From e1f9bb3cd0bbe8cd902ca91ab4698fb9c21b7285 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Mon, 29 Apr 2019 17:50:46 +0200 Subject: [PATCH] reinstaled drupal core using composer-drupal/drupal-project --- .env.example | 27 + .eslintrc | 3 - .gitignore | 65 +- .../dev/devel/css/devel-rtl.css => .gitkeep | 0 .travis.yml | 52 + ...geFormatter-to-localized-single-date.patch | 35 - .../contrib/admin/domain/LICENSE => LICENSE | 8 +- PATCHES.md | 8 - README.md | 145 + README.txt | 139 - composer.json | 130 +- composer.lock | 1022 ++++-- core/.env.example | 77 - core/.eslintignore | 7 - core/.eslintrc.json | 45 - core/.eslintrc.legacy.json | 94 - core/.eslintrc.passing.json | 15 - core/.gitignore | 21 - core/.prettierignore | 1 - core/.prettierrc.json | 6 - core/.stylelintrc.json | 40 - drush/Commands/PolicyCommands.php | 38 + drush/README.md | 1 + drush/drush.yml | 6 + drush/sites/self.site.yml | 14 + example.gitignore | 39 - load.environment.php | 20 + modules/README.txt | 42 - phpunit.xml.dist | 15 + profiles/README.txt | 28 - scripts/composer/ScriptHandler.php | 100 + .../contrib/admin/admin_toolbar/CHANGELOG.txt | 382 --- .../contrib/admin/admin_toolbar/README.txt | 69 - .../admin_toolbar/admin_toolbar.info.yml | 15 - .../admin/admin_toolbar/admin_toolbar.install | 16 - .../admin_toolbar/admin_toolbar.libraries.yml | 10 - .../admin/admin_toolbar/admin_toolbar.module | 97 - .../README.txt | 53 - ...admin_toolbar_links_access_filter.info.yml | 15 - .../admin_toolbar_links_access_filter.module | 200 -- .../composer.json | 38 - .../admin_toolbar_tools/README.txt | 62 - .../admin_toolbar_tools.info.yml | 16 - .../admin_toolbar_tools.libraries.yml | 4 - .../admin_toolbar_tools.links.menu.yml | 76 - .../admin_toolbar_tools.module | 702 ----- .../admin_toolbar_tools.routing.yml | 80 - .../admin_toolbar_tools/composer.json | 39 - .../admin_toolbar_tools/css/tools.css | 16 - .../misc/icons/ffffff/d8-item.svg | 1 - .../src/Controller/ToolbarController.php | 249 -- .../Functional/AdminToolbarToolsAlterTest.php | 54 - .../contrib/admin/admin_toolbar/composer.json | 35 - .../admin/admin_toolbar/css/admin.toolbar.css | 211 -- .../admin/admin_toolbar/js/admin_toolbar.js | 53 - .../admin_toolbar/js/jquery.hoverIntent.js | 158 - .../misc/icons/0074bd/chevron-left.svg | 1 - .../misc/icons/0074bd/chevron-right.svg | 1 - .../misc/icons/ffffff/chevron-right.svg | 1 - .../src/Functional/AdminToolbarAlterTest.php | 54 - .../admin/adminimal_admin_toolbar/LICENSE.txt | 339 -- .../admin/adminimal_admin_toolbar/README.txt | 20 - .../adminimal_admin_toolbar.info.yml | 13 - .../adminimal_admin_toolbar.libraries.yml | 5 - .../adminimal_admin_toolbar.module | 48 - .../adminimal_admin_toolbar/composer.json | 27 - .../css/adminimal_admin_toolbar.css | 440 --- .../images/0084d7/chevron-right.svg | 1 - .../images/acacac/barchart.svg | 1 - .../images/acacac/chevron-disc-down.svg | 1 - .../acacac/chevron-outline-disc-close.svg | 27 - .../acacac/chevron-outline-disc-close0.svg | 27 - .../acacac/chevron-outline-disc-down.svg | 26 - .../acacac/chevron-outline-disc-down0.svg | 26 - .../images/acacac/chevron-right.svg | 1 - .../images/acacac/drupal-8.svg | 24 - .../images/acacac/file.svg | 1 - .../images/acacac/orgchart.svg | 1 - .../images/acacac/paintbrush.svg | 1 - .../images/acacac/pencil.svg | 1 - .../images/acacac/people.svg | 1 - .../images/acacac/puzzlepiece.svg | 1 - .../images/acacac/questionmark-disc.svg | 1 - .../images/acacac/wrench.svg | 1 - .../ffcfcf/chevron-outline-disc-close.svg | 27 - .../images/ffffff/barchart.svg | 1 - .../images/ffffff/chevron-disc-down.svg | 1 - .../ffffff/chevron-outline-disc-close.svg | 27 - .../ffffff/chevron-outline-disc-down.svg | 26 - .../images/ffffff/chevron-right.svg | 1 - .../images/ffffff/drupal-8.svg | 24 - .../images/ffffff/file.svg | 1 - .../images/ffffff/orgchart.svg | 1 - .../images/ffffff/paintbrush.svg | 1 - .../images/ffffff/pencil.svg | 1 - .../images/ffffff/people.svg | 1 - .../images/ffffff/puzzlepiece.svg | 1 - .../images/ffffff/questionmark-disc.svg | 1 - .../images/ffffff/wrench.svg | 1 - .../contrib/admin/better_messages/LICENSE.txt | 339 -- .../better_messages/better_messages.info.yml | 12 - .../better_messages.libraries.yml | 14 - .../better_messages.links.menu.yml | 5 - .../better_messages/better_messages.module | 138 - .../better_messages.permissions.yml | 3 - .../better_messages.routing.yml | 7 - .../better_messages.services.yml | 5 - .../admin/better_messages/composer.json | 5 - .../install/better_messages.settings.yml | 20 - .../config/schema/better_messages.schema.yml | 70 - .../condition.plugin.message_type.schema.yml | 9 - .../css/better_messages-rtl.css | 7 - .../better_messages/css/better_messages.css | 54 - .../better_messages/images/closelabel.gif | Bin 687 -> 0 bytes .../better_messages/js/better_messages.js | 124 - .../src/ContextProvider/MessagesContext.php | 82 - .../src/Form/BetterMessagesSettingsForm.php | 356 --- .../src/Plugin/Condition/MessageType.php | 92 - .../better-messages-wrapper.html.twig | 24 - .../contrib/admin/bulkdelete/LICENSE.txt | 339 -- .../contrib/admin/bulkdelete/README.txt | 31 - .../admin/bulkdelete/bulkdelete.info.yml | 11 - .../bulkdelete/bulkdelete.links.task.yml | 6 - .../admin/bulkdelete/bulkdelete.module | 24 - .../bulkdelete/bulkdelete.permissions.yml | 4 - .../admin/bulkdelete/bulkdelete.routing.yml | 8 - .../bulkdelete/src/Form/BulkDeleteForm.php | 154 - .../contrib/admin/config_update/LICENSE.txt | 339 -- .../contrib/admin/config_update/README.txt | 13 - .../config_update/config_update.info.yml | 12 - .../admin/config_update/config_update.module | 21 - .../config_update/config_update.services.yml | 20 - .../config_update/config_update_ui/README.txt | 173 - .../config_update_ui.drush.inc | 356 --- .../config_update_ui.drush_testing.inc | 31 - .../config_update_ui.info.yml | 14 - .../config_update_ui.libraries.yml | 5 - .../config_update_ui.links.task.yml | 5 - .../config_update_ui/config_update_ui.module | 54 - .../config_update_ui.permissions.yml | 8 - .../config_update_ui.routing.yml | 43 - .../css/config_update_ui.report.css | 13 - .../src/Controller/ConfigUpdateController.php | 656 ---- .../src/Form/ConfigDeleteConfirmForm.php | 144 - .../src/Form/ConfigImportConfirmForm.php | 146 - .../src/Form/ConfigRevertConfirmForm.php | 146 - .../Functional/ConfigProfileOverridesTest.php | 101 - .../tests/src/Functional/ConfigUpdateTest.php | 544 ---- .../contrib/admin/config_update/drupalci.yml | 37 - .../src/ConfigDeleteInterface.php | 37 - .../config_update/src/ConfigDiffInterface.php | 46 - .../admin/config_update/src/ConfigDiffer.php | 195 -- .../src/ConfigListByProviderInterface.php | 37 - .../config_update/src/ConfigListInterface.php | 74 - .../admin/config_update/src/ConfigLister.php | 251 -- .../src/ConfigListerWithProviders.php | 148 - .../config_update/src/ConfigRevertEvent.php | 66 - .../src/ConfigRevertInterface.php | 96 - .../config_update/src/ConfigReverter.php | 249 -- .../tests/src/Unit/ConfigDifferTest.php | 362 --- .../tests/src/Unit/ConfigListerTest.php | 293 -- .../tests/src/Unit/ConfigReverterTest.php | 356 --- .../src/Unit/ConfigUpdateUnitTestBase.php | 547 ---- .../contrib/admin/context/.editorconfig | 17 - .../modules/contrib/admin/context/.gitignore | 1 - .../modules/contrib/admin/context/.travis.yml | 41 - .../contrib/admin/context/CHANGELOG.md | 4 - .../contrib/admin/context/CONTRIBUTING.md | 3 - .../all/modules/contrib/admin/context/LICENSE | 22 - .../modules/contrib/admin/context/LICENSE.txt | 339 -- .../modules/contrib/admin/context/README.md | 23 - .../contrib/admin/context/composer.json | 21 - .../contrib/admin/context/context.info.yml | 11 - .../contrib/admin/context/context.install | 43 - .../contrib/admin/context/context.module | 75 - .../contrib/admin/context/context.routing.yml | 8 - .../admin/context/context.services.yml | 16 - .../context_ui/assets/js/context_ui.admin.js | 69 - .../modules/context_ui/context_ui.info.yml | 16 - .../context_ui/context_ui.libraries.yml | 7 - .../context_ui/context_ui.links.action.yml | 5 - .../context_ui.links.contextual.yml | 4 - .../context_ui/context_ui.links.menu.yml | 5 - .../context_ui/context_ui.permissions.yml | 3 - .../modules/context_ui/context_ui.routing.yml | 137 - .../context_ui/src/ContextListBuilder.php | 263 -- .../src/Controller/ContextUIController.php | 395 --- .../src/Form/ConditionDeleteForm.php | 142 - .../context_ui/src/Form/ContextAddForm.php | 30 - .../context_ui/src/Form/ContextDeleteForm.php | 79 - .../src/Form/ContextDisableForm.php | 89 - .../context_ui/src/Form/ContextEditForm.php | 268 -- .../context_ui/src/Form/ContextFormBase.php | 230 -- .../src/Form/ReactionDeleteForm.php | 143 - .../admin/context/src/ContextInterface.php | 215 -- .../admin/context/src/ContextManager.php | 360 --- .../context/src/ContextMenuActiveTrail.php | 51 - .../context/src/ContextReactionInterface.php | 25 - .../context/src/ContextReactionManager.php | 21 - .../context/src/ContextReactionPluginBase.php | 68 - .../context/src/ContextServiceProvider.php | 23 - .../admin/context/src/Entity/Context.php | 376 --- .../context/src/Entity/ContextAccess.php | 45 - .../BlockPageDisplayVariantSubscriber.php | 60 - .../admin/context/src/Form/AjaxFormTrait.php | 49 - .../Plugin/Condition/RequestPathExclusion.php | 36 - .../src/Plugin/ContextReaction/Blocks.php | 681 ---- .../src/Plugin/ContextReaction/BodyClass.php | 66 - .../src/Plugin/ContextReaction/Menu.php | 91 - .../PageTemplateSuggestions.php | 55 - .../src/Plugin/ContextReaction/Regions.php | 170 - .../src/Plugin/ContextReaction/Theme.php | 105 - .../ContextReactionPluginCollection.php | 17 - .../ContextBlockPageVariant.php | 133 - .../Reaction/Annotation/ContextReaction.php | 48 - .../src/Reaction/Blocks/BlockCollection.php | 69 - .../ContextReactionBlocksController.php | 210 -- .../src/Reaction/Blocks/Form/BlockAddForm.php | 30 - .../Reaction/Blocks/Form/BlockDeleteForm.php | 151 - .../Reaction/Blocks/Form/BlockEditForm.php | 28 - .../Reaction/Blocks/Form/BlockFormBase.php | 343 -- .../src/Reaction/ContextReactionFormBase.php | 67 - .../src/Theme/ThemeSwitcherNegotiator.php | 55 - .../modules/contrib/admin/domain/.travis.yml | 96 - .../modules/contrib/admin/domain/CHANGELOG.md | 134 - .../modules/contrib/admin/domain/LICENSE.txt | 339 -- .../modules/contrib/admin/domain/README.md | 222 -- .../contrib/admin/domain/composer.json | 26 - .../domain/config/install/domain.settings.yml | 4 - ...eld.field.user.user.field_domain_admin.yml | 24 - .../field.storage.user.field_domain_admin.yml | 19 - .../system.action.domain_default_action.yml | 10 - .../system.action.domain_delete_action.yml | 10 - .../system.action.domain_disable_action.yml | 10 - .../system.action.domain_enable_action.yml | 10 - .../domain/config/schema/domain.schema.yml | 95 - .../admin/domain/domain/domain.api.php | 138 - .../admin/domain/domain/domain.drush.inc | 634 ---- .../admin/domain/domain/domain.info.yml | 16 - .../admin/domain/domain/domain.install | 36 - .../admin/domain/domain/domain.libraries.yml | 7 - .../domain/domain/domain.links.action.yml | 5 - .../admin/domain/domain/domain.links.menu.yml | 18 - .../admin/domain/domain/domain.links.task.yml | 8 - .../contrib/admin/domain/domain/domain.module | 177 -- .../domain/domain/domain.permissions.yml | 32 - .../admin/domain/domain/domain.routing.yml | 55 - .../admin/domain/domain/domain.services.yml | 41 - .../admin/domain/domain/drush.services.yml | 5 - .../contrib/admin/domain/domain/js/domain.js | 42 - .../domain/domain/migrations/d7_domain.yml | 18 - .../domain/src/Access/DomainAccessCheck.php | 92 - .../domain/src/Access/DomainListCheck.php | 29 - .../domain/src/Access/DomainRouteCheck.php | 81 - .../src/Commands/DomainCommandException.php | 10 - .../domain/src/Commands/DomainCommands.php | 1368 -------- .../ContextProvider/CurrentDomainContext.php | 66 - .../src/Controller/DomainController.php | 76 - .../src/Controller/DomainControllerBase.php | 58 - .../domain/src/DomainAccessControlHandler.php | 119 - .../admin/domain/domain/src/DomainCreator.php | 81 - .../domain/src/DomainCreatorInterface.php | 48 - .../domain/src/DomainElementManager.php | 217 -- .../src/DomainElementManagerInterface.php | 105 - .../admin/domain/domain/src/DomainForm.php | 221 -- .../domain/domain/src/DomainInterface.php | 239 -- .../domain/domain/src/DomainListBuilder.php | 357 --- .../admin/domain/domain/src/DomainLoader.php | 163 - .../domain/src/DomainLoaderInterface.php | 119 - .../domain/domain/src/DomainNegotiator.php | 231 -- .../domain/src/DomainNegotiatorInterface.php | 93 - .../domain/src/DomainRedirectResponse.php | 179 -- .../admin/domain/domain/src/DomainStorage.php | 202 -- .../domain/src/DomainStorageInterface.php | 124 - .../admin/domain/domain/src/DomainToken.php | 186 -- .../domain/domain/src/DomainValidator.php | 152 - .../domain/src/DomainValidatorInterface.php | 45 - .../admin/domain/domain/src/Entity/Domain.php | 570 ---- .../src/EventSubscriber/DomainSubscriber.php | 140 - .../domain/src/Form/DomainDeleteForm.php | 45 - .../domain/src/Form/DomainSettingsForm.php | 97 - .../src/Plugin/Action/DefaultDomain.php | 47 - .../domain/src/Plugin/Action/DeleteDomain.php | 47 - .../src/Plugin/Action/DisableDomain.php | 47 - .../domain/src/Plugin/Action/EnableDomain.php | 47 - .../src/Plugin/Block/DomainBlockBase.php | 20 - .../src/Plugin/Block/DomainNavBlock.php | 217 -- .../src/Plugin/Block/DomainServerBlock.php | 144 - .../src/Plugin/Block/DomainSwitcherBlock.php | 50 - .../src/Plugin/Block/DomainTokenBlock.php | 81 - .../domain/src/Plugin/Condition/Domain.php | 150 - .../DomainAdminSelection.php | 34 - .../DomainSelection.php | 114 - .../Plugin/migrate/source/d7/DomainRecord.php | 57 - .../domain/src/Plugin/views/access/Domain.php | 188 -- .../domain/src/Tests/DomainTestBase.php | 105 - .../templates/domain-nav-block.html.twig | 32 - .../contrib/admin/domain/domain/tests/200.png | Bin 593 -> 0 bytes .../config/install/domain.record.drupal.yml | 10 - .../domain_config_schema_test.info.yml | 16 - .../views.view.domain_views_access.yml | 172 - .../modules/domain_test/domain_test.info.yml | 16 - .../modules/domain_test/domain_test.module | 60 - .../Condition/DomainConditionTest.php | 88 - .../src/Functional/DomainActionsTest.php | 100 - .../src/Functional/DomainAdminElementTest.php | 140 - .../tests/src/Functional/DomainCSSTest.php | 79 - .../Functional/DomainCheckResponseTest.php | 57 - .../tests/src/Functional/DomainCreateTest.php | 61 - .../Functional/DomainEntityReferenceTest.php | 156 - .../tests/src/Functional/DomainFormsTest.php | 82 - .../src/Functional/DomainGetResponseTest.php | 42 - .../src/Functional/DomainInactiveTest.php | 98 - .../src/Functional/DomainListBuilderTest.php | 211 -- .../src/Functional/DomainListWeightTest.php | 109 - .../src/Functional/DomainNavBlockTest.php | 97 - .../src/Functional/DomainNegotiatorTest.php | 45 - .../src/Functional/DomainReferencesTest.php | 220 -- .../tests/src/Functional/DomainTestBase.php | 232 -- .../tests/src/Functional/DomainTokenTest.php | 75 - .../src/Functional/DomainValidatorTest.php | 99 - .../src/Functional/DomainViewsAccessTest.php | 84 - .../tests/src/Kernel/DomainConfigTest.php | 39 - .../tests/src/Kernel/DomainHookTest.php | 168 - .../src/Kernel/DomainVariableSchemeTest.php | 76 - .../tests/src/Traits/DomainTestTrait.php | 168 - .../config/install/domain_access.settings.yml | 1 - ...field.storage.node.field_domain_access.yml | 22 - ...orage.node.field_domain_all_affiliates.yml | 21 - ...field.storage.user.field_domain_access.yml | 22 - ...orage.user.field_domain_all_affiliates.yml | 21 - ...system.action.domain_access_all_action.yml | 10 - ...m.action.domain_access_edit_all_action.yml | 10 - ....action.domain_access_edit_none_action.yml | 10 - ...ystem.action.domain_access_none_action.yml | 10 - .../config/schema/domain_access.schema.yml | 50 - .../schema/domain_access.views.schema.yml | 63 - .../domain_access/domain_access.info.yml | 15 - .../domain_access/domain_access.install | 46 - .../domain_access.links.menu.yml | 6 - .../domain_access.links.task.yml | 4 - .../domain/domain_access/domain_access.module | 746 ----- .../domain_access.permissions.yml | 2 - .../domain_access/domain_access.routing.yml | 7 - .../domain_access/domain_access.services.yml | 9 - .../domain/domain_access/drush.services.yml | 5 - .../src/Access/DomainAccessViewsAccess.php | 105 - .../src/Commands/DomainAccessCommands.php | 79 - .../domain_access/src/DomainAccessManager.php | 203 -- .../src/DomainAccessManagerInterface.php | 95 - .../src/DomainAccessPermissions.php | 86 - .../src/Form/DomainAccessSettingsForm.php | 66 - .../Plugin/Action/DomainAccessActionBase.php | 100 - .../src/Plugin/Action/DomainAccessAdd.php | 31 - .../Plugin/Action/DomainAccessAddEditor.php | 31 - .../src/Plugin/Action/DomainAccessAll.php | 24 - .../src/Plugin/Action/DomainAccessEditAll.php | 24 - .../Plugin/Action/DomainAccessEditNone.php | 24 - .../src/Plugin/Action/DomainAccessNone.php | 24 - .../src/Plugin/Action/DomainAccessRemove.php | 31 - .../Action/DomainAccessRemoveEditor.php | 31 - .../views/access/DomainAccessContent.php | 170 - .../views/access/DomainAccessEditor.php | 30 - .../views/argument/DomainAccessArgument.php | 24 - .../Plugin/views/field/DomainAccessField.php | 50 - .../filter/DomainAccessCurrentAllFilter.php | 73 - .../views/filter/DomainAccessFilter.php | 26 - ...rage.taxonomy_term.field_domain_access.yml | 19 - ...onomy_term.field_domain_all_affiliates.yml | 18 - .../domain_access_test.info.yml | 18 - .../DomainAccessAllAffiliatesTest.php | 103 - .../DomainAccessContentUrlsTest.php | 84 - .../DomainAccessDefaultValueTest.php | 99 - .../Functional/DomainAccessElementTest.php | 151 - .../DomainAccessEntityFieldTest.php | 79 - .../DomainAccessEntityReferenceTest.php | 98 - .../src/Functional/DomainAccessFieldTest.php | 198 -- .../src/Functional/DomainAccessGrantsTest.php | 88 - .../DomainAccessLanguageSaveTest.php | 89 - .../DomainAccessPermissionsTest.php | 300 -- .../Functional/DomainAccessRecordsTest.php | 80 - .../src/Functional/DomainAccessSaveTest.php | 76 - .../admin/domain/domain_alias/README.md | 182 -- .../config/install/domain_alias.settings.yml | 6 - .../config/schema/domain_alias.schema.yml | 34 - .../domain/domain_alias/domain_alias.info.yml | 14 - .../domain/domain_alias/domain_alias.install | 33 - .../domain_alias.links.action.yml | 5 - .../domain_alias/domain_alias.links.task.yml | 4 - .../domain/domain_alias/domain_alias.module | 169 - .../domain_alias/domain_alias.permissions.yml | 14 - .../domain_alias/domain_alias.routing.yml | 34 - .../domain_alias/domain_alias.services.yml | 8 - .../src/Controller/DomainAliasController.php | 48 - .../src/DomainAliasAccessControlHandler.php | 46 - .../domain_alias/src/DomainAliasForm.php | 239 -- .../domain_alias/src/DomainAliasInterface.php | 44 - .../src/DomainAliasListBuilder.php | 103 - .../domain_alias/src/DomainAliasLoader.php | 260 -- .../src/DomainAliasLoaderInterface.php | 104 - .../domain_alias/src/DomainAliasStorage.php | 250 -- .../src/DomainAliasStorageInterface.php | 76 - .../domain_alias/src/DomainAliasValidator.php | 125 - .../src/DomainAliasValidatorInterface.php | 21 - .../domain_alias/src/Entity/DomainAlias.php | 138 - .../src/Form/DomainAliasDeleteForm.php | 22 - .../src/Tests/DomainAliasTestBase.php | 26 - .../src/Functional/DomainAliasActionsTest.php | 137 - .../Functional/DomainAliasEnvironmentTest.php | 95 - .../Functional/DomainAliasListBuilderTest.php | 101 - .../DomainAliasListHostnameTest.php | 83 - .../Functional/DomainAliasNegotiatorTest.php | 110 - .../src/Functional/DomainAliasSortTest.php | 82 - .../src/Functional/DomainAliasTestBase.php | 22 - .../Functional/DomainAliasValidatorTest.php | 86 - .../Functional/DomainAliasWildcardTest.php | 87 - .../Kernel/DomainAliasDomainDeleteTest.php | 86 - .../tests/src/Traits/DomainAliasTestTrait.php | 67 - .../admin/domain/domain_config/README.md | 121 - .../domain_config/domain_config.info.yml | 14 - .../domain/domain_config/domain_config.module | 6 - .../domain_config/domain_config.services.yml | 15 - .../DomainConfigLibraryDiscoveryCollector.php | 47 - .../src/DomainConfigOverrider.php | 221 -- .../src/DomainConfigServiceProvider.php | 38 - .../src/Routing/DomainRouteProvider.php | 38 - .../src/Tests/DomainConfigTestBase.php | 77 - .../domain_config_hook_test.info.yml | 24 - .../domain_config_hook_test.module | 23 - .../domain_config_hook_test.services.yml | 7 - .../RequestPolicy/PageCacheRequestPolicy.php | 47 - ...domain_config_middleware_test.settings.yml | 1 - .../domain_config_middleware_test.schema.yml | 8 - .../domain_config_middleware_test.info.yml | 17 - ...domain_config_middleware_test.services.yml | 8 - .../src/Middleware.php | 51 - ...in.config.four_example_com.system.site.yml | 3 - ....config.one_example_com.en.system.site.yml | 10 - ...onfig.three_example_com.en.system.site.yml | 9 - ....config.two_example_com.en.system.site.yml | 10 - ....config.two_example_com.es.system.site.yml | 10 - .../domain_config_test.info.yml | 17 - .../domain_config_test.module | 30 - .../Functional/DomainConfigAlterHookTest.php | 74 - .../Functional/DomainConfigHomepageTest.php | 71 - .../DomainConfigHookProblemTest.php | 30 - .../src/Functional/DomainConfigHookTest.php | 42 - .../Functional/DomainConfigOverriderTest.php | 112 - .../src/Functional/DomainConfigTestBase.php | 73 - .../views.view.affiliated_content.yml | 1298 -------- .../views.view.affiliated_editors.yml | 1454 --------- .../schema/domain_content.views.schema.yml | 8 - .../domain_content/domain_content.info.yml | 18 - .../domain_content/domain_content.install | 58 - .../domain_content.links.menu.yml | 12 - .../domain_content/domain_content.module | 40 - .../domain_content.permissions.yml | 4 - .../domain_content/domain_content.routing.yml | 14 - .../Controller/DomainContentController.php | 124 - .../views/access/DomainContentAccess.php | 30 - .../views/access/DomainEditorAccess.php | 30 - .../Functional/DomainContentActionsTest.php | 83 - .../src/Functional/DomainContentCountTest.php | 52 - .../DomainContentPermissionsTest.php | 176 -- .../src/Functional/DomainContentTestBase.php | 111 - .../admin/domain/domain_source/README.md | 58 - .../config/install/domain_source.settings.yml | 1 - ...field.storage.node.field_domain_source.yml | 22 - .../config/schema/domain_source.schema.yml | 10 - .../schema/domain_source.views.schema.yml | 9 - .../domain_source/domain_source.api.php | 65 - .../domain_source/domain_source.info.yml | 15 - .../domain_source/domain_source.install | 30 - .../domain_source/domain_source.libraries.yml | 7 - .../domain_source.links.menu.yml | 6 - .../domain_source.links.task.yml | 4 - .../domain/domain_source/domain_source.module | 302 -- .../domain_source/domain_source.routing.yml | 7 - .../domain_source/domain_source.services.yml | 9 - .../domain/domain_source/drush.services.yml | 5 - .../domain/domain_source/js/domain_source.js | 59 - .../src/Commands/DomainSourceCommands.php | 79 - .../src/DomainSourceElementManager.php | 28 - .../src/DomainSourceServiceProvider.php | 21 - ...DomainSourceRedirectResponseSubscriber.php | 68 - .../src/Form/DomainSourceSettingsForm.php | 66 - .../HttpKernel/DomainSourcePathProcessor.php | 294 -- .../src/Plugin/views/field/DomainSource.php | 50 - .../src/Plugin/views/filter/DomainSource.php | 42 - .../views.view.domain_format_test.yml | 212 -- .../domain_source_test.info.yml | 21 - .../domain_source_test.module | 13 - .../DomainSourceContentUrlsTest.php | 83 - .../Functional/DomainSourceElementTest.php | 184 -- .../DomainSourceEntityReferenceTest.php | 174 - .../Functional/DomainSourceExcludeTest.php | 98 - .../Functional/DomainSourceLanguageTest.php | 127 - .../Functional/DomainSourceParameterTest.php | 54 - .../DomainSourceTrustedHostTest.php | 84 - .../src/Functional/DomainSourceUrlTest.php | 70 - .../admin/domain_menu_access/LICENSE.txt | 339 -- .../install/domain_menu_access.settings.yml | 1 - ....menu_link_content.field_domain_access.yml | 19 - ...nk_content.field_domain_all_affiliates.yml | 18 - .../schema/domain_menu_access.scheme.yml | 3 - .../domain_menu_access.info.yml | 14 - .../domain_menu_access.install | 38 - .../domain_menu_access.links.menu.yml | 6 - .../domain_menu_access.links.task.yml | 4 - .../domain_menu_access.module | 54 - .../domain_menu_access.routing.yml | 7 - .../domain_menu_access.services.yml | 4 - .../src/Form/DomainMenuAccessSettingsForm.php | 78 - .../Menu/DomainMenuLinkTreeManipulators.php | 194 -- .../Block/DomainMenuAccessMenuBlock.php | 81 - .../Derivative/DomainMenuAccessMenuBlock.php | 65 - .../domain_site_settings/2930391-21.patch | 58 - .../admin/domain_site_settings/LICENSE.txt | 339 -- .../admin/domain_site_settings/README.md | 21 - .../admin/domain_site_settings/composer.json | 14 - ...ain_site_settings.domainconfigsettings.yml | 1 - .../domain_site_settings.info.yml | 16 - .../domain_site_settings.links.menu.yml | 6 - .../domain_site_settings.links.task.yml | 4 - .../domain_site_settings.permissions.yml | 3 - .../domain_site_settings.routing.yml | 18 - .../domain_site_settings.services.yml | 6 - .../Configuration/DomainConfigOverride.php | 131 - .../DomainSiteSettingsController.php | 84 - .../src/Form/DomainConfigSettingsForm.php | 235 -- .../src/Tests/LoadTest.php | 46 - .../contrib/admin/features/LICENSE.txt | 339 -- .../contrib/admin/features/composer.json | 17 - .../install/features.bundle.default.yml | 98 - .../config/install/features.settings.yml | 3 - .../config/schema/features.schema.yml | 188 -- .../contrib/admin/features/drush.services.yml | 11 - .../admin/features/drush/features.drush8.inc | 912 ------ .../contrib/admin/features/features.info.yml | 14 - .../contrib/admin/features/features.install | 31 - .../contrib/admin/features/features.module | 56 - .../admin/features/features.routing.yml | 6 - .../admin/features/features.services.yml | 38 - .../features_ui/css/features_ui.admin.css | 283 -- .../modules/features_ui/features_ui.admin.inc | 175 -- .../modules/features_ui/features_ui.info.yml | 14 - .../features_ui/features_ui.libraries.yml | 11 - .../features_ui/features_ui.links.action.yml | 5 - .../features_ui/features_ui.links.menu.yml | 5 - .../features_ui/features_ui.links.task.yml | 14 - .../modules/features_ui/features_ui.module | 55 - .../features_ui/features_ui.routing.yml | 104 - .../features_ui/js/features_ui.admin.js | 401 --- .../src/Controller/FeaturesUIController.php | 193 -- .../src/Form/AssignmentAlterForm.php | 76 - .../src/Form/AssignmentBaseForm.php | 61 - .../src/Form/AssignmentConfigureForm.php | 445 --- .../src/Form/AssignmentCoreForm.php | 54 - .../src/Form/AssignmentExcludeForm.php | 131 - .../src/Form/AssignmentFormBase.php | 176 -- .../src/Form/AssignmentOptionalForm.php | 54 - .../src/Form/AssignmentProfileForm.php | 88 - .../src/Form/AssignmentSiteForm.php | 54 - .../features_ui/src/Form/FeaturesDiffForm.php | 270 -- .../features_ui/src/Form/FeaturesEditForm.php | 1091 ------- .../src/Form/FeaturesExportForm.php | 561 ---- .../src/Tests/FeaturesBundleUITest.php | 188 -- .../src/Tests/FeaturesCreateUITest.php | 184 -- .../features_ui/src/Tests/FeaturesUITest.php | 49 - .../src/Commands/FeaturesCommands.php | 1053 ------- .../admin/features/src/ConfigurationItem.php | 351 --- .../src/Controller/FeaturesController.php | 77 - .../features/src/Entity/FeaturesBundle.php | 310 -- .../src/Exception/DomainException.php | 7 - .../Exception/InvalidArgumentException.php | 7 - .../admin/features/src/FeaturesAssigner.php | 446 --- .../src/FeaturesAssignerInterface.php | 228 -- .../src/FeaturesAssignmentMethodBase.php | 124 - .../src/FeaturesAssignmentMethodInterface.php | 56 - .../src/FeaturesAssignmentMethodManager.php | 32 - .../features/src/FeaturesBundleInterface.php | 240 -- .../src/FeaturesConfigDependencyManager.php | 59 - .../features/src/FeaturesConfigInstaller.php | 109 - .../src/FeaturesExtensionStorages.php | 121 - .../FeaturesExtensionStoragesByDirectory.php | 24 - ...sExtensionStoragesByDirectoryInterface.php | 26 - .../FeaturesExtensionStoragesInterface.php | 87 - .../src/FeaturesGenerationMethodBase.php | 111 - .../src/FeaturesGenerationMethodInterface.php | 67 - .../src/FeaturesGenerationMethodManager.php | 33 - .../admin/features/src/FeaturesGenerator.php | 173 - .../src/FeaturesGeneratorInterface.php | 103 - .../features/src/FeaturesInstallStorage.php | 163 - .../admin/features/src/FeaturesManager.php | 1399 --------- .../features/src/FeaturesManagerInterface.php | 647 ---- .../contrib/admin/features/src/Package.php | 562 ---- .../FeaturesAssignmentAlter.php | 63 - .../FeaturesAssignmentBaseType.php | 68 - .../FeaturesAssignmentCoreType.php | 37 - .../FeaturesAssignmentDependency.php | 26 - .../FeaturesAssignmentExclude.php | 149 - .../FeaturesAssignmentExisting.php | 58 - .../FeaturesAssignmentForwardDependency.php | 78 - .../FeaturesAssignmentNamespace.php | 38 - .../FeaturesAssignmentOptionalType.php | 33 - .../FeaturesAssignmentPackages.php | 53 - .../FeaturesAssignmentProfile.php | 177 -- .../FeaturesAssignmentSiteType.php | 36 - .../FeaturesGenerationArchive.php | 292 -- .../FeaturesGenerationWrite.php | 237 -- .../config/install/core.date_format.short.yml | 7 - .../config/install/system.cron.yml | 3 - .../test_feature/test_feature.features.yml | 3 - .../test_feature/test_feature.info.yml | 13 - .../config/install/core.date_format.long.yml | 7 - .../test_mybundle_core.features.yml | 5 - .../test_mybundle_core.info.yml | 13 - .../Entity/FeaturesBundleIntegrationTest.php | 82 - .../tests/src/Kernel/FeaturesAssignTest.php | 855 ----- .../tests/src/Kernel/FeaturesAssignerTest.php | 67 - .../tests/src/Kernel/FeaturesGenerateTest.php | 210 -- .../src/Kernel/FeaturesManagerKernelTest.php | 103 - .../tests/src/Unit/ConfigurationItemTest.php | 21 - .../tests/src/Unit/FeaturesBundleTest.php | 206 -- .../tests/src/Unit/FeaturesManagerTest.php | 989 ------ .../features/tests/src/Unit/PackageTest.php | 53 - .../contrib/admin/filter_perms/LICENSE.txt | 339 -- .../admin/filter_perms/filter_perms.info.yml | 13 - .../filter_perms/filter_perms.services.yml | 5 - .../filter_perms/src/Form/PermissionsForm.php | 261 -- .../src/Form/PermissionsRoleSpecificForm.php | 24 - .../src/Routing/RouteSubscriber.php | 25 - .../admin/login_destination/LICENSE.txt | 339 -- .../admin/login_destination/README.txt | 31 - .../admin/login_destination/composer.json | 5 - .../install/login_destination.settings.yml | 2 - .../schema/login_destination.schema.yml | 34 - .../schema/login_destination.settings.yml | 10 - .../login_destination.info.yml | 12 - .../login_destination.links.action.yml | 5 - .../login_destination.links.menu.yml | 6 - .../login_destination.links.task.yml | 9 - .../login_destination.module | 148 - .../login_destination.permissions.yml | 2 - .../login_destination.routing.yml | 40 - .../login_destination.services.yml | 4 - .../LoginDestinationListBuilder.php | 92 - .../src/Entity/LoginDestination.php | 349 --- .../Form/LoginDestinationDeleteRuleForm.php | 52 - .../src/Form/LoginDestinationRuleForm.php | 301 -- .../src/Form/LoginDestinationSettingsForm.php | 60 - .../src/LoginDestinationInterface.php | 117 - .../src/LoginDestinationManager.php | 189 -- .../src/LoginDestinationManagerInterface.php | 33 - .../modules/contrib/admin/matomo/.eslintrc | 5 - .../modules/contrib/admin/matomo/LICENSE.txt | 339 -- .../modules/contrib/admin/matomo/README.txt | 109 - .../contrib/admin/matomo/composer.json | 24 - .../matomo/config/install/matomo.settings.yml | 29 - .../matomo/config/schema/matomo.schema.yml | 120 - .../contrib/admin/matomo/js/matomo.admin.js | 141 - .../modules/contrib/admin/matomo/js/matomo.js | 41 - .../contrib/admin/matomo/matomo.info.yml | 17 - .../contrib/admin/matomo/matomo.install | 55 - .../contrib/admin/matomo/matomo.libraries.yml | 15 - .../admin/matomo/matomo.links.menu.yml | 5 - .../admin/matomo/matomo.links.task.yml | 4 - .../contrib/admin/matomo/matomo.module | 729 ----- .../admin/matomo/matomo.permissions.yml | 14 - .../contrib/admin/matomo/matomo.routing.yml | 7 - .../contrib/admin/matomo/matomo.tokens.inc | 60 - .../matomo/migrations/d6_matomo_settings.yml | 70 - .../migrations/d6_matomo_user_settings.yml | 22 - .../matomo/migrations/d7_matomo_settings.yml | 77 - .../migrations/d7_matomo_user_settings.yml | 22 - .../Render/MatomoJavaScriptSnippet.php | 43 - .../src/Form/MatomoAdminSettingsForm.php | 752 ----- .../admin/matomo/src/MatomoInterface.php | 15 - .../migrate/process/MatomoCustomVars.php | 27 - .../migrate/process/MatomoVisibilityPages.php | 113 - .../migrate/process/MatomoVisibilityRoles.php | 87 - .../matomo/src/Tests/MatomoBasicTest.php | 222 -- .../matomo/src/Tests/MatomoCustomUrls.php | 59 - .../src/Tests/MatomoCustomVariablesTest.php | 133 - .../src/Tests/MatomoPhpFilterTest.php.php | 107 - .../matomo/src/Tests/MatomoRolesTest.php | 107 - .../matomo/src/Tests/MatomoSearchTest.php | 97 - .../src/Tests/MatomoStatusMessagesTest.php | 73 - .../matomo/src/Tests/MatomoUninstallTest.php | 78 - .../matomo/src/Tests/MatomoUserFieldsTest.php | 73 - .../modules/matomo_test/matomo_test.info.yml | 11 - .../matomo_test/matomo_test.routing.yml | 7 - .../src/Controller/MatomoTestController.php | 28 - .../src/Functional/AdminSettingsFormTest.php | 103 - .../admin/menu_admin_per_menu/LICENSE.txt | 339 -- .../admin/menu_admin_per_menu/README.txt | 14 - .../menu_admin_per_menu.api.php | 42 - .../menu_admin_per_menu.info.yml | 13 - .../menu_admin_per_menu.install | 14 - .../menu_admin_per_menu.module | 97 - .../menu_admin_per_menu.permissions.yml | 2 - .../menu_admin_per_menu.services.yml | 7 - .../src/Access/MenuAdminPerMenuAccess.php | 91 - .../Controller/MenuAdminPerMenuController.php | 67 - .../src/MenuAdminPerMenuAccessInterface.php | 76 - .../src/MenuAdminPerMenuPermissions.php | 37 - .../src/Routing/RouteSubscriber.php | 58 - .../src/Tests/MenuAdminPerMenuNodeSave.php | 116 - .../contrib/admin/metatag/.codeclimate.yml | 25 - .../modules/contrib/admin/metatag/.csslintrc | 2 - .../contrib/admin/metatag/.eslintignore | 1 - .../modules/contrib/admin/metatag/.eslintrc | 213 -- .../contrib/admin/metatag/CHANGELOG.txt | 518 --- .../contrib/admin/metatag/CODE_OF_CONDUCT.txt | 3 - .../modules/contrib/admin/metatag/LICENSE.txt | 339 -- .../modules/contrib/admin/metatag/README.txt | 331 -- .../contrib/admin/metatag/composer.json | 32 - .../install/metatag.metatag_defaults.403.yml | 8 - .../install/metatag.metatag_defaults.404.yml | 8 - .../metatag.metatag_defaults.front.yml | 8 - .../metatag.metatag_defaults.global.yml | 8 - .../install/metatag.metatag_defaults.node.yml | 9 - ...metatag.metatag_defaults.taxonomy_term.yml | 9 - .../install/metatag.metatag_defaults.user.yml | 9 - .../metatag.metatag_defaults.schema.yml | 15 - .../schema/metatag.metatag_tag.schema.yml | 67 - .../metatag/config/schema/metatag.schema.yml | 8 - .../config/schema/metatag.settings.schema.yml | 7 - .../admin/metatag/console.services.yml | 24 - .../en/generate.metatag.group.yml | 17 - .../translations/en/generate.metatag.tag.yml | 31 - .../contrib/admin/metatag/metatag.api.php | 59 - .../contrib/admin/metatag/metatag.info.yml | 20 - .../contrib/admin/metatag/metatag.install | 376 --- .../admin/metatag/metatag.links.action.yml | 5 - .../admin/metatag/metatag.links.menu.yml | 11 - .../admin/metatag/metatag.links.task.yml | 10 - .../contrib/admin/metatag/metatag.module | 605 ---- .../admin/metatag/metatag.permissions.yml | 4 - .../contrib/admin/metatag/metatag.routing.yml | 60 - .../admin/metatag/metatag.services.yml | 16 - .../metatag_app_links.metatag_tag.schema.yml | 76 - .../metatag_app_links.info.yml | 13 - .../metatag_app_links.module | 24 - .../src/Plugin/metatag/Group/AppLinks.php | 19 - .../Plugin/metatag/Tag/AlAndroidAppName.php | 24 - .../src/Plugin/metatag/Tag/AlAndroidClass.php | 24 - .../Plugin/metatag/Tag/AlAndroidPackage.php | 24 - .../src/Plugin/metatag/Tag/AlAndroidUrl.php | 24 - .../src/Plugin/metatag/Tag/AlIosAppName.php | 24 - .../Plugin/metatag/Tag/AlIosAppStoreId.php | 24 - .../src/Plugin/metatag/Tag/AlIosUrl.php | 24 - .../src/Plugin/metatag/Tag/AlIpadAppName.php | 24 - .../Plugin/metatag/Tag/AlIpadAppStoreId.php | 24 - .../src/Plugin/metatag/Tag/AlIpadUrl.php | 24 - .../Plugin/metatag/Tag/AlIphoneAppName.php | 24 - .../Plugin/metatag/Tag/AlIphoneAppStoreId.php | 24 - .../src/Plugin/metatag/Tag/AlIphoneUrl.php | 24 - .../metatag/Tag/AlWebShouldFallback.php | 24 - .../src/Plugin/metatag/Tag/AlWebUrl.php | 24 - .../src/Plugin/metatag/Tag/AlWindowsAppId.php | 24 - .../Plugin/metatag/Tag/AlWindowsAppName.php | 24 - .../metatag/Tag/AlWindowsPhoneAppId.php | 24 - .../metatag/Tag/AlWindowsPhoneAppName.php | 24 - .../Plugin/metatag/Tag/AlWindowsPhoneUrl.php | 24 - .../metatag/Tag/AlWindowsUniversalAppId.php | 24 - .../metatag/Tag/AlWindowsUniversalAppName.php | 24 - .../metatag/Tag/AlWindowsUniversalUrl.php | 24 - .../src/Plugin/metatag/Tag/AlWindowsUrl.php | 24 - .../src/Tests/MetatagAppLinksTagsTest.php | 74 - .../schema/metatag_dc.metatag_tag.schema.yml | 49 - .../metatag/metatag_dc/metatag_dc.info.yml | 13 - .../src/Plugin/metatag/Group/DublinCore.php | 19 - .../src/Plugin/metatag/Tag/Contributor.php | 24 - .../src/Plugin/metatag/Tag/Coverage.php | 24 - .../src/Plugin/metatag/Tag/Creator.php | 24 - .../src/Plugin/metatag/Tag/Date.php | 24 - .../src/Plugin/metatag/Tag/Description.php | 24 - .../src/Plugin/metatag/Tag/Format.php | 24 - .../src/Plugin/metatag/Tag/Identifier.php | 24 - .../src/Plugin/metatag/Tag/Language.php | 24 - .../src/Plugin/metatag/Tag/Publisher.php | 24 - .../src/Plugin/metatag/Tag/Relation.php | 24 - .../src/Plugin/metatag/Tag/Rights.php | 24 - .../src/Plugin/metatag/Tag/Source.php | 24 - .../src/Plugin/metatag/Tag/Subject.php | 24 - .../src/Plugin/metatag/Tag/Title.php | 24 - .../src/Plugin/metatag/Tag/Type.php | 24 - .../src/Tests/MetatagDublinCoreTagsTest.php | 50 - ...metatag_dc_advanced.metatag_tag.schema.yml | 124 - .../metatag_dc_advanced.info.yml | 14 - .../metatag_dc_advanced.module | 24 - .../metatag/Group/DublinCoreAdvanced.php | 19 - .../src/Plugin/metatag/Tag/AbstractTag.php | 24 - .../src/Plugin/metatag/Tag/AccessRights.php | 24 - .../src/Plugin/metatag/Tag/AccrualMethod.php | 24 - .../Plugin/metatag/Tag/AccrualPeriodicity.php | 24 - .../src/Plugin/metatag/Tag/AccrualPolicy.php | 24 - .../src/Plugin/metatag/Tag/Alternative.php | 24 - .../src/Plugin/metatag/Tag/Audience.php | 24 - .../src/Plugin/metatag/Tag/Available.php | 24 - .../metatag/Tag/BibliographicCitation.php | 24 - .../src/Plugin/metatag/Tag/ConformsTo.php | 24 - .../src/Plugin/metatag/Tag/Created.php | 24 - .../src/Plugin/metatag/Tag/DateAccepted.php | 24 - .../Plugin/metatag/Tag/DateCopyrighted.php | 24 - .../src/Plugin/metatag/Tag/DateSubmitted.php | 24 - .../src/Plugin/metatag/Tag/EducationLevel.php | 24 - .../src/Plugin/metatag/Tag/Extent.php | 24 - .../src/Plugin/metatag/Tag/HasFormat.php | 24 - .../src/Plugin/metatag/Tag/HasPart.php | 24 - .../src/Plugin/metatag/Tag/HasVersion.php | 24 - .../metatag/Tag/InstructionalMethod.php | 24 - .../src/Plugin/metatag/Tag/IsFormatOf.php | 24 - .../src/Plugin/metatag/Tag/IsPartOf.php | 24 - .../src/Plugin/metatag/Tag/IsReferencedBy.php | 24 - .../src/Plugin/metatag/Tag/IsReplacedBy.php | 24 - .../src/Plugin/metatag/Tag/IsRequiredBy.php | 24 - .../src/Plugin/metatag/Tag/IsVersionOf.php | 24 - .../src/Plugin/metatag/Tag/Issued.php | 24 - .../src/Plugin/metatag/Tag/License.php | 24 - .../src/Plugin/metatag/Tag/Mediator.php | 24 - .../src/Plugin/metatag/Tag/Medium.php | 24 - .../src/Plugin/metatag/Tag/Modified.php | 24 - .../src/Plugin/metatag/Tag/Provenance.php | 24 - .../src/Plugin/metatag/Tag/References.php | 24 - .../src/Plugin/metatag/Tag/Replaces.php | 24 - .../src/Plugin/metatag/Tag/Requires.php | 24 - .../src/Plugin/metatag/Tag/RightsHolder.php | 24 - .../src/Plugin/metatag/Tag/Spatial.php | 24 - .../Plugin/metatag/Tag/TableOfContents.php | 24 - .../src/Plugin/metatag/Tag/Temporal.php | 24 - .../src/Plugin/metatag/Tag/Valid.php | 24 - .../MetatagDublinCoreAdvancedTagsTest.php | 78 - .../metatag_facebook.metatag_tag.schema.yml | 13 - .../metatag_facebook.info.yml | 13 - .../src/Plugin/metatag/Group/Facebook.php | 19 - .../src/Plugin/metatag/Tag/FbAdmins.php | 24 - .../src/Plugin/metatag/Tag/FbAppId.php | 24 - .../src/Plugin/metatag/Tag/FbPages.php | 24 - .../src/Tests/MetatagFacebookTagsTest.php | 44 - .../metatag_favicons.metatag_tag.schema.yml | 70 - .../metatag_favicons.info.yml | 13 - .../metatag_favicons/metatag_favicons.module | 45 - .../src/Plugin/metatag/Group/Favicons.php | 19 - .../src/Plugin/metatag/Tag/AppleTouchIcon.php | 24 - .../metatag/Tag/AppleTouchIcon114x114.php | 29 - .../metatag/Tag/AppleTouchIcon120x120.php | 29 - .../metatag/Tag/AppleTouchIcon144x144.php | 29 - .../metatag/Tag/AppleTouchIcon152x152.php | 29 - .../metatag/Tag/AppleTouchIcon180x180.php | 29 - .../metatag/Tag/AppleTouchIcon72x72.php | 29 - .../metatag/Tag/AppleTouchIcon76x76.php | 29 - .../metatag/Tag/AppleTouchIconPrecomposed.php | 24 - .../Tag/AppleTouchIconPrecomposed114x114.php | 29 - .../Tag/AppleTouchIconPrecomposed120x120.php | 29 - .../Tag/AppleTouchIconPrecomposed144x144.php | 29 - .../Tag/AppleTouchIconPrecomposed152x152.php | 29 - .../Tag/AppleTouchIconPrecomposed180x180.php | 29 - .../Tag/AppleTouchIconPrecomposed72x72.php | 29 - .../Tag/AppleTouchIconPrecomposed76x76.php | 29 - .../src/Plugin/metatag/Tag/Icon16x16.php | 30 - .../src/Plugin/metatag/Tag/Icon192x192.php | 29 - .../src/Plugin/metatag/Tag/Icon32x32.php | 29 - .../src/Plugin/metatag/Tag/Icon96x96.php | 29 - .../src/Plugin/metatag/Tag/LinkSizesBase.php | 39 - .../src/Plugin/metatag/Tag/MaskIcon.php | 24 - .../src/Plugin/metatag/Tag/ShortcutIcon.php | 24 - .../src/Tests/MetatagFaviconsTagsTest.php | 240 -- .../metatag_google_cse.metatag_tag.schema.yml | 19 - .../metatag_google_cse.info.yml | 13 - .../metatag_google_cse.module | 24 - .../src/Plugin/metatag/Group/GoogleCse.php | 19 - .../src/Plugin/metatag/Tag/Audience.php | 24 - .../src/Plugin/metatag/Tag/Department.php | 24 - .../src/Plugin/metatag/Tag/DocStatus.php | 24 - .../src/Plugin/metatag/Tag/GoogleRating.php | 24 - .../src/Plugin/metatag/Tag/Thumbnail.php | 24 - .../src/Tests/MetatagGoogleCSETagsTest.php | 40 - ...metatag_google_plus.metatag_tag.schema.yml | 19 - .../metatag_google_plus.info.yml | 13 - .../src/Plugin/metatag/Group/GooglePlus.php | 19 - .../src/Plugin/metatag/Tag/Author.php | 24 - .../src/Plugin/metatag/Tag/Description.php | 24 - .../src/Plugin/metatag/Tag/Image.php | 24 - .../src/Plugin/metatag/Tag/Name.php | 24 - .../src/Plugin/metatag/Tag/Publisher.php | 24 - .../src/Tests/MetatagGooglePlusTagsTest.php | 77 - .../metatag_hreflang.metatag_tag.schema.yml | 7 - .../metatag_hreflang.info.yml | 13 - .../metatag_hreflang/metatag_hreflang.module | 24 - .../src/Plugin/Derivative/HreflangDeriver.php | 53 - .../src/Plugin/metatag/Group/Hreflang.php | 19 - .../src/Plugin/metatag/Tag/HreflangBase.php | 37 - .../metatag/Tag/HreflangPerLanguage.php | 25 - .../Plugin/metatag/Tag/HreflangXDefault.php | 29 - .../src/Tests/MetatagHreflangTagsTest.php | 91 - .../metatag_mobile.metatag_tag.schema.yml | 103 - .../metatag_mobile/metatag_mobile.info.yml | 13 - .../metatag_mobile/metatag_mobile.module | 106 - .../Plugin/metatag/Group/AndroidMobile.php | 17 - .../src/Plugin/metatag/Group/AppleMobile.php | 17 - .../src/Plugin/metatag/Group/Mobile.php | 17 - .../Plugin/metatag/Group/WindowsMobile.php | 17 - .../metatag/Tag/AndroidAppLinkAlternative.php | 24 - .../Plugin/metatag/Tag/AndroidManifest.php | 24 - .../src/Plugin/metatag/Tag/AppleItunesApp.php | 24 - .../metatag/Tag/AppleMobileWebAppCapable.php | 24 - .../Tag/AppleMobileWebAppStatusBarStyle.php | 24 - .../metatag/Tag/AppleMobileWebAppTitle.php | 24 - .../Plugin/metatag/Tag/ApplicationName.php | 24 - .../src/Plugin/metatag/Tag/Cleartype.php | 24 - .../Plugin/metatag/Tag/FormatDetection.php | 24 - .../Plugin/metatag/Tag/HandheldFriendly.php | 24 - .../metatag/Tag/IosAppLinkAlternative.php | 24 - .../Plugin/metatag/Tag/MobileOptimized.php | 24 - .../Tag/MsapplicationAllowDomainApiCalls.php | 24 - .../Tag/MsapplicationAllowDomainMetaTags.php | 24 - .../Plugin/metatag/Tag/MsapplicationBadge.php | 24 - .../metatag/Tag/MsapplicationConfig.php | 24 - .../Tag/MsapplicationNavbuttonColor.php | 24 - .../metatag/Tag/MsapplicationNotification.php | 24 - .../Tag/MsapplicationSquare150x150logo.php | 24 - .../Tag/MsapplicationSquare310x310logo.php | 24 - .../Tag/MsapplicationSquare70x70logo.php | 24 - .../metatag/Tag/MsapplicationStartUrl.php | 24 - .../Plugin/metatag/Tag/MsapplicationTask.php | 24 - .../Tag/MsapplicationTaskSeparator.php | 24 - .../metatag/Tag/MsapplicationTilecolor.php | 24 - .../metatag/Tag/MsapplicationTileimage.php | 24 - .../metatag/Tag/MsapplicationTooltip.php | 24 - .../Tag/MsapplicationWide310x150logo.php | 24 - .../metatag/Tag/MsapplicationWindow.php | 24 - .../src/Plugin/metatag/Tag/ThemeColor.php | 24 - .../src/Plugin/metatag/Tag/Viewport.php | 24 - .../src/Plugin/metatag/Tag/WebManifest.php | 24 - .../src/Plugin/metatag/Tag/XUaCompatible.php | 24 - .../src/Tests/MetatagMobileTagsTest.php | 238 -- .../metatag_open_graph.metatag_tag.schema.yml | 133 - .../metatag_open_graph.info.yml | 13 - .../metatag_open_graph.install | 127 - .../metatag_open_graph.module | 38 - .../src/Plugin/metatag/Group/OpenGraph.php | 19 - .../src/Plugin/metatag/Tag/ArticleAuthor.php | 24 - .../metatag/Tag/ArticleExpirationTime.php | 24 - .../metatag/Tag/ArticleModifiedTime.php | 24 - .../metatag/Tag/ArticlePublishedTime.php | 24 - .../Plugin/metatag/Tag/ArticlePublisher.php | 24 - .../src/Plugin/metatag/Tag/ArticleSection.php | 24 - .../src/Plugin/metatag/Tag/ArticleTag.php | 24 - .../src/Plugin/metatag/Tag/BookAuthor.php | 24 - .../src/Plugin/metatag/Tag/BookISBN.php | 24 - .../Plugin/metatag/Tag/BookReleaseDate.php | 24 - .../src/Plugin/metatag/Tag/BookTag.php | 24 - .../src/Plugin/metatag/Tag/OgCountryName.php | 24 - .../src/Plugin/metatag/Tag/OgDescription.php | 24 - .../src/Plugin/metatag/Tag/OgDeterminer.php | 24 - .../src/Plugin/metatag/Tag/OgEmail.php | 24 - .../src/Plugin/metatag/Tag/OgFaxNumber.php | 24 - .../src/Plugin/metatag/Tag/OgImage.php | 25 - .../src/Plugin/metatag/Tag/OgImageAlt.php | 25 - .../src/Plugin/metatag/Tag/OgImageHeight.php | 24 - .../Plugin/metatag/Tag/OgImageSecureUrl.php | 25 - .../src/Plugin/metatag/Tag/OgImageType.php | 24 - .../src/Plugin/metatag/Tag/OgImageUrl.php | 25 - .../src/Plugin/metatag/Tag/OgImageWidth.php | 24 - .../src/Plugin/metatag/Tag/OgLatitude.php | 24 - .../src/Plugin/metatag/Tag/OgLocale.php | 24 - .../metatag/Tag/OgLocaleAlternative.php | 24 - .../src/Plugin/metatag/Tag/OgLocality.php | 24 - .../src/Plugin/metatag/Tag/OgLongitude.php | 24 - .../src/Plugin/metatag/Tag/OgPhoneNumber.php | 24 - .../src/Plugin/metatag/Tag/OgPostalCode.php | 24 - .../src/Plugin/metatag/Tag/OgRegion.php | 24 - .../src/Plugin/metatag/Tag/OgSeeAlso.php | 24 - .../src/Plugin/metatag/Tag/OgSiteName.php | 24 - .../Plugin/metatag/Tag/OgStreetAddress.php | 24 - .../src/Plugin/metatag/Tag/OgTitle.php | 24 - .../src/Plugin/metatag/Tag/OgType.php | 24 - .../src/Plugin/metatag/Tag/OgUpdatedTime.php | 24 - .../src/Plugin/metatag/Tag/OgUrl.php | 25 - .../src/Plugin/metatag/Tag/OgVideo.php | 25 - .../src/Plugin/metatag/Tag/OgVideoHeight.php | 24 - .../Plugin/metatag/Tag/OgVideoSecureUrl.php | 25 - .../src/Plugin/metatag/Tag/OgVideoType.php | 24 - .../src/Plugin/metatag/Tag/OgVideoWidth.php | 24 - .../src/Tests/MetatagOpenGraphTagsTest.php | 102 - ...open_graph_products.metatag_tag.schema.yml | 6 - .../metatag_open_graph_products.info.yml | 14 - .../metatag_open_graph_products.module | 24 - .../metatag/Group/OpenGraphProducts.php | 19 - .../Plugin/metatag/Tag/ProductPriceAmount.php | 24 - .../metatag/Tag/ProductPriceCurrency.php | 24 - .../MetatagOpenGraphProductsTagsTest.php | 50 - .../metatag_page_manager.info.yml | 14 - .../metatag_page_manager.module | 106 - .../Functional/MetatagPageManagerTest.php | 177 -- .../metatag_pinterest.metatag_tag.schema.yml | 25 - .../metatag_pinterest.info.yml | 13 - .../src/Plugin/metatag/Group/Pinterest.php | 19 - .../metatag/Tag/PinterestDescription.php | 24 - .../src/Plugin/metatag/Tag/PinterestId.php | 24 - .../src/Plugin/metatag/Tag/PinterestMedia.php | 24 - .../Plugin/metatag/Tag/PinterestNohover.php | 41 - .../src/Plugin/metatag/Tag/PinterestNopin.php | 41 - .../Plugin/metatag/Tag/PinterestNosearch.php | 41 - .../src/Plugin/metatag/Tag/PinterestUrl.php | 24 - .../src/Tests/MetatagPinterestTagsTest.php | 81 - ...tatag_twitter_cards.metatag_tag.schema.yml | 112 - .../metatag_twitter_cards.info.yml | 13 - .../src/Plugin/metatag/Group/TwitterCards.php | 19 - .../Tag/TwitterCardsAppIdGooglePlay.php | 23 - .../metatag/Tag/TwitterCardsAppIdIpad.php | 23 - .../metatag/Tag/TwitterCardsAppIdIphone.php | 23 - .../Tag/TwitterCardsAppNameGooglePlay.php | 23 - .../metatag/Tag/TwitterCardsAppNameIpad.php | 23 - .../metatag/Tag/TwitterCardsAppNameIphone.php | 23 - .../Tag/TwitterCardsAppStoreCountry.php | 23 - .../Tag/TwitterCardsAppUrlGooglePlay.php | 23 - .../metatag/Tag/TwitterCardsAppUrlIpad.php | 23 - .../metatag/Tag/TwitterCardsAppUrlIphone.php | 23 - .../metatag/Tag/TwitterCardsCreator.php | 23 - .../metatag/Tag/TwitterCardsCreatorId.php | 23 - .../Plugin/metatag/Tag/TwitterCardsData1.php | 24 - .../Plugin/metatag/Tag/TwitterCardsData2.php | 24 - .../metatag/Tag/TwitterCardsDescription.php | 23 - .../metatag/Tag/TwitterCardsDoNotTrack.php | 23 - .../metatag/Tag/TwitterCardsGalleryImage0.php | 24 - .../metatag/Tag/TwitterCardsGalleryImage1.php | 24 - .../metatag/Tag/TwitterCardsGalleryImage2.php | 24 - .../metatag/Tag/TwitterCardsGalleryImage3.php | 24 - .../Plugin/metatag/Tag/TwitterCardsImage.php | 24 - .../metatag/Tag/TwitterCardsImageAlt.php | 23 - .../metatag/Tag/TwitterCardsImageHeight.php | 23 - .../metatag/Tag/TwitterCardsImageWidth.php | 23 - .../Plugin/metatag/Tag/TwitterCardsLabel1.php | 24 - .../Plugin/metatag/Tag/TwitterCardsLabel2.php | 24 - .../metatag/Tag/TwitterCardsPageUrl.php | 23 - .../Plugin/metatag/Tag/TwitterCardsPlayer.php | 24 - .../metatag/Tag/TwitterCardsPlayerHeight.php | 23 - .../metatag/Tag/TwitterCardsPlayerStream.php | 23 - .../TwitterCardsPlayerStreamContentType.php | 23 - .../metatag/Tag/TwitterCardsPlayerWidth.php | 23 - .../Plugin/metatag/Tag/TwitterCardsSite.php | 23 - .../Plugin/metatag/Tag/TwitterCardsSiteId.php | 23 - .../Plugin/metatag/Tag/TwitterCardsTitle.php | 23 - .../Plugin/metatag/Tag/TwitterCardsType.php | 51 - .../src/Tests/MetatagTwitterCardsTagsTest.php | 106 - ...etatag_verification.metatag_tag.schema.yml | 28 - .../metatag_verification.info.yml | 13 - .../Plugin/metatag/Group/SiteVerification.php | 19 - .../src/Plugin/metatag/Tag/Baidu.php | 23 - .../src/Plugin/metatag/Tag/Bing.php | 23 - .../src/Plugin/metatag/Tag/Google.php | 23 - .../src/Plugin/metatag/Tag/NortonSafeWeb.php | 23 - .../src/Plugin/metatag/Tag/Pinterest.php | 23 - .../src/Plugin/metatag/Tag/Yandex.php | 23 - .../src/Tests/MetatagVerificationTagsTest.php | 60 - .../schema/metatag_views.views.schema.yml | 8 - .../metatag_views/metatag_views.info.yml | 14 - .../metatag_views/metatag_views.install | 45 - .../metatag_views/metatag_views.module | 76 - .../src/Controller/MetatagViewsController.php | 246 -- .../MetatagViewsTranslationController.php | 151 - .../src/Form/MetatagViewsAddForm.php | 49 - .../src/Form/MetatagViewsEditForm.php | 194 -- .../src/Form/MetatagViewsRevertForm.php | 132 - .../src/Form/MetatagViewsTranslationForm.php | 269 -- .../src/MetatagViewsValuesCleanerTrait.php | 44 - .../MetatagDisplayExtender.php | 187 -- ..._translation_manage_form_element.html.twig | 23 - .../src/Functional/MetatagViewsBasicsTest.php | 141 - .../metatag/src/Annotation/MetatagGroup.php | 44 - .../metatag/src/Annotation/MetatagTag.php | 90 - .../src/Command/GenerateGroupCommand.php | 197 -- .../src/Command/GenerateTagCommand.php | 367 --- .../metatag/src/Entity/MetatagDefaults.php | 146 - .../src/Form/MetatagDefaultsDeleteForm.php | 52 - .../metatag/src/Form/MetatagDefaultsForm.php | 319 -- .../src/Form/MetatagDefaultsRevertForm.php | 52 - .../metatag/src/Form/MetatagSettingsForm.php | 104 - .../src/Generator/MetatagGroupGenerator.php | 80 - .../src/Generator/MetatagTagGenerator.php | 102 - .../metatag/src/MetatagDefaultsInterface.php | 12 - .../src/MetatagDefaultsListBuilder.php | 141 - .../metatag/src/MetatagGroupPluginManager.php | 30 - .../admin/metatag/src/MetatagManager.php | 578 ---- .../metatag/src/MetatagManagerInterface.php | 98 - .../metatag/src/MetatagServiceProvider.php | 35 - .../metatag/src/MetatagTagPluginManager.php | 30 - .../admin/metatag/src/MetatagToken.php | 95 - .../src/Normalizer/MetatagHalNormalizer.php | 27 - .../src/Normalizer/MetatagNormalizer.php | 53 - .../metatag/src/Plugin/DataType/Metatag.php | 19 - .../src/Plugin/DataType/MetatagInterface.php | 14 - .../FieldFormatter/MetatagEmptyFormatter.php | 30 - .../Field/FieldType/MetatagFieldItem.php | 91 - .../Field/FieldWidget/MetatagFirehose.php | 129 - .../Field/MetatagEntityFieldItemList.php | 11 - .../Plugin/GraphQL/Scalars/MetatagScalar.php | 20 - .../src/Plugin/metatag/Group/Advanced.php | 17 - .../src/Plugin/metatag/Group/Basic.php | 17 - .../src/Plugin/metatag/Group/GroupBase.php | 88 - .../src/Plugin/metatag/Tag/AbstractTag.php | 38 - .../src/Plugin/metatag/Tag/CanonicalUrl.php | 22 - .../Plugin/metatag/Tag/ContentLanguage.php | 22 - .../src/Plugin/metatag/Tag/Description.php | 38 - .../src/Plugin/metatag/Tag/Generator.php | 22 - .../src/Plugin/metatag/Tag/GeoPlacename.php | 22 - .../src/Plugin/metatag/Tag/GeoPosition.php | 22 - .../src/Plugin/metatag/Tag/GeoRegion.php | 22 - .../metatag/src/Plugin/metatag/Tag/Google.php | 22 - .../metatag/src/Plugin/metatag/Tag/Icbm.php | 22 - .../src/Plugin/metatag/Tag/ImageSrc.php | 22 - .../src/Plugin/metatag/Tag/Keywords.php | 22 - .../src/Plugin/metatag/Tag/LinkRelBase.php | 27 - .../Plugin/metatag/Tag/MetaHttpEquivBase.php | 17 - .../Plugin/metatag/Tag/MetaItempropBase.php | 17 - .../src/Plugin/metatag/Tag/MetaNameBase.php | 413 --- .../Plugin/metatag/Tag/MetaPropertyBase.php | 17 - .../src/Plugin/metatag/Tag/NewsKeywords.php | 22 - .../src/Plugin/metatag/Tag/OriginalSource.php | 22 - .../src/Plugin/metatag/Tag/Referrer.php | 47 - .../metatag/src/Plugin/metatag/Tag/Rights.php | 22 - .../metatag/src/Plugin/metatag/Tag/Robots.php | 73 - .../src/Plugin/metatag/Tag/SetCookie.php | 22 - .../src/Plugin/metatag/Tag/ShortLink.php | 22 - .../src/Plugin/metatag/Tag/Standout.php | 22 - .../metatag/src/Plugin/metatag/Tag/Title.php | 43 - .../metatag/src/Tests/MetatagAdminTest.php | 497 --- .../Tests/MetatagConfigTranslationTest.php | 160 - .../src/Tests/MetatagCustomRouteTest.php | 57 - .../src/Tests/MetatagFieldNodeTest.php | 89 - .../src/Tests/MetatagFieldTermTest.php | 99 - .../src/Tests/MetatagFieldTestBase.php | 503 --- .../src/Tests/MetatagFieldTestTest.php | 83 - .../src/Tests/MetatagFieldUserTest.php | 109 - .../metatag/src/Tests/MetatagForumTest.php | 78 - .../src/Tests/MetatagFrontpageTest.php | 172 - .../metatag/src/Tests/MetatagHelperTrait.php | 159 - .../src/Tests/MetatagNodeTranslationTest.php | 210 -- .../metatag/src/Tests/MetatagStringTest.php | 319 -- .../metatag/src/Tests/MetatagTagTypesTest.php | 188 -- .../metatag/src/Tests/MetatagTagsTest.php | 184 -- .../metatag/src/Tests/MetatagTagsTestBase.php | 328 -- .../metatag/src/Tests/MetatagXssTest.php | 213 -- .../admin/metatag/src/Tests/WithRedirect.php | 37 - .../metatag/templates/generator.php.twig | 9 - .../admin/metatag/templates/group.php.twig | 25 - .../templates/metatag_tag.schema.yml.twig | 3 - .../admin/metatag/templates/tag.php.twig | 30 - .../metatag_test_custom_route.info.yml | 13 - .../metatag_test_custom_route.module | 35 - .../metatag_test_custom_route.routing.yml | 15 - .../MetatagTestCustomRouteController.php | 23 - .../metatag_test_tag.metatag_tag.schema.yml | 3 - .../metatag_test_tag.info.yml | 13 - .../metatag_test_tag.metatag_tag.schema.yml | 3 - .../metatag_test_tag/metatag_test_tag.module | 6 - .../src/Plugin/metatag/Tag/MetatagTestTag.php | 23 - .../tests/src/Functional/DefaultTags.php | 156 - .../EnsureDevelWebProfilerWorks.php | 36 - .../tests/src/Functional/EnsureDevelWorks.php | 58 - .../src/Functional/MetatagHelperTrait.php | 157 - .../tests/src/Functional/NodeJsonOutput.php | 135 - .../tests/src/Functional/NodeTranslation.php | 76 - .../src/Functional/RemoveCoreMetaTags.php | 60 - .../src/Functional/SchemaMetatagTest.php | 19 - .../tests/src/Kernel/MetatagManagerTest.php | 136 - .../contrib/admin/path_alias_xt/LICENSE.txt | 339 -- .../config/install/path_alias_xt.settings.yml | 2 - .../config/schema/path_alias_xt.schema.yml | 9 - .../path_alias_xt/path_alias_xt.info.yml | 16 - .../path_alias_xt.links.menu.yml | 5 - .../admin/path_alias_xt/path_alias_xt.module | 24 - .../path_alias_xt.permissions.yml | 2 - .../path_alias_xt/path_alias_xt.routing.yml | 9 - .../path_alias_xt/path_alias_xt.services.yml | 7 - .../src/Form/PathAliasXtSettingsForm.php | 69 - .../src/PathAliasXtProcessorAlias.php | 89 - .../contrib/admin/pathauto/LICENSE.txt | 339 -- .../modules/contrib/admin/pathauto/README.md | 83 - .../config/install/pathauto.settings.yml | 20 - ...stem.action.pathauto_update_alias_node.yml | 9 - ...stem.action.pathauto_update_alias_user.yml | 9 - .../config/schema/pathauto.schema.yml | 39 - .../config/schema/pathauto_pattern.schema.yml | 40 - .../contrib/admin/pathauto/pathauto.api.php | 159 - .../contrib/admin/pathauto/pathauto.info.yml | 21 - .../contrib/admin/pathauto/pathauto.install | 320 -- .../contrib/admin/pathauto/pathauto.js | 21 - .../admin/pathauto/pathauto.libraries.yml | 9 - .../admin/pathauto/pathauto.links.action.yml | 5 - .../admin/pathauto/pathauto.links.task.yml | 23 - .../contrib/admin/pathauto/pathauto.module | 179 -- .../admin/pathauto/pathauto.permissions.yml | 6 - .../admin/pathauto/pathauto.routing.yml | 54 - .../admin/pathauto/pathauto.services.yml | 26 - .../admin/pathauto/pathauto.tokens.inc | 49 - .../admin/pathauto/src/AliasCleaner.php | 353 --- .../pathauto/src/AliasCleanerInterface.php | 103 - .../admin/pathauto/src/AliasStorageHelper.php | 255 -- .../src/AliasStorageHelperInterface.php | 117 - .../src/AliasTypeBatchUpdateInterface.php | 32 - .../admin/pathauto/src/AliasTypeInterface.php | 48 - .../admin/pathauto/src/AliasTypeManager.php | 71 - .../admin/pathauto/src/AliasUniquifier.php | 169 - .../pathauto/src/AliasUniquifierInterface.php | 43 - .../pathauto/src/Annotation/AliasType.php | 37 - .../pathauto/src/Entity/PathautoPattern.php | 382 --- .../PathautoSettingsCacheTag.php | 68 - .../pathauto/src/Form/PathautoAdminDelete.php | 193 -- .../src/Form/PathautoBulkUpdateForm.php | 170 - .../src/Form/PathautoSettingsForm.php | 273 -- .../pathauto/src/Form/PatternDisableForm.php | 54 - .../pathauto/src/Form/PatternEditForm.php | 297 -- .../pathauto/src/Form/PatternEnableForm.php | 54 - .../admin/pathauto/src/MessengerInterface.php | 20 - .../pathauto/src/PathautoFieldItemList.php | 41 - .../admin/pathauto/src/PathautoGenerator.php | 379 --- .../src/PathautoGeneratorInterface.php | 90 - .../admin/pathauto/src/PathautoItem.php | 48 - .../pathauto/src/PathautoPatternInterface.php | 181 -- .../src/PathautoPatternListBuilder.php | 51 - .../admin/pathauto/src/PathautoState.php | 159 - .../admin/pathauto/src/PathautoWidget.php | 71 - .../src/Plugin/Action/UpdateAction.php | 36 - .../Plugin/Deriver/EntityAliasTypeDeriver.php | 96 - .../src/Plugin/pathauto/AliasType/Broken.php | 24 - .../AliasType/EntityAliasTypeBase.php | 342 -- .../pathauto/AliasType/ForumAliasType.php | 106 - .../src/Tests/PathautoBulkUpdateTest.php | 157 - .../Tests/PathautoEnablingEntityTypesTest.php | 88 - .../pathauto/src/Tests/PathautoLocaleTest.php | 216 -- .../src/Tests/PathautoMassDeleteTest.php | 201 -- .../src/Tests/PathautoNodeWebTest.php | 293 -- .../src/Tests/PathautoSettingsFormWebTest.php | 239 -- .../src/Tests/PathautoTaxonomyWebTest.php | 101 - .../src/Tests/PathautoTestHelperTrait.php | 190 -- .../pathauto/src/Tests/PathautoUiTest.php | 191 -- .../src/Tests/PathautoUserWebTest.php | 90 - .../admin/pathauto/src/VerboseMessenger.php | 79 - .../pathauto_string_id_test.info.yml | 13 - .../src/Entity/PathautoStringIdTest.php | 50 - .../config/install/views.view.articles.yml | 231 -- .../pathauto_views_test.info.yml | 14 - .../Kernel/PathautoEntityWithStringIdTest.php | 130 - .../tests/src/Kernel/PathautoKernelTest.php | 586 ---- .../tests/src/Kernel/PathautoTokenTest.php | 114 - .../tests/src/Unit/VerboseMessengerTest.php | 54 - .../admin/permissions_filter/LICENSE.txt | 339 -- .../admin/permissions_filter/README.txt | 14 - .../js/permissions_filter.js | 81 - .../permissions_filter.info.yml | 11 - .../permissions_filter.libraries.yml | 9 - .../permissions_filter.module | 49 - .../all/modules/contrib/admin/piwik/.eslintrc | 5 - .../modules/contrib/admin/piwik/LICENSE.txt | 339 -- .../modules/contrib/admin/piwik/README.txt | 109 - .../modules/contrib/admin/piwik/composer.json | 24 - .../piwik/config/install/piwik.settings.yml | 29 - .../piwik/config/schema/piwik.schema.yml | 120 - .../contrib/admin/piwik/js/piwik.admin.js | 127 - .../modules/contrib/admin/piwik/js/piwik.js | 41 - .../migration_templates/d6_piwik_settings.yml | 68 - .../d6_piwik_user_settings.yml | 24 - .../migration_templates/d7_piwik_settings.yml | 75 - .../d7_piwik_user_settings.yml | 24 - .../contrib/admin/piwik/piwik.info.yml | 17 - .../modules/contrib/admin/piwik/piwik.install | 132 - .../contrib/admin/piwik/piwik.libraries.yml | 15 - .../contrib/admin/piwik/piwik.links.menu.yml | 5 - .../contrib/admin/piwik/piwik.links.task.yml | 4 - .../modules/contrib/admin/piwik/piwik.module | 727 ----- .../contrib/admin/piwik/piwik.permissions.yml | 14 - .../contrib/admin/piwik/piwik.routing.yml | 7 - .../contrib/admin/piwik/piwik.tokens.inc | 60 - .../Render/PiwikJavaScriptSnippet.php | 43 - .../piwik/src/Form/PiwikAdminSettingsForm.php | 717 ----- .../migrate/process/PiwikCustomVars.php | 27 - .../migrate/process/PiwikSkipRowIfNotSet.php | 30 - .../migrate/process/PiwikVisibilityPages.php | 113 - .../migrate/process/PiwikVisibilityRoles.php | 87 - .../admin/piwik/src/Tests/PiwikBasicTest.php | 221 -- .../admin/piwik/src/Tests/PiwikCustomUrls.php | 59 - .../src/Tests/PiwikCustomVariablesTest.php | 133 - .../src/Tests/PiwikPhpFilterTest.php.php | 107 - .../admin/piwik/src/Tests/PiwikRolesTest.php | 107 - .../admin/piwik/src/Tests/PiwikSearchTest.php | 98 - .../src/Tests/PiwikStatusMessagesTest.php | 69 - .../piwik/src/Tests/PiwikUninstallTest.php | 78 - .../piwik/src/Tests/PiwikUserFieldsTest.php | 71 - .../modules/piwik_test/piwik_test.info.yml | 11 - .../modules/piwik_test/piwik_test.routing.yml | 7 - .../src/Controller/PiwikTestController.php | 28 - .../contrib/admin/redirect/LICENSE.txt | 339 -- .../modules/contrib/admin/redirect/README.txt | 61 - .../contrib/admin/redirect/composer.json | 10 - .../config/install/redirect.settings.yml | 7 - .../system.action.redirect_delete_action.yml | 13 - .../config/install/views.view.redirect.yml | 597 ---- ...age.content_settings.redirect.redirect.yml | 10 - .../config/schema/redirect.schema.yml | 31 - .../config/schema/redirect.views.schema.yml | 19 - .../admin/redirect/css/redirect.admin.css | 14 - .../redirect/migrations/d6_path_redirect.yml | 21 - .../redirect/migrations/d7_path_redirect.yml | 25 - .../config/install/redirect_404.settings.yml | 3 - .../install/views.view.redirect_404.yml | 523 ---- .../config/schema/redirect_404.schema.yml | 14 - .../schema/redirect_404.views.schema.yml | 7 - .../redirect_404/redirect_404.info.yml | 14 - .../modules/redirect_404/redirect_404.install | 62 - .../redirect_404.links.action.yml | 5 - .../redirect_404/redirect_404.links.menu.yml | 6 - .../redirect_404/redirect_404.links.task.yml | 5 - .../modules/redirect_404/redirect_404.module | 96 - .../redirect_404/redirect_404.routing.yml | 15 - .../redirect_404/redirect_404.services.yml | 16 - .../redirect_404/redirect_404.views.inc | 99 - .../src/Controller/Fix404IgnoreController.php | 85 - .../EventSubscriber/Redirect404Subscriber.php | 129 - .../src/Form/RedirectFix404Form.php | 193 -- .../src/Plugin/views/field/Language.php | 63 - .../views/field/Redirect404Operations.php | 123 - .../src/RedirectNotFoundStorageInterface.php | 53 - .../src/Render/Redirect404LogSuppressor.php | 65 - .../src/SqlRedirectNotFoundStorage.php | 162 - .../Tests/Fix404RedirectUILanguageTest.php | 203 -- .../src/Tests/Fix404RedirectUITest.php | 186 -- .../Tests/Redirect404LogSuppressorTest.php | 80 - .../src/Tests/Redirect404TestBase.php | 144 - .../src/Kernel/Fix404RedirectCronJobTest.php | 192 -- .../Unit/SqlRedirectNotFoundStorageTest.php | 78 - .../install/redirect_domain.domains.yml | 1 - .../config/schema/redirect_domain.schema.yml | 18 - .../redirect_domain/redirect_domain.info.yml | 13 - .../redirect_domain.links.task.yml | 5 - .../redirect_domain/redirect_domain.module | 33 - .../redirect_domain.routing.yml | 7 - .../redirect_domain.services.yml | 6 - .../DomainRedirectRequestSubscriber.php | 133 - .../src/Form/RedirectDomainForm.php | 165 - .../src/Tests/RedirectDomainUITest.php | 64 - .../DomainRedirectRequestSubscriberTest.php | 144 - .../contrib/admin/redirect/redirect.api.php | 142 - .../contrib/admin/redirect/redirect.drush.inc | 72 - .../admin/redirect/redirect.generate.inc | 194 -- .../contrib/admin/redirect/redirect.info.yml | 15 - .../contrib/admin/redirect/redirect.install | 224 -- .../admin/redirect/redirect.libraries.yml | 5 - .../admin/redirect/redirect.links.action.yml | 5 - .../admin/redirect/redirect.links.menu.yml | 26 - .../admin/redirect/redirect.links.task.yml | 10 - .../contrib/admin/redirect/redirect.module | 504 --- .../admin/redirect/redirect.permissions.yml | 4 - .../admin/redirect/redirect.routing.yml | 58 - .../admin/redirect/redirect.services.yml | 30 - .../admin/redirect/src/Entity/Redirect.php | 347 -- .../RedirectRequestSubscriber.php | 211 -- .../RedirectSettingsCacheTag.php | 54 - .../RouteNormalizerRequestSubscriber.php | 143 - .../src/Exception/RedirectLoopException.php | 24 - .../redirect/src/Form/RedirectDeleteForm.php | 41 - .../src/Form/RedirectDeleteMultipleForm.php | 140 - .../admin/redirect/src/Form/RedirectForm.php | 152 - .../src/Form/RedirectSettingsForm.php | 93 - .../src/Plugin/Action/DeleteRedirect.php | 92 - .../RedirectSourceFormatter.php | 36 - .../Field/FieldType/RedirectSourceItem.php | 112 - .../FieldWidget/RedirectSourceWidget.php | 117 - .../Constraint/SourceLinkTypeConstraint.php | 92 - .../Plugin/migrate/process/PathRedirect.php | 42 - .../migrate/process/d7/PathRedirect.php | 54 - .../process/d7/RedirectSourceQuery.php | 41 - .../Plugin/migrate/source/PathRedirect.php | 62 - .../Plugin/migrate/source/d7/PathRedirect.php | 81 - .../admin/redirect/src/RedirectChecker.php | 98 - .../admin/redirect/src/RedirectRepository.php | 180 -- .../redirect/src/RedirectStorageSchema.php | 31 - .../admin/redirect/src/RedirectViewsData.php | 25 - .../redirect/src/Routing/RouteSubscriber.php | 28 - .../src/Tests/AssertRedirectTrait.php | 53 - .../redirect/src/Tests/GlobalRedirectTest.php | 296 -- .../src/Tests/RedirectUILanguageTest.php | 125 - .../redirect/src/Tests/RedirectUITest.php | 436 --- .../admin/redirect/tests/fixtures/drupal6.php | 186 -- .../admin/redirect/tests/fixtures/drupal7.php | 240 -- .../Kernel/Migrate/d6/PathRedirectTest.php | 50 - .../Kernel/Migrate/d7/PathRedirectTest.php | 68 - .../tests/src/Kernel/RedirectAPITest.php | 305 -- .../src/Unit/Migrate/d7/PathRedirectTest.php | 54 - .../tests/src/Unit/RedirectCheckerTest.php | 155 - .../Unit/RedirectRequestSubscriberTest.php | 301 -- .../RouteNormalizerRequestSubscriberTest.php | 225 -- .../contrib/admin/simple_sitemap/LICENSE.txt | 339 -- .../contrib/admin/simple_sitemap/README.md | 249 -- .../admin/simple_sitemap/composer.json | 32 - .../simple_sitemap.custom_links.default.yml | 5 - .../install/simple_sitemap.settings.yml | 14 - ...mple_sitemap.variants.default_hreflang.yml | 4 - .../config/schema/simple_sitemap.schema.yml | 94 - .../admin/simple_sitemap/drush.services.yml | 7 - .../js/simple_sitemap.fieldsetSummaries.js | 27 - .../simple_sitemap/js/simple_sitemap.form.js | 26 - .../js/simple_sitemap.sitemapEntities.js | 53 - .../simple_sitemap/simple_sitemap.api.php | 142 - .../simple_sitemap/simple_sitemap.drush.inc | 45 - .../simple_sitemap/simple_sitemap.info.yml | 12 - .../simple_sitemap/simple_sitemap.install | 678 ---- .../simple_sitemap.libraries.yml | 19 - .../simple_sitemap.links.menu.yml | 5 - .../simple_sitemap.links.task.yml | 25 - .../simple_sitemap/simple_sitemap.module | 236 -- .../simple_sitemap.permissions.yml | 4 - .../simple_sitemap/simple_sitemap.routing.yml | 51 - .../simple_sitemap.services.yml | 100 - .../src/Annotation/SitemapGenerator.php | 50 - .../src/Annotation/SitemapType.php | 57 - .../src/Annotation/UrlGenerator.php | 50 - .../src/Commands/SimplesitemapCommands.php | 59 - .../Controller/SimplesitemapController.php | 70 - .../admin/simple_sitemap/src/EntityHelper.php | 164 - .../simple_sitemap/src/Form/FormHelper.php | 539 ---- .../src/Form/SimplesitemapCustomLinksForm.php | 227 -- .../src/Form/SimplesitemapEntitiesForm.php | 192 -- .../src/Form/SimplesitemapFormBase.php | 62 - .../src/Form/SimplesitemapSettingsForm.php | 409 --- .../src/Form/SimplesitemapVariantsForm.php | 147 - .../admin/simple_sitemap/src/Logger.php | 100 - .../PathProcessorSitemapVariant.php | 25 - .../SimplesitemapPluginBase.php | 36 - .../DefaultSitemapGenerator.php | 184 -- .../SitemapGenerator/SitemapGeneratorBase.php | 303 -- .../SitemapGeneratorInterface.php | 22 - .../SitemapGeneratorManager.php | 37 - .../SitemapGenerator/SitemapWriter.php | 13 - .../DefaultHreflangSitemapType.php | 23 - .../SitemapType/SitemapTypeBase.php | 12 - .../SitemapType/SitemapTypeInterface.php | 10 - .../SitemapType/SitemapTypeManager.php | 37 - .../UrlGenerator/ArbitraryUrlGenerator.php | 82 - .../UrlGenerator/CustomUrlGenerator.php | 143 - .../EntityMenuLinkContentUrlGenerator.php | 198 -- .../UrlGenerator/EntityUrlGenerator.php | 181 -- .../UrlGenerator/EntityUrlGeneratorBase.php | 218 -- .../UrlGenerator/UrlGeneratorBase.php | 113 - .../UrlGenerator/UrlGeneratorInterface.php | 18 - .../UrlGenerator/UrlGeneratorManager.php | 37 - .../simple_sitemap/src/Queue/BatchTrait.php | 102 - .../simple_sitemap/src/Queue/QueueWorker.php | 388 --- .../src/Queue/SimplesitemapQueue.php | 82 - .../simple_sitemap/src/Simplesitemap.php | 948 ------ .../src/SimplesitemapManager.php | 316 -- .../src/SimplesitemapSettings.php | 68 - .../src/Functional/SimplesitemapTest.php | 566 ---- .../src/Functional/SimplesitemapTestBase.php | 123 - .../contrib/admin/toolbar_menu/LICENSE.txt | 339 -- .../contrib/admin/toolbar_menu/README.txt | 12 - .../schema/toolbar_menu_element.schema.yml | 21 - .../toolbar_menu/css/toolbar_menu.module.css | 3 - .../admin/toolbar_menu/js/toolbar_menu.js | 65 - .../src/Entity/ToolbarMenuElement.php | 113 - .../src/Form/ToolbarMenuElementEditForm.php | 80 - .../src/Tests/ToolbarMenuFonctionalTest.php | 90 - .../src/ToolbarMenuElementListBuilder.php | 41 - .../toolbar_menu/src/ToolbarMenuManager.php | 110 - .../ToolbarMenuMenuLinkTreeManipulators.php | 44 - .../src/ToolbarMenuPermissions.php | 49 - .../admin/toolbar_menu/toolbar_menu.info.yml | 13 - .../admin/toolbar_menu/toolbar_menu.install | 44 - .../toolbar_menu/toolbar_menu.libraries.yml | 7 - .../toolbar_menu.links.action.yml | 5 - .../toolbar_menu/toolbar_menu.links.menu.yml | 5 - .../toolbar_menu/toolbar_menu.links.task.yml | 4 - .../admin/toolbar_menu/toolbar_menu.module | 121 - .../toolbar_menu/toolbar_menu.permissions.yml | 5 - .../toolbar_menu/toolbar_menu.routing.yml | 16 - .../toolbar_menu/toolbar_menu.services.yml | 8 - .../contrib/admin/toolbar_themes/.gitignore | 2 - .../contrib/admin/toolbar_themes/Gruntfile.js | 73 - .../contrib/admin/toolbar_themes/LICENSE.txt | 339 -- .../contrib/admin/toolbar_themes/README.md | 2 - .../install/toolbar_themes.settings.yml | 4 - .../css/toolbar-themes-form.css | 34 - .../contrib/admin/toolbar_themes/js/base.js | 47 - .../contrib/admin/toolbar_themes/package.json | 33 - .../src/Form/ToolbarThemesSettingsForm.php | 188 -- .../templates/toolbar-themes--menu.html.twig | 93 - .../toolbar-themes--toolbar.html.twig | 56 - .../themes/admin_menu/_variables.scss | 34 - .../themes/admin_menu/admin_menu_icons.css | 47 - .../admin_menu/admin_menu_icons.css.map | 1 - .../themes/admin_menu/admin_menu_icons.scss | 91 - .../themes/admin_menu/admin_menu_theme.css | 345 -- .../admin_menu/admin_menu_theme.css.map | 1 - .../themes/admin_menu/admin_menu_theme.scss | 437 --- .../themes/admin_menu/screenshot.png | Bin 5148 -> 0 bytes .../themes/base/base_handles.css | 140 - .../themes/base/base_handles.css.map | 1 - .../themes/base/base_handles.scss | 179 -- .../toolbar_themes/themes/base/base_icons.css | 75 - .../themes/base/base_icons.css.map | 1 - .../themes/base/base_icons.scss | 93 - .../themes/base/base_module.css | 299 -- .../themes/base/base_module.css.map | 1 - .../themes/base/base_module.scss | 430 --- .../toolbar_themes/themes/base/base_theme.css | 224 -- .../themes/base/base_theme.css.map | 1 - .../themes/base/base_theme.scss | 274 -- .../themes/base/fonts/libricons.md | 70 - .../themes/base/fonts/libricons.ttf | Bin 12956 -> 0 bytes .../themes/base/fonts/libricons.woff | Bin 7036 -> 0 bytes .../themes/base/fonts/libricons.woff2 | Bin 6048 -> 0 bytes .../themes/base/grunticons/icon_load.js | 18 - .../toolbar-icon-admin-toolbar-tools-help.svg | 1 - .../grunticons/original/toolbar-icon-edit.svg | 2 - .../toolbar-icon-entity-user-collection.svg | 1 - .../original/toolbar-icon-escape-admin.svg | 1 - .../original/toolbar-icon-help-main.svg | 1 - .../grunticons/original/toolbar-icon-help.svg | 1 - .../grunticons/original/toolbar-icon-home.svg | 1 - .../toolbar-icon-link-toolbar-menu.svg | 1 - .../grunticons/original/toolbar-icon-menu.svg | 1 - .../original/toolbar-icon-shortcut.svg | 1 - .../toolbar-icon-system-admin-config.svg | 1 - .../toolbar-icon-system-admin-content.svg | 1 - .../toolbar-icon-system-admin-reports.svg | 1 - .../toolbar-icon-system-admin-structure.svg | 1 - .../toolbar-icon-system-modules-list.svg | 1 - .../toolbar-icon-system-themes-page.svg | 1 - .../original/toolbar-icon-toolbar-menu.svg | 1 - .../grunticons/original/toolbar-icon-user.svg | 1 - .../grunticons/processed/grunticon.loader.js | 3 - .../grunticons/processed/icons.data.png.css | 46 - .../processed/icons.data.png.css.map | 1 - .../grunticons/processed/icons.data.svg.css | 36 - .../processed/icons.data.svg.css.map | 1 - .../grunticons/processed/icons.fallback.css | 46 - .../processed/icons.fallback.css.map | 1 - .../processed/png/toolbar-handle.png | Bin 6195 -> 0 bytes .../toolbar-icon-admin-toolbar-tools-help.png | Bin 7611 -> 0 bytes .../processed/png/toolbar-icon-edit.png | Bin 2637 -> 0 bytes .../toolbar-icon-entity-user-collection.png | Bin 6653 -> 0 bytes .../png/toolbar-icon-escape-admin.png | Bin 6120 -> 0 bytes .../processed/png/toolbar-icon-help-main.png | Bin 6722 -> 0 bytes .../processed/png/toolbar-icon-help.png | Bin 9778 -> 0 bytes .../processed/png/toolbar-icon-home.png | Bin 175 -> 0 bytes .../png/toolbar-icon-link-toolbar-menu.png | Bin 5914 -> 0 bytes .../processed/png/toolbar-icon-menu.png | Bin 3458 -> 0 bytes .../processed/png/toolbar-icon-shortcut.png | Bin 5646 -> 0 bytes .../png/toolbar-icon-system-admin-config.png | Bin 4840 -> 0 bytes .../png/toolbar-icon-system-admin-content.png | Bin 2146 -> 0 bytes .../png/toolbar-icon-system-admin-reports.png | Bin 2104 -> 0 bytes .../toolbar-icon-system-admin-structure.png | Bin 5589 -> 0 bytes .../png/toolbar-icon-system-modules-list.png | Bin 5303 -> 0 bytes .../png/toolbar-icon-system-themes-page.png | Bin 6064 -> 0 bytes .../png/toolbar-icon-toggle-horizontal.png | Bin 2033 -> 0 bytes .../png/toolbar-icon-toggle-orientation.png | Bin 2033 -> 0 bytes .../png/toolbar-icon-toggle-vertical.png | Bin 2403 -> 0 bytes .../png/toolbar-icon-toolbar-menu.png | Bin 7307 -> 0 bytes .../processed/png/toolbar-icon-tour.png | Bin 9778 -> 0 bytes .../processed/png/toolbar-icon-user.png | Bin 4945 -> 0 bytes .../base/grunticons/processed/preview.html | 75 - .../toolbar-themes--base-menu.html.twig | 93 - .../toolbar-themes--base-toolbar.html.twig | 61 - .../themes/mini/_variables.scss | 5 - .../toolbar_themes/themes/mini/mini_icons.css | 43 - .../themes/mini/mini_icons.css.map | 1 - .../themes/mini/mini_icons.scss | 80 - .../toolbar_themes/themes/mini/mini_theme.css | 373 --- .../themes/mini/mini_theme.css.map | 1 - .../themes/mini/mini_theme.scss | 450 --- .../toolbar_themes/themes/mini/screenshot.png | Bin 4782 -> 0 bytes .../themes/seven/_variables.scss | 36 - .../themes/seven/screenshot.png | Bin 4933 -> 0 bytes .../themes/seven/seven_icons.css | 46 - .../themes/seven/seven_icons.css.map | 1 - .../themes/seven/seven_icons.scss | 90 - .../themes/seven/seven_theme.css | 368 --- .../themes/seven/seven_theme.css.map | 1 - .../themes/seven/seven_theme.scss | 425 --- .../toolbar_themes/toolbar_themes.info.yml | 13 - .../toolbar_themes/toolbar_themes.install | 34 - .../toolbar_themes.libraries.yml | 80 - .../toolbar_themes.links.menu.yml | 5 - .../toolbar_themes/toolbar_themes.module | 376 --- .../toolbar_themes.permissions.yml | 2 - .../toolbar_themes/toolbar_themes.routing.yml | 7 - .../toolbar_themes.toolbar_themes.yml | 47 - .../contrib/admin/workflow/CHANGELOG.txt | 7 - .../contrib/admin/workflow/LICENSE.txt | 339 -- .../config/install/workflow.settings.yml | 1 - .../block.block.workflowtransitionform.yml | 19 - ...n.change_a_node_to_next_workflow_state.yml | 21 - .../views.view.workflow_entity_history.yml | 713 ----- .../config/schema/workflow.schema.yml | 72 - .../config/schema/workflow.state.schema.yml | 27 - .../schema/workflow.transition.schema.yml | 27 - .../config/schema/workflow.views.schema.yml | 7 - .../install/workflow_access.settings.yml | 1 - .../config/schema/workflow_access.schema.yml | 6 - .../src/Form/WorkflowAccessRoleForm.php | 143 - .../src/Form/WorkflowAccessSettingsForm.php | 76 - .../workflow_access/workflow_access.info.yml | 14 - .../workflow_access/workflow_access.install | 41 - .../workflow_access.links.task.yml | 15 - .../workflow_access/workflow_access.module | 302 -- .../workflow_access.routing.yml | 21 - .../src/Form/WorkflowCleanupSettingsForm.php | 142 - .../workflow_cleanup.info.yml | 14 - .../workflow_cleanup.links.task.yml | 7 - .../workflow_cleanup/workflow_cleanup.module | 26 - .../workflow_cleanup.routing.yml | 7 - .../modules/workflow_devel/README.txt | 3 - .../workflow_devel/workflow_devel.info.yml | 13 - .../workflow_devel/workflow_devel.module | 143 - .../workflow_field/workflowfield.info.yml | 13 - .../src/Form/WorkflowTransitionRevertForm.php | 133 - .../src/WorkflowAccessControlHandler.php | 144 - .../src/WorkflowPermissions.php | 72 - .../workflow_operations.info.yml | 13 - .../workflow_operations.module | 97 - .../workflow_operations.permissions.yml | 2 - .../workflow_operations.routing.yml | 10 - .../src/Controller/WorkflowListBuilder.php | 104 - .../Controller/WorkflowStateListBuilder.php | 405 --- .../src/Controller/WorkflowUiController.php | 24 - .../Form/WorkflowConfigTransitionFormBase.php | 191 -- .../WorkflowConfigTransitionLabelForm.php | 103 - .../Form/WorkflowConfigTransitionRoleForm.php | 186 -- .../modules/workflow_ui/workflow_ui.info.yml | 14 - .../modules/workflow_ui/workflow_ui.install | 24 - .../workflow_ui/workflow_ui.links.action.yml | 13 - .../workflow_ui/workflow_ui.links.menu.yml | 7 - .../workflow_ui/workflow_ui.links.task.yml | 28 - .../modules/workflow_ui/workflow_ui.module | 93 - .../workflow_ui/workflow_ui.routing.yml | 57 - .../src/Access/WorkflowHistoryAccess.php | 79 - .../WorkflowTransitionListController.php | 136 - .../src/Element/WorkflowTransitionElement.php | 568 ---- .../admin/workflow/src/Entity/Workflow.php | 468 --- .../src/Entity/WorkflowConfigTransition.php | 237 -- .../WorkflowConfigTransitionInterface.php | 74 - .../workflow/src/Entity/WorkflowInterface.php | 170 - .../workflow/src/Entity/WorkflowManager.php | 463 --- .../src/Entity/WorkflowManagerInterface.php | 173 - .../Entity/WorkflowScheduledTransition.php | 258 -- .../workflow/src/Entity/WorkflowState.php | 556 ---- .../workflow/src/Entity/WorkflowStorage.php | 76 - .../src/Entity/WorkflowTransition.php | 1069 ------- .../Entity/WorkflowTransitionInterface.php | 277 -- .../src/Form/WorkflowTransitionForm.php | 211 -- .../workflow/src/Form/WorkflowTypeForm.php | 281 -- .../Action/WorkflowNodeGivenStateAction.php | 79 - .../Action/WorkflowNodeNextStateAction.php | 71 - .../Plugin/Action/WorkflowStateActionBase.php | 232 -- .../Plugin/Block/WorkflowTransitionBlock.php | 85 - .../Plugin/Derivative/WorkflowLocalTask.php | 75 - .../WorkflowDefaultFormatter.php | 206 -- .../Plugin/Field/FieldType/WorkflowItem.php | 420 --- .../FieldWidget/WorkflowDefaultWidget.php | 239 -- .../Constraint/WorkflowFieldConstraint.php | 36 - .../WorkflowFieldConstraintValidator.php | 91 - .../Plugin/views/argument/WorkflowState.php | 23 - .../src/Plugin/views/filter/WorkflowState.php | 55 - .../workflow/src/Routing/RouteSubscriber.php | 135 - .../src/WorkflowAccessControlHandler.php | 146 - .../workflow/src/WorkflowPermissions.php | 79 - .../WorkflowScheduledTransitionViewsData.php | 22 - .../src/WorkflowTransitionListBuilder.php | 263 -- .../src/WorkflowTransitionViewsData.php | 176 -- .../src/WorkflowTypeAttributeTrait.php | 105 - .../src/WorkflowURLRouteParametersTrait.php | 19 - .../contrib/admin/workflow/workflow.api.php | 431 --- .../contrib/admin/workflow/workflow.field.inc | 141 - .../contrib/admin/workflow/workflow.form.inc | 277 -- .../contrib/admin/workflow/workflow.info.yml | 16 - .../contrib/admin/workflow/workflow.install | 102 - .../admin/workflow/workflow.links.task.yml | 23 - .../contrib/admin/workflow/workflow.module | 774 ----- .../admin/workflow/workflow.permissions.yml | 10 - .../admin/workflow/workflow.routing.yml | 111 - .../admin/workflow/workflow.services.yml | 10 - .../contrib/admin/workflow/workflow.views.inc | 86 - .../contrib/dev/config_devel/LICENSE.txt | 339 -- .../contrib/dev/config_devel/composer.json | 8 - .../config/install/config_devel.settings.yml | 2 - .../config/schema/config_devel.schema.yml | 23 - .../dev/config_devel/config_devel.info.yml | 13 - .../config_devel/config_devel.links.menu.yml | 5 - .../dev/config_devel/config_devel.routing.yml | 7 - .../config_devel/config_devel.services.yml | 11 - .../dev/config_devel/drush.services.yml | 13 - .../config_devel/drush/config_devel.drush.inc | 258 -- .../src/Commands/ConfigDevelCommands.php | 353 --- .../src/Event/ConfigDevelEvents.php | 26 - .../src/Event/ConfigDevelSaveEvent.php | 79 - .../ConfigDevelAutoExportSubscriber.php | 136 - .../ConfigDevelAutoImportSubscriber.php | 83 - .../ConfigDevelSubscriberBase.php | 66 - .../src/Form/ConfigDevelSettingsForm.php | 100 - .../ConfigDevelSubscriberEntityTest.php | 32 - .../Kernel/ConfigDevelSubscriberRawTest.php | 25 - .../Kernel/ConfigDevelSubscriberTestBase.php | 65 - .../ConfigDevelAutoExportSubscriberTest.php | 53 - .../tests/src/Unit/ConfigDevelTestBase.php | 44 - .../contrib/dev/config_filter/.gitignore | 2 - .../contrib/dev/config_filter/.travis.yml | 41 - .../contrib/dev/config_filter/LICENSE.txt | 339 -- .../contrib/dev/config_filter/README.md | 50 - .../contrib/dev/config_filter/composer.json | 31 - .../dev/config_filter/config_filter.info.yml | 11 - .../config_filter/config_filter.services.yml | 16 - .../src/Annotation/ConfigFilter.php | 62 - .../src/Config/FilteredStorage.php | 245 -- .../src/Config/FilteredStorageInterface.php | 12 - .../config_filter/src/Config/GhostStorage.php | 46 - .../src/Config/ReadOnlyStorage.php | 125 - .../src/Config/StorageFilterInterface.php | 223 -- .../Config/TransparentStorageFilterTrait.php | 151 - .../src/ConfigFilterManagerInterface.php | 34 - .../src/ConfigFilterStorageFactory.php | 93 - .../InvalidStorageFilterException.php | 19 - .../src/Exception/UnsupportedMethod.php | 9 - .../src/Plugin/ConfigFilterBase.php | 15 - .../src/Plugin/ConfigFilterInterface.php | 13 - .../src/Plugin/ConfigFilterPluginManager.php | 80 - .../src/Tests/FilteredStorageTest.php | 429 --- .../src/Tests/GhostStorageTest.php | 44 - .../src/Tests/ReadonlyStorageTest.php | 138 - .../src/Tests/TransparentFilter.php | 40 - .../dev/config_filter/tests/composer.json | 24 - .../config_filter_split_test/README.md | 40 - .../config_filter_split_test.info.yml | 12 - .../src/Config/ActiveMigrateStorage.php | 34 - .../Plugin/ConfigFilter/TestSplitFilter.php | 167 - .../config_filter_test.info.yml | 12 - .../src/Plugin/ConfigFilter/PirateFilter.php | 40 - .../dev/config_filter/tests/phpunit.xml.dist | 13 - .../Kernel/ConfigFilterStorageFactoryTest.php | 88 - .../contrib/dev/config_ignore/LICENSE.txt | 339 -- .../contrib/dev/config_ignore/README.txt | 41 - .../contrib/dev/config_ignore/composer.json | 29 - .../config/install/config_ignore.settings.yml | 1 - .../config/schema/config_ignore.schema.yml | 9 - .../dev/config_ignore/config_ignore.api.php | 23 - .../dev/config_ignore/config_ignore.info.yml | 14 - .../dev/config_ignore/config_ignore.install | 13 - .../config_ignore.links.task.yml | 5 - .../dev/config_ignore/config_ignore.module | 70 - .../config_ignore/config_ignore.routing.yml | 7 - .../dev/config_ignore/src/Form/Settings.php | 76 - .../src/Plugin/ConfigFilter/IgnoreFilter.php | 236 -- .../config_ignore_hook_test.info.yml | 13 - .../config_ignore_hook_test.module | 13 - .../ConfigIgnoreBrowserTestBase.php | 66 - .../src/Functional/ConfigIgnoreHookTest.php | 47 - .../tests/src/Functional/ConfigIgnoreTest.php | 196 -- .../modules/contrib/dev/ctools/LICENSE.txt | 339 -- .../modules/contrib/dev/ctools/composer.json | 40 - .../ctools/config/schema/ctools.schema.yml | 63 - .../contrib/dev/ctools/ctools.info.yml | 13 - .../modules/contrib/dev/ctools/ctools.module | 64 - .../contrib/dev/ctools/ctools.services.yml | 38 - .../config/schema/ctools_block.schema.yml | 28 - .../ctools_block/ctools_block.info.yml | 14 - .../modules/ctools_block/ctools_block.module | 16 - .../src/Plugin/Block/EntityField.php | 375 --- .../src/Plugin/Deriver/EntityFieldDeriver.php | 65 - ...e.node.ctools_block_field_test.promote.yml | 23 - ...y.node.ctools_block_field_test.default.yml | 62 - ...y.node.ctools_block_field_test.default.yml | 18 - ...ay.node.ctools_block_field_test.teaser.yml | 27 - ...ield.node.ctools_block_field_test.body.yml | 23 - ...de.ctools_block_field_test.field_image.yml | 37 - .../field.storage.node.field_image.yml | 31 - .../node.type.ctools_block_field_test.yml | 18 - .../ctools_block_field_test.info.yml | 20 - .../src/Functional/EntityFieldBlockTest.php | 132 - .../ctools_entity_mask.info.yml | 11 - .../ctools_entity_mask.module | 189 -- .../src/MaskContentEntityStorage.php | 81 - .../src/MaskEntityTrait.php | 26 - .../install/block_content.type.basic.yml | 7 - ...rm_display.block_content.basic.default.yml | 52 - ...ew_display.block_content.basic.default.yml | 46 - .../field.field.block_content.basic.body.yml | 21 - ....field.block_content.basic.field_image.yml | 37 - ...d.field.block_content.basic.field_link.yml | 22 - ...ield.storage.block_content.field_image.yml | 29 - ...field.storage.block_content.field_link.yml | 18 - .../entity_mask_test.info.yml | 14 - .../entity_mask_test.routing.yml | 9 - .../src/Entity/BlockContent.php | 70 - .../tests/src/Functional/DisplayTest.php | 110 - .../tests/src/Kernel/EntityMaskTest.php | 216 -- .../ctools_views/ctools_views.info.yml | 15 - .../modules/ctools_views/ctools_views.module | 104 - .../ctools_views/src/Plugin/Display/Block.php | 440 --- .../Tests/CToolsViewsBasicViewBlockTest.php | 350 --- .../ctools_views_test_views.info.yml | 20 - .../views.view.ctools_views_entity_test.yml | 543 ---- .../views.view.ctools_views_test_view.yml | 949 ------ .../dev/ctools/plugins/access/node.inc | 6 - .../dev/ctools/src/Access/AccessInterface.php | 9 - .../dev/ctools/src/Access/TempstoreAccess.php | 50 - .../src/Ajax/OpenModalWizardCommand.php | 23 - .../ctools/src/Annotation/Relationship.php | 54 - .../src/ConstraintConditionInterface.php | 26 - .../ctools/src/Context/AutomaticContext.php | 25 - .../src/Context/EntityLazyLoadContext.php | 66 - .../contrib/dev/ctools/src/ContextMapper.php | 50 - .../dev/ctools/src/ContextMapperInterface.php | 21 - .../ctools/src/ContextNotFoundException.php | 5 - .../Controller/WizardEntityFormController.php | 52 - .../src/Controller/WizardFormController.php | 81 - .../ctools/src/Event/BlockVariantEvent.php | 56 - .../ctools/src/Event/BlockVariantEvents.php | 49 - .../dev/ctools/src/Event/WizardEvent.php | 41 - .../dev/ctools/src/Form/AjaxFormTrait.php | 43 - .../ctools/src/Form/ConditionConfigure.php | 183 -- .../dev/ctools/src/Form/ConditionDelete.php | 210 -- .../dev/ctools/src/Form/ContextConfigure.php | 264 -- .../dev/ctools/src/Form/ContextDelete.php | 84 - .../dev/ctools/src/Form/ManageConditions.php | 242 -- .../dev/ctools/src/Form/ManageContext.php | 355 --- .../src/Form/ManageResolverRelationships.php | 251 -- .../ctools/src/Form/RelationshipConfigure.php | 154 - .../dev/ctools/src/Form/RequiredContext.php | 224 -- .../ctools/src/Form/RequiredContextDelete.php | 194 -- .../Form/ResolverRelationshipConfigure.php | 183 -- .../src/Form/ResolverRelationshipDelete.php | 149 - .../src/ParamConverter/TempstoreConverter.php | 168 - .../ctools/src/Plugin/Block/EntityView.php | 117 - .../src/Plugin/BlockPluginCollection.php | 53 - .../src/Plugin/BlockVariantInterface.php | 96 - .../ctools/src/Plugin/BlockVariantTrait.php | 170 - .../src/Plugin/Condition/EntityBundle.php | 160 - .../ctools/src/Plugin/Condition/NodeType.php | 41 - .../src/Plugin/Deriver/EntityBundle.php | 53 - .../src/Plugin/Deriver/EntityDeriverBase.php | 75 - .../src/Plugin/Deriver/EntityViewDeriver.php | 28 - .../TypedDataEntityRelationshipDeriver.php | 24 - .../TypedDataLanguageRelationshipDeriver.php | 40 - .../Deriver/TypedDataPropertyDeriverBase.php | 113 - .../Deriver/TypedDataRelationshipDeriver.php | 75 - .../DisplayVariant/BlockDisplayVariant.php | 224 -- .../src/Plugin/PluginWizardInterface.php | 25 - .../TypedDataEntityRelationship.php | 37 - .../TypedDataLanguageRelationship.php | 36 - .../Relationship/TypedDataRelationship.php | 75 - .../ctools/src/Plugin/RelationshipBase.php | 10 - .../src/Plugin/RelationshipInterface.php | 27 - .../ctools/src/Plugin/RelationshipManager.php | 35 - .../Plugin/RelationshipManagerInterface.php | 11 - .../src/Plugin/VariantCollectionInterface.php | 50 - .../src/Plugin/VariantCollectionTrait.php | 67 - .../src/Plugin/VariantPluginCollection.php | 43 - .../src/Routing/Enhancer/WizardEnhancer.php | 47 - .../dev/ctools/src/SerializableTempstore.php | 13 - .../src/SerializableTempstoreFactory.php | 57 - .../src/Testing/EntityCreationTrait.php | 54 - .../src/Tests/Wizard/CToolsWizardTest.php | 142 - .../dev/ctools/src/TypedDataResolver.php | 250 -- .../src/Wizard/EntityFormWizardBase.php | 183 -- .../src/Wizard/EntityFormWizardInterface.php | 39 - .../dev/ctools/src/Wizard/FormWizardBase.php | 467 --- .../ctools/src/Wizard/FormWizardInterface.php | 182 -- .../dev/ctools/src/Wizard/WizardFactory.php | 141 - .../src/Wizard/WizardFactoryInterface.php | 43 - .../ctools-wizard-trail-links.html.twig | 14 - .../templates/ctools-wizard-trail.html.twig | 14 - .../ctools_block_display_test.info.yml | 14 - .../DisplayVariant/BlockDisplayVariant.php | 23 - ...tools_wizard_test_config_entity.schema.yml | 18 - .../ctools_wizard_test.info.yml | 12 - .../ctools_wizard_test.links.action.yml | 6 - .../ctools_wizard_test.links.menu.yml | 7 - .../ctools_wizard_test.routing.yml | 82 - .../src/Entity/ExampleConfigEntity.php | 83 - .../src/ExampleConfigEntityInterface.php | 26 - .../src/ExampleConfigEntityListBuilder.php | 49 - .../Form/ExampleConfigEntityDeleteForm.php | 51 - .../Form/ExampleConfigEntityExistingForm.php | 37 - .../Form/ExampleConfigEntityExternalForm.php | 68 - .../Form/ExampleConfigEntityGeneralForm.php | 46 - .../src/Form/ExampleConfigEntityOneForm.php | 62 - .../src/Form/ExampleConfigEntityTwoForm.php | 47 - .../ctools_wizard_test/src/Form/OneForm.php | 70 - .../ctools_wizard_test/src/Form/TwoForm.php | 69 - .../src/Wizard/EntityAddWizardTest.php | 15 - .../src/Wizard/EntityEditWizardTest.php | 71 - .../src/Wizard/WizardTest.php | 82 - .../src/Kernel/BlockDisplayVariantTest.php | 53 - .../src/Kernel/RelationshipManagerTest.php | 63 - .../src/Kernel/RelationshipsTestBase.php | 96 - .../src/Kernel/SerializableTempstoreTest.php | 64 - .../TypedDataEntityRelationshipPluginTest.php | 46 - ...ypedDataLanguageRelationshipPluginTest.php | 36 - .../TypedDataRelationshipPluginTest.php | 103 - .../src/Kernel/TypedDataResolverTest.php | 105 - .../src/Unit/BlockDisplayVariantTest.php | 90 - .../src/Unit/BlockPluginCollectionTest.php | 81 - .../tests/src/Unit/BlockVariantTraitTest.php | 149 - .../tests/src/Unit/ContextMapperTest.php | 104 - .../src/Unit/VariantCollectionTraitTest.php | 209 -- .../views_content/views_content.admin.inc | 6 - .../all/modules/contrib/dev/devel/LICENSE.txt | 339 -- .../all/modules/contrib/dev/devel/README.txt | 88 - .../modules/contrib/dev/devel/composer.json | 52 - .../devel/config/install/devel.settings.yml | 8 - .../config/install/devel.toolbar.settings.yml | 8 - .../config/install/system.menu.devel.yml | 9 - .../dev/devel/config/schema/devel.schema.yml | 53 - .../modules/contrib/dev/devel/css/devel.css | 42 - .../contrib/dev/devel/css/devel.toolbar.css | 38 - .../modules/contrib/dev/devel/devel.api.php | 25 - .../modules/contrib/dev/devel/devel.info.yml | 14 - .../modules/contrib/dev/devel/devel.install | 49 - .../contrib/dev/devel/devel.libraries.yml | 11 - .../contrib/dev/devel/devel.links.menu.yml | 89 - .../contrib/dev/devel/devel.links.task.yml | 18 - .../modules/contrib/dev/devel/devel.module | 630 ---- .../contrib/dev/devel/devel.permissions.yml | 9 - .../contrib/dev/devel/devel.routing.yml | 268 -- .../contrib/dev/devel/devel.services.yml | 32 - .../dev/devel/devel_generate/README.txt | 44 - .../dev/devel/devel_generate/composer.json | 52 - .../devel_generate/devel_generate.batch.inc | 25 - .../devel_generate/devel_generate.info.yml | 13 - .../devel_generate/devel_generate.module | 145 - .../devel_generate.permissions.yml | 5 - .../devel_generate/devel_generate.routing.yml | 2 - .../devel_generate.services.yml | 4 - .../devel/devel_generate/drush.services.yml | 7 - .../drush/devel_generate.drush8.inc | 196 -- .../src/Annotation/DevelGenerate.php | 86 - .../src/Commands/DevelGenerateCommands.php | 191 -- .../devel_generate/src/DevelGenerateBase.php | 172 - .../src/DevelGenerateBaseInterface.php | 77 - .../src/DevelGenerateException.php | 12 - .../src/DevelGeneratePermissions.php | 62 - .../src/DevelGeneratePluginManager.php | 31 - .../src/Form/DevelGenerateForm.php | 114 - .../DevelGenerate/ContentDevelGenerate.php | 506 --- .../DevelGenerate/MenuDevelGenerate.php | 405 --- .../DevelGenerate/TermDevelGenerate.php | 258 -- .../DevelGenerate/UserDevelGenerate.php | 204 -- .../DevelGenerate/VocabularyDevelGenerate.php | 175 -- .../src/Routing/DevelGenerateRoutes.php | 57 - .../src/Tests/DevelGenerateTest.php | 175 -- .../devel_generate_example.info.yml | 14 - .../DevelGenerate/ExampleDevelGenerate.php | 88 - .../tests/src/DevelGenerateManagerTest.php | 93 - .../contrib/dev/devel/drush.services.yml | 6 - .../contrib/dev/devel/drush/devel.drush8.inc | 276 -- .../contrib/dev/devel/icons/bebebe/cog.svg | 1 - .../contrib/dev/devel/icons/ffffff/cog.svg | 1 - .../modules/contrib/dev/devel/kint/README.txt | 37 - .../contrib/dev/devel/kint/kint.info.yml | 13 - .../contrib/dev/devel/kint/kint.module | 65 - .../dev/devel/kint/kint.permissions.yml | 4 - .../contrib/dev/devel/kint/kint.services.yml | 5 - .../contrib/dev/devel/kint/kint/.gitignore | 3 - .../dev/devel/kint/kint/Kint.class.php | 836 ----- .../contrib/dev/devel/kint/kint/LICENCE | 20 - .../contrib/dev/devel/kint/kint/README.md | 141 - .../contrib/dev/devel/kint/kint/composer.json | 29 - .../dev/devel/kint/kint/config.default.php | 94 - .../dev/devel/kint/kint/decorators/plain.php | 335 -- .../dev/devel/kint/kint/decorators/rich.php | 319 -- .../dev/devel/kint/kint/examples/overview.php | 176 -- .../devel/kint/kint/inc/kintObject.class.php | 19 - .../devel/kint/kint/inc/kintParser.class.php | 608 ---- .../kint/kint/inc/kintVariableData.class.php | 102 - .../kint/kint/parsers/custom/classmethods.php | 150 - .../kint/kint/parsers/custom/classstatics.php | 49 - .../devel/kint/kint/parsers/custom/color.php | 400 --- .../devel/kint/kint/parsers/custom/fspath.php | 69 - .../devel/kint/kint/parsers/custom/json.php | 19 - .../kint/kint/parsers/custom/microtime.php | 60 - .../kint/parsers/custom/objectiterateable.php | 22 - .../kint/parsers/custom/splobjectstorage.php | 24 - .../kint/kint/parsers/custom/timestamp.php | 29 - .../devel/kint/kint/parsers/custom/xml.php | 25 - .../kint/kint/parsers/objects/closure.php | 47 - .../kint/kint/parsers/objects/smarty.php | 35 - .../kint/kint/parsers/objects/splfileinfo.php | 70 - .../contrib/dev/devel/kint/kint/view/base.js | 437 --- .../dev/devel/kint/kint/view/base.less | 413 --- .../kint/kint/view/compiled/aante-light.css | 397 --- .../dev/devel/kint/kint/view/compiled/kint.js | 10 - .../kint/kint/view/compiled/original.css | 1 - .../kint/view/compiled/solarized-dark.css | 1 - .../kint/kint/view/compiled/solarized.css | 1 - .../kint/kint/view/themes/aante-light.less | 154 - .../devel/kint/kint/view/themes/original.less | 43 - .../kint/kint/view/themes/solarized-dark.less | 39 - .../kint/kint/view/themes/solarized.less | 29 - .../kint/src/Plugin/Devel/Dumper/Kint.php | 51 - .../dev/devel/kint/src/Twig/KintExtension.php | 154 - .../dev/devel/src/Annotation/DevelDumper.php | 44 - .../dev/devel/src/Commands/DevelCommands.php | 264 -- .../Controller/ContainerInfoController.php | 274 -- .../devel/src/Controller/DevelController.php | 189 -- .../src/Controller/ElementInfoController.php | 162 - .../src/Controller/EntityDebugController.php | 143 - .../Controller/EntityTypeInfoController.php | 154 - .../src/Controller/EventInfoController.php | 136 - .../src/Controller/LayoutInfoController.php | 91 - .../src/Controller/RouteInfoController.php | 203 -- .../src/Controller/SwitchUserController.php | 120 - .../contrib/dev/devel/src/DevelDumperBase.php | 45 - .../dev/devel/src/DevelDumperInterface.php | 59 - .../dev/devel/src/DevelDumperManager.php | 145 - .../devel/src/DevelDumperManagerInterface.php | 102 - .../devel/src/DevelDumperPluginManager.php | 71 - .../src/DevelDumperPluginManagerInterface.php | 24 - .../contrib/dev/devel/src/EntityTypeInfo.php | 103 - .../ErrorHandlerSubscriber.php | 57 - .../ThemeInfoRebuildSubscriber.php | 116 - .../dev/devel/src/Form/ConfigEditor.php | 146 - .../dev/devel/src/Form/ConfigsList.php | 86 - .../dev/devel/src/Form/DevelReinstall.php | 154 - .../src/Form/RouterRebuildConfirmForm.php | 86 - .../dev/devel/src/Form/SettingsForm.php | 191 -- .../dev/devel/src/Form/SwitchUserForm.php | 108 - .../dev/devel/src/Form/SystemStateEdit.php | 189 -- .../devel/src/Form/ToolbarSettingsForm.php | 118 - .../src/Plugin/Block/SwitchUserBlock.php | 286 -- .../src/Plugin/Derivative/DevelLocalTask.php | 106 - .../src/Plugin/Devel/Dumper/ChromePhp.php | 40 - .../src/Plugin/Devel/Dumper/DoctrineDebug.php | 69 - .../Plugin/Devel/Dumper/DrupalVariable.php | 61 - .../devel/src/Plugin/Devel/Dumper/FirePhp.php | 41 - .../src/Plugin/Devel/Dumper/VarDumper.php | 47 - .../devel/src/Plugin/Mail/DevelMailLog.php | 188 -- .../src/Plugin/Menu/DestinationMenuLink.php | 32 - .../src/Plugin/Menu/MenuItemMenuLink.php | 11 - .../src/Plugin/Menu/RouteDetailMenuLink.php | 29 - .../dev/devel/src/Render/FilteredMarkup.php | 23 - .../dev/devel/src/Routing/RouteSubscriber.php | 156 - .../contrib/dev/devel/src/ToolbarHandler.php | 181 -- .../dev/devel/src/Twig/Extension/Debug.php | 201 -- .../devel_dumper_test.info.yml | 12 - .../devel_dumper_test.libraries.yml | 7 - .../devel_dumper_test.routing.yml | 39 - .../src/Controller/DumperTestController.php | 89 - .../Devel/Dumper/AvailableTestDumper.php | 60 - .../Devel/Dumper/NotAvailableTestDumper.php | 41 - .../devel_entity_test.info.yml | 16 - .../devel_entity_test.links.task.yml | 2 - .../devel_entity_test.module | 29 - .../src/Entity/DevelEntityTestCanonical.php | 44 - .../src/Entity/DevelEntityTestEdit.php | 44 - .../src/Entity/DevelEntityTestNoLinks.php | 41 - .../Derivative/DevelEntityTestLocalTasks.php | 31 - .../modules/devel_test/devel_test.info.yml | 12 - .../modules/devel_test/devel_test.module | 20 - .../modules/devel_test/devel_test.routing.yml | 7 - .../devel_test/devel_test.services.yml | 6 - .../src/Controller/DevelTestController.php | 24 - .../src/Routing/TestRouteSubscriber.php | 20 - .../src/Functional/DevelContainerInfoTest.php | 261 -- .../src/Functional/DevelControllerTest.php | 122 - .../tests/src/Functional/DevelDumperTest.php | 165 - .../src/Functional/DevelElementInfoTest.php | 151 - .../Functional/DevelEntityTypeInfoTest.php | 158 - .../src/Functional/DevelErrorHandlerTest.php | 161 - .../src/Functional/DevelEventInfoTest.php | 135 - .../src/Functional/DevelLayoutInfoTest.php | 151 - .../src/Functional/DevelMenuLinksTest.php | 109 - .../Functional/DevelModulesReinstallTest.php | 60 - .../src/Functional/DevelRequirementsTest.php | 33 - .../src/Functional/DevelRouteInfoTest.php | 197 -- .../src/Functional/DevelRouterRebuildTest.php | 46 - .../src/Functional/DevelStateEditorTest.php | 209 -- .../src/Functional/DevelSwitchUserTest.php | 313 -- .../tests/src/Functional/DevelToolbarTest.php | 266 -- .../src/Functional/DevelWebAssertHelper.php | 34 - .../tests/src/Kernel/DevelDumperTestTrait.php | 127 - .../Kernel/DevelEnforcedDependenciesTest.php | 80 - .../tests/src/Kernel/DevelMailLogTest.php | 202 -- .../tests/src/Kernel/DevelQueryDebugTest.php | 127 - .../src/Kernel/DevelTwigExtensionTest.php | 203 -- .../devel/tests/src/Unish/DevelDrushTest.php | 31 - .../dev/devel/tests/src/Unish/README.md | 6 - .../contrib/dev/devel/webprofiler/README.md | 92 - .../dev/devel/webprofiler/composer.json | 15 - .../config/install/webprofiler.config.yml | 28 - .../config/schema/webprofiler.schema.yml | 35 - .../devel/webprofiler/console.services.yml | 14 - .../translations/en/webprofiler.benchmark.yml | 20 - .../translations/en/webprofiler.export.yml | 15 - .../translations/en/webprofiler.list.yml | 14 - .../translations/es/webprofiler.benchmark.yml | 20 - .../translations/es/webprofiler.export.yml | 15 - .../translations/es/webprofiler.list.yml | 14 - .../devel/webprofiler/css/app/dashboard.css | 582 ---- .../dev/devel/webprofiler/css/timeline.css | 106 - .../devel/webprofiler/images/caret-down.svg | 1 - .../js/app/collections/collectors.js | 35 - .../dev/devel/webprofiler/js/app/helpers.js | 107 - .../dev/devel/webprofiler/js/app/main.js | 105 - .../webprofiler/js/app/models/collector.js | 15 - .../webprofiler/js/app/routers/collectors.js | 48 - .../webprofiler/js/app/views/collector.js | 29 - .../js/app/views/collectorsList.js | 21 - .../devel/webprofiler/js/app/views/details.js | 20 - .../devel/webprofiler/js/app/views/layout.js | 83 - .../dev/devel/webprofiler/js/database.js | 68 - .../dev/devel/webprofiler/js/timeline.js | 223 -- .../src/Access/AccessManagerWrapper.php | 83 - .../Asset/CssCollectionRendererWrapper.php | 40 - .../src/Asset/JsCollectionRendererWrapper.php | 40 - .../src/Cache/CacheBackendWrapper.php | 176 -- .../src/Cache/CacheFactoryWrapper.php | 62 - .../src/Command/BenchmarkCommand.php | 311 -- .../webprofiler/src/Command/BenchmarkData.php | 57 - .../webprofiler/src/Command/ExportCommand.php | 160 - .../webprofiler/src/Command/ListCommand.php | 82 - .../src/Compiler/DecoratorPass.php | 33 - .../webprofiler/src/Compiler/ProfilerPass.php | 64 - .../webprofiler/src/Compiler/ServicePass.php | 108 - .../webprofiler/src/Compiler/StoragePass.php | 32 - .../src/Config/ConfigFactoryWrapper.php | 44 - .../src/Controller/DashboardController.php | 243 -- .../src/Controller/DatabaseController.php | 95 - .../src/Controller/ToolbarController.php | 110 - .../src/DataCollector/AssetsDataCollector.php | 107 - .../src/DataCollector/BlocksDataCollector.php | 149 - .../src/DataCollector/CacheDataCollector.php | 172 - .../src/DataCollector/ConfigDataCollector.php | 68 - .../DataCollector/DatabaseDataCollector.php | 264 -- .../src/DataCollector/DevelDataCollector.php | 103 - .../src/DataCollector/DrupalDataCollector.php | 134 - .../DrupalDataCollectorTrait.php | 120 - .../src/DataCollector/EventsDataCollector.php | 144 - .../DataCollector/ExtensionDataCollector.php | 156 - .../src/DataCollector/FormsDataCollector.php | 81 - .../src/DataCollector/HttpDataCollector.php | 175 -- .../src/DataCollector/MailDataCollector.php | 99 - .../PerformanceTimingDataCollector.php | 83 - .../DataCollector/PhpConfigDataCollector.php | 163 - .../DataCollector/RequestDataCollector.php | 113 - .../DataCollector/RoutingDataCollector.php | 91 - .../DataCollector/ServicesDataCollector.php | 162 - .../src/DataCollector/StateDataCollector.php | 65 - .../src/DataCollector/ThemeDataCollector.php | 257 -- .../src/DataCollector/TimeDataCollector.php | 157 - .../TranslationsDataCollector.php | 99 - .../src/DataCollector/UserDataCollector.php | 141 - .../src/DataCollector/ViewsDataCollector.php | 118 - .../dev/devel/webprofiler/src/Decorator.php | 94 - .../TraceableContainer.php | 66 - .../src/DrupalDataCollectorInterface.php | 67 - .../Config/ConfigEntityStorageDecorator.php | 221 -- .../Config/ImageStyleStorageDecorator.php | 33 - .../Config/RoleStorageDecorator.php | 19 - .../Config/ShortcutSetStorageDecorator.php | 56 - .../Config/VocabularyStorageDecorator.php | 19 - .../src/Entity/EntityDecorator.php | 24 - .../src/Entity/EntityManagerWrapper.php | 243 -- .../src/Entity/EntityViewBuilderDecorator.php | 92 - .../EventDispatcherTraceableInterface.php | 19 - .../TraceableEventDispatcher.php | 214 -- .../EventSubscriber/ProfilerSubscriber.php | 118 - .../WebprofilerEventSubscriber.php | 97 - .../devel/webprofiler/src/Form/ConfigForm.php | 238 -- .../src/Form/FormBuilderWrapper.php | 61 - .../src/Form/ProfilesFilterForm.php | 86 - .../src/Frontend/PerformanceTimingData.php | 81 - .../webprofiler/src/Helper/ClassShortener.php | 34 - .../src/Helper/ClassShortenerInterface.php | 17 - .../src/Helper/IdeLinkGenerator.php | 40 - .../src/Helper/IdeLinkGeneratorInterface.php | 17 - .../src/Http/HttpClientMiddleware.php | 94 - .../src/Mail/MailManagerWrapper.php | 104 - .../src/Profiler/DatabaseProfilerStorage.php | 158 - .../src/Profiler/FileProfilerStorage.php | 24 - .../webprofiler/src/Profiler/Profiler.php | 77 - .../src/Profiler/ProfilerStorageFactory.php | 26 - .../src/Profiler/ProfilerStorageManager.php | 52 - .../src/Profiler/TemplateManager.php | 130 - .../src/ProxyClass/Command/ListCommand.php | 325 -- .../WebprofilerRequestMatcher.php | 50 - .../src/Routing/TokenConverter.php | 46 - .../StackMiddleware/WebprofilerMiddleware.php | 41 - .../webprofiler/src/State/StateWrapper.php | 125 - .../dev/devel/webprofiler/src/Stopwatch.php | 543 ---- .../TranslationManagerWrapper.php | 69 - .../src/Theme/ThemeNegotiatorWrapper.php | 80 - .../src/Twig/Dumper/HtmlDumper.php | 35 - .../src/Twig/Extension/ProfilerExtension.php | 93 - .../src/Views/TraceableViewExecutable.php | 156 - .../Views/ViewExecutableFactoryWrapper.php | 47 - .../src/WebprofilerServiceProvider.php | 117 - .../templates/Collector/assets.html.twig | 133 - .../templates/Collector/blocks.html.twig | 113 - .../templates/Collector/cache.html.twig | 63 - .../templates/Collector/config.html.twig | 37 - .../templates/Collector/database.html.twig | 168 - .../templates/Collector/devel.html.twig | 24 - .../templates/Collector/drupal.html.twig | 66 - .../templates/Collector/events.html.twig | 88 - .../templates/Collector/extensions.html.twig | 95 - .../templates/Collector/forms.html.twig | 67 - .../templates/Collector/http.html.twig | 77 - .../templates/Collector/mail.html.twig | 76 - .../Collector/performance_timing.html.twig | 76 - .../templates/Collector/php_config.html.twig | 52 - .../templates/Collector/request.html.twig | 216 -- .../templates/Collector/routing.html.twig | 50 - .../templates/Collector/services.html.twig | 149 - .../templates/Collector/state.html.twig | 36 - .../templates/Collector/theme.html.twig | 147 - .../templates/Collector/time.html.twig | 59 - .../Collector/translations.html.twig | 85 - .../templates/Collector/user.html.twig | 63 - .../templates/Collector/views.html.twig | 58 - .../Profiler/webprofiler_dashboard.html.twig | 57 - .../Profiler/webprofiler_loader.html.twig | 73 - .../Profiler/webprofiler_panel.html.twig | 1 - .../Profiler/webprofiler_toolbar.css.twig | 311 -- .../Profiler/webprofiler_toolbar.html.twig | 35 - .../src/FunctionalJavascript/ToolbarTest.php | 79 - .../WebprofilerTestBase.php | 80 - .../tests/src/Kernel/DecoratorTest.php | 65 - .../DataCollector/AssetsDataCollectorTest.php | 68 - .../DataCollector/CacheDataCollectorTest.php | 69 - .../DataCollector/DataCollectorBaseTest.php | 40 - .../devel/webprofiler/webprofiler.info.yml | 16 - .../dev/devel/webprofiler/webprofiler.install | 188 -- .../webprofiler/webprofiler.libraries.yml | 63 - .../webprofiler/webprofiler.links.menu.yml | 5 - .../webprofiler/webprofiler.links.task.yml | 9 - .../devel/webprofiler/webprofiler.make.yml | 12 - .../dev/devel/webprofiler/webprofiler.module | 51 - .../webprofiler/webprofiler.permissions.yml | 7 - .../devel/webprofiler/webprofiler.routing.yml | 81 - .../webprofiler/webprofiler.services.yml | 262 -- .../modules/contrib/dev/entity/.travis.yml | 58 - .../modules/contrib/dev/entity/LICENSE.txt | 339 -- .../all/modules/contrib/dev/entity/README.txt | 13 - .../modules/contrib/dev/entity/composer.json | 10 - .../entity/config/schema/entity.schema.yml | 11 - .../contrib/dev/entity/entity.info.yml | 12 - .../dev/entity/entity.links.action.yml | 2 - .../contrib/dev/entity/entity.links.task.yml | 3 - .../modules/contrib/dev/entity/entity.module | 120 - .../contrib/dev/entity/entity.permissions.yml | 2 - .../contrib/dev/entity/entity.services.yml | 16 - .../contrib/dev/entity/entity.views.inc | 32 - .../EntityRevisionRouteAccessChecker.php | 175 -- .../src/BundleEntityAccessControlHandler.php | 49 - .../dev/entity/src/BundleFieldDefinition.php | 27 - .../src/BundlePlugin/BundlePluginHandler.php | 102 - .../BundlePluginHandlerInterface.php | 37 - .../BundlePlugin/BundlePluginInstaller.php | 94 - .../BundlePluginInstallerInterface.php | 34 - .../BundlePlugin/BundlePluginInterface.php | 24 - .../BundlePluginUninstallValidator.php | 76 - .../Controller/RevisionControllerTrait.php | 192 -- .../Controller/RevisionOverviewController.php | 160 - .../RevisionableEntityBundleInterface.php | 14 - .../entity/src/EntityAccessControlHandler.php | 60 - .../src/EntityAccessControlHandlerBase.php | 115 - .../entity/src/EntityPermissionProvider.php | 95 - .../src/EntityPermissionProviderBase.php | 233 -- .../src/EntityPermissionProviderInterface.php | 23 - .../dev/entity/src/EntityPermissions.php | 63 - .../dev/entity/src/EntityViewBuilder.php | 17 - .../entity/src/Form/DeleteMultipleForm.php | 14 - .../entity/src/Form/RevisionRevertForm.php | 174 - .../Form/RevisionableContentEntityForm.php | 165 - .../entity/src/Menu/EntityAddLocalAction.php | 81 - .../EntityCollectionLocalActionProvider.php | 47 - .../EntityLocalActionProviderInterface.php | 23 - .../entity/src/Plugin/Action/DeleteAction.php | 20 - .../Action/Derivative/DeleteActionDeriver.php | 82 - .../Derivative/EntityActionsDeriver.php | 58 - .../Derivative/RevisionsOverviewDeriver.php | 68 - .../dev/entity/src/QueryAccess/Condition.php | 113 - .../entity/src/QueryAccess/ConditionGroup.php | 227 -- .../src/QueryAccess/EntityQueryAlter.php | 181 -- .../src/QueryAccess/QueryAccessEvent.php | 92 - .../src/QueryAccess/QueryAccessHandler.php | 27 - .../QueryAccess/QueryAccessHandlerBase.php | 268 -- .../QueryAccessHandlerInterface.php | 41 - .../UncacheableQueryAccessHandler.php | 11 - .../src/QueryAccess/ViewsQueryAlter.php | 251 -- .../RevisionableContentEntityBase.php | 25 - .../src/Routing/AdminHtmlRouteProvider.php | 26 - .../src/Routing/DefaultHtmlRouteProvider.php | 26 - .../Routing/DeleteMultipleRouteProvider.php | 54 - .../src/Routing/RevisionRouteProvider.php | 127 - .../UncacheableEntityAccessControlHandler.php | 54 - .../UncacheableEntityPermissionProvider.php | 145 - ...odule_bundle_plugin_examples_test.info.yml | 13 - .../src/Plugin/BundlePluginTest/Second.php | 31 - .../entity_module_bundle_plugin_test.info.yml | 13 - ...ity_module_bundle_plugin_test.services.yml | 4 - .../src/Annotation/BundlePluginTest.php | 34 - .../src/BundlePluginTestManager.php | 35 - .../src/Entity/EntityTestBundlePlugin.php | 27 - .../BundlePluginTestInterface.php | 12 - .../src/Plugin/BundlePluginTest/First.php | 31 - ...ld.entity_test_enhanced.first.assigned.yml | 17 - ...d.entity_test_enhanced.second.assigned.yml | 17 - ....storage.entity_test_enhanced.assigned.yml | 20 - .../views.view.entity_test_enhanced.yml | 170 - ...ws.view.entity_test_enhanced_revisions.yml | 170 - ...s.view.entity_test_enhanced_with_owner.yml | 170 - ...ity_test_enhanced_with_owner_revisions.yml | 170 - .../entity_module_test.info.yml | 12 - .../entity_module_test.links.task.yml | 9 - .../entity_module_test.module | 15 - .../entity_module_test.permissions.yml | 3 - .../entity_module_test.services.yml | 5 - .../src/Entity/EnhancedEntity.php | 97 - .../src/Entity/EnhancedEntityWithOwner.php | 145 - .../EventSubscriber/QueryAccessSubscriber.php | 58 - .../Functional/CollectionRouteAccessTest.php | 71 - .../src/Functional/DeleteMultipleFormTest.php | 76 - .../Functional/Menu/EntityLocalActionTest.php | 44 - .../Functional/RevisionRouteAccessTest.php | 91 - .../tests/src/Kernel/BundlePluginTest.php | 146 - .../tests/src/Kernel/DeleteActionTest.php | 78 - .../Kernel/QueryAccess/ConditionGroupTest.php | 106 - .../QueryAccess/QueryAccessEventTest.php | 62 - .../QueryAccess/QueryAccessHandlerTest.php | 137 - .../Kernel/QueryAccess/QueryAccessTest.php | 343 -- .../UncacheableQueryAccessHandlerTest.php | 203 -- .../UncacheableQueryAccessTest.php | 511 --- .../tests/src/Kernel/RevisionBasicUITest.php | 185 -- .../RevisionOverviewIntegrationTest.php | 53 - .../BundleEntityAccessControlHandlerTest.php | 115 - .../Unit/EntityAccessControlHandlerTest.php | 249 -- .../src/Unit/EntityPermissionProviderTest.php | 185 -- .../src/Unit/QueryAccess/ConditionTest.php | 50 - ...acheableEntityAccessControlHandlerTest.php | 253 -- ...ncacheableEntityPermissionProviderTest.php | 190 -- .../contrib/dev/entity_delete/LICENSE.txt | 339 -- .../contrib/dev/entity_delete/README.txt | 20 - ...entity_delete.entitydeleteconfirmation.yml | 3 - .../dev/entity_delete/entity_delete.info.yml | 11 - .../entity_delete.links.menu.yml | 8 - .../entity_delete/entity_delete.routing.yml | 15 - .../dev/entity_delete/src/DeleteEntity.php | 29 - .../src/Form/EntityDeleteConfirmationForm.php | 131 - .../src/Form/EntityDeleteForm.php | 149 - .../dev/mobile_js_redirect/LICENSE.txt | 339 -- .../contrib/dev/mobile_js_redirect/README.txt | 14 - .../js/mobile_js_redirect.js | 46 - .../mobile_js_redirect.info.yml | 11 - .../mobile_js_redirect.libraries.yml | 7 - .../mobile_js_redirect.links.menu.yml | 6 - .../mobile_js_redirect.module | 90 - .../mobile_js_redirect.routing.yml | 7 - .../src/Form/MobileJsRedirectAdminForm.php | 87 - .../src/Tests/MobileJsRedirectTests.php | 89 - .../module_missing_message_fixer/LICENSE.txt | 339 -- .../module_missing_message_fixer/README.txt | 61 - .../composer.json | 28 - .../drush.services.yml | 11 - .../module_missing_message_fixer.drush.inc | 107 - .../module_missing_message_fixer.info.yml | 11 - ...odule_missing_message_fixer.links.menu.yml | 5 - .../module_missing_message_fixer.module | 6 - ...dule_missing_message_fixer.permissions.yml | 2 - .../module_missing_message_fixer.routing.yml | 7 - .../module_missing_message_fixer.services.yml | 4 - .../src/Commands/MmmfFixCommand.php | 131 - .../src/Commands/MmmfListCommand.php | 59 - .../Form/ModuleMissingMessageFixerForm.php | 158 - .../src/ModuleMissingMessageFixer.php | 175 -- .../all/modules/contrib/dev/redis/.gitignore | 1 - .../dev/redis/.travis-before-script.sh | 21 - .../all/modules/contrib/dev/redis/.travis.yml | 116 - .../all/modules/contrib/dev/redis/LICENSE.txt | 339 -- .../contrib/dev/redis/README.PhpRedis.txt | 52 - .../contrib/dev/redis/README.Predis.txt | 37 - sites/all/modules/contrib/dev/redis/README.md | 338 -- .../modules/contrib/dev/redis/composer.json | 13 - .../contrib/dev/redis/example.services.yml | 33 - .../modules/contrib/dev/redis/redis.info.yml | 12 - .../modules/contrib/dev/redis/redis.install | 40 - .../modules/contrib/dev/redis/redis.module | 28 - .../contrib/dev/redis/redis.services.yml | 18 - .../redis/src/Cache/CacheBackendFactory.php | 70 - .../contrib/dev/redis/src/Cache/CacheBase.php | 379 --- .../contrib/dev/redis/src/Cache/PhpRedis.php | 111 - .../contrib/dev/redis/src/Cache/Predis.php | 113 - .../src/Cache/RedisCacheTagsChecksum.php | 150 - .../contrib/dev/redis/src/Client/PhpRedis.php | 97 - .../contrib/dev/redis/src/Client/Predis.php | 61 - .../contrib/dev/redis/src/ClientFactory.php | 215 -- .../contrib/dev/redis/src/ClientInterface.php | 26 - .../dev/redis/src/Flood/FloodFactory.php | 49 - .../contrib/dev/redis/src/Flood/PhpRedis.php | 95 - .../contrib/dev/redis/src/Flood/Predis.php | 95 - .../dev/redis/src/Lock/LockFactory.php | 37 - .../contrib/dev/redis/src/Lock/PhpRedis.php | 144 - .../contrib/dev/redis/src/Lock/Predis.php | 133 - .../dev/redis/src/PersistentLock/PhpRedis.php | 26 - .../dev/redis/src/PersistentLock/Predis.php | 26 - .../contrib/dev/redis/src/Queue/PhpRedis.php | 148 - .../contrib/dev/redis/src/Queue/Predis.php | 152 - .../contrib/dev/redis/src/Queue/QueueBase.php | 96 - .../dev/redis/src/Queue/QueueRedisFactory.php | 56 - .../dev/redis/src/Queue/ReliablePhpRedis.php | 153 - .../dev/redis/src/Queue/ReliablePredis.php | 156 - .../dev/redis/src/Queue/ReliableQueueBase.php | 14 - .../src/Queue/ReliableQueueRedisFactory.php | 17 - .../dev/redis/src/RedisPrefixTrait.php | 89 - .../Lock/RedisLockFunctionalTest.php | 89 - .../redis/tests/src/Functional/WebTest.php | 192 -- .../redis/tests/src/Kernel/RedisCacheTest.php | 49 - .../redis/tests/src/Kernel/RedisFloodTest.php | 58 - .../redis/tests/src/Kernel/RedisLockTest.php | 66 - .../redis/tests/src/Kernel/RedisQueueTest.php | 95 - .../src/Traits/RedisTestInterfaceTrait.php | 36 - .../all/modules/contrib/dev/token/.travis.yml | 96 - .../all/modules/contrib/dev/token/LICENSE.txt | 339 -- sites/all/modules/contrib/dev/token/README.md | 52 - .../dev/token/css/jquery.treetable.css | 28 - .../modules/contrib/dev/token/css/token.css | 32 - .../dev/token/css/token.treetable.theme.css | 50 - .../contrib/dev/token/js/jquery.treetable.js | 629 ---- .../all/modules/contrib/dev/token/js/token.js | 93 - .../TokenAutocompleteController.php | 77 - .../src/Controller/TokenCacheController.php | 21 - .../src/Controller/TokenDevelController.php | 109 - .../src/Controller/TokenTreeController.php | 67 - .../dev/token/src/Element/TokenTreeTable.php | 155 - .../src/Plugin/Derivative/DevelLocalTask.php | 56 - .../dev/token/src/Routing/RouteSubscriber.php | 75 - .../dev/token/src/Tests/TokenBlockTest.php | 73 - .../token/src/Tests/TokenCurrentPageTest.php | 66 - .../dev/token/src/Tests/TokenFieldUiTest.php | 282 -- .../dev/token/src/Tests/TokenMenuTest.php | 459 --- .../dev/token/src/Tests/TokenTestBase.php | 21 - .../dev/token/src/Tests/TokenTestTrait.php | 111 - .../dev/token/src/Tests/TokenURLTest.php | 51 - .../dev/token/src/Tests/TokenUserTest.php | 127 - .../token/src/Tests/Tree/AutocompleteTest.php | 61 - .../dev/token/src/Tests/Tree/HelpPageTest.php | 69 - .../src/Tests/Tree/TokenTreeTestTrait.php | 131 - .../dev/token/src/Tests/Tree/TreeTest.php | 148 - .../modules/contrib/dev/token/src/Token.php | 213 -- .../dev/token/src/TokenEntityMapper.php | 82 - .../token/src/TokenEntityMapperInterface.php | 53 - .../contrib/dev/token/src/TokenInterface.php | 75 - .../dev/token/src/TokenServiceProvider.php | 20 - .../contrib/dev/token/src/TreeBuilder.php | 267 -- .../dev/token/src/TreeBuilderInterface.php | 79 - .../token/templates/token-tree-link.html.twig | 19 - .../core.date_format.token_module_test.yml | 6 - .../Controller/TokenTreeBrowseController.php | 37 - .../views.view.token_views_test.yml | 130 - .../token_module_test.info.yml | 12 - .../token_module_test.module | 33 - .../token_module_test.routing.yml | 7 - .../token_module_test.tokens.inc | 13 - ....entity_form_display.user.user.default.yml | 23 - .../field.field.user.user.user_picture.yml | 31 - .../field.storage.user.user_picture.yml | 25 - .../token_user_picture.info.yml | 14 - .../token/tests/src/Functional/UrlTest.php | 137 - .../dev/token/tests/src/Kernel/ArrayTest.php | 61 - .../dev/token/tests/src/Kernel/BookTest.php | 108 - .../token/tests/src/Kernel/CommentTest.php | 101 - .../dev/token/tests/src/Kernel/DateTest.php | 36 - .../dev/token/tests/src/Kernel/EntityTest.php | 106 - .../dev/token/tests/src/Kernel/FieldTest.php | 731 ----- .../dev/token/tests/src/Kernel/FileTest.php | 57 - .../token/tests/src/Kernel/KernelTestBase.php | 33 - .../dev/token/tests/src/Kernel/NodeTest.php | 100 - .../dev/token/tests/src/Kernel/RandomTest.php | 28 - .../token/tests/src/Kernel/TaxonomyTest.php | 154 - .../dev/token/tests/src/Kernel/UnitTest.php | 120 - .../dev/token/tests/src/Kernel/UrlTest.php | 88 - .../dev/token/tests/src/Kernel/ViewsTest.php | 50 - .../modules/contrib/dev/token/token.drush.inc | 20 - .../modules/contrib/dev/token/token.info.yml | 12 - .../modules/contrib/dev/token/token.install | 316 -- .../contrib/dev/token/token.libraries.yml | 25 - .../contrib/dev/token/token.links.task.yml | 3 - .../modules/contrib/dev/token/token.module | 793 ----- .../modules/contrib/dev/token/token.pages.inc | 61 - .../contrib/dev/token/token.routing.yml | 22 - .../contrib/dev/token/token.services.yml | 12 - .../contrib/dev/token/token.tokens.inc | 1786 ----------- .../contrib/fields/addtoany/LICENSE.txt | 339 -- .../contrib/fields/addtoany/README.txt | 53 - .../contrib/fields/addtoany/addtoany.api.php | 21 - .../addtoany/addtoany.config_translation.yml | 5 - .../contrib/fields/addtoany/addtoany.info.yml | 14 - .../contrib/fields/addtoany/addtoany.install | 132 - .../fields/addtoany/addtoany.libraries.yml | 21 - .../fields/addtoany/addtoany.links.menu.yml | 5 - .../fields/addtoany/addtoany.links.task.yml | 4 - .../contrib/fields/addtoany/addtoany.module | 280 -- .../fields/addtoany/addtoany.permissions.yml | 4 - .../fields/addtoany/addtoany.routing.yml | 7 - .../fields/addtoany/addtoany.views.inc | 21 - .../config/install/addtoany.settings.yml | 15 - .../config/schema/addtoany.schema.yml | 28 - .../fields/addtoany/css/addtoany.admin.css | 16 - .../contrib/fields/addtoany/css/addtoany.css | 54 - .../fields/addtoany/images/a2a_32_32.png | Bin 104 -> 0 bytes .../fields/addtoany/images/a2a_32_32.svg | 1 - .../fields/addtoany/js/addtoany.admin.js | 33 - .../contrib/fields/addtoany/js/addtoany.js | 14 - .../src/Form/AddToAnySettingsForm.php | 305 -- .../src/Plugin/Block/AddToAnyBlock.php | 42 - .../Plugin/views/field/NodeAddToAnyShare.php | 44 - .../templates/addtoany-standard.html.twig | 45 - .../contrib/fields/audiofield/.eslintrc.json | 11 - .../contrib/fields/audiofield/LICENSE.txt | 339 -- .../contrib/fields/audiofield/README.md | 141 - .../fields/audiofield/audiofield.info.yml | 12 - .../fields/audiofield/audiofield.install | 98 - .../audiofield/audiofield.libraries.yml | 225 -- .../fields/audiofield/audiofield.module | 155 - .../fields/audiofield/audiofield.services.yml | 4 - .../contrib/fields/audiofield/composer.json | 25 - .../audiofield/css/audiofield.audiojs.css | 200 -- .../fields/audiofield/css/audiofield.css | 21 - .../css/audiofield.mediaelement.css | 6 - .../audiofield/css/audiofield.projekktor.css | 18 - .../audiofield/css/audiofield.wavesurfer.css | 40 - .../fields/audiofield/drush.services.yml | 7 - .../audiofield/drush/audiofield.drush.inc | 252 -- .../audiofield/js/audiojs.builder.es6.js | 80 - .../fields/audiofield/js/audiojs.builder.js | 62 - .../audiofield/js/jplayer.builder.es6.js | 169 - .../fields/audiofield/js/jplayer.builder.js | 114 - .../js/jplayer.circleplayer.fix.es6.js | 9 - .../audiofield/js/jplayer.circleplayer.fix.js | 8 - .../audiofield/js/mediaelement.builder.es6.js | 50 - .../audiofield/js/mediaelement.builder.js | 31 - .../audiofield/js/projekktor.builder.es6.js | 60 - .../audiofield/js/projekktor.builder.js | 41 - .../audiofield/js/soundmanager.builder.es6.js | 30 - .../audiofield/js/soundmanager.builder.js | 22 - .../audiofield/js/wavesurfer.builder.es6.js | 260 -- .../audiofield/js/wavesurfer.builder.js | 179 -- .../audiofield/js/wordpress.builder.es6.js | 64 - .../fields/audiofield/js/wordpress.builder.js | 46 - .../audiofield/src/Annotation/AudioPlayer.php | 60 - .../src/AudioFieldPlayerManager.php | 32 - .../audiofield/src/AudioFieldPluginBase.php | 555 ---- .../src/Commands/AudiofieldCommands.php | 268 -- .../Plugin/AudioPlayer/AudioJsAudioPlayer.php | 77 - .../Plugin/AudioPlayer/DefaultMp3Player.php | 46 - .../Plugin/AudioPlayer/JPlayerAudioPlayer.php | 182 -- .../AudioPlayer/MediaElementAudioPlayer.php | 84 - .../AudioPlayer/ProjekktorAudioPlayer.php | 86 - .../AudioPlayer/SoundManagerAudioPlayer.php | 82 - .../AudioPlayer/WavesurferAudioPlayer.php | 104 - .../AudioPlayer/WordPressAudioPlayer.php | 112 - .../AudioFieldFieldFormatter.php | 598 ---- .../audiofield-download-links.html.twig | 19 - .../templates/audioplayer--audiojs.html.twig | 40 - ...layer--jplayer--default-multiple.html.twig | 65 - ...oplayer--jplayer--default-single.html.twig | 53 - ...oplayer--jplayer--jplayer-circle.html.twig | 43 - .../templates/audioplayer--jplayer.html.twig | 39 - .../audioplayer--mediaelement.html.twig | 27 - .../audioplayer--projekktor.html.twig | 25 - ...audioplayer--soundmanager--barui.html.twig | 76 - ...ayer--soundmanager--inlineplayer.html.twig | 23 - ...oplayer--soundmanager--player360.html.twig | 21 - .../audioplayer--soundmanager.html.twig | 24 - ...udioplayer--wavesurfer--playlist.html.twig | 29 - .../audioplayer--wavesurfer.html.twig | 24 - .../audioplayer--wordpress.html.twig | 21 - .../templates/audioplayer.html.twig | 25 - .../contrib/fields/color_field/.gitignore | 1 - .../contrib/fields/color_field/LICENSE.txt | 339 -- .../contrib/fields/color_field/README.md | 123 - .../fields/color_field/color_field.info.yml | 15 - .../fields/color_field/color_field.install | 53 - .../color_field/color_field.libraries.yml | 55 - .../fields/color_field/color_field.module | 74 - .../color_field/color_field.post_update.php | 37 - .../contrib/fields/color_field/composer.json | 36 - .../config/schema/color_field.schema.yml | 135 - .../css/color_field_formatter_swatch.css | 16 - .../css/color_field_widget_box.css | 30 - .../css/color_field_widget_grid.css | 4 - .../contrib/fields/color_field/drupalci.yml | 50 - .../color_field/images/transparent_box16.gif | Bin 1286 -> 0 bytes .../color_field/images/transparent_box32.gif | Bin 1901 -> 0 bytes .../js/color_field_widget_box.jquery.js | 44 - .../color_field/js/color_field_widget_box.js | 71 - .../js/color_field_widget_grid.jquery.js | 38 - .../js/color_field_widget_spectrum.jquery.js | 76 - .../fields/color_field/src/ColorBase.php | 192 -- .../fields/color_field/src/ColorCMY.php | 120 - .../fields/color_field/src/ColorCMYK.php | 137 - .../fields/color_field/src/ColorHex.php | 87 - .../fields/color_field/src/ColorInterface.php | 39 - .../fields/color_field/src/ColorRGB.php | 126 - .../FieldFormatter/ColorFieldFormatterCss.php | 217 -- .../ColorFieldFormatterSwatch.php | 166 - .../ColorFieldFormatterText.php | 146 - .../Plugin/Field/FieldType/ColorFieldType.php | 254 -- .../FieldWidget/ColorFieldWidgetBase.php | 61 - .../Field/FieldWidget/ColorFieldWidgetBox.php | 130 - .../FieldWidget/ColorFieldWidgetDefault.php | 89 - .../FieldWidget/ColorFieldWidgetGrid.php | 156 - .../FieldWidget/ColorFieldWidgetHTML5.php | 57 - .../FieldWidget/ColorFieldWidgetSpectrum.php | 144 - .../color-field-formatter-swatch.html.twig | 19 - .../Functional/ColorFieldFormatterTest.php | 203 -- .../ColorFieldFormatterTokenTest.php | 95 - .../ColorFieldFunctionalTestBase.php | 69 - .../src/Functional/ColorFieldWidgetTest.php | 45 - .../ColorFieldWidgetJavascriptTests.php | 260 -- .../tests/src/Kernel/ColorFieldTypeTest.php | 113 - .../fields/date_range_formatter/LICENSE.txt | 339 -- .../date_range_formatter.info.yml | 12 - .../date_range_formatter.module | 1 - .../DateRangeFormatterRangeFormatter.php | 151 - .../contrib/fields/field_group/CHANGELOG.txt | 17 - .../contrib/fields/field_group/LICENSE.txt | 339 -- .../contrib/fields/field_group/README.txt | 50 - .../contrib/fields/field_group/composer.json | 8 - .../field_group.entity_display.schema.yml | 61 - ...up.field_group_formatter_plugin.schema.yml | 105 - .../field_group_migrate.info.yml | 14 - .../d6_field_group_entity_form_display.yml | 41 - .../d6_field_group_entity_view_display.yml | 39 - .../migration_templates/d7_field_group.yml | 28 - .../FieldGroupEntityFormDisplay.php | 39 - .../FieldGroupEntityViewDisplay.php | 43 - .../migrate/destination/d7/FieldGroup.php | 97 - .../Plugin/migrate/source/d6/FieldGroup.php | 188 -- .../Plugin/migrate/source/d7/FieldGroup.php | 104 - .../tests/fixtures/drupal7.php | 147 - .../Migrate/d7/MigrateFieldGroupTest.php | 120 - .../src/Unit/Migrate/d7/FieldGroupTest.php | 102 - .../field_group/css/field_group.field_ui.css | 14 - .../fields/field_group/field_group.info.yml | 13 - .../field_group/field_group.libraries.yml | 63 - .../field_group/field_group.links.action.yml | 3 - .../fields/field_group/field_group.module | 810 ----- .../field_group/field_group.services.yml | 13 - .../formatters/accordion/accordion.js | 68 - .../field_group/formatters/details/details.js | 23 - .../formatters/fieldset/fieldset.js | 24 - .../formatters/html_element/html-element.js | 69 - .../formatters/tabs/horizontal-tabs.css | 129 - .../formatters/tabs/horizontal-tabs.js | 248 -- .../field_group/formatters/tabs/tabs.js | 39 - .../fields/field_group/includes/field_ui.inc | 614 ---- .../fields/field_group/includes/helpers.inc | 64 - .../field_group/js/field_group.field_ui.js | 123 - .../fields/field_group/js/field_group.js | 58 - .../src/Annotation/FieldGroupFormatter.php | 80 - .../field_group/src/Element/Accordion.php | 57 - .../field_group/src/Element/AccordionItem.php | 24 - .../src/Element/HorizontalTabs.php | 88 - .../field_group/src/Element/HtmlElement.php | 67 - .../src/FieldGroupFormatterBase.php | 179 -- .../src/FieldGroupFormatterInterface.php | 58 - .../src/FieldGroupFormatterPluginManager.php | 143 - .../fields/field_group/src/FieldgroupUi.php | 97 - .../src/Form/FieldGroupAddForm.php | 276 -- .../src/Form/FieldGroupDeleteForm.php | 82 - .../Derivative/FieldGroupLocalAction.php | 106 - .../FieldGroupFormatter/Accordion.php | 89 - .../FieldGroupFormatter/AccordionItem.php | 119 - .../FieldGroupFormatter/Details.php | 118 - .../FieldGroupFormatter/Fieldset.php | 123 - .../FieldGroupFormatter/HtmlElement.php | 220 -- .../field_group/FieldGroupFormatter/Tab.php | 123 - .../field_group/FieldGroupFormatter/Tabs.php | 139 - .../src/Routing/FieldGroupConverter.php | 32 - .../src/Routing/RouteSubscriber.php | 161 - .../field-group-accordion-item.html.twig | 39 - .../templates/field-group-accordion.html.twig | 21 - .../field-group-html-element.html.twig | 30 - .../templates/horizontal-tabs.html.twig | 15 - .../fields/field_group/templates/theme.inc | 94 - .../field_group_test.info.yml | 11 - .../field_group_test/field_group_test.module | 27 - .../src/Functional/EntityDisplayTest.php | 346 -- .../src/Functional/FieldGroupTestTrait.php | 59 - .../FieldGroupWithoutFieldUiTest.php | 30 - .../src/Functional/ManageDisplayTest.php | 158 - .../FunctionalJavascript/FieldGroupUiTest.php | 105 - .../fields/filefield_sources/LICENSE.txt | 339 -- .../fields/filefield_sources/README.txt | 43 - .../filefield_sources.data_types.schema.yml | 5 - .../schema/filefield_sources.schema.yml | 9 - ...d_sources.setting.source_attach.schema.yml | 13 - ...eld_sources.setting.source_imce.schema.yml | 7 - ...ources.setting.source_reference.schema.yml | 10 - ...lefield_sources.setting.sources.schema.yml | 5 - ...filefield_sources.source.attach.schema.yml | 3 - ...efield_sources.source.clipboard.schema.yml | 3 - .../filefield_sources.source.imce.schema.yml | 3 - ...efield_sources.source.reference.schema.yml | 3 - ...filefield_sources.source.remote.schema.yml | 3 - ...filefield_sources.source.upload.schema.yml | 5 - .../css/filefield_sources.css | 44 - .../filefield_sources.api.php | 42 - .../filefield_sources.info.yml | 14 - .../filefield_sources.install | 23 - .../filefield_sources.libraries.yml | 9 - .../filefield_sources.module | 771 ----- .../filefield_sources.routing.yml | 2 - .../filefield_sources.services.yml | 12 - .../filefield_sources/js/filefield_sources.js | 262 -- .../src/Access/FieldAccessCheck.php | 38 - .../src/Annotation/FilefieldSource.php | 62 - .../src/Controller/ImceController.php | 111 - .../MimeType/ExtensionMimeTypeGuesser.php | 75 - .../src/FilefieldSourceInterface.php | 55 - .../src/FilefieldSourceManager.php | 54 - .../src/FilefieldSourcesServiceProvider.php | 26 - .../filefield_sources/src/ImceScanner.php | 102 - .../src/Plugin/FilefieldSource/Attach.php | 356 --- .../src/Plugin/FilefieldSource/Clipboard.php | 152 - .../src/Plugin/FilefieldSource/Imce.php | 216 -- .../src/Plugin/FilefieldSource/Reference.php | 239 -- .../src/Plugin/FilefieldSource/Remote.php | 400 --- .../MimeType/ExtensionMimeTypeGuesser.php | 108 - .../src/Routing/FilefieldSourcesRoutes.php | 35 - .../src/Tests/AttachSourceTest.php | 168 - .../src/Tests/ClipboardSourceTest.php | 37 - .../src/Tests/EmptyValuesTest.php | 90 - .../src/Tests/FileFieldSourcesTestBase.php | 450 --- .../src/Tests/ImceSourceTest.php | 52 - .../src/Tests/MultipleValuesTest.php | 133 - .../src/Tests/ReferenceSourceTest.php | 109 - .../src/Tests/RemoteSourceTest.php | 38 - .../src/Tests/UploadSourceTest.php | 62 - .../modules/contrib/fields/linkit/LICENSE.txt | 339 -- .../modules/contrib/fields/linkit/README.md | 54 - .../contrib/fields/linkit/composer.json | 19 - .../image.style.linkit_result_thumbnail.yml | 13 - .../linkit.linkit_profile.default.yml | 19 - .../linkit/config/schema/linkit.schema.yml | 114 - .../fields/linkit/css/linkit.admin.theme.css | 14 - .../fields/linkit/css/linkit.autocomplete.css | 77 - .../fields/linkit/images/throbber-active.gif | Bin 1275 -> 0 bytes .../linkit/images/throbber-inactive.png | Bin 356 -> 0 bytes .../contrib/fields/linkit/js/autocomplete.js | 215 -- .../linkit/js/linkit.filter_html.admin.js | 51 - .../contrib/fields/linkit/js/linkit.js | 15 - .../contrib/fields/linkit/linkit.info.yml | 14 - .../contrib/fields/linkit/linkit.install | 195 -- .../fields/linkit/linkit.libraries.yml | 32 - .../fields/linkit/linkit.links.action.yml | 11 - .../fields/linkit/linkit.links.menu.yml | 5 - .../fields/linkit/linkit.links.task.yml | 10 - .../contrib/fields/linkit/linkit.module | 153 - .../fields/linkit/linkit.permissions.yml | 2 - .../contrib/fields/linkit/linkit.routing.yml | 71 - .../contrib/fields/linkit/linkit.services.yml | 10 - .../fields/linkit/src/Annotation/Matcher.php | 35 - .../linkit/src/Annotation/Substitution.php | 28 - .../linkit/src/ConfigurableMatcherBase.php | 11 - .../src/ConfigurableMatcherInterface.php | 18 - .../src/Controller/AutocompleteController.php | 94 - .../src/Controller/LinkitController.php | 43 - .../fields/linkit/src/Element/Linkit.php | 92 - .../fields/linkit/src/Entity/Profile.php | 158 - .../linkit/src/Form/Matcher/AddForm.php | 155 - .../linkit/src/Form/Matcher/DeleteForm.php | 85 - .../linkit/src/Form/Matcher/EditForm.php | 88 - .../linkit/src/Form/Matcher/OverviewForm.php | 160 - .../linkit/src/Form/Profile/AddForm.php | 23 - .../linkit/src/Form/Profile/EditForm.php | 24 - .../linkit/src/Form/Profile/FormBase.php | 85 - .../contrib/fields/linkit/src/MatcherBase.php | 126 - .../fields/linkit/src/MatcherCollection.php | 32 - .../fields/linkit/src/MatcherInterface.php | 71 - .../fields/linkit/src/MatcherManager.php | 24 - .../fields/linkit/src/MatcherTokensTrait.php | 67 - .../CKEditorPlugin/LinkitDrupalLink.php | 111 - .../Derivative/EntityMatcherDeriver.php | 66 - .../linkit/src/Plugin/Filter/LinkitFilter.php | 156 - .../Linkit/Matcher/ContactFormMatcher.php | 38 - .../Plugin/Linkit/Matcher/EmailMatcher.php | 40 - .../Plugin/Linkit/Matcher/EntityMatcher.php | 523 ---- .../src/Plugin/Linkit/Matcher/FileMatcher.php | 232 -- .../Linkit/Matcher/FrontPageMatcher.php | 40 - .../src/Plugin/Linkit/Matcher/NodeMatcher.php | 114 - .../src/Plugin/Linkit/Matcher/TermMatcher.php | 47 - .../src/Plugin/Linkit/Matcher/UserMatcher.php | 127 - .../Plugin/Linkit/Substitution/Canonical.php | 34 - .../src/Plugin/Linkit/Substitution/File.php | 39 - .../src/Plugin/Linkit/Substitution/Media.php | 75 - .../fields/linkit/src/ProfileInterface.php | 82 - .../fields/linkit/src/ProfileListBuilder.php | 60 - .../linkit/src/SubstitutionInterface.php | 36 - .../fields/linkit/src/SubstitutionManager.php | 77 - .../src/SubstitutionManagerInterface.php | 28 - .../src/Suggestion/DescriptionSuggestion.php | 44 - .../src/Suggestion/EntitySuggestion.php | 81 - .../src/Suggestion/SimpleSuggestion.php | 87 - .../src/Suggestion/SuggestionCollection.php | 56 - .../SuggestionDescriptionInterface.php | 28 - .../src/Suggestion/SuggestionInterface.php | 64 - .../fields/linkit/src/SuggestionManager.php | 63 - .../linkit/src/Tests/ProfileCreationTrait.php | 43 - .../src/Tests/Update/LinkitUpdateTest.php | 152 - .../fields/linkit/src/Utility/LinkitXss.php | 29 - .../update/editor.editor.format_1.yml | 54 - .../update/editor.editor.format_2.yml | 53 - .../update/editor.editor.format_3.yml | 25 - .../update/filter.format.format_1.yml | 17 - .../update/filter.format.format_2.yml | 8 - .../update/filter.format.format_3.yml | 17 - .../fixtures/update/linkit-additions.php | 73 - .../linkit.linkit_profile.test_profile.yml | 47 - ....linkit_profile.test_profile_with_imce.yml | 24 - .../config/schema/linkit_test.schema.yml | 8 - .../tests/linkit_test/linkit_test.info.yml | 16 - .../tests/linkit_test/linkit_test.module | 6 - .../tests/linkit_test/linkit_test.routing.yml | 0 .../Matcher/ConfigurableDummyMatcher.php | 71 - .../Plugin/Linkit/Matcher/DummyMatcher.php | 34 - .../Controllers/LinkitControllerTest.php | 60 - .../src/Functional/LinkitBrowserTestBase.php | 48 - .../tests/src/Functional/MatcherAdminTest.php | 138 - .../tests/src/Functional/ProfileAdminTest.php | 127 - .../FunctionalJavascript/LinkitDialogTest.php | 320 -- .../LinkitFormatAdminTest.php | 59 - .../src/Kernel/AssertLinkitFilterTrait.php | 83 - .../tests/src/Kernel/Entity/ProfileTest.php | 32 - .../src/Kernel/EntityMatcherDeriverTest.php | 49 - .../src/Kernel/LinkitAutocompleteTest.php | 281 -- .../src/Kernel/LinkitEditorLinkDialogTest.php | 243 -- .../src/Kernel/LinkitFilterEntityTest.php | 148 - .../tests/src/Kernel/LinkitKernelTestBase.php | 71 - .../Matchers/ContactFormMatcherTest.php | 58 - .../src/Kernel/Matchers/FileMatcherTest.php | 113 - .../src/Kernel/Matchers/NodeMatcherTest.php | 183 -- .../src/Kernel/Matchers/TermMatcherTest.php | 158 - .../src/Kernel/Matchers/UserMatcherTest.php | 138 - .../src/Kernel/SubstitutionPluginTest.php | 181 -- .../filters/url_to_video_filter/.gitignore | 3 - .../filters/url_to_video_filter/LICENSE.txt | 339 -- .../filters/url_to_video_filter/README.txt | 19 - .../css/url_to_video_embed.css | 54 - .../css/url_to_video_embed.scss | 72 - .../images/ajax-loader.gif | Bin 8787 -> 0 bytes .../url_to_video_filter/images/no-js.png | Bin 2572 -> 0 bytes .../images/play-button.png | Bin 2473 -> 0 bytes .../url_to_video_filter/js/vimeo_embed.js | 113 - .../url_to_video_filter/js/youtube_embed.js | 100 - .../src/Plugin/Filter/FilterUrlToVideo.php | 157 - .../src/Service/UrlToVideoFilterService.php | 161 - .../UrlToVideoFilterServiceInterface.php | 38 - ...lToVideoFilterFunctionalJavascriptTest.php | 189 -- ...ideoFilterFunctionalJavascriptTestBase.php | 115 - .../Service/UrlToVideoFilterServiceTest.php | 71 - .../url_to_video_filter.info.yml | 10 - .../url_to_video_filter.libraries.yml | 24 - .../url_to_video_filter.services.yml | 6 - .../modules/contrib/mail/maillog/LICENSE.txt | 339 -- .../modules/contrib/mail/maillog/README.txt | 4 - .../config/install/maillog.settings.yml | 3 - .../install/views.view.maillog_overview.yml | 441 --- .../maillog/config/schema/maillog.schema.yml | 12 - .../contrib/mail/maillog/maillog.info.yml | 16 - .../contrib/mail/maillog/maillog.install | 93 - .../mail/maillog/maillog.links.menu.yml | 5 - .../contrib/mail/maillog/maillog.module | 28 - .../mail/maillog/maillog.permissions.yml | 10 - .../contrib/mail/maillog/maillog.routing.yml | 30 - .../contrib/mail/maillog/maillog.views.inc | 192 -- .../src/Controller/MaillogController.php | 132 - .../src/Form/MaillogClearConfirmForm.php | 64 - .../maillog/src/Form/MaillogSettingsForm.php | 108 - .../mail/maillog/src/Plugin/Mail/Maillog.php | 104 - .../Plugin/views/field/MaillogFieldDelete.php | 38 - .../maillog/src/Tests/Mail/MailUiTest.php | 149 - .../maillog_test/maillog_test.info.yml | 12 - .../modules/maillog_test/maillog_test.module | 34 - .../maillog/tests/src/Kernel/MailTest.php | 98 - .../contrib/migrate/migrate_plus/LICENSE.txt | 339 -- .../contrib/migrate/migrate_plus/README.txt | 77 - .../migrate/migrate_plus/composer.json | 24 - .../schema/migrate_plus.data_types.schema.yml | 68 - .../migrate_plus.destination.schema.yml | 21 - .../schema/migrate_plus.process.schema.yml | 145 - .../config/schema/migrate_plus.schema.yml | 78 - .../schema/migrate_plus.source.schema.yml | 34 - .../contrib/migrate/migrate_plus/drupalci.yml | 20 - .../migrate_plus/migrate_example/README.txt | 111 - .../migrate_plus.migration.beer_node.yml | 55 - .../migrate_plus.migration.beer_term.yml | 91 - .../migrate_plus.migration.beer_user.yml | 107 - .../migrate_plus.migration_group.beer.yml | 38 - .../migrate_example/migrate_example.info.yml | 17 - .../install/comment.type.node_comments.yml | 7 - ..._display.comment.node_comments.default.yml | 30 - ...play.node.migrate_example_beer.default.yml | 87 - ..._display.comment.node_comments.default.yml | 22 - ...play.node.migrate_example_beer.default.yml | 60 - ...splay.node.migrate_example_beer.teaser.yml | 35 - ...eld.comment.node_comments.comment_body.yml | 20 - ...d.field.node.migrate_example_beer.body.yml | 21 - ...de.migrate_example_beer.field_comments.yml | 32 - ..._beer.field_migrate_example_beer_style.yml | 26 - ...ple_beer.field_migrate_example_country.yml | 18 - ...ample_beer.field_migrate_example_image.yml | 37 - ...er.user.field_migrate_example_favbeers.yml | 27 - ...user.user.field_migrate_example_gender.yml | 19 - .../field.storage.node.field_comments.yml | 19 - ....node.field_migrate_example_beer_style.yml | 19 - ...age.node.field_migrate_example_country.yml | 20 - ...orage.node.field_migrate_example_image.yml | 29 - ...ge.user.field_migrate_example_favbeers.yml | 19 - ...rage.user.field_migrate_example_gender.yml | 20 - .../node.type.migrate_example_beer.yml | 9 - ...vocabulary.migrate_example_beer_styles.yml | 8 - .../migrate_example_setup.info.yml | 18 - .../migrate_example_setup.install | 502 --- .../migrations/beer_comment.yml | 45 - .../src/Plugin/migrate/source/BeerComment.php | 65 - .../src/Plugin/migrate/source/BeerNode.php | 105 - .../src/Plugin/migrate/source/BeerTerm.php | 84 - .../src/Plugin/migrate/source/BeerUser.php | 90 - .../migrate_example_advanced/README.txt | 58 - .../migrate_plus.migration.weather_soap.yml | 56 - .../migrate_plus.migration.wine_role_json.yml | 58 - .../migrate_plus.migration.wine_role_xml.yml | 54 - .../migrate_plus.migration.wine_terms.yml | 39 - ..._plus.migration.wine_variety_multi_xml.yml | 71 - .../migrate_plus.migration_group.wine.yml | 11 - .../migrate_example_advanced/data/0001.xml | 7 - .../migrate_example_advanced/data/0002.xml | 7 - .../migrate_example_advanced/data/index.xml | 4 - .../migrate_example_advanced/data/index2.xml | 4 - .../migrate_example_advanced.info.yml | 15 - .../migrate_example_advanced.install | 58 - ....type.migrate_example_advanced_comment.yml | 7 - ...grate_example_advanced_comment.default.yml | 30 - ....node.migrate_example_producer.default.yml | 69 - ...play.node.migrate_example_wine.default.yml | 117 - ...migrate_example_wine_varieties.default.yml | 41 - ...grate_example_advanced_comment.default.yml | 22 - ....node.migrate_example_producer.default.yml | 33 - ...y.node.migrate_example_producer.teaser.yml | 27 - ...play.node.migrate_example_wine.default.yml | 88 - ...splay.node.migrate_example_wine.teaser.yml | 39 - ...migrate_example_wine_varieties.default.yml | 27 - ..._example_advanced_comment.comment_body.yml | 20 - ...eld.node.migrate_example_producer.body.yml | 21 - ...ducer.field_migrate_example_wine_regio.yml | 26 - ...d.field.node.migrate_example_wine.body.yml | 21 - ...e_wine.field_migrate_example_adv_image.yml | 37 - ...le_wine.field_migrate_example_comments.yml | 32 - ..._wine.field_migrate_example_top_vintag.yml | 22 - ...e_wine.field_migrate_example_wine_best.yml | 26 - ..._wine.field_migrate_example_wine_ratin.yml | 22 - ..._wine.field_migrate_example_wine_regio.yml | 26 - ...le_wine.field_migrate_example_wine_var.yml | 26 - ...ine_varieties.field_variety_attributes.yml | 18 - ...e.node.field_migrate_example_adv_image.yml | 29 - ...ge.node.field_migrate_example_comments.yml | 19 - ....node.field_migrate_example_top_vintag.yml | 19 - ...e.node.field_migrate_example_wine_best.yml | 19 - ....node.field_migrate_example_wine_ratin.yml | 19 - ....node.field_migrate_example_wine_regio.yml | 19 - ...ge.node.field_migrate_example_wine_var.yml | 19 - ...taxonomy_term.field_variety_attributes.yml | 20 - .../node.type.migrate_example_producer.yml | 10 - .../node.type.migrate_example_wine.yml | 10 - ...urce.migrate_example_advanced_position.yml | 10 - ...migrate_example_advanced_variety_items.yml | 10 - ....migrate_example_advanced_variety_list.yml | 10 - ...rate_example_advanced_variety_multiple.yml | 10 - ...abulary.migrate_example_wine_best_with.yml | 8 - ...ocabulary.migrate_example_wine_regions.yml | 8 - ...abulary.migrate_example_wine_varieties.yml | 8 - .../migrate_example_advanced_setup.info.yml | 18 - .../migrate_example_advanced_setup.install | 1222 -------- .../Plugin/rest/resource/PositionResource.php | 44 - .../src/Plugin/rest/resource/VarietyItems.php | 76 - .../src/Plugin/rest/resource/VarietyList.php | 42 - .../rest/resource/VarietyMultiFiles.php | 87 - .../src/Plugin/migrate/source/WineTerm.php | 57 - .../migrate_json_example/README.md | 22 - .../artifacts/products.json | 16 - ...tity_form_display.node.product.default.yml | 88 - ...tity_view_display.node.product.default.yml | 49 - ...d.field.node.product.field_description.yml | 18 - .../field.field.node.product.field_price.yml | 22 - .../field.field.node.product.field_upc.yml | 22 - .../field.storage.node.field_description.yml | 20 - .../field.storage.node.field_price.yml | 17 - .../optional/field.storage.node.field_upc.yml | 19 - .../migrate_plus.migration.product.yml | 81 - .../config/optional/node.type.product.yml | 17 - .../migrate_json_example.info.yml | 15 - .../migrate_json_example.install | 20 - .../migrate_plus/migrate_plus.info.yml | 13 - .../migrate/migrate_plus/migrate_plus.install | 38 - .../migrate/migrate_plus/migrate_plus.module | 87 - .../migrate_plus/migrate_plus.services.yml | 10 - .../migrations/migration_config_deriver.yml | 6 - .../contrib/migrate/migrate_plus/phpcs.xml | 207 -- .../src/Annotation/Authentication.php | 37 - .../src/Annotation/DataFetcher.php | 37 - .../src/Annotation/DataParser.php | 37 - .../src/AuthenticationPluginBase.php | 25 - .../src/AuthenticationPluginInterface.php | 25 - .../src/AuthenticationPluginManager.php | 37 - .../src/DataFetcherPluginBase.php | 32 - .../src/DataFetcherPluginInterface.php | 50 - .../src/DataFetcherPluginManager.php | 37 - .../migrate_plus/src/DataParserPluginBase.php | 221 -- .../src/DataParserPluginInterface.php | 15 - .../src/DataParserPluginManager.php | 37 - .../migrate_plus/src/Entity/Migration.php | 98 - .../src/Entity/MigrationGroup.php | 85 - .../src/Entity/MigrationGroupInterface.php | 12 - .../src/Entity/MigrationInterface.php | 12 - .../migrate_plus/src/Event/MigrateEvents.php | 30 - .../src/Event/MigratePrepareRowEvent.php | 84 - .../src/Plugin/MigrationConfigDeriver.php | 32 - .../src/Plugin/migrate/destination/Table.php | 143 - .../src/Plugin/migrate/process/ArrayPop.php | 44 - .../src/Plugin/migrate/process/ArrayShift.php | 44 - .../Plugin/migrate/process/EntityGenerate.php | 179 -- .../Plugin/migrate/process/EntityLookup.php | 300 -- .../src/Plugin/migrate/process/FileBlob.php | 155 - .../src/Plugin/migrate/process/Merge.php | 68 - .../Plugin/migrate/process/MultipleValues.php | 58 - .../Plugin/migrate/process/SingleValue.php | 45 - .../Plugin/migrate/process/SkipOnValue.php | 135 - .../src/Plugin/migrate/process/StrReplace.php | 113 - .../migrate/process/Transliteration.php | 83 - .../migrate/source/SourcePluginExtension.php | 60 - .../src/Plugin/migrate/source/Url.php | 78 - .../migrate_plus/authentication/Basic.php | 30 - .../migrate_plus/authentication/Digest.php | 31 - .../migrate_plus/authentication/OAuth2.php | 69 - .../Plugin/migrate_plus/data_fetcher/File.php | 52 - .../Plugin/migrate_plus/data_fetcher/Http.php | 121 - .../Plugin/migrate_plus/data_parser/Json.php | 131 - .../migrate_plus/data_parser/SimpleXml.php | 87 - .../Plugin/migrate_plus/data_parser/Soap.php | 130 - .../Plugin/migrate_plus/data_parser/Xml.php | 321 -- .../migrate_plus/data_parser/XmlTrait.php | 62 - .../tests/data/missing_properties.json | 21 - .../data/simple_xml_reduce_single_value.xml | 14 - .../migrate_plus.migration.fruit_terms.yml | 32 - .../migrate_plus.migration_group.default.yml | 9 - .../migrate_plus_test.info.yml | 14 - .../tests/src/Functional/LoadTest.php | 53 - .../tests/src/Kernel/MigrateTableTest.php | 163 - .../src/Kernel/MigrationConfigEntityTest.php | 123 - .../tests/src/Kernel/MigrationGroupTest.php | 127 - .../migrate/process/EntityGenerateTest.php | 900 ------ .../migrate/process/EntityLookupTest.php | 76 - .../migrate_plus/data_fetcher/HttpTest.php | 59 - .../migrate_plus/data_parser/JsonTest.php | 112 - .../data_parser/SimpleXmlTest.php | 77 - .../tests/src/Unit/data_fetcher/FileTest.php | 185 -- .../tests/src/Unit/data_fetcher/HttpTest.php | 242 -- .../tests/src/Unit/process/ArrayPopTest.php | 71 - .../tests/src/Unit/process/ArrayShiftTest.php | 71 - .../src/Unit/process/MultipleValuesTest.php | 32 - .../src/Unit/process/SingleValueTest.php | 32 - .../src/Unit/process/SkipOnValueTest.php | 145 - .../tests/src/Unit/process/StrReplaceTest.php | 100 - .../src/Unit/process/TransliterationTest.php | 51 - .../contrib/migrate/migrate_tools/LICENSE.txt | 339 -- .../contrib/migrate/migrate_tools/README.txt | 15 - .../migrate/migrate_tools/composer.json | 28 - .../migrate/migrate_tools/drupalci.yml | 25 - .../migrate/migrate_tools/drush.services.yml | 6 - .../migrate_tools/migrate_tools.drush.inc | 580 ---- .../migrate_tools/migrate_tools.info.yml | 17 - .../migrate_tools.links.action.yml | 11 - .../migrate_tools.links.menu.yml | 5 - .../migrate_tools.links.task.yml | 53 - .../migrate_tools/migrate_tools.module | 58 - .../migrate_tools.permissions.yml | 3 - .../migrate_tools/migrate_tools.routing.yml | 197 -- .../migrate_tools/migrate_tools.services.yml | 9 - .../src/Commands/MigrateToolsCommands.php | 792 ----- .../src/Controller/MessageController.php | 162 - .../src/Controller/MigrationController.php | 303 -- .../Controller/MigrationGroupListBuilder.php | 68 - .../src/Controller/MigrationListBuilder.php | 244 -- .../src/Drush9LogMigrateMessage.php | 48 - .../src/DrushLogMigrateMessage.php | 28 - .../src/Form/MigrationAddForm.php | 37 - .../src/Form/MigrationDeleteForm.php | 71 - .../src/Form/MigrationEditForm.php | 50 - .../src/Form/MigrationExecuteForm.php | 217 -- .../src/Form/MigrationFormBase.php | 184 -- .../src/Form/MigrationGroupAddForm.php | 37 - .../src/Form/MigrationGroupDeleteForm.php | 71 - .../src/Form/MigrationGroupEditForm.php | 35 - .../src/Form/MigrationGroupFormBase.php | 172 - .../migrate_tools/src/Form/SourceCsvForm.php | 449 --- .../migrate/migrate_tools/src/IdMapFilter.php | 42 - .../src/MigrateBatchExecutable.php | 302 -- .../migrate_tools/src/MigrateExecutable.php | 405 --- .../migrate_tools/src/MigrateTools.php | 34 - .../src/Routing/RouteProcessor.php | 27 - .../migrate_tools/src/SourceFilter.php | 53 - ...migrate_plus.migration.csv_source_test.yml | 33 - .../migrate_plus.migration_group.csv_test.yml | 4 - .../csv_source_test/csv_source_test.info.yml | 15 - .../migrate_plus.migration.fruit_terms.yml | 32 - .../migrate_plus.migration_group.default.yml | 9 - .../migrate_tools_test.info.yml | 14 - .../Functional/MigrateExecutionFormTest.php | 134 - .../src/Functional/SourceCsvFormTest.php | 243 -- .../tests/src/Kernel/DrushTest.php | 217 -- .../tests/src/Kernel/MigrateImportTest.php | 81 - .../tests/src/Kernel/MigrateRollbackTest.php | 106 - .../tests/src/Unit/MigrateToolsTest.php | 85 - .../migrate/migrate_upgrade/LICENSE.txt | 339 -- .../migrate/migrate_upgrade/README.txt | 87 - .../migrate/migrate_upgrade/composer.json | 11 - .../migrate_upgrade/migrate_upgrade.drush.inc | 93 - .../migrate_upgrade/migrate_upgrade.info.yml | 16 - .../contrib/migrate/migrate_upgrade/phpcs.xml | 126 - .../src/DrushLogMigrateMessage.php | 23 - .../src/MigrateUpgradeDrushRunner.php | 324 -- .../contrib/search/search_api/CHANGELOG.txt | 587 ---- .../contrib/search/search_api/LICENSE.txt | 339 -- .../contrib/search/search_api/README.txt | 138 - .../contrib/search/search_api/composer.json | 41 - .../config/install/search_api.settings.yml | 4 - .../tour.tour.search-api-index-fields.yml | 96 - .../tour.tour.search-api-index-form.yml | 65 - .../tour.tour.search-api-index-processors.yml | 40 - .../optional/tour.tour.search-api-index.yml | 104 - .../tour.tour.search-api-server-form.yml | 41 - .../optional/tour.tour.search-api-server.yml | 48 - .../schema/search_api.datasource.schema.yml | 32 - .../config/schema/search_api.index.schema.yml | 96 - .../schema/search_api.processor.schema.yml | 245 -- .../config/schema/search_api.schema.yml | 16 - .../schema/search_api.server.schema.yml | 30 - .../schema/search_api.tracker.schema.yml | 7 - .../config/schema/search_api.views.schema.yml | 308 -- .../search_api/css/search_api.admin.css | 93 - .../search/search_api/drush.services.yml | 8 - .../search_api/js/search_api.processors.js | 49 - .../modules/search_api_db/README.txt | 60 - .../config/install/search_api_db.settings.yml | 1 - .../schema/search_api_db.backend.schema.yml | 23 - .../config/schema/search_api_db.schema.yml | 7 - .../search_api_db/search_api_db.api.php | 38 - .../search_api_db/search_api_db.info.yml | 13 - .../search_api_db/search_api_db.install | 109 - .../search_api_db/search_api_db.module | 17 - .../search_api_db/search_api_db.services.yml | 22 - .../search_api_db_defaults/README.txt | 23 - ...view_display.node.article.search_index.yml | 43 - ...iew_display.node.article.search_result.yml | 42 - ...ty_view_display.node.page.search_index.yml | 24 - ...y_view_display.node.page.search_result.yml | 28 - .../search_api.index.default_index.yml | 188 -- .../search_api.server.default_server.yml | 16 - .../optional/views.view.search_content.yml | 159 - .../search_api_db_defaults.info.yml | 20 - .../search_api_db_defaults.install | 37 - .../tests/src/Functional/IntegrationTest.php | 181 -- .../CaseSensitiveDatabase.php | 17 - .../DatabaseCompatibilityHandlerInterface.php | 73 - .../DatabaseCompatibility/GenericDatabase.php | 71 - .../src/DatabaseCompatibility/MySql.php | 39 - .../Plugin/search_api/backend/Database.php | 2785 ----------------- .../src/Tests/DatabaseTestsTrait.php | 67 - .../Update/SearchApiDbUpdate8102Test.php | 68 - .../fixtures/update/search-api-db-base.php | 59 - .../update/search-api-db-update-8102.php | 62 - ...search.search_api_db_test_autocomplete.yml | 15 - .../search_api_db_test_autocomplete.info.yml | 15 - .../search/TestSearch.php | 70 - .../FunctionalJavascript/IntegrationTest.php | 40 - .../tests/src/Kernel/AutocompleteTest.php | 144 - .../tests/src/Kernel/BackendTest.php | 945 ------ .../search_api_views_taxonomy.info.yml | 18 - .../search_api_views_taxonomy.install | 29 - .../contrib/search/search_api/phpcs.xml | 254 -- .../search/search_api/search_api.api.php | 356 --- .../search/search_api/search_api.drush.inc | 449 --- .../search/search_api/search_api.info.yml | 14 - .../search/search_api/search_api.install | 281 -- .../search_api/search_api.libraries.yml | 13 - .../search_api/search_api.links.action.yml | 15 - .../search_api/search_api.links.menu.yml | 5 - .../search_api/search_api.links.task.yml | 27 - .../search/search_api/search_api.module | 672 ---- .../search_api/search_api.permissions.yml | 3 - .../search_api/search_api.plugin_type.yml | 34 - .../search/search_api/search_api.routing.yml | 241 -- .../search/search_api/search_api.services.yml | 88 - .../search/search_api/search_api.theme.inc | 506 --- .../search/search_api/search_api.views.inc | 829 ----- .../src/Annotation/SearchApiBackend.php | 44 - .../src/Annotation/SearchApiDataType.php | 60 - .../src/Annotation/SearchApiDatasource.php | 44 - .../src/Annotation/SearchApiDisplay.php | 58 - .../src/Annotation/SearchApiParseMode.php | 44 - .../src/Annotation/SearchApiProcessor.php | 56 - .../src/Annotation/SearchApiTracker.php | 44 - .../src/Backend/BackendInterface.php | 86 - .../src/Backend/BackendPluginBase.php | 372 --- .../src/Backend/BackendPluginManager.php | 36 - .../src/Backend/BackendSpecificInterface.php | 216 -- .../src/Commands/SearchApiCommands.php | 458 --- .../search_api/src/ConsoleException.php | 8 - .../src/Contrib/RowsOfMultiValueFields.php | 43 - .../ViewsBulkOperationsEventSubscriber.php | 49 - .../src/Controller/IndexController.php | 215 -- .../src/Controller/ServerController.php | 119 - .../src/Controller/TaskController.php | 86 - .../src/DataType/DataTypeInterface.php | 65 - .../src/DataType/DataTypePluginBase.php | 89 - .../src/DataType/DataTypePluginManager.php | 119 - .../src/Datasource/DatasourceInterface.php | 241 -- .../src/Datasource/DatasourcePluginBase.php | 158 - .../Datasource/DatasourcePluginManager.php | 36 - .../src/Display/DisplayDeriverBase.php | 68 - .../src/Display/DisplayInterface.php | 74 - .../src/Display/DisplayPluginBase.php | 185 -- .../src/Display/DisplayPluginManager.php | 64 - .../Display/DisplayPluginManagerInterface.php | 20 - .../search/search_api/src/Entity/Index.php | 1962 ------------ .../search_api/src/Entity/InstallingTrait.php | 38 - .../Entity/SearchApiConfigEntityStorage.php | 70 - .../search/search_api/src/Entity/Server.php | 625 ---- .../search/search_api/src/Entity/Task.php | 184 -- .../src/FacetsQueryTypeMappingInterface.php | 23 - .../src/Form/FieldConfigurationForm.php | 237 -- .../src/Form/IndexAddFieldsForm.php | 498 --- .../src/Form/IndexBreakLockForm.php | 138 - .../src/Form/IndexClearConfirmForm.php | 74 - .../src/Form/IndexDeleteConfirmForm.php | 72 - .../src/Form/IndexDisableConfirmForm.php | 82 - .../search_api/src/Form/IndexFieldsForm.php | 520 --- .../search/search_api/src/Form/IndexForm.php | 641 ---- .../src/Form/IndexProcessorsForm.php | 392 --- .../Form/IndexRebuildTrackerConfirmForm.php | 59 - .../src/Form/IndexReindexConfirmForm.php | 89 - .../search_api/src/Form/IndexStatusForm.php | 273 -- .../src/Form/ServerClearConfirmForm.php | 111 - .../src/Form/ServerDeleteConfirmForm.php | 79 - .../src/Form/ServerDisableConfirmForm.php | 82 - .../search/search_api/src/Form/ServerForm.php | 328 -- .../search_api/src/Form/ServerStatusForm.php | 123 - .../Form/UnsavedConfigurationFormTrait.php | 106 - .../search_api/src/IndexBatchHelper.php | 210 -- .../search/search_api/src/IndexInterface.php | 730 ----- .../search_api/src/IndexListBuilder.php | 330 -- .../search/search_api/src/Item/Field.php | 683 ---- .../search_api/src/Item/FieldInterface.php | 425 --- .../search/search_api/src/Item/Item.php | 473 --- .../search_api/src/Item/ItemInterface.php | 301 -- .../search/search_api/src/LoggerTrait.php | 80 - .../src/ParamConverter/SearchApiConverter.php | 97 - .../src/ParseMode/ParseModeInterface.php | 75 - .../src/ParseMode/ParseModePluginBase.php | 81 - .../src/ParseMode/ParseModePluginManager.php | 72 - .../src/Plugin/ConfigurablePluginBase.php | 95 - .../Plugin/ConfigurablePluginInterface.php | 57 - .../search_api/src/Plugin/DataType/Html.php | 17 - .../search_api/src/Plugin/DataType/Text.php | 22 - .../src/Plugin/HideablePluginBase.php | 19 - .../src/Plugin/HideablePluginInterface.php | 18 - .../search_api/src/Plugin/IndexPluginBase.php | 44 - .../src/Plugin/IndexPluginInterface.php | 28 - .../search_api/src/Plugin/PluginFormTrait.php | 46 - .../search_api/data_type/BooleanDataType.php | 19 - .../search_api/data_type/DateDataType.php | 41 - .../search_api/data_type/DecimalDataType.php | 19 - .../search_api/data_type/IntegerDataType.php | 19 - .../search_api/data_type/StringDataType.php | 19 - .../search_api/data_type/TextDataType.php | 36 - .../search_api/data_type/value/TextToken.php | 76 - .../data_type/value/TextTokenInterface.php | 46 - .../search_api/data_type/value/TextValue.php | 147 - .../data_type/value/TextValueInterface.php | 125 - .../search_api/datasource/ContentEntity.php | 1045 ------- .../datasource/ContentEntityDeriver.php | 97 - .../datasource/ContentEntityTaskManager.php | 113 - .../datasource/EntityDatasourceInterface.php | 46 - .../Plugin/search_api/display/ViewsBlock.php | 35 - .../search_api/display/ViewsDisplayBase.php | 108 - .../display/ViewsDisplayDeriver.php | 122 - .../Plugin/search_api/display/ViewsEmbed.php | 14 - .../Plugin/search_api/display/ViewsPage.php | 14 - .../Plugin/search_api/display/ViewsRest.php | 14 - .../Plugin/search_api/parse_mode/Direct.php | 25 - .../Plugin/search_api/parse_mode/Phrase.php | 28 - .../Plugin/search_api/parse_mode/Terms.php | 60 - .../search_api/processor/AddHierarchy.php | 323 -- .../Plugin/search_api/processor/AddURL.php | 61 - .../search_api/processor/AggregatedFields.php | 128 - .../search_api/processor/ContentAccess.php | 380 --- .../search_api/processor/EntityStatus.php | 70 - .../Plugin/search_api/processor/Highlight.php | 648 ---- .../search_api/processor/HtmlFilter.php | 306 -- .../search_api/processor/IgnoreCase.php | 48 - .../search_api/processor/IgnoreCharacters.php | 180 -- .../Property/AggregatedFieldProperty.php | 223 -- .../Property/RenderedItemProperty.php | 89 - .../search_api/processor/RenderedItem.php | 374 --- .../search_api/processor/Resources/Cc.php | 27 - .../search_api/processor/Resources/Cf.php | 39 - .../search_api/processor/Resources/Co.php | 18 - .../search_api/processor/Resources/Mc.php | 68 - .../search_api/processor/Resources/Me.php | 19 - .../search_api/processor/Resources/Mn.php | 200 -- .../search_api/processor/Resources/Pc.php | 19 - .../search_api/processor/Resources/Pd.php | 22 - .../search_api/processor/Resources/Pe.php | 28 - .../search_api/processor/Resources/Pf.php | 19 - .../search_api/processor/Resources/Pi.php | 19 - .../search_api/processor/Resources/Po.php | 79 - .../processor/Resources/Porter2.php | 648 ---- .../search_api/processor/Resources/Ps.php | 28 - .../search_api/processor/Resources/Sc.php | 24 - .../search_api/processor/Resources/Sk.php | 34 - .../search_api/processor/Resources/Sm.php | 153 - .../search_api/processor/Resources/So.php | 647 ---- .../UnicodeCharacterPropertyInterface.php | 18 - .../search_api/processor/Resources/Zl.php | 18 - .../search_api/processor/Resources/Zp.php | 18 - .../search_api/processor/Resources/Zs.php | 20 - .../processor/ReverseEntityReferences.php | 417 --- .../search_api/processor/RoleFilter.php | 119 - .../Plugin/search_api/processor/Stemmer.php | 140 - .../Plugin/search_api/processor/Stopwords.php | 148 - .../Plugin/search_api/processor/Tokenizer.php | 328 -- .../search_api/processor/Transliteration.php | 143 - .../Plugin/search_api/processor/TypeBoost.php | 153 - .../src/Plugin/search_api/tracker/Basic.php | 439 --- .../src/Plugin/views/EntityFieldRenderer.php | 100 - .../views/EntityTranslationRenderer.php | 28 - .../Plugin/views/SearchApiHandlerTrait.php | 69 - .../Plugin/views/argument/SearchApiDate.php | 197 -- .../views/argument/SearchApiFulltext.php | 192 -- .../views/argument/SearchApiMoreLikeThis.php | 93 - .../views/argument/SearchApiStandard.php | 222 -- .../Plugin/views/argument/SearchApiTerm.php | 43 - .../views/cache/SearchApiCachePluginTrait.php | 231 -- .../Plugin/views/cache/SearchApiTagCache.php | 84 - .../Plugin/views/cache/SearchApiTimeCache.php | 31 - .../Plugin/views/field/SearchApiBoolean.php | 19 - .../src/Plugin/views/field/SearchApiDate.php | 19 - .../Plugin/views/field/SearchApiEntity.php | 311 -- .../views/field/SearchApiEntityField.php | 332 -- .../views/field/SearchApiFieldTrait.php | 1314 -------- .../Plugin/views/field/SearchApiNumeric.php | 49 - .../Plugin/views/field/SearchApiStandard.php | 27 - .../Plugin/views/filter/SearchApiBoolean.php | 18 - .../views/filter/SearchApiDatasource.php | 34 - .../src/Plugin/views/filter/SearchApiDate.php | 126 - .../views/filter/SearchApiFilterTrait.php | 63 - .../Plugin/views/filter/SearchApiFulltext.php | 410 --- .../Plugin/views/filter/SearchApiLanguage.php | 43 - .../Plugin/views/filter/SearchApiNumeric.php | 27 - .../Plugin/views/filter/SearchApiOptions.php | 41 - .../Plugin/views/filter/SearchApiString.php | 19 - .../src/Plugin/views/filter/SearchApiTerm.php | 24 - .../src/Plugin/views/filter/SearchApiText.php | 34 - .../src/Plugin/views/filter/SearchApiUser.php | 64 - .../src/Plugin/views/join/SearchApiJoin.php | 25 - .../src/Plugin/views/query/SearchApiQuery.php | 1405 --------- .../relationship/SearchApiRelationship.php | 98 - .../src/Plugin/views/row/SearchApiRow.php | 214 -- .../src/Plugin/views/sort/SearchApiSort.php | 38 - .../Processor/ConfigurablePropertyBase.php | 40 - .../ConfigurablePropertyInterface.php | 74 - .../src/Processor/EntityProcessorProperty.php | 26 - .../Processor/FieldsProcessorPluginBase.php | 564 ---- .../src/Processor/ProcessorInterface.php | 231 -- .../src/Processor/ProcessorPluginBase.php | 265 -- .../src/Processor/ProcessorPluginManager.php | 69 - .../src/Processor/ProcessorProperty.php | 33 - .../Processor/ProcessorPropertyInterface.php | 28 - .../ParamConverter/SearchApiConverter.php | 86 - .../search/search_api/src/Query/Condition.php | 99 - .../search_api/src/Query/ConditionGroup.php | 120 - .../src/Query/ConditionGroupInterface.php | 55 - .../src/Query/ConditionInterface.php | 64 - .../src/Query/ConditionSetInterface.php | 55 - .../search/search_api/src/Query/Query.php | 790 ----- .../search_api/src/Query/QueryInterface.php | 536 ---- .../search/search_api/src/Query/ResultSet.php | 236 -- .../src/Query/ResultSetInterface.php | 191 -- .../search_api/src/SearchApiException.php | 8 - .../search/search_api/src/ServerInterface.php | 96 - .../search_api/src/Task/IndexTaskManager.php | 260 -- .../src/Task/IndexTaskManagerInterface.php | 84 - .../search_api/src/Task/ServerTaskManager.php | 220 -- .../src/Task/ServerTaskManagerInterface.php | 62 - .../search/search_api/src/Task/TaskEvent.php | 77 - .../search_api/src/Task/TaskInterface.php | 85 - .../search_api/src/Task/TaskManager.php | 369 --- .../src/Task/TaskManagerInterface.php | 133 - .../src/Tracker/TrackerInterface.php | 124 - .../src/Tracker/TrackerPluginBase.php | 39 - .../src/Tracker/TrackerPluginManager.php | 53 - .../src/UnsavedConfigurationInterface.php | 78 - .../src/UnsavedIndexConfiguration.php | 1098 ------- .../search_api/src/Utility/CommandHelper.php | 704 ----- .../search_api/src/Utility/DataTypeHelper.php | 166 - .../src/Utility/DataTypeHelperInterface.php | 49 - .../search_api/src/Utility/FieldsHelper.php | 500 --- .../src/Utility/FieldsHelperInterface.php | 274 -- .../search_api/src/Utility/PluginHelper.php | 172 - .../src/Utility/PluginHelperInterface.php | 129 - .../src/Utility/PostRequestIndexing.php | 96 - .../Utility/PostRequestIndexingInterface.php | 20 - .../search_api/src/Utility/QueryHelper.php | 155 - .../src/Utility/QueryHelperInterface.php | 64 - .../search/search_api/src/Utility/Utility.php | 272 -- .../config/schema/search_api_test.schema.yml | 35 - .../search_api_test/search_api_test.info.yml | 14 - .../search_api_test/search_api_test.module | 33 - .../search_api_test/src/MethodOverrides.php | 50 - .../Plugin/search_api/backend/TestBackend.php | 321 -- .../data_type/AlteringValueTestDataType.php | 33 - .../search_api/data_type/TestDataType.php | 18 - .../data_type/UnsupportedTestDataType.php | 25 - .../search_api/datasource/TestDatasource.php | 54 - .../Plugin/search_api/display/TestDisplay.php | 18 - .../search_api/processor/TestProcessor.php | 97 - .../Plugin/search_api/tracker/TestTracker.php | 140 - .../tracker/TestTrackerStringLabel.php | 15 - .../search_api_test/src/PluginTestTrait.php | 94 - .../search_api_test/src/TestPluginTrait.php | 133 - ...search_api.index.database_search_index.yml | 84 - ...arch_api.server.database_search_server.yml | 13 - .../search_api_test_db.info.yml | 15 - .../search_api_test_db.search_api.inc | 18 - ...ntity_test_mulrev_changed.article.body.yml | 17 - ...y_test_mulrev_changed.article.category.yml | 16 - ...y_test_mulrev_changed.article.keywords.yml | 16 - ...tity_test_mulrev_changed.article.width.yml | 20 - ...hanged.entity_test_mulrev_changed.body.yml | 17 - ...ed.entity_test_mulrev_changed.category.yml | 16 - ...ed.entity_test_mulrev_changed.keywords.yml | 16 - ...anged.entity_test_mulrev_changed.width.yml | 20 - ...d.entity_test_mulrev_changed.item.body.yml | 17 - ...tity_test_mulrev_changed.item.category.yml | 16 - ...tity_test_mulrev_changed.item.keywords.yml | 16 - ....entity_test_mulrev_changed.item.width.yml | 20 - ...torage.entity_test_mulrev_changed.body.yml | 16 - ...ge.entity_test_mulrev_changed.category.yml | 16 - ...ge.entity_test_mulrev_changed.keywords.yml | 16 - ...orage.entity_test_mulrev_changed.width.yml | 15 - .../search_api_test_example_content.info.yml | 14 - ...tity_test_mulrev_changed.article.links.yml | 24 - ...orage.entity_test_mulrev_changed.links.yml | 18 - .../search_api_test_extraction.info.yml | 14 - .../Plugin/search_api/processor/SoulMate.php | 180 -- .../search_api_test_hooks.info.yml | 14 - .../search_api_test_hooks.module | 35 - .../search_api_test_hooks.search_api.inc | 121 - ...ch_api.index.inconsistent_search_index.yml | 33 - ..._api.server.inconsistent_search_server.yml | 10 - ...arch_api_test_inconsistent_config.info.yml | 15 - .../search_api_test_no_ui.info.yml | 14 - .../src/Plugin/search_api/backend/NoUi.php | 45 - .../src/Plugin/search_api/data_type/NoUi.php | 17 - .../src/Plugin/search_api/datasource/NoUi.php | 26 - .../src/Plugin/search_api/parse_mode/NoUi.php | 25 - .../src/Plugin/search_api/processor/NoUi.php | 25 - .../src/Plugin/search_api/tracker/NoUi.php | 18 - .../search_api_test_tasks.info.yml | 14 - .../search_api_test_tasks.services.yml | 6 - .../src/TestTaskWorker.php | 105 - .../views.view.search_api_test_cache.yml | 286 -- .../views.view.search_api_test_sorts.yml | 317 -- .../views.view.search_api_test_view.yml | 350 --- .../search_api_test_views.info.yml | 18 - .../search_api_test_views.module | 21 - .../tests/src/Functional/CacheabilityTest.php | 86 - .../ConfigOverrideIntegrationTest.php | 210 -- .../src/Functional/ExampleContentTrait.php | 133 - .../src/Functional/FieldIntegrationTest.php | 50 - .../tests/src/Functional/HooksTest.php | 164 - .../tests/src/Functional/IntegrationTest.php | 1597 ---------- .../Functional/LanguageIntegrationTest.php | 131 - .../tests/src/Functional/OverviewPageTest.php | 267 -- .../Functional/ProcessorIntegrationTest.php | 809 ----- .../Functional/SearchApiBrowserTestBase.php | 197 -- .../tests/src/Functional/ViewsTest.php | 965 ------ .../src/FunctionalJavascript/AjaxTest.php | 162 - .../tests/src/Kernel/BackendTestBase.php | 1180 ------- .../tests/src/Kernel/BasicTrackerTest.php | 382 --- .../ConfigEntity/ConfigOverrideKernelTest.php | 218 -- .../DefaultConfigEntityInstallationTest.php | 85 - .../ConfigEntity/DependencyRemovalTest.php | 635 ---- .../Datasource/BundlelessEntityTest.php | 91 - .../ContentEntityDatasourceTest.php | 312 -- .../Kernel/Datasource/DatasourceTaskTest.php | 251 -- .../Kernel/Datasource/EntityStringIdTest.php | 153 - .../Kernel/Datasource/LanguageKernelTest.php | 358 --- .../src/Kernel/Index/IndexChangesTest.php | 450 --- .../src/Kernel/Index/IndexImportTest.php | 118 - .../src/Kernel/Index/IndexLoadItemsTest.php | 97 - .../src/Kernel/Index/IndexStorageTest.php | 98 - .../src/Kernel/PostRequestIndexingTrait.php | 18 - .../src/Kernel/Processor/AddHierarchyTest.php | 310 -- .../src/Kernel/Processor/AddURLKernelTest.php | 63 - .../Kernel/Processor/ContentAccessTest.php | 376 --- .../Kernel/Processor/ProcessorTestBase.php | 189 -- .../src/Kernel/Processor/RenderedItemTest.php | 406 --- .../Processor/ReverseEntityReferencesTest.php | 158 - .../src/Kernel/Processor/TypeBoostTest.php | 117 - .../tests/src/Kernel/ResultsTrait.php | 46 - .../src/Kernel/Server/ServerChangesTest.php | 130 - .../src/Kernel/Server/ServerStorageTest.php | 131 - .../src/Kernel/Server/ServerTaskTest.php | 463 --- .../tests/src/Kernel/System/CliTest.php | 140 - .../src/Kernel/System/CommandHelperTest.php | 399 --- .../src/Kernel/System/CustomDataTypesTest.php | 181 -- .../System/FieldValuesExtractionTest.php | 299 -- .../tests/src/Kernel/System/QueryTest.php | 253 -- .../src/Kernel/System/SerializationTest.php | 328 -- .../tests/src/Kernel/System/TaskTest.php | 291 -- .../tests/src/Kernel/TestTimeService.php | 49 - .../src/Kernel/Views/TestMemoryBackend.php | 36 - .../Kernel/Views/ViewsDisplayCachingTest.php | 377 --- .../src/Kernel/Views/ViewsDisplayTest.php | 98 - .../src/Kernel/Views/ViewsFieldTraitTest.php | 249 -- .../Views/ViewsPropertyExtractionTest.php | 313 -- .../tests/src/Kernel/ViewsTestField.php | 55 - .../tests/src/Unit/BackendPluginBaseTest.php | 62 - .../tests/src/Unit/DateDataTypeTest.php | 71 - .../tests/src/Unit/ItemFieldTest.php | 81 - .../tests/src/Unit/LocalTasksTest.php | 96 - .../tests/src/Unit/Processor/AddURLTest.php | 140 - .../Unit/Processor/AggregatedFieldsTest.php | 446 --- .../src/Unit/Processor/EntityStatusTest.php | 181 -- .../FieldsProcessorPluginBaseTest.php | 673 ---- .../src/Unit/Processor/HighlightTest.php | 1176 ------- .../src/Unit/Processor/HtmlFilterTest.php | 283 -- .../src/Unit/Processor/IgnoreCaseTest.php | 57 - .../Unit/Processor/IgnoreCharacterTest.php | 139 - .../src/Unit/Processor/ProcessorTestTrait.php | 35 - .../src/Unit/Processor/RoleFilterTest.php | 125 - .../tests/src/Unit/Processor/StemmerTest.php | 240 -- .../src/Unit/Processor/StopwordsTest.php | 118 - .../Processor/TestFieldsProcessorPlugin.php | 135 - .../src/Unit/Processor/TestItemsTrait.php | 156 - .../src/Unit/Processor/TokenizerTest.php | 389 --- .../Unit/Processor/TransliterationTest.php | 85 - .../src/Unit/TestComplexDataInterface.php | 13 - .../tests/src/Unit/TestNodeInterface.php | 13 - .../tests/src/Unit/TestUserInterface.php | 13 - .../contrib/security/honeypot/.travis.yml | 41 - .../contrib/security/honeypot/LICENSE.txt | 339 -- .../contrib/security/honeypot/README.md | 58 - .../contrib/security/honeypot/composer.json | 16 - .../config/install/honeypot.settings.yml | 16 - .../config/optional/tour.tour.honeypot.yml | 59 - .../config/schema/honeypot.schema.yml | 28 - .../security/honeypot/docker-compose.yml | 34 - .../security/honeypot/honeypot.api.php | 100 - .../security/honeypot/honeypot.info.yml | 13 - .../security/honeypot/honeypot.install | 75 - .../security/honeypot/honeypot.links.menu.yml | 5 - .../contrib/security/honeypot/honeypot.module | 337 -- .../honeypot/honeypot.permissions.yml | 7 - .../security/honeypot/honeypot.routing.yml | 7 - .../Controller/HoneypotSettingsController.php | 329 -- .../src/Tests/HoneypotAdminFormTest.php | 96 - .../src/Tests/HoneypotFormCacheTest.php | 137 - ...HoneypotFormProgrammaticSubmissionTest.php | 48 - .../honeypot/src/Tests/HoneypotFormTest.php | 254 -- .../honeypot_test/honeypot_test.info.yml | 12 - .../honeypot_test/honeypot_test.routing.yml | 8 - .../src/Controller/HoneypotTestController.php | 31 - .../contrib/taxonomy/synonyms/LICENSE.txt | 339 -- .../contrib/taxonomy/synonyms/README.txt | 63 - .../synonyms/config/schema/synonym.schema.yml | 22 - .../schema/synonyms.behavior.schema.yml | 15 - .../schema/synonyms.provider.schema.yml | 14 - .../src/Annotation/SynonymsProvider.php | 56 - .../src/Controller/EntityAutocomplete.php | 66 - .../Controller/SynonymConfigController.php | 149 - .../Element/SynonymsEntityAutocomplete.php | 148 - .../src/Element/SynonymsEntitySelect.php | 161 - .../taxonomy/synonyms/src/Entity/Synonym.php | 235 -- .../synonyms/src/Form/SynonymDeleteForm.php | 45 - .../synonyms/src/Form/SynonymForm.php | 292 -- .../EntityTypeParamConverter.php | 40 - .../SynonymsBehaviorServiceParamConverter.php | 40 - .../Derivative/EntityReferenceField.php | 113 - .../synonyms/src/Plugin/Derivative/Field.php | 133 - .../ViewsSynonymsEntityArgumentValidator.php | 78 - .../EntityReferenceSynonymsAutocomplete.php | 161 - .../EntityReferenceSynonymsSelect.php | 56 - .../Synonyms/Provider/AbstractProvider.php | 58 - .../Plugin/Synonyms/Provider/BaseField.php | 128 - .../Provider/EntityReferenceField.php | 191 -- .../src/Plugin/Synonyms/Provider/Field.php | 216 -- .../src/Plugin/SynonymsFieldItemList.php | 33 - .../argument_validator/SynonymsEntity.php | 144 - .../Plugin/views/filter/SynonymsEntity.php | 243 -- .../synonyms/src/SynonymInterface.php | 72 - .../src/SynonymProviderPluginCollection.php | 21 - .../SynonymsFindProviderInterface.php | 58 - .../SynonymsFindTrait.php | 45 - ...SynonymsFormatWordingProviderInterface.php | 35 - .../SynonymsFormatWordingTrait.php | 51 - .../SynonymsGetProviderInterface.php | 45 - .../SynonymsGetTrait.php | 50 - .../SynonymsProviderInterface.php | 27 - .../src/SynonymsProviderPluginManager.php | 31 - .../Behavior/AutocompleteService.php | 250 -- .../Behavior/SelectService.php | 157 - .../SynonymsBehaviorConfigurableInterface.php | 65 - .../Behavior/SynonymsBehaviorInterface.php | 29 - .../src/SynonymsService/BehaviorService.php | 143 - .../src/SynonymsService/EntityGet.php | 79 - .../SynonymsService/FieldTypeToSynonyms.php | 44 - .../src/SynonymsService/SynonymsFind.php | 84 - .../taxonomy/synonyms/synonyms.api.php | 30 - .../taxonomy/synonyms/synonyms.info.yml | 14 - .../synonyms/synonyms.links.action.yml | 5 - .../taxonomy/synonyms/synonyms.links.menu.yml | 5 - .../contrib/taxonomy/synonyms/synonyms.module | 47 - .../synonyms/synonyms.permissions.yml | 7 - .../taxonomy/synonyms/synonyms.routing.yml | 63 - .../taxonomy/synonyms/synonyms.services.yml | 46 - .../Behavior/SearchService.php | 194 -- .../synonyms_search/synonyms_search.info.yml | 14 - .../synonyms_search/synonyms_search.module | 69 - .../synonyms_search.services.yml | 6 - .../modules/contrib/theme/extlink/LICENSE.txt | 339 -- .../modules/contrib/theme/extlink/README.txt | 37 - .../theme/extlink/config/extlink.settings.yml | 8 - .../extlink/config/schema/extlink.schema.yml | 40 - .../modules/contrib/theme/extlink/extlink.css | 22 - .../contrib/theme/extlink/extlink.info.yml | 13 - .../contrib/theme/extlink/extlink.install | 21 - .../modules/contrib/theme/extlink/extlink.js | 171 - .../theme/extlink/extlink.libraries.yml | 12 - .../theme/extlink/extlink.links.menu.yml | 5 - .../contrib/theme/extlink/extlink.min.js | 1 - .../contrib/theme/extlink/extlink.module | 32 - .../contrib/theme/extlink/extlink.routing.yml | 7 - .../contrib/theme/extlink/extlink_s.png | Bin 153 -> 0 bytes .../src/Form/ExtlinkAdminSettingsForm.php | 200 -- .../extlink/src/Tests/ExtlinkAdminTest.php | 26 - .../theme/extlink/src/Tests/ExtlinkTest.php | 18 - .../extlink/src/Tests/ExtlinkTestBase.php | 67 - .../contrib/users/autologout/LICENSE.txt | 339 -- .../contrib/users/autologout/README.txt | 54 - .../users/autologout/autologout.api.php | 49 - .../users/autologout/autologout.info.yml | 11 - .../users/autologout/autologout.install | 31 - .../users/autologout/autologout.libraries.yml | 9 - .../autologout/autologout.links.menu.yml | 6 - .../users/autologout/autologout.module | 236 -- .../autologout/autologout.permissions.yml | 4 - .../users/autologout/autologout.routing.yml | 34 - .../users/autologout/autologout.services.yml | 12 - .../contrib/users/autologout/composer.json | 7 - .../config/install/autologout.settings.yml | 13 - .../config/schema/autologout.schema.yml | 64 - .../contrib/users/autologout/js/autologout.js | 313 -- .../autologout/src/AutologoutManager.php | 195 -- .../src/AutologoutManagerInterface.php | 83 - .../src/Controller/AutologoutController.php | 82 - .../EventSubscriber/AutologoutSubscriber.php | 93 - .../src/Form/AutologoutBlockForm.php | 77 - .../src/Form/AutologoutSettingsForm.php | 315 -- .../Plugin/Block/AutologoutWarningBlock.php | 129 - .../src/Tests/AutologoutAjaxTest.php | 141 - .../AutologoutSessionCleanupOnLoginTest.php | 188 -- .../autologout/src/Tests/AutologoutTest.php | 395 --- .../users/email_registration/LICENSE.txt | 339 -- .../users/email_registration/README.txt | 45 - .../users/email_registration/composer.json | 34 - .../install/email_registration.settings.yml | 1 - .../schema/email_registration.schema.yml | 7 - .../email_registration.api.php | 37 - .../email_registration.info.yml | 12 - .../email_registration.install | 35 - .../email_registration.module | 204 -- .../CheckoutPane/EmailRegistrationLogin.php | 108 - .../Functional/EmailRegistrationTestCase.php | 111 - .../contrib/users/profile/.travis-phpcs.sh | 9 - .../modules/contrib/users/profile/.travis.yml | 119 - .../modules/contrib/users/profile/LICENSE.txt | 339 -- .../modules/contrib/users/profile/README.md | 23 - .../contrib/users/profile/composer.json | 10 - .../system.action.profile_delete_action.yml | 9 - .../system.action.profile_publish_action.yml | 9 - ...system.action.profile_unpublish_action.yml | 9 - .../config/install/views.view.profiles.yml | 379 --- .../profile/config/schema/profile.schema.yml | 59 - .../users/profile/css/profile.base.css | 11 - .../contrib/users/profile/profile.info.yml | 17 - .../contrib/users/profile/profile.install | 36 - .../users/profile/profile.libraries.yml | 5 - .../users/profile/profile.links.action.yml | 5 - .../users/profile/profile.links.menu.yml | 11 - .../users/profile/profile.links.task.yml | 15 - .../contrib/users/profile/profile.module | 385 --- .../users/profile/profile.permissions.yml | 3 - .../contrib/users/profile/profile.routing.yml | 67 - .../users/profile/profile.services.yml | 7 - .../profile/src/Access/ProfileAccessCheck.php | 59 - .../src/Controller/ProfileController.php | 179 -- .../src/Controller/ProfileViewController.php | 61 - .../users/profile/src/Entity/Profile.php | 293 -- .../profile/src/Entity/ProfileInterface.php | 108 - .../users/profile/src/Entity/ProfileType.php | 213 -- .../src/Entity/ProfileTypeInterface.php | 75 - .../users/profile/src/Event/ProfileEvents.php | 19 - .../profile/src/Event/ProfileLabelEvent.php | 75 - .../users/profile/src/Form/DeleteMultiple.php | 124 - .../profile/src/Form/ProfileDeleteForm.php | 53 - .../users/profile/src/Form/ProfileForm.php | 102 - .../src/Form/ProfileTypeDeleteForm.php | 32 - .../profile/src/Form/ProfileTypeForm.php | 138 - .../src/Plugin/Action/DeleteProfile.php | 77 - .../src/Plugin/Action/PublishProfile.php | 39 - .../src/Plugin/Action/UnpublishProfile.php | 39 - .../Plugin/Derivative/ProfileLocalTask.php | 66 - .../ProfileSelection.php | 30 - .../processor/ProfileUserStatus.php | 52 - .../Plugin/views/field/ProfileBulkForm.php | 21 - .../relationship/ProfileViewsRelationship.php | 84 - .../src/ProfileAccessControlHandler.php | 34 - .../users/profile/src/ProfileListBuilder.php | 155 - .../profile/src/ProfilePermissionProvider.php | 43 - .../users/profile/src/ProfileStorage.php | 51 - .../profile/src/ProfileStorageInterface.php | 56 - .../users/profile/src/ProfileTestTrait.php | 67 - .../profile/src/ProfileTypeListBuilder.php | 65 - .../users/profile/src/ProfileViewBuilder.php | 22 - .../users/profile/src/ProfileViewsData.php | 29 - .../users/profile/templates/profile.html.twig | 24 - .../tests/profile_test/profile_test.info.yml | 12 - .../test_views/views.view.users.yml | 243 -- .../src/Functional/ProfileDefaultTest.php | 148 - .../src/Functional/ProfileFieldAccessTest.php | 121 - .../tests/src/Functional/ProfileHelpTest.php | 26 - .../Functional/ProfileRegisterFormTest.php | 74 - .../src/Functional/ProfileRevisionTest.php | 160 - .../tests/src/Functional/ProfileTabTest.php | 136 - .../tests/src/Functional/ProfileTest.php | 127 - .../tests/src/Functional/ProfileTestBase.php | 138 - .../src/Functional/ProfileTypeCRUDTest.php | 105 - .../tests/src/Functional/ProfileTypeTest.php | 77 - .../tests/src/Kernel/ProfileAccessTest.php | 219 -- .../src/Kernel/ProfileRoleAccessTest.php | 201 -- .../profile/tests/src/Kernel/ProfileTest.php | 332 -- .../tests/src/Kernel/ProfileViewTest.php | 109 - .../views/translation_views/LICENSE.txt | 339 -- .../contrib/views/translation_views/README.md | 78 - .../views.view.content_translations.yml | 878 ------ .../schema/translation_views.views.schema.yml | 71 - .../src/EntityTranslationInfo.php | 81 - .../views/field/TranslationCountField.php | 83 - .../field/TranslationModerationState.php | 161 - .../field/TranslationOperationsField.php | 382 --- ...onSourceLangcodeEqualsRowLangcodeField.php | 49 - .../Plugin/views/field/TranslationStatus.php | 95 - .../field/TranslationTargetLanguageField.php | 84 - .../views/filter/TranslationCountFilter.php | 69 - ...nSourceLangcodeEqualsRowLangcodeFilter.php | 31 - .../views/filter/TranslationStatusFilter.php | 52 - .../TranslationTargetLanguageFilter.php | 298 -- .../views/join/TranslationLanguageJoin.php | 70 - .../src/TranslationCountTrait.php | 52 - .../src/TranslationViewsFieldDefinitions.php | 164 - .../src/TranslationViewsTargetLanguage.php | 47 - ..._local_translation_content_integration.yml | 253 -- ...tion_views_local_translation_test.info.yml | 19 - .../views.view.comment_translation.yml | 997 ------ ...ew.content_moderation_integration_test.yml | 166 - .../views.view.test_operations_links.yml | 260 -- ...anslation_views_all_filters_and_fields.yml | 925 ------ .../workflows.workflow.editorial.yml | 63 - .../translation_views_test_views.info.yml | 19 - .../CommentFullViewFiltersFieldsTest.php | 491 --- .../ContentFullViewFiltersFieldsTest.php | 471 --- .../ContentModerationIntegration.php | 103 - .../ContentTranslationJobsViewTest.php | 223 -- ...LocalTranslationContentIntegrationTest.php | 221 -- ...TranslationOperationTargetLanguageTest.php | 211 -- ...nslationOperationsFieldPermissionsTest.php | 285 -- .../translation_views.info.yml | 17 - .../translation_views.module | 138 - .../translation_views.views.inc | 115 - .../translation_views.views_execution.inc | 36 - .../contrib/views/views_bulk_edit/LICENSE.txt | 339 -- .../contrib/views/views_bulk_edit/README.txt | 35 - .../views/views_bulk_edit/composer.json | 20 - .../views/views_bulk_edit/css/edit_form.css | 5 - .../src/Plugin/Action/ModifyEntityValues.php | 490 --- .../ViewsBulkEditModifyEntityValuesTest.php | 158 - .../src/Kernel/ViewsBulkEditActionTest.php | 79 - .../views_bulk_edit/views_bulk_edit.info.yml | 13 - .../views_bulk_edit.libraries.yml | 4 - .../views_bulk_edit/views_bulk_edit.module | 24 - .../views/views_bulk_operations/LICENSE.txt | 339 -- .../views/views_bulk_operations/README.txt | 53 - .../views/views_bulk_operations/composer.json | 26 - .../views_bulk_operations.views.schema.yml | 28 - .../views_bulk_operations/css/frontUi.css | 6 - .../views_bulk_operations/drush.services.yml | 9 - .../views/views_bulk_operations/js/adminUi.js | 58 - .../views/views_bulk_operations/js/frontUi.js | 234 -- .../actions_permissions.info.yml | 13 - .../actions_permissions.permissions.yml | 2 - .../actions_permissions.services.yml | 5 - .../src/ActionsPermissions.php | 106 - .../ActionsPermissionsEventSubscriber.php | 59 - .../ViewsBulkOperationExampleAction.php | 115 - .../views_bulk_operations_example.info.yml | 13 - .../src/Access/ViewsBulkOperationsAccess.php | 50 - .../Action/ViewsBulkOperationsActionBase.php | 133 - .../ViewsBulkOperationsActionInterface.php | 47 - ...ulkOperationsPreconfigurationInterface.php | 27 - .../Commands/ViewsBulkOperationsCommands.php | 287 -- .../ViewsBulkOperationsController.php | 131 - .../ViewsBulkOperationsEventSubscriber.php | 61 - .../src/Form/ConfigureAction.php | 176 -- .../src/Form/ConfirmAction.php | 131 - .../src/Form/ViewsBulkOperationsFormTrait.php | 197 -- .../src/Plugin/Action/CancelUserAction.php | 160 - .../src/Plugin/Action/EntityDeleteAction.php | 39 - .../field/ViewsBulkOperationsBulkForm.php | 905 ------ .../ViewsBulkOperationsActionManager.php | 183 -- .../ViewsBulkOperationsActionProcessor.php | 419 --- ...BulkOperationsActionProcessorInterface.php | 56 - .../Service/ViewsBulkOperationsViewData.php | 227 -- .../ViewsBulkOperationsViewDataInterface.php | 86 - .../src/ViewsBulkOperationsBatch.php | 233 -- .../src/ViewsBulkOperationsEvent.php | 139 - .../ViewsBulkOperationsBulkFormTest.php | 344 -- ...ViewsBulkOperationsActionProcessorTest.php | 89 - .../ViewsBulkOperationsDataServiceTest.php | 58 - .../ViewsBulkOperationsKernelTestBase.php | 297 -- .../src/Unit/TestViewsBulkOperationsBatch.php | 34 - .../src/Unit/ViewsBulkOperationsBatchTest.php | 160 - .../views.view.views_bulk_operations_test.yml | 232 -- ...ew.views_bulk_operations_test_advanced.yml | 270 -- .../ViewsBulkOperationsAdvancedTestAction.php | 98 - .../ViewsBulkOperationsPassTestAction.php | 71 - .../ViewsBulkOperationsSimpleTestAction.php | 37 - .../views_bulk_operations_test.info.yml | 14 - ...views_bulk_operations_test.permissions.yml | 2 - .../views_bulk_operations.drush.inc | 207 -- .../views_bulk_operations.info.yml | 13 - .../views_bulk_operations.libraries.yml | 20 - .../views_bulk_operations.module | 47 - .../views_bulk_operations.routing.yml | 32 - .../views_bulk_operations.services.yml | 20 - .../all/modules/examples/examples/LICENSE.txt | 339 -- .../examples/ms_ajax_form_example/LICENSE.txt | 339 -- .../contrib/adminimal_theme/LICENSE.txt | 339 -- .../adminimal_theme/adminimal_theme.info.yml | 34 - .../adminimal_theme.libraries.yml | 11 - .../adminimal_theme/adminimal_theme.theme | 106 - .../contrib/adminimal_theme/composer.json | 10 - ...lock.block.adminimal_theme_breadcrumbs.yml | 19 - .../block.block.adminimal_theme_content.yml | 19 - .../block.block.adminimal_theme_help.yml | 19 - ...ck.block.adminimal_theme_local_actions.yml | 17 - .../block.block.adminimal_theme_login.yml | 19 - .../block.block.adminimal_theme_messages.yml | 19 - ...block.block.adminimal_theme_page_title.yml | 17 - ...ck.adminimal_theme_primary_local_tasks.yml | 19 - ....adminimal_theme_secondary_local_tasks.yml | 19 - .../contrib/adminimal_theme/css/adminimal.css | 844 ----- .../adminimal_theme/images/caret-down.svg | 1 - .../images/chevron-disc-down-hover.svg | 26 - .../images/chevron-disc-down.svg | 26 - .../images/chevron-disc-up.svg | 27 - .../contrib/adminimal_theme/screenshot.png | Bin 11319 -> 0 bytes sites/all/themes/contrib/basic/.gitignore | 6 - sites/all/themes/contrib/basic/Gruntfile.js | 154 - sites/all/themes/contrib/basic/LICENSE.txt | 339 -- sites/all/themes/contrib/basic/README.txt | 242 -- sites/all/themes/contrib/basic/basic.info.yml | 28 - .../themes/contrib/basic/basic.libraries.yml | 40 - sites/all/themes/contrib/basic/basic.theme | 55 - sites/all/themes/contrib/basic/composer.json | 46 - .../basic/config/install/basic.settings.yml | 9 - .../block.block.basic_account_menu.yml | 23 - .../optional/block.block.basic_branding.yml | 22 - .../block.block.basic_breadcrumbs.yml | 19 - .../optional/block.block.basic_content.yml | 19 - .../optional/block.block.basic_footer.yml | 23 - .../optional/block.block.basic_help.yml | 19 - .../block.block.basic_local_actions.yml | 17 - .../block.block.basic_local_tasks.yml | 19 - .../optional/block.block.basic_main_menu.yml | 23 - .../optional/block.block.basic_messages.yml | 19 - .../optional/block.block.basic_page_title.yml | 17 - .../optional/block.block.basic_search.yml | 19 - .../optional/block.block.basic_tools.yml | 23 - .../basic/config/schema/basic.schema.yml | 33 - .../themes/contrib/basic/css/base/base.css | 271 -- .../basic/css/components/components.css | 33 - .../contrib/basic/css/components/messages.css | 50 - .../contrib/basic/css/components/tabs.css | 24 - .../contrib/basic/css/layout/layout.css | 174 - .../themes/contrib/basic/css/theme/print.css | 34 - .../themes/contrib/basic/css/theme/theme.css | 7 - .../contrib/basic/images/optimized/README.txt | 26 - .../contrib/basic/images/source/README.txt | 26 - .../contrib/basic/includes/basic.drush.inc | 442 --- .../themes/contrib/basic/js/build/scripts.js | 2 - .../all/themes/contrib/basic/js/modernizr.js | 3 - .../contrib/basic/js/selectivizr-min.js | 5 - .../themes/contrib/basic/js/source/scripts.js | 37 - sites/all/themes/contrib/basic/logo.png | Bin 1584 -> 0 bytes sites/all/themes/contrib/basic/logo.svg | 50 - sites/all/themes/contrib/basic/package.json | 26 - .../contrib/basic/sass/base/_buttons.sass | 32 - .../contrib/basic/sass/base/_forms.sass | 71 - .../contrib/basic/sass/base/_lists.sass | 16 - .../contrib/basic/sass/base/_media.sass | 9 - .../contrib/basic/sass/base/_tables.sass | 21 - .../contrib/basic/sass/base/_typography.sass | 71 - .../themes/contrib/basic/sass/base/base.sass | 13 - .../basic/sass/components/_breadcrumb.sass | 5 - .../basic/sass/components/_navigation.sass | 5 - .../contrib/basic/sass/components/_pager.sass | 5 - .../basic/sass/components/_site-name.sass | 7 - .../basic/sass/components/components.sass | 11 - .../basic/sass/components/messages.sass | 33 - .../contrib/basic/sass/components/tabs.sass | 16 - .../contrib/basic/sass/config/_config.sass | 36 - .../basic/sass/config/_grid-settings.sass | 27 - .../contrib/basic/sass/config/_mixins.sass | 19 - .../contrib/basic/sass/config/_variables.sass | 65 - .../basic/sass/layout/_layout--grid.sass | 101 - .../contrib/basic/sass/layout/layout.sass | 8 - .../contrib/basic/sass/theme/print.sass | 36 - .../contrib/basic/sass/theme/theme.sass | 9 - sites/all/themes/contrib/basic/screenshot.png | Bin 2134 -> 0 bytes .../block--local-actions-block.html.twig | 12 - .../block/block--local-tasks-block.html.twig | 14 - .../block/block--search-form-block.html.twig | 45 - .../block--system-branding-block.html.twig | 30 - .../block/block--system-menu-block.html.twig | 56 - .../basic/templates/block/block.html.twig | 32 - .../basic/templates/breadcrumb.html.twig | 25 - .../contrib/basic/templates/comment.html.twig | 109 - .../basic/templates/field--comment.html.twig | 42 - .../contrib/basic/templates/field.html.twig | 20 - .../contrib/basic/templates/html.html.twig | 81 - .../basic/templates/menu-local-task.html.twig | 19 - .../templates/menu-local-tasks.html.twig | 29 - .../contrib/basic/templates/menu.html.twig | 55 - .../contrib/basic/templates/node.html.twig | 53 - .../contrib/basic/templates/page.html.twig | 93 - .../contrib/basic/templates/pager.html.twig | 98 - .../basic/templates/status-messages.html.twig | 58 - .../templates/views-mini-pager.html.twig | 41 - .../themes/contrib/basic/theme-settings.php | 83 - themes/README.txt | 31 - .csslintrc => web/.csslintrc | 0 web/.editorconfig | 17 + .eslintignore => web/.eslintignore | 0 .eslintrc.json => web/.eslintrc.json | 0 web/.gitattributes | 61 + web/.ht.router.php | 65 + .htaccess => web/.htaccess | 0 autoload.php => web/autoload.php | 5 +- index.php => web/index.php | 0 .../modules/.gitkeep | 0 .../profiles/.gitkeep | 0 robots.txt => web/robots.txt | 4 +- {sites => web/sites}/README.txt | 0 .../all/modules/examples/examples/.eslintrc | 0 .../modules/examples/examples/CONTRIBUTING.md | 0 .../all/modules/examples/examples/LICENSE.txt | 0 .../all/modules/examples/examples/README.md | 0 .../modules/examples/examples/STANDARDS.md | 0 .../all/modules/examples/examples/TESTING.md | 0 .../ajax_example/ajax_example.info.yml | 0 .../ajax_example/ajax_example.libraries.yml | 0 .../ajax_example/ajax_example.links.menu.yml | 0 .../examples/ajax_example/ajax_example.module | 0 .../ajax_example/ajax_example.routing.yml | 0 .../ajax_example/css/ajax-example-base.css | 0 .../examples/ajax_example/js/ajax-example.js | 0 .../src/Controller/AjaxExampleController.php | 0 .../ajax_example/src/Form/Autotextfields.php | 0 .../src/Form/DependentDropdown.php | 0 .../src/Form/DynamicFormSections.php | 0 .../src/Form/EntityAutocomplete.php | 0 .../ajax_example/src/Form/Simplest.php | 0 .../ajax_example/src/Form/SubmitDriven.php | 0 .../examples/ajax_example/src/Form/Wizard.php | 0 .../templates/description.html.twig | 0 .../src/Functional/AjaxExampleMenuTest.php | 0 .../src/Functional/DependentDropdownTest.php | 0 .../Functional/DynamicFormSectionsTest.php | 0 .../AutotextfieldsTest.php | 0 .../DependentDropdownTest.php | 0 .../DynamicFormSectionsTest.php | 0 .../EntityAutocompleteTest.php | 0 .../src/FunctionalJavascript/SimplestTest.php | 0 .../FunctionalJavascript/SubmitDrivenTest.php | 0 .../batch_example/batch_example.info.yml | 0 .../batch_example/batch_example.install | 0 .../batch_example.links.menu.yml | 0 .../batch_example/batch_example.module | 0 .../batch_example/batch_example.routing.yml | 0 .../src/Form/BatchExampleForm.php | 0 .../src/functional/BatchExampleWebTest.php | 0 .../block_example/block_example.info.yml | 0 .../block_example.links.menu.yml | 0 .../block_example/block_example.module | 0 .../block_example/block_example.routing.yml | 0 .../config/schema/block_example.schema.yml | 0 .../src/Controller/BlockExampleController.php | 0 .../Block/ExampleConfigurableTextBlock.php | 0 .../src/Plugin/Block/ExampleEmptyBlock.php | 0 .../Plugin/Block/ExampleUppercaseBlock.php | 0 .../templates/description.html.twig | 0 .../src/Functional/BlockExampleMenuTest.php | 0 .../tests/src/Functional/BlockExampleTest.php | 0 .../cache_example/cache_example.info.yml | 0 .../cache_example.links.menu.yml | 0 .../cache_example/cache_example.module | 0 .../cache_example/cache_example.routing.yml | 0 .../src/Form/CacheExampleForm.php | 0 .../tests/src/Functional/CacheExampleTest.php | 0 .../modules/examples/examples/composer.json | 0 .../config_entity_example.robot.marvin.yml | 0 .../schema/config_entity_example.schema.yml | 0 .../config_entity_example.info.yml | 0 .../config_entity_example.links.action.yml | 0 .../config_entity_example.links.menu.yml | 0 .../config_entity_example.module | 0 .../config_entity_example.permissions.yml | 0 .../config_entity_example.routing.yml | 0 .../src/Controller/RobotListBuilder.php | 0 .../src/Entity/Robot.php | 0 .../src/Form/RobotAddForm.php | 0 .../src/Form/RobotDeleteForm.php | 0 .../src/Form/RobotEditForm.php | 0 .../src/Form/RobotFormBase.php | 0 .../src/RobotAccessController.php | 0 .../templates/description.html.twig | 0 .../Functional/ConfigEntityExampleTest.php | 0 .../content_entity_example.info.yml | 0 .../content_entity_example.links.action.yml | 0 .../content_entity_example.links.menu.yml | 0 .../content_entity_example.links.task.yml | 0 .../content_entity_example.module | 0 .../content_entity_example.permissions.yml | 0 .../content_entity_example.routing.yml | 0 .../src/ContactAccessControlHandler.php | 0 .../src/ContactInterface.php | 0 .../src/Entity/Contact.php | 0 .../Entity/Controller/ContactListBuilder.php | 0 .../src/Form/ContactDeleteForm.php | 0 .../src/Form/ContactForm.php | 0 .../src/Form/ContactSettingsForm.php | 0 .../Functional/ContentEntityExampleTest.php | 0 .../config/install/cron_example.settings.yml | 0 .../config/schema/cron_example.schema.yml | 0 .../cron_example/cron_example.info.yml | 0 .../cron_example/cron_example.links.menu.yml | 0 .../examples/cron_example/cron_example.module | 0 .../cron_example/cron_example.routing.yml | 0 .../cron_example/src/Form/CronExampleForm.php | 0 .../Plugin/QueueWorker/ReportWorkerBase.php | 0 .../Plugin/QueueWorker/ReportWorkerOne.php | 0 .../Plugin/QueueWorker/ReportWorkerTwo.php | 0 .../tests/src/Functional/CronExampleTest.php | 0 .../examples/examples/css/examples.icons.css | 0 .../dbtng_example/dbtng_example.info.yml | 0 .../dbtng_example/dbtng_example.install | 0 .../dbtng_example.links.menu.yml | 0 .../dbtng_example/dbtng_example.module | 0 .../dbtng_example/dbtng_example.routing.yml | 0 .../src/Controller/DbtngExampleController.php | 0 .../dbtng_example/src/DbtngExampleStorage.php | 0 .../src/Form/DbtngExampleAddForm.php | 0 .../src/Form/DbtngExampleUpdateForm.php | 0 .../tests/src/Functional/DbtngExampleTest.php | 0 .../email_example/email_example.info.yml | 0 .../email_example.links.menu.yml | 0 .../email_example/email_example.module | 0 .../email_example/email_example.routing.yml | 0 .../src/Form/EmailExampleGetFormPage.php | 0 .../tests/src/Functional/EmailExampleTest.php | 0 .../events_example/events_example.info.yml | 0 .../events_example.links.menu.yml | 0 .../events_example/events_example.module | 0 .../events_example/events_example.routing.yml | 0 .../events_example.services.yml | 0 .../src/Event/IncidentEvents.php | 0 .../src/Event/IncidentReportEvent.php | 0 .../EventsExampleSubscriber.php | 0 .../src/Form/EventsExampleForm.php | 0 .../src/Functional/EventsExampleTest.php | 0 .../src/Kernel/EventsExampleServiceTest.php | 0 .../examples/examples/examples.info.yml | 0 .../examples/examples/examples.libraries.yml | 0 .../modules/examples/examples/examples.module | 0 .../config/schema/field_example.schema.yml | 0 .../field_example/field_example.info.yml | 0 .../examples/field_example/field_example.js | 0 .../field_example/field_example.libraries.yml | 0 .../field_example.links.menu.yml | 0 .../field_example/field_example.module | 0 .../field_example/field_example.routing.yml | 0 .../src/Controller/FieldExampleController.php | 0 .../src/FieldExampleWebTestBase.php | 0 .../ColorBackgroudFormatter.php | 0 .../FieldFormatter/SimpleTextFormatter.php | 0 .../src/Plugin/Field/FieldType/RgbItem.php | 0 .../Field/FieldWidget/ColorPickerWidget.php | 0 .../Plugin/Field/FieldWidget/Text3Widget.php | 0 .../Plugin/Field/FieldWidget/TextWidget.php | 0 .../templates/description.html.twig | 0 .../ColorBackgroundFormatterTest.php | 0 .../src/Functional/ColorPickerWidgetTest.php | 0 .../FieldExampleBrowserTestBase.php | 0 .../src/Functional/FieldExampleMenuTest.php | 0 .../tests/src/Functional/Text3WidgetTest.php | 0 .../tests/src/Functional/TextWidgetTest.php | 0 .../css/field-permission-description.css | 0 .../css/field_permission_example.css | 0 .../field_permission_example.info.yml | 0 .../field_permission_example.libraries.yml | 0 .../field_permission_example.links.menu.yml | 0 .../field_permission_example.module | 0 .../field_permission_example.permissions.yml | 0 .../field_permission_example.routing.yml | 0 .../FieldPermissionExampleController.php | 0 .../FieldFormatter/SimpleTextFormatter.php | 0 .../src/Plugin/Field/FieldType/FieldNote.php | 0 .../Plugin/Field/FieldWidget/TextWidget.php | 0 .../templates/description.html.twig | 0 .../tests/src/Kernel/FieldNoteItemTest.php | 0 .../file_example/file_example.info.yml | 0 .../file_example/file_example.links.menu.yml | 0 .../examples/file_example/file_example.module | 0 .../file_example/file_example.permissions.yml | 0 .../file_example/file_example.routing.yml | 0 .../src/Form/FileExampleReadWriteForm.php | 0 .../tests/src/Functional/FileExampleTest.php | 0 .../form_api_example.info.yml | 0 .../form_api_example.links.menu.yml | 0 .../form_api_example/form_api_example.module | 0 .../form_api_example.routing.yml | 0 .../form_api_example/src/Controller/Page.php | 0 .../form_api_example/src/Form/AjaxAddMore.php | 0 .../src/Form/AjaxColorForm.php | 0 .../form_api_example/src/Form/BuildDemo.php | 0 .../src/Form/ContainerDemo.php | 0 .../form_api_example/src/Form/DemoBase.php | 0 .../form_api_example/src/Form/InputDemo.php | 0 .../form_api_example/src/Form/ModalForm.php | 0 .../src/Form/MultistepForm.php | 0 .../form_api_example/src/Form/SimpleForm.php | 0 .../form_api_example/src/Form/StateDemo.php | 0 .../src/Form/VerticalTabsDemo.php | 0 .../templates/description.html.twig | 0 .../tests/src/Functional/FapiExampleTest.php | 0 .../src/Functional/MultistepFormTest.php | 0 .../AjaxColorFormTest.php | 0 .../FunctionalJavascript/ModalFormTest.php | 0 .../hooks_example/hooks_example.api.php | 0 .../hooks_example/hooks_example.info.yml | 0 .../hooks_example/hooks_example.module | 0 .../hooks_example/hooks_example.routing.yml | 0 .../src/Controller/HooksExampleController.php | 0 .../templates/description.html.twig | 0 .../tests/src/Functional/HooksExampleTest.php | 0 .../examples/examples/images/100x30.svg | 0 .../examples/examples/images/examples.svg | 0 .../examples/js_example/css/jsweights.css | 0 .../examples/examples/js_example/js/black.js | 0 .../examples/examples/js_example/js/blue.js | 0 .../examples/examples/js_example/js/brown.js | 0 .../examples/examples/js_example/js/green.js | 0 .../js_example/js/js_example_accordion.js | 0 .../examples/examples/js_example/js/purple.js | 0 .../examples/examples/js_example/js/red.js | 0 .../examples/js_example/js_example.info.yml | 0 .../js_example/js_example.libraries.yml | 0 .../js_example/js_example.links.menu.yml | 0 .../examples/js_example/js_example.module | 0 .../js_example/js_example.routing.yml | 0 .../src/Controller/JsExampleController.php | 0 .../js_example/templates/accordion.html.twig | 0 .../templates/description.html.twig | 0 .../tests/src/Functional/JsExampleTest.php | 0 ...isplay.node.basic_content_type.default.yml | 0 ...splay.node.locked_content_type.default.yml | 0 ...isplay.node.basic_content_type.default.yml | 0 ...splay.node.locked_content_type.default.yml | 0 ...eld.field.node.basic_content_type.body.yml | 0 ...ld.field.node.locked_content_type.body.yml | 0 .../install/node.type.basic_content_type.yml | 0 .../install/node.type.locked_content_type.yml | 0 .../node_type_example.info.yml | 0 .../node_type_example.install | 0 .../node_type_example.links.menu.yml | 0 .../node_type_example.module | 0 .../node_type_example.routing.yml | 0 .../Controller/NodeTypeExampleController.php | 0 .../templates/description.html.twig | 0 .../src/Functional/NodeTypeExampleTest.php | 0 .../page_example/page_example.info.yml | 0 .../page_example/page_example.links.menu.yml | 0 .../examples/page_example/page_example.module | 0 .../page_example/page_example.permissions.yml | 0 .../page_example/page_example.routing.yml | 0 .../src/Controller/PageExampleController.php | 0 .../templates/description.html.twig | 0 .../tests/src/Functional/PageExampleTest.php | 0 .../pager_example/pager_example.info.yml | 0 .../pager_example.links.menu.yml | 0 .../pager_example/pager_example.module | 0 .../pager_example/pager_example.routing.yml | 0 .../src/Controller/PagerExamplePage.php | 0 .../templates/description.html.twig | 0 .../tests/src/Functional/PagerExampleTest.php | 0 .../modules/examples/examples/phpcs.xml.dist | 0 .../phpunit_example/phpunit_example.info.yml | 0 .../phpunit_example.links.menu.yml | 0 .../phpunit_example/phpunit_example.module | 0 .../phpunit_example.routing.yml | 0 .../examples/phpunit_example/src/AddClass.php | 0 .../Controller/PHPUnitExampleController.php | 0 .../src/DisplayInfoInterface.php | 0 .../phpunit_example/src/DisplayManager.php | 0 .../phpunit_example/src/ProtectedPrivates.php | 0 .../templates/description.html.twig | 0 .../src/Functional/PHPUnitExampleMenuTest.php | 0 .../tests/src/Unit/AddClassTest.php | 0 .../tests/src/Unit/DisplayManagerTest.php | 0 .../tests/src/Unit/ProtectedPrivatesTest.php | 0 .../Subclasses/ProtectedPrivatesSubclass.php | 0 .../plugin_type_example.api.php | 0 .../plugin_type_example.info.yml | 0 .../plugin_type_example.links.menu.yml | 0 .../plugin_type_example.module | 0 .../plugin_type_example.routing.yml | 0 .../plugin_type_example.services.yml | 0 .../src/Annotation/Sandwich.php | 0 .../PluginTypeExampleController.php | 0 .../Plugin/Sandwich/ExampleHamSandwich.php | 0 .../Sandwich/ExampleMeatballSandwich.php | 0 .../plugin_type_example/src/SandwichBase.php | 0 .../src/SandwichInterface.php | 0 .../src/SandwichPluginManager.php | 0 .../src/Functional/PluginTypeExampleTest.php | 0 .../queue_example/queue_example.info.yml | 0 .../queue_example.links.menu.yml | 0 .../queue_example/queue_example.module | 0 .../queue_example/queue_example.routing.yml | 0 .../src/Forms/QueueExampleForm.php | 0 .../tests/src/Functional/QueueExampleTest.php | 0 ...isplay.node.simpletest_example.default.yml | 0 ...eld.field.node.simpletest_example.body.yml | 0 .../install/node.type.simpletest_example.yml | 0 .../simpletest_example_test.info.yml | 0 .../simpletest_example_test.module | 0 .../simpletest_example.info.yml | 0 .../simpletest_example.links.menu.yml | 0 .../simpletest_example.module | 0 .../simpletest_example.permissions.yml | 0 .../simpletest_example.routing.yml | 0 .../SimpleTestExampleController.php | 0 .../Tests/SimpleTestExampleMockModuleTest.php | 0 .../src/Tests/SimpleTestExampleTest.php | 0 .../templates/description.html.twig | 0 .../src/Functional/SimpletestExampeTest.php | 0 .../examples/src/Tests/ExamplesTest.php | 0 .../examples/src/Tests/ExamplesTestBase.php | 0 .../src/Utility/DescriptionTemplateTrait.php | 0 .../StreamWrapperExampleController.php | 0 .../PathProcessor/PathProcessorSessions.php | 0 .../FileExampleSessionStreamWrapper.php | 0 .../src/StreamWrapper/MockSessionTrait.php | 0 .../src/StreamWrapper/SessionWrapper.php | 0 .../stream_wrapper_example.info.yml | 0 .../stream_wrapper_example.links.menu.yml | 0 .../stream_wrapper_example.module | 0 .../stream_wrapper_example.routing.yml | 0 .../stream_wrapper_example.services.yml | 0 .../templates/description.html.twig | 0 .../tests/src/Kernel/StreamWrapperTest.php | 0 .../tests/src/Unit/SessionWrapperTest.php | 0 .../Controller/TableDragExampleController.php | 0 .../src/Form/TableDragExampleNestedForm.php | 0 .../src/Form/TableDragExampleResetForm.php | 0 .../src/Form/TableDragExampleRootLeafForm.php | 0 .../src/Form/TableDragExampleSimpleForm.php | 0 .../tabledrag_example.data.inc | 0 .../tabledrag_example.info.yml | 0 .../tabledrag_example.install | 0 .../tabledrag_example.links.menu.yml | 0 .../tabledrag_example.module | 0 .../tabledrag_example.routing.yml | 0 .../templates/description.html.twig | 0 .../src/Functional/TabledragMenuTest.php | 0 .../Controller/TableSortExampleController.php | 0 .../tablesort_example.info.yml | 0 .../tablesort_example.install | 0 .../tablesort_example.links.menu.yml | 0 .../tablesort_example.module | 0 .../tablesort_example.routing.yml | 0 .../src/Functional/TableSortExampleTest.php | 0 .../src/Controller/ContrivedController.php | 0 .../Controller/TestingExampleController.php | 0 .../src/Tests/NaiveConversionTest.php | 0 .../templates/description.html.twig | 0 .../testing_example/testing_example.info.yml | 0 .../testing_example.links.menu.yml | 0 .../testing_example/testing_example.module | 0 .../testing_example.routing.yml | 0 .../src/Functional/ExampleFunctionalTest.php | 0 .../FrontPageLinkDependenciesTest.php | 0 .../src/Functional/FrontPageLinkTest.php | 0 .../tests/src/Functional/SkeletonTest.php | 0 .../src/Functional/TestingExampleMenuTest.php | 0 .../Kernel/ExampleFixtureManagementTest.php | 0 .../Controller/ContrivedControllerTest.php | 0 .../examples_description_test.info.yml | 0 .../examples_description_test.routing.yml | 0 .../Controller/SampleExampleController.php | 0 .../templates/description.html.twig | 0 .../Functional/ExamplesBrowserTestBase.php | 0 .../tests/src/Functional/ExamplesTest.php | 0 .../tests/src/Kernel/DescriptionTraitTest.php | 0 .../tests/src/Unit/YamlValidationTest.php | 0 .../config/install/tour.tour.tour-example.yml | 0 .../src/Controller/TourExampleController.php | 0 .../templates/description.html.twig | 0 .../tests/src/Functional/TourExampleTest.php | 0 .../tests/src/Functional/TourTestBase.php | 0 .../tests/src/Functional/TourTestBasic.php | 0 .../tour_example/tour_example.info.yml | 0 .../tour_example/tour_example.links.menu.yml | 0 .../examples/tour_example/tour_example.module | 0 .../tour_example/tour_example.routing.yml | 0 .../ms_ajax_form_example}/LICENSE.txt | 0 .../examples/ms_ajax_form_example/README.txt | 0 .../ms_ajax_form_example.info.yml | 0 .../ms_ajax_form_example.routing.yml | 0 .../src/Button/BaseButton.php | 0 .../src/Button/ButtonInterface.php | 0 .../src/Button/StepOneNextButton.php | 0 .../src/Button/StepThreeFinishButton.php | 0 .../src/Button/StepThreePreviousButton.php | 0 .../src/Button/StepTwoNextButton.php | 0 .../src/Button/StepTwoPreviousButton.php | 0 .../src/Form/MultiStepExampleForm.php | 0 .../src/Manager/StepManager.php | 0 .../src/Step/BaseStep.php | 0 .../src/Step/StepFinalize.php | 0 .../src/Step/StepInterface.php | 0 .../ms_ajax_form_example/src/Step/StepOne.php | 0 .../src/Step/StepThree.php | 0 .../ms_ajax_form_example/src/Step/StepTwo.php | 0 .../src/Step/StepsEnum.php | 0 .../src/Validator/BaseValidator.php | 0 .../src/Validator/ValidatorInterface.php | 0 .../src/Validator/ValidatorRegex.php | 0 .../src/Validator/ValidatorRequired.php | 0 .../sites}/all/modules/figli/.gitignore | 0 .../figli/edlp_admin/edlp_admin.info.yml | 0 .../edlp_admin/edlp_admin.links.action.yml | 0 .../figli/edlp_admin/edlp_admin.module | 0 .../src/Plugin/Filter/CssFilter.php | 0 .../figli/edlp_agenda/edlp_agenda.info.yml | 0 .../figli/edlp_agenda/edlp_agenda.module | 0 .../figli/edlp_agenda/edlp_agenda.routing.yml | 0 .../edlp_agenda/includes/edlp_agenda.inc | 0 .../src/Controller/AgendaController.php | 0 .../templates/edlp-agenda.html.twig | 0 .../figli/edlp_ajax/edlp_ajax.info.yml | 0 .../modules/figli/edlp_ajax/edlp_ajax.module | 0 .../figli/edlp_ajax/edlp_ajax.routing.yml | 0 .../figli/edlp_ajax/includes/edlp_ajax.inc | 0 .../src/Controller/EdlpAjaxController.php | 0 .../EntityReferenceLabelFormatterAjax.php | 0 .../edlp_ajax/templates/edlp-ajax.html.twig | 0 .../all/modules/figli/edlp_corpus/.gitignore | 0 .../assets/dist/scripts/corpus.min.js | 0 .../assets/dist/scripts/physics.min.js | 0 .../assets/dist/styles/corpus.min.css | 0 .../edlp_corpus/assets/scripts/corpus.js | 0 .../edlp_corpus/assets/scripts/physics.js | 0 .../edlp_corpus/assets/styles/corpus.scss | 0 .../all/modules/figli/edlp_corpus/bower.json | 0 .../figli/edlp_corpus/edlp_corpus.info.yml | 0 .../edlp_corpus/edlp_corpus.libraries.yml | 0 .../figli/edlp_corpus/edlp_corpus.module | 0 .../figli/edlp_corpus/edlp_corpus.routing.yml | 0 .../all/modules/figli/edlp_corpus/gulpfile.js | 0 .../edlp_corpus/includes/blockentrees.inc | 0 .../includes/edlp_corpus_articlesindex.inc | 0 .../includes/edlp_corpus_collection.inc | 0 .../includes/edlp_corpus_lastdocs.inc | 0 .../modules/figli/edlp_corpus/package.json | 0 .../src/Controller/CorpusController.php | 0 .../src/Plugin/Block/BlockEntrees.php | 0 .../src/Plugin/Filter/AudioLinksFilter.php | 0 .../templates/blockentrees.html.twig | 0 .../edlp-corpus-articlesindex.html.twig | 0 .../edlp-corpus-collection.html.twig | 0 .../templates/edlp-corpus-lastdocs.html.twig | 0 .../figli/edlp_fils/edlp_fils.info.yml | 0 .../modules/figli/edlp_fils/edlp_fils.module | 0 .../figli/edlp_fils/edlp_fils.routing.yml | 0 .../src/Controller/FilsController.php | 0 .../figli/edlp_home/edlp_home.info.yml | 0 .../modules/figli/edlp_home/edlp_home.module | 0 .../figli/edlp_home/edlp_home.routing.yml | 0 .../figli/edlp_home/includes/edlp_home.inc | 0 .../src/Controller/HomeController.php | 0 .../edlp_home/templates/edlp-home.html.twig | 0 ...igrate_plus.migration.d6_edlp_allfiles.yml | 0 .../migrate_plus.migration.d6_edlp_corpus.yml | 0 ...migrate_plus.migration.d6_edlp_entrees.yml | 0 ...rate_plus.migration.d6_edlp_evenements.yml | 0 .../migrate_plus.migration.d6_edlp_genres.yml | 0 ...migrate_plus.migration.d6_edlp_langues.yml | 0 .../migrate_plus.migration.d6_edlp_pages.yml | 0 ...igrate_plus.migration.d6_edlp_pagetype.yml | 0 .../migrate_plus.migration.d6_edlp_sons.yml | 0 .../migrate_plus.migration.d6_edlp_users.yml | 0 .../migrate_plus.migration_group.d6_edlp.yml | 0 .../figli/edlp_migrate/edlp_migrate.info.yml | 0 .../all/modules/figli/edlp_migrate/readme.md | 0 .../Plugin/migrate/source/D6EdlpCorpus.php | 0 .../migrate/source/D6EdlpEvenements.php | 0 .../src/Plugin/migrate/source/D6EdlpFile.php | 0 .../src/Plugin/migrate/source/D6EdlpPages.php | 0 .../src/Plugin/migrate/source/D6EdlpSons.php | 0 .../source/D6EdlpTaxonomyTermEntree.php | 0 .../src/Plugin/migrate/source/D6EdlpUsers.php | 0 ...igrate_plus.migration.upgrade_d6_block.yml | 0 ...plus.migration.upgrade_d6_date_formats.yml | 0 ...us.migration.upgrade_d6_dblog_settings.yml | 0 ...igrate_plus.migration.upgrade_d6_field.yml | 0 ...on.upgrade_d6_field_formatter_settings.yml | 0 ...us.migration.upgrade_d6_field_instance.yml | 0 ...rade_d6_field_instance_widget_settings.yml | 0 ...migrate_plus.migration.upgrade_d6_file.yml | 0 ...lus.migration.upgrade_d6_file_settings.yml | 0 ...lus.migration.upgrade_d6_filter_format.yml | 0 ...igration.upgrade_d6_imagecache_presets.yml | 0 ...n.upgrade_d6_language_content_settings.yml | 0 ...grade_d6_language_negotiation_settings.yml | 0 ...us.migration.upgrade_d6_language_types.yml | 0 ...migrate_plus.migration.upgrade_d6_menu.yml | 0 ...e_plus.migration.upgrade_d6_menu_links.yml | 0 ..._plus.migration.upgrade_d6_node_corpus.yml | 0 ..._plus.migration.upgrade_d6_node_entree.yml | 0 ...plus.migration.upgrade_d6_node_episode.yml | 0 ...e_plus.migration.upgrade_d6_node_event.yml | 0 ...te_plus.migration.upgrade_d6_node_home.yml | 0 ...te_plus.migration.upgrade_d6_node_page.yml | 0 ...ration.upgrade_d6_node_revision_corpus.yml | 0 ...ration.upgrade_d6_node_revision_entree.yml | 0 ...ation.upgrade_d6_node_revision_episode.yml | 0 ...gration.upgrade_d6_node_revision_event.yml | 0 ...igration.upgrade_d6_node_revision_home.yml | 0 ...igration.upgrade_d6_node_revision_page.yml | 0 ...migration.upgrade_d6_node_revision_son.yml | 0 ...ration.upgrade_d6_node_revision_static.yml | 0 ...e_d6_node_revision_visual_piece_sonore.yml | 0 ...ation.upgrade_d6_node_revision_webform.yml | 0 ...ration.upgrade_d6_node_setting_promote.yml | 0 ...gration.upgrade_d6_node_setting_status.yml | 0 ...gration.upgrade_d6_node_setting_sticky.yml | 0 ...lus.migration.upgrade_d6_node_settings.yml | 0 ...ate_plus.migration.upgrade_d6_node_son.yml | 0 ..._plus.migration.upgrade_d6_node_static.yml | 0 ...ion.upgrade_d6_node_translation_corpus.yml | 0 ...ion.upgrade_d6_node_translation_entree.yml | 0 ...on.upgrade_d6_node_translation_episode.yml | 0 ...tion.upgrade_d6_node_translation_event.yml | 0 ...ation.upgrade_d6_node_translation_home.yml | 0 ...ation.upgrade_d6_node_translation_page.yml | 0 ...ration.upgrade_d6_node_translation_son.yml | 0 ...ion.upgrade_d6_node_translation_static.yml | 0 ...6_node_translation_visual_piece_sonore.yml | 0 ...on.upgrade_d6_node_translation_webform.yml | 0 ...te_plus.migration.upgrade_d6_node_type.yml | 0 ...on.upgrade_d6_node_visual_piece_sonore.yml | 0 ...plus.migration.upgrade_d6_node_webform.yml | 0 ...s.migration.upgrade_d6_search_settings.yml | 0 ...gration.upgrade_d6_statistics_settings.yml | 0 ...s.migration.upgrade_d6_syslog_settings.yml | 0 ..._plus.migration.upgrade_d6_system_cron.yml | 0 ..._plus.migration.upgrade_d6_system_date.yml | 0 ..._plus.migration.upgrade_d6_system_file.yml | 0 ...plus.migration.upgrade_d6_system_image.yml | 0 ...s.migration.upgrade_d6_system_image_gd.yml | 0 ...us.migration.upgrade_d6_system_logging.yml | 0 ...igration.upgrade_d6_system_maintenance.yml | 0 ...igration.upgrade_d6_system_performance.yml | 0 ...e_plus.migration.upgrade_d6_system_rss.yml | 0 ..._plus.migration.upgrade_d6_system_site.yml | 0 ...lus.migration.upgrade_d6_taxonomy_term.yml | 0 ...n.upgrade_d6_taxonomy_term_translation.yml | 0 ...gration.upgrade_d6_taxonomy_vocabulary.yml | 0 ..._plus.migration.upgrade_d6_term_node_1.yml | 0 ..._plus.migration.upgrade_d6_term_node_2.yml | 0 ..._plus.migration.upgrade_d6_term_node_3.yml | 0 ..._plus.migration.upgrade_d6_term_node_4.yml | 0 ...ration.upgrade_d6_term_node_revision_1.yml | 0 ...ration.upgrade_d6_term_node_revision_2.yml | 0 ...ration.upgrade_d6_term_node_revision_3.yml | 0 ...ration.upgrade_d6_term_node_revision_4.yml | 0 ...grate_plus.migration.upgrade_d6_upload.yml | 0 ...ation.upgrade_d6_upload_entity_display.yml | 0 ....upgrade_d6_upload_entity_form_display.yml | 0 ...plus.migration.upgrade_d6_upload_field.yml | 0 ...ation.upgrade_d6_upload_field_instance.yml | 0 ...te_plus.migration.upgrade_d6_url_alias.yml | 0 ...migrate_plus.migration.upgrade_d6_user.yml | 0 ...ation.upgrade_d6_user_contact_settings.yml | 0 ...te_plus.migration.upgrade_d6_user_mail.yml | 0 ...migration.upgrade_d6_user_picture_file.yml | 0 ...te_plus.migration.upgrade_d6_user_role.yml | 0 ...lus.migration.upgrade_d6_user_settings.yml | 0 ...e_plus.migration.upgrade_d6_view_modes.yml | 0 ...n.upgrade_d6_vocabulary_entity_display.yml | 0 ...rade_d6_vocabulary_entity_form_display.yml | 0 ....migration.upgrade_d6_vocabulary_field.yml | 0 ...n.upgrade_d6_vocabulary_field_instance.yml | 0 ...lus.migration.upgrade_default_language.yml | 0 ...e_plus.migration.upgrade_file_settings.yml | 0 ...igrate_plus.migration.upgrade_language.yml | 0 ....upgrade_language_prefixes_and_domains.yml | 0 ...plus.migration.upgrade_locale_settings.yml | 0 .../migrate_plus.migration.upgrade_menu.yml | 0 ...rate_plus.migration.upgrade_menu_links.yml | 0 ...e_plus.migration.upgrade_menu_settings.yml | 0 ...ate_plus.migration.upgrade_search_page.yml | 0 ....migration.upgrade_statistics_settings.yml | 0 ...te_plus.migration.upgrade_system_image.yml | 0 ...plus.migration.upgrade_system_image_gd.yml | 0 ..._plus.migration.upgrade_system_logging.yml | 0 ...s.migration.upgrade_system_maintenance.yml | 0 ...rate_plus.migration.upgrade_system_rss.yml | 0 ...ate_plus.migration.upgrade_system_site.yml | 0 ...us.migration.upgrade_taxonomy_settings.yml | 0 ...e_plus.migration.upgrade_text_settings.yml | 0 ...plus.migration.upgrade_update_settings.yml | 0 ...on.upgrade_user_picture_entity_display.yml | 0 ...grade_user_picture_entity_form_display.yml | 0 ...s.migration.upgrade_user_picture_field.yml | 0 ...on.upgrade_user_picture_field_instance.yml | 0 .../migrate_plus.migration_group.default.yml | 0 ..._plus.migration_group.migrate_drupal_6.yml | 0 .../figli/edlp_mobile/edlp_mobile.info.yml | 0 .../figli/edlp_mobile/edlp_mobile.module | 0 .../edlp_productions.info.yml | 0 .../edlp_productions/edlp_productions.module | 0 .../edlp_productions.routing.yml | 0 .../includes/edlp_productions.inc | 0 .../src/Controller/ProductionsController.php | 0 .../templates/edlp-productions.html.twig | 0 .../assets/dist/scripts/edlp_search.min.js | 0 .../edlp_search/assets/scripts/edlp_search.js | 0 .../config/install/edlp_search.edlpsearch.yml | 0 .../figli/edlp_search/edlp_search.info.yml | 0 .../edlp_search/edlp_search.libraries.yml | 0 .../figli/edlp_search/edlp_search.module | 0 .../figli/edlp_search/edlp_search.routing.yml | 0 .../includes/edlp_search_results.inc | 0 .../includes/edlp_search_search_form.inc | 0 .../src/Controller/EdlpSearchController.php | 9 +- .../edlp_search/src/Form/EdlpSearchForm.php | 0 .../src/Plugin/Block/EdlpSearchLinkBlock.php | 0 .../templates/edlp-search-results.html.twig | 0 .../edlp-search-search-form.html.twig | 0 .../figli/edlp_studio/__chutier.page.inc | 0 .../figli/edlp_studio/__composition.page.inc | 0 .../assets/dist/scripts/edlp_studio.min.js | 0 .../edlp_studio/assets/scripts/edlp_studio.js | 0 .../figli/edlp_studio/edlp_studio.info.yml | 0 .../edlp_studio/edlp_studio.libraries.yml | 0 .../edlp_studio/edlp_studio.links.action.yml | 0 .../edlp_studio/edlp_studio.links.menu.yml | 0 .../edlp_studio/edlp_studio.links.task.yml | 0 .../figli/edlp_studio/edlp_studio.module | 0 .../edlp_studio/edlp_studio.permissions.yml | 0 .../figli/edlp_studio/edlp_studio.routing.yml | 0 .../edlp_studio/includes/composition.inc | 0 .../edlp_studio/includes/edlp_chutier_ui.inc | 0 .../includes/edlp_composition_ui.inc | 0 .../includes/edlp_compositions_list.inc | 0 .../edlp_studio/includes/edlp_studio_ui.inc | 0 .../all/modules/figli/edlp_studio/readme.md | 0 .../src/ChutierAccessControlHandler.php | 0 .../src/ChutierHtmlRouteProvider.php | 0 .../edlp_studio/src/ChutierListBuilder.php | 0 .../src/CompositionAccessControlHandler.php | 0 .../src/CompositionHtmlRouteProvider.php | 0 .../src/CompositionListBuilder.php | 0 .../src/Controller/ChutierController.php | 0 .../src/Controller/CompositionController.php | 0 .../src/Controller/StudioUIController.php | 0 .../figli/edlp_studio/src/Entity/Chutier.php | 0 .../src/Entity/ChutierInterface.php | 0 .../src/Entity/ChutierViewsData.php | 0 .../edlp_studio/src/Entity/Composition.php | 0 .../src/Entity/CompositionInterface.php | 0 .../src/Entity/CompositionViewsData.php | 0 .../src/Form/ChutierDeleteForm.php | 0 .../edlp_studio/src/Form/ChutierForm.php | 0 .../src/Form/ChutierSettingsForm.php | 0 .../src/Form/CompositionDeleteForm.php | 0 .../edlp_studio/src/Form/CompositionForm.php | 0 .../src/Form/CompositionSettingsForm.php | 0 .../src/Plugin/Block/StudioLinkBlock.php | 0 .../edlp_studio/templates/chutier.html.twig | 0 .../templates/composition.html.twig | 0 .../templates/edlp-chutier-ui.html.twig | 0 .../templates/edlp-composition-ui.html.twig | 0 .../edlp-compositions-list.html.twig | 0 .../templates/edlp-studio-ui.html.twig | 0 .../sites}/all/modules/figli/gulpfile.js | 0 .../all/modules/figli/package-lock.json | 0 .../sites}/all/modules/figli/package.json | 0 .../all/themes/custom/edlptheme/.gitignore | 0 .../all/themes/custom/edlptheme/README.md | 0 .../dist/bower/imagesloaded.pkgd.min.js | 0 .../assets/dist/bower/jquery.hotkeys.js | 0 .../assets/dist/bower/masonry.pkgd.min.js | 0 .../assets/dist/img/audio-player-next.svg | 0 .../assets/dist/img/audio-player-pause.svg | 0 .../assets/dist/img/audio-player-play.svg | 0 .../assets/dist/img/audio-player-previous.svg | 0 .../edlptheme/assets/dist/img/close.svg | 0 .../edlptheme/assets/dist/img/delete.svg | 0 .../assets/dist/img/edlp-loader-anim.svg | 0 .../edlptheme/assets/dist/img/edlp-loader.svg | 0 .../edlptheme/assets/dist/img/favori-off.svg | 0 .../edlptheme/assets/dist/img/favori-on.svg | 0 .../custom/edlptheme/assets/dist/img/logo.svg | 0 .../assets/dist/img/random-active.svg | 0 .../edlptheme/assets/dist/img/random.svg | 0 .../assets/dist/img/search-active.svg | 0 .../edlptheme/assets/dist/img/search.svg | 0 .../assets/dist/img/studio-active.svg | 0 .../edlptheme/assets/dist/img/studio.svg | 0 .../edlptheme/assets/dist/img/trash.svg | 0 .../custom/edlptheme/assets/dist/img/user.svg | 0 .../edlptheme/assets/dist/scripts/main.min.js | 0 .../assets/dist/scripts/redirect.min.js | 0 .../edlptheme/assets/dist/styles/app.css | 0 .../edlptheme/assets/dist/styles/app.min.css | 0 .../assets/img/audio-player-next.svg | 0 .../assets/img/audio-player-pause.svg | 0 .../assets/img/audio-player-play.svg | 0 .../assets/img/audio-player-previous.svg | 0 .../custom/edlptheme/assets/img/close.svg | 0 .../custom/edlptheme/assets/img/delete.svg | 0 .../edlptheme/assets/img/edlp-loader-anim.svg | 0 .../edlptheme/assets/img/edlp-loader.svg | 0 .../edlptheme/assets/img/favori-off.svg | 0 .../custom/edlptheme/assets/img/favori-on.svg | 0 .../custom/edlptheme/assets/img/logo.svg | 0 .../edlptheme/assets/img/random-active.svg | 0 .../custom/edlptheme/assets/img/random.svg | 0 .../edlptheme/assets/img/search-active.svg | 0 .../custom/edlptheme/assets/img/search.svg | 0 .../edlptheme/assets/img/studio-active.svg | 0 .../custom/edlptheme/assets/img/studio.svg | 0 .../custom/edlptheme/assets/img/trash.svg | 0 .../custom/edlptheme/assets/img/user.svg | 0 .../assets/json/shared_variables.json | 0 .../custom/edlptheme/assets/scripts/main.js | 0 .../edlptheme/assets/scripts/redirect.js | 0 .../assets/scripts/shared_variables_model.js | 0 .../custom/edlptheme/assets/styles/app.scss | 0 .../edlptheme/assets/styles/base/README.md | 0 .../edlptheme/assets/styles/base/_colors.scss | 0 .../edlptheme/assets/styles/base/_fonts.scss | 0 .../edlptheme/assets/styles/base/_grid.scss | 0 .../edlptheme/assets/styles/base/_layout.scss | 0 .../edlptheme/assets/styles/base/_reset.scss | 0 .../all/themes/custom/edlptheme/bower.json | 0 .../edlptheme/edlptheme.breakpoints.yml | 0 .../custom/edlptheme/edlptheme.info.yml | 0 .../custom/edlptheme/edlptheme.libraries.yml | 0 .../themes/custom/edlptheme/edlptheme.theme | 0 .../all/themes/custom/edlptheme/favicon.ico | Bin .../all/themes/custom/edlptheme/gulpfile.js | 0 .../all/themes/custom/edlptheme/package.json | 0 .../block--system-branding-block.html.twig | 0 .../block/block--system-main-block.html.twig | 0 .../block/block--userlogin.html.twig | 0 .../templates/content/edlp-agenda.html.twig | 0 .../edlp-ajax--node--article.html.twig | 0 .../edlp-ajax--node--default.html.twig | 0 ...p-ajax--node--evenement--default.html.twig | 0 .../edlp-ajax--node--transcript.html.twig | 0 .../edlp-ajax--taxonomy-term--index.html.twig | 0 ...edlp-ajax--taxonomy-term--notice.html.twig | 0 .../edlp-corpus-articlesindex.html.twig | 0 .../content/edlp-corpus-collection.html.twig | 0 .../content/edlp-corpus-lastdocs.html.twig | 0 .../templates/content/edlp-home.html.twig | 0 .../content/edlp-productions.html.twig | 0 .../content/edlp-search-results.html.twig | 0 .../content/edlp-search-search-form.html.twig | 0 .../content/edlp-studio-ui.html.twig | 0 .../templates/content/file-link.html.twig | 0 .../content/image-formatter.html.twig | 0 .../node--enregistrement--compo.html.twig | 0 ...node--enregistrement--index-home.html.twig | 0 .../node--enregistrement--lastdocs.html.twig | 0 ...e--enregistrement--player-cartel.html.twig | 0 ...de--enregistrement--search-index.html.twig | 0 .../content/node--evenement--aside.html.twig | 0 .../content/node--evenement--teaser.html.twig | 0 .../node--page--image-1-columns.html.twig | 0 .../node--page--image-2-columns.html.twig | 0 .../node--page--image-2-columns0.html.twig | 0 .../templates/content/node--page.html.twig | 0 .../templates/content/node.html.twig | 0 .../content/old__edlp-agenda.html.twig | 0 ...onomy-term--entrees--home-mobile.html.twig | 0 .../templates/form/form-element.html.twig | 0 .../templates/form/input--textfield.html.twig | 0 .../edlptheme/templates/layout/html.html.twig | 0 .../layout/maintenance-page.html.twig | 0 .../edlptheme/templates/layout/page.html.twig | 0 .../layout/region--content.html.twig | 0 .../templates/layout/region.html.twig | 0 .../links--language-block.html.twig | 0 .../themes/custom/edlptheme/variables.scss | 0 .../sites}/default/config/sync/.htaccess | 0 .../default/config/sync/action.settings.yml | 0 .../default/config/sync/addtoany.settings.yml | 0 .../config/sync/adminimal_theme.settings.yml | 0 .../config/sync/autologout.role.admin.yml | 0 .../sync/autologout.role.authenticated.yml | 0 .../sync/autologout.role.collectionneur.yml | 0 .../config/sync/autologout.role.invite.yml | 0 .../config/sync/autologout.role.root.yml | 0 .../config/sync/autologout.role.user.yml | 0 .../config/sync/autologout.settings.yml | 0 .../default/config/sync/basic.settings.yml | 0 .../config/sync/better_messages.settings.yml | 0 ...lock.block.adminimal_theme_breadcrumbs.yml | 0 .../block.block.adminimal_theme_content.yml | 0 ...ck.block.adminimal_theme_local_actions.yml | 0 .../block.block.adminimal_theme_login.yml | 0 .../block.block.adminimal_theme_messages.yml | 0 ...block.block.adminimal_theme_page_title.yml | 0 ...ck.adminimal_theme_primary_local_tasks.yml | 0 ....adminimal_theme_secondary_local_tasks.yml | 0 .../sync/block.block.basic_branding.yml | 0 .../config/sync/block.block.basic_content.yml | 0 .../config/sync/block.block.basic_footer.yml | 0 .../config/sync/block.block.basic_help.yml | 0 .../sync/block.block.basic_local_actions.yml | 0 .../sync/block.block.basic_local_tasks.yml | 0 .../sync/block.block.basic_main_menu.yml | 0 .../sync/block.block.basic_messages.yml | 0 .../sync/block.block.basic_page_title.yml | 0 .../config/sync/block.block.basic_tools.yml | 0 .../sync/block.block.edlpentreesblock.yml | 0 .../sync/block.block.edlpsearchlinkblock.yml | 0 .../sync/block.block.edlptheme_branding.yml | 0 .../sync/block.block.edlptheme_content.yml | 0 .../config/sync/block.block.footer.yml | 0 .../sync/block.block.languageswitcher.yml | 0 .../sync/block.block.languageswitcher_2.yml | 0 .../sync/block.block.mainnavigation.yml | 0 .../sync/block.block.mainnavigation_2.yml | 0 .../config/sync/block.block.messages.yml | 0 .../config/sync/block.block.productions.yml | 0 .../sync/block.block.selecteurdelangue.yml | 0 .../sync/block.block.selecteurdelangue_2.yml | 0 .../config/sync/block.block.sitebranding.yml | 0 .../config/sync/block.block.stark_admin.yml | 0 .../sync/block.block.stark_branding.yml | 0 .../sync/block.block.stark_local_actions.yml | 0 .../sync/block.block.stark_local_tasks.yml | 0 .../config/sync/block.block.stark_login.yml | 0 .../sync/block.block.stark_messages.yml | 0 .../sync/block.block.stark_page_title.yml | 0 .../config/sync/block.block.stark_tools.yml | 0 .../sync/block.block.studiolinkblock.yml | 0 .../default/config/sync/block.block.tabs.yml | 0 .../config/sync/block.block.userlogin.yml | 0 .../config/sync/block.block.userlogin_2.yml | 0 .../config/sync/config_devel.settings.yml | 0 .../config/sync/config_ignore.settings.yml | 0 .../config/sync/context.context.medium_up.yml | 0 ...link_content.menu_link_content.changed.yml | 0 ..._content.menu_link_content.description.yml | 0 ...u_link_content.menu_link_content.title.yml | 0 ..._field_override.node.autre_son.changed.yml | 0 ..._field_override.node.autre_son.created.yml | 0 ...ield_override.node.autre_son.menu_link.yml | 0 ...ase_field_override.node.autre_son.path.yml | 0 ..._field_override.node.autre_son.promote.yml | 0 ...e_field_override.node.autre_son.status.yml | 0 ...e_field_override.node.autre_son.sticky.yml | 0 ...se_field_override.node.autre_son.title.yml | 0 ...base_field_override.node.autre_son.uid.yml | 0 ...d_override.node.enregistrement.changed.yml | 0 ...d_override.node.enregistrement.created.yml | 0 ...ield_override.node.enregistrement.path.yml | 0 ...d_override.node.enregistrement.promote.yml | 0 ...ld_override.node.enregistrement.status.yml | 0 ...ld_override.node.enregistrement.sticky.yml | 0 ...eld_override.node.enregistrement.title.yml | 0 ...field_override.node.enregistrement.uid.yml | 0 ..._field_override.node.evenement.changed.yml | 0 ..._field_override.node.evenement.created.yml | 0 ...ase_field_override.node.evenement.path.yml | 0 ..._field_override.node.evenement.promote.yml | 0 ...e_field_override.node.evenement.status.yml | 0 ...e_field_override.node.evenement.sticky.yml | 0 ...se_field_override.node.evenement.title.yml | 0 ...base_field_override.node.evenement.uid.yml | 0 ...e.base_field_override.node.fil.changed.yml | 0 ...e.base_field_override.node.fil.created.yml | 0 ...base_field_override.node.fil.menu_link.yml | 0 ...core.base_field_override.node.fil.path.yml | 0 ...e.base_field_override.node.fil.promote.yml | 0 ...re.base_field_override.node.fil.status.yml | 0 ...re.base_field_override.node.fil.sticky.yml | 0 ...ore.base_field_override.node.fil.title.yml | 0 .../core.base_field_override.node.fil.uid.yml | 0 ....base_field_override.node.page.changed.yml | 0 ....base_field_override.node.page.created.yml | 0 ...ore.base_field_override.node.page.path.yml | 0 ....base_field_override.node.page.promote.yml | 0 ...e.base_field_override.node.page.status.yml | 0 ...e.base_field_override.node.page.sticky.yml | 0 ...core.base_field_override.node.page.uid.yml | 0 ...ase_field_override.node.static.changed.yml | 0 ...ase_field_override.node.static.created.yml | 0 ...e.base_field_override.node.static.path.yml | 0 ...ase_field_override.node.static.promote.yml | 0 ...base_field_override.node.static.status.yml | 0 ...base_field_override.node.static.sticky.yml | 0 ...re.base_field_override.node.static.uid.yml | 0 ....taxonomy_term.collectionneurs.changed.yml | 0 ...onomy_term.collectionneurs.description.yml | 0 ...ide.taxonomy_term.collectionneurs.name.yml | 0 ...ide.taxonomy_term.collectionneurs.path.yml | 0 ...override.taxonomy_term.entrees.changed.yml | 0 ...ride.taxonomy_term.entrees.description.yml | 0 ...ld_override.taxonomy_term.entrees.name.yml | 0 ...ld_override.taxonomy_term.entrees.path.yml | 0 ..._override.taxonomy_term.genres.changed.yml | 0 ...rride.taxonomy_term.genres.description.yml | 0 ...eld_override.taxonomy_term.genres.name.yml | 0 ...eld_override.taxonomy_term.genres.path.yml | 0 ...override.taxonomy_term.langues.changed.yml | 0 ...ride.taxonomy_term.langues.description.yml | 0 ...ld_override.taxonomy_term.langues.name.yml | 0 ...ld_override.taxonomy_term.langues.path.yml | 0 ...erride.taxonomy_term.locuteurs.changed.yml | 0 ...de.taxonomy_term.locuteurs.description.yml | 0 ..._override.taxonomy_term.locuteurs.name.yml | 0 ..._override.taxonomy_term.locuteurs.path.yml | 0 ...erride.taxonomy_term.page_type.changed.yml | 0 ...de.taxonomy_term.page_type.description.yml | 0 ..._override.taxonomy_term.page_type.name.yml | 0 ..._override.taxonomy_term.page_type.path.yml | 0 ....base_field_override.user.user.changed.yml | 0 ...ore.base_field_override.user.user.path.yml | 0 .../config/sync/core.date_format.fallback.yml | 0 .../sync/core.date_format.html_date.yml | 0 .../sync/core.date_format.html_datetime.yml | 0 .../sync/core.date_format.html_month.yml | 0 .../sync/core.date_format.html_time.yml | 0 .../sync/core.date_format.html_week.yml | 0 .../sync/core.date_format.html_year.yml | 0 .../core.date_format.html_yearless_date.yml | 0 .../config/sync/core.date_format.long.yml | 0 .../config/sync/core.date_format.medium.yml | 0 .../config/sync/core.date_format.short.yml | 0 ...isplay.composition.composition.default.yml | 0 ...link_content.menu_link_content.default.yml | 0 ...ty_form_display.node.autre_son.default.yml | 0 ...rm_display.node.enregistrement.default.yml | 0 ...ty_form_display.node.evenement.default.yml | 0 ...e.entity_form_display.node.fil.default.yml | 0 ....entity_form_display.node.page.default.yml | 0 ...ntity_form_display.node.static.default.yml | 0 ..._display.taxonomy_term.entrees.default.yml | 0 ...m_display.taxonomy_term.genres.default.yml | 0 ..._display.taxonomy_term.langues.default.yml | 0 ....entity_form_display.user.user.default.yml | 0 .../core.entity_form_mode.user.register.yml | 0 ...isplay.composition.composition.default.yml | 0 ...play.composition.composition.studio_ui.yml | 0 ...ty_view_display.node.autre_son.default.yml | 0 ...ity_view_display.node.autre_son.teaser.yml | 0 ...ew_display.node.enregistrement.article.yml | 0 ...ew_display.node.enregistrement.chutier.yml | 0 ...view_display.node.enregistrement.compo.yml | 0 ...ay.node.enregistrement.compo_document_.yml | 0 ...ew_display.node.enregistrement.default.yml | 0 ...view_display.node.enregistrement.index.yml | 0 ...display.node.enregistrement.index_home.yml | 0 ...w_display.node.enregistrement.lastdocs.yml | 0 ...play.node.enregistrement.player_cartel.yml | 0 ...splay.node.enregistrement.search_index.yml | 0 ...iew_display.node.enregistrement.teaser.yml | 0 ...display.node.enregistrement.transcript.yml | 0 ...tity_view_display.node.evenement.aside.yml | 0 ...ty_view_display.node.evenement.default.yml | 0 ...ity_view_display.node.evenement.teaser.yml | 0 ...ore.entity_view_display.node.fil.admin.yml | 0 ...e.entity_view_display.node.fil.default.yml | 0 ...re.entity_view_display.node.fil.teaser.yml | 0 ....entity_view_display.node.page.default.yml | 0 ...view_display.node.page.image_1_columns.yml | 0 ...view_display.node.page.image_2_columns.yml | 0 ...e.entity_view_display.node.page.teaser.yml | 0 ...y_view_display.node.page.text_1_column.yml | 0 ...ntity_view_display.node.static.default.yml | 0 ...entity_view_display.node.static.teaser.yml | 0 ..._display.taxonomy_term.entrees.default.yml | 0 ...play.taxonomy_term.entrees.home_mobile.yml | 0 ...ew_display.taxonomy_term.entrees.index.yml | 0 ...w_display.taxonomy_term.entrees.notice.yml | 0 ...w_display.taxonomy_term.genres.default.yml | 0 .../core.entity_view_mode.block.token.yml | 0 .../core.entity_view_mode.chutier.token.yml | 0 ...entity_view_mode.composition.studio_ui.yml | 0 ...ore.entity_view_mode.composition.token.yml | 0 .../sync/core.entity_view_mode.file.token.yml | 0 ...tity_view_mode.menu_link_content.token.yml | 0 .../sync/core.entity_view_mode.node.admin.yml | 0 .../core.entity_view_mode.node.article.yml | 0 .../sync/core.entity_view_mode.node.aside.yml | 0 .../core.entity_view_mode.node.chutier.yml | 0 .../sync/core.entity_view_mode.node.compo.yml | 0 ....entity_view_mode.node.compo_document_.yml | 0 .../sync/core.entity_view_mode.node.full.yml | 0 ....entity_view_mode.node.image_1_columns.yml | 0 ....entity_view_mode.node.image_2_columns.yml | 0 .../sync/core.entity_view_mode.node.index.yml | 0 .../core.entity_view_mode.node.index_home.yml | 0 .../core.entity_view_mode.node.lastdocs.yml | 0 ...re.entity_view_mode.node.player_cartel.yml | 0 .../sync/core.entity_view_mode.node.rss.yml | 0 ...ore.entity_view_mode.node.search_index.yml | 0 ...re.entity_view_mode.node.search_result.yml | 0 .../core.entity_view_mode.node.teaser.yml | 0 ...re.entity_view_mode.node.text_1_column.yml | 0 .../sync/core.entity_view_mode.node.token.yml | 0 .../core.entity_view_mode.node.transcript.yml | 0 .../core.entity_view_mode.profile.token.yml | 0 ...entity_view_mode.search_api_task.token.yml | 0 ...re.entity_view_mode.taxonomy_term.full.yml | 0 ...ty_view_mode.taxonomy_term.home_mobile.yml | 0 ...e.entity_view_mode.taxonomy_term.index.yml | 0 ....entity_view_mode.taxonomy_term.notice.yml | 0 ...e.entity_view_mode.taxonomy_term.token.yml | 0 .../core.entity_view_mode.user.compact.yml | 0 .../sync/core.entity_view_mode.user.full.yml | 0 .../sync/core.entity_view_mode.user.token.yml | 0 ...de.workflow_scheduled_transition.token.yml | 0 ...ty_view_mode.workflow_transition.token.yml | 0 .../default/config/sync/core.extension.yml | 0 .../core.menu.static_menu_link_overrides.yml | 0 .../default/config/sync/dblog.settings.yml | 0 .../default/config/sync/devel.settings.yml | 0 .../config/sync/devel.toolbar.settings.yml | 0 ...main.record.encyclopediedelaparole_org.yml | 0 ...in.record.m_encyclopediedelaparole_org.yml | 0 .../default/config/sync/domain.settings.yml | 0 .../config/sync/domain_access.settings.yml | 0 ....alias.beta_encyclopediedelaparole_org.yml | 0 ...lias.beta_m_encyclopediedelaparole_org.yml | 0 ...s.alias.dev_encyclopediedelaparole_org.yml | 0 ...alias.dev_m_encyclopediedelaparole_org.yml | 0 .../sync/domain_alias.alias.edlp_figli_io.yml | 0 .../domain_alias.alias.edlp_m_figli_io.yml | 0 .../config/sync/domain_alias.settings.yml | 0 .../sync/domain_menu_access.settings.yml | 0 ...ain_site_settings.domainconfigsettings.yml | 0 .../config/sync/editor.editor.wysiwyg.yml | 0 .../config/sync/edlptheme.settings.yml | 0 .../sync/email_registration.settings.yml | 0 .../config/sync/features.bundle.default.yml | 0 .../default/config/sync/features.settings.yml | 0 ....menu_link_content.field_domain_access.yml | 0 ...nk_content.field_domain_all_affiliates.yml | 0 .../sync/field.field.node.autre_son.body.yml | 0 ...d.node.autre_son.field_collectionneurs.yml | 0 ...eld.node.autre_son.field_domain_access.yml | 0 ....autre_son.field_domain_all_affiliates.yml | 0 ...ield.field.node.autre_son.field_genres.yml | 0 ...d.field.node.autre_son.field_locuteurs.yml | 0 .../field.field.node.autre_son.field_son.yml | 0 .../field.field.node.enregistrement.body.yml | 0 ...e.enregistrement.field_collectionneurs.yml | 0 ....node.enregistrement.field_description.yml | 0 ...ode.enregistrement.field_domain_access.yml | 0 ...gistrement.field_domain_all_affiliates.yml | 0 ...ield.node.enregistrement.field_entrees.yml | 0 ...field.node.enregistrement.field_genres.yml | 0 ...ield.node.enregistrement.field_langues.yml | 0 ...ld.node.enregistrement.field_locuteurs.yml | 0 ...ode.enregistrement.field_nbr_locuteurs.yml | 0 ...ld.field.node.enregistrement.field_son.yml | 0 ...e.enregistrement.field_transcript_trad.yml | 0 ...ode.enregistrement.field_transcript_vo.yml | 0 ...eld.node.enregistrement.field_workflow.yml | 0 .../sync/field.field.node.evenement.body.yml | 0 .../field.field.node.evenement.field_date.yml | 0 ...eld.node.evenement.field_domain_access.yml | 0 ....evenement.field_domain_all_affiliates.yml | 0 ...d.field.node.evenement.field_page_liee.yml | 0 ....node.evenement.field_workflow_generic.yml | 0 .../config/sync/field.field.node.fil.body.yml | 0 ...eld.field.node.fil.field_domain_access.yml | 0 ...d.node.fil.field_domain_all_affiliates.yml | 0 ...ld.field.node.fil.field_enregistrement.yml | 0 .../sync/field.field.node.page.body.yml | 0 ....page.field_afficher_en_page_d_acceuil.yml | 0 ...d.field.node.page.field_documents_lies.yml | 0 ...ld.field.node.page.field_domain_access.yml | 0 ....node.page.field_domain_all_affiliates.yml | 0 .../field.field.node.page.field_page_type.yml | 0 .../sync/field.field.node.page.field_son.yml | 0 .../field.field.node.page.field_view_mode.yml | 0 .../field.field.node.page.field_visuel.yml | 0 ...field.node.page.field_workflow_generic.yml | 0 .../sync/field.field.node.static.body.yml | 0 ...tatic.field_afficher_en_page_d_acceuil.yml | 0 ....field.node.static.field_domain_access.yml | 0 ...ode.static.field_domain_all_affiliates.yml | 0 ...ield.field.node.static.field_view_mode.yml | 0 .../field.field.node.static.field_visuel.yml | 0 ...eld.node.static.field_workflow_generic.yml | 0 ...ield.taxonomy_term.entrees.field_color.yml | 0 ...eld.taxonomy_term.entrees.field_notice.yml | 0 ...d.taxonomy_term.entrees.field_workflow.yml | 0 ...ld.taxonomy_term.genres.field_synonyms.yml | 0 ...ld.field.user.user.field_domain_access.yml | 0 ...eld.field.user.user.field_domain_admin.yml | 0 ....user.user.field_domain_all_affiliates.yml | 0 .../default/config/sync/field.settings.yml | 0 ....menu_link_content.field_domain_access.yml | 0 ...nk_content.field_domain_all_affiliates.yml | 0 .../config/sync/field.storage.node.body.yml | 0 ....node.field_afficher_en_page_d_acceuil.yml | 0 ...eld.storage.node.field_collectionneurs.yml | 0 .../sync/field.storage.node.field_date.yml | 0 .../field.storage.node.field_description.yml | 0 ...ield.storage.node.field_documents_lies.yml | 0 ...field.storage.node.field_domain_access.yml | 0 ...orage.node.field_domain_all_affiliates.yml | 0 ...ield.storage.node.field_enregistrement.yml | 0 .../sync/field.storage.node.field_entrees.yml | 0 .../sync/field.storage.node.field_genres.yml | 0 .../sync/field.storage.node.field_langues.yml | 0 .../field.storage.node.field_locuteurs.yml | 0 ...field.storage.node.field_nbr_locuteurs.yml | 0 .../field.storage.node.field_page_liee.yml | 0 .../field.storage.node.field_page_type.yml | 0 .../sync/field.storage.node.field_son.yml | 0 ...eld.storage.node.field_transcript_trad.yml | 0 ...field.storage.node.field_transcript_vo.yml | 0 .../field.storage.node.field_view_mode.yml | 0 .../sync/field.storage.node.field_visuel.yml | 0 .../field.storage.node.field_workflow.yml | 0 ...ld.storage.node.field_workflow_generic.yml | 0 ...ield.storage.taxonomy_term.field_color.yml | 0 ...eld.storage.taxonomy_term.field_notice.yml | 0 ...d.storage.taxonomy_term.field_synonyms.yml | 0 ...d.storage.taxonomy_term.field_workflow.yml | 0 ...field.storage.user.field_domain_access.yml | 0 .../field.storage.user.field_domain_admin.yml | 0 ...orage.user.field_domain_all_affiliates.yml | 0 .../default/config/sync/field_ui.settings.yml | 0 .../default/config/sync/file.settings.yml | 0 .../config/sync/filter.format.plain_text.yml | 0 .../config/sync/filter.format.wysiwyg.yml | 0 .../default/config/sync/filter.settings.yml | 0 .../default/config/sync/honeypot.settings.yml | 0 .../default/config/sync/image.settings.yml | 0 .../default/config/sync/image.style.large.yml | 0 .../image.style.linkit_result_thumbnail.yml | 0 .../config/sync/image.style.medium.yml | 0 .../config/sync/image.style.thumbnail.yml | 0 ...guage.content_settings.chutier.chutier.yml | 0 ...ntent_settings.composition.composition.yml | 0 .../language.content_settings.file.file.yml | 0 ...gs.menu_link_content.menu_link_content.yml | 0 ...nguage.content_settings.node.autre_son.yml | 0 ...e.content_settings.node.enregistrement.yml | 0 ...nguage.content_settings.node.evenement.yml | 0 .../language.content_settings.node.fil.yml | 0 .../language.content_settings.node.page.yml | 0 .../language.content_settings.node.static.yml | 0 ...age.content_settings.redirect.redirect.yml | 0 ...settings.taxonomy_term.collectionneurs.yml | 0 ...content_settings.taxonomy_term.entrees.yml | 0 ....content_settings.taxonomy_term.genres.yml | 0 ...content_settings.taxonomy_term.langues.yml | 0 ...ntent_settings.taxonomy_term.locuteurs.yml | 0 ...ntent_settings.taxonomy_term.page_type.yml | 0 .../language.content_settings.user.user.yml | 0 ...ansition.workflow_scheduled_transition.yml | 0 ...s.workflow_transition.corpus_documents.yml | 0 ...settings.workflow_transition.generique.yml | 0 .../config/sync/language.entity.en.yml | 0 .../config/sync/language.entity.fr.yml | 0 .../config/sync/language.entity.und.yml | 0 .../config/sync/language.entity.zxx.yml | 0 .../default/config/sync/language.mappings.yml | 0 .../config/sync/language.negotiation.yml | 0 .../default/config/sync/language.types.yml | 0 .../sync/language/en/addtoany.settings.yml | 0 ...lock.block.adminimal_theme_breadcrumbs.yml | 0 .../block.block.adminimal_theme_content.yml | 0 ...ck.block.adminimal_theme_local_actions.yml | 0 .../en/block.block.adminimal_theme_login.yml | 0 .../block.block.adminimal_theme_messages.yml | 0 ...block.block.adminimal_theme_page_title.yml | 0 ...ck.adminimal_theme_primary_local_tasks.yml | 0 ....adminimal_theme_secondary_local_tasks.yml | 0 .../en/block.block.basic_branding.yml | 0 .../language/en/block.block.basic_content.yml | 0 .../language/en/block.block.basic_footer.yml | 0 .../language/en/block.block.basic_help.yml | 0 .../en/block.block.basic_local_actions.yml | 0 .../en/block.block.basic_local_tasks.yml | 0 .../en/block.block.basic_main_menu.yml | 0 .../en/block.block.basic_messages.yml | 0 .../en/block.block.basic_page_title.yml | 0 .../language/en/block.block.basic_tools.yml | 0 .../language/en/block.block.stark_admin.yml | 0 .../en/block.block.stark_branding.yml | 0 .../en/block.block.stark_local_actions.yml | 0 .../en/block.block.stark_local_tasks.yml | 0 .../language/en/block.block.stark_login.yml | 0 .../en/block.block.stark_messages.yml | 0 .../en/block.block.stark_page_title.yml | 0 .../language/en/block.block.stark_tools.yml | 0 .../language/en/core.date_format.fallback.yml | 0 .../en/core.date_format.html_date.yml | 0 .../en/core.date_format.html_datetime.yml | 0 .../en/core.date_format.html_month.yml | 0 .../en/core.date_format.html_time.yml | 0 .../en/core.date_format.html_week.yml | 0 .../en/core.date_format.html_year.yml | 0 .../core.date_format.html_yearless_date.yml | 0 .../language/en/core.date_format.long.yml | 0 .../language/en/core.date_format.medium.yml | 0 .../language/en/core.date_format.short.yml | 0 .../core.entity_form_mode.user.register.yml | 0 .../en/core.entity_view_mode.node.full.yml | 0 .../en/core.entity_view_mode.node.rss.yml | 0 ...ore.entity_view_mode.node.search_index.yml | 0 ...re.entity_view_mode.node.search_result.yml | 0 .../en/core.entity_view_mode.node.teaser.yml | 0 ...re.entity_view_mode.taxonomy_term.full.yml | 0 .../en/core.entity_view_mode.user.compact.yml | 0 .../en/core.entity_view_mode.user.full.yml | 0 .../sync/language/en/domain.settings.yml | 0 ...eld.field.user.user.field_domain_admin.yml | 0 .../language/en/filter.format.plain_text.yml | 0 .../sync/language/en/image.style.large.yml | 0 .../image.style.linkit_result_thumbnail.yml | 0 .../sync/language/en/image.style.medium.yml | 0 .../language/en/image.style.thumbnail.yml | 0 .../sync/language/en/language.entity.en.yml | 0 .../sync/language/en/language.entity.und.yml | 0 .../sync/language/en/language.entity.zxx.yml | 0 .../en/metatag.metatag_defaults.403.yml | 0 .../en/metatag.metatag_defaults.404.yml | 0 .../en/metatag.metatag_defaults.front.yml | 0 .../en/metatag.metatag_defaults.global.yml | 0 .../en/metatag.metatag_defaults.node.yml | 0 ...metatag.metatag_defaults.taxonomy_term.yml | 0 .../en/metatag.metatag_defaults.user.yml | 0 .../migrate_plus.migration_group.d6_edlp.yml | 0 ...system.action.domain_access_all_action.yml | 0 ...m.action.domain_access_edit_all_action.yml | 0 ....action.domain_access_edit_none_action.yml | 0 ...ystem.action.domain_access_none_action.yml | 0 .../system.action.domain_default_action.yml | 0 .../en/system.action.domain_delete_action.yml | 0 .../system.action.domain_disable_action.yml | 0 .../en/system.action.domain_enable_action.yml | 0 .../en/system.action.node_delete_action.yml | 0 .../system.action.node_make_sticky_action.yml | 0 ...ystem.action.node_make_unsticky_action.yml | 0 .../en/system.action.node_promote_action.yml | 0 .../en/system.action.node_publish_action.yml | 0 .../en/system.action.node_save_action.yml | 0 .../system.action.node_unpromote_action.yml | 0 .../system.action.node_unpublish_action.yml | 0 ...stem.action.pathauto_update_alias_node.yml | 0 ...stem.action.pathauto_update_alias_user.yml | 0 .../system.action.profile_delete_action.yml | 0 .../system.action.profile_publish_action.yml | 0 ...system.action.profile_unpublish_action.yml | 0 .../system.action.redirect_delete_action.yml | 0 .../system.action.user_block_user_action.yml | 0 .../system.action.user_cancel_user_action.yml | 0 ...system.action.user_unblock_user_action.yml | 0 .../sync/language/en/system.maintenance.yml | 0 .../sync/language/en/system.menu.account.yml | 0 .../sync/language/en/system.menu.admin.yml | 0 .../sync/language/en/system.menu.devel.yml | 0 .../sync/language/en/system.menu.footer.yml | 0 .../sync/language/en/system.menu.main.yml | 0 .../sync/language/en/system.menu.tools.yml | 0 .../config/sync/language/en/system.site.yml | 0 .../config/sync/language/en/user.mail.yml | 0 .../sync/language/en/user.role.anonymous.yml | 0 .../language/en/user.role.authenticated.yml | 0 .../config/sync/language/en/user.settings.yml | 0 .../sync/language/en/views.view.archive.yml | 0 .../sync/language/en/views.view.content.yml | 0 .../language/en/views.view.content_recent.yml | 0 .../en/views.view.content_translations.yml | 0 .../sync/language/en/views.view.files.yml | 0 .../sync/language/en/views.view.frontpage.yml | 0 .../sync/language/en/views.view.glossary.yml | 0 .../en/views.view.maillog_overview.yml | 0 .../sync/language/en/views.view.profiles.yml | 0 .../sync/language/en/views.view.redirect.yml | 0 .../language/en/views.view.taxonomy_term.yml | 0 .../en/views.view.user_admin_people.yml | 0 .../sync/language/en/views.view.who_s_new.yml | 0 .../language/en/views.view.who_s_online.yml | 0 .../en/views.view.workflow_entity_history.yml | 0 .../sync/linkit.linkit_profile.collection.yml | 0 .../default/config/sync/locale.settings.yml | 0 .../default/config/sync/maillog.settings.yml | 0 .../default/config/sync/matomo.settings.yml | 0 .../default/config/sync/menu_ui.settings.yml | 0 .../sync/metatag.metatag_defaults.403.yml | 0 .../sync/metatag.metatag_defaults.404.yml | 0 .../sync/metatag.metatag_defaults.front.yml | 0 .../sync/metatag.metatag_defaults.global.yml | 0 .../sync/metatag.metatag_defaults.node.yml | 0 ...metatag.metatag_defaults.taxonomy_term.yml | 0 .../sync/metatag.metatag_defaults.user.yml | 0 .../config/sync/migrate_drupal.settings.yml | 0 ...igrate_plus.migration.d6_edlp_allfiles.yml | 0 .../migrate_plus.migration.d6_edlp_corpus.yml | 0 ...migrate_plus.migration.d6_edlp_entrees.yml | 0 ...rate_plus.migration.d6_edlp_evenements.yml | 0 .../migrate_plus.migration.d6_edlp_genres.yml | 0 ...migrate_plus.migration.d6_edlp_langues.yml | 0 .../migrate_plus.migration.d6_edlp_pages.yml | 0 ...igrate_plus.migration.d6_edlp_pagetype.yml | 0 .../migrate_plus.migration.d6_edlp_sons.yml | 0 .../migrate_plus.migration.d6_edlp_users.yml | 0 .../migrate_plus.migration_group.d6_edlp.yml | 0 .../migrate_plus.migration_group.default.yml | 0 .../migrate_plus.migration_group.edlp.yml | 0 .../default/config/sync/node.settings.yml | 0 .../config/sync/node.type.autre_son.yml | 0 .../config/sync/node.type.enregistrement.yml | 0 .../config/sync/node.type.evenement.yml | 0 .../default/config/sync/node.type.fil.yml | 0 .../default/config/sync/node.type.page.yml | 0 .../default/config/sync/node.type.static.yml | 0 .../config/sync/path_alias_xt.settings.yml | 0 .../sync/pathauto.pattern.documents.yml | 0 .../sync/pathauto.pattern.evenements.yml | 0 .../sync/pathauto.pattern.page_static.yml | 0 .../pathauto.pattern.pages_production.yml | 0 .../pathauto.pattern.taxonomy_entrees.yml | 0 .../default/config/sync/pathauto.settings.yml | 0 .../default/config/sync/redirect.settings.yml | 0 .../sync/search_api.index.collection.yml | 0 .../config/sync/search_api.server.edlp_db.yml | 0 .../config/sync/search_api.settings.yml | 0 .../config/sync/search_api_db.settings.yml | 0 ...tings.default.menu_link_content.footer.yml | 0 ....default.menu_link_content.productions.yml | 0 ...e_settings.default.node.enregistrement.yml | 0 ...bundle_settings.default.node.evenement.yml | 0 ...emap.bundle_settings.default.node.page.yml | 0 ...ap.bundle_settings.default.node.static.yml | 0 ...settings.default.taxonomy_term.entrees.yml | 0 .../simple_sitemap.custom_links.default.yml | 0 .../config/sync/simple_sitemap.settings.yml | 0 ...mple_sitemap.variants.default_hreflang.yml | 0 ...te_taxonomy_term_genres_field_synonyms.yml | 0 ...n.change_a_node_to_next_workflow_state.yml | 0 ..._workflow_double_fond_state_documents_.yml | 0 ...de_to_workflow_state_publie_documents_.yml | 0 ...hange_workflow_state_to_sas_documents_.yml | 0 ..._add_action.encyclopediedelaparole_org.yml | 0 ...dd_action.m_encyclopediedelaparole_org.yml | 0 ...itor_action.encyclopediedelaparole_org.yml | 0 ...or_action.m_encyclopediedelaparole_org.yml | 0 ...system.action.domain_access_all_action.yml | 0 ...m.action.domain_access_edit_all_action.yml | 0 ....action.domain_access_edit_none_action.yml | 0 ...ystem.action.domain_access_none_action.yml | 0 ...move_action.encyclopediedelaparole_org.yml | 0 ...ve_action.m_encyclopediedelaparole_org.yml | 0 ...itor_action.encyclopediedelaparole_org.yml | 0 ...or_action.m_encyclopediedelaparole_org.yml | 0 .../system.action.domain_default_action.yml | 0 .../system.action.domain_delete_action.yml | 0 .../system.action.domain_disable_action.yml | 0 .../system.action.domain_enable_action.yml | 0 .../sync/system.action.node_delete_action.yml | 0 .../system.action.node_make_sticky_action.yml | 0 ...ystem.action.node_make_unsticky_action.yml | 0 .../system.action.node_promote_action.yml | 0 .../system.action.node_publish_action.yml | 0 .../sync/system.action.node_save_action.yml | 0 .../system.action.node_unpromote_action.yml | 0 .../system.action.node_unpublish_action.yml | 0 ...stem.action.pathauto_update_alias_node.yml | 0 ...stem.action.pathauto_update_alias_user.yml | 0 .../system.action.profile_delete_action.yml | 0 .../system.action.profile_publish_action.yml | 0 ...system.action.profile_unpublish_action.yml | 0 .../system.action.redirect_delete_action.yml | 0 ...stem.action.user_add_role_action.admin.yml | 0 ...on.user_add_role_action.collectionneur.yml | 0 ...tem.action.user_add_role_action.invite.yml | 0 ...ystem.action.user_add_role_action.root.yml | 0 ...ystem.action.user_add_role_action.user.yml | 0 .../system.action.user_block_user_action.yml | 0 .../system.action.user_cancel_user_action.yml | 0 ...m.action.user_remove_role_action.admin.yml | 0 ...user_remove_role_action.collectionneur.yml | 0 ....action.user_remove_role_action.invite.yml | 0 ...em.action.user_remove_role_action.root.yml | 0 ...em.action.user_remove_role_action.user.yml | 0 ...system.action.user_unblock_user_action.yml | 0 .../default/config/sync/system.authorize.yml | 0 .../default/config/sync/system.cron.yml | 0 .../default/config/sync/system.date.yml | 0 .../default/config/sync/system.diff.yml | 0 .../default/config/sync/system.file.yml | 0 .../default/config/sync/system.image.gd.yml | 0 .../default/config/sync/system.image.yml | 0 .../default/config/sync/system.logging.yml | 0 .../default/config/sync/system.mail.yml | 0 .../config/sync/system.maintenance.yml | 0 .../config/sync/system.menu.account.yml | 0 .../default/config/sync/system.menu.admin.yml | 0 .../default/config/sync/system.menu.devel.yml | 0 .../config/sync/system.menu.footer.yml | 0 .../default/config/sync/system.menu.main.yml | 0 .../config/sync/system.menu.productions.yml | 0 .../default/config/sync/system.menu.tools.yml | 0 .../config/sync/system.performance.yml | 0 .../sites}/default/config/sync/system.rss.yml | 0 .../default/config/sync/system.site.yml | 0 .../config/sync/system.theme.global.yml | 0 .../default/config/sync/system.theme.yml | 0 .../default/config/sync/taxonomy.settings.yml | 0 .../taxonomy.vocabulary.collectionneurs.yml | 0 .../sync/taxonomy.vocabulary.entrees.yml | 0 .../sync/taxonomy.vocabulary.genres.yml | 0 .../sync/taxonomy.vocabulary.langues.yml | 0 .../sync/taxonomy.vocabulary.locuteurs.yml | 0 .../sync/taxonomy.vocabulary.page_type.yml | 0 .../default/config/sync/text.settings.yml | 0 .../config/sync/toolbar_themes.settings.yml | 0 .../default/config/sync/update.settings.yml | 0 .../sites}/default/config/sync/user.flood.yml | 0 .../sites}/default/config/sync/user.mail.yml | 0 .../default/config/sync/user.role.admin.yml | 0 .../config/sync/user.role.anonymous.yml | 0 .../config/sync/user.role.authenticated.yml | 0 .../config/sync/user.role.collectionneur.yml | 0 .../default/config/sync/user.role.invite.yml | 0 .../default/config/sync/user.role.root.yml | 0 .../default/config/sync/user.role.user.yml | 0 .../default/config/sync/user.settings.yml | 0 .../default/config/sync/views.settings.yml | 0 .../config/sync/views.view.archive.yml | 0 .../config/sync/views.view.content.yml | 0 .../config/sync/views.view.content_recent.yml | 0 .../sync/views.view.content_translations.yml | 0 .../config/sync/views.view.entree_s_.yml | 0 .../default/config/sync/views.view.files.yml | 0 .../config/sync/views.view.frontpage.yml | 0 .../config/sync/views.view.glossary.yml | 0 .../sync/views.view.maillog_overview.yml | 0 .../config/sync/views.view.profiles.yml | 0 .../config/sync/views.view.redirect.yml | 0 .../config/sync/views.view.taxonomy_term.yml | 0 .../sync/views.view.user_admin_people.yml | 0 .../config/sync/views.view.watchdog.yml | 0 .../config/sync/views.view.who_s_new.yml | 0 .../config/sync/views.view.who_s_online.yml | 0 .../views.view.workflow_entity_history.yml | 0 .../default/config/sync/workflow.settings.yml | 0 ...rkflow.state.corpus_documents_creation.yml | 0 ...low.state.corpus_documents_double_fond.yml | 0 ...workflow.state.corpus_documents_masque.yml | 0 ...workflow.state.corpus_documents_publie.yml | 0 .../workflow.state.corpus_documents_sas.yml | 0 .../workflow.state.generique_creation.yml | 0 .../sync/workflow.state.generique_masque.yml | 0 .../sync/workflow.state.generique_publie.yml | 0 ....corpus_documents_creation_double_fond.yml | 0 ...ition.corpus_documents_creation_masque.yml | 0 ...ition.corpus_documents_creation_publie.yml | 0 ...ansition.corpus_documents_creation_sas.yml | 0 ...rpus_documents_double_fond_double_fond.yml | 0 ...on.corpus_documents_double_fond_masque.yml | 0 ...on.corpus_documents_double_fond_publie.yml | 0 ...ition.corpus_documents_double_fond_sas.yml | 0 ...on.corpus_documents_masque_double_fond.yml | 0 ...nsition.corpus_documents_masque_masque.yml | 0 ...nsition.corpus_documents_masque_publie.yml | 0 ...transition.corpus_documents_masque_sas.yml | 0 ...on.corpus_documents_publie_double_fond.yml | 0 ...nsition.corpus_documents_publie_masque.yml | 0 ...nsition.corpus_documents_publie_publie.yml | 0 ...transition.corpus_documents_publie_sas.yml | 0 ...ition.corpus_documents_sas_double_fond.yml | 0 ...transition.corpus_documents_sas_masque.yml | 0 ...transition.corpus_documents_sas_publie.yml | 0 ...ow.transition.corpus_documents_sas_sas.yml | 0 ...w.transition.generique_creation_masque.yml | 0 ...w.transition.generique_creation_publie.yml | 0 ...low.transition.generique_masque_masque.yml | 0 ...low.transition.generique_masque_publie.yml | 0 ...low.transition.generique_publie_masque.yml | 0 ...low.transition.generique_publie_publie.yml | 0 .../workflow.workflow.corpus_documents.yml | 0 .../sync/workflow.workflow.generique.yml | 0 .../config/sync/workflow_access.role.yml | 0 .../config/sync/workflow_access.settings.yml | 0 web/sites/default/default.services.yml | 174 + web/sites/default/default.settings.php | 770 +++++ web/sites/default/services.yml | 162 + {sites => web/sites}/development.services.yml | 0 .../sites}/example.settings.local.php | 0 {sites => web/sites}/example.sites.php | 0 .../themes/.gitkeep | 0 update.php => web/update.php | 0 web.config => web/web.config | 0 5468 files changed, 2488 insertions(+), 395192 deletions(-) create mode 100644 .env.example delete mode 100644 .eslintrc rename sites/all/modules/contrib/dev/devel/css/devel-rtl.css => .gitkeep (100%) create mode 100644 .travis.yml delete mode 100644 0001-patched-DateRangeFormatter-to-localized-single-date.patch rename sites/all/modules/contrib/admin/domain/LICENSE => LICENSE (99%) delete mode 100644 PATCHES.md create mode 100644 README.md delete mode 100644 README.txt delete mode 100644 core/.env.example delete mode 100644 core/.eslintignore delete mode 100644 core/.eslintrc.json delete mode 100644 core/.eslintrc.legacy.json delete mode 100644 core/.eslintrc.passing.json delete mode 100644 core/.gitignore delete mode 100644 core/.prettierignore delete mode 100644 core/.prettierrc.json delete mode 100644 core/.stylelintrc.json create mode 100644 drush/Commands/PolicyCommands.php create mode 100644 drush/README.md create mode 100644 drush/drush.yml create mode 100644 drush/sites/self.site.yml delete mode 100644 example.gitignore create mode 100644 load.environment.php delete mode 100644 modules/README.txt create mode 100644 phpunit.xml.dist delete mode 100644 profiles/README.txt create mode 100644 scripts/composer/ScriptHandler.php delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/CHANGELOG.txt delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/README.txt delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.info.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.install delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.module delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/composer.json delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg delete mode 100644 sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg delete mode 100644 sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg delete mode 100644 sites/all/modules/contrib/admin/better_messages/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.info.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.module delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/better_messages.services.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/composer.json delete mode 100644 sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml delete mode 100644 sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css delete mode 100644 sites/all/modules/contrib/admin/better_messages/css/better_messages.css delete mode 100644 sites/all/modules/contrib/admin/better_messages/images/closelabel.gif delete mode 100644 sites/all/modules/contrib/admin/better_messages/js/better_messages.js delete mode 100644 sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php delete mode 100644 sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php delete mode 100644 sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/README.txt delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml delete mode 100644 sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/config_update/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/config_update/README.txt delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update.info.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update.module delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update.services.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.info.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.module delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php delete mode 100644 sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php delete mode 100644 sites/all/modules/contrib/admin/config_update/drupalci.yml delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigDiffInterface.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigDiffer.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigListInterface.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigLister.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php delete mode 100644 sites/all/modules/contrib/admin/config_update/src/ConfigReverter.php delete mode 100644 sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php delete mode 100644 sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php delete mode 100644 sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php delete mode 100644 sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php delete mode 100644 sites/all/modules/contrib/admin/context/.editorconfig delete mode 100644 sites/all/modules/contrib/admin/context/.gitignore delete mode 100644 sites/all/modules/contrib/admin/context/.travis.yml delete mode 100644 sites/all/modules/contrib/admin/context/CHANGELOG.md delete mode 100644 sites/all/modules/contrib/admin/context/CONTRIBUTING.md delete mode 100644 sites/all/modules/contrib/admin/context/LICENSE delete mode 100644 sites/all/modules/contrib/admin/context/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/context/README.md delete mode 100644 sites/all/modules/contrib/admin/context/composer.json delete mode 100644 sites/all/modules/contrib/admin/context/context.info.yml delete mode 100644 sites/all/modules/contrib/admin/context/context.install delete mode 100644 sites/all/modules/contrib/admin/context/context.module delete mode 100644 sites/all/modules/contrib/admin/context/context.routing.yml delete mode 100644 sites/all/modules/contrib/admin/context/context.services.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php delete mode 100644 sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextInterface.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextManager.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextReactionManager.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php delete mode 100644 sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Entity/Context.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php delete mode 100644 sites/all/modules/contrib/admin/context/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Blocks.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Plugin/DisplayVariant/ContextBlockPageVariant.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Blocks/BlockCollection.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php delete mode 100644 sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php delete mode 100644 sites/all/modules/contrib/admin/domain/.travis.yml delete mode 100644 sites/all/modules/contrib/admin/domain/CHANGELOG.md delete mode 100644 sites/all/modules/contrib/admin/domain/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/domain/README.md delete mode 100644 sites/all/modules/contrib/admin/domain/composer.json delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.api.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.drush.inc delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.install delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/domain.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/drush.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/js/domain.js delete mode 100644 sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommands.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainElementManager.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainRedirectResponse.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Entity/Domain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainNavBlock.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainSelection.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/200.png delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/modules/domain_config_schema_test/config/install/domain.record.drupal.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/modules/domain_config_schema_test/domain_config_schema_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/modules/domain_test/config/optional/views.view.domain_views_access.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/modules/domain_test/domain_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/modules/domain_test/domain_test.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCheckResponseTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCreateTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainEntityReferenceTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.install delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml delete mode 100755 sites/all/modules/contrib/admin/domain/domain_access/domain_access.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessPermissions.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/argument/DomainAccessArgument.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/README.md delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorage.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidator.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/Entity/DomainAlias.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasActionsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasValidatorTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/README.md delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/domain_config.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/domain_config.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigLibraryDiscoveryCollector.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/domain_content.install delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/domain_content.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/README.md delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.install delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php delete mode 100644 sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php delete mode 100644 sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/README.md delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/composer.json delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php delete mode 100644 sites/all/modules/contrib/admin/features/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/features/composer.json delete mode 100644 sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml delete mode 100644 sites/all/modules/contrib/admin/features/config/install/features.settings.yml delete mode 100644 sites/all/modules/contrib/admin/features/config/schema/features.schema.yml delete mode 100644 sites/all/modules/contrib/admin/features/drush.services.yml delete mode 100644 sites/all/modules/contrib/admin/features/drush/features.drush8.inc delete mode 100644 sites/all/modules/contrib/admin/features/features.info.yml delete mode 100644 sites/all/modules/contrib/admin/features/features.install delete mode 100644 sites/all/modules/contrib/admin/features/features.module delete mode 100644 sites/all/modules/contrib/admin/features/features.routing.yml delete mode 100644 sites/all/modules/contrib/admin/features/features.services.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/css/features_ui.admin.css delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.admin.inc delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.info.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.module delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.routing.yml delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/js/features_ui.admin.js delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Controller/FeaturesUIController.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentAlterForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentBaseForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentConfigureForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentCoreForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentExcludeForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentFormBase.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentOptionalForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentProfileForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentSiteForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesDiffForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesEditForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesExportForm.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesBundleUITest.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesCreateUITest.php delete mode 100644 sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesUITest.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Commands/FeaturesCommands.php delete mode 100644 sites/all/modules/contrib/admin/features/src/ConfigurationItem.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Controller/FeaturesController.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Entity/FeaturesBundle.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Exception/DomainException.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Exception/InvalidArgumentException.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssigner.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignerInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodBase.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodManager.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesBundleInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesConfigDependencyManager.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesConfigInstaller.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesExtensionStorages.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectory.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectoryInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodBase.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodManager.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGenerator.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesGeneratorInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesInstallStorage.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesManager.php delete mode 100644 sites/all/modules/contrib/admin/features/src/FeaturesManagerInterface.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Package.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentAlter.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentBaseType.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentCoreType.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentDependency.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExclude.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentForwardDependency.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentNamespace.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentOptionalType.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentPackages.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentProfile.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentSiteType.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php delete mode 100644 sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/core.date_format.short.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/system.cron.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.features.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.info.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/config/install/core.date_format.long.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.features.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.info.yml delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/Entity/FeaturesBundleIntegrationTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignerTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesGenerateTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesManagerKernelTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/ConfigurationItemTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesBundleTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesManagerTest.php delete mode 100644 sites/all/modules/contrib/admin/features/tests/src/Unit/PackageTest.php delete mode 100644 sites/all/modules/contrib/admin/filter_perms/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/filter_perms/filter_perms.info.yml delete mode 100644 sites/all/modules/contrib/admin/filter_perms/filter_perms.services.yml delete mode 100644 sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsForm.php delete mode 100644 sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php delete mode 100644 sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/login_destination/README.txt delete mode 100644 sites/all/modules/contrib/admin/login_destination/composer.json delete mode 100644 sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.info.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.module delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/login_destination.services.yml delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManager.php delete mode 100644 sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php delete mode 100644 sites/all/modules/contrib/admin/matomo/.eslintrc delete mode 100644 sites/all/modules/contrib/admin/matomo/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/matomo/README.txt delete mode 100644 sites/all/modules/contrib/admin/matomo/composer.json delete mode 100644 sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/js/matomo.admin.js delete mode 100644 sites/all/modules/contrib/admin/matomo/js/matomo.js delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.info.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.install delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.module delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.routing.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/matomo.tokens.inc delete mode 100644 sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoCustomVars.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityPages.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php delete mode 100644 sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml delete mode 100644 sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php delete mode 100644 sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.module delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuPermissions.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php delete mode 100644 sites/all/modules/contrib/admin/metatag/.codeclimate.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/.csslintrc delete mode 100644 sites/all/modules/contrib/admin/metatag/.eslintignore delete mode 100644 sites/all/modules/contrib/admin/metatag/.eslintrc delete mode 100644 sites/all/modules/contrib/admin/metatag/CHANGELOG.txt delete mode 100644 sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt delete mode 100644 sites/all/modules/contrib/admin/metatag/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/metatag/README.txt delete mode 100644 sites/all/modules/contrib/admin/metatag/composer.json delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/console.services.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.api.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.install delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.routing.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag.services.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidClass.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidPackage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppStoreId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppStoreId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppStoreId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/config/schema/metatag_dc.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/metatag_dc.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Coverage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Creator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Date.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Description.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Format.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Identifier.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Language.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Publisher.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Relation.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Rights.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Source.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Subject.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Title.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Type.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc/src/Tests/MetatagDublinCoreTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/config/schema/metatag_dc_advanced.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Group/DublinCoreAdvanced.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AbstractTag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccessRights.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualMethod.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPeriodicity.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPolicy.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Alternative.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Audience.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Available.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/BibliographicCitation.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/ConformsTo.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Created.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateAccepted.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateCopyrighted.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateSubmitted.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/EducationLevel.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Extent.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasFormat.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasPart.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasVersion.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/InstructionalMethod.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsFormatOf.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsPartOf.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReferencedBy.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReplacedBy.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsRequiredBy.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsVersionOf.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Issued.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/License.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Mediator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Medium.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Modified.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Provenance.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/References.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Replaces.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Requires.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/RightsHolder.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Spatial.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/TableOfContents.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Temporal.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Valid.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Tests/MetatagDublinCoreAdvancedTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/config/schema/metatag_facebook.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/metatag_facebook.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Group/Facebook.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAdmins.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAppId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbPages.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Tests/MetatagFacebookTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/config/schema/metatag_favicons.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Group/Favicons.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon114x114.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon120x120.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon144x144.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon152x152.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon180x180.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon72x72.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon76x76.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed114x114.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed120x120.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed144x144.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed152x152.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed180x180.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed72x72.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed76x76.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon16x16.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon192x192.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon32x32.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon96x96.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/LinkSizesBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/MaskIcon.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/ShortcutIcon.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Tests/MetatagFaviconsTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/config/schema/metatag_google_cse.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Group/GoogleCse.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Audience.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Department.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/DocStatus.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/GoogleRating.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Thumbnail.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Tests/MetatagGoogleCSETagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/config/schema/metatag_google_plus.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/metatag_google_plus.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Group/GooglePlus.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Author.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Description.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Image.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Name.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Publisher.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Tests/MetatagGooglePlusTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/config/schema/metatag_hreflang.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangXDefault.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Tests/MetatagHreflangTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AppleMobile.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/Mobile.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/WindowsMobile.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidAppLinkAlternative.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidManifest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppCapable.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppStatusBarStyle.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppTitle.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ApplicationName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Cleartype.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/FormatDetection.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/HandheldFriendly.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/IosAppLinkAlternative.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MobileOptimized.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainApiCalls.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainMetaTags.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationBadge.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNotification.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare150x150logo.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare310x310logo.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare70x70logo.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationStartUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTask.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTaskSeparator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTilecolor.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTileimage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTooltip.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWide310x150logo.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWindow.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ThemeColor.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Viewport.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/WebManifest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Tests/MetatagMobileTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleExpirationTime.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleSection.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleTag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookAuthor.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookISBN.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookReleaseDate.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookTag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgCountryName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDescription.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDeterminer.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgEmail.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgFaxNumber.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageAlt.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageHeight.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageSecureUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageType.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLatitude.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocale.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocaleAlternative.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocality.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLongitude.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPhoneNumber.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPostalCode.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgRegion.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSeeAlso.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSiteName.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgTitle.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoHeight.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoSecureUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoType.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoWidth.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Tests/MetatagOpenGraphTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/config/schema/metatag_open_graph_products.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceAmount.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceCurrency.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Tests/MetatagOpenGraphProductsTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestMedia.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNohover.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Tests/MetatagPinterestTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/config/schema/metatag_twitter_cards.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Group/TwitterCards.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIpad.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIphone.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameGooglePlay.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIpad.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIphone.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppStoreCountry.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlGooglePlay.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIpad.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIphone.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreatorId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData1.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData2.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDescription.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDoNotTrack.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage1.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage2.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage3.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageAlt.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageHeight.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageWidth.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel1.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel2.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPageUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayer.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerHeight.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStream.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStreamContentType.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSite.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSiteId.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsTitle.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/config/schema/metatag_verification.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/metatag_verification.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Group/SiteVerification.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Baidu.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/config/schema/metatag_views.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.install delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig delete mode 100644 sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagTag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Command/GenerateGroupCommand.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagManager.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagServiceProvider.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/MetatagToken.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/MetatagInterface.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldFormatter/MetatagEmptyFormatter.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldType/MetatagFieldItem.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Advanced.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Basic.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/GroupBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ContentLanguage.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Description.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPlacename.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPosition.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Google.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Keywords.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaItempropBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaNameBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/NewsKeywords.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Referrer.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Robots.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Standout.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldUserTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTestBase.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php delete mode 100644 sites/all/modules/contrib/admin/metatag/templates/generator.php.twig delete mode 100644 sites/all/modules/contrib/admin/metatag/templates/group.php.twig delete mode 100644 sites/all/modules/contrib/admin/metatag/templates/metatag_tag.schema.yml.twig delete mode 100644 sites/all/modules/contrib/admin/metatag/templates/tag.php.twig delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.module delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.routing.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/src/Controller/MetatagTestCustomRouteController.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/src/Plugin/metatag/Tag/MetatagTestTag.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/DefaultTags.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWorks.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php delete mode 100644 sites/all/modules/contrib/admin/metatag/tests/src/Kernel/MetatagManagerTest.php delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/pathauto/README.md delete mode 100644 sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.api.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.info.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.install delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.js delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.module delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.services.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelper.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasTypeBatchUpdateInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasTypeInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasTypeManager.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Annotation/AliasType.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Entity/PathautoPattern.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoFieldItemList.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoItem.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoPatternListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoState.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php delete mode 100644 sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php delete mode 100644 sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/permissions_filter/README.txt delete mode 100644 sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js delete mode 100644 sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml delete mode 100644 sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml delete mode 100755 sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module delete mode 100644 sites/all/modules/contrib/admin/piwik/.eslintrc delete mode 100644 sites/all/modules/contrib/admin/piwik/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/piwik/README.txt delete mode 100644 sites/all/modules/contrib/admin/piwik/composer.json delete mode 100644 sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/js/piwik.admin.js delete mode 100644 sites/all/modules/contrib/admin/piwik/js/piwik.js delete mode 100644 sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.info.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.install delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.module delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.routing.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/piwik.tokens.inc delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikSkipRowIfNotSet.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php delete mode 100644 sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml delete mode 100644 sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php delete mode 100644 sites/all/modules/contrib/admin/redirect/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/redirect/README.txt delete mode 100644 sites/all/modules/contrib/admin/redirect/composer.json delete mode 100644 sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/css/redirect.admin.css delete mode 100644 sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Render/Redirect404LogSuppressor.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.api.php delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.drush.inc delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.generate.inc delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.info.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.install delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.module delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.routing.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/redirect.services.yml delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/d7/PathRedirect.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/d7/RedirectSourceQuery.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/PathRedirect.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php delete mode 100644 sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/README.md delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/composer.json delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapType.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/UrlGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Commands/SimplesitemapCommands.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapFormBase.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SimplesitemapPluginBase.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/DefaultSitemapGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorManager.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapType/DefaultHreflangSitemapType.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapType/SitemapTypeBase.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapType/SitemapTypeInterface.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapType/SitemapTypeManager.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorManager.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php delete mode 100644 sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/README.txt delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/.gitignore delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/README.md delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/js/base.js delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/package.json delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/_variables.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/screenshot.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.scss delete mode 100755 sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.md delete mode 100755 sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.ttf delete mode 100755 sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.woff delete mode 100755 sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.woff2 delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/icon_load.js delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-admin-toolbar-tools-help.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-edit.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-entity-user-collection.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-escape-admin.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help-main.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-home.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-link-toolbar-menu.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-menu.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-shortcut.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-config.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-content.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-reports.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-structure.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-modules-list.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-themes-page.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-toolbar-menu.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-user.svg delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/grunticon.loader.js delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/icons.data.png.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/icons.data.png.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/icons.data.svg.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/icons.data.svg.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/icons.fallback.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/icons.fallback.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-handle.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-admin-toolbar-tools-help.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-edit.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-entity-user-collection.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-escape-admin.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-help-main.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-help.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-home.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-link-toolbar-menu.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-menu.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-shortcut.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-config.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-content.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-reports.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-structure.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-modules-list.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-themes-page.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-horizontal.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-orientation.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-vertical.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toolbar-menu.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-tour.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-user.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/preview.html delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-menu.html.twig delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-toolbar.html.twig delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/_variables.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/mini/screenshot.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/_variables.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/screenshot.png delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css.map delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.scss delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.info.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.install delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.libraries.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.module delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.routing.yml delete mode 100644 sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.toolbar_themes.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/CHANGELOG.txt delete mode 100644 sites/all/modules/contrib/admin/workflow/LICENSE.txt delete mode 100644 sites/all/modules/contrib/admin/workflow/config/install/workflow.settings.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/optional/block.block.workflowtransitionform.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/optional/system.action.change_a_node_to_next_workflow_state.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/optional/views.view.workflow_entity_history.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/schema/workflow.schema.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/schema/workflow.state.schema.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/schema/workflow.transition.schema.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/config/schema/workflow.views.schema.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/install/workflow_access.settings.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/schema/workflow_access.schema.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessRoleForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.install delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.module delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.routing.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/src/Form/WorkflowCleanupSettingsForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.module delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.routing.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_devel/README.txt delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_devel/workflow_devel.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_devel/workflow_devel.module delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_field/workflowfield.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/Form/WorkflowTransitionRevertForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowPermissions.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.module delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.routing.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowStateListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowUiController.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionFormBase.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionLabelForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionRoleForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.install delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.action.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.menu.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.module delete mode 100644 sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.routing.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Access/WorkflowHistoryAccess.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Controller/WorkflowTransitionListController.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Element/WorkflowTransitionElement.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/Workflow.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransition.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransitionInterface.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowInterface.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManager.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManagerInterface.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowScheduledTransition.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowState.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowStorage.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransition.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransitionInterface.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTransitionForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTypeForm.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeGivenStateAction.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeNextStateAction.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowStateActionBase.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Block/WorkflowTransitionBlock.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Derivative/WorkflowLocalTask.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldFormatter/WorkflowDefaultFormatter.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldType/WorkflowItem.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldWidget/WorkflowDefaultWidget.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Validation/Constraint/WorkflowFieldConstraint.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/Validation/Constraint/WorkflowFieldConstraintValidator.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/views/argument/WorkflowState.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Plugin/views/filter/WorkflowState.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowPermissions.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowScheduledTransitionViewsData.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowTransitionListBuilder.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowTransitionViewsData.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowTypeAttributeTrait.php delete mode 100644 sites/all/modules/contrib/admin/workflow/src/WorkflowURLRouteParametersTrait.php delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.api.php delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.field.inc delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.form.inc delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.info.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.install delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.links.task.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.module delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.permissions.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.routing.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.services.yml delete mode 100644 sites/all/modules/contrib/admin/workflow/workflow.views.inc delete mode 100644 sites/all/modules/contrib/dev/config_devel/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/config_devel/composer.json delete mode 100644 sites/all/modules/contrib/dev/config_devel/config/install/config_devel.settings.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/config/schema/config_devel.schema.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/config_devel.info.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/config_devel.links.menu.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/config_devel.routing.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/config_devel.services.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/drush.services.yml delete mode 100644 sites/all/modules/contrib/dev/config_devel/drush/config_devel.drush.inc delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/Commands/ConfigDevelCommands.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/Event/ConfigDevelEvents.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/Event/ConfigDevelSaveEvent.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoExportSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoImportSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelSubscriberBase.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/src/Form/ConfigDevelSettingsForm.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberEntityTest.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberRawTest.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberTestBase.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelAutoExportSubscriberTest.php delete mode 100644 sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelTestBase.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/.gitignore delete mode 100644 sites/all/modules/contrib/dev/config_filter/.travis.yml delete mode 100644 sites/all/modules/contrib/dev/config_filter/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/config_filter/README.md delete mode 100644 sites/all/modules/contrib/dev/config_filter/composer.json delete mode 100644 sites/all/modules/contrib/dev/config_filter/config_filter.info.yml delete mode 100644 sites/all/modules/contrib/dev/config_filter/config_filter.services.yml delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Annotation/ConfigFilter.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Config/FilteredStorage.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Config/FilteredStorageInterface.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Config/GhostStorage.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Config/ReadOnlyStorage.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Config/StorageFilterInterface.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Config/TransparentStorageFilterTrait.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/ConfigFilterManagerInterface.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/ConfigFilterStorageFactory.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Exception/InvalidStorageFilterException.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Exception/UnsupportedMethod.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Plugin/ConfigFilterBase.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Plugin/ConfigFilterInterface.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Plugin/ConfigFilterPluginManager.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Tests/FilteredStorageTest.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Tests/GhostStorageTest.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Tests/ReadonlyStorageTest.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/src/Tests/TransparentFilter.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/composer.json delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/README.md delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/config_filter_split_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/src/Config/ActiveMigrateStorage.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/src/Plugin/ConfigFilter/TestSplitFilter.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/config_filter_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/src/Plugin/ConfigFilter/PirateFilter.php delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/phpunit.xml.dist delete mode 100644 sites/all/modules/contrib/dev/config_filter/tests/src/Kernel/ConfigFilterStorageFactoryTest.php delete mode 100644 sites/all/modules/contrib/dev/config_ignore/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/config_ignore/README.txt delete mode 100644 sites/all/modules/contrib/dev/config_ignore/composer.json delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config/install/config_ignore.settings.yml delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config/schema/config_ignore.schema.yml delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config_ignore.api.php delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config_ignore.info.yml delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config_ignore.install delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config_ignore.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config_ignore.module delete mode 100644 sites/all/modules/contrib/dev/config_ignore/config_ignore.routing.yml delete mode 100644 sites/all/modules/contrib/dev/config_ignore/src/Form/Settings.php delete mode 100644 sites/all/modules/contrib/dev/config_ignore/src/Plugin/ConfigFilter/IgnoreFilter.php delete mode 100644 sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.module delete mode 100644 sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreBrowserTestBase.php delete mode 100644 sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreHookTest.php delete mode 100644 sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/ctools/composer.json delete mode 100644 sites/all/modules/contrib/dev/ctools/config/schema/ctools.schema.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/ctools.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/ctools.module delete mode 100644 sites/all/modules/contrib/dev/ctools/ctools.services.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/config/schema/ctools_block.schema.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.module delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Block/EntityField.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.base_field_override.node.ctools_block_field_test.promote.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_form_display.node.ctools_block_field_test.default.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.default.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.teaser.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.body.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.field_image.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.storage.node.field_image.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/node.type.ctools_block_field_test.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/ctools_block_field_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/src/Functional/EntityFieldBlockTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.module delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/src/MaskContentEntityStorage.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/src/MaskEntityTrait.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/block_content.type.basic.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_form_display.block_content.basic.default.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_view_display.block_content.basic.default.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.body.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_image.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_link.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_image.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_link.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.routing.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/src/Entity/BlockContent.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/src/Functional/DisplayTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/src/Kernel/EntityMaskTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.module delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Plugin/Display/Block.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/ctools_views_test_views.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_entity_test.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_test_view.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/plugins/access/node.inc delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Access/AccessInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Access/TempstoreAccess.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Ajax/OpenModalWizardCommand.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Annotation/Relationship.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/ConstraintConditionInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Context/AutomaticContext.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Context/EntityLazyLoadContext.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/ContextMapper.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/ContextMapperInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/ContextNotFoundException.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Controller/WizardEntityFormController.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Controller/WizardFormController.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvent.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvents.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Event/WizardEvent.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/AjaxFormTrait.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ConditionConfigure.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ConditionDelete.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ContextConfigure.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ContextDelete.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ManageConditions.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ManageContext.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ManageResolverRelationships.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/RelationshipConfigure.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/RequiredContext.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/RequiredContextDelete.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipConfigure.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipDelete.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/ParamConverter/TempstoreConverter.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Block/EntityView.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/BlockPluginCollection.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/BlockVariantInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/BlockVariantTrait.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/EntityBundle.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/NodeType.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityBundle.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityDeriverBase.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityViewDeriver.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataEntityRelationshipDeriver.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataLanguageRelationshipDeriver.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataPropertyDeriverBase.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataRelationshipDeriver.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/DisplayVariant/BlockDisplayVariant.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/PluginWizardInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataEntityRelationship.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataLanguageRelationship.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataRelationship.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipBase.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipManager.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipManagerInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/VariantCollectionInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/VariantCollectionTrait.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Plugin/VariantPluginCollection.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Routing/Enhancer/WizardEnhancer.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/SerializableTempstore.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/SerializableTempstoreFactory.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Testing/EntityCreationTrait.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Tests/Wizard/CToolsWizardTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/TypedDataResolver.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardBase.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Wizard/FormWizardBase.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Wizard/FormWizardInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactory.php delete mode 100644 sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactoryInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/templates/ctools-wizard-trail-links.html.twig delete mode 100644 sites/all/modules/contrib/dev/ctools/templates/ctools-wizard-trail.html.twig delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/ctools_block_display_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/src/Plugin/DisplayVariant/BlockDisplayVariant.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/config/schema/ctools_wizard_test_config_entity.schema.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/ctools_wizard_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/ctools_wizard_test.links.action.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/ctools_wizard_test.links.menu.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/ctools_wizard_test.routing.yml delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Entity/ExampleConfigEntity.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityInterface.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityListBuilder.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityDeleteForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExistingForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExternalForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityGeneralForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityOneForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityTwoForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/OneForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/TwoForm.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/EntityAddWizardTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/EntityEditWizardTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/WizardTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/BlockDisplayVariantTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipManagerTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipsTestBase.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/SerializableTempstoreTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataEntityRelationshipPluginTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataLanguageRelationshipPluginTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataRelationshipPluginTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataResolverTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockDisplayVariantTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockPluginCollectionTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockVariantTraitTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Unit/ContextMapperTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/tests/src/Unit/VariantCollectionTraitTest.php delete mode 100644 sites/all/modules/contrib/dev/ctools/views_content/views_content.admin.inc delete mode 100644 sites/all/modules/contrib/dev/devel/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/devel/README.txt delete mode 100644 sites/all/modules/contrib/dev/devel/composer.json delete mode 100644 sites/all/modules/contrib/dev/devel/config/install/devel.settings.yml delete mode 100644 sites/all/modules/contrib/dev/devel/config/install/devel.toolbar.settings.yml delete mode 100644 sites/all/modules/contrib/dev/devel/config/install/system.menu.devel.yml delete mode 100644 sites/all/modules/contrib/dev/devel/config/schema/devel.schema.yml delete mode 100644 sites/all/modules/contrib/dev/devel/css/devel.css delete mode 100644 sites/all/modules/contrib/dev/devel/css/devel.toolbar.css delete mode 100644 sites/all/modules/contrib/dev/devel/devel.api.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel.install delete mode 100644 sites/all/modules/contrib/dev/devel/devel.libraries.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel.links.menu.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel.module delete mode 100644 sites/all/modules/contrib/dev/devel/devel.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel.routing.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/README.txt delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/composer.json delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.batch.inc delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.module delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.routing.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/drush.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/drush/devel_generate.drush8.inc delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Annotation/DevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Commands/DevelGenerateCommands.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBase.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBaseInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateException.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGeneratePermissions.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGeneratePluginManager.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Form/DevelGenerateForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/MenuDevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Routing/DevelGenerateRoutes.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/src/Tests/DevelGenerateTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/devel_generate_example.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php delete mode 100644 sites/all/modules/contrib/dev/devel/devel_generate/tests/src/DevelGenerateManagerTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/drush.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/drush/devel.drush8.inc delete mode 100644 sites/all/modules/contrib/dev/devel/icons/bebebe/cog.svg delete mode 100644 sites/all/modules/contrib/dev/devel/icons/ffffff/cog.svg delete mode 100644 sites/all/modules/contrib/dev/devel/kint/README.txt delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint.module delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/.gitignore delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/Kint.class.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/LICENCE delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/README.md delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/composer.json delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/config.default.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/decorators/plain.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/decorators/rich.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/examples/overview.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/inc/kintObject.class.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/inc/kintParser.class.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/inc/kintVariableData.class.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/classmethods.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/classstatics.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/color.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/fspath.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/json.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/microtime.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/objectiterateable.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/splobjectstorage.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/timestamp.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/xml.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/closure.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/smarty.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/splfileinfo.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/base.js delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/base.less delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/aante-light.css delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/kint.js delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/original.css delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized-dark.css delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized.css delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/themes/aante-light.less delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/themes/original.less delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized-dark.less delete mode 100644 sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized.less delete mode 100644 sites/all/modules/contrib/dev/devel/kint/src/Plugin/Devel/Dumper/Kint.php delete mode 100644 sites/all/modules/contrib/dev/devel/kint/src/Twig/KintExtension.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Annotation/DevelDumper.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Commands/DevelCommands.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/ContainerInfoController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/DevelController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/ElementInfoController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/EntityDebugController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/EntityTypeInfoController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/EventInfoController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/LayoutInfoController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/RouteInfoController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Controller/SwitchUserController.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/DevelDumperBase.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/DevelDumperInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/DevelDumperManager.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/DevelDumperManagerInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/DevelDumperPluginManager.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/DevelDumperPluginManagerInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/EntityTypeInfo.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/EventSubscriber/ErrorHandlerSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/EventSubscriber/ThemeInfoRebuildSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/ConfigEditor.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/ConfigsList.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/DevelReinstall.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/RouterRebuildConfirmForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/SettingsForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/SwitchUserForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/SystemStateEdit.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Form/ToolbarSettingsForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Block/SwitchUserBlock.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Derivative/DevelLocalTask.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/ChromePhp.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DoctrineDebug.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DrupalVariable.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/FirePhp.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/VarDumper.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Mail/DevelMailLog.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Menu/DestinationMenuLink.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Menu/MenuItemMenuLink.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Plugin/Menu/RouteDetailMenuLink.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Render/FilteredMarkup.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/ToolbarHandler.php delete mode 100644 sites/all/modules/contrib/dev/devel/src/Twig/Extension/Debug.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.libraries.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.routing.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Controller/DumperTestController.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/AvailableTestDumper.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/NotAvailableTestDumper.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.module delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Entity/DevelEntityTestCanonical.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Entity/DevelEntityTestEdit.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Entity/DevelEntityTestNoLinks.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Plugin/Derivative/DevelEntityTestLocalTasks.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.module delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.routing.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_test/src/Controller/DevelTestController.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/modules/devel_test/src/Routing/TestRouteSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelContainerInfoTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelControllerTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelDumperTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelElementInfoTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEntityTypeInfoTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelErrorHandlerTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEventInfoTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelLayoutInfoTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelMenuLinksTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelModulesReinstallTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRequirementsTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouteInfoTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouterRebuildTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelStateEditorTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelSwitchUserTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelToolbarTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelWebAssertHelper.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelDumperTestTrait.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelEnforcedDependenciesTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelMailLogTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelQueryDebugTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelTwigExtensionTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Unish/DevelDrushTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/tests/src/Unish/README.md delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/README.md delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/composer.json delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/config/install/webprofiler.config.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/config/schema/webprofiler.schema.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console.services.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.benchmark.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.export.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.list.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.benchmark.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.export.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.list.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/css/app/dashboard.css delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/css/timeline.css delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/images/caret-down.svg delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/collections/collectors.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/helpers.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/main.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/models/collector.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/routers/collectors.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collector.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collectorsList.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/details.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/layout.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/database.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/js/timeline.js delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Access/AccessManagerWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/CssCollectionRendererWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/JsCollectionRendererWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheBackendWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheFactoryWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkCommand.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkData.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ExportCommand.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ListCommand.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/DecoratorPass.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ProfilerPass.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ServicePass.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/StoragePass.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Config/ConfigFactoryWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DashboardController.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DatabaseController.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/ToolbarController.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/AssetsDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/BlocksDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/CacheDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ConfigDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DatabaseDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DevelDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollectorTrait.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/EventsDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ExtensionDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/FormsDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/HttpDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/MailDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PerformanceTimingDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PhpConfigDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RequestDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RoutingDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ServicesDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/StateDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ThemeDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TimeDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TranslationsDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/UserDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ViewsDataCollector.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Decorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DependencyInjection/TraceableContainer.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/DrupalDataCollectorInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ConfigEntityStorageDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/RoleStorageDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ShortcutSetStorageDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/VocabularyStorageDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityManagerWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityViewBuilderDecorator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/EventDispatcher/EventDispatcherTraceableInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/EventDispatcher/TraceableEventDispatcher.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/ProfilerSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/WebprofilerEventSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ConfigForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Form/FormBuilderWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ProfilesFilterForm.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Frontend/PerformanceTimingData.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortener.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortenerInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/IdeLinkGenerator.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/IdeLinkGeneratorInterface.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Http/HttpClientMiddleware.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Mail/MailManagerWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/DatabaseProfilerStorage.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/FileProfilerStorage.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/Profiler.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageFactory.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageManager.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/TemplateManager.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/ProxyClass/Command/ListCommand.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Routing/TokenConverter.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/State/StateWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Stopwatch.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/StringTranslation/TranslationManagerWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Theme/ThemeNegotiatorWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Dumper/HtmlDumper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Extension/ProfilerExtension.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Views/TraceableViewExecutable.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/Views/ViewExecutableFactoryWrapper.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/src/WebprofilerServiceProvider.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/assets.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/blocks.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/cache.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/config.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/database.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/devel.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/drupal.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/events.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/extensions.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/forms.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/http.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/mail.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/performance_timing.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/php_config.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/request.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/routing.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/services.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/state.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/theme.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/time.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/translations.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/user.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/views.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_dashboard.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_loader.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_panel.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.css.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.html.twig delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Kernel/DecoratorTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/AssetsDataCollectorTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/CacheDataCollectorTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/DataCollectorBaseTest.php delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.info.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.install delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.libraries.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.menu.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.make.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.module delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.routing.yml delete mode 100644 sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.services.yml delete mode 100644 sites/all/modules/contrib/dev/entity/.travis.yml delete mode 100644 sites/all/modules/contrib/dev/entity/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/entity/README.txt delete mode 100644 sites/all/modules/contrib/dev/entity/composer.json delete mode 100644 sites/all/modules/contrib/dev/entity/config/schema/entity.schema.yml delete mode 100644 sites/all/modules/contrib/dev/entity/entity.info.yml delete mode 100644 sites/all/modules/contrib/dev/entity/entity.links.action.yml delete mode 100644 sites/all/modules/contrib/dev/entity/entity.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/entity/entity.module delete mode 100644 sites/all/modules/contrib/dev/entity/entity.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/entity/entity.services.yml delete mode 100644 sites/all/modules/contrib/dev/entity/entity.views.inc delete mode 100644 sites/all/modules/contrib/dev/entity/src/Access/EntityRevisionRouteAccessChecker.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundleEntityAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundleFieldDefinition.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginHandler.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginHandlerInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginInstaller.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginInstallerInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginUninstallValidator.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Controller/RevisionControllerTrait.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Controller/RevisionOverviewController.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Entity/RevisionableEntityBundleInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityAccessControlHandlerBase.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityPermissionProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderBase.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityPermissions.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/EntityViewBuilder.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Form/DeleteMultipleForm.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Form/RevisionRevertForm.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Form/RevisionableContentEntityForm.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Menu/EntityAddLocalAction.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Menu/EntityCollectionLocalActionProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Menu/EntityLocalActionProviderInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Plugin/Action/DeleteAction.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Plugin/Action/Derivative/DeleteActionDeriver.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/EntityActionsDeriver.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/RevisionsOverviewDeriver.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/Condition.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/ConditionGroup.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/EntityQueryAlter.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessEvent.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandler.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerBase.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/UncacheableQueryAccessHandler.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/QueryAccess/ViewsQueryAlter.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Revision/RevisionableContentEntityBase.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Routing/AdminHtmlRouteProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Routing/DefaultHtmlRouteProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Routing/DeleteMultipleRouteProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/Routing/RevisionRouteProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/UncacheableEntityAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/dev/entity/src/UncacheableEntityPermissionProvider.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/entity_module_bundle_plugin_examples_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/src/Plugin/BundlePluginTest/Second.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.services.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Annotation/BundlePluginTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/BundlePluginTestManager.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Entity/EntityTestBundlePlugin.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Plugin/BundlePluginTest/BundlePluginTestInterface.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Plugin/BundlePluginTest/First.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.first.assigned.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.second.assigned.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.storage.entity_test_enhanced.assigned.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_revisions.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner_revisions.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.module delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.services.yml delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/Entity/EnhancedEntity.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/Entity/EnhancedEntityWithOwner.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/EventSubscriber/QueryAccessSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Functional/CollectionRouteAccessTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Functional/DeleteMultipleFormTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Functional/Menu/EntityLocalActionTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Functional/RevisionRouteAccessTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/BundlePluginTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/DeleteActionTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/ConditionGroupTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessEventTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessHandlerTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessHandlerTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionBasicUITest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionOverviewIntegrationTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Unit/BundleEntityAccessControlHandlerTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityAccessControlHandlerTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityPermissionProviderTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Unit/QueryAccess/ConditionTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php delete mode 100644 sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityPermissionProviderTest.php delete mode 100644 sites/all/modules/contrib/dev/entity_delete/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/entity_delete/README.txt delete mode 100644 sites/all/modules/contrib/dev/entity_delete/config/install/entity_delete.entitydeleteconfirmation.yml delete mode 100644 sites/all/modules/contrib/dev/entity_delete/entity_delete.info.yml delete mode 100755 sites/all/modules/contrib/dev/entity_delete/entity_delete.links.menu.yml delete mode 100755 sites/all/modules/contrib/dev/entity_delete/entity_delete.routing.yml delete mode 100755 sites/all/modules/contrib/dev/entity_delete/src/DeleteEntity.php delete mode 100644 sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteConfirmationForm.php delete mode 100755 sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteForm.php delete mode 100644 sites/all/modules/contrib/dev/mobile_js_redirect/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/mobile_js_redirect/README.txt delete mode 100644 sites/all/modules/contrib/dev/mobile_js_redirect/js/mobile_js_redirect.js delete mode 100644 sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.info.yml delete mode 100644 sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.libraries.yml delete mode 100755 sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.links.menu.yml delete mode 100755 sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.module delete mode 100755 sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.routing.yml delete mode 100755 sites/all/modules/contrib/dev/mobile_js_redirect/src/Form/MobileJsRedirectAdminForm.php delete mode 100644 sites/all/modules/contrib/dev/mobile_js_redirect/src/Tests/MobileJsRedirectTests.php delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/README.txt delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/composer.json delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/drush.services.yml delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/includes/module_missing_message_fixer.drush.inc delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.info.yml delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.links.menu.yml delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.module delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.permissions.yml delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.routing.yml delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.services.yml delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/src/Commands/MmmfFixCommand.php delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/src/Commands/MmmfListCommand.php delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/src/Form/ModuleMissingMessageFixerForm.php delete mode 100644 sites/all/modules/contrib/dev/module_missing_message_fixer/src/ModuleMissingMessageFixer.php delete mode 100644 sites/all/modules/contrib/dev/redis/.gitignore delete mode 100644 sites/all/modules/contrib/dev/redis/.travis-before-script.sh delete mode 100644 sites/all/modules/contrib/dev/redis/.travis.yml delete mode 100644 sites/all/modules/contrib/dev/redis/LICENSE.txt delete mode 100644 sites/all/modules/contrib/dev/redis/README.PhpRedis.txt delete mode 100644 sites/all/modules/contrib/dev/redis/README.Predis.txt delete mode 100644 sites/all/modules/contrib/dev/redis/README.md delete mode 100644 sites/all/modules/contrib/dev/redis/composer.json delete mode 100644 sites/all/modules/contrib/dev/redis/example.services.yml delete mode 100644 sites/all/modules/contrib/dev/redis/redis.info.yml delete mode 100644 sites/all/modules/contrib/dev/redis/redis.install delete mode 100644 sites/all/modules/contrib/dev/redis/redis.module delete mode 100644 sites/all/modules/contrib/dev/redis/redis.services.yml delete mode 100644 sites/all/modules/contrib/dev/redis/src/Cache/CacheBackendFactory.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Cache/CacheBase.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Cache/PhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Cache/Predis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Cache/RedisCacheTagsChecksum.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Client/PhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Client/Predis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/ClientFactory.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/ClientInterface.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Flood/FloodFactory.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Flood/PhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Flood/Predis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Lock/LockFactory.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Lock/PhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Lock/Predis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/PersistentLock/PhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/PersistentLock/Predis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/PhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/Predis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/QueueBase.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/QueueRedisFactory.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/ReliablePhpRedis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/ReliablePredis.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/ReliableQueueBase.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/Queue/ReliableQueueRedisFactory.php delete mode 100644 sites/all/modules/contrib/dev/redis/src/RedisPrefixTrait.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Functional/Lock/RedisLockFunctionalTest.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Functional/WebTest.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisCacheTest.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisFloodTest.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisLockTest.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisQueueTest.php delete mode 100644 sites/all/modules/contrib/dev/redis/tests/src/Traits/RedisTestInterfaceTrait.php delete mode 100644 sites/all/modules/contrib/dev/token/.travis.yml delete mode 100644 sites/all/modules/contrib/dev/token/LICENSE.txt delete mode 100755 sites/all/modules/contrib/dev/token/README.md delete mode 100644 sites/all/modules/contrib/dev/token/css/jquery.treetable.css delete mode 100644 sites/all/modules/contrib/dev/token/css/token.css delete mode 100644 sites/all/modules/contrib/dev/token/css/token.treetable.theme.css delete mode 100644 sites/all/modules/contrib/dev/token/js/jquery.treetable.js delete mode 100644 sites/all/modules/contrib/dev/token/js/token.js delete mode 100644 sites/all/modules/contrib/dev/token/src/Controller/TokenAutocompleteController.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Controller/TokenCacheController.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Controller/TokenDevelController.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Controller/TokenTreeController.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Element/TokenTreeTable.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Plugin/Derivative/DevelLocalTask.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenBlockTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenCurrentPageTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenFieldUiTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenMenuTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenTestBase.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenTestTrait.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenURLTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/TokenUserTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/Tree/AutocompleteTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/Tree/HelpPageTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/Tree/TokenTreeTestTrait.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Tests/Tree/TreeTest.php delete mode 100644 sites/all/modules/contrib/dev/token/src/Token.php delete mode 100644 sites/all/modules/contrib/dev/token/src/TokenEntityMapper.php delete mode 100644 sites/all/modules/contrib/dev/token/src/TokenEntityMapperInterface.php delete mode 100644 sites/all/modules/contrib/dev/token/src/TokenInterface.php delete mode 100644 sites/all/modules/contrib/dev/token/src/TokenServiceProvider.php delete mode 100644 sites/all/modules/contrib/dev/token/src/TreeBuilder.php delete mode 100644 sites/all/modules/contrib/dev/token/src/TreeBuilderInterface.php delete mode 100644 sites/all/modules/contrib/dev/token/templates/token-tree-link.html.twig delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/config/install/core.date_format.token_module_test.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/src/Controller/TokenTreeBrowseController.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/test_views/views.view.token_views_test.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.info.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.module delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.routing.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.tokens.inc delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/core.entity_form_display.user.user.default.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.field.user.user.user_picture.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.storage.user.user_picture.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/token_user_picture.info.yml delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Functional/UrlTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/ArrayTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/BookTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/CommentTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/DateTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/EntityTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/FieldTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/FileTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/KernelTestBase.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/NodeTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/RandomTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/TaxonomyTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/UnitTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/UrlTest.php delete mode 100644 sites/all/modules/contrib/dev/token/tests/src/Kernel/ViewsTest.php delete mode 100644 sites/all/modules/contrib/dev/token/token.drush.inc delete mode 100644 sites/all/modules/contrib/dev/token/token.info.yml delete mode 100644 sites/all/modules/contrib/dev/token/token.install delete mode 100644 sites/all/modules/contrib/dev/token/token.libraries.yml delete mode 100644 sites/all/modules/contrib/dev/token/token.links.task.yml delete mode 100644 sites/all/modules/contrib/dev/token/token.module delete mode 100644 sites/all/modules/contrib/dev/token/token.pages.inc delete mode 100644 sites/all/modules/contrib/dev/token/token.routing.yml delete mode 100644 sites/all/modules/contrib/dev/token/token.services.yml delete mode 100644 sites/all/modules/contrib/dev/token/token.tokens.inc delete mode 100644 sites/all/modules/contrib/fields/addtoany/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/addtoany/README.txt delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.api.php delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.config_translation.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.info.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.install delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.libraries.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.links.menu.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.links.task.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.module delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.permissions.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.routing.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/addtoany.views.inc delete mode 100644 sites/all/modules/contrib/fields/addtoany/config/install/addtoany.settings.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/config/schema/addtoany.schema.yml delete mode 100644 sites/all/modules/contrib/fields/addtoany/css/addtoany.admin.css delete mode 100644 sites/all/modules/contrib/fields/addtoany/css/addtoany.css delete mode 100644 sites/all/modules/contrib/fields/addtoany/images/a2a_32_32.png delete mode 100644 sites/all/modules/contrib/fields/addtoany/images/a2a_32_32.svg delete mode 100644 sites/all/modules/contrib/fields/addtoany/js/addtoany.admin.js delete mode 100644 sites/all/modules/contrib/fields/addtoany/js/addtoany.js delete mode 100644 sites/all/modules/contrib/fields/addtoany/src/Form/AddToAnySettingsForm.php delete mode 100644 sites/all/modules/contrib/fields/addtoany/src/Plugin/Block/AddToAnyBlock.php delete mode 100644 sites/all/modules/contrib/fields/addtoany/src/Plugin/views/field/NodeAddToAnyShare.php delete mode 100644 sites/all/modules/contrib/fields/addtoany/templates/addtoany-standard.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/.eslintrc.json delete mode 100644 sites/all/modules/contrib/fields/audiofield/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/audiofield/README.md delete mode 100644 sites/all/modules/contrib/fields/audiofield/audiofield.info.yml delete mode 100644 sites/all/modules/contrib/fields/audiofield/audiofield.install delete mode 100644 sites/all/modules/contrib/fields/audiofield/audiofield.libraries.yml delete mode 100644 sites/all/modules/contrib/fields/audiofield/audiofield.module delete mode 100644 sites/all/modules/contrib/fields/audiofield/audiofield.services.yml delete mode 100644 sites/all/modules/contrib/fields/audiofield/composer.json delete mode 100644 sites/all/modules/contrib/fields/audiofield/css/audiofield.audiojs.css delete mode 100644 sites/all/modules/contrib/fields/audiofield/css/audiofield.css delete mode 100644 sites/all/modules/contrib/fields/audiofield/css/audiofield.mediaelement.css delete mode 100644 sites/all/modules/contrib/fields/audiofield/css/audiofield.projekktor.css delete mode 100644 sites/all/modules/contrib/fields/audiofield/css/audiofield.wavesurfer.css delete mode 100644 sites/all/modules/contrib/fields/audiofield/drush.services.yml delete mode 100644 sites/all/modules/contrib/fields/audiofield/drush/audiofield.drush.inc delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/audiojs.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/audiojs.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/jplayer.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/jplayer.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/jplayer.circleplayer.fix.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/jplayer.circleplayer.fix.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/mediaelement.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/mediaelement.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/projekktor.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/projekktor.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/soundmanager.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/soundmanager.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/wavesurfer.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/wavesurfer.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/wordpress.builder.es6.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/js/wordpress.builder.js delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Annotation/AudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/AudioFieldPlayerManager.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/AudioFieldPluginBase.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Commands/AudiofieldCommands.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/AudioJsAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/DefaultMp3Player.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/JPlayerAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/MediaElementAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/ProjekktorAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/SoundManagerAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/WavesurferAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/AudioPlayer/WordPressAudioPlayer.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/src/Plugin/Field/FieldFormatter/AudioFieldFieldFormatter.php delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audiofield-download-links.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--audiojs.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--jplayer--default-multiple.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--jplayer--default-single.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--jplayer--jplayer-circle.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--jplayer.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--mediaelement.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--projekktor.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--soundmanager--barui.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--soundmanager--inlineplayer.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--soundmanager--player360.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--soundmanager.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--wavesurfer--playlist.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--wavesurfer.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer--wordpress.html.twig delete mode 100644 sites/all/modules/contrib/fields/audiofield/templates/audioplayer.html.twig delete mode 100644 sites/all/modules/contrib/fields/color_field/.gitignore delete mode 100644 sites/all/modules/contrib/fields/color_field/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/color_field/README.md delete mode 100644 sites/all/modules/contrib/fields/color_field/color_field.info.yml delete mode 100644 sites/all/modules/contrib/fields/color_field/color_field.install delete mode 100755 sites/all/modules/contrib/fields/color_field/color_field.libraries.yml delete mode 100644 sites/all/modules/contrib/fields/color_field/color_field.module delete mode 100644 sites/all/modules/contrib/fields/color_field/color_field.post_update.php delete mode 100644 sites/all/modules/contrib/fields/color_field/composer.json delete mode 100755 sites/all/modules/contrib/fields/color_field/config/schema/color_field.schema.yml delete mode 100644 sites/all/modules/contrib/fields/color_field/css/color_field_formatter_swatch.css delete mode 100644 sites/all/modules/contrib/fields/color_field/css/color_field_widget_box.css delete mode 100644 sites/all/modules/contrib/fields/color_field/css/color_field_widget_grid.css delete mode 100644 sites/all/modules/contrib/fields/color_field/drupalci.yml delete mode 100644 sites/all/modules/contrib/fields/color_field/images/transparent_box16.gif delete mode 100644 sites/all/modules/contrib/fields/color_field/images/transparent_box32.gif delete mode 100644 sites/all/modules/contrib/fields/color_field/js/color_field_widget_box.jquery.js delete mode 100644 sites/all/modules/contrib/fields/color_field/js/color_field_widget_box.js delete mode 100644 sites/all/modules/contrib/fields/color_field/js/color_field_widget_grid.jquery.js delete mode 100644 sites/all/modules/contrib/fields/color_field/js/color_field_widget_spectrum.jquery.js delete mode 100644 sites/all/modules/contrib/fields/color_field/src/ColorBase.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/ColorCMY.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/ColorCMYK.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/ColorHex.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/ColorInterface.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/ColorRGB.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldType/ColorFieldType.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetBase.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetBox.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetDefault.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetGrid.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetHTML5.php delete mode 100644 sites/all/modules/contrib/fields/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetSpectrum.php delete mode 100644 sites/all/modules/contrib/fields/color_field/templates/color-field-formatter-swatch.html.twig delete mode 100644 sites/all/modules/contrib/fields/color_field/tests/src/Functional/ColorFieldFormatterTest.php delete mode 100644 sites/all/modules/contrib/fields/color_field/tests/src/Functional/ColorFieldFormatterTokenTest.php delete mode 100644 sites/all/modules/contrib/fields/color_field/tests/src/Functional/ColorFieldFunctionalTestBase.php delete mode 100644 sites/all/modules/contrib/fields/color_field/tests/src/Functional/ColorFieldWidgetTest.php delete mode 100644 sites/all/modules/contrib/fields/color_field/tests/src/FunctionalJavascript/ColorFieldWidgetJavascriptTests.php delete mode 100644 sites/all/modules/contrib/fields/color_field/tests/src/Kernel/ColorFieldTypeTest.php delete mode 100644 sites/all/modules/contrib/fields/date_range_formatter/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/date_range_formatter/date_range_formatter.info.yml delete mode 100644 sites/all/modules/contrib/fields/date_range_formatter/date_range_formatter.module delete mode 100644 sites/all/modules/contrib/fields/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php delete mode 100644 sites/all/modules/contrib/fields/field_group/CHANGELOG.txt delete mode 100644 sites/all/modules/contrib/fields/field_group/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/field_group/README.txt delete mode 100644 sites/all/modules/contrib/fields/field_group/composer.json delete mode 100644 sites/all/modules/contrib/fields/field_group/config/schema/field_group.entity_display.schema.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/config/schema/field_group.field_group_formatter_plugin.schema.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/field_group_migrate.info.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/migration_templates/d6_field_group_entity_form_display.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/migration_templates/d6_field_group_entity_view_display.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/migration_templates/d7_field_group.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/src/Plugin/migrate/destination/FieldGroupEntityFormDisplay.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/src/Plugin/migrate/destination/FieldGroupEntityViewDisplay.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/src/Plugin/migrate/destination/d7/FieldGroup.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/src/Plugin/migrate/source/d6/FieldGroup.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/src/Plugin/migrate/source/d7/FieldGroup.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/tests/fixtures/drupal7.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php delete mode 100644 sites/all/modules/contrib/fields/field_group/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php delete mode 100644 sites/all/modules/contrib/fields/field_group/css/field_group.field_ui.css delete mode 100644 sites/all/modules/contrib/fields/field_group/field_group.info.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/field_group.libraries.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/field_group.links.action.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/field_group.module delete mode 100644 sites/all/modules/contrib/fields/field_group/field_group.services.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/accordion/accordion.js delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/details/details.js delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/fieldset/fieldset.js delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/html_element/html-element.js delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/tabs/horizontal-tabs.css delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/tabs/horizontal-tabs.js delete mode 100644 sites/all/modules/contrib/fields/field_group/formatters/tabs/tabs.js delete mode 100644 sites/all/modules/contrib/fields/field_group/includes/field_ui.inc delete mode 100644 sites/all/modules/contrib/fields/field_group/includes/helpers.inc delete mode 100644 sites/all/modules/contrib/fields/field_group/js/field_group.field_ui.js delete mode 100644 sites/all/modules/contrib/fields/field_group/js/field_group.js delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Annotation/FieldGroupFormatter.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Element/Accordion.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Element/AccordionItem.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Element/HorizontalTabs.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Element/HtmlElement.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/FieldGroupFormatterBase.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/FieldGroupFormatterInterface.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/FieldGroupFormatterPluginManager.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/FieldgroupUi.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Form/FieldGroupAddForm.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Form/FieldGroupDeleteForm.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/Derivative/FieldGroupLocalAction.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/Accordion.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/Details.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/Tab.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Plugin/field_group/FieldGroupFormatter/Tabs.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Routing/FieldGroupConverter.php delete mode 100644 sites/all/modules/contrib/fields/field_group/src/Routing/RouteSubscriber.php delete mode 100644 sites/all/modules/contrib/fields/field_group/templates/field-group-accordion-item.html.twig delete mode 100644 sites/all/modules/contrib/fields/field_group/templates/field-group-accordion.html.twig delete mode 100644 sites/all/modules/contrib/fields/field_group/templates/field-group-html-element.html.twig delete mode 100644 sites/all/modules/contrib/fields/field_group/templates/horizontal-tabs.html.twig delete mode 100644 sites/all/modules/contrib/fields/field_group/templates/theme.inc delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/modules/field_group_test/field_group_test.info.yml delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/modules/field_group_test/field_group_test.module delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/src/Functional/EntityDisplayTest.php delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/src/Functional/FieldGroupTestTrait.php delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/src/Functional/FieldGroupWithoutFieldUiTest.php delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/src/Functional/ManageDisplayTest.php delete mode 100644 sites/all/modules/contrib/fields/field_group/tests/src/FunctionalJavascript/FieldGroupUiTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/README.txt delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.data_types.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.setting.source_attach.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.setting.source_imce.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.setting.source_reference.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.setting.sources.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.source.attach.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.source.clipboard.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.source.imce.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.source.reference.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.source.remote.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/config/schema/filefield_sources.source.upload.schema.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/css/filefield_sources.css delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.api.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.info.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.install delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.libraries.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.module delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.routing.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/filefield_sources.services.yml delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/js/filefield_sources.js delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Access/FieldAccessCheck.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Annotation/FilefieldSource.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Controller/ImceController.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/File/MimeType/ExtensionMimeTypeGuesser.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/FilefieldSourceInterface.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/FilefieldSourceManager.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/FilefieldSourcesServiceProvider.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/ImceScanner.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Plugin/FilefieldSource/Attach.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Plugin/FilefieldSource/Clipboard.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Plugin/FilefieldSource/Imce.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Plugin/FilefieldSource/Reference.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Plugin/FilefieldSource/Remote.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/ProxyClass/File/MimeType/ExtensionMimeTypeGuesser.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Routing/FilefieldSourcesRoutes.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/AttachSourceTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/ClipboardSourceTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/EmptyValuesTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/FileFieldSourcesTestBase.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/ImceSourceTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/MultipleValuesTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/ReferenceSourceTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/RemoteSourceTest.php delete mode 100644 sites/all/modules/contrib/fields/filefield_sources/src/Tests/UploadSourceTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/LICENSE.txt delete mode 100644 sites/all/modules/contrib/fields/linkit/README.md delete mode 100644 sites/all/modules/contrib/fields/linkit/composer.json delete mode 100644 sites/all/modules/contrib/fields/linkit/config/optional/image.style.linkit_result_thumbnail.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/config/optional/linkit.linkit_profile.default.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/config/schema/linkit.schema.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/css/linkit.admin.theme.css delete mode 100644 sites/all/modules/contrib/fields/linkit/css/linkit.autocomplete.css delete mode 100644 sites/all/modules/contrib/fields/linkit/images/throbber-active.gif delete mode 100644 sites/all/modules/contrib/fields/linkit/images/throbber-inactive.png delete mode 100644 sites/all/modules/contrib/fields/linkit/js/autocomplete.js delete mode 100644 sites/all/modules/contrib/fields/linkit/js/linkit.filter_html.admin.js delete mode 100644 sites/all/modules/contrib/fields/linkit/js/linkit.js delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.info.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.install delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.libraries.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.links.action.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.links.menu.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.links.task.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.module delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.permissions.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.routing.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/linkit.services.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Annotation/Matcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Annotation/Substitution.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/ConfigurableMatcherBase.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/ConfigurableMatcherInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Controller/AutocompleteController.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Controller/LinkitController.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Element/Linkit.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Entity/Profile.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Matcher/AddForm.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Matcher/DeleteForm.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Matcher/EditForm.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Matcher/OverviewForm.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Profile/AddForm.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Profile/EditForm.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Form/Profile/FormBase.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/MatcherBase.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/MatcherCollection.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/MatcherInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/MatcherManager.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/MatcherTokensTrait.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/CKEditorPlugin/LinkitDrupalLink.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Derivative/EntityMatcherDeriver.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Filter/LinkitFilter.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/ContactFormMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/EmailMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/EntityMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/FileMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/FrontPageMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/NodeMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/TermMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Matcher/UserMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Substitution/Canonical.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Substitution/File.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Plugin/Linkit/Substitution/Media.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/ProfileInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/ProfileListBuilder.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/SubstitutionInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/SubstitutionManager.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/SubstitutionManagerInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Suggestion/DescriptionSuggestion.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Suggestion/EntitySuggestion.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Suggestion/SimpleSuggestion.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Suggestion/SuggestionCollection.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Suggestion/SuggestionDescriptionInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Suggestion/SuggestionInterface.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/SuggestionManager.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Tests/ProfileCreationTrait.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Tests/Update/LinkitUpdateTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/src/Utility/LinkitXss.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/editor.editor.format_1.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/editor.editor.format_2.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/editor.editor.format_3.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/filter.format.format_1.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/filter.format.format_2.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/filter.format.format_3.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/linkit-additions.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/linkit.linkit_profile.test_profile.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/fixtures/update/linkit.linkit_profile.test_profile_with_imce.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/linkit_test/config/schema/linkit_test.schema.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/linkit_test/linkit_test.info.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/linkit_test/linkit_test.module delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/linkit_test/linkit_test.routing.yml delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/linkit_test/src/Plugin/Linkit/Matcher/ConfigurableDummyMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/linkit_test/src/Plugin/Linkit/Matcher/DummyMatcher.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Functional/Controllers/LinkitControllerTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Functional/LinkitBrowserTestBase.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Functional/MatcherAdminTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Functional/ProfileAdminTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/FunctionalJavascript/LinkitDialogTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/FunctionalJavascript/LinkitFormatAdminTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/AssertLinkitFilterTrait.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/Entity/ProfileTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/EntityMatcherDeriverTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/LinkitAutocompleteTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/LinkitEditorLinkDialogTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/LinkitFilterEntityTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/LinkitKernelTestBase.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/Matchers/ContactFormMatcherTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/Matchers/FileMatcherTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/Matchers/NodeMatcherTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/Matchers/TermMatcherTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/Matchers/UserMatcherTest.php delete mode 100644 sites/all/modules/contrib/fields/linkit/tests/src/Kernel/SubstitutionPluginTest.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/.gitignore delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/LICENSE.txt delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/README.txt delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/css/url_to_video_embed.css delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/css/url_to_video_embed.scss delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/images/ajax-loader.gif delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/images/no-js.png delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/images/play-button.png delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/js/vimeo_embed.js delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/js/youtube_embed.js delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/src/Plugin/Filter/FilterUrlToVideo.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/src/Service/UrlToVideoFilterService.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/src/Service/UrlToVideoFilterServiceInterface.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/tests/src/FunctionalJavascript/UrlToVideoFilterFunctionalJavascriptTest.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/tests/src/FunctionalJavascript/UrlToVideoFilterFunctionalJavascriptTestBase.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/tests/src/Unit/Service/UrlToVideoFilterServiceTest.php delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/url_to_video_filter.info.yml delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/url_to_video_filter.libraries.yml delete mode 100644 sites/all/modules/contrib/filters/url_to_video_filter/url_to_video_filter.services.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/LICENSE.txt delete mode 100644 sites/all/modules/contrib/mail/maillog/README.txt delete mode 100644 sites/all/modules/contrib/mail/maillog/config/install/maillog.settings.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/config/install/views.view.maillog_overview.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/config/schema/maillog.schema.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.info.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.install delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.links.menu.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.module delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.permissions.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.routing.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/maillog.views.inc delete mode 100644 sites/all/modules/contrib/mail/maillog/src/Controller/MaillogController.php delete mode 100644 sites/all/modules/contrib/mail/maillog/src/Form/MaillogClearConfirmForm.php delete mode 100644 sites/all/modules/contrib/mail/maillog/src/Form/MaillogSettingsForm.php delete mode 100755 sites/all/modules/contrib/mail/maillog/src/Plugin/Mail/Maillog.php delete mode 100644 sites/all/modules/contrib/mail/maillog/src/Plugin/views/field/MaillogFieldDelete.php delete mode 100644 sites/all/modules/contrib/mail/maillog/src/Tests/Mail/MailUiTest.php delete mode 100644 sites/all/modules/contrib/mail/maillog/tests/modules/maillog_test/maillog_test.info.yml delete mode 100644 sites/all/modules/contrib/mail/maillog/tests/modules/maillog_test/maillog_test.module delete mode 100644 sites/all/modules/contrib/mail/maillog/tests/src/Kernel/MailTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/LICENSE.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/README.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/composer.json delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.data_types.schema.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.destination.schema.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.process.schema.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.schema.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.source.schema.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/drupalci.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/README.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_term.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_user.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration_group.beer.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/comment.type.node_comments.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.comment.node_comments.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.node.migrate_example_beer.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.comment.node_comments.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.teaser.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.comment.node_comments.comment_body.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.body.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_comments.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_beer_style.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_country.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_image.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_favbeers.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_gender.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_comments.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_beer_style.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_country.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_image.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_favbeers.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_gender.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/node.type.migrate_example_beer.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/taxonomy.vocabulary.migrate_example_beer_styles.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.install delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrations/beer_comment.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerComment.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerNode.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerTerm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerUser.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/README.txt delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.weather_soap.yml delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.yml delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_xml.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_multi_xml.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration_group.wine.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0001.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0002.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index2.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.install delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/comment.type.migrate_example_advanced_comment.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.comment.migrate_example_advanced_comment.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_producer.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_wine.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.taxonomy_term.migrate_example_wine_varieties.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.comment.migrate_example_advanced_comment.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.teaser.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.teaser.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.taxonomy_term.migrate_example_wine_varieties.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.comment.migrate_example_advanced_comment.comment_body.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.body.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.field_migrate_example_wine_regio.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.body.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_adv_image.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_comments.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_top_vintag.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_best.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_ratin.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_regio.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_var.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_adv_image.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_comments.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_top_vintag.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_best.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_ratin.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_regio.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_var.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.taxonomy_term.field_variety_attributes.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_producer.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_wine.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_position.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_items.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_list.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_multiple.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_best_with.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_regions.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_varieties.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/PositionResource.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyMultiFiles.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/README.md delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/artifacts/products.json delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_form_display.node.product.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_view_display.node.product.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_description.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_price.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_upc.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_description.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_price.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_upc.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/migrate_plus.migration.product.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/node.type.product.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.install delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.install delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.module delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.services.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/migrations/migration_config_deriver.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/phpcs.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Annotation/Authentication.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Annotation/DataFetcher.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Annotation/DataParser.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/AuthenticationPluginBase.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/AuthenticationPluginInterface.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/AuthenticationPluginManager.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/DataFetcherPluginBase.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/DataFetcherPluginInterface.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/DataFetcherPluginManager.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginBase.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginInterface.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginManager.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Entity/Migration.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroup.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroupInterface.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationInterface.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Event/MigrateEvents.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Event/MigratePrepareRowEvent.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/MigrationConfigDeriver.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/destination/Table.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/ArrayPop.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/ArrayShift.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/EntityGenerate.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/EntityLookup.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/FileBlob.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Merge.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/MultipleValues.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/SingleValue.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/SkipOnValue.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/StrReplace.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Transliteration.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/SourcePluginExtension.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/Url.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Basic.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Digest.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/OAuth2.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/File.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/Http.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Json.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/SimpleXml.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Soap.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Xml.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/XmlTrait.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/data/missing_properties.json delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/data/simple_xml_reduce_single_value.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration.fruit_terms.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration_group.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/migrate_plus_test.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Functional/LoadTest.php delete mode 100755 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrateTableTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationConfigEntityTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationGroupTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/FileTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/HttpTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayPopTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayShiftTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/MultipleValuesTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SingleValueTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/StrReplaceTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/TransliterationTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/LICENSE.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/README.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/composer.json delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/drupalci.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/drush.services.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.drush.inc delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.action.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.menu.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.task.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.module delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.permissions.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.routing.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.services.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Commands/MigrateToolsCommands.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MessageController.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationController.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationGroupListBuilder.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationListBuilder.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Drush9LogMigrateMessage.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/DrushLogMigrateMessage.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationAddForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationDeleteForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationEditForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationExecuteForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationFormBase.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupAddForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupDeleteForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupEditForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupFormBase.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Form/SourceCsvForm.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/IdMapFilter.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/MigrateBatchExecutable.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/MigrateExecutable.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/MigrateTools.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/Routing/RouteProcessor.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/src/SourceFilter.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration.csv_source_test.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration_group.csv_test.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/csv_source_test.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration.fruit_terms.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration_group.default.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/migrate_tools_test.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/MigrateExecutionFormTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/SourceCsvFormTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/DrushTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateImportTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateRollbackTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_tools/tests/src/Unit/MigrateToolsTest.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/LICENSE.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/README.txt delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/composer.json delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.drush.inc delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.info.yml delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/phpcs.xml delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/src/DrushLogMigrateMessage.php delete mode 100644 sites/all/modules/contrib/migrate/migrate_upgrade/src/MigrateUpgradeDrushRunner.php delete mode 100644 sites/all/modules/contrib/search/search_api/CHANGELOG.txt delete mode 100644 sites/all/modules/contrib/search/search_api/LICENSE.txt delete mode 100644 sites/all/modules/contrib/search/search_api/README.txt delete mode 100644 sites/all/modules/contrib/search/search_api/composer.json delete mode 100644 sites/all/modules/contrib/search/search_api/config/install/search_api.settings.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-fields.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-form.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-processors.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server-form.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.datasource.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.index.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.processor.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.server.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.tracker.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/config/schema/search_api.views.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/css/search_api.admin.css delete mode 100644 sites/all/modules/contrib/search/search_api/drush.services.yml delete mode 100644 sites/all/modules/contrib/search/search_api/js/search_api.processors.js delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/README.txt delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/config/install/search_api_db.settings.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.backend.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.api.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.install delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.module delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.services.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/README.txt delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_index.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_result.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_index.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_result.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.index.default_index.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.server.default_server.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/views.view.search_content.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.install delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/tests/src/Functional/IntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/CaseSensitiveDatabase.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/DatabaseCompatibilityHandlerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/GenericDatabase.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/MySql.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Plugin/search_api/backend/Database.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/DatabaseTestsTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-base.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/config/install/search_api_autocomplete.search.search_api_db_test_autocomplete.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/src/Plugin/search_api_autocomplete/search/TestSearch.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/AutocompleteTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/BackendTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.install delete mode 100644 sites/all/modules/contrib/search/search_api/phpcs.xml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.api.php delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.drush.inc delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.install delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.libraries.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.links.action.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.links.menu.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.links.task.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.module delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.permissions.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.plugin_type.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.routing.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.services.yml delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.theme.inc delete mode 100644 sites/all/modules/contrib/search/search_api/search_api.views.inc delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiBackend.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiDatasource.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiDisplay.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiParseMode.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiProcessor.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiTracker.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Backend/BackendInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Backend/BackendPluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Backend/BackendPluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Backend/BackendSpecificInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Commands/SearchApiCommands.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ConsoleException.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Contrib/RowsOfMultiValueFields.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Contrib/ViewsBulkOperationsEventSubscriber.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Controller/IndexController.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Controller/ServerController.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Controller/TaskController.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/DataType/DataTypeInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/DataType/DataTypePluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/DataType/DataTypePluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Datasource/DatasourceInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Datasource/DatasourcePluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Datasource/DatasourcePluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Display/DisplayDeriverBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Display/DisplayInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManagerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Entity/Index.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Entity/InstallingTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Entity/SearchApiConfigEntityStorage.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Entity/Server.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Entity/Task.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/FacetsQueryTypeMappingInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/FieldConfigurationForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexAddFieldsForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexBreakLockForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexClearConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexDeleteConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexDisableConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexFieldsForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexProcessorsForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexRebuildTrackerConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexReindexConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/IndexStatusForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/ServerClearConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/ServerDeleteConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/ServerDisableConfirmForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/ServerForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/ServerStatusForm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Form/UnsavedConfigurationFormTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/IndexBatchHelper.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/IndexInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/IndexListBuilder.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Item/Field.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Item/FieldInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Item/Item.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Item/ItemInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/LoggerTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ParamConverter/SearchApiConverter.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModeInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModePluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModePluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/DataType/Html.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/DataType/Text.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/HideablePluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/HideablePluginInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/IndexPluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/IndexPluginInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/PluginFormTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/BooleanDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/DateDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/DecimalDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/IntegerDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/StringDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/TextDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextToken.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextTokenInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextValue.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextValueInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntity.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityDeriver.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityTaskManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/EntityDatasourceInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsBlock.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayDeriver.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsEmbed.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsPage.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsRest.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/parse_mode/Direct.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/parse_mode/Phrase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/parse_mode/Terms.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddHierarchy.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddURL.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AggregatedFields.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/ContentAccess.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/EntityStatus.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Highlight.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/HtmlFilter.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/IgnoreCase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/IgnoreCharacters.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Property/AggregatedFieldProperty.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Property/RenderedItemProperty.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/RenderedItem.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Cc.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Cf.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Co.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Mc.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Me.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Mn.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Pc.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Pd.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Pe.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Pf.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Pi.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Po.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Porter2.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Ps.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Sc.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Sk.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Sm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/So.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/UnicodeCharacterPropertyInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Zl.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Zp.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Resources/Zs.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/ReverseEntityReferences.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/RoleFilter.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Stemmer.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Stopwords.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Tokenizer.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Transliteration.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/TypeBoost.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/search_api/tracker/Basic.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/EntityFieldRenderer.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/EntityTranslationRenderer.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/SearchApiHandlerTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/argument/SearchApiDate.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/argument/SearchApiFulltext.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/argument/SearchApiMoreLikeThis.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/argument/SearchApiStandard.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/argument/SearchApiTerm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/cache/SearchApiCachePluginTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/cache/SearchApiTagCache.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/cache/SearchApiTimeCache.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiBoolean.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiDate.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiEntity.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiEntityField.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiFieldTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiNumeric.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/field/SearchApiStandard.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiBoolean.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiDatasource.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiDate.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiFilterTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiFulltext.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiLanguage.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiNumeric.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiOptions.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiString.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiTerm.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiText.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/filter/SearchApiUser.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/join/SearchApiJoin.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/query/SearchApiQuery.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/relationship/SearchApiRelationship.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/row/SearchApiRow.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Plugin/views/sort/SearchApiSort.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ConfigurablePropertyBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ConfigurablePropertyInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/EntityProcessorProperty.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/FieldsProcessorPluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ProcessorInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ProcessorPluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ProcessorPluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ProcessorProperty.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Processor/ProcessorPropertyInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ProxyClass/ParamConverter/SearchApiConverter.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/Condition.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/ConditionGroup.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/ConditionGroupInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/ConditionInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/ConditionSetInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/Query.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/QueryInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/ResultSet.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Query/ResultSetInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/SearchApiException.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/ServerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/IndexTaskManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/IndexTaskManagerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/ServerTaskManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/ServerTaskManagerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/TaskEvent.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/TaskInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/TaskManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Task/TaskManagerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Tracker/TrackerInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Tracker/TrackerPluginBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Tracker/TrackerPluginManager.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/UnsavedConfigurationInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/UnsavedIndexConfiguration.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/CommandHelper.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/DataTypeHelper.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/DataTypeHelperInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/FieldsHelper.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/FieldsHelperInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/PluginHelper.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/PluginHelperInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/PostRequestIndexing.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/PostRequestIndexingInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/QueryHelper.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/QueryHelperInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/src/Utility/Utility.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/config/schema/search_api_test.schema.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/search_api_test.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/search_api_test.module delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/MethodOverrides.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/backend/TestBackend.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/data_type/AlteringValueTestDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/data_type/TestDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/data_type/UnsupportedTestDataType.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/datasource/TestDatasource.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/display/TestDisplay.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/processor/TestProcessor.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/tracker/TestTracker.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/Plugin/search_api/tracker/TestTrackerStringLabel.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/PluginTestTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test/src/TestPluginTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_db/config/install/search_api.index.database_search_index.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_db/config/install/search_api.server.database_search_server.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_db/search_api_test_db.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_db/search_api_test_db.search_api.inc delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.article.body.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.article.category.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.article.keywords.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.article.width.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.entity_test_mulrev_changed.body.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.entity_test_mulrev_changed.category.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.entity_test_mulrev_changed.keywords.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.entity_test_mulrev_changed.width.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.item.body.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.item.category.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.item.keywords.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.field.entity_test_mulrev_changed.item.width.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.storage.entity_test_mulrev_changed.body.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.storage.entity_test_mulrev_changed.category.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.storage.entity_test_mulrev_changed.keywords.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/config/install/field.storage.entity_test_mulrev_changed.width.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_example_content/search_api_test_example_content.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_extraction/config/install/field.field.entity_test_mulrev_changed.article.links.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_extraction/config/install/field.storage.entity_test_mulrev_changed.links.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_extraction/search_api_test_extraction.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_extraction/src/Plugin/search_api/processor/SoulMate.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_hooks/search_api_test_hooks.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_hooks/search_api_test_hooks.module delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_hooks/search_api_test_hooks.search_api.inc delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_inconsistent_config/config/install/search_api.index.inconsistent_search_index.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_inconsistent_config/config/install/search_api.server.inconsistent_search_server.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_inconsistent_config/search_api_test_inconsistent_config.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/search_api_test_no_ui.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/src/Plugin/search_api/backend/NoUi.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/src/Plugin/search_api/data_type/NoUi.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/src/Plugin/search_api/datasource/NoUi.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/src/Plugin/search_api/parse_mode/NoUi.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/src/Plugin/search_api/processor/NoUi.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_no_ui/src/Plugin/search_api/tracker/NoUi.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_tasks/search_api_test_tasks.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_tasks/search_api_test_tasks.services.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_tasks/src/TestTaskWorker.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_views/config/install/views.view.search_api_test_cache.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_views/config/install/views.view.search_api_test_sorts.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_views/config/install/views.view.search_api_test_view.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_views/search_api_test_views.info.yml delete mode 100644 sites/all/modules/contrib/search/search_api/tests/search_api_test_views/search_api_test_views.module delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/CacheabilityTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/ConfigOverrideIntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/ExampleContentTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/FieldIntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/HooksTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/IntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/LanguageIntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/OverviewPageTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/ProcessorIntegrationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/SearchApiBrowserTestBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Functional/ViewsTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/FunctionalJavascript/AjaxTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/BackendTestBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/BasicTrackerTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/ConfigEntity/ConfigOverrideKernelTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/ConfigEntity/DefaultConfigEntityInstallationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/ConfigEntity/DependencyRemovalTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Datasource/BundlelessEntityTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Datasource/ContentEntityDatasourceTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Datasource/DatasourceTaskTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Datasource/EntityStringIdTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Datasource/LanguageKernelTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Index/IndexChangesTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Index/IndexImportTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Index/IndexLoadItemsTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Index/IndexStorageTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/PostRequestIndexingTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/AddHierarchyTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/AddURLKernelTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/ContentAccessTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/ProcessorTestBase.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/RenderedItemTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/ReverseEntityReferencesTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Processor/TypeBoostTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/ResultsTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Server/ServerChangesTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Server/ServerStorageTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Server/ServerTaskTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/CliTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/CommandHelperTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/CustomDataTypesTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/FieldValuesExtractionTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/QueryTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/SerializationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/System/TaskTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/TestTimeService.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Views/TestMemoryBackend.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Views/ViewsDisplayCachingTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Views/ViewsDisplayTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Views/ViewsFieldTraitTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/Views/ViewsPropertyExtractionTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Kernel/ViewsTestField.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/BackendPluginBaseTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/DateDataTypeTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/ItemFieldTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/LocalTasksTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/AddURLTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/AggregatedFieldsTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/EntityStatusTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/FieldsProcessorPluginBaseTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/HighlightTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/HtmlFilterTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCaseTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCharacterTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/ProcessorTestTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/RoleFilterTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StemmerTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StopwordsTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestFieldsProcessorPlugin.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestItemsTrait.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TokenizerTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TransliterationTest.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/TestComplexDataInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/TestNodeInterface.php delete mode 100644 sites/all/modules/contrib/search/search_api/tests/src/Unit/TestUserInterface.php delete mode 100644 sites/all/modules/contrib/security/honeypot/.travis.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/LICENSE.txt delete mode 100644 sites/all/modules/contrib/security/honeypot/README.md delete mode 100644 sites/all/modules/contrib/security/honeypot/composer.json delete mode 100644 sites/all/modules/contrib/security/honeypot/config/install/honeypot.settings.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/config/optional/tour.tour.honeypot.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/config/schema/honeypot.schema.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/docker-compose.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.api.php delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.info.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.install delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.links.menu.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.module delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.permissions.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/honeypot.routing.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/src/Controller/HoneypotSettingsController.php delete mode 100644 sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotAdminFormTest.php delete mode 100644 sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormCacheTest.php delete mode 100644 sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormProgrammaticSubmissionTest.php delete mode 100644 sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormTest.php delete mode 100644 sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.info.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.routing.yml delete mode 100644 sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/src/Controller/HoneypotTestController.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/LICENSE.txt delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/README.txt delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonym.schema.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.behavior.schema.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.provider.schema.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Annotation/SynonymsProvider.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Controller/EntityAutocomplete.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Controller/SynonymConfigController.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntityAutocomplete.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntitySelect.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Entity/Synonym.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymDeleteForm.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymForm.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/EntityTypeParamConverter.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/SynonymsBehaviorServiceParamConverter.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/EntityReferenceField.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/Field.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/ViewsSynonymsEntityArgumentValidator.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsAutocomplete.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsSelect.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/AbstractProvider.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/BaseField.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/EntityReferenceField.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/Field.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/SynonymsFieldItemList.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/argument_validator/SynonymsEntity.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/filter/SynonymsEntity.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymProviderPluginCollection.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFindProviderInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFindTrait.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFormatWordingProviderInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFormatWordingTrait.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsGetProviderInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsGetTrait.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsProviderInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderPluginManager.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/AutocompleteService.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SelectService.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SynonymsBehaviorConfigurableInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SynonymsBehaviorInterface.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/BehaviorService.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/EntityGet.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/FieldTypeToSynonyms.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/SynonymsFind.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.api.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.info.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.action.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.menu.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.module delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.permissions.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.routing.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms.services.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/src/SynonymsService/Behavior/SearchService.php delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.info.yml delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.module delete mode 100644 sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.services.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/LICENSE.txt delete mode 100644 sites/all/modules/contrib/theme/extlink/README.txt delete mode 100644 sites/all/modules/contrib/theme/extlink/config/extlink.settings.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/config/schema/extlink.schema.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.css delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.info.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.install delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.js delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.libraries.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.links.menu.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.min.js delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.module delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink.routing.yml delete mode 100644 sites/all/modules/contrib/theme/extlink/extlink_s.png delete mode 100644 sites/all/modules/contrib/theme/extlink/src/Form/ExtlinkAdminSettingsForm.php delete mode 100644 sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkAdminTest.php delete mode 100644 sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTest.php delete mode 100644 sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTestBase.php delete mode 100644 sites/all/modules/contrib/users/autologout/LICENSE.txt delete mode 100644 sites/all/modules/contrib/users/autologout/README.txt delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.api.php delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.info.yml delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.install delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.libraries.yml delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.links.menu.yml delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.module delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.permissions.yml delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.routing.yml delete mode 100644 sites/all/modules/contrib/users/autologout/autologout.services.yml delete mode 100644 sites/all/modules/contrib/users/autologout/composer.json delete mode 100644 sites/all/modules/contrib/users/autologout/config/install/autologout.settings.yml delete mode 100644 sites/all/modules/contrib/users/autologout/config/schema/autologout.schema.yml delete mode 100644 sites/all/modules/contrib/users/autologout/js/autologout.js delete mode 100644 sites/all/modules/contrib/users/autologout/src/AutologoutManager.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/AutologoutManagerInterface.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Controller/AutologoutController.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/EventSubscriber/AutologoutSubscriber.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Form/AutologoutBlockForm.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Form/AutologoutSettingsForm.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Plugin/Block/AutologoutWarningBlock.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Tests/AutologoutAjaxTest.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Tests/AutologoutSessionCleanupOnLoginTest.php delete mode 100644 sites/all/modules/contrib/users/autologout/src/Tests/AutologoutTest.php delete mode 100644 sites/all/modules/contrib/users/email_registration/LICENSE.txt delete mode 100644 sites/all/modules/contrib/users/email_registration/README.txt delete mode 100644 sites/all/modules/contrib/users/email_registration/composer.json delete mode 100644 sites/all/modules/contrib/users/email_registration/config/install/email_registration.settings.yml delete mode 100644 sites/all/modules/contrib/users/email_registration/config/schema/email_registration.schema.yml delete mode 100644 sites/all/modules/contrib/users/email_registration/email_registration.api.php delete mode 100644 sites/all/modules/contrib/users/email_registration/email_registration.info.yml delete mode 100644 sites/all/modules/contrib/users/email_registration/email_registration.install delete mode 100644 sites/all/modules/contrib/users/email_registration/email_registration.module delete mode 100644 sites/all/modules/contrib/users/email_registration/src/Plugin/Commerce/CheckoutPane/EmailRegistrationLogin.php delete mode 100644 sites/all/modules/contrib/users/email_registration/tests/src/Functional/EmailRegistrationTestCase.php delete mode 100644 sites/all/modules/contrib/users/profile/.travis-phpcs.sh delete mode 100644 sites/all/modules/contrib/users/profile/.travis.yml delete mode 100644 sites/all/modules/contrib/users/profile/LICENSE.txt delete mode 100644 sites/all/modules/contrib/users/profile/README.md delete mode 100644 sites/all/modules/contrib/users/profile/composer.json delete mode 100644 sites/all/modules/contrib/users/profile/config/install/system.action.profile_delete_action.yml delete mode 100644 sites/all/modules/contrib/users/profile/config/install/system.action.profile_publish_action.yml delete mode 100644 sites/all/modules/contrib/users/profile/config/install/system.action.profile_unpublish_action.yml delete mode 100644 sites/all/modules/contrib/users/profile/config/install/views.view.profiles.yml delete mode 100644 sites/all/modules/contrib/users/profile/config/schema/profile.schema.yml delete mode 100644 sites/all/modules/contrib/users/profile/css/profile.base.css delete mode 100644 sites/all/modules/contrib/users/profile/profile.info.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.install delete mode 100644 sites/all/modules/contrib/users/profile/profile.libraries.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.links.action.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.links.menu.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.links.task.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.module delete mode 100644 sites/all/modules/contrib/users/profile/profile.permissions.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.routing.yml delete mode 100644 sites/all/modules/contrib/users/profile/profile.services.yml delete mode 100644 sites/all/modules/contrib/users/profile/src/Access/ProfileAccessCheck.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Controller/ProfileController.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Controller/ProfileViewController.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Entity/Profile.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Entity/ProfileInterface.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Entity/ProfileType.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Entity/ProfileTypeInterface.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Event/ProfileEvents.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Event/ProfileLabelEvent.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Form/DeleteMultiple.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Form/ProfileDeleteForm.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Form/ProfileForm.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Form/ProfileTypeDeleteForm.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Form/ProfileTypeForm.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/Action/DeleteProfile.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/Action/PublishProfile.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/Action/UnpublishProfile.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/Derivative/ProfileLocalTask.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/EntityReferenceSelection/ProfileSelection.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/search_api/processor/ProfileUserStatus.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/views/field/ProfileBulkForm.php delete mode 100644 sites/all/modules/contrib/users/profile/src/Plugin/views/relationship/ProfileViewsRelationship.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileAccessControlHandler.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileListBuilder.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfilePermissionProvider.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileStorage.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileStorageInterface.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileTestTrait.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileTypeListBuilder.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileViewBuilder.php delete mode 100644 sites/all/modules/contrib/users/profile/src/ProfileViewsData.php delete mode 100644 sites/all/modules/contrib/users/profile/templates/profile.html.twig delete mode 100644 sites/all/modules/contrib/users/profile/tests/profile_test/profile_test.info.yml delete mode 100644 sites/all/modules/contrib/users/profile/tests/profile_test/test_views/views.view.users.yml delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileDefaultTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileFieldAccessTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileHelpTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRegisterFormTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRevisionTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTabTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTestBase.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeCRUDTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileAccessTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileRoleAccessTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileTest.php delete mode 100644 sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileViewTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/LICENSE.txt delete mode 100644 sites/all/modules/contrib/views/translation_views/README.md delete mode 100644 sites/all/modules/contrib/views/translation_views/config/optional/views.view.content_translations.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/config/schema/translation_views.views.schema.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/src/EntityTranslationInfo.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationCountField.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationModerationState.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationOperationsField.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationSourceLangcodeEqualsRowLangcodeField.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationStatus.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationTargetLanguageField.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationCountFilter.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationSourceLangcodeEqualsRowLangcodeFilter.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationStatusFilter.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationTargetLanguageFilter.php delete mode 100755 sites/all/modules/contrib/views/translation_views/src/Plugin/views/join/TranslationLanguageJoin.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/TranslationCountTrait.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/TranslationViewsFieldDefinitions.php delete mode 100644 sites/all/modules/contrib/views/translation_views/src/TranslationViewsTargetLanguage.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/config/install/views.view.test_local_translation_content_integration.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/translation_views_local_translation_test.info.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.comment_translation.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.content_moderation_integration_test.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.test_operations_links.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.translation_views_all_filters_and_fields.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/workflows.workflow.editorial.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/translation_views_test_views.info.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/CommentFullViewFiltersFieldsTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentFullViewFiltersFieldsTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentModerationIntegration.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentTranslationJobsViewTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/LocalTranslationContentIntegrationTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationTargetLanguageTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationsFieldPermissionsTest.php delete mode 100644 sites/all/modules/contrib/views/translation_views/translation_views.info.yml delete mode 100644 sites/all/modules/contrib/views/translation_views/translation_views.module delete mode 100755 sites/all/modules/contrib/views/translation_views/translation_views.views.inc delete mode 100644 sites/all/modules/contrib/views/translation_views/translation_views.views_execution.inc delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/LICENSE.txt delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/README.txt delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/composer.json delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/css/edit_form.css delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/src/Plugin/Action/ModifyEntityValues.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/tests/src/Functional/ViewsBulkEditModifyEntityValuesTest.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/tests/src/Kernel/ViewsBulkEditActionTest.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.info.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.libraries.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.module delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/LICENSE.txt delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/README.txt delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/composer.json delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/config/schema/views_bulk_operations.views.schema.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/css/frontUi.css delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/drush.services.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/js/adminUi.js delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/js/frontUi.js delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.info.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.permissions.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.services.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/ActionsPermissions.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/EventSubscriber/ActionsPermissionsEventSubscriber.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/src/Plugin/Action/ViewsBulkOperationExampleAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/views_bulk_operations_example.info.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Access/ViewsBulkOperationsAccess.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionBase.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionInterface.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsPreconfigurationInterface.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Commands/ViewsBulkOperationsCommands.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Controller/ViewsBulkOperationsController.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/EventSubscriber/ViewsBulkOperationsEventSubscriber.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfigureAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfirmAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Form/ViewsBulkOperationsFormTrait.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/CancelUserAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/EntityDeleteAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionManager.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessorInterface.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsViewData.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsViewDataInterface.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/ViewsBulkOperationsBatch.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/src/ViewsBulkOperationsEvent.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/src/Functional/ViewsBulkOperationsBulkFormTest.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsActionProcessorTest.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsDataServiceTest.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsKernelTestBase.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/src/Unit/TestViewsBulkOperationsBatch.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/src/Unit/ViewsBulkOperationsBatchTest.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test_advanced.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsAdvancedTestAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsPassTestAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsSimpleTestAction.php delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.info.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.permissions.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.drush.inc delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.info.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.libraries.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.module delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.routing.yml delete mode 100644 sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.services.yml delete mode 100644 sites/all/modules/examples/examples/LICENSE.txt delete mode 100644 sites/all/modules/examples/ms_ajax_form_example/LICENSE.txt delete mode 100644 sites/all/themes/contrib/adminimal_theme/LICENSE.txt delete mode 100644 sites/all/themes/contrib/adminimal_theme/adminimal_theme.info.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/adminimal_theme.libraries.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/adminimal_theme.theme delete mode 100644 sites/all/themes/contrib/adminimal_theme/composer.json delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_breadcrumbs.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_content.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_help.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_local_actions.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_login.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_messages.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_page_title.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_primary_local_tasks.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_secondary_local_tasks.yml delete mode 100644 sites/all/themes/contrib/adminimal_theme/css/adminimal.css delete mode 100644 sites/all/themes/contrib/adminimal_theme/images/caret-down.svg delete mode 100644 sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down-hover.svg delete mode 100644 sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down.svg delete mode 100644 sites/all/themes/contrib/adminimal_theme/images/chevron-disc-up.svg delete mode 100644 sites/all/themes/contrib/adminimal_theme/screenshot.png delete mode 100644 sites/all/themes/contrib/basic/.gitignore delete mode 100644 sites/all/themes/contrib/basic/Gruntfile.js delete mode 100644 sites/all/themes/contrib/basic/LICENSE.txt delete mode 100644 sites/all/themes/contrib/basic/README.txt delete mode 100644 sites/all/themes/contrib/basic/basic.info.yml delete mode 100644 sites/all/themes/contrib/basic/basic.libraries.yml delete mode 100644 sites/all/themes/contrib/basic/basic.theme delete mode 100644 sites/all/themes/contrib/basic/composer.json delete mode 100644 sites/all/themes/contrib/basic/config/install/basic.settings.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_account_menu.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_branding.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_breadcrumbs.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_content.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_footer.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_help.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_local_actions.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_local_tasks.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_main_menu.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_messages.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_page_title.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_search.yml delete mode 100644 sites/all/themes/contrib/basic/config/optional/block.block.basic_tools.yml delete mode 100644 sites/all/themes/contrib/basic/config/schema/basic.schema.yml delete mode 100644 sites/all/themes/contrib/basic/css/base/base.css delete mode 100644 sites/all/themes/contrib/basic/css/components/components.css delete mode 100644 sites/all/themes/contrib/basic/css/components/messages.css delete mode 100644 sites/all/themes/contrib/basic/css/components/tabs.css delete mode 100644 sites/all/themes/contrib/basic/css/layout/layout.css delete mode 100644 sites/all/themes/contrib/basic/css/theme/print.css delete mode 100644 sites/all/themes/contrib/basic/css/theme/theme.css delete mode 100644 sites/all/themes/contrib/basic/images/optimized/README.txt delete mode 100644 sites/all/themes/contrib/basic/images/source/README.txt delete mode 100644 sites/all/themes/contrib/basic/includes/basic.drush.inc delete mode 100644 sites/all/themes/contrib/basic/js/build/scripts.js delete mode 100644 sites/all/themes/contrib/basic/js/modernizr.js delete mode 100755 sites/all/themes/contrib/basic/js/selectivizr-min.js delete mode 100644 sites/all/themes/contrib/basic/js/source/scripts.js delete mode 100644 sites/all/themes/contrib/basic/logo.png delete mode 100644 sites/all/themes/contrib/basic/logo.svg delete mode 100644 sites/all/themes/contrib/basic/package.json delete mode 100755 sites/all/themes/contrib/basic/sass/base/_buttons.sass delete mode 100755 sites/all/themes/contrib/basic/sass/base/_forms.sass delete mode 100755 sites/all/themes/contrib/basic/sass/base/_lists.sass delete mode 100644 sites/all/themes/contrib/basic/sass/base/_media.sass delete mode 100755 sites/all/themes/contrib/basic/sass/base/_tables.sass delete mode 100755 sites/all/themes/contrib/basic/sass/base/_typography.sass delete mode 100644 sites/all/themes/contrib/basic/sass/base/base.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/_breadcrumb.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/_navigation.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/_pager.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/_site-name.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/components.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/messages.sass delete mode 100644 sites/all/themes/contrib/basic/sass/components/tabs.sass delete mode 100644 sites/all/themes/contrib/basic/sass/config/_config.sass delete mode 100755 sites/all/themes/contrib/basic/sass/config/_grid-settings.sass delete mode 100644 sites/all/themes/contrib/basic/sass/config/_mixins.sass delete mode 100644 sites/all/themes/contrib/basic/sass/config/_variables.sass delete mode 100644 sites/all/themes/contrib/basic/sass/layout/_layout--grid.sass delete mode 100644 sites/all/themes/contrib/basic/sass/layout/layout.sass delete mode 100644 sites/all/themes/contrib/basic/sass/theme/print.sass delete mode 100644 sites/all/themes/contrib/basic/sass/theme/theme.sass delete mode 100644 sites/all/themes/contrib/basic/screenshot.png delete mode 100644 sites/all/themes/contrib/basic/templates/block/block--local-actions-block.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/block/block--local-tasks-block.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/block/block--search-form-block.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/block/block--system-branding-block.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/block/block--system-menu-block.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/block/block.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/breadcrumb.html.twig delete mode 100755 sites/all/themes/contrib/basic/templates/comment.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/field--comment.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/field.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/html.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/menu-local-task.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/menu-local-tasks.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/menu.html.twig delete mode 100755 sites/all/themes/contrib/basic/templates/node.html.twig delete mode 100755 sites/all/themes/contrib/basic/templates/page.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/pager.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/status-messages.html.twig delete mode 100644 sites/all/themes/contrib/basic/templates/views-mini-pager.html.twig delete mode 100644 sites/all/themes/contrib/basic/theme-settings.php delete mode 100644 themes/README.txt rename .csslintrc => web/.csslintrc (100%) create mode 100644 web/.editorconfig rename .eslintignore => web/.eslintignore (100%) rename .eslintrc.json => web/.eslintrc.json (100%) create mode 100644 web/.gitattributes create mode 100644 web/.ht.router.php rename .htaccess => web/.htaccess (100%) rename autoload.php => web/autoload.php (55%) rename index.php => web/index.php (100%) rename sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/css/devel_dumper_test.css => web/modules/.gitkeep (100%) rename sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/js/devel_dumper_test.js => web/profiles/.gitkeep (100%) rename robots.txt => web/robots.txt (96%) rename {sites => web/sites}/README.txt (100%) rename {sites => web/sites}/all/modules/examples/examples/.eslintrc (100%) rename {sites => web/sites}/all/modules/examples/examples/CONTRIBUTING.md (100%) rename LICENSE.txt => web/sites/all/modules/examples/examples/LICENSE.txt (100%) rename {sites => web/sites}/all/modules/examples/examples/README.md (100%) rename {sites => web/sites}/all/modules/examples/examples/STANDARDS.md (100%) rename {sites => web/sites}/all/modules/examples/examples/TESTING.md (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/ajax_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/ajax_example.libraries.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/ajax_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/ajax_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/ajax_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/css/ajax-example-base.css (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/js/ajax-example.js (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Controller/AjaxExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/Autotextfields.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/DependentDropdown.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/DynamicFormSections.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/EntityAutocomplete.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/Simplest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/SubmitDriven.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/src/Form/Wizard.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/Functional/AjaxExampleMenuTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/Functional/DependentDropdownTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/Functional/DynamicFormSectionsTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/FunctionalJavascript/AutotextfieldsTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/FunctionalJavascript/DependentDropdownTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/FunctionalJavascript/DynamicFormSectionsTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/FunctionalJavascript/EntityAutocompleteTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/FunctionalJavascript/SimplestTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/ajax_example/tests/src/FunctionalJavascript/SubmitDrivenTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/batch_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/batch_example.install (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/batch_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/batch_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/batch_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/src/Form/BatchExampleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/batch_example/tests/src/functional/BatchExampleWebTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/block_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/block_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/block_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/block_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/config/schema/block_example.schema.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/src/Controller/BlockExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/src/Plugin/Block/ExampleConfigurableTextBlock.php (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/src/Plugin/Block/ExampleEmptyBlock.php (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/src/Plugin/Block/ExampleUppercaseBlock.php (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/tests/src/Functional/BlockExampleMenuTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/block_example/tests/src/Functional/BlockExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cache_example/cache_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cache_example/cache_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cache_example/cache_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/cache_example/cache_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cache_example/src/Form/CacheExampleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cache_example/tests/src/Functional/CacheExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/composer.json (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config/install/config_entity_example.robot.marvin.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config/schema/config_entity_example.schema.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config_entity_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config_entity_example.links.action.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config_entity_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config_entity_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config_entity_example.permissions.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/config_entity_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/Controller/RobotListBuilder.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/Entity/Robot.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/Form/RobotAddForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/Form/RobotDeleteForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/Form/RobotEditForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/Form/RobotFormBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/src/RobotAccessController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.links.action.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.links.task.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.permissions.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/content_entity_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/ContactAccessControlHandler.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/ContactInterface.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/Entity/Contact.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/Entity/Controller/ContactListBuilder.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/Form/ContactDeleteForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/Form/ContactForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/src/Form/ContactSettingsForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/content_entity_example/tests/src/Functional/ContentEntityExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/config/install/cron_example.settings.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/config/schema/cron_example.schema.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/cron_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/cron_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/cron_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/cron_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/src/Form/CronExampleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/src/Plugin/QueueWorker/ReportWorkerBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/src/Plugin/QueueWorker/ReportWorkerOne.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/src/Plugin/QueueWorker/ReportWorkerTwo.php (100%) rename {sites => web/sites}/all/modules/examples/examples/cron_example/tests/src/Functional/CronExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/css/examples.icons.css (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/dbtng_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/dbtng_example.install (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/dbtng_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/dbtng_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/dbtng_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/src/Controller/DbtngExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/src/DbtngExampleStorage.php (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/src/Form/DbtngExampleAddForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/src/Form/DbtngExampleUpdateForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/dbtng_example/tests/src/Functional/DbtngExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/email_example/email_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/email_example/email_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/email_example/email_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/email_example/email_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/email_example/src/Form/EmailExampleGetFormPage.php (100%) rename {sites => web/sites}/all/modules/examples/examples/email_example/tests/src/Functional/EmailExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/events_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/events_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/events_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/events_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/events_example.services.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/src/Event/IncidentEvents.php (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/src/Event/IncidentReportEvent.php (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/src/EventSubscriber/EventsExampleSubscriber.php (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/src/Form/EventsExampleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/tests/src/Functional/EventsExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/events_example/tests/src/Kernel/EventsExampleServiceTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/examples.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/examples.libraries.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/examples.module (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/config/schema/field_example.schema.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/field_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/field_example.js (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/field_example.libraries.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/field_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/field_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/field_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Controller/FieldExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/FieldExampleWebTestBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Plugin/Field/FieldFormatter/ColorBackgroudFormatter.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Plugin/Field/FieldFormatter/SimpleTextFormatter.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Plugin/Field/FieldType/RgbItem.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Plugin/Field/FieldWidget/ColorPickerWidget.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Plugin/Field/FieldWidget/Text3Widget.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/src/Plugin/Field/FieldWidget/TextWidget.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/tests/src/Functional/ColorBackgroundFormatterTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/tests/src/Functional/ColorPickerWidgetTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/tests/src/Functional/FieldExampleBrowserTestBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/tests/src/Functional/FieldExampleMenuTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/tests/src/Functional/Text3WidgetTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_example/tests/src/Functional/TextWidgetTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/css/field-permission-description.css (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/css/field_permission_example.css (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/field_permission_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/field_permission_example.libraries.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/field_permission_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/field_permission_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/field_permission_example.permissions.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/field_permission_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/src/Controller/FieldPermissionExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/src/Plugin/Field/FieldFormatter/SimpleTextFormatter.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/src/Plugin/Field/FieldType/FieldNote.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/src/Plugin/Field/FieldWidget/TextWidget.php (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/field_permission_example/tests/src/Kernel/FieldNoteItemTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/file_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/file_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/file_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/file_example.permissions.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/file_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/src/Form/FileExampleReadWriteForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/file_example/tests/src/Functional/FileExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/form_api_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/form_api_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/form_api_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/form_api_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Controller/Page.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/AjaxAddMore.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/AjaxColorForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/BuildDemo.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/ContainerDemo.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/DemoBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/InputDemo.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/ModalForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/MultistepForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/SimpleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/StateDemo.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/src/Form/VerticalTabsDemo.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/tests/src/Functional/FapiExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/tests/src/Functional/MultistepFormTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/tests/src/FunctionalJavascript/AjaxColorFormTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/form_api_example/tests/src/FunctionalJavascript/ModalFormTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/hooks_example.api.php (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/hooks_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/hooks_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/hooks_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/src/Controller/HooksExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/hooks_example/tests/src/Functional/HooksExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/images/100x30.svg (100%) rename {sites => web/sites}/all/modules/examples/examples/images/examples.svg (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/css/jsweights.css (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/black.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/blue.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/brown.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/green.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/js_example_accordion.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/purple.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js/red.js (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js_example.libraries.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/js_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/src/Controller/JsExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/templates/accordion.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/js_example/tests/src/Functional/JsExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/core.entity_form_display.node.basic_content_type.default.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/core.entity_form_display.node.locked_content_type.default.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/core.entity_view_display.node.basic_content_type.default.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/core.entity_view_display.node.locked_content_type.default.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/field.field.node.basic_content_type.body.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/field.field.node.locked_content_type.body.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/node.type.basic_content_type.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/config/install/node.type.locked_content_type.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/node_type_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/node_type_example.install (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/node_type_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/node_type_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/node_type_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/src/Controller/NodeTypeExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/node_type_example/tests/src/Functional/NodeTypeExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/page_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/page_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/page_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/page_example.permissions.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/page_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/src/Controller/PageExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/page_example/tests/src/Functional/PageExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/pager_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/pager_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/pager_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/pager_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/src/Controller/PagerExamplePage.php (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/pager_example/tests/src/Functional/PagerExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpcs.xml.dist (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/phpunit_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/phpunit_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/phpunit_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/phpunit_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/src/AddClass.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/src/Controller/PHPUnitExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/src/DisplayInfoInterface.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/src/DisplayManager.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/src/ProtectedPrivates.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/tests/src/Functional/PHPUnitExampleMenuTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/tests/src/Unit/AddClassTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/tests/src/Unit/DisplayManagerTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/tests/src/Unit/ProtectedPrivatesTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/phpunit_example/tests/src/Unit/Subclasses/ProtectedPrivatesSubclass.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/plugin_type_example.api.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/plugin_type_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/plugin_type_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/plugin_type_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/plugin_type_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/plugin_type_example.services.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/Annotation/Sandwich.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/Controller/PluginTypeExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/Plugin/Sandwich/ExampleHamSandwich.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/SandwichBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/SandwichInterface.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/src/SandwichPluginManager.php (100%) rename {sites => web/sites}/all/modules/examples/examples/plugin_type_example/tests/src/Functional/PluginTypeExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/queue_example/queue_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/queue_example/queue_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/queue_example/queue_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/queue_example/queue_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/queue_example/src/Forms/QueueExampleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/queue_example/tests/src/Functional/QueueExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/config/install/core.entity_form_display.node.simpletest_example.default.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/config/install/field.field.node.simpletest_example.body.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/config/install/node.type.simpletest_example.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/mock/simpletest_example_test/simpletest_example_test.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/mock/simpletest_example_test/simpletest_example_test.module (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/simpletest_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/simpletest_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/simpletest_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/simpletest_example.permissions.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/simpletest_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/src/Controller/SimpleTestExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/src/Tests/SimpleTestExampleMockModuleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/src/Tests/SimpleTestExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/simpletest_example/tests/src/Functional/SimpletestExampeTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/src/Tests/ExamplesTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/src/Tests/ExamplesTestBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/src/Utility/DescriptionTemplateTrait.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/src/Controller/StreamWrapperExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/src/PathProcessor/PathProcessorSessions.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/src/StreamWrapper/FileExampleSessionStreamWrapper.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/src/StreamWrapper/MockSessionTrait.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/src/StreamWrapper/SessionWrapper.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/stream_wrapper_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/stream_wrapper_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/stream_wrapper_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/stream_wrapper_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/stream_wrapper_example.services.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/tests/src/Kernel/StreamWrapperTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/stream_wrapper_example/tests/src/Unit/SessionWrapperTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/src/Controller/TableDragExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/src/Form/TableDragExampleNestedForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/src/Form/TableDragExampleResetForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/src/Form/TableDragExampleRootLeafForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/src/Form/TableDragExampleSimpleForm.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tabledrag_example.data.inc (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tabledrag_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tabledrag_example.install (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tabledrag_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tabledrag_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tabledrag_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/tabledrag_example/tests/src/Functional/TabledragMenuTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/src/Controller/TableSortExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/tablesort_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/tablesort_example.install (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/tablesort_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/tablesort_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/tablesort_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tablesort_example/tests/src/Functional/TableSortExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/src/Controller/ContrivedController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/src/Controller/TestingExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/src/Tests/NaiveConversionTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/testing_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/testing_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/testing_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/testing_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Functional/ExampleFunctionalTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Functional/FrontPageLinkDependenciesTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Functional/FrontPageLinkTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Functional/SkeletonTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Functional/TestingExampleMenuTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Kernel/ExampleFixtureManagementTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/testing_example/tests/src/Unit/Controller/ContrivedControllerTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/modules/examples_description_test/examples_description_test.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/modules/examples_description_test/examples_description_test.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/modules/examples_description_test/src/Controller/SampleExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/modules/examples_description_test/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/src/Functional/ExamplesBrowserTestBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/src/Functional/ExamplesTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/src/Kernel/DescriptionTraitTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tests/src/Unit/YamlValidationTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/config/install/tour.tour.tour-example.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/src/Controller/TourExampleController.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/templates/description.html.twig (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tests/src/Functional/TourExampleTest.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tests/src/Functional/TourTestBase.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tests/src/Functional/TourTestBasic.php (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tour_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tour_example.links.menu.yml (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tour_example.module (100%) rename {sites => web/sites}/all/modules/examples/examples/tour_example/tour_example.routing.yml (100%) rename {sites/all/modules/contrib/admin/admin_toolbar => web/sites/all/modules/examples/ms_ajax_form_example}/LICENSE.txt (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/README.txt (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/ms_ajax_form_example.info.yml (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/ms_ajax_form_example.routing.yml (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/BaseButton.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/ButtonInterface.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/StepOneNextButton.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/StepThreeFinishButton.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/StepThreePreviousButton.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/StepTwoNextButton.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Button/StepTwoPreviousButton.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Form/MultiStepExampleForm.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Manager/StepManager.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/BaseStep.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/StepFinalize.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/StepInterface.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/StepOne.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/StepThree.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/StepTwo.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Step/StepsEnum.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Validator/BaseValidator.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Validator/ValidatorInterface.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Validator/ValidatorRegex.php (100%) rename {sites => web/sites}/all/modules/examples/ms_ajax_form_example/src/Validator/ValidatorRequired.php (100%) rename {sites => web/sites}/all/modules/figli/.gitignore (100%) rename {sites => web/sites}/all/modules/figli/edlp_admin/edlp_admin.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_admin/edlp_admin.links.action.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_admin/edlp_admin.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_admin/src/Plugin/Filter/CssFilter.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_agenda/edlp_agenda.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_agenda/edlp_agenda.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_agenda/edlp_agenda.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_agenda/includes/edlp_agenda.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_agenda/src/Controller/AgendaController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_agenda/templates/edlp-agenda.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/edlp_ajax.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/edlp_ajax.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/edlp_ajax.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/includes/edlp_ajax.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/src/Controller/EdlpAjaxController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatterAjax.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_ajax/templates/edlp-ajax.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/.gitignore (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/assets/dist/scripts/physics.min.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/assets/dist/styles/corpus.min.css (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/assets/scripts/corpus.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/assets/scripts/physics.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/assets/styles/corpus.scss (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/bower.json (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/edlp_corpus.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/edlp_corpus.libraries.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/edlp_corpus.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/edlp_corpus.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/gulpfile.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/includes/blockentrees.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/includes/edlp_corpus_articlesindex.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/includes/edlp_corpus_collection.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/includes/edlp_corpus_lastdocs.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/package.json (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/src/Controller/CorpusController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/src/Plugin/Block/BlockEntrees.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/src/Plugin/Filter/AudioLinksFilter.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/templates/blockentrees.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/templates/edlp-corpus-articlesindex.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/templates/edlp-corpus-collection.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_corpus/templates/edlp-corpus-lastdocs.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_fils/edlp_fils.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_fils/edlp_fils.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_fils/edlp_fils.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_fils/src/Controller/FilsController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_home/edlp_home.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_home/edlp_home.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_home/edlp_home.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_home/includes/edlp_home.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_home/src/Controller/HomeController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_home/templates/edlp-home.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_allfiles.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_corpus.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_entrees.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_evenements.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_genres.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_langues.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_pages.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_pagetype.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_sons.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration.d6_edlp_users.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/config/install/migrate_plus.migration_group.d6_edlp.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/edlp_migrate.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/readme.md (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpCorpus.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpEvenements.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpFile.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpPages.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpSons.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpTaxonomyTermEntree.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/src/Plugin/migrate/source/D6EdlpUsers.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_block.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_date_formats.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_dblog_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_field.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_field_formatter_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_field_instance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_field_instance_widget_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_file.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_file_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_filter_format.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_imagecache_presets.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_language_content_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_language_negotiation_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_language_types.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_menu.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_menu_links.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_corpus.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_entree.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_episode.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_event.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_home.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_page.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_corpus.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_entree.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_episode.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_event.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_home.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_page.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_son.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_static.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_visual_piece_sonore.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_revision_webform.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_setting_promote.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_setting_status.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_setting_sticky.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_son.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_static.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_corpus.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_entree.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_episode.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_event.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_home.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_page.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_son.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_static.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_visual_piece_sonore.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_translation_webform.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_type.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_visual_piece_sonore.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_node_webform.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_search_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_statistics_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_syslog_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_cron.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_date.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_file.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_image.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_image_gd.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_logging.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_maintenance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_performance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_rss.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_system_site.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_taxonomy_term.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_taxonomy_term_translation.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_taxonomy_vocabulary.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_1.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_2.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_3.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_4.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_revision_1.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_revision_2.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_revision_3.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_term_node_revision_4.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_upload.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_upload_entity_display.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_upload_entity_form_display.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_upload_field.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_upload_field_instance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_url_alias.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_user.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_user_contact_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_user_mail.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_user_picture_file.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_user_role.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_user_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_view_modes.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_vocabulary_entity_display.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_vocabulary_entity_form_display.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_vocabulary_field.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_d6_vocabulary_field_instance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_default_language.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_file_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_language.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_language_prefixes_and_domains.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_locale_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_menu.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_menu_links.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_menu_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_search_page.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_statistics_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_system_image.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_system_image_gd.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_system_logging.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_system_maintenance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_system_rss.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_system_site.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_taxonomy_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_text_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_update_settings.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_user_picture_entity_display.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_user_picture_entity_form_display.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_user_picture_field.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration.upgrade_user_picture_field_instance.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration_group.default.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_migrate/upgrade-export/migrate_plus.migration_group.migrate_drupal_6.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_mobile/edlp_mobile.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_mobile/edlp_mobile.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_productions/edlp_productions.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_productions/edlp_productions.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_productions/edlp_productions.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_productions/includes/edlp_productions.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_productions/src/Controller/ProductionsController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_productions/templates/edlp-productions.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/assets/dist/scripts/edlp_search.min.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/assets/scripts/edlp_search.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/config/install/edlp_search.edlpsearch.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/edlp_search.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/edlp_search.libraries.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/edlp_search.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/edlp_search.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/includes/edlp_search_results.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/includes/edlp_search_search_form.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/src/Controller/EdlpSearchController.php (96%) rename {sites => web/sites}/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/src/Plugin/Block/EdlpSearchLinkBlock.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/templates/edlp-search-results.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_search/templates/edlp-search-search-form.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/__chutier.page.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/__composition.page.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/assets/scripts/edlp_studio.js (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.info.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.libraries.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.links.action.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.links.menu.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.links.task.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.module (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.permissions.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/edlp_studio.routing.yml (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/includes/composition.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/includes/edlp_compositions_list.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/readme.md (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/ChutierAccessControlHandler.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/ChutierHtmlRouteProvider.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/ChutierListBuilder.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/CompositionAccessControlHandler.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/CompositionHtmlRouteProvider.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/CompositionListBuilder.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Controller/ChutierController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Controller/CompositionController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Entity/Chutier.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Entity/ChutierInterface.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Entity/ChutierViewsData.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Entity/Composition.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Entity/CompositionInterface.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Entity/CompositionViewsData.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Form/ChutierDeleteForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Form/ChutierForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Form/ChutierSettingsForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Form/CompositionDeleteForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Form/CompositionForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Form/CompositionSettingsForm.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/src/Plugin/Block/StudioLinkBlock.php (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/templates/chutier.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/templates/composition.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/templates/edlp-chutier-ui.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/templates/edlp-composition-ui.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/templates/edlp-compositions-list.html.twig (100%) rename {sites => web/sites}/all/modules/figli/edlp_studio/templates/edlp-studio-ui.html.twig (100%) rename {sites => web/sites}/all/modules/figli/gulpfile.js (100%) rename {sites => web/sites}/all/modules/figli/package-lock.json (100%) rename {sites => web/sites}/all/modules/figli/package.json (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/.gitignore (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/README.md (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/bower/imagesloaded.pkgd.min.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/bower/jquery.hotkeys.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/bower/masonry.pkgd.min.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/audio-player-next.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/audio-player-pause.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/audio-player-play.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/audio-player-previous.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/close.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/delete.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/edlp-loader-anim.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/edlp-loader.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/favori-off.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/favori-on.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/logo.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/random-active.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/random.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/search-active.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/search.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/studio-active.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/studio.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/trash.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/img/user.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/styles/app.css (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/dist/styles/app.min.css (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/audio-player-next.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/audio-player-pause.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/audio-player-play.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/audio-player-previous.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/close.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/delete.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/edlp-loader-anim.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/edlp-loader.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/favori-off.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/favori-on.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/logo.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/random-active.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/random.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/search-active.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/search.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/studio-active.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/studio.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/trash.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/img/user.svg (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/json/shared_variables.json (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/scripts/main.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/scripts/redirect.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/scripts/shared_variables_model.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/app.scss (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/base/README.md (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/base/_colors.scss (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/base/_fonts.scss (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/base/_grid.scss (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/base/_layout.scss (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/assets/styles/base/_reset.scss (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/bower.json (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/edlptheme.breakpoints.yml (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/edlptheme.info.yml (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/edlptheme.libraries.yml (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/edlptheme.theme (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/favicon.ico (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/gulpfile.js (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/package.json (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/block/block--system-branding-block.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/block/block--system-main-block.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/block/block--userlogin.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-agenda.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--article.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--default.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--evenement--default.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--transcript.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--index.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--notice.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-corpus-articlesindex.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-corpus-collection.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-corpus-lastdocs.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-home.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-productions.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-search-results.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-search-search-form.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/edlp-studio-ui.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/file-link.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/image-formatter.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--enregistrement--compo.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--enregistrement--index-home.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--enregistrement--lastdocs.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--enregistrement--player-cartel.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--enregistrement--search-index.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--evenement--aside.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--evenement--teaser.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--page--image-1-columns.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns0.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node--page.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/node.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/old__edlp-agenda.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/content/taxonomy-term--entrees--home-mobile.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/form/form-element.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/form/input--textfield.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/layout/html.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/layout/maintenance-page.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/layout/page.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/layout/region--content.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/layout/region.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig (100%) rename {sites => web/sites}/all/themes/custom/edlptheme/variables.scss (100%) rename {sites => web/sites}/default/config/sync/.htaccess (100%) rename {sites => web/sites}/default/config/sync/action.settings.yml (100%) rename {sites => web/sites}/default/config/sync/addtoany.settings.yml (100%) rename {sites => web/sites}/default/config/sync/adminimal_theme.settings.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.role.admin.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.role.authenticated.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.role.collectionneur.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.role.invite.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.role.root.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.role.user.yml (100%) rename {sites => web/sites}/default/config/sync/autologout.settings.yml (100%) rename {sites => web/sites}/default/config/sync/basic.settings.yml (100%) rename {sites => web/sites}/default/config/sync/better_messages.settings.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_breadcrumbs.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_content.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_local_actions.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_login.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_messages.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_page_title.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_primary_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.adminimal_theme_secondary_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_branding.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_content.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_footer.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_help.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_local_actions.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_main_menu.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_messages.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_page_title.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.basic_tools.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.edlpentreesblock.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.edlpsearchlinkblock.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.edlptheme_branding.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.edlptheme_content.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.footer.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.languageswitcher.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.languageswitcher_2.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.mainnavigation.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.mainnavigation_2.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.messages.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.productions.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.selecteurdelangue.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.selecteurdelangue_2.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.sitebranding.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_admin.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_branding.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_local_actions.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_login.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_messages.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_page_title.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.stark_tools.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.studiolinkblock.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.tabs.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.userlogin.yml (100%) rename {sites => web/sites}/default/config/sync/block.block.userlogin_2.yml (100%) rename {sites => web/sites}/default/config/sync/config_devel.settings.yml (100%) rename {sites => web/sites}/default/config/sync/config_ignore.settings.yml (100%) rename {sites => web/sites}/default/config/sync/context.context.medium_up.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.title.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.created.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.menu_link.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.promote.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.status.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.sticky.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.title.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.autre_son.uid.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.created.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.promote.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.status.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.sticky.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.title.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.enregistrement.uid.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.created.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.promote.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.status.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.sticky.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.title.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.evenement.uid.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.created.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.menu_link.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.promote.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.status.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.sticky.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.title.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.fil.uid.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.created.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.promote.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.status.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.sticky.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.page.uid.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.created.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.promote.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.status.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.sticky.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.node.static.uid.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.name.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.entrees.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.entrees.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.entrees.name.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.entrees.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.genres.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.genres.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.genres.name.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.genres.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.langues.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.langues.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.langues.name.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.langues.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.name.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.page_type.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.page_type.description.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.page_type.name.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.taxonomy_term.page_type.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.user.user.changed.yml (100%) rename {sites => web/sites}/default/config/sync/core.base_field_override.user.user.path.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.fallback.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_date.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_datetime.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_month.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_time.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_week.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_year.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.html_yearless_date.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.long.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.medium.yml (100%) rename {sites => web/sites}/default/config/sync/core.date_format.short.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.composition.composition.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.menu_link_content.menu_link_content.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.node.autre_son.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.node.enregistrement.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.node.evenement.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.node.fil.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.node.page.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.node.static.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.taxonomy_term.entrees.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.taxonomy_term.genres.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.taxonomy_term.langues.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_display.user.user.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_form_mode.user.register.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.composition.composition.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.composition.composition.studio_ui.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.autre_son.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.autre_son.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.article.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.chutier.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.compo.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.compo_document_.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.index.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.index_home.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.lastdocs.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.player_cartel.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.search_index.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.enregistrement.transcript.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.evenement.aside.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.evenement.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.evenement.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.fil.admin.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.fil.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.fil.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.page.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.page.image_1_columns.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.page.image_2_columns.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.page.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.page.text_1_column.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.static.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.node.static.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.taxonomy_term.entrees.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.taxonomy_term.entrees.home_mobile.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.taxonomy_term.entrees.index.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.taxonomy_term.entrees.notice.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_display.taxonomy_term.genres.default.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.block.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.chutier.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.composition.studio_ui.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.composition.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.file.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.menu_link_content.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.admin.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.article.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.aside.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.chutier.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.compo.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.compo_document_.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.full.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.image_1_columns.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.image_2_columns.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.index.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.index_home.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.lastdocs.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.player_cartel.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.rss.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.search_index.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.search_result.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.text_1_column.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.node.transcript.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.profile.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.search_api_task.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.taxonomy_term.full.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.taxonomy_term.home_mobile.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.taxonomy_term.index.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.taxonomy_term.notice.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.taxonomy_term.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.user.compact.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.user.full.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.user.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.workflow_scheduled_transition.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.entity_view_mode.workflow_transition.token.yml (100%) rename {sites => web/sites}/default/config/sync/core.extension.yml (100%) rename {sites => web/sites}/default/config/sync/core.menu.static_menu_link_overrides.yml (100%) rename {sites => web/sites}/default/config/sync/dblog.settings.yml (100%) rename {sites => web/sites}/default/config/sync/devel.settings.yml (100%) rename {sites => web/sites}/default/config/sync/devel.toolbar.settings.yml (100%) rename {sites => web/sites}/default/config/sync/domain.record.encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/domain.record.m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/domain.settings.yml (100%) rename {sites => web/sites}/default/config/sync/domain_access.settings.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.alias.beta_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.alias.beta_m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.alias.dev_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.alias.dev_m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.alias.edlp_figli_io.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.alias.edlp_m_figli_io.yml (100%) rename {sites => web/sites}/default/config/sync/domain_alias.settings.yml (100%) rename {sites => web/sites}/default/config/sync/domain_menu_access.settings.yml (100%) rename {sites => web/sites}/default/config/sync/domain_site_settings.domainconfigsettings.yml (100%) rename {sites => web/sites}/default/config/sync/editor.editor.wysiwyg.yml (100%) rename {sites => web/sites}/default/config/sync/edlptheme.settings.yml (100%) rename {sites => web/sites}/default/config/sync/email_registration.settings.yml (100%) rename {sites => web/sites}/default/config/sync/features.bundle.default.yml (100%) rename {sites => web/sites}/default/config/sync/features.settings.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.field_collectionneurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.field_genres.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.field_locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.autre_son.field_son.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_collectionneurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_description.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_entrees.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_genres.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_langues.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_nbr_locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_son.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_transcript_trad.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_transcript_vo.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.enregistrement.field_workflow.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.evenement.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.evenement.field_date.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.evenement.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.evenement.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.evenement.field_page_liee.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.evenement.field_workflow_generic.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.fil.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.fil.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.fil.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.fil.field_enregistrement.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_afficher_en_page_d_acceuil.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_documents_lies.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_page_type.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_son.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_view_mode.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_visuel.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.page.field_workflow_generic.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.field_afficher_en_page_d_acceuil.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.field_view_mode.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.field_visuel.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.node.static.field_workflow_generic.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.taxonomy_term.entrees.field_color.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.taxonomy_term.entrees.field_notice.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.taxonomy_term.entrees.field_workflow.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.taxonomy_term.genres.field_synonyms.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.user.user.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.user.user.field_domain_admin.yml (100%) rename {sites => web/sites}/default/config/sync/field.field.user.user.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.settings.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.menu_link_content.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.menu_link_content.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.body.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_afficher_en_page_d_acceuil.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_collectionneurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_date.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_description.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_documents_lies.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_enregistrement.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_entrees.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_genres.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_langues.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_nbr_locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_page_liee.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_page_type.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_son.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_transcript_trad.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_transcript_vo.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_view_mode.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_visuel.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_workflow.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.node.field_workflow_generic.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.taxonomy_term.field_color.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.taxonomy_term.field_notice.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.taxonomy_term.field_synonyms.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.taxonomy_term.field_workflow.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.user.field_domain_access.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.user.field_domain_admin.yml (100%) rename {sites => web/sites}/default/config/sync/field.storage.user.field_domain_all_affiliates.yml (100%) rename {sites => web/sites}/default/config/sync/field_ui.settings.yml (100%) rename {sites => web/sites}/default/config/sync/file.settings.yml (100%) rename {sites => web/sites}/default/config/sync/filter.format.plain_text.yml (100%) rename {sites => web/sites}/default/config/sync/filter.format.wysiwyg.yml (100%) rename {sites => web/sites}/default/config/sync/filter.settings.yml (100%) rename {sites => web/sites}/default/config/sync/honeypot.settings.yml (100%) rename {sites => web/sites}/default/config/sync/image.settings.yml (100%) rename {sites => web/sites}/default/config/sync/image.style.large.yml (100%) rename {sites => web/sites}/default/config/sync/image.style.linkit_result_thumbnail.yml (100%) rename {sites => web/sites}/default/config/sync/image.style.medium.yml (100%) rename {sites => web/sites}/default/config/sync/image.style.thumbnail.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.chutier.chutier.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.composition.composition.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.file.file.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.menu_link_content.menu_link_content.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.node.autre_son.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.node.enregistrement.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.node.evenement.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.node.fil.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.node.page.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.node.static.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.redirect.redirect.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.taxonomy_term.collectionneurs.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.taxonomy_term.entrees.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.taxonomy_term.genres.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.taxonomy_term.langues.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.taxonomy_term.locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.taxonomy_term.page_type.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.user.user.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.workflow_scheduled_transition.workflow_scheduled_transition.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.workflow_transition.corpus_documents.yml (100%) rename {sites => web/sites}/default/config/sync/language.content_settings.workflow_transition.generique.yml (100%) rename {sites => web/sites}/default/config/sync/language.entity.en.yml (100%) rename {sites => web/sites}/default/config/sync/language.entity.fr.yml (100%) rename {sites => web/sites}/default/config/sync/language.entity.und.yml (100%) rename {sites => web/sites}/default/config/sync/language.entity.zxx.yml (100%) rename {sites => web/sites}/default/config/sync/language.mappings.yml (100%) rename {sites => web/sites}/default/config/sync/language.negotiation.yml (100%) rename {sites => web/sites}/default/config/sync/language.types.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/addtoany.settings.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_breadcrumbs.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_content.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_local_actions.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_login.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_messages.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_page_title.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_primary_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.adminimal_theme_secondary_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_branding.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_content.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_footer.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_help.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_local_actions.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_main_menu.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_messages.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_page_title.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.basic_tools.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_admin.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_branding.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_local_actions.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_local_tasks.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_login.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_messages.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_page_title.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/block.block.stark_tools.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.fallback.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_date.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_datetime.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_month.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_time.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_week.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_year.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.html_yearless_date.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.long.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.medium.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.date_format.short.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_form_mode.user.register.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.node.full.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.node.rss.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.node.search_index.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.node.search_result.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.node.teaser.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.taxonomy_term.full.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.user.compact.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/core.entity_view_mode.user.full.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/domain.settings.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/field.field.user.user.field_domain_admin.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/filter.format.plain_text.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/image.style.large.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/image.style.linkit_result_thumbnail.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/image.style.medium.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/image.style.thumbnail.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/language.entity.en.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/language.entity.und.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/language.entity.zxx.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.403.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.404.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.front.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.global.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.node.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.taxonomy_term.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/metatag.metatag_defaults.user.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/migrate_plus.migration_group.d6_edlp.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_access_all_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_access_edit_all_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_access_edit_none_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_access_none_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_default_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_disable_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.domain_enable_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_make_sticky_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_make_unsticky_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_promote_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_publish_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_save_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_unpromote_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.node_unpublish_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.pathauto_update_alias_node.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.pathauto_update_alias_user.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.profile_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.profile_publish_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.profile_unpublish_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.redirect_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.user_block_user_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.user_cancel_user_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.action.user_unblock_user_action.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.maintenance.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.menu.account.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.menu.admin.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.menu.devel.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.menu.footer.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.menu.main.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.menu.tools.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/system.site.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/user.mail.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/user.role.anonymous.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/user.role.authenticated.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/user.settings.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.archive.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.content.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.content_recent.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.content_translations.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.files.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.frontpage.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.glossary.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.maillog_overview.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.profiles.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.redirect.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.taxonomy_term.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.user_admin_people.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.who_s_new.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.who_s_online.yml (100%) rename {sites => web/sites}/default/config/sync/language/en/views.view.workflow_entity_history.yml (100%) rename {sites => web/sites}/default/config/sync/linkit.linkit_profile.collection.yml (100%) rename {sites => web/sites}/default/config/sync/locale.settings.yml (100%) rename {sites => web/sites}/default/config/sync/maillog.settings.yml (100%) rename {sites => web/sites}/default/config/sync/matomo.settings.yml (100%) rename {sites => web/sites}/default/config/sync/menu_ui.settings.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.403.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.404.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.front.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.global.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.node.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.taxonomy_term.yml (100%) rename {sites => web/sites}/default/config/sync/metatag.metatag_defaults.user.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_drupal.settings.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_allfiles.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_corpus.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_entrees.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_evenements.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_genres.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_langues.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_pages.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_pagetype.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_sons.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration.d6_edlp_users.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration_group.d6_edlp.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration_group.default.yml (100%) rename {sites => web/sites}/default/config/sync/migrate_plus.migration_group.edlp.yml (100%) rename {sites => web/sites}/default/config/sync/node.settings.yml (100%) rename {sites => web/sites}/default/config/sync/node.type.autre_son.yml (100%) rename {sites => web/sites}/default/config/sync/node.type.enregistrement.yml (100%) rename {sites => web/sites}/default/config/sync/node.type.evenement.yml (100%) rename {sites => web/sites}/default/config/sync/node.type.fil.yml (100%) rename {sites => web/sites}/default/config/sync/node.type.page.yml (100%) rename {sites => web/sites}/default/config/sync/node.type.static.yml (100%) rename {sites => web/sites}/default/config/sync/path_alias_xt.settings.yml (100%) rename {sites => web/sites}/default/config/sync/pathauto.pattern.documents.yml (100%) rename {sites => web/sites}/default/config/sync/pathauto.pattern.evenements.yml (100%) rename {sites => web/sites}/default/config/sync/pathauto.pattern.page_static.yml (100%) rename {sites => web/sites}/default/config/sync/pathauto.pattern.pages_production.yml (100%) rename {sites => web/sites}/default/config/sync/pathauto.pattern.taxonomy_entrees.yml (100%) rename {sites => web/sites}/default/config/sync/pathauto.settings.yml (100%) rename {sites => web/sites}/default/config/sync/redirect.settings.yml (100%) rename {sites => web/sites}/default/config/sync/search_api.index.collection.yml (100%) rename {sites => web/sites}/default/config/sync/search_api.server.edlp_db.yml (100%) rename {sites => web/sites}/default/config/sync/search_api.settings.yml (100%) rename {sites => web/sites}/default/config/sync/search_api_db.settings.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.footer.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.productions.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.node.enregistrement.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.node.evenement.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.node.page.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.node.static.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.bundle_settings.default.taxonomy_term.entrees.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.custom_links.default.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.settings.yml (100%) rename {sites => web/sites}/default/config/sync/simple_sitemap.variants.default_hreflang.yml (100%) rename {sites => web/sites}/default/config/sync/synonyms.synonym.field.synonyms.behavior.autocomplete_taxonomy_term_genres_field_synonyms.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.change_a_node_to_next_workflow_state.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.change_a_node_to_workflow_double_fond_state_documents_.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.change_a_node_to_workflow_state_publie_documents_.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.change_workflow_state_to_sas_documents_.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_add_action.encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_add_action.m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_add_editor_action.encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_add_editor_action.m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_all_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_edit_all_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_edit_none_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_none_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_remove_action.encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_remove_action.m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_remove_editor_action.encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_access_remove_editor_action.m_encyclopediedelaparole_org.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_default_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_disable_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.domain_enable_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_make_sticky_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_make_unsticky_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_promote_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_publish_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_save_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_unpromote_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.node_unpublish_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.pathauto_update_alias_node.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.pathauto_update_alias_user.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.profile_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.profile_publish_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.profile_unpublish_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.redirect_delete_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_add_role_action.admin.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_add_role_action.collectionneur.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_add_role_action.invite.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_add_role_action.root.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_add_role_action.user.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_block_user_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_cancel_user_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_remove_role_action.admin.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_remove_role_action.collectionneur.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_remove_role_action.invite.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_remove_role_action.root.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_remove_role_action.user.yml (100%) rename {sites => web/sites}/default/config/sync/system.action.user_unblock_user_action.yml (100%) rename {sites => web/sites}/default/config/sync/system.authorize.yml (100%) rename {sites => web/sites}/default/config/sync/system.cron.yml (100%) rename {sites => web/sites}/default/config/sync/system.date.yml (100%) rename {sites => web/sites}/default/config/sync/system.diff.yml (100%) rename {sites => web/sites}/default/config/sync/system.file.yml (100%) rename {sites => web/sites}/default/config/sync/system.image.gd.yml (100%) rename {sites => web/sites}/default/config/sync/system.image.yml (100%) rename {sites => web/sites}/default/config/sync/system.logging.yml (100%) rename {sites => web/sites}/default/config/sync/system.mail.yml (100%) rename {sites => web/sites}/default/config/sync/system.maintenance.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.account.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.admin.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.devel.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.footer.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.main.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.productions.yml (100%) rename {sites => web/sites}/default/config/sync/system.menu.tools.yml (100%) rename {sites => web/sites}/default/config/sync/system.performance.yml (100%) rename {sites => web/sites}/default/config/sync/system.rss.yml (100%) rename {sites => web/sites}/default/config/sync/system.site.yml (100%) rename {sites => web/sites}/default/config/sync/system.theme.global.yml (100%) rename {sites => web/sites}/default/config/sync/system.theme.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.settings.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.vocabulary.collectionneurs.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.vocabulary.entrees.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.vocabulary.genres.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.vocabulary.langues.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.vocabulary.locuteurs.yml (100%) rename {sites => web/sites}/default/config/sync/taxonomy.vocabulary.page_type.yml (100%) rename {sites => web/sites}/default/config/sync/text.settings.yml (100%) rename {sites => web/sites}/default/config/sync/toolbar_themes.settings.yml (100%) rename {sites => web/sites}/default/config/sync/update.settings.yml (100%) rename {sites => web/sites}/default/config/sync/user.flood.yml (100%) rename {sites => web/sites}/default/config/sync/user.mail.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.admin.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.anonymous.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.authenticated.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.collectionneur.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.invite.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.root.yml (100%) rename {sites => web/sites}/default/config/sync/user.role.user.yml (100%) rename {sites => web/sites}/default/config/sync/user.settings.yml (100%) rename {sites => web/sites}/default/config/sync/views.settings.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.archive.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.content.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.content_recent.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.content_translations.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.entree_s_.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.files.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.frontpage.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.glossary.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.maillog_overview.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.profiles.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.redirect.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.taxonomy_term.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.user_admin_people.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.watchdog.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.who_s_new.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.who_s_online.yml (100%) rename {sites => web/sites}/default/config/sync/views.view.workflow_entity_history.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.settings.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.corpus_documents_creation.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.corpus_documents_double_fond.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.corpus_documents_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.corpus_documents_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.corpus_documents_sas.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.generique_creation.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.generique_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.state.generique_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_creation_double_fond.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_creation_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_creation_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_creation_sas.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_double_fond_double_fond.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_double_fond_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_double_fond_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_double_fond_sas.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_masque_double_fond.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_masque_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_masque_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_masque_sas.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_publie_double_fond.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_publie_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_publie_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_publie_sas.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_sas_double_fond.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_sas_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_sas_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.corpus_documents_sas_sas.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.generique_creation_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.generique_creation_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.generique_masque_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.generique_masque_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.generique_publie_masque.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.transition.generique_publie_publie.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.workflow.corpus_documents.yml (100%) rename {sites => web/sites}/default/config/sync/workflow.workflow.generique.yml (100%) rename {sites => web/sites}/default/config/sync/workflow_access.role.yml (100%) rename {sites => web/sites}/default/config/sync/workflow_access.settings.yml (100%) create mode 100644 web/sites/default/default.services.yml create mode 100644 web/sites/default/default.settings.php create mode 100644 web/sites/default/services.yml rename {sites => web/sites}/development.services.yml (100%) rename {sites => web/sites}/example.settings.local.php (100%) rename {sites => web/sites}/example.sites.php (100%) rename sites/all/modules/contrib/dev/mobile_js_redirect/cia_report_mstr_persona_trn.csv_.gztmp => web/themes/.gitkeep (100%) rename update.php => web/update.php (100%) rename web.config => web/web.config (100%) diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..60581237b --- /dev/null +++ b/.env.example @@ -0,0 +1,27 @@ +# +# Copy and rename this file to .env at root of this project. +# + +# A common use case is to supply database creds via the environment. Edit settings.php +# like so: +# +# $databases['default']['default'] = [ +# 'database' => getenv('MYSQL_DATABASE'), +# 'driver' => 'mysql', +# 'host' => getenv('MYSQL_HOSTNAME'), +# 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', +# 'password' => getenv('MYSQL_PASSWORD'), +# 'port' => getenv('MYSQL_PORT'), +# 'prefix' => '', +# 'username' => getenv('MYSQL_USER'), +# ]; +# +# Uncomment and populate as needed. +# MYSQL_DATABASE= +# MYSQL_HOSTNAME= +# MYSQL_PASSWORD= +# MYSQL_PORT= +# MYSQL_USER= + +# Another common use case is to set Drush's --uri via environment. +# DRUSH_OPTIONS_URI=http://example.com diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 9c0e3e698..000000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./core/.eslintrc" -} diff --git a/.gitignore b/.gitignore index 67e8141fb..b9c6a2c7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,53 +1,28 @@ -# This file contains default .gitignore rules. To use it, copy it to .gitignore, -# and it will cause files like your settings.php and user-uploaded files to be -# excluded from Git version control. This is a common strategy to avoid -# accidentally including private information in public repositories and patch -# files. -# -# Because .gitignore can be specific to your site, this file has a different -# name; updating Drupal core will not override your custom .gitignore file. - -# Ignore core when managing all of a project's dependencies with Composer -# including Drupal core. -/core/ - - -# Core's dependencies are managed with Composer. +# Ignore directories generated by Composer +/drush/contrib/ /vendor/ +/web/core/ +/web/modules/contrib/ +/web/themes/contrib/ +/web/profiles/contrib/ +/web/libraries/ +# Ignore sensitive information +/web/sites/*/settings.php +/web/sites/*/settings.local.php +/web/sites/*/services*.yml -# Ignore configuration files that may contain sensitive information. -sites/*/settings*.php -sites/*/services*.yml +/web/sites/all/modules/contrib/* +/web/sites/all/themes/contrib/* -# Ignore paths that contain user-generated content. -sites/*/files -sites/*/private +# Ignore Drupal's file directory +/web/sites/*/files/ # Ignore SimpleTest multi-site environment. -sites/simpletest +/web/sites/simpletest -# If you prefer to store your .gitignore file in the sites/ folder, comment -# or delete the previous settings and uncomment the following ones, instead. +# Ignore files generated by PhpStorm +/.idea/ -# Ignore configuration files that may contain sensitive information. -*/settings*.php - -# Ignore paths that contain user-generated content. -*/files -/private - -# Ignore SimpleTest multi-site environment. -simpletest - -backupbase.sh -dbbackups - -*.mysql -*.tar.gz -*.zip - -profiles/figli_starter_kit/ - -# this is not working as missing config a simply delete on import -# sites/default/config/sync/system.performance.yml +# Ignore .env files as they are personal +/.env diff --git a/sites/all/modules/contrib/dev/devel/css/devel-rtl.css b/.gitkeep similarity index 100% rename from sites/all/modules/contrib/dev/devel/css/devel-rtl.css rename to .gitkeep diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..858d5fa77 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,52 @@ +language: php +dist: trusty +sudo: false + +php: + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + +env: + global: + - SIMPLETEST_DB=sqlite://tmp/site.sqlite + - SIMPLETEST_BASE_URL="http://127.0.0.1:8080" + matrix: + - RELEASE=stable COMPOSER_CHANNEL=stable + - RELEASE=dev COMPOSER_CHANNEL=stable + - RELEASE=stable COMPOSER_CHANNEL=snapshot + +matrix: + exclude: + - php: 5.6 + env: RELEASE=dev COMPOSER_CHANNEL=stable + - php: 5.6 + env: RELEASE=stable COMPOSER_CHANNEL=snapshot + +before_install: + - if [[ $TRAVIS_PHP_VERSION = 5.6 ]]; then export COMPOSER_MEMORY_LIMIT=-1; fi; + - echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini + - phpenv config-rm xdebug.ini + - composer --verbose self-update --$COMPOSER_CHANNEL + - composer --version + +install: + - composer --verbose validate + - composer --verbose install + +script: + - if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi; + - if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.7.x-dev webflo/drupal-core-require-dev:8.7.x-dev; fi; + - if [[ $RELEASE = dev ]]; then composer --verbose update; fi; + - cd $TRAVIS_BUILD_DIR/web + - ./../vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite + - ./../vendor/bin/drush runserver $SIMPLETEST_BASE_URL & + - until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null + # Skip core/tests/Drupal/Tests/ComposerIntegrationTest.php because web/ has no composer.json + # Ignore PageCache group temporarily, @see https://www.drupal.org/node/2770673 + # Ignore Setup group temporarily, @see https://www.drupal.org/node/2962157 + - ./../vendor/bin/phpunit -c core --testsuite unit --exclude-group Composer,DependencyInjection,PageCache,Setup + - ./../vendor/bin/drush + - if [[ $RELEASE = stable ]]; then ./../vendor/bin/drupal; fi; diff --git a/0001-patched-DateRangeFormatter-to-localized-single-date.patch b/0001-patched-DateRangeFormatter-to-localized-single-date.patch deleted file mode 100644 index a7f070231..000000000 --- a/0001-patched-DateRangeFormatter-to-localized-single-date.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f26202ce5871ee393f86cc4afd79c3b4368c453a Mon Sep 17 00:00:00 2001 -From: Bachir Soussi Chiadmi -Date: Tue, 15 May 2018 13:54:08 +0200 -Subject: [PATCH] patched DateRangeFormatter to localized single date - ---- - .../FieldFormatter/DateRangeFormatterRangeFormatter.php | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/sites/all/modules/contrib/fields/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php b/sites/all/modules/contrib/fields/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php -index 26def1be..a7df140d 100644 ---- a/sites/all/modules/contrib/fields/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php -+++ b/sites/all/modules/contrib/fields/date_range_formatter/src/Plugin/Field/FieldFormatter/DateRangeFormatterRangeFormatter.php -@@ -63,7 +63,6 @@ public function viewElements(FieldItemListInterface $items, $langcode) { - if (date('d.m.Y', $start_date) === date('d.m.Y', $end_date)) { - $format = $this->getSetting('one_day'); - } -- - $date_str = format_date($start_date, 'custom', preg_replace('/\{([a-zA-Z])\}/', '{\\\$1}', t($format))); - $matches = array(); - if (preg_match_all('/\{([a-zA-Z])\}/', $date_str, $matches)) { -@@ -75,7 +74,9 @@ public function viewElements(FieldItemListInterface $items, $langcode) { - - } - else { -- $elements[$delta] = ['#markup' => date($this->getSetting('one_day'), $start_date)]; -+ $format = $this->getSetting('one_day'); -+ $date_str = format_date($start_date, 'custom', $format); -+ $elements[$delta] = ['#markup' => $date_str]; - } - } - } --- -2.17.0 - diff --git a/sites/all/modules/contrib/admin/domain/LICENSE b/LICENSE similarity index 99% rename from sites/all/modules/contrib/admin/domain/LICENSE rename to LICENSE index 6b5dc9742..23cb79033 100644 --- a/sites/all/modules/contrib/admin/domain/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ -GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., + Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Domain module for Drupal port to Drupal 8. - Copyright (C) 2013 Ken Rickard + {description} + Copyright (C) {year} {fullname} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/PATCHES.md b/PATCHES.md deleted file mode 100644 index 12f888502..000000000 --- a/PATCHES.md +++ /dev/null @@ -1,8 +0,0 @@ -color_field -https://www.drupal.org/project/color_field/issues/2854199#comment-12316266 - -domain_site_settings -https://www.drupal.org/project/domain_site_settings/issues/2930391 - -date_range_formatter -https://www.drupal.org/project/date_range_formatter/issues/2972998 diff --git a/README.md b/README.md new file mode 100644 index 000000000..114dfaaa7 --- /dev/null +++ b/README.md @@ -0,0 +1,145 @@ +# Composer template for Drupal projects + +[![Build Status](https://travis-ci.org/drupal-composer/drupal-project.svg?branch=8.x)](https://travis-ci.org/drupal-composer/drupal-project) + +This project template provides a starter kit for managing your site +dependencies with [Composer](https://getcomposer.org/). + +If you want to know how to use it as replacement for +[Drush Make](https://github.com/drush-ops/drush/blob/8.x/docs/make.md) visit +the [Documentation on drupal.org](https://www.drupal.org/node/2471553). + +## Usage + +First you need to [install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx). + +> Note: The instructions below refer to the [global composer installation](https://getcomposer.org/doc/00-intro.md#globally). +You might need to replace `composer` with `php composer.phar` (or similar) +for your setup. + +After that you can create the project: + +``` +composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction +``` + +With `composer require ...` you can download new dependencies to your +installation. + +``` +cd some-dir +composer require drupal/devel:~1.0 +``` + +The `composer create-project` command passes ownership of all files to the +project that is created. You should create a new git repository, and commit +all files not excluded by the .gitignore file. + +## What does the template do? + +When installing the given `composer.json` some tasks are taken care of: + +* Drupal will be installed in the `web`-directory. +* Autoloader is implemented to use the generated composer autoloader in `vendor/autoload.php`, + instead of the one provided by Drupal (`web/vendor/autoload.php`). +* Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib/` +* Theme (packages of type `drupal-theme`) will be placed in `web/themes/contrib/` +* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib/` +* Creates default writable versions of `settings.php` and `services.yml`. +* Creates `web/sites/default/files`-directory. +* Latest version of drush is installed locally for use at `vendor/bin/drush`. +* Latest version of DrupalConsole is installed locally for use at `vendor/bin/drupal`. +* Creates environment variables based on your .env file. See [.env.example](.env.example). + +## Updating Drupal Core + +This project will attempt to keep all of your Drupal Core files up-to-date; the +project [drupal-composer/drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold) +is used to ensure that your scaffold files are updated every time drupal/core is +updated. If you customize any of the "scaffolding" files (commonly .htaccess), +you may need to merge conflicts if any of your modified files are updated in a +new release of Drupal core. + +Follow the steps below to update your core files. + +1. Run `composer update drupal/core webflo/drupal-core-require-dev "symfony/*" --with-dependencies` to update Drupal Core and its dependencies. +1. Run `git diff` to determine if any of the scaffolding files have changed. + Review the files for any changes and restore any customizations to + `.htaccess` or `robots.txt`. +1. Commit everything all together in a single commit, so `web` will remain in + sync with the `core` when checking out branches or running `git bisect`. +1. In the event that there are non-trivial conflicts in step 2, you may wish + to perform these steps on a branch, and use `git merge` to combine the + updated core files with your customized files. This facilitates the use + of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple; + keeping all of your modifications at the beginning or end of the file is a + good strategy to keep merges easy. + +## Generate composer.json from existing project + +With using [the "Composer Generate" drush extension](https://www.drupal.org/project/composer_generate) +you can now generate a basic `composer.json` file from an existing project. Note +that the generated `composer.json` might differ from this project's file. + + +## FAQ + +### Should I commit the contrib modules I download? + +Composer recommends **no**. They provide [argumentation against but also +workrounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md). + +### Should I commit the scaffolding files? + +The [drupal-scaffold](https://github.com/drupal-composer/drupal-scaffold) plugin can download the scaffold files (like +index.php, update.php, …) to the web/ directory of your project. If you have not customized those files you could choose +to not check them into your version control system (e.g. git). If that is the case for your project it might be +convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can +achieve that by registering `@composer drupal:scaffold` as post-install and post-update command in your composer.json: + +```json +"scripts": { + "post-install-cmd": [ + "@composer drupal:scaffold", + "..." + ], + "post-update-cmd": [ + "@composer drupal:scaffold", + "..." + ] +}, +``` +### How can I apply patches to downloaded modules? + +If you need to apply patches (depending on the project being modified, a pull +request is often a better solution), you can do so with the +[composer-patches](https://github.com/cweagans/composer-patches) plugin. + +To add a patch to drupal module foobar insert the patches section in the extra +section of composer.json: +```json +"extra": { + "patches": { + "drupal/foobar": { + "Patch description": "URL or local path to patch" + } + } +} +``` +### How do I switch from packagist.drupal-composer.org to packages.drupal.org? + +Follow the instructions in the [documentation on drupal.org](https://www.drupal.org/docs/develop/using-composer/using-packagesdrupalorg). + +### How do I specify a PHP version ? + +This project supports PHP 5.6 as minimum version (see [Drupal 8 PHP requirements](https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements)), however it's possible that a `composer update` will upgrade some package that will then require PHP 7+. + +To prevent this you can add this code to specify the PHP version you want to use in the `config` section of `composer.json`: +```json +"config": { + "sort-packages": true, + "platform": { + "php": "5.6.40" + } +}, +``` diff --git a/README.txt b/README.txt deleted file mode 100644 index 4c8696560..000000000 --- a/README.txt +++ /dev/null @@ -1,139 +0,0 @@ - -CONTENTS OF THIS FILE ---------------------- - - * About Drupal - * Configuration and features - * Installation profiles - * Appearance - * Developing for Drupal - * More information - -ABOUT DRUPAL ------------- - -Drupal is an open source content management platform supporting a variety of -websites ranging from personal weblogs to large community-driven websites. For -more information, see the Drupal website at https://www.drupal.org, and join -the Drupal community at https://www.drupal.org/community. - -Legal information about Drupal: - * Know your rights when using Drupal: - See LICENSE.txt in the "core" directory. - * Learn about the Drupal trademark and logo policy: - https://www.drupal.com/trademark - -CONFIGURATION AND FEATURES --------------------------- - -Drupal core (what you get when you download and extract a drupal-x.y.tar.gz or -drupal-x.y.zip file from https://www.drupal.org/project/drupal) has what you -need to get started with your website. It includes several modules (extensions -that add functionality) for common website features, such as managing content, -user accounts, image uploading, and search. Core comes with many options that -allow site-specific configuration. In addition to the core modules, there are -thousands of contributed modules (for functionality not included with Drupal -core) available for download. - -More about configuration: - * Install, update, and maintain Drupal: - See INSTALL.txt and UPDATE.txt in the "core" directory. - * Learn about how to use Drupal to create your site: - https://www.drupal.org/documentation - * Follow best practices: - https://www.drupal.org/best-practices - * Download contributed modules to /modules to extend Drupal's functionality: - https://www.drupal.org/project/modules - * See also: "Developing for Drupal" for writing your own modules, below. - - -INSTALLATION PROFILES ---------------------- - -Installation profiles define additional steps (such as enabling modules, -defining content types, etc.) that run after the base installation provided -by core when Drupal is first installed. There are two basic installation -profiles provided with Drupal core. - -Installation profiles from the Drupal community modify the installation process -to provide a website for a specific use case, such as a CMS for media -publishers, a web-based project tracking tool, or a full-fledged CRM for -non-profit organizations raising money and accepting donations. They can be -distributed as bare installation profiles or as "distributions". Distributions -include Drupal core, the installation profile, and all other required -extensions, such as contributed and custom modules, themes, and third-party -libraries. Bare installation profiles require you to download Drupal Core and -the required extensions separately; place the downloaded profile in the -/profiles directory before you start the installation process. - -More about installation profiles and distributions: - * Read about the difference between installation profiles and distributions: - https://www.drupal.org/node/1089736 - * Download contributed installation profiles and distributions: - https://www.drupal.org/project/distributions - * Develop your own installation profile or distribution: - https://www.drupal.org/docs/8/creating-distributions - - -APPEARANCE ----------- - -In Drupal, the appearance of your site is set by the theme (themes are -extensions that set fonts, colors, and layout). Drupal core comes with several -themes. More themes are available for download, and you can also create your own -custom theme. - -More about themes: - * Download contributed themes to /themes to modify Drupal's appearance: - https://www.drupal.org/project/themes - * Develop your own theme: - https://www.drupal.org/docs/8/theming - -DEVELOPING FOR DRUPAL ---------------------- - -Drupal contains an extensive API that allows you to add to and modify the -functionality of your site. The API consists of "hooks", which allow modules to -react to system events and customize Drupal's behavior, and functions that -standardize common operations such as database queries and form generation. The -flexible hook architecture means that you should never need to directly modify -the files that come with Drupal core to achieve the functionality you want; -instead, functionality modifications take the form of modules. - -When you need new functionality for your Drupal site, search for existing -contributed modules. If you find a module that matches except for a bug or an -additional needed feature, change the module and contribute your improvements -back to the project in the form of a "patch". Create new custom modules only -when nothing existing comes close to what you need. - -More about developing: - * Search for existing contributed modules: - https://www.drupal.org/project/modules - * Contribute a patch: - https://www.drupal.org/patch/submit - * Develop your own module: - https://www.drupal.org/developing/modules - * Follow programming best practices: - https://www.drupal.org/developing/best-practices - * Refer to the API documentation: - https://api.drupal.org/api/drupal/8 - * Learn from documented Drupal API examples: - https://www.drupal.org/project/examples - -MORE INFORMATION ----------------- - - * See the Drupal.org online documentation: - https://www.drupal.org/documentation - - * For a list of security announcements, see the "Security advisories" page at - https://www.drupal.org/security (available as an RSS feed). This page also - describes how to subscribe to these announcements via email. - - * For information about the Drupal security process, or to find out how to - report a potential security issue to the Drupal security team, see the - "Security team" page at https://www.drupal.org/security-team - - * For information about the wide range of available support options, visit - https://www.drupal.org and click on Community and Support in the top or - bottom navigation. diff --git a/composer.json b/composer.json index a86ea15a8..8726b1d00 100644 --- a/composer.json +++ b/composer.json @@ -1,68 +1,82 @@ { - "name": "drupal/drupal", - "description": "Drupal is an open source content management platform powering millions of websites and applications.", + "name": "drupal-composer/drupal-project", + "description": "Project template for Drupal 8 projects with composer", "type": "project", "license": "GPL-2.0-or-later", - "require": { - "composer/installers": "^1.0.24", - "wikimedia/composer-merge-plugin": "^1.4", - "drupal/core": "^8.6", - "drupal/console": "^1.7", - "drush/drush": "^9" - }, - "replace": { - }, - "minimum-stability": "dev", - "prefer-stable": true, - "config": { - "preferred-install": "dist", - "autoloader-suffix": "Drupal8" - }, - "extra": { - "_readme": [ - "By default Drupal loads the autoloader from ./vendor/autoload.php.", - "To change the autoloader you can edit ./autoload.php.", - "This file specifies the packages.drupal.org repository.", - "You can read more about this composer repository at:", - "https://www.drupal.org/node/2718229" - ], - "merge-plugin": { - "include": [ - "core/composer.json" - ], - "recurse": true, - "replace": false, - "merge-extra": false - }, - "installer-paths": { - "core": ["type:drupal-core"], - "modules/contrib/{$name}": ["type:drupal-module"], - "profiles/contrib/{$name}": ["type:drupal-profile"], - "themes/contrib/{$name}": ["type:drupal-theme"], - "drush/contrib/{$name}": ["type:drupal-drush"], - "modules/custom/{$name}": ["type:drupal-custom-module"], - "themes/custom/{$name}": ["type:drupal-custom-theme"] + "authors": [ + { + "name": "", + "role": "" } - }, - "autoload": { - "psr-4": { - "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer" - } - }, - "scripts": { - "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump", - "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess", - "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup", - "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup", - "drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit", - "drupal-phpunit-upgrade": "@composer update phpunit/phpunit --with-dependencies --no-progress", - "phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --", - "phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --" - }, + ], "repositories": [ { "type": "composer", "url": "https://packages.drupal.org/8" } - ] + ], + "require": { + "php": ">=5.6", + "composer/installers": "^1.2", + "cweagans/composer-patches": "^1.6.5", + "drupal-composer/drupal-scaffold": "^2.5", + "drupal/console": "^1.0.2", + "drupal/core": "^8.6.0", + "drush/drush": "^9.0.0", + "vlucas/phpdotenv": "^2.4", + "webflo/drupal-finder": "^1.0.0", + "webmozart/path-util": "^2.3", + "zaporylie/composer-drupal-optimizations": "^1.0" + }, + "require-dev": { + "webflo/drupal-core-require-dev": "^8.6.0" + }, + "conflict": { + "drupal/drupal": "*" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "sort-packages": true + }, + "autoload": { + "classmap": [ + "scripts/composer/ScriptHandler.php" + ], + "files": ["load.environment.php"] + }, + "scripts": { + "pre-install-cmd": [ + "DrupalProject\\composer\\ScriptHandler::checkComposerVersion" + ], + "pre-update-cmd": [ + "DrupalProject\\composer\\ScriptHandler::checkComposerVersion" + ], + "post-install-cmd": [ + "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" + ], + "post-update-cmd": [ + "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" + ] + }, + "extra": { + "composer-exit-on-patch-failure": true, + "patchLevel": { + "drupal/core": "-p2" + }, + "installer-paths": { + "web/core": ["type:drupal-core"], + "web/libraries/{$name}": ["type:drupal-library"], + "web/modules/contrib/{$name}": ["type:drupal-module"], + "web/profiles/contrib/{$name}": ["type:drupal-profile"], + "web/themes/contrib/{$name}": ["type:drupal-theme"], + "drush/Commands/{$name}": ["type:drupal-drush"] + }, + "drupal-scaffold": { + "initial": { + ".editorconfig": "../.editorconfig", + ".gitattributes": "../.gitattributes" + } + } + } } diff --git a/composer.lock b/composer.lock index 90f61a73c..1d7bca5c9 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "003af97d41965a633c88def12a0421e9", + "content-hash": "022d72f0e3ad77df10b459fb0c8c90a7", "packages": [ { "name": "alchemy/zippy", @@ -123,24 +123,60 @@ "time": "2017-12-20T14:37:45+00:00" }, { - "name": "chi-teck/drupal-code-generator", - "version": "1.28.0", + "name": "brumann/polyfill-unserialize", + "version": "v1.0.3", "source": { "type": "git", - "url": "https://github.com/Chi-teck/drupal-code-generator.git", - "reference": "a43131309b56a4c1874f39a9eaa4f6cb1a9832cd" + "url": "https://github.com/dbrumann/polyfill-unserialize.git", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/a43131309b56a4c1874f39a9eaa4f6cb1a9832cd", - "reference": "a43131309b56a4c1874f39a9eaa4f6cb1a9832cd", + "url": "https://api.github.com/repos/dbrumann/polyfill-unserialize/zipball/844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "reference": "844d7e44b62a1a3d5c68cfb7ebbd59c17ea0fd7b", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brumann\\Polyfill\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Denis Brumann", + "email": "denis.brumann@sensiolabs.de" + } + ], + "description": "Backports unserialize options introduced in PHP 7.0 to older PHP versions.", + "time": "2017-02-03T09:55:47+00:00" + }, + { + "name": "chi-teck/drupal-code-generator", + "version": "1.29.1", + "source": { + "type": "git", + "url": "https://github.com/Chi-teck/drupal-code-generator.git", + "reference": "f1da0370113ee246cd8f6d744d4835e8d53ea61c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/f1da0370113ee246cd8f6d744d4835e8d53ea61c", + "reference": "f1da0370113ee246cd8f6d744d4835e8d53ea61c", "shasum": "" }, "require": { "ext-json": "*", "php": ">=5.5.9", "symfony/console": "^3.4 || ^4.0", - "symfony/filesystem": "^3.4 || ^4.0", + "symfony/filesystem": "^2.7 || ^3.4 || ^4.0", "twig/twig": "^1.35" }, "bin": [ @@ -165,7 +201,7 @@ "GPL-2.0-or-later" ], "description": "Drupal code generator", - "time": "2019-01-30T10:34:16+00:00" + "time": "2019-04-26T08:30:10+00:00" }, { "name": "composer/installers", @@ -289,16 +325,16 @@ }, { "name": "composer/semver", - "version": "1.4.2", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", "shasum": "" }, "require": { @@ -347,20 +383,20 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2019-03-19T17:25:45+00:00" }, { "name": "consolidation/annotated-command", - "version": "2.11.2", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572" + "reference": "512a2e54c98f3af377589de76c43b24652bcb789" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/004af26391cd7d1cd04b0ac736dc1324d1b4f572", - "reference": "004af26391cd7d1cd04b0ac736dc1324d1b4f572", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/512a2e54c98f3af377589de76c43b24652bcb789", + "reference": "512a2e54c98f3af377589de76c43b24652bcb789", "shasum": "" }, "require": { @@ -443,20 +479,20 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2019-02-02T02:29:53+00:00" + "time": "2019-03-08T16:55:03+00:00" }, { "name": "consolidation/config", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab" + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/11ab7ecd19131ce084390171b9c070eedecf7dab", - "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab", + "url": "https://api.github.com/repos/consolidation/config/zipball/cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", + "reference": "cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1", "shasum": "" }, "require": { @@ -524,7 +560,74 @@ } ], "description": "Provide configuration services for a commandline tool.", - "time": "2019-02-16T01:18:47+00:00" + "time": "2019-03-03T19:37:04+00:00" + }, + { + "name": "consolidation/filter-via-dot-access-data", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/consolidation/filter-via-dot-access-data.git", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/filter-via-dot-access-data/zipball/a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "reference": "a53e96c6b9f7f042f5e085bf911f3493cea823c6", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.5.0" + }, + "require-dev": { + "consolidation/robo": "^1.2.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^5", + "squizlabs/php_codesniffer": "^2.8", + "symfony/console": "^2.8|^3|^4" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Filter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.", + "time": "2019-01-18T06:05:07+00:00" }, { "name": "consolidation/log", @@ -618,16 +721,16 @@ }, { "name": "consolidation/output-formatters", - "version": "3.4.0", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19" + "reference": "0881112642ad9059071f13f397f571035b527cb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/a942680232094c4a5b21c0b7e54c20cce623ae19", - "reference": "a942680232094c4a5b21c0b7e54c20cce623ae19", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0881112642ad9059071f13f397f571035b527cb9", + "reference": "0881112642ad9059071f13f397f571035b527cb9", "shasum": "" }, "require": { @@ -637,11 +740,10 @@ "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "g1a/composer-test-scenarios": "^2", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", "phpunit/phpunit": "^5.7.27", - "satooshi/php-coveralls": "^2", "squizlabs/php_codesniffer": "^2.7", - "symfony/console": "3.2.3", "symfony/var-dumper": "^2.8|^3|^4", "victorjonsson/markdowndocs": "^1.3" }, @@ -650,6 +752,52 @@ }, "type": "library", "extra": { + "scenarios": { + "symfony4": { + "require": { + "symfony/console": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony3": { + "require": { + "symfony/console": "^3.4", + "symfony/finder": "^3.4", + "symfony/var-dumper": "^3.4" + }, + "config": { + "platform": { + "php": "5.6.32" + } + } + }, + "symfony2": { + "require": { + "symfony/console": "^2.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + }, + "scenario-options": { + "create-lockfile": "false" + } + } + }, "branch-alias": { "dev-master": "3.x-dev" } @@ -670,25 +818,25 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2018-10-19T22:35:38+00:00" + "time": "2019-03-14T03:45:44+00:00" }, { "name": "consolidation/robo", - "version": "1.4.6", + "version": "1.4.9", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3" + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", - "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", "shasum": "" }, "require": { "consolidation/annotated-command": "^2.10.2", - "consolidation/config": "^1.0.10", + "consolidation/config": "^1.2", "consolidation/log": "~1", "consolidation/output-formatters": "^3.1.13", "consolidation/self-update": "^1", @@ -778,7 +926,7 @@ } ], "description": "Modern task runner", - "time": "2019-02-17T05:32:27+00:00" + "time": "2019-03-19T18:07:19+00:00" }, { "name": "consolidation/self-update", @@ -832,36 +980,52 @@ }, { "name": "consolidation/site-alias", - "version": "1.1.11", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/consolidation/site-alias.git", - "reference": "54ea74ee7dbd54ef356798028ca9a3548cb8df14" + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/site-alias/zipball/54ea74ee7dbd54ef356798028ca9a3548cb8df14", - "reference": "54ea74ee7dbd54ef356798028ca9a3548cb8df14", + "url": "https://api.github.com/repos/consolidation/site-alias/zipball/8cfd3b6ab6d541086fc970bf850864293b284e6f", + "reference": "8cfd3b6ab6d541086fc970bf850864293b284e6f", "shasum": "" }, "require": { + "consolidation/config": "^1.2.1", "php": ">=5.5.0" }, "require-dev": { "consolidation/robo": "^1.2.3", - "g1a/composer-test-scenarios": "^2", + "g1a/composer-test-scenarios": "^3", "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", "php-http/guzzle6-adapter": "^1.1", - "phpunit/phpunit": "^5", - "satooshi/php-coveralls": "^2", + "phpunit/phpunit": "^6", "squizlabs/php_codesniffer": "^2.8", "symfony/console": "^2.8|^3|^4", "symfony/yaml": "~2.3|^3" }, "type": "library", "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { @@ -884,7 +1048,79 @@ } ], "description": "Manage alias records for local and remote sites.", - "time": "2018-11-03T05:07:56+00:00" + "time": "2019-03-12T17:31:48+00:00" + }, + { + "name": "consolidation/site-process", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/consolidation/site-process.git", + "reference": "8957b9b3f4d48c183b7b11a29089d52875442e2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/site-process/zipball/8957b9b3f4d48c183b7b11a29089d52875442e2f", + "reference": "8957b9b3f4d48c183b7b11a29089d52875442e2f", + "shasum": "" + }, + "require": { + "consolidation/config": "^1.2.1", + "consolidation/site-alias": "^3", + "php": ">=5.6.0", + "symfony/process": "^3.4" + }, + "require-dev": { + "consolidation/robo": "^1.3", + "g1a/composer-test-scenarios": "^3", + "knplabs/github-api": "^2.7", + "php-coveralls/php-coveralls": "^1", + "php-http/guzzle6-adapter": "^1.1", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "type": "library", + "extra": { + "scenarios": { + "phpunit5": { + "require-dev": { + "phpunit/phpunit": "^5.7.27" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.6.33" + } + } + } + }, + "branch-alias": { + "dev-master": "0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\SiteProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Moshe Weitzman", + "email": "weitzman@tejasa.com" + }, + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.", + "time": "2019-04-05T20:16:00+00:00" }, { "name": "container-interop/container-interop", @@ -917,6 +1153,50 @@ "homepage": "https://github.com/container-interop/container-interop", "time": "2017-02-14T19:40:03+00:00" }, + { + "name": "cweagans/composer-patches", + "version": "1.6.5", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "2ec4f00ff5fb64de584c8c4aea53bf9053ecb0b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/2ec4f00ff5fb64de584c8c4aea53bf9053ecb0b3", + "reference": "2ec4f00ff5fb64de584c8c4aea53bf9053ecb0b3", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "time": "2018-05-11T18:00:16+00:00" + }, { "name": "dflydev/dot-access-configuration", "version": "v1.0.3", @@ -1123,35 +1403,35 @@ }, { "name": "doctrine/annotations", - "version": "v1.2.7", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", + "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": ">=5.3.2" + "php": "^5.6 || ^7.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -1187,7 +1467,7 @@ "docblock", "parser" ], - "time": "2015-08-31T12:32:49+00:00" + "time": "2017-02-24T16:22:25+00:00" }, { "name": "doctrine/cache", @@ -1520,6 +1800,50 @@ ], "time": "2014-09-09T13:34:57+00:00" }, + { + "name": "drupal-composer/drupal-scaffold", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/drupal-composer/drupal-scaffold.git", + "reference": "13c1ffc7dd4925cb03707759128b85c0cd6276f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/drupal-composer/drupal-scaffold/zipball/13c1ffc7dd4925cb03707759128b85c0cd6276f8", + "reference": "13c1ffc7dd4925cb03707759128b85c0cd6276f8", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "composer/semver": "^1.4", + "php": "^5.5.9|>=7.0.8" + }, + "require-dev": { + "composer/composer": "dev-master", + "g1a/composer-test-scenarios": "^2.1.0", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^2.8" + }, + "type": "composer-plugin", + "extra": { + "class": "DrupalComposer\\DrupalScaffold\\Plugin", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "DrupalComposer\\DrupalScaffold\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Composer Plugin for updating the Drupal scaffold files when using drupal/core", + "time": "2019-03-30T10:41:38+00:00" + }, { "name": "drupal/console", "version": "1.8.0", @@ -1778,16 +2102,16 @@ }, { "name": "drupal/core", - "version": "8.6.10", + "version": "8.6.15", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "59568ac02948cf075ee8543e6c6d4386ad8daec1" + "reference": "936456cdeac25c6bbd2f55b0d587239c6a81ba86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/59568ac02948cf075ee8543e6c6d4386ad8daec1", - "reference": "59568ac02948cf075ee8543e6c6d4386ad8daec1", + "url": "https://api.github.com/repos/drupal/core/zipball/936456cdeac25c6bbd2f55b0d587239c6a81ba86", + "reference": "936456cdeac25c6bbd2f55b0d587239c6a81ba86", "shasum": "" }, "require": { @@ -1818,9 +2142,9 @@ "symfony-cmf/routing": "^1.4", "symfony/class-loader": "~3.4.0", "symfony/console": "~3.4.0", - "symfony/dependency-injection": "~3.4.0", + "symfony/dependency-injection": "~3.4.26", "symfony/event-dispatcher": "~3.4.0", - "symfony/http-foundation": "~3.4.14", + "symfony/http-foundation": "~3.4.26", "symfony/http-kernel": "~3.4.14", "symfony/polyfill-iconv": "^1.0", "symfony/process": "~3.4.0", @@ -1830,7 +2154,7 @@ "symfony/translation": "~3.4.0", "symfony/validator": "~3.4.0", "symfony/yaml": "~3.4.5", - "twig/twig": "^1.35.0", + "twig/twig": "^1.38.2", "typo3/phar-stream-wrapper": "^2.0.1", "zendframework/zend-diactoros": "^1.1", "zendframework/zend-feed": "^2.4" @@ -2013,42 +2337,43 @@ "GPL-2.0-or-later" ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", - "time": "2019-02-20T18:35:01+00:00" + "time": "2019-04-17T20:00:11+00:00" }, { "name": "drush/drush", - "version": "9.5.2", + "version": "9.6.2", "source": { "type": "git", "url": "https://github.com/drush-ops/drush.git", - "reference": "17f0106706391675a281c6d212850853bdbe90f9" + "reference": "65d36cf542308d0b88f77c80f818a978d2844b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drush-ops/drush/zipball/17f0106706391675a281c6d212850853bdbe90f9", - "reference": "17f0106706391675a281c6d212850853bdbe90f9", + "url": "https://api.github.com/repos/drush-ops/drush/zipball/65d36cf542308d0b88f77c80f818a978d2844b80", + "reference": "65d36cf542308d0b88f77c80f818a978d2844b80", "shasum": "" }, "require": { - "chi-teck/drupal-code-generator": "^1.27.0", + "chi-teck/drupal-code-generator": "^1.28.1", "composer/semver": "^1.4", - "consolidation/annotated-command": "^2.9.1", - "consolidation/config": "^1.1.0", - "consolidation/output-formatters": "^3.1.12", - "consolidation/robo": "^1.1.5", - "consolidation/site-alias": "^1.1.5", + "consolidation/annotated-command": "^2.12", + "consolidation/config": "^1.2", + "consolidation/filter-via-dot-access-data": "^1", + "consolidation/output-formatters": "^3.3.1", + "consolidation/robo": "^1.4.6", + "consolidation/site-alias": "^3.0.0@stable", + "consolidation/site-process": "^2.0.1", "ext-dom": "*", "grasmash/yaml-expander": "^1.1.1", "league/container": "~2", "php": ">=5.6.0", "psr/log": "~1.0", "psy/psysh": "~0.6", - "symfony/config": "^3.4", "symfony/console": "^3.4", "symfony/event-dispatcher": "^3.4", - "symfony/finder": "^3.4", + "symfony/finder": "^3.4 || ^4.0", "symfony/process": "^3.4", - "symfony/var-dumper": "^3.4", + "symfony/var-dumper": "^3.4 || ^4.0", "symfony/yaml": "^3.4", "webflo/drupal-finder": "^1.1", "webmozart/path-util": "^2.1.0" @@ -2057,9 +2382,9 @@ "composer/installers": "^1.2", "cweagans/composer-patches": "~1.0", "drupal/alinks": "1.0.0", - "drupal/devel": "^1.0@RC", + "drupal/devel": "^2", "drupal/empty_theme": "1.0", - "g1a/composer-test-scenarios": "^2.2.0", + "g1a/composer-test-scenarios": "^3", "lox/xhprof": "dev-master", "phpunit/phpunit": "^4.8.36 || ^6.1", "squizlabs/php_codesniffer": "^2.7", @@ -2097,6 +2422,15 @@ "type:drupal-drush" ] }, + "scenarios": { + "php5": { + "config": { + "platform": { + "php": "5.6.38" + } + } + } + }, "branch-alias": { "dev-master": "9.x-dev" } @@ -2104,8 +2438,7 @@ "autoload": { "psr-4": { "Drush\\": "src/", - "Drush\\Internal\\": "internal-copy/", - "Unish\\": "tests/" + "Drush\\Internal\\": "src/internal-forks" } }, "notification-url": "https://packagist.org/downloads/", @@ -2148,7 +2481,7 @@ ], "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.", "homepage": "http://www.drush.org", - "time": "2018-10-17T18:37:53+00:00" + "time": "2019-04-03T11:17:00+00:00" }, { "name": "easyrdf/easyrdf", @@ -2697,16 +3030,16 @@ }, { "name": "masterminds/html5", - "version": "2.5.0", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "b5d892a4bd058d61f736935d32a9c248f11ccc93" + "reference": "c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/b5d892a4bd058d61f736935d32a9c248f11ccc93", - "reference": "b5d892a4bd058d61f736935d32a9c248f11ccc93", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad", + "reference": "c961ca6a0a81dc6b55b6859b3f9ea7f402edf9ad", "shasum": "" }, "require": { @@ -2723,7 +3056,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -2760,7 +3093,7 @@ "serializer", "xml" ], - "time": "2018-12-27T22:03:43+00:00" + "time": "2019-03-10T11:41:28+00:00" }, { "name": "nikic/php-parser", @@ -3173,16 +3506,16 @@ }, { "name": "stecman/symfony-console-completion", - "version": "0.9.0", + "version": "0.10.0", "source": { "type": "git", "url": "https://github.com/stecman/symfony-console-completion.git", - "reference": "bd07a24190541de2828c1d6469a8ddce599d3c5a" + "reference": "bc095febf00aa42ace233b344d4561071d7c912b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/bd07a24190541de2828c1d6469a8ddce599d3c5a", - "reference": "bd07a24190541de2828c1d6469a8ddce599d3c5a", + "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/bc095febf00aa42ace233b344d4561071d7c912b", + "reference": "bc095febf00aa42ace233b344d4561071d7c912b", "shasum": "" }, "require": { @@ -3214,7 +3547,7 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2019-01-19T21:25:25+00:00" + "time": "2019-04-26T12:14:26+00:00" }, { "name": "symfony-cmf/routing", @@ -3277,7 +3610,7 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", @@ -3333,16 +3666,16 @@ }, { "name": "symfony/config", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4" + "reference": "177a276c01575253c95cefe0866e3d1b57637fe0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/c9bc510c217075d42d4a927e285917d0c2001cf4", - "reference": "c9bc510c217075d42d4a927e285917d0c2001cf4", + "url": "https://api.github.com/repos/symfony/config/zipball/177a276c01575253c95cefe0866e3d1b57637fe0", + "reference": "177a276c01575253c95cefe0866e3d1b57637fe0", "shasum": "" }, "require": { @@ -3393,20 +3726,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-01-30T11:33:42+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "symfony/console", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be" + "reference": "15a9104356436cb26e08adab97706654799d31d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", + "reference": "15a9104356436cb26e08adab97706654799d31d8", "shasum": "" }, "require": { @@ -3465,11 +3798,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:42:12+00:00" + "time": "2019-04-08T09:29:13+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3522,16 +3855,16 @@ }, { "name": "symfony/debug", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8" + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", "shasum": "" }, "require": { @@ -3574,20 +3907,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:19:25+00:00" + "time": "2019-04-11T09:48:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1" + "reference": "dee85a9148399cdb2731603802842bcfd8afe5ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1", - "reference": "b514f5b765cf3e4a56e9d8ebacf14b117f7a0ee1", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/dee85a9148399cdb2731603802842bcfd8afe5ab", + "reference": "dee85a9148399cdb2731603802842bcfd8afe5ab", "shasum": "" }, "require": { @@ -3645,20 +3978,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-01-30T17:48:51+00:00" + "time": "2019-04-16T11:13:42+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422" + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/32cb577c07bd900ee883a9d4b55d4098aa02e422", - "reference": "32cb577c07bd900ee883a9d4b55d4098aa02e422", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d40023c057393fb25f7ca80af2a56ed948c45a09", + "reference": "d40023c057393fb25f7ca80af2a56ed948c45a09", "shasum": "" }, "require": { @@ -3702,20 +4035,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b" + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ed5be1663fa66623b3a7004d5d51a14c4045399b", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", "shasum": "" }, "require": { @@ -3765,20 +4098,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-04-02T08:51:52+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d" + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b52454ec66fe5082b7a66a491339d1f1da9a5a0d", - "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", "shasum": "" }, "require": { @@ -3815,20 +4148,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-02-04T21:34:32+00:00" }, { "name": "symfony/finder", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7c0c627220308928e958a87c293108e5891cde1d" + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7c0c627220308928e958a87c293108e5891cde1d", - "reference": "7c0c627220308928e958a87c293108e5891cde1d", + "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98", "shasum": "" }, "require": { @@ -3864,20 +4197,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:43:35+00:00" + "time": "2019-04-02T19:54:57+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05" + "reference": "90454ad44c95d75faf3507d56388056001b74baf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9a81d2330ea255ded06a69b4f7fb7804836e7a05", - "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/90454ad44c95d75faf3507d56388056001b74baf", + "reference": "90454ad44c95d75faf3507d56388056001b74baf", "shasum": "" }, "require": { @@ -3918,20 +4251,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-01-27T09:04:14+00:00" + "time": "2019-04-17T14:51:18+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "dc6bf17684b7120f7bf74fae85c9155506041002" + "reference": "14fa41ccd38570b5e3120a3754bbaa144a15f311" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/dc6bf17684b7120f7bf74fae85c9155506041002", - "reference": "dc6bf17684b7120f7bf74fae85c9155506041002", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/14fa41ccd38570b5e3120a3754bbaa144a15f311", + "reference": "14fa41ccd38570b5e3120a3754bbaa144a15f311", "shasum": "" }, "require": { @@ -4007,20 +4340,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-02-03T12:22:50+00:00" + "time": "2019-04-17T15:57:07+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -4032,7 +4365,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -4065,20 +4398,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "97001cfc283484c9691769f51cdf25259037eba2" + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/97001cfc283484c9691769f51cdf25259037eba2", - "reference": "97001cfc283484c9691769f51cdf25259037eba2", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", + "reference": "f037ea22acfaee983e271dd9c3b8bb4150bd8ad7", "shasum": "" }, "require": { @@ -4090,7 +4423,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -4124,20 +4457,20 @@ "portable", "shim" ], - "time": "2018-09-21T06:26:08+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", "shasum": "" }, "require": { @@ -4149,7 +4482,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -4183,20 +4516,20 @@ "portable", "shim" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" + "reference": "bc4858fb611bda58719124ca079baff854149c89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", - "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89", + "reference": "bc4858fb611bda58719124ca079baff854149c89", "shasum": "" }, "require": { @@ -4206,7 +4539,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -4242,20 +4575,20 @@ "portable", "shim" ], - "time": "2018-09-21T06:26:08+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/process", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a", "shasum": "" }, "require": { @@ -4291,20 +4624,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-04-08T16:15:54+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v1.1.0", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196" + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/53c15a6a7918e6c2ab16ae370ea607fb40cab196", - "reference": "53c15a6a7918e6c2ab16ae370ea607fb40cab196", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a33352af16f78a5ff4f9d90811536abf210df12b", + "reference": "a33352af16f78a5ff4f9d90811536abf210df12b", "shasum": "" }, "require": { @@ -4313,12 +4646,10 @@ "symfony/http-foundation": "^2.3.42 || ^3.4 || ^4.0" }, "require-dev": { - "symfony/phpunit-bridge": "^3.4 || 4.0" + "symfony/phpunit-bridge": "^3.4 || ^4.0" }, "suggest": { - "psr/http-factory-implementation": "To use the PSR-17 factory", - "psr/http-message-implementation": "To use the HttpFoundation factory", - "zendframework/zend-diactoros": "To use the Zend Diactoros factory" + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" }, "type": "symfony-bridge", "extra": { @@ -4329,7 +4660,10 @@ "autoload": { "psr-4": { "Symfony\\Bridge\\PsrHttpMessage\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4350,22 +4684,23 @@ "keywords": [ "http", "http-message", + "psr-17", "psr-7" ], - "time": "2018-08-30T16:28:28+00:00" + "time": "2019-04-03T17:09:40+00:00" }, { "name": "symfony/routing", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646" + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646", - "reference": "62f0b8d8cd2cd359c3caa5a9f5253a4a6d480646", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", + "reference": "ff11aac46d6cb8a65f2855687bb9a1ac9d860eec", "shasum": "" }, "require": { @@ -4388,7 +4723,6 @@ "suggest": { "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" @@ -4429,20 +4763,20 @@ "uri", "url" ], - "time": "2019-01-29T08:47:12+00:00" + "time": "2019-03-29T21:58:42+00:00" }, { "name": "symfony/serializer", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "a897373b86489ddecacc665d15ab32983a519907" + "reference": "14b3221cc41dcfef404205f0060cda873f43a534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/a897373b86489ddecacc665d15ab32983a519907", - "reference": "a897373b86489ddecacc665d15ab32983a519907", + "url": "https://api.github.com/repos/symfony/serializer/zipball/14b3221cc41dcfef404205f0060cda873f43a534", + "reference": "14b3221cc41dcfef404205f0060cda873f43a534", "shasum": "" }, "require": { @@ -4508,20 +4842,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2019-01-26T19:55:54+00:00" + "time": "2019-04-11T05:44:34+00:00" }, { "name": "symfony/translation", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "81cfcd6935cb7505640153576c1f9155b2a179c1" + "reference": "aae26f143da71adc8707eb489f1dc86aef7d376b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/81cfcd6935cb7505640153576c1f9155b2a179c1", - "reference": "81cfcd6935cb7505640153576c1f9155b2a179c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/aae26f143da71adc8707eb489f1dc86aef7d376b", + "reference": "aae26f143da71adc8707eb489f1dc86aef7d376b", "shasum": "" }, "require": { @@ -4538,7 +4872,9 @@ "symfony/config": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/http-kernel": "~3.4|~4.0", "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/var-dumper": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -4576,20 +4912,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:00:44+00:00" + "time": "2019-04-10T16:00:48+00:00" }, { "name": "symfony/validator", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "06af494d8634df6ad9655ec7d80cb61983253912" + "reference": "83da5259779aaf9dde220130e62b785f74e2ac49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/06af494d8634df6ad9655ec7d80cb61983253912", - "reference": "06af494d8634df6ad9655ec7d80cb61983253912", + "url": "https://api.github.com/repos/symfony/validator/zipball/83da5259779aaf9dde220130e62b785f74e2ac49", + "reference": "83da5259779aaf9dde220130e62b785f74e2ac49", "shasum": "" }, "require": { @@ -4661,20 +4997,20 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2019-01-30T09:03:33+00:00" + "time": "2019-04-16T11:21:44+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2159335b452d929cbb9921fc4eb7d1bfed32d0be" + "reference": "f0883812642a6d6583a9e2ae6aec4ba134436f40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2159335b452d929cbb9921fc4eb7d1bfed32d0be", - "reference": "2159335b452d929cbb9921fc4eb7d1bfed32d0be", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f0883812642a6d6583a9e2ae6aec4ba134436f40", + "reference": "f0883812642a6d6583a9e2ae6aec4ba134436f40", "shasum": "" }, "require": { @@ -4730,20 +5066,20 @@ "debug", "dump" ], - "time": "2019-01-29T16:19:17+00:00" + "time": "2019-04-16T13:58:17+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { @@ -4789,20 +5125,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-01-16T10:59:17+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "twig/twig", - "version": "v1.37.1", + "version": "v1.40.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62" + "reference": "35889516bbd6bbe46a600c2c33b03515df4a076e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/66be9366c76cbf23e82e7171d47cbfa54a057a62", - "reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/35889516bbd6bbe46a600c2c33b03515df4a076e", + "reference": "35889516bbd6bbe46a600c2c33b03515df4a076e", "shasum": "" }, "require": { @@ -4817,7 +5153,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.37-dev" + "dev-master": "1.40-dev" } }, "autoload": { @@ -4855,23 +5191,26 @@ "keywords": [ "templating" ], - "time": "2019-01-14T14:59:29+00:00" + "time": "2019-04-29T14:12:28+00:00" }, { "name": "typo3/phar-stream-wrapper", - "version": "v2.0.1", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/TYPO3/phar-stream-wrapper.git", - "reference": "0469d9fefa0146ea4299d3b11cfbb76faa7045bf" + "reference": "b7a21f0859059ed5d9754af8c11f852d43762334" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/0469d9fefa0146ea4299d3b11cfbb76faa7045bf", - "reference": "0469d9fefa0146ea4299d3b11cfbb76faa7045bf", + "url": "https://api.github.com/repos/TYPO3/phar-stream-wrapper/zipball/b7a21f0859059ed5d9754af8c11f852d43762334", + "reference": "b7a21f0859059ed5d9754af8c11f852d43762334", "shasum": "" }, "require": { + "brumann/polyfill-unserialize": "^1.0", + "ext-fileinfo": "*", + "ext-json": "*", "php": "^5.3.3|^7.0" }, "require-dev": { @@ -4895,7 +5234,58 @@ "security", "stream-wrapper" ], - "time": "2018-10-18T08:46:28+00:00" + "time": "2019-03-01T17:43:52+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v2.6.1", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2a7dcf7e3e02dc5e701004e51a6f304b713107d5", + "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "^1.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "http://www.vancelucas.com" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2019-01-29T11:11:52+00:00" }, { "name": "webflo/drupal-finder", @@ -5032,53 +5422,47 @@ "time": "2015-12-17T08:42:14+00:00" }, { - "name": "wikimedia/composer-merge-plugin", - "version": "v1.4.1", + "name": "zaporylie/composer-drupal-optimizations", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/wikimedia/composer-merge-plugin.git", - "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" + "url": "https://github.com/zaporylie/composer-drupal-optimizations.git", + "reference": "173c198fd7c9aefa5e5b68cd755ee63eb0abf7e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", - "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "url": "https://api.github.com/repos/zaporylie/composer-drupal-optimizations/zipball/173c198fd7c9aefa5e5b68cd755ee63eb0abf7e8", + "reference": "173c198fd7c9aefa5e5b68cd755ee63eb0abf7e8", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": ">=5.3.2" + "composer-plugin-api": "^1.1" }, "require-dev": { - "composer/composer": "~1.0.0", - "jakub-onderka/php-parallel-lint": "~0.8", - "phpunit/phpunit": "~4.8|~5.0", - "squizlabs/php_codesniffer": "~2.1.0" + "composer/composer": "^1.6", + "phpunit/phpunit": "^6" }, "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - }, - "class": "Wikimedia\\Composer\\MergePlugin" + "class": "zaporylie\\ComposerDrupalOptimizations\\Plugin" }, "autoload": { "psr-4": { - "Wikimedia\\Composer\\": "src/" + "zaporylie\\ComposerDrupalOptimizations\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-2.0-or-later" ], "authors": [ { - "name": "Bryan Davis", - "email": "bd808@wikimedia.org" + "name": "Jakub Piasecki", + "email": "jakub@piaseccy.pl" } ], - "description": "Composer plugin to merge multiple composer.json files", - "time": "2017-04-25T02:31:25+00:00" + "description": "Composer plugin to improve composer performance for Drupal projects", + "time": "2019-02-20T10:00:17+00:00" }, { "name": "zendframework/zend-diactoros", @@ -5191,16 +5575,16 @@ }, { "name": "zendframework/zend-feed", - "version": "2.11.0", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-feed.git", - "reference": "5248e9fffa760e5c36092aeff02c3797e4a8a690" + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/5248e9fffa760e5c36092aeff02c3797e4a8a690", - "reference": "5248e9fffa760e5c36092aeff02c3797e4a8a690", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/d926c5af34b93a0121d5e2641af34ddb1533d733", + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733", "shasum": "" }, "require": { @@ -5231,8 +5615,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" } }, "autoload": { @@ -5250,7 +5634,7 @@ "feed", "zf" ], - "time": "2019-01-29T21:37:15+00:00" + "time": "2019-03-05T20:08:49+00:00" }, { "name": "zendframework/zend-stdlib", @@ -5587,16 +5971,16 @@ }, { "name": "drupal/coder", - "version": "8.3.1", + "version": "8.3.3", "source": { "type": "git", "url": "https://git.drupal.org/project/coder.git", - "reference": "29a25627e7148b3119c84f18e087fc3b8c85b959" + "reference": "a33d3388fb2e1d94bd2aee36a8ff79186e9d8f43" }, "require": { "ext-mbstring": "*", - "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.0.1", + "php": ">=5.5.9", + "squizlabs/php_codesniffer": "^3.4.1", "symfony/yaml": ">=2.0.0" }, "require-dev": { @@ -5606,7 +5990,7 @@ "autoload": { "psr-0": { "Drupal\\": "coder_sniffer/Drupal/", - "DrupalPractice\\": "coder_sniffer/Drupal/" + "DrupalPractice\\": "coder_sniffer/DrupalPractice/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5620,7 +6004,7 @@ "phpcs", "standards" ], - "time": "2018-09-21T14:22:49+00:00" + "time": "2019-04-16T18:56:06+00:00" }, { "name": "fabpot/goutte", @@ -5853,16 +6237,16 @@ }, { "name": "mikey179/vfsStream", - "version": "v1.6.5", + "version": "v1.6.6", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", "shasum": "" }, "require": { @@ -5895,7 +6279,7 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2017-08-01T08:02:14+00:00" + "time": "2019-04-08T13:54:32+00:00" }, { "name": "myclabs/deep-copy", @@ -7213,16 +7597,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { @@ -7255,25 +7639,25 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-12-19T23:57:18+00:00" + "time": "2019-04-10T23:49:02+00:00" }, { "name": "symfony/browser-kit", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471" + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/884689e5d29fc3c48498a0038e96d60e4f91b471", - "reference": "884689e5d29fc3c48498a0038e96d60e4f91b471", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/7f2b0843d5045468225f9a9b27a0cb171ae81828", + "reference": "7f2b0843d5045468225f9a9b27a0cb171ae81828", "shasum": "" }, "require": { @@ -7317,20 +7701,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-01-16T09:39:14+00:00" + "time": "2019-04-06T19:33:58+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "6a2148bfc6ca0016846a32bdc55a317274283709" + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/6a2148bfc6ca0016846a32bdc55a317274283709", - "reference": "6a2148bfc6ca0016846a32bdc55a317274283709", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/a43a2f6c465a2d99635fea0addbebddc3864ad97", + "reference": "a43a2f6c465a2d99635fea0addbebddc3864ad97", "shasum": "" }, "require": { @@ -7340,7 +7724,6 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "suggest": { - "ext-zip": "Zip support is required when using bin/simple-phpunit", "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, "bin": [ @@ -7383,20 +7766,20 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2019-01-30T13:30:37+00:00" + "time": "2019-04-16T09:03:16+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", "shasum": "" }, "require": { @@ -7423,32 +7806,53 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2019-04-04T09:56:43+00:00" + }, + { + "name": "webflo/drupal-core-require-dev", + "version": "8.6.15", + "source": { + "type": "git", + "url": "https://github.com/webflo/drupal-core-require-dev.git", + "reference": "6b3d632fa16e56858706fe0394eafe88a13a9cd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webflo/drupal-core-require-dev/zipball/6b3d632fa16e56858706fe0394eafe88a13a9cd0", + "reference": "6b3d632fa16e56858706fe0394eafe88a13a9cd0", + "shasum": "" + }, + "require": { + "behat/mink": "1.7.x-dev", + "behat/mink-goutte-driver": "^1.2", + "behat/mink-selenium2-driver": "1.3.x-dev", + "drupal/coder": "^8.2.12", + "drupal/core": "8.6.15", + "jcalderonzumba/gastonjs": "^1.0.2", + "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", + "mikey179/vfsstream": "^1.2", + "phpspec/prophecy": "^1.7", + "phpunit/phpunit": "^4.8.35 || ^6.5", + "symfony/css-selector": "^3.4.0", + "symfony/debug": "^3.4.0", + "symfony/phpunit-bridge": "^3.4.3" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "require-dev dependencies from drupal/core", + "time": "2019-04-17T20:31:37+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "behat/mink": 20, - "behat/mink-selenium2-driver": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { - "ext-date": "*", - "ext-dom": "*", - "ext-filter": "*", - "ext-gd": "*", - "ext-hash": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-pdo": "*", - "ext-session": "*", - "ext-simplexml": "*", - "ext-spl": "*", - "ext-tokenizer": "*", - "ext-xml": "*", - "php": "^5.5.9|>=7.0.8" + "php": ">=5.6" }, "platform-dev": [] } diff --git a/core/.env.example b/core/.env.example deleted file mode 100644 index 13c5a7867..000000000 --- a/core/.env.example +++ /dev/null @@ -1,77 +0,0 @@ -# This is a dotenv file used by JavaScript tasks. -# Copy this to '.env' to override. - -############################# -# General Test Environment # -############################# -# This is the URL that Drupal can be accessed by. You don't need an installed -# site here, just make sure you can at least access the installer screen. If you -# don't already have one running, e.g. Apache, you can use PHP's built-in web -# server by running the following command in your Drupal root folder: -# php -S localhost:8888 .ht.router.php -# DRUPAL_TEST_BASE_URL=http://localhost:8888 -DRUPAL_TEST_BASE_URL= - -# Tests need to be executed with a user in the same group as the web server -# user. -#DRUPAL_TEST_WEBSERVER_USER=www-data - -# By default we use sqlite as database. Use -# mysql://username:password@localhost/databasename#table_prefix for mysql. -DRUPAL_TEST_DB_URL=sqlite://localhost/sites/default/files/db.sqlite - -############# -# Webdriver # -############# - -# If Chromedriver is running as a service elsewhere, set it here. -# When using DRUPAL_TEST_CHROMEDRIVER_AUTOSTART leave this at the default settings. -DRUPAL_TEST_WEBDRIVER_HOSTNAME=localhost -DRUPAL_TEST_WEBDRIVER_PORT=9515 - -# If using Selenium, override the path prefix here. -# See http://nightwatchjs.org/gettingstarted#browser-drivers-setup -#DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub - -################ -# Chromedriver # -################ - -# Automatically start chromedriver for local development. Set to false when you -# use your own webdriver or chromedriver setup. -# Also set it to false when you use a different browser for testing. -DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=true - -# A list of arguments to pass to Chrome, separated by spaces -# e.g. `--disable-gpu --headless --no-sandbox`. -#DRUPAL_TEST_WEBDRIVER_CHROME_ARGS= - -############## -# Nightwatch # -############## - -# Nightwatch generates output files. Use this to specify the location where these -# files need to be stored. The default location is ignored by git, if you modify -# the location you will probably want to add this location to your .gitignore. -DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch - -# The path that Nightwatch searches for assumes the same directory structure as -# when you download Drupal core. If you have Drupal installed into a docroot -# folder, you can use the following folder structure to add integration tests -# for your project, outside of tests specifically for custom modules/themes/profiles. -# -# . -# ├── docroot -# │ ├── core -# ├── tests -# │ ├── Nightwatch -# │ │ ├── Tests -# │ │ │ ├── myTest.js -# -# and then set DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../ -# -#DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY= - -# Filter directories to look for tests. This uses minimatch syntax. -# Separate folders with a comma. -DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest diff --git a/core/.eslintignore b/core/.eslintignore deleted file mode 100644 index 21c8a024f..000000000 --- a/core/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -assets/vendor/**/* -node_modules/**/* -**/js_test_files/**/* -*.js -!*.es6.js -modules/locale/tests/locale_test.es6.js -!tests/Drupal/Nightwatch/**/*.js diff --git a/core/.eslintrc.json b/core/.eslintrc.json deleted file mode 100644 index e3d505cad..000000000 --- a/core/.eslintrc.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "extends": [ - "airbnb", - "plugin:prettier/recommended" - ], - "root": true, - "env": { - "browser": true, - "es6": true, - "node": true - }, - "globals": { - "Drupal": true, - "drupalSettings": true, - "drupalTranslations": true, - "domready": true, - "jQuery": true, - "_": true, - "matchMedia": true, - "Backbone": true, - "Modernizr": true, - "CKEDITOR": true - }, - "rules": { - "prettier/prettier": "error", - "consistent-return": ["off"], - "no-underscore-dangle": ["off"], - "max-nested-callbacks": ["warn", 3], - "import/no-mutable-exports": ["warn"], - "no-plusplus": ["warn", { - "allowForLoopAfterthoughts": true - }], - "no-param-reassign": ["off"], - "no-prototype-builtins": ["off"], - "valid-jsdoc": ["warn", { - "prefer": { - "returns": "return", - "property": "prop" - }, - "requireReturn": false - }], - "no-unused-vars": ["warn"], - "operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }] - } -} diff --git a/core/.eslintrc.legacy.json b/core/.eslintrc.legacy.json deleted file mode 100644 index f9dbd5b66..000000000 --- a/core/.eslintrc.legacy.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "extends": "eslint:recommended", - "root": true, - "env": { - "browser": true - }, - "globals": { - "Drupal": true, - "drupalSettings": true, - "drupalTranslations": true, - "domready": true, - "jQuery": true, - "_": true, - "matchMedia": true, - "Backbone": true, - "Modernizr": true, - "CKEDITOR": true - }, - "rules": { - "array-bracket-spacing": ["error", "never"], - "block-scoped-var": "error", - "brace-style": ["error", "stroustrup", {"allowSingleLine": true}], - "comma-dangle": ["error", "never"], - "comma-spacing": "error", - "comma-style": ["error", "last"], - "computed-property-spacing": ["error", "never"], - "curly": ["error", "all"], - "eol-last": "error", - "eqeqeq": ["error", "smart"], - "guard-for-in": "error", - "indent": ["error", 2, {"SwitchCase": 1}], - "key-spacing": ["error", {"beforeColon": false, "afterColon": true}], - "keyword-spacing": ["error", {"before": true, "after": true}], - "linebreak-style": ["error", "unix"], - "lines-around-comment": ["error", {"beforeBlockComment": true, "afterBlockComment": false}], - "new-parens": "error", - "no-array-constructor": "error", - "no-caller": "error", - "no-catch-shadow": "error", - "no-eval": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-parens": ["error", "functions"], - "no-implied-eval": "error", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-loop-func": "error", - "no-multi-spaces": "error", - "no-multi-str": "error", - "no-native-reassign": "error", - "no-nested-ternary": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-wrappers": "error", - "no-octal-escape": "error", - "no-process-exit": "error", - "no-proto": "error", - "no-return-assign": "error", - "no-script-url": "error", - "no-sequences": "error", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-undefined": "error", - "no-unused-expressions": "error", - "no-unused-vars": ["error", {"vars": "all", "args": "none"}], - "no-with": "error", - "object-curly-spacing": ["error", "never"], - "one-var": ["error", "never"], - "quote-props": ["error", "consistent-as-needed"], - "quotes": ["error", "single", "avoid-escape"], - "semi": ["error", "always"], - "semi-spacing": ["error", {"before": false, "after": true}], - "space-before-blocks": ["error", "always"], - "space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}], - "space-in-parens": ["error", "never"], - "space-infix-ops": "error", - "space-unary-ops": ["error", { "words": true, "nonwords": false }], - "spaced-comment": ["error", "always"], - "strict": ["error", "function"], - "yoda": ["error", "never"], - "max-nested-callbacks": ["warn", 3], - "valid-jsdoc": ["warn", { - "prefer": { - "returns": "return", - "property": "prop" - }, - "requireReturn": false - }] - } -} diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json deleted file mode 100644 index 5e4223224..000000000 --- a/core/.eslintrc.passing.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "./.eslintrc.json", - "rules": { - "no-shadow": "off", - "no-new": "off", - "no-continue": "off", - "new-cap": "off", - "max-len": "off", - "default-case": "off", - "prefer-destructuring": "off", - "react/no-this-in-sfc": "off", - "react/destructuring-assignment": "off", - "import/named": "off" - } -} diff --git a/core/.gitignore b/core/.gitignore deleted file mode 100644 index 6b71af77a..000000000 --- a/core/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# Ignore node_modules folder created when installing core's JavaScript -# dependencies. -node_modules -yarn-error.log - -# Ignore overrides of core's phpcs.xml.dist and phpunit.xml.dist. -phpcs.xml -phpunit.xml - -# Ignore package-lock.json that is automatically created when adding -# dependencies by users of NPMv5. -package-lock.json - -# Ignore test reports -reports - -# Ignore local Nightwatch settings -nightwatch.settings.json - -# Ignore dotenv -.env diff --git a/core/.prettierignore b/core/.prettierignore deleted file mode 100644 index 2e0da403d..000000000 --- a/core/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -modules/locale/tests/locale_test.es6.js diff --git a/core/.prettierrc.json b/core/.prettierrc.json deleted file mode 100644 index c06cd1fd0..000000000 --- a/core/.prettierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "printWidth": 80, - "semi": true, - "singleQuote": true, - "trailingComma": "all" -} diff --git a/core/.stylelintrc.json b/core/.stylelintrc.json deleted file mode 100644 index 87d152953..000000000 --- a/core/.stylelintrc.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "extends": "stylelint-config-standard", - "plugins": [ - "stylelint-no-browser-hacks/lib" - ], - "rules": { - "comment-empty-line-before": null, - "function-linear-gradient-no-nonstandard-direction": null, - "function-whitespace-after": null, - "no-descending-specificity": null, - "no-duplicate-selectors": null, - "no-unknown-animations": true, - "media-feature-name-no-unknown": [true, { - "ignoreMediaFeatureNames": [ - "prefers-reduced-motion", - "min--moz-device-pixel-ratio" - ] - }], - "number-leading-zero": "always", - "plugin/no-browser-hacks": [true, { - "browsers": [ - "ie >= 9", - "edge >= 13", - "firefox >= 5", - "opera >= 12", - "safari >= 5", - "chrome >= 56" - ] - }], - "property-no-unknown": null, - "rule-empty-line-before": null, - "selector-pseudo-element-colon-notation": null, - "shorthand-property-no-redundant-values": null, - "unit-whitelist": ["deg", "em", "ex", "ms", "rem", "%", "s", "px", "vw", "vh"] - }, - "ignoreFiles": [ - "assets/vendor/**/*.css", - "tests/Drupal/Tests/Core/Asset/css_test_files/**/*.css" - ] -} diff --git a/drush/Commands/PolicyCommands.php b/drush/Commands/PolicyCommands.php new file mode 100644 index 000000000..290b4e033 --- /dev/null +++ b/drush/Commands/PolicyCommands.php @@ -0,0 +1,38 @@ +input()->getArgument('target') == '@prod') { + throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__])); + } + } + + /** + * Limit rsync operations to production site. + * + * @hook validate core:rsync + * + * @throws \Exception + */ + public function rsyncValidate(CommandData $commandData) { + if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) { + throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__])); + } + } +} diff --git a/drush/README.md b/drush/README.md new file mode 100644 index 000000000..9d7bd397a --- /dev/null +++ b/drush/README.md @@ -0,0 +1 @@ +This directory contains commands, configuration and site aliases for Drush. See https://packagist.org/search/?type=drupal-drush for a directory of Drush commands installable via Composer. diff --git a/drush/drush.yml b/drush/drush.yml new file mode 100644 index 000000000..a8cbd0073 --- /dev/null +++ b/drush/drush.yml @@ -0,0 +1,6 @@ +# +# A Drush configuration file +# +# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml +# +# Edit or remove this file as needed. diff --git a/drush/sites/self.site.yml b/drush/sites/self.site.yml new file mode 100644 index 000000000..fda719409 --- /dev/null +++ b/drush/sites/self.site.yml @@ -0,0 +1,14 @@ +# Edit or remove this file as needed. +# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.site.yml + +#prod: +# host: prod.domain.com +# user: www-admin +# root: /path/to/drupal +# uri: http://www.example.com +# +#stage: +# host: stage.domain.com +# user: www-admin +# root: /path/to/drupal +# uri: http://stage.example.com diff --git a/example.gitignore b/example.gitignore deleted file mode 100644 index d1e35ac00..000000000 --- a/example.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# This file contains default .gitignore rules. To use it, copy it to .gitignore, -# and it will cause files like your settings.php and user-uploaded files to be -# excluded from Git version control. This is a common strategy to avoid -# accidentally including private information in public repositories and patch -# files. -# -# Because .gitignore can be specific to your site, this file has a different -# name; updating Drupal core will not override your custom .gitignore file. - -# Ignore core when managing all of a project's dependencies with Composer -# including Drupal core. -# core - -# Core's dependencies are managed with Composer. -vendor - -# Ignore configuration files that may contain sensitive information. -sites/*/settings*.php -sites/*/services*.yml - -# Ignore paths that contain user-generated content. -sites/*/files -sites/*/private - -# Ignore SimpleTest multi-site environment. -sites/simpletest - -# If you prefer to store your .gitignore file in the sites/ folder, comment -# or delete the previous settings and uncomment the following ones, instead. - -# Ignore configuration files that may contain sensitive information. -# */settings*.php - -# Ignore paths that contain user-generated content. -# */files -# */private - -# Ignore SimpleTest multi-site environment. -# simpletest diff --git a/load.environment.php b/load.environment.php new file mode 100644 index 000000000..769343fd6 --- /dev/null +++ b/load.environment.php @@ -0,0 +1,20 @@ +load(); +} +catch (InvalidPathException $e) { + // Do nothing. Production environments rarely use .env files. +} diff --git a/modules/README.txt b/modules/README.txt deleted file mode 100644 index 529c31b2b..000000000 --- a/modules/README.txt +++ /dev/null @@ -1,42 +0,0 @@ -Modules extend your site functionality beyond Drupal core. - -WHAT TO PLACE IN THIS DIRECTORY? --------------------------------- - -Placing downloaded and custom modules in this directory separates downloaded and -custom modules from Drupal core's modules. This allows Drupal core to be updated -without overwriting these files. - -DOWNLOAD ADDITIONAL MODULES ---------------------------- - -Contributed modules from the Drupal community may be downloaded at -https://www.drupal.org/project/project_module. - -ORGANIZING MODULES IN THIS DIRECTORY ------------------------------------- - -You may create subdirectories in this directory, to organize your added modules, -without breaking the site. Some common subdirectories include "contrib" for -contributed modules, and "custom" for custom modules. Note that if you move a -module to a subdirectory after it has been enabled, you may need to clear the -Drupal cache so it can be found. - -There are number of directories that are ignored when looking for modules. These -are 'src', 'lib', 'vendor', 'assets', 'css', 'files', 'images', 'js', 'misc', -'templates', 'includes', 'fixtures' and 'Drupal'. - -MULTISITE CONFIGURATION ------------------------ - -In multisite configurations, modules found in this directory are available to -all sites. You may also put modules in the sites/all/modules directory, and the -versions in sites/all/modules will take precedence over versions of the same -module that are here. Alternatively, the sites/your_site_name/modules directory -pattern may be used to restrict modules to a specific site instance. - -MORE INFORMATION ----------------- - -Refer to the “Developing for Drupal” section of the README.txt in the Drupal -root directory for further information on extending Drupal with custom modules. diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 000000000..ce29746d7 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,15 @@ + + + + + + ./test/ + + + diff --git a/profiles/README.txt b/profiles/README.txt deleted file mode 100644 index b0f0c0bac..000000000 --- a/profiles/README.txt +++ /dev/null @@ -1,28 +0,0 @@ -Installation profiles define additional steps that run after the base -installation of Drupal is completed. They may also offer additional -functionality and change the behavior of the site. - -WHAT TO PLACE IN THIS DIRECTORY? --------------------------------- - -Place downloaded and custom installation profiles in this directory. -Note that installation profiles are generally provided as part of a Drupal -distribution. - -DOWNLOAD ADDITIONAL DISTRIBUTIONS ---------------------------------- - -Contributed distributions from the Drupal community may be downloaded at -https://www.drupal.org/project/project_distribution. - -MULTISITE CONFIGURATION ------------------------ - -In multisite configurations, installation profiles found in this directory are -available to all sites during their initial site installation. - -MORE INFORMATION ----------------- - -Refer to the "Installation profiles" section of the README.txt in the Drupal -root directory for further information on extending Drupal with custom profiles. diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php new file mode 100644 index 000000000..e7c84f412 --- /dev/null +++ b/scripts/composer/ScriptHandler.php @@ -0,0 +1,100 @@ +locateRoot(getcwd()); + $drupalRoot = $drupalFinder->getDrupalRoot(); + + $dirs = [ + 'modules', + 'profiles', + 'themes', + ]; + + // Required for unit testing + foreach ($dirs as $dir) { + if (!$fs->exists($drupalRoot . '/'. $dir)) { + $fs->mkdir($drupalRoot . '/'. $dir); + $fs->touch($drupalRoot . '/'. $dir . '/.gitkeep'); + } + } + + // Prepare the settings file for installation + if (!$fs->exists($drupalRoot . '/sites/default/settings.php') and $fs->exists($drupalRoot . '/sites/default/default.settings.php')) { + $fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php'); + require_once $drupalRoot . '/core/includes/bootstrap.inc'; + require_once $drupalRoot . '/core/includes/install.inc'; + $settings['config_directories'] = [ + CONFIG_SYNC_DIRECTORY => (object) [ + 'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot), + 'required' => TRUE, + ], + ]; + drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php'); + $fs->chmod($drupalRoot . '/sites/default/settings.php', 0666); + $event->getIO()->write("Created a sites/default/settings.php file with chmod 0666"); + } + + // Create the files directory with chmod 0777 + if (!$fs->exists($drupalRoot . '/sites/default/files')) { + $oldmask = umask(0); + $fs->mkdir($drupalRoot . '/sites/default/files', 0777); + umask($oldmask); + $event->getIO()->write("Created a sites/default/files directory with chmod 0777"); + } + } + + /** + * Checks if the installed version of Composer is compatible. + * + * Composer 1.0.0 and higher consider a `composer install` without having a + * lock file present as equal to `composer update`. We do not ship with a lock + * file to avoid merge conflicts downstream, meaning that if a project is + * installed with an older version of Composer the scaffolding of Drupal will + * not be triggered. We check this here instead of in drupal-scaffold to be + * able to give immediate feedback to the end user, rather than failing the + * installation after going through the lengthy process of compiling and + * downloading the Composer dependencies. + * + * @see https://github.com/composer/composer/pull/5035 + */ + public static function checkComposerVersion(Event $event) { + $composer = $event->getComposer(); + $io = $event->getIO(); + + $version = $composer::VERSION; + + // The dev-channel of composer uses the git revision as version number, + // try to the branch alias instead. + if (preg_match('/^[0-9a-f]{40}$/i', $version)) { + $version = $composer::BRANCH_ALIAS_VERSION; + } + + // If Composer is installed through git we have no easy way to determine if + // it is new enough, just display a warning. + if ($version === '@package_version@' || $version === '@package_branch_alias_version@') { + $io->writeError('You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.'); + } + elseif (Comparator::lessThan($version, '1.0.0')) { + $io->writeError('Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing.'); + exit(1); + } + } + +} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/CHANGELOG.txt b/sites/all/modules/contrib/admin/admin_toolbar/CHANGELOG.txt deleted file mode 100644 index 5fea31ee3..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/CHANGELOG.txt +++ /dev/null @@ -1,382 +0,0 @@ -Admin Toolbar 8.x-1.25, 2018-11-22 ----------------------------------- -Changes since 8.x-1.24: - -- #3012102 by tikaszvince, Jody Lynn, adriancid, grahl, jigarius: Provider - property missing on link definition. -- #3010451 by epowelljr, adriancid: Improve the admin_toolbar module - description. -- #2958415 by adriancid, romainj, Prashant.c, harshita29: Replace usages of the - deprecated drupal_set_message() function. -- #2996485 by idebr, adriancid: Remove unused function - admin_toolbar_tools_get_links(). -- #2989281 by JKerschner, adriancid: Consistently use $entityTypeManager. -- #2985106 by Eli-T, adriancid, eme: Add ability to hide Drupal.org links - exposed by admin_toolbar_tools from certain users. -- #2938884 by Spurlos, bdanin, romainj, purdy_nc, adriancid: A non-existent - route breaks the site. - -Admin Toolbar 8.x-1.24, 2018-05-28 ----------------------------------- -Changes since 8.x-1.23: - -- #2973131 by adriancid: Don't refer to Drupal in the help page. -- #2975170 by adriancid: Add composer.json file to submodules. -- #2975165 by Gamewalker, adriancid: datetime.time services is not found in - ToolbarController. -- #2971466 by recrit, adriancid, acbramley: Add media links incorrectly set to - "node.add.". -- #2972553 by dww, adriancid: Add static cache to speed up - admin_toolbar_links_access_filter_user_has_admin_role(). -- #2971435 by adriancid: Module help page for Admin Toolbar Extra Tools module - doesn't show the links. -- #2971398 by adriancid: Add the docblock to the ToolbarController constructor. -- #2969686 by adriancid, Vidushi Mehta: Add a menu link to clean the twig cache. -- #2969325 by adriancid: Fix the module version in the CHANGELOG.txt. -- #2961450 by adriancid: Convert the AdminToolbarAlterTest test class to - PHPUnit. -- #2961445 by adriancid: Convert the AdminToolbarToolsAlterTest test class to - PHPUnit. -- #2959684 by adriancid: Remove recommended modules section from README.txt. -- #2959647 by adriancid: Use interfaces instead of classes to inject - dependencies. -- #2952643 by romainj, if-jds, adriancid: Add Item for Files under Content Menu. -- #2944463 by adriancid: Update the composer.json file. - -Admin Toolbar 8.x-1.23, 2018-02-06 ----------------------------------- -Changes since 8.x-1.22: - -- #2924266 by sunlix, romainj, adriancid, samerali: Add a menu link for the - media module. -- #2941184 by daniel.nitsche, adriancid: Remove unwanted comment from - admin.toolbar.css. -- #2912503 by Amsteri, m.abdulqader: Right to left language direction support. -- #2937982 by romainj, adriancid: Auto-generation of menu links conflicts with - other modules. -- #2932873 by vaplas, saravanaprasanth, adriancid: Horizontal mode only works if - the page is loaded in horizontal mode. -- #2935311 by romainj, adriancid: Use the $entityTypeManager variable instead of - the \Drupal::entityTypeManager service. -- #2935449 by adriancid: Add the release information for the 1.22 version in the - CHANGELOG.txt. -- #2932476 by romainj: toolbar.tree library should have a dependency to the - core/drupal library. -- #2931503 by K3vin_nl: Admin toolbar generates invalid class names. - -Admin Toolbar 8.x-1.22, 2018-01-02 ----------------------------------- -Changes since 8.x-1.21: - -- #2929053 by kkuhnen, eme, adriancid: admin_toolbar.js should use Drupal - behaviors. -- #2929061 by romainj, dsnopek, adriancid: admin_toolbar_links_access_filter - doesn't do anything unless admin_toolbar is enabled. -- #2928836 by eme: One extra pixel line under the admin toolbar. -- #2925501 by eme, adriancid, RumyanaRuseva: Menu does not take changes into - account (caching issue). -- #2927914 by adriancid: Parameter comment indentation must be 3 spaces. -- #2927911 by adriancid: Remove unused variables. -- #2927905 by adriancid: All dependencies must be prefixed with the project - name. -- #2925327 by Berdir, adriancid: Better check for is-link-in-admin-menu for - local task links. -- #2922046 by mikejw, adriancid, Berdir, BrianLewisDesign: Notice: Undefined - index: entity.eform_type.collection in - admin_toolbar_tools_menu_links_discovered_alter. -- #2925128 by adriancid: Create the module help page for the Admin Toolbar Links - Access Filter submodule. - -Admin Toolbar 8.x-1.21, 2017-11-20 ----------------------------------- -Changes since 8.x-1.20: - -- #2923580 by sylus, adriancid: Unsupported operand types in - ToolbarHandler::lazyBuilder(). -- #2731369 by stefan.r, DuneBL, Berdir, kbasarab, joachim, adriancid: Local - tasks don't show in the toolbar. -- #2920793 by adriancid: Change the user TAKTAK by matio89 in the CHANGELOG.txt - file. -- #2873228 by smustgrave, adriancid, flocondetoile: Toolbar menu accessible and - navigable with keyboard. -- #2919775 by adriancid: Create the CHANGELOG.txt file. -- #2919772 by adriancid: Use the README.txt template. -- #2919769 by adriancid: Use the README.txt template for the admin_toolbar_tools - submodule. -- #2897309 by finne, adriancid, eme, rgpublic: admin_toolbar_tools module - makes all pages uncacheable. -- #2913299 by esod, Chi, adriancid, hudri, eme: CSS Z-Index of toolbar is - inappropriate. -- #2919390 by adriancid: Create the README.txt file for the admin toolbar links - access filter submodule. -- #2919367 by adriancid: Fix coding standard format. -- #2919346 by adriancid: Don't show menu links that you don't have access - permission for. -- #2917710: Create the .info.yml file for the admin_toolbar_links_access_filter - submodule. -- #2916064 by adriancid, eme, finne: Use in drupal.org links url parameter and - not route_name. -- #2916040 by adriancid, finne, eme: Remove unused route admin_development. -- #2915778 by finne, adriancid: Remove the _csrf_token from routes that don't - need it. -- #2909359 by adriancid, Musa.thomas: Add a menu link to clean the Views cache. -- #2910931 by adriancid: .info.yml files don't have the drupal version. -- #2759135 by Johnny vd Laar, miiimooo, romainj, chegor, adriancid, ckaotik, - bdominguez, SpadXIII, mrtndlmt: Content type, Vocabularies and Menus names are - not translated. -- #2909710 by adriancid, Musa.thomas: Fix coding standard format. -- #2910934 by adriancid, romainj: Error trying to clean the cache. -- #2910892 by adriancid: Delete the LICENSE.txt. -- #2909637 by bapi_22, Musa.thomas, adriancid: Avoid static call inside class - method. -- #2909003 by eme: fix z-index for CKEditor. -- #2504449 by robin.ingelbrecht, rwam, eme: Un-hover delay. - -Admin Toolbar 8.x-1.20, 2017-09-07 ----------------------------------- -Changes since 8.x-1.19: - -- #2887439 by romainj: Fix test. -- #2759135 by Johnny vd Laar, miiimooo, chegor, romainj: Content type, - Vocabularies and Menus names are not translated. -- #2894520 by romainj, bapi_22: Remove deprecated constant REQUEST_TIME from - code base. -- #2883098 by romainj, Alka Kumari: Admin Toolbar Extra Tools module display - theme machine names instead of labels. -- #2504449 by robin.ingelbrecht: Un-hover delay. -- #2838636 by ddrozdik, Fons Vandamme, kerby70, romainj: Issue with z-index of - dropdown in horizontal tray. -- #2838636 by Fons Vandamme, ddrozdik, romainj: Issue with z-index of dropdown - in horizontal tray. -- #2870404 by romainj: Add a link to the Webprofiler settings page. -- #2706643 by esod, romainj, Keenegan, DamienMcKenna: Use short array syntax. - -Admin Toolbar 8.x-1.19, 2017-04-06 ----------------------------------- -Changes since 8.x-1.18: - -- #2706643 by esod, romainj, Keenegan, DamienMcKenna: Use short array syntax. -- #2781745 by minakshiPh, eelkeblok, romainj, akhilavnair_zyxware: Drupal coding - standard issues found in most of the files. -- #2855720 by stefan.r, romainj: No logout link in admin toolbar anymore. -- #2841512 by Chi, romainj: User error: Redirects to external URLs are not - allowed by default. - -Admin Toolbar 8.x-1.18, 2016-12-01 ----------------------------------- -Changes since 8.x-1.17: - -- #2830677 by vaplas, romainj: z-index for sub menu. -- by romainj: Get rid of the Hello popup. -- #2805431 by marcusx: Accidentaly committed alert. -- #2630724 by squarecandy, romainj, reblutus, Hemangi Gokhale, jacoferg, - Balu Ertl, Jeff Burnz, Don Greco: Consider changes to link title parameter to - avoid tooltip visual conflict. -- #2518202 by james.williams, chegor, eme, romainj, DuneBL: Change default link - to taxonomy. - -Admin Toolbar 8.x-1.17, 2016-08-19 ----------------------------------- -Changes since 8.x-1.16: - -- #2779251 by romainj, DuneBL: Wrong integration of field_collection delete - form. -- #2776229 by Chi, romainj, mattlt: Chevron icons missing if Drupal is not in - document root. -- by romainj: CSS coding standard cleaning. -- #2781059 by mstrelan, romainj: Why is CRON in all caps? -- #2778935 by akhilavnair_zyxware, rjarraud: As per Drupal Standards each line - in documentation should not exceeds 80 characters. -- by romainj: Adds ending new line where required. -- #2776229 by Chi, rjarraud: Chevron icons missing if Drupal is not in document - root. -- by eme: Commiting again #2707611. -- #2757687 by neerajsingh: Remove usages of \Drupal::url(). -- #2707747 by Balu Ertl, nevergone, eme, esod: D8 logo not rendered with smooth - antialiasing. - -Admin Toolbar 8.x-1.16, 2016-07-28 ----------------------------------- -Changes since 8.x-1.15: - -- #2723209 by andrewmacpherson, colan, mattshoaf: Enabling admin_toolbar_tools - causes Devel Settings to disappear from the main configuration page. -- #2759335 bycwells, jalpesh: fixes a mistaken link in hook_help(). -- #2664564 by kolier, matio89, romainj and Michèle: auto-detect content entities - with Field UI route. -- #2735257 by colan, romainj, Balu Ertl: respect of coding standards in the - module README.txt file. -- #2735257 by colan, romainj, Balu Ertl: shortens the module README.txt - description text. -- by romainj: Fixes a problem with the link to the Admin menu overview page. -- #2735257 by Balu Ertl, colan, romainj: improves Admin Toolbar Extra Tools - description in the README.txt file. -- #2723381 by joachim, romainj: fieldable content entities are no more - hardcoded. -- #2735257 by Balu Ertl, colan, romainj: added some description details in the - README.txt files. -- by romainj: Menu link definitions updated. -- by romainj: Change routing permissions to follow Drupal default permissions - for administration pages. -- by romainj: Fixes issue #2737027. -- by romainj: fixes issue #2701825. -- by romainj: Adds the menu name for each menu item in - admin_toolbar_tools/admin_toolbar_tools.links.menu.yml file. -- #2735153 by Kionn: InvalidArgumentException: Cannot redirect to an empty URL. - в Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl(). -- by matio89: correction InvalidArgumentException: Cannot redirect to an empty - URL. в Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl(). -- by romainj: Add a new Render Cache shortcut on the admin menu. -- by romainj: Fixes issue #2731663 by canceling the move of the Logout menu - link. - -Admin Toolbar 8.x-1.15, 2016-05-23 ----------------------------------- -Changes since 8.x-1.14: - -- by matio89: add RTL in admin.toolbar.css. -- by romainj: Changes Devel menu item titles. -- by romainj: Fixes issue #2713899. -- by romainj: Minor code/typo cleaning. -- #2707611 by Balu Ertl: Add fine shadow under dropdown menus. -- #2707789 by esod: Fix Automated Tests. -- by romainj: Code cleaning. -- by romainj: Replace the deprecated entityManager() by entityTypeManager() - service. -- by romainj: Emptying menu cache with all link types. -- #2614962 by dbt102, seppelM, neha.gangwar, chegor: Correct text in - info.yml(s). -- by eme: Minor typo changes. -- by eme: Fix dependencies to core modules. -- by eme: Fix issue #2666964. -- by eme: Fix css background color level3. -- by eme: fix issue #2658896 and refactor and fix chevron-right.svg. -- by eme: fix Issue #2493037. - -Admin Toolbar 8.x-1.14, 2016-02-08 ----------------------------------- -Changes since 8.x-1.13: - -- by matio89: Correction differents bugs(problem white page when installing a - new module). -- #2643648 by Lord_of_Codes: Proposed README.txt file for Admin Toolbar. -- by matio89: resolving the dependecies problem(dependencies of others modules). -- by matio89: Correction route of entities. - -Admin Toolbar 8.x-1.13, 2016-02-02 ----------------------------------- -Changes since 8.x-1.12: - -- by matio89: Admin toolbar is compatible with 8.0.2. -- by matio89: Commmit dev version compatible with drupal 8.0.2. -- by matio89: New version of admin toolbar compatible with 8.0.2. - -Admin Toolbar 8.x-1.12, 2016-01-15 ----------------------------------- -Changes since 8.x-1.11: - -- by matio89: Correction AdminToolbaToolsAlterTest. -- #2493037 by mimran: Empty elements in #toolbar-bar. -- #2598136 by mimran, felribeiro: Menu items duplicated. -- #2635154 by Lukas von Blarer: Too general CSS selectors. -- by eme: Fix chevron right in local state. - -Admin Toolbar 8.x-1.11, 2015-12-11 ----------------------------------- -Changes since 8.x-1.10: - -- #2620430 by Vagelis, NarendraR: Typo. -- #2632888 by JamesK: Add dependency on node module. -- by eme: Fix admin toolbar test. -- #2552081 by jonhattan, bruvers: chevron-right.svg not found. -- by Vagelis: Minor typos. -- by eme: Refactor basic tests. -- #2613378 by chegor: Add basic test. -- #2612694 by chegor: Add new view. -- #2627918 by joe_carvajal: Version in info.yml files does Update Manager try to - update. -- by matio89: correction collapsible behaviour in vertical menu layout. -- #2582825 by Ben Coleman: Installing Admin Toolbar Tools loses anonymous user - login link. -- by matio89: Correction the login link on the site when in a logged-out state. - -Admin Toolbar 8.x-1.10, 2015-08-07 ----------------------------------- -Changes since 8.x-1.9: - -- #2546939 by jonhattan: Add dependency on toolbar module. - -Admin Toolbar 8.x-1.9, 2015-07-22 ---------------------------------- -Changes since 8.x-1.8: - -- #2537016 by matio89: Removing dependance for user & system. -- #2533420 by Dave Reid, twistor: Chase HEAD changes in toolbar. -- #2537016 by twistor: Rewrite admin_toolbar_tools.module -- by matio89: Correction all bugs and add new security features. - -Admin Toolbar 8.x-1.8, 2015-06-22 ---------------------------------- -Changes since 8.x-1.7: - -- correction not found route. -- #2493037 by bobrov1989: Empty elements in #toolbar-bar. -- by fethi: icones. - -Admin Toolbar 8.x-1.7, 2015-06-22 ---------------------------------- -Changes since 8.x-1.6: - -- correction not found route. -- #2493037 by bobrov1989: Empty elements in #toolbar-bar. -- by fethi: icones. - -Admin Toolbar 8.x-1.6, 2015-06-03 ---------------------------------- -Changes since 8.x-1.5: - -- by matio89: correction admin_toolbar. - -Admin Toolbar 8.x-1.5, 2015-06-03 ---------------------------------- -Changes since 8.x-1.4: - -- by matio89: test if module update exist or no to display install and update - module. -- by fethi: Change the colors used to match the Seven styleguide. -- by matio89: compatibility with Drupal 8 béta 11. -- by fethi: Change the colors used to match the Seven styleguide. - -Admin Toolbar 8.x-1.4, 2015-05-20 ---------------------------------- -Changes since 8.x-1.3: - -- by matio89: correction add/node. - -Admin Toolbar 8.x-1.3, 2015-05-19 ---------------------------------- -Changes since 8.x-1.2: - -- by matio89: add new functionalities. -- by matio89: add administration devel link. -- by matio89: correction reload page. -- by matio89: correction redirect to the same page. - -Admin Toolbar 8.x-1.2, 2015-05-19 ---------------------------------- -Changes since 8.x-1.1: - -- by matio89: add new functionalities. -- by matio89: add administration devel link. -- by matio89: correction reload page. -- by matio89: correction redirect to the same page. - -Admin Toolbar 8.x-1.1, 2015-05-19 ---------------------------------- -Changes since 8.x-1.0: - -- by matio89: add new functionalities. - -Admin Toolbar 8.x-1.0, 2015-05-07 ---------------------------------- -- Initial release. diff --git a/sites/all/modules/contrib/admin/admin_toolbar/README.txt b/sites/all/modules/contrib/admin/admin_toolbar/README.txt deleted file mode 100644 index 459cc2ca9..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/README.txt +++ /dev/null @@ -1,69 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Requirements - * Recommended modules - * Installation - * Configuration - * Maintainers - - -INTRODUCTION ------------- - -Admin Toolbar intends to improve the default Drupal Toolbar to transform it into -a drop-down menu, providing a fast and full access to all administration links. - - * For a full description of the module, visit the project page: - https://www.drupal.org/project/admin_toolbar - - * To submit bug reports and feature suggestions, or to track changes: - https://www.drupal.org/project/issues/search/admin_toolbar - - -REQUIREMENTS ------------- - -No special requirements. - - -RECOMMENDED MODULES -------------------- - - * Admin Toolbar Extra Tools (https://www.drupal.org/project/admin_toolbar): - Provides menu links to administration pages or actions (eg. Flushing caches) - that are not generated by Drupal core. - - * Admin Toolbar Links Access Filter (https://www.drupal.org/node/2474539): - Provides a workaround for the common problem that users with - 'Use the administration pages and help' permission see menu links they don't - have access permission for. - -INSTALLATION ------------- - - * Install as you would normally install a contributed Drupal module. - See: https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -No configuration is needed. - - -MAINTAINERS ------------ - -Current maintainers: - * Wilfrid Roze (eme) - https://www.drupal.org/u/eme - * Romain Jarraud (romainj) - https://www.drupal.org/u/romainj - * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid - * Mohamed Anis Taktak (matio89) - https://www.drupal.org/u/matio89 - -This project has been sponsored by: - * emerya - Founded in 2009, emerya is a human-sized company, dedicated to the design and - implementation of web interfaces. Visit: http://http://emerya.fr/ for more - information. diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.info.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.info.yml deleted file mode 100644 index 2e6857e41..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Admin Toolbar -description: Provides an improved drop-down menu interface to the site Toolbar. -package: Administration - -type: module -# core: 8.x - -dependencies: - - drupal:toolbar - -# Information added by Drupal.org packaging script on 2019-02-03 -version: '8.x-1.26' -core: '8.x' -project: 'admin_toolbar' -datestamp: 1549218484 diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.install b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.install deleted file mode 100644 index bd80e9a06..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.install +++ /dev/null @@ -1,16 +0,0 @@ -rebuild(); -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.libraries.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.libraries.yml deleted file mode 100644 index 85b322a4e..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.libraries.yml +++ /dev/null @@ -1,10 +0,0 @@ -toolbar.tree: - css: - theme: - css/admin.toolbar.css: {} - js: - js/jquery.hoverIntent.js: {} - js/admin_toolbar.js: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.module b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.module deleted file mode 100644 index c8ee104da..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar.module +++ /dev/null @@ -1,97 +0,0 @@ - Url::fromRoute('help.page', ['name' => 'toolbar'])->toString(), - ':automated_cron' => (\Drupal::moduleHandler()->moduleExists('automated_cron')) ? Url::fromRoute('help.page', ['name' => 'automated_cron'])->toString() : '#', - ]; - - $output = ''; - $output .= '

' . t('About') . '

'; - $output .= '

' . t('The Admin Toolbar module enhances the Toolbar module by providing fast access to all the administrative links at the top of your site. Admin Toolbar remains a very "lightweight" module by closely integrating with all Toolbar functionality. It can be used in conjunction with all the sub modules included on Admin Toolbar, for quick access to system commands such as Flush all caches, Run cron, Run Updates, etc.', $variables) . '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '

' . t('The Admin Toolbar greatly improves the user experience for those who regularly interact with the site Toolbar by providing fast, full access to all links in the site Toolbar without having to click to get there.') . '

'; - - return $output; - } -} - -/** - * Renders the toolbar's administration tray. - * - * This is a clone of core's toolbar_prerender_toolbar_administration_tray() - * function, which uses setMaxDepth(4) instead of setTopLevelOnly(). - * - * @param array $element - * A renderable array. - * - * @return array - * The updated renderable array. - * - * @see toolbar_prerender_toolbar_administration_tray() - */ -function admin_toolbar_prerender_toolbar_administration_tray(array $element) { - $menu_tree = \Drupal::service('toolbar.menu_tree'); - $parameters = new MenuTreeParameters(); - $parameters->setRoot('system.admin')->excludeRoot()->setMaxDepth(4)->onlyEnabledLinks(); - $tree = $menu_tree->load(NULL, $parameters); - $manipulators = [ - ['callable' => 'menu.default_tree_manipulators:checkAccess'], - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - ['callable' => 'toolbar_tools_menu_navigation_links'], - ]; - $tree = $menu_tree->transform($tree, $manipulators); - $element['administration_menu'] = $menu_tree->build($tree); - - return $element; -} - -/** - * Adds toolbar-specific attributes to the menu link tree. - * - * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree - * The menu link tree to manipulate. - * - * @return \Drupal\Core\Menu\MenuLinkTreeElement[] - * The manipulated menu link tree. - */ -function toolbar_tools_menu_navigation_links(array $tree) { - foreach ($tree as $element) { - if ($element->subtree) { - toolbar_tools_menu_navigation_links($element->subtree); - } - $link = $element->link; - - // Get the non-localized title to make the icon class. - $definition = $link->getPluginDefinition(); - - $element->options['attributes']['class'][] = 'toolbar-icon'; - $string = strtolower(str_replace(['.', ' ', '_'], ['-', '-', '-'], $definition['id'])); - $element->options['attributes']['class'][] = Html::cleanCssIdentifier('toolbar-icon-' . $string); - $element->options['attributes']['title'] = $link->getDescription(); - } - return $tree; -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt deleted file mode 100644 index 37670cf49..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt +++ /dev/null @@ -1,53 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Requirements - * Installation - * Configuration - * Maintainers - - -INTRODUCTION ------------- - -The Admin Toolbar Links Access Filter module Provides a workaround for the -common problem that users with 'Use the administration pages and help' -permission see menu links they don't have access permission for. Once the issue -https://www.drupal.org/node/296693 be solved, this module will be deprecated. - - * To know why we create this module check this issue: - https://www.drupal.org/node/2917704 - - * To submit bug reports and feature suggestions, or to track changes: - https://www.drupal.org/project/issues/search/admin_toolbar - - -REQUIREMENTS ------------- - -This module requires the following modules: - - * Admin Toolbar (https://www.drupal.org/project/admin_toolbar) - - -INSTALLATION ------------- - - * Install as you would normally install a contributed Drupal module. - See: https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -No configuration is needed. - - -MAINTAINERS ------------ - -Current maintainers: - * Wilfrid Roze (eme) - https://www.drupal.org/u/eme - * Romain Jarraud (romainj) - https://www.drupal.org/u/romainj - * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml deleted file mode 100644 index 7e743e26c..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Admin Toolbar Links Access Filter -description: Provides a workaround for the common problem that users with 'Use the administration pages and help' permission see menu links they don't have access permission for. Once the issue https://www.drupal.org/node/296693 be solved, this module will be deprecated. -package: Administration - -type: module -# core: 8.x - -dependencies: - - admin_toolbar:admin_toolbar - -# Information added by Drupal.org packaging script on 2019-02-03 -version: '8.x-1.26' -core: '8.x' -project: 'admin_toolbar' -datestamp: 1549218484 diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module deleted file mode 100644 index d9930e07b..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module +++ /dev/null @@ -1,200 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Admin Toolbar Links Access Filter module provides a workaround for the common problem that users with Use the administration pages and help permission see menu links they done not have access permission for.') . '

'; - - return $output; - } -} - -/** - * Implements hook_preprocess_menu(). - * - * Hides links from admin menu, if user doesn't have access rights. - */ -function admin_toolbar_links_access_filter_preprocess_menu(&$variables) { - if (empty($variables['items'])) { - // Additional empty check to prevent exotic situations, where the preprocess - // function is entered even without items. - // @see https://www.drupal.org/node/2833885 - return; - } - // Ensure that menu_name exists. - if (!isset($variables['menu_name'])) { - // In rare cases (for unknown reasons) menu_name may not be set. - // As fallback, we can fetch it from the first menu item. - $first_link = reset($variables['items']); - /** @var Drupal\Core\Menu\MenuLinkDefault $original_link */ - // Fetch the menu_name from the original link. - $original_link = $first_link['original_link']; - $variables['menu_name'] = $original_link->getMenuName(); - } - if ($variables['menu_name'] == 'admin') { - if (!admin_toolbar_links_access_filter_user_has_admin_role($variables['user'])) { - admin_toolbar_links_access_filter_filter_non_accessible_links($variables['items']); - } - } -} - -/** - * Hides links from admin menu, if user doesn't have access rights. - */ -function admin_toolbar_links_access_filter_filter_non_accessible_links(array &$items) { - foreach ($items as $route => &$item) { - $route_name = $route; - $route_params = []; - if (!empty($item['original_link'])) { - /** @var \Drupal\Core\Menu\MenuLinkBase $original_link */ - $original_link = $item['original_link']; - if ($original_link->getUrlObject()->isExternal()) { - // Do not filter external URL at all. - continue; - } - $route_name = $original_link->getRouteName(); - $route_params = $original_link->getRouteParameters(); - } - - // Check, if user has access rights to the route. - if (!\Drupal::accessManager()->checkNamedRoute($route_name, $route_params)) { - unset($items[$route]); - } - else { - if (!empty($items[$route]['below'])) { - // Recursively call this function for the child items. - admin_toolbar_links_access_filter_filter_non_accessible_links($items[$route]['below']); - } - if (empty($items[$route]['below']) && \Drupal::moduleHandler()->moduleExists('admin_toolbar')) { - - // Every child item has been cleared out. - // Now check, if the given route represents an overview page only, - // without having functionality on its own. In this case, we can safely - // unset this item, as there aren't any children left. - // This assumption is only valid, when the admin_toolbar module is - // installed because otherwise we won't have child items at all. - if (admin_toolbar_links_access_filter_is_overview_page($route)) { - unset($items[$route]); - } - else { - // Let's remove the expanded flag. - $items[$route]['is_expanded'] = FALSE; - } - } - } - } -} - -/** - * Implements template_preprocess_admin_block_content(). - */ -function admin_toolbar_links_access_filter_admin_block_content(&$variables) { - if (!admin_toolbar_links_access_filter_user_has_admin_role($variables['user'])) { - foreach ($variables['content'] as $key => &$item) { - if (isset($item['url']) && $item['url'] instanceof Url) { - /* @var \Drupal\Core\Url $url */ - $url = $item['url']; - if ($url->access()) { - continue; - } - unset($variables['content'][$key]); - } - - // The key is structured in the form: "ID title route", - // concatenated with spaces. - $key_parts = explode(' ', $key); - $route = end($key_parts); - - // Special handling for Views pages, as they are not defined - // system routes. - // @TODO check the permission for Views + find a generic way for similar - // cases. Best way would be to get the link entity somehow to properly - // check permissions. - if (strpos($route, 'views_view:') === 0) { - continue; - } - - // Check, if user has access rights to the route. - if (!\Drupal::accessManager()->checkNamedRoute($route)) { - unset($variables['content'][$key]); - } - } - } -} - -/** - * Checks if the given route name is an overview page. - * - * Checks if the given route name matches a pure (admin) overview page that can - * be skipped, if there are no child items set. The typical example are routes - * having the SystemController::systemAdminMenuBlockPage() function as their - * controller callback set. - * - * @param string $route_name - * The route name to check. - * - * @return bool - * TRUE, if the given route name matches a pure admin overview page route, - * FALSE otherwise. - */ -function admin_toolbar_links_access_filter_is_overview_page($route_name) { - // @var \Drupal\Core\Routing\RouteProviderInterface $route_provider. - $route_provider = \Drupal::service('router.route_provider'); - $overview_page_controllers = [ - '\Drupal\system\Controller\AdminController::index', - '\Drupal\system\Controller\SystemController::overview', - '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage', - ]; - try { - $route = $route_provider->getRouteByName($route_name); - $controller = $route->getDefault('_controller'); - return !empty($controller) && in_array($controller, $overview_page_controllers); - } - catch (RouteNotFoundException $ex) { - - } - return FALSE; -} - -/** - * Checks, if the given user has admin rights. - * - * @param \Drupal\Core\Session\AccountInterface $account - * The account to check. - * - * @return bool - * TRUE, if the given user account has at least one role with admin rights - * assigned, FALSE otherwise. - */ -function admin_toolbar_links_access_filter_user_has_admin_role(AccountInterface $account) { - static $user_has_admin_role = []; - $uid = $account->id(); - if (!isset($user_has_admin_role[$uid])) { - $roles = Role::loadMultiple($account->getRoles()); - foreach ($roles as $role) { - if ($role->isAdmin()) { - $user_has_admin_role[$uid] = TRUE; - break; - } - $user_has_admin_role[$uid] = FALSE; - } - } - return $user_has_admin_role[$uid]; -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json deleted file mode 100644 index d75f3b0c6..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "drupal/admin_toolbar_links_access_filter", - "description": "Provides a workaround for the common problem that users with 'Use the administration pages and help' permission see menu links they don't have access permission for. Once the issue https://www.drupal.org/node/296693 be solved, this module will be deprecated.", - "type": "drupal-module", - "keywords": ["Drupal", "Toolbar"], - "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Wilfrid Roze (eme)", - "homepage": "https://www.drupal.org/u/eme", - "role": "Maintainer" - }, - { - "name": "Romain Jarraud (romainj)", - "homepage": "https://www.drupal.org/u/romainj", - "role": "Maintainer" - }, - { - "name": "Adrian Cid Almaguer (adriancid)", - "email": "adriancid@gmail.com", - "homepage": "https://www.drupal.org/u/adriancid", - "role": "Maintainer" - }, - { - "name": "Mohamed Anis Taktak (matio89)", - "homepage": "https://www.drupal.org/u/matio89", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" - }, - "require": { - "drupal/admin_toolbar": "^1" - } -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt deleted file mode 100644 index 263cde93c..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt +++ /dev/null @@ -1,62 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Requirements - * Recommended modules - * Installation - * Configuration - * Maintainers - - -INTRODUCTION ------------- - -Admin Toolbar Extra Tools provides menu links to administration pages or actions -(eg. Flushing caches) that are not generated by Drupal core. It adds menu items -that are not generated by Drupal core. For example there are no menu items for -each content type by default or menu links to Manage fields on each entity -types. That's the purpose of Admin Toolbar Extra Tools to add them. - - * For a full description of the module, visit the project page: - https://www.drupal.org/project/admin_toolbar - - * To submit bug reports and feature suggestions, or to track changes: - https://www.drupal.org/project/issues/search/admin_toolbar - - -REQUIREMENTS ------------- - -This module requires the following modules: - - * Admin Toolbar (https://www.drupal.org/project/admin_toolbar) - - -INSTALLATION ------------- - - * Install as you would normally install a contributed Drupal module. - See: https://www.drupal.org/node/895232 for further information. - - -CONFIGURATION -------------- - -No configuration is needed. - - -MAINTAINERS ------------ - -Current maintainers: - * Wilfrid Roze (eme) - https://www.drupal.org/u/eme - * Romain Jarraud (romainj) - https://www.drupal.org/u/romainj - * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid - * Mohamed Anis Taktak (matio89) - https://www.drupal.org/u/matio89 - -This project has been sponsored by: - * emerya - Founded in 2009, emerya is a human-sized company, dedicated to the design and - implementation of web interfaces. Visit: http://http://emerya.fr/ for more - information. diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml deleted file mode 100644 index d94726473..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Admin Toolbar Extra Tools -description: Adds menu links to the Admin Toolbar. -package: Administration - -type: module -# core: 8.x - -dependencies: - - admin_toolbar:admin_toolbar - - drupal:system (>=8.5) - -# Information added by Drupal.org packaging script on 2019-02-03 -version: '8.x-1.26' -core: '8.x' -project: 'admin_toolbar' -datestamp: 1549218484 diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml deleted file mode 100644 index 94afa9f57..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml +++ /dev/null @@ -1,4 +0,0 @@ -toolbar.icon: - css: - theme: - css/tools.css: {} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml deleted file mode 100644 index e39dbe940..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml +++ /dev/null @@ -1,76 +0,0 @@ -admin_toolbar_tools.help: - title: 'Tools' - route_name: - menu_name: admin - parent: system.admin - weight: -100 - -system.admin_index: - title: 'Index' - route_name: system.admin_index - menu_name: admin - parent: admin_toolbar_tools.help - weight: -100 - -system.run_cron: - title: 'Run cron' - route_name: admin_toolbar.run.cron - menu_name: admin - parent: admin_toolbar_tools.help - weight: -8 - -system.db_update: - title: 'Run updates' - route_name: system.db_update - menu_name: admin - parent: admin_toolbar_tools.help - weight: -6 - -system.modules_uninstall: - title: 'Uninstall module' - route_name: system.modules_uninstall - menu_name: admin - parent: system.modules_list - -admin_toolbar_tools.flush: - title: 'Flush all caches' - route_name: admin_toolbar_tools.flush - weight: -9 - parent: admin_toolbar_tools.help - menu_name: admin - -admin_toolbar_tools.cssjs: - title: 'Flush CSS and Javascript' - route_name: admin_toolbar_tools.cssjs - parent: admin_toolbar_tools.flush - menu_name: admin - -admin_toolbar_tools.plugin: - title: 'Flush plugins cache' - route_name: admin_toolbar_tools.plugin - parent: admin_toolbar_tools.flush - menu_name: admin - -admin_toolbar_tools.flush_static: - title: 'Flush static cache' - route_name: admin_toolbar_tools.flush_static - parent: admin_toolbar_tools.flush - menu_name: admin - -admin_toolbar_tools.flush_menu: - title: 'Flush routing and links cache' - route_name: admin_toolbar_tools.flush_menu - parent: admin_toolbar_tools.flush - menu_name: admin - -admin_toolbar_tools.flush_twig: - title: 'Flush twig cache' - route_name: admin_toolbar_tools.flush_twig - parent: admin_toolbar_tools.flush - menu_name: admin - -admin_toolbar_tools.flush_rendercache: - title: 'Flush render cache' - route_name: admin_toolbar_tools.flush_rendercache - parent: admin_toolbar_tools.flush - menu_name: admin diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module deleted file mode 100644 index cd56261ec..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module +++ /dev/null @@ -1,702 +0,0 @@ - 'toolbar_item', - 'tab' => [ - '#type' => 'link', - '#attributes' => [ - 'class' => ['toolbar-icon', 'toolbar-icon-admin-toolbar-tools-help'], - ], - ], - '#attached' => ['library' => ['admin_toolbar_tools/toolbar.icon']], - ]; - - return $items; -} - -/** - * Implements hook_help(). - */ -function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'help.page.admin_toolbar_tools': - $output = ''; - $output .= '

'; - $output .= t('The Admin Toolbar Extra Tools module comes packaged with the Admin Toolbar module and adds functionality to it. The additional functionality is accessed thru extra links on the main administration Toolbar. Some links to Admin Toolbar Extra Tools administration pages are located at the bottom of this page.', [':admin-toolbar' => Url::fromRoute('help.page', ['name' => 'admin_toolbar'])->toString()]); - $output .= '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '

' . t('To use Admin Toolbar Extra Tools just install it like any other module. There is no other configuration required.') . '

'; - - return $output; - } -} - -/** - * Implements hook_menu_links_discovered_alter(). - */ -function admin_toolbar_tools_menu_links_discovered_alter(&$links) { - $languageManager = \Drupal::languageManager(); - $config_override_language = $languageManager->getConfigOverrideLanguage(); - $languageManager->setConfigOverrideLanguage($languageManager->getLanguage('en')); - - $moduleHandler = \Drupal::moduleHandler(); - $entityTypeManager = \Drupal::entityTypeManager(); - $routeProvider = \Drupal::service('router.route_provider'); - - /** - * Determine if a route exists by name. - * - * @param $routeName - * The name of the route to check. - * - * @return bool - * Whether a route with that route name exists. - */ - $routeExists = function ($routeName) use ($routeProvider) { - return (count($routeProvider->getRoutesByNames([$routeName])) === 1); - }; - - $entityTypes = $entityTypeManager->getDefinitions(); - $content_entities = []; - foreach ($entityTypes as $key => $entityType) { - if ($entityType->getBundleEntityType() && ($entityType->get('field_ui_base_route') != '')) { - $content_entities[$key] = [ - 'content_entity' => $key, - 'content_entity_bundle' => $entityType->getBundleEntityType(), - ]; - } - } - - // Adding a menu link to clean the Views cache. - if ($moduleHandler->moduleExists('views')) { - $links['admin_toolbar_tools.flush_views'] = [ - 'title' => t('Flush views cache'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'admin_toolbar_tools.flush_views', - 'menu_name' => 'admin', - 'parent' => 'admin_toolbar_tools.flush', - ]; - // Adding a menu link to Files. - if ($moduleHandler->moduleExists('file') && $routeExists('view.files.page_1')) { - $links['admin_toolbar_tools.view.files'] = [ - 'title' => t('Files'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'view.files.page_1', - 'menu_name' => 'admin', - 'parent' => 'system.admin_content', - ]; - } - } - - // Adds common links to entities. - foreach ($content_entities as $entities) { - $content_entity_bundle = $entities['content_entity_bundle']; - $content_entity = $entities['content_entity']; - foreach ($entityTypeManager->getStorage($content_entity_bundle)->loadMultiple() as $machine_name => $bundle) { - // Normally, the edit form for the bundle would be its root link. - $content_entity_bundle_root = NULL; - if ($routeExists('entity.' . $content_entity_bundle . '.overview_form')) { - // Some bundles have an overview/list form that make a better root link. - $content_entity_bundle_root = 'entity.' . $content_entity_bundle . '.overview_form.' . $machine_name; - $links[$content_entity_bundle_root] = [ - 'title' => t($bundle->label()), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.' . $content_entity_bundle . '.overview_form', - 'menu_name' => 'admin', - 'parent' => 'entity.' . $content_entity_bundle . '.collection', - 'route_parameters' => [$content_entity_bundle => $machine_name], - ]; - } - if ($routeExists('entity.' . $content_entity_bundle . '.edit_form')) { - $key = 'entity.' . $content_entity_bundle . '.edit_form.' . $machine_name; - $links[$key] = [ - 'title' => t($bundle->label()), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.' . $content_entity_bundle . '.edit_form', - 'menu_name' => 'admin', - 'parent' => 'entity.' . $content_entity_bundle . '.collection', - 'route_parameters' => [$content_entity_bundle => $machine_name], - ]; - if (empty($content_entity_bundle_root)) { - $content_entity_bundle_root = $key; - } - else { - $links[$key]['parent'] = $content_entity_bundle_root; - $links[$key]['title'] = t('Edit'); - } - } - if ($moduleHandler->moduleExists('field_ui')) { - if ($routeExists('entity.' . $content_entity . '.field_ui_fields')) { - $links['entity.' . $content_entity . '.field_ui_fields' . $machine_name] = [ - 'title' => t('Manage fields'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.' . $content_entity . '.field_ui_fields', - 'menu_name' => 'admin', - 'parent' => $content_entity_bundle_root, - 'route_parameters' => [$content_entity_bundle => $machine_name], - 'weight' => 1, - ]; - } - if ($routeExists('entity.entity_form_display.' . $content_entity . '.default')) { - $links['entity.entity_form_display.' . $content_entity . '.default' . $machine_name] = [ - 'title' => t('Manage form display'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.entity_form_display.' . $content_entity . '.default', - 'menu_name' => 'admin', - 'parent' => $content_entity_bundle_root, - 'route_parameters' => [$content_entity_bundle => $machine_name], - 'weight' => 2, - ]; - } - if ($routeExists('entity.entity_view_display.' . $content_entity . '.default')) { - $links['entity.entity_view_display.' . $content_entity . '.default.' . $machine_name] = [ - 'title' => t('Manage display'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.entity_view_display.' . $content_entity . '.default', - 'menu_name' => 'admin', - 'parent' => $content_entity_bundle_root, - 'route_parameters' => [$content_entity_bundle => $machine_name], - 'weight' => 3, - ]; - } - } - if ($moduleHandler->moduleExists('devel') && $routeExists('entity.' . $content_entity_bundle . '.devel_load')) { - $links['entity.' . $content_entity_bundle . '.devel_load.' . $machine_name] = [ - 'title' => t('Devel'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.' . $content_entity_bundle . '.devel_load', - 'menu_name' => 'admin', - 'parent' => $content_entity_bundle_root, - 'route_parameters' => [$content_entity_bundle => $machine_name], - 'weight' => 4, - ]; - } - if ($routeExists('entity.' . $content_entity_bundle . '.delete_form')) { - $links['entity.' . $content_entity_bundle . '.delete_form.' . $machine_name] = [ - 'title' => t('Delete'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.' . $content_entity_bundle . '.delete_form', - 'menu_name' => 'admin', - 'parent' => $content_entity_bundle_root, - 'route_parameters' => [$content_entity_bundle => $machine_name], - 'weight' => 5, - ]; - } - } - } - - // Add user links. - $links['user.admin_create'] = [ - 'title' => t('Add a new user'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'user.admin_create', - 'menu_name' => 'admin', - 'parent' => 'entity.user.collection', - ]; - $links['user.admin_permissions'] = [ - 'title' => t('Permissions'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'user.admin_permissions', - 'menu_name' => 'admin', - 'parent' => 'entity.user.collection', - ]; - $links['entity.user_role.collection'] = [ - 'title' => t('Roles'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.user_role.collection', - 'menu_name' => 'admin', - 'parent' => 'entity.user.collection', - ]; - $links['admin_toolbar_tools.user.logout'] = [ - 'title' => t('Logout'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'user.logout', - 'parent' => 'admin_toolbar_tools.help', - 'weight' => 10, - ]; - $links['user.role_add'] = [ - 'title' => t('Add a new role'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'user.role_add', - 'menu_name' => 'admin', - 'parent' => 'entity.user_role.collection', - 'weight' => -5, - ]; - if ($moduleHandler->moduleExists('field_ui')) { - $links['entity.user.field_ui_fields_'] = [ - 'title' => t('Manage fields'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.user.field_ui_fields', - 'menu_name' => 'admin', - 'parent' => 'entity.user.admin_form', - ]; - $links['entity.entity_form_display.user.default_'] = [ - 'title' => t('Manage form display'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.entity_form_display.user.default', - 'menu_name' => 'admin', - 'parent' => 'entity.user.admin_form', - ]; - $links['entity.entity_view_display.user.default_'] = [ - 'title' => t('Manage display'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.entity_view_display.user.default', - 'menu_name' => 'admin', - 'parent' => 'entity.user.admin_form', - ]; - } - foreach (user_roles() as $role) { - $links['entity.user_role.edit_form.' . $role->id()] = [ - 'title' => t($role->label()), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.user_role.edit_form', - 'menu_name' => 'admin', - 'parent' => 'entity.user_role.collection', - 'route_parameters' => ['user_role' => $role->id()], - ]; - $links['entity.user_role.edit_permissions_form.' . $role->id()] = [ - 'title' => t('Edit permissions'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.user_role.edit_permissions_form', - 'menu_name' => 'admin', - 'parent' => 'entity.user_role.edit_form.' . $role->id(), - 'route_parameters' => ['user_role' => $role->id()], - ]; - $links['entity.user_role.delete_form.' . $role->id()] = [ - 'title' => t('Delete'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.user_role.delete_form', - 'menu_name' => 'admin', - 'parent' => 'entity.user_role.edit_form.' . $role->id(), - 'route_parameters' => ['user_role' => $role->id()], - ]; - if ($moduleHandler->moduleExists('devel')) { - $links['entity.user_role.devel_load.' . $role->id()] = [ - 'title' => t('Devel'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.user_role.devel_load', - 'menu_name' => 'admin', - 'parent' => 'entity.user_role.edit_form.' . $role->id(), - 'route_parameters' => ['user_role' => $role->id()], - ]; - } - } - - if ($moduleHandler->moduleExists('node')) { - $links['admin_toolbar_tools.add_content'] = $links['node.add_page']; - $links['admin_toolbar_tools.add_content']['parent'] = 'system.admin_content'; - $links['node.type_add'] = [ - 'title' => t('Add content type'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'node.type_add', - 'menu_name' => 'admin', - 'parent' => 'entity.node_type.collection', - 'weight' => -5, - ]; - // Add node links for each content type. - foreach ($entityTypeManager->getStorage('node_type')->loadMultiple() as $type) { - $links['node.add.' . $type->id()] = [ - 'title' => t($type->label()), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'node.add', - 'parent' => 'admin_toolbar_tools.add_content', - 'route_parameters' => ['node_type' => $type->id()], - ]; - } - } - - if ($moduleHandler->moduleExists('field_ui')) { - $links['field_ui.entity_form_mode_add'] = [ - 'title' => t('Add new form mode'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'field_ui.entity_form_mode_add', - 'menu_name' => 'admin', - 'parent' => 'entity.entity_form_mode.collection', - ]; - $links['field_ui.entity_view_mode_add'] = [ - 'title' => t('Add new view mode'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'field_ui.entity_view_mode_add', - 'menu_name' => 'admin', - 'parent' => 'entity.entity_view_mode.collection', - ]; - } - - if ($moduleHandler->moduleExists('taxonomy')) { - $links['entity.taxonomy_vocabulary.add_form'] = [ - 'title' => t('Add vocabulary'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.taxonomy_vocabulary.add_form', - 'menu_name' => 'admin', - 'parent' => 'entity.taxonomy_vocabulary.collection', - 'weight' => -5, - ]; - } - - if ($moduleHandler->moduleExists('menu_ui')) { - $links['entity.menu.add_form'] = [ - 'title' => t('Add menu'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.menu.add_form', - 'menu_name' => 'admin', - 'parent' => 'entity.menu.collection', - 'weight' => -50, - ]; - // Adds links to /admin/structure/menu. - foreach (menu_ui_get_menus() as $machine_name => $label) { - $links['entity.menu.edit_form.' . $machine_name] = [ - 'title' => t($label), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.menu.edit_form', - 'menu_name' => 'admin', - 'parent' => 'entity.menu.collection', - 'route_parameters' => ['menu' => $machine_name], - ]; - $links['entity.menu.delete_form.' . $machine_name] = [ - 'title' => t('Delete'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.menu.delete_form', - 'menu_name' => 'admin', - 'parent' => 'entity.menu.edit_form.' . $machine_name, - 'route_parameters' => ['menu' => $machine_name], - ]; - if ($moduleHandler->moduleExists('devel') && $routeExists('entity.menu.devel_load')) { - $links['entity.menu.devel_load.' . $machine_name] = [ - 'title' => t('Devel'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.menu.devel_load', - 'menu_name' => 'admin', - 'parent' => 'entity.menu.edit_form.' . $machine_name, - 'route_parameters' => ['menu' => $machine_name], - ]; - } - $links['entity.menu.add_link_form.' . $machine_name] = [ - 'title' => t('Add link'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.menu.add_link_form', - 'menu_name' => 'admin', - 'parent' => 'entity.menu.edit_form.' . $machine_name, - 'route_parameters' => ['menu' => $machine_name], - ]; - } - } - - // If module block_content is enabled. - if ($moduleHandler->moduleExists('block_content')) { - $links['block_content.add_page'] = [ - 'title' => t('Add custom block'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'block_content.add_page', - 'menu_name' => 'admin', - 'parent' => 'block.admin_display', - 'weight' => -100, - ]; - $links['entity.block_content.collection'] = [ - 'title' => t('Custom block library'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.block_content.collection', - 'menu_name' => 'admin', - 'parent' => 'block.admin_display', - ]; - $links['entity.block_content_type.collection'] = [ - 'title' => t('Types'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.block_content_type.collection', - 'menu_name' => 'admin', - 'parent' => 'block.admin_display', - ]; - } - - // If module Contact is enabled. - if ($moduleHandler->moduleExists('contact')) { - $links['contact.form_add'] = [ - 'title' => t('Add contact form'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'contact.form_add', - 'menu_name' => 'admin', - 'parent' => 'entity.contact_form.collection', - 'weight' => -5, - ]; - } - - // If module Update Manager is enabled. - if ($moduleHandler->moduleExists('update')) { - $links['update.module_update'] = [ - 'title' => t('Update'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'update.module_update', - 'menu_name' => 'admin', - 'parent' => 'system.modules_list', - ]; - $links['update.module_install'] = [ - 'title' => t('Install new module'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'update.module_install', - 'menu_name' => 'admin', - 'parent' => 'system.modules_list', - ]; - } - - // If module Devel is enabled. - if ($moduleHandler->moduleExists('devel')) { - $links['admin_development'] = [ - 'title' => t('Development'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'system.admin_config_development', - 'menu_name' => 'admin', - 'parent' => 'admin_toolbar_tools.help', - 'weight' => '-8', - ]; - $links['admin_toolbar_tools.devel.admin_settings'] = [ - 'title' => t('Devel settings'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.admin_settings', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - 'weight' => '-1', - ]; - if ($moduleHandler->moduleExists('webprofiler')) { - $links['admin_toolbar_tools.devel.webprofiler'] = [ - 'title' => t('Web Profiler settings'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'webprofiler.settings', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - } - $links['admin_toolbar_tools.devel.configs_list'] = [ - 'title' => t('Config editor'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.configs_list', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.reinstall'] = [ - 'title' => t('Reinstall modules'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.reinstall', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.menu_rebuild'] = [ - 'title' => t('Rebuild menu'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.menu_rebuild', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.state_system_page'] = [ - 'title' => t('State editor'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.state_system_page', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.theme_registry'] = [ - 'title' => t('Theme registry'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.theme_registry', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.entity_info_page'] = [ - 'title' => t('Entity Info'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.entity_info_page', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.session'] = [ - 'title' => t('Session viewer'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.session', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - $links['admin_toolbar_tools.devel.elements_page'] = [ - 'title' => t('Form API field types'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.elements_page', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - // Menu link for the Toolbar module. - $links['admin_toolbar_tools.toolbar.settings'] = [ - 'title' => t('Toolbar settings'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.toolbar.settings_form', - 'menu_name' => 'admin', - 'parent' => 'devel.admin_settings', - ]; - } - // If module Devel PHP is enabled. - if ($moduleHandler->moduleExists('devel_php') && $routeExists('devel_php.execute_php')) { - $links['admin_toolbar_tools.devel_php.execute_php'] = [ - 'title' => t('Execute PHP Code'), - 'route_name' => 'devel_php.execute_php', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - } - elseif ($moduleHandler->moduleExists('devel') && $routeExists('devel.execute_php')) { - $links['admin_toolbar_tools.devel.execute_php'] = [ - 'title' => t('Execute PHP Code'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'devel.execute_php', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - } - // If module Views Ui enabled. - if ($moduleHandler->moduleExists('views_ui')) { - $links['admin_toolbar_tools.views_ui.add'] = [ - 'title' => t('Add new view'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'views_ui.add', - 'menu_name' => 'admin', - 'parent' => 'entity.view.collection', - 'weight' => -5, - ]; - $links['admin_toolbar_tools.views_ui.field_list'] = [ - 'title' => t('Used in views'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'views_ui.reports_fields', - 'menu_name' => 'admin', - 'parent' => 'entity.field_storage_config.collection', - ]; - } - - $links['admin_toolbar_tools.system.theme_settings'] = [ - 'title' => t('Settings'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'system.theme_settings', - 'menu_name' => 'admin', - 'parent' => 'system.themes_page', - ]; - - if ($moduleHandler->moduleExists('webprofiler')) { - $links['admin_toolbar_tools.devel.webprofiler'] = [ - 'title' => t('Webprofiler settings'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'webprofiler.settings', - 'menu_name' => 'admin', - 'parent' => 'admin_development', - ]; - } - - if ($moduleHandler->moduleExists('update')) { - $links['update.theme_install_'] = [ - 'title' => t('Install new theme'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'update.theme_install', - 'menu_name' => 'admin', - 'parent' => 'system.themes_page', - ]; - $links['update.theme_update_'] = [ - 'title' => t('Update'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'update.theme_update', - 'menu_name' => 'admin', - 'parent' => 'system.themes_page', - ]; - // Lists installed themes. - $installed_themes = admin_toolbar_tools_installed_themes(); - foreach ($installed_themes as $key_theme => $label_theme) { - $links['system.theme_settings_theme.' . $key_theme] = [ - 'title' => t($label_theme), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'system.theme_settings_theme', - 'menu_name' => 'admin', - 'parent' => 'system.theme_settings_', - 'route_parameters' => [ - 'theme' => $key_theme, - ], - ]; - } - } - - // If module Language enabled. - if ($moduleHandler->moduleExists('language')) { - $links['admin_toolbar_tools.language.negotiation'] = [ - 'title' => t('Detection and selection'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'language.negotiation', - 'menu_name' => 'admin', - 'parent' => 'entity.configurable_language.collection', - ]; - } - - // If module Media enabled. - if ($moduleHandler->moduleExists('media')) { - $links['admin_toolbar_tools.add_media'] = [ - 'title' => t('Add media'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.media.add_page', - 'menu_name' => 'admin', - 'parent' => 'system.admin_content', - ]; - // Add node links for each media type. - foreach ($entityTypeManager->getStorage('media_type')->loadMultiple() as $type) { - $links['media.add.' . $type->id()] = [ - 'title' => t($type->label()), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'entity.media.add_form', - 'parent' => 'admin_toolbar_tools.add_media', - 'route_parameters' => ['media_type' => $type->id()], - ]; - } - } - - // If module Config enabled. - if ($moduleHandler->moduleExists('config')) { - $links['admin_toolbar_tools.config.import'] = [ - 'title' => t('Import'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'config.import_full', - 'menu_name' => 'admin', - 'parent' => 'config.sync', - 'weight' => 1, - ]; - $links['admin_toolbar_tools.config.export'] = [ - 'title' => t('Export'), - 'provider' => 'admin_toolbar_tools', - 'route_name' => 'config.export_full', - 'menu_name' => 'admin', - 'parent' => 'config.sync', - 'weight' => 2, - ]; - } - - $languageManager->setConfigOverrideLanguage($config_override_language); -} - -/** - * Return installed themes. - * - * @return array - * An array of friendly theme names, keyed by the machine name. - */ -function admin_toolbar_tools_installed_themes() { - $themeHandler = \Drupal::service('theme_handler'); - $all_themes = $themeHandler->listInfo(); - $themes_installed = []; - foreach ($all_themes as $key_theme => $theme) { - if ($themeHandler->hasUi($key_theme)) { - $themes_installed[$key_theme] = $themeHandler->getName($key_theme); - } - } - - return $themes_installed; -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml deleted file mode 100644 index dc081c860..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml +++ /dev/null @@ -1,80 +0,0 @@ -admin_toolbar_tools.flush: - path: '/admin/flush' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushAll' - _title: 'Flush all caches' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.cssjs: - path: '/admin/flush/cssjs' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushJsCss' - _title: 'Flush Css and Javascript' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.plugin: - path: '/admin/flush/plugin' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushPlugins' - _title: 'Plugin' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.flush_static: - path: '/admin/flush/static-caches' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushStatic' - _title: 'Static caches' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.flush_menu: - path: '/admin/flush/menu' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushMenu' - _title: 'Menu' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.flush_rendercache: - path: '/admin/flush/rendercache' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::cacheRender' - _title: 'Render cache' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.flush_views: - path: '/admin/flush/views' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushViews' - _title: 'Views' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar_tools.flush_twig: - path: '/admin/flush/twig' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushTwig' - _title: 'Twig' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -admin_toolbar.run.cron: - path: '/run-cron' - defaults: - _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::runCron' - _title: 'Run cron' - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json deleted file mode 100644 index 41366480f..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "drupal/admin_toolbar_tools", - "description": "Adds menu links to the Admin Toolbar.", - "type": "drupal-module", - "keywords": ["Drupal", "Toolbar"], - "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Wilfrid Roze (eme)", - "homepage": "https://www.drupal.org/u/eme", - "role": "Maintainer" - }, - { - "name": "Romain Jarraud (romainj)", - "homepage": "https://www.drupal.org/u/romainj", - "role": "Maintainer" - }, - { - "name": "Adrian Cid Almaguer (adriancid)", - "email": "adriancid@gmail.com", - "homepage": "https://www.drupal.org/u/adriancid", - "role": "Maintainer" - }, - { - "name": "Mohamed Anis Taktak (matio89)", - "homepage": "https://www.drupal.org/u/matio89", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" - }, - "require": { - "drupal/admin_toolbar": "^1", - "drupal/core": "~8.5" - } -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css deleted file mode 100644 index a40a8a4f3..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css +++ /dev/null @@ -1,16 +0,0 @@ -.toolbar-icon-admin-toolbar-tools-help { - text-indent: -9999px; -} - -.toolbar-icon-admin-toolbar-tools-help:before { - background-image: url(../misc/icons/ffffff/d8-item.svg); - padding-bottom: 0; - padding-left: 4px; - padding-right: 8px; - padding-top: 2px; -} - -.toolbar-icon-admin-toolbar-tools-help:active:before, -.toolbar-icon-admin-toolbar-tools-help.active:before { - background-image: url(../misc/icons/ffffff/d8-item.svg); -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg deleted file mode 100644 index 40ffae371..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php deleted file mode 100644 index a8758628a..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php +++ /dev/null @@ -1,249 +0,0 @@ -cron = $cron; - $this->menuLinkManager = $menuLinkManager; - $this->contextualLinkManager = $contextualLinkManager; - $this->localTaskLinkManager = $localTaskLinkManager; - $this->localActionLinkManager = $localActionLinkManager; - $this->cacheRender = $cacheRender; - $this->time = $time; - $this->requestStack = $request_stack; - $this->pluginCacheClearer = $plugin_cache_clearer; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('cron'), - $container->get('plugin.manager.menu.link'), - $container->get('plugin.manager.menu.contextual_link'), - $container->get('plugin.manager.menu.local_task'), - $container->get('plugin.manager.menu.local_action'), - $container->get('cache.render'), - $container->get('datetime.time'), - $container->get('request_stack'), - $container->get('plugin.cache_clearer') - ); - } - - /** - * Reload the previous page. - */ - public function reloadPage() { - $request = $this->requestStack->getCurrentRequest(); - if ($request->server->get('HTTP_REFERER')) { - return $request->server->get('HTTP_REFERER'); - } - else { - return '/'; - } - } - - /** - * Flushes all caches. - */ - public function flushAll() { - $this->messenger()->addMessage($this->t('All caches cleared.')); - drupal_flush_all_caches(); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Flushes css and javascript caches. - */ - public function flushJsCss() { - $this->state() - ->set('system.css_js_query_string', base_convert($this->time->getCurrentTime(), 10, 36)); - $this->messenger()->addMessage($this->t('CSS and JavaScript cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Flushes plugins caches. - */ - public function flushPlugins() { - $this->pluginCacheClearer->clearCachedDefinitions(); - $this->messenger()->addMessage($this->t('Plugins cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Resets all static caches. - */ - public function flushStatic() { - drupal_static_reset(); - $this->messenger()->addMessage($this->t('Static cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Clears all cached menu data. - */ - public function flushMenu() { - menu_cache_clear_all(); - $this->menuLinkManager->rebuild(); - $this->contextualLinkManager->clearCachedDefinitions(); - $this->localTaskLinkManager->clearCachedDefinitions(); - $this->localActionLinkManager->clearCachedDefinitions(); - $this->messenger()->addMessage($this->t('Routing and links cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Clears all cached views data. - */ - public function flushViews() { - views_invalidate_cache(); - $this->messenger()->addMessage($this->t('Views cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Clears the twig cache. - */ - public function flushTwig() { - // @todo Update once Drupal 8.6 will be released. - // @see https://www.drupal.org/node/2908461 - PhpStorageFactory::get('twig')->deleteAll(); - $this->messenger()->addMessage($this->t('Twig cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Run the cron. - */ - public function runCron() { - $this->cron->run(); - $this->messenger()->addMessage($this->t('Cron ran successfully.')); - return new RedirectResponse($this->reloadPage()); - } - - /** - * Clear the rendered cache. - */ - public function cacheRender() { - $this->cacheRender->invalidateAll(); - $this->messenger()->addMessage($this->t('Render cache cleared.')); - return new RedirectResponse($this->reloadPage()); - } - -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php deleted file mode 100644 index f61329c63..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php +++ /dev/null @@ -1,54 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access toolbar', - 'access administration pages', - 'administer site configuration', - ]); - $this->drupalLogin($this->adminUser); - } - - /** - * Tests for the hover of sub menus. - */ - public function testAdminToolbarTools() { - // Assert that special menu items are present in the HTML. - $this->assertRaw('class="toolbar-icon toolbar-icon-admin-toolbar-tools-flush"'); - } - -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/composer.json b/sites/all/modules/contrib/admin/admin_toolbar/composer.json deleted file mode 100644 index a97caac9b..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "drupal/admin_toolbar", - "description": "Provides a drop-down menu interface to the core Drupal Toolbar.", - "type": "drupal-module", - "keywords": ["Drupal", "Toolbar"], - "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Wilfrid Roze (eme)", - "homepage": "https://www.drupal.org/u/eme", - "role": "Maintainer" - }, - { - "name": "Romain Jarraud (romainj)", - "homepage": "https://www.drupal.org/u/romainj", - "role": "Maintainer" - }, - { - "name": "Adrian Cid Almaguer (adriancid)", - "email": "adriancid@gmail.com", - "homepage": "https://www.drupal.org/u/adriancid", - "role": "Maintainer" - }, - { - "name": "Mohamed Anis Taktak (matio89)", - "homepage": "https://www.drupal.org/u/matio89", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" - } -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css b/sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css deleted file mode 100644 index d848b90ef..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css +++ /dev/null @@ -1,211 +0,0 @@ -.toolbar-tray-horizontal .menu-item:hover { - background: #fff; -} - -.toolbar-tray-horizontal .menu-item a:focus { - background: #abeae4; -} - -.toolbar-tray-horizontal .toolbar-menu:not(:first-child) li.menu-item--expanded > a:focus { - background-position: center right; - background-image: url('../misc/icons/0074bd/chevron-right.svg'); - background-repeat: no-repeat; -} - -.toolbar-tray-horizontal .menu-item--expanded .menu { - background: #fff; - width: auto; - height: auto; -} - -.toolbar-tray-horizontal .menu-item--expanded { - background-color: #f5f5f2; -} - -.toolbar-tray-horizontal ul li li.menu-item { - border-top: none transparent; - border-right: 1px solid #dddddd; - border-bottom: 1px solid #dddddd; - border-left: 1px solid #dddddd; -} - -.toolbar .toolbar-tray-horizontal .menu-item:last-child { - border-left: 1px solid #dddddd; - border-right: 1px solid #dddddd; -} - -.toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child { - border-top: 1px solid #dddddd; -} - -.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul, -.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul, -.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul, -.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul ul { - display: none; - left: -999em; /* LTR */ -} - -/* Lists nested under hovered list items */ -.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul, -.toolbar-tray-horizontal li li.menu-item--expanded.hover-intent ul, -.toolbar-tray-horizontal li li li.menu-item--expanded.hover-intent ul, -.toolbar-tray-horizontal li li li li.menu-item--expanded.hover-intent ul, -.toolbar-tray-horizontal li li li li li.menu-item--expanded.hover-intent ul { - display: block; - left: auto; /* LTR */ -} - -.toolbar-tray-horizontal .menu ul li a, -.toolbar-tray-horizontal .menu ul .toolbar-icon { - padding: 12px 15px 12px 12px; -} - -.toolbar-tray-horizontal ul li.menu-item--expanded.hover-intent ul { - display: block; - position: absolute; - width: 200px; - box-shadow: 2px 2px 3px hsla(0, 0%, 0%, 0.4); - z-index: 1; -} - -.toolbar-tray-horizontal ul li.menu-item--expanded .menu-item > ul { - display: none; -} - -.toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded { - background-position: center right; - background-image: url('../misc/icons/0074bd/chevron-right.svg'); - background-repeat: no-repeat; -} - -.toolbar-tray-horizontal ul li.menu-item--expanded .menu-item.hover-intent ul { - display: block; - margin: -40px 0 0 197px; -} - -.toolbar-tray-horizontal li:hover ul li { - float: none; -} - -.toolbar-tray-horizontal li.hover-intent ul li { - float: none; -} - -.toolbar-tray-horizontal .toolbar .level-2 > ul { - position: absolute; - padding-top: 0; - top: 0; - left: 200px; - width: 200px; -} - -.toolbar .toolbar-tray-vertical li.open > ul.toolbar-menu.clearfix { - display: block; -} - -[dir="rtl"] .toolbar-tray-horizontal .menu-item:hover { - background: #fff; -} - -[dir="rtl"] .toolbar-tray-horizontal .menu-item a:focus { - background: #abeae4; -} - -[dir="rtl"] .toolbar-tray-horizontal .toolbar-menu:not(:first-child) li.menu-item--expanded > a:focus { - background-position: center right; - background-image: url('../misc/icons/0074bd/chevron-right.svg'); - background-repeat: no-repeat; -} - -[dir="rtl"] .toolbar-tray-horizontal .menu-item--expanded .menu { - background: #fff; - width: auto; - height: auto; -} - -[dir="rtl"] .toolbar-tray-horizontal .menu-item--expanded { - background-color: #f5f5f2; -} - -[dir="rtl"] .toolbar-tray-horizontal ul li li.menu-item { - border-top: none transparent; - border-right: 1px solid #dddddd; - border-bottom: 1px solid #dddddd; - border-left: 1px solid #dddddd; -} - -[dir="rtl"] .toolbar .toolbar-tray-horizontal .menu-item:last-child { - border-left: 1px solid #dddddd; - border-right: 1px solid #dddddd; -} - -[dir="rtl"] .toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child { - border-top: 1px solid #dddddd; -} - -[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul, -[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul, -[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul, -[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul ul { - display: none; - left: -999em; /* LTR */ -} - -/* Lists nested under hovered list items */ -[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul, -[dir="rtl"] .toolbar-tray-horizontal li li.menu-item--expanded.hover-intent ul, -[dir="rtl"] .toolbar-tray-horizontal li li li.menu-item--expanded.hover-intent ul, -[dir="rtl"] .toolbar-tray-horizontal li li li li.menu-item--expanded.hover-intent ul, -[dir="rtl"] .toolbar-tray-horizontal li li li li li.menu-item--expanded.hover-intent ul { - display: block; - left: auto; /* LTR */ -} - -[dir="rtl"] .toolbar-tray-horizontal .menu ul li a, -[dir="rtl"] .toolbar-tray-horizontal .menu ul .toolbar-icon { - padding: 12px 15px 12px 12px; -} - -[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded.hover-intent ul { - display: block; - position: absolute; - width: 200px; - box-shadow: 2px 2px 3px hsla(0, 0%, 0%, 0.4); - z-index: 1; -} - -[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item > ul { - display: none; -} - -[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded { - background-position: center left; - background-image: url('../misc/icons/0074bd/chevron-left.svg'); - background-repeat: no-repeat; -} - -[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item.hover-intent ul { - display: block; - margin: -40px 197px 0 0; -} - -[dir="rtl"] .toolbar-tray-horizontal li:hover ul li { - float: none; -} - -[dir="rtl"] .toolbar-tray-horizontal li.hover-intent ul li { - float: none; -} - -[dir="rtl"] .toolbar-tray-horizontal .toolbar .level-2 > ul { - position: absolute; - padding-top: 0; - top: 0; - left: 200px; - width: 200px; -} - -[dir="rtl"] .toolbar .toolbar-tray-vertical li.open > ul.toolbar-menu.clearfix { - display: block; -} diff --git a/sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js b/sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js deleted file mode 100644 index 96dfa829a..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js +++ /dev/null @@ -1,53 +0,0 @@ -(function ($, Drupal) { - Drupal.behaviors.adminToolbar = { - attach: function (context, settings) { - - $('a.toolbar-icon', context).removeAttr('title'); - - $('.toolbar-tray li.menu-item--expanded, .toolbar-tray ul li.menu-item--expanded .menu-item', context).hoverIntent({ - over: function () { - // At the current depth, we should delete all "hover-intent" classes. - // Other wise we get unwanted behaviour where menu items are expanded while already in hovering other ones. - $(this).parent().find('li').removeClass('hover-intent'); - $(this).addClass('hover-intent'); - }, - out: function () { - $(this).removeClass('hover-intent'); - }, - timeout: 250 - }); - - // Make the toolbar menu navigable with keyboard. - $('ul.toolbar-menu li.menu-item--expanded a', context).on('focusin', function () { - $('li.menu-item--expanded', context).removeClass('hover-intent'); - $(this).parents('li.menu-item--expanded').addClass('hover-intent'); - }); - - $('ul.toolbar-menu li.menu-item a', context).keydown(function (e) { - if ((e.shiftKey && (e.keyCode || e.which) == 9)) { - if ($(this).parent('.menu-item').prev().hasClass('menu-item--expanded')) { - $(this).parent('.menu-item').prev().addClass('hover-intent'); - } - } - }); - - $('.toolbar-menu:first-child > .menu-item:not(.menu-item--expanded) a, .toolbar-tab > a', context).on('focusin', function () { - $('.menu-item--expanded').removeClass('hover-intent'); - }); - - $('.toolbar-menu:first-child > .menu-item', context).on('hover', function () { - $(this, 'a').css("background: #fff;"); - }); - - $('ul:not(.toolbar-menu)', context).on({ - mousemove: function () { - $('li.menu-item--expanded').removeClass('hover-intent'); - }, - hover: function () { - $('li.menu-item--expanded').removeClass('hover-intent'); - } - }); - - } - }; -})(jQuery, Drupal); diff --git a/sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js b/sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js deleted file mode 100644 index 1afc5e605..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js +++ /dev/null @@ -1,158 +0,0 @@ -/*! - * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ - * http://briancherne.github.io/jquery-hoverIntent/ - * - * You may use hoverIntent under the terms of the MIT license. Basically that - * means you are free to use hoverIntent as long as this header is left intact. - * Copyright 2007, 2014 Brian Cherne - */ - -/* hoverIntent is similar to jQuery's built-in "hover" method except that - * instead of firing the handlerIn function immediately, hoverIntent checks - * to see if the user's mouse has slowed down (beneath the sensitivity - * threshold) before firing the event. The handlerOut function is only - * called after a matching handlerIn. - * - * // basic usage ... just like .hover() - * .hoverIntent( handlerIn, handlerOut ) - * .hoverIntent( handlerInOut ) - * - * // basic usage ... with event delegation! - * .hoverIntent( handlerIn, handlerOut, selector ) - * .hoverIntent( handlerInOut, selector ) - * - * // using a basic configuration object - * .hoverIntent( config ) - * - * @param handlerIn function OR configuration object - * @param handlerOut function OR selector for delegation OR undefined - * @param selector selector OR undefined - * @author Brian Cherne - */ - -;(function(factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - define(['jquery'], factory); - } else if (jQuery && !jQuery.fn.hoverIntent) { - factory(jQuery); - } -})(function($) { - 'use strict'; - - // default configuration values - var _cfg = { - interval: 100, - sensitivity: 6, - timeout: 0 - }; - - // counter used to generate an ID for each instance - var INSTANCE_COUNT = 0; - - // current X and Y position of mouse, updated during mousemove tracking (shared across instances) - var cX, cY; - - // saves the current pointer position coordinates based on the given mousemove event - var track = function(ev) { - cX = ev.pageX; - cY = ev.pageY; - }; - - // compares current and previous mouse positions - var compare = function(ev,$el,s,cfg) { - // compare mouse positions to see if pointer has slowed enough to trigger `over` function - if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) { - $el.off(s.event,track); - delete s.timeoutId; - // set hoverIntent state as active for this element (permits `out` handler to trigger) - s.isActive = true; - // overwrite old mouseenter event coordinates with most recent pointer position - ev.pageX = cX; ev.pageY = cY; - // clear coordinate data from state object - delete s.pX; delete s.pY; - return cfg.over.apply($el[0],[ev]); - } else { - // set previous coordinates for next comparison - s.pX = cX; s.pY = cY; - // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) - s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval ); - } - }; - - // triggers given `out` function at configured `timeout` after a mouseleave and clears state - var delay = function(ev,$el,s,out) { - delete $el.data('hoverIntent')[s.id]; - return out.apply($el[0],[ev]); - }; - - $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { - // instance ID, used as a key to store and retrieve state information on an element - var instanceId = INSTANCE_COUNT++; - - // extend the default configuration and parse parameters - var cfg = $.extend({}, _cfg); - if ( $.isPlainObject(handlerIn) ) { - cfg = $.extend(cfg, handlerIn); - if ( !$.isFunction(cfg.out) ) { - cfg.out = cfg.over; - } - } else if ( $.isFunction(handlerOut) ) { - cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); - } else { - cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); - } - - // A private function for handling mouse 'hovering' - var handleHover = function(e) { - // cloned event to pass to handlers (copy required for event object to be passed in IE) - var ev = $.extend({},e); - - // the current target of the mouse event, wrapped in a jQuery object - var $el = $(this); - - // read hoverIntent data from element (or initialize if not present) - var hoverIntentData = $el.data('hoverIntent'); - if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); } - - // read per-instance state from element (or initialize if not present) - var state = hoverIntentData[instanceId]; - if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; } - - // state properties: - // id = instance ID, used to clean up data - // timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler - // isActive = plugin state, true after `over` is called just until `out` is called - // pX, pY = previously-measured pointer coordinates, updated at each polling interval - // event = string representing the namespaced event used for mouse tracking - - // clear any existing timeout - if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); } - - // namespaced event used to register and unregister mousemove tracking - var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId; - - // handle the event, based on its type - if (e.type === 'mouseenter') { - // do nothing if already active - if (state.isActive) { return; } - // set "previous" X and Y position based on initial entry point - state.pX = ev.pageX; state.pY = ev.pageY; - // update "current" X and Y position based on mousemove - $el.off(mousemove,track).on(mousemove,track); - // start polling interval (self-calling timeout) to compare mouse coordinates over time - state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval ); - } else { // "mouseleave" - // do nothing if not already active - if (!state.isActive) { return; } - // unbind expensive mousemove event - $el.off(mousemove,track); - // if hoverIntent state is true, then call the mouseOut function after the specified delay - state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout ); - } - }; - - // listen for mouseenter and mouseleave - return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); - }; -}); diff --git a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg b/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg deleted file mode 100644 index 122e1c099..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg b/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg deleted file mode 100644 index b16a8ce89..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg b/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg deleted file mode 100644 index b16a8ce89..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php b/sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php deleted file mode 100644 index 1403688d3..000000000 --- a/sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php +++ /dev/null @@ -1,54 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access toolbar', - 'access administration pages', - ]); - $this->drupalLogin($this->adminUser); - } - - /** - * Tests for a the hover of sub menus. - */ - public function testAdminToolbar() { - // Assert that expanded links are present in the HTML. - $this->assertRaw('class="toolbar-icon toolbar-icon-user-admin-index"'); - } - -} diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt deleted file mode 100644 index cdec2ca9d..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt +++ /dev/null @@ -1,20 +0,0 @@ -This module is inspired by "Adminimal Administration Menu". It provides a -minimalist style to the "Admin Toolbar" module. - -Although "Adminimal" provides menu styling, there some conflicts with Admin -toolbar and styling will only be present when the admin theme is present. - -For this reason it makes the most sense to put this styling in a module rather -than the theme. - - -Installation ------------- - -By downloading and enabling this module styling will be applied. - - -Dependencies ------------- - -- admin_toolbar diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml deleted file mode 100644 index 71b40e1d2..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Adminimal Admin Toolbar -# core: 8.x -description: Adminimal styling brought to admin toolbar. -package: Administration -type: module -dependencies: - - admin_toolbar - -# Information added by Drupal.org packaging script on 2017-07-25 -version: '8.x-1.5' -core: '8.x' -project: 'adminimal_admin_toolbar' -datestamp: 1500955448 diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml deleted file mode 100644 index c7bbc00ae..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml +++ /dev/null @@ -1,5 +0,0 @@ -adminimal-admin-toolbar: - version: VERSION - css: - theme: - css/adminimal_admin_toolbar.css: {} diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module deleted file mode 100644 index 526951bf8..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module +++ /dev/null @@ -1,48 +0,0 @@ -hasPermission('access toolbar'); -} diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json deleted file mode 100644 index f8fd7cdab..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "drupal/adminimal_admin_toolbar", - "description": "Adminimal styling brought to admin toolbar.", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/adminimal_admin_toolbar", - "authors": [{ - "name": "Ted Slesinski", - "homepage": "https://www.drupal.org/u/energee" - }], - "support": { - "issues": "https://www.drupal.org/project/issues/adminimal_admin_toolbar" - }, - "license": "GPL-2.0+", - "repositories": [{ - "type": "package", - "package": { - "name": "drupal/adminimal_admin_toolbar", - "version": "8.0.0", - "type": "drupal-module", - "source": { - "url": "https://git.drupal.org/project/adminimal_admin_toolbar.git", - "type": "git", - "reference": "refs/heads/8.x-1.x" - } - } - }] -} diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css deleted file mode 100644 index 0e6b7230b..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css +++ /dev/null @@ -1,440 +0,0 @@ -/* Import the Open Sans webfont from Google CDN */ -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTRsxEYwM7FgeyaSgU71cLG0.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/uYKcPVoh6c5R0NpdEY5A-Q.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 600; - src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNShsxEYwM7FgeyaSgU71cLG0.woff) format('woff'); -} - -.adminimal-admin-toolbar .toolbar { - font-family: "Open Sans"; -} - -.adminimal-admin-toolbar .toolbar a { - transition: all, 0.2s; -} - -.adminimal-admin-toolbar .toolbar .toolbar-bar { - box-shadow: none; - background-color: #2d2d2d; -} - -.adminimal-admin-toolbar .toolbar .toolbar-menu { - background: #333; -} - -.adminimal-admin-toolbar .toolbar-tray .toolbar-menu a { - background: transparent; - color: #ccc; -} - -.adminimal-admin-toolbar .toolbar-tray .toolbar-menu li { - background: #333; -} - -.adminimal-admin-toolbar .toolbar-tray ul li.menu-item { - border: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child { - border: none; -} - -.adminimal-admin-toolbar .toolbar-oriented .user-toolbar-tab { - float: right; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical { - border: none; - box-shadow: none; -} - -.adminimal-admin-toolbar .toolbar-tray a { - background: #2d2d2d; - color: #bbb; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal a:hover, -.adminimal-admin-toolbar .toolbar-tray-horizontal a:active, -.adminimal-admin-toolbar .toolbar-tray-horizontal a:focus { - background: #0084d7; - color: #fff; - text-decoration: none; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover > a, -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover > .toolbar-box > a { - background: #0084d7; - color: #fff !important; -} - -.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item { - font-weight: 600; -} - -.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-item { - color: #bebebe; -} - -.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item:hover { - background-image: none; - background-color: #2d2d2d; - color: #fff; - text-decoration: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item.is-active, -.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item:focus { - background-image: none; - background-color: #333; - text-decoration: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item + .menu-item, -[dir="rtl"] .adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item + .menu-item, -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item:last-child { - border-left: none; /* LTR */ - border-right: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray .menu-item--active-trail > .toolbar-box a, -.adminimal-admin-toolbar .toolbar .toolbar-tray a.is-active { - color: inherit; - text-decoration: none; - font-weight: bold; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .menu-item + .menu-item { - border: 0 none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray { - background-color: #333; - box-shadow: -2px 2px 12px rgba(0,0,0,0.85); -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal { - border-bottom: 1px solid #333; - box-shadow: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-toggle-orientation { - background-color: #333; -} - -.toolbar .toolbar-icon:before { - transition: .25s; -} - -.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle:focus { - background-color: transparent; -} - -.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle:before { - background-image: url(../images/acacac/chevron-outline-disc-down.svg); - transition: .25s; -} - -.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle.open:before { - background-image: url(../images/ffcfcf/chevron-outline-disc-close.svg) !important; - transform: rotate(180deg); -} - -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle:before { - background-image: url(../images/acacac/chevron-outline-disc-down.svg); - background-size: 100%; -} - -.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle:hover:before, -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle:hover:before, -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-box:hover .toolbar-icon.toolbar-handle:before { - background-image: url(../images/ffffff/chevron-outline-disc-down.svg); -} - -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle.open:before, -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-box:hover .toolbar-icon.toolbar-handle.open:before { - background-image: url(../images/ffffff/chevron-outline-disc-close.svg); - background-size: 100%; -} - -.adminimal-admin-toolbar .level-1 .toolbar-handle.open, -.adminimal-admin-toolbar .toolbar-tray-vertical .level-2 { - background: #3b3b3b !important; -} - -.adminimal-admin-toolbar .level-2 .toolbar-handle.open, -.adminimal-admin-toolbar .toolbar-tray-vertical .level-3 { - background: #434343 !important; -} - -.adminimal-admin-toolbar .level-3 .toolbar-handle.open, -.adminimal-admin-toolbar .toolbar-tray-vertical .level-4 { - background: #4c4c4c !important; -} - -.adminimal-admin-toolbar .level-4 .toolbar-handle.open, -.adminimal-admin-toolbar .toolbar-tray-vertical .level-5 { - background: #545454 !important; -} - -/* For WCAG, we are lightening the text on this tier. */ -.adminimal-admin-toolbar .toolbar .level-3 a, -.adminimal-admin-toolbar .toolbar .level-4 a { - color: #d5d5d5 !important; -} - -.adminimal-admin-toolbar .toolbar-handle.open { - border-top-left-radius: 10px; -} - -.toolbar .toolbar-tray-vertical .level-3 ul { - margin-left: 0 !important; -} - -.adminimal-admin-toolbar .toolbar-tray-vertical .level-3 a { - padding-left: 2.75em !important; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal a:focus, -.adminimal-admin-toolbar .toolbar-box a:focus { - background: #333; - text-decoration: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu a { - color: #bbb; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu a:hover, -.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu a:focus { - color: #fff; - background: #0084d7; - text-decoration: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu ul ul { - border: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .toolbar-toggle-orientation { - border: none; -} - -.adminimal-admin-toolbar .toolbar .menu-item:hover { - background-color: #333; -} - -.adminimal-admin-toolbar .toolbar .menu-item:focus { - background: #abeae4; -} - -.adminimal-admin-toolbar .toolbar .menu-item--expanded { - background-color: #333; -} -.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded, -[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded { - background-image: none; - position: relative; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .toolbar-menu ul .toolbar-icon { - padding: 1em 12px; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item:hover ul { - margin: -39px 0 0 200px; -} -[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item:hover ul { - margin: -39px 200px 0 0; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:after { - color: #8eacc0; - content: url(../images/0084d7/chevron-right.svg); - font-size: 16px; - pointer-events: none; - position: absolute; - right: 5px; - top: 50%; - transform: translateY(-8px); - transition: all .2s; -} - -[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:after { - right: auto; - left: 5px; - top: 30%; - -moz-transform: scaleX(-1); - -o-transform: scaleX(-1); - -webkit-transform: scaleX(-1); - transform: scaleX(-1); - filter: FlipH; - -ms-filter: "FlipH"; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:hover:after { - content: url(../images/ffffff/chevron-right.svg); - transform: translate(6px, -8px); -} - -[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:hover:after { - transform-origin: 40% top; - -moz-transform: scaleX(-1); - -o-transform: scaleX(-1); - -webkit-transform: scaleX(-1); - transform: scaleX(-1); - filter: FlipH; - -ms-filter: "FlipH"; -} - -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu a { - color: #bbb; -} - -.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu a:hover { - color: #fff; -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item { - border-top: none transparent; - border-right: none; - border-bottom: none; - border-left: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item:last-child { - border-left: none; - border-right: none; -} - -.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child { - border-top: 1px solid #0084d7; -} - -/* Removes border top on next consecutive lists after first */ -.adminimal-admin-toolbar .toolbar-tray-horizontal ul ul li li.menu-item:first-child { - border-top: none !important; -} - -/* Main menu icons. */ -.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help:before { - background-image: url(../images/acacac/drupal-8.svg); - margin-left: 7px; - padding: 0px; -} - -.adminimal-admin-toolbar .toolbar-tray-vertical .toolbar-icon-admin-toolbar-tools-help:before { - margin-left: 0; -} - -.adminimal-admin-toolbar .toolbar-icon-system-admin-content:before { - background-image: url(../images/acacac/file.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-system-admin-structure:before { - background-image: url(../images/acacac/orgchart.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-system-themes-page:before { - background-image: url(../images/acacac/paintbrush.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-entity-user-collection:before { - background-image: url(../images/acacac/people.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-system-modules-list:before { - background-image: url(../images/acacac/puzzlepiece.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-system-admin-config:before { - background-image: url(../images/acacac/wrench.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-system-admin-reports:before { - background-image: url(../images/acacac/barchart.svg); -} - -.adminimal-admin-toolbar .toolbar-icon-help-main:before { - background-image: url(../images/acacac/questionmark-disc.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-admin-toolbar-tools-help:before, -.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help:hover:before, -.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help:active:before, -.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help.is-active:before { - background-image: url(../images/ffffff/drupal-8.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-content:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-content:hover:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-content:active:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-content.is-active:before { - background-image: url(../images/ffffff/file.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-structure:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-structure:hover:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-structure:active:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-structure.is-active:before { - background-image: url(../images/ffffff/orgchart.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-themes-page:before, -.adminimal-admin-toolbar .toolbar-icon-system-themes-page:hover:before, -.adminimal-admin-toolbar .toolbar-icon-system-themes-page:active:before, -.adminimal-admin-toolbar .toolbar-icon-system-themes-page.is-active:before { - background-image: url(../images/ffffff/paintbrush.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-entity-user-collection:before, -.adminimal-admin-toolbar .toolbar-icon-entity-user-collection:hover:before, -.adminimal-admin-toolbar .toolbar-icon-entity-user-collection:active:before, -.adminimal-admin-toolbar .toolbar-icon-entity-user-collection.is-active:before { - background-image: url(../images/ffffff/people.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-modules-list:before, -.adminimal-admin-toolbar .toolbar-icon-system-modules-list:hover:before, -.adminimal-admin-toolbar .toolbar-icon-system-modules-list:active:before, -.adminimal-admin-toolbar .toolbar-icon-system-modules-list.is-active:before { - background-image: url(../images/ffffff/puzzlepiece.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-config:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-config:hover:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-config:active:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-config.is-active:before { - background-image: url(../images/ffffff/wrench.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-reports:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-reports:hover:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-reports:active:before, -.adminimal-admin-toolbar .toolbar-icon-system-admin-reports.is-active:before { - background-image: url(../images/ffffff/barchart.svg); -} - -.adminimal-admin-toolbar .menu-item--expanded:hover .toolbar-icon-help-main:before, -.adminimal-admin-toolbar .toolbar-icon-help-main:hover:before, -.adminimal-admin-toolbar .toolbar-icon-help-main:active:before, -.adminimal-admin-toolbar .toolbar-icon-help-main.is-active:before { - background-image: url(../images/ffffff/questionmark-disc.svg); -} - -.adminimal-admin-toolbar .toolbar-tray-vertical .toolbar-icon-admin-toolbar-tools-help { - text-indent: 0; - transition: none; -} diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg deleted file mode 100644 index ae77eece2..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg deleted file mode 100644 index 826bbdce6..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg deleted file mode 100644 index d87dae10a..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg deleted file mode 100644 index 2c2d2e70d..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg deleted file mode 100644 index 2c2d2e70d..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg deleted file mode 100644 index 785450dbb..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg deleted file mode 100644 index 785450dbb..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg deleted file mode 100644 index 6b940d9fc..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg deleted file mode 100644 index 832eba876..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg deleted file mode 100644 index 6d6771448..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg deleted file mode 100644 index ddea4e13f..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg deleted file mode 100644 index 445b3e0a7..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg deleted file mode 100644 index a8040c41c..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg deleted file mode 100644 index 09ad8f382..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg deleted file mode 100644 index 56b2e6f02..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg deleted file mode 100644 index a9b524445..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg deleted file mode 100644 index 0e953b0b3..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg deleted file mode 100644 index 20417c416..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg deleted file mode 100644 index 9c1555424..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg deleted file mode 100644 index 17aeeb350..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg deleted file mode 100644 index 7ba4e0802..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg deleted file mode 100644 index ec9f71cdd..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg deleted file mode 100644 index f962b5cd1..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg deleted file mode 100644 index 936bc6308..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg deleted file mode 100644 index f157b9eac..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg deleted file mode 100644 index 677f49857..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg deleted file mode 100644 index 117828eaa..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg deleted file mode 100644 index 4e8c4af13..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg deleted file mode 100644 index cea0beb75..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg deleted file mode 100644 index a8f2f0df9..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg deleted file mode 100644 index 8dda7dc29..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg deleted file mode 100644 index 5c45e8033..000000000 --- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/better_messages/LICENSE.txt b/sites/all/modules/contrib/admin/better_messages/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/better_messages/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.info.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.info.yml deleted file mode 100644 index 6a8218fce..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Better Messages -type: module -description: This module adds simple functions to make Drupal messages look and act better. -package: User interface -# core: 8.x -configure: better_messages.settings_form - -# Information added by Drupal.org packaging script on 2018-02-03 -version: '8.x-1.0-alpha2' -core: '8.x' -project: 'better_messages' -datestamp: 1517663884 diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml deleted file mode 100644 index 51abc8f89..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml +++ /dev/null @@ -1,14 +0,0 @@ -better_messages: - version: 1.x - css: - theme: - css/better_messages.css: {} - js: - js/better_messages.js: {} - dependencies: - - core/jquery - - core/jquery.once - - core/jquery.ui.draggable - - core/jquery.ui.resizable - - core/drupal - - core/drupalSettings diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml deleted file mode 100644 index 0a7ca4f0b..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -better_messages.settings_form: - title: 'Better Messages settings' - description: 'Better handling of Drupal messages UI' - route_name: better_messages.settings_form - parent: system.admin_config_ui diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.module b/sites/all/modules/contrib/admin/better_messages/better_messages.module deleted file mode 100644 index 8d8290a4b..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.module +++ /dev/null @@ -1,138 +0,0 @@ - [ - 'render element' => 'element', - 'variables' => [ - 'children' => '', - 'message_list' => [], - ], - ], - ]; -} - -/** - * Implements hook_element_info_alter(). - */ -function better_messages_element_info_alter(array &$info) { - // Replace the default pre_render for status_messages with our custom one. - $info['status_messages']['#pre_render'][0] = 'better_messages_status_messages_pre_render'; -} - -/** - * Pre render callback for 'status_messages' render element. - */ -function better_messages_status_messages_pre_render(array $element) { - // The code below is heavily copied from StatusMessages::renderMessages(). - $element = [ - '#lazy_builder' => ['better_messages_status_messages_lazy_builder', [$element['#display']]], - '#create_placeholder' => TRUE, - ]; - - // Directly create a placeholder as we need this to be placeholdered - // regardless if this is a POST or GET request. - // @todo remove this when https://www.drupal.org/node/2367555 lands. - return \Drupal::service('render_placeholder_generator')->createPlaceholder($element); -} - -/** - * Lazy builder for 'status_messages'. - * - * Improved version of StatusMessages::renderMessages() that additionally wraps - * the output into an overlay markup whenever necessary. - * - * @param string|null $type - * Limit the messages returned by type. Defaults to NULL, meaning all types. - * Passed on to drupal_get_messages(). These values are supported: - * - NULL - * - 'status' - * - 'warning' - * - 'error' - * - * @return array - * A renderable array containing the messages. - */ -function better_messages_status_messages_lazy_builder($type) { - $render = \Drupal\Core\Render\Element\StatusMessages::renderMessages($type); - if (!empty($render)) { - $render['#theme_wrappers'][] = 'better_messages_wrapper'; - $render['#attached']['library'][] = 'better_messages/better_messages'; - $render['#attached']['drupalSettings']['better_messages'] = \Drupal::config('better_messages.settings')->get(); - } - - return $render; -} - -/** - * Preprocess for 'better_messages_wrapper' theme hook. - */ -function template_preprocess_better_messages_wrapper(&$variables) { - $settings = \Drupal::config('better_messages.settings'); - $cache = \Drupal\Core\Cache\CacheableMetadata::createFromRenderArray($variables); - $cache->addCacheTags($settings->getCacheTags()); - $cache->addCacheContexts($settings->getCacheContexts()); - $cache->mergeCacheMaxAge($settings->getCacheMaxAge()); - - // Inject the messages from $variables into our "better_messages" context - // since now we have crossed beyond the point where "current" messages are - // retrievable via drupal_get_messages(). - \Drupal::service('better_messages.context')->setMessages($variables['message_list']); - - /** @var \Drupal\Core\Condition\ConditionManager $condition_manager */ - $condition_manager = \Drupal::service('plugin.manager.condition'); - /** @var \Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository */ - $context_repository = \Drupal::service('context.repository'); - /** @var \Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler */ - $context_handler = \Drupal::service('context.handler'); - - $pass = TRUE; - foreach ($settings->get('visibility') as $condition_id => $condition) { - $condition = $condition_manager->createInstance($condition_id, $condition); - if ($condition instanceof \Drupal\Core\Plugin\ContextAwarePluginInterface) { - try { - $contexts = $context_repository->getRuntimeContexts(array_values($condition->getContextMapping())); - $context_handler->applyContextMapping($condition, $contexts); - } - catch (\Drupal\Component\Plugin\Exception\ContextException $e) { - // We couldn't initialize the condition, so it just cannot participate. - continue; - } - } - - try { - $pass = $condition->execute(); - } - catch (\Drupal\Component\Plugin\Exception\ContextException $e) { - // Condition couldn't evaluate itself. Let's skip it. - continue; - } - - if ($condition instanceof \Drupal\Core\Cache\CacheableDependencyInterface) { - $cache->addCacheTags($condition->getCacheTags()); - $cache->addCacheContexts($condition->getCacheContexts()); - $cache->mergeCacheMaxAge($condition->getCacheMaxAge()); - } - - if (!$pass) { - break; - } - } - - $cache->applyTo($variables); - - if ($pass && !empty($variables['message_list'])) { - $variables['attributes']['class'][] = 'better-messages-overlay'; - - if (\Drupal::config('better_messages.settings')->get('fixed')) { - $variables['attributes']['class'][] = 'better-messages-position-fixed'; - } - - if (isset($variables['message_list']['error'])) { - $variables['attributes']['class'][] = 'better-messages-has-errors'; - } - } -} diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml deleted file mode 100644 index d7d927598..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -configure better messages: - title: 'Configure better messages' - description: 'Configure settings of the Better Messages module.' diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml deleted file mode 100644 index da060b0fc..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -better_messages.settings_form: - path: /admin/config/user-interface/better-messages - defaults: - _form: 'Drupal\better_messages\Form\BetterMessagesSettingsForm' - _title: 'Better Message settings' - requirements: - _permission: 'configure better messages' diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.services.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.services.yml deleted file mode 100644 index a56936485..000000000 --- a/sites/all/modules/contrib/admin/better_messages/better_messages.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - better_messages.context: - class: Drupal\better_messages\ContextProvider\MessagesContext - tags: - - { name: 'context_provider' } diff --git a/sites/all/modules/contrib/admin/better_messages/composer.json b/sites/all/modules/contrib/admin/better_messages/composer.json deleted file mode 100644 index 06d655411..000000000 --- a/sites/all/modules/contrib/admin/better_messages/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "drupal/better_messages", - "description": "Better Messages module for Drupal 8.", - "type": "drupal-module" -} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml b/sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml deleted file mode 100644 index d0f1c3683..000000000 --- a/sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml +++ /dev/null @@ -1,20 +0,0 @@ -position: 'center' -vertical: 0 -horizontal: 10 -fixed: 1 -width: '400px' -autoclose: 0 -opendelay: 0.3 -disable_autoclose: 0 -show_countdown: 1 -hover_autoclose: 1 -popin: - effect: 'fadeIn' - duration: 'slow' -popout: - effect: 'fadeOut' - duration: 'slow' -jquery_ui: - draggable: 1 - resizable: 0 -visibility: [] diff --git a/sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml b/sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml deleted file mode 100644 index 7786f6d8c..000000000 --- a/sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml +++ /dev/null @@ -1,70 +0,0 @@ -better_messages.settings: - type: config_entity - label: 'Better Messages settings' - mapping: - position: - type: string - label: 'Position' - vertical: - type: integer - label: 'Vertical' - horizontal: - type: integer - label: 'Horizontal' - fixed: - type: integer - label: 'Fixed' - width: - type: string - label: 'Width' - autoclose: - type: integer - label: 'autoclose' - opendelay: - type: float - label: 'Opendelay' - disable_autoclose: - type: integer - label: 'Disable autoclose' - show_countdown: - type: integer - label: 'Show countdown' - hover_autoclose: - type: integer - label: 'Hover autoclose' - popin: - type: mapping - label: 'Popin effect' - mapping: - effect: - type: string - label: 'Effect' - duration: - type: string - label: 'Duration' - popout: - type: mapping - label: 'Popout effect' - mapping: - effect: - type: string - label: 'Effect' - duration: - type: string - label: 'Duration' - jquery_ui: - type: mapping - label: 'jQuery UI enhancement' - mapping: - draggable: - type: integer - label: 'Draggable' - resizable : - type: integer - label: 'Resizable' - visibility: - type: sequence - label: 'Visibility Conditions' - sequence: - type: condition.plugin.[id] - label: 'Visibility Condition' diff --git a/sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml b/sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml deleted file mode 100644 index c5dd93a53..000000000 --- a/sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml +++ /dev/null @@ -1,9 +0,0 @@ -condition.plugin.message_type: - type: condition.plugin - mapping: - message_types: - type: sequence - label: 'Allowed message types' - sequence: - type: string - label: 'Message type' diff --git a/sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css b/sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css deleted file mode 100644 index 585261ec7..000000000 --- a/sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css +++ /dev/null @@ -1,7 +0,0 @@ -#better-messages-default .better-messages-close { - float: left; -} - -#better-messages-default .better-messages-timer { - float: right; -} diff --git a/sites/all/modules/contrib/admin/better_messages/css/better_messages.css b/sites/all/modules/contrib/admin/better_messages/css/better_messages.css deleted file mode 100644 index b9557026f..000000000 --- a/sites/all/modules/contrib/admin/better_messages/css/better_messages.css +++ /dev/null @@ -1,54 +0,0 @@ -/** We want the admin toolbar to be on top of our overlay when it's -horizontal. */ -.toolbar-horizontal #toolbar-administration { - z-index: 520; -} - -/** Hide the messages if we have JS support */ -.js #better-messages-default.better-messages-overlay { - display: none; -} - -#better-messages-default.better-messages-overlay { - z-index: 510; - position: absolute; - background: #FFFFFF; - padding: 1em; - -webkit-box-shadow: 0 2px 10px #000000; - -moz-box-shadow: 0 2px 10px #000000; - box-shadow: 0 2px 10px #000000; - -webkit-border-radius: 1em; - -moz-border-radius: 1em; - border-radius: 1em; -} - -#better-messages-default.better-messages-overlay.better-messages-position-fixed { - position: fixed; -} - -#better-messages-default.better-messages-overlay .better-messages-footer { - border-top: 1px solid #DDDDDD; - margin-top: 10px; - padding-top: 5px; - text-align: right; -} - -#better-messages-default.better-messages-overlay .better-messages-close { - display: block; - float: right; - color: #676767; - text-transform: uppercase; -} - -#better-messages-default.better-messages-overlay .better-messages-close span { - background: transparent url(../images/closelabel.gif) no-repeat; - display: block; - float: right; - height: 22px; - width: 22px; -} - -#better-messages-default.better-messages-overlay .better-messages-timer { - float: left; - line-height: 22px; -} diff --git a/sites/all/modules/contrib/admin/better_messages/images/closelabel.gif b/sites/all/modules/contrib/admin/better_messages/images/closelabel.gif deleted file mode 100644 index fa6c9ab008ead1b1175e39da8ae68f2f11c6e974..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 687 zcmZ?wbhEHb6k`x$I2OZj;J|@{2M^AjJ2x^i^3tVC&CSj0*RTKj_3M)-PXYo0cI?>E z)6+9$%9N0hkg%|@J9q8`1qGcvc``6CFd`x%G&JWG1!QZ}p`}_Crt5>gn{ra_R z*|PBP@I{Lj`S|$w`}?P*rG5YY{qEhnXU?2SNJyxzu3ors;h#T$K79Ca@7}$foSdy& zxBmY9d+OAwXV0EJb?Q__MaApauf4s!A3S&vA0NMS=g#~0?{C?%rLC>4pr9Z*Ir-_+ zr;{d4>gecLxpHM*Uf%TS)ARH5uU@^{*Vp&5E2E;KQc_ZUeSM3Ii__E7r%jvI-roNB@nb(fzs$_c+qZ95RaO1} z|Nq~=e?XEBK=CIFBNszGgAM}_fZ~LK{a-^&Q*%peTYE=mt9n;kY=4Z7yHia6wAdJB zCaIQbiVkvtN>eAq=$XiciZ@U2HDVTXjao8Og_l{*Zp{qIXnAJN5VIy_6EWrp3ys}- zR5_V>wT$()F$aYy&Ycz`s=8mqW1BFi?dlm#(`OiZ3NZ7@Fbg=}T)Jd>jE0*CvoNph zoZAgop7MBxkq}<4vR#Fhlj=H xeh-WAn2fQQYzkc5i9ll`){3^EO-zY}az<@MB`mo2?P?(XjIJ6M<)tO4qJe_#Lr diff --git a/sites/all/modules/contrib/admin/better_messages/js/better_messages.js b/sites/all/modules/contrib/admin/better_messages/js/better_messages.js deleted file mode 100644 index 5e06b9e37..000000000 --- a/sites/all/modules/contrib/admin/better_messages/js/better_messages.js +++ /dev/null @@ -1,124 +0,0 @@ - -(function ($) { - - 'use strict'; - - Drupal.behaviors.betterMessages = { - attach: function (context, settings) { - - var betterMessages = settings.better_messages; - var message_box = $('#better-messages-default.better-messages-overlay', context).once('better-messages'); - - if (message_box.length > 0) { - /* jQuery UI Enhancements */ - if (betterMessages.jquery_ui.draggable == '1') { - message_box.draggable(); - } - if (betterMessages.jquery_ui.resizable == '1') { - message_box.resizable(); - } - - /* Functions to determine the popin/popout animation */ - betterMessages.open = function () { - var method = 'fadeIn'; - switch (betterMessages.popin.effect) { - case 'fadeIn': - case 'slideDown': - method = betterMessages.popin.effect; - break; - } - message_box[method](betterMessages.popin.duration); - }; - betterMessages.close = function () { - var method = 'fadeOut'; - switch (betterMessages.popout.effect) { - case 'fadeOut': - break; - case 'slideUp': - method = betterMessages.popout.effect; - break; - } - message_box[method](betterMessages.popout.duration); - }; - - /* Function to determine closing count */ - betterMessages.countDownClose = function (seconds) { - if (!message_box.hasClass('better-messages-has-errors') || !betterMessages.disable_autoclose) { - if (seconds > 0) { - seconds--; - if (betterMessages.show_countdown == '1') { - $('.better-messages-timer', message_box).text(Drupal.t('Closing in !seconds seconds', {'!seconds': seconds})); - } - if (seconds > 0) { - betterMessages.countDown = setTimeout(function () { - betterMessages.countDownClose(seconds); - }, 1000); - } - else { - betterMessages.close(); - } - } - } - }; - - if (betterMessages.width) { - message_box.css('width', betterMessages.width); - } - - /* Determine Popup Message position */ - var vertical = betterMessages.vertical; - var horizontal = betterMessages.horizontal; - var cssPosition = {}; - switch (betterMessages.position) { - case 'center': - vertical = ($(window).height() - message_box.height()) / 2; - horizontal = ($(window).width() - message_box.width()) / 2; - cssPosition = {top: vertical + 'px', left: horizontal + 'px'}; - break; - case 'tl': - cssPosition = {top: vertical + 'px', left: horizontal + 'px'}; - break; - case 'tr': - cssPosition = {top: vertical + 'px', right: horizontal + 'px'}; - break; - case 'bl': - cssPosition = {bottom: vertical + 'px', left: horizontal + 'px'}; - break; - case 'br': - cssPosition = {bottom: vertical + 'px', right: horizontal + 'px'}; - break; - } - message_box.css(cssPosition); - - /* Here we control closing and opening effects and controls */ - setTimeout(function () { - betterMessages.open(); - }, betterMessages.opendelay * 1000); - - if (betterMessages.autoclose != 0) { - betterMessages.countDownClose(betterMessages.autoclose); - } - if (betterMessages.hover_autoclose == '1') { - message_box.hover(function () { - clearTimeout(betterMessages.countDown); - $('.better-messages-timer', message_box).fadeOut('slow'); - }); - } - $('.better-messages-close', message_box).click(function (event) { - betterMessages.close(); - event.preventDefault(); - }); - - /* Esc key handler for closing the message. This doesn't work on Safari or Chrome - See the issue here: http://code.google.com/p/chromium/issues/detail?id=14635 - */ - $(document).keypress(function (e) { - if (e.keyCode == 27) { - betterMessages.close(); - return e.preventDefault(); - } - }); - } - } - }; -})(jQuery); diff --git a/sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php b/sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php deleted file mode 100644 index b7069941c..000000000 --- a/sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php +++ /dev/null @@ -1,82 +0,0 @@ -getMessages()); - - $cacheability = new CacheableMetadata(); - // We cannot cache this context as literally a few lines below some message - // might be added. - $cacheability->setCacheMaxAge(0); - // Since messages are stored in session, we must vary by it. - $cacheability->addCacheContexts(['session']); - $context->addCacheableDependency($cacheability); - - $result['better_messages'] = $context; - - return $result; - } - - /** - * {@inheritdoc} - */ - public function getAvailableContexts() { - $context = new Context(new ContextDefinition('map', $this->t('Current status messages'))); - return ['better_messages' => $context]; - } - - /** - * Store currently rendered status messages. - * - * @param array $messages - * Messages array to store (supposedly it should be the currently rendered - * ones) - */ - public function setMessages(array $messages) { - $this->messages = $messages; - } - - /** - * Retrieve current status messages. - * - * @return array - * Array of current messages. It will either be a result of - * drupal_get_messages() or $this->messages should we already be beyond the - * phase of rendering status messages on the current page request - */ - protected function getMessages() { - return is_null($this->messages) ? drupal_get_messages(NULL, FALSE) : $this->messages; - } - -} diff --git a/sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php b/sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php deleted file mode 100644 index c6044046c..000000000 --- a/sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php +++ /dev/null @@ -1,356 +0,0 @@ -get('config.factory'), - $container->get('plugin.manager.condition'), - $container->get('context.repository') - ); - } - - /** - * BetterMessagesSettingsForm constructor. - */ - public function __construct(ConfigFactoryInterface $config_factory, ConditionManager $condition_manager, ContextRepositoryInterface $context_repository) { - parent::__construct($config_factory); - - $this->conditionManager = $condition_manager; - $this->contextRepository = $context_repository; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'better_messages_settings_form'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['better_messages.settings']; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('better_messages.settings'); - - $form_state->setTemporaryValue('gathered_contexts', $this->contextRepository->getAvailableContexts()); - - $settings = $config->get(); - - $form['position'] = array( - '#type' => 'details', - '#title' => $this->t('Messages positions and basic properties'), - '#weight' => -5, - '#open' => TRUE - ); - - $form['position']['pos'] = array( - '#type' => 'radios', - '#title' => $this->t('Set position of Message'), - '#default_value' => $settings['position'], - '#description' => $this->t('Position of message relative to screen'), - '#attributes' => array('class' => array('better-messages-admin-radios')), - '#options' => array( - 'center' => $this->t('Center screen'), - 'tl' => $this->t('Top left'), - 'tr' => $this->t('Top right'), - 'bl' => $this->t('Bottom left'), - 'br' => $this->t('Bottom right'), - ), - ); - - $form['position']['fixed'] = array( - '#type' => 'checkbox', - '#default_value' => $settings['fixed'], - '#title' => $this->t('Keep fixed position of message as you scroll.'), - ); - - $form['position']['width'] = array( - '#type' => 'textfield', - '#title' => $this->t('Custom width'), - '#description' => $this->t('Width in pixel (e.g. 400px) or percentage (e.g. 100%). Leave empty if you prefer your theme to control the width.'), - '#default_value' => $settings['width'], - '#size' => 20, - '#maxlength' => 20, - ); - - $form['position']['horizontal'] = array( - '#type' => 'textfield', - '#title' => $this->t('Left/Right spacing'), - '#default_value' => $settings['horizontal'], - '#size' => 20, - '#maxlength' => 20, - '#required' => TRUE, - '#field_suffix' => $this->t('px'), - '#states' => [ - 'invisible' => [ - ':input[name="pos"]' => ['value' => 'center'], - ], - ], - ); - - $form['position']['vertical'] = array( - '#type' => 'textfield', - '#title' => $this->t('Top/Down spacing'), - '#default_value' => $settings['vertical'], - '#size' => 20, - '#maxlength' => 20, - '#required' => TRUE, - '#field_suffix' => $this->t('px'), - '#states' => [ - 'invisible' => [ - ':input[name="pos"]' => ['value' => 'center'], - ], - ], - ); - - $form['animation'] = array( - '#type' => 'details', - '#title' => $this->t('Messages animation settings'), - '#weight' => -3, - '#open' => TRUE, - ); - - $form['animation']['popin_effect'] = array( - '#type' => 'select', - '#title' => $this->t('Pop-in (show) message box effect'), - '#default_value' => $settings['popin']['effect'], - '#options' => array( - 'fadeIn' => $this->t('Fade in'), - 'slideDown' => $this->t('Slide down'), - ), - ); - - $form['animation']['popin_duration'] = array( - '#type' => 'textfield', - '#title' => $this->t('Duration of (show) effect'), - '#description' => $this->t('A string representing one of the three predefined speeds ("slow", "normal", or "fast").
Or the number of milliseconds to run the animation (e.g. 1000).'), - '#default_value' => $settings['popin']['duration'], - '#size' => 20, - '#maxlength' => 20, - ); - - $form['animation']['popout_effect'] = array( - '#type' => 'select', - '#title' => $this->t('Pop-out (close) message box effect'), - '#default_value' => $settings['popout']['effect'], - '#options' => array( - 'fadeIn' => $this->t('Fade out'), - 'slideUp' => $this->t('Slide Up'), - ), - ); - - $form['animation']['popout_duration'] = array( - '#type' => 'textfield', - '#title' => $this->t('Duration of (close) effect'), - '#description' => $this->t('A string representing one of the three predefined speeds ("slow", "normal", or "fast").
Or the number of milliseconds to run the animation (e.g. 1000).'), - '#default_value' => $settings['popout']['duration'], - '#size' => 20, - '#maxlength' => 20, - ); - - $form['animation']['autoclose'] = array( - '#type' => 'textfield', - '#title' => $this->t('Number of seconds to auto close after the page has loaded'), - '#description' => $this->t('0 for never. You can set it as 0.25 for quarter second'), - '#default_value' => $settings['autoclose'], - '#size' => 20, - '#maxlength' => 20, - ); - - $form['animation']['disable_autoclose'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Disable auto close if messages include an error message'), - '#default_value' => $settings['disable_autoclose'], - ); - - $form['animation']['show_countdown'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Show countdown timer'), - '#default_value' => $settings['show_countdown'], - ); - - $form['animation']['hover_autoclose'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Stop auto close timer when hover'), - '#default_value' => $settings['hover_autoclose'], - ); - - $form['animation']['open_delay'] = array( - '#type' => 'textfield', - '#title' => $this->t('Number of seconds to delay message after the page has loaded'), - '#description' => $this->t('0 for never. You can set it as 0.25 for quarter second'), - '#default_value' => $settings['opendelay'], - '#size' => 20, - '#maxlength' => 20, - ); - - $form['jquery_ui'] = array( - '#type' => 'details', - '#title' => $this->t('jQuery UI enhancements'), - '#weight' => 10, - '#description' => $this->t('These settings require jQuery UI.'), - '#open' => TRUE, - ); - - $form['jquery_ui']['draggable'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Make Better Messages draggable'), - '#default_value' => $settings['jquery_ui']['draggable'], - ); - $form['jquery_ui']['resizable'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Make Better Messages resizable'), - '#default_value' => $settings['jquery_ui']['resizable'], - ); - - $form['visibility'] = $this->buildVisibility([], $form_state); - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - foreach ($form_state->getValue('visibility') as $condition_id => $values) { - // All condition plugins use 'negate' as a Boolean in their schema. - // However, certain form elements may return it as 0/1. Cast here to - // ensure the data is in the expected type. - if (array_key_exists('negate', $values)) { - $form_state->setValue(['visibility', $condition_id, 'negate'], (bool) $values['negate']); - } - - // Allow the condition to validate the form. - $condition = $form_state->get(['conditions', $condition_id]); - $condition->validateConfigurationForm($form['visibility'][$condition_id], SubformState::createForSubform($form['visibility'][$condition_id], $form, $form_state)); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('better_messages.settings'); - $config->set('position', $form_state->getValue('pos')) - ->set('fixed', $form_state->getValue('fixed')) - ->set('width', $form_state->getValue('width')) - ->set('horizontal', intval($form_state->getValue('horizontal'))) - ->set('vertical', intval($form_state->getValue('vertical'))) - ->set('popin.effect', $form_state->getValue('popin_effect')) - ->set('popin.duration', $form_state->getValue('popin_duration')) - ->set('popout.effect', $form_state->getValue('popout_effect')) - ->set('popout.duration', $form_state->getValue('popout_duration')) - ->set('autoclose', $form_state->getValue('autoclose')) - ->set('disable_autoclose', $form_state->getValue('disable_autoclose')) - ->set('show_countdown', $form_state->getValue('show_countdown')) - ->set('hover_autoclose', $form_state->getValue('hover_autoclose')) - ->set('opendelay', $form_state->getValue('open_delay')) - ->set('jquery_ui.draggable', $form_state->getValue('draggable')) - ->set('jquery_ui.resizable', $form_state->getValue('resizable')) - ->set('visibility', []); - - foreach ($form_state->getValue('visibility') as $condition_id => $values) { - // Allow the condition to submit the form. - $condition = $form_state->get(['conditions', $condition_id]); - $condition->submitConfigurationForm($form['visibility'][$condition_id], SubformState::createForSubform($form['visibility'][$condition_id], $form, $form_state)); - $config->set('visibility.' . $condition_id, $condition->getConfiguration()); - } - - $config->save(); - - parent::submitForm($form, $form_state); - } - - /** - * Generate form elements for visibility controls. - * - * @param array $form - * Form array chunk where the genreated visibility controls will be embedded - * @param \Drupal\Core\Form\FormStateInterface $form_state - * Form state that corresponds to $form - * - * @return array - * Form elements for visibility controls - */ - protected function buildVisibility($form, FormStateInterface $form_state) { - $form['#tree'] = TRUE; - - $form['visibility_tabs'] = [ - '#type' => 'vertical_tabs', - '#title' => $this->t('Visibility'), - '#parents' => ['visibility_tabs'], - ]; - - $visibility = $this->config($this->getEditableConfigNames()[0])->get('visibility'); - foreach ($this->conditionManager->getDefinitionsForContexts($form_state->getTemporaryValue('gathered_contexts')) as $condition_id => $definition) { - /** @var \Drupal\Core\Condition\ConditionInterface $condition */ - $condition = $this->conditionManager->createInstance($condition_id, isset($visibility[$condition_id]) ? $visibility[$condition_id] : []); - $form_state->set(['conditions', $condition_id], $condition); - $condition_form = $condition->buildConfigurationForm([], $form_state); - $condition_form['#type'] = 'details'; - $condition_form['#title'] = $condition->getPluginDefinition()['label']; - $condition_form['#group'] = 'visibility_tabs'; - $form[$condition_id] = $condition_form; - } - - // The "current_theme" condition is very raw, and has bugs: - // https://www.drupal.org/node/2787529 and - // https://www.drupal.org/node/2787529 - // so we prefer to ditch it. - unset($form['current_theme']); - - if (isset($form['request_path'])) { - $form['request_path']['#title'] = $this->t('Pages'); - $form['request_path']['negate']['#type'] = 'radios'; - $form['request_path']['negate']['#default_value'] = (int) $form['request_path']['negate']['#default_value']; - $form['request_path']['negate']['#title_display'] = 'invisible'; - $form['request_path']['negate']['#options'] = [ - $this->t('Show for the listed pages'), - $this->t('Hide for the listed pages'), - ]; - } - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php b/sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php deleted file mode 100644 index 340bc3a8b..000000000 --- a/sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php +++ /dev/null @@ -1,92 +0,0 @@ - []] + parent::defaultConfiguration(); - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form['message_types'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Message types'), - '#default_value' => $this->configuration['message_types'], - '#options' => $this->messageTypeOptions(), - '#description' => $this->t('Specify for which message types to active the condition. Leaving empty means for all message types.'), - ]; - return parent::buildConfigurationForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->configuration['message_types'] = array_values(array_filter($form_state->getValue('message_types'))); - parent::submitConfigurationForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function summary() { - $message_labels = array_intersect_key($this->messageTypeOptions(), array_combine($this->configuration['message_types'], $this->configuration['message_types'])); - return implode(', ', $message_labels); - } - - /** - * {@inheritdoc} - */ - public function evaluate() { - $messages = $this->getContextValue('better_messages'); - $intersect = array_intersect($this->configuration['message_types'], array_keys($messages)); - return empty($this->configuration['message_types']) || !empty($intersect); - } - - /** - * Retrieve a list of known message types. - * - * @return array - * Array of known message types. Keys are their machine names whereas values - * are the corresponding human friendly labels - */ - protected function messageTypeOptions() { - return [ - 'status' => $this->t('Status'), - 'warning' => $this->t('Warning'), - 'error' => $this->t('Error'), - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig b/sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig deleted file mode 100644 index 69c8a10a4..000000000 --- a/sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig +++ /dev/null @@ -1,24 +0,0 @@ -{# -/** - * @file - * Default theme for better_messages_wrapper theme hook. - * - * Wrap the system messages into additional markup required for presenting the - * messages in an overlay. - * - * Available variables: - * - children: The system messages - */ -#} - -
- {%block children%} -
- {{ children }} -
- {% if attributes.hasClass('better-messages-overlay') %} - - {% endif %} - {%endblock%} -
- diff --git a/sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt b/sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/bulkdelete/README.txt b/sites/all/modules/contrib/admin/bulkdelete/README.txt deleted file mode 100644 index 9f6d53424..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Installation - * Configuration - - -INTRODUCTION ------------- - -This module will delete any nodes of a certain node-type using the batch api. -It is advised to use the Views Batch Operations module (VBO) for a small number -of nodes. But if you have to delete 10.000 nodes this module might be a better -option. - - -INSTALLATION ------------- - -The bulkdelete.module is very similar to other Drupal modules. For installation -of the bulkdelete module please follow the below mentioned steps: - -• Install as usual -• Enable the bulkdelete module. - - -CONFIGURATION -------------- - -• There is no configuration for this module. diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml deleted file mode 100644 index 1a512112b..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Bulk Delete -type: module -description: 'Adds an administrative option to bulk delete nodes by content type using the batch API.' -# core: 8.x -configure: bulkdelete.admin - -# Information added by Drupal.org packaging script on 2017-05-23 -version: '8.x-1.x-dev' -core: '8.x' -project: 'bulkdelete' -datestamp: 1495565589 diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml deleted file mode 100644 index 680b8450a..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml +++ /dev/null @@ -1,6 +0,0 @@ -# bulkdelete.links.task.yml snippet -bulkdelete.admin: - route_name: bulkdelete.admin - title: Bulk delete nodes - base_route: system.admin_content - weight: 11 diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module deleted file mode 100644 index 21feba4e3..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module +++ /dev/null @@ -1,24 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('This module will delete any nodes of a certain node-type - using the batch api. It is advised to use the Views Batch Operations module (VBO) - for a small number of nodes. But if you have to delete 10.000 nodes this module - might be a better option.') . '

'; - return $output; - } -} diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml deleted file mode 100644 index 9507f61b6..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -bulkdelete nodes: - title: 'Access bulk delete nodes' - description: 'Access bulkdelete.' - restrict access: true diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml deleted file mode 100644 index d320bff97..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml +++ /dev/null @@ -1,8 +0,0 @@ -# bulkdelete.routing.yml snippet -bulkdelete.admin: - path: '/admin/content/bulkdelete' - defaults: - _form: '\Drupal\bulkdelete\Form\BulkDeleteForm' - _title: 'Bulk delete nodes' - requirements: - _permission: 'bulkdelete nodes' diff --git a/sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php b/sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php deleted file mode 100644 index a5fa35ac7..000000000 --- a/sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php +++ /dev/null @@ -1,154 +0,0 @@ - $values) { - $query = \Drupal::entityQuery('node') - // Filter by content type. - ->condition('type', $key) - // Count. - ->count(); - $count = $query->execute(); - if ($count > 0) { - $options[$key] = $values->get('name') . " ($count)"; - } - } - if (empty($options)) { - $form['default_msg'] = [ - '#type' => 'item', - '#markup' => $this->t('Node not available.'), - ]; - } - else { - $form['types'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Content types for deletion'), - '#options' => $options, - '#description' => $this->t('All nodes of these types will be deleted using the batch API.'), - ]; - - $form['actions']['#type'] = 'actions'; - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Delete'), - '#button_type' => 'primary', - ]; - } - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $types = array_filter($values['types']); - if (count($types) > 0) { - try { - foreach ($types as $bundle) { - $result = db_select('node'); - $query = $result->fields('node', ['nid']); - $query = $result->condition('type', $bundle); - $query = $result->execute()->fetchAll(); - $last_row = count($query); - $operations = []; - if (!empty($last_row)) { - $message = t('All nodes of type @content mark for deletion', ['@content' => $bundle]); - \Drupal::logger('bulkdelete')->notice($message); - // Create batch of 20 nodes. - $count = 1; - foreach ($query as $row) { - $nids[] = $row->nid; - if ($count % 20 === 0 || $count === $last_row) { - $operations[] = [ - [get_class($this), - 'processBatch', - ], - [$nids], - ]; - $nids = []; - } - ++$count; - } - // Set up the Batch API. - $batch = [ - 'operations' => $operations, - 'finished' => [get_class($this), 'bulkDeleteFinishedBatch'], - 'title' => $this->t('Node bulk delete'), - 'init_message' => $this->t('Starting nodes deletion.'), - 'progress_message' => $this->t('Completed @current step of @total.'), - 'error_message' => $this->t('Bulk node deletion has encountered an error.'), - ]; - batch_set($batch); - } - } - } - catch (Exception $e) { - foreach ($e->getErrors() as $error_message) { - drupal_set_message($error_message, 'error'); - } - } - } - } - - /** - * Processes the bulk node deletion. - * - * @param array $nids - * Node nid. - * @param array $context - * The batch context. - */ - public static function processBatch(array $nids, array &$context) { - entity_delete_multiple('node', $nids); - } - - /** - * Batch finish function. - * - * This function is called by the batch 'finished' parameter. - * The cache must not be cleared as the last batch operation, - * but after the batch is finished. - * - * @param bool $success - * Indicates if the batch was successfully finished. - * @param array $results - * The value of the results item from the context variable used in the batch - * processing. - * @param array $operations - * If the success parameter is false then this is a list of the operations - * that haven't completed yet. - */ - public static function bulkDeleteFinishedBatch($success, array $results, array $operations) { - drupal_flush_all_caches(); - $message = $success ? t('Bulkdelete performed successfully.') : t('Bulkdelete has not been finished successfully.'); - \Drupal::logger('bulkdelete')->notice($message); - drupal_set_message($message); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/LICENSE.txt b/sites/all/modules/contrib/admin/config_update/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/config_update/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/config_update/README.txt b/sites/all/modules/contrib/admin/config_update/README.txt deleted file mode 100644 index c493d6b1f..000000000 --- a/sites/all/modules/contrib/admin/config_update/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -Configuration Update Manager project ------------------------------------- - -The Configuration Update Manager project consists of two modules: - -Configuration Update Base: A base module providing functionality related to - updating and computing differences between configuration versions. No - user interface; used by other modules such as Features. - -Configuration Update Reports (in the config_update_ui sub-directory of this - project): Adds an updates report and revert functionality to configuration - management. Depends on Configuration Update Base. For more information, see - the README.txt file in the subdirectory. diff --git a/sites/all/modules/contrib/admin/config_update/config_update.info.yml b/sites/all/modules/contrib/admin/config_update/config_update.info.yml deleted file mode 100644 index fbd94845c..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Configuration Update Base -type: module -description: 'Provides basic revert and update functionality for other modules' -# core: 8.x -dependencies: - - drupal:config - -# Information added by Drupal.org packaging script on 2018-12-17 -version: '8.x-1.6' -core: '8.x' -project: 'config_update' -datestamp: 1545090489 diff --git a/sites/all/modules/contrib/admin/config_update/config_update.module b/sites/all/modules/contrib/admin/config_update/config_update.module deleted file mode 100644 index df775d320..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update.module +++ /dev/null @@ -1,21 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Configuration Update Base module provides functionality that other modules can use, related to updating and computing differences between configuration versions. This module does not provide any end-user functionality itself.') . '

'; - return $output; - } -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update.services.yml b/sites/all/modules/contrib/admin/config_update/config_update.services.yml deleted file mode 100644 index 2a2586086..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update.services.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - config_update.config_diff: - class: Drupal\config_update\ConfigDiffer - arguments: ['@string_translation'] - - config_update.config_list: - class: Drupal\config_update\ConfigListerWithProviders - arguments: ['@entity.manager', '@config.storage', '@config_update.extension_storage', '@config_update.extension_optional_storage', '@module_handler', '@theme_handler'] - - config_update.config_update: - class: Drupal\config_update\ConfigReverter - arguments: ['@entity.manager', '@config.storage', '@config_update.extension_storage', '@config_update.extension_optional_storage', '@config.factory', '@event_dispatcher'] - - config_update.extension_storage: - class: Drupal\Core\Config\ExtensionInstallStorage - arguments: ['@config.storage'] - - config_update.extension_optional_storage: - class: Drupal\Core\Config\ExtensionInstallStorage - arguments: ['@config.storage', 'config/optional'] diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt b/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt deleted file mode 100644 index 5773062e6..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt +++ /dev/null @@ -1,173 +0,0 @@ -Configuration Update Reports module ------------------------------------ - -CONTENTS OF THIS README FILE -- Introduction -- Installation -- Generating reports in the user interface -- Generating reports using Drush commands -- Important notes *** Be sure to read this section *** - - -INTRODUCTION - -This module provides a report that allows you to see the differences between the -default configuration items provided by the current versions of your installed -modules, themes, and install profile, and the active configuration of your -site. From this report, you can also import new configuration provided by -updates, and revert your site configuration to the provided values. - -The main use case is: You update a module, and it has either changed default -configuration that it provides, or added new default configuration items that -you didn't get when you first installed the module. You want to be able to -import the new items, view the differences between the active site configuration -and the changed configuration, and possibly "revert" (or it may be an update) to -the newly-provided default configuration. - - -INSTALLATION - -Install the module in the normal way for Drupal modules. The only dependencies -are the Configuration Manager module (Drupal core), and the Configuration Update -Base module (part of this same project download). - - -GENERATING REPORTS IN THE USER INTERFACE - -You can generate configuration reports at Administration >> Configuration >> -Development >> Configuration management >> Update report (path: -admin/config/development/configuration/report ). - -You can generate a report for a particular type of configuration object, such as -Actions, Tours, Views, etc. Or, you can generate a report for an installed -module, theme, or install profile. Finally, you can generate a report that -contains all configuration in one report. - -The report has three sections, depending on what type you choose: - -1. Missing configuration items: Configuration items that are provided as - defaults by your currently-installed modules, themes, and install profile - that are missing from your active site configuration. - - Any items listed here can be imported into your site. - -2. Added configuration items: Configuration items that you added to the site - (not provided by a currently-installed module, theme, or install - profile). This section is only shown when you are running the report based on - a configuration type. - - Items listed here can be exported, which is useful for developers or if you - want to keep your site configuration in a version control system. - -3. Changed configuration items: Configuration items that are in your active site - configuration that differ from the same item currently being provided by an - installed module, theme, or install profile. - - You can export these items, see the differences between what is on your site - and what the module/theme/profile is currently providing, or "revert" to the - version currently being provided by the module/theme/profile in its default - configuration. - - Note that the differences may be a bit hard to read, but hopefully they'll - give you the general idea of what has changed. - - -GENERATING REPORTS USING DRUSH COMMANDS - -The reports detailed in the previous section can also be generated, in pieces, -using Drush commands (https://drupal.org/project/drush): - -drush config-list-types (clt) - Lists all the config types on your system. Reports can be run for - 'system.simple' (simple configuration), and 'system.all' (all types), in - addition to the types listed by this command. - -drush config-added-report (cra) -drush config-missing-report (crm) -drush config-different-report (crd) -drush config-inactive-report (cri) - Run config reports (see below). - -drush config-diff (cfd) - Show config differences for one item between active and imported (see below). - -The report commands run reports that tell what config has been added, is -missing, is inactive, or is different between your active site configuration and -the imported default configuration from config/install directories of your -installed profile, modules, and themes. - -For each report except "added", the first argument is one of: -- type: Runs the report for a configuration type; use drush config-list-types to - list them. -- module: Runs the report for an installed module. -- theme: Runs the report for an installed theme. -- profile: Runs the report for the install profile. - -The second argument for reports is the machine name of the configuration type, -module, theme, or install profile you want to run the report for. For the -"added" report, this is the only argument, as the added report is always by -configuration type. - -These are the same as the reports you get in the UI, which is described above; -the difference is that in Drush the report is separated into pieces, and the -UI report sections have more columns giving information about each config item. - -Once you have found a configuration item with differences, you can view the -differences using the config-diff command. This is a normalized/formatted diff -like in the UI of this module, so see above for details. - -Drush examples: - -drush clt -drush crm module node -drush cra block -drush crd theme bartik -drush crd type system.all -drush crd type system.simple -drush crd profile standard -drush cfd block.block.bartik_search - -Once you have figured out which configuration items are added, missing, or -different, you can: - -- Export them - see drush config-export. - -- Import missing configuration or revert to provided default values. There are -Drush commands to do this: - -drush config-revert (cfr) - Revert a config item found in a "different" report to the current version in - the module, theme, or install profile that provides it. - -drush config-revert-multiple (cfrm) - Revert all config items of one type or from one module, theme, or install - profile to the provided versions. - -drush config-import-missing (cfi) - Import a config item found in a "missing" or "inactive" report from the - current version in the module, theme, or install profile that provides it. - -You can also to use the drush config-import command to import/update multiple -configuration items. But this requires that you locate the files containing the -configuration you want to import, and copy them to your configuration staging -directory. - - -IMPORTANT NOTES - -Here are some notes about how this module functions: - -* This module is always looking at the base configuration items, without - overrides (from settings.php, for example) or translations. - -* It is possible for an install profile on a site to provide configuration that - overrides configuration from a module or theme. The install profile version - always takes precedence. As an example, consider the case where module Foo - provides a configuration item called foo.settings, and install profile Bar - overrides this with its own file. Any reports that include foo.settings will - be based on the differences between your site's active configuration and the - version in the install profile. This is not usually a problem, but it can be - confusing if you're looking at the Foo module report. The foo.settings item - will be present, but the differences reported will be between the install - profile's version and your site's active configuration, not the differences - between the Foo module version and your site's active configuration. diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc deleted file mode 100644 index e4d77bd41..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc +++ /dev/null @@ -1,356 +0,0 @@ - 'List config types', - 'aliases' => ['clt'], - 'core' => ['8+'], - 'outputformat' => [ - 'default' => 'list', - ], - ]; - - $items['config-added-report'] = [ - 'description' => 'Display a list of config items that did not come from your installed modules, themes, or install profile', - 'arguments' => [ - 'name' => 'The type of config to report on. See config-list-types to list them. You can also use system.all for all types, or system.simple for simple config.', - ], - 'required-arguments' => 1, - 'examples' => [ - 'drush config-added-report action' => 'Displays the added config report for action config.', - ], - 'aliases' => ['cra'], - 'core' => ['8+'], - 'outputformat' => [ - 'default' => 'list', - ], - ]; - - $items['config-missing-report'] = [ - 'description' => 'Display a list of config items from your installed modules, themes, or install profile that are not currently in your active config', - 'arguments' => [ - 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.', - 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.', - ], - 'required-arguments' => 2, - 'examples' => [ - 'drush config-missing-report type action' => 'Displays the missing config report for action config.', - ], - 'aliases' => ['crm'], - 'core' => ['8+'], - 'outputformat' => [ - 'default' => 'list', - ], - ]; - - $items['config-inactive-report'] = [ - 'description' => 'Display a list of optional config items from your installed modules, themes, or install profile that are not currently in your active config', - 'arguments' => [ - 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.', - 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.', - ], - 'required-arguments' => 2, - 'examples' => [ - 'drush config-inactive-report type action' => 'Displays the inactive config report for action config.', - ], - 'aliases' => ['cri'], - 'core' => ['8+'], - 'outputformat' => [ - 'default' => 'list', - ], - ]; - - $items['config-different-report'] = [ - 'description' => 'Display a list of config items that differ from the versions provided by your installed modules, themes, or install profile. See config-diff to show what the differences are.', - 'arguments' => [ - 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.', - 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.', - ], - 'required-arguments' => 2, - 'examples' => [ - 'drush config-different-report type action' => 'Displays the differing config report for action config.', - ], - 'aliases' => ['crd'], - 'core' => ['8+'], - 'outputformat' => [ - 'default' => 'list', - ], - ]; - - $items['config-diff'] = [ - 'description' => 'Display line-by-line differences for one config item between your active config and the version currently being provided by an installed module, theme, or install profile', - 'arguments' => [ - 'name' => 'The config item to diff. See config-different-report to list config items that are different.', - ], - 'required-arguments' => 1, - 'examples' => [ - 'drush config-diff block.block.bartik_search' => 'Displays the config differences for the search block in the Bartik theme.', - ], - 'aliases' => ['cfd'], - 'core' => ['8+'], - ]; - - $items['config-revert'] = [ - 'description' => 'Revert one config item in active storage to the version provided by an installed module, theme, or install profile.', - 'arguments' => [ - 'name' => 'The config item to revert. See config-different-report to list config items that are different.', - ], - 'required-arguments' => 1, - 'examples' => [ - 'drush config-revert block.block.bartik_search' => 'Revert the config for the search block in the Bartik theme to the version provided by the install profile.', - ], - 'aliases' => ['cfr'], - 'core' => ['8+'], - ]; - - $items['config-import-missing'] = [ - 'description' => 'Import a missing or inactive config item provided by an installed module, theme, or install profile. Be sure that requirements are met.', - 'arguments' => [ - 'name' => 'The name of the config item to import (usually the ID you would see in the user interface). See config-missing-report to list config items that are missing, and config-inactive-report to list config items that are inactive.', - ], - 'required-arguments' => 1, - 'examples' => [ - 'drush config-import-missing block.block.bartik_search' => 'Import the config for the search block in the Bartik theme from the version provided by the install profile.', - ], - 'aliases' => ['cfi'], - 'core' => ['8+'], - ]; - - $items['config-revert-multiple'] = [ - 'description' => 'Revert a set of config items to the versions provided by installed modules, themes, or install profiles. A set is all differing items from one extension, or one type of configuration.', - 'arguments' => [ - 'type' => 'Type of set to revert: "module" for all items from a module, "theme" for all items from a theme, "profile" for all items from the install profile, or "type" for all items of one config entity type. See config-different-report to list config items that are different.', - 'name' => 'The machine name of the module, theme, etc. to revert items of. All items in the corresponding config-different-report will be reverted.', - ], - 'required-arguments' => 2, - 'examples' => [ - 'drush config-revert-multiple type action' => 'Revert all differing config items of type action.', - ], - 'aliases' => ['cfrm'], - 'core' => ['8+'], - ]; - - return $items; -} - -/** - * Lists available config types. - */ -function drush_config_update_ui_config_list_types() { - $list = []; - - $definitions = \Drupal::service('config_update.config_list')->listTypes(); - return array_keys($definitions); -} - -/** - * Runs the config added report. - * - * @param string $name - * Type of config to report on. - */ -function drush_config_update_ui_config_added_report($name) { - list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig('type', $name); - - $added = array_diff($active_list, $install_list, $optional_list); - - if (!count($added)) { - drush_print(dt('No added config'), 0, STDERR); - } - - sort($added); - return $added; -} - -/** - * Runs the config missing report. - * - * @param string $type - * Type of report to run: 'type', 'module', 'theme', or 'profile'. - * @param string $name - * Machine name of item to report on. - */ -function drush_config_update_ui_config_missing_report($type, $name) { - list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name); - - $missing = array_diff($install_list, $active_list); - if (!count($missing)) { - drush_print(dt('No missing config'), 0, STDERR); - } - - sort($missing); - return $missing; -} - -/** - * Runs the config inactive report. - * - * @param string $type - * Type of report to run: 'type', 'module', 'theme', or 'profile'. - * @param string $name - * Machine name of item to report on. - */ -function drush_config_update_ui_config_inactive_report($type, $name) { - list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name); - - $missing = array_diff($optional_list, $active_list); - if (!count($missing)) { - drush_print(dt('No inactive config'), 0, STDERR); - } - - sort($missing); - return $missing; -} - -/** - * Runs the config different report. - * - * @param string $type - * Type of report to run: 'type', 'module', 'theme', or 'profile'. - * @param string $name - * Machine name of item to report on. - */ -function drush_config_update_ui_config_different_report($type, $name) { - list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name); - - $reverter = \Drupal::service('config_update.config_update'); - $differ = \Drupal::service('config_update.config_diff'); - - $added = array_diff($active_list, $install_list, $optional_list); - $both = array_diff($active_list, $added); - $different = []; - foreach ($both as $name) { - $active = $reverter->getFromActive('', $name); - $extension = $reverter->getFromExtension('', $name); - if (!$differ->same($active, $extension)) { - $different[] = $name; - } - } - - if (!count($different)) { - drush_print(dt('No different config'), 0, STDERR); - } - - sort($different); - return $different; -} - -/** - * Runs the drush config-diff command. - * - * @param string $name - * Config item to diff. - */ -function drush_config_update_ui_config_diff($name) { - $reverter = \Drupal::service('config_update.config_update'); - $differ = \Drupal::service('config_update.config_diff'); - $formatter = new DiffFormatter(); - - $extension = $reverter->getFromExtension('', $name); - $active = $reverter->getFromActive('', $name); - if ($extension && $active) { - $diff = $differ->diff($extension, $active); - $output = $formatter->format($diff); - return $output; - } - else { - drush_print(dt('Config is missing, cannot diff'), 0, STDERR); - return ''; - } -} - -/** - * Runs the drush config-revert command. - * - * @param string $name - * Config item to revert. - */ -function drush_config_update_ui_config_revert($name) { - $lister = \Drupal::service('config_update.config_list'); - $reverter = \Drupal::service('config_update.config_update'); - $manager = \Drupal::service('entity.manager'); - - // The revert command needs the type and the unprefixed name. - $type = $lister->getTypeNameByConfigName($name); - // The lister gives NULL if simple configuration, but the reverter expects - // 'system.simple' so we convert it. - if ($type === NULL) { - $type = 'system.simple'; - } - $shortname = $name; - if ($type != 'system.simple') { - $definition = $manager->getDefinition($type); - $prefix = $definition->getConfigPrefix() . '.'; - if (strpos($name, $prefix) === 0) { - $shortname = substr($name, strlen($prefix)); - } - } - - if ($reverter->revert($type, $shortname)) { - drush_print(dt('The configuration item @name was reverted to its source.', ['@name' => $name])); - } - else { - drush_print(dt('There was an error and the configuration item @name was not reverted.', ['@name' => $name]), 0, STDERR); - } -} - -/** - * Runs the drush config-import-missing command. - * - * @param string $name - * Name of config item to import, without prefix. - */ -function drush_config_update_ui_config_import_missing($name) { - $lister = \Drupal::service('config_update.config_list'); - $reverter = \Drupal::service('config_update.config_update'); - $manager = \Drupal::service('entity.manager'); - - // The import command needs the type and the unprefixed name. - $type = $lister->getTypeNameByConfigName($name); - $shortname = $name; - if ($type && $type != 'system.simple') { - $definition = $manager->getDefinition($type); - $prefix = $definition->getConfigPrefix() . '.'; - if (strpos($name, $prefix) === 0) { - $shortname = substr($name, strlen($prefix)); - } - } - - if ($reverter->import($type, $shortname)) { - drush_print(dt('The configuration item @name was imported from its source.', ['@name' => $name])); - } - else { - drush_print(dt('There was an error and the configuration item @name was not imported.', ['@name' => $name]), 0, STDERR); - drush_print(dt('The configuration was imported from its source.')); - } -} - -/** - * Runs the drush config-revert-multiple command. - * - * @param string $type - * Type of config to revert: 'type', 'module', 'theme', or 'profile'. - * @param string $name - * Machine name of type to revert. - */ -function drush_config_update_ui_config_revert_multiple($type, $name) { - // This command will print an error if there are no items to revert. - $different = drush_config_update_ui_config_different_report($type, $name); - foreach ($different as $name) { - // This command will print a message if it succeeds or fails for each item. - drush_config_update_ui_config_revert($name); - } -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc deleted file mode 100644 index 2c11acde9..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc +++ /dev/null @@ -1,31 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Configuration Update Reports module provides a report that allows you to see the differences between the default configuration provided by the current versions of your installed modules, themes, and install profile, and the active configuration of your site. From this report, you can also import new configuration provided by updates, and revert your active configuration to the provided default values.') . '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '
'; - $output .= '
' . t('Checking for configuration differences') . ''; - $output .= '
' . t('The Updates report shows you configuration that differs between your site\'s active configuration and the installed modules, themes, and install profile. Choose a particular configuration type (or All), or run the report for a particular module, theme, or your install profile.', [':report' => Url::fromRoute('config_update_ui.report')->toString()]) . '
'; - $output .= '
'; - return $output; - - case 'config_update_ui.report': - $output = ''; - $output .= '

' . t('This report shows which default configuration items provided by the current versions of your installed modules, themes, and install profile differ from the active configuration of your site. You can generate the report for all configuration of a certain type; for a particular installed module, theme, or your install profile (only modules, themes, and install profiles that actually provide configuration are listed); or for all configuration.') . '

'; - $output .= '

' . t('Some configuration provided by modules has dependencies, and is only added to your system when all the dependencies are satisfied. This is known as optional configuration.') . '

'; - $output .= '

' . t('Differences, including missing and added configuration, can be due to either an updated module or theme providing different configuration from when you installed it, or to changes made by site administrators. This report does not differentiate between these two sources for differences, and note that an install profile can also silently override module/theme configuration. Overrides (such as those in your settings.php file) and translations are not considered when looking at differences.') . '

'; - return $output; - - case 'config_update_ui.diff': - return '

' . t('Most configuration is organized into a hierarchy of settings; at a minimum, it is a one-level hierarchy where each setting has a name and a value, and the hierarchy comes in when some of the settings have multiple components.') . '

' . t('Configuration items are normalized and formatted before computing differences. The normalization step alphabetizes the components at each level of the hierarchy, and removes a few components whose differences should be ignored, such as the UUID. The formatting step shows the full hierarchy of each configuration value with :: separators for the hierarchy levels, and a : separator between the lowest-level setting name and the value, so that in a line-by-line diff you can always see which values are actually different. Green lines with + signs have been added, and yellow lines with - signs have been removed.') . '

' . t('Note that differences are considering the base configuration, without overrides from your settings.php file, or translations.') . '

'; - } -} - -/** - * Implements hook_menu_links_discovered_alter(). - */ -function config_update_ui_menu_links_discovered_alter(&$links) { - if (\Drupal::moduleHandler()->moduleExists('admin_toolbar_tools')) { - // Add the Updates report link to the Tools menu, but only if the - // Admin Toolbar Extra Tools module is present. - $links['admin_toolbar_tools.config.update'] = [ - 'title' => t('Updates report'), - 'route_name' => 'config_update_ui.report', - 'menu_name' => 'admin', - 'parent' => 'config.sync', - 'weight' => 3, - ]; - } -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml deleted file mode 100644 index bedd4a938..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml +++ /dev/null @@ -1,8 +0,0 @@ -view config updates report: - title: 'View configuration updates report' -revert configuration: - title: 'Revert any configuration' - restrict access: true -delete configuration: - title: 'Delete any configuration' - restrict access: true diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml deleted file mode 100644 index 9f2f35585..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml +++ /dev/null @@ -1,43 +0,0 @@ -config_update_ui.report: - path: '/admin/config/development/configuration/report/{report_type}/{name}' - defaults: - _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::report' - _title: 'Updates report' - report_type: NULL - name: NULL - requirements: - _permission: 'view config updates report' - -config_update_ui.import: - path: '/admin/config/development/configuration/report/import/{config_type}/{config_name}' - defaults: - _title: 'Import' - _form: '\Drupal\config_update_ui\Form\ConfigImportConfirmForm' - requirements: - _permission: 'import configuration' - -config_update_ui.diff: - path: '/admin/config/development/configuration/report/diff/{config_type}/{config_name}' - defaults: - _title: 'Differences' - _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::diff' - config_type: NULL - config_name: NULL - requirements: - _permission: 'view config updates report' - -config_update_ui.revert: - path: '/admin/config/development/configuration/report/revert/{config_type}/{config_name}' - defaults: - _title: 'Revert' - _form: '\Drupal\config_update_ui\Form\ConfigRevertConfirmForm' - requirements: - _permission: 'revert configuration' - -config_update_ui.delete: - path: '/admin/config/development/configuration/report/delete/{config_type}/{config_name}' - defaults: - _title: 'Delete' - _form: '\Drupal\config_update_ui\Form\ConfigDeleteConfirmForm' - requirements: - _permission: 'delete configuration' diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css b/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css deleted file mode 100644 index 77b8d10b3..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file - * Styling for the Config Updates report. - */ - -table.config-update-report { - margin-top: 2em; -} - -table.config-update-report caption { - font-weight: bold; - font-size: 1.1em; -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php deleted file mode 100644 index 31ed06d7a..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php +++ /dev/null @@ -1,656 +0,0 @@ -configDiff = $config_diff; - $this->configList = $config_list; - $this->configRevert = $config_update; - $this->diffFormatter = $diff_formatter; - $this->diffFormatter->show_header = FALSE; - $this->moduleHandler = $module_handler; - $this->themeHandler = $theme_handler; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config_update.config_diff'), - $container->get('config_update.config_list'), - $container->get('config_update.config_update'), - $container->get('diff.formatter'), - $container->get('module_handler'), - $container->get('theme_handler'), - $container->get('config.factory') - ); - } - - /** - * Shows the diff between active and provided configuration. - * - * @param string $config_type - * The type of configuration. - * @param string $config_name - * The name of the config item, without the prefix. - * - * @return array - * Render array for page showing differences between them. - */ - public function diff($config_type, $config_name) { - $diff = $this->configDiff->diff( - $this->configRevert->getFromExtension($config_type, $config_name), - $this->configRevert->getFromActive($config_type, $config_name) - ); - - $build = []; - $definition = $this->configList->getType($config_type); - $config_type_label = ($definition) ? $definition->getLabel() : $this->t('Simple configuration'); - $build['#title'] = $this->t('Config difference for @type @name', ['@type' => $config_type_label, '@name' => $config_name]); - $build['#attached']['library'][] = 'system/diff'; - - $build['diff'] = [ - '#type' => 'table', - '#header' => [ - ['data' => $this->t('Source config'), 'colspan' => '2'], - ['data' => $this->t('Site config'), 'colspan' => '2'], - ], - '#rows' => $this->diffFormatter->format($diff), - '#attributes' => ['class' => ['diff']], - ]; - - $url = new Url('config_update_ui.report'); - - $build['back'] = [ - '#type' => 'link', - '#attributes' => [ - 'class' => [ - 'dialog-cancel', - ], - ], - '#title' => $this->t("Back to 'Updates report' page."), - '#url' => $url, - ]; - - return $build; - } - - /** - * Generates the config updates report. - * - * @param string $report_type - * (optional) Type of report to run: - * - type: Configuration entity type. - * - module: Module. - * - theme: Theme. - * - profile: Install profile. - * @param string $name - * (optional) Name of specific item to run report for (config entity type - * ID, module machine name, etc.). Ignored for profile. - * - * @return array - * Render array for report, with section at the top for selecting another - * report to run. If either $report_type or $name is missing, the report - * itself is not generated. - */ - public function report($report_type = NULL, $name = NULL) { - $links = $this->generateReportLinks(); - - $report = $this->generateReport($report_type, $name); - if (!$report) { - return $links; - } - - // If there is a report, extract the title, put table of links in a - // details element, and add report to build. - $build = []; - $build['#title'] = $report['#title']; - unset($report['#title']); - - $build['links_wrapper'] = [ - '#type' => 'details', - '#title' => $this->t('Generate new report'), - '#children' => $links, - ]; - - $build['report'] = $report; - - $build['#attached']['library'][] = 'config_update/report_css'; - - return $build; - } - - /** - * Generates the operations links for running individual reports. - * - * @return array - * Render array for the operations links for running reports. - */ - protected function generateReportLinks() { - - // These links are put into an 'operations' render array element. They do - // not look good outside of tables. Also note that the array index in - // operations links is used as a class on the LI element. Some classes are - // special in the Seven CSS, such as "contextual", so avoid hitting these - // accidentally by prefixing. - $build = []; - - $build['links'] = [ - '#type' => 'table', - '#header' => [ - $this->t('Report type'), - $this->t('Report on'), - ], - '#rows' => [], - ]; - - // Full report of all configuration. - $links['report_full'] = [ - 'title' => $this->t('Everything'), - 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => 'system.all']), - ]; - $build['links']['#rows'][] = [ - $this->t('Full report'), - [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ], - ]; - - // Reports by configuration type. - $definitions = $this->configList->listTypes(); - $links = []; - foreach ($definitions as $entity_type => $definition) { - $links['report_type_' . $entity_type] = [ - 'title' => $definition->getLabel(), - 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => $entity_type]), - ]; - } - - uasort($links, [$this, 'sortLinks']); - - $links = [ - 'report_type_system.simple' => [ - 'title' => $this->t('Simple configuration'), - 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => 'system.simple']), - ], - ] + $links; - - $build['links']['#rows'][] = [ - $this->t('Single configuration type'), - [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ], - ]; - - // Make a list of installed modules. - $profile = $this->getProfileName(); - $modules = $this->moduleHandler->getModuleList(); - $links = []; - foreach ($modules as $machine_name => $module) { - if ($machine_name != $profile && $this->configList->providerHasConfig('module', $machine_name)) { - $links['report_module_' . $machine_name] = [ - 'title' => $this->moduleHandler->getName($machine_name), - 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'module', 'name' => $machine_name]), - ]; - } - } - uasort($links, [$this, 'sortLinks']); - - $build['links']['#rows'][] = [ - $this->t('Single module'), - [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ], - ]; - - // Make a list of installed themes. - $themes = $this->themeHandler->listInfo(); - $links = []; - foreach ($themes as $machine_name => $theme) { - if ($this->configList->providerHasConfig('theme', $machine_name)) { - $links['report_theme_' . $machine_name] = [ - 'title' => $this->themeHandler->getName($machine_name), - 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'theme', 'name' => $machine_name]), - ]; - } - } - uasort($links, [$this, 'sortLinks']); - - $build['links']['#rows'][] = [ - $this->t('Single theme'), - [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ], - ]; - - $links = []; - - // Profile is just one option. - if ($this->configList->providerHasConfig('profile', $profile)) { - $links['report_profile_' . $profile] = [ - 'title' => $this->moduleHandler->getName($profile), - 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'profile']), - ]; - $build['links']['#rows'][] = [ - $this->t('Installation profile'), - [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ], - ]; - } - - return $build; - } - - /** - * Generates a report about config updates. - * - * @param string $report_type - * Type of report to generate: 'type', 'module', 'theme', or 'profile'. - * @param string $value - * Machine name of a configuration type, module, or theme to generate the - * report for. Ignored for profile, since that uses the active profile. - * - * @return array - * Render array for the updates report. Empty if invalid or missing - * report type or value. - */ - protected function generateReport($report_type, $value) { - // Figure out what to name the report, and incidentally, validate that - // $value exists for this type of report. - switch ($report_type) { - case 'type': - if ($value == 'system.all') { - $label = $this->t('All configuration'); - } - elseif ($value == 'system.simple') { - $label = $this->t('Simple configuration'); - } - else { - $definition = $this->configList->getType($value); - if (!$definition) { - return NULL; - } - - $label = $this->t('@name configuration', ['@name' => $definition->getLabel()]); - } - - break; - - case 'module': - $list = $this->moduleHandler->getModuleList(); - if (!isset($list[$value])) { - return NULL; - } - - $label = $this->t('@name module', ['@name' => $this->moduleHandler->getName($value)]); - break; - - case 'theme': - $list = $this->themeHandler->listInfo(); - if (!isset($list[$value])) { - return NULL; - } - - $label = $this->t('@name theme', ['@name' => $this->themeHandler->getName($value)]); - break; - - case 'profile': - $profile = $this->getProfileName(); - $label = $this->t('@name profile', ['@name' => $this->moduleHandler->getName($profile)]); - break; - - default: - return NULL; - } - - // List the active and extension-provided config. - list($active_list, $install_list, $optional_list) = $this->configList->listConfig($report_type, $value); - - // Build the report. - $build = []; - - $build['#title'] = $this->t('Configuration updates report for @label', ['@label' => $label]); - $build['report_header'] = ['#markup' => '

' . $this->t('Updates report') . '

']; - - // List items missing from site. - $removed = array_diff($install_list, $active_list); - $build['removed'] = [ - '#caption' => $this->t('Missing configuration items'), - '#empty' => $this->t('None: all provided configuration items are in your active configuration.'), - ] + $this->makeReportTable($removed, 'extension', ['import']); - - // List optional items that are not installed. - $inactive = array_diff($optional_list, $active_list); - $build['inactive'] = [ - '#caption' => $this->t('Inactive optional items'), - '#empty' => $this->t('None: all optional configuration items are in your active configuration.'), - ] + $this->makeReportTable($inactive, 'extension', ['import']); - - // List items added to site, which only makes sense in the report for a - // config type. - $added = array_diff($active_list, $install_list, $optional_list); - if ($report_type == 'type') { - $build['added'] = [ - '#caption' => $this->t('Added configuration items'), - '#empty' => $this->t('None: all active configuration items of this type were provided by modules, themes, or install profile.'), - ] + $this->makeReportTable($added, 'active', ['export', 'delete']); - } - - // For differences, we need to go through the array of config in both - // and see if each config item is the same or not. - $both = array_diff($active_list, $added); - $different = []; - foreach ($both as $name) { - if (!$this->configDiff->same( - $this->configRevert->getFromExtension('', $name), - $this->configRevert->getFromActive('', $name) - )) { - $different[] = $name; - } - } - $build['different'] = [ - '#caption' => $this->t('Changed configuration items'), - '#empty' => $this->t('None: no active configuration items differ from their current provided versions.'), - ] + $this->makeReportTable($different, 'active', - ['diff', 'export', 'revert']); - - return $build; - } - - /** - * Builds a table for the report. - * - * @param string[] $names - * List of machine names of config items for the table. - * @param string $storage - * Config storage the items can be loaded from, either 'active' or - * 'extension'. - * @param string[] $actions - * Action links to include, one or more of: - * - diff - * - revert - * - export - * - import - * - delete. - * - * @return array - * Render array for the table, not including the #empty and #prefix - * properties. - */ - protected function makeReportTable(array $names, $storage, array $actions) { - $build = []; - - $build['#type'] = 'table'; - - $build['#attributes'] = ['class' => ['config-update-report']]; - - $build['#header'] = [ - 'name' => [ - 'data' => $this->t('Machine name'), - ], - 'label' => [ - 'data' => $this->t('Label (if any)'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - 'type' => [ - 'data' => $this->t('Type'), - 'class' => [RESPONSIVE_PRIORITY_MEDIUM], - ], - 'provider' => [ - 'data' => $this->t('Provider'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - 'operations' => [ - 'data' => $this->t('Operations'), - ], - ]; - - $build['#rows'] = []; - - foreach ($names as $name) { - $row = []; - if ($storage == 'active') { - $config = $this->configRevert->getFromActive('', $name); - } - else { - $config = $this->configRevert->getFromExtension('', $name); - } - - // Figure out what type of config it is, and get the ID. - $entity_type = $this->configList->getTypeNameByConfigName($name); - - if (!$entity_type) { - // This is simple config. - $id = $name; - $label = ''; - $type_label = $this->t('Simple configuration'); - $entity_type = 'system.simple'; - } - else { - $definition = $this->configList->getType($entity_type); - $id_key = $definition->getKey('id'); - $id = $config[$id_key]; - // The label key is not required. - if ($label_key = $definition->getKey('label')) { - $label = $config[$label_key]; - } - else { - $label = ''; - } - - $type_label = $definition->getLabel(); - } - - $row[] = $name; - $row[] = $label; - $row[] = $type_label; - $provider = $this->configList->getConfigProvider($name); - $provider_name = ''; - if (!empty($provider)) { - switch ($provider[0]) { - case 'profile': - $provider_name = $this->moduleHandler->getName($provider[1]); - if ($provider_name) { - $provider_name = $this->t('@name profile', ['@name' => $provider_name]); - } - else { - $provider_name = ''; - } - break; - - case 'module': - $provider_name = $this->moduleHandler->getName($provider[1]); - if ($provider_name) { - $provider_name = $this->t('@name module', ['@name' => $provider_name]); - } - else { - $provider_name = ''; - } - break; - - case 'theme': - $provider_name = $this->themeHandler->getName($provider[1]); - if ($provider_name) { - $provider_name = $this->t('@name theme', ['@name' => $provider_name]); - } - else { - $provider_name = ''; - } - break; - } - } - $row[] = $provider_name; - - $links = []; - $routes = [ - 'export' => 'config.export_single', - 'import' => 'config_update_ui.import', - 'diff' => 'config_update_ui.diff', - 'revert' => 'config_update_ui.revert', - 'delete' => 'config_update_ui.delete', - ]; - $titles = [ - 'export' => $this->t('Export'), - 'import' => $this->t('Import from source'), - 'diff' => $this->t('Show differences'), - 'revert' => $this->t('Revert to source'), - 'delete' => $this->t('Delete'), - ]; - - foreach ($actions as $action) { - $links[$action] = [ - 'url' => Url::fromRoute($routes[$action], ['config_type' => $entity_type, 'config_name' => $id]), - 'title' => $titles[$action], - ]; - } - - $row[] = [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ]; - - $build['#rows'][] = $row; - } - - return $build; - } - - /** - * Compares links for uasort(), to sort by displayed link title. - */ - protected static function sortLinks($link1, $link2) { - $title1 = $link1['title']; - $title2 = $link2['title']; - if ($title1 == $title2) { - return 0; - } - return ($title1 < $title2) ? -1 : 1; - } - - /** - * Returns the name of the install profile. - * - * For backwards compatibility with pre/post 8.3.x, tries to get it from - * either configuration or settings. - * - * @return string - * The name of the install profile. - */ - protected function getProfileName() { - // Code adapted from DrupalKernel::getInstalProfile() in Core. - // In Core 8.3.x or later, read from config. - $profile = $this->configFactory->get('core.extension')->get('profile'); - if (!empty($profile)) { - return $profile; - } - else { - // If system_update_8300() has not yet run, use settings. - return Settings::get('install_profile'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php deleted file mode 100644 index c11e9ba94..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php +++ /dev/null @@ -1,144 +0,0 @@ -configList = $config_list; - $this->configRevert = $config_update; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config_update.config_list'), - $container->get('config_update.config_update') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'config_delete_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - if ($this->type == 'system.simple') { - $type_label = $this->t('Simple configuration'); - } - else { - $definition = $this->configList->getType($this->type); - if (!$definition) { - // Make a 404 error if the type doesn't exist. - throw new NotFoundHttpException(); - } - $type_label = $definition->get('label'); - } - - // To delete, the configuration item must exist in active storage. Check - // that and make a 404 error if not. - $active = $this->configRevert->getFromActive($this->type, $this->name); - if (!$active) { - throw new NotFoundHttpException(); - } - - return $this->t('Are you sure you want to delete the %type config %item?', ['%type' => $type_label, '%item' => $this->name]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('config_update_ui.report'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('This action cannot be undone. Manually deleting configuration from this page can cause problems on your site due to missing dependencies, and should only be done if there is no other way to delete a problematic piece of configuration.'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) { - $this->type = $config_type; - $this->name = $config_name; - - $form = parent::buildForm($form, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->configRevert->delete($this->type, $this->name); - - $this->messenger()->addMessage($this->t('The configuration %item has been deleted.', ['%item' => $this->name])); - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php deleted file mode 100644 index 2d064f6e2..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php +++ /dev/null @@ -1,146 +0,0 @@ -configList = $config_list; - $this->configRevert = $config_update; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config_update.config_list'), - $container->get('config_update.config_update') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'config_import_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - if ($this->type == 'system.simple') { - $type_label = $this->t('Simple configuration'); - } - else { - $definition = $this->configList->getType($this->type); - if (!$definition) { - // Make a 404 error if the type doesn't exist. - throw new NotFoundHttpException(); - } - $type_label = $definition->get('label'); - } - - // To import (as opposed to revert), the configuration item must exist in - // extension storage but not active storage, so check that, and make a 404 - // error if not. - $extension = $this->configRevert->getFromExtension($this->type, $this->name); - $active = $this->configRevert->getFromActive($this->type, $this->name); - if (!$extension || $active) { - throw new NotFoundHttpException(); - } - - return $this->t('Are you sure you want to import the %type config %item from its source configuration?', ['%type' => $type_label, '%item' => $this->name]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('config_update_ui.report'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Configuration will be added to your site. This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Import'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) { - $this->type = $config_type; - $this->name = $config_name; - - $form = parent::buildForm($form, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->configRevert->import($this->type, $this->name); - - $this->messenger()->addMessage($this->t('The configuration %item has been imported from its source.', ['%item' => $this->name])); - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php deleted file mode 100644 index 8785d0fc5..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php +++ /dev/null @@ -1,146 +0,0 @@ -configList = $config_list; - $this->configRevert = $config_update; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config_update.config_list'), - $container->get('config_update.config_update') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'config_update_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - if ($this->type == 'system.simple') { - $type_label = $this->t('Simple configuration'); - } - else { - $definition = $this->configList->getType($this->type); - if (!$definition) { - // Make a 404 error if the type doesn't exist. - throw new NotFoundHttpException(); - } - $type_label = $definition->get('label'); - } - - // To revert (as opposed to import), the configuration item must exist in - // both active storage and extension storage, so check that and make a 404 - // error if not. - $extension = $this->configRevert->getFromExtension($this->type, $this->name); - $active = $this->configRevert->getFromActive($this->type, $this->name); - if (!$extension || !$active) { - throw new NotFoundHttpException(); - } - - return $this->t('Are you sure you want to revert the %type config %item to its source configuration?', ['%type' => $type_label, '%item' => $this->name]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('config_update_ui.report'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Customizations will be lost. This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Revert'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) { - $this->type = $config_type; - $this->name = $config_name; - - $form = parent::buildForm($form, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->configRevert->revert($this->type, $this->name); - - $this->messenger()->addMessage($this->t('The configuration %item has been reverted to its source.', ['%item' => $this->name])); - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php deleted file mode 100644 index f2ced76e1..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php +++ /dev/null @@ -1,101 +0,0 @@ -adminUser = $this->createUser([ - 'access administration pages', - 'administer themes', - 'view config updates report', - 'synchronize configuration', - 'export configuration', - 'import configuration', - 'revert configuration', - 'delete configuration', - ]); - $this->drupalLogin($this->adminUser); - } - - /** - * Tests that config overrides work as expected. - */ - public function testConfigOverrides() { - - // The Standard install profile contains a system.theme.yml file that - // sets up bartik/seven as the default/admin theme. The default config - // from the System module has no admin theme and stark as the default - // theme. So first, run the report on simple configuration and verify - // that system.theme is not shown (it should not be missing, or added, - // or overridden). - $this->drupalGet('admin/config/development/configuration/report/type/system.simple'); - $session = $this->assertSession(); - $session->responseNotContains('system.theme'); - - // Go to the Appearance page and change the theme to whatever is currently - // disabled. Return to the report and verify that system.theme is there, - // since it is now overridden. - $this->drupalGet('admin/appearance'); - $this->clickLink('Install and set as default'); - $this->drupalGet('admin/config/development/configuration/report/type/system.simple'); - $session = $this->assertSession(); - $session->pageTextContains('system.theme'); - - // Look at the differences for system.theme and verify it's against - // the standard profile version, not default version. The line for - // default should show bartik as the source; if it's against the system - // version, the word bartik would not be there. - $this->drupalGet('admin/config/development/configuration/report/diff/system.simple/system.theme'); - $session = $this->assertSession(); - $session->pageTextContains('bartik'); - - // Revert and verify that it reverted to the profile version, not the - // system module version. - $this->drupalGet('admin/config/development/configuration/report/revert/system.simple/system.theme'); - $this->drupalPostForm(NULL, [], 'Revert'); - $this->drupalGet('admin/config/development/configuration/single/export/system.simple/system.theme'); - $session = $this->assertSession(); - $session->pageTextContains('admin: seven'); - $session->pageTextContains('default: bartik'); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php deleted file mode 100644 index 4f2c943d1..000000000 --- a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php +++ /dev/null @@ -1,544 +0,0 @@ -adminUser = $this->createUser([ - 'access administration pages', - 'administer search', - 'view config updates report', - 'synchronize configuration', - 'export configuration', - 'import configuration', - 'revert configuration', - 'delete configuration', - 'administer filters', - ]); - $this->drupalLogin($this->adminUser); - - // Make sure local tasks and page title are showing. - $this->placeBlock('local_tasks_block'); - $this->placeBlock('page_title_block'); - - // Load the Drush include file so that its functions can be tested, plus - // the Drush testing include file. - module_load_include('inc', 'config_update_ui', 'config_update_ui.drush_testing'); - module_load_include('inc', 'config_update_ui', 'config_update_ui.drush'); - } - - /** - * Tests the config report and its linked pages. - */ - public function testConfigReport() { - // Test links to report page. - $this->drupalGet('admin/config/development/configuration'); - $this->clickLink('Updates report'); - $this->assertNoReport(); - - // Verify the Drush list types command. - $output = implode("\n", drush_config_update_ui_config_list_types()); - $this->assertTrue(strpos($output, 'search_page') !== FALSE); - $this->assertTrue(strpos($output, 'node_type') !== FALSE); - $this->assertTrue(strpos($output, 'user_role') !== FALSE); - $this->assertTrue(strpos($output, 'block') !== FALSE); - - // Verify some empty reports. - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - $this->assertDrushReports('type', 'search_page', [], [], [], []); - - // Module, theme, and profile reports have no 'added' section. - $this->drupalGet('admin/config/development/configuration/report/module/search'); - $this->assertReport('Search module', [], [], [], [], ['added']); - $this->assertDrushReports('module', 'search', [], [], [], []); - $this->drupalGet('admin/config/development/configuration/report/theme/classy'); - $this->assertReport('Classy theme', [], [], [], [], ['added']); - $this->assertDrushReports('theme', 'classy', [], [], [], []); - - $inactive = ['locale.settings' => 'Simple configuration']; - $this->drupalGet('admin/config/development/configuration/report/profile'); - $this->assertReport('Testing profile', [], [], [], $inactive, ['added']); - // The locale.settings line should show that the Testing profile is the - // provider. - $session = $this->assertSession(); - $session->pageTextContains('Testing profile'); - $this->assertDrushReports('profile', '', [], [], [], array_keys($inactive)); - - // Verify that the user search page cannot be imported (because it already - // exists). - $this->drupalGet('admin/config/development/configuration/report/import/search_page/user_search'); - $session = $this->assertSession(); - $session->statusCodeEquals(404); - - // Delete the user search page from the search UI and verify report for - // both the search page config type and user module. - $this->drupalGet('admin/config/search/pages'); - $this->clickLink('Delete'); - $this->drupalPostForm(NULL, [], 'Delete'); - $inactive = ['search.page.user_search' => 'Users']; - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], $inactive); - // The search.page.user_search line should show that the User module is the - // provider. - $session = $this->assertSession(); - $session->pageTextContains('User module'); - $this->assertDrushReports('type', 'search_page', [], [], [], array_keys($inactive)); - - $this->drupalGet('admin/config/development/configuration/report/module/user'); - $this->assertReport('User module', [], [], [], $inactive, ['added', 'changed']); - $this->assertDrushReports('module', 'user', [], [], [], - [ - 'rdf.mapping.user.user', - 'search.page.user_search', - 'views.view.user_admin_people', - 'views.view.who_s_new', - 'views.view.who_s_online', - ], ['changed']); - - // Verify that the user search page cannot be reverted (because it does - // not already exist). - $this->drupalGet('admin/config/development/configuration/report/revert/search_page/user_search'); - $session = $this->assertSession(); - $session->statusCodeEquals(404); - // Verify that the delete URL doesn't work either. - $this->drupalGet('admin/config/development/configuration/report/delete/search_page/user_search'); - $session = $this->assertSession(); - $session->statusCodeEquals(404); - - // Use the import link to get it back. Do this from the search page - // report to make sure we are importing the right config. - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->clickLink('Import from source'); - $this->drupalPostForm(NULL, [], 'Import'); - $session = $this->assertSession(); - $session->pageTextContains('has been imported'); - $this->assertNoReport(); - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - $this->assertDrushReports('type', 'search_page', [], [], [], []); - - // Verify that after import, there is no config hash generated. - $this->drupalGet('admin/config/development/configuration/single/export/search_page/user_search'); - $session = $this->assertSession(); - $session->pageTextContains('id: user_search'); - $session->pageTextNotContains('default_config_hash:'); - - // Test importing again, this time using the Drush import command. - $this->drupalGet('admin/config/search/pages'); - $this->clickLink('Delete'); - $this->drupalPostForm(NULL, [], 'Delete'); - $inactive = ['search.page.user_search' => 'Users']; - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], $inactive); - drush_config_update_ui_config_import_missing('search.page.user_search'); - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - - // Edit the node search page from the search UI and verify report. - $this->drupalGet('admin/config/search/pages'); - $this->clickLink('Edit'); - $this->drupalPostForm(NULL, [ - 'label' => 'New label', - 'path' => 'new_path', - ], 'Save search page'); - $changed = ['search.page.node_search' => 'New label']; - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], $changed, []); - $this->assertDrushReports('type', 'search_page', [], [], array_keys($changed), []); - - // Test the show differences link. - $this->clickLink('Show differences'); - $session = $this->assertSession(); - $session->pageTextContains('Content'); - $session->pageTextContains('New label'); - $session->pageTextContains('node'); - $session->pageTextContains('new_path'); - - // Test the show differences Drush command. - $output = drush_config_update_ui_config_diff('search.page.node_search'); - $this->assertTrue(strpos($output, 'Content') !== FALSE); - $this->assertTrue(strpos($output, 'New label') !== FALSE); - $this->assertTrue(strpos($output, 'node') !== FALSE); - $this->assertTrue(strpos($output, 'new_path') !== FALSE); - - // Test the Back link. - $this->clickLink("Back to 'Updates report' page."); - $this->assertNoReport(); - - // Test the export link. - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->clickLink('Export'); - $session = $this->assertSession(); - $session->pageTextContains('Here is your configuration:'); - $session->pageTextContains('id: node_search'); - $session->pageTextContains('New label'); - $session->pageTextContains('path: new_path'); - $session->pageTextContains('search.page.node_search.yml'); - - // Grab the uuid and hash lines from the exported config for the next test. - $text = strip_tags($this->getSession()->getPage()->find('css', 'textarea')->getHtml()); - $matches = []; - preg_match('|^.*uuid:.*$|m', $text, $matches); - $uuid_line = trim($matches[0]); - preg_match('|^.*default_config_hash:.*$|m', $text, $matches); - $hash_line = trim($matches[0]); - - // Test reverting. - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->clickLink('Revert to source'); - $session = $this->assertSession(); - $session->pageTextContains('Are you sure you want to revert'); - $session->pageTextContains('Search page'); - $session->pageTextContains('node_search'); - $session->pageTextContains('Customizations will be lost. This action cannot be undone'); - $this->drupalPostForm(NULL, [], 'Revert'); - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - - // Verify that the uuid and hash keys were retained in the revert. - $this->drupalGet('admin/config/development/configuration/single/export/search_page/node_search'); - $session = $this->assertSession(); - $session->pageTextContains('id: node_search'); - $session->pageTextContains($uuid_line); - $session->pageTextContains($hash_line); - - // Test reverting again, this time using Drush single revert command. - $this->drupalGet('admin/config/search/pages'); - $this->clickLink('Edit'); - $this->drupalPostForm(NULL, [ - 'label' => 'New label', - 'path' => 'new_path', - ], 'Save search page'); - $changed = ['search.page.node_search' => 'New label']; - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], $changed, []); - drush_config_update_ui_config_revert('search.page.node_search'); - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - - // Test reverting again, this time using Drush multiple revert command. - $this->drupalGet('admin/config/search/pages'); - $this->clickLink('Edit'); - $this->drupalPostForm(NULL, [ - 'label' => 'New label', - 'path' => 'new_path', - ], 'Save search page'); - $changed = ['search.page.node_search' => 'New label']; - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], $changed, []); - drush_config_update_ui_config_revert_multiple('type', 'search_page'); - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - - // Add a new search page from the search UI and verify report. - $this->drupalPostForm('admin/config/search/pages', [ - 'search_type' => 'node_search', - ], 'Add search page'); - $this->drupalPostForm(NULL, [ - 'label' => 'test', - 'id' => 'test', - 'path' => 'test', - ], 'Save'); - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $added = ['search.page.test' => 'test']; - $this->assertReport('Search page', [], $added, [], []); - $this->assertDrushReports('type', 'search_page', [], array_keys($added), [], []); - - // Test the export link. - $this->clickLink('Export'); - $session = $this->assertSession(); - $session->pageTextContains('Here is your configuration:'); - $session->pageTextContains('id: test'); - $session->pageTextContains('label: test'); - $session->pageTextContains('path: test'); - $session->pageTextContains('search.page.test.yml'); - - // Test the delete link. - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->clickLink('Delete'); - $session = $this->assertSession(); - $session->pageTextContains('Are you sure'); - $session->pageTextContains('cannot be undone'); - $this->drupalPostForm(NULL, [], 'Delete'); - $session = $this->assertSession(); - $session->pageTextContains('has been deleted'); - - // And verify the report again. - $this->drupalGet('admin/config/development/configuration/report/type/search_page'); - $this->assertReport('Search page', [], [], [], []); - - // Change the search module config and verify the actions work for - // simple config. - $this->drupalPostForm('admin/config/search/pages', [ - 'minimum_word_size' => 4, - ], 'Save configuration'); - $changed = ['search.settings' => 'search.settings']; - $this->drupalGet('admin/config/development/configuration/report/module/search'); - $this->assertReport('Search module', [], [], $changed, [], ['added']); - - $this->clickLink('Show differences'); - $session = $this->assertSession(); - $session->pageTextContains('Config difference for Simple configuration search.settings'); - $session->pageTextContains('index::minimum_word_size'); - $session->pageTextContains('4'); - - $this->drupalGet('admin/config/development/configuration/report/module/search'); - $this->clickLink('Export'); - $session = $this->assertSession(); - $session->pageTextContains('minimum_word_size: 4'); - // Grab the hash line for the next test. - $text = strip_tags($this->getSession()->getPage()->find('css', 'textarea')->getHtml()); - $matches = []; - preg_match('|^.*default_config_hash:.*$|m', $text, $matches); - $hash_line = trim($matches[0]); - - $this->drupalGet('admin/config/development/configuration/report/module/search'); - $this->clickLink('Revert to source'); - $this->drupalPostForm(NULL, [], 'Revert'); - - // Verify that the hash was retained in the revert. - $this->drupalGet('admin/config/development/configuration/single/export/system.simple/search.settings'); - $session = $this->assertSession(); - $session->pageTextContains($hash_line); - - $this->drupalGet('admin/config/development/configuration/report/module/search'); - $this->assertReport('Search module', [], [], [], [], ['added']); - - // Edit the plain_text filter from the filter UI and verify report. - // The filter_format config type uses a label key other than 'label'. - $this->drupalPostForm('admin/config/content/formats/manage/plain_text', [ - 'name' => 'New label', - ], 'Save configuration'); - $changed = ['filter.format.plain_text' => 'New label']; - $this->drupalGet('admin/config/development/configuration/report/type/filter_format'); - $this->assertReport('Text format', [], [], $changed, []); - - // Verify that we can revert non-entity configuration in Drush. Issue: - // https://www.drupal.org/project/config_update/issues/2935395 - drush_config_update_ui_config_revert('system.date'); - } - - /** - * Asserts that the report page has the correct content. - * - * Assumes you are already on the report page. - * - * @param string $title - * Report title to check for. - * @param string[] $missing - * Array of items that should be listed as missing, name => label. - * @param string[] $added - * Array of items that should be listed as added, name => label. - * @param string[] $changed - * Array of items that should be listed as changed, name => label. - * @param string[] $inactive - * Array of items that should be listed as inactive, name => label. - * @param string[] $skip - * Array of report sections to skip checking. - */ - protected function assertReport($title, array $missing, array $added, array $changed, array $inactive, array $skip = []) { - $session = $this->assertSession(); - $session->pageTextContains('Configuration updates report for ' . $title); - $session->pageTextContains('Generate new report'); - - if (!in_array('missing', $skip)) { - $session->pageTextContains('Missing configuration items'); - if (count($missing)) { - foreach ($missing as $name => $label) { - $session->pageTextContains($name); - $session->pageTextContains($label); - } - $session->pageTextNotContains('None: all provided configuration items are in your active configuration.'); - } - else { - $session->pageTextContains('None: all provided configuration items are in your active configuration.'); - } - } - - if (!in_array('inactive', $skip)) { - $session->pageTextContains('Inactive optional items'); - if (count($inactive)) { - foreach ($inactive as $name => $label) { - $session->pageTextContains($name); - $session->pageTextContains($label); - } - $session->pageTextNotContains('None: all optional configuration items are in your active configuration.'); - } - else { - $session->pageTextContains('None: all optional configuration items are in your active configuration.'); - } - } - - if (!in_array('added', $skip)) { - $session->pageTextContains('Added configuration items'); - if (count($added)) { - foreach ($added as $name => $label) { - $session->pageTextContains($name); - $session->pageTextContains($label); - } - $session->pageTextNotContains('None: all active configuration items of this type were provided by modules, themes, or install profile.'); - } - else { - $session->pageTextContains('None: all active configuration items of this type were provided by modules, themes, or install profile.'); - } - } - - if (!in_array('changed', $skip)) { - $session->pageTextContains('Changed configuration items'); - if (count($changed)) { - foreach ($changed as $name => $label) { - $session->pageTextContains($name); - $session->pageTextContains($label); - } - $session->pageTextNotContains('None: no active configuration items differ from their current provided versions.'); - } - else { - $session->pageTextContains('None: no active configuration items differ from their current provided versions.'); - } - } - } - - /** - * Asserts that the Drush reports have the correct content. - * - * @param string $type - * Type of report to run (type, module, theme, etc.). - * @param string $name - * Name of that type to run (e.g., module machine name). - * @param string[] $missing - * Array of config items that should be listed as missing. - * @param string[] $added - * Array of config items that should be listed as added. - * @param string[] $changed - * Array of config items that should be listed as changed. - * @param string[] $inactive - * Array of config items that should be listed as inactive. - * @param string[] $skip - * Array of report sections to skip checking. - */ - protected function assertDrushReports($type, $name, array $missing, array $added, array $changed, array $inactive, array $skip = []) { - if (!in_array('missing', $skip)) { - $output = drush_config_update_ui_config_missing_report($type, $name); - $this->assertEquals(count($output), count($missing), 'Drush missing report has correct number of items'); - if (count($missing)) { - foreach ($missing as $item) { - $this->assertTrue(in_array($item, $output), "Item $item is in the Drush missing report"); - } - } - } - - if (!in_array('added', $skip) && $type == 'type') { - $output = drush_config_update_ui_config_added_report($name); - $this->assertEquals(count($output), count($added), 'Drush added report has correct number of items'); - if (count($added)) { - foreach ($added as $item) { - $this->assertTrue(in_array($item, $output), "Item $item is in the Drush added report"); - } - } - } - - if (!in_array('changed', $skip)) { - $output = drush_config_update_ui_config_different_report($type, $name); - $this->assertEquals(count($output), count($changed), 'Drush changed report has correct number of items'); - if (count($changed)) { - foreach ($changed as $item) { - $this->assertTrue(in_array($item, $output), "Item $item is in the Drush changed report"); - } - } - } - - if (!in_array('inactive', $skip)) { - $output = drush_config_update_ui_config_inactive_report($type, $name); - $this->assertEquals(count($output), count($inactive), 'Drush inactive report has correct number of items'); - if (count($inactive)) { - foreach ($inactive as $item) { - $this->assertTrue(in_array($item, $output), "Item $item is in the Drush inactive report"); - } - } - } - } - - /** - * Asserts that the report is not shown. - * - * Assumes you are already on the report form page. - */ - protected function assertNoReport() { - $session = $this->assertSession(); - $session->pageTextContains('Report type'); - $session->pageTextContains('Full report'); - $session->pageTextContains('Single configuration type'); - $session->pageTextContains('Single module'); - $session->pageTextContains('Single theme'); - $session->pageTextContains('Installation profile'); - $session->pageTextContains('Updates report'); - $session->pageTextNotContains('Missing configuration items'); - $session->pageTextNotContains('Added configuration items'); - $session->pageTextNotContains('Changed configuration items'); - $session->pageTextNotContains('Unchanged configuration items'); - - // Verify that certain report links are shown or not shown. For extensions, - // only extensions that have configuration should be shown. - // Modules. - $session->linkExists('Search'); - $session->linkExists('Field'); - $session->linkNotExists('Configuration Update Base'); - $session->linkNotExists('Configuration Update Reports'); - - // Themes. - $session->linkNotExists('Stark'); - $session->linkNotExists('Classy'); - - // Profiles. - $session->linkExists('Testing'); - - // Configuration types. - $session->linkExists('Everything'); - $session->linkExists('Simple configuration'); - $session->linkExists('Search page'); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/drupalci.yml b/sites/all/modules/contrib/admin/config_update/drupalci.yml deleted file mode 100644 index 59a556b5e..000000000 --- a/sites/all/modules/contrib/admin/config_update/drupalci.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This is the DrupalCI testbot build file for Configuration Update Manager. -# Learn to make one for your own drupal.org project: -# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing -build: - assessment: - validate_codebase: - phplint: - phpcs: - # phpcs will use core's specified version of Coder. - sniff-all-files: true - halt-on-fail: true - testing: - # run_tests task is executed several times in order of performance speeds. - # halt-on-fail can be set on the run_tests tasks in order to fail fast. - # suppress-deprecations is false in order to be alerted to usages of - # deprecated code. - run_tests.phpunit: - types: 'PHPUnit-Unit' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false - run_tests.kernel: - types: 'PHPUnit-Kernel' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false - run_tests.functional: - types: 'PHPUnit-Functional' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false - run_tests.javascript: - concurrency: 15 - types: 'PHPUnit-FunctionalJavascript' - testgroups: '--all' - suppress-deprecations: false - halt-on-fail: false diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php deleted file mode 100644 index 670885097..000000000 --- a/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -stringTranslation = $translation; - $this->hierarchyPrefix = $hierarchy_prefix; - $this->valuePrefix = $value_prefix; - $this->ignore = $ignore; - } - - /** - * Normalizes config for comparison. - * - * Removes elements in the ignore list from the top level of configuration, - * and at each level of the array, removes empty arrays and sorts by array - * key, so that config from different storage can be compared meaningfully. - * - * @param array|null $config - * Configuration array to normalize. - * - * @return array - * Normalized configuration array. - * - * @see ConfigDiffer::format() - * @see ConfigDiffer::$ignore - */ - protected function normalize($config) { - if (empty($config)) { - return []; - } - - // Remove "ignore" elements, only at the top level. - foreach ($this->ignore as $element) { - unset($config[$element]); - } - - // Recursively normalize and return. - return $this->normalizeArray($config); - } - - /** - * Recursively sorts an array by key, and removes empty arrays. - * - * @param array $array - * An array to normalize. - * - * @return array - * An array that is sorted by key, at each level of the array, with empty - * arrays removed. - */ - protected function normalizeArray(array $array) { - foreach ($array as $key => $value) { - if (is_array($value)) { - $new = $this->normalizeArray($value); - if (count($new)) { - $array[$key] = $new; - } - else { - unset($array[$key]); - } - } - } - - ksort($array); - return $array; - } - - /** - * {@inheritdoc} - */ - public function same($source, $target) { - $source = $this->normalize($source); - $target = $this->normalize($target); - return $source === $target; - } - - /** - * Formats config for showing differences. - * - * To compute differences, we need to separate the config into lines and use - * line-by-line differencer. The obvious way to split into lines is: - * @code - * explode("\n", Yaml::encode($config)) - * @endcode - * But this would highlight meaningless differences due to the often different - * order of config files, and also loses the indentation and context of the - * config hierarchy when differences are computed, making the difference - * difficult to interpret. - * - * So, what we do instead is to take the YAML hierarchy and format it so that - * the hierarchy is shown on each line. So, if you're in element - * $config['foo']['bar'] and the value is 'value', you will see - * 'foo::bar : value'. - * - * @param array $config - * Config array to format. Normalize it first if you want to do diffs. - * @param string $prefix - * (optional) When called recursively, the prefix to put on each line. Omit - * when initially calling this function. - * - * @return string[] - * Array of config lines formatted so that a line-by-line diff will show the - * context in each line, and meaningful differences will be computed. - * - * @see ConfigDiffer::normalize() - * @see ConfigDiffer::$hierarchyPrefix - * @see ConfigDiffer::$valuePrefix - */ - protected function format(array $config, $prefix = '') { - $lines = []; - - foreach ($config as $key => $value) { - $section_prefix = ($prefix) ? $prefix . $this->hierarchyPrefix . $key : $key; - - if (is_array($value)) { - $lines[] = $section_prefix; - $newlines = $this->format($value, $section_prefix); - foreach ($newlines as $line) { - $lines[] = $line; - } - } - else { - $lines[] = $section_prefix . $this->valuePrefix . Yaml::encode($value); - } - } - - return $lines; - } - - /** - * {@inheritdoc} - */ - public function diff($source, $target) { - $source = $this->normalize($source); - $target = $this->normalize($target); - - $source_lines = $this->format($source); - $target_lines = $this->format($target); - - return new Diff($source_lines, $target_lines); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php deleted file mode 100644 index 42ff515ed..000000000 --- a/sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -entityManager = $entity_manager; - $this->activeConfigStorage = $active_config_storage; - $this->extensionConfigStorage = $extension_config_storage; - $this->extensionOptionalConfigStorage = $extension_optional_config_storage; - } - - /** - * Sets up and returns the entity definitions list. - */ - public function listTypes() { - // Return list if it has already been calculated. - if (count($this->definitions)) { - return $this->definitions; - } - - // Calculate and return the list. - foreach ($this->entityManager->getDefinitions() as $entity_type => $definition) { - if ($definition->entityClassImplements('Drupal\Core\Config\Entity\ConfigEntityInterface')) { - $this->definitions[$entity_type] = $definition; - $prefix = $definition->getConfigPrefix(); - $this->typesByPrefix[$prefix] = $entity_type; - } - } - - ksort($this->definitions); - - return $this->definitions; - } - - /** - * {@inheritdoc} - */ - public function getType($name) { - $definitions = $this->listTypes(); - return isset($definitions[$name]) ? $definitions[$name] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getTypeByPrefix($prefix) { - $definitions = $this->listTypes(); - return isset($this->typesByPrefix[$prefix]) ? $definitions[$this->typesByPrefix[$prefix]] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getTypeNameByConfigName($name) { - $definitions = $this->listTypes(); - foreach ($this->typesByPrefix as $prefix => $entity_type) { - if (strpos($name, $prefix . '.') === 0) { - return $entity_type; - } - } - - return NULL; - } - - /** - * {@inheritdoc} - */ - public function listConfig($list_type, $name) { - $active_list = []; - $install_list = []; - $optional_list = []; - $definitions = $this->listTypes(); - - switch ($list_type) { - case 'type': - if ($name == 'system.all') { - $active_list = $this->activeConfigStorage->listAll(); - $install_list = $this->extensionConfigStorage->listAll(); - $optional_list = $this->extensionOptionalConfigStorage->listAll(); - } - elseif ($name == 'system.simple') { - // Listing is done by prefixes, and simple config doesn't have one. - // So list all and filter out all known prefixes. - $active_list = $this->omitKnownPrefixes($this->activeConfigStorage->listAll()); - $install_list = $this->omitKnownPrefixes($this->extensionConfigStorage->listAll()); - $optional_list = $this->omitKnownPrefixes($this->extensionOptionalConfigStorage->listAll()); - } - elseif (isset($this->definitions[$name])) { - $definition = $this->definitions[$name]; - $prefix = $definition->getConfigPrefix(); - $active_list = $this->activeConfigStorage->listAll($prefix); - $install_list = $this->extensionConfigStorage->listAll($prefix); - $optional_list = $this->extensionOptionalConfigStorage->listAll($prefix); - } - break; - - case 'profile': - $name = $this->getProfileName(); - // Intentional fall-through here to the 'module' or 'theme' case. - case 'module': - case 'theme': - $active_list = $this->activeConfigStorage->listAll(); - $install_list = $this->listProvidedItems($list_type, $name); - $optional_list = $this->listProvidedItems($list_type, $name, TRUE); - break; - } - - // This only seems to be a problem in unit tests, where a mock object - // is returning NULL instead of an empy array for some reason. - if (!is_array($optional_list)) { - $optional_list = []; - } - - return [$active_list, $install_list, $optional_list]; - } - - /** - * Returns a list of the install storage items for an extension. - * - * @param string $type - * Type of extension ('module', etc.). - * @param string $name - * Machine name of extension. - * @param bool $do_optional - * FALSE (default) to list config/install items, TRUE to list - * config/optional items. - * - * @return string[] - * List of config items provided by this extension. - */ - protected function listProvidedItems($type, $name, $do_optional = FALSE) { - $pathname = drupal_get_filename($type, $name); - $component = new Extension(\Drupal::root(), $type, $pathname); - if ($do_optional) { - $names = $this->extensionOptionalConfigStorage->getComponentNames([$component]); - } - else { - $names = $this->extensionConfigStorage->getComponentNames([$component]); - } - return array_keys($names); - } - - /** - * Omits config with known prefixes from a list of config names. - */ - protected function omitKnownPrefixes($list) { - $prefixes = array_keys($this->typesByPrefix); - $list = array_combine($list, $list); - foreach ($list as $name) { - foreach ($prefixes as $prefix) { - if (strpos($name, $prefix . '.') === 0) { - unset($list[$name]); - } - } - } - - return array_values($list); - } - - /** - * Returns the name of the install profile. - * - * For backwards compatibility with pre/post 8.3.x, tries to get it from - * either configuration or settings. - * - * @return string - * The name of the install profile. - */ - protected function getProfileName() { - // Code adapted from DrupalKernel::getInstalProfile() in Core. - // In Core 8.3.x or later, read from config. - $config = $this->activeConfigStorage->read('core.extension'); - if (!empty($config['profile'])) { - return $config['profile']; - } - else { - // If system_update_8300() has not yet run, use settings. - return Settings::get('install_profile'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php b/sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php deleted file mode 100644 index 5c50c9892..000000000 --- a/sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php +++ /dev/null @@ -1,148 +0,0 @@ -entityManager = $entity_manager; - $this->activeConfigStorage = $active_config_storage; - $this->extensionConfigStorage = $extension_config_storage; - $this->extensionOptionalConfigStorage = $extension_optional_config_storage; - $this->moduleHandler = $module_handler; - $this->themeHandler = $theme_handler; - } - - /** - * Sets up and returns the config providers list. - */ - public function listProviders() { - // Return the list if it has already been set up. - if (count($this->providers)) { - return $this->providers; - } - - // Calculate if it hasn't been set up yet. - // List all of the profile, modules, and themes. - $extensionsToDo = []; - $profile = $this->getProfileName(); - $extensionsToDo[] = ['profile', $profile]; - $modules = $this->moduleHandler->getModuleList(); - foreach ($modules as $machine_name => $module) { - if ($machine_name != $profile) { - $extensionsToDo[] = ['module', $machine_name]; - } - } - - $themes = $this->themeHandler->listInfo(); - foreach ($themes as $machine_name => $theme) { - $extensionsToDo[] = ['theme', $machine_name]; - } - - // For each extension, figure out if it has config, and make an index of - // config item => provider. - $this->extensionsWithConfig = [ - 'profile' => [], - 'module' => [], - 'theme' => [], - ]; - - foreach ($extensionsToDo as $item) { - $type = $item[0]; - $name = $item[1]; - $configs = array_merge($this->listProvidedItems($type, $name), - $this->listProvidedItems($type, $name, TRUE)); - if (!empty($configs)) { - $this->extensionsWithConfig[$type][$name] = $name; - foreach ($configs as $config) { - $this->providers[$config] = [$type, $name]; - } - } - } - - return $this->providers; - } - - /** - * {@inheritdoc} - */ - public function getConfigProvider($name) { - $providers = $this->listProviders(); - - return (isset($providers[$name])) ? $providers[$name] : NULL; - } - - /** - * {@inheritdoc} - */ - public function providerHasConfig($type, $name) { - // Make sure the list of extensions with configuration has been generated. - $this->listProviders(); - - return isset($this->extensionsWithConfig[$type][$name]); - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php deleted file mode 100644 index 90944a15f..000000000 --- a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php +++ /dev/null @@ -1,66 +0,0 @@ -type = $type; - $this->name = $name; - } - - /** - * Returns the type of configuration being imported or reverted. - * - * @return string - * The type of configuration, either 'system.simple' or a config entity - * type machine name. - */ - public function getType() { - return $this->type; - } - - /** - * Returns the name of the config item, without prefix. - * - * @return string - * The name of the config item being imported/reverted/deleted, with the - * prefix. - */ - public function getName() { - return $this->name; - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php deleted file mode 100644 index c0ef26d60..000000000 --- a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php +++ /dev/null @@ -1,96 +0,0 @@ -entityManager = $entity_manager; - $this->activeConfigStorage = $active_config_storage; - $this->extensionConfigStorage = $extension_config_storage; - $this->extensionOptionalConfigStorage = $extension_optional_config_storage; - $this->configFactory = $config_factory; - $this->dispatcher = $dispatcher; - } - - /** - * {@inheritdoc} - */ - public function import($type, $name) { - // Read the config from the file. Note: Do not call getFromExtension() here - // because we need $full_name below. - $full_name = $this->getFullName($type, $name); - $value = FALSE; - if ($full_name) { - $value = $this->extensionConfigStorage->read($full_name); - if (!$value) { - $value = $this->extensionOptionalConfigStorage->read($full_name); - } - } - if (!$value) { - return FALSE; - } - - // Save it as a new config entity or simple config. - if ($type == 'system.simple') { - $this->configFactory->getEditable($full_name)->setData($value)->save(); - } - else { - $entity_storage = $this->entityManager->getStorage($type); - $entity = $entity_storage->createFromStorageRecord($value); - $entity->save(); - } - - // Trigger an event notifying of this change. - $event = new ConfigRevertEvent($type, $name); - $this->dispatcher->dispatch(ConfigRevertInterface::IMPORT, $event); - - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function revert($type, $name) { - // Read the config from the file. Note: Do not call getFromExtension() here - // because we need $full_name below. - $value = FALSE; - $full_name = $this->getFullName($type, $name); - if ($full_name) { - $value = $this->extensionConfigStorage->read($full_name); - if (!$value) { - $value = $this->extensionOptionalConfigStorage->read($full_name); - } - } - if (!$value) { - return FALSE; - } - - // Make sure the configuration exists currently in active storage. - if (!$this->activeConfigStorage->read($full_name)) { - return FALSE; - } - - // Load the current config and replace the value, retaining the config - // hash (which is part of the _core config key's value). - if ($type == 'system.simple') { - $config = $this->configFactory->getEditable($full_name); - $core = $config->get('_core'); - $config - ->setData($value) - ->set('_core', $core) - ->save(); - } - else { - $definition = $this->entityManager->getDefinition($type); - $id_key = $definition->getKey('id'); - $id = $value[$id_key]; - $entity_storage = $this->entityManager->getStorage($type); - $entity = $entity_storage->load($id); - $core = $entity->get('_core'); - $entity = $entity_storage->updateFromStorageRecord($entity, $value); - $entity->set('_core', $core); - $entity->save(); - } - - // Trigger an event notifying of this change. - $event = new ConfigRevertEvent($type, $name); - $this->dispatcher->dispatch(ConfigRevertInterface::REVERT, $event); - - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function delete($type, $name) { - $config = FALSE; - $full_name = $this->getFullName($type, $name); - if ($full_name) { - // Make sure the configuration exists currently in active storage. - if (!$this->activeConfigStorage->read($full_name)) { - return FALSE; - } - $config = $this->configFactory->getEditable($full_name); - } - if (!$config) { - return FALSE; - } - $config->delete(); - - // Trigger an event notifying of this change. - $event = new ConfigRevertEvent($type, $name); - $this->dispatcher->dispatch(ConfigDeleteInterface::DELETE, $event); - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function getFromActive($type, $name) { - $full_name = $this->getFullName($type, $name); - if ($full_name) { - return $this->activeConfigStorage->read($full_name); - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getFromExtension($type, $name) { - $value = FALSE; - $full_name = $this->getFullName($type, $name); - if ($full_name) { - $value = $this->extensionConfigStorage->read($full_name); - if (!$value) { - $value = $this->extensionOptionalConfigStorage->read($full_name); - } - } - return $value; - } - - /** - * Returns the full name of a config item. - * - * @param string $type - * The config type, or '' to indicate $name is already prefixed. - * @param string $name - * The config name, without prefix. - * - * @return string - * The config item's full name, or FALSE if there is an error. - */ - protected function getFullName($type, $name) { - if ($type == 'system.simple' || !$type) { - return $name; - } - - $definition = $this->entityManager->getDefinition($type); - if ($definition) { - $prefix = $definition->getConfigPrefix() . '.'; - return $prefix . $name; - } - else { - return FALSE; - } - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php deleted file mode 100644 index 085291091..000000000 --- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php +++ /dev/null @@ -1,362 +0,0 @@ -configDiffer = new ConfigDiffer($this->getTranslationMock()); - } - - /** - * @covers \Drupal\config_update\ConfigDiffer::same - * @dataProvider sameProvider - */ - public function testSame($a, $b, $expected) { - $this->assertEquals($expected, $this->configDiffer->same($a, $b)); - } - - /** - * Data provider for self:testSame(). - */ - public function sameProvider() { - $base = [ - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - ]; - return [ - [$base, $base, TRUE], - - // Add _core, omit uuid at top level. Should match, as both are removed - // in normalization process. - [ - $base, - [ - '_core' => 'foo', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - ], - TRUE, - ], - - // Change order in top and deep level. Should match. - [ - $base, - [ - 'uuid' => 'bar', - 'b' => 0, - 'a' => 'a', - 'c' => [ - 'e' => FALSE, - 'empty' => [], - 'd' => TRUE, - ], - ], - TRUE, - ], - - // Add _core in deeper level. Should not match, as this is removed - // only at the top level during normalization. - [ - $base, - [ - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - '_core' => 'do-not-use-this-key', - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - ], - FALSE, - ], - - // Add uuid in deeper level. Should not match, as this is removed - // only at the top level during normalization. - [ - $base, - [ - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'uuid' => 'important', - 'empty' => [], - ], - ], - FALSE, - ], - - // Omit a component. Should not match. - [ - $base, - [ - 'uuid' => 'bar', - 'a' => 'a', - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - ], - FALSE, - ], - - // Add a component. Should not match. - [ - $base, - [ - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - 'f' => 'f', - ], - FALSE, - ], - - // 0 should not match a string. - [ - $base, - [ - '_core' => 'foo', - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 'b', - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - ], - FALSE, - ], - - // 0 should not match NULL. - [ - $base, - [ - '_core' => 'foo', - 'uuid' => 'bar', - 'a' => 'a', - 'b' => NULL, - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - 'empty' => [], - ], - ], - FALSE, - ], - - // FALSE should not match a string. - [ - $base, - [ - '_core' => 'foo', - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => TRUE, - 'e' => 'e', - 'empty' => [], - ], - ], - FALSE, - ], - - // TRUE should not match a string. - [ - $base, - [ - '_core' => 'foo', - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => 'd', - 'e' => FALSE, - 'empty' => [], - ], - ], - FALSE, - ], - - // Add an empty array at top, and remove at lower level. Should still - // match. - [ - $base, - [ - '_core' => 'foo', - 'uuid' => 'bar', - 'a' => 'a', - 'b' => 0, - 'c' => [ - 'd' => TRUE, - 'e' => FALSE, - ], - 'empty_two' => [], - ], - TRUE, - ], - ]; - } - - /** - * @covers \Drupal\config_update\ConfigDiffer::diff - */ - public function testDiff() { - $configOne = [ - 'uuid' => '1234-5678-90', - 'id' => 'test.config.id', - 'id_to_remove' => 'test.remove.id', - 'type' => 'old_type', - 'true_value' => TRUE, - 'null_value' => NULL, - 'nested_array' => [ - 'flat_array' => [ - 'value2', - 'value1', - 'value3', - ], - 'custom_key' => 'value', - ], - ]; - - $configTwo = [ - 'uuid' => '09-8765-4321', - 'id' => 'test.config.id', - 'type' => 'new_type', - 'true_value' => FALSE, - 'null_value' => FALSE, - 'nested_array' => [ - 'flat_array' => [ - 'value2', - 'value3', - ], - 'custom_key' => 'value', - 'custom_key_2' => 'value2', - ], - ]; - - $edits = $this->configDiffer->diff($configOne, $configTwo)->getEdits(); - - $expectedEdits = [ - [ - 'copy' => [ - 'orig' => [ - 'id : test.config.id', - ], - 'closing' => [ - 'id : test.config.id', - ], - ], - ], - [ - 'delete' => [ - 'orig' => [ - 'id_to_remove : test.remove.id', - ], - 'closing' => FALSE, - ], - ], - [ - 'copy' => [ - 'orig' => [ - 'nested_array', - 'nested_array::custom_key : value', - ], - 'closing' => [ - 'nested_array', - 'nested_array::custom_key : value', - ], - ], - ], - [ - 'add' => [ - 'orig' => FALSE, - 'closing' => [ - 'nested_array::custom_key_2 : value2', - ], - ], - ], - [ - 'copy' => [ - 'orig' => [ - 'nested_array::flat_array', - 'nested_array::flat_array::0 : value2', - ], - 'closing' => [ - 'nested_array::flat_array', - 'nested_array::flat_array::0 : value2', - ], - ], - ], - [ - 'change' => [ - 'orig' => [ - 'nested_array::flat_array::1 : value1', - 'nested_array::flat_array::2 : value3', - 'null_value : null', - 'true_value : true', - 'type : old_type', - ], - 'closing' => [ - 'nested_array::flat_array::1 : value3', - 'null_value : false', - 'true_value : false', - 'type : new_type', - ], - ], - ], - ]; - - $this->assertEquals(count($expectedEdits), count($edits)); - - /** @var \Drupal\Component\Diff\Engine\DiffOp $diffOp */ - foreach ($edits as $index => $diffOp) { - $this->assertEquals($expectedEdits[$index][$diffOp->type]['orig'], $diffOp->orig); - $this->assertEquals($expectedEdits[$index][$diffOp->type]['closing'], $diffOp->closing); - } - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php deleted file mode 100644 index 668e8b929..000000000 --- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php +++ /dev/null @@ -1,293 +0,0 @@ - ['module', 'foo.barbaz.one', 'foo.barbaz.two'], - 'foo_theme' => ['theme', 'foo.bar.one', 'foo.bar.two'], - 'standard' => ['profile', 'baz.bar.one', 'baz.bar.two'], - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - $lister = $this->getMockBuilder('Drupal\config_update\ConfigListerWithProviders') - ->setConstructorArgs([ - $this->getEntityManagerMock(), - $this->getConfigStorageMock('active'), - $this->getConfigStorageMock('extension'), - $this->getConfigStorageMock('optional'), - $this->getModuleHandlerMock(), - $this->getThemeHandlerMock(), - ]) - ->setMethods(['listProvidedItems', 'getProfileName']) - ->getMock(); - - $lister->method('getProfileName') - ->willReturn('standard'); - - $map = []; - foreach ($this->configProviderList as $provider => $info) { - // Info has: [type, install storage item, optional storage item]. - // Map needs: [type, provider name, isOptional, [config items]]. - $map[] = [$info[0], $provider, FALSE, [$info[1]]]; - $map[] = [$info[0], $provider, TRUE, [$info[2]]]; - } - $lister->method('listProvidedItems') - ->will($this->returnValueMap($map)); - - $this->configLister = $lister; - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::listConfig - * @dataProvider listConfigProvider - */ - public function testListConfig($a, $b, $expected) { - $this->assertEquals($expected, $this->configLister->listConfig($a, $b)); - } - - /** - * Data provider for self:testListConfig(). - */ - public function listConfigProvider() { - return [ - // Arguments are $list_type, $name, and return value is that list of - // configuration in active, extension, and optional storage. - ['type', 'system.all', - [ - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.three', - 'foo.barbaz.four', - 'foo.barbaz.five', - 'foo.barbaz.six', - 'something.else', - 'another.one', - ], - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.seven', - 'foo.barbaz.four', - 'foo.barnot.three', - 'something.else', - ], - ['foo.barbaz.four'], - ], - ], - ['type', 'system.simple', - [ - ['something.else', 'another.one'], - ['foo.barnot.three', 'something.else'], - [], - ], - ], - ['type', 'foo', - [ - ['foo.bar.one', 'foo.bar.two', 'foo.bar.three'], - ['foo.bar.one', 'foo.bar.two', 'foo.bar.seven'], - [], - ], - ], - ['type', 'unknown.type', [[], [], []]], - ['profile', 'dummy', - [ - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.three', - 'foo.barbaz.four', - 'foo.barbaz.five', - 'foo.barbaz.six', - 'something.else', - 'another.one', - ], - ['baz.bar.one'], - ['baz.bar.two'], - ], - ], - ['module', 'foo_module', - [ - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.three', - 'foo.barbaz.four', - 'foo.barbaz.five', - 'foo.barbaz.six', - 'something.else', - 'another.one', - ], - ['foo.barbaz.one'], - ['foo.barbaz.two'], - ], - ], - ['theme', 'foo_theme', - [ - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.three', - 'foo.barbaz.four', - 'foo.barbaz.five', - 'foo.barbaz.six', - 'something.else', - 'another.one', - ], - ['foo.bar.one'], - ['foo.bar.two'], - ], - ], - ]; - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::getType - */ - public function testGetType() { - $return = $this->configLister->getType('not_in_list'); - $this->assertNull($return); - - foreach ($this->entityDefinitionInformation as $info) { - $return = $this->configLister->getType($info['type']); - $this->assertEquals($return->getConfigPrefix(), $info['prefix']); - } - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::getTypeByPrefix - */ - public function testGetTypeByPrefix() { - $return = $this->configLister->getTypeByPrefix('not_in_list'); - $this->assertNull($return); - - foreach ($this->entityDefinitionInformation as $info) { - $return = $this->configLister->getTypeByPrefix($info['prefix']); - $this->assertEquals($return->getConfigPrefix(), $info['prefix']); - } - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::getTypeNameByConfigName - */ - public function testGetTypeNameByConfigName() { - $return = $this->configLister->getTypeNameByConfigName('not_in_list'); - $this->assertNull($return); - - foreach ($this->entityDefinitionInformation as $info) { - $return = $this->configLister->getTypeNameByConfigName($info['prefix'] . '.something'); - $this->assertEquals($return, $info['type']); - } - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::listTypes - */ - public function testListTypes() { - $return = $this->configLister->listTypes(); - // Should return an array in sorted order, of just the config entities - // that $this->getEntityManagerMock() set up. - $expected = ['bar' => 'foo.barbaz', 'baz' => 'baz.foo', 'foo' => 'foo.bar']; - $this->assertEquals(array_keys($return), array_keys($expected)); - foreach ($return as $key => $definition) { - $this->assertTrue($definition->entityClassImplements('Drupal\Core\Config\Entity\ConfigEntityInterface')); - $this->assertEquals($definition->getConfigPrefix(), $expected[$key]); - } - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::listProviders - */ - public function testListProviders() { - // This method's return value is not sorted in any particular way. - $return = $this->configLister->listProviders(); - $expected = []; - foreach ($this->configProviderList as $provider => $info) { - // Info has: [type, install storage item, optional storage item]. - // Expected needs: key is item name, value is [type, provider name]. - $expected[$info[1]] = [$info[0], $provider]; - $expected[$info[2]] = [$info[0], $provider]; - } - ksort($return); - ksort($expected); - $this->assertEquals($return, $expected); - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::getConfigProvider - * @dataProvider getConfigProviderProvider - */ - public function testGetConfigProvider($a, $expected) { - $this->assertEquals($expected, $this->configLister->getConfigProvider($a)); - } - - /** - * Data provider for self:testGetConfigProvider(). - */ - public function getConfigProviderProvider() { - $values = []; - foreach ($this->configProviderList as $provider => $info) { - // Info has: [type, install storage item, optional storage item]. - // Values needs: [item, [type, provider name]]. - $values[] = [$info[1], [$info[0], $provider]]; - $values[] = [$info[2], [$info[0], $provider]]; - } - $values[] = ['not.a.config.item', NULL]; - return $values; - } - - /** - * @covers \Drupal\config_update\ConfigListerWithProviders::providerHasConfig - * @dataProvider providerHasConfigProvider - */ - public function testProviderHasConfig($a, $b, $expected) { - $this->assertEquals($expected, $this->configLister->providerHasConfig($a, $b)); - } - - /** - * Data provider for self:testProviderHasConfig(). - */ - public function providerHasConfigProvider() { - $values = []; - foreach ($this->configProviderList as $provider => $info) { - // Info has: [type, install storage item, optional storage item]. - // Values needs: [type, provider name, TRUE] for valid providers, - // change the last to FALSE for invalid providers. - $values[] = [$info[0], $provider, TRUE]; - $values[] = [$info[0], $provider . '_suffix', FALSE]; - } - $values[] = ['invalid_type', 'foo_module', FALSE]; - return $values; - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php deleted file mode 100644 index 6c35cd72c..000000000 --- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php +++ /dev/null @@ -1,356 +0,0 @@ -configReverter = new ConfigReverter( - $this->getEntityManagerMock(), - $this->getConfigStorageMock('active'), - $this->getConfigStorageMock('extension'), - $this->getConfigStorageMock('optional'), - $this->getConfigFactoryMock(), - $this->getEventDispatcherMock()); - } - - /** - * @covers \Drupal\config_update\ConfigReverter::getFromActive - * @dataProvider getFromActiveProvider - */ - public function testGetFromActive($a, $b, $expected) { - $this->assertEquals($expected, $this->configReverter->getFromActive($a, $b)); - } - - /** - * Data provider for self:testGetFromActive(). - */ - public function getFromActiveProvider() { - return [ - // Arguments are $type, $name, and return value is the config. - // Some config items that are already prefixed. - ['', 'foo.bar.one', ['foo.bar.one' => 'active', 'id' => 'one']], - ['system.simple', 'foo.bar.one', - ['foo.bar.one' => 'active', 'id' => 'one'], - ], - // Config item with a defined entity definition prefix. Entity type 'foo' - // has prefix 'foo.bar'. - ['foo', 'one', ['foo.bar.one' => 'active', 'id' => 'one']], - // Unknown type. This should not generate a call into the config read, - // so should not return the known value. - ['unknown', 'foo.bar.one', FALSE], - // Missing configuration. Config mock is configured to return FALSE for - // this particular config name. - ['system.simple', 'missing', FALSE], - ]; - } - - /** - * @covers \Drupal\config_update\ConfigReverter::getFromExtension - * @dataProvider getFromExtensionProvider - */ - public function testGetFromExtension($a, $b, $expected) { - $this->assertEquals($expected, $this->configReverter->getFromExtension($a, $b)); - } - - /** - * Data provider for self:testGetFromExtension(). - */ - public function getFromExtensionProvider() { - return [ - // Arguments are $type, $name, and return value is the config. - // Some config items that are already prefixed, and exist in the mock - // extension storage. - ['', 'in.extension', ['in.extension' => 'extension']], - ['system.simple', 'in.extension', ['in.extension' => 'extension']], - // Config item with a defined entity definition prefix. Entity type 'foo' - // has prefix 'foo.bar'. - ['foo', 'one', ['foo.bar.one' => 'extension', 'id' => 'one']], - // One that exists in both extension and optional storage. - ['system.simple', 'in.both', ['in.both' => 'extension']], - // One that exists only in optional storage. - ['system.simple', 'in.optional', ['in.optional' => 'optional']], - // Unknown type. This should not generate a call into the config read, - // so should not return the known value. - ['unknown', 'in.extension', FALSE], - // Missing configuration. Storage mock is configured to return FALSE for - // this particular config name. - ['system.simple', 'missing2', FALSE], - ]; - } - - /** - * @covers \Drupal\config_update\ConfigReverter::import - * @dataProvider importProvider - */ - public function testImport($type, $name, $config_name, $expected, $config_before, $config_after) { - // Clear dispatch log and set pre-config. - $this->dispatchedEvents = []; - if ($config_name) { - $this->configStorage[$config_name] = $config_before; - } - $save_config = $this->configStorage; - - // Call the importer and test the Boolean result. - $result = $this->configReverter->import($type, $name); - $this->assertEquals($result, $expected); - - if ($result) { - // Verify that the config is correct after import, and logging worked. - $this->assertEquals($this->configStorage[$config_name], $config_after); - $this->assertEquals(count($this->dispatchedEvents), 1); - $this->assertEquals($this->dispatchedEvents[0][0], ConfigRevertInterface::IMPORT); - } - else { - // Verify that the config didn't change and no events were logged. - $this->assertEquals($this->configStorage, $save_config); - $this->assertEquals(count($this->dispatchedEvents), 0); - } - } - - /** - * Data provider for self:testImport(). - */ - public function importProvider() { - return [ - // Elements: type, name, config name, return value, - // config to set up before, config expected after. See also - // getFromExtensionProvider(). - [ - 'system.simple', - 'in.extension', - 'in.extension', - TRUE, - ['in.extension' => 'before'], - ['in.extension' => 'extension', '_core' => 'core_for_in.extension'], - ], - [ - 'foo', - 'one', - 'foo.bar.one', - TRUE, - ['foo.bar.one' => 'before', 'id' => 'one'], - [ - 'foo.bar.one' => 'extension', - 'id' => 'one', - '_core' => 'core_for_foo.bar.one', - ], - ], - [ - 'system.simple', - 'in.both', - 'in.both', - TRUE, - ['in.both' => 'before'], - ['in.both' => 'extension', '_core' => 'core_for_in.both'], - ], - [ - 'system.simple', - 'in.optional', - 'in.optional', - TRUE, - ['in.optional' => 'before'], - ['in.optional' => 'optional', '_core' => 'core_for_in.optional'], - ], - [ - 'unknown', - 'in.extension', - FALSE, - FALSE, - FALSE, - FALSE, - ], - [ - 'system.simple', - 'missing2', - 'missing2', - FALSE, - FALSE, - FALSE, - ], - ]; - } - - /** - * @covers \Drupal\config_update\ConfigReverter::revert - * @dataProvider revertProvider - */ - public function testRevert($type, $name, $config_name, $expected, $config_before, $config_after) { - // Clear dispatch log and set pre-config. - $this->dispatchedEvents = []; - if ($config_name) { - $this->configStorage[$config_name] = $config_before; - } - $save_config = $this->configStorage; - - // Call the reverter and test the Boolean result. - $result = $this->configReverter->revert($type, $name); - $this->assertEquals($result, $expected); - - if ($result) { - // Verify that the config is correct after revert, and logging worked. - $this->assertEquals($this->configStorage[$config_name], $config_after); - $this->assertEquals(count($this->dispatchedEvents), 1); - $this->assertEquals($this->dispatchedEvents[0][0], ConfigRevertInterface::REVERT); - } - else { - // Verify that the config didn't change and no events were logged. - $this->assertEquals($this->configStorage, $save_config); - $this->assertEquals(count($this->dispatchedEvents), 0); - } - } - - /** - * Data provider for self:testRevert(). - */ - public function revertProvider() { - return [ - // Elements: type, name, config name, return value, - // config to set up before, config expected after. See also - // getFromExtensionProvider(). - [ - 'system.simple', - 'in.extension', - 'in.extension', - TRUE, - ['in.extension' => 'active'], - ['in.extension' => 'extension', '_core' => 'core_for_in.extension'], - ], - [ - 'foo', - 'one', - 'foo.bar.one', - TRUE, - ['foo.bar.one' => 'active', 'id' => 'one'], - [ - 'foo.bar.one' => 'extension', - 'id' => 'one', - '_core' => 'core_for_foo.bar.one', - ], - ], - [ - 'system.simple', - 'in.both', - 'in.both', - TRUE, - ['in.both' => 'active'], - ['in.both' => 'extension', '_core' => 'core_for_in.both'], - ], - [ - 'system.simple', - 'in.optional', - 'in.optional', - TRUE, - ['in.optional' => 'active'], - ['in.optional' => 'optional', '_core' => 'core_for_in.optional'], - ], - [ - 'unknown', - 'in.extension', - FALSE, - FALSE, - FALSE, - FALSE, - ], - // Missing from extension storage. - [ - 'system.simple', - 'missing2', - 'missing2', - FALSE, - FALSE, - FALSE, - ], - // Present in extension storage but missing from active storage. - [ - 'system.simple', - 'another', - 'another', - FALSE, - FALSE, - FALSE, - ], - ]; - } - - /** - * @covers \Drupal\config_update\ConfigReverter::delete - * @dataProvider deleteProvider - */ - public function testDelete($type, $name, $config_name, $expected) { - // Clear dispatch log. - $this->dispatchedEvents = []; - $save_config = $this->configStorage; - - // Call the deleteer and test the Boolean result. - $result = $this->configReverter->delete($type, $name); - $this->assertEquals($result, $expected); - - if ($result) { - // Verify that the config is missing after delete, and logging worked. - $this->assertTrue(!isset($this->configStorage[$config_name])); - $this->assertEquals(count($this->dispatchedEvents), 1); - $this->assertEquals($this->dispatchedEvents[0][0], ConfigDeleteInterface::DELETE); - } - else { - // Verify that the config didn't change and no events were logged. - $this->assertEquals($this->configStorage, $save_config); - $this->assertEquals(count($this->dispatchedEvents), 0); - } - } - - /** - * Data provider for self:testDelete(). - */ - public function deleteProvider() { - return [ - // Elements: type, name, config name, return value. - [ - 'system.simple', - 'in.extension', - 'in.extension', - TRUE, - ], - [ - 'foo', - 'one', - 'foo.bar.one', - TRUE, - ], - [ - 'unknown', - 'in.extension', - FALSE, - FALSE, - ], - [ - 'system.simple', - 'missing2', - 'missing2', - FALSE, - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php deleted file mode 100644 index 519474484..000000000 --- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php +++ /dev/null @@ -1,547 +0,0 @@ - 'foo.bar', 'type' => 'foo'], - ['prefix' => 'foo.barbaz', 'type' => 'bar'], - ['prefix' => 'baz.foo', 'type' => 'baz'], - ]; - - /** - * Creates a mock entity manager for the test. - * - * @see ConfigUpdateUnitTestBase::entityDefinitionInformation - */ - protected function getEntityManagerMock() { - $definitions = []; - $map = []; - foreach ($this->entityDefinitionInformation as $info) { - $def = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityTypeInterface')->getMock(); - $def - ->expects($this->any()) - ->method('getConfigPrefix') - ->willReturn($info['prefix']); - $def - ->expects($this->any()) - ->method('entityClassImplements') - ->willReturn(TRUE); - - $def - ->method('getKey') - ->willReturn('id'); - - $def->getConfigPrefix(); - - $definitions[$info['type']] = $def; - $map[] = [$info['type'], FALSE, $def]; - $map[] = [$info['type'], TRUE, $def]; - } - - // Add in a content entity definition, which shouldn't be recognized by the - // config lister class. - $def = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityTypeInterface')->getMock(); - $def - ->expects($this->any()) - ->method('entityClassImplements') - ->willReturn(FALSE); - $definitions['content_entity'] = $def; - - $manager = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeManagerInterface')->getMock(); - $manager - ->method('getDefinitions') - ->willReturn($definitions); - - $manager - ->method('getDefinition') - ->will($this->returnValueMap($map)); - - $manager - ->method('getStorage') - ->will($this->returnCallback([$this, 'mockGetStorage'])); - - return $manager; - } - - /** - * Mocks the getStorage() method for the entity manager. - */ - public function mockGetStorage($entity_type) { - // Figure out the config prefix for this entity type. - $prefix = ''; - foreach ($this->entityDefinitionInformation as $info) { - if ($info['type'] == $entity_type) { - $prefix = $info['prefix']; - } - } - - // This is used in ConfigReverter::import(). Although it is supposed to - // be entity storage, we'll use our mock config object instead. - return new MockConfig('', $prefix, $this); - } - - /** - * Array of active configuration information for mocking. - * - * Array structure: Each element is an array whose first element is a - * provider name, and second is an array of config items it provides. - * - * @var array - * - * @see ConfigUpdateUnitTestBase::getConfigStorageMock() - */ - protected $configStorageActiveInfo = [ - ['foo.bar', ['foo.bar.one', 'foo.bar.two', 'foo.bar.three']], - ['foo.barbaz', ['foo.barbaz.four', 'foo.barbaz.five', 'foo.barbaz.six']], - ['baz.foo', []], - ['', - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.three', - 'foo.barbaz.four', - 'foo.barbaz.five', - 'foo.barbaz.six', - 'something.else', - 'another.one', - ], - ], - ]; - - /** - * Array of extension configuration information for mocking. - * - * Array structure: Each element is an array whose first element is a - * provider name, and second is an array of config items it provides. - * - * @var array - * - * @see ConfigUpdateUnitTestBase::getConfigStorageMock() - */ - protected $configStorageExtensionInfo = [ - ['foo.bar', ['foo.bar.one', 'foo.bar.two', 'foo.bar.seven']], - ['baz.foo', []], - // This next item is assumed to be element 2 of the array. If not, you - // will need to change ConfigUpdateUnitTestBase::getConfigStorageMock(). - ['', - [ - 'foo.bar.one', - 'foo.bar.two', - 'foo.bar.seven', - 'foo.barbaz.four', - 'foo.barnot.three', - 'something.else', - ], - ], - ]; - - /** - * Array of optional configuration information for mocking. - * - * Array structure: Each element is an array whose first element is a - * provider name, and second is an array of config items it provides. - * - * @var array - * - * @see ConfigUpdateUnitTestBase::getConfigStorageMock() - */ - protected $configStorageOptionalInfo = [ - ['foo.bar', []], - ['foo.barbaz', ['foo.barbaz.four']], - // This next item is assumed to be element 2 of the array. If not, you - // will need to change ConfigUpdateUnitTestBase::getConfigStorageMock(). - ['', ['foo.barbaz.four']], - ]; - - /** - * Creates a mock config storage object for the test. - * - * @param string $type - * Type of storage object to return: 'active', 'extension', or 'optional'. - * In active storage, the read() method is mocked to assume you are reading - * core.extension to get the profile name, so it returns that information. - * For extension and optional storage, the getComponentNames() method is - * mocked, and for all storages, the listAll() method is mocked. - * - * @see ConfigUpdateUnitTestBase::configStorageActiveInfo - * @see ConfigUpdateUnitTestBase::configStorageExtensionInfo - * @see ConfigUpdateUnitTestBase::configStorageOptionalInfo - */ - protected function getConfigStorageMock($type) { - if ($type == 'active') { - $storage = $this->getMockBuilder('Drupal\Core\Config\StorageInterface')->getMock(); - - // Various tests assume various values of configuration that need to be - // read from active storage. - $map = [ - ['core.extension', ['profile' => 'standard']], - ['foo.bar.one', ['foo.bar.one' => 'active', 'id' => 'one']], - ['missing', FALSE], - ['in.extension', - ['in.extension' => 'active', '_core' => 'core_for_in.extension'], - ], - ['in.both', ['in.both' => 'active']], - ['in.optional', ['in.optional' => 'active']], - ]; - $storage - ->method('read') - ->will($this->returnValueMap($map)); - - $storage - ->method('listAll') - ->will($this->returnValueMap($this->configStorageActiveInfo)); - } - elseif ($type == 'extension') { - $storage = $this->getMockBuilder('Drupal\Core\Config\ExtensionInstallStorage')->disableOriginalConstructor()->getMock(); - - $value = []; - foreach ($this->configStorageExtensionInfo[2][1] as $item) { - $value[$item] = 'ignored'; - } - $storage - ->method('getComponentNames') - ->willReturn($value); - - $storage - ->method('listAll') - ->will($this->returnValueMap($this->configStorageExtensionInfo)); - $map = [ - ['in.extension', ['in.extension' => 'extension']], - ['in.both', ['in.both' => 'extension']], - ['in.optional', FALSE], - ['foo.bar.one', ['foo.bar.one' => 'extension', 'id' => 'one']], - ['another', ['another' => 'extension', 'id' => 'one']], - ['missing2', FALSE], - ]; - $storage - ->method('read') - ->will($this->returnValueMap($map)); - - } - else { - $storage = $this->getMockBuilder('Drupal\Core\Config\ExtensionInstallStorage')->disableOriginalConstructor()->getMock(); - - $value = []; - foreach ($this->configStorageOptionalInfo[2][1] as $item) { - $value[$item] = 'ignored'; - } - $storage - ->method('getComponentNames') - ->willReturn($value); - - $storage - ->method('listAll') - ->will($this->returnValueMap($this->configStorageOptionalInfo)); - - $map = [ - ['in.optional', ['in.optional' => 'optional']], - ['in.both', ['in.both' => 'optional']], - ['missing2', FALSE], - ]; - $storage - ->method('read') - ->will($this->returnValueMap($map)); - } - return $storage; - - } - - /** - * Creates a mock module handler for the test. - */ - protected function getModuleHandlerMock() { - $manager = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface')->getMock(); - $manager->method('getModuleList') - ->willReturn(['foo_module' => '', 'standard' => '']); - - return $manager; - } - - /** - * Creates a mock theme handler for the test. - */ - protected function getThemeHandlerMock() { - $manager = $this->getMockBuilder('Drupal\Core\Extension\ThemeHandlerInterface')->getMock(); - $manager->method('listInfo') - ->willReturn(['foo_theme' => '']); - return $manager; - } - - /** - * Creates a mock string translation class for the test. - */ - protected function getTranslationMock() { - $translation = $this->getMockBuilder('Drupal\Core\StringTranslation\TranslationInterface')->getMock(); - $translation - ->method('translateString') - ->will($this->returnCallback([$this, 'mockTranslate'])); - return $translation; - } - - /** - * Mocks the translateString() method for the string translation mock object. - * - * @param \Drupal\Core\StringTranslation\TranslatableMarkup $input - * Object to translate. - * - * @return string - * The untranslated string from $input. - */ - public function mockTranslate(TranslatableMarkup $input) { - return $input->getUntranslatedString(); - } - - /** - * List of mock-dispatched events. - * - * Each element of the array is the call parameters to dispatchEvent() in - * the mocked dispatch class: name and event instance. - * - * @var array - * - * @see ConfigUpdateUnitTestBase::getEventDispatcherMock() - */ - protected $dispatchedEvents = []; - - /** - * Mocks the event dispatcher service. - * - * Stores dispatched events in ConfigUpdateUnitTestBase::dispatchedEvents. - */ - protected function getEventDispatcherMock() { - $event = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock(); - $event - ->method('dispatch') - ->will($this->returnCallback([$this, 'mockDispatch'])); - - return $event; - } - - /** - * Mocks event dispatch. - * - * For \Symfony\Component\EventDispatcher\EventDispatchInterface::dispatch(). - */ - public function mockDispatch($name, Event $event = NULL) { - $this->dispatchedEvents[] = [$name, $event]; - } - - /** - * Mock config storage for the mock config factory. - * - * This is actually managed by the MockConfig class in this file. - * - * @var array - */ - protected $configStorage = []; - - /** - * Gets the value of the mocked config storage. - */ - public function getConfigStorage() { - return $this->configStorage; - } - - /** - * Sets the value of the mocked config storage. - */ - public function setConfigStorage($values) { - $this->configStorage = $values; - } - - /** - * Creates a mock config factory class for the test. - */ - protected function getConfigFactoryMock() { - $config = $this->getMockBuilder('Drupal\Core\Config\ConfigFactoryInterface')->getMock(); - $config - ->method('getEditable') - ->will($this->returnCallback([$this, 'mockGetEditable'])); - - return $config; - } - - /** - * Mocks the getEditable() method for the mock config factory. - * - * @param string $name - * Name of the config object to get an editable object for. - * - * @return MockConfig - * Editable mock config object. - */ - public function mockGetEditable($name) { - return new MockConfig($name, '', $this); - } - -} - -/** - * Mock class for mutable configuration, config entity, and entity storage. - */ -class MockConfig { - - /** - * Name of the config. - * - * @var string - */ - protected $name = ''; - - /** - * Prefix for the entity type being mocked, for entity storage mocking. - * - * @var string - */ - protected $entityPrefix = ''; - - /** - * Test class this comes from. - * - * @var \Drupal\Tests\config_update\Unit\ConfigUpdateUnitTestBase - */ - protected $test; - - /** - * Current value of the configuration. - * - * @var array - */ - protected $value = ''; - - /** - * Constructs a mock config object. - * - * @param string $name - * Name of the config that is being mocked. Can be blank. - * @param string $entity_prefix - * Prefix for the entity type that is being mocked. Often blank. - * @param \Drupal\Tests\config_update\Unit\ConfigUpdateUnitTestBase $test - * Test class this comes from. - */ - public function __construct($name, $entity_prefix, ConfigUpdateUnitTestBase $test) { - $this->name = $name; - $this->entityPrefix = $entity_prefix; - $this->test = $test; - - $storage = $test->getConfigStorage(); - if ($name && isset($storage[$name])) { - $value = $storage[$name]; - $value['is_new'] = FALSE; - } - else { - $value['is_new'] = TRUE; - } - $value['_core'] = 'core_for_' . $name; - - $this->value = $value; - } - - /** - * Gets a component of the configuration value. - */ - public function get($key) { - return isset($this->value[$key]) ? $this->value[$key] : NULL; - } - - /** - * Sets a component of the configuration value. - */ - public function set($key, $value) { - $this->value[$key] = $value; - return $this; - } - - /** - * Sets the entire configuration value. - */ - public function setData($value) { - // Retain the _core key. - $core = isset($this->value['_core']) ? $this->value['_core'] : ''; - $this->value = $value; - if ($core) { - $this->value['_core'] = $core; - } - return $this; - } - - /** - * Saves the configuration. - */ - public function save() { - $config = $this->test->getConfigStorage(); - $config[$this->name] = $this->value; - $this->test->setConfigStorage($config); - return $this; - } - - /** - * Deletes the configuration. - */ - public function delete() { - $config = $this->test->getConfigStorage(); - unset($config[$this->name]); - $this->test->setConfigStorage($config); - return $this; - } - - /** - * Mocks the createFromStorageRecord() method from entity storage. - */ - public function createFromStorageRecord($values) { - if (!$this->entityPrefix) { - return NULL; - } - - // This is supposed to return an entity, but the only method we need is - // save(), so instead set up and return this object. - $this->name = $this->entityPrefix . '.' . $values['id']; - $this->value = $values; - $this->value['_core'] = 'core_for_' . $this->name; - return $this; - } - - /** - * Mocks the updateFromStorageRecord() method from entity storage. - */ - public function updateFromStorageRecord($object, $values) { - return $object->createFromStorageRecord($values); - } - - /** - * Mocks the load() method for entity storage. - */ - public function load($id) { - $full_name = $this->entityPrefix . '.' . $id; - $configs = $this->test->getConfigStorage(); - if (isset($configs[$full_name])) { - $this->value = $configs[$full_name]; - $this->name = $full_name; - $this->value['_core'] = 'core_for_' . $full_name; - return $this; - } - return NULL; - } - -} diff --git a/sites/all/modules/contrib/admin/context/.editorconfig b/sites/all/modules/contrib/admin/context/.editorconfig deleted file mode 100644 index 4a2c5c728..000000000 --- a/sites/all/modules/contrib/admin/context/.editorconfig +++ /dev/null @@ -1,17 +0,0 @@ -# This file is for unifying the coding style for various code editors and IDEs. -# Make sure to have an editorconfig plug-in installed in your editor to have -# the editor use this file. - -# Sets this config file to be the top-most one. -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/context/.gitignore b/sites/all/modules/contrib/admin/context/.gitignore deleted file mode 100644 index e43b0f988..000000000 --- a/sites/all/modules/contrib/admin/context/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store diff --git a/sites/all/modules/contrib/admin/context/.travis.yml b/sites/all/modules/contrib/admin/context/.travis.yml deleted file mode 100644 index 1d5f0e4c0..000000000 --- a/sites/all/modules/contrib/admin/context/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: php -sudo: false - -php: - - 5.5 - - 5.6 - - 7.0 - - hhvm - -matrix: - allow_failures: - - php: hhvm - fast_finish: true - -mysql: - database: context - username: root - encoding: utf8 - -before_script: - # Remember the current context test directory for later use in the Drupal - # installation. - - TESTDIR=$(pwd) - # Navigate out of module directory to prevent blown stack by recursive module - # lookup. - - cd .. - - # Create database. - - mysql -e 'create database context' - # Export database variable for kernel tests. - - export SIMPLETEST_DB=mysql://root:@127.0.0.1/context - # Download Drupal 8 core. - - travis_retry git clone --branch 8.0.x --depth 1 http://git.drupal.org/project/drupal.git - - cd drupal - - # Reference rules in build site. - - ln -s $TESTDIR modules/context - -script: - # Run the PHPUnit tests which also include the kernel tests. - - ./vendor/phpunit/phpunit/phpunit -c ./core/phpunit.xml.dist ./modules/context diff --git a/sites/all/modules/contrib/admin/context/CHANGELOG.md b/sites/all/modules/contrib/admin/context/CHANGELOG.md deleted file mode 100644 index bdf25ac63..000000000 --- a/sites/all/modules/contrib/admin/context/CHANGELOG.md +++ /dev/null @@ -1,4 +0,0 @@ -# Change log - -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). diff --git a/sites/all/modules/contrib/admin/context/CONTRIBUTING.md b/sites/all/modules/contrib/admin/context/CONTRIBUTING.md deleted file mode 100644 index a5be72119..000000000 --- a/sites/all/modules/contrib/admin/context/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contributing - -This file will contain information on how you can contribute to the project. diff --git a/sites/all/modules/contrib/admin/context/LICENSE b/sites/all/modules/contrib/admin/context/LICENSE deleted file mode 100644 index 92f7edafb..000000000 --- a/sites/all/modules/contrib/admin/context/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Odd Hill - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/sites/all/modules/contrib/admin/context/LICENSE.txt b/sites/all/modules/contrib/admin/context/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/context/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/context/README.md b/sites/all/modules/contrib/admin/context/README.md deleted file mode 100644 index 29304a480..000000000 --- a/sites/all/modules/contrib/admin/context/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Context - -The context module lets you define conditions for when certain reactions should take place. - -An example of a condition could be when viewing a certain node type and blocks should be placed as a reaction when viewing a page with this node type. - -###Good resources - -- [Drupal 8 Plugin API](https://www.drupal.org/developing/api/8/plugins) - -Conditions ---- - -Context for Drupal 8 uses the built in condition plugins supplied by Drupal through the [Plugin API](https://www.drupal.org/developing/api/8/plugins). So any conditional plug-ins supplied by other modules can also be used with context. - -Reactions ---- - -Reactions for the context module are defined trough the new Drupal 8 [Plugin API](https://www.drupal.org/developing/api/8/plugins). - -The context module defines a plugin type named Context Reaction that you can extend when creating your own plugins. - -A context reaction requires a configuration form and execute method. The execution of the plugin is also something that will have to be handled by the author of the reaction. \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/context/composer.json b/sites/all/modules/contrib/admin/context/composer.json deleted file mode 100644 index fe4a77c2c..000000000 --- a/sites/all/modules/contrib/admin/context/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "drupal/context", - "description": "Manage contextual conditions and reactions for different portions of your site.", - "keywords": ["Drupal", "context", "block", "visibility", "conditions"], - "type": "drupal-module", - "license": "MIT", - "homepage": "https://github.com/oddhill/context", - "authors": [ - { - "name": "Christoffer Palm", - "email": "christoffer.palm@oddhill.se", - "homepage": "http://www.oddhill.se/", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/oddhill/context/issues", - "source": "https://github.com/oddhill/context", - "docs": "https://github.com/oddhill/context" - } -} diff --git a/sites/all/modules/contrib/admin/context/context.info.yml b/sites/all/modules/contrib/admin/context/context.info.yml deleted file mode 100644 index 2a7d63c1d..000000000 --- a/sites/all/modules/contrib/admin/context/context.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Context -description: 'Set conditions and configure reactions that should be implemented when conditions pass.' -package: Context -type: module -# core: 8.x - -# Information added by Drupal.org packaging script on 2017-09-14 -version: '8.x-4.0-beta2' -core: '8.x' -project: 'context' -datestamp: 1505379269 diff --git a/sites/all/modules/contrib/admin/context/context.install b/sites/all/modules/contrib/admin/context/context.install deleted file mode 100644 index 62da5490a..000000000 --- a/sites/all/modules/contrib/admin/context/context.install +++ /dev/null @@ -1,43 +0,0 @@ -getContexts() as $context) { - foreach ($context->getReactions() as $reaction) { - if ($reaction instanceof Drupal\context\Plugin\ContextReaction\Blocks) { - foreach ($reaction->getBlocks() as $block) { - $config = $block->getConfiguration(); - if (!isset($config['context_id'])) { - $config['context_id'] = $context->id(); - $block->setConfiguration($config); - $context->save(); - } - } - } - } - } -} - -/** - * Update all blocks reaction configuration with additional "css_class" property. - */ -function context_update_8002() { - $context_manager = \Drupal::service('context.manager'); - foreach ($context_manager->getContexts() as $context) { - foreach ($context->getReactions() as $reaction) { - if ($reaction instanceof \Drupal\context\Plugin\ContextReaction\Blocks) { - foreach ($reaction->getBlocks() as $block) { - $configuration = $block->getConfiguration(); - if (!isset($configuration['css_class'])) { - $configuration['css_class'] = ''; - // Update the block. - $reaction->updateBlock($configuration['uuid'], $configuration); - $context->save(); - } - } - } - } - } -} diff --git a/sites/all/modules/contrib/admin/context/context.module b/sites/all/modules/contrib/admin/context/context.module deleted file mode 100644 index 0cd01c9bc..000000000 --- a/sites/all/modules/contrib/admin/context/context.module +++ /dev/null @@ -1,75 +0,0 @@ -' . t('About') . ''; - $output .= '

'.t('The Context module lets users define conditions for when certain reactions should take place.').'

'; - $output .= '

'.t('An example of a condition could be when viewing a certain node type and blocks should be placed as a reaction when viewing a page with this node type.').'

'; - $output .= '

' . t('Uses') . '

'; - $output .= '
'; - $output .= '
' . t('Managing context') . '
'; - $output .= '
' . t('Users with Administer contexts permission can add contextual conditions and reactions for different portions of their site. For each context, they can choose the conditions that trigger this context to be active and choose different aspects of their site that should react to this active context.') . '
'; - $output .= '
' . t('Adding new custom reactions') . '
'; - $output .= '
' . t('Reactions for the context module are defined trough the new Drupal 8 Plugin API.', array(':link' =>'https://www.drupal.org/developing/api/8/plugins')) . '
'; - $output .= '
' . t('The Context module defines a plugin type named ContextReaction that users can extend when creating their own plugins.') . '
'; - $output .= '
' . t('A context reaction requires a configuration form and execute method. The execution of the plugin is also something that will have to be handled by the author of the reaction.') . '
'; - $output .= '
'; - return $output; - } -} - -/** - * Run the body class context reactions if there are any and let them add - * classes to the page body. - * - * Implements hook_preprocess_HOOK(). - */ -function context_preprocess_html(&$variables) { - /** @var \Drupal\context\ContextManager $context_manager */ - $context_manager = \Drupal::service('context.manager'); - - foreach ($context_manager->getActiveReactions('body_class') as $reaction) { - $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $reaction->execute()); - } -} - -/** - * Implements hook_theme_suggestions_page_alter(). - */ -function context_theme_suggestions_page_alter(array &$suggestions, array $variables) { - $context_manager = \Drupal::service('context.manager'); - foreach ($context_manager->getActiveReactions('page_template_suggestions') as $reaction) { - $template_suggestions = explode(PHP_EOL, $reaction->execute()); - $suggestions = array_merge($suggestions, $template_suggestions); - } -} - -/** - * Implements hook_preprocess_page(). - */ -function context_preprocess_page(&$variables) { - // Active theme for route. - $current_theme = \Drupal::service('theme.negotiator')->determineActiveTheme(Drupal::routeMatch()); - - // Context manager. - $context_manager = \Drupal::service('context.manager'); - - // Disable regions based on regions reaction. - foreach ($context_manager->getActiveReactions('regions') as $region_reaction) { - $configuration = $region_reaction->getConfiguration(); - if (isset($configuration['regions'][$current_theme])) { - foreach ($configuration['regions'][$current_theme] as $region) { - unset($variables['page'][$region]); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/context/context.routing.yml b/sites/all/modules/contrib/admin/context/context.routing.yml deleted file mode 100644 index 261d3827e..000000000 --- a/sites/all/modules/contrib/admin/context/context.routing.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Page to edit a context. -entity.context.edit_form: - path: '/admin/structure/context/{context}' - defaults: - _entity_form: 'context.edit' - _title: 'Edit context' - requirements: - _permission: 'administer contexts' diff --git a/sites/all/modules/contrib/admin/context/context.services.yml b/sites/all/modules/contrib/admin/context/context.services.yml deleted file mode 100644 index 558325135..000000000 --- a/sites/all/modules/contrib/admin/context/context.services.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - context.manager: - class: Drupal\context\ContextManager - arguments: ['@entity.query', '@entity.manager', '@context.repository', '@context.handler', '@entity.form_builder', '@theme.manager'] - plugin.manager.context_reaction: - class: Drupal\context\ContextReactionManager - parent: default_plugin_manager - context.block_page_display_variant_subscriber: - class: Drupal\context\EventSubscriber\BlockPageDisplayVariantSubscriber - arguments: ['@context.manager'] - tags: - - { name: event_subscriber } - theme.negotiator.context_themeswitcher: - class: Drupal\context\Theme\ThemeSwitcherNegotiator - tags: - - { name: theme_negotiator, priority: 1000 } diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js b/sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js deleted file mode 100644 index 25f202c3d..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * Context admin behaviors. - */ -(function ($, Drupal) { - - 'use strict'; - - /** - * This is a generic table filter that works with any table formatted in the - * correct way with classes and data attributes. - * - * @type {Drupal~behavior} - * - * @prop {Drupal~behaviorAttach} attach - * Attaches the behavior for the block filtering. - */ - Drupal.behaviors.contextTableFilter = { - attach: function () { - var $input = $('input.context-table-filter').once('.context-table-filter'); - var $table = $($input.attr('data-element')); - var $filter_rows; - - // Only attach the filter listener if there is a table to filter. - if ($table.length) { - $filter_rows = $table.find('.context-table-filter-text-source'); - $input.on('keyup', filterTableRows); - } - - /** - * Filters the table rows. - * - * @param {jQuery.Event} e - * The jQuery event for the keyup event that triggered the filter. - */ - function filterTableRows(e) { - var query = $(e.target).val().toLowerCase(); - - /** - * Shows or hides the Table rows based on the query. - * - * @param {number} index - * The index in the loop, as provided by `jQuery.each` - * - * @param {HTMLElement} label - * The label of the block. - */ - function toggleTableRow(index, label) { - var $label = $(label); - var $row = $label.parent().parent(); - var textMatch = $label.text().toLowerCase().indexOf(query) !== -1; - - $row.toggle(textMatch); - } - - // Filter if the length of the query is at least 2 characters. - if (query.length >= 2) { - $filter_rows.each(toggleTableRow); - } - else { - $filter_rows.each(function () { - $(this).parent().parent().show(); - }); - } - } - } - }; - -}(jQuery, Drupal)); diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml deleted file mode 100644 index f1a18a597..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Context UI -description: 'Provides a simple UI for settings up a site structure using Context.' -package: Context -type: module -# core: 8.x -configure: entity.context.collection - -# Module dependencies. -dependencies: - - context - -# Information added by Drupal.org packaging script on 2017-09-14 -version: '8.x-4.0-beta2' -core: '8.x' -project: 'context' -datestamp: 1505379269 diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml deleted file mode 100644 index bdd2aa4dc..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml +++ /dev/null @@ -1,7 +0,0 @@ -admin: - version: VERSION - js: - assets/js/context_ui.admin.js: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml deleted file mode 100644 index 4e7830856..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.context.add_form: - title: 'Add context' - route_name: entity.context.add_form - appears_on: - - entity.context.collection diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml deleted file mode 100644 index d200da8ba..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml +++ /dev/null @@ -1,4 +0,0 @@ -context_block_config: - title: 'Configure block' - route_name: 'context.reaction.blocks.block_edit' - group: 'context_block' \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml deleted file mode 100644 index e03719a44..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.context.collection: - title: 'Context' - parent: system.admin_structure - description: 'Associate menus, views, blocks, etc. with different contexts to structure your site.' - route_name: entity.context.collection diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml deleted file mode 100644 index 65e0c34c2..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -administer contexts: - title: 'Administer contexts' - description: 'Associate menus, views, blocks, etc. with different contexts to structure your site.' diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml deleted file mode 100644 index 397bbd5aa..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml +++ /dev/null @@ -1,137 +0,0 @@ -# Page to lists all contexts. -entity.context.collection: - path: '/admin/structure/context' - defaults: - _entity_list: 'context' - _title: 'Context' - requirements: - _permission: 'administer contexts' - -# Page to add a context. -entity.context.add_form: - path: '/admin/structure/context/add' - defaults: - _entity_form: 'context.add' - _title: 'Add context' - requirements: - _permission: 'administer contexts' - -# Page to remove a context. -entity.context.delete_form: - path: '/admin/structure/context/{context}/delete' - defaults: - _entity_form: 'context.delete' - _title: 'Delete context' - requirements: - _permission: 'administer contexts' - -# Page to disable a context. -entity.context.disable_form: - path: '/admin/structure/context/{context}/disable' - defaults: - _entity_form: 'context.disable' - _title: 'Disable context' - requirements: - _permission: 'administer contexts' - -# Route to get autocomplete results for context groups. -context.groups.autocomplete: - path: '/admin/structure/context/groups/autocomplete' - defaults: - _controller: '\Drupal\context_ui\Controller\ContextUIController::groupsAutocomplete' - requirements: - _permission: 'administer contexts' - -## Context conditions. - -context.conditions_library: - path: '/admin/structure/context/{context}/conditions/library' - defaults: - _title: 'Add condition' - _controller: '\Drupal\context_ui\Controller\ContextUIController::listConditions' - requirements: - _entity_access: 'context.update' - -context.condition_add: - path: '/admin/structure/context/{context}/condition/add/{condition_id}' - defaults: - _controller: '\Drupal\context_ui\Controller\ContextUIController::addCondition' - requirements: - _entity_access: 'context.update' - -context.condition_delete: - path: '/admin/structure/context/{context}/condition/delete/{condition_id}' - defaults: - _form: '\Drupal\context_ui\Form\ConditionDeleteForm' - requirements: - _entity_access: 'context.update' - -## Context reactions. - -context.reactions_library: - path: '/admin/structure/context/{context}/reactions/library' - defaults: - _title: 'Add reaction' - _controller: '\Drupal\context_ui\Controller\ContextUIController::listReactions' - requirements: - _entity_access: 'context.update' - -context.reaction_add: - path: '/admin/structure/context/{context}/reaction/add/{reaction_id}' - defaults: - _controller: '\Drupal\context_ui\Controller\ContextUIController::addReaction' - requirements: - _entity_access: 'context.update' - -context.reaction_delete: - path: '/admin/structure/context/{context}/reaction/delete/{reaction_id}' - defaults: - _form: '\Drupal\context_ui\Form\ReactionDeleteForm' - requirements: - _entity_access: 'context.update' - -## Context blocks reaction. - -# Callback handler for when the theme is changed in the blocks configuration form. -context.reaction.blocks.regions: - path: '/admin/structure/context/{context}/reaction/blocks/regions' - defaults: - _controller: '\Drupal\context\Reaction\Blocks\Controller\ContextReactionBlocksController::blocksFormThemeSelect' - requirements: - _entity_access: 'context.update' - -# Display a list of all blocks. -context.reaction.blocks.library: - path: '/admin/structure/context/{context}/reaction/blocks/{reaction_id}/library' - defaults: - _title: 'Add block' - _controller: '\Drupal\context\Reaction\Blocks\Controller\ContextReactionBlocksController::blocksLibrary' - requirements: - _entity_access: 'context.update' - -# Display a form to deleta a block. -context.reaction.blocks.block_delete: - path: '/admin/structure/context/{context}/reaction/blocks/delete/{block_id}' - defaults: - _form: '\Drupal\context\Reaction\Blocks\Form\BlockDeleteForm' - _title: 'Delete block' - requirements: - _entity_access: 'context.update' - -# Display a form to add a block. -context.reaction.blocks.block_add: - path: '/admin/structure/context/{context}/reaction/blocks/{reaction_id}/add/{block_id}' - defaults: - _form: '\Drupal\context\Reaction\Blocks\Form\BlockAddForm' - _title: 'Add block' - requirements: - _entity_access: 'context.update' - -# Display a form to edit a block. -context.reaction.blocks.block_edit: - path: '/admin/structure/context/{context}/reaction/blocks/{reaction_id}/edit/{block_id}' - defaults: - _form: '\Drupal\context\Reaction\Blocks\Form\BlockEditForm' - _title: 'Edit block' - requirements: - _entity_access: 'context.update' diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php deleted file mode 100644 index befaf21fa..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php +++ /dev/null @@ -1,263 +0,0 @@ -contextManager = $contextManager; - $this->formBuilder = $formBuilder; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), - $container->get('context.manager'), - $container->get('form_builder') - ); - } - - /** - * Use a form instead of the entity list builder to display contexts. - * - * {@inheritdoc} - */ - public function render() { - return $this->formBuilder->getForm($this); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'context_ui_admin_display_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $groups = $this->contextManager->getContextsByGroup(); - - $form['contexts'] = array( - '#type' => 'table', - '#header' => array( - $this->t('Context'), - $this->t('Description'), - $this->t('Group'), - $this->t('Weight'), - $this->t('Operations'), - ), - '#empty' => $this->t('There are no contexts defined.'), - '#attributes' => array( - 'id' => 'contexts', - ), - ); - - $group_options = []; - - // @todo Make this a bit prettier. - foreach ($groups as $group => $contexts) { - $group_options[$group] = ($group === 'not_grouped') ? $this->t('Not grouped') : $group; - } - - // Count the number of entities to get a good delta for the weights. - $weight_delta = round(count($this->getEntityIds()) / 2); - - foreach ($groups as $group => $contexts) { - $group_class = Html::getClass($group); - - $form['contexts']['#tabledrag'][] = array( - 'action' => 'match', - 'relationship' => 'sibling', - 'group' => 'context-group-select', - 'subgroup' => 'context-group-' . $group_class, - 'hidden' => FALSE, - ); - - $form['contexts']['#tabledrag'][] = array( - 'action' => 'order', - 'relationship' => 'sibling', - 'group' => 'context-weight', - 'subgroup' => 'context-weight-' . $group_class, - ); - - $form['contexts']['group-' . $group_class] = array( - '#attributes' => array( - 'class' => array('group-label', 'group-label-' . $group_class), - 'no_striping' => TRUE, - ), - ); - - $form['contexts']['group-' . $group_class] = [ - '#attributes' => [ - 'class' => ['region-title'], - ], - 'title' => [ - '#markup' => ($group === 'not_grouped') ? $this->t('Not grouped') : $group, - '#wrapper_attributes' => [ - 'colspan' => 5, - ], - ], - ]; - - /** @var ContextInterface $context */ - foreach ($contexts as $context_id => $context) { - $operations = [ - 'edit' => [ - 'title' => $this->t('Edit'), - 'url' => $context->urlInfo('edit-form'), - ], - 'delete' => [ - 'title' => $this->t('Delete'), - 'url' => $context->urlInfo('delete-form'), - 'attributes' => $this->getAjaxAttributes(), - ], - 'disable' => [ - 'title' => $context->disabled() ? $this->t('Enable') : $this->t('Disable'), - 'url' => $context->toUrl('disable-form'), - 'attributes' => $this->getAjaxAttributes(), - ] - ]; - - $form['contexts'][$context_id] = [ - '#attributes' => [ - 'class' => ['draggable'], - ], - 'label' => [ - '#markup' => $context->getLabel(), - '#wrapper_attributes' => $context->disabled() ? ['style' => 'opacity:0.6'] : NULL, - ], - 'description' => [ - '#markup' => $context->getDescription(), - ], - 'group' => [ - '#type' => 'select', - '#title' => $this->t('Group for @context context', ['@context' => $context->getLabel()]), - '#title_display' => 'invisible', - '#default_value' => $context->getGroup(), - '#options' => $group_options, - '#attributes' => [ - 'class' => ['context-group-select', 'context-group-' . $group_class], - ], - ], - 'weight' => [ - '#type' => 'weight', - '#title' => $this->t('Weight for @context context', ['@context' => $context->getLabel()]), - '#default_value' => $context->getWeight(), - '#delta' => $weight_delta, - '#title_display' => 'invisible', - '#attributes' => [ - 'class' => ['context-weight', 'context-weight-' . $group_class], - ], - ], - 'operations' => [ - '#type' => 'operations', - '#links' => $operations, - ], - ]; - } - } - - $form['actions'] = array( - '#type' => 'actions', - ); - - if (count($groups) > 0) { - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => $this->t('Save contexts'), - '#button_type' => 'primary', - ); - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // No validation. - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $contexts = $this->storage->loadMultiple(array_keys($form_state->getValue('contexts'))); - - /*** @var ContextInterface $context */ - foreach ($contexts as $context_id => $context) { - $context_values = $form_state->getValue(['contexts', $context_id]); - - $context->setWeight($context_values['weight']); - - // Not grouped contexts needs a specific group value. - if ($context_values['group'] === 'not_grouped') { - $context->setGroup(Context::CONTEXT_GROUP_NONE); - } - else { - $context->setGroup($context_values['group']); - } - - $context->save(); - } - - drupal_set_message($this->t('The context settings have been updated.')); - } - -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php deleted file mode 100644 index 1b49f3d5e..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php +++ /dev/null @@ -1,395 +0,0 @@ -contextManager = $contextManager; - $this->contextReactionManager = $contextReactionManager; - $this->conditionManager = $conditionManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('context.manager'), - $container->get('plugin.manager.context_reaction'), - $container->get('plugin.manager.condition') - ); - } - - /** - * Retrieves group suggestions for a context. - * - * @param Request $request - * The current request. - * - * @return JsonResponse - * A JSON response with groups matching the query. - */ - public function groupsAutocomplete(Request $request) { - $query = $request->query->get('q'); - - $matches = []; - - foreach ($this->contextManager->getContexts() as $context) { - if (stripos($context->getGroup(), $query) === 0) { - $matches[] = $context->getGroup(); - } - } - - $response = []; - - // Format the unique matches to be used with the autocomplete field. - foreach (array_unique($matches) as $match) { - $response[] = [ - 'value' => $match, - 'label' => Html::escape($match), - ]; - } - - return new JsonResponse($response); - } - - /** - * Displays a list of conditions that can be added to the context. - * - * @param ContextInterface $context - * The context to display available conditions for. - * - * @return array - */ - public function listConditions(ContextInterface $context) { - - // Get a list of all available conditions. - $conditions = $this->conditionManager->getDefinitions(); - - $header = [ - $this->t('Condition') - ]; - - $build['filter'] = [ - '#type' => 'search', - '#title' => $this->t('Filter'), - '#title_display' => 'invisible', - '#size' => 30, - '#placeholder' => $this->t('Filter by condition name'), - '#attributes' => [ - 'class' => ['context-table-filter'], - 'data-element' => '.condition-add-table', - 'title' => $this->t('Enter a part of the condition name to filter by.'), - ], - ]; - - $rows = []; - - // Add a table row for each condition. - foreach ($conditions as $condition_id => $condition) { - // Only add the condition to the list of it's not already been added to - // the context. - if ($context->hasCondition($condition_id)) { - continue; - } - - $rows[] = [ - 'condition' => [ - 'data' => [ - '#type' => 'link', - '#title' => $condition['label'] . ' (' . $condition['provider'] . ')', - '#url' => Url::fromRoute('context.condition_add', [ - 'context' => $context->id(), - 'condition_id' => $condition_id, - ]), - '#attributes' => [ - 'class' => ['use-ajax', 'context-table-filter-text-source'], - ], - '#options' => [ - 'html' => TRUE, - ] - ], - ], - ]; - } - - $build['conditions'] = [ - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('There are no conditions left that can be added to this context.'), - '#attributes' => [ - 'class' => ['condition-add-table'], - ], - ]; - - $build['#attached']['library'][] = 'context_ui/admin'; - - return $build; - } - - /** - * Displays a list of reactions that can be added to the context. - * - * @param ContextInterface $context - * The context to display available - * - * @return array - */ - public function listReactions(ContextInterface $context) { - - // Get a list of all available conditions. - $reactions = $this->contextReactionManager->getDefinitions(); - - $header = [ - $this->t('Reactions') - ]; - - $build['filter'] = [ - '#type' => 'search', - '#title' => $this->t('Filter'), - '#title_display' => 'invisible', - '#size' => 30, - '#placeholder' => $this->t('Filter by reaction name'), - '#attributes' => [ - 'class' => ['context-table-filter'], - 'data-element' => '.reaction-add-table', - 'title' => $this->t('Enter a part of the reaction name to filter by.'), - ], - ]; - - $rows = []; - - // Add a table row for each context reaction. - foreach ($reactions as $reaction_id => $reaction) { - // Only add the reaction to the list of it's not already been added to - // the context. - if ($context->hasReaction($reaction_id)) { - continue; - } - - $rows[] = [ - 'reaction' => [ - 'data' => [ - '#type' => 'link', - '#title' => $reaction['label'], - '#url' => Url::fromRoute('context.reaction_add', [ - 'context' => $context->id(), - 'reaction_id' => $reaction_id, - ]), - '#attributes' => [ - 'class' => ['use-ajax', 'context-table-filter-text-source'], - ], - '#options' => [ - 'html' => TRUE, - ], - '#ajax' => TRUE, - ], - ], - ]; - } - - $build['reactions'] = [ - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('There are no reactions left that can be added to this context.'), - '#attributes' => [ - 'class' => ['reaction-add-table'], - ], - ]; - - $build['#attached']['library'][] = 'context_ui/admin'; - - return $build; - } - - /** - * Add the specified reaction to the context. - * - * @param Request $request - * The current request. - * - * @param ContextInterface $context - * The context to add the reaction to. - * - * @param $reaction_id - * The ID of the reaction to add. - * - * @return AjaxResponse|RedirectResponse - */ - public function addReaction(Request $request, ContextInterface $context, $reaction_id) { - - if ($context->hasReaction($reaction_id)) { - throw new HttpException(403, 'The specified reaction had already been added to the context.'); - } - - // Create an instance of the reaction and add it to the context. - try { - $reaction = $this->contextReactionManager->createInstance($reaction_id); - } - catch (PluginException $e) { - throw new HttpException(400, $e->getMessage()); - } - - // If one of the condition is "Current theme", prevent adding Theme reaction. - // Else this will cause an infinite loop when checking for active contexts. - if ($reaction_id == 'theme') { - $conditions = $context->getConditions(); - foreach ($conditions as $condition) { - if ($condition->getPluginId() == 'current_theme') { - if ($request->isXmlHttpRequest()) { - $response = new AjaxResponse(); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new OpenModalDialogCommand($this->t("Theme reaction"), $this->t("You can not place Theme reaction if Current theme condition is set."), ['width' => '700'])); - return $response; - } - } - } - } - - $context->addReaction($reaction->getConfiguration()); - $context->save(); - - // If the request is an AJAX request then return an AJAX response with - // commands to replace the content on the page. - if ($request->isXmlHttpRequest()) { - $response = new AjaxResponse(); - - $contextForm = $this->contextManager->getForm($context, 'edit'); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions'])); - - return $response; - } - - $url = $context->urlInfo('edit-form'); - - return $this->redirect($url->getRouteName(), $url->getRouteParameters()); - } - - /** - * Add the specified condition to the context. - * - * @param Request $request - * The current request. - * - * @param ContextInterface $context - * The context to add the condition to. - * - * @param $condition_id - * The ID of the condition to add. - * - * @return AjaxResponse|RedirectResponse - */ - public function addCondition(Request $request, ContextInterface $context, $condition_id) { - - if ($context->hasCondition($condition_id)) { - throw new HttpException(403, 'The specified condition had already been added to the context.'); - } - - // Create an instance of the condition and add it to the context. - try { - $condition = $this->conditionManager->createInstance($condition_id); - } - catch (PluginException $e) { - throw new HttpException(400, $e->getMessage()); - } - - // Prevent adding "Current theme" condition, if "Theme" reaction is already set. - // Else this will cause an infinite loop when checking for active contexts. - if ($condition_id == 'current_theme') { - $reactions = $context->getReactions(); - foreach ($reactions as $reaction) { - if ($reaction->getPluginId() == 'theme') { - if ($request->isXmlHttpRequest()) { - $response = new AjaxResponse(); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new OpenModalDialogCommand($this->t("Current theme condition"), $this->t("You can not set Current theme condition if Theme reaction is set."), ['width' => '700'])); - return $response; - } - } - } - } - - $context->addCondition($condition->getConfiguration()); - $context->save(); - - // If the request is an AJAX request then return an AJAX response with - // commands to replace the content on the page. - if ($request->isXmlHttpRequest()) { - $response = new AjaxResponse(); - - $contextForm = $this->contextManager->getForm($context, 'edit'); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new ReplaceCommand('#context-conditions', $contextForm['conditions'])); - - return $response; - } - - $url = $context->urlInfo('edit-form'); - - return $this->redirect($url->getRouteName(), $url->getRouteParameters()); - } - -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php deleted file mode 100644 index 9201e9366..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php +++ /dev/null @@ -1,142 +0,0 @@ -contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static ( - $container->get('context.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'context_ui_condition_delete_form'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to delete the %label condition?', [ - '%label' => $this->condition->getPluginDefinition()['label'], - ]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return $this->context->urlInfo('edit-form'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $condition_id = NULL) { - $this->context = $context; - $this->condition = $context->getCondition($condition_id); - - $form = parent::buildForm($form, $form_state); - - // Remove the cancel button if this is an AJAX request since Drupals built - // in modal dialogues does not handle buttons that are not a primary - // button very well. - if ($this->getRequest()->isXmlHttpRequest()) { - unset($form['actions']['cancel']); - } - - // Submit the form with AJAX if possible. - $form['actions']['submit']['#ajax'] = [ - 'callback' => '::submitFormAjax' - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Remove the condition and save the context. - $this->context->removeCondition($this->condition->getConfiguration()['id'])->save(); - - // If this is not an AJAX request then redirect and show a message. - if (!$this->getRequest()->isXmlHttpRequest()) { - drupal_set_message($this->t('The condition %name has been removed.', [ - '%name' => $this->condition->getPluginDefinition()['label']] - )); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - } - - /** - * Handle when the form is submitted trough AJAX. - * - * @return AjaxResponse - */ - public function submitFormAjax() { - $contextForm = $this->contextManager->getForm($this->context, 'edit'); - - $response = new AjaxResponse(); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new ReplaceCommand('#context-conditions', $contextForm['conditions'])); - - return $response; - } - -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php deleted file mode 100644 index b105e26ac..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php +++ /dev/null @@ -1,30 +0,0 @@ -t('The context %label has been added.', [ - '%label' => $this->entity->getLabel(), - ])); - } - else { - drupal_set_message($this->t('The context was not saved.')); - } - - $formState->setRedirect('entity.context.edit_form', [ - 'context' => $this->entity->id(), - ]); - } - -} - diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php deleted file mode 100644 index 02403f785..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php +++ /dev/null @@ -1,79 +0,0 @@ -contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('context.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to delete the %label context?', array( - '%label' => $this->entity->getLabel(), - )); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.context.collection'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = parent::buildForm($form, $form_state); - - // Remove the cancel button if this is an AJAX request since Drupals built - // in modal dialogues does not handle buttons that are not a primary - // button very well. - if ($this->getRequest()->isXmlHttpRequest()) { - unset($form['actions']['cancel']); - } - - return $form; - } - - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $formState) { - $this->entity->delete(); - - drupal_set_message($this->t('The context %title has been deleted.', array( - '%title' => $this->entity->getLabel(), - ))); - - $formState->setRedirectUrl($this->getCancelUrl()); - } -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php deleted file mode 100644 index 61e0fd673..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php +++ /dev/null @@ -1,89 +0,0 @@ -contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('context.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to %status the %label context?', array( - '%status' => $this->entity->disabled() ? "enable" : "disable", - '%label' => $this->entity->getLabel(), - )); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('This action will %status the %label context.', array( - '%status' => $this->entity->disabled() ? "enable" : "disable", - '%label' => $this->entity->getLabel(), - )); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.context.collection'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = parent::buildForm($form, $form_state); - - // Remove the cancel button if this is an AJAX request since Drupals built - // in modal dialogues does not handle buttons that are not a primary - // button very well. - if ($this->getRequest()->isXmlHttpRequest()) { - unset($form['actions']['cancel']); - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $formState) { - $this->entity->disable(); - drupal_set_message($this->t('The context %title has been %status.', array( - '%title' => $this->entity->getLabel(), - '%status' => $this->entity->disabled() ? "disabled" : "enabled", - ))); - - $formState->setRedirectUrl($this->getCancelUrl()); - } -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php deleted file mode 100644 index 26dfdccd8..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php +++ /dev/null @@ -1,268 +0,0 @@ -setTemporaryValue('gathered_contexts', $this->contextRepository->getAvailableContexts()); - - $form['require_all_conditions'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Require all conditions'), - '#description' => $this->t('If checked, all conditions must be met for this context to be active. Otherwise, the first condition that is met will activate this context.'), - '#default_value' => $this->entity->requiresAllConditions(), - ]; - - $form['conditions'] = [ - '#prefix' => '
', - '#suffix' => '
', - '#markup' => '

' . $this->t('Conditions') . '

', - '#tree' => TRUE, - '#process' => array( - array($this, 'processConditions'), - ), - ]; - - $form['reactions'] = [ - '#prefix' => '
', - '#suffix' => '
', - '#markup' => '

' . $this->t('Reactions') . '

', - '#tree' => TRUE, - '#process' => array( - array($this, 'processReactions'), - ), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $formState) { - $status = parent::save($form, $formState); - - if ($status) { - drupal_set_message($this->t('The context %label has been saved.', [ - '%label' => $this->entity->getLabel(), - ])); - } - else { - drupal_set_message($this->t('The context was not saved.')); - } - - } - - /** - * Process function for the conditions. - * - * @param $element - * The element to process. - * - * @param FormStateInterface $form_state - * The current form state. - * - * @return array - */ - public function processConditions(&$element, FormStateInterface $form_state) { - $conditions = $this->entity->getConditions(); - - $element['add_condition'] = array( - '#type' => 'link', - '#title' => $this->t('Add condition'), - '#url' => Url::fromRoute('context.conditions_library', [ - 'context' => $this->entity->id(), - ]), - '#attributes' => [ - 'class' => [ - 'use-ajax', 'button', 'button--small' - ], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ); - - if (!count($conditions)) { - $element['reactions']['empty'] = [ - '#type' => 'container', - '#markup' => $this->t('No conditions has been added. When there are no added conditions the context will be considered sitewide.'), - ]; - } - - $element['condition_tabs'] = [ - '#type' => 'vertical_tabs', - '#parents' => ['condition_tabs'], - ]; - - foreach ($conditions as $condition_id => $condition) { - $element['condition-' . $condition_id] = [ - '#type' => 'details', - '#title' => $condition->getPluginDefinition()['label'], - '#group' => 'condition_tabs', - ]; - - $element['condition-' . $condition_id]['options'] = $condition->buildConfigurationForm([], $form_state); - $element['condition-' . $condition_id]['options']['#parents'] = ['conditions', $condition_id]; - - $element['condition-' . $condition_id]['remove'] = [ - '#type' => 'link', - '#title' => $this->t('Remove condition'), - '#url' => Url::fromRoute('context.condition_delete', [ - 'context' => $this->entity->id(), - 'condition_id' => $condition_id, - ]), - '#attributes' => [ - 'class' => [ - 'use-ajax', 'button', 'button--small' - ], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ]; - } - - return $element; - } - - /** - * Process function for the reactions. - * - * @param $element - * The element to process. - * - * @param FormStateInterface $form_state - * The current form state. - * - * @return array - */ - public function processReactions(&$element, FormStateInterface $form_state) { - $reactions = $this->entity->getReactions(); - - $element['add_reaction'] = [ - '#type' => 'link', - '#title' => $this->t('Add reaction'), - '#url' => Url::fromRoute('context.reactions_library', [ - 'context' => $this->entity->id(), - ]), - '#attributes' => [ - 'class' => [ - 'use-ajax', 'button', 'button--small' - ], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ]; - - if (!count($reactions)) { - $element['empty'] = [ - '#type' => 'container', - '#markup' => $this->t('No reactions has been added.'), - ]; - } - - $element['reaction_tabs'] = [ - '#type' => 'vertical_tabs', - '#parents' => ['reaction_tabs'], - ]; - - foreach ($reactions as $reaction_id => $reaction) { - $element['reaction-' . $reaction_id] = [ - '#type' => 'details', - '#title' => $reaction->getPluginDefinition()['label'], - '#group' => 'reaction_tabs', - ]; - - $reaction_values = $form_state->getValue(['reactions', $reaction_id], []); - $reaction_state = (new FormState())->setValues($reaction_values); - - $element['reaction-' . $reaction_id]['options'] = $reaction->buildConfigurationForm([], $reaction_state, $this->entity); - $element['reaction-' . $reaction_id]['options']['#parents'] = ['reactions', $reaction_id]; - - $element['reaction-' . $reaction_id]['remove'] = [ - '#type' => 'link', - '#title' => $this->t('Remove reaction'), - '#url' => Url::fromRoute('context.reaction_delete', [ - 'context' => $this->entity->id(), - 'reaction_id' => $reaction_id, - ]), - '#attributes' => [ - 'class' => [ - 'use-ajax', 'button', 'button--small' - ], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ]; - } - - return $element; - } - - /** - * Actions function. - * - * @param array $form - * Form object. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * Form state object. - * - * @return mixed - * Return mixed object. - */ - protected function actions(array $form, FormStateInterface $form_state) { - $element = parent::actions($form, $form_state); - - $element['submit'] = [ - '#type' => 'submit', - '#dropbutton' => 'save', - '#value' => t('Save and continue'), - '#submit' => ['::submitForm', '::save'], - ]; - $element['submit_exit'] = [ - '#type' => 'submit', - '#dropbutton' => 'save', - '#value' => t('Save and exit'), - '#submit' => ['::submitForm', '::save', '::collection'], - ]; - - return $element; - } - - /** - * Collection function makes redirection to route name. - * - * @param array $form - * Form object. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * From state object. - */ - public function collection(array $form, FormStateInterface $form_state) { - $form_state->setRedirect('entity.context.collection'); - - } - -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php deleted file mode 100644 index 827c0d9da..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php +++ /dev/null @@ -1,230 +0,0 @@ -contextManager = $contextManager; - $this->contextRepository = $contextRepository; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('context.manager'), - $container->get('context.repository') - ); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $formState) { - - $form['general'] = [ - '#type' => 'fieldset', - '#title' => $this->t('General details'), - ]; - - $form['general']['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#default_value' => $this->entity->getLabel(), - '#required' => TRUE, - '#description' => $this->t('Enter label for this context.'), - ]; - - $form['general']['name'] = [ - '#type' => 'machine_name', - '#title' => $this->t('Machine name'), - '#default_value' => $this->entity->getName(), - '#machine_name' => [ - 'source' => ['general', 'label'], - 'exists' => [$this, 'contextExists'], - ], - ]; - - $form['general']['group'] = [ - '#type' => 'textfield', - '#title' => $this->t('Group'), - '#default_value' => $this->entity->getGroup(), - '#description' => $this->t('Enter name of the group this context should belong to.'), - '#autocomplete_route_name' => 'context.groups.autocomplete', - ]; - - $form['general']['description'] = [ - '#type' => 'textfield', - '#title' => $this->t('Description'), - '#default_value' => $this->entity->getDescription(), - '#description' => $this->t('Enter a description for this context definition.'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - if ($form_state->hasValue('reactions')) { - $this->validateReactions($form, $form_state); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Save entity values that the built in submit handler cant take care of. - if ($form_state->hasValue('require_all_conditions')) { - $this->entity->setRequireAllConditions($form_state->getValue('require_all_conditions')); - } - - if ($form_state->hasValue('conditions')) { - $this->handleConditions($form, $form_state); - } - - if ($form_state->hasValue('reactions')) { - $this->handleReactions($form, $form_state); - } - - // If the group is empty set it to the context no group value, - // otherwise Drupal will save it as an empty string instead. - if ($form_state->hasValue('group') && empty($form_state->getValue('group'))) { - $form_state->setValue('group', Context::CONTEXT_GROUP_NONE); - } - - // Run the default submit method. - parent::submitForm($form, $form_state); - } - - /** - * Handle submitting the condition plugins configuration forms. - * - * @param array $form - * The rendered form. - * - * @param FormStateInterface $form_state - * The current form state. - */ - private function handleConditions(array &$form, FormStateInterface $form_state) { - $conditions = $form_state->getValue('conditions', []); - - // Loop trough each condition and update the configuration values by - // submitting the conditions form. - foreach ($conditions as $condition_id => $configuration) { - $condition = $this->entity->getCondition($condition_id); - - $condition_values = (new FormState())->setValues($configuration); - $condition->submitConfigurationForm($form, $condition_values); - - // If the condition is context aware then add context mapping to - // the condition. - if ($condition instanceof ContextAwarePluginInterface) { - $condition->setContextMapping($condition_values->getValue('context_mapping', [])); - } - } - } - - /** - * Handle submitting the context reaction plugins configuration forms. - * - * @param array $form - * The rendered form. - * - * @param FormStateInterface $form_state - * The current form state. - */ - private function handleReactions(array &$form, FormStateInterface $form_state) { - $reactions = $form_state->getValue('reactions', []); - - // Loop trough each reaction and update the configuration values by - // submitting the reactions form. - foreach ($reactions as $reaction_id => $configuration) { - $reaction = $this->entity->getReaction($reaction_id); - - $reaction_values = (new FormState())->setValues($configuration); - $reaction->submitConfigurationForm($form, $reaction_values); - } - } - - /** - * Validate the context reaction plugins configuration forms. - * - * @param array $form - * The rendered form. - * - * @param FormStateInterface $form_state - * The current form state. - */ - private function validateReactions(array &$form, FormStateInterface $form_state) { - $reactions = $form_state->getValue('reactions', []); - - // Loop trough each reaction and update the configuration values by - // validating the reactions form. - foreach ($reactions as $reaction_id => $configuration) { - $reaction = $this->entity->getReaction($reaction_id); - - $reaction_values = (new FormState())->setValues($configuration); - $reaction->validateConfigurationForm($form, $reaction_values); - if ($reaction_values->hasAnyErrors()) { - // In case of errors, copy them back from the dummy FormState to the - // master form. - foreach ($reaction_values->getErrors() as $element => $error) { - $form_state->setErrorByName("reactions][$reaction_id][$element", $error); - } - } - } - } - - /** - * Check to see if a context already exists with the specified name. - * - * @param string $name - * The machine name to check for. - * - * @return bool - */ - public function contextExists($name) { - return $this->contextManager->contextExists($name); - } -} diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php deleted file mode 100644 index f46b4d0a1..000000000 --- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php +++ /dev/null @@ -1,143 +0,0 @@ -contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('context.manager') - ); - } - - /** - * Returns the question to ask the user. - * - * @return string - * The form question. The page title will be set to this value. - */ - public function getQuestion() { - return $this->t('Are you sure you want to remove the %reaction reaction.', [ - '%reaction' => $this->reaction->getPluginDefinition()['label'], - ]); - } - - /** - * Returns the route to go to if the user cancels the action. - * - * @return \Drupal\Core\Url - * A URL object. - */ - public function getCancelUrl() { - return $this->context->urlInfo(); - } - - /** - * Returns a unique string identifying the form. - * - * @return string - * The unique string identifying the form. - */ - public function getFormId() { - return 'context_reaction_delete_confirm'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $reaction_id = NULL) { - $this->context = $context; - $this->reaction = $this->context->getReaction($reaction_id); - - $form = parent::buildForm($form, $form_state); - - // Remove the cancel button if this is an AJAX request since Drupals built - // in modal dialogues does not handle buttons that are not a primary - // button very well. - if ($this->getRequest()->isXmlHttpRequest()) { - unset($form['actions']['cancel']); - } - - $form['actions']['submit']['#ajax'] = [ - 'callback' => '::submitFormAjax', - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $definition = $this->reaction->getPluginDefinition(); - - $this->context->removeReaction($this->reaction->getPluginId()); - - $this->context->save(); - - // If this is not an AJAX request then redirect and show a message. - if (!$this->getRequest()->isXmlHttpRequest()) { - drupal_set_message($this->t('The %label context reaction has been removed.', [ - '%label' => $definition['label']] - )); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - } - - /** - * Handle when the form is submitted through AJAX. - * - * @return AjaxResponse - */ - public function submitFormAjax() { - $response = new AjaxResponse(); - - $contextForm = $this->contextManager->getForm($this->context, 'edit'); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions'])); - - return $response; - } -} diff --git a/sites/all/modules/contrib/admin/context/src/ContextInterface.php b/sites/all/modules/contrib/admin/context/src/ContextInterface.php deleted file mode 100644 index c0d6cb65f..000000000 --- a/sites/all/modules/contrib/admin/context/src/ContextInterface.php +++ /dev/null @@ -1,215 +0,0 @@ -entityQuery = $entityQuery; - $this->entityManager = $entityManager; - $this->contextRepository = $contextRepository; - $this->contextHandler = $contextHandler; - $this->entityFormBuilder = $entityFormBuilder; - $this->themeManager = $themeManager; - } - - /** - * Get all contexts. - * - * @return Context[] - */ - public function getContexts() { - $contextIds = $this->entityQuery - ->get('context') - ->execute(); - - $contexts = $this->entityManager - ->getStorage('context') - ->loadMultiple($contextIds); - - // Sort the contexts by their weight. - uasort($contexts, [$this, 'sortContextsByWeight']); - - return $contexts; - } - - /** - * Get all contexts sorted by their group and sorted by their weight inside - * of each group. - * - * @return array - */ - public function getContextsByGroup() { - $contexts = $this->getContexts(); - - $groups = []; - - // Add each context to their respective groups. - foreach ($contexts as $context_id => $context) { - $group = $context->getGroup(); - - if ($group === Context::CONTEXT_GROUP_NONE) { - $group = 'not_grouped'; - } - - $groups[$group][$context_id] = $context; - } - - return $groups; - } - - /** - * Check to validate that the context name does not already exist. - * - * @param string $name - * The machine name of the context to validate. - * - * @return bool - */ - public function contextExists($name) { - $entity = $this->entityQuery->get('context') - ->condition('name', $name) - ->execute(); - - return (bool) $entity; - } - - /** - * Check to see if context conditions has been evaluated. - * - * @return bool - */ - public function conditionsHasBeenEvaluated() { - return $this->contextConditionsEvaluated; - } - - /** - * Get the evaluated and active contexts. - * - * @return \Drupal\context\ContextInterface[] - */ - public function getActiveContexts() { - if ($this->conditionsHasBeenEvaluated()) { - return $this->activeContexts; - } - - $this->evaluateContexts(); - - return $this->activeContexts; - } - - /** - * Evaluate all context conditions. - */ - public function evaluateContexts() { - - /** @var \Drupal\context\ContextInterface $context */ - foreach ($this->getContexts() as $context) { - if ($this->evaluateContextConditions($context) && !$context->disabled()) { - $this->activeContexts[] = $context; - } - } - - $this->contextConditionsEvaluated = TRUE; - } - - /** - * Get all active reactions or reactions of a certain type. - * - * @param string $reactionType - * Either the reaction class name or the id of the reaction type to get. - * - * @return ContextReactionInterface[] - */ - public function getActiveReactions($reactionType = NULL) { - $reactions = []; - - foreach ($this->getActiveContexts() as $context) { - - // If no reaction type has been specified then add all reactions and - // continue to the next context. - if (is_null($reactionType)) { - foreach ($context->getReactions() as $reaction) { - // Only return block reaction if there is a block applied to the current theme. - if ($reaction instanceof Blocks) { - $blocks = $reaction->getBlocks(); - $current_theme = $this->getCurrentTheme(); - foreach ($blocks as $block) { - if ($block->getConfiguration()['theme'] == $current_theme) { - $reactions[] = $reaction; - break; - } - } - } - else { - $reactions[] = $reaction; - } - } - continue; - } - - $contextReactions = $context->getReactions(); - - // Filter the reactions based on the reaction type. - foreach ($contextReactions as $reaction) { - - if (class_exists($reactionType) && $reaction instanceof $reactionType) { - $reactions[] = $reaction; - continue; - } - - if ($reaction->getPluginId() === $reactionType) { - $reactions[] = $reaction; - continue; - } - } - } - - return $reactions; - } - - /** - * Evaluate a contexts conditions. - * - * @param ContextInterface $context - * The context to evaluate conditions for. - * - * @return bool - */ - public function evaluateContextConditions(ContextInterface $context) { - $conditions = $context->getConditions(); - - // Apply context to any context aware conditions. - $this->applyContexts($conditions); - - // Set the logic to use when validating the conditions. - $logic = $context->requiresAllConditions() - ? 'and' - : 'or'; - - // Of there are no conditions then the context will be - // applied as a site wide context. - if (!count($conditions)) { - $logic = 'and'; - } - - return $this->resolveConditions($conditions, $logic); - } - - /** - * Apply context to all the context aware conditions in the collection. - * - * @param ConditionPluginCollection $conditions - * A collection of conditions to apply context to. - * - * @return bool - */ - protected function applyContexts(ConditionPluginCollection &$conditions) { - - foreach ($conditions as $condition) { - if ($condition instanceof ContextAwarePluginInterface) { - try { - $contexts = $this->contextRepository->getRuntimeContexts(array_values($condition->getContextMapping())); - $this->contextHandler->applyContextMapping($condition, $contexts); - } - catch (ContextException $e) { - return FALSE; - } - } - } - - return TRUE; - } - - /** - * Get a rendered form for the context. - * @param \Drupal\context\ContextInterface $context - * @param string $formType - * @param array $form_state_additions - * @return array - */ - public function getForm(ContextInterface $context, $formType = 'edit', array $form_state_additions = array()) { - return $this->entityFormBuilder->getForm($context, $formType, $form_state_additions); - } - - /** - * Sorts an array of context entities by their weight. - * - * Callback for uasort(). - * - * @param ContextInterface $a - * First item for comparison. - * - * @param ContextInterface $b - * Second item for comparison. - * - * @return int - * The comparison result for uasort(). - */ - public function sortContextsByWeight(ContextInterface $a, ContextInterface $b) { - if ($a->getWeight() == $b->getWeight()) { - return 0; - } - - return ($a->getWeight() < $b->getWeight()) ? -1 : 1; - } - - /** - * Get current active theme. - * - * @return string - * Current active theme name. - */ - private function getCurrentTheme() { - return $this->themeManager->getActiveTheme()->getName(); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php b/sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php deleted file mode 100644 index 0d58d438c..000000000 --- a/sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php +++ /dev/null @@ -1,51 +0,0 @@ -contextManager = $context_manager; - } - - - /** - * {@inheritdoc} - */ - public function getActiveLink($menu_name = NULL) { - $found = parent::getActiveLink($menu_name); - - // Get active reaction of Menu type. - foreach($this->contextManager->getActiveReactions('menu') as $reaction) { - $menu_items = $reaction->execute(); - foreach ($menu_items as $menu_link_content) { - $menu = strtok($menu_link_content, ':'); - if ($menu == $menu_name) { - $plugin_id = substr($menu_link_content, strlen($menu) + 1); - return $this->menuLinkManager->createInstance($plugin_id); - } - } - } - return $found; - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php b/sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php deleted file mode 100644 index 1010cdbe1..000000000 --- a/sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -alterInfo('context_condition_info'); - $this->setCacheBackend($cache_backend, 'context_condition_plugins'); - } -} diff --git a/sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php b/sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php deleted file mode 100644 index a8488f29d..000000000 --- a/sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php +++ /dev/null @@ -1,68 +0,0 @@ -setConfiguration($configuration); - } - - /** - * {@inheritdoc} - */ - public function getId() { - if (isset($this->getConfiguration()['id'])) { - return $this->getConfiguration()['id']; - } - - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getConfiguration() { - return [ - 'id' => $this->getPluginId(), - ] + $this->configuration; - } - - /** - * {@inheritdoc} - */ - public function setConfiguration(array $configuration) { - $this->configuration = $configuration + $this->defaultConfiguration(); - return $this; - } - - /** - * Form validation handler is optional. - * - * {@inheritdoc} - */ - public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {} - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'saved' => FALSE, - ]; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - return []; - } -} diff --git a/sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php b/sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php deleted file mode 100644 index 96aeebf80..000000000 --- a/sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php +++ /dev/null @@ -1,23 +0,0 @@ -getDefinition('menu.active_trail'); - $definition->setClass('Drupal\context\ContextMenuActiveTrail'); - $definition->addArgument($container->getDefinition('context.manager')); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Entity/Context.php b/sites/all/modules/contrib/admin/context/src/Entity/Context.php deleted file mode 100644 index 15d2d9016..000000000 --- a/sites/all/modules/contrib/admin/context/src/Entity/Context.php +++ /dev/null @@ -1,376 +0,0 @@ -name; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function setName($name) { - - if (!is_string($name)) { - throw new InvalidArgumentException('The context name must be a string.'); - } - - $this->name = $name; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getLabel() { - return $this->label; - } - - /** - * {@inheritdoc} - */ - public function setLabel($label) { - - if (!is_string($label)) { - throw new InvalidArgumentException('The context label must be a string.'); - } - - $this->label = $label; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->description; - } - - /** - * {@inheritdoc} - */ - public function setDescription($description) { - - if (!is_string($description)) { - throw new InvalidArgumentException('The context description must be a string.'); - } - - $this->description = $description; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getGroup() { - return $this->group; - } - - /** - * {@inheritdoc} - */ - public function setGroup($group) { - $this->group = (is_string($group) && !empty($group)) ? $group : self::CONTEXT_GROUP_NONE; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getWeight() { - return $this->weight; - } - - /** - * {@inheritdoc} - */ - public function setWeight($weight) { - $this->weight = (int) $weight; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function requiresAllConditions() { - return $this->requireAllConditions; - } - - /** - * {@inheritdoc} - */ - public function setRequireAllConditions($require) { - $this->requireAllConditions = (bool) $require; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getConditions() { - if (!$this->conditionsCollection) { - $conditionManager = Drupal::service('plugin.manager.condition'); - $this->conditionsCollection = new ConditionPluginCollection($conditionManager, $this->conditions); - } - - return $this->conditionsCollection; - } - - /** - * {@inheritdoc} - */ - public function getCondition($condition_id) { - return $this->getConditions()->get($condition_id); - } - - /** - * {@inheritdoc} - */ - public function addCondition(array $configuration) { - // Add an UUID to the condition to make sure the configuration is saved - // since the configuration export from the conditions collection wont - // export configuration that has not been "configured". - $configuration['uuid'] = $this->uuidGenerator()->generate(); - - $this->getConditions()->addInstanceId($configuration['id'], $configuration); - - return $configuration['id']; - } - - /** - * {@inheritdoc} - */ - public function removeCondition($condition_id) { - $this->getConditions()->removeInstanceId($condition_id); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function hasCondition($condition_id) { - return $this->getConditions()->has($condition_id); - } - - /** - * {@inheritdoc} - */ - public function getReactions() { - if (!$this->reactionsCollection) { - $reactionManager = Drupal::service('plugin.manager.context_reaction'); - $this->reactionsCollection = new ContextReactionPluginCollection($reactionManager, $this->reactions); - } - - return $this->reactionsCollection; - } - - /** - * {@inheritdoc} - */ - public function getReaction($reaction_id) { - return $this->getReactions()->get($reaction_id); - } - - /** - * {@inheritdoc} - */ - public function addReaction(array $configuration) { - // Add an UUID to the condition to make sure the configuration is saved - // since the configuration export from the conditions collection wont - // export configuration that has not been "configured". - $configuration['uuid'] = $this->uuidGenerator()->generate(); - - $this->getReactions()->addInstanceId($configuration['id'], $configuration); - - return $configuration['id']; - } - - /** - * {@inheritdoc} - */ - public function removeReaction($reaction_id) { - $this->getReactions()->removeInstanceId($reaction_id); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function hasReaction($reaction_id) { - return $this->getReactions()->has($reaction_id); - } - - /** - * Gets the plugin collections used by this entity. - * - * @return \Drupal\Component\Plugin\LazyPluginCollection[] - * An array of plugin collections, keyed by the property name they use to - * store their configuration. - */ - public function getPluginCollections() { - return [ - 'reactions' => $this->getReactions(), - 'conditions' => $this->getConditions(), - ]; - } - - /** - * Disable context. - */ - public function disable() { - $this->disabled = !$this->disabled(); - $this->save(); - } - - /** - * {@inheritdoc} - */ - public function disabled() { - return $this->disabled; - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php b/sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php deleted file mode 100644 index 627ab27d8..000000000 --- a/sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php +++ /dev/null @@ -1,45 +0,0 @@ -contextManager = $contextManager; - } - - /** - * Selects the context block page display variant. - * - * @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event - * The event to process. - */ - public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event) { - // Activate the context block page display variant if any of the reactions - // is a blocks reaction. - foreach ($this->contextManager->getActiveReactions() as $reaction) { - if ($reaction instanceof Blocks) { - $event->setPluginId('context_block_page'); - break; - } - } - } - - /** - * {@inheritdoc} - */ - static function getSubscribedEvents() { - $events[RenderEvents::SELECT_PAGE_DISPLAY_VARIANT][] = array('onSelectPageDisplayVariant'); - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php b/sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php deleted file mode 100644 index d61af38c6..000000000 --- a/sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php +++ /dev/null @@ -1,49 +0,0 @@ - ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 1000, - ]), - ]; - } - - /** - * Gets attributes for use with an add button AJAX modal. - * - * @return array - */ - public static function getAjaxButtonAttributes() { - return NestedArray::mergeDeep(AjaxFormTrait::getAjaxAttributes(), [ - 'class' => [ - 'button', - 'button--small', - 'button-action', - ], - ]); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php b/sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php deleted file mode 100644 index 7796a3bd0..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php +++ /dev/null @@ -1,36 +0,0 @@ -uuid = $uuid; - $this->themeManager = $themeManager; - $this->themeHandler = $themeHandler; - $this->contextRepository = $contextRepository; - $this->contextHandler = $contextHandler; - $this->account = $account; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) { - return new static( - $configuration, - $pluginId, - $pluginDefinition, - $container->get('uuid'), - $container->get('theme.manager'), - $container->get('theme_handler'), - $container->get('context.repository'), - $container->get('context.handler'), - $container->get('current_user') - ); - } - - /** - * Executes the plugin. - * - * @param array $build - * The current build of the page. - * - * @param string|null $title - * The page title. - * - * @param string|null $main_content - * The main page content. - * - * @return array - */ - public function execute(array $build = array(), $title = NULL, $main_content = NULL) { - - $cacheability = CacheableMetadata::createFromRenderArray($build); - - // Use the currently active theme to fetch blocks. - $theme = $this->themeManager->getActiveTheme()->getName(); - - $regions = $this->getBlocks()->getAllByRegion($theme); - - // Add each block to the page build. - foreach ($regions as $region => $blocks) { - - /** @var $blocks BlockPluginInterface[] */ - foreach ($blocks as $block_id => $block) { - $configuration = $block->getConfiguration(); - - $block_placement_key = $this->blockShouldBePlacedUniquely($block) - ? $block_id - : $block->getConfiguration()['id']; - - if ($block instanceof MainContentBlockPluginInterface) { - if (isset($build['content']['system_main'])) { - unset($build['content']['system_main']); - } - $block->setMainContent($main_content); - } - - // Make sure the user is allowed to view the block. - $access = $block->access($this->account, TRUE); - $cacheability->addCacheableDependency($access); - - // If the user is not allowed then do not render the block. - if (!$access->isAllowed()) { - continue; - } - - if ($block instanceof TitleBlockPluginInterface) { - if (isset($build['content']['messages'])) { - unset($build['content']['messages']); - } - $block->setTitle($title); - } - - // Inject runtime contexts. - if ($block instanceof ContextAwarePluginInterface) { - $contexts = $this->contextRepository->getRuntimeContexts($block->getContextMapping()); - $this->contextHandler->applyContextMapping($block, $contexts); - } - - // Create the render array for the block as a whole. - // @see template_preprocess_block(). - $blockBuild = [ - '#theme' => 'block', - '#attributes' => [ - 'class' => [$block->getConfiguration()['css_class']] - ], - '#configuration' => $configuration, - '#plugin_id' => $block->getPluginId(), - '#base_plugin_id' => $block->getBaseId(), - '#derivative_plugin_id' => $block->getDerivativeId(), - '#block_plugin' => $block, - '#pre_render' => [[$this, 'preRenderBlock']], - '#cache' => [ - 'keys' => ['context_blocks_reaction', 'block', $block_placement_key], - 'tags' => $block->getCacheTags(), - 'contexts' => $block->getCacheContexts(), - 'max-age' => $block->getCacheMaxAge(), - ], - ]; - - // Add contextual links to block. - $content = $block->build(); - if (isset($content['#contextual_links'])) { - $blockBuild['#contextual_links'] = $content['#contextual_links']; - } - - // Add additional contextual link, for editing block configuration. - $blockBuild['#contextual_links']['context_block'] = [ - 'route_parameters' => [ - 'context' => $configuration['context_id'], - 'reaction_id' => 'blocks', - 'block_id' => $block->getConfiguration()['uuid'], - ], - ]; - - if (array_key_exists('weight', $configuration)) { - $blockBuild['#weight'] = $configuration['weight']; - } - - $build[$region][$block_placement_key] = $blockBuild; - - // After merging with blocks from Block layout, we want to sort all of - // them again. - $build[$region]['#sorted'] = FALSE; - - // The main content block cannot be cached: it is a placeholder for the - // render array returned by the controller. It should be rendered as-is, - // with other placed blocks "decorating" it. Analogous reasoning for the - // title block. - if ($block instanceof MainContentBlockPluginInterface || $block instanceof TitleBlockPluginInterface) { - unset($build[$region][$block_placement_key]['#cache']['keys']); - } - - $cacheability->addCacheableDependency($block); - } - } - - $cacheability->applyTo($build); - - return $build; - } - - /** - * Renders the content using the provided block plugin. - * - * @param array $build - * @return array - */ - public function preRenderBlock($build) { - - $content = $build['#block_plugin']->build(); - - unset($build['#block_plugin']); - - // Abort rendering: render as the empty string and ensure this block is - // render cached, so we can avoid the work of having to repeatedly - // determine whether the block is empty. E.g. modifying or adding entities - // could cause the block to no longer be empty. - if (is_null($content) || Element::isEmpty($content)) { - $build = [ - '#markup' => '', - '#cache' => $build['#cache'], - ]; - - // If $content is not empty, then it contains cacheability metadata, and - // we must merge it with the existing cacheability metadata. This allows - // blocks to be empty, yet still bubble cacheability metadata, to indicate - // why they are empty. - if (!empty($content)) { - CacheableMetadata::createFromRenderArray($build) - ->merge(CacheableMetadata::createFromRenderArray($content)) - ->applyTo($build); - } - } - else { - $build['content'] = $content; - } - - return $build; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'blocks' => [] - ] + parent::defaultConfiguration(); - } - - /** - * {@inheritdoc} - */ - public function setConfiguration(array $configuration) { - $this->configuration = $configuration + $this->defaultConfiguration(); - - if (isset($configuration['blocks'])) { - $this->blocks = $configuration['blocks']; - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getConfiguration() { - return [ - 'blocks' => $this->getBlocks()->getConfiguration(), - ] + parent::getConfiguration(); - } - - /** - * {@inheritdoc} - */ - public function summary() { - return $this->t('Lets you add blocks to the selected themes regions'); - } - - /** - * Get all blocks as a collection. - * - * @return BlockPluginInterface[]|BlockCollection - */ - public function getBlocks() { - if (!$this->blocksCollection) { - $blockManager = \Drupal::service('plugin.manager.block'); - $this->blocksCollection = new BlockCollection($blockManager, $this->blocks); - } - - return $this->blocksCollection; - } - - /** - * Get a block by id. - * - * @param string $blockId - * The ID of the block to get. - * - * @return BlockPluginInterface - */ - public function getBlock($blockId) { - return $this->getBlocks()->get($blockId); - } - - /** - * Add a new block. - * - * @param array $configuration - */ - public function addBlock(array $configuration) { - $configuration['uuid'] = $this->uuid->generate(); - - $this->getBlocks()->addInstanceId($configuration['uuid'], $configuration); - - return $configuration['uuid']; - } - - /** - * Update an existing blocks configuration. - * - * @param string $blockId - * The ID of the block to update. - * - * @param $configuration - * The updated configuration for the block. - * - * @return $this - */ - public function updateBlock($blockId, array $configuration) { - $existingConfiguration = $this->getBlock($blockId)->getConfiguration(); - - $this->getBlocks()->setInstanceConfiguration($blockId, $configuration + $existingConfiguration); - - return $this; - } - - /** - * @param $blockId - * @return $this - */ - public function removeBlock($blockId) { - $this->getBlocks()->removeInstanceId($blockId); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL) { - $form['#attached']['library'][] = 'block/drupal.block'; - - $themes = $this->themeHandler->listInfo(); - - $default_theme = $this->themeHandler->getDefault(); - - // Select list for changing themes. - $form['theme'] = [ - '#type' => 'select', - '#title' => $this->t('Theme'), - '#options' => [], - '#description' => $this->t('Select the theme you want to display regions for.'), - '#default_value' => $form_state->getValue('theme', $default_theme), - '#ajax' => [ - 'url' => Url::fromRoute('context.reaction.blocks.regions', [ - 'context' => $context->id(), - ]), - ], - ]; - - // Add each theme to the theme select. - foreach ($themes as $theme_id => $theme) { - if ($theme_id === $default_theme) { - $form['theme']['#options'][$theme_id] = $this->t('%theme (Default)', [ - '%theme' => $theme->info['name'], - ]); - } - else { - $form['theme']['#options'][$theme_id] = $theme->info['name']; - } - } - - $form['blocks'] = [ - '#type' => 'container', - '#attributes' => [ - 'id' => 'context-reaction-blocks-container', - ], - ]; - - $form['blocks']['include_default_blocks'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Include blocks from Block layout'), - '#description' => $this->t('if checked, all blocks from default Block layout will also be included in page build.'), - '#weight' => -10, - '#default_value' => isset($this->getConfiguration()['include_default_blocks']) ? $this->getConfiguration()['include_default_blocks'] : FALSE, - ]; - - - $form['blocks']['block_add'] = [ - '#type' => 'link', - '#title' => $this->t('Place block'), - '#attributes' => [ - 'id' => 'context-reaction-blocks-region-add', - ] + $this->getAjaxButtonAttributes(), - '#url' => Url::fromRoute('context.reaction.blocks.library', [ - 'context' => $context->id(), - 'reaction_id' => $this->getPluginId(), - ], [ - 'query' => [ - 'theme' => $form_state->getValue('theme', $default_theme), - ], - ]), - ]; - - $form['blocks']['blocks'] = [ - '#type' => 'table', - '#header' => [ - $this->t('Block'), - $this->t('Category'), - $this->t('Unique'), - $this->t('Region'), - $this->t('Weight'), - $this->t('Operations'), - ], - '#empty' => $this->t('No regions available to place blocks in.'), - '#attributes' => [ - 'id' => 'blocks', - ], - ]; - - // If a theme has been selected use that to get the regions otherwise use - // the default theme. - $theme = $form_state->getValue('theme', $default_theme); - - // Get all blocks by their regions. - $blocks = $this->getBlocks()->getAllByRegion($theme); - - // Get regions of the selected theme. - $regions = $this->getSystemRegionList($theme); - - // Add each region. - foreach ($regions as $region => $title) { - - // Add the tabledrag details for this region. - $form['blocks']['blocks']['#tabledrag'][] = [ - 'action' => 'match', - 'relationship' => 'sibling', - 'group' => 'block-region-select', - 'subgroup' => 'block-region-' . $region, - 'hidden' => FALSE, - ]; - - $form['blocks']['blocks']['#tabledrag'][] = [ - 'action' => 'order', - 'relationship' => 'sibling', - 'group' => 'block-weight', - 'subgroup' => 'block-weight-' . $region, - ]; - - // Add the theme region. - $form['blocks']['blocks']['region-' . $region] = [ - '#attributes' => [ - 'class' => ['region-title'], - ], - 'title' => [ - '#markup' => $title, - '#wrapper_attributes' => [ - 'colspan' => 6, - ], - ], - ]; - - $regionEmptyClass = empty($blocks[$region]) - ? 'region-empty' - : 'region-populated'; - - $form['blocks']['blocks']['region-' . $region . '-message'] = [ - '#attributes' => [ - 'class' => ['region-message', 'region-' . $region . '-message', $regionEmptyClass], - ], - 'message' => [ - '#markup' => '' . $this->t('No blocks in this region') . '', - '#wrapper_attributes' => [ - 'colspan' => 6, - ], - ], - ]; - - // Add each block specified for the region if there are any. - if (isset($blocks[$region])) { - /** @var BlockPluginInterface $block */ - foreach ($blocks[$region] as $block_id => $block) { - $configuration = $block->getConfiguration(); - - $operations = [ - 'edit' => [ - 'title' => $this->t('Edit'), - 'url' => Url::fromRoute('context.reaction.blocks.block_edit', [ - 'context' => $context->id(), - 'reaction_id' => $this->getPluginId(), - 'block_id' => $block_id, - ], [ - 'query' => [ - 'theme' => $theme, - ], - ]), - 'attributes' => $this->getAjaxAttributes(), - ], - 'delete' => [ - 'title' => $this->t('Delete'), - 'url' => Url::fromRoute('context.reaction.blocks.block_delete', [ - 'context' => $context->id(), - 'block_id' => $block_id, - ]), - 'attributes' => $this->getAjaxAttributes(), - ], - ]; - - $form['blocks']['blocks'][$block_id] = [ - '#attributes' => [ - 'class' => ['draggable'], - ], - 'label' => [ - '#markup' => $block->label(), - ], - 'category' => [ - '#markup' => $block->getPluginDefinition()['category'], - ], - 'unique' => [ - '#markup' => $this->blockShouldBePlacedUniquely($block) ? $this->t('Yes') : $this->t('No'), - ], - 'region' => [ - '#type' => 'select', - '#title' => $this->t('Region for @block block', ['@block' => $block->label()]), - '#title_display' => 'invisible', - '#default_value' => $region, - '#options' => $regions, - '#attributes' => [ - 'class' => ['block-region-select', 'block-region-' . $region], - ], - ], - 'weight' => [ - '#type' => 'weight', - '#default_value' => isset($configuration['weight']) ? $configuration['weight'] : 0, - '#title' => $this->t('Weight for @block block', ['@block' => $block->label()]), - '#title_display' => 'invisible', - '#attributes' => [ - 'class' => ['block-weight', 'block-weight-' . $region], - ], - ], - 'operations' => [ - '#type' => 'operations', - '#links' => $operations, - ], - ]; - } - } - } - - return $form; - } - - /** - * Check to see if the block should be uniquely placed. - * - * @param BlockPluginInterface $block - * - * @return bool - */ - private function blockShouldBePlacedUniquely(BlockPluginInterface $block) { - $configuration = $block->getConfiguration(); - return (isset($configuration['unique']) && $configuration['unique']); - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $blocks = $form_state->getValue(['blocks', 'blocks'], []); - - // Save configuration for including default blocks. - $config = $this->getConfiguration(); - $config['include_default_blocks'] = $form_state->getValue(['blocks', 'include_default_blocks'], FALSE); - $this->setConfiguration($config); - - if (is_array($blocks)) { - foreach ($blocks as $block_id => $configuration) { - $block = $this->getBlock($block_id); - $configuration += $block->getConfiguration(); - - $block_state = (new FormState())->setValues($configuration); - $block->submitConfigurationForm($form, $block_state); - - // If the block is context aware then add context mapping to the block. - if ($block instanceof ContextAwarePluginInterface) { - $block->setContextMapping($block_state->getValue('context_mapping', [])); - } - - $this->updateBlock($block_id, $block_state->getValues()); - } - } - } - - /** - * Should reaction include default blocks from Block layout. - * - * @return bool - */ - public function includeDefaultBlocks() { - $config = $this->getConfiguration(); - return isset($config['include_default_blocks']) ? $config['include_default_blocks'] : FALSE; - } - - /** - * Wraps system_region_list(). - * - * @param string $theme - * The theme to get a list of regions for. - * - * @param string $show - * What type of regions that should be returned, defaults to all regions. - * - * @return array - * - * @todo This could be moved to a service since we use it in a couple of places. - */ - protected function getSystemRegionList($theme, $show = REGIONS_ALL) { - return system_region_list($theme, $show); - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php deleted file mode 100644 index 56df9ece4..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php +++ /dev/null @@ -1,66 +0,0 @@ - '', - ]; - } - - /** - * {@inheritdoc} - */ - public function summary() { - return $this->getConfiguration()['body_class']; - } - - /** - * {@inheritdoc} - */ - public function execute(array &$vars = []) { - return [ - 'class' => explode(' ', $this->getConfiguration()['body_class']), - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form['body_class'] = [ - '#title' => $this->t('Section class'), - '#type' => 'textfield', - '#description' => $this->t('Provides this text as additional body class in the html.html.twig.'), - '#default_value' => $this->getConfiguration()['body_class'], - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->setConfiguration([ - 'body_class' => $form_state->getValue('body_class'), - ]); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php deleted file mode 100644 index 44e7b92e6..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php +++ /dev/null @@ -1,91 +0,0 @@ -menuParentFormSelector = $menu_parent_form_selector; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('menu.parent_form_selector') - ); - } - - /** - * {@inheritdoc} - */ - public function summary() { - return $this->t('Set active menu item based on conditions.'); - } - - /** - * {@inheritdoc} - */ - public function execute(array &$vars = []) { - $config = $this->getConfiguration(); - return $config['menu']; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $parent_element = $this->menuParentFormSelector->parentSelectElement('main:'); - $config = $this->getConfiguration(); - $form['menu_items'] = [ - '#title' => $this->t('Menu'), - '#type' => 'select', - '#options' => $parent_element['#options'], - '#multiple' => TRUE, - '#default_value' => isset($config['menu']) ? $config['menu'] : '', - '#size' => 15, - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $values = array_keys($form_state->getValue('menu_items')); - - $this->setConfiguration([ - 'menu' => $values, - ]); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php deleted file mode 100644 index 76e1e8c8d..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php +++ /dev/null @@ -1,55 +0,0 @@ -t('Gives you ability to add template suggestions.'); - } - - /** - * Executes the plugin. - */ - public function execute() { - $config = $this->getConfiguration(); - return $config['suggestions']; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $config = $this->getConfiguration(); - - $form['suggestions'] = [ - '#type' => 'textarea', - '#title' => $this->t('Page template suggestions'), - '#default_value' => isset($config['suggestions']) ? $config['suggestions'] : '', - '#description' => $this->t('Enter page template suggestions such as "page__front", one per line, in order of preference (using underscores instead of hyphens). Entered template suggestions will override page.html.twig template.'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $config['suggestions'] = str_replace("\r\n", "\n", $form_state->getValue('suggestions')); - $this->setConfiguration($config); - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php deleted file mode 100644 index 153464a81..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php +++ /dev/null @@ -1,170 +0,0 @@ -themeManager = $themeManager; - $this->themeHandler = $themeHandler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) { - return new static( - $configuration, - $pluginId, - $pluginDefinition, - $container->get('theme.manager'), - $container->get('theme_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function summary() { - return $this->t('Lets you remove regions from selected theme.'); - } - - /** - * Executes the plugin. - */ - public function execute() { - // TODO: Implement execute() method. - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - - $themes = $this->themeHandler->listInfo(); - $default_theme = $this->themeHandler->getDefault(); - - // Build configuration form for each installed theme. - foreach ($themes as $theme_id => $theme) { - if ($theme_id == $default_theme) { - $title = $this->t('Disable Regions in %theme (Default)', [ - '%theme' => $theme->info['name'], - ]); - } - else { - $title = $this->t('Disable Regions in %theme', [ - '%theme' => $theme->info['name'], - ]); - } - - $form[$theme_id] = [ - '#type' => 'details', - '#title' => $title, - '#weight' => 5, - '#open' => FALSE, - ]; - - // Get regions of the theme. - $regions = $this->getSystemRegionList($theme_id); - - // Get disabled regions. - $disabled_regions = $this->getDisabledRegions(); - - $form[$theme_id]['regions'] = [ - '#type' => 'checkboxes', - '#options' => $regions, - '#title' => $this->t('Disable the following'), - '#default_value' => isset($disabled_regions[$theme_id]) ? $disabled_regions[$theme_id] : [], - ]; - } - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $themes = $form_state->getValues(); - if (is_array($themes)) { - foreach ($themes as $theme_name => $region) { - $disabled_regions = array_keys(array_filter($region['regions'])); - if (!empty($disabled_regions)) { - $configuration['regions'][$theme_name] = $disabled_regions; - $configuration += $this->getConfiguration(); - } - else { - $configuration['regions'][$theme_name] = []; - $configuration += $this->getConfiguration(); - } - $this->setConfiguration($configuration); - } - } - } - - /** - * Wraps system_region_list(). - * - * @param string $theme - * The theme to get a list of regions for. - * - * @param string $show - * What type of regions that should be returned, defaults to all regions. - * - * @return array - * - * @todo This could be moved to a service since we use it in a couple of places. - */ - protected function getSystemRegionList($theme, $show = REGIONS_ALL) { - return system_region_list($theme, $show); - } - - /** - * Get disabled regions. - */ - protected function getDisabledRegions() { - $configurations = $this->getConfiguration(); - return isset($configurations['regions']) ? $configurations['regions'] : []; - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php deleted file mode 100644 index 204e295ec..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php +++ /dev/null @@ -1,105 +0,0 @@ -themeManager = $themeManager; - $this->themeHandler = $themeHandler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) { - return new static( - $configuration, - $pluginId, - $pluginDefinition, - $container->get('theme.manager'), - $container->get('theme_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function summary() { - return $this->t('Gives you ability to change theme.'); - } - - /** - * Executes the plugin. - */ - public function execute() { - // TODO: Implement execute() method. - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - - $themes = $this->themeHandler->listInfo(); - $default_theme = $this->themeHandler->getDefault(); - - $theme_options = []; - foreach ($themes as $theme_id => $theme) { - $theme_options[$theme_id] = $theme->info['name']; - } - $configuration = $this->getConfiguration(); - - $form['theme'] = [ - '#type' => 'radios', - '#options' => $theme_options, - '#title' => $this->t('Select theme'), - '#default_value' => isset($configuration['theme']) ? $configuration['theme'] : $default_theme, - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $configuration['theme'] = $form_state->getValue('theme'); - $configuration += $this->getConfiguration(); - $this->setConfiguration($configuration); - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php deleted file mode 100644 index e464f9af8..000000000 --- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php +++ /dev/null @@ -1,17 +0,0 @@ -contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('context.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function setMainContent(array $main_content) { - $this->mainContent = $main_content; - return $this; - } - - /** - * {@inheritdoc} - */ - public function setTitle($title) { - $this->title = $title; - return $this; - } - - /** - * {@inheritdoc} - */ - public function build() { - $build = [ - '#cache' => [ - 'tags' => ['context_block_page', $this->getPluginId()], - ], - ]; - - // Place main content block, it will be removed by the reactions if a main - // content block has been manually placed. - $build['content']['system_main'] = $this->mainContent; - - // Execute each block reaction and let them modify the page build. - foreach ($this->contextManager->getActiveReactions('blocks') as $reaction) { - $build = $reaction->execute($build, $this->title, $this->mainContent); - } - - // Execute each block reaction and check if default block should be included in page build. - foreach ($this->contextManager->getActiveReactions('blocks') as $reaction) { - if ($reaction->includeDefaultBlocks()) { - $build = NestedArray::mergeDeep($this->getBuildFromBlockLayout(), $build); - return $build; - } - } - return $build; - } - - /** - * Get build from Block layout. - */ - private function getBuildFromBlockLayout() { - $plugin_manager = \Drupal::service('plugin.manager.display_variant'); - $display_variant = $plugin_manager->createInstance('block_page', $plugin_manager->getDefinition('block_page')); - $display_variant->setTitle($this->title); - - return $display_variant->build(); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php b/sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php deleted file mode 100644 index b27033848..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php +++ /dev/null @@ -1,48 +0,0 @@ - $block) { - $configuration = $block->getConfiguration(); - - if ($configuration['theme'] !== $theme) { - continue; - } - - $region = isset($configuration['region']) - ? $configuration['region'] - : NULL; - - $region_assignments[$region][$block_id] = $block; - } - - foreach ($region_assignments as $region => $region_assignment) { - // @todo Determine the reason this needs error suppression. - @uasort($region_assignment, function (BlockPluginInterface $a, BlockPluginInterface $b) { - $a_config = $a->getConfiguration(); - $a_weight = isset($a_config['weight']) ? $a_config['weight'] : 0; - - $b_config = $b->getConfiguration(); - $b_weight = isset($b_config['weight']) ? $b_config['weight'] : 0; - - if ($a_weight == $b_weight) { - return strcmp($a->label(), $b->label()); - } - - return $a_weight > $b_weight ? 1 : -1; - }); - - $region_assignments[$region] = $region_assignment; - } - - return $region_assignments; - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php deleted file mode 100644 index 3e16250f2..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php +++ /dev/null @@ -1,210 +0,0 @@ -blockManager = $blockManager; - $this->contextRepository = $contextRepository; - $this->themeHandler = $themeHandler; - $this->contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.block'), - $container->get('context.repository'), - $container->get('theme_handler'), - $container->get('context.manager') - ); - } - - /** - * Display a library of blocks that can be added to the context reaction. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. - * - * @param \Drupal\context\ContextInterface $context - * The context the blocks reaction belongs to. - * - * @param string $reaction_id - * The ID of the blocks reaction that the selected block - * should be added to. - * - * @return array - */ - public function blocksLibrary(Request $request, ContextInterface $context, $reaction_id) { - - // If a theme has been defined in the query string then use this for - // the add block link, default back to the default theme. - $theme = $request->query->get('theme', $this->themeHandler->getDefault()); - - // Only add blocks which work without any available context. - $blocks = $this->blockManager->getDefinitionsForContexts($this->contextRepository->getAvailableContexts()); - - // Order by category, and then by admin label. - $blocks = $this->blockManager->getSortedDefinitions($blocks); - - $build['filter'] = [ - '#type' => 'search', - '#title' => $this->t('Filter'), - '#title_display' => 'invisible', - '#size' => 30, - '#placeholder' => $this->t('Filter by block name'), - '#attributes' => [ - 'class' => ['context-table-filter'], - 'data-element' => '.block-add-table', - 'title' => $this->t('Enter a part of the block name to filter by.'), - ], - ]; - - $headers = [ - $this->t('Block'), - $this->t('Category'), - $this->t('Operations'), - ]; - - $build['blocks'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => [], - '#empty' => $this->t('No blocks available.'), - '#attributes' => [ - 'class' => ['block-add-table'], - ], - ]; - - // Add each block definition to the table. - foreach ($blocks as $block_id => $block) { - $links = [ - 'add' => [ - 'title' => $this->t('Place block'), - 'url' => Url::fromRoute('context.reaction.blocks.block_add', [ - 'context' => $context->id(), - 'reaction_id' => $reaction_id, - 'block_id' => $block_id, - ], [ - 'query' => [ - 'theme' => $theme, - ], - ]), - 'attributes' => [ - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ], - ]; - - $build['blocks']['#rows'][] = [ - 'title' => [ - 'data' => [ - '#type' => 'inline_template', - '#template' => '
{{ label }}
', - '#context' => [ - 'label' => $block['admin_label'], - ], - ], - ], - 'category' => [ - 'data' => $block['category'], - ], - 'operations' => [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ], - ]; - } - - $build['#attached']['library'][] = 'context_ui/admin'; - - return $build; - } - - /** - * Callback for the theme select list on the Context blocks reaction form. - * - * @param Request $request - * The current request. - * - * @param ContextInterface $context - * The context the block reaction is located on. - * - * @return \Drupal\Core\Ajax\AjaxResponse - */ - public function blocksFormThemeSelect(Request $request, ContextInterface $context) { - $theme = $request->request->get('reactions[blocks][theme]', '', TRUE); - - // Get the context form and supply it with the blocks theme value. - $form = $this->contextManager->getForm($context, 'edit', [ - 'reactions' => [ - 'blocks' => [ - 'theme' => $theme, - ], - ], - ]); - - $response = new AjaxResponse(); - - $response->addCommand(new ReplaceCommand('#context-reactions', $form['reactions'])); - - return $response; - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php deleted file mode 100644 index 7dc9a2f90..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php +++ /dev/null @@ -1,30 +0,0 @@ -t('Add block'); - } - - /** - * {@inheritdoc} - */ - protected function prepareBlock($block_id) { - return $this->blockManager->createInstance($block_id); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php deleted file mode 100644 index d2feed2e0..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php +++ /dev/null @@ -1,151 +0,0 @@ -contextManager = $contextManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static ( - $container->get('context.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'context_reaction_blocks_delete_block_form'; - } - - /** - * Returns the question to ask the user. - * - * @return string - * The form question. The page title will be set to this value. - */ - public function getQuestion() { - return $this->t('Are you sure you want to remove the %label block?', [ - '%label' => $this->block->getConfiguration()['label'], - ]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return $this->context->urlInfo(); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $block_id = NULL) { - $this->context = $context; - - $this->reaction = $this->context->getReaction('blocks'); - $this->block = $this->reaction->getBlock($block_id); - - $form = parent::buildForm($form, $form_state); - - // Remove the cancel button if this is an AJAX request since Drupals built - // in modal dialogues does not handle buttons that are not a primary - // button very well. - if ($this->getRequest()->isXmlHttpRequest()) { - unset($form['actions']['cancel']); - } - - // Submit the form with AJAX if possible. - $form['actions']['submit']['#ajax'] = [ - 'callback' => '::submitFormAjax' - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $configuration = $this->block->getConfiguration(); - - $this->reaction->removeBlock($configuration['uuid']); - - $this->context->save(); - - // If this is not an AJAX request then redirect and show a message. - if (!$this->getRequest()->isXmlHttpRequest()) { - drupal_set_message($this->t('The %label block has been removed.', [ - '%label' => $configuration['label']] - )); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - } - - /** - * Handle when the form is submitted trough AJAX. - * - * @return AjaxResponse - */ - public function submitFormAjax() { - $contextForm = $this->contextManager->getForm($this->context, 'edit'); - - $response = new AjaxResponse(); - - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions'])); - - return $response; - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php deleted file mode 100644 index deca31101..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php +++ /dev/null @@ -1,28 +0,0 @@ -t('Update block'); - } - - /** - * {@inheritdoc} - */ - protected function prepareBlock($block_id) { - return $this->reaction->getBlock($block_id); - } - -} diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php deleted file mode 100644 index c8738fdc9..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php +++ /dev/null @@ -1,343 +0,0 @@ -blockManager = $block_manager; - $this->contextRepository = $contextRepository; - $this->themeHandler = $themeHandler; - $this->formBuilder = $formBuilder; - $this->contextReactionManager = $contextReactionManager; - $this->contextManager = $contextManager; - $this->request = $requestStack->getCurrentRequest(); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.block'), - $container->get('context.repository'), - $container->get('theme_handler'), - $container->get('form_builder'), - $container->get('plugin.manager.context_reaction'), - $container->get('context.manager'), - $container->get('request_stack') - ); - } - - /** - * Prepares the block plugin based on the block ID. - * - * @param string $block_id - * Either a block ID, or the plugin ID used to create a new block. - * - * @return \Drupal\Core\Block\BlockPluginInterface - * The block plugin. - */ - abstract protected function prepareBlock($block_id); - - /** - * Get the value to use for the submit button. - * - * @return TranslatableMarkup - */ - abstract protected function getSubmitValue(); - - /** - * Form constructor. - * - * @param array $form - * An associative array containing the structure of the form. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @param ContextInterface $context - * The context the reaction belongs to. - * - * @param string|null $reaction_id - * The ID of the blocks reaction the block should be added to. - * - * @param string|null $block_id - * The ID of the block to show a configuration form for. - * - * @return array - */ - public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $reaction_id = NULL, $block_id = NULL) { - $this->context = $context; - - $this->reaction = $this->context->getReaction($reaction_id); - $this->block = $this->prepareBlock($block_id); - - // If a theme was defined in the query use this theme for the block - // otherwise use the default theme. - $theme = $this->getRequest()->query->get('theme', $this->themeHandler->getDefault()); - - // Some blocks require the theme name in the form state like Site Branding - $form_state->set('block_theme', $theme); - - // Some blocks require contexts, set a temporary value with gathered - // contextual values. - $form_state->setTemporaryValue('gathered_contexts', $this->contextRepository->getAvailableContexts()); - - $configuration = $this->block->getConfiguration(); - - $form['#tree'] = TRUE; - - $form['settings'] = $this->block->buildConfigurationForm([], $form_state); - - $form['settings']['id'] = [ - '#type' => 'value', - '#value' => $this->block->getPluginId(), - ]; - - $form['region'] = [ - '#type' => 'select', - '#title' => $this->t('Region'), - '#description' => $this->t('Select the region where this block should be displayed.'), - '#options' => $this->getThemeRegionOptions($theme), - '#default_value' => isset($configuration['region']) ? $configuration['region'] : '', - ]; - - $form['unique'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Unique'), - '#description' => $this->t('Check if the block should be uniquely placed, this means that the block can not be overridden by other blocks of the same type in the selected region.'), - '#default_value' => isset($configuration['unique']) ? $configuration['unique'] : FALSE, - ]; - - $form['theme'] = [ - '#type' => 'value', - '#value' => $theme, - ]; - - $form['css_class'] = [ - '#type' => 'textfield', - '#title' => $this->t('Block Class'), - '#default_value' => isset($configuration['css_class']) ? $configuration['css_class'] : '', - ]; - - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->getSubmitValue(), - '#button_type' => 'primary', - '#ajax' => [ - 'callback' => '::submitFormAjax' - ], - ]; - - // Remove ajax from submit, if this is not ajax request. - if (!$this->request->isXmlHttpRequest()) { - unset($form['actions']['submit']['#ajax']); - } - - // Disable cache on form to prevent ajax forms from failing. - $form_state->disableCache(); - - return $form; - } - - /** - * Form submission handler. - * - * @param array $form - * An associative array containing the structure of the form. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $settings = (new FormState())->setValues($form_state->getValue('settings')); - - // Call the plugin submit handler. - $this->block->submitConfigurationForm($form, $settings); - - // Update the original form values. - $form_state->setValue('settings', $settings->getValues()); - - // Add available contexts if this is a context aware block. - if ($this->block instanceof ContextAwarePluginInterface) { - $this->block->setContextMapping($form_state->getValue(['settings', 'context_mapping'], [])); - } - - $configuration = array_merge($this->block->getConfiguration(), [ - 'region' => $form_state->getValue('region'), - 'theme' => $form_state->getValue('theme'), - 'css_class' => $form_state->getValue('css_class'), - 'unique' => $form_state->getValue('unique'), - 'context_id' => $this->context->id(), - ]); - - // Add/Update the block. - if (!isset($configuration['uuid'])) { - $this->reaction->addBlock($configuration); - } else { - $this->reaction->updateBlock($configuration['uuid'], $configuration); - } - - $this->context->save(); - - $form_state->setRedirectUrl(Url::fromRoute('entity.context.edit_form', [ - 'context' => $this->context->id(), - ])); - } - - /** - * Handle when the form is submitted trough AJAX. - * - * @return AjaxResponse - */ - public function submitFormAjax(array &$form, FormStateInterface $form_state) { - $response = new AjaxResponse(); - - if ($form_state->getErrors()) { - $messages = StatusMessages::renderMessages(NULL); - $output[] = $messages; - $output[] = $form; - $form_class = '.' . str_replace('_', '-', $form_state->getFormObject()->getFormId()) ; - // Remove any previously added error messages. - $response->addCommand(new RemoveCommand('#drupal-modal .messages--error')); - // Replace old form with new one and with error message. - $response->addCommand(new ReplaceCommand($form_class, $output)); - } - else { - $form = $this->contextManager->getForm($this->context, 'edit'); - $response->addCommand(new CloseModalDialogCommand()); - $response->addCommand(new ReplaceCommand('#context-reactions', $form['reactions'])); - } - - return $response; - } - - /** - * Get a list of regions for the select list. - * - * @param string $theme - * The theme to get a list of regions for. - * - * @param string $show - * What type of regions that should be returned, defaults to all regions. - * - * @return array - */ - protected function getThemeRegionOptions($theme, $show = REGIONS_ALL) { - $regions = system_region_list($theme, $show); - - foreach ($regions as $region => $title) { - $regions[$region] = $title; - } - - return $regions; - } - -} - diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php b/sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php deleted file mode 100644 index 8db2fa9aa..000000000 --- a/sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php +++ /dev/null @@ -1,67 +0,0 @@ -context = $context; - $this->reaction = $this->context->getReaction($reaction_id); - - $form['reaction'] = [ - '#tree' => TRUE, - ]; - - $form['actions'] = [ - '#type' => 'actions' - ]; - - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - '#button_type' => 'primary', - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->context->save(); - } -} diff --git a/sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php b/sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php deleted file mode 100644 index 6ce7340d5..000000000 --- a/sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php +++ /dev/null @@ -1,55 +0,0 @@ -getContexts() as $context) { - foreach ($context->getReactions() as $reaction) { - if ($reaction instanceof Theme) { - $theme_reaction = TRUE; - break; - } - } - } - - if ($theme_reaction) { - foreach($context_manager->getActiveReactions('theme') as $theme_reaction) { - $configuration = $theme_reaction->getConfiguration(); - $this->theme = $configuration['theme']; - return TRUE; - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function determineActiveTheme(RouteMatchInterface $route_match) { - return $this->theme; - } -} diff --git a/sites/all/modules/contrib/admin/domain/.travis.yml b/sites/all/modules/contrib/admin/domain/.travis.yml deleted file mode 100644 index 8e82646e4..000000000 --- a/sites/all/modules/contrib/admin/domain/.travis.yml +++ /dev/null @@ -1,96 +0,0 @@ -language: php -sudo: false - -matrix: - fast_finish: true - include: - - env: DRUPAL=8.6.x - php: 7.1 - - env: DRUPAL=8.6.x - php: 7.2 - - env: DRUPAL=8.7.x - php: 7.1 - - env: DRUPAL=8.7.x - php: 7.2 - -addons: - hosts: - - example.com - - one.example.com - - two.example.com - - three.example.com - - four.example.com - - five.example.com - -cache: - directories: - - $HOME/.composer/cache - -env: - global: - # add composer's global bin directory to the path - # see: https://github.com/drush-ops/drush#install---composer - - PATH="$PATH:$HOME/.composer/vendor/bin" - -mysql: - database: domain - username: root - encoding: utf8 - -notifications: - email: false - -before_install: - # Remove Xdebug. Not an issue for PHP 7. - - phpenv config-rm xdebug.ini || true - - - composer self-update - - # Install Drush. - - composer global require --no-interaction drush/drush:8.* - -install: - # Optimize MySQL timeout and max packet size. - - echo "mysql.connect_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "default_socket_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - mysql -e 'create database domain' - - mysql -e "SET GLOBAL wait_timeout = 36000;" - - mysql -e "SET GLOBAL max_allowed_packet = 134209536;" - -before_script: - - # Remember the current rules test directory for later use in the Drupal installation. - - TESTDIR=$(pwd) - # Navigate out of module directory to prevent blown stack by recursive module lookup. - - cd .. - - # Download Drupal 8 core. - - travis_retry drush dl drupal-$DRUPAL --drupal-project-rename=drupal - - cd drupal - - # Update PHPUnit. - - composer run-script drupal-phpunit-upgrade - - # Make the module appear in the correct place - - ln -s $TESTDIR modules/domain - - # Install drupal default profile - - /usr/bin/env PHP_OPTIONS="-d sendmail_path=$(which true)" drush --yes --verbose site-install minimal --db-url=mysql://root:@127.0.0.1/domain - - drush --yes en simpletest domain domain_access domain_alias domain_config domain_source - - drush cr - - # Start a web server on port 8080 in the background. - - nohup php -S 0.0.0.0:8080 > /dev/null 2>&1 & - - # Wait until the web server is responding. - - until curl -s example.com:8080; do true; done > /dev/null - -script: - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Kernel" --php `which php` --url http://example.com:8080 domain - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_access - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_alias - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Kernel" --php `which php` --url http://example.com:8080 domain_alias - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_config - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_content - - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_source diff --git a/sites/all/modules/contrib/admin/domain/CHANGELOG.md b/sites/all/modules/contrib/admin/domain/CHANGELOG.md deleted file mode 100644 index 37be56dfc..000000000 --- a/sites/all/modules/contrib/admin/domain/CHANGELOG.md +++ /dev/null @@ -1,134 +0,0 @@ -Changelog -===== - -31-JUL-2016 8.x-1.0-alpha1 -22-AUG-2016 8.x-1.0-alpha2 -30-AUG-2016 8.x-1.0-alpha3 -01-SEP-2016 8.x-1.0-alpha4 -25-OCT-2016 8.x-1.0-alpha5 -20-NOV-2016 8.x-1.0-alpha6 -06-DEC-2016 Adds the domain_alpha module to handle critical pre-release updates. -13-DEC-2016 8.x-1.0-alpha7 -12-MAR-2017 8.x-1.0-alpha8 -23-APR-2017 8.x-1.0-alpha9 -01-DEC-2017 8.x-1.0-alpha10 -19-DEC-2017 8.x-1.0-alpha11 -12-FEB-2018 8.x-1.0-alpha12 -07-MAR-2018 8.x-1.0-alpha13 -19-OCT-2018 8.x-1.0-alpha14 -21-FEB-2019 8.x-1.0-alpha15 - -Status -==== - -The 8.x-1.x version is a ground up rewrite of a module originally written for -Drupal 5. - -The following feature sets are considered critical for each release stage. Items -marked with [x] are considered complete. - -# Alpha -- [x] Domain entity for storage and configuration -- [x] Domain negotiation for active requests -- [x] API for modifying active domain requests -- [x] API for modifying paths per domain -- [x] Mechanism for access restriction inactive domains -- [x] Form for adding / editing / deleting domain records -- [x] Validation of domain record patterns -- [x] Domain server information block -- [x] Domain switcher block -- [x] Domain context for block visibility -- [x] Entity reference support, with an API for altering entity lists -- [x] Alias registration and negotiation -- [x] Alias validation -- [x] Configuration overrides per domain -- [x] Language-aware configuration overrides -- [x] Enable node access control via domain references (Domain Access) -- [x] Allow nodes to be assigned to domains -- [x] Allow users to be assigned as domain editors -- [x] Set permissions for content editing based on domain -- [x] Restrict publication options based on user domains -- [x] Support the all affiliates concept of publication -- [x] Support the all affiliates concept for editors -- [x] Test and document cross-domain logins -- [x] Make language optional for domain overrides -- [x] Use domain source for path rewrites -- [x] Finish the path alter behavior -- [x] Catalog @TODO items as issues -- [x] Drupal cache system makes it difficult to serve different homepage for each domain -- [x] Provide common views support for attached fields -- [x] Recreate the Domain Content module with bulk operations -- [x] Add help text to domain overview screen -- [x] Views argument handler to show proper title. -- [x] Ensure unique numeric ids for use with node access -- [x] Invalidate cache on Domain save -- [x] Invalidate render cache on Alias save -- [x] DomainConfigOverrider returns empty $overrides -- [x] Allow non-ascii domains and aliases -- [x] The domain_validate hook needs tests -- [x] Allow partial config loading - -# Beta -- [x] Actions for domain operations -- [x] Drush support for domain operations -- [x] Replace / inject the storage manager in DomainAliasLoader. -- [x] Replace / inject the storage manager in domainStorage. -- [x] Write tests for Domain Content. -- [x] Views access handler for domain content. -- [x] Restrict Domain Source options using JS -- [x] Handle site name overrides -- perhaps as a new field? -- [x] Restore the `domain_grant_all` permission? -- [x] Domain token support -- [x] Module configurations - - [x] Allow configuration of access-exempt paths for inactive domains - - [x] www prefix handling - - [x] Add domain-specific CSS classes - - [x] Path matching for URL rewrites? - - [x] Allow non-ascii characters in domains -- [x] Recreate the Domain Nav module -- [x] Allow selective access to domain record editing -- [x] Allow access to actions based on assigned domain permissions -- [x] Tests for all module hooks -- [x] Proper tests for domain record validation -- [x] Check test logic in testDomainAliasNegotiator() -- [x] Test that sort logic in DomainAliasLoader matches what is documented -- [x] Error handling in DomainAliasForm -- [x] Error checking in DomainAliasController -- [x] Deprecated methods in DomainAliasController -- [x] Error reporting in `domain_alias_domain_request_alter()` -- [x] Ensure completeness of DomainAccessPermissionsTest -- [x] Check module setup behavior in tests -- [x] Make all affiliates default value configurable -- [x] Review drupalUserIsLoggedIn() hack -- [x] Review DomainNegotiatorTest for completeness -- [x] Review core note in DomainEntityReferenceTest -- [x] Expand DomainActionsTest -- [x] DomainViewBuilder review -- [x] Dependency Injection in DomainValidator -- [x] Inject the module handler service in DomainListBuilder::getOperations() -- [x] `drush_domain_generate_domains()` has odd counting logic -- [x] Separate permissions for Domain Alias -- [x] Check loader logic in the DomainSource PathProcessor -- [x] Check loader logic in Domain Access `node_access` -- [x] Check id logic in Domain Alias list controller -- [x] Check domain responses on configuration forms -- [x] Remove deprecated `entity_get_form_display` -- [x] Implement theme functions or twig templates where proper -- [x] Advanced drush integration / complete labelled tasks -- [ ] Add filter options to domain_access and domain_source views -- [ ] Test cron handling -- [ ] Caching strategies in DomainNegotiator -- [ ] Caching strategies in DomainConfigOverrides -- [ ] Cache in the DomainAccessManager -- [ ] Proper handling of default node values -- [ ] Do not allow actions to be edited? -- [o] Recreate the Domain Theme module -- see https://www.drupal.org/project/domain_theme_switch - -# Final -- [ ] Security review -- [ ] Provide an upgrade path from 6.x -- [ ] Provide an upgrade path from 7.x-3.x -- [x] Remove calls to deprecated methods / classes -- [ ] Remove unnecessary use statements -- [ ] Support Tour module -- [ ] Views schema fails -- see https://www.drupal.org/project/drupal/issues/2834801 diff --git a/sites/all/modules/contrib/admin/domain/LICENSE.txt b/sites/all/modules/contrib/admin/domain/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/domain/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/domain/README.md b/sites/all/modules/contrib/admin/domain/README.md deleted file mode 100644 index 691d60bba..000000000 --- a/sites/all/modules/contrib/admin/domain/README.md +++ /dev/null @@ -1,222 +0,0 @@ -Domain -====== - -The Domain module suite lets you share users, content, and configuration across a group of domains from a single installation and database. - -Current Status ------- - -Domain module for Drupal port to Drupal 8, under active development. - -Domain required Drupal 8.5 or higher. - -Active branch is the 8-x.1-x branch in GitHub. Begin any forks from there. - -The underlying API is stable, and it's currently usable for access control. -The configuration supports manual editing. Themes should work. Views and Bulk -Operations are not yet supported. - -For a complete feature status list, see [CHANGELOG.md](https://github.com/agentrickard/domain/blob/8.x-1.x/CHANGELOG.md) - -Included modules -------- - -* *Domain* - The core module. Domain provides means for registering multiple domains within a - single Drupal installation. It allows users to be assigned as domain administrators, - provides a Block and Views display context, and creates a default entity reference - field for use by other modules. - -* *Domain Access* - Provides node access controls based on domains. (This module contains much of the - Drupal 7 functionality). It allows users to be assigned as editors of content per-domain, - sets content visibility rules, and provides Views integration for content. - -* *Domain Alias* - Allows multiple hostnames to be pointed to a single registered domain. These aliases - can include wildcards (such as *.example.com) and may be configured to redirect to - their canonical domain. Domain Alias also allows developers to register aliases per - `environment`, so that different hosts are used consistently across development - environments. See the README file for Domain Alias for more information. - -* *Domain Config* - Provides a means for changing configuration settings on a per-domain basis. See the - README for Domain Config for more information. - -* *Domain Content* - Provides content overview pages on a per-domain basis, so that editors may review - content assigned to specific domains. This module is a series of Views. - -* *Domain Source* - Allows content to be assigned a canonical domain when writing URLs. Domain Source will - ensure that content that appears on multiple domains always links to one URL. See - the module's README for more information. - - -Implementation Notes -====== - -Cross-domain logins ------- - -To use cross-domain logins, you must now set the *cookie_domain* value in -*sites/default/services.yml*. - -To do so, clone `default.services.yml` to `services.yml` and change the -`cookie_domain` value to match the root hostname of your sites. Note that -cross-domain login requires the sharing of a top-level domain, so a setting like -`.example.com` will work for all `example.com` subdomains. - -Example: - -``` -cookie_domain: '.example.com' -``` - -See https://www.drupal.org/node/2391871. - -Cross-Site HTTP requests (CORS) ------- -As of Drupal 8.2, it's possible to allow a particular site to enable CORS for responses -served by Drupal. - -In the case of Domain, allowing CORS may remove AJAX errors caused when using some forms, -particularly entity references, when the AJAX request goes to another domain. - -This feature is not enabled by default because there are security consequences. See -https://www.drupal.org/node/2715637 for more information and instructions. - -To enable CORS for all domains, copy `default.services.yml` to `services.yml` and enable -the following lines: - -``` - # Configure Cross-Site HTTP requests (CORS). - # Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS - # for more information about the topic in general. - # Note: By default the configuration is disabled. - cors.config: - enabled: false - # Specify allowed headers, like 'x-allowed-header'. - allowedHeaders: [] - # Specify allowed request methods, specify ['*'] to allow all possible ones. - allowedMethods: [] - # Configure requests allowed from specific origins. - allowedOrigins: ['*'] - # Sets the Access-Control-Expose-Headers header. - exposedHeaders: false - # Sets the Access-Control-Max-Age header. - maxAge: false - # Sets the Access-Control-Allow-Credentials header. - supportsCredentials: false -``` - -The key here is setting `enabled` to `false`. - -Trusted host settings ------- - -If using the trusted host security setting in Drupal 8, be sure to add each domain -and alias to the pattern list. For example: - -``` -$settings['trusted_host_patterns'] = array( - '^.+\.example\.org$', - '^myexample\.com$', - '^myexample\.dev$', - '^localhost$', -); -``` - -We *strongly encourage* the use of trusted host settings. When Domain issues a redirect, -it will check the domain hostname against these settings. Any redirect that does not -match the trusted host settings will be denied and throw an error. - -See https://www.drupal.org/node/1992030 for more information. - -Configuring domain records -------- -To create a domain record, you must provide the following information: - -* A unique *hostname*, which may include a port. (Therefore, example.com and -example.com:8080 are considered different.) The hostname may only contain -alphanumeric characters, dashes, dots, and one colon. If you wish to use -international domain names, toggle the `Allow non-ASCII characters in domains - and aliases.` setting. -* A *machine_name* that must be unique. This value will be autogenerated and -cannot be edited once created. -* A *name* to be used in lists of domains. -* A URL scheme, used for writing links to the domain. The scheme may be `http`, -`https`, or `variable`. If `variable` is used, the scheme will be inherited from -the server or request settings. This option is good if your test environments -do not have secure certificates but your production environment does. -* A *status* indicating `active` or `inactive`. Inactive domains may only be -viewed by users with permission to `view inactive domains` all other users will -be redirected to the default domain (see below). -* The *weight* to be used when sorting domains. These values autoincrement as -new domains are created. -* Whether the domain is the *default* or not. Only one domain can be set as - `default`. The default domain is used for redirects in cases where other - domains are either restricted (inactive) or fail to load. This value can be - reassigned after domains are created. - -Domain records are *configuration entities*, which means they are not stored in -the database nor accessible to Views by default. They are, however, exportable -as part of your configuration. - -Domains and caching ------- - -If some variable changes are not picked up when the page renders, you may need -add domain-sensitivity to the site's cache. - -To do so, clone `default.services.yml` to `services.yml` (if you have not -already done so) and change the `required_cache_contexts` value to: - -```YAML - required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions', 'url.site'] -``` - -The addition of `url.site` should provide the domain context that the cache -layer requires. - -For developers, see also the information in the Domain Alias README. - -Contributing -==== - -If you'd like to contribute, please do. Github forks and pull requests are preferable. -If you prefer a patch-based workflow, you can attach patches to GitHub issues or Drupal.org -issues. If you open a Drupal.org issue, please link to it from the appropriate GitHub -issue. - -The GitHub issues are grouped under three milestones: - -1. Alpha -- items required for a test release. When this is complete, we will roll an -alpha1 release on Drupal.org. -2. Beta -- items considered critical features for a release. When complete, we will roll -a beta release on Drupal.org. -3. Final -- items required for a stable, secure release on Drupal.org. - -We would like to tackle issues in that order, but feel free to work on what motivates you. - -Testing [![Build Status](https://travis-ci.com/agentrickard/domain.svg?branch=8.x-1.x)](https://travis-ci.com/agentrickard/domain) -==== - -@zerolab built a Travis definition file for automated testing! That means all pull requests will automatically run tests! - -If you file a pull request or patch, please (at a minimum) run the existing tests to check -for failures. Writing additional tests will greatly speed completion, as I won't commit -code without test coverage. - -New tests should be written in PHPUnit as Functional, Kernel, or Unit tests. - -Because Domain requires varying http host requests to test, we can't normally use the Drupal.org -testing infrastructure. (This may change, but we are not counting on it.) - -To setup a proper environment locally, you need multiple or wilcard domains configured to -point to your drupal instance. I use variants of `example.com` for local tests. See -`DomainTestBase` for documentation. Domain testing should work with root hosts other than -`example.com`, though we also expect to find the subdomains `one.*, two.*, three.*, four.*, five.*` -in most test cases. See `DomainTestBase::domainCreateTestDomains()` for the logic. - -When running tests, you normally need to be on the default domain. diff --git a/sites/all/modules/contrib/admin/domain/composer.json b/sites/all/modules/contrib/admin/domain/composer.json deleted file mode 100644 index 1613e13c2..000000000 --- a/sites/all/modules/contrib/admin/domain/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "drupal/domain", - "description": "Creates domain records within a Drupal installation.", - "type": "drupal-module", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Ken Rickard", - "email": "agentrickard@gmail.com" - } - ], - "support": { - "issues": "http://drupal.org/project/issues/domain", - "irc": "http://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/domain" - }, - "extra": { - "drush": { - "services": { - "domain/drush.services.yml": "^9", - "domain_access/drush.services.yml": "^9", - "domain_source/drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml deleted file mode 100644 index bdcce5339..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml +++ /dev/null @@ -1,4 +0,0 @@ -allow_non_ascii: false -www_prefix: false -login_paths: "/user/login\r\n/user/password" -css_classes: '' diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml deleted file mode 100644 index e70c002b4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml +++ /dev/null @@ -1,24 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.user.field_domain_admin - module: - - user -id: user.user.field_domain_admin -field_name: field_domain_admin -entity_type: user -bundle: user -label: 'Domain administrator' -description: 'Select the domains this user may administer.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'domain:domain' - target_bundles: null - sort: - field: weight - direction: ASC -field_type: entity_reference diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml deleted file mode 100644 index 86ec5b253..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - user -id: user.field_domain_admin -field_name: field_domain_admin -entity_type: user -type: entity_reference -settings: - target_type: domain -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml deleted file mode 100644 index c7bf8b9c2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain -id: domain_default_action -label: 'Set default domain record' -type: domain -plugin: domain_default_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml deleted file mode 100644 index 8f1e94d57..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain -id: domain_delete_action -label: 'Delete domain record' -type: domain -plugin: domain_delete_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml deleted file mode 100644 index b9817b947..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain -id: domain_disable_action -label: 'Disable domain record' -type: domain -plugin: domain_disable_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml deleted file mode 100644 index c23ede79b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain -id: domain_enable_action -label: 'Enable domain record' -type: domain -plugin: domain_enable_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml b/sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml deleted file mode 100644 index aa0138d73..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml +++ /dev/null @@ -1,95 +0,0 @@ -# Schema for the configuration files of the Domain module. -domain.settings: - type: config_object - label: 'Domain settings' - mapping: - allow_non_ascii: - type: boolean - label: 'Allow non-ASCII characters' - www_prefix: - type: boolean - label: 'Ignore www prefix when negotiating domains' - login_paths: - type: text - label: 'Paths that should be accessible for inactive domains' - css_classes: - type: text - label: 'Custom css classes to apply to the body tag of each domain' - -domain.record.*: - type: config_entity - label: 'Domain record' - mapping: - id: - type: string - label: 'ID' - uuid: - type: string - label: 'ID' - domain_id: - type: integer - label: 'Domain ID' - hostname: - type: string - label: 'Hostname' - name: - type: label - label: 'Name' - scheme: - type: string - label: 'Scheme' - status: - type: boolean - label: 'Status' - weight: - type: integer - label: 'Weight' - is_default: - type: boolean - label: 'Default domain' - -action.configuration.domain_default_action: - type: action_configuration_default - label: 'Set default domain record' -action.configuration.domain_delete_action: - type: action_configuration_default - label: 'Delete domain record' -action.configuration.domain_disable_action: - type: action_configuration_default - label: 'Disable domain record' -action.configuration.domain_enable_action: - type: action_configuration_default - label: 'Enable domain record' - -block.settings.domain_nav_block: - type: block_settings - label: 'Domain navigation block' - mapping: - link_options: - type: string - label: 'Link paths' - link_theme: - type: string - label: 'Link theme' - link_label: - type: string - label: 'Link text' - -condition.plugin.domain: - type: condition.plugin - mapping: - domains: - type: sequence - sequence: - type: string - -views.access.domain: - type: mapping - label: 'Domains' - mapping: - domain: - type: sequence - label: 'List of domains' - sequence: - type: string - label: 'Domain' diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.api.php b/sites/all/modules/contrib/admin/domain/domain/domain.api.php deleted file mode 100644 index 7762c9b12..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.api.php +++ /dev/null @@ -1,138 +0,0 @@ -addProperty('myvar', 'mydomainvar'); - } -} - -/** - * Allows modules to modify the inbound domain request. - * - * When using this hook, first check $domain->getMatchType(), which returns a - * numeric constant indicating the type of match derived by the caller or by - * earlier returns of this hook (such as domain_alias_request_alter()). - * Use this value to determine if the request needs to be overridden. Valid - * types are DomainNegotiator::DOMAIN_MATCH_NONE, - * DomainNegotiator::DOMAIN_MATCH_EXACT, DomainNegotiator::DOMAIN_MATCH_ALIAS. - * - * To issue a redirect, as in the case of Domain Alias, set a redirect - * property to a valid response code (301 or 302). - * - * @param \Drupal\domain\DomainInterface $domain - * A domain object defined by Drupal\domain\DomainInterface. - */ -function hook_domain_request_alter(\Drupal\domain\DomainInterface &$domain) { - // Add a special case to the example domain. - if ($domain->getMatchType() == \Drupal\domain\DomainNegotiator::DOMAIN_MATCH_EXACT && $domain->id() == 'example_com') { - // Do something here. - $domain->addProperty('foo', 'Bar'); - } -} - -/** - * Adds administrative operations for the domain overview form. - * - * These operations are only available to users who can administer the domain. - * That access check happens prior to this hook being called. If your use-case - * requires additional permission checking, you should provide it before - * returning any values. - * - * @param \Drupal\domain\DomainInterface $domain - * A domain record object. - * @param \Drupal\Core\Session\AccountInterface $account - * The user account performing the operation. - * - * @return array - * An array of operations which uses a unique string key and requires the - * elements 'title' and 'url'; the 'query' value is optional, and used - * for link-actions with tokens - */ -function hook_domain_operations(\Drupal\domain\DomainInterface $domain, \Drupal\Core\Session\AccountInterface $account) { - $operations = []; - // Check permissions. - if ($account->hasPermission('view domain aliases') || $account->hasPermission('administer domain aliases')) { - // Add aliases to the list. - $id = $domain->id(); - $operations['domain_alias'] = [ - 'title' => t('Aliases'), - 'url' => \Drupal\Core\Url::fromRoute('domain_alias.admin', ['domain' => $id]), - 'weight' => 60, - ]; - } - return $operations; -} - -/** - * Alter the validation step of a domain record. - * - * This hook allows modules to change or extend how domain validation - * happens. Most useful for international domains or other special cases - * where a site wants to restrict domain creation is some manner. - * - * NOTE: This does not apply to Domain Alias records. - * - * No return value. Modify $error_list by reference. Return an empty array - * or NULL to validate this domain. - * - * @param array &$error_list - * The list of current validation errors. Modify this value by reference. - * If you return an empty array or NULL, the domain is considered valid. - * @param string $hostname - * The HTTP_HOST string value being validated, such as one.example.com. - * Note that this is checked for uniqueness separately. This value is not - * modifiable. - * - * @see domain_valid_domain() - */ -function hook_domain_validate_alter(array &$error_list, $hostname) { - // Only allow TLDs to be .org for our site. - if (substr($hostname, -4) != '.org') { - $error_list[] = t('Only .org domains may be registered.'); - } -} - -/** - * Alter the list of domains that may be referenced. - * - * Note that this hook does not fire for users with the 'administer domains' - * permission. - * - * No return value. Modify the $query object via methods. - * - * @param \Drupal\Core\Entity\Query\QueryInterface $query - * An entity query prepared by DomainSelection::buildEntityQuery(). - * @param \Drupal\Core\Session\AccountInterface $account - * The account of the user viewing the reference list. - * @param array $context - * A keyed array passing two items: - * - entity_type The type of entity (e.g. node, user) that requested the list. - * - bundle The entity subtype (e.g. 'article' or 'page'). - * - field_type The access field group used for this selection. Groups are - * 'editor' for assigning editorial permissions (as in Domain Access) - * 'admin' for assigning administrative permissions for a specific domain. - * Most contributed modules will use 'editor'. - */ -function hook_domain_references_alter(\Drupal\Core\Entity\Query\QueryInterface $query, \Drupal\Core\Session\AccountInterface $account, array $context) { - // Remove the default domain from non-admins when editing nodes. - if ($context['entity_type'] == 'node' && $context['field_type'] == 'editor' && !$account->hasPermission('edit assigned domains')) { - $default = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultId(); - $query->condition('id', $default, '<>'); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.drush.inc b/sites/all/modules/contrib/admin/domain/domain/domain.drush.inc deleted file mode 100644 index bb089bcf2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.drush.inc +++ /dev/null @@ -1,634 +0,0 @@ - 'List active domains for the site.', - 'examples' => [ - 'drush domain-list', - 'drush domains', - ], - 'aliases' => ['domains'], - ]; - $items['domain-add'] = [ - 'description' => 'Add a new domain to the site.', - 'examples' => [ - 'drush domain-add example.com \'My Test Site\'', - 'drush domain-add example.com \'My Test Site\' --inactive=1 --https==1', - 'drush domain-add example.com \'My Test Site\' --weight=10', - 'drush domain-add example.com \'My Test Site\' --validate=1', - ], - 'arguments' => [ - 'hostname' => 'The domain hostname to register (e.g. example.com).', - 'name' => 'The name of the site (e.g. Domain Two).', - ], - 'options' => [ - 'inactive' => 'Set the domain to inactive status if set.', - 'https' => 'Use https protocol for this domain if set.', - 'weight' => 'Set the order (weight) of the domain.', - 'is_default' => 'Set this domain as the default domain.', - 'validate' => 'Force a check of the URL response before allowing registration.', - ], - ]; - $items['domain-delete'] = [ - 'description' => 'Delete a domain from the site.', - 'examples' => [ - 'drush domain-delete example.com', - 'drush domain-delete 1', - ], - 'arguments' => [ - 'domain' => 'The numeric id or hostname of the domain to delete.', - ], - ]; - $items['domain-test'] = [ - 'description' => 'Tests domains for proper response. If run from a subfolder, you must specify the --uri.', - 'examples' => [ - 'drush domain-test', - 'drush domain-test example.com', - 'drush domain-test 1', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to test. If no value is passed, all domains are tested.', - ], - 'options' => [ - 'base_path' => 'The subdirectory name if Drupal is installed in a folder other than server root.', - ], - ]; - $items['domain-default'] = [ - 'description' => 'Sets the default domain. If run from a subfolder, you must specify the --uri.', - 'examples' => [ - 'drush domain-default example.com', - 'drush domain-default 1', - 'drush domain-default 1 --validate=1', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to make default.', - ], - 'options' => [ - 'validate' => 'Force a check of the URL response before allowing registration.', - ], - ]; - $items['domain-disable'] = [ - 'description' => 'Sets a domain status to off.', - 'examples' => [ - 'drush domain-disable example.com', - 'drush domain-disable 1', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to disable.', - ], - ]; - $items['domain-enable'] = [ - 'description' => 'Sets a domain status to on.', - 'examples' => [ - 'drush domain-disable example.com', - 'drush domain-disable 1', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to enable.', - ], - ]; - $items['domain-name'] = [ - 'description' => 'Changes a domain label.', - 'examples' => [ - 'drush domain-name example.com Foo', - 'drush domain-name 1 Foo', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to relabel.', - 'name' => 'The name to use for the domain.', - ], - ]; - $items['domain-machine-name'] = [ - 'description' => 'Changes a domain name.', - 'examples' => [ - 'drush domain-machine-name example.com foo', - 'drush domain-machine-name 1 foo', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to rename.', - 'name' => 'The machine-readable name to use for the domain.', - ], - ]; - $items['domain-scheme'] = [ - 'description' => 'Changes a domain scheme.', - 'examples' => [ - 'drush domain-scheme example.com https', - 'drush domain-scheme 1 https', - ], - 'arguments' => [ - 'domain_id' => 'The numeric id or hostname of the domain to change.', - 'scheme' => 'The URL schema (http or https) to use for the domain.', - ], - ]; - $items['generate-domains'] = [ - 'description' => 'Generate domains for testing.', - 'arguments' => [ - 'primary' => 'The primary domain to use. This will be created and used for *.example.com hostnames.', - ], - 'options' => [ - 'count' => 'The count of extra domains to generate. Default is 15.', - 'empty' => 'Pass empty=1 to truncate the {domain} table before creating records.', - ], - 'examples' => [ - 'drush domain-generate example.com', - 'drush domain-generate example.com --count=25', - 'drush domain-generate example.com --count=25 --empty=1', - 'drush gend', - 'drush gend --count=25', - 'drush gend --count=25 --empty=1', - ], - 'aliases' => ['gend'], - ]; - return $items; -} - -/** - * Implements hook_drush_help(). - */ -function domain_drush_help($section) { - $items = domain_drush_command(); - $name = str_replace('domain:', '', $section); - if (isset($items[$name])) { - return dt($items[$name]['description']); - } -} - -/** - * Shows the domain list. - */ -function drush_domain_list() { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted(NULL, TRUE); - - if (empty($domains)) { - drush_print(dt('No domains have been created. Use drush domain-add to create one.')); - return; - } - - $header = [ - 'weight' => dt('Weight'), - 'name' => dt('Name'), - 'hostname' => dt('Hostname'), - 'scheme' => dt('Scheme'), - 'status' => dt('Status'), - 'is_default' => dt('Default'), - 'domain_id' => dt('Domain Id'), - 'id' => dt('Machine name'), - ]; - $rows = [array_values($header)]; - foreach ($domains as $domain) { - $row = []; - foreach ($header as $key => $name) { - $row[] = Html::escape($domain->get($key)); - } - $rows[] = $row; - } - - drush_print_table($rows, TRUE); -} - -/** - * Generates a list of domains for testing. - * - * In my environment, I name hostnames one.* two.* up to ten. I also use - * foo.* bar.* and baz.*. We also want a non-hostname here and use - * myexample.com. - * - * The script may also add test1, test2, test3 up to any number to test a - * large number of domains. This test is mostly for UI testing. - * - * @param string $primary - * The root domain to use for domain creation. - */ -function drush_domain_generate_domains($primary = 'example.com') { - // Check the number of domains to create. - $count = drush_get_option('count'); - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE); - if (empty($count)) { - $count = 15; - } - // Ensure we don't duplicate any domains. - $existing = []; - if (!empty($domains)) { - foreach ($domains as $domain) { - $existing[] = $domain->getHostname(); - } - } - // Set up one.* and so on. - $names = [ - 'one', - 'two', - 'three', - 'four', - 'five', - 'six', - 'seven', - 'eight', - 'nine', - 'ten', - 'foo', - 'bar', - 'baz', - ]; - // Set the creation array. - $new = [$primary]; - foreach ($names as $name) { - $new[] = $name . '.' . $primary; - } - // Include a non hostname. - $new[] = 'my' . $primary; - // Filter against existing so we can count correctly. - $prepared = []; - foreach ($new as $key => $value) { - if (!in_array($value, $existing)) { - $prepared[] = $value; - } - } - // Add any test domains that have numeric prefixes. We don't expect these URLs - // to work, and mainly use these for testing the user interface. - $needed = $count - count($prepared); - for ($i = 1; $i <= $needed; $i++) { - $prepared[] = 'test' . $i . '.' . $primary; - } - - // Get the initial item weight for sorting. - $start_weight = count($domains); - $prepared = array_slice($prepared, 0, $count); - - // Create the domains. - foreach ($prepared as $key => $item) { - $hostname = mb_strtolower($item); - $values = [ - 'name' => ($item != $primary) ? ucwords(str_replace(".$primary", '', $item)) : \Drupal::config('system.site')->get('name'), - 'hostname' => $hostname, - 'scheme' => 'http', - 'status' => 1, - 'weight' => ($item != $primary) ? $key + $start_weight + 1 : -1, - 'is_default' => 0, - 'id' => \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($hostname), - ]; - $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values); - domain_drush_create($domain); - } - - // If nothing created, say so. - if (empty($new)) { - drush_print(dt('No new domains were created.')); - } -} - -/** - * Validates the domain generation script. - * - * @param string $primary - * The root domain to use for domain creation. - */ -function drush_domain_generate_domains_validate($primary = 'example.com') { - if ($empty = drush_get_option('empty')) { - db_query("TRUNCATE TABLE {domain}"); - } - return; - // TODO: Add validation. -} - -/** - * Adds a new domain. - * - * @param string $hostname - * The domain name to register. - * @param string $name - * The name to use for this domain. - */ -function drush_domain_add($hostname, $name) { - $records_count = \Drupal::entityTypeManager()->getStorage('domain')->getQuery()->count()->execute(); - $start_weight = $records_count + 1; - $hostname = mb_strtolower($hostname); - /** @var \Drupal\domain\DomainStorageInterface $domain_storage */ - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - $values = [ - 'hostname' => $hostname, - 'name' => $name, - 'status' => (!drush_get_option('invalid')) ? 1 : 0, - 'scheme' => (!drush_get_option('https')) ? 'http' : 'https', - 'weight' => ($weight = drush_get_option('weight')) ? $weight : $start_weight + 1, - 'is_default' => ($is_default = drush_get_option('is_default')) ? $is_default : 0, - 'id' => $domain_storage->createMachineName($hostname), - 'validate_url' => (drush_get_option('validate')) ? 1 : 0, - ]; - $domain = $domain_storage->create($values); - domain_drush_create($domain); -} - -/** - * Validates the domain add command arguments. - * - * @param string $hostname - * The domain name to register. - * @param string $name - * The name to use for this domain. - * - * @return bool - * TRUE when validation passed, FALSE otherwise. - */ -function drush_domain_add_validate($hostname, $name) { - $errors = domain_drush_validate_domain($hostname); - if (!empty($errors)) { - return drush_set_error('domain', $errors); - } - elseif (\Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($hostname)) { - return drush_set_error('domain', dt('The hostname is already registered.')); - } - return TRUE; -} - -/** - * Creates a domain record. - * - * @param Drupal\domain\DomainInterface $domain - * A domain entity. - */ -function domain_drush_create(DomainInterface $domain) { - if ($error = domain_drush_check_response($domain)) { - drush_set_error('hostname', $error); - } - else { - $domain->save(); - if ($domain->getDomainId()) { - drush_print(dt('Created @name at @domain.', ['@name' => $domain->label(), '@domain' => $domain->getHostname()])); - } - else { - drush_print(dt('The request could not be completed.')); - } - } -} - -/** - * Runs a check to ensure that the domain is responsive. - * - * @param Drupal\domain\DomainInterface $domain - * A domain entity. - * - * @return string - * An error message if the domain url does not validate. Else empty. - */ -function domain_drush_check_response(DomainInterface $domain) { - // Check the domain response. First, clear the path value. - if ($domain->validate_url) { - $domain->setPath(); - try { - $response = $domain->getResponse(); - } - // We cannot know which Guzzle Exception class will be returned; be generic. - catch (RequestException $e) { - watchdog_exception('domain', $e); - // File a general server failure. - $domain->setResponse(500); - } - // If validate_url is set, then we must receive a 200 response. - if ($domain->getResponse() != 200) { - if (empty($response)) { - $response = 500; - } - return dt('The server request to @url returned a @response response. To proceed, disable the test of the server response by leaving off the --validate flag.', ['@url' => $domain->getPath(), '@response' => $response]); - } - } -} - -/** - * Validates a domain. - * - * @param string $hostname - * The domain name to validate for syntax and uniqueness. - * - * @return array - * An array of errors encountered. - * - * @see domain_validate() - */ -function domain_drush_validate_domain($hostname) { - /** @var \Drupal\domain\DomainValidatorInterface $validator */ - $validator = \Drupal::service('domain.validator'); - return $validator->validate($hostname); -} - -/** - * Deletes a domain record. - * - * @param string $argument - * The domain_id to delete. Pass 'all' to delete all records. - */ -function drush_domain_delete($argument = NULL) { - if (is_null($argument)) { - drush_set_error('domain', dt('You must specify a domain to delete.')); - } - if ($argument == 'all') { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE); - if (empty($domains)) { - drush_print(dt('There are no domains to delete.')); - return; - } - $content = drush_choice([1 => dt('Delete all domains')], dt('This action may not be undone. Continue?'), '!value'); - if (empty($content)) { - return; - } - } - // Resolve the domain. - elseif ($domain = drush_domain_get_from_argument($argument)) { - if ($domain->isDefault()) { - return drush_set_error('domain', dt('The primary domain may not be deleted. Use drush domain-default to set a new default domain.')); - } - $domains = [$domain]; - } - else { - return; - } - foreach ($domains as $domain) { - $domain->delete(); - drush_print(dt('Domain record @domain deleted.', ['@domain' => $domain->getHostname()])); - } - - return; - - // TODO: Set options for re-assigning content. - $list = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE); - $options = ['0' => dt('Do not reassign')]; - foreach ($list as $data) { - if ($data->id() != $domain->id()) { - $options[$data->getDomainId()] = $data->getHostname(); - } - } - $content = drush_choice($options, dt('Reassign content to:'), '!value'); - if (empty($content)) { - return; - } - $users = drush_choice($options, dt('Reassign users to:'), '!value'); - if (empty($users)) { - return; - } - $values['domain_access'] = (!empty($content)) ? $content : 'none'; - $values['domain_editor'] = (!empty($content)) ? $users : 'none'; - - domain_delete($domain, $values); - - drush_print(dt('Domain record deleted.')); -} - -/** - * Tests a domain record for the proper HTTP response. - * - * @param string $argument - * The domain_id to test. Passing no value tests all records. - */ -function drush_domain_test($argument = NULL) { - // TODO: This won't work in a subdirectory without a parameter. - if ($base_path = drush_get_option('base_path')) { - $GLOBALS['base_path'] = '/' . $base_path . '/'; - } - if (is_null($argument)) { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE); - } - else { - if ($domain = drush_domain_get_from_argument($argument)) { - $domains = [$domain]; - } - else { - return; - } - } - foreach ($domains as $domain) { - if ($domain->getResponse() != 200) { - drush_print(dt('Fail: !error. Please pass a --uri parameter or a --base_path to retest.', ['!error' => $domain->getResponse()])); - } - else { - drush_print(dt('Success: !url tested successfully.', ['!url' => $domain->getPath()])); - } - } -} - -/** - * Sets the default domain id. - */ -function drush_domain_default($argument) { - // Resolve the domain. - if ($domain = drush_domain_get_from_argument($argument)) { - $validate = (drush_get_option('validate')) ? 1 : 0; - $domain->addProperty('validate_url', $validate); - if ($error = domain_drush_check_response($domain)) { - drush_set_error('domain', $error); - } - else { - $domain->saveDefault(); - drush_print(dt('!domain set to primary domain.', ['!domain' => $domain->getHostname()])); - } - } -} - -/** - * Disables a domain. - */ -function drush_domain_disable($argument) { - // Resolve the domain. - if ($domain = drush_domain_get_from_argument($argument)) { - if ($domain->status()) { - $domain->disable(); - drush_print(dt('!domain has been disabled.', ['!domain' => $domain->getHostname()])); - } - else { - drush_print(dt('!domain is already disabled.', ['!domain' => $domain->getHostname()])); - } - } -} - -/** - * Enables a domain. - */ -function drush_domain_enable($argument) { - // Resolve the domain. - if ($domain = drush_domain_get_from_argument($argument)) { - if (!$domain->status()) { - $domain->enable(); - drush_print(dt('!domain has been enabled.', ['!domain' => $domain->getHostname()])); - } - else { - drush_print(dt('!domain is already enabled.', ['!domain' => $domain->getHostname()])); - } - } -} - -/** - * Changes a domain name. - */ -function drush_domain_name($argument, $name) { - // Resolve the domain. - if ($domain = drush_domain_get_from_argument($argument)) { - $domain->saveProperty('name', $name); - } -} - -/** - * Changes a domain machine_name. - */ -function drush_domain_machine_name($argument, $machine_name) { - $machine_name = \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($machine_name); - // Resolve the domain. - if ($domain = drush_domain_get_from_argument($argument)) { - $results = \Drupal::entityTypeManager() - ->getStorage('domain') - ->loadByProperties(['machine_name' => $machine_name]); - foreach ($results as $result) { - if ($result->id() == $machine_name) { - drush_print(dt('The machine_name @machine_name is being used by domain @hostname.', ['@machine_name' => $machine_name, '@hostname' => $result->getHostname()])); - return; - } - } - $domain->saveProperty('id', $machine_name); - } -} - -/** - * Changes a domain scheme. - */ -function drush_domain_scheme($argument) { - // Resolve the domain. - if ($domain = drush_domain_get_from_argument($argument)) { - $content = drush_choice([1 => dt('http'), 2 => dt('https')], dt('Select the default http scheme:'), '!value'); - if (empty($content)) { - return; - } - $scheme = 'http'; - if ($content == 2) { - $scheme = 'https'; - } - $domain->saveProperty('scheme', $scheme); - } -} - -/** - * Converts a domain string or domain_id to a $domain array. - * - * On failure, throws a drush error. - */ -function drush_domain_get_from_argument($argument) { - $domain = \Drupal::entityTypeManager()->getStorage('domain')->load($argument); - if (!$domain) { - $domain = \Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($argument); - } - if (!$domain) { - drush_set_error('domain', dt('Domain record not found.')); - return NULL; - } - return $domain; -} diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.info.yml b/sites/all/modules/contrib/admin/domain/domain/domain.info.yml deleted file mode 100644 index 190ac69b3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Domain -description: 'Creates domain records within a Drupal installation.' -type: module -package: Domain -# version: VERSION -# core: 8.x -dependencies: - - drupal:system (>=8.5) - - drupal:options -configure: domain.admin - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.install b/sites/all/modules/contrib/admin/domain/domain/domain.install deleted file mode 100644 index 8b7dee9b9..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.install +++ /dev/null @@ -1,36 +0,0 @@ -getStorage('entity_form_display')->load('user.user.default')) { - $display->setComponent(DOMAIN_ADMIN_FIELD, [ - 'type' => 'options_buttons', - 'weight' => 50, - ])->save(); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml b/sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml deleted file mode 100644 index 6c70e1411..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml +++ /dev/null @@ -1,7 +0,0 @@ -drupal.domain: - version: VERSION - js: - js/domain.js: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml b/sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml deleted file mode 100644 index e65a9b02c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.domain_add: - route_name: entity.domain.add - title: 'Add domain record' - appears_on: - - domain.admin diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml deleted file mode 100644 index 50e3f3971..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml +++ /dev/null @@ -1,18 +0,0 @@ -domain.admin: - title: Domains - route_name: domain.admin - parent: system.admin_config - description: 'Domain configuration' - weight: 0 -domain.admin_list: - title: Domain records - route_name: domain.admin - parent: domain.admin - description: 'Manage the domain records used by the site.' - weight: -10 -domain.settings: - title: Domain settings - route_name: domain.settings - parent: domain.admin - description: 'Domain module settings' - weight: 0 diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml b/sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml deleted file mode 100644 index e66821094..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml +++ /dev/null @@ -1,8 +0,0 @@ -domain.admin: - title: Domain records - route_name: domain.admin - base_route: domain.admin -domain.settings: - title: Domain settings - route_name: domain.settings - base_route: domain.admin diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.module b/sites/all/modules/contrib/admin/domain/domain/domain.module deleted file mode 100644 index 960674976..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.module +++ /dev/null @@ -1,177 +0,0 @@ -getPath(), ['absolute' => TRUE]); -} - -/** - * Implements hook_entity_load(). - * - * The $domain->path and $domain->uri properties are derived from data in the - * {domain} table. We use the hook system to load that data to indicate that - * the data is not native to the object. - * - * This action is performed in hook_entity_load(), which precedes the running - * of hook_domain_load() and ensures that our data is present for other modules. - */ -function domain_entity_load(array $entities, $entity_type) { - if ($entity_type == 'domain') { - foreach ($entities as $domain) { - $domain->setPath(); - $domain->setUrl(); - } - } -} - -/** - * Implements hook_help(). - */ -function domain_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'domain.admin': - $output = t('

The following domains have been created for your site. The currently active domain - is shown in boldface. You may click on a domain to change the currently active domain. -

'); - return $output; - } -} - -/** - * Implements hook_token_info(). - */ -function domain_token_info() { - return \Drupal::service('domain.token')->getTokenInfo(); -} - -/** - * Implements hook_tokens(). - */ -function domain_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { - return \Drupal::service('domain.token')->getTokens($type, $tokens, $data, $options, $bubbleable_metadata); -} - -/** - * Implements hook_preprocess_HOOK() for html.html.twig. - */ -function domain_preprocess_html(array &$variables) { - // Add class to body tag, if set. - $config = \Drupal::config('domain.settings'); - if ($string = $config->get('css_classes')) { - $token = \Drupal::token(); - // Prepare the classes proparly, with one class per string. - $classes = explode(' ', trim($string)); - foreach ($classes as $class) { - // Ensure no leading or trailing space. - $class = trim($class); - if (!empty($class)) { - $variables['attributes']['class'][] = Html::getClass($token->replace($class)); - } - } - } -} - -/** - * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\user\UserForm. - * - * Handle settings that the user cannot access. - */ -function domain_form_user_form_alter(&$form, &$form_state, $form_id) { - // Add the options hidden from the user silently to the form. - $manager = \Drupal::service('domain.element_manager'); - $form = $manager->setFormOptions($form, $form_state, DOMAIN_ADMIN_FIELD); -} - -/** - * Implements hook_domain_references_alter(). - */ -function domain_domain_references_alter($query, $account, $context) { - // Restrict domains by assignment, being sure only to act on the admin field. - if ($context['field_type'] == 'admin' && $context['entity_type'] == 'user') { - if ($account->hasPermission('administer domains')) { - // Do nothing. - } - elseif ($account->hasPermission('assign domain administrators')) { - $allowed = \Drupal::service('domain.element_manager')->getFieldValues($account, DOMAIN_ADMIN_FIELD); - $query->condition('id', array_keys($allowed), 'IN'); - } - else { - // Remove all options. - $query->condition('id', '-no-possible-match-'); - } - } -} - -/** - * Implements hook_views_data_alter(). - */ -function domain_views_data_alter(array &$data) { - $table = 'user__' . DOMAIN_ADMIN_FIELD; - // Since domains are not stored in the database, relationships cannot be used. - unset($data[$table][DOMAIN_ADMIN_FIELD]['relationship']); -} - -/** - * Implements hook_theme(). - */ -function domain_theme() { - return [ - 'domain_nav_block' => [ - 'render element' => 'items', - ], - ]; -} - -/** - * Prepares variables for block templates. - * - * Default template: domain-nav-block.html.twig. - * - * @param array $variables - * An associative array containing: - * - items: An array of labels and urls for use in the list. - * Properties used: 'label', 'url', 'active'. - */ -function template_preprocess_domain_nav_block(array &$variables) { - $variables['items'] = $variables['items']['#items']; -} - -/** - * Implements hook_hook_info(). - */ -function domain_hook_info() { - $hooks['domain_request_alter'] = [ - 'group' => 'domain', - ]; - $hooks['domain_validate_alter'] = [ - 'group' => 'domain', - ]; - $hooks['domain_references_alter'] = [ - 'group' => 'domain', - ]; - return $hooks; -} diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml b/sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml deleted file mode 100644 index c3b2d2f80..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml +++ /dev/null @@ -1,32 +0,0 @@ -administer domains: - title: 'Administer all domain records' - description: 'View, create, edit, and delete domain records. Allows all permissions for the module.' - restrict access: true -access inactive domains: - title: 'Access inactive domains' - description: 'Access domain URLs for domains marked as inactive.' - restrict access: true -assign domain administrators: - title: 'Assign additional administrators to assigned domains' - restrict access: true -create domains: - title: 'Create domain records' - restrict access: true -edit assigned domains: - title: 'Edit assigned domain records' - restrict access: true -delete assigned domains: - title: 'Delete assigned domain records' - restrict access: true -use domain nav block: - title: 'Access the domain navigation block' -use domain switcher block: - title: 'Access the domain switcher block' - restrict access: true -view assigned domains: - title: 'View assigned domains in the administration list' -view domain list: - title: 'View all registered domains in the administration list' -view domain information: - title: 'View debugging information for domain handling' - restrict access: true diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.routing.yml b/sites/all/modules/contrib/admin/domain/domain/domain.routing.yml deleted file mode 100644 index c230a9994..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.routing.yml +++ /dev/null @@ -1,55 +0,0 @@ -domain.admin: - path: '/admin/config/domain' - defaults: - _entity_list: 'domain' - _title: 'Domains' - _title_context: 'With modules' - requirements: - _custom_access: 'Drupal\domain\Access\DomainListCheck::viewDomainList' - -domain.settings: - path: '/admin/config/domain/settings' - defaults: - _title: 'Domain settings' - _form: '\Drupal\domain\Form\DomainSettingsForm' - requirements: - _permission: 'administer domains' - -entity.domain.add: - path: '/admin/config/domain/add' - defaults: - _entity_form: domain.edit - _title: 'Add domain record' - options: - _admin_route: TRUE - requirements: - _entity_create_access: domain - -entity.domain.edit_form: - path: '/admin/config/domain/edit/{domain}' - defaults: - _entity_form: domain.edit - _title: 'Edit domain record' - options: - _admin_route: TRUE - requirements: - _entity_access: domain.update - -entity.domain.delete_form: - path: '/admin/config/domain/delete/{domain}' - defaults: - _entity_form: domain.delete - _title: 'Delete' - options: - _admin_route: TRUE - requirements: - _entity_access: domain.delete - -domain.inline_action: - path: '/admin/config/domain/{op}/{domain}' - defaults: - _controller: 'Drupal\domain\Controller\DomainController::ajaxOperation' - requirements: - _entity_access: domain.update - _csrf_token: 'TRUE' - op: 'enable|disable|default' diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.services.yml b/sites/all/modules/contrib/admin/domain/domain/domain.services.yml deleted file mode 100644 index 8b87c6a5f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/domain.services.yml +++ /dev/null @@ -1,41 +0,0 @@ -services: - access_check.domain: - class: Drupal\domain\Access\DomainAccessCheck - tags: - - { name: access_check } - arguments: ['@domain.negotiator', '@config.factory', '@path.matcher'] - access_check.domain_route: - class: Drupal\domain\Access\DomainRouteCheck - tags: - - { name: access_check, applies_to: _domain } - arguments: ['@domain.negotiator'] - domain.current_domain_context: - class: Drupal\domain\ContextProvider\CurrentDomainContext - arguments: ['@domain.negotiator'] - tags: - - { name: 'context_provider' } - domain.element_manager: - class: Drupal\domain\DomainElementManager - arguments: ['@entity_type.manager'] - domain.negotiator: - class: Drupal\domain\DomainNegotiator - arguments: ['@request_stack', '@module_handler', '@entity_type.manager', '@config.factory'] - domain.subscriber: - class: Drupal\domain\EventSubscriber\DomainSubscriber - tags: - - { name: event_subscriber } - arguments: ['@domain.negotiator', '@entity_type.manager', '@access_check.domain', '@current_user'] - domain.token: - class: Drupal\domain\DomainToken - arguments: ['@entity_type.manager', '@domain.negotiator'] - domain.validator: - class: Drupal\domain\DomainValidator - arguments: ['@module_handler', '@config.factory', '@http_client', '@entity_type.manager'] - # @deprecated and will be removed for 8.x-1.0 release. - domain.creator: - class: Drupal\domain\DomainCreator - arguments: ['@domain.loader', '@domain.negotiator'] - # @deprecated and will be removed for 8.x-1.0 release. - domain.loader: - class: Drupal\domain\DomainLoader - arguments: ['@config.typed', '@config.factory'] diff --git a/sites/all/modules/contrib/admin/domain/domain/drush.services.yml b/sites/all/modules/contrib/admin/domain/domain/drush.services.yml deleted file mode 100644 index 84d23f785..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/drush.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - domain.commands: - class: \Drupal\domain\Commands\DomainCommands - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/admin/domain/domain/js/domain.js b/sites/all/modules/contrib/admin/domain/domain/js/domain.js deleted file mode 100644 index be71eceeb..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/js/domain.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file - * Attaches behaviors for the Domain module. - */ -(function ($) { - - "use strict"; - - /** - * - * @type {Drupal~behavior} - */ - Drupal.behaviors.domainSettingsSummaries = { - attach: function () { - // The drupalSetSummary method required for this behavior is not available - // on the Blocks administration page, so we need to make sure this - // behavior is processed only if drupalSetSummary is defined. - if (typeof jQuery.fn.drupalSetSummary === 'undefined') { - return; - } - - // There may be an easier way to do this. Right now, we just copy code - // from block module. - function checkboxesSummary(context) { - var vals = []; - var $checkboxes = $(context).find('input[type="checkbox"]:checked + label'); - var il = $checkboxes.length; - for (var i = 0; i < il; i++) { - vals.push($($checkboxes[i]).html()); - } - if (!vals.length) { - vals.push(Drupal.t('Not restricted')); - } - return vals.join(', '); - } - - $('[data-drupal-selector="edit-visibility-domain"]').drupalSetSummary(checkboxesSummary); - - } - }; - -})(jQuery); diff --git a/sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml b/sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml deleted file mode 100644 index 52e31b119..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml +++ /dev/null @@ -1,18 +0,0 @@ -id: d7_domain -label: Domain Records -migration_tags: - - Drupal 7 -source: - plugin: d7_domain -process: - id: machine_name - name: sitename - hostname: subdomain - weight: weight - is_default: is_default - scheme: scheme - path: subdomain - status: valid -destination: - plugin: entity:domain - destination_module: domain diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php b/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php deleted file mode 100644 index 0a48aec4f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php +++ /dev/null @@ -1,92 +0,0 @@ -domainNegotiator = $negotiator; - $this->configFactory = $config_factory; - $this->pathMatcher = $path_matcher; - } - - /** - * {@inheritdoc} - */ - public function applies(Route $route) { - return $this->checkPath($route->getPath()); - } - - /** - * {@inheritdoc} - */ - public function checkPath($path) { - $allowed_paths = $this->configFactory->get('domain.settings')->get('login_paths'); - return !$this->pathMatcher->matchPath($path, $allowed_paths); - } - - /** - * {@inheritdoc} - */ - public function access(AccountInterface $account) { - $domain = $this->domainNegotiator->getActiveDomain(); - // Is the domain allowed? - // No domain, let it pass. - if (empty($domain)) { - return AccessResult::allowed()->addCacheTags(['url.site']); - } - // Active domain, let it pass. - if ($domain->status()) { - return AccessResult::allowed()->addCacheTags(['url.site']); - } - // Inactive domain, require permissions. - else { - $permissions = ['administer domains', 'access inactive domains']; - $operator = 'OR'; - return AccessResult::allowedIfHasPermissions($account, $permissions, $operator)->addCacheTags(['url.site']); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php b/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php deleted file mode 100644 index 271080766..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php +++ /dev/null @@ -1,29 +0,0 @@ -hasPermission('administer domains') || $account->hasPermission('view domain list') || $account->hasPermission('view assigned domains')) { - return AccessResult::allowed(); - } - return AccessResult::forbidden(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php b/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php deleted file mode 100644 index a67066a30..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php +++ /dev/null @@ -1,81 +0,0 @@ -domainNegotiator = $negotiator; - } - - /** - * {@inheritdoc} - */ - public function applies(Route $route) { - return $route->hasRequirement($this->requirementsKey); - } - - /** - * Checks access to a route with a _domain requirement. - * - * @param \Symfony\Component\Routing\Route $route - * The route to check against. - * @param \Drupal\Core\Session\AccountInterface $account - * The currently logged in account. - * - * @return \Drupal\Core\Access\AccessResultInterface - * The access result. - * - * @see \Drupal\domain\Plugin\views\access\Domain - */ - public function access(Route $route, AccountInterface $account) { - // Requirements just allow strings, so this might be a comma separated list. - $string = $route->getRequirement($this->requirementsKey); - $domain = $this->domainNegotiator->getActiveDomain(); - // Since only one domain can be active per request, we only suport OR logic. - $allowed = array_filter(array_map('trim', explode('+', $string))); - if (!empty($domain) && in_array($domain->id(), $allowed)) { - return AccessResult::allowed()->addCacheContexts(['url.site']); - } - // If there is no allowed domain, give other access checks a chance. - return AccessResult::neutral()->addCacheContexts(['url.site']); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php b/sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php deleted file mode 100644 index 0ab54726b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php +++ /dev/null @@ -1,10 +0,0 @@ -domainStorage()->loadMultipleSorted(); - - if (empty($domains)) { - $this->logger()->warning(dt('No domains have been created. Use "drush domain:add" to create one.')); - return new RowsOfFields([]); - } - - $keys = [ - 'weight', - 'name', - 'hostname', - 'response', - 'scheme', - 'status', - 'is_default', - 'domain_id', - 'id', - ]; - $rows = []; - /** @var \Drupal\domain\DomainInterface $domain */ - foreach ($domains as $domain) { - $row = []; - foreach ($keys as $key) { - switch($key) { - case 'response': - try { - $v = $this->checkDomain($domain); - } - catch(\GuzzleHttp\Exception\TransferException $ex) { - $v = dt('500 - Failed'); - } - catch(Exception $ex) { - $v = dt('500 - Exception'); - } - if ($v >= 200 && $v <= 299) { - $v = dt('200 - OK'); - } - elseif ($v == 500) { - $v = dt('500 - No server'); - } - break; - case 'status': - $v = $domain->get($key); - if (($options['inactive'] && $v) || ($options['active'] && !$v)) { - continue 3; // switch, for, for - } - $v = !empty($v) ? dt('Active') : dt('Inactive'); - break; - case 'is_default': - $v = $domain->get($key); - $v = !empty($v) ? dt('Default') : ''; - break; - default: - $v = $domain->get($key); - break; - } - - $row[$key] = Html::escape($v); - } - $rows[] = $row; - } - return new RowsOfFields($rows); - } - - /** - * List general information about the domains on the site. - * - * @usage drush domain:info - * - * @command domain:info - * @aliases domain-info,dinf - * - * @return \Consolidation\OutputFormatters\StructuredData\PropertyList - * @field-labels - * count: All Domains - * count_active: Active Domains - * default_id: Default Domain ID - * default_host: Default Domain hostname - * scheme: Fields in Domain entity - * domain_admin_entities: Domain admin entities - * @list-orientation true - * @format table - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function infoDomains() { - $default_domain = $this->domainStorage()->loadDefaultDomain(); - - // Load all domains: - $all_domains = $this->domainStorage()->loadMultiple(NULL); - $active_domains = []; - foreach ($all_domains as $domain) { - if ($domain->status()) { - $active_domains[] = $domain; - } - } - - $keys = [ - 'count', - 'count_active', - 'default_id', - 'default_host', - 'scheme', - ]; - $rows = []; - foreach ($keys as $key) { - $v = ''; - switch($key) { - case 'count': - $v = count($all_domains); - break; - case 'count_active': - $v = count($active_domains); - break; - case 'default_id': - $v = '-unset-'; - if ($default_domain) { - $v = $default_domain->id(); - } - break; - case 'default_host': - $v = '-unset-'; - if ($default_domain) { - $v = $default_domain->getHostname(); - } - break; - case 'scheme': - $v = implode(', ', array_keys($this->domainStorage()->loadSchema())); - break; - } - - $rows[$key] = $v; - } - - - // Display which entities are enabled for domain by checking for the fields. - $rows['domain_admin_entities'] = $this->getFieldEntities(DOMAIN_ADMIN_FIELD); - - return new PropertyList($rows); - } - - /** - * Finds entities that reference a specific field. - * - * @param $field_name - * The field name to lookup. - */ - public function getFieldEntities($field_name) { - $entity_manager = \Drupal::entityManager(); - $field_map = $entity_manager->getFieldMap(); - $domain_entities = []; - foreach($field_map as $type => $fields) { - if (array_key_exists($field_name, $fields)) { - $domain_entities[] = $type; - } - } - return implode(', ', $domain_entities); - } - - /** - * Add a new domain to the site. - * - * @param $hostname - * The domain hostname to register (e.g. example.com). - * @param $name - * The name of the site (e.g. Domain Two). - * @param array $options An associative array of optional values. - * - * @option inactive - * Set the domain to inactive status if set. - * @option scheme - * Use indicated protocol for this domain, defaults to 'https'. Options: - * - http: normal http (no SSL). - * - https: secure https (with SSL). - * - variable: match the scheme used by the request. - * @option weight - * Set the order (weight) of the domain. - * @option is_default - * Set this domain as the default domain. - * @option validate - * Force a check of the URL response before allowing registration. - * - * @usage drush domain-add example.com 'My Test Site' - * @usage drush domain-add example.com 'My Test Site' --scheme=https --inactive - * @usage drush domain-add example.com 'My Test Site' --weight=10 - * @usage drush domain-add example.com 'My Test Site' --validate - * - * @command domain:add - * @aliases domain-add - * - * @return string - * The entity id of the created domain. - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function add($hostname, $name, array $options = ['weight' => null, 'scheme' => null]) { - // Validate the weight arg. - if (!empty($options['weight']) && !is_numeric($options['weight'])) { - throw new DomainCommandException( - dt('Domain weight "!weight" must be a number', - ['!weight' => !empty($options['weight']) ? $options['weight'] : '']) - ); - } - - // Validate the scheme arg. - if (!empty($options['scheme']) && - ($options['scheme'] !== 'http' && $options['scheme'] !== 'https' && $options['scheme'] !== 'variable') - ) { - throw new DomainCommandException( - dt('Scheme name "!scheme" not known', - ['!scheme' => !empty($options['scheme']) ? $options['scheme'] : '']) - ); - } - - $domains = $this->domainStorage()->loadMultipleSorted(); - $start_weight = count($domains) + 1; - $values = [ - 'hostname' => $hostname, - 'name' => $name, - 'status' => empty($options['inactive']), - 'scheme' => empty($options['scheme']) ? 'http' : $options['scheme'], - 'weight' => empty($options['weight']) ? $start_weight : $options['weight'], - 'is_default' => !empty($options['is_default']), - 'id' => $this->domainStorage()->createMachineName($hostname), - ]; - /** @var DomainInterface $domain */ - $domain = $this->domainStorage()->create($values); - - // Check for hostname validity. This is required. - $valid = $this->validateDomain($domain); - if (!empty($valid)) { - throw new DomainCommandException( - dt('Hostname is not valid. !errors', - ['!errors' => implode(" ", $valid)]) - ); - } - // Check for hostname and id uniqueness. - foreach ($domains as $existing) { - if ($hostname == $existing->getHostname()) { - throw new DomainCommandException( - dt('No domain created. Hostname is a duplicate of !hostname.', - ['!hostname' => $hostname]) - ); - } - if ($values['id'] == $existing->id()) { - throw new DomainCommandException( - dt('No domain created. Id is a duplicate of !id.', - ['!id' => $existing->id()]) - ); - } - } - - $validate_response = (bool) $options['validate']; - if ($this->createDomain($domain, $validate_response)) { - return dt('Created the !hostname with machine id !id.', ['!hostname' => $values['hostname'], '!id' => $values['id']]); - } - else { - return dt('No domain created.'); - } - } - - /** - * Delete a domain from the site. - * - * Deletes the domain from the Drupal configuration and optionally reassign - * content and/or profiles associated with the deleted domain to another. - * The domain marked as default cannot be deleted: to achieve this goal, - * mark another, possibly newly created, domain as the default domain, then - * delete the old default. - * - * The usage example descriptions are based on starting with three domains: - * - id:19476, machine: example_com, domain: example.com - * - id:29389, machine: example_org, domain: example.org (default) - * - id:91736, machine: example_net, domain: example.net - * - * @param $domain_id - * The numeric id, machine name, or hostname of the domain to delete. The - * value "all" is taken to mean delete all except the default domain. - * @param array $options - * An associative array of options whose values come from cli, aliases, - * config, etc. - * - * @usage drush domain:delete example.com - * Delete the domain example.com, assigning its content and users to - * the default domain, example.org. - * - * @usage drush domain:delete --content-assign=ignore example.com - * Delete the domain example.com, leaving its content untouched but - * assigning its users to the default domain. - * - * @usage drush domain:delete --content-assign=example_net --users-assign=example_net - * example.com Delete the domain example.com, assigning its content and - * users to the example.net domain. - * - * @usage drush domain:delete --dryrun 19476 - * Show the effects of delete the domain example.com and assigning its - * content and users to the default domain, example.org, but not doing so. - * - * @usage drush domain:delete --chatty example_net - * Verbosely Delete the domain example.net and assign its content and users - * to the default domain, example.org. - * - * @usage drush domain-delete --chatty all - * Verbosely Delete the domains example.com and example.net and assign - * their content and users to the default domain, example.org. - * - * @option chatty - * Document each step as it is performed. - * @option dryrun - * Do not do anything, but explain what would be done. Implies --chatty. - * @option users-assign - * Values "prompt", "ignore", "default", , Reassign user accounts - * associated with the the domain being deleted to the default domain, - * to the domain whose machine name is , or leave the user accounts - * alone (and so inaccessible in the normal way). The default value is - * 'prompt': ask which domain to use. - * - * @command domain:delete - * @aliases domain-delete - * - * @throws \Drupal\domain\Commands\DomainCommandException - * - * @see https://github.com/consolidation/annotated-command#option-event-hook - */ - public function delete($domain_id, $options = ['users-assign' => null, 'dryrun' => null, 'chatty' => null]) { - if (is_null($options['users-assign'])) { - $policy_users = 'prompt'; - } - - $this->is_dry_run = (bool) $options['dryrun']; - - // Get current domain list and perform validation checks. - $default_domain = $this->domainStorage()->loadDefaultDomain(); - $all_domains = $this->domainStorage()->loadMultipleSorted(NULL); - - if (empty($all_domains)) { - throw new DomainCommandException('There are no configured domains.'); - } - if (empty($domain_id)) { - throw new DomainCommandException('You must specify a domain to delete.'); - } - - // Determine which domains to be deleted. - if ($domain_id === 'all') { - $domains = $all_domains; - if (empty($domains)) { - $this->logger()->info(dt('There are no domains to delete.')); - return; - } - $really = $this->io()->confirm(dt('This action cannot be undone. Continue?:'), FALSE); - if (empty($really)) { - return; - } - // TODO: handle deletion of all domains. - } - elseif ($domain = $this->getDomainFromArgument($domain_id)) { - if ($domain->isDefault()) { - throw new DomainCommandException('The primary domain may not be deleted. - Use drush domain:default to set a new default domain.'); - } - $domains = [$domain]; - } - - if (!empty($options['users-assign'])) { - if (in_array($options['users-assign'], $this->reassignment_policies, TRUE)) { - $policy_users = $options['users-assign']; - } - } - - $delete_options = [ - 'entity_filter' => 'user', - 'policy' => $policy_users, - 'field' => DOMAIN_ADMIN_FIELD, - ]; - - if ($policy_users !== 'ignore') { - $messages[] = $this->doReassign($domain, $delete_options); - } - - // Fire any registered hooks for deletion, passing them current imput. - $handlers = $this->getCustomEventHandlers('domain-delete'); - $messages = []; - foreach ($handlers as $handler) { - $messages[] = $handler($domain, $options); - } - - $this->deleteDomain($domains, $options); - - $message = dt('Domain record !domain deleted.', ['!domain' => $domain->id()]); - if ($messages) { - $message .= "\n" . implode("\n", $messages); - } - $this->logger()->info($message); - return $message; - } - - /** - * Handles reassignment of entities to another domain. - * - * This method includes necessary UI elements if the user is prompted to - * choose a new domain. - * - * @param Drupal\domain\DomainInterface $target_domain - * The domain selected for deletion. - * @param array $delete_options - * A selection of options for deletion, defined in reassignLinkedEntities(). - */ - public function doReassign(DomainInterface $target_domain, array $delete_options) { - $policy = $delete_options['policy']; - $default_domain = $this->domainStorage()->loadDefaultDomain(); - $all_domains = $this->domainStorage()->loadMultipleSorted(NULL); - - // Perform the 'prompt' for a destination domain. - if ($policy === 'prompt') { - // Make a list of the eligible destination domains in form id -> name. - $noassign_domain = [$target_domain->id()]; - - $reassign_list = $this->filterDomains($all_domains, $noassign_domain); - $reassign_base = [ - 'ignore' => dt('Do not reassign'), - 'default' => dt('Reassign to default domain'), - ]; - $reassign_list = array_map( - function (DomainInterface $d) { - return $d->getHostname(); - }, - $reassign_list - ); - $reassign_list = array_merge($reassign_base, $reassign_list); - $policy = $this->io()->choice(dt('Reassign @type field @field data to:', ['@type' => $delete_options['entity_filter'], '@field' => $delete_options['field']]), $reassign_list); - } - elseif ($policy === 'default') { - $policy = $default_domain->id(); - } - if ($policy !== 'ignore') { - $delete_options['policy'] = $policy; - $target = [$target_domain]; - $count = $this->reassignLinkedEntities($target, $delete_options); - return dt('@count @type entities updated field @field.', ['@count' => $count, '@type' => $delete_options['entity_filter'], '@field' => $delete_options['field']]); - } - } - - /** - * Tests domains for proper response. - * - * If run from a subfolder, you must specify the --uri. - * - * @param $domain_id - * The machine name or hostname of the domain to make default. - * - * @usage drush domain-test - * @usage drush domain-test example.com - * - * @command domain:test - * @aliases domain-test - * - * @field-labels - * id: Machine name - * url: URL - * response: HTTP Response - * @default-fields id,url,response - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function test($domain_id = null) { - if (is_null($domain_id)) { - $domains = $this->domainStorage()->loadMultipleSorted(); - } - else { - if ($domain = $this->getDomainFromArgument($domain_id)) { - $domains = [$domain]; - } - else { - throw new DomainCommandException(dt('Domain @domain not found.', - ['@domain' => $options['domain']])); - } - } - $keys = ['url', 'response']; - $rows = []; - foreach ($domains as $domain) { - $rows[] = [ - 'id' => $domain->id(), - 'url' => $domain->getPath(), - 'response' => $domain->getResponse(), - ]; - } - return new RowsOfFields($rows); - } - - /** - * Sets the default domain. - * - * @param $domain_id - * The machine name or hostname of the domain to make default. - * @param array $options - * An associative array of options whose values come from cli, aliases, - * config, etc. - * @option validate - * Force a check of the URL response before allowing registration. - * @usage drush domain-default www.example.com - * @usage drush domain-default example_org - * @usage drush domain-default www.example.org --validate=1 - * - * @command domain:default - * @aliases domain-default - * - * @return string - * The machine name of the default domain. - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function defaultDomain($domain_id, array $options = ['validate' => null]) { - // Resolve the domain. - if (!empty($domain_id) && $domain = $this->getDomainFromArgument($domain_id)) { - $validate = ($options['validate']) ? 1 : 0; - $domain->addProperty('validate_url', $validate); - if ($error = $this->checkHTTPResponse($domain)) { - throw new DomainCommandException(dt('Unable to verify domain !domain: !error', - ['!domain' => $domain->getHostname(), '!error' => $error])); - } - else { - $domain->saveDefault(); - } - } - - // Now, ask for the current default, so we know if it worked. - $domain = $this->domainStorage()->loadDefaultDomain(); - if ($domain->status()) { - $this->logger()->info(dt('!domain set to primary domain.', - ['!domain' => $domain->getHostname()])); - } - else { - $this->logger()->warning(dt('!domain set to primary domain, but is also inactive.', - ['!domain' => $domain->getHostname()])); - } - return $domain->id(); - } - - /** - * Deactivates the domain. - * - * @param $domain_id - * The numeric id or hostname of the domain to disable. - * @usage drush domain-disable example.com - * @usage drush domain-disable 1 - * - * @command domain:disable - * @aliases domain-disable - * - * @return string - * 'disabled' if the domain is now disabled. - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function disable($domain_id) { - // Resolve the domain. - if ($domain = $this->getDomainFromArgument($domain_id)) { - if ($domain->status()) { - $domain->disable(); - $this->logger()->info(dt('!domain has been disabled.', - ['!domain' => $domain->getHostname()])); - return dt('Disabled !domain.', ['!domain' => $domain->getHostname()]); - } - else { - $this->logger()->info(dt('!domain is already disabled.', - ['!domain' => $domain->getHostname()])); - return dt('!domain is already disabled.', ['!domain' => $domain->getHostname()]); - } - } - return dt('No matching domain record found.'); - } - - /** - * Activates the domain. - * - * @param $domain_id - * The numeric id or hostname of the domain to enable. - * @usage drush domain-disable example.com - * @usage drush domain-enable 1 - * - * @command domain:enable - * @aliases domain-enable - * - * @return string - * 'enabled' if the domain is now enabled. - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function enable($domain_id) { - // Resolve the domain. - if ($domain = $this->getDomainFromArgument($domain_id)) { - if (!$domain->status()) { - $domain->enable(); - $this->logger()->info(dt('!domain has been enabled.', - ['!domain' => $domain->getHostname()])); - return dt('Enabled !domain.', ['!domain' => $domain->getHostname()]); - } - else { - $this->logger()->info(dt('!domain is already enabled.', - ['!domain' => $domain->getHostname()])); - return dt('!domain is already enabled.', ['!domain' => $domain->getHostname()]); - } - } - return dt('No matching domain record found.'); - } - - /** - * Changes a domain label. - * - * @param $domain_id - * The machine name or hostname of the domain to relabel. - * @param $name - * The name to use for the domain. - * @usage drush domain-name example.com Foo - * @usage drush domain-name 1 Foo - * - * @command domain:name - * @aliases domain-name - * - * @return string - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function renameDomain($domain_id, $name) { - // Resolve the domain. - if ($domain = $this->getDomainFromArgument($domain_id)) { - $domain->saveProperty('name', $name); - return dt('Renamed !domain to !name.', ['!domain' => $domain->getHostname(), '!name' => $domain->label()]); - } - return dt('No matching domain record found.'); - } - - /** - * Changes a domain scheme. - * - * @param $domain_id - * The machine name or hostname of the domain to change. - * @param $scheme - * The scheme to use for the domain: http, https, or variable. - * - * @usage drush domain-scheme example.com http - * @usage drush domain-scheme example_com https - * - * @command domain:scheme - * @aliases domain-scheme - * - * @return string - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function scheme($domain_id, $scheme = null) { - $new_scheme = null; - - // Resolve the domain. - if ($domain = $this->getDomainFromArgument($domain_id)) { - if (!empty($scheme)) { - // --set with a value - $new_scheme = $scheme; - } - else { - // Prompt for selection. - $new_scheme = $this->io()->choice(dt('Select the default http scheme:'), - [ - 'http' => 'http', - 'https' => 'https', - 'variable' => 'variable', - ]); - } - - // If we were asked to change scheme, validate the value and do so. - if (!empty($new_scheme)) { - switch ($new_scheme) { - case 'http': - $new_scheme = 'http'; - break; - - case 'https': - $new_scheme = 'https'; - break; - - case 'variable': - $new_scheme = 'variable'; - break; - - default: - throw new DomainCommandException( - dt('Scheme name "!scheme" not known', ['!scheme' => $new_scheme]) - ); - } - $domain->saveProperty('scheme', $new_scheme); - } - - // Either way, return the (new | current) scheme for this domain. - return dt('Scheme is now to "!scheme" for !domain', ['!scheme' => $domain->get('scheme'),'!domain' => $domain->id()]); - } - - // We couldn't find the domain - so fail. - throw new DomainCommandException( - dt('Domain name "!domain" not known', ['!domain' => $domain_id]) - ); - } - - /** - * Generate domains for testing. - * - * @param $primary - * The primary domain to use. This will be created and used for - * *.example.com hostnames. - * @param array $options - * An associative array of options whose values come from cli, aliases, - * config, etc. - * @option count - * The count of extra domains to generate. Default is 15. - * @option empty - * Pass empty=1 to truncate the {domain} table before creating records. - * @usage drush domain-generate example.com - * @usage drush domain-generate example.com --count=25 - * @usage drush domain-generate example.com --count=25 --empty=1 - * @usage drush gend - * @usage drush gend --count=25 - * @usage drush gend --count=25 --empty=1 - * - * @command domain:generate - * @aliases gend,domgen,domain-generate - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - public function generate($primary = 'example.com', array $options = ['count' => null, 'empty' => null]) { - // Check the number of domains to create. - $count = $options['count']; - if (is_null($count)) { - $count = 15; - } - - $domains = $this->domainStorage()->loadMultiple(NULL); - if (!empty($options['empty'])) { - $this->domainStorage()->delete($domains); - $domains = $this->domainStorage()->loadMultiple(NULL); - } - // Ensure we don't duplicate any domains. - $existing = []; - if (!empty($domains)) { - /** @var DomainInterface $domain */ - foreach ($domains as $domain) { - $existing[] = $domain->getHostname(); - } - } - // Set up one.* and so on. - $names = [ - 'one', - 'two', - 'three', - 'four', - 'five', - 'six', - 'seven', - 'eight', - 'nine', - 'ten', - 'foo', - 'bar', - 'baz', - ]; - // Set the creation array. - $new = [$primary]; - foreach ($names as $name) { - $new[] = $name . '.' . $primary; - } - // Include a non hostname. - $new[] = 'my' . $primary; - // Filter against existing so we can count correctly. - $prepared = []; - foreach ($new as $key => $value) { - if (!in_array($value, $existing, true)) { - $prepared[] = $value; - } - } - - // Add any test domains that have numeric prefixes. We don't expect these URLs to work, - // and mainly use these for testing the user interface. - // Test that we already have test domains. - $start = 1; - foreach ($existing as $exists) { - $name = explode('.', $exists); - if (substr_count($name[0], 'test') > 0) { - $num = (int) str_replace('test', '', $name[0]) + 1; - if ($num > $start) { - $start = $num; - } - } - } - $needed = $count - count($prepared) + $start; - for ($i = $start; $i <= $needed; $i++) { - $prepared[] = 'test' . $i . '.' . $primary; - } - // Get the initial item weight for sorting. - $start_weight = count($domains); - $prepared = array_slice($prepared, 0, $count); - $list = []; - - // Create the domains. - foreach ($prepared as $key => $item) { - $hostname = mb_strtolower($item); - $values = [ - 'name' => ($item != $primary) ? ucwords(str_replace(".$primary", '', $item)) : \Drupal::config('system.site')->get('name'), - 'hostname' => $hostname, - 'scheme' => 'http', - 'status' => 1, - 'weight' => ($item != $primary) ? $key + $start_weight + 1 : -1, - 'is_default' => 0, - 'id' => $this->domainStorage()->createMachineName($hostname), - ]; - $domain = $this->domainStorage()->create($values); - $domain->save(); - $list[] = dt('Created @domain.', ['@domain' => $domain->getHostname()]); - } - - // If nothing created, say so. - if (empty($prepared)) { - return dt('No new domains were created.'); - } - else { - return dt("Created @count new domains:\n@list", ['@count' => count($prepared), '@list' => implode("\n", $list)]); - } - } - - /** - * Gets a domain storage object or throw an exception. - * - * Note that domain can run very early in the bootstrap, so we cannot - * reliably inject this service. - * - * @return DomainStorageInterface - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - protected function domainStorage() { - if (!is_null($this->domain_storage)) { - return $this->domain_storage; - } - - try { - $this->domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - } - catch (PluginNotFoundException $e) { - throw new DomainCommandException('Unable to get domain: no storage', $e); - } - catch (InvalidPluginDefinitionException $e) { - throw new DomainCommandException('Unable to get domain: bad storage', $e); - } - - return $this->domain_storage; - } - - /** - * Loads a domain based on a string identifier. - * - * @param string $argument - * The machine name or the hostname of an existing domain. - * - * @return \Drupal\domain\DomainInterface - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - protected function getDomainFromArgument($argument) { - - // Try loading domain assuming arg is a machine name. - $domain = $this->domainStorage()->load($argument); - if (!$domain) { - // Try loading assuming it is a host name. - $domain = $this->domainStorage()->loadByHostname($argument); - } - - // domain_id (an INT) is only used internally because the Node Access - // system demands the use of numeric keys. It should never be used to load - // or identify domain records. Use the machine_name or hostname instead. - if (!$domain) { - throw new DomainCommandException( - dt('Domain record could not be found from "!a".', ['!a' => $argument]) - ); - } - - return $domain; - } - - /** - * Filters a list of domains by excluding domains appearing in a specific list. - * - * @param DomainInterface[] $domains - * List of domains. - * @param string[] $exclude - * List of domain id to exclude from the list. - * @param DomainInterface[] $initial - * Initial value of list that will be returned. - * - * @return array - */ - protected function filterDomains(array $domains, array $exclude, array $initial = []) { - foreach ($domains as $domain) { - // Exclude unwanted domains. - if (!in_array($domain->id(), $exclude, FALSE)) { - $initial[$domain->id()] = $domain; - } - } - return $initial; - } - - /** - * Checks the domain response. - * - * @param \Drupal\domain\DomainInterface $domain - * The domain to check. - * @param bool $validate_url - * True to validate this domain by performing a URL lookup; False to skip - * the checks. - * - * @return bool - * True if the domain resolves properly, or we are not checking, - * False otherwise. - */ - protected function checkHTTPResponse(DomainInterface $domain, $validate_url = FALSE) { - // Ensure the url is rebuilt. - if ($validate_url) { - $code = $this->checkDomain($domain); - - // Some sort of success: - return $code >= 200 && $code <= 299; - } - // Not validating, so all is well! - return FALSE; - } - - /** - * Helper function: check a domain is responsive and create it. - * - * @param DomainInterface $domain - * The (as yet unsaved) domain to create. - * @param bool $check_response - * Indicates that registration should not be allowed unless the server - * returns a 200 response. - * - * @return bool - * TODO: stndardize this return so we can issue good messages. - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - protected function createDomain(DomainInterface $domain, $check_response = FALSE) { - if ($check_response) { - $valid = $this->checkHTTPResponse($domain, TRUE); - if (!$valid) { - throw new DomainCommandException( - dt('The server did not return a 200 response for !d. Domain creation failed. Remove the --validate flag to save this domain.', ['!d' => $domain->getHostname()]) - ); - } - } - else { - try { - $domain->save(); - } - catch (EntityStorageException $e) { - throw new DomainCommandException('Unable to save domain', $e); - } - - if ($domain->getDomainId()) { - $this->logger()->info(dt('Created @name at @domain.', - ['@name' => $domain->label(), '@domain' => $domain->getHostname()])); - return TRUE; - } - else { - $this->logger()->error(dt('The request could not be completed.')); - } - } - return FALSE; - } - - /** - * Checks a domain exists by trying to do an http request to it. - * - * @param DomainInterface $domain - * The domain to validate for syntax and uniqueness. - * - * @return int - * The server response code for the request. - * - * @see domain_validate() - */ - protected function checkDomain(DomainInterface $domain) { - /** @var \Drupal\domain\DomainValidatorInterface $validator */ - $validator = \Drupal::service('domain.validator'); - return $validator->checkResponse($domain); - } - - /** - * Validates a domain meets the standards for a hostname. - * - * @param DomainInterface $domain - * The domain to validate for syntax and uniqueness. - * @return string[] - * Array of strings indicating issues found. - * - * @see domain_validate() - */ - protected function validateDomain(DomainInterface $domain) { - /** @var \Drupal\domain\DomainValidatorInterface $validator */ - $validator = \Drupal::service('domain.validator'); - return $validator->validate($domain->getHostname()); - } - - /** - * Deletes a domain record. - * - * @param DomainInterface[] $domains - * The domain_id to delete. Pass 'all' to delete all records. - * - * @throws \Drupal\domain\Commands\DomainCommandException - * @throws \UnexpectedValueException - */ - protected function deleteDomain(array $domains) { - foreach ($domains as $domain) { - if (!$domain instanceof DomainInterface) { - throw new StorageException('deleting domains: value is not a domain'); - } - $hostname = $domain->getHostname(); - - if ($this->is_dry_run) { - $this->logger()->info(dt('DRYRUN: Domain record @domain deleted.', - ['@domain' => $hostname])); - continue; - } - - try { - $domain->delete(); - } - catch (EntityStorageException $e) { - throw new DomainCommandException(dt('Unable to delete domain: @domain', - ['@domain' => $hostname]), $e); - } - $this->logger()->info(dt('Domain record @domain deleted.', - ['@domain' => $hostname])); - } - } - - /** - * Returns a list of the entity types that are domain enabled. - * - * A domain-enabled entity is defined here as an entity type that includes - * the domain access field(s). - * - * @param string $using_field - * The specific field name to look for. - * - * @return string[] - * List of entity machine names that support domain references. - */ - protected function findDomainEnabledEntities($using_field = DOMAIN_ADMIN_FIELD) { - $this->ensureEntityFieldMap(); - $entities = []; - foreach($this->entity_field_map as $type => $fields) { - if (array_key_exists($using_field, $fields)) { - $entities[] = $type; - } - } - return $entities; - } - - /** - * Determines whether or not a given entity is domain-enabled. - * - * @param string $entity_type - * The machine name of the entity. - * @param string $field - * The name of the field to check for existence. - * - * @return bool - * True if this type of entity has a domain field. - */ - protected function entityHasDomainField($entity_type, $field = DOMAIN_ADMIN_FIELD) { - // Try to avoid repeated calls to getFieldMap(), assuming it's expensive. - $this->ensureEntityFieldMap(); - return array_key_exists($field, $this->entity_field_map[$entity_type]); - } - - /** - * Ensure the local entity field map has been defined. - * - * Asking for the entity field map cause a lot of lookup, so we lazily - * fetch it and then remember it to avoid repeated checks. - */ - protected function ensureEntityFieldMap() { - // Try to avoid repeated calls to getFieldMap() assuming it's expensive. - if (empty($this->entity_field_map)) { - $entity_manager = \Drupal::entityManager(); - $this->entity_field_map = $entity_manager->getFieldMap(); - } - } - - /** - * Enumerate entity instances of the supplied type and domain. - * - * @param string $entity_type - * The entity type name, e.g. 'node' - * @param string $domain_id - * The machine name of the domain to enumerate. - * @param string $field - * The field to manipulate in the entity, e.g. DOMAIN_ACCESS_FIELD. - * - * @return int|string[] - * List of entity IDs for the selected domain. - * @todo: should this really be a string[] of fields? - */ - protected function enumerateDomainEntities($entity_type, $domain_id, $field, $just_count = FALSE) { - if (!$this->entityHasDomainField($entity_type, $field)) { - $this->logger()->info('Entity type @entity_type does not have field @field, so none found.', - ['@entity_type'=> $entity_type, - '@field' => $field]); - return []; - } - - $efq = \Drupal::entityQuery($entity_type); - // Don't access check or we wont get all of the possible entities moved. - $efq->accessCheck(FALSE); - $efq->condition($field, $domain_id, '='); - if ($just_count) { - $efq->count(); - } - return $efq->execute(); - } - - /** - * Reassign old_domain entities, of the supplied type, to the new_domain. - * - * @param string $entity_type - * The entity type name, e.g. 'node' - * @param string $field - * The field to manipulate in the entity, e.g. DOMAIN_ADMIN_FIELD. - * @param \Drupal\domain\DomainInterface $old_domain - * The domain the entities currently belong to. It is not an error for - * entity ids to be passed in that are not in this domain, though of course - * not very useful. - * @param \Drupal\domain\DomainInterface $new_domain - * The domain the entities should now belong to: When an entity belongs to - * the old_domain, this domain replaces it. - * @param array $ids - * List of entity IDs for the selected domain and all of type $entity_type. - * - * @return int - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Drupal\Core\Entity\EntityStorageException - */ - protected function reassignEntities($entity_type, $field, DomainInterface $old_domain, DomainInterface $new_domain, array $ids) { - $entity_storage = \Drupal::entityTypeManager()->getStorage($entity_type); - $entities = $entity_storage->loadMultiple($ids); - - foreach($entities as $entity) { - $changed = FALSE; - if (!$entity->hasField($field)) { - continue; - } - // Multivalue fields are used, so check each one. - foreach ($entity->get($field) as $k => $item) { - if ($item->target_id == $old_domain->id()) { - - if ($this->is_dry_run) { - $this->logger()->info(dt('DRYRUN: Update domain membership for entity @id to @new.', - [ '@id' => $entity->id(), '@new' => $new_domain->id() ])); - - // Don't set changed, so don't save either. - continue; - } - - $changed = TRUE; - $item->target_id = $new_domain->id(); - } - } - if ($changed) { - $entity->save(); - } - } - return count($entities); - } - - /** - * Return the Domain object corresponding to a policy string. - * - * @param string $policy - * In general one of 'prompt' | 'default' | 'ignore' or a domain entity - * machine name, but this function does not process 'prompt'. - * - * @return \Drupal\Core\Entity\EntityInterface|\Drupal\domain\DomainInterface|null - * @throws \Drupal\domain\Commands\DomainCommandException - */ - protected function getDomainInstanceFromPolicy($policy) { - switch($policy) { - /* Use the Default Domain machine name */ - case 'default': - $new_domain = $this->domainStorage()->loadDefaultDomain(); - break; - - /* Ask interactively for a Domain machine name */ - case 'prompt': - case 'ignore': - return NULL; - - /* Use this (specified) Domain machine name */ - default: - $new_domain = $this->domainStorage()->load($policy); - break; - } - return $new_domain; - } - - /** - * Reassign entities of the supplied type to the $policy domain. - * - * @param array $options - * [ - * 'entity_filter' => 'node', - * 'policy' => 'prompt' | 'default' | 'ignore' | {domain_id} - * 'field' => DOMAIN_ACCESS_FIELD, - * ]; - * - * @param DomainInterface[] $domains - * List of the domains to reassign content away from. - * - * @throws \Drupal\domain\Commands\DomainCommandException - */ - protected function reassignLinkedEntities($domains, array $options) { - $count = 0; - $field = $options['field']; - $entity_typenames = $this->findDomainEnabledEntities($field); - - $new_domain = $this->getDomainInstanceFromPolicy($options['policy']); - if (empty($new_domain)) { - throw new DomainCommandException('invalid destination domain'); - } - - // For each entity type... - $exceptions = FALSE; - foreach ($entity_typenames as $name) { - if (empty($options['entity_filter']) || $options['entity_filter'] === $name) { - - // For each domain being reassigned from... - foreach ($domains as $domain) { - $ids = $this->enumerateDomainEntities($name, $domain->id(), $field); - if (!empty($ids)) { - try { - if ($options['chatty']) { - $this->logger()->info('Reassigning @count @entity_name entities to @domain', - ['@entity_name'=>'', - '@count' => \count($ids), - '@domain' => $new_domain->id()]); - } - $count = $this->reassignEntities($name, $field, $domain, $new_domain, $ids); - } - catch (PluginException $e) { - $exceptions = TRUE; - $this->logger()->error('Unable to reassign content to @new_domain: plugin exception: @ex', - ['@ex' => $e->getMessage(), - '@new_domain' => $new_domain->id()]); - } - catch (EntityStorageException $e) { - $exceptions = TRUE; - $this->logger()->error('Unable to reassign content to @new_domain: storage exception: @ex', - ['@ex' => $e->getMessage(), - '@new_domain' => $new_domain->id()]); - } - } - } - } - } - if ($exceptions) { - throw new DomainCommandException('Errors encountered during reassign.'); - } - - return $count; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php b/sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php deleted file mode 100644 index 51cb962d6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php +++ /dev/null @@ -1,66 +0,0 @@ -negotiator = $negotiator; - } - - /** - * {@inheritdoc} - */ - public function getRuntimeContexts(array $unqualified_context_ids) { - // Load the current domain. - $current_domain = $this->negotiator->getActiveDomain(); - // Set the context. - $context = new Context(new ContextDefinition('entity:domain', $this->t('Active domain')), $current_domain); - - // Allow caching. - $cacheability = new CacheableMetadata(); - $cacheability->setCacheContexts(['url.site']); - $context->addCacheableDependency($cacheability); - - // Prepare the result. - $result = [ - 'entity:domain' => $context, - ]; - - return $result; - } - - /** - * {@inheritdoc} - */ - public function getAvailableContexts() { - $context = new Context(new ContextDefinition('entity:domain', $this->t('Active domain'))); - return ['entity:domain' => $context]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php b/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php deleted file mode 100644 index 78837c984..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php +++ /dev/null @@ -1,76 +0,0 @@ -saveDefault(); - $message = $this->t('Domain record set as default'); - if ($domain->isDefault()) { - $success = TRUE; - } - break; - - case 'enable': - $domain->enable(); - $message = $this->t('Domain record has been enabled.'); - if ($domain->status()) { - $success = TRUE; - } - break; - - case 'disable': - $domain->disable(); - $message = $this->t('Domain record has been disabled.'); - if (!$domain->status()) { - $success = TRUE; - } - break; - } - - // Set a message. - if ($success) { - \Drupal::messenger()->addMessage($message); - } - else { - \Drupal::messenger()->addMessage($this->t('The operation failed.')); - } - - // Return to the invoking page. - $url = Url::fromRoute('domain.admin', [], ['absolute' => TRUE]); - return new RedirectResponse($url->toString(), 302); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php b/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php deleted file mode 100644 index 71a855dd4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php +++ /dev/null @@ -1,58 +0,0 @@ -domainStorage = $domain_storage; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager')->getStorage('domain'), - $container->get('entity_type.manager') - ); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php deleted file mode 100644 index 2f8a2985c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php +++ /dev/null @@ -1,119 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->domainElementManager = $domain_element_manager; - $this->userStorage = $user_storage; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity_type.manager'), - $container->get('domain.element_manager'), - $container->get('entity_type.manager')->getStorage('user') - ); - } - - /** - * {@inheritdoc} - */ - public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account = NULL) { - $account = $this->prepareUser($account); - // Check the global permission. - if ($account->hasPermission('administer domains')) { - return AccessResult::allowed(); - } - // @TODO: This may not be relevant. - if ($operation == 'create' && $account->hasPermission('create domains')) { - return AccessResult::allowed(); - } - // For view, we allow admins unless the domain is inactive. - $is_admin = $this->isDomainAdmin($entity, $account); - if ($operation == 'view' && ($entity->status() || $account->hasPermission('access inactive domains')) && ($is_admin || $account->hasPermission('view domain list'))) { - return AccessResult::allowed(); - } - // For other operations, check that the user is a domain admin. - if ($operation == 'update' && $account->hasPermission('edit assigned domains') && $is_admin) { - return AccessResult::allowed(); - } - if ($operation == 'delete' && $account->hasPermission('delete assigned domains') && $is_admin) { - return AccessResult::allowed(); - } - return AccessResult::forbidden(); - } - - /** - * Checks if a user can administer a specific domain. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity to retrieve field data from. - * @param \Drupal\Core\Session\AccountInterface $account - * The user account. - * - * @return bool - * TRUE if a user can administer a specific domain, or FALSE. - */ - public function isDomainAdmin(EntityInterface $entity, AccountInterface $account) { - $user = $this->userStorage->load($account->id()); - $user_domains = $this->domainElementManager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - return isset($user_domains[$entity->id()]); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php deleted file mode 100644 index 94eb0ab2a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php +++ /dev/null @@ -1,81 +0,0 @@ -loader = $loader; - $this->negotiator = $negotiator; - } - - /** - * {@inheritdoc} - */ - public function createDomain(array $values = []) { - $default = $this->loader->loadDefaultId(); - $domains = $this->loader->loadMultiple(); - if (empty($values)) { - $values['hostname'] = $this->createHostname(); - $values['name'] = \Drupal::config('system.site')->get('name'); - } - $values += [ - 'scheme' => \Drupal::entityTypeManager()->getStorage('domain')->getDefaultScheme(), - 'status' => 1, - 'weight' => count($domains) + 1, - 'is_default' => (int) empty($default), - ]; - $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values); - - return $domain; - } - - /** - * {@inheritdoc} - */ - public function createHostname() { - return $this->negotiator->negotiateActiveHostname(); - } - - /** - * {@inheritdoc} - */ - public function createMachineName($hostname = NULL) { - if (empty($hostname)) { - $hostname = $this->createHostname(); - } - return preg_replace('/[^a-z0-9_]/', '_', $hostname); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php deleted file mode 100644 index b8da0e628..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php +++ /dev/null @@ -1,48 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->domainStorage = $entity_type_manager->getStorage('domain'); - } - - /** - * {@inheritdoc} - */ - public function setFormOptions(array $form, FormStateInterface $form_state, $field_name, $hide_on_disallow = FALSE) { - // There are cases, such as Entity Browser, where the form is partially - // invoked, but without our fields. - if (!isset($form[$field_name])) { - return $form; - } - $fields = $this->fieldList($field_name); - $empty = FALSE; - $disallowed = $this->disallowedOptions($form_state, $form[$field_name]); - if (empty($form[$field_name]['widget']['#options']) || - (count($form[$field_name]['widget']['#options']) == 1 && - isset($form[$field_name]['widget']['#options']['_none']) - ) - ) { - $empty = TRUE; - } - - // If the domain form element is set as a group, and the field is not - // assigned to another group, then move it. See - // domain_access_form_node_form_alter(). - if (isset($form['domain']) && !isset($form[$field_name]['#group'])) { - $form[$field_name]['#group'] = 'domain'; - } - // If no values and we should hide the element, do so. - if ($hide_on_disallow && $empty) { - $form[$field_name]['#access'] = FALSE; - } - // Check for domains the user cannot access or the absence of any options. - if (!empty($disallowed) || $empty) { - // @TODO: Potentially show this information to users with permission. - $form[$field_name . '_disallowed'] = [ - '#type' => 'value', - '#value' => $disallowed, - ]; - $form['domain_hidden_fields'] = [ - '#type' => 'value', - '#value' => $fields, - ]; - if ($hide_on_disallow || $empty) { - $form[$field_name]['#access'] = FALSE; - } - elseif (!empty($disallowed)) { - $form[$field_name]['widget']['#description'] .= $this->listDisallowed($disallowed); - } - // Call our submit function to merge in values. - // Account for all the submit buttons on the node form. - $buttons = ['preview', 'delete']; - $submit = $this->getSubmitHandler(); - foreach ($form['actions'] as $key => $action) { - if (!in_array($key, $buttons) && isset($form['actions'][$key]['#submit']) && !in_array($submit, $form['actions'][$key]['#submit'])) { - array_unshift($form['actions'][$key]['#submit'], $submit); - } - } - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public static function submitEntityForm(array &$form, FormStateInterface $form_state) { - $fields = $form_state->getValue('domain_hidden_fields'); - foreach ($fields as $field) { - $entity_values = []; - $values = $form_state->getValue($field . '_disallowed'); - if (!empty($values)) { - $info = $form_state->getBuildInfo(); - $node = $form_state->getFormObject()->getEntity(); - $entity_values = $form_state->getValue($field); - } - foreach ($values as $value) { - $entity_values[]['target_id'] = $value; - } - // Prevent a fatal error caused by passing a NULL value. - // See https://www.drupal.org/node/2841962. - if (!empty($entity_values)) { - $form_state->setValue($field, $entity_values); - } - } - } - - /** - * {@inheritdoc} - */ - public function disallowedOptions(FormStateInterface $form_state, array $field) { - $options = []; - $info = $form_state->getBuildInfo(); - $entity = $form_state->getFormObject()->getEntity(); - $entity_values = $this->getFieldValues($entity, $field['widget']['#field_name']); - if (isset($field['widget']['#options'])) { - $options = array_diff_key($entity_values, $field['widget']['#options']); - } - return array_keys($options); - } - - /** - * {@inheritdoc} - */ - public function fieldList($field_name) { - static $fields = []; - $fields[] = $field_name; - // Return only unique field names. AJAX requests can result in duplicates. - // See https://www.drupal.org/project/domain/issues/2930934. - return array_unique($fields); - } - - /** - * {@inheritdoc} - */ - public function getFieldValues(EntityInterface $entity, $field_name) { - // @TODO: static cache. - $list = []; - // @TODO In tests, $entity is returning NULL. - if (is_null($entity)) { - return $list; - } - // Get the values of an entity. - $values = $entity->hasField($field_name) ? $entity->get($field_name) : NULL; - // Must be at least one item. - if (!empty($values)) { - foreach ($values as $item) { - if ($target = $item->getValue()) { - if ($domain = $this->domainStorage->load($target['target_id'])) { - $list[$domain->id()] = $domain->getDomainId(); - } - } - } - } - return $list; - } - - /** - * {@inheritdoc} - */ - public function getSubmitHandler() { - return '\\Drupal\\domain\\DomainElementManager::submitEntityForm'; - } - - /** - * Lists the disallowed domains in the user interface. - * - * @param array $disallowed - * An array of domain ids. - * - * @return string - * A string suitable for display. - */ - public function listDisallowed(array $disallowed) { - $domains = $this->domainStorage->loadMultiple($disallowed); - $string = $this->t('The following domains are currently assigned and cannot be changed:'); - foreach ($domains as $domain) { - $items[] = $domain->label(); - } - $build = [ - '#theme' => 'item_list', - '#items' => $items, - ]; - $string .= render($build); - return '
' . $string . '
'; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php deleted file mode 100644 index 9c6832dc4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php +++ /dev/null @@ -1,105 +0,0 @@ -domainStorage = $domain_storage; - $this->renderer = $renderer; - $this->validator = $validator; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager')->getStorage('domain'), - $container->get('renderer'), - $container->get('domain.validator'), - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - /** @var \Drupal\domain\Entity\Domain $domain */ - $domain = $this->entity; - - // Create defaults if this is the first domain. - $count_existing = $this->domainStorage->getQuery()->count()->execute(); - if (!$count_existing) { - $domain->addProperty('hostname', $this->domainStorage->createHostname()); - $domain->addProperty('name', $this->config('system.site')->get('name')); - } - $form['domain_id'] = [ - '#type' => 'value', - '#value' => $domain->getDomainId(), - ]; - $form['hostname'] = [ - '#type' => 'textfield', - '#title' => $this->t('Hostname'), - '#size' => 40, - '#maxlength' => 80, - '#default_value' => $domain->getCanonical(), - '#description' => $this->t('The canonical hostname, using the full subdomain.example.com format. Leave off the http:// and the trailing slash and do not include any paths.
If this domain uses a custom http(s) port, you should specify it here, e.g.: subdomain.example.com:1234
The hostname may contain only lowercase alphanumeric characters, dots, dashes, and a colon (if using alternative ports).'), - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => !empty($domain->id()) ? $domain->id() : '', - '#disabled' => !empty($domain->id()), - '#machine_name' => [ - 'source' => ['hostname'], - 'exists' => [$this->domainStorage, 'load'], - ], - ]; - $form['name'] = [ - '#type' => 'textfield', - '#title' => $this->t('Name'), - '#size' => 40, - '#maxlength' => 80, - '#default_value' => $domain->label(), - '#description' => $this->t('The human-readable name is shown in domain lists and may be used as the title tag.'), - ]; - // Do not use the :// suffix when storing data. - $add_suffix = FALSE; - $form['scheme'] = [ - '#type' => 'radios', - '#title' => $this->t('Domain URL scheme'), - '#options' => [ - 'http' => 'http://', - 'https' => 'https://', - 'variable' => 'Variable', - ], - '#default_value' => $domain->getRawScheme(), - '#description' => $this->t('This URL scheme will be used when writing links and redirects to this domain and its resources. Selecting Variable will inherit the current scheme of the web request.'), - ]; - $form['status'] = [ - '#type' => 'radios', - '#title' => $this->t('Domain status'), - '#options' => [1 => $this->t('Active'), 0 => $this->t('Inactive')], - '#default_value' => (int) $domain->status(), - '#description' => $this->t('"Inactive" domains are only accessible to user roles with that assigned permission.'), - ]; - $form['weight'] = [ - '#type' => 'weight', - '#title' => $this->t('Weight'), - '#delta' => $count_existing + 1, - '#default_value' => $domain->getWeight(), - '#description' => $this->t('The sort order for this record. Lower values display first.'), - ]; - $form['is_default'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Default domain'), - '#default_value' => $domain->isDefault(), - '#description' => $this->t('If a URL request fails to match a domain record, the settings for this domain will be used. Only one domain can be default.'), - ]; - $form['validate_url'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Test server response'), - '#default_value' => TRUE, - '#description' => $this->t('Validate that url of the host is accessible to Drupal before saving.'), - ]; - $required = $this->validator->getRequiredFields(); - foreach ($form as $key => $element) { - if (in_array($key, $required)) { - $form[$key]['#required'] = TRUE; - } - } - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\domain\DomainInterface $entity */ - $entity = $this->entity; - $hostname = $entity->getHostname(); - $errors = $this->validator->validate($hostname); - if (!empty($errors)) { - // Render errors to display as message. - $message = [ - '#theme' => 'item_list', - '#items' => $errors, - ]; - $message = $this->renderer->renderPlain($message); - $form_state->setErrorByName('hostname', $message); - } - // Validate if the same hostname exists. - // Do not use domain loader because it may change hostname. - $existing = $this->domainStorage->loadByProperties(['hostname' => $hostname]); - $existing = reset($existing); - // If we have already registered a hostname, make sure we don't create a - // duplicate. - // We cannot check id() here, as the machine name is editable. - if ($existing && $existing->getDomainId() != $entity->getDomainId()) { - $form_state->setErrorByName('hostname', $this->t('The hostname is already registered.')); - } - - // Check the domain response. First, clear the path value. - $entity->setPath(); - // Check the response. - $response = $this->validator->checkResponse($entity); - // If validate_url is set, then we must receive a 200 response. - if ($entity->validate_url && $response != 200) { - if (empty($response)) { - $response = 500; - } - $form_state->setErrorByName('hostname', $this->t('The server request to @url returned a @response response. To proceed, disable the Test server response in the form.', ['@url' => $entity->getPath(), '@response' => $response])); - } - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $status = parent::save($form, $form_state); - if ($status == SAVED_NEW) { - \Drupal::messenger()->addMessage($this->t('Domain record created.')); - } - else { - \Drupal::messenger()->addMessage($this->t('Domain record updated.')); - } - $form_state->setRedirect('domain.admin'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php deleted file mode 100644 index ce963d803..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php +++ /dev/null @@ -1,239 +0,0 @@ -get('entity_type.manager')->getStorage($entity_type->id()), - $container->get('current_user'), - $container->get('redirect.destination'), - $container->get('entity_type.manager'), - $container->get('module_handler'), - $container->get('domain.element_manager') - ); - } - - /** - * Constructs a new DomainListBuilder object. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type definition. - * @param \Drupal\domain\DomainStorageInterface $domain_storage - * The domain storage class. - * @param \Drupal\Core\Session\AccountInterface $account - * The active user account. - * @param \Drupal\Core\Routing\RedirectDestinationInterface $destination_handler - * The redirect destination helper. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager. - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler. - * @param \Drupal\domain\DomainElementManagerInterface $domain_element_manager - * The domain field element manager. - */ - public function __construct(EntityTypeInterface $entity_type, DomainStorageInterface $domain_storage, AccountInterface $account, RedirectDestinationInterface $destination_handler, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, DomainElementManagerInterface $domain_element_manager) { - parent::__construct($entity_type, $domain_storage); - $this->entityTypeId = $entity_type->id(); - $this->domainStorage = $domain_storage; - $this->entityType = $entity_type; - $this->currentUser = $account; - $this->destinationHandler = $destination_handler; - $this->entityTypeManager = $entity_type_manager; - $this->accessHandler = $this->entityTypeManager->getAccessControlHandler('domain'); - $this->moduleHandler = $module_handler; - $this->domainElementManager = $domain_element_manager; - $this->userStorage = $this->entityTypeManager->getStorage('user'); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'domain_admin_overview_form'; - } - - /** - * {@inheritdoc} - */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - $destination = $this->destinationHandler->getAsArray(); - $default = $entity->isDefault(); - $id = $entity->id(); - - // If the user cannot edit domains, none of these actions are permitted. - $access = $this->accessHandler->checkAccess($entity, 'update'); - if ($access->isForbidden()) { - return $operations; - } - - $super_admin = $this->currentUser->hasPermission('administer domains'); - if ($super_admin || $this->currentUser->hasPermission('access inactive domains')) { - if ($entity->status() && !$default) { - $operations['disable'] = [ - 'title' => $this->t('Disable'), - 'url' => Url::fromRoute('domain.inline_action', ['op' => 'disable', 'domain' => $id]), - 'weight' => 50, - ]; - } - elseif (!$default) { - $operations['enable'] = [ - 'title' => $this->t('Enable'), - 'url' => Url::fromRoute('domain.inline_action', ['op' => 'enable', 'domain' => $id]), - 'weight' => 40, - ]; - } - } - if (!$default && $super_admin) { - $operations['default'] = [ - 'title' => $this->t('Make default'), - 'url' => Url::fromRoute('domain.inline_action', ['op' => 'default', 'domain' => $id]), - 'weight' => 30, - ]; - } - if (!$default && $this->accessHandler->checkAccess($entity, 'delete')->isAllowed()) { - $operations['delete'] = [ - 'title' => $this->t('Delete'), - 'url' => Url::fromRoute('entity.domain.delete_form', ['domain' => $id]), - 'weight' => 20, - ]; - } - $operations += $this->moduleHandler->invokeAll('domain_operations', [$entity, $this->currentUser]); - foreach ($operations as $key => $value) { - if (isset($value['query']['token'])) { - $operations[$key]['query'] += $destination; - } - } - /** @var DomainInterface $default */ - $default = $this->domainStorage->loadDefaultDomain(); - - // Deleting the site default domain is not allowed. - if ($default && $id == $default->id()) { - unset($operations['delete']); - } - return $operations; - } - - /** - * {@inheritdoc} - */ - public function buildHeader() { - $header['label'] = $this->t('Name'); - $header['hostname'] = $this->t('Hostname'); - $header['status'] = $this->t('Status'); - $header['is_default'] = $this->t('Default'); - $header += parent::buildHeader(); - if (!$this->currentUser->hasPermission('administer domains')) { - unset($header['weight']); - } - return $header; - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - // If the user cannot view the domain, none of these actions are permitted. - $admin = $this->accessHandler->checkAccess($entity, 'view'); - if ($admin->isForbidden()) { - return; - } - - $row['label'] = $this->getLabel($entity); - $row['hostname'] = ['#markup' => $entity->getLink()]; - if ($entity->isActive()) { - $row['hostname']['#prefix'] = ''; - $row['hostname']['#suffix'] = ''; - } - $row['status'] = ['#markup' => $entity->status() ? $this->t('Active') : $this->t('Inactive')]; - $row['is_default'] = ['#markup' => ($entity->isDefault() ? $this->t('Yes') : $this->t('No'))]; - $row += parent::buildRow($entity); - - if (!$this->currentUser->hasPermission('administer domains')) { - unset($row['weight']); - } - - return $row; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = parent::buildForm($form, $form_state); - $form[$this->entitiesKey]['#domains'] = $this->entities; - $form['actions']['submit']['#value'] = $this->t('Save configuration'); - // Only super-admins may sort domains. - if (!$this->currentUser->hasPermission('administer domains')) { - $form['actions']['submit']['#access'] = FALSE; - unset($form['#tabledrag']); - } - // Delta is set after each row is loaded. - $count = count($this->domainStorage->loadMultiple()) + 1; - foreach (Element::children($form['domains']) as $key) { - if (isset($form['domains'][$key]['weight'])) { - $form['domains'][$key]['weight']['#delta'] = $count; - } - } - return $form; - } - - /** - * {@inheritdoc} - * - * Overrides the parent method to prevent saving bad data. - * - * @link https://www.drupal.org/project/domain/issues/2925798 - * @link https://www.drupal.org/project/domain/issues/2925629 - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - foreach ($form_state->getValue($this->entitiesKey) as $id => $value) { - if (isset($this->entities[$id]) && $this->entities[$id]->get($this->weightKey) != $value['weight']) { - // Reset weight properly. - $this->entities[$id]->set($this->weightKey, $value['weight']); - // Do not allow accidental hostname rewrites. - $this->entities[$id]->set('hostname', $this->entities[$id]->getCanonical()); - $this->entities[$id]->save(); - } - } - } - - /** - * Internal sort method for form weights. - */ - private function sortByWeight($a, $b) { - if ($a['weight'] < $b['weight']) { - return 0; - } - return 1; - } - - /** - * {@inheritdoc} - * - * Builds the entity listing as a form with pagination. This method overrides - * both Drupal\Core\Config\Entity\DraggableListBuilder::render() and - * Drupal\Core\Entity\EntityListBuilder::render(). - */ - public function render() { - // Build the default form, which includes weights. - $form = $this->formBuilder()->getForm($this); - - // Only add the pager if a limit is specified. - if ($this->limit) { - $form['pager'] = [ - '#type' => 'pager', - ]; - } - return $form; - } - - /** - * {@inheritdoc} - * - * Loads entity IDs using a pager sorted by the entity weight. The default - * behavior when using a limit is to sort by id. - * - * We also have to limit by assigned domains of the active user. - * - * See Drupal\Core\Entity\EntityListBuilder::getEntityIds() - * - * @return array - * An array of entity IDs. - */ - protected function getEntityIds() { - $query = $this->getStorage()->getQuery() - ->sort($this->entityType->getKey('weight')); - - // If the user cannot administer domains, we must filter the query further - // by assigned IDs. We don't have to check permissions here, because that is - // handled by the route system and buildRow(). There are two permissions - // that allow users to view the entire list. - if (!$this->currentUser->hasPermission('administer domains') && !$this->currentUser->hasPermission('view domain list')) { - $user = $this->userStorage->load($this->currentUser->id()); - $allowed = $this->domainElementManager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - $query->condition('id', array_keys($allowed), 'IN'); - } - - // Only add the pager if a limit is specified. - if ($this->limit) { - $query->pager($this->limit); - } - return $query->execute(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php deleted file mode 100644 index 1372779a3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php +++ /dev/null @@ -1,163 +0,0 @@ -typedConfig = $typed_config; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function loadSchema() { - $fields = $this->typedConfig->getDefinition('domain.record.*'); - return isset($fields['mapping']) ? $fields['mapping'] : []; - } - - /** - * {@inheritdoc} - */ - public function load($id, $reset = FALSE) { - $controller = $this->getStorage(); - if ($reset) { - $controller->resetCache([$id]); - } - return $controller->load($id); - } - - /** - * {@inheritdoc} - */ - public function loadDefaultId() { - $result = $this->loadDefaultDomain(); - if (!empty($result)) { - return $result->id(); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function loadDefaultDomain() { - $result = $this->getStorage()->loadByProperties(['is_default' => TRUE]); - if (!empty($result)) { - return current($result); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $ids = NULL, $reset = FALSE) { - $controller = $this->getStorage(); - if ($reset) { - $controller->resetCache($ids); - } - return $controller->loadMultiple($ids); - } - - /** - * {@inheritdoc} - */ - public function loadMultipleSorted(array $ids = NULL) { - $domains = $this->loadMultiple($ids); - uasort($domains, [$this, 'sort']); - return $domains; - } - - /** - * {@inheritdoc} - */ - public function loadByHostname($hostname) { - $hostname = $this->prepareHostname($hostname); - $result = $this->getStorage()->loadByProperties(['hostname' => $hostname]); - if (empty($result)) { - return NULL; - } - return current($result); - } - - /** - * {@inheritdoc} - */ - public function loadOptionsList() { - $list = []; - foreach ($this->loadMultipleSorted() as $id => $domain) { - $list[$id] = $domain->label(); - } - return $list; - } - - /** - * {@inheritdoc} - */ - public function sort(DomainInterface $a, DomainInterface $b) { - return $a->getWeight() > $b->getWeight(); - } - - /** - * Loads the storage controller. - * - * We use the loader very early in the request cycle. As a result, if we try - * to inject the storage container, we hit a circular dependency. Using this - * method at least keeps our code easier to update. - */ - protected function getStorage() { - $storage = \Drupal::entityTypeManager()->getStorage('domain'); - return $storage; - } - - /** - * {@inheritdoc} - */ - public function prepareHostname($hostname) { - // Strip www. prefix off the hostname. - $ignore_www = $this->configFactory->get('domain.settings')->get('www_prefix'); - if ($ignore_www && substr($hostname, 0, 4) == 'www.') { - $hostname = substr($hostname, 4); - } - return $hostname; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php deleted file mode 100644 index 7f124363c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php +++ /dev/null @@ -1,119 +0,0 @@ - label for use in forms. - */ - public function loadOptionsList(); - - /** - * Sorts domains by weight. - * - * For use by loadMultipleSorted(). - * - * @param DomainInterface $a - * The first Domain object to sort. - * @param DomainInterface $b - * The Domain object to compare against. - * - * @return bool - * Wether the first domain weight is greater or not. - */ - public function sort(DomainInterface $a, DomainInterface $b); - - /** - * Gets the entity field schema for domain records. - * - * @return array - * An array representing the field schema of the object. - */ - public function loadSchema(); - - /** - * Removes www. prefix from a hostname, if set. - * - * @param string $hostname - * A hostname. - * - * @return string - * The cleaned hostname. - */ - public function prepareHostname($hostname); - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php deleted file mode 100644 index ef68f7c5f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php +++ /dev/null @@ -1,231 +0,0 @@ -requestStack = $requestStack; - $this->moduleHandler = $module_handler; - $this->entityTypeManager = $entity_type_manager; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function setRequestDomain($httpHost, $reset = FALSE) { - // @TODO: Investigate caching methods. - $this->setHttpHost($httpHost); - // Try to load a direct match. - if ($domain = $this->domainStorage()->loadByHostname($httpHost)) { - // If the load worked, set an exact match flag for the hook. - $domain->setMatchType(self::DOMAIN_MATCH_EXACT); - } - // If a straight load fails, create a base domain for checking. This data - // is required for hook_domain_request_alter(). - else { - $values = ['hostname' => $httpHost]; - /** @var \Drupal\domain\DomainInterface $domain */ - $domain = $this->domainStorage()->create($values); - $domain->setMatchType(self::DOMAIN_MATCH_NONE); - } - - // Now check with modules (like Domain Alias) that register alternate - // lookup systems with the main module. - $this->moduleHandler->alter('domain_request', $domain); - - // We must have registered a valid id, else the request made no match. - if (!empty($domain->id())) { - $this->setActiveDomain($domain); - } - // Fallback to default domain if no match. - elseif ($domain = $this->domainStorage()->loadDefaultDomain()) { - $this->moduleHandler->alter('domain_request', $domain); - $domain->setMatchType(self::DOMAIN_MATCH_NONE); - if (!empty($domain->id())) { - $this->setActiveDomain($domain); - } - } - } - - /** - * {@inheritdoc} - */ - public function setActiveDomain(DomainInterface $domain) { - // @TODO: caching - $this->domain = $domain; - } - - /** - * Determine the active domain. - */ - protected function negotiateActiveDomain() { - $httpHost = $this->negotiateActiveHostname(); - $this->setRequestDomain($httpHost); - return $this->domain; - } - - /** - * {@inheritdoc} - */ - public function getActiveDomain($reset = FALSE) { - if ($reset) { - $this->negotiateActiveDomain(); - } - return $this->domain; - } - - /** - * {@inheritdoc} - */ - public function getActiveId() { - return $this->domain->id(); - } - - /** - * {@inheritdoc} - */ - public function negotiateActiveHostname() { - if ($request = $this->requestStack->getCurrentRequest()) { - $httpHost = $request->getHttpHost(); - } - else { - $httpHost = $_SERVER['HTTP_HOST']; - } - $hostname = !empty($httpHost) ? $httpHost : 'localhost'; - return $this->domainStorage()->prepareHostname($hostname); - } - - /** - * {@inheritdoc} - */ - public function setHttpHost($httpHost) { - $this->httpHost = $httpHost; - } - - /** - * {@inheritdoc} - */ - public function getHttpHost() { - return $this->httpHost; - } - - /** - * {@inheritdoc} - */ - public function isRegisteredDomain($hostname) { - // Direct hostname match always passes. - if ($domain = $this->domainStorage()->loadByHostname($hostname)) { - return TRUE; - } - // Check for registered alias matches. - $values = ['hostname' => $hostname]; - /** @var \Drupal\domain\DomainInterface $domain */ - $domain = $this->domainStorage()->create($values); - $domain->setMatchType(self::DOMAIN_MATCH_NONE); - - // Now check with modules (like Domain Alias) that register alternate - // lookup systems with the main module. - $this->moduleHandler->alter('domain_request', $domain); - - // We must have registered a valid id, else the request made no match. - if (!empty($domain->id())) { - return TRUE; - } - return FALSE; - } - - /** - * Retrieves the domain storage handler. - * - * @return \Drupal\domain\DomainStorageInterface - * The domain storage handler. - */ - protected function domainStorage() { - if (!$this->domainStorage) { - $this->domainStorage = $this->entityTypeManager->getStorage('domain'); - } - return $this->domainStorage; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php deleted file mode 100644 index 6dbfb3d5b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php +++ /dev/null @@ -1,93 +0,0 @@ -getRequestContext()->getCompleteBaseUrl(); - return !UrlHelper::isExternal($url) || UrlHelper::externalIsLocal($url, $base_url) || $this->externalIsRegistered($url, $base_url); - } - - /** - * {@inheritdoc} - */ - protected function isSafe($url) { - return $this->isLocal($url); - } - - /** - * Returns the request context. - * - * @return \Drupal\Core\Routing\RequestContext - * The request context. - */ - protected function getRequestContext() { - if (!isset($this->requestContext)) { - $this->requestContext = \Drupal::service('router.request_context'); - } - return $this->requestContext; - } - - /** - * Sets the request context. - * - * @param \Drupal\Core\Routing\RequestContext $request_context - * The request context. - * - * @return $this - */ - public function setRequestContext(RequestContext $request_context) { - $this->requestContext = $request_context; - - return $this; - } - - /** - * Determines if an external URL points to this domain-aware installation. - * - * This method replaces the logic in - * Drupal\Component\Utility\UrlHelper::externalIsLocal(). Since that class is - * not directly extendable, we have to replace it. - * - * @param string $url - * A string containing an external URL, such as "http://example.com/foo". - * @param string $base_url - * The base URL string to check against, such as "http://example.com/". - * - * @return bool - * TRUE if the URL has the same domain and base path. - * - * @throws \InvalidArgumentException - * Exception thrown when $url is not fully qualified. - */ - public static function externalIsRegistered($url, $base_url) { - $url_parts = parse_url($url); - $base_parts = parse_url($base_url); - - if (empty($url_parts['host'])) { - throw new \InvalidArgumentException('A path was passed when a fully qualified domain was expected.'); - } - - // Check that the host name is registered with trusted hosts. - $trusted = self::checkTrustedHost($url_parts['host']); - if (!$trusted) { - return FALSE; - } - - // Check that the requested $url is registered. - $negotiator = \Drupal::service('domain.negotiator'); - $registered_domain = $negotiator->isRegisteredDomain($url_parts['host']); - - if (!isset($url_parts['path']) || !isset($base_parts['path'])) { - return $registered_domain; - } - else { - // When comparing base paths, we need a trailing slash to make sure a - // partial URL match isn't occurring. Since base_path() always returns - // with a trailing slash, we don't need to add the trailing slash here. - return ($registered_domain && stripos($url_parts['path'], $base_parts['path']) === 0); - } - } - - /** - * Checks that a host is registered with trusted_host_patterns. - * - * This method is cribbed from Symfony's Request::getHost() method. - * - * @param string $host - * The hostname to check. - * - * @return bool - * TRUE if the hostname matches the trusted_host_patterns. FALSE otherwise. - * It is the caller's responsibility to deal with this result securely. - */ - public static function checkTrustedHost($host) { - // See Request::setTrustedHosts(); - if (!isset(self::$trustedHostPatterns)) { - self::$trustedHostPatterns = array_map(function ($hostPattern) { - return sprintf('#%s#i', $hostPattern); - }, Settings::get('trusted_host_patterns', [])); - // Reset the trusted host match array. - self::$trustedHosts = []; - } - - // Trim and remove port number from host. Host is lowercase as per RFC - // 952/2181. - $host = mb_strtolower(preg_replace('/:\d+$/', '', trim($host))); - - // In the original Symfony code, hostname validation runs here. We have - // removed that portion because Domains are already validated on creation. - if (count(self::$trustedHostPatterns) > 0) { - // To avoid host header injection attacks, you should provide a list of - // trusted host patterns. - if (in_array($host, self::$trustedHosts)) { - return TRUE; - } - foreach (self::$trustedHostPatterns as $pattern) { - if (preg_match($pattern, $host)) { - self::$trustedHosts[] = $host; - return TRUE; - } - } - return FALSE; - } - // In cases where trusted_host_patterns are not set, allow all. This is - // flagged as a security issue by Drupal core in the Reports UI. - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php deleted file mode 100644 index d2b28e26f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php +++ /dev/null @@ -1,202 +0,0 @@ -configFactory = $config_factory; - $this->uuidService = $uuid_service; - $this->languageManager = $language_manager; - $this->typedConfig = $typed_config; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('config.factory'), - $container->get('uuid'), - $container->get('language_manager'), - $container->get('config.typed') - ); - } - - /** - * {@inheritdoc} - */ - public function loadSchema() { - $fields = $this->typedConfig->getDefinition('domain.record.*'); - return isset($fields['mapping']) ? $fields['mapping'] : []; - } - - /** - * {@inheritdoc} - */ - public function loadDefaultId() { - $result = $this->loadDefaultDomain(); - if (!empty($result)) { - return $result->id(); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function loadDefaultDomain() { - $result = $this->loadByProperties(['is_default' => TRUE]); - if (!empty($result)) { - return current($result); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function loadMultipleSorted(array $ids = NULL) { - $domains = $this->loadMultiple($ids); - uasort($domains, [$this, 'sort']); - return $domains; - } - - /** - * {@inheritdoc} - */ - public function loadByHostname($hostname) { - $hostname = $this->prepareHostname($hostname); - $result = $this->loadByProperties(['hostname' => $hostname]); - if (empty($result)) { - return NULL; - } - return current($result); - } - - /** - * {@inheritdoc} - */ - public function loadOptionsList() { - $list = []; - foreach ($this->loadMultipleSorted() as $id => $domain) { - $list[$id] = $domain->label(); - } - return $list; - } - - /** - * {@inheritdoc} - */ - public function sort(DomainInterface $a, DomainInterface $b) { - return $a->getWeight() > $b->getWeight(); - } - - /** - * {@inheritdoc} - */ - public function prepareHostname($hostname) { - // Strip www. prefix off the hostname. - $ignore_www = $this->configFactory->get('domain.settings')->get('www_prefix'); - if ($ignore_www && substr($hostname, 0, 4) == 'www.') { - $hostname = substr($hostname, 4); - } - return $hostname; - } - - /** - * {@inheritdoc} - */ - public function create(array $values = []) { - $default = $this->loadDefaultId(); - $domains = $this->loadMultiple(); - if (empty($values)) { - $values['hostname'] = $this->createHostname(); - $values['name'] = \Drupal::config('system.site')->get('name'); - } - $values += [ - 'scheme' => $this->getDefaultScheme(), - 'status' => 1, - 'weight' => count($domains) + 1, - 'is_default' => (int) empty($default), - ]; - $domain = parent::create($values); - - return $domain; - } - - /** - * {@inheritdoc} - */ - public function createHostname() { - // We cannot inject the negotiator due to dependencies. - return \Drupal::service('domain.negotiator')->negotiateActiveHostname(); - } - - /** - * {@inheritdoc} - */ - public function createMachineName($hostname = NULL) { - if (empty($hostname)) { - $hostname = $this->createHostname(); - } - return preg_replace('/[^a-z0-9_]/', '_', $hostname); - } - - /** - * {@inheritdoc} - */ - public function getDefaultScheme() { - // Use the foundation request if possible. - $request = \Drupal::request(); - if (!empty($request)) { - $scheme = $request->getScheme(); - } - // Else use the server variable. - elseif (!empty($_SERVER['https'])) { - $scheme = 'https'; - } - // Else fall through to default. - else { - $scheme = 'http'; - } - return $scheme; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php deleted file mode 100644 index 115a6c225..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php +++ /dev/null @@ -1,124 +0,0 @@ - label for use in forms. - */ - public function loadOptionsList(); - - /** - * Sorts domains by weight. - * - * For use by loadMultipleSorted(). - * - * @param DomainInterface $a - * The first Domain object to sort. - * @param DomainInterface $b - * The Domain object to compare against. - * - * @return bool - * Wether the first domain weight is greater or not. - */ - public function sort(DomainInterface $a, DomainInterface $b); - - /** - * Gets the entity field schema for domain records. - * - * @return array - * An array representing the field schema of the object. - */ - public function loadSchema(); - - /** - * Removes www. prefix from a hostname, if set. - * - * @param string $hostname - * A hostname. - * - * @return string - * The cleaned hostname. - */ - public function prepareHostname($hostname); - - /** - * Gets the hostname of the active request. - * - * @return string - * The hostname string of the current request. - */ - public function createHostname(); - - /** - * Creates a machine-name string from the hostname. - * - * This string is the primary key of the entity. - * - * @param string $hostname - * The hostname of the domain record. If empty, the current request will be - * used. - * - * @return string - * A string containing A-Z, a-z, 0-9, and _ characters. - */ - public function createMachineName($hostname = NULL); - - /** - * Returns the default http/https scheme for the site. - * - * This function helps us account for variable schemes across environments. - * - * @return string - * A string representation of s scheme (http|https). - */ - public function getDefaultScheme(); - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php deleted file mode 100644 index f6c217460..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php +++ /dev/null @@ -1,186 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->domainStorage = $this->entityTypeManager->getStorage('domain'); - $this->negotiator = $negotiator; - } - - /** - * Implements hook_token_info(). - */ - public function getTokenInfo() { - // Domain token types. - $info['types']['domain'] = [ - 'name' => $this->t('Domains'), - 'description' => $this->t('Tokens related to domains.'), - 'needs-data' => 'domain', - ]; - // These two types require the Token contrib module. - $info['types']['current-domain'] = [ - 'name' => $this->t('Current domain'), - 'description' => $this->t('Tokens related to the current domain.'), - 'type' => 'domain', - ]; - $info['types']['default-domain'] = [ - 'name' => $this->t('Default domain'), - 'description' => $this->t('Tokens related to the default domain.'), - 'type' => 'domain', - ]; - - // Domain tokens. - $info['tokens']['domain']['id'] = [ - 'name' => $this->t('Domain id'), - 'description' => $this->t("The domain's numeric ID."), - ]; - $info['tokens']['domain']['machine-name'] = [ - 'name' => $this->t('Domain machine name'), - 'description' => $this->t('The domain machine identifier.'), - ]; - $info['tokens']['domain']['path'] = [ - 'name' => $this->t('Domain path'), - 'description' => $this->t('The base URL for the domain.'), - ]; - $info['tokens']['domain']['name'] = [ - 'name' => $this->t('Domain name'), - 'description' => $this->t('The domain name.'), - ]; - $info['tokens']['domain']['url'] = [ - 'name' => $this->t('Domain URL'), - 'description' => $this->t("The domain's URL for the current page request."), - ]; - $info['tokens']['domain']['hostname'] = [ - 'name' => $this->t('Domain hostname'), - 'description' => $this->t('The domain hostname.'), - ]; - $info['tokens']['domain']['scheme'] = [ - 'name' => $this->t('Domain scheme'), - 'description' => $this->t('The domain scheme.'), - ]; - $info['tokens']['domain']['status'] = [ - 'name' => $this->t('Domain status'), - 'description' => $this->t('The domain status.'), - ]; - $info['tokens']['domain']['weight'] = [ - 'name' => $this->t('Domain weight'), - 'description' => $this->t('The domain weight.'), - ]; - $info['tokens']['domain']['is_default'] = [ - 'name' => $this->t('Domain default'), - 'description' => $this->t('The domain is the default domain.'), - ]; - - return $info; - } - - /** - * Implements hook_tokens(). - */ - public function getTokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { - $replacements = []; - - $domain = NULL; - - // Based on the type, get the proper domain context. - switch ($type) { - case 'domain': - if (!empty($data['domain'])) { - $domain = $data['domain']; - } - else { - $domain = $this->negotiator->getActiveDomain(); - } - break; - - case 'current-domain': - $domain = $this->negotiator->getActiveDomain(); - break; - - case 'default-domain': - $domain = $this->domainStorage->loadDefaultDomain(); - break; - } - - // Set the token information. - if (!empty($domain)) { - $callbacks = $this->getCallbacks(); - foreach ($tokens as $name => $original) { - if (isset($callbacks[$name])) { - $replacements[$original] = $domain->{$callbacks[$name]}(); - $bubbleable_metadata->addCacheableDependency($domain); - } - } - } - - return $replacements; - } - - /** - * Maps tokens to their entity callbacks. - * - * We assume that the token will call an instance of DomainInterface. - * - * @return array - * An array of callbacks keyed by the token string. - */ - public function getCallbacks() { - return [ - 'id' => 'getDomainId', - 'machine-name' => 'id', - 'path' => 'getPath', - 'name' => 'label', - 'hostname' => 'getHostname', - 'scheme' => 'getScheme', - 'status' => 'status', - 'weight' => 'getWeight', - 'is_default' => 'isDefault', - 'url' => 'getUrl', - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php deleted file mode 100644 index 5d68100af..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php +++ /dev/null @@ -1,152 +0,0 @@ -moduleHandler = $module_handler; - $this->configFactory = $config_factory; - $this->httpClient = $http_client; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public function validate($hostname) { - $error_list = []; - // Check for at least one dot or the use of 'localhost'. - // Note that localhost can specify a port. - $localhost_check = explode(':', $hostname); - if (substr_count($hostname, '.') == 0 && $localhost_check[0] != 'localhost') { - $error_list[] = $this->t('At least one dot (.) is required, except when using localhost.'); - } - // Check for one colon only. - if (substr_count($hostname, ':') > 1) { - $error_list[] = $this->t('Only one colon (:) is allowed.'); - } - // If a colon, make sure it is only followed by numbers. - elseif (substr_count($hostname, ':') == 1) { - $parts = explode(':', $hostname); - $port = (int) $parts[1]; - if (strcmp($port, $parts[1])) { - $error_list[] = $this->t('The port protocol must be an integer.'); - } - } - // The domain cannot begin or end with a period. - if (substr($hostname, 0, 1) == '.') { - $error_list[] = $this->t('The domain must not begin with a dot (.)'); - } - // The domain cannot begin or end with a period. - if (substr($hostname, -1) == '.') { - $error_list[] = $this->t('The domain must not end with a dot (.)'); - } - // Check for valid characters, unless using non-ASCII domains. - $config = $this->configFactory->get('domain.settings'); - $non_ascii = $config->get('allow_non_ascii'); - if (!$non_ascii) { - $pattern = '/^[a-z0-9\.\-:]*$/i'; - if (!preg_match($pattern, $hostname)) { - $error_list[] = $this->t('Only alphanumeric characters, dashes, and a colon are allowed.'); - } - } - // Check for lower case. - if ($hostname != mb_strtolower($hostname)) { - $error_list[] = $this->t('Only lower-case characters are allowed.'); - } - // Check for 'www' prefix if redirection / handling is - // enabled under global domain settings. - // Note that www prefix handling must be set explicitly in the UI. - // See http://drupal.org/node/1529316 and http://drupal.org/node/1783042 - if ($config->get('www_prefix') && (substr($hostname, 0, strpos($hostname, '.')) == 'www')) { - $error_list[] = $this->t('WWW prefix handling: Domains must be registered without the www. prefix.'); - } - - // Allow modules to alter this behavior. - $this->moduleHandler->alter('domain_validate', $error_list, $hostname); - - return $error_list; - } - - /** - * {@inheritdoc} - */ - public function checkResponse(DomainInterface $domain) { - $url = $domain->getPath() . drupal_get_path('module', 'domain') . '/tests/200.png'; - try { - // GuzzleHttp no longer allows for bogus URL calls. - $request = $this->httpClient->get($url); - } - // We cannot know which Guzzle Exception class will be returned; be generic. - catch (RequestException $e) { - // File a general server failure. - $domain->setResponse(500); - return $domain->getResponse(); - } - // Expected result (i.e. no exception thrown.) - $domain->setResponse($request->getStatusCode()); - - return $domain->getResponse(); - } - - /** - * {@inheritdoc} - */ - public function getRequiredFields() { - return ['hostname', 'name', 'scheme', 'status', 'weight']; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php deleted file mode 100644 index b1c349c20..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php +++ /dev/null @@ -1,45 +0,0 @@ -getStorage('domain'); - $default = $domain_storage->loadDefaultId(); - $count = $storage_controller->getQuery()->count()->execute(); - $values += [ - 'scheme' => empty($GLOBALS['is_https']) ? 'http' : 'https', - 'status' => 1, - 'weight' => $count + 1, - 'is_default' => (int) empty($default), - ]; - // Note that we have not created a domain_id, which is only used for - // node access control and will be added on save. - } - - /** - * {@inheritdoc} - */ - public function isActive() { - $negotiator = \Drupal::service('domain.negotiator'); - /** @var self $domain */ - $domain = $negotiator->getActiveDomain(); - if (empty($domain)) { - return FALSE; - } - return ($this->id() == $domain->id()); - } - - /** - * {@inheritdoc} - */ - public function addProperty($name, $value) { - if (!isset($this->{$name})) { - $this->{$name} = $value; - } - } - - /** - * {@inheritdoc} - */ - public function isDefault() { - return (bool) $this->is_default; - } - - /** - * {@inheritdoc} - */ - public function isHttps() { - return (bool) ($this->getScheme(FALSE) == 'https'); - } - - /** - * {@inheritdoc} - */ - public function saveDefault() { - if (!$this->isDefault()) { - // Swap the current default. - /** @var self $default */ - if ($default = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain()) { - $default->is_default = FALSE; - $default->setHostname($default->getCanonical()); - $default->save(); - } - // Save the new default. - $this->is_default = TRUE; - $this->setHostname($this->getCanonical()); - $this->save(); - } - else { - \Drupal::messenger()->addMessage($this->t('The selected domain is already the default.'), 'warning'); - } - } - - /** - * {@inheritdoc} - */ - public function enable() { - $this->setStatus(TRUE); - $this->setHostname($this->getCanonical()); - $this->save(); - } - - /** - * {@inheritdoc} - */ - public function disable() { - if (!$this->isDefault()) { - $this->setStatus(FALSE); - $this->setHostname($this->getCanonical()); - $this->save(); - } - else { - \Drupal::messenger()->addMessage($this->t('The default domain cannot be disabled.'), 'warning'); - } - } - - /** - * {@inheritdoc} - */ - public function saveProperty($name, $value) { - if (isset($this->{$name})) { - $this->{$name} = $value; - $this->setHostname($this->getCanonical()); - $this->save(); - \Drupal::messenger()->addMessage($this->t('The @key attribute was set to @value for domain @hostname.', [ - '@key' => $name, - '@value' => $value, - '@hostname' => $this->hostname, - ])); - } - else { - \Drupal::messenger()->addMessage($this->t('The @key attribute does not exist.', ['@key' => $name])); - } - } - - /** - * {@inheritdoc} - */ - public function setPath() { - global $base_path; - $this->path = $this->getScheme() . $this->getHostname() . ($base_path ?: '/'); - } - - /** - * {@inheritdoc} - */ - public function setUrl() { - $request = \Drupal::request(); - $uri = $request ? $request->getRequestUri() : '/'; - $this->url = $this->getScheme() . $this->getHostname() . $uri; - } - - /** - * {@inheritdoc} - */ - public function getPath() { - if (!isset($this->path)) { - $this->setPath(); - } - return $this->path; - } - - /** - * Returns the raw path of the domain object, without the base url. - */ - public function getRawPath() { - return $this->getScheme() . $this->getHostname(); - } - - /** - * Builds a link from a known internal path. - * - * @param string $path - * A Drupal-formatted internal path, starting with /. Note that it is the - * caller's responsibility to handle the base_path(). - * - * @return string - * The built link. - */ - public function buildUrl($path) { - return $this->getRawPath() . $path; - } - - /** - * {@inheritdoc} - */ - public function getUrl() { - if (!isset($this->url)) { - $this->setUrl(); - } - return $this->url; - } - - /** - * {@inheritdoc} - */ - public function preSave(EntityStorageInterface $storage) { - parent::preSave($storage); - // Sets the default domain properly. - /** @var self $default */ - $default = $storage->loadDefaultDomain(); - if (!$default) { - $this->is_default = TRUE; - } - elseif ($this->is_default && $default->getDomainId() != $this->getDomainId()) { - // Swap the current default. - $default->is_default = FALSE; - $default->save(); - } - // Ensures we have a proper domain_id but does not erase existing ones. - if ($this->isNew() && empty($this->getDomainId())) { - $this->createDomainId(); - } - // Prevent duplicate hostname. - $hostname = $this->getHostname(); - // Do not use domain loader because it may change hostname. - $existing = $storage->loadByProperties(['hostname' => $hostname]); - $existing = reset($existing); - if ($existing && $this->getDomainId() != $existing->getDomainId()) { - throw new ConfigValueException("The hostname ($hostname) is already registered."); - } - } - - /** - * {@inheritdoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - parent::postSave($storage, $update); - // Invalidate cache tags relevant to domains. - \Drupal::service('cache_tags.invalidator')->invalidateTags(['rendered', 'url.site']); - } - - /** - * {@inheritdoc} - */ - public static function postDelete(EntityStorageInterface $storage, array $entities) { - parent::postDelete($storage, $entities); - foreach ($entities as $entity) { - $actions = $storage->loadMultiple([ - 'domain_default_action.' . $entity->id(), - 'domain_delete_action.' . $entity->id(), - 'domain_disable_action.' . $entity->id(), - 'domain_enable_action.' . $entity->id(), - ]); - foreach ($actions as $action) { - $action->delete(); - } - } - // Invalidate cache tags relevant to domains. - \Drupal::service('cache_tags.invalidator')->invalidateTags(['rendered', 'url.site']); - } - - /** - * {@inheritdoc} - */ - public function createDomainId() { - // We cannot reliably use sequences (1, 2, 3) because those can be different - // across environments. Instead, we use the crc32 hash function to create a - // unique numeric id for each domain. In some systems (Windows?) we have - // reports of crc32 returning a negative number. Issue #2794047. - // If we don't use hash(), then crc32() returns different results for 32- - // and 64-bit systems. On 32-bit systems, the number returned may also be - // too large for PHP. - // See #2908236. - $id = hash('crc32', $this->id()); - $id = abs(hexdec(substr($id, 0, -2))); - $this->createNumericId($id); - } - - /** - * Creates a unique numeric id for use in the {node_access} table. - * - * @param int $id - * An integer to use as the numeric id. - */ - public function createNumericId($id) { - // Ensure that this value is unique. - $storage = \Drupal::entityTypeManager()->getStorage('domain'); - $result = $storage->loadByProperties(['domain_id' => $id]); - if (empty($result)) { - $this->domain_id = $id; - } - else { - $id++; - $this->createNumericId($id); - } - } - - /** - * {@inheritdoc} - */ - public function getScheme($add_suffix = TRUE) { - $scheme = $this->scheme; - if ($scheme == 'variable') { - $scheme = \Drupal::entityTypeManager()->getStorage('domain')->getDefaultScheme(); - } - elseif ($scheme != 'https') { - $scheme = 'http'; - } - $scheme .= ($add_suffix) ? '://' : ''; - - return $scheme; - } - - /** - * {@inheritdoc} - */ - public function getRawScheme() { - return $this->scheme; - } - - /** - * {@inheritdoc} - */ - public function getResponse() { - if (empty($this->response)) { - $validator = \Drupal::service('domain.validator'); - $validator->checkResponse($this); - } - return $this->response; - } - - /** - * {@inheritdoc} - */ - public function setResponse($response) { - $this->response = $response; - } - - /** - * {@inheritdoc} - */ - public function getLink($current_path = TRUE) { - $options = ['absolute' => TRUE, 'https' => $this->isHttps()]; - if ($current_path) { - $url = Url::fromUri($this->getUrl(), $options); - } - else { - $url = Url::fromUri($this->getPath(), $options); - } - - return Link::fromTextAndUrl($this->getCanonical(), $url)->toString(); - } - - /** - * {@inheritdoc} - */ - public function getRedirect() { - return $this->redirect; - } - - /** - * {@inheritdoc} - */ - public function setRedirect($code = 302) { - $this->redirect = $code; - } - - /** - * {@inheritdoc} - */ - public function getHostname() { - return $this->hostname; - } - - /** - * {@inheritdoc} - */ - public function setHostname($hostname) { - $this->hostname = $hostname; - } - - /** - * {@inheritdoc} - */ - public function getDomainId() { - return $this->domain_id; - } - - /** - * {@inheritdoc} - */ - public function getWeight() { - return $this->weight; - } - - /** - * {@inheritdoc} - */ - public function setMatchType($match_type = DomainNegotiator::DOMAIN_MATCH_EXACT) { - $this->matchType = $match_type; - } - - /** - * {@inheritdoc} - */ - public function getMatchType() { - return $this->matchType; - } - - /** - * {@inheritdoc} - */ - public function getPort() { - $ports = explode(':', $this->getHostname()); - if (isset($ports[1])) { - return ':' . $ports[1]; - } - return ''; - } - - /** - * {@inheritdoc} - */ - public function setCanonical($hostname = NULL) { - if (is_null($hostname)) { - $this->canonical = $this->getHostname(); - } - else { - $this->canonical = $hostname; - } - } - - /** - * {@inheritdoc} - */ - public function getCanonical() { - if (empty($this->canonical)) { - $this->setCanonical(); - } - return $this->canonical; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php b/sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php deleted file mode 100644 index a170d3bce..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php +++ /dev/null @@ -1,140 +0,0 @@ -domainNegotiator = $negotiator; - $this->entityTypeManager = $entity_type_manager; - $this->domainStorage = $this->entityTypeManager->getStorage('domain'); - $this->accessCheck = $access_check; - $this->account = $account; - } - - /** - * Sets the domain context of the request. - * - * This method also determines the redirect status for the http request. - * - * Specifically, here we determine if a redirect is required. That happens - * in one of two cases: an unauthorized request to an inactive domain is made; - * a domain alias is set to redirect to its primary domain record. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The Event to process. - * - * @see domain_alias_domain_request_alter - */ - public function onKernelRequestDomain(GetResponseEvent $event) { - // Negotiate the request and set domain context. - /** @var \Drupal\domain\DomainInterface $domain */ - if ($domain = $this->domainNegotiator->getActiveDomain(TRUE)) { - $hostname = $domain->getHostname(); - $domain_url = $domain->getUrl(); - if ($domain_url) { - $redirect_status = $domain->getRedirect(); - $path = trim($event->getRequest()->getPathInfo(), '/'); - // If domain negotiation asked for a redirect, issue it. - if (is_null($redirect_status) && $this->accessCheck->checkPath($path)) { - // Else check for active domain or inactive access. - /** @var \Drupal\Core\Access\AccessResult $access */ - $access = $this->accessCheck->access($this->account); - // If the access check fails, reroute to the default domain. - // Note that Allowed, Neutral, and Failed are the options here. - // We insist on Allowed. - if (!$access->isAllowed()) { - /** @var \Drupal\domain\DomainInterface $default */ - $default = $this->domainStorage->loadDefaultDomain(); - $domain_url = $default->getUrl(); - $redirect_status = 302; - $hostname = $default->getHostname(); - } - } - } - if (!empty($redirect_status)) { - // Pass a redirect if necessary. - if (DomainRedirectResponse::checkTrustedHost($hostname)) { - $response = new TrustedRedirectResponse($domain_url, $redirect_status); - } - else { - // If the redirect is not to a registered hostname, reject the - // request. - $response = new Response('The provided host name is not a valid redirect.', 401); - } - $event->setResponse($response); - } - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - // This needs to fire very early in the stack, before accounts are cached. - $events[KernelEvents::REQUEST][] = ['onKernelRequestDomain', 50]; - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php b/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php deleted file mode 100644 index 589148614..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php +++ /dev/null @@ -1,45 +0,0 @@ -t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('domain.admin'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - \Drupal::messenger()->addMessage($this->t('Domain %label has been deleted.', ['%label' => $this->entity->label()])); - \Drupal::logger('domain')->notice('Domain %label has been deleted.', ['%label' => $this->entity->label()]); - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php b/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php deleted file mode 100644 index bc25dabc8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php +++ /dev/null @@ -1,97 +0,0 @@ -config('domain.settings'); - $form['allow_non_ascii'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Allow non-ASCII characters in domains and aliases'), - '#default_value' => $config->get('allow_non_ascii'), - '#description' => $this->t('Domains may be registered with international character sets. Note that not all DNS server respect non-ascii characters.'), - ]; - $form['www_prefix'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Ignore www prefix when negotiating domains'), - '#default_value' => $config->get('www_prefix'), - '#description' => $this->t('Domain negotiation will ignore any www prefixes for all requests.'), - ]; - // Get the usable tokens for this field. - $patterns = []; - foreach (\Drupal::service('domain.token')->getCallbacks() as $key => $callback) { - $patterns[] = "[domain:$key]"; - } - $form['css_classes'] = [ - '#type' => 'textfield', - '#size' => 80, - '#title' => $this->t('Custom CSS classes'), - '#default_value' => $config->get('css_classes'), - '#description' => $this->t('Enter any CSS classes that should be added to the <body> tag. Available replacement patterns are: @patterns', [ - '@patterns' => implode(', ', $patterns), - ]), - ]; - $form['login_paths'] = [ - '#type' => 'textarea', - '#rows' => 5, - '#columns' => 40, - '#title' => $this->t('Paths that should be accessible for inactive domains'), - '#default_value' => $config->get('login_paths'), - '#description' => $this->t('Inactive domains are only accessible to users with permission. - Enter any paths that should be accessible, one per line. Normally, only the - login path will be allowed.'), - ]; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('domain.settings'); - foreach ($this->settingsKeys() as $key) { - $config->set($key, $form_state->getValue($key)); - } - $config->save(); - parent::submitForm($form, $form_state); - } - - /** - * Returns an array of settings keys. - */ - public function settingsKeys() { - return [ - 'allow_non_ascii', - 'www_prefix', - 'login_paths', - 'css_classes', - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php deleted file mode 100644 index f44253bef..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php +++ /dev/null @@ -1,47 +0,0 @@ -saveDefault(); - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $objects) { - foreach ($objects as $object) { - if ($object instanceof DomainInterface) { - $object->saveDefault(); - } - } - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains'); - return $return_as_object ? $access_result : $access_result->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php deleted file mode 100644 index 0450a6d88..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php +++ /dev/null @@ -1,47 +0,0 @@ -delete(); - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $objects) { - foreach ($objects as $object) { - if ($object instanceof DomainInterface) { - $object->delete(); - } - } - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains'); - return $return_as_object ? $access_result : $access_result->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php deleted file mode 100644 index f227f0604..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php +++ /dev/null @@ -1,47 +0,0 @@ -disable(); - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $objects) { - foreach ($objects as $object) { - if ($object instanceof DomainInterface) { - $object->disable(); - } - } - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains'); - return $return_as_object ? $access_result : $access_result->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php deleted file mode 100644 index 0b9deab27..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php +++ /dev/null @@ -1,47 +0,0 @@ -enable(); - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $objects) { - foreach ($objects as $object) { - if ($object instanceof DomainInterface) { - $object->enable(); - } - } - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains'); - return $return_as_object ? $access_result : $access_result->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php deleted file mode 100644 index ccc8d0643..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php +++ /dev/null @@ -1,20 +0,0 @@ -getSetting('link_options') == 'home') { - return ['url.site']; - } - return ['url']; - } - - /** - * {@inheritdoc} - */ - public function blockForm($form, FormStateInterface $form_state) { - $defaults = $this->defaultConfiguration(); - $elements['link_options'] = [ - '#title' => $this->t('Link paths'), - '#type' => 'radios', - '#required' => TRUE, - '#options' => ['active' => $this->t('Link to active url'), 'home' => $this->t('Link to site home page')], - '#default_value' => !empty($this->configuration['link_options']) ? $this->configuration['link_options'] : $defaults['link_options'], - '#description' => $this->t('Determines how links to each domain will be written. Note that some paths may not be accessible on all domains.'), - ]; - $options = [ - 'select' => $this->t('JavaScript select list'), - 'menus' => $this->t('Menu-style tab links'), - 'ul' => $this->t('Unordered list of links'), - ]; - $elements['link_theme'] = [ - '#type' => 'radios', - '#title' => t('Link theme'), - '#default_value' => !empty($this->configuration['link_theme']) ? $this->configuration['link_theme'] : $defaults['link_theme'], - '#options' => $options, - '#description' => $this->t('Select how to display the block output.'), - ]; - $options = [ - 'name' => $this->t('The domain display name'), - 'hostname' => $this->t('The raw hostname'), - 'url' => $this->t('The domain base URL'), - ]; - $elements['link_label'] = [ - '#type' => 'radios', - '#title' => $this->t('Link text'), - '#default_value' => !empty($this->configuration['link_label']) ? $this->configuration['link_label'] : $defaults['link_label'], - '#options' => $options, - '#description' => $this->t('Select the text to display for each link.'), - ]; - return $elements; - } - - /** - * {@inheritdoc} - */ - public function blockSubmit($form, FormStateInterface $form_state) { - // Process the block's submission handling if no errors occurred only. - if (!$form_state->getErrors()) { - foreach (array_keys($this->defaultConfiguration()) as $element) { - $this->configuration[$element] = $form_state->getValue($element); - } - } - } - - /** - * Overrides \Drupal\block\BlockBase::access(). - */ - public function access(AccountInterface $account, $return_as_object = FALSE) { - $access = AccessResult::allowedIfHasPermissions($account, ['administer domains', 'use domain nav block'], 'OR'); - return $return_as_object ? $access : $access->isAllowed(); - } - - /** - * Build the output. - */ - public function build() { - /** @var \Drupal\domain\DomainInterface $active_domain */ - $active_domain = \Drupal::service('domain.negotiator')->getActiveDomain(); - $access_handler = \Drupal::entityTypeManager()->getAccessControlHandler('domain'); - $account = \Drupal::currentUser(); - - // Determine the visible domain list. - $items = []; - $add_path = ($this->getSetting('link_options') == 'active'); - /** @var \Drupal\domain\DomainInterface $domain */ - foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted() as $domain) { - // Set the URL. - $options = ['absolute' => TRUE, 'https' => ($domain->getScheme() == 'https')]; - if ($add_path) { - $url = Url::fromUri($domain->getUrl(), $options); - } - else { - $url = Url::fromUri($domain->getPath(), $options); - } - // Set the label text. - $label = $domain->label(); - if ($this->getSetting('link_label') == 'hostname') { - $label = $domain->getHostname(); - } - elseif ($this->getSetting('link_label') == 'url') { - $label = $domain->getPath(); - } - // Handles menu links. - if ($domain->status() || $account->hasPermission('access inactive domains')) { - if ($this->getSetting('link_theme') == 'menus') { - // @TODO: active trail isn't working properly, likely because this - // isn't really a menu. - $items[] = [ - 'title' => $label, - 'url' => $url, - 'attributes' => [], - 'below' => [], - 'is_expanded' => FALSE, - 'is_collapsed' => FALSE, - 'in_active_trail' => $domain->isActive(), - ]; - } - elseif ($this->getSetting('link_theme') == 'select') { - $items[] = [ - 'label' => $label, - 'url' => $url->toString(), - 'active' => $domain->isActive(), - ]; - } - else { - $items[] = ['#markup' => Link::fromTextAndUrl($label, $url)->toString()]; - } - } - } - - // Set the proper theme. - switch ($this->getSetting('link_theme')) { - case 'select': - $build['#theme'] = 'domain_nav_block'; - $build['#items'] = $items; - break; - - case 'menus': - // Map the $items params to what menu.html.twig expects. - $build['#items'] = $items; - $build['#menu_name'] = 'domain-nav'; - $build['#sorted'] = TRUE; - $build['#theme'] = 'menu__' . strtr($build['#menu_name'], '-', '_'); - break; - - case 'ul': - default: - $build['#theme'] = 'item_list'; - $build['#items'] = $items; - break; - } - - return $build; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'link_options' => 'home', - 'link_theme' => 'ul', - 'link_label' => 'name', - ]; - } - - /** - * Gets the configuration for the block, loading defaults if not set. - * - * @param string $key - * The setting key to retrieve, a string. - * - * @return string - * The setting value, a string. - */ - public function getSetting($key) { - if (isset($this->settings[$key])) { - return $this->settings[$key]; - } - $defaults = $this->defaultConfiguration(); - if (isset($this->configuration[$key])) { - $this->settings[$key] = $this->configuration[$key]; - } - else { - $this->settings[$key] = $defaults[$key]; - } - return $this->settings[$key]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php deleted file mode 100644 index a2b0bfc1c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php +++ /dev/null @@ -1,144 +0,0 @@ -isAllowed(); - } - - /** - * Build the output. - */ - public function build() { - /** @var \Drupal\domain\DomainInterface $domain */ - $domain = \Drupal::service('domain.negotiator')->getActiveDomain(); - if (!$domain) { - return [ - '#markup' => $this->t('No domain record could be loaded.'), - ]; - } - $header = [$this->t('Server'), $this->t('Value')]; - $rows[] = [ - $this->t('HTTP_HOST request'), - Html::escape($_SERVER['HTTP_HOST']), - ]; - // Check the response test. - $domain->getResponse(); - $check = \Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($_SERVER['HTTP_HOST']); - $match = $this->t('Exact match'); - // This value is not translatable. - $environment = 'default'; - if (!$check) { - // Specific check for Domain Alias. - if (isset($domain->alias)) { - $match = $this->t('ALIAS: Using alias %id', ['%id' => $domain->alias->getPattern()]); - // Get the environment. - $environment = $domain->alias->getEnvironment(); - } - else { - $match = $this->t('FALSE: Using default domain.'); - } - } - $rows[] = [ - $this->t('Domain match'), - $match, - ]; - $rows[] = [ - $this->t('Environment'), - $environment, - ]; - $rows[] = [ - $this->t('Canonical hostname'), - $domain->getCanonical(), - ]; - $rows[] = [ - $this->t('Base path'), - $domain->getPath(), - ]; - $rows[] = [ - $this->t('Current URL'), - $domain->getUrl(), - ]; - - $www = \Drupal::config('domain.settings')->get('www_prefix'); - $rows[] = [ - $this->t('Strip www prefix'), - !empty($www) ? $this->t('On') : $this->t('Off'), - ]; - $list = $domain->toArray(); - ksort($list); - foreach ($list as $key => $value) { - if (is_null($value)) { - $value = $this->t('NULL'); - } - elseif ($value === TRUE) { - $value = $this->t('TRUE'); - } - elseif ($value === FALSE) { - $value = $this->t('FALSE'); - } - elseif ($key == 'status' || $key == 'is_default') { - $value = empty($value) ? $this->t('FALSE') : $this->t('TRUE'); - } - $rows[] = [ - Html::escape($key), - !is_array($value) ? Html::escape($value) : $this->printArray($value), - ]; - } - return [ - '#theme' => 'table', - '#rows' => $rows, - '#header' => $header, - ]; - } - - /** - * Prints array data for the server block. - * - * @param array $array - * An array of data. Note that we support two levels of nesting. - * - * @return string - * A suitable output string. - */ - public function printArray(array $array) { - $items = []; - foreach ($array as $key => $val) { - if (!is_array($val)) { - $value = Html::escape($val); - } - else { - $list = []; - foreach ($val as $k => $v) { - $list[] = $this->t('@key : @value', ['@key' => $k, '@value' => $v]); - } - $value = implode('
', $list); - } - $items[] = $this->t('@key : @value', ['@key' => $key, '@value' => $value]); - } - $variables['domain_server'] = [ - '#theme' => 'item_list', - '#items' => $items, - ]; - return render($variables); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php deleted file mode 100644 index 25428f5a9..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php +++ /dev/null @@ -1,50 +0,0 @@ -isAllowed(); - } - - /** - * Build the output. - */ - public function build() { - /** @var \Drupal\domain\DomainInterface $active_domain */ - $active_domain = \Drupal::service('domain.negotiator')->getActiveDomain(); - $items = []; - /** @var \Drupal\domain\DomainInterface $domain */ - foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted() as $domain) { - $string = $domain->getLink(); - if (!$domain->status()) { - $string .= '*'; - } - if ($domain->id() == $active_domain->id()) { - $string = '' . $string . ''; - } - $items[] = ['#markup' => $string]; - } - return [ - '#theme' => 'item_list', - '#items' => $items, - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php deleted file mode 100644 index 30fb54efd..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php +++ /dev/null @@ -1,81 +0,0 @@ -isAllowed(); - } - - /** - * Build the output. - */ - public function build() { - /** @var \Drupal\domain\DomainInterface $domain */ - $domain = \Drupal::service('domain.negotiator')->getActiveDomain(); - if (!$domain) { - return [ - '#markup' => $this->t('No domain record could be loaded.'), - ]; - } - $header = [$this->t('Token'), $this->t('Value')]; - return [ - '#theme' => 'table', - '#rows' => $this->renderTokens($domain), - '#header' => $header, - ]; - } - - /** - * Generates available tokens for printing. - * - * @param \Drupal\domain\DomainInterface $domain - * The active domain request. - * - * @return array - * An array keyed by token name, with value of replacement value. - */ - private function renderTokens(DomainInterface $domain) { - $rows = []; - $token = \Drupal::token(); - $tokens = $token->getInfo(); - // The 'domain' token is supported by core. The others by Token module, - // so we cannot assume that Token module is present. - $domain_tokens = ['domain', 'current-domain', 'default-domain']; - foreach ($domain_tokens as $key) { - if (isset($tokens['tokens'][$key])) { - $data = []; - // Pass domain data to the default handler. - if ($key == 'domain') { - $data['domain'] = $domain; - } - foreach ($tokens['tokens'][$key] as $name => $info) { - $string = "[$key:$name]"; - $rows[] = [ - $string, - $token->replace($string, $data), - ]; - } - } - } - return $rows; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php deleted file mode 100644 index 7347401b4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php +++ /dev/null @@ -1,150 +0,0 @@ -domainNegotiator = $domain_negotiator; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $container->get('domain.negotiator'), - $configuration, - $plugin_id, - $plugin_definition - ); - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form['domains'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('When the following domains are active'), - '#default_value' => $this->configuration['domains'], - '#options' => array_map('\Drupal\Component\Utility\Html::escape', \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList()), - '#description' => $this->t('If you select no domains, the condition will evaluate to TRUE for all requests.'), - '#attached' => [ - 'library' => [ - 'domain/drupal.domain', - ], - ], - ]; - $form = parent::buildConfigurationForm($form, $form_state); - if (isset($form['context_mapping']['entity:domain']['#title'])) { - $form['context_mapping']['entity:domain']['#title'] = $this->t('Select the Domain condition'); - $form['context_mapping']['entity:domain']['#description'] = $this->t('This value must be set to "Active domain" for the context to work.'); - } - return $form; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'domains' => [], - ] + parent::defaultConfiguration(); - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->configuration['domains'] = array_filter($form_state->getValue('domains')); - parent::submitConfigurationForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function summary() { - // Use the domain labels. They will be sanitized below. - $domains = array_intersect_key(\Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(), $this->configuration['domains']); - if (count($domains) > 1) { - $domains = implode(', ', $domains); - } - else { - $domains = reset($domains); - } - if ($this->isNegated()) { - return $this->t('Active domain is not @domains', ['@domains' => $domains]); - } - else { - return $this->t('Active domain is @domains', ['@domains' => $domains]); - } - } - - /** - * {@inheritdoc} - */ - public function evaluate() { - $domains = $this->configuration['domains']; - if (empty($domains) && !$this->isNegated()) { - return TRUE; - } - // If the context did not load, derive from the request. - if (!$domain = $this->getContextValue('entity:domain')) { - $domain = $this->domainNegotiator->getActiveDomain(); - } - // No context found? - if (empty($domain)) { - return FALSE; - } - // NOTE: The context system handles negation for us. - return (bool) in_array($domain->id(), $domains); - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - $contexts = parent::getCacheContexts(); - $contexts[] = 'url.site'; - return $contexts; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php deleted file mode 100644 index 556660215..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php +++ /dev/null @@ -1,34 +0,0 @@ -currentUser->hasPermission('administer domains')) { - return $query; - } - // Can this user access inactive domains? - if (!$this->currentUser->hasPermission('access inactive domains')) { - $query->condition('status', 1); - } - // Filter domains by the user's assignments, which are controlled by other - // modules. Those modules must know what type of entity they are dealing - // with, so look up the entity type and bundle. - $info = $query->getMetaData('entity_reference_selection_handler'); - - if (!empty($info->configuration['entity'])) { - $context['entity_type'] = $info->configuration['entity']->getEntityTypeId(); - $context['bundle'] = $info->configuration['entity']->bundle(); - $context['field_type'] = $this->fieldType; - - // Load the current user. - $account = User::load($this->currentUser->id()); - // Run the alter hook. - $this->moduleHandler->alter('domain_references', $query, $account, $context); - } - - return $query; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $selection_handler_settings = $this->configuration['handler_settings']; - - // Merge-in default values. - $selection_handler_settings += [ - // For the 'target_bundles' setting, a NULL value is equivalent to "allow - // entities from any bundle to be referenced" and an empty array value is - // equivalent to "no entities from any bundle can be referenced". - 'target_bundles' => NULL, - 'sort' => [ - 'field' => 'weight', - 'direction' => 'ASC', - ], - 'auto_create' => FALSE, - 'default_selection' => 'current', - ]; - - $form['target_bundles'] = [ - '#type' => 'value', - '#value' => NULL, - ]; - - $fields = [ - 'weight' => $this->t('Weight'), - 'label' => $this->t('Name'), - 'hostname' => $this->t('Hostname'), - ]; - - $form['sort']['field'] = [ - '#type' => 'select', - '#title' => $this->t('Sort by'), - '#options' => $fields, - '#ajax' => FALSE, - '#default_value' => $selection_handler_settings['sort']['field'], - ]; - - $form['sort']['direction'] = [ - '#type' => 'select', - '#title' => $this->t('Sort direction'), - '#required' => TRUE, - '#options' => [ - 'ASC' => $this->t('Ascending'), - 'DESC' => $this->t('Descending'), - ], - '#default_value' => $selection_handler_settings['sort']['direction'], - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php deleted file mode 100644 index 2b2945c9f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php +++ /dev/null @@ -1,57 +0,0 @@ -select('domain', 'd')->fields('d', $fields); - } - - /** - * {@inheritdoc} - */ - public function fields() { - return [ - 'domain_id' => $this->t('Domain ID.'), - 'subdomain' => $this->t('Subdomain.'), - 'sitename' => $this->t('Sitename.'), - 'scheme' => $this->t('Scheme.'), - 'valid' => $this->t('Valid.'), - 'weight' => $this->t('Weight.'), - 'is_default' => $this->t('Is default.'), - 'machine_name' => $this->t('Machine name.'), - ]; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return ['domain_id' => ['type' => 'integer']]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php deleted file mode 100644 index 69ae30ab2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php +++ /dev/null @@ -1,188 +0,0 @@ -domainStorage = $domain_storage; - $this->domainNegotiator = $domain_negotiator; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager')->getStorage('domain'), - $container->get('domain.negotiator') - ); - } - - /** - * {@inheritdoc} - */ - public function access(AccountInterface $account) { - $id = $this->domainNegotiator->getActiveId(); - $options = array_filter($this->options['domain']); - return isset($options[$id]); - } - - /** - * {@inheritdoc} - */ - public function alterRouteDefinition(Route $route) { - if ($this->options['domain']) { - $route->setRequirement('_domain', (string) implode('+', $this->options['domain'])); - } - } - - /** - * {@inheritdoc} - */ - public function summaryTitle() { - $count = count($this->options['domain']); - if ($count < 1) { - return $this->t('No domain(s) selected'); - } - elseif ($count > 1) { - return $this->t('Multiple domains'); - } - else { - $domains = $this->domainStorage->loadOptionsList(); - $domain = reset($this->options['domain']); - return $domains[$domain]; - } - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['domain'] = ['default' => []]; - - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - $form['domain'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Domain'), - '#default_value' => $this->options['domain'], - '#options' => $this->domainStorage->loadOptionsList(), - '#description' => $this->t('Only the checked domain(s) will be able to access this display.'), - ]; - } - - /** - * {@inheritdoc} - */ - public function validateOptionsForm(&$form, FormStateInterface $form_state) { - $domain = $form_state->getValue(['access_options', 'domain']); - $domain = array_filter($domain); - - if (!$domain) { - $form_state->setError($form['domain'], $this->t('You must select at least one domain if type is "by domain"')); - } - - $form_state->setValue(['access_options', 'domain'], $domain); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = parent::calculateDependencies(); - - foreach (array_keys($this->options['domain']) as $id) { - if ($domain = $this->domainStorage->load($id)) { - $dependencies[$domain->getConfigDependencyKey()][] = $domain->getConfigDependencyName(); - } - } - - return $dependencies; - } - - /** - * {@inheritdoc} - */ - public function getCacheMaxAge() { - return Cache::PERMANENT; - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - return ['url.site']; - } - - /** - * {@inheritdoc} - */ - public function getCacheTags() { - return []; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php b/sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php deleted file mode 100644 index a66295a3b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php +++ /dev/null @@ -1,105 +0,0 @@ -baseHostname or the - * domainCreateTestDomains() method. - * - * @var string - */ - public $baseHostname; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = ['domain', 'node']; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Create Basic page and Article node types. - if ($this->profile != 'standard') { - $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); - } - - // Set the base hostname for domains. - $this->setBaseHostname(); - } - - /** - * Returns whether a given user account is logged in. - * - * @param \Drupal\user\UserInterface $account - * The user account object to check. - * - * @return bool - * TRUE if a given user account is logged in, or FALSE. - */ - protected function drupalUserIsLoggedIn(UserInterface $account) { - // @TODO: This is a temporary hack for the test login fails when setting $cookie_domain. - if (!isset($account->session_id)) { - return (bool) $account->id(); - } - // The session ID is hashed before being stored in the database. - // @see \Drupal\Core\Session\SessionHandler::read() - return (bool) db_query("SELECT sid FROM {users_field_data} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid", [':sid' => Crypt::hashBase64($account->session_id)])->fetchField(); - } - - /** - * Login a user on a specific domain. - * - * @param \Drupal\domain\DomainInterface $domain - * The domain to log the user into. - * @param \Drupal\user\UserInterface $account - * The user account to login. - */ - public function domainLogin(DomainInterface $domain, UserInterface $account) { - if ($this->loggedInUser) { - $this->drupalLogout(); - } - - // Login. - $url = $domain->getPath() . 'user/login'; - $edit = ['name' => $account->getAccountName(), 'pass' => $account->passRaw]; - $this->drupalPostForm($url, $edit, t('Log in')); - - // @see WebTestBase::drupalUserIsLoggedIn() - if (isset($this->sessionId)) { - $account->session_id = $this->sessionId; - } - $pass = $this->assert($this->drupalUserIsLoggedIn($account), new FormattableMarkup('User %name successfully logged in.', ['%name' => $account->getUsername()]), 'User login'); - if ($pass) { - $this->loggedInUser = $account; - $this->container->get('current_user')->setAccount($account); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig b/sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig deleted file mode 100644 index d2d4c0aca..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig +++ /dev/null @@ -1,32 +0,0 @@ -{# -/** - * @file - * Custom theme implementation for a select-and-go menu list. - * - * Available variables: - * - items: A list of items containing an array of strings. - * - label: the label text - * - url: the link url string - * - active: indicates if the domain is currently active. - * - * @ingroup themeable - */ -#} -{%- if items -%} -
-
- -
-
-{%- else -%} - {{- empty -}} -{%- endif -%} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/200.png b/sites/all/modules/contrib/admin/domain/domain/tests/200.png deleted file mode 100644 index d6152bd3c0dafa162b6bf93aeafa34f8bea930de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 593 zcmV-X0zW{8v8EKj1?C?pQ(!$r{ONp<)(A#R8x=DwwG>^zYh_tH9-}w6b zGK9BSlC-nO)NZfX0Cc_Y^!DiP^6vBYrohmDyWpL?!E@#|%09%|tm(Bohxa95gs>s@sxX-1- z)BtzDEqSIFdbiu|`rGUE1a-Shkh@2Ps{nAkJC@A=UzrblzW`sKxy{)}im|Q6)_1Pa zsm0ciwaXWGvjA?n2zR{F=JQXV&=q#FMTM;E@bq<}y#RB&{r>(>hp8nuVZ8tV0H#Sq zK~#9!VqgFP7H$SOkchF6gEBR=o#h4mB=taSeI*7XekLJlO;ZL2)@c7^OHM{cMjtf? z2Jg^tb|xU3ky+G`f!Caakpn1`As*($kiyK!o){>@#2mrK#}KdUt`m@CYv(HL8O#tA zq6#uoU5tUjm?1X74aind*79J8WZ+SBaddProperty('foo', 'bar'); - } -} - -/** - * Implements hook_domain_validate_alter(). - */ -function domain_test_domain_validate_alter(&$error_list, $hostname) { - // Deliberate test fail. - if ($hostname == 'fail.example.com') { - $error_list[] = 'Fail.example.com cannot be registered'; - } -} - -/** - * Implements hook_domain_request_alter(). - */ -function domain_test_domain_request_alter(DomainInterface &$domain) { - $domain->addProperty('foo1', 'bar1'); -} - -/** - * Implements hook_domain_operations(). - */ -function domain_test_domain_operations(DomainInterface $domain) { - $operations = []; - // Add aliases to the list. - $id = $domain->id(); - $operations['domain_test'] = [ - 'title' => t('Test'), - 'url' => Url::fromRoute('entity.domain.edit_form', ['domain' => $id]), - 'weight' => 80, - ]; - return $operations; -} - -/** - * Implements hook_domain_references_alter(). - */ -function domain_test_domain_references_alter($query, $account, $context) { - if ($context['entity_type'] == 'node') { - $test = 'Test string'; - $query->addMetadata('domain_test', $test); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php deleted file mode 100644 index 2462d13f3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php +++ /dev/null @@ -1,88 +0,0 @@ -manager = $this->container->get('plugin.manager.condition'); - - // Create test domains. - $this->domainCreateTestDomains(5); - - // Get two sample domains. - $this->domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $this->testDomain = array_shift($this->domains); - $this->notDomain = array_shift($this->domains); - } - - /** - * Test the domain condition. - */ - public function testConditions() { - // Grab the domain condition and configure it to check against one domain. - $condition = $this->manager->createInstance('domain') - ->setConfig('domains', [$this->testDomain->id() => $this->testDomain->id()]) - ->setContextValue('entity:domain', $this->notDomain); - $this->assertFalse($condition->execute(), 'Domain request condition fails on wrong domain.'); - - // Grab the domain condition and configure it to check against itself. - $condition = $this->manager->createInstance('domain') - ->setConfig('domains', [$this->testDomain->id() => $this->testDomain->id()]) - ->setContextValue('entity:domain', $this->testDomain); - $this->assertTrue($condition->execute(), 'Domain request condition succeeds on matching domain.'); - - // Check for the proper summary. - // Summaries require an extra space due to negate handling in summary(). - $this->assertEqual($condition->summary(), 'Active domain is ' . $this->testDomain->label()); - - // Check the negated summary. - $condition->setConfig('negate', TRUE); - $this->assertEqual($condition->summary(), 'Active domain is not ' . $this->testDomain->label()); - - // Check the negated condition. - $this->assertFalse($condition->execute(), 'Domain request condition fails when condition negated.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php deleted file mode 100644 index 7c3b93b31..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php +++ /dev/null @@ -1,100 +0,0 @@ -admin_user = $this->drupalCreateUser(['administer domains', 'access administration pages']); - $this->drupalLogin($this->admin_user); - - $path = 'admin/config/domain'; - - // Create test domains. - $this->domainCreateTestDomains(4); - - // Visit the domain overview administration page. - $this->drupalGet($path); - $this->assertResponse(200); - - // Test the domains. - $storage = \Drupal::entityTypeManager()->getStorage('domain'); - $domains = $storage->loadMultiple(); - $this->assertTrue(count($domains) == 4, 'Four domain records found.'); - - // Check the default domain. - $default = $storage->loadDefaultId(); - $key = 'example_com'; - $this->assertTrue($default == $key, 'Default domain set correctly.'); - - // Test some text on the page. - foreach ($domains as $domain) { - $name = $domain->label(); - $this->assertText($name, 'Name found properly.'); - } - // Test the list of actions. - $actions = ['delete', 'disable', 'default']; - foreach ($actions as $action) { - $this->assertRaw("/domain/{$action}/", 'Actions found properly.'); - } - // Check that all domains are active. - $this->assertNoRaw('Inactive', 'Inactive domain not found.'); - - // Disable a domain and test the enable link. - $this->clickLink('Disable', 0); - $this->assertRaw('Inactive', 'Inactive domain found.'); - - // Visit the domain overview administration page to clear cache. - $this->drupalGet($path); - $this->assertResponse(200); - - foreach ($storage->loadMultiple() as $domain) { - if ($domain->id() == 'one_example_com') { - $this->assertEmpty($domain->status(), 'One domain inactive.'); - } - else { - $this->assertNotEmpty($domain->status(), 'Other domains active.'); - } - } - - // Test the list of actions. - $actions = ['enable', 'delete', 'disable', 'default']; - foreach ($actions as $action) { - $this->assertRaw("/domain/{$action}/", 'Actions found properly.'); - } - // Re-enable the domain. - $this->clickLink('Enable', 0); - $this->assertNoRaw('Inactive', 'Inactive domain not found.'); - - // Visit the domain overview administration page to clear cache. - $this->drupalGet($path); - $this->assertResponse(200); - - foreach ($storage->loadMultiple() as $domain) { - $this->assertNotEmpty($domain->status(), 'All domains active.'); - } - - // Set a new default domain. - $this->clickLink('Make default', 0); - - // Visit the domain overview administration page to clear cache. - $this->drupalGet($path); - $this->assertResponse(200); - - // Check the default domain. - $storage->resetCache(); - $default = $storage->loadDefaultId(); - $key = 'one_example_com'; - $this->assertTrue($default == $key, 'Default domain set correctly.'); - - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php deleted file mode 100644 index befc13fb6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php +++ /dev/null @@ -1,140 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Basic test setup. - */ - public function testDomainAccessElement() { - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer users', - 'administer domains', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('admin/people/create'); - $this->assertSession()->statusCodeEquals(200); - - // Create a user through the form. - $this->fillField('name', 'testuser'); - $this->fillField('mail', 'test@example.com'); - $this->fillField('pass[pass1]', 'test'); - $this->fillField('pass[pass2]', 'test'); - - // We expect to find 5 domain options. We set two as selected. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $count = 0; - $ids = ['example_com', 'one_example_com', 'two_example_com']; - foreach ($domains as $domain) { - $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if (in_array($domain->id(), $ids)) { - $this->checkField($locator); - } - } - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - $storage = \Drupal::entityTypeManager()->getStorage('user'); - $user = $storage->load(3); - // Check that two values are set. - $manager = \Drupal::service('domain.element_manager'); - $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 3, 'User saved with three domain records.'); - - // Now login as a user with limited rights. - $account = $this->drupalCreateUser([ - 'administer users', - 'assign domain administrators', - ]); - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD); - $tester = $storage->load($account->id()); - $values = $manager->getFieldValues($tester, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain records.'); - $storage->resetCache([$account->id()]); - $this->drupalLogin($account); - - $this->drupalGet('user/' . $user->id() . '/edit'); - $this->assertSession()->statusCodeEquals(200); - - foreach ($domains as $domain) { - $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if ($domain->id() == 'example_com') { - $this->checkField($locator); - } - elseif ($domain->id() == 'one_example_com') { - $this->uncheckField($locator); - } - else { - $this->assertSession()->fieldNotExists($locator); - } - } - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Now, check the user. - $storage->resetCache([$user->id()]); - $user = $storage->load($user->id()); - // Check that two values are set. - $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain records.'); - - // Test the case presented in https://www.drupal.org/node/2841962. - $config = \Drupal::configFactory()->getEditable('user.settings'); - $config->set('verify_mail', 0); - $config->set('register', USER_REGISTER_VISITORS); - $config->save(); - $this->drupalLogout(); - $this->drupalGet('user/register'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseNotContains('Domain administrator'); - foreach ($domains as $domain) { - $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']'; - $this->assertSession()->fieldNotExists($locator); - } - // Create a user through the form. - $this->fillField('name', 'testuser2'); - $this->fillField('mail', 'test2@example.com'); - // In 8.3, this field is not present? - if (!empty($this->findField('pass[pass1]'))) { - $this->fillField('pass[pass1]', 'test'); - $this->fillField('pass[pass2]', 'test'); - } - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php deleted file mode 100644 index f861b4188..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php +++ /dev/null @@ -1,79 +0,0 @@ -install(['bartik']); - } - - /** - * Tests the handling of an inbound request. - */ - public function testDomainNegotiator() { - // No domains should exist. - $this->domainTableIsEmpty(); - - // Create four new domains programmatically. - $this->domainCreateTestDomains(4); - - // The test runner doesn't use a theme that contains the preprocess hook, - // so set to use Bartik. - $config = $this->config('system.theme'); - $config->set('default', 'bartik')->save(); - - // Test the response of the default home page. - foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) { - $this->drupalGet($domain->getPath()); - $text = 'id() . '-class'); - $this->assertRaw($text, 'Custom CSS present.' . $text); - } - - // Set the css classes. - $config = $this->config('domain.settings'); - $config->set('css_classes', '[domain:machine-name]-class [domain:name]-class')->save(); - // Test the response of the default home page. - foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) { - // The render cache trips up this test. In production, it may be - // necessary to add the url.site cache context. See README.md. - drupal_flush_all_caches(); - $this->drupalGet($domain->getPath()); - $text = 'id() . '"'; - $this->assertRaw($string, 'Found the domain option'); - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - } - } - - // Try to post a node, assigned to the first two domains. - $edit['title[0][value]'] = 'Test node'; - $edit["field_domain[{$one}]"] = TRUE; - $edit["field_domain[{$two}]"] = TRUE; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - $this->assertResponse(200); - $node = \Drupal::entityTypeManager()->getStorage('node')->load(1); - $values = $node->get('field_domain'); - - // Get the expected value count. - $this->assertTrue(count($values) == 2, 'Node saved with two domain records.'); - - } - - /** - * Creates a simple field for testing on the article content type. - * - * Note: This code is a model for auto-creation of fields. - */ - public function domainCreateTestField() { - $label = 'domain'; - $name = 'field_' . $label; - - $storage = [ - 'field_name' => $name, - 'entity_type' => 'node', - 'type' => 'entity_reference', - 'cardinality' => -1, - 'settings' => [ - 'target_type' => 'domain', - ], - ]; - $field_storage_config = \Drupal::entityTypeManager()->getStorage('field_storage_config')->create($storage); - $field_storage_config->save(); - - $field = [ - 'field_name' => $name, - 'entity_type' => 'node', - 'label' => 'Domain test field', - 'bundle' => 'article', - 'settings' => [ - 'handler_settings' => [ - 'sort' => ['field' => 'weight', 'direction' => 'ASC'], - ], - ], - ]; - $field_config = \Drupal::entityTypeManager()->getStorage('field_config')->create($field); - $field_config->save(); - - // Tell the form system how to behave. - if ($display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load('node.article.default')) { - $display->setComponent($name, ['type' => 'options_buttons'])->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php deleted file mode 100644 index 066ddb4fe..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php +++ /dev/null @@ -1,82 +0,0 @@ -admin_user = $this->drupalCreateUser(['administer domains', 'create domains']); - $this->drupalLogin($this->admin_user); - - $storage = \Drupal::entityTypeManager()->getStorage('domain'); - - // No domains should exist. - $this->domainTableIsEmpty(); - - // Visit the main domain administration page. - $this->drupalGet('admin/config/domain'); - - // Check for the add message. - if (substr_count(\Drupal::VERSION, '8.5') > 0) { - $this->assertText('There is no Domain record yet.', 'Text for no domains found.'); - } - else { - $this->assertText('There are no domain record entities yet.', 'Text for no domains found.'); - } - // Visit the add domain administration page. - $this->drupalGet('admin/config/domain/add'); - - // Make a POST request on admin/config/domain/add. - $edit = $this->domainPostValues(); - $this->drupalPostForm('admin/config/domain/add', $edit, 'Save'); - - // Did it save correctly? - $default_id = $storage->loadDefaultId(); - $this->assertTrue(!empty($default_id), 'Domain record saved via form.'); - - // Does it load correctly? - $storage->resetCache([$default_id]); - $new_domain = $storage->load($default_id); - $this->assertTrue($new_domain->id() == $default_id, 'Domain loaded properly.'); - - // Has a UUID been set? - $this->assertTrue(!empty($new_domain->uuid()), 'Entity UUID set properly.'); - - // Visit the edit domain administration page. - $editUrl = 'admin/config/domain/edit/' . $new_domain->id(); - $this->drupalGet($editUrl); - - // Update the record. - $edit = []; - $edit['name'] = 'Foo'; - $edit['validate_url'] = 0; - $this->drupalPostForm($editUrl, $edit, 'Save'); - - // Check that the update succeeded. - $storage->resetCache([$default_id]); - $domain = $storage->load($default_id); - $this->assertTrue($domain->label() == 'Foo', 'Domain record updated via form.'); - - // Visit the delete domain administration page. - $deleteUrl = 'admin/config/domain/delete/' . $new_domain->id(); - $this->drupalGet($deleteUrl); - - // Delete the record. - $this->drupalPostForm($deleteUrl, [], 'Delete'); - $storage->resetCache([$default_id]); - $domain = $storage->load($default_id); - $this->assertTrue(empty($domain), 'Domain record deleted.'); - - // No domains should exist. - $this->domainTableIsEmpty(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php deleted file mode 100644 index 35128bce3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php +++ /dev/null @@ -1,42 +0,0 @@ -domainTableIsEmpty(); - - // Create a new domain programmatically. - $this->domainCreateTestDomains(); - - // Check the created domain based on its known id value. - $key = 'example_com'; - /** @var \Drupal\domain\Entity\Domain $domain */ - $domain = \Drupal::entityTypeManager()->getStorage('domain')->load($key); - - // Our testing server should be able to access the test PNG file. - $this->assert($domain->getResponse() == 200, 'Server returned a 200 response.'); - - // Now create a bad domain. - $values = [ - 'hostname' => 'foo.bar', - 'id' => 'foo_bar', - 'name' => 'Foo', - ]; - $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values); - - $domain->save(); - $this->assert($domain->getResponse() == 500, 'Server test returned a 500 response.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php deleted file mode 100644 index b2af33a70..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php +++ /dev/null @@ -1,98 +0,0 @@ -config('system.site'); - $site_config->set('page.front', '/node')->save(); - - // Create four new domains programmatically. - $this->domainCreateTestDomains(4); - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - - // Grab a known domain for testing. - $domain = $domains['two_example_com']; - $this->drupalGet($domain->getPath()); - $this->assertTrue($domain->status(), 'Tested domain is set to active.'); - $this->assertTrue($domain->getPath() == $this->getUrl(), 'Loaded the active domain.'); - - // Disable the domain and test for redirect. - $domain->disable(); - $default = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain(); - // Our postSave() cache tag clear should allow this to work properly. - $this->drupalGet($domain->getPath()); - - $this->assertFalse($domain->status(), 'Tested domain is set to inactive.'); - $this->assertTrue($default->getPath() == $this->getUrl(), 'Redirected an inactive domain to the default domain.'); - - // Check to see if the user can login. - $url = $domain->getPath() . 'user/login'; - $this->drupalGet($url); - $this->assertResponse(200, 'Request to login on inactive domain allowed.'); - // Check to see if the user can reset password. - $url = $domain->getPath() . 'user/password'; - $this->drupalGet($url); - $this->assertResponse(200, 'Request to reset password on inactive domain allowed.'); - - // Try to access with the proper permission. - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['access inactive domains']); - // Must flush cache because we did not resave the domain. - drupal_flush_all_caches(); - $this->assertFalse($domain->status(), 'Tested domain is set to inactive.'); - $this->drupalGet($domain->getPath()); - - // Set up two additional domains. - $domain2 = $domains['one_example_com']; - $domain3 = $domains['three_example_com']; - - // Check against trusted host patterns. - $settings['settings']['trusted_host_patterns'] = (object) [ - 'value' => ['^' . $this->prepareTrustedHostname($domain->getHostname()) . '$', - '^' . $this->prepareTrustedHostname($domain2->getHostname()) . '$', - ], - 'required' => TRUE, - ]; - $this->writeSettings($settings); - - // Revoke the permission change. - user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['access inactive domains']); - - $domain2->saveDefault(); - - // Test the trusted host, which should redirect to default. - $this->drupalGet($domain->getPath()); - $this->assertTrue($domain2->getPath() == $this->getUrl(), 'Redirected from the inactive domain.'); - $this->assertResponse(200, 'Request to trusted host allowed.'); - - // The redirect is cached, so we must flush cache to test again. - drupal_flush_all_caches(); - - // Test another inactive domain that is not trusted. - // Disable the domain and test for redirect. - $domain3->saveDefault(); - $this->drupalGet($domain->getPath()); - $this->assertRaw('The provided host name is not a valid redirect.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php deleted file mode 100644 index a2ec8ac93..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php +++ /dev/null @@ -1,211 +0,0 @@ -domainCreateTestDomains(150); - } - - /** - * Basic test setup. - */ - public function testDomainListBuilder() { - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Check that links are printed. - foreach ($this->getPaginatedDomains() as $domain) { - $href = 'admin/config/domain/edit/' . $domain->id(); - $this->assertSession()->linkByHrefExists($href, 0, 'Link found ' . $href); - $this->assertSession()->assertEscaped($domain->label()); - // Check for pagination. - $this->checkPagination(); - } - - // Go to page 2. - $this->clickLink('Next'); - foreach ($this->getPaginatedDomains(1) as $domain) { - $href = 'admin/config/domain/edit/' . $domain->id(); - $this->assertSession()->linkByHrefExists($href, 0, 'Link found ' . $href); - $this->assertSession()->assertEscaped($domain->label()); - // Check for pagination. - $this->checkPagination(); - } - - // Now login as a user with limited rights. - $account = $this->drupalCreateUser([ - 'create article content', - 'edit any article content', - 'edit assigned domains', - 'view domain list', - ]); - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD); - $user_storage = \Drupal::entityTypeManager()->getStorage('user'); - $user = $user_storage->load($account->id()); - $manager = \Drupal::service('domain.element_manager'); - $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain records.'); - - $this->drupalLogin($account); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Check that links are printed. - $path = 'admin/config/domain'; - $this->drupalGet($path); - foreach ($this->getPaginatedDomains() as $domain) { - $href = 'admin/config/domain/edit/' . $domain->id(); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->linkByHrefExists($href, 0, 'Link found'); - $this->assertSession()->assertEscaped($domain->label()); - } - else { - $this->assertSession()->linkByHrefNotExists($href, 'Link not found'); - $this->assertSession()->assertEscaped($domain->label()); - } - // Check for pagination. - $this->checkPagination(); - } - - // Check access to the pages/routes. - foreach ($this->getPaginatedDomains() as $domain) { - $path = 'admin/config/domain/edit/' . $domain->id(); - $this->drupalGet($path); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->statusCodeEquals(200); - } - else { - $this->assertSession()->statusCodeEquals(403); - } - } - - // Go to page 2. - $this->drupalGet('admin/config/domain'); - $this->clickLink('Next'); - foreach ($this->getPaginatedDomains(1) as $domain) { - $href = 'admin/config/domain/edit/' . $domain->id(); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->linkByHrefExists($href, 0, 'Link found'); - $this->assertSession()->assertEscaped($domain->label()); - } - else { - $this->assertSession()->linkByHrefNotExists($href, 'Link not found'); - $this->assertSession()->assertEscaped($domain->label()); - } - // Check for pagination. - $this->checkPagination(); - } - - // Now login as a user with more limited rights. - $account2 = $this->drupalCreateUser([ - 'create article content', - 'edit any article content', - 'edit assigned domains', - 'view assigned domains', - ]); - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $account2->id(), $ids, DOMAIN_ADMIN_FIELD); - $user_storage = \Drupal::entityTypeManager()->getStorage('user'); - $user = $user_storage->load($account2->id()); - $manager = \Drupal::service('domain.element_manager'); - $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain records.'); - - $this->drupalLogin($account2); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Check that domains are listed and links are printed. - $path = 'admin/config/domain'; - $this->drupalGet($path); - foreach ($this->getPaginatedDomains() as $domain) { - $href = 'admin/config/domain/edit/' . $domain->id(); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->linkByHrefExists($href, 0, 'Link found'); - $this->assertSession()->assertEscaped($domain->label()); - } - else { - $this->assertSession()->linkByHrefNotExists($href, 'Link not found'); - $this->assertSession()->assertNoEscaped($domain->label()); - } - // Check for pagination. - $this->checkNoPagination(); - } - - // Check access to the pages/routes. - foreach ($this->getPaginatedDomains() as $domain) { - $path = 'admin/config/domain/edit/' . $domain->id(); - $this->drupalGet($path); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->statusCodeEquals(200); - } - else { - $this->assertSession()->statusCodeEquals(403); - } - } - - } - - /** - * Returns an array of domains, paginated and sorted by weight. - * - * @param int $page - * The page number to return. - */ - private function getPaginatedDomains($page = 0) { - $limit = 50; - $offset = $page * $limit; - return array_slice($this->getDomainsSorted(), $offset, $limit); - } - - /** - * Checks that pagination links appear, as expected. - */ - private function checkPagination() { - foreach (['?page=0', '?page=1', '?page=2'] as $href) { - $this->assertSession()->linkByHrefExists($href, 0, 'Link found'); - } - } - - /** - * Checks that pagination links do not appear, as expected. - */ - private function checkNoPagination() { - foreach (['?page=0', '?page=1', '?page=2'] as $href) { - $this->assertSession()->linkByHrefNotExists($href, 0, 'Link not found'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php deleted file mode 100644 index 441adb610..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php +++ /dev/null @@ -1,109 +0,0 @@ -domainCreateTestDomains(60); - } - - /** - * Basic test setup. - */ - public function testDomainWeight() { - // Test the default sort values. Should be 1 to 60. - $domains = $this->getDomainsSorted(); - $i = 1; - foreach ($domains as $domain) { - $this->assert($domain->getWeight() == $i, 'Weight set to ' . $i); - $i++; - } - // The last domain should be test59_example_com. - $this->assert($domain->id() == 'test59_example_com', 'Last domain is test59'); - $domains_old = $domains; - - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Set one weight to 61. - $locator = 'edit-domains-one-example-com-weight'; - $this->fillField($locator, 61); - - // Save the form. - $this->pressButton('edit-submit'); - - $domains = $this->getDomainsSorted(); - $i = 1; - foreach ($domains as $domain) { - // Weights should be the same one page 1 except for the one we changed. - if ($domain->id() == 'one_example_com') { - $this->assert($domain->getWeight() == 61, 'Weight set to 61 ' . $domain->getWeight()); - } - else { - $this->assert($domain->getWeight() == $domains_old[$domain->id()]->getWeight() . 'Weights unchanged'); - } - $i++; - } - // The last domain should be one_example_com. - $this->assert($domain->id() == 'one_example_com', 'Last domain is one'); - - // Go to page two. - $this->clickLink('Next'); - $this->assertSession()->statusCodeEquals(200); - // Set one weight to 2. - $locator = 'edit-domains-one-example-com-weight'; - $this->fillField($locator, 2); - // Save the form. - $this->pressButton('edit-submit'); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Go to page two. - $this->clickLink('Next'); - $this->assertSession()->statusCodeEquals(200); - - // Check the domain sort order. - $domains = $this->getDomainsSorted(); - $i = 1; - foreach ($domains as $domain) { - if ($domain->id() == 'one_example_com') { - $this->assert($domain->getWeight() == 2, 'Weight set to 2'); - } - else { - $this->assert($domain->getWeight() == $domains_old[$domain->id()]->getWeight() . 'Weights unchanged'); - } - } - // The last domain should be test59_example_com. - $this->assert($domain->id() == 'test59_example_com', 'Last domain is test59' . $domain->id()); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php deleted file mode 100644 index f75710ce2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php +++ /dev/null @@ -1,97 +0,0 @@ -domainCreateTestDomains(4); - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - - // Place the nav block. - $block = $this->drupalPlaceBlock('domain_nav_block'); - - // Let the anon user view the block. - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['use domain nav block']); - - // Load the homepage. All links should appear. - $this->drupalGet(''); - // Confirm domain links. - foreach ($domains as $id => $domain) { - $this->findLink($domain->label()); - } - - // Disable one of the domains. One link should not appear. - $disabled = $domains['one_example_com']; - $disabled->disable(); - - // Load the homepage. - $this->drupalGet(''); - // Confirm domain links. - foreach ($domains as $id => $domain) { - if ($id != 'one_example_com') { - $this->findLink($domain->label()); - } - else { - $this->assertNoRaw($domain->label()); - } - } - // Let the anon user view diabled domains. All links should appear. - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['access inactive domains']); - - // Load the homepage. - $this->drupalGet(''); - // Confirm domain links. - foreach ($domains as $id => $domain) { - $this->findLink($domain->label()); - } - - // Now update the configuration and test again. - $this->config('block.block.' . $block->id()) - ->set('settings.link_options', 'active') - ->set('settings.link_label', 'hostname') - ->save(); - - // Load the the login page. - $this->drupalGet('user/login'); - // Confirm domain links. - foreach ($domains as $id => $domain) { - $this->findLink($domain->getHostname()); - $this->assertRaw($domain->buildUrl('/user/login')); - } - - // Now update the configuration and test again. - $this->config('block.block.' . $block->id()) - ->set('settings.link_options', 'home') - ->set('settings.link_theme', 'menu') - ->set('settings.link_label', 'url') - ->save(); - - // Load the the login page. - $this->drupalGet('user/login'); - // Confirm domain links. - foreach ($domains as $id => $domain) { - $this->findLink($domain->getPath()); - $this->assertRaw($domain->getPath()); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php deleted file mode 100644 index 010030962..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php +++ /dev/null @@ -1,45 +0,0 @@ -domainTableIsEmpty(); - - // Create four new domains programmatically. - $this->domainCreateTestDomains(4); - - // Since we cannot read the service request, we place a block - // which shows the current domain information. - $this->drupalPlaceBlock('domain_server_block'); - - // To get around block access, let the anon user view the block. - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['view domain information']); - - // Test the response of the default home page. - foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) { - $this->drupalGet($domain->getPath()); - $this->assertRaw($domain->label(), 'Loaded the proper domain.'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php deleted file mode 100644 index e9e4a1397..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php +++ /dev/null @@ -1,220 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Basic test setup. - */ - public function testDomainReferences() { - // Create an admin user. This will be user 2. - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer users', - 'administer domains', - 'assign domain editors', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('admin/people/create'); - $this->assertSession()->statusCodeEquals(200); - - // Create a user through the form. This will be user 3. - $this->fillField('name', 'testuser'); - $this->fillField('mail', 'test@example.com'); - $this->fillField('pass[pass1]', 'test'); - $this->fillField('pass[pass2]', 'test'); - - // We expect to find 5 domain options. We set three as selected. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - - $ids = ['example_com', 'one_example_com', 'two_example_com']; - $edit_ids = ['example_com', 'one_example_com']; - foreach ($domains as $domain) { - $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if (in_array($domain->id(), $ids)) { - $this->checkField($locator); - } - $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if (in_array($domain->id(), $edit_ids)) { - $this->checkField($locator); - } - } - - // Find the all affiliates field. - $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]'; - $this->findField($locator); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Load our test user. - $storage = \Drupal::entityTypeManager()->getStorage('user'); - $testuser = $storage->load(3); - // Check that three values are set. - $manager = \Drupal::service('domain.element_manager'); - $values = $manager->getFieldValues($testuser, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 3, 'User saved with three domain admin records.'); - // Check that no access fields are set. - $values = $manager->getFieldValues($testuser, DOMAIN_ACCESS_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain access records.'); - - // Now login as a user with limited rights. This is user 4. - $account = $this->drupalCreateUser([ - 'administer users', - 'assign domain administrators', - ]); - // Set some domain assignments for this user. - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD); - $limited_admin = $storage->load($account->id()); - $values = $manager->getFieldValues($limited_admin, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain admin records.'); - // Check that no access fields are set. - $values = $manager->getFieldValues($limited_admin, DOMAIN_ACCESS_FIELD); - $this->assert(count($values) == 0, 'User saved with no domain access records.'); - - // Now edit user 3 as user 4 with limited rights. - $this->drupalLogin($account); - $this->drupalGet('user/' . $testuser->id() . '/edit'); - $this->assertSession()->statusCodeEquals(200); - - foreach ($domains as $domain) { - $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if ($domain->id() == 'example_com') { - $this->checkField($locator); - } - elseif ($domain->id() == 'one_example_com') { - $this->uncheckField($locator); - } - else { - $this->assertSession()->fieldNotExists($locator); - } - // No Domain Access field rights exist for this user. - $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']'; - $this->assertSession()->fieldNotExists($locator); - } - - // The all affiliates field should not be present.. - $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]'; - $this->assertSession()->fieldNotExists($locator); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Now, check the user. - $storage->resetCache([$testuser->id()]); - $testuser = $storage->load($testuser->id()); - // Check that two values are set. - $values = $manager->getFieldValues($testuser, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain admin records.'); - // Check that no access fields are set. - $values = $manager->getFieldValues($testuser, DOMAIN_ACCESS_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain access records.'); - - // Now login as a user with different limited rights. This is user 5. - $new_account = $this->drupalCreateUser([ - 'administer users', - 'assign domain administrators', - 'assign domain editors', - ]); - $ids = ['example_com', 'one_example_com']; - $new_ids = ['one_example_com', 'four_example_com']; - $this->addDomainsToEntity('user', $new_account->id(), $ids, DOMAIN_ADMIN_FIELD); - $this->addDomainsToEntity('user', $new_account->id(), $new_ids, DOMAIN_ACCESS_FIELD); - - $new_admin = $storage->load($new_account->id()); - $values = $manager->getFieldValues($new_admin, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain admin records.'); - $values = $manager->getFieldValues($new_admin, DOMAIN_ACCESS_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain access records.'); - - // Now edit the user as someone with limited rights. - $storage->resetCache([$new_admin->id()]); - $this->drupalLogin($new_account); - - $this->drupalGet('user/' . $testuser->id() . '/edit'); - $this->assertSession()->statusCodeEquals(200); - - foreach ($domains as $domain) { - $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if ($domain->id() == 'example_com') { - $this->checkField($locator); - } - elseif ($domain->id() == 'one_example_com') { - $this->uncheckField($locator); - } - else { - $this->assertSession()->fieldNotExists($locator); - } - // Some Domain Access field rights exist for this user. This adds - // one to the count. - $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']'; - if (in_array($domain->id(), $new_ids)) { - $this->findField($locator); - $this->checkField($locator); - } - else { - $this->assertSession()->fieldNotExists($locator); - } - } - - // The all affiliates field should not be present.. - $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]'; - $this->assertSession()->fieldNotExists($locator); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Now, check the user. - $storage->resetCache([$testuser->id()]); - $testuser = $storage->load($testuser->id()); - // Check that two values are set. - $values = $manager->getFieldValues($testuser, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain admin records.'); - $values = $manager->getFieldValues($testuser, DOMAIN_ACCESS_FIELD); - $this->assert(count($values) == 3, 'User saved with three domain access records.'); - - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php deleted file mode 100644 index 66cc82504..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php +++ /dev/null @@ -1,232 +0,0 @@ -baseHostname or the - * domainCreateTestDomains() method. - * - * @var string - */ - public $baseHostname; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = ['domain', 'node']; - - /** - * We use the standard profile for testing. - * - * @var string - */ - protected $profile = 'standard'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Set the base hostname for domains. - $this->baseHostname = \Drupal::entityTypeManager()->getStorage('domain')->createHostname(); - } - - /** - * The methods below are brazenly copied from Rules module. - * - * They are all helper methods that make writing tests a bit easier. - */ - - /** - * Finds link with specified locator. - * - * @param string $locator - * Link id, title, text or image alt. - * - * @return \Behat\Mink\Element\NodeElement|null - * The link node element. - */ - public function findLink($locator) { - return $this->getSession()->getPage()->findLink($locator); - } - - /** - * Confirms absence of link with specified locator. - * - * @param string $locator - * Link id, title, text or image alt. - * - * @return bool - * TRUE if link is absent, or FALSE. - */ - public function findNoLink($locator) { - return empty($this->getSession()->getPage()->hasLink($locator)); - } - - /** - * Finds field (input, textarea, select) with specified locator. - * - * @param string $locator - * Input id, name or label. - * - * @return \Behat\Mink\Element\NodeElement|null - * The input field element. - */ - public function findField($locator) { - return $this->getSession()->getPage()->findField($locator); - } - - /** - * Finds button with specified locator. - * - * @param string $locator - * Button id, value or alt. - * - * @return \Behat\Mink\Element\NodeElement|null - * The button node element. - */ - public function findButton($locator) { - return $this->getSession()->getPage()->findButton($locator); - } - - /** - * Presses button with specified locator. - * - * @param string $locator - * Button id, value or alt. - * - * @throws \Behat\Mink\Exception\ElementNotFoundException - */ - public function pressButton($locator) { - $this->getSession()->getPage()->pressButton($locator); - } - - /** - * Fills in field (input, textarea, select) with specified locator. - * - * @param string $locator - * Input id, name or label. - * @param string $value - * Value. - * - * @throws \Behat\Mink\Exception\ElementNotFoundException - * - * @see \Behat\Mink\Element\NodeElement::setValue - */ - public function fillField($locator, $value) { - $this->getSession()->getPage()->fillField($locator, $value); - } - - /** - * Checks checkbox with specified locator. - * - * @param string $locator - * An input id, name or label. - * - * @throws \Behat\Mink\Exception\ElementNotFoundException - */ - public function checkField($locator) { - $this->getSession()->getPage()->checkField($locator); - } - - /** - * Unchecks checkbox with specified locator. - * - * @param string $locator - * An input id, name or label. - * - * @throws \Behat\Mink\Exception\ElementNotFoundException - */ - public function uncheckField($locator) { - $this->getSession()->getPage()->uncheckField($locator); - } - - /** - * Selects option from select field with specified locator. - * - * @param string $locator - * An input id, name or label. - * @param string $value - * The option value. - * @param bool $multiple - * Whether to select multiple options. - * - * @throws \Behat\Mink\Exception\ElementNotFoundException - * - * @see NodeElement::selectOption - */ - public function selectFieldOption($locator, $value, $multiple = FALSE) { - $this->getSession()->getPage()->selectFieldOption($locator, $value, $multiple); - } - - /** - * Returns whether a given user account is logged in. - * - * @param \Drupal\Core\Session\AccountInterface $account - * The user account object to check. - * - * @return bool - * TRUE if a given user account is logged in, or FALSE. - */ - protected function drupalUserIsLoggedIn(AccountInterface $account) { - // @TODO: This is a temporary hack for the test login fails when setting $cookie_domain. - if (!isset($account->session_id)) { - return (bool) $account->id(); - } - // The session ID is hashed before being stored in the database. - // @see \Drupal\Core\Session\SessionHandler::read() - return (bool) db_query("SELECT sid FROM {users_field_data} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid", [':sid' => Crypt::hashBase64($account->session_id)])->fetchField(); - } - - /** - * Login a user on a specific domain. - * - * @param \Drupal\domain\DomainInterface $domain - * The domain to log the user into. - * @param \Drupal\Core\Session\AccountInterface $account - * The user account to login. - */ - public function domainLogin(DomainInterface $domain, AccountInterface $account) { - // Due to a quirk in session handling that we cannot directly access, it - // works if we login, then logout, and then login to a specific domain. - $this->drupalLogin($account); - if ($this->loggedInUser) { - $this->drupalLogout(); - } - - // Login. - $url = $domain->getPath() . 'user/login'; - $this->submitForm([ - 'name' => $account->getUsername(), - 'pass' => $account->passRaw, - ], t('Log in')); - - // @see BrowserTestBase::drupalUserIsLoggedIn() - $account->sessionId = $this->getSession()->getCookie($this->getSessionName()); - $this->assertTrue($this->drupalUserIsLoggedIn($account), 'User successfully logged in.'); - - $this->loggedInUser = $account; - $this->container->get('current_user')->setAccount($account); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php deleted file mode 100644 index 5f5039e15..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php +++ /dev/null @@ -1,75 +0,0 @@ -domainTableIsEmpty(); - - // Create four new domains programmatically. - $this->domainCreateTestDomains(4); - - // Since we cannot read the service request, we place a block - // which shows the current domain token information. - $this->drupalPlaceBlock('domain_token_block'); - - // To get around block access, let the anon user view the block. - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['view domain information']); - - // Test the response of the default home page. - foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) { - $this->drupalGet($domain->getPath()); - $this->assertRaw($domain->label(), 'Loaded the proper domain.'); - $this->assertRaw('Token', 'Token values printed.'); - foreach ($this->tokenList() as $token => $callback) { - $this->assertRaw("$token", "$token found correctly."); - // The URL token is sensitive to the path, which is /user, but that - // does not come across when making the callback outside of a request - // context. - $value = $domain->{$callback}(); - if ($token == '[domain:url]') { - $value = str_replace('user', '', $value); - if (substr($value, -1) != '/') { - $value .= '/'; - } - } - $this->assertRaw('' . $value . '', 'Value set correctly to ' . $value); - } - } - } - - /** - * Gets the list of tokens and value callbacks used by the test. - * - * @return array - * An array keyed by token string, with value of expected domain value. - */ - private function tokenList() { - $tokens = []; - foreach (\Drupal::service('domain.token')->getCallbacks() as $key => $callback) { - $name = "[domain:$key]"; - $tokens[$name] = $callback; - } - return $tokens; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php deleted file mode 100644 index 25a73fefe..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php +++ /dev/null @@ -1,99 +0,0 @@ -domainTableIsEmpty(); - $validator = \Drupal::service('domain.validator'); - $storage = \Drupal::entityTypeManager()->getStorage('domain'); - - // Create a domain. - $this->domainCreateTestDomains(1, 'foo.com'); - // Check the created domain based on its known id value. - $key = 'foo.com'; - /** @var \Drupal\domain\Entity\Domain $domain */ - $domain = $storage->loadByHostname($key); - $this->assertTrue(!empty($domain), 'Test domain created.'); - - // Valid hostnames to test. Valid is the boolean value. - $hostnames = [ - 'localhost' => 1, - 'example.com' => 1, - // See www-prefix test, below. - 'www.example.com' => 1, - 'one.example.com' => 1, - 'example.com:8080' => 1, - // Only one colon. - 'example.com::8080' => 0, - // No letters after a colon. - 'example.com:abc' => 0, - // Cannot begin with a dot. - '.example.com' => 0, - // Cannot end with a dot. - 'example.com.' => 0, - // Lowercase only. - 'EXAMPLE.com' => 0, - // ascii-only. - 'éxample.com' => 0, - ]; - foreach ($hostnames as $hostname => $valid) { - $errors = $validator->validate($hostname); - if ($valid) { - $this->assertTrue(empty($errors), 'Validation correct with no errors.'); - } - else { - $this->assertTrue(!empty($errors), 'Validation correct with proper errors.'); - } - } - // Test duplicate hostname creation. - $test_hostname = 'foo.com'; - $test_domain = $storage->create([ - 'hostname' => $test_hostname, - 'name' => 'Test domain', - 'id' => 'test_domain', - ]); - try { - $test_domain->save(); - $this->fail('Duplicate hostname validation'); - } - catch (ConfigValueException $e) { - $expected_message = "The hostname ($test_hostname) is already registered."; - $this->assertEqual($expected_message, $e->getMessage()); - } - // Test the two configurable options. - $config = $this->config('domain.settings'); - $config->set('www_prefix', TRUE); - $config->set('allow_non_ascii', TRUE); - $config->save(); - // Valid hostnames to test. Valid is the boolean value. - $hostnames = [ - // No www-prefix allowed. - 'www.example.com' => 0, - // ascii-only allowed. - 'éxample.com' => 1, - ]; - foreach ($hostnames as $hostname => $valid) { - $errors = $validator->validate($hostname); - if ($valid) { - $this->assertTrue(empty($errors), 'Validation test correct with no errors.'); - } - else { - $this->assertTrue(!empty($errors), 'Validation test correct with errors.'); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php deleted file mode 100644 index f1da872e4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php +++ /dev/null @@ -1,84 +0,0 @@ -domainCreateTestDomains(5); - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - // Enable the views. - $this->enableViewsTestModule(); - // Create a user. To test the area output was more difficult, so we just - // configured two views. The page shows the first, admin, user, and the - // block will show this new user name. - $this->user = $this->drupalCreateUser(['administer domains', 'create domains']); - // Place the view block. - $this->drupalPlaceBlock('views_block:domain_views_access-block_1'); - - // The block and page should be visible on example_com and one_example_com. - $allowed = ['example_com', 'one_example_com']; - - foreach ($domains as $domain) { - $path = $domain->getPath() . 'domain-views-access'; - $this->DrupalGet($path); - if (in_array($domain->id(), $allowed)) { - $this->assertResponse('200', 'Access allowed'); - $this->assertRaw('admin'); - $this->assertRaw($this->user->getUsername()); - } - else { - $this->assertResponse('403', 'Access denied'); - $this->assertNoRaw('admin'); - $this->assertNoRaw($this->user->getUsername()); - } - // Test the block on another page. - $this->drupalGet($domain->getPath()); - if (in_array($domain->id(), $allowed)) { - $this->assertRaw($this->user->getUsername()); - } - else { - $this->assertNoRaw($this->user->getUsername()); - } - } - } - - /** - * Sets up the domain_test module. - * - * Because the schema of domain_test.module is dependent on the test - * using it, it cannot be enabled normally. - */ - protected function enableViewsTestModule() { - \Drupal::service('module_installer')->install(['domain_test']); - $this->resetAll(); - $this->rebuildContainer(); - $this->container->get('module_handler')->reload(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php deleted file mode 100644 index 79508aef7..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php +++ /dev/null @@ -1,39 +0,0 @@ -installEntitySchema('domain'); - // Install the test domain record & views config. - $this->installConfig('domain_config_schema_test'); - } - - /** - * Dummy test method to ensure config gets installed. - */ - public function testRun() { - $this->assertTrue(TRUE); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php deleted file mode 100644 index 8a27c9341..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php +++ /dev/null @@ -1,168 +0,0 @@ -domainCreateTestDomains(); - - // Get the services. - $this->domainStorage = \Drupal::entityTypeManager()->getStorage('domain'); - $this->currentUser = \Drupal::service('current_user'); - $this->moduleHandler = \Drupal::service('module_handler'); - } - - /** - * Tests domain loading. - */ - public function testHookDomainLoad() { - // Check the created domain based on its known id value. - $domain = $this->domainStorage->load($this->key); - - // Internal hooks. - $path = $domain->getPath(); - $url = $domain->getUrl(); - $this->assertTrue(isset($path), new FormattableMarkup('The path property was set to %path by hook_entity_load.', ['%path' => $path])); - $this->assertTrue(isset($url), new FormattableMarkup('The url property was set to %url by hook_entity_load.', ['%url' => $url])); - - // External hooks. - $this->assertTrue($domain->foo == 'bar', 'The foo property was set to bar by hook_domain_load.'); - } - - /** - * Tests domain validation. - */ - public function testHookDomainValidate() { - $validator = \Drupal::service('domain.validator'); - // Test a good domain. - $errors = $validator->validate('one.example.com'); - $this->assertEmpty($errors, 'No errors returned for example.com'); - - // Test our hook implementation, which denies fail.example.com explicitly. - $errors = $validator->validate('fail.example.com'); - $this->assertNotEmpty($errors, 'Errors returned for fail.example.com'); - $this->assertTrue(current($errors) == 'Fail.example.com cannot be registered', 'Error message returned correctly.'); - } - - /** - * Tests domain request alteration. - */ - public function testHookDomainRequestAlter() { - // Set the request. - $negotiator = \Drupal::service('domain.negotiator'); - $negotiator->setRequestDomain($this->baseHostname); - - // Check that the property was added by our hook. - $domain = $negotiator->getActiveDomain(); - $this->assertTrue($domain->foo1 == 'bar1', 'The foo1 property was set to bar1 by hook_domain_request_alter'); - } - - /** - * Tests domain operations hook. - */ - public function testHookDomainOperations() { - $domain = $this->domainStorage->load($this->key); - - // Set the request. - $operations = $this->moduleHandler->invokeAll('domain_operations', [$domain, $this->currentUser]); - - // Test that our operations were added by the hook. - $this->assertTrue(isset($operations['domain_test']), 'Domain test operation loaded.'); - } - - /** - * Tests domain references alter hook. - */ - public function testHookDomainReferencesAlter() { - $domain = $this->domainStorage->load($this->key); - - // Set the request. - $manager = \Drupal::service('entity.manager'); - $target_type = 'domain'; - - // Build a node entity selection query. - $query = $manager->getStorage($target_type)->getQuery(); - $context = [ - 'entity_type' => 'node', - 'bundle' => 'article', - 'field_type' => 'editor', - ]; - - // Run the alteration, which should add metadata to the query for nodes. - $this->moduleHandler->alter('domain_references', $query, $this->currentUser, $context); - $this->assertTrue($query->getMetaData('domain_test') == 'Test string', 'Domain test query altered.'); - - // Build a user entity selection query. - $query = $manager->getStorage($target_type)->getQuery(); - $context = [ - 'entity_type' => 'user', - 'bundle' => 'user', - 'field_type' => 'admin', - ]; - - // Run the alteration, which does not add metadata for user queries. - $this->moduleHandler->alter('domain_references', $query, $this->currentUser, $context); - $this->assertEmpty($query->getMetaData('domain_test'), 'Domain test query not altered.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php deleted file mode 100644 index 7ffd1ee8b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php +++ /dev/null @@ -1,76 +0,0 @@ -domainCreateTestDomains(); - - // Get the services. - $this->domainStorage = \Drupal::entityTypeManager()->getStorage('domain'); - } - - /** - * Tests domain loading. - */ - public function testDomainScheme() { - // Set our testing parameters. - $default_scheme = \Drupal::request()->getScheme(); - $alt_scheme = ($default_scheme == 'https') ? 'http' : 'https'; - $add_suffix = FALSE; - - // Our created domain should have a scheme that matches the request. - $domain = $this->domainStorage->load($this->key); - $this->assertTrue($domain->getScheme($add_suffix) == $default_scheme); - - // Swtich the scheme and see if that works. - $domain->set('scheme', $alt_scheme); - $domain->save(); - $domain = $this->domainStorage->load($this->key); - $this->assertTrue($domain->getScheme($add_suffix) == $alt_scheme); - - // Set the scheme to variable, and that should match the default. - $domain->set('scheme', 'variable'); - $domain->save(); - $this->assertTrue($domain->getScheme($add_suffix) == $default_scheme); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php deleted file mode 100644 index d5af5f273..000000000 --- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php +++ /dev/null @@ -1,168 +0,0 @@ -getStorage('domain')->loadMultiple(NULL, TRUE); - if (empty($base_hostname)) { - $base_hostname = $this->baseHostname; - } - // Note: these domains are rigged to work on my test server. - // For proper testing, yours should be set up similarly, but you can pass a - // $list array to change the default. - if (empty($list)) { - $list = [ - '', - 'one', - 'two', - 'three', - 'four', - 'five', - 'six', - 'seven', - 'eight', - 'nine', - 'ten', - ]; - } - for ($i = 0; $i < $count; $i++) { - if ($i === 0) { - $hostname = $base_hostname; - $machine_name = 'example.com'; - $name = 'Example'; - } - elseif (!empty($list[$i])) { - $hostname = $list[$i] . '.' . $base_hostname; - $machine_name = $list[$i] . '.example.com'; - $name = 'Test ' . ucfirst($list[$i]); - } - // These domains are not setup and are just for UX testing. - else { - $hostname = 'test' . $i . '.' . $base_hostname; - $machine_name = 'test' . $i . '.example.com'; - $name = 'Test ' . $i; - } - // Create a new domain programmatically. - $values = [ - 'hostname' => $hostname, - 'name' => $name, - 'id' => \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($machine_name), - ]; - $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values); - $domain->save(); - } - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE); - } - - /** - * Adds a test domain to an entity. - * - * @param string $entity_type - * The entity type being acted upon. - * @param int $entity_id - * The entity id. - * @param array|string $ids - * An id or array of ids to add. - * @param string $field - * The name of the domain field used to attach to the entity. - */ - public function addDomainsToEntity($entity_type, $entity_id, $ids, $field) { - if ($entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id)) { - $entity->set($field, $ids); - $entity->save(); - } - } - - /** - * Returns an uncached list of all domains. - * - * @return array - * An array of domain entities. - */ - public function getDomains() { - \Drupal::entityTypeManager()->getStorage('domain')->resetCache(); - return \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - } - - /** - * Returns an uncached list of all domains, sorted by weight. - * - * @return array - * An array of domain entities. - */ - public function getDomainsSorted() { - \Drupal::entityTypeManager()->getStorage('domain')->resetCache(); - return \Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted(); - } - - /** - * Converts a domain hostname to a trusted host pattern. - * - * @param string $hostname - * A hostname string. - * - * @return string - * A regex-safe hostname, without delimiters. - */ - public function prepareTrustedHostname($hostname) { - $hostname = mb_strtolower(preg_replace('/:\d+$/', '', trim($hostname))); - return preg_quote($hostname); - } - - /** - * Set the base hostname for this test. - */ - public function setBaseHostname() { - $this->baseHostname = \Drupal::entityTypeManager()->getStorage('domain')->createHostname(); - } - - /** - * Reusable test function for checking initial / empty table status. - */ - public function domainTableIsEmpty() { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE); - $this->assertTrue(empty($domains), 'No domains have been created.'); - $default_id = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultId(); - $this->assertTrue(empty($default_id), 'No default domain has been set.'); - } - - /** - * Creates domain record for use with POST request tests. - */ - public function domainPostValues() { - $edit = []; - $domain = \Drupal::entityTypeManager()->getStorage('domain')->create(); - $required = \Drupal::service('domain.validator')->getRequiredFields(); - foreach ($required as $key) { - $edit[$key] = $domain->get($key); - } - // URL validation has issues on Travis, so only do it when requested. - $edit['validate_url'] = 0; - $edit['id'] = \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($edit['hostname']); - return $edit; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml deleted file mode 100644 index 2f245f810..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml +++ /dev/null @@ -1 +0,0 @@ -node_advanced_tab: true diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml deleted file mode 100644 index d4cdf636b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - node - enforced: - module: - - domain_access -id: node.field_domain_access -field_name: field_domain_access -entity_type: node -type: entity_reference -settings: - target_type: domain -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml deleted file mode 100644 index 392f68940..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - node - enforced: - module: - - domain_access -id: node.field_domain_all_affiliates -field_name: field_domain_all_affiliates -entity_type: node -type: boolean -settings: { } -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml deleted file mode 100644 index 25d0b0944..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - user - enforced: - module: - - domain_access -id: user.field_domain_access -field_name: field_domain_access -entity_type: user -type: entity_reference -settings: - target_type: domain -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml deleted file mode 100644 index e8f9888fc..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - user - enforced: - module: - - domain_access -id: user.field_domain_all_affiliates -field_name: field_domain_all_affiliates -entity_type: user -type: boolean -settings: { } -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml deleted file mode 100644 index d932320f8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: domain_access_all_action -label: 'Assign content to all affiliates' -type: node -plugin: domain_access_all_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml deleted file mode 100644 index 926e2d55b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: domain_access_edit_all_action -label: 'Assign editors to all affiliates' -type: user -plugin: domain_access_edit_all_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml deleted file mode 100644 index 33e7adf10..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: domain_access_edit_none_action -label: 'Remove editors from all affiliates' -type: user -plugin: domain_access_edit_none_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml deleted file mode 100644 index 4accb23cd..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: domain_access_none_action -label: 'Remove content from all affiliates' -type: node -plugin: domain_access_none_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml deleted file mode 100644 index 63676c661..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml +++ /dev/null @@ -1,50 +0,0 @@ -domain_access.settings: - type: config_object - label: 'Domain Access settings' - mapping: - node_advanced_tab: - type: boolean - label: 'Move domain access field to a tab in the advanced settings on nodes.' - node_advanced_tab_open: - type: boolean - label: 'Open the Domain Access details by default.' -action.configuration.domain_access_all_action: - type: action_configuration_default - label: 'Assign content to all affiliates' -action.configuration.domain_access_edit_all_action: - type: action_configuration_default - label: 'Assign editors to all affiliates' -action.configuration.domain_access_edit_none_action: - type: action_configuration_default - label: 'Remove editors from all affiliates' -action.configuration.domain_access_none_action: - type: action_configuration_default - label: 'Remove content from all affiliates' -action.configuration.domain_access_add_action: - type: mapping - label: 'Configuration for the add domain(s) to content action' - mapping: - domain_id: - type: string - label: 'The ID(s) of the domain(s) to add' -action.configuration.domain_access_remove_action: - type: mapping - label: 'Configuration for the remove domain(s) from content action' - mapping: - domain_id: - type: string - label: 'The ID(s) of the domain(s) to remove' -action.configuration.domain_access_add_editor_action: - type: mapping - label: 'Configuration for the add domain(s) to users action' - mapping: - domain_id: - type: string - label: 'The ID(s) of the domain(s) to add' -action.configuration.domain_access_remove_editor_action: - type: mapping - label: 'Configuration for the remove domain(s) from users action' - mapping: - domain_id: - type: string - label: 'The ID(s) of the domain(s) to remove' diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml deleted file mode 100644 index e489a9227..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Schema for the domain access plugins. - -views.access.domain_access_admin: - type: mapping - label: 'Domain Access: Administer domain editors' -views.access.domain_access_editor: - type: mapping - label: 'Domain Access: Edit domain content' -views.argument.domain_access_argument: - type: views_argument - label: 'Domain Access' -views.field.domain_access_field: - type: views_field - label: 'Domain Access' - mapping: - click_sort_column: - type: string - label: 'Column used for click sorting' - type: - type: string - label: 'Formatter' - settings: - label: 'Settings' - type: field.formatter.settings.[%parent.type] - group_column: - type: string - label: 'Group by column' - group_columns: - type: sequence - label: 'Group by columns' - sequence: - type: string - label: 'Column' - group_rows: - type: boolean - label: 'Display all values in the same row' - delta_limit: - type: integer - label: 'Field' - delta_offset: - type: integer - label: 'Offset' - delta_reversed: - type: boolean - label: 'Reversed' - delta_first_last: - type: boolean - label: 'First and last only' - multi_type: - type: string - label: 'Display type' - separator: - type: label - label: 'Separator' - field_api_classes: - type: boolean - label: 'Use field template' -views.filter.domain_access_current_all_filter: - type: views_filter - label: 'Current Domain or All Domains' -views.filter.domain_access_filter: - type: views.filter.in_operator - label: 'Domain Access' diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml deleted file mode 100644 index b7e3f245f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Domain Access -description: 'Domain-based access control for content.' -type: module -package: Domain -# version: VERSION -# core: 8.x -dependencies: - - drupal:node - - domain:domain - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.install b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.install deleted file mode 100644 index 189ea8ff4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.install +++ /dev/null @@ -1,46 +0,0 @@ -getStorage('node_type')->loadMultiple(); - foreach ($node_types as $type => $info) { - $list[$type] = 'node'; - } - // Install our fields. - foreach ($list as $bundle => $entity_type) { - domain_access_confirm_fields($entity_type, $bundle); - } - // Install our actions. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - domain_access_domain_insert($domain); - } -} - -/** - * Add the setting to open the domain access fieldset. - */ -function domain_access_update_8001() { - $config_factory = \Drupal::configFactory(); - $config = $config_factory->getEditable('domain_access.settings'); - $config->set('node_advanced_tab_open', 0); - $config->save(TRUE); -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml deleted file mode 100644 index 92ad9905b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -domain_access.settings: - title: Domain Access settings - route_name: domain_access.settings - parent: domain.admin - description: 'Domain Access settings' - weight: 10 diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml deleted file mode 100644 index 02cc8734d..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -domain_access.settings: - title: Domain Access settings - route_name: domain_access.settings - base_route: domain.admin diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.module b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.module deleted file mode 100755 index 34d26bbb7..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.module +++ /dev/null @@ -1,746 +0,0 @@ -getActiveDomain(); - - if (empty($active)) { - $active = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain(); - } - - // No domains means no permissions. - if (empty($active)) { - return $grants; - } - - $id = $active->getDomainId(); - // Advanced grants for edit/delete require permissions. - /** @var \Drupal\user\UserInterface $user */ - $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id()); - $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($user); - // Grants for view are simple. Use the active domain and all affiliates. - // Note that "X to any domain" is a global permission designed for admins. - if ($op == 'view') { - $grants['domain_id'][] = $id; - $grants['domain_site'][] = 0; - if ($user->hasPermission('view unpublished domain content')) { - if ($user->hasPermission('publish to any domain') || in_array($id, $user_domains) || !empty($user->get(DOMAIN_ACCESS_ALL_FIELD)->value)) { - $grants['domain_unpublished'][] = $id; - } - } - } - elseif ($op == 'update' && $user->hasPermission('edit domain content')) { - if ($user->hasPermission('publish to any domain') || in_array($id, $user_domains) || !empty($user->get(DOMAIN_ACCESS_ALL_FIELD)->value)) { - $grants['domain_id'][] = $id; - } - } - elseif ($op == 'delete' && $user->hasPermission('delete domain content')) { - if ($user->hasPermission('publish to any domain') || in_array($id, $user_domains) || !empty($user->get(DOMAIN_ACCESS_ALL_FIELD)->value)) { - $grants['domain_id'][] = $id; - } - } - return $grants; -} - -/** - * Implements hook_node_access_records(). - */ -function domain_access_node_access_records(NodeInterface $node) { - $grants = []; - // Create grants for each translation of the node. See the report at - // https://www.drupal.org/node/2825419 for the logic here. Note that right - // now, grants may not be the same for all languages. - $translations = $node->getTranslationLanguages(); - foreach ($translations as $langcode => $language) { - $translation = $node->getTranslation($langcode); - // If there are no domains set, use the current one. - $domains = \Drupal::service('domain_access.manager')->getAccessValues($translation); - /** @var \Drupal\domain\DomainInterface $active */ - if (empty($domains) && $active = \Drupal::service('domain.negotiator')->getActiveDomain()) { - $domains[$active->id()] = $active->getDomainId(); - } - foreach ($domains as $id => $domainId) { - /** @var \Drupal\domain\DomainInterface $domain */ - if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($id)) { - $grants[] = [ - 'realm' => ($translation->isPublished()) ? 'domain_id' : 'domain_unpublished', - 'gid' => $domain->getDomainId(), - 'grant_view' => 1, - 'grant_update' => 1, - 'grant_delete' => 1, - 'langcode' => $langcode, - ]; - } - } - // Set the domain_site grant. - if (!empty($translation->get(DOMAIN_ACCESS_ALL_FIELD)->value) && $translation->isPublished()) { - $grants[] = [ - 'realm' => 'domain_site', - 'gid' => 0, - 'grant_view' => 1, - 'grant_update' => 0, - 'grant_delete' => 0, - 'langcode' => $langcode, - ]; - } - // Because of language translation, we must save a record for each language. - // even if that record adds no permissions, as this one does. - else { - $grants[] = [ - 'realm' => 'domain_site', - 'gid' => 1, - 'grant_view' => 0, - 'grant_update' => 0, - 'grant_delete' => 0, - 'langcode' => $langcode, - ]; - } - } - return $grants; -} - -/** - * Implements hook_ENTITY_TYPE_presave(). - * - * Fires only if Devel Generate module is present, to assign test nodes to - * domains. - */ -function domain_access_node_presave(EntityInterface $node) { - domain_access_presave_generate($node); -} - -/** - * Implements hook_ENTITY_TYPE_presave(). - * - * Fires only if Devel Generate module is present, to assign test nodes to - * domains. - */ -function domain_access_user_presave(EntityInterface $account) { - domain_access_presave_generate($account); -} - -/** - * Handles presave operations for devel generate. - */ -function domain_access_presave_generate(EntityInterface $entity) { - // There is a core bug https://www.drupal.org/node/2609252 that causes a - // fatal database errors if the boolean DOMAIN_ACCESS_ALL_FIELD is set when - // a user cannot access the field. See domain_access_entity_field_access(). - // To overcome this issue, we cast the boolean to integer, which prevents the - // failure. - $value = (int) $entity->get(DOMAIN_ACCESS_ALL_FIELD)->value; - $entity->set(DOMAIN_ACCESS_ALL_FIELD, $value); - - // Handle devel module settings. - $exists = \Drupal::moduleHandler()->moduleExists('devel_generate'); - $values = []; - if ($exists && isset($entity->devel_generate)) { - // If set by the form. - if (isset($entity->devel_generate['domain_access'])) { - $selection = array_filter($entity->devel_generate['domain_access']); - if (isset($selection['random-selection'])) { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $values[DOMAIN_ACCESS_FIELD] = array_rand($domains, ceil(rand(1, count($domains)))); - } - else { - $values[DOMAIN_ACCESS_FIELD] = array_keys($selection); - } - } - if (isset($entity->devel_generate['domain_all'])) { - $selection = $entity->devel_generate['domain_all']; - if ($selection == 'random-selection') { - $values[DOMAIN_ACCESS_ALL_FIELD] = rand(0, 1); - } - else { - $values[DOMAIN_ACCESS_ALL_FIELD] = ($selection = 'yes' ? 1 : 0); - } - } - foreach ($values as $name => $value) { - $entity->set($name, $value); - } - } - -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Add options for domains when using Devel Generate. - */ -function domain_access_form_devel_generate_form_content_alter(&$form, &$form_state, $form_id) { - // Add our element to the Devel generate form. - $form['submit']['#weight'] = 10; - $list = ['random-selection' => t('Random selection')]; - $list += \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(); - $form['domain_access'] = [ - '#title' => t('Domains'), - '#type' => 'checkboxes', - '#options' => $list, - '#weight' => 2, - '#multiple' => TRUE, - '#size' => count($list) > 5 ? 5 : count($list), - '#default_value' => ['random-selection'], - '#description' => t('Sets the domains for created nodes. Random selection overrides other choices.'), - ]; - $form['domain_all'] = [ - '#title' => t('Send to all affiliates'), - '#type' => 'radios', - '#options' => [ - 'random-selection' => t('Random selection'), - 'yes' => t('Yes'), - 'no' => t('No'), - ], - '#default_value' => 'random-selection', - '#weight' => 3, - '#description' => t('Sets visibility across all affiliates.'), - ]; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Add options for domains when using Devel Generate. - */ -function domain_access_form_devel_generate_form_user_alter(&$form, &$form_state, $form_id) { - domain_access_form_devel_generate_form_content_alter($form, $form_state, $form_id); -} - -/** - * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm. - * - * Move Domain Access fields to an advanced tab like other node settings. - */ -function domain_access_form_node_form_alter(&$form, FormState $form_state, $form_id) { - $move_enabled = \Drupal::config('domain_access.settings')->get('node_advanced_tab'); - if ( - $move_enabled && isset($form[DOMAIN_ACCESS_FIELD]) && - isset($form[DOMAIN_ACCESS_ALL_FIELD]) && - empty($form[DOMAIN_ACCESS_FIELD]['#group']) && - empty($form[DOMAIN_ACCESS_ALL_FIELD]['#group']) - ) { - // Move to the tabs on the entity form. - $form[DOMAIN_ACCESS_FIELD]['#group'] = 'domain'; - $form[DOMAIN_ACCESS_ALL_FIELD]['#group'] = 'domain'; - $form['domain'] = [ - '#type' => 'details', - '#open' => (bool) \Drupal::config('domain_access.settings')->get('node_advanced_tab_open'), - '#title' => t('Domain settings'), - '#group' => 'advanced', - '#attributes' => [ - 'class' => ['node-form-options'], - ], - '#attached' => [ - 'library' => ['node/drupal.node'], - ], - '#weight' => 100, - '#optional' => TRUE, - ]; - } - // Add the options hidden from the user silently to the form. - $manager = \Drupal::service('domain.element_manager'); - $form = $manager->setFormOptions($form, $form_state, DOMAIN_ACCESS_FIELD); -} - -/** - * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\user\UserForm. - * - * Handle settings that the user cannot access. - */ -function domain_access_form_user_form_alter(&$form, &$form_state, $form_id) { - // Add the options hidden from the user silently to the form. - $manager = \Drupal::service('domain.element_manager'); - $form = $manager->setFormOptions($form, $form_state, DOMAIN_ACCESS_FIELD); -} - -/** - * Implements hook_domain_references_alter(). - */ -function domain_access_domain_references_alter($query, $account, $context) { - // Restrict domains by editorial assignment. - if ($context['field_type'] != 'editor') { - return; - } - switch ($context['entity_type']) { - case 'node': - if ($account->hasPermission('publish to any domain')) { - break; - } - elseif ($account->hasPermission('publish to any assigned domain')) { - if (!empty($account->get(DOMAIN_ACCESS_ALL_FIELD)->value)) { - break; - } - $allowed = \Drupal::service('domain_access.manager')->getAccessValues($account); - $query->condition('id', array_keys($allowed), 'IN'); - } - else { - // Remove all options. - $query->condition('id', '-no-possible-match-'); - } - break; - - case 'user': - if ($account->hasPermission('assign editors to any domain')) { - // Do nothing. - } - elseif ($account->hasPermission('assign domain editors')) { - if (!empty($account->get(DOMAIN_ACCESS_ALL_FIELD)->value)) { - break; - } - $allowed = \Drupal::service('domain_access.manager')->getAccessValues($account); - $query->condition('id', array_keys($allowed), 'IN'); - } - else { - // Remove all options. - $query->condition('id', '-no-possible-match-'); - } - break; - - default: - // No action taken. - break; - } -} - -/** - * Implements hook_node_access(). - */ -function domain_access_node_access(NodeInterface $node, $op, AccountInterface $account) { - static $active_domain; - if (!isset($active_domain)) { - // Ensure that the loader has run. In some tests, the kernel event has not. - $active = \Drupal::service('domain.negotiator')->getActiveDomain(); - if (empty($active)) { - $active = \Drupal::service('domain.negotiator')->getActiveDomain(TRUE); - } - $active_domain = $active; - } - // Check to see that we have a valid active domain. - // Without one, we cannot assert an opinion about access. - if (!$active_domain || empty($active_domain->getDomainId())) { - return AccessResult::neutral(); - } - - $type = $node->bundle(); - $manager = \Drupal::service('domain_access.manager'); - $allowed = FALSE; - - // In order to access update or delete, the user must be able to View. - if ($op == 'view' && $manager->checkEntityAccess($node, $account)) { - /** @var \Drupal\user\UserInterface $user */ - if ($node->isPublished()) { - $allowed = TRUE; - } - elseif ($account->hasPermission('view unpublished domain content')) { - $allowed = TRUE; - } - } - - if ($op == 'update') { - if ($account->hasPermission('update ' . $type . ' content on assigned domains') && $manager->checkEntityAccess($node, $account)) { - $allowed = TRUE; - } - elseif ($account->hasPermission('edit domain content') && $manager->checkEntityAccess($node, $account)) { - $allowed = TRUE; - } - } - - if ($op == 'delete') { - if ($account->hasPermission('delete ' . $type . ' content on assigned domains') && $manager->checkEntityAccess($node, $account)) { - $allowed = TRUE; - } - elseif ($account->hasPermission('delete domain content') && $manager->checkEntityAccess($node, $account)) { - $allowed = TRUE; - } - } - - if ($allowed) { - return AccessResult::allowed() - ->cachePerPermissions() - ->cachePerUser() - ->addCacheableDependency($node); - } - - // No opinion. - return AccessResult::neutral(); -} - -/** - * Implements hook_node_create_access(). - * - * @link https://www.drupal.org/node/2348203 - */ -function domain_access_node_create_access(AccountInterface $account, $context, $entity_bundle) { - // Check to see that we have a valid active domain. - // Without one, we cannot assert an opinion about access. - /** @var \Drupal\domain\DomainInterface $active */ - if ($active = \Drupal::service('domain.negotiator')->getActiveDomain()) { - $id = $active->getDomainId(); - } - else { - return AccessResult::neutral(); - } - // Load the full user record. - $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id()); - $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($user); - if (($account->hasPermission('create ' . $entity_bundle . ' content on assigned domains') - || $account->hasPermission('create domain content')) - && in_array($id, $user_domains)) { - // Note the cache context here! - return AccessResult::allowed()->addCacheContexts(['user.permissions', 'url.site']); - } - // No opinion. - return AccessResult::neutral(); -} - -/** - * Implements hook_entity_field_access(). - */ -function domain_access_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) { - // Hide the domain access fields from the entity add/edit forms - // when the user cannot access them. - if ($operation != 'edit') { - return AccessResult::neutral(); - } - - // The entity the field is attached to. - $entity = $items->getEntity(); - - if ($field_definition->getName() == DOMAIN_ACCESS_FIELD) { - if ($entity instanceof AccountInterface) { - $access = AccessResult::allowedIfHasPermissions($account, [ - 'assign domain editors', - 'assign editors to any domain', - ], 'OR'); - } - elseif ($entity instanceof NodeInterface) { - // Treat any other entity as content. - $access = AccessResult::allowedIfHasPermissions($account, [ - 'publish to any domain', - 'publish to any assigned domain', - ], 'OR'); - } - // allowedIfHasPermissions returns allowed() or neutral(). - // In this case, we want it to be forbidden, - // if user doesn't have the permissions above. - if (isset($access) && !$access->isAllowed()) { - return AccessResult::forbidden(); - } - } - // Check permissions on the All Affiliates field. - elseif ($field_definition->getName() == DOMAIN_ACCESS_ALL_FIELD) { - if ($entity instanceof AccountInterface) { - return AccessResult::forbiddenIf(!$account->hasPermission('assign editors to any domain')); - } - elseif ($entity instanceof NodeInterface) { - // Treat any other entity as content. - return AccessResult::forbiddenIf(!$account->hasPermission('publish to any domain')); - } - } - - return AccessResult::neutral(); -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - * - * Creates our fields when new node types are created. - */ -function domain_access_node_type_insert(EntityInterface $entity) { - /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ - if (!$entity->isSyncing()) { - // Do not fire hook when config sync in progress. - domain_access_confirm_fields('node', $entity->id()); - } -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - * - * In some cases, form display modes are not set when the node type is created. - * be sure to update our field definitions on creation of form_display for - * node types. - */ -function domain_access_entity_form_display_insert(EntityInterface $entity) { - if (!$entity->isSyncing() && $entity->getTargetEntityTypeId() == 'node' && $bundle = $entity->getTargetBundle()) { - domain_access_confirm_fields('node', $bundle); - } -} - -/** - * Creates our fields for an entity bundle. - * - * @param string $entity_type - * The entity type being created. Node and user are supported. - * @param string $bundle - * The bundle being created. - * @param array $text - * The text to use for the field. Keys are: - * 'name' -- the lower-case, human-readable name of the entity. - * 'label' -- the form label for the all affiliates field. - * 'description' -- the help text for the all affiliates field. - * - * If calling this function for entities other than user or node, it is the - * caller's responsibility to provide this text. - * - * This function is here for convenience during installation. It is not really - * an API function. Modules wishing to add fields to non-node entities must - * provide their own field storage. See the field storage YML sample in - * tests/modules/domain_access_test for an example of field storage - * definitions. - * - * @see domain_access_node_type_insert() - * @see domain_access_install() - */ -function domain_access_confirm_fields($entity_type, $bundle, array $text = []) { - // We have reports that importing config causes this function to fail. - try { - $text['node'] = [ - 'name' => 'content', - 'label' => 'Send to all affiliates', - 'description' => 'Make this content available on all domains.', - ]; - $text['user'] = [ - 'name' => 'user', - 'label' => 'Editor for all affiliates', - 'description' => 'Make this user an editor on all domains.', - ]; - - $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_FIELD; - - $field_storage = \Drupal::entityTypeManager()->getStorage('field_config'); - if (!$field = $field_storage->load($id)) { - $field = [ - 'field_name' => DOMAIN_ACCESS_FIELD, - 'entity_type' => $entity_type, - 'label' => 'Domain Access', - 'bundle' => $bundle, - // Users should not be required to be a domain editor. - 'required' => $entity_type !== 'user', - 'description' => 'Select the affiliate domain(s) for this ' . $text[$entity_type]['name'], - 'default_value_callback' => 'Drupal\domain_access\DomainAccessManager::getDefaultValue', - 'settings' => [ - 'handler' => 'default:domain', - // Handler_settings are deprecated but seem to be necessary here. - 'handler_settings' => [ - 'target_bundles' => NULL, - 'sort' => ['field' => 'weight', 'direction' => 'ASC'], - ], - 'target_bundles' => NULL, - 'sort' => ['field' => 'weight', 'direction' => 'ASC'], - ], - ]; - $field_config = $field_storage->create($field); - $field_config->save(); - } - // Assign the all affiliates field. - $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_ALL_FIELD; - if (!$field = $field_storage->load($id)) { - $field = [ - 'field_name' => DOMAIN_ACCESS_ALL_FIELD, - 'entity_type' => $entity_type, - 'label' => $text[$entity_type]['label'], - 'bundle' => $bundle, - 'required' => FALSE, - 'description' => $text[$entity_type]['description'], - ]; - $field_config = $field_storage->create($field); - $field_config->save(); - } - // Tell the form system how to behave. Default to radio buttons. - if ($display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load($entity_type . '.' . $bundle . '.default')) { - $display->setComponent(DOMAIN_ACCESS_FIELD, [ - 'type' => 'options_buttons', - 'weight' => 40, - ])->setComponent(DOMAIN_ACCESS_ALL_FIELD, [ - 'type' => 'boolean_checkbox', - 'settings' => ['display_label' => 1], - 'weight' => 41, - ])->save(); - } - } - catch (Exception $e) { - \Drupal::logger('domain_access')->notice('Field installation failed.'); - } -} - -/** - * Implements hook_views_data_alter(). - */ -function domain_access_views_data_alter(array &$data) { - $table = 'node__' . DOMAIN_ACCESS_FIELD; - $data[$table][DOMAIN_ACCESS_FIELD]['field']['id'] = 'domain_access_field'; - $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['filter']['id'] = 'domain_access_filter'; - $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['argument']['id'] = 'domain_access_argument'; - - // Current domain filter. - $data[$table]['current_all'] = [ - 'title' => t('Current domain'), - 'group' => t('Domain'), - 'filter' => [ - 'field' => DOMAIN_ACCESS_FIELD . '_target_id', - 'id' => 'domain_access_current_all_filter', - 'title' => t('Available on current domain'), - 'help' => t('Filters out nodes not available on current domain (published to current domain or all affiliates).'), - ], - ]; - // Since domains are not stored in the database, relationships cannot be used. - unset($data[$table][DOMAIN_ACCESS_FIELD]['relationship']); - - // Set the user data. - $table = 'user__' . DOMAIN_ACCESS_FIELD; - $data[$table][DOMAIN_ACCESS_FIELD]['field']['id'] = 'domain_access_field'; - $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['filter']['id'] = 'domain_access_filter'; - $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['argument']['id'] = 'domain_access_argument'; - - // Since domains are not stored in the database, relationships cannot be used. - unset($data[$table][DOMAIN_ACCESS_FIELD]['relationship']); -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - */ -function domain_access_domain_insert($entity) { - /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ - if ($entity->isSyncing()) { - // Do not fire hook when config sync in progress. - return; - } - $id = 'domain_access_add_action.' . $entity->id(); - $controller = \Drupal::entityTypeManager()->getStorage('action'); - if (!$controller->load($id)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = $controller->create([ - 'id' => $id, - 'type' => 'node', - 'label' => t('Add selected content to the @label domain', ['@label' => $entity->label()]), - 'configuration' => [ - 'domain_id' => $entity->id(), - ], - 'plugin' => 'domain_access_add_action', - ]); - $action->trustData()->save(); - } - $remove_id = 'domain_access_remove_action.' . $entity->id(); - if (!$controller->load($remove_id)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = $controller->create([ - 'id' => $remove_id, - 'type' => 'node', - 'label' => t('Remove selected content from the @label domain', ['@label' => $entity->label()]), - 'configuration' => [ - 'domain_id' => $entity->id(), - ], - 'plugin' => 'domain_access_remove_action', - ]); - $action->trustData()->save(); - } - $id = 'domain_access_add_editor_action.' . $entity->id(); - if (!$controller->load($id)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = $controller->create([ - 'id' => $id, - 'type' => 'user', - 'label' => t('Add editors to the @label domain', ['@label' => $entity->label()]), - 'configuration' => [ - 'domain_id' => $entity->id(), - ], - 'plugin' => 'domain_access_add_editor_action', - ]); - $action->trustData()->save(); - } - $remove_id = 'domain_access_remove_editor_action.' . $entity->id(); - if (!$controller->load($remove_id)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = $controller->create([ - 'id' => $remove_id, - 'type' => 'user', - 'label' => t('Remove editors from the @label domain', ['@label' => $entity->label()]), - 'configuration' => [ - 'domain_id' => $entity->id(), - ], - 'plugin' => 'domain_access_remove_editor_action', - ]); - $action->trustData()->save(); - } -} - -/** - * Implements hook_ENTITY_TYPE_delete(). - */ -function domain_access_domain_delete(EntityInterface $entity) { - $controller = \Drupal::entityTypeManager()->getStorage('action'); - $actions = $controller->loadMultiple([ - 'domain_access_add_action.' . $entity->id(), - 'domain_access_remove_action.' . $entity->id(), - 'domain_access_add_editor_action.' . $entity->id(), - 'domain_access_remove_editor_action.' . $entity->id(), - ]); - foreach ($actions as $action) { - $action->delete(); - } -} - -/** - * Implements hook_form_alter(). - * - * Find forms that contain the domain access field and allow those to handle - * default values properly. Note that here we just care if the form saves an - * entity. We then pass that entity to a helper function. - * - * @see domain_access_default_form_values() - */ -function domain_access_form_alter(&$form, &$form_state, $form_id) { - if ($object = $form_state->getFormObject() && !empty($object) && is_callable([$object, 'getEntity']) && $entity = $object->getEntity()) { - domain_access_default_form_values($form, $form_state, $entity); - } -} - -/** - * Defines default values for domain access field. - * - * This function is a workaround for a core bug. When the domain access field - * is not accessible to some users, the existing values are not preserved. - * - * @see domain_access_entity_field_access() - */ -function domain_access_default_form_values(&$form, &$form_state, $entity) { - // Set domain access default value when the user does not have access - // to edit the field. This seems to work fine for all affiliates, which - // suggests a core bug in entity reference handling. - if (!$entity->isNew() && - isset($form['field_domain_access']) && - !$form['field_domain_access']['#access'] && - empty($form['field_domain_access']['widget']['#default_value']) - ) { - // Set the default values correctly. - $values = \Drupal::service('domain_access.manager')->getAccessValues($entity); - $form['field_domain_access']['widget']['#default_value'] = array_keys($values); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml deleted file mode 100644 index b05ebf58b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -permission_callbacks: - - Drupal\domain_access\DomainAccessPermissions::permissions diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml deleted file mode 100644 index fb3071dab..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -domain_access.settings: - path: '/admin/config/domain/domain_access' - defaults: - _title: 'Domain Access settings' - _form: '\Drupal\domain_access\Form\DomainAccessSettingsForm' - requirements: - _permission: 'administer domains' diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml deleted file mode 100644 index 3ae6c385a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - domain_access.manager: - class: Drupal\domain_access\DomainAccessManager - arguments: ['@domain.negotiator', '@module_handler', '@entity_type.manager'] - access_check.domain_access_views: - class: Drupal\domain_access\Access\DomainAccessViewsAccess - arguments: ['@entity_type.manager', '@domain_access.manager'] - tags: - - { name: access_check, applies_to: _domain_access_views } diff --git a/sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml b/sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml deleted file mode 100644 index e7541c0ec..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - domain_access.commands: - class: \Drupal\domain_access\Commands\DomainAccessCommands - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php deleted file mode 100644 index 783e61b24..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php +++ /dev/null @@ -1,105 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->domainStorage = $this->entityTypeManager->getStorage('domain'); - $this->userStorage = $this->entityTypeManager->getStorage('user'); - $this->manager = $manager; - } - - /** - * {@inheritdoc} - */ - public function access(Route $route, AccountInterface $account, $arg_0 = NULL) { - // Permissions are stored on the route defaults. - $permission = $route->getDefault('domain_permission'); - $allPermission = $route->getDefault('domain_all_permission'); - - // Users with this permission can see any domain content lists, and it is - // required to view all affiliates. - if ($account->hasPermission($allPermission)) { - return AccessResult::allowed(); - } - - // Load the domain from the passed argument. In testing, this passed NULL - // in some instances. - if (!is_null($arg_0)) { - $domain = $this->domainStorage->load($arg_0); - } - - // Domain found, check user permissions. - if (!empty($domain)) { - if ($this->manager->hasDomainPermissions($account, $domain, [$permission])) { - return AccessResult::allowed(); - } - } - return AccessResult::forbidden(); - } - - /** - * {@inheritdoc} - */ - public function applies(Route $route) { - return $route->hasRequirement($this->requirementsKey); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php deleted file mode 100644 index fe408cb3f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php +++ /dev/null @@ -1,79 +0,0 @@ -getFieldEntities(DOMAIN_ACCESS_FIELD); - - return $result; - } - -/** - * @hook option domain:delete - */ - public function deleteOptions(Command $command, AnnotationData $annotationData) { - $command->addOption( - 'content-assign', - '', - InputOption::VALUE_OPTIONAL, - 'Reassign content for Domain Access', - null - ); - } - -/** - * @hook on-event domain-delete - */ - public function domainAccessDomainDelete($target_domain, $options) { - // Run our own deletion routine here. - if (is_null($options['content-assign'])) { - $policy_content = 'prompt'; - } - if (!empty($options['content-assign'])) { - if (in_array($options['content-assign'], $this->reassignment_policies, TRUE)) { - $policy_content = $options['content-assign']; - } - } - - $delete_options = [ - 'entity_filter' => 'node', - 'policy' => $policy_content, - 'field' => DOMAIN_ACCESS_FIELD, - ]; - - return $this->doReassign($target_domain, $delete_options); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php b/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php deleted file mode 100644 index b498d0228..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php +++ /dev/null @@ -1,203 +0,0 @@ -negotiator = $negotiator; - $this->moduleHandler = $module_handler; - $this->entityTypeManager = $entity_type_manager; - $this->domainStorage = $entity_type_manager->getStorage('domain'); - } - - /** - * {@inheritdoc} - */ - public static function getAccessValues(FieldableEntityInterface $entity, $field_name = DOMAIN_ACCESS_FIELD) { - // @TODO: static cache. - $list = []; - // @TODO In tests, $entity is returning NULL. - if (is_null($entity)) { - return $list; - } - // Get the values of an entity. - $values = $entity->hasField($field_name) ? $entity->get($field_name) : NULL; - // Must be at least one item. - if (!empty($values)) { - foreach ($values as $item) { - if ($target = $item->getValue()) { - if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($target['target_id'])) { - $list[$domain->id()] = $domain->getDomainId(); - } - } - } - } - return $list; - } - - /** - * {@inheritdoc} - */ - public static function getAllValue(FieldableEntityInterface $entity) { - return $entity->hasField(DOMAIN_ACCESS_ALL_FIELD) ? $entity->get(DOMAIN_ACCESS_ALL_FIELD)->value : NULL; - } - - /** - * {@inheritdoc} - */ - public function checkEntityAccess(FieldableEntityInterface $entity, AccountInterface $account) { - $entity_domains = $this->getAccessValues($entity); - $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id()); - if (!empty($this->getAllValue($user)) && !empty($entity_domains)) { - return TRUE; - } - $user_domains = $this->getAccessValues($user); - return (bool) !empty(array_intersect($entity_domains, $user_domains)); - } - - /** - * {@inheritdoc} - */ - public static function getDefaultValue(FieldableEntityInterface $entity, FieldDefinitionInterface $definition) { - $item = []; - if (!$entity->isNew()) { - // If set, ensure we do not drop existing data. - foreach (self::getAccessValues($entity) as $id) { - $item[] = $id; - } - } - // When creating a new entity, populate if required. - elseif ($entity->getFieldDefinition(DOMAIN_ACCESS_FIELD)->isRequired()) { - /** @var \Drupal\domain\DomainInterface $active */ - if ($active = \Drupal::service('domain.negotiator')->getActiveDomain()) { - $item[0]['target_uuid'] = $active->uuid(); - } - } - return $item; - } - - /** - * {@inheritdoc} - */ - public function hasDomainPermissions(AccountInterface $account, DomainInterface $domain, array $permissions, $conjunction = 'AND') { - // Assume no access. - $access = FALSE; - - // In the case of multiple AND permissions, assume access and then deny if - // any check fails. - if ($conjunction == 'AND' && !empty($permissions)) { - $access = TRUE; - foreach ($permissions as $permission) { - if (!($permission_access = $account->hasPermission($permission))) { - $access = FALSE; - break; - } - } - } - // In the case of multiple OR permissions, assume deny and then allow if any - // check passes. - else { - foreach ($permissions as $permission) { - if ($permission_access = $account->hasPermission($permission)) { - $access = TRUE; - break; - } - } - } - // Validate that the user is assigned to the domain. If not, deny. - $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id()); - $allowed = $this->getAccessValues($user); - if (!isset($allowed[$domain->id()]) && empty($this->getAllValue($user))) { - $access = FALSE; - } - - return $access; - } - - /** - * {@inheritdoc} - */ - public function getContentUrls(FieldableEntityInterface $entity) { - $list = []; - $processed = FALSE; - $domains = $this->getAccessValues($entity); - if ($this->moduleHandler->moduleExists('domain_source')) { - $source = domain_source_get($entity); - if (isset($domains[$source])) { - unset($domains['source']); - } - if (!empty($source)) { - $list[] = $source; - } - $processed = TRUE; - } - $list = array_merge($list, array_keys($domains)); - $domains = $this->domainStorage->loadMultiple($list); - $urls = []; - foreach ($domains as $domain) { - $options['domain_target_id'] = $domain->id(); - $url = $entity->toUrl('canonical', $options); - if ($processed) { - $urls[$domain->id()] = $url->toString(); - } - else { - $urls[$domain->id()] = trim($domain->getPath(), '/') . $url->toString(); - } - } - return $urls; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php b/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php deleted file mode 100644 index 7f2f67ddc..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php +++ /dev/null @@ -1,95 +0,0 @@ - [ - 'title' => $this->t('Assign additional editors to assigned domains'), - 'restrict access' => TRUE, - ], - 'assign editors to any domain' => [ - 'title' => $this->t('Assign additional editors to any domains'), - 'restrict access' => TRUE, - ], - 'publish to any domain' => [ - 'title' => $this->t('Publish to any domain'), - ], - 'publish to any assigned domain' => [ - 'title' => $this->t('Publish content to any assigned domain'), - ], - 'create domain content' => [ - 'title' => $this->t('Create any content on assigned domains'), - ], - 'edit domain content' => [ - 'title' => $this->t('Edit any content on assigned domains'), - ], - 'delete domain content' => [ - 'title' => $this->t('Delete any content on assigned domains'), - ], - 'view unpublished domain content' => [ - 'title' => $this->t('View unpublished content on assigned domains'), - 'restrict access' => TRUE, - ], - ]; - - // Generate standard node permissions for all applicable node types. - foreach (NodeType::loadMultiple() as $type) { - $permissions += $this->nodePermissions($type); - } - - return $permissions; - } - - /** - * Helper method to generate standard node permission list for a given type. - * - * Shamelessly lifted from node_list_permissions(). - * - * @param \Drupal\node\Entity\NodeType $type - * The node type object. - * - * @return array - * An array of permission names and descriptions. - */ - private function nodePermissions(NodeType $type) { - // Build standard list of node permissions for this type. - $id = $type->id(); - $perms = [ - "create $id content on assigned domains" => [ - 'title' => $this->t('%type_name: Create new content on assigned domains', ['%type_name' => $type->label()]), - ], - "update $id content on assigned domains" => [ - 'title' => $this->t('%type_name: Edit any content on assigned domains', ['%type_name' => $type->label()]), - ], - "delete $id content on assigned domains" => [ - 'title' => $this->t('%type_name: Delete any content on assigned domains', ['%type_name' => $type->label()]), - ], - ]; - - return $perms; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php deleted file mode 100644 index 2aa0dc4df..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php +++ /dev/null @@ -1,66 +0,0 @@ -config('domain_access.settings'); - $form['node_advanced_tab'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Move Domain Access fields to advanced node settings.'), - '#default_value' => $config->get('node_advanced_tab'), - '#description' => $this->t('When checked the Domain Access fields will be shown as a tab in the advanced settings on node edit form. However, if you have placed the fields in a field group already, they will not be moved.'), - ]; - $form['node_advanced_tab_open'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Open the Domain Access details.'), - '#description' => $this->t('Set the details tab to be open by default.'), - '#default_value' => $config->get('node_advanced_tab_open'), - '#states' => [ - 'visible' => [ - ':input[name="node_advanced_tab"]' => ['checked' => TRUE], - ], - ], - ]; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config('domain_access.settings') - ->set('node_advanced_tab', (bool) $form_state->getValue('node_advanced_tab')) - ->set('node_advanced_tab_open', (bool) $form_state->getValue('node_advanced_tab_open')) - ->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php deleted file mode 100644 index 4f074e820..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php +++ /dev/null @@ -1,100 +0,0 @@ -entityType = $entity_type; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity.manager')->getDefinition('domain') - ); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'domain_id' => '', - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(); - $form['domain_id'] = [ - '#type' => 'checkboxes', - '#title' => t('Domain'), - '#options' => $domains, - '#default_value' => $this->configuration['id'], - '#required' => TRUE, - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->configuration['domain_id'] = $form_state->getValue('domain_id'); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - if (!empty($this->configuration['domain_id'])) { - $prefix = $this->entityType->getConfigPrefix() . '.'; - $this->addDependency('config', $prefix . $this->configuration['domain_id']); - } - return $this->dependencies; - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - /** @var \Drupal\user\UserInterface $object */ - // @TODO: fix this logic. - $access = $object->access('update', $account, TRUE); - - return $return_as_object ? $access : $access->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php deleted file mode 100644 index 5d388405e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php +++ /dev/null @@ -1,31 +0,0 @@ -configuration['domain_id']; - $node_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity); - - // Add domain assignment if not present. - if ($entity !== FALSE && !isset($node_domains[$id])) { - $node_domains[$id] = $id; - $entity->set(DOMAIN_ACCESS_FIELD, array_keys($node_domains)); - $entity->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php deleted file mode 100644 index e6e963de9..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php +++ /dev/null @@ -1,31 +0,0 @@ -configuration['domain_id']; - $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity); - - // Skip adding the role to the user if they already have it. - if ($entity !== FALSE && !isset($user_domains[$id])) { - $user_domains[$id] = $id; - $entity->set(DOMAIN_ACCESS_FIELD, array_keys($user_domains)); - $entity->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php deleted file mode 100644 index 8ccd91397..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php +++ /dev/null @@ -1,24 +0,0 @@ -set(DOMAIN_ACCESS_ALL_FIELD, 1); - $entity->save(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php deleted file mode 100644 index dc2dfa772..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php +++ /dev/null @@ -1,24 +0,0 @@ -set(DOMAIN_ACCESS_ALL_FIELD, 1); - $entity->save(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php deleted file mode 100644 index ee3ba9855..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php +++ /dev/null @@ -1,24 +0,0 @@ -set(DOMAIN_ACCESS_ALL_FIELD, 0); - $entity->save(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php deleted file mode 100644 index 53d670a2b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php +++ /dev/null @@ -1,24 +0,0 @@ -set(DOMAIN_ACCESS_ALL_FIELD, 0); - $entity->save(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php deleted file mode 100644 index d6c676c1a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php +++ /dev/null @@ -1,31 +0,0 @@ -configuration['domain_id']; - $node_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity); - - // Remove domain assignment if present. - if ($entity !== FALSE && isset($node_domains[$id])) { - unset($node_domains[$id]); - $entity->set(DOMAIN_ACCESS_FIELD, array_keys($node_domains)); - $entity->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php deleted file mode 100644 index 0c2e27905..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php +++ /dev/null @@ -1,31 +0,0 @@ -configuration['domain_id']; - $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity); - - // Skip adding the role to the user if they already have it. - if ($entity !== FALSE && isset($user_domains[$id])) { - unset($user_domains[$id]); - $entity->set(DOMAIN_ACCESS_FIELD, array_keys($user_domains)); - $entity->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php deleted file mode 100644 index c58af3de0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php +++ /dev/null @@ -1,170 +0,0 @@ -domainStorage = $domain_storage; - $this->userStorage = $user_storage; - $this->manager = $manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager')->getStorage('domain'), - $container->get('entity_type.manager')->getStorage('user'), - $container->get('domain_access.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function summaryTitle() { - return $this->t('Domain editor'); - } - - /** - * {@inheritdoc} - */ - public function access(AccountInterface $account) { - // Users with this permission can see any domain content lists, and it is - // required to view all affiliates. - if ($account->hasPermission($this->allPermission)) { - return TRUE; - } - - // The routine below determines what domain (if any) was passed to the View. - if (isset($this->view->element['#arguments'])) { - foreach ($this->view->element['#arguments'] as $value) { - if ($domain = $this->domainStorage->load($value)) { - break; - } - } - } - - // Domain found, check user permissions. - if (!empty($domain)) { - return $this->manager->hasDomainPermissions($account, $domain, [$this->permission]); - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function alterRouteDefinition(Route $route) { - if ($domains = $this->domainStorage->loadMultiple()) { - $list = array_keys($domains); - } - $list[] = 'all_affiliates'; - $route->setRequirement('_domain_access_views', (string) implode('+', $list)); - $route->setDefault('domain_permission', $this->permission); - $route->setDefault('domain_all_permission', $this->allPermission); - } - - /** - * {@inheritdoc} - */ - public function getCacheMaxAge() { - return Cache::PERMANENT; - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - return ['user']; - } - - /** - * {@inheritdoc} - */ - public function getCacheTags() { - return []; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php deleted file mode 100644 index 2a34b2a8c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php +++ /dev/null @@ -1,30 +0,0 @@ -getStorage('domain')->load($this->argument)) { - return $domain->label(); - } - return parent::title(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php deleted file mode 100644 index 7dd279855..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php +++ /dev/null @@ -1,50 +0,0 @@ -options['settings']['link'])) { - foreach ($items as &$item) { - $object = $item['raw']; - $entity = $object->getEntity(); - $url = $entity->toUrl()->toString(); - $domain = $item['rendered']['#options']['entity']; - $item['rendered']['#type'] = 'markup'; - $item['rendered']['#markup'] = '' . $domain->label() . ''; - } - uasort($items, [$this, 'sort']); - } - - return $items; - } - - /** - * Sort the domain list, if possible. - */ - private function sort($a, $b) { - $domainA = isset($a['rendered']['#options']['entity']) ? $a['rendered']['#options']['entity'] : 0; - $domainB = isset($b['rendered']['#options']['entity']) ? $b['rendered']['#options']['entity'] : 0; - if ($domainA !== 0) { - return $domainA->getWeight() > $domainB->getWeight(); - } - // We don't have a domain object so sort as best we can. - return $a['rendered']['#plain_text'] > $b['rendered']['#plain_text']; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php deleted file mode 100644 index a32c19d1b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php +++ /dev/null @@ -1,73 +0,0 @@ -value_value = t('Available on current domain'); - } - - /** - * {@inheritdoc} - */ - public function getValueOptions() { - $this->valueOptions = [1 => $this->t('Yes'), 0 => $this->t('No')]; - } - - /** - * {@inheritdoc} - */ - protected function operators() { - return []; - } - - /** - * {@inheritdoc} - */ - public function query() { - $this->ensureMyTable(); - // @TODO: Proper abstraction of table and field name. - $all_table = $this->query->ensureTable('node__field_domain_all_affiliates'); - $current_domain = \Drupal::service('domain.negotiator')->getActiveId(); - if (empty($this->value)) { - // @TODO proper handling of NULL? - $where = "$this->tableAlias.$this->realField <> '$current_domain'"; - $where = '(' . $where . " OR $this->tableAlias.$this->realField IS NULL)"; - $where = '(' . $where . " AND ($all_table.field_domain_all_affiliates_value = 0 OR $all_table.field_domain_all_affiliates_value IS NULL))"; - } - else { - $where = "($this->tableAlias.$this->realField = '$current_domain' OR $all_table.field_domain_all_affiliates_value = 1)"; - } - $this->query->addWhereExpression($this->options['group'], $where); - // This filter causes duplicates. - $this->query->options['distinct'] = TRUE; - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - $contexts = parent::getCacheContexts(); - - $contexts[] = 'url.site'; - - return $contexts; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php deleted file mode 100644 index 9952a00c8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php +++ /dev/null @@ -1,26 +0,0 @@ -valueOptions)) { - $this->valueTitle = $this->t('Domains'); - $this->valueOptions = \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(); - } - return $this->valueOptions; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml b/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml deleted file mode 100644 index a37af529c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - taxonomy -id: taxonomy_term.field_domain_access -field_name: field_domain_access -entity_type: taxonomy_term -type: entity_reference -settings: - target_type: domain -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml deleted file mode 100644 index 407d58ca3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - taxonomy -id: taxonomy_term.field_domain_all_affiliates -field_name: field_domain_all_affiliates -entity_type: taxonomy_term -type: boolean -settings: { } -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml deleted file mode 100644 index b9635a950..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "Domain Access module tests" -description: "Support module for domain access testing." -type: module -package: Testing -# version: VERSION -# core: 8.x -hidden: TRUE - -dependencies: - - domain - - domain_access - - taxonomy - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php deleted file mode 100644 index 56c857e5e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php +++ /dev/null @@ -1,103 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - ]); - $this->drupalLogin($this->admin_user); - - // Visit the article field administration page. - $this->drupalGet('admin/structure/types/manage/article/fields'); - $this->assertResponse(200, 'Manage fields page accessed.'); - - // Check for the field. - $this->assertText($label, 'Domain form field found.'); - - // Visit the article field display administration page. - $this->drupalGet('admin/structure/types/manage/article/display'); - $this->assertResponse(200, 'Manage field display page accessed.'); - - // Check for the field. - $this->assertText($label, 'Domain form field found.'); - } - - /** - * Tests the storage of the domain access field. - */ - public function testDomainAccessAllFieldStorage() { - $label = 'Send to all affiliates'; - $this->admin_user = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'publish to any domain', - ]); - $this->drupalLogin($this->admin_user); - - // Create 5 domains. - $this->domainCreateTestDomains(5); - - // Visit the article field display administration page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - - // Check the new field exists on the page. - $this->assertText($label, 'Found the domain field instance.'); - - // We expect to find 5 domain options. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $string = 'value="' . $domain->id() . '"'; - $this->assertRaw($string, 'Found the domain option.'); - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - } - } - - // Try to post a node, assigned to the first two domains. - $edit['title[0][value]'] = 'Test node'; - $edit["field_domain_access[{$one}]"] = TRUE; - $edit["field_domain_access[{$two}]"] = TRUE; - $edit["field_domain_all_affiliates[value]"] = 1; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - $this->assertResponse(200); - $node = \Drupal::entityTypeManager()->getStorage('node')->load(1); - // Check that two values are set. - $values = \Drupal::service('domain_access.manager')->getAccessValues($node); - $this->assertTrue(count($values) == 2, 'Node saved with two domain records.'); - // Check that all affiliates is set. - $this->assertTrue(!empty($node->get(DOMAIN_ACCESS_ALL_FIELD)->value), 'Node assigned to all affiliates.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php deleted file mode 100644 index 7b68a1747..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php +++ /dev/null @@ -1,84 +0,0 @@ - 'page', - 'title' => 'foo', - DOMAIN_ACCESS_FIELD => [ - 'example_com', - 'one_example_com', - 'two_example_com', - ], - DOMAIN_ACCESS_ALL_FIELD => 0, - ]; - $node = $this->createNode($nodes_values); - - // Variables for our tests. - $path = 'node/1'; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $uri = 'entity:' . $path; - $uri_path = '/' . $path; - $expected = $uri_path; - $options = []; - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - - // Get the path processor service. - $paths = \Drupal::service('domain_access.manager'); - $urls = $paths->getContentUrls($node); - $expected = [ - 'example_com' => $domains['example_com']->getPath() . 'node/1', - $id => $domains[$id]->getPath() . 'node/1', - 'two_example_com' => $domains['two_example_com']->getPath() . 'node/1', - ]; - $this->assertTrue($expected == $urls); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php deleted file mode 100644 index 3610b50c9..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php +++ /dev/null @@ -1,99 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'publish to any domain', - ]); - $this->drupalLogin($this->admin_user); - - // Create 5 domains. - $this->domainCreateTestDomains(5); - - // Visit the article field display administration page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - - // Check the new field exists on the page. - $this->assertText('Domain Access', 'Found the domain field instance.'); - $this->assertRaw('name="field_domain_access[example_com]" value="example_com" checked="checked"', 'Default domain selected.'); - // Check the all affiliates field. - $this->assertText('Send to all affiliates', 'Found the all affiliates field instance.'); - $this->assertNoRaw('name="field_domain_all_affiliates[value]" value="1" checked="checked"', 'All affiliates not selected.'); - - // Now save the node with the values set. - $edit = [ - 'title[0][value]' => 'Test node', - 'field_domain_access[example_com]' => 'example_com', - ]; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - - // Load the node. - $node = \Drupal::entityTypeManager()->getStorage('node')->load(1); - $this->assertTrue($node, 'Article node created.'); - // Check that the values are set. - $values = \Drupal::service('domain_access.manager')->getAccessValues($node); - $this->assertTrue(count($values) == 1, 'Node saved with one domain record.'); - $allValue = \Drupal::service('domain_access.manager')->getAllValue($node); - $this->assertTrue(empty($allValue), 'Not sent to all affiliates.'); - - // Logout the admin user. - $this->drupalLogout(); - - // Create a limited value user. - $this->test_user = $this->drupalCreateUser([ - 'create article content', - 'edit any article content', - ]); - - // Login and try to edit the created node. - $this->drupalLogin($this->test_user); - - $this->drupalGet('node/1/edit'); - $this->assertResponse(200); - - // Now save the node with the values set. - $edit = [ - 'title[0][value]' => 'Test node update', - ]; - $this->drupalPostForm('node/1/edit', $edit, 'Save'); - - // Load the node. - $node = \Drupal::entityTypeManager()->getStorage('node')->load(1); - $this->assertTrue($node, 'Article node created.'); - // Check that the values are set. - $values = \Drupal::service('domain_access.manager')->getAccessValues($node); - $this->assertTrue(count($values) == 1, 'Node saved with one domain record.'); - $allValue = \Drupal::service('domain_access.manager')->getAllValue($node); - $this->assertTrue(empty($allValue), 'Not sent to all affiliates.'); - - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php deleted file mode 100644 index dc2019a68..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php +++ /dev/null @@ -1,151 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Test runner. - */ - public function testDomainAccessElement() { - $this->runInstalledTest('article'); - $node_type = $this->createContentType(['type' => 'test']); - $this->runInstalledTest('test'); - } - - /** - * Basic test setup. - */ - public function runInstalledTest($node_type) { - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'publish to any domain', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('node/add/' . $node_type); - $this->assertSession()->statusCodeEquals(200); - - // Set the title, so the node can be saved. - $this->fillField('title[0][value]', 'Test node'); - - // We expect to find 5 domain options. We set two as selected. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $count = 0; - $ids = ['example_com', 'one_example_com', 'two_example_com']; - foreach ($domains as $domain) { - $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if (in_array($domain->id(), $ids)) { - $this->checkField($locator); - } - } - // Find the all affiliates field. - $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]'; - $this->findField($locator); - - // Set all affiliates to TRUE. - $this->checkField($locator); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Get node data. Note that we create one new node for each test case. - $storage = \Drupal::entityTypeManager()->getStorage('node'); - $nid = $node_type == 'article' ? 1 : 2; - $node = $storage->load($nid); - // Check that two values are set. - $manager = \Drupal::service('domain_access.manager'); - $values = $manager->getAccessValues($node); - $this->assert(count($values) == 3, 'Node saved with three domain records.'); - $value = $manager->getAllValue($node); - $this->assert($value == 1, 'Node saved to all affiliates.'); - - // Now login as a user with limited rights. - $account = $this->drupalCreateUser([ - 'create ' . $node_type . ' content', - 'edit any ' . $node_type . ' content', - 'publish to any assigned domain', - ]); - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ACCESS_FIELD); - $user_storage = \Drupal::entityTypeManager()->getStorage('user'); - $user = $user_storage->load($account->id()); - $values = $manager->getAccessValues($user); - $this->assert(count($values) == 2, 'User saved with two domain records.'); - $value = $manager->getAllValue($user); - $this->assert($value == 0, 'User not saved to all affiliates.'); - - $this->drupalLogin($account); - - $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertSession()->statusCodeEquals(200); - - foreach ($domains as $domain) { - $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if ($domain->id() == 'example_com') { - $this->checkField($locator); - } - elseif ($domain->id() == 'one_example_com') { - $this->uncheckField($locator); - } - - else { - $this->assertSession()->fieldNotExists($locator); - } - } - - $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]'; - $this->assertSession()->fieldNotExists($locator); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Now, check the node. - $storage->resetCache([$node->id()]); - $node = $storage->load($node->id()); - // Check that two values are set. - $values = $manager->getAccessValues($node); - $this->assert(count($values) == 2, 'Node saved with two domain records.'); - $value = $manager->getAllValue($node); - $this->assert($value == 1, 'Node saved to all affiliates.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php deleted file mode 100644 index bf3e448b3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php +++ /dev/null @@ -1,79 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Tests that the fields are accessed properly. - */ - public function testDomainAccessEntityFields() { - $label = 'Send to all affiliates'; - // Create a vocabulary. - $vocabulary = entity_create('taxonomy_vocabulary', [ - 'name' => 'Domain vocabulary', - 'description' => 'Test taxonomy for Domain Access', - 'vid' => 'domain_access', - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - 'weight' => 100, - ]); - $vocabulary->save(); - $text['taxonomy_term'] = [ - 'name' => 'term', - 'label' => 'Send to all affiliates', - 'description' => 'Make this term available on all domains.', - ]; - domain_access_confirm_fields('taxonomy_term', 'domain_access', $text); - $this->admin_user = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'publish to any domain', - 'administer taxonomy', - 'administer taxonomy_term fields', - 'administer taxonomy_term form display', - ]); - $this->drupalLogin($this->admin_user); - $this->drupalGet('admin/structure/taxonomy/manage/domain_access/overview/fields'); - $this->assertResponse(200, 'Manage fields page accessed.'); - - // Check for a domain field. - $this->assertText('Domain Access', 'Domain form field found.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php deleted file mode 100644 index b952006a7..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php +++ /dev/null @@ -1,98 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - ]); - $this->drupalLogin($this->admin_user); - - // Visit the article field administration page. - $this->drupalGet('admin/structure/types/manage/article/fields'); - $this->assertResponse(200, 'Manage fields page accessed.'); - - // Check for a domain field. - $this->assertText('Domain Access', 'Domain form field found.'); - - // Visit the article field display administration page. - $this->drupalGet('admin/structure/types/manage/article/display'); - $this->assertResponse(200, 'Manage field display page accessed.'); - - // Check for a domain field. - $this->assertText('Domain Access', 'Domain form field found.'); - } - - /** - * Tests the storage of the domain access field. - */ - public function testDomainAccessFieldStorage() { - $this->admin_user = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'publish to any domain', - ]); - $this->drupalLogin($this->admin_user); - - // Create 5 domains. - $this->domainCreateTestDomains(5); - - // Visit the article field display administration page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - - // Check the new field exists on the page. - $this->assertText('Domain Access', 'Found the domain field instance.'); - - // We expect to find 5 domain options. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $string = 'value="' . $domain->id() . '"'; - $this->assertRaw($string, 'Found the domain option.'); - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - } - } - - // Try to post a node, assigned to the first two domains. - $edit['title[0][value]'] = 'Test node'; - $edit["field_domain_access[{$one}]"] = TRUE; - $edit["field_domain_access[{$two}]"] = TRUE; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - $this->assertResponse(200); - $node = \Drupal::entityTypeManager()->getStorage('node')->load(1); - // Check that two values are set. - $values = \Drupal::service('domain_access.manager')->getAccessValues($node); - $this->assertTrue(count($values) == 2, 'Node saved with two domain records.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php deleted file mode 100644 index b2c5ebce7..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php +++ /dev/null @@ -1,198 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Tests that the fields are accessed properly. - */ - public function testDomainAccessFields() { - $label = 'Send to all affiliates'; - - // Test a user who can access all domain settings. - $user1 = $this->drupalCreateUser(['create article content', 'publish to any domain']); - $this->drupalLogin($user1); - - // Visit the article creation page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200, 'Article creation found.'); - - // Check for the form options. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $this->assertText($domain->label(), 'Domain form item found.'); - } - $this->assertText($label, 'All affiliates field found.'); - - // Test a user who can access some domain settings. - $user2 = $this->drupalCreateUser(['create article content', 'publish to any assigned domain']); - $active_domain = array_rand($domains, 1); - $this->addDomainsToEntity('user', $user2->id(), $active_domain, DOMAIN_ACCESS_FIELD); - $this->drupalLogin($user2); - - // Visit the article creation page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200, 'Article creation found.'); - - // Check for the form options. - foreach ($domains as $domain) { - if ($domain->id() == $active_domain) { - $this->assertRaw('>' . $domain->label() . '', 'Domain form item found.'); - } - else { - $this->assertNoRaw('>' . $domain->label() . '', 'Domain form item not found.'); - } - } - $this->assertNoText($label, 'All affiliates field not found.'); - - // Test a user who can access no domain settings. - $user3 = $this->drupalCreateUser(['create article content']); - $this->drupalLogin($user3); - - // Visit the article creation page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200, 'Article creation found.'); - - // Check for the form options. - foreach ($domains as $domain) { - $this->assertNoText($domain->label(), 'Domain form item not found.'); - } - $this->assertNoText($label, 'All affiliates field not found.'); - - // Attempt saving the node. - // The domain/domain affiliates fields are not accessible to this user. - // The save will fail with an EntityStorageException until - // https://www.drupal.org/node/2609252 is fixed. - $edit = []; - $edit['title[0][value]'] = $this->randomMachineName(8); - $edit['body[0][value]'] = $this->randomMachineName(16); - $this->drupalPostForm('node/add/article', $edit, t('Save')); - - // Check that the node exists in the database. - $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); - $this->assertTrue($node, 'Node found in database.'); - - // Test a user who can assign users to domains. - $user4 = $this->drupalCreateUser(['administer users', 'assign editors to any domain']); - $this->drupalLogin($user4); - - // Visit the account creation page. - $this->drupalGet('admin/people/create'); - $this->assertResponse(200, 'User creation found.'); - - // Check for the form options. - foreach ($domains as $domain) { - $this->assertText($domain->label(), 'Domain form item found.'); - } - - // Test a user who can assign users to some domains. - $user5 = $this->drupalCreateUser(['administer users', 'assign domain editors']); - $active_domain = array_rand($domains, 1); - $this->addDomainsToEntity('user', $user5->id(), $active_domain, DOMAIN_ACCESS_FIELD); - $this->drupalLogin($user5); - - // Visit the account creation page. - $this->drupalGet('admin/people/create'); - $this->assertResponse(200, 'User creation found.'); - - // Check for the form options. - foreach ($domains as $domain) { - if ($domain->id() == $active_domain) { - $this->assertRaw('>' . $domain->label() . '', 'Domain form item found.'); - } - else { - $this->assertNoRaw('>' . $domain->label() . '', 'Domain form item not found.'); - } - } - - // Test a user who can access no domain settings. - $user6 = $this->drupalCreateUser(['administer users']); - $this->drupalLogin($user6); - - // Visit the account creation page. - $this->drupalGet('admin/people/create'); - $this->assertResponse(200, 'User creation found.'); - - // Check for the form options. - foreach ($domains as $domain) { - $this->assertNoText($domain->label(), 'Domain form item not found.'); - } - - // Test a user who can access all domain settings. - $user7 = $this->drupalCreateUser(['bypass node access', 'publish to any domain']); - $this->drupalLogin($user7); - - // Create a new content type and test that the fields are created. - // Create a content type programmatically. - $type = $this->drupalCreateContentType(); - $type_exists = (bool) NodeType::load($type->id()); - $this->assertTrue($type_exists, 'The new content type has been created in the database.'); - - // The test is not passing to domain_access_node_type_insert() properly. - domain_access_confirm_fields('node', $type->id()); - - // Visit the article creation page. - $this->drupalGet('node/add/' . $type->id()); - $this->assertResponse(200, $type->id() . ' creation found.'); - - // Check for the form options. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $this->assertText($domain->label(), 'Domain form item found.'); - } - $this->assertText($label, 'All affiliates field found.'); - - // Test user without access to affiliates field editing their user page. - $user8 = $this->drupalCreateUser(['change own username']); - $this->drupalLogin($user8); - - $user_edit_page = 'user/' . $user8->id() . '/edit'; - $this->drupalGet($user_edit_page); - // Check for the form options. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $this->assertNoText($domain->label(), 'Domain form item not found.'); - } - - $this->assertNoText($label, 'All affiliates field not found.'); - - // Change own username. - $edit = []; - $edit['name'] = $this->randomMachineName(); - - $this->drupalPostForm($user_edit_page, $edit, t('Save')); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php deleted file mode 100644 index 5e11081e5..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php +++ /dev/null @@ -1,88 +0,0 @@ -delete('node_access')->execute(); - } - - /** - * Creates a node and tests the creation of node access rules. - */ - public function testDomainAccessGrants() { - $node_storage = \Drupal::entityTypeManager()->getStorage('node'); - - // Create 5 domains. - $this->domainCreateTestDomains(5); - // Assign a node to a random domain. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $active_domain = array_rand($domains, 1); - $domain = $domains[$active_domain]; - // Create an article node. - $node1 = $this->drupalCreateNode([ - 'type' => 'article', - DOMAIN_ACCESS_FIELD => [$domain->id()], - ]); - $this->assertTrue($node_storage->load($node1->id()), 'Article node created.'); - - // Test the response of the node on each site. Should allow access only to - // the selected site. - foreach ($domains as $domain) { - $path = $domain->getPath() . 'node/' . $node1->id(); - $this->drupalGet($path); - if ($domain->id() == $active_domain) { - $this->assertResponse(200); - $this->assertRaw($node1->getTitle(), 'Article found on domain.'); - } - else { - $this->assertResponse(403); - } - } - - // Create an article node. - $node2 = $this->drupalCreateNode([ - 'type' => 'article', - DOMAIN_ACCESS_FIELD => [$domain->id()], - DOMAIN_ACCESS_ALL_FIELD => 1, - ]); - $this->assertTrue($node_storage->load($node2->id()), 'Article node created.'); - // Test the response of the node on each site. Should allow access on all. - foreach ($domains as $domain) { - $path = $domain->getPath() . 'node/' . $node2->id(); - $this->drupalGet($path); - $this->assertResponse(200); - $this->assertRaw($node2->getTitle(), 'Article found on domain.'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php deleted file mode 100644 index dbbe5e939..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php +++ /dev/null @@ -1,89 +0,0 @@ -domainCreateTestDomains(5); - - // Add Hungarian and Afrikaans. - ConfigurableLanguage::createFromLangcode('hu')->save(); - ConfigurableLanguage::createFromLangcode('af')->save(); - - // Enable content translation for the current entity type. - \Drupal::service('content_translation.manager')->setEnabled('node', 'page', TRUE); - } - - /** - * Basic test setup. - */ - public function testDomainAccessSave() { - $storage = \Drupal::entityTypeManager()->getStorage('node'); - // Save a node programmatically. - $node = $storage->create([ - 'type' => 'article', - 'title' => 'Test node', - 'uid' => '1', - 'status' => 1, - DOMAIN_ACCESS_FIELD => ['example_com'], - DOMAIN_ACCESS_ALL_FIELD => 1, - ]); - $node->save(); - - // Load the node. - $node = $storage->load(1); - - // Check that two values are set properly. - $manager = \Drupal::service('domain_access.manager'); - $values = $manager->getAccessValues($node); - $this->assert(count($values) == 1, 'Node saved with one domain records.'); - $value = $manager->getAllValue($node); - $this->assert($value == 1, 'Node saved to all affiliates.'); - - // Create an Afrikaans translation assigned to domain 2. - $translation = $node->addTranslation('af'); - $translation->title->value = $this->randomString(); - $translation->{DOMAIN_ACCESS_FIELD} = ['example_com', 'one_example_com']; - $translation->{DOMAIN_ACCESS_ALL_FIELD} = 0; - $translation->status = 1; - $node->save(); - - // Load and check the translated node. - $parent_node = $storage->load(1); - $node = $parent_node->getTranslation('af'); - $values = $manager->getAccessValues($node); - $this->assert(count($values) == 2, 'Node saved with two domain records.'); - $value = $manager->getAllValue($node); - $this->assert($value == 0, 'Node not saved to all affiliates.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php deleted file mode 100644 index 99787c8b0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php +++ /dev/null @@ -1,300 +0,0 @@ -config('user.role.' . RoleInterface::AUTHENTICATED_ID)->set('permissions', [])->save(); - // Create Basic page node type. - if ($this->profile != 'standard') { - $this->drupalCreateContentType([ - 'type' => 'page', - 'name' => 'Basic page', - 'display_submitted' => FALSE, - ]); - $this->drupalCreateContentType([ - 'type' => 'article', - 'name' => 'Article', - 'display_submitted' => FALSE, - ]); - } - $this->accessHandler = \Drupal::entityTypeManager()->getAccessControlHandler('node'); - $this->manager = \Drupal::service('domain_access.manager'); - $this->userStorage = \Drupal::entityTypeManager()->getStorage('user'); - // Create 5 domains. - $this->domainCreateTestDomains(5); - $this->domains = $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - } - - /** - * Runs basic tests for node_access function. - */ - public function testDomainAccessPermissions() { - // Note that these are hook_node_access() rules. Node Access system tests - // are in DomainAccessRecordsTest. - // We expect to find 5 domain options. Set two for later use. - foreach ($this->domains as $domain) { - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - } - } - - // Assign our user to domain $two. Test on $one and $two. - $domain_user1 = $this->drupalCreateUser([ - 'access content', - 'edit domain content', - 'delete domain content', - ]); - $this->addDomainsToEntity('user', $domain_user1->id(), $two, DOMAIN_ACCESS_FIELD); - $domain_user1 = $this->userStorage->load($domain_user1->id()); - $assigned = $this->manager->getAccessValues($domain_user1); - $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.'); - $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.'); - // Assign one node to default domain, and one to our test domain. - $domain_node1 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$one]]); - $domain_node2 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$two]]); - $assigned = $this->manager->getAccessValues($domain_node1); - $this->assertTrue(isset($assigned[$one]), 'Node1 assigned to proper test domain.'); - $assigned = $this->manager->getAccessValues($domain_node2); - $this->assertTrue(isset($assigned[$two]), 'Node2 assigned to proper test domain.'); - - // Tests 'edit domain content' to edit content assigned to their domains. - $this->assertNodeAccess([ - 'view' => TRUE, - 'update' => FALSE, - 'delete' => FALSE, - ], $domain_node1, $domain_user1); - $this->assertNodeAccess([ - 'view' => TRUE, - 'update' => TRUE, - 'delete' => TRUE, - ], $domain_node2, $domain_user1); - - // Tests 'edit domain TYPE content'. - // Assign our user to domain $two. Test on $one and $two. - $domain_user3 = $this->drupalCreateUser([ - 'access content', - 'update page content on assigned domains', - 'delete page content on assigned domains', - ]); - $this->addDomainsToEntity('user', $domain_user3->id(), $two, DOMAIN_ACCESS_FIELD); - $domain_user3 = $this->userStorage->load($domain_user3->id()); - $assigned = $this->manager->getAccessValues($domain_user3); - $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.'); - $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.'); - - // Assign two different node types to our test domain. - $domain_node3 = $this->drupalCreateNode(['type' => 'article', DOMAIN_ACCESS_FIELD => [$two]]); - $domain_node4 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$two]]); - $assigned = $this->manager->getAccessValues($domain_node3); - $this->assertTrue(isset($assigned[$two]), 'Node3 assigned to proper test domain.'); - $assigned = $this->manager->getAccessValues($domain_node4); - $this->assertTrue(isset($assigned[$two]), 'Node4 assigned to proper test domain.'); - - // Tests 'edit TYPE content on assigned domains'. - $this->assertNodeAccess([ - 'view' => TRUE, - 'update' => FALSE, - 'delete' => FALSE, - ], $domain_node3, $domain_user3); - $this->assertNodeAccess([ - 'view' => TRUE, - 'update' => TRUE, - 'delete' => TRUE, - ], $domain_node4, $domain_user3); - - // @TODO: Test edit and delete for user with 'all affiliates' permission. - // Tests 'edit domain TYPE content'. - // Assign our user to domain $two. Test on $one and $two. - $domain_user4 = $this->drupalCreateUser([ - 'access content', - 'update page content on assigned domains', - 'delete page content on assigned domains', - ]); - $this->addDomainsToEntity('user', $domain_user4->id(), $two, DOMAIN_ACCESS_FIELD); - $this->addDomainsToEntity('user', $domain_user4->id(), 1, DOMAIN_ACCESS_ALL_FIELD); - $domain_user4 = $this->userStorage->load($domain_user4->id()); - $assigned = $this->manager->getAccessValues($domain_user4); - $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.'); - $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.'); - $this->assertTrue(!empty($domain_user4->get(DOMAIN_ACCESS_ALL_FIELD)->value), 'User assign to all affiliates.'); - - // Assign two different node types to our test domain. - $domain_node5 = $this->drupalCreateNode(['type' => 'article', DOMAIN_ACCESS_FIELD => [$one]]); - $domain_node6 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$one]]); - $assigned = $this->manager->getAccessValues($domain_node5); - $this->assertTrue(isset($assigned[$one]), 'Node5 assigned to proper test domain.'); - $assigned = $this->manager->getAccessValues($domain_node6); - $this->assertTrue(isset($assigned[$one]), 'Node6 assigned to proper test domain.'); - - // Tests 'edit TYPE content on assigned domains'. - $this->assertNodeAccess([ - 'view' => TRUE, - 'update' => FALSE, - 'delete' => FALSE, - ], $domain_node5, $domain_user4); - $this->assertNodeAccess([ - 'view' => TRUE, - 'update' => TRUE, - 'delete' => TRUE, - ], $domain_node6, $domain_user4); - - } - - /** - * Tests domain access create permissions. - */ - public function testDomainAccessCreatePermissions() { - foreach ($this->domains as $domain) { - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - } - } - // Tests create permissions. Any content on assigned domains. - $domain_account5 = $this->drupalCreateUser(['access content', 'create domain content']); - $this->addDomainsToEntity('user', $domain_account5->id(), $two, DOMAIN_ACCESS_FIELD); - $domain_user5 = $this->userStorage->load($domain_account5->id()); - $assigned = $this->manager->getAccessValues($domain_user5); - $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.'); - $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.'); - // This test is domain sensitive. - foreach ($this->domains as $domain) { - $this->domainLogin($domain, $domain_account5); - $url = $domain->getPath() . 'node/add/page'; - $this->drupalGet($url); - if ($domain->id() == $two) { - $this->assertResponse(200); - } - else { - $this->assertResponse(403); - } - // The user should be allowed to create articles. - $url = $domain->getPath() . 'node/add/article'; - $this->drupalGet($url); - if ($domain->id() == $two) { - $this->assertResponse(200); - } - else { - $this->assertResponse(403); - } - } - - } - - /** - * Tests domain access limited create permissions. - */ - public function testDomainAccessLimitedCreatePermissions() { - foreach ($this->domains as $domain) { - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - } - } - // Tests create permissions. Any content on assigned domains. - $domain_account6 = $this->drupalCreateUser(['access content', 'create page content on assigned domains']); - $this->addDomainsToEntity('user', $domain_account6->id(), $two, DOMAIN_ACCESS_FIELD); - $domain_user6 = $this->userStorage->load($domain_account6->id()); - $assigned = $this->manager->getAccessValues($domain_user6); - $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.'); - $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.'); - // This test is domain sensitive. - foreach ($this->domains as $domain) { - $this->domainLogin($domain, $domain_account6); - $url = $domain->getPath() . 'node/add/page'; - $this->drupalGet($url); - if ($domain->id() == $two) { - $this->assertResponse(200); - } - else { - $this->assertResponse(403); - } - // The user should not be allowed to create articles. - $url = $domain->getPath() . 'node/add/article'; - $this->drupalGet($url); - $this->assertResponse(403); - } - } - - /** - * Asserts that node access correctly grants or denies access. - * - * @param array $ops - * An associative array of the expected node access grants for the node - * and account, with each key as the name of an operation (e.g. 'view', - * 'delete') and each value a Boolean indicating whether access to that - * operation should be granted. - * @param \Drupal\node\NodeInterface $node - * The node object to check. - * @param \Drupal\Core\Session\AccountInterface $account - * The user account for which to check access. - */ - public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterface $account) { - foreach ($ops as $op => $result) { - $this->assertEqual($result, $this->accessHandler->access($node, $op, $account), 'Expected result returned.'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php deleted file mode 100644 index 1328d3984..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php +++ /dev/null @@ -1,80 +0,0 @@ -domainCreateTestDomains(5); - // Assign a node to a random domain. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $active_domain = array_rand($domains, 1); - $domain = $domains[$active_domain]; - $node_storage = \Drupal::entityTypeManager()->getStorage('node'); - - // Create an article node. - $node1 = $this->drupalCreateNode([ - 'type' => 'article', - DOMAIN_ACCESS_FIELD => [$domain->id()], - DOMAIN_ACCESS_ALL_FIELD => 0, - ]); - $this->assertTrue($node_storage->load($node1->id()), 'Article node created.'); - - // Check to see if grants added by domain_node_access_records made it in. - $query = 'SELECT realm, gid, grant_view, grant_update, grant_delete FROM {node_access} WHERE nid = :nid'; - $records = Database::getConnection() - ->query($query, [':nid' => $node1->id()]) - ->fetchAll(); - - $this->assertEqual(count($records), 1, 'Returned the correct number of rows.'); - $this->assertEqual($records[0]->realm, 'domain_id', 'Grant with domain_id acquired for node.'); - $this->assertEqual($records[0]->gid, $domain->getDomainId(), 'Grant with proper id acquired for node.'); - $this->assertEqual($records[0]->grant_view, 1, 'Grant view stored.'); - $this->assertEqual($records[0]->grant_update, 1, 'Grant update stored.'); - $this->assertEqual($records[0]->grant_delete, 1, 'Grant delete stored.'); - - // Create another article node. - $node2 = $this->drupalCreateNode([ - 'type' => 'article', - DOMAIN_ACCESS_FIELD => [$domain->id()], - DOMAIN_ACCESS_ALL_FIELD => 1, - ]); - $this->assertTrue($node_storage->load($node2->id()), 'Article node created.'); - // Check to see if grants added by domain_node_access_records made it in. - $query = 'SELECT realm, gid, grant_view, grant_update, grant_delete FROM {node_access} WHERE nid = :nid ORDER BY realm'; - $records = Database::getConnection() - ->query($query, [':nid' => $node2->id()]) - ->fetchAll(); - $this->assertEqual(count($records), 2, 'Returned the correct number of rows.'); - $this->assertEqual($records[0]->realm, 'domain_id', 'Grant with domain_id acquired for node.'); - $this->assertEqual($records[0]->gid, $domain->getDomainId(), 'Grant with proper id acquired for node.'); - $this->assertEqual($records[0]->grant_view, 1, 'Grant view stored.'); - $this->assertEqual($records[0]->grant_update, 1, 'Grant update stored.'); - $this->assertEqual($records[0]->grant_delete, 1, 'Grant delete stored.'); - $this->assertEqual($records[1]->realm, 'domain_site', 'Grant with domain_site acquired for node.'); - $this->assertEqual($records[1]->gid, 0, 'Grant with proper id acquired for node.'); - $this->assertEqual($records[1]->grant_view, 1, 'Grant view stored.'); - $this->assertEqual($records[1]->grant_update, 0, 'Grant update stored.'); - $this->assertEqual($records[1]->grant_delete, 0, 'Grant delete stored.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php deleted file mode 100644 index fd06f9eb8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php +++ /dev/null @@ -1,76 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Basic test setup. - */ - public function testDomainAccessSave() { - $storage = \Drupal::entityTypeManager()->getStorage('node'); - // Save a node programatically. - $node = $storage->create([ - 'type' => 'article', - 'title' => 'Test node', - 'uid' => '1', - 'status' => 1, - DOMAIN_ACCESS_FIELD => ['example_com'], - DOMAIN_ACCESS_ALL_FIELD => 1, - ]); - $node->save(); - - // Load the node. - $node = $storage->load(1); - - // Check that two values are set properly. - $manager = \Drupal::service('domain_access.manager'); - $values = $manager->getAccessValues($node); - $this->assert(count($values) == 1, 'Node saved with one domain records.'); - $value = $manager->getAllValue($node); - $this->assert($value == 1, 'Node saved to all affiliates.'); - - // Save a node with different values. - $node = $storage->create([ - 'type' => 'article', - 'title' => 'Test node', - 'uid' => '1', - 'status' => 1, - DOMAIN_ACCESS_FIELD => ['example_com', 'one_example_com'], - DOMAIN_ACCESS_ALL_FIELD => 0, - ]); - $node->save(); - - // Load and check the node. - $node = $storage->load(2); - $values = $manager->getAccessValues($node); - $this->assert(count($values) == 2, 'Node saved with two domain records.'); - $value = $manager->getAllValue($node); - $this->assert($value == 0, 'Node not saved to all affiliates.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/README.md b/sites/all/modules/contrib/admin/domain/domain_alias/README.md deleted file mode 100644 index eea1623b8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/README.md +++ /dev/null @@ -1,182 +0,0 @@ -About aliases -==== - -Aliases define unique domains or patterns that map to existing domain records. -For example, you may want to have the following setup: - -* example.com (primary domain) -* my.example.com (active domain record) -* myexample.com (alias of the my.example.com record) - -In effect, myexample.com and my.example.com behave the same way from a Drupal -perspective. Aliases may also be made to redirect to their parent domain, if -preferred. - -Alias Patterns -==== - -The Drupal 8 version of Domain Alias supports multi-character wildcards as part -of the hostname. You can register an alias to a domain record in any of the -following patterns. -``` - *.example.com - example.*.com - example.com.* - *.*.example.com - example.*.*.com - example.* - example.*.* - example.*.*.* - *.com - *.example.* - example.com:8080 - example.com:* - example.*:* - *.com:* -``` -A maximum of three wildcards are supported. At least one element must not be a -wildcard. Ports may be wildcards as well, but are optional. - -Alias Matching -==== - -When a request is sent to Drupal, the domain negotiation system will look for a -matching record. The order of precedence is as follows. - -Example request: `one.example.com` - -1. Exact domain record match (`one.example.com`) -1. Exact alias match (`one.example.com`) -1. Wildcard match -``` - one.example.com - one.example.* - *.example.com - one.*.com - *.example.* - *.*.com - one.*.*, -``` -Note that wildcard matching happens _in the listed order_. The number of -wildcards is equal to the number of hostname parts minus 1. That is, you cannot register -an alias that is all wildcards. - -Port Matching -=== - -Port matching (e.g. example.com:8080) works exactly as hostname matching, with -one significant change. If the inbound request is on port 80, matches to the -base hostname are permitted, since port 80 is the default port for HTTP. - -For example, a request to example.com:80 will match the following aliases: -``` - example.com:80 - example.com - example.com:* - example.* - example.*:80 - example.*:* - *.com - *.com:80 - *.com:* -``` -Whereas a request to example.com:8080 will not match the hostname without a port -specified. -``` - example.com:8080 - example.com:* - example.*:8080 - example.*:* - *.com:8080 - *.com:* -``` - -Development Workflow -==== - -Aliases can be used to support development across different environments, with unique -URLs. To support this feature, there is now an `environment` field for each alias. The -default environment list is: - -* default -* local -* development -* staging -* testing - -This list may be overridden by setting the `domain_alias.environments` configuration in -settings.php. - -The operation of these environments is as follows: - -* If alias matching the environment is `default`, no changes occur. -* Else, matching aliases are loaded for all domains, so that links are rewritten to be -specific to the specified environment. (See `domain_alias_domain_load()` for the logic.) - -For instance, consider the following configuration. Your site's canonical domains are: - -* example.com -* foo.example.com -* bar.example.com - -When developing locally, developers use `.local` instead of `.com`. These should be -aliased to each domain as set as the `local` environment. - -* example.local > alias to example.com -* foo.example.local > alias to foo.example.com -* bar.example.local > alias to bar.example.com - -When pushing changes to the cloud, we use a development server. These are tied to a -specific cloud host (dev.mycloud.com). You can alias these to the `development` -environment. - -* example.dev.mycloud.com > alias to example.com -* foo.example.dev.mycloud.com > alias to foo.example.com -* bar.example.dev.mycloud.com > alias to bar.example.com - -The pattern can repeat for each of the environments listed above. The intended use of the -default set of environments is: - -* default -- indicates a canonical URL. No changes will be made. -* local -- for local development environments. -* development -- for a development integration server (such as those provided by Acquia, -Pantheon, and Platform.sh) -* staging -- for a pre-deployment server (such as those provided by Acquia, Panthon, and -Platform.sh) -* testing -- for continuous integration services (such as TravisCI or CircleCI). - -None of these environments are required. You may safely set all aliases to default if -your workflow does not span multiple server environments. - -How does it work? ----- - -This feature works by mapping each alias to an environment. If the active request matches -an alias that is set as an environment other than `default`, then matching environment -aliases are loaded for each domain. If a match is found, the `hostname` value for each -domain is overwritten. - -This overwrite affects the base path and request url that Domain module (and Domain Source) -use for writing links. - -Because the environments are specific to hostnames, this feature will only work if the -site's cache recognizes `url.site` as a required cache context. Without that, the render -system will cache the output of a request incorrectly. - -Configuration ----- - -To use this feature, the following steps must be followed: - -* `url.site` must be added as a required_cache_context to your `services.yml` file. -* Aliases must be mapped to a server environment. Default value is `default`. -* All aliases should be listed as part of `trusted_host_settings` in `settings.php`. - -Technical Notes -==== - -The matching follows an explicit sort order shown in DomainAliasSortTest. - -The code will attempt to match domains of different lengths when doing wildcard -matching in an environment. That is, an alias to `example.*` assigned to `local` should -return `example.local` if the active domain is `one.example.local`, assigned to `local`. diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml b/sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml deleted file mode 100644 index 41b02b54b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml +++ /dev/null @@ -1,6 +0,0 @@ -environments: - - default - - local - - development - - staging - - testing diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml b/sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml deleted file mode 100644 index 8b0320581..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Schema for the configuration files of the Domain Alias module. -domain_alias.settings: - type: config_object - label: 'Domain Alias settings' - mapping: - environments: - type: sequence - label: 'Development environments' - sequence: - type: string - label: 'Environment' - -domain_alias.alias.*: - type: config_entity - label: 'Domain alias' - mapping: - id: - type: string - label: 'ID' - uuid: - type: string - label: 'UUID' - domain_id: - type: string - label: 'Domain ID' - pattern: - type: string - label: 'Pattern' - redirect: - type: integer - label: 'Redirect' - environment: - type: string - label: 'Environment' diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml deleted file mode 100644 index b6adc6d03..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Domain Alias -description: 'Maps multiple host requests to a single domain record.' -type: module -package: Domain -# version: VERSION -# core: 8.x -dependencies: - - domain:domain - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install deleted file mode 100644 index 6b2f06aa9..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install +++ /dev/null @@ -1,33 +0,0 @@ -getEditable('domain_alias.settings'); - // Set and save new message value. - $environments = ['default', 'local', 'development', 'staging', 'testing']; - $config->set('environments', $environments)->save(); -} - -/** - * Updates domain_alias schema. - */ -function domain_alias_update_8001() { - $manager = \Drupal::entityDefinitionUpdateManager(); - // Regenerate entity type indexes. - $manager->updateEntityType($manager->getEntityType('domain_alias')); -} - -/** - * Adds domain_alias environment settings. - */ -function domain_alias_update_8002() { - // Set the default environments variable. - domain_alias_set_environments(); -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml deleted file mode 100644 index e8ad0ebce..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -domain_alias_add: - route_name: domain_alias.add - title: 'Add domain alias' - appears_on: - - domain_alias.admin diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml deleted file mode 100644 index 842ea90c2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -domain_alias.list: - title: 'Aliases' - route_name: domain_alias.admin - tab_root_id: entity.domain.edit_form diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module deleted file mode 100644 index bb4fa8c0b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module +++ /dev/null @@ -1,169 +0,0 @@ -getMatchType() == DomainNegotiator::DOMAIN_MATCH_EXACT) { - return; - } - // If no exact match, then run the alias load routine. - $hostname = $domain->getHostname(); - $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - /** @var \Drupal\domain_alias\Entity\DomainAlias $alias */ - if ($alias = $alias_storage->loadByHostname($hostname)) { - /** @var \Drupal\domain\Entity\Domain $domain */ - if ($domain = $domain_storage->load($alias->getDomainId())) { - $domain->addProperty('alias', $alias); - $domain->setMatchType(DomainNegotiator::DOMAIN_MATCH_ALIAS); - $redirect = $alias->getRedirect(); - if (!empty($redirect)) { - $domain->setRedirect($redirect); - } - } - else { - // If the domain did not load, report an error. - \Drupal::logger('domain_alias')->error('Found matching alias %alias for host request %hostname, but failed to load matching domain with id %id.', [ - '%alias' => $alias->getPattern(), - '%hostname' => $hostname, - '%id' => $alias->getDomainId(), - ]); - } - } -} - -/** - * Implements hook_domain_operations(). - */ -function domain_alias_domain_operations(DomainInterface $domain, AccountInterface $account) { - $operations = []; - // Check permissions. The user must be a super-admin or assigned to the - // domain. - $is_domain_admin = $domain->access('update', $account); - if ($account->hasPermission('administer domain aliases') || ($is_domain_admin && $account->hasPermission('view domain aliases'))) { - // Add aliases to the list of operations. - $operations['domain_alias'] = [ - 'title' => t('Aliases'), - 'url' => Url::fromRoute('domain_alias.admin', ['domain' => $domain->id()]), - 'weight' => 60, - ]; - } - return $operations; -} - -/** - * Implements hook_ENTITY_TYPE_load(). - */ -function domain_alias_domain_load($entities) { - static $enabled; - // We can only perform meaningful actions if url.site is a cache context. - // Otherwise, the render process ignores our changes. - if (!isset($enabled)) { - $required_cache_contexts = \Drupal::getContainer()->getParameter('renderer.config')['required_cache_contexts']; - if (!in_array('url.site', $required_cache_contexts) && !in_array('url', $required_cache_contexts)) { - $enabled = FALSE; - return; - } - $enabled = TRUE; - } - - // We cannot run before the negotiator service has fired. - $negotiator = \Drupal::service('domain.negotiator'); - $active = $negotiator->getActiveDomain(); - - // Do nothing if no domain is active. - if (is_null($active)) { - return; - } - - // Load and rewrite environment-specific aliases. - $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - if (isset($active->alias) && $active->alias->getEnvironment() != 'default') { - foreach ($entities as $id => $domain) { - if ($environment_aliases = $alias_storage->loadByEnvironmentMatch($domain, $active->alias->getEnvironment())) { - foreach ($environment_aliases as $environment_alias) { - $pattern = $environment_alias->getPattern(); - // Add a canonical property. - $domain->setCanonical(); - // Override the domain hostname and path. We always prefer a string - // match. - if (substr_count($pattern, '*') < 1) { - $domain->setHostname($pattern); - $domain->setPath(); - $domain->setUrl(); - break; - } - else { - // Do a wildcard replacement based on the current request. - $request = $negotiator->negotiateActiveHostname(); - // First, check for a wildcard port. - if (substr_count($pattern, ':*') > 0) { - // Do not replace ports unless they are nonstandard. See - // \Symfony\Component\HttpFoundation\Request\getHttpHost(). - if (substr_count($request, ':') > 0) { - $search = explode(':', $pattern); - $replace = explode(':', $request); - if (!empty($search[1]) && !empty($replace[1])) { - $pattern = str_replace(':' . $search[1], ':' . $replace[1], $pattern); - } - } - // If no port wildcard, then remove the port entirely. - else { - $pattern = str_replace(':*', '', $pattern); - } - } - - $replacements = ['.' => '\.', '*' => '(.+?)']; - $regex = '/^' . strtr($active->alias->getPattern(), $replacements) . '$/'; - if (preg_match($regex, $request, $matches) && isset($matches[1])) { - $pattern = str_replace('*', $matches[1], $pattern); - } - - // Do not let the domain loop back on itself. - if ($pattern != $domain->getCanonical()) { - $domain->setHostname($pattern); - $domain->setPath(); - $domain->setUrl(); - } - } - } - } - } - } -} - -/** - * Implements hook_ENTITY_TYPE_delete(). - */ -function domain_alias_domain_delete(EntityInterface $entity) { - $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - $properties = ['domain_id' => $entity->id()]; - foreach ($alias_storage->loadByProperties($properties) as $alias) { - $alias->delete(); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml deleted file mode 100644 index 88fd57655..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml +++ /dev/null @@ -1,14 +0,0 @@ -administer domain aliases: - title: 'Administer all domain aliases' - restrict access: true -create domain aliases: - title: 'Create domain aliases for assigned domains' - restrict access: true -edit domain aliases: - title: 'Edit domain aliases for assigned domains' - restrict access: true -delete domain aliases: - title: 'Delete domain aliases for assigned domains' - restrict access: true -view domain aliases: - title: 'View aliases for assigned domains' diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml deleted file mode 100644 index 8ac59e418..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml +++ /dev/null @@ -1,34 +0,0 @@ -domain_alias.admin: - path: '/admin/config/domain/alias/{domain}' - defaults: - _controller: '\Drupal\domain_alias\Controller\DomainAliasController::listing' - _title: 'Domain aliases' - _title_context: 'With modules' - requirements: - _entity_access: domain.update - _permission: 'view domain aliases' - -entity.domain_alias.edit_form: - path: '/admin/config/domain/alias/edit/{domain_alias}' - defaults: - _entity_form: domain_alias.edit - _title: 'Edit domain alias' - requirements: - _entity_access: domain_alias.update - -entity.domain_alias.delete_form: - path: '/admin/config/domain/alias/delete/{domain_alias}' - defaults: - _entity_form: domain_alias.delete - _title: 'Delete domain alias' - requirements: - _entity_access: domain_alias.delete - -domain_alias.add: - path: '/admin/config/domain/alias/{domain}/add' - defaults: - _controller: '\Drupal\domain_alias\Controller\DomainAliasController::addAlias' - _title: 'Add domain alias' - requirements: - _entity_access: domain.update - _permission: 'create domain aliases' diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml deleted file mode 100644 index 104563a94..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - domain_alias.validator: - class: Drupal\domain_alias\DomainAliasValidator - arguments: ['@config.factory', '@entity_type.manager'] - # @deprecated and will be removed for 8.x-1.0 release. - domain_alias.loader: - class: Drupal\domain_alias\DomainAliasLoader - arguments: ['@config.typed'] diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php deleted file mode 100644 index 93d1693a1..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php +++ /dev/null @@ -1,48 +0,0 @@ -id(); - - // Create the stub alias with reference to the parent domain. - $alias = $this->entityTypeManager()->getStorage('domain_alias')->create($values); - - return $this->entityFormBuilder()->getForm($alias); - } - - /** - * Provides the listing page for aliases. - * - * @param \Drupal\domain\DomainInterface $domain - * An domain record entity. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function listing(DomainInterface $domain) { - $list = $this->entityTypeManager()->getListBuilder('domain_alias'); - $list->setDomain($domain); - return $list->render(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php deleted file mode 100644 index 84c9b09db..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php +++ /dev/null @@ -1,46 +0,0 @@ -prepareUser($account); - // Check the global permission. - if ($account->hasPermission('administer domain aliases')) { - return AccessResult::allowed(); - } - // For other actions we allow admin if they can administer the parent - // domains. - $domain = $entity->getDomain(); - // If this account can administer the domain, allow access to actions based - // on permission. - if ($is_admin = $this->isDomainAdmin($domain, $account)) { - if ($operation == 'view' && $account->hasPermission('view domain aliases')) { - return AccessResult::allowed(); - } - if ($operation == 'create' && $account->hasPermission('create domain aliases')) { - return AccessResult::allowed(); - } - if ($operation == 'update' && $account->hasPermission('edit domain aliases')) { - return AccessResult::allowed(); - } - if ($operation == 'delete' && $account->hasPermission('delete domain aliases')) { - return AccessResult::allowed(); - } - } - return AccessResult::forbidden(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php deleted file mode 100644 index e033fd002..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php +++ /dev/null @@ -1,239 +0,0 @@ -validator = $validator; - $this->config = $config; - $this->entityTypeManager = $entity_type_manager; - $this->aliasStorage = $alias_storage; - $this->domainStorage = $domain_storage; - // Not loaded directly since it is not an interface. - $this->accessHandler = $this->entityTypeManager->getAccessControlHandler('domain'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('domain_alias.validator'), - $container->get('config.factory'), - $container->get('entity_type.manager'), - $container->get('entity_type.manager')->getStorage('domain_alias'), - $container->get('entity_type.manager')->getStorage('domain') - ); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - /** @var \Drupal\domain_alias\DomainAliasInterface $alias */ - $alias = $this->entity; - - $form['domain_id'] = [ - '#type' => 'value', - '#value' => $alias->getDomainId(), - ]; - $form['pattern'] = [ - '#type' => 'textfield', - '#title' => $this->t('Pattern'), - '#size' => 40, - '#maxlength' => 80, - '#default_value' => $alias->getPattern(), - '#description' => $this->t('The matching pattern for this alias.'), - '#required' => TRUE, - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => $alias->id(), - '#machine_name' => [ - 'source' => ['pattern'], - 'exists' => '\Drupal\domain_alias\Entity\DomainAlias::load', - ], - ]; - $form['redirect'] = [ - '#type' => 'select', - '#options' => $this->redirectOptions(), - '#default_value' => $alias->getRedirect(), - '#description' => $this->t('Set an optional redirect directive when this alias is invoked.'), - ]; - $environments = $this->environmentOptions(); - $form['environment'] = [ - '#type' => 'select', - '#options' => $environments, - '#default_value' => $alias->getEnvironment(), - '#description' => $this->t('Map the alias to a development environment.'), - ]; - $form['environment_help'] = [ - '#type' => 'details', - '#open' => FALSE, - '#collapsed' => TRUE, - '#title' => $this->t('Environment list'), - '#description' => $this->t('The table below shows the registered aliases for each environment.'), - ]; - - $domains = $this->domainStorage->loadMultipleSorted(); - $rows = []; - foreach ($domains as $domain) { - // If the user cannot edit the domain, then don't show in the list. - $access = $this->accessHandler->checkAccess($domain, 'update'); - if ($access->isForbidden()) { - continue; - } - $row = []; - $row[] = $domain->label(); - foreach ($environments as $environment) { - $match_output = []; - if ($environment == 'default') { - $match_output[] = $domain->getCanonical(); - } - $matches = $this->aliasStorage->loadByEnvironmentMatch($domain, $environment); - foreach ($matches as $match) { - $match_output[] = $match->getPattern(); - } - $output = [ - '#items' => $match_output, - '#theme' => 'item_list', - ]; - $row[] = \Drupal::service('renderer')->render($output); - } - $rows[] = $row; - } - - $form['environment_help']['table'] = [ - '#type' => 'table', - '#header' => array_merge([$this->t('Domain')], $environments), - '#rows' => $rows, - ]; - - return parent::form($form, $form_state); - } - - /** - * Returns a list of valid redirect options for the form. - * - * @return array - * A list of valid redirect options. - */ - public function redirectOptions() { - return [ - 0 => $this->t('Do not redirect'), - 301 => $this->t('301 redirect: Moved Permanently'), - 302 => $this->t('302 redirect: Found'), - ]; - } - - /** - * Returns a list of valid environement options for the form. - * - * @return array - * A list of valid environment options. - */ - public function environmentOptions() { - $list = $this->config->get('domain_alias.settings')->get('environments'); - $environments = []; - foreach ($list as $item) { - $environments[$item] = $item; - } - return $environments; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $errors = $this->validator->validate($this->entity); - if (!empty($errors)) { - $form_state->setErrorByName('pattern', $errors); - } - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - /** @var \Drupal\domain_alias\DomainAliasInterface $alias */ - $alias = $this->entity; - $edit_link = $alias->toLink($this->t('Edit'), 'edit-form')->toString(); - if ($alias->save() == SAVED_NEW) { - \Drupal::messenger()->addMessage($this->t('Created new domain alias.')); - $this->logger('domain_alias')->notice('Created new domain alias %name.', ['%name' => $alias->label(), 'link' => $edit_link]); - } - else { - \Drupal::messenger()->addMessage($this->t('Updated domain alias.')); - $this->logger('domain_alias')->notice('Updated domain alias %name.', ['%name' => $alias->label(), 'link' => $edit_link]); - } - $form_state->setRedirect('domain_alias.admin', ['domain' => $alias->getDomainId()]); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php deleted file mode 100644 index b4f341ab8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -t('Pattern'); - $header['redirect'] = $this->t('Redirect'); - $header['environment'] = $this->t('Environment'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row = []; - - $row['label'] = $entity->label(); - $redirect = $entity->getRedirect(); - $row['redirect'] = empty($redirect) ? $this->t('None') : $redirect; - $row['environment'] = $entity->getEnvironment(); - $row += parent::buildRow($entity); - - return $row; - } - - /** - * {@inheritdoc} - */ - public function render() { - $build = [ - '#theme' => 'table', - '#header' => $this->buildHeader(), - '#rows' => [], - '#empty' => $this->t('No aliases have been created for this domain.'), - ]; - foreach ($this->load() as $entity) { - if ($row = $this->buildRow($entity)) { - $build['#rows'][$entity->id()] = $row; - } - } - return $build; - } - - /** - * Loads entity IDs using a pager sorted by the entity id. - * - * @return array - * An array of entity IDs. - */ - protected function getEntityIds() { - $query = $this->getStorage()->getQuery() - ->condition('domain_id', $this->getDomainId()) - ->sort($this->entityType->getKey('id')); - - // Only add the pager if a limit is specified. - if ($this->limit) { - $query->pager($this->limit); - } - return $query->execute(); - } - - /** - * Sets the domain context for this list. - * - * @param \Drupal\domain\DomainInterface $domain - * The domain to set as context for the list. - */ - public function setDomain(DomainInterface $domain) { - $this->domain = $domain; - } - - /** - * Gets the domain context for this list. - * - * @return \Drupal\domain\DomainInterface - * The domain that is context for this list. - */ - public function getDomainId() { - // @TODO: check for a use-case where we might need to derive the id? - return !empty($this->domain) ? $this->domain->id() : NULL; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php deleted file mode 100644 index 06440f455..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php +++ /dev/null @@ -1,260 +0,0 @@ -typedConfig = $typed_config; - } - - /** - * {@inheritdoc} - */ - public function loadSchema() { - $fields = $this->typedConfig->getDefinition('domain_alias.alias.*'); - return isset($fields['mapping']) ? $fields['mapping'] : []; - } - - /** - * {@inheritdoc} - */ - public function load($id, $reset = FALSE) { - $controller = $this->getStorage(); - if ($reset) { - $controller->resetCache([$id]); - } - return $controller->load($id); - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $ids = NULL, $reset = FALSE) { - $controller = $this->getStorage(); - if ($reset) { - $controller->resetCache($ids); - } - return $controller->loadMultiple($ids); - } - - /** - * {@inheritdoc} - */ - public function loadByHostname($hostname) { - $patterns = $this->getPatterns($hostname); - foreach ($patterns as $pattern) { - if ($alias = $this->loadByPattern($pattern)) { - return $alias; - } - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function loadByPattern($pattern) { - $result = $this->getStorage()->loadByProperties(['pattern' => $pattern]); - if (empty($result)) { - return NULL; - } - return current($result); - } - - /** - * {@inheritdoc} - */ - public function loadByEnvironment($environment) { - $result = $this->getStorage()->loadByProperties(['environment' => $environment]); - if (empty($result)) { - return NULL; - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function loadByEnvironmentMatch(DomainInterface $domain, $environment) { - $result = $this->getStorage()->loadByProperties(['domain_id' => $domain->id(), 'environment' => $environment]); - if (empty($result)) { - return []; - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function sort($a, $b) { - // Fewer wildcards is a closer match. - // A longer string indicates a closer match. - if ((substr_count($a, '*') > substr_count($b, '*')) || (strlen($a) < strlen($b))) { - return 1; - } - return 0; - } - - /** - * Returns an array of eligible matching patterns. - * - * @param string $hostname - * A hostname string, in the format example.com. - * - * @return array - * An array of eligible matching patterns. - */ - public function getPatterns($hostname) { - $parts = explode('.', $hostname); - $count = count($parts); - // Account for ports. - if (substr_count($hostname, ':') > 0) { - $ports = explode(':', $parts[$count - 1]); - $parts[$count - 1] = preg_replace('/:(\d+)/', '', $parts[$count - 1]); - $parts[] = $ports[1]; - } - // Build the list of possible matching patterns. - $patterns = $this->buildPatterns($parts); - // Pattern lists are sorted based on the fewest wildcards. That gives us - // more precise matches first. - uasort($patterns, [$this, 'sort']); - array_unshift($patterns, $hostname); - - // Account for ports. - if (isset($ports)) { - $patterns = $this->buildPortPatterns($patterns, $hostname); - } - - // Return unique patters. - return array_unique($patterns); - } - - /** - * Builds a list of matching patterns. - * - * @param array $parts - * The hostname of the request, as an array split by dots. - * - * @return array - * An array of eligible matching patterns. - */ - private function buildPatterns(array $parts) { - $count = count($parts); - for ($i = 0; $i < $count; $i++) { - // Basic replacement of each value. - $temp = $parts; - $temp[$i] = '*'; - $patterns[] = implode('.', $temp); - // Advanced multi-value wildcards. - // Pattern *.*. - if (count($temp) > 2 && $i < ($count - 1)) { - $temp[$i + 1] = '*'; - $patterns[] = implode('.', $temp); - } - // Pattern foo.bar.*. - if ($count > 3 && $i < ($count - 2)) { - $temp[$i + 2] = '*'; - $patterns[] = implode('.', $temp); - } - // Pattern *.foo.*. - if ($count > 3 && $i < 2) { - $temp = $parts; - $temp[$i] = '*'; - $temp[$i + 2] = '*'; - $patterns[] = implode('.', $temp); - } - // Pattern *.foo.*.*. - if ($count > 2) { - $temp = array_fill(0, $count, '*'); - $temp[$i] = $parts[$i]; - $patterns[] = implode('.', $temp); - } - } - return $patterns; - } - - /** - * Builds a list of matching patterns, including ports. - * - * @param array $patterns - * An array of eligible matching patterns. - * @param string $hostname - * A hostname string, in the format example.com. - * - * @return array - * An array of eligible matching patterns, modified by port. - */ - private function buildPortPatterns(array $patterns, $hostname) { - foreach ($patterns as $index => $pattern) { - // Make a pattern for port wildcards. - if (substr_count($pattern, ':') < 1) { - $new = explode('.', $pattern); - $port = (int) array_pop($new); - $allow = FALSE; - // Do not allow *.* or *:*. - foreach ($new as $item) { - if ($item != '*') { - $allow = TRUE; - } - } - if ($allow) { - // For port 80, allow bare hostname matches. - if ($port == 80) { - // Base hostname with port. - $patterns[] = str_replace(':' . $port, '', $hostname); - // Base hostname is allowed. - $patterns[] = implode('.', $new); - } - // Base hostname with wildcard port. - $patterns[] = str_replace(':' . $port, ':*', $hostname); - // Pattern with exact port. - $patterns[] = implode('.', $new) . ':' . $port; - // Pattern with wildcard port. - $patterns[] = implode('.', $new) . ':*'; - } - unset($patterns[$index]); - } - } - return $patterns; - } - - /** - * Loads the storage controller. - * - * We use the loader very early in the request cycle. As a result, if we try - * to inject the storage container, we hit a circular dependency. Using this - * method at least keeps our code easier to update. - */ - protected function getStorage() { - $storage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - return $storage; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php deleted file mode 100644 index 2009e06f0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php +++ /dev/null @@ -1,104 +0,0 @@ -configFactory = $config_factory; - $this->uuidService = $uuid_service; - $this->languageManager = $language_manager; - $this->typedConfig = $typed_config; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('config.factory'), - $container->get('uuid'), - $container->get('language_manager'), - $container->get('config.typed') - ); - } - - /** - * {@inheritdoc} - */ - public function loadSchema() { - $fields = $this->typedConfig->getDefinition('domain_alias.alias.*'); - return isset($fields['mapping']) ? $fields['mapping'] : []; - } - - /** - * {@inheritdoc} - */ - public function loadByHostname($hostname) { - $patterns = $this->getPatterns($hostname); - foreach ($patterns as $pattern) { - if ($alias = $this->loadByPattern($pattern)) { - return $alias; - } - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function loadByPattern($pattern) { - $result = $this->loadByProperties(['pattern' => $pattern]); - if (empty($result)) { - return NULL; - } - return current($result); - } - - /** - * {@inheritdoc} - */ - public function loadByEnvironment($environment) { - $result = $this->loadByProperties(['environment' => $environment]); - if (empty($result)) { - return NULL; - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function loadByEnvironmentMatch(DomainInterface $domain, $environment) { - $result = $this->loadByProperties(['domain_id' => $domain->id(), 'environment' => $environment]); - if (empty($result)) { - return []; - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function sort($a, $b) { - // Fewer wildcards is a closer match. - // A longer string indicates a closer match. - if ((substr_count($a, '*') > substr_count($b, '*')) || (strlen($a) < strlen($b))) { - return 1; - } - return 0; - } - - /** - * Returns an array of eligible matching patterns. - * - * @param string $hostname - * A hostname string, in the format example.com. - * - * @return array - * An array of eligible matching patterns. - */ - public function getPatterns($hostname) { - $parts = explode('.', $hostname); - $count = count($parts); - // Account for ports. - if (substr_count($hostname, ':') > 0) { - $ports = explode(':', $parts[$count - 1]); - $parts[$count - 1] = preg_replace('/:(\d+)/', '', $parts[$count - 1]); - $parts[] = $ports[1]; - } - // Build the list of possible matching patterns. - $patterns = $this->buildPatterns($parts); - // Pattern lists are sorted based on the fewest wildcards. That gives us - // more precise matches first. - uasort($patterns, [$this, 'sort']); - array_unshift($patterns, $hostname); - - // Account for ports. - if (isset($ports)) { - $patterns = $this->buildPortPatterns($patterns, $hostname); - } - - // Return unique patters. - return array_unique($patterns); - } - - /** - * Builds a list of matching patterns. - * - * @param array $parts - * The hostname of the request, as an array split by dots. - * - * @return array - * An array of eligible matching patterns. - */ - private function buildPatterns(array $parts) { - $count = count($parts); - for ($i = 0; $i < $count; $i++) { - // Basic replacement of each value. - $temp = $parts; - $temp[$i] = '*'; - $patterns[] = implode('.', $temp); - // Advanced multi-value wildcards. - // Pattern *.*. - if (count($temp) > 2 && $i < ($count - 1)) { - $temp[$i + 1] = '*'; - $patterns[] = implode('.', $temp); - } - // Pattern foo.bar.*. - if ($count > 3 && $i < ($count - 2)) { - $temp[$i + 2] = '*'; - $patterns[] = implode('.', $temp); - } - // Pattern *.foo.*. - if ($count > 3 && $i < 2) { - $temp = $parts; - $temp[$i] = '*'; - $temp[$i + 2] = '*'; - $patterns[] = implode('.', $temp); - } - // Pattern *.foo.*.*. - if ($count > 2) { - $temp = array_fill(0, $count, '*'); - $temp[$i] = $parts[$i]; - $patterns[] = implode('.', $temp); - } - } - return $patterns; - } - - /** - * Builds a list of matching patterns, including ports. - * - * @param array $patterns - * An array of eligible matching patterns. - * @param string $hostname - * A hostname string, in the format example.com. - * - * @return array - * An array of eligible matching patterns, modified by port. - */ - private function buildPortPatterns(array $patterns, $hostname) { - foreach ($patterns as $index => $pattern) { - // Make a pattern for port wildcards. - if (substr_count($pattern, ':') < 1) { - $new = explode('.', $pattern); - $port = (int) array_pop($new); - $allow = FALSE; - // Do not allow *.* or *:*. - foreach ($new as $item) { - if ($item != '*') { - $allow = TRUE; - } - } - if ($allow) { - // For port 80, allow bare hostname matches. - if ($port == 80) { - // Base hostname with port. - $patterns[] = str_replace(':' . $port, '', $hostname); - // Base hostname is allowed. - $patterns[] = implode('.', $new); - } - // Base hostname with wildcard port. - $patterns[] = str_replace(':' . $port, ':*', $hostname); - // Pattern with exact port. - $patterns[] = implode('.', $new) . ':' . $port; - // Pattern with wildcard port. - $patterns[] = implode('.', $new) . ':*'; - } - unset($patterns[$index]); - } - } - return $patterns; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php deleted file mode 100644 index 8bf6d1933..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php +++ /dev/null @@ -1,76 +0,0 @@ -configFactory = $config_factory; - $this->entityTypeManager = $entity_type_manager; - $this->aliasStorage = $this->entityTypeManager->getStorage('domain_alias'); - $this->domainStorage = $this->entityTypeManager->getStorage('domain'); - } - - /** - * Validates the rules for a domain alias. - * - * @param \Drupal\domain_alias\DomainAliasInterface $alias - * The Domain Alias to validate. - * - * @return \Drupal\Core\StringTranslation\TranslatableMarkup - * A validation error message, if any. - */ - public function validate(DomainAliasInterface $alias) { - $pattern = $alias->getPattern(); - - // 1) Check for at least one dot or the use of 'localhost'. - // Note that localhost can specify a port. - $localhost_check = explode(':', $pattern); - if (substr_count($pattern, '.') == 0 && $localhost_check[0] != 'localhost') { - return $this->t('At least one dot (.) is required, except when using localhost.'); - } - - // 2) Check that the alias only has one wildcard. - $count = substr_count($pattern, '*') + substr_count($pattern, '?'); - if ($count > 1) { - return $this->t('You may only have one wildcard character in each alias.'); - } - // 3) Only one colon allowed, and it must be followed by an integer. - $count = substr_count($pattern, ':'); - if ($count > 1) { - return $this->t('You may only have one colon ":" character in each alias.'); - } - elseif ($count == 1) { - $int = substr($pattern, strpos($pattern, ':') + 1); - if (!is_numeric($int)) { - return $this->t('A colon may only be followed by an integer indicating the proper port.'); - } - } - // 4) Check that the alias doesn't contain any invalid characters. - // Check for valid characters, unless using non-ASCII domains. - $non_ascii = $this->configFactory->get('domain.settings')->get('allow_non_ascii'); - if (!$non_ascii) { - $check = preg_match('/^[a-z0-9\.\+\-\*\?:]*$/', $pattern); - if ($check == 0) { - return $this->t('The pattern contains invalid characters.'); - } - } - // 5) The alias cannot begin or end with a period. - if (substr($pattern, 0, 1) == '.') { - return $this->t('The pattern cannot begin with a dot.'); - } - if (substr($pattern, -1) == '.') { - return $this->t('The pattern cannot end with a dot.'); - } - - // 6) Check that the alias is not a direct match for a registered domain. - $check = preg_match('/[a-z0-9\.\+\-:]*$/', $pattern); - if ($check == 1 && $this->domainStorage->loadByHostname($pattern)) { - return $this->t('The pattern matches an existing domain record.'); - } - // 7) Check that the alias is unique across all records. - if ($alias_check = $this->aliasStorage->loadByPattern($pattern)) { - /** @var \Drupal\domain_alias\DomainAliasInterface $alias_check */ - if ($alias_check->id() != $alias->id()) { - return $this->t('The pattern already exists.'); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php deleted file mode 100644 index 99c756370..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -pattern; - } - - /** - * {@inheritdoc} - */ - public function getEnvironment() { - return !empty($this->environment) ? $this->environment : 'default'; - } - - /** - * {@inheritdoc} - */ - public function getDomainId() { - return $this->domain_id; - } - - /** - * {@inheritdoc} - */ - public function getDomain() { - $storage = \Drupal::entityTypeManager()->getStorage('domain'); - $domains = $storage->loadByProperties(['domain_id' => $this->domain_id]); - return $domains ? current($domains) : NULL; - } - - /** - * {@inheritdoc} - */ - public function getRedirect() { - return $this->redirect; - } - - /** - * {@inheritdoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - parent::postSave($storage, $update); - // Invalidate cache tags relevant to domains. - \Drupal::service('cache_tags.invalidator')->invalidateTags(['rendered', 'url.site']); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php deleted file mode 100644 index cd8cc6220..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php +++ /dev/null @@ -1,22 +0,0 @@ - $this->entity->getDomainId(), - ]); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php deleted file mode 100644 index 2e84ba322..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php +++ /dev/null @@ -1,26 +0,0 @@ -admin_user = $this->drupalCreateUser(['administer domains', 'access administration pages']); - $this->drupalLogin($this->admin_user); - - // Create test domains. - $this->domainCreateTestDomains(3); - - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias'); - $domains = $domain_storage->loadMultiple(); - - // Save these for later testing. - $original_domains = $domains; - - $base = $this->baseHostname; - $hostnames = [$base, 'one.' . $base, 'two.' . $base]; - - // Our patterns should map to example.com, one.example.com, two.example.com. - $patterns = ['*.' . $base, 'four.' . $base, 'five.' . $base]; - $i = 0; - foreach ($domains as $domain) { - $this->assert($domain->getHostname() == $hostnames[$i], 'Hostnames set correctly'); - $this->assert($domain->getCanonical() == $hostnames[$i], 'Canonical domains set correctly'); - $values = [ - 'domain_id' => $domain->id(), - 'pattern' => array_shift($patterns), - 'redirect' => 0, - 'environment' => 'local', - ]; - $this->createDomainAlias($values); - $i++; - } - - $path = $domain->getScheme() . 'five.' . $base . '/admin/config/domain'; - - // Visit the domain overview administration page. - $this->drupalGet($path); - $this->assertResponse(200); - - // Test the domains. - $domains = $domain_storage->loadMultiple(); - $this->assertTrue(count($domains) == 3, 'Three domain records found.'); - - // Check the default domain. - $default = $domain_storage->loadDefaultId(); - $key = 'example_com'; - $this->assertTrue($default == $key, 'Default domain set correctly.'); - - // Test some text on the page. - foreach ($domains as $domain) { - $name = $domain->label(); - $this->assertText($name, 'Name found properly.'); - } - // Test the list of actions. - $actions = ['delete', 'disable', 'default']; - foreach ($actions as $action) { - $this->assertRaw("/domain/{$action}/", 'Actions found properly.'); - } - // Check that all domains are active. - $this->assertNoRaw('Inactive', 'Inactive domain not found.'); - - // Disable a domain and test the enable link. - $this->clickLink('Disable', 0); - $this->assertRaw('Inactive', 'Inactive domain found.'); - - // Visit the domain overview administration page to clear cache. - $this->drupalGet($path); - $this->assertResponse(200); - - foreach ($domain_storage->loadMultiple() as $domain) { - if ($domain->id() == 'one_example_com') { - $this->assertEmpty($domain->status(), 'One domain inactive.'); - } - else { - $this->assertNotEmpty($domain->status(), 'Other domains active.'); - } - } - - // Test the list of actions. - $actions = ['enable', 'delete', 'disable', 'default']; - foreach ($actions as $action) { - $this->assertRaw("/domain/{$action}/", 'Actions found properly.'); - } - // Re-enable the domain. - $this->clickLink('Enable', 0); - $this->assertNoRaw('Inactive', 'Inactive domain not found.'); - - // Visit the domain overview administration page to clear cache. - $this->drupalGet($path); - $this->assertResponse(200); - - foreach ($domain_storage->loadMultiple() as $domain) { - $this->assertNotEmpty($domain->status(), 'All domains active.'); - } - - // Set a new default domain. - $this->clickLink('Make default', 0); - - // Visit the domain overview administration page to clear cache. - $this->drupalGet($path); - $this->assertResponse(200); - - // Check the default domain. - $domain_storage->resetCache(); - $default = $domain_storage->loadDefaultId(); - $key = 'one_example_com'; - $this->assertTrue($default == $key, 'Default domain set correctly.'); - - // Did the hostnames change accidentally? - foreach ($domain_storage->loadMultiple() as $id => $domain) { - $this->assertTrue($domain->getHostname() == $original_domains[$id]->getHostname(), 'Hostnames match.'); - } - - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php deleted file mode 100644 index 3e4dd3e28..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php +++ /dev/null @@ -1,95 +0,0 @@ -domainCreateTestDomains(3); - } - - /** - * Test for environment matching. - */ - public function testDomainAliasEnvironments() { - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias'); - $domains = $domain_storage->loadMultipleSorted(NULL, TRUE); - // Our patterns should map to example.com, one.example.com, two.example.com. - $patterns = ['*.example.com', 'four.example.com', 'five.example.com']; - foreach ($domains as $domain) { - $values = [ - 'domain_id' => $domain->id(), - 'pattern' => array_shift($patterns), - 'redirect' => 0, - 'environment' => 'local', - ]; - $this->createDomainAlias($values); - } - // Test the environment loader. - $local = $alias_loader->loadByEnvironment('local'); - $this->assert(count($local) == 3, 'Three aliases set to local'); - // Test the environment matcher. $domain here is two.example.com. - $match = $alias_loader->loadByEnvironmentMatch($domain, 'local'); - $this->assert(count($match) == 1, 'One environment match loaded'); - $alias = current($match); - $this->assert($alias->getPattern() == 'five.example.com', 'Proper pattern match loaded.'); - - // Set one alias to a different environment. - $alias->set('environment', 'testing')->save(); - $local = $alias_loader->loadByEnvironment('local'); - $this->assert(count($local) == 2, 'Two aliases set to local'); - // Test the environment matcher. $domain here is two.example.com. - $matches = $alias_loader->loadByEnvironmentMatch($domain, 'local'); - $this->assert(count($matches) == 0, 'No environment matches loaded'); - - // Test the environment matcher. $domain here is one.example.com. - $domain = $domain_storage->load('one_example_com'); - $matches = $alias_loader->loadByEnvironmentMatch($domain, 'local'); - $this->assert(count($matches) == 1, 'One environment match loaded'); - $alias = current($matches); - $this->assert($alias->getPattern() == 'four.example.com', 'Proper pattern match loaded.'); - - // Now load a page and check things. - // Since we cannot read the service request, we place a block - // which shows links to all domains. - $this->drupalPlaceBlock('domain_switcher_block'); - - // To get around block access, let the anon user view the block. - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']); - // For a non-aliased request, the url list should be normal. - $this->drupalGet($domain->getPath()); - foreach ($domains as $domain) { - $this->assertSession()->assertEscaped($domain->getHostname()); - $this->assertSession()->linkByHrefExists($domain->getPath(), 0, 'Link found: ' . $domain->getPath()); - } - // For an aliased request (four.example.com), the list should be aliased. - $url = $domain->getScheme() . $alias->getPattern() . $domain->getPort(); - $this->drupalGet($url); - foreach ($matches as $match) { - $this->assertSession()->assertEscaped($match->getPattern()); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php deleted file mode 100644 index dc5a971f2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php +++ /dev/null @@ -1,101 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Basic test setup. - */ - public function testDomainListBuilder() { - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'administer domain aliases', - 'view domain aliases', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Check that links are printed. - foreach ($this->getDomains() as $domain) { - $href = 'admin/config/domain/alias/' . $domain->id(); - $this->assertSession()->linkByHrefExists($href, 0, 'Link found'); - } - - // Now login as a user with limited rights. - $account = $this->drupalCreateUser([ - 'create article content', - 'edit any article content', - 'edit assigned domains', - 'view domain list', - 'view domain aliases', - 'edit domain aliases', - ]); - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD); - $user_storage = \Drupal::entityTypeManager()->getStorage('user'); - $user = $user_storage->load($account->id()); - $manager = \Drupal::service('domain.element_manager'); - $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD); - $this->assert(count($values) == 2, 'User saved with two domain records.'); - - $this->drupalLogin($account); - - $this->drupalGet('admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Check that links are printed. - $path = 'admin/config/domain/'; - $this->drupalGet($path); - foreach ($this->getDomains() as $domain) { - $href = 'admin/config/domain/alias/' . $domain->id(); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->linkByHrefExists($href, 0, 'Link found'); - } - else { - $this->assertSession()->linkByHrefNotExists($href, 'Link not found'); - } - } - - // Check access to the pages/routes. - foreach ($this->getDomains() as $domain) { - $path = 'admin/config/domain/alias/' . $domain->id(); - $this->drupalGet($path); - if (in_array($domain->id(), $ids)) { - $this->assertSession()->statusCodeEquals(200); - } - else { - $this->assertSession()->statusCodeEquals(403); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php deleted file mode 100644 index 1d392f79a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php +++ /dev/null @@ -1,83 +0,0 @@ -domainCreateTestDomains(3); - } - - /** - * Test for environment matching. - */ - public function testDomainAliasEnvironments() { - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias'); - $domains = $domain_storage->loadMultiple(); - - $base = $this->baseHostname; - $hostnames = [$base, 'one.' . $base, 'two.' . $base]; - - // Our patterns should map to example.com, one.example.com, two.example.com. - $patterns = ['*.' . $base, 'four.' . $base, 'five.' . $base]; - $i = 0; - foreach ($domains as $domain) { - $this->assert($domain->getHostname() == $hostnames[$i], 'Hostnames set correctly'); - $this->assert($domain->getCanonical() == $hostnames[$i], 'Canonical domains set correctly'); - $values = [ - 'domain_id' => $domain->id(), - 'pattern' => array_shift($patterns), - 'redirect' => 0, - 'environment' => 'local', - ]; - $this->createDomainAlias($values); - $i++; - } - // Test the environment loader. - $local = $alias_loader->loadByEnvironment('local'); - $this->assert(count($local) == 3, 'Three aliases set to local'); - // Test the environment matcher. $domain here is two.example.com. - $match = $alias_loader->loadByEnvironmentMatch($domain, 'local'); - $this->assert(count($match) == 1, 'One environment match loaded'); - $alias = current($match); - $this->assert($alias->getPattern() == 'five.' . $base, 'Proper pattern match loaded.'); - - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - ]); - $this->drupalLogin($admin); - - // Load an aliased domain. - $this->drupalGet($domain->getScheme() . 'five.' . $base . '/admin/config/domain'); - $this->assertSession()->statusCodeEquals(200); - - // Save the form. - $this->pressButton('edit-submit'); - // Ensure the values haven't changed. - $i = 0; - $domains = $domain_storage->loadMultiple(); - foreach ($domains as $domain) { - $this->assert($domain->getHostname() == $hostnames[$i], 'Hostnames set correctly'); - $this->assert($domain->getCanonical() == $hostnames[$i], 'Canonical domains set correctly'); - $i++; - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php deleted file mode 100644 index 4f39ab300..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php +++ /dev/null @@ -1,110 +0,0 @@ -domainTableIsEmpty(); - - // Create two new domains programmatically. - $this->domainCreateTestDomains(2); - - // Since we cannot read the service request, we place a block - // which shows the current domain information. - $this->drupalPlaceBlock('domain_server_block'); - - // To get around block access, let the anon user view the block. - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']); - - // Set the storage handles. - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - - // Set known prefixes that work with our tests. This will give us domains - // 'example.com' and 'one.example.com' aliased to 'two.example.com' and - // 'three.example.com'. - $prefixes = ['two', 'three']; - // Test the response of each home page. - /** @var \Drupal\domain\Entity\Domain $domain */ - foreach ($domain_storage->loadMultiple() as $domain) { - $alias_domains[] = $domain; - $this->drupalGet($domain->getPath()); - $this->assertRaw($domain->label(), 'Loaded the proper domain.'); - $this->assertRaw('Exact match', 'Direct domain match.'); - } - - // Now, test an alias for each domain. - foreach ($alias_domains as $index => $alias_domain) { - $prefix = $prefixes[$index]; - // Set a known pattern. - $pattern = $prefix . '.' . $this->baseHostname; - $this->domainAliasCreateTestAlias($alias_domain, $pattern); - $alias = $alias_storage->loadByPattern($pattern); - // Set the URL for the request. Note that this is not saved, it is just - // URL generation. - $alias_domain->set('hostname', $pattern); - $alias_domain->setPath(); - $url = $alias_domain->getPath(); - $this->drupalGet($url); - $this->assertRaw($alias_domain->label(), 'Loaded the proper domain.'); - $this->assertRaw('ALIAS:', 'No direct domain match.'); - $this->assertRaw($alias->getPattern(), 'Alias match.'); - - // Test redirections. - // @TODO: This could be much more elegant: the redirects break assertRaw() - $alias->set('redirect', 301); - $alias->save(); - $this->drupalGet($url); - $alias->set('redirect', 302); - $alias->save(); - $this->drupalGet($url); - } - // Test a wildcard alias. - // @TODO: Refactor this test to merge with the above. - $alias_domain = $domain_storage->loadDefaultDomain(); - $pattern = '*.' . $this->baseHostname; - $this->domainAliasCreateTestAlias($alias_domain, $pattern); - $alias = $alias_storage->loadByPattern($pattern); - // Set the URL for the request. Note that this is not saved, it is just - // URL generation. - $alias_domain->set('hostname', 'four.' . $this->baseHostname); - $alias_domain->setPath(); - $url = $alias_domain->getPath(); - $this->drupalGet($url); - $this->assertRaw($alias_domain->label(), 'Loaded the proper domain.'); - $this->assertRaw('ALIAS:', 'No direct domain match.'); - $this->assertRaw($alias->getPattern(), 'Alias match.'); - - // Test redirections. - // @TODO: This could be much more elegant: the redirects break assertRaw() - $alias->set('redirect', 301); - $alias->save(); - $this->drupalGet($url); - $alias->set('redirect', 302); - $alias->save(); - $this->drupalGet($url); - - // Revoke the permission change. - user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php deleted file mode 100644 index 204443976..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php +++ /dev/null @@ -1,82 +0,0 @@ -sortList(); - - $storage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - foreach ($list as $key => $values) { - $patterns = $storage->getPatterns($key); - $this->assertTrue(empty(array_diff($values, $patterns)), 'Pattern matched as expected for ' . $key); - } - } - - /** - * An array of expected matches to specific domains. - */ - private function sortList() { - return [ - 'example.com' => [ - 'example.com', - 'example.*', - '*.com', - ], - 'one.example.com' => [ - 'one.example.com', - 'one.example.*', - '*.example.com', - 'one.*.com', - '*.example.*', - '*.*.com', - 'one.*.*', - ], - 'one.two.example.com' => [ - 'one.two.example.com', - '*.two.example.com', - 'one.two.example.*', - 'one.*.example.com', - '*.*.example.com', - 'one.two.*.com', - 'one.*.example.*', - 'one.*.*.com', - '*.two.*.com', - 'one.two.*.*', - '*.*.example.com', - '*.*.*.com', - 'one.*.*.*', - '*.two.*.*', - ], - 'example.com:80' => [ - 'example.com:80', - 'example.com', - 'example.*', - 'example.com:*', - 'example.*:80', - 'example.*:*', - '*.com', - '*.com:80', - '*.com:*', - ], - 'example.com:8080' => [ - 'example.com:8080', - 'example.com:*', - 'example.*:8080', - 'example.*:*', - '*.com:8080', - '*.com:*', - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php deleted file mode 100644 index a7af96f78..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php +++ /dev/null @@ -1,22 +0,0 @@ -domainTableIsEmpty(); - $validator = \Drupal::service('domain_alias.validator'); - - // Create a domain. - $this->domainCreateTestDomains(1, 'foo.com'); - // Check the created domain based on it's known id value. - $key = 'foo.com'; - /** @var \Drupal\domain\Entity\Domain $domain */ - $domain = \Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($key); - $this->assertTrue(!empty($domain), 'Test domain created.'); - - // Valid patterns to test. Valid is the boolean value. - $patterns = [ - 'localhost' => 1, - 'example.com' => 1, - // See www-prefix test, below. - 'www.example.com' => 1, - '*.example.com' => 1, - 'one.example.com' => 1, - 'example.com:8080' => 1, - // Must have a dot or be localhost. - 'foobar' => 0, - // Only one wildcard. - '*.*.example.com' => 0, - // Only one colon. - 'example.com::8080' => 0, - // No letters after a colon. - 'example.com:abc' => 0, - // Cannot begin with a dot. - '.example.com' => 0, - // Cannot end with a dot. - 'example.com.' => 0, - // Lowercase only. - 'EXAMPLE.com' => 0, - // ascii-only. - 'éxample.com' => 0, - // duplicate. - 'foo.com' => 0, - ]; - foreach ($patterns as $pattern => $valid) { - $alias = $this->domainAliasCreateTestAlias($domain, $pattern, 0, 'default', FALSE); - $errors = $validator->validate($alias); - if ($valid) { - $this->assertTrue(empty($errors), 'Validation test success.'); - } - else { - $this->assertTrue(!empty($errors), 'Validation test success.'); - } - } - // Test the configurable option. - $config = $this->config('domain.settings'); - $config->set('allow_non_ascii', TRUE)->save(); - // Valid hostnames to test. Valid is the boolean value. - $patterns = [ - // ascii-only allowed. - 'éxample.com' => 1, - ]; - foreach ($patterns as $pattern => $valid) { - $alias = $this->domainAliasCreateTestAlias($domain, $pattern, 0, 'default', FALSE); - $errors = $validator->validate($alias); - if ($valid) { - $this->assertTrue(empty($errors), 'Validation test success.'); - } - else { - $this->assertTrue(!empty($errors), 'Validation test success.'); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php deleted file mode 100644 index 218ab80b3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php +++ /dev/null @@ -1,87 +0,0 @@ -domainCreateTestDomains(3); - } - - /** - * Test for environment matching. - */ - public function testDomainAliasWildcards() { - $domain_storage = \Drupal::entityTypeManager()->getStorage('domain'); - $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias'); - $domains = $domain_storage->loadMultipleSorted(NULL, TRUE); - // Our patterns should map to example.com, one.example.com, two.example.com. - $patterns = ['example.*', 'four.example.*', 'five.example.*']; - foreach ($domains as $domain) { - $values = [ - 'domain_id' => $domain->id(), - 'pattern' => array_shift($patterns), - 'redirect' => 0, - 'environment' => 'local', - ]; - $this->createDomainAlias($values); - } - // Test the environment loader. - $local = $alias_loader->loadByEnvironment('local'); - $this->assert(count($local) == 3, 'Three aliases set to local'); - // Test the environment matcher. $domain here is two.example.com. - $match = $alias_loader->loadByEnvironmentMatch($domain, 'local'); - $this->assert(count($match) == 1, 'One environment match loaded'); - $alias = current($match); - $this->assert($alias->getPattern() == 'five.example.*', 'Proper pattern match loaded.'); - - // Test the environment matcher. $domain here is one.example.com. - $domain = $domain_storage->load('example_com'); - $matches = $alias_loader->loadByEnvironmentMatch($domain, 'local'); - $this->assert(count($matches) == 1, 'One environment match loaded'); - $alias = current($matches); - $this->assert($alias->getPattern() == 'example.*', 'Proper pattern match loaded.'); - - // Now load a page and check things. - // Since we cannot read the service request, we place a block - // which shows links to all domains. - $this->drupalPlaceBlock('domain_switcher_block'); - - // To get around block access, let the anon user view the block. - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']); - // For a non-aliased request, the url list should be normal. - $this->drupalGet($domain->getPath()); - foreach ($domains as $domain) { - $this->assertSession()->assertEscaped($domain->getHostname()); - $this->assertSession()->linkByHrefExists($domain->getPath(), 0, 'Link found: ' . $domain->getPath()); - } - // For an aliased request (four.example.com), the list should be aliased. - $url = $domain->getScheme() . str_replace('*', 'com', $alias->getPattern()) . $domain->getPort(); - $this->drupalGet($url); - foreach ($matches as $match) { - $this->assertSession()->assertEscaped(str_replace('*', 'com', $match->getPattern())); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php deleted file mode 100644 index 94fe73fad..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php +++ /dev/null @@ -1,86 +0,0 @@ -domainCreateTestDomains(2); - - // Get the services. - $this->domainStorage = \Drupal::entityTypeManager()->getStorage('domain'); - $this->aliasStorage = \Drupal::entityTypeManager()->getStorage('domain_alias'); - } - - /** - * Tests alias deletion on domain deletion. - */ - public function testDomainDelete() { - $domains = $this->domainStorage->loadMultiple(); - $patterns = [ - 'example_com' => '*.example.com', - 'one_example_com' => 'foo.example.com', - ]; - - // Create an alias. - foreach ($domains as $id => $domain) { - $values = [ - 'domain_id' => $domain->id(), - 'pattern' => $patterns[$id], - 'redirect' => 0, - 'environment' => 'local', - ]; - $this->createDomainAlias($values); - $alias = $this->aliasStorage->loadByPattern($patterns[$id]); - $this->assertTrue(!empty($alias), 'Alias saved properly'); - } - - // Delete one domain. - $domain->delete(); - $alias = $this->aliasStorage->loadByPattern($patterns[$id]); - $this->assertTrue(empty($alias), 'Alias deleted properly'); - - // Check the remaining domain, which should still have an alias. - $domain = $this->domainStorage->load('example_com'); - $alias = $this->aliasStorage->loadByPattern($patterns[$domain->id()]); - $this->assertTrue(!empty($alias), 'Alias retained properly'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php deleted file mode 100644 index bc7e1fffe..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php +++ /dev/null @@ -1,67 +0,0 @@ -getStorage('domain_alias')->create($values); - if ($save) { - $alias->save(); - } - - return $alias; - } - - /** - * Creates an alias for testing without passing values. - * - * @param \Drupal\domain\DomainInterface $domain - * A domain entity. - * @param string $pattern - * An optional alias pattern. - * @param int $redirect - * An optional redirect (301 or 302). - * @param int $environment - * An optional environment string. - * @param bool $save - * Whether to save the alias or return for validation. - * - * @return \Drupal\domain_alias\Entity\DomainAlias - * A domain alias entity. - */ - public function domainAliasCreateTestAlias(DomainInterface $domain, $pattern = NULL, $redirect = 0, $environment = 'default', $save = TRUE) { - if (empty($pattern)) { - $pattern = '*.' . $domain->getHostname(); - } - $values = [ - 'domain_id' => $domain->id(), - 'pattern' => $pattern, - 'redirect' => $redirect, - 'environment' => $environment, - ]; - - return $this->createDomainAlias($values, $save); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/README.md b/sites/all/modules/contrib/admin/domain/domain_config/README.md deleted file mode 100644 index 9b5138b58..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/README.md +++ /dev/null @@ -1,121 +0,0 @@ -Domain Config -============= - -This module provides a per-domain configuration option so that, for each -domain, you can change configuration items of any type, such as settings like -the site name. - -By default, these overrides are also language-aware. An override may exist per -domain, or per-language per domain, based on the prefixes used in the config -file. - -Usage -===== - -Currently, there is no user interface for changing settings, but you can load -in new files that contain configuration per domain. - -The pattern for override files is -`domain.config.DOMAIN_MACHINE_NAME.LANGCODE.item.name`, with the backup for -language-insensitive files as `domain.config.DOMAIN_MACHINE_NAME.item.name`, -where `item.name` is the name of the configuration item being overridden. - -To override the site name, for instance, you begin by exporting the -corresponding configuration item at the Configuration Synchronization screen -for a single export: -`admin/config/development/configuration/single/export` - -In this case, the type of configuration to be exported is "Simple -configuration" and the particular item is named `system.site`. - -You should have a file like the following: - -```YAML -uuid: 536db351-7aec-407e-a746-70ba9cc9f190 -name: Example -mail: admin@example.com -slogan: '' -page: - 403: '' - 404: '' - front: /user -admin_compact_mode: false -weight_select_max: 100 -langcode: en -default_langcode: en -``` - -An override file should contain only the specific data that you want to -override. To override the name, the only line needed is the one beginning - ```name:```. The resulting override looks like this: - -```YAML -name: Three -``` - -To override both the name and the slogan: - -```YAML -name: Three -slogan: 'My site slogan' -``` - -*Warning: do not copy over the `uuid` value into the new file. Doing so may -cause the configuration import to fail.* - -We want this to apply when the domain `three.example.com` is active and English -is the active language. Therefore, this file would be named -`domain.config.three_example_com.en.system.site`. If we wanted this file to -apply whenever the domain `three.example.com` is active, we would leave off the -language prefix: `domain.config.three_example_com.system.site`. - -For further examples, see the files in -`\domain\domain_config\tests\modules\domain_config_test\config\install`. - -Import that file's contents at the Configuration Synchronization screen for a -single import: -`admin/config/development/configuration/single/import` - -Note that, unlike when you exported the item, here you always select "Simple -configuration" as the configuration type to import, independent of the type of -configuration you're overriding. - -settings.php overrides ----------------------- - -For environment-specific or sensitive overrides, use the settings.php method. -In the above case, add: - -`$config['domain.config.three_example_com.en.system.site']['name'] = "My special site";` - -to your local settings.php file. This will ensure that the `three.example.com` -domain gets the correct value regardless of other module overrides. If you do -not have a language set the config system will fallback on the domain-specific -setting (note the missing '.en'): - -`$config['domain.config.three_example_com.system.site']['name'] = "My special site";` - -To set nested values you need to nest the config array: - -`$config['domain.config.three_example_com.system.site']['page']['front'] = '/node/1;` - -Read more about the "Configuration override system" at -https://www.drupal.org/node/1928898. - -Installation -============ - -If some variable changes are not picked up when the page renders, you may need -add domain-sensitivity to the site's cache. - -To do so, clone `default.services.yml` to `services.yml` and change the -`required_cache_contexts` value to: - -```YAML - required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions', 'url.site'] -``` - -Dependencies -============ - -- Domain diff --git a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml deleted file mode 100644 index dae75bca8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Domain Configuration -description: 'Allows domain specific configuration.' -type: module -package: Domain -# version: VERSION -# core: 8.x -dependencies: - - domain:domain - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.module b/sites/all/modules/contrib/admin/domain/domain_config/domain_config.module deleted file mode 100644 index bb26c0250..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.module +++ /dev/null @@ -1,6 +0,0 @@ -domain = $domainNegotiator->getActiveDomain(); - } - - /** - * {@inheritdoc} - */ - protected function getCid() { - if (!isset($this->cid)) { - $domain_id = 'null'; - if (!empty($this->domain)) { - $domain_id = $this->domain->id(); - } - $this->cid = 'library_info:' . $domain_id . ':' . $this->themeManager->getActiveTheme()->getName(); - } - - return $this->cid; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php b/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php deleted file mode 100644 index 97f3ec09e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php +++ /dev/null @@ -1,221 +0,0 @@ -storage = $storage; - $this->moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - public function loadOverrides($names) { - // Try to prevent repeating lookups. - static $lookups; - // Key should be a known length, so hash. - $key = md5(implode(':', $names)); - if (isset($lookups[$key])) { - return $lookups[$key]; - } - - // Set the context of the override request. - if (empty($this->contextSet)) { - $this->initiateContext(); - } - - // Prepare our overrides. - $overrides = []; - // loadOverrides() runs on config entities, which means that if we try - // to run this routine on our own data, then we end up in an infinite loop. - // So ensure that we are _not_ looking up a domain.record.*. - $check = current($names); - $list = explode('.', $check); - if (isset($list[0]) && isset($list[1]) && $list[0] == 'domain' && $list[1] == 'record') { - $lookups[$key] = $overrides; - return $overrides; - } - if (!empty($this->domain)) { - foreach ($names as $name) { - $config_name = $this->getDomainConfigName($name, $this->domain); - // Check to see if the config storage has an appropriately named file - // containing override data. - if ($override = $this->storage->read($config_name['langcode'])) { - $overrides[$name] = $override; - } - // Check to see if we have a file without a specific language. - elseif ($override = $this->storage->read($config_name['domain'])) { - $overrides[$name] = $override; - } - - // Apply any settings.php overrides. - if (isset($GLOBALS['config'][$config_name['langcode']])) { - $overrides[$name] = $GLOBALS['config'][$config_name['langcode']]; - } - elseif (isset($GLOBALS['config'][$config_name['domain']])) { - $overrides[$name] = $GLOBALS['config'][$config_name['domain']]; - } - } - $lookups[$key] = $overrides; - } - - return $overrides; - } - - /** - * Get configuration name for this hostname. - * - * It will be the same name with a prefix depending on domain and language: - * @code domain.config.DOMAIN_ID.LANGCODE @endcode - * - * @param string $name - * The name of the config object. - * @param \Drupal\domain\DomainInterface $domain - * The domain object. - * - * @return array - * The domain-language, and domain-specific config names. - */ - protected function getDomainConfigName($name, DomainInterface $domain) { - return [ - 'langcode' => 'domain.config.' . $domain->id() . '.' . $this->language->getId() . '.' . $name, - 'domain' => 'domain.config.' . $domain->id() . '.' . $name, - ]; - } - - /** - * {@inheritdoc} - */ - public function getCacheSuffix() { - $suffix = $this->domain ? $this->domain->id() : ''; - $suffix .= $this->language ? $this->language->getId() : ''; - return ($suffix) ? $suffix : NULL; - } - - /** - * {@inheritdoc} - */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getCacheableMetadata($name) { - if (empty($this->contextSet)) { - $this->initiateContext(); - } - $metadata = new CacheableMetadata(); - if (!empty($this->domain)) { - $metadata->addCacheContexts(['url.site', 'languages:language_interface']); - } - return $metadata; - } - - /** - * Sets domain and language contexts for the request. - * - * We wait to do this in order to avoid circular dependencies - * with the locale module. - */ - protected function initiateContext() { - // Prevent infinite lookups by caching the request. Since the _construct() - // is called for each lookup, this is more efficient. - $this->contextSet = TRUE; - - // Get the language context. Note that injecting the language manager - // into the service created a circular dependency error, so we load from - // the core service manager. - $this->languageManager = \Drupal::languageManager(); - $this->language = $this->languageManager->getCurrentLanguage(); - - // The same issue is true for the domainNegotiator. - $this->domainNegotiator = \Drupal::service('domain.negotiator'); - // Get the domain context. - $this->domain = $this->domainNegotiator->getActiveDomain(); - // If we have fired too early in the bootstrap, we must force the routine to - // run. - if (empty($this->domain)) { - $this->domain = $this->domainNegotiator->getActiveDomain(TRUE); - // Ensure the module hook cache is set properly. - // See https://www.drupal.org/project/domain/issues/3025541 - $this->moduleHandler->resetImplementations(); - } - - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php b/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php deleted file mode 100644 index a7841188e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php +++ /dev/null @@ -1,38 +0,0 @@ -getDefinition('router.route_provider'); - $definition->setClass(DomainRouteProvider::class); - - if ($container->hasParameter('renderer.config')) { - $renderer_config = $container->getParameter('renderer.config'); - - if (!in_array('url.site', $renderer_config['required_cache_contexts'])) { - $renderer_config['required_cache_contexts'][] = 'url.site'; - } - - $container->setParameter('renderer.config', $renderer_config); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php b/sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php deleted file mode 100644 index a5297e94b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php +++ /dev/null @@ -1,38 +0,0 @@ -getCurrentLanguageCacheIdPart(); - return 'route:' . $request->getHost() . ':' . $language_part . ':' . $request->getPathInfo() . ':' . $request->getQueryString(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php b/sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php deleted file mode 100644 index 04c9526ca..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php +++ /dev/null @@ -1,77 +0,0 @@ - 'Spanish']; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = [ - 'domain', - 'language', - 'domain_config_test', - 'domain_config', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Create and login user. - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']); - $this->drupalLogin($admin_user); - - // Add language. - $edit = [ - 'predefined_langcode' => 'es', - ]; - $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); - - // Enable URL language detection and selection. - $edit = ['language_interface[enabled][language-url]' => '1']; - $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings')); - - $this->drupalLogout(); - - // In order to reflect the changes for a multilingual site in the container - // we have to rebuild it. - $this->rebuildContainer(); - - $es = \Drupal::entityTypeManager()->getStorage('configurable_language')->load('es'); - $this->assertTrue(!empty($es), 'Created test language.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml deleted file mode 100644 index 86b70de9b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "Domain config hook test" -description: "Support module for domain config testing." -type: module -package: Testing -# version: VERSION -# core: 8.x -hidden: TRUE - -dependencies: [] - -# This module represents several services that could be provided by multiple modules in the Drupal community. -# The following are not playing nice together: -# - A page cache policy service that uses the config factory. -# - A module that implements hook_module_implements. -# - A random hook that hook_module_implements wishes to control. -# - The domain_config module (and domain negotiator service, I believe). - -# When this module is functioning correctly, when a user logs in, there will not be a state key set. - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module deleted file mode 100644 index dfbfcf56e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module +++ /dev/null @@ -1,23 +0,0 @@ -set('domain_config_test__user_login', TRUE); -} - -/** - * Implements hook_module_implements_alter(). - */ -function domain_config_hook_test_module_implements_alter(&$implementations, $hook) { - if ($hook == 'user_login') { - // Turn off the domain_config_hook_test's hook_user_login (above). - unset($implementations['domain_config_hook_test']); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml deleted file mode 100644 index 8cb02a0d8..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - domain_config_service.page_cache_request_policy: - class: Drupal\domain_config_hook_test\PageCache\RequestPolicy\PageCacheRequestPolicy - arguments: ['@config.factory'] - tags: - - { name: page_cache_request_policy } - diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php deleted file mode 100644 index 6d0cc4b4d..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php +++ /dev/null @@ -1,47 +0,0 @@ -configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function check(Request $request) { - // This line is important. You have to use this service for it to fail. - $this->configFactory - ->get('system.site'); - - return NULL; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml deleted file mode 100644 index 03c0bfdd1..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml +++ /dev/null @@ -1 +0,0 @@ -test_setting: false diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml deleted file mode 100644 index 7fddd2369..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Schema for the configuration files of the Domain module. -domain_config_middleware_test.settings: - type: config_object - label: 'Domain config middleware settings' - mapping: - test_setting: - type: boolean - label: 'A test setting' diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml deleted file mode 100644 index 0ba18b603..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Domain config middleware module tests" -description: "Support module for domain config middleware response testing." -type: module -package: Testing -# version: VERSION -# core: 8.x -hidden: TRUE - -dependencies: - - domain - - domain_config - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml deleted file mode 100644 index ecaa375c2..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - domain_config_test.middleware: - class: Drupal\domain_config_middleware_test\Middleware - arguments: ['@config.factory'] - tags: - # Ensure to come before page caching, so you don't serve cached pages to - # banned users. - - { name: http_middleware, priority: 250 } diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php deleted file mode 100644 index dd850098f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php +++ /dev/null @@ -1,51 +0,0 @@ -httpKernel = $http_kernel; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) { - // This line should break hooks in our code. - // @see https://www.drupal.org/node/2896434. - $config = $this->configFactory->get('domain_config_middleware_test.settings'); - return $this->httpKernel->handle($request, $type, $catch); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml deleted file mode 100644 index 320f9b0fe..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml +++ /dev/null @@ -1,3 +0,0 @@ -name: 'Four' -page: - front: /node/2 diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml deleted file mode 100644 index 479549188..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: 'One' -mail: admin@example.com -slogan: '' -page: - 403: '' - 404: '' - front: /node/1 -admin_compact_mode: false -weight_select_max: 100 -langcode: en diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml deleted file mode 100644 index 4c7e58f3b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml +++ /dev/null @@ -1,9 +0,0 @@ -mail: admin@example.com -slogan: '' -page: - 403: '' - 404: '' - front: /node -admin_compact_mode: false -weight_select_max: 100 -langcode: en diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml deleted file mode 100644 index 03791fb87..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: 'Two' -mail: admin@example.com -slogan: 'I have it' -page: - 403: '' - 404: '' - front: /node -admin_compact_mode: false -weight_select_max: 100 -langcode: en diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml deleted file mode 100644 index 33f2ed30c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: 'Dos' -mail: admin@example.com -slogan: 'Yo la tengo' -page: - 403: '' - 404: '' - front: /node -admin_compact_mode: false -weight_select_max: 100 -langcode: en diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml deleted file mode 100644 index 0c1f3bbf0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Domain config module tests" -description: "Support module for domain config testing." -type: module -package: Testing -# version: VERSION -# core: 8.x -hidden: TRUE - -dependencies: - - domain - - domain_config - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module deleted file mode 100644 index 6c10b8ed0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module +++ /dev/null @@ -1,30 +0,0 @@ -addProperty('config_test', 'aye'); -} - -/** - * Implements hook_page_attachments_alter(). - */ -function domain_config_test_page_attachments_alter(array &$attachments) { - /** @var \Drupal\domain\DomainNegotiatorInterface $Negotiator */ - $negotiator = \Drupal::service('domain.negotiator'); - $domain = $negotiator->getActiveDomain(); - if (!empty($domain) && $domain->get('config_test') == 'aye') { - $attachments['#attached']['http_header'][] = [ - 'X-Domain-Config-Test-page-attachments-hook', - 'invoked', - ]; - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php deleted file mode 100644 index b2b773380..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php +++ /dev/null @@ -1,74 +0,0 @@ -domainCreateTestDomains(); - - // Get the services. - $this->negotiator = \Drupal::service('domain.negotiator'); - $this->moduleHandler = \Drupal::service('module_handler'); - } - - /** - * Tests domain request alteration. - */ - public function testHookDomainRequestAlter() { - // Check for the count of hook implementations. - $hooks = $this->moduleHandler->getImplementations('domain_request_alter'); - $this->assertCount(1, $hooks, 'One hook implementation found.'); - - // Assert that the hook is also called on a request with a HTTP Middleware - // that requests config thus triggering an early hook invocation (before - // modules are loaded by the kernel). - $this->drupalGet(''); - $this->assertEquals('invoked', $this->drupalGetHeader('X-Domain-Config-Test-page-attachments-hook')); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php deleted file mode 100644 index d4eba5094..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php +++ /dev/null @@ -1,71 +0,0 @@ -config('system.site'); - $site_config->set('page.front', '/node')->save(); - - // No domains should exist. - $this->domainTableIsEmpty(); - // Create four new domains programmatically. - $this->domainCreateTestDomains(5); - // Get the domain list. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $this->drupalCreateNode([ - 'type' => 'article', - 'title' => 'Node 1', - 'promoted' => TRUE, - ]); - $this->drupalCreateNode([ - 'type' => 'article', - 'title' => 'Node 2', - 'promoted' => TRUE, - ]); - $homepages = $this->getHomepages(); - foreach ($domains as $domain) { - $home = $this->drupalGet($domain->getPath()); - - // Check if this setting is picked up. - $expected = $domain->getPath() . $homepages[$domain->id()]; - $expected_home = $this->drupalGet($expected); - - $this->assertTrue($home == $expected_home, 'Proper home page loaded (' . $domain->id() . ').'); - } - } - - /** - * Returns the expected homepage paths for each domain. - */ - private function getHomepages() { - $homepages = [ - 'example_com' => 'node', - 'one_example_com' => 'node/1', - 'two_example_com' => 'node', - 'three_example_com' => 'node', - 'four_example_com' => 'node/2', - ]; - return $homepages; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php deleted file mode 100644 index c6fb7a11e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php +++ /dev/null @@ -1,30 +0,0 @@ -drupalGet('user/login'); - $user = $this->drupalCreateUser([]); - $edit = ['name' => $user->getUserName(), 'pass' => $user->passRaw]; - $this->drupalPostForm(NULL, $edit, t('Log in')); - - $test = \Drupal::state()->get('domain_config_test__user_login', NULL); - // When this test passes, it means domain_config_hook_test_user_login was - // not run. - $this->assertNull($test, 'The hook_user_login state message is set.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php deleted file mode 100644 index 160be3cb7..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php +++ /dev/null @@ -1,112 +0,0 @@ -domainTableIsEmpty(); - // Create five new domains programmatically. - $this->domainCreateTestDomains(5); - // Get the domain list. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - // Except for the default domain, the page title element should match what - // is in the override files. - // With a language context, based on how we have our files setup, we - // expect the following outcomes: - // - example.com name = 'Drupal' for English, 'Drupal' for Spanish. - // - one.example.com name = 'One' for English, 'Drupal' for Spanish. - // - two.example.com name = 'Two' for English, 'Dos' for Spanish. - // - three.example.com name = 'Drupal' for English, 'Drupal' for Spanish. - // - four.example.com name = 'Four' for English, 'Four' for Spanish. - foreach ($domains as $domain) { - // Test the login page, because our default homepages do not exist. - foreach ($this->langcodes as $langcode => $language) { - $path = $domain->getPath() . $langcode . '/user/login'; - $this->drupalGet($path); - if ($domain->isDefault()) { - $this->assertRaw('Log in | Drupal', 'Loaded the proper site name.'); - } - else { - $this->assertRaw('Log in | ' . $this->expectedName($domain, $langcode) . '', 'Loaded the proper site name.' . 'Log in | ' . $this->expectedName($domain, $langcode) . ''); - } - } - } - } - - /** - * Tests that domain-specific variable overrides in settings.php works. - */ - public function testDomainConfigOverriderFromSettings() { - // Set up overrides. - $settings = []; - $settings['config']['domain.config.one_example_com.en.system.site']['name'] = (object) [ - 'value' => 'First', - 'required' => TRUE, - ]; - $settings['config']['domain.config.four_example_com.system.site']['name'] = (object) [ - 'value' => 'Four overridden in settings', - 'required' => TRUE, - ]; - $this->writeSettings($settings); - - // Create five new domains programmatically. - $this->domainCreateTestDomains(5); - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(['one_example_com', 'four_example_com']); - - $domain_one = $domains['one_example_com']; - $this->drupalGet($domain_one->getPath() . 'user/login'); - $this->assertRaw('Log in | First', 'Found overridden slogan for one.example.com.'); - - $domain_four = $domains['four_example_com']; - $this->drupalGet($domain_four->getPath() . 'user/login'); - $this->assertRaw('Log in | Four overridden in settings', 'Found overridden slogan for four.example.com.'); - } - - /** - * Returns the expected site name value from our test configuration. - * - * @param \Drupal\domain\DomainInterface $domain - * The Domain object. - * @param string $langcode - * A two-digit language code. - * - * @return string - * The expected name. - */ - private function expectedName(DomainInterface $domain, $langcode = NULL) { - $name = ''; - - switch ($domain->id()) { - case 'one_example_com': - $name = ($langcode == 'es') ? 'Drupal' : 'One'; - break; - - case 'two_example_com': - $name = ($langcode == 'es') ? 'Dos' : 'Two'; - break; - - case 'three_example_com': - $name = 'Drupal'; - break; - - case 'four_example_com': - $name = 'Four'; - break; - } - - return $name; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php deleted file mode 100644 index e67e0395a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php +++ /dev/null @@ -1,73 +0,0 @@ - 'Spanish']; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = [ - 'domain', - 'language', - 'domain_config_test', - 'domain_config', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Create and login user. - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']); - $this->drupalLogin($admin_user); - - // Add language. - $edit = [ - 'predefined_langcode' => 'es', - ]; - $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); - - // Enable URL language detection and selection. - $edit = ['language_interface[enabled][language-url]' => '1']; - $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings')); - - $this->drupalLogout(); - - // In order to reflect the changes for a multilingual site in the container - // we have to rebuild it. - $this->rebuildContainer(); - - $es = \Drupal::entityTypeManager()->getStorage('configurable_language')->load('es'); - $this->assertTrue(!empty($es), 'Created test language.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml b/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml deleted file mode 100644 index 6a332083c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml +++ /dev/null @@ -1,1298 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_domain_access - - field.storage.node.field_domain_all_affiliates - module: - - domain_access - - node - - user -id: affiliated_content -label: 'Affiliated content' -module: node -description: 'Find and manage content.' -tag: domain -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_options: - access: - type: domain_content_editor - options: { } - cache: - type: tag - query: - type: views_query - options: - disable_sql_rewrite: true - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: true - caption: '' - summary: '' - description: '' - columns: - node_bulk_form: node_bulk_form - title: title - type: type - name: name - status: status - changed: changed - operations: operations - field_domain_access: field_domain_access - field_domain_all_affiliates: field_domain_all_affiliates - info: - node_bulk_form: - align: '' - separator: '' - empty_column: false - responsive: '' - title: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - type: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - name: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-low - status: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - changed: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - operations: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_domain_access: - align: '' - separator: '' - empty_column: false - responsive: '' - field_domain_all_affiliates: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: changed - empty_table: true - row: - type: fields - fields: - node_bulk_form: - id: node_bulk_form - table: node - field: node_bulk_form - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - action_title: 'With selection' - include_exclude: exclude - selected_actions: { } - plugin_id: node_bulk_form - entity_type: node - title: - id: title - table: node_field_data - field: title - label: Title - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - entity_type: node - entity_field: title - type: string - settings: - link_to_entity: true - plugin_id: field - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - label: 'Content Type' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: false - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: type - plugin_id: field - field_domain_access: - id: field_domain_access - table: node__field_domain_access - field: field_domain_access - relationship: none - group_type: group - admin_label: '' - label: Domain(s) - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: domain_access_field - field_domain_all_affiliates: - id: field_domain_all_affiliates - table: node__field_domain_all_affiliates - field: field_domain_all_affiliates - relationship: none - group_type: group - admin_label: '' - label: 'All affiliates' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: boolean - settings: - format: yes-no - format_custom_true: '' - format_custom_false: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - name: - id: name - table: users_field_data - field: name - relationship: uid - label: Author - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: field - type: user_name - entity_type: user - entity_field: name - status: - id: status - table: node_field_data - field: status - label: Status - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: boolean - settings: - format: custom - format_custom_true: Published - format_custom_false: Unpublished - plugin_id: field - entity_type: node - entity_field: status - changed: - id: changed - table: node_field_data - field: changed - label: Updated - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: timestamp - settings: - date_format: short - custom_date_format: '' - timezone: '' - plugin_id: field - entity_type: node - entity_field: changed - operations: - id: operations - table: node - field: operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - plugin_id: entity_operations - filters: - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: Status - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: true - group_info: - label: 'Published status' - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Published - operator: '=' - value: '1' - 2: - title: Unpublished - operator: '=' - value: '0' - plugin_id: boolean - entity_type: node - entity_field: status - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: Type - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: bundle - entity_type: node - entity_field: type - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - entity_type: node - entity_field: title - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: Language - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: language - entity_type: node - entity_field: langcode - field_domain_all_affiliates_value: - id: field_domain_all_affiliates_value - table: node__field_domain_all_affiliates - field: field_domain_all_affiliates_value - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - sorts: { } - title: 'Content assigned to All affiliates' - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - empty: true - content: 'No content available.' - plugin_id: text_custom - arguments: - field_domain_access_target_id: - id: field_domain_access_target_id - table: node__field_domain_access - field: field_domain_access_target_id - relationship: none - group_type: group - admin_label: '' - default_action: 'not found' - exception: - value: all - title_enable: false - title: All - title_enable: true - title: '{{ arguments.field_domain_access_target_id }} content' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: true - validate: - type: 'entity:domain' - fail: 'not found' - validate_options: - operation: view - multiple: 0 - access: false - bundles: { } - glossary: false - limit: 0 - case: none - path_case: none - transform_dash: false - break_phrase: false - plugin_id: string - relationships: - uid: - id: uid - table: node_field_data - field: uid - admin_label: author - required: true - plugin_id: standard - show_admin_links: false - filter_groups: - operator: AND - groups: - 1: AND - display_extenders: { } - display_plugin: default - display_title: Master - id: default - position: 0 - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - - 'user.node_grants:view' - max-age: 0 - tags: - - 'config:field.storage.node.field_domain_access' - - 'config:field.storage.node.field_domain_all_affiliates' - page_1: - display_options: - path: admin/content/domain-content/% - menu: - type: none - title: Content - description: '' - expanded: false - parent: '' - weight: -10 - context: '0' - menu_name: admin - tab_options: - type: normal - title: Content - description: 'Find and manage content' - menu_name: admin - weight: -10 - display_extenders: { } - display_description: 'Default page for content per domain' - filters: - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: Status - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: true - group_info: - label: 'Published status' - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Published - operator: '=' - value: '1' - 2: - title: Unpublished - operator: '=' - value: '0' - plugin_id: boolean - entity_type: node - entity_field: status - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: Type - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: bundle - entity_type: node - entity_field: type - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - entity_type: node - entity_field: title - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: Language - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: language - entity_type: node - entity_field: langcode - defaults: - filters: false - filter_groups: false - title: false - filter_groups: - operator: AND - groups: - 1: AND - title: Content - display_plugin: page - display_title: 'Domain content page' - id: page_1 - position: 1 - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - - 'user.node_grants:view' - max-age: 0 - tags: - - 'config:field.storage.node.field_domain_access' - - 'config:field.storage.node.field_domain_all_affiliates' - page_2: - display_plugin: page - id: page_2 - display_title: 'All affiliates page' - position: 2 - display_options: - display_extenders: { } - display_description: 'Lists content assigned to all affiliates' - arguments: { } - defaults: - arguments: false - filters: false - filter_groups: false - path: admin/content/domain-content/all_affiliates - filters: - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: Status - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: true - group_info: - label: 'Published status' - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Published - operator: '=' - value: '1' - 2: - title: Unpublished - operator: '=' - value: '0' - plugin_id: boolean - entity_type: node - entity_field: status - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: Type - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: bundle - entity_type: node - entity_field: type - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - entity_type: node - entity_field: title - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: Language - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: language - entity_type: node - entity_field: langcode - field_domain_all_affiliates_value: - id: field_domain_all_affiliates_value - table: node__field_domain_all_affiliates - field: field_domain_all_affiliates_value - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - field_domain_access_target_id: - id: field_domain_access_target_id - table: node__field_domain_access - field: field_domain_access_target_id - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: field_domain_access_target_id_op - label: Domain - description: '' - use_operator: false - operator: field_domain_access_target_id_op - identifier: field_domain_access_target_id - required: false - remember: true - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: domain_access_filter - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - - 'user.node_grants:view' - tags: - - 'config:field.storage.node.field_domain_access' - - 'config:field.storage.node.field_domain_all_affiliates' diff --git a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml b/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml deleted file mode 100644 index fd65a6d27..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml +++ /dev/null @@ -1,1454 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.user.field_domain_access - - field.storage.user.field_domain_all_affiliates - module: - - domain_access - - user -id: affiliated_editors -label: 'Affiliated editors' -module: user -description: 'Find and manage people interacting with your site.' -tag: domain -base_table: users_field_data -base_field: uid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: domain_content_admin - options: { } - cache: - type: tag - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: 0 - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - summary: '' - columns: - user_bulk_form: user_bulk_form - name: name - status: status - rid: rid - created: created - access: access - edit_node: edit_node - dropbutton: dropbutton - info: - user_bulk_form: - align: '' - separator: '' - empty_column: false - responsive: '' - name: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - status: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-low - rid: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-low - created: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - access: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - edit_node: - align: '' - separator: '' - empty_column: false - responsive: priority-low - dropbutton: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: created - empty_table: true - row: - type: fields - fields: - user_bulk_form: - id: user_bulk_form - table: users - field: user_bulk_form - relationship: none - group_type: group - admin_label: '' - label: 'Bulk update' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: user_bulk_form - entity_type: user - name: - id: name - table: users_field_data - field: name - relationship: none - group_type: group - admin_label: '' - label: Username - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: field - type: user_name - entity_type: user - entity_field: name - status: - id: status - table: users_field_data - field: status - relationship: none - group_type: group - admin_label: '' - label: Status - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: field - type: boolean - settings: - format: custom - format_custom_true: Active - format_custom_false: Blocked - entity_type: user - entity_field: status - roles_target_id: - id: roles_target_id - table: user__roles - field: roles_target_id - relationship: none - group_type: group - admin_label: '' - label: Roles - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: ul - separator: ', ' - plugin_id: user_roles - field_domain_access: - id: field_domain_access - table: user__field_domain_access - field: field_domain_access - relationship: none - group_type: group - admin_label: '' - label: Domain(s) - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: false - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: domain_access_field - field_domain_all_affiliates: - id: field_domain_all_affiliates - table: user__field_domain_all_affiliates - field: field_domain_all_affiliates - relationship: none - group_type: group - admin_label: '' - label: 'All affiliates' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: boolean - settings: - format: yes-no - format_custom_true: '' - format_custom_false: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - created: - id: created - table: users_field_data - field: created - relationship: none - group_type: group - admin_label: '' - label: 'Member for' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: timestamp_ago - settings: - future_format: '@interval' - past_format: '@interval' - granularity: 2 - plugin_id: field - entity_type: user - entity_field: created - access: - id: access - table: users_field_data - field: access - relationship: none - group_type: group - admin_label: '' - label: 'Last access' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: timestamp_ago - settings: - future_format: '@interval hence' - past_format: '@interval ago' - granularity: 2 - plugin_id: field - entity_type: user - entity_field: access - operations: - id: operations - table: users - field: operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - entity_type: user - plugin_id: entity_operations - mail: - id: mail - table: users_field_data - field: mail - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: basic_string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - plugin_id: field - entity_type: user - entity_field: mail - filters: - combine: - id: combine - table: views - field: combine - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: combine_op - label: 'Name or email contains' - description: '' - use_operator: false - operator: combine_op - identifier: user - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - fields: - name: name - mail: mail - plugin_id: combine - roles_target_id: - id: roles_target_id - table: user__roles - field: roles_target_id - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: roles_target_id_op - label: Role - description: '' - use_operator: false - operator: roles_target_id_op - identifier: role - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: user_roles - permission: - id: permission - table: user__roles - field: permission - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: permission_op - label: Permission - description: '' - use_operator: false - operator: permission_op - identifier: permission - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: user_permissions - status: - id: status - table: users_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: true - group_info: - label: Status - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Active - operator: '=' - value: '1' - 2: - title: Blocked - operator: '=' - value: '0' - plugin_id: boolean - entity_type: user - entity_field: status - default_langcode: - id: default_langcode - table: users_field_data - field: default_langcode - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: user - entity_field: default_langcode - plugin_id: boolean - uid_raw: - id: uid_raw - table: users_field_data - field: uid_raw - relationship: none - group_type: group - admin_label: '' - operator: '!=' - value: - min: '' - max: '' - value: '0' - group: 1 - exposed: false - expose: - operator_id: '0' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - entity_type: user - sorts: - created: - id: created - table: users_field_data - field: created - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - granularity: second - plugin_id: date - entity_type: user - entity_field: created - title: People - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: 'No people available.' - plugin_id: text_custom - use_more: false - use_more_always: false - use_more_text: more - display_comment: '' - use_ajax: false - hide_attachment_summary: false - show_admin_links: true - group_by: false - link_url: '' - link_display: page_1 - css_class: '' - filter_groups: - operator: AND - groups: - 1: AND - display_extenders: { } - arguments: - field_domain_access_target_id: - id: field_domain_access_target_id - table: user__field_domain_access - field: field_domain_access_target_id - plugin_id: string - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - max-age: 0 - tags: - - 'config:field.storage.user.field_domain_access' - - 'config:field.storage.user.field_domain_all_affiliates' - page_1: - display_plugin: page - id: page_1 - display_title: 'Domain content editors' - position: 1 - display_options: - path: admin/content/domain-editors/% - show_admin_links: false - menu: - type: none - title: List - description: 'Find and manage people interacting with your site.' - expanded: false - parent: '' - weight: -10 - context: '0' - menu_name: admin - tab_options: - type: normal - title: People - description: 'Manage user accounts, roles, and permissions.' - menu_name: admin - weight: 0 - defaults: - show_admin_links: false - arguments: false - display_extenders: { } - display_description: 'Default page for domain content editor lists.' - arguments: - field_domain_access_target_id: - id: field_domain_access_target_id - table: user__field_domain_access - field: field_domain_access_target_id - relationship: none - group_type: group - admin_label: '' - default_action: 'not found' - exception: - value: all - title_enable: false - title: All - title_enable: true - title: '{{ arguments.field_domain_access_target_id }} editors' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: true - validate: - type: 'entity:domain' - fail: 'not found' - validate_options: - operation: view - multiple: 0 - access: false - bundles: { } - glossary: false - limit: 0 - case: none - path_case: none - transform_dash: false - break_phrase: false - plugin_id: string - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - max-age: 0 - tags: - - 'config:field.storage.user.field_domain_access' - - 'config:field.storage.user.field_domain_all_affiliates' - page_2: - display_plugin: page - id: page_2 - display_title: 'All affiliates editors' - position: 2 - display_options: - display_extenders: { } - path: admin/content/domain-editors/all_affiliates - display_description: 'Lists editors with the All affiliates permission.' - filters: - combine: - id: combine - table: views - field: combine - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: combine_op - label: 'Name or email contains' - description: '' - use_operator: false - operator: combine_op - identifier: user - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - fields: - name: name - mail: mail - plugin_id: combine - roles_target_id: - id: roles_target_id - table: user__roles - field: roles_target_id - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: roles_target_id_op - label: Role - description: '' - use_operator: false - operator: roles_target_id_op - identifier: role - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: user_roles - permission: - id: permission - table: user__roles - field: permission - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: permission_op - label: Permission - description: '' - use_operator: false - operator: permission_op - identifier: permission - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: user_permissions - status: - id: status - table: users_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: true - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: true - group_info: - label: Status - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Active - operator: '=' - value: '1' - 2: - title: Blocked - operator: '=' - value: '0' - plugin_id: boolean - entity_type: user - entity_field: status - default_langcode: - id: default_langcode - table: users_field_data - field: default_langcode - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: user - entity_field: default_langcode - plugin_id: boolean - uid_raw: - id: uid_raw - table: users_field_data - field: uid_raw - relationship: none - group_type: group - admin_label: '' - operator: '!=' - value: - min: '' - max: '' - value: '0' - group: 1 - exposed: false - expose: - operator_id: '0' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - entity_type: user - field_domain_access_target_id: - id: field_domain_access_target_id - table: user__field_domain_access - field: field_domain_access_target_id - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: field_domain_access_target_id_op - label: Domain - description: '' - use_operator: false - operator: field_domain_access_target_id_op - identifier: field_domain_access_target_id - required: false - remember: true - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: domain_access_filter - field_domain_all_affiliates_value: - id: field_domain_all_affiliates_value - table: user__field_domain_all_affiliates - field: field_domain_all_affiliates_value - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - defaults: - filters: false - filter_groups: false - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - tags: - - 'config:field.storage.user.field_domain_access' - - 'config:field.storage.user.field_domain_all_affiliates' diff --git a/sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml b/sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml deleted file mode 100644 index 16f223546..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Schema for the domain content plugins. - -views.access.domain_content_admin: - type: mapping - label: 'Domain Content: View domain-specific editors' -views.access.domain_content_editor: - type: mapping - label: 'Domain Content: View domain-specific content' diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml deleted file mode 100644 index 1af7da3f7..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Domain Content -description: 'Review content by assigned domain.' -type: module -package: Domain -# version: VERSION -# core: 8.x -dependencies: - - drupal:node - - drupal:user - - drupal:views - - domain:domain - - domain:domain_access - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.install b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.install deleted file mode 100644 index f7d1d7a7b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.install +++ /dev/null @@ -1,58 +0,0 @@ -getStorage('node_type')->loadMultiple(); - foreach ($node_types as $type => $info) { - $list[$type] = 'node'; - } - // Check for required fields. - foreach ($list as $bundle => $entity_type) { - $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_FIELD; - if (!$field = \Drupal::entityTypeManager()->getStorage('field_config')->load($id)) { - $allow = FALSE; - break; - } - $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_ALL_FIELD; - if (!$field = \Drupal::entityTypeManager()->getStorage('field_config')->load($id)) { - $allow = FALSE; - break; - } - } - } - if (!$allow) { - $requirements['domain_content'] = [ - 'title' => t('Domain content'), - 'description' => t('Domain content cannot be enabled until Domain access has installed its required fields.'), - 'severity' => REQUIREMENT_ERROR, - ]; - } - return $requirements; -} - -/** - * Implements hook_uninstall(). - */ -function domain_content_uninstall() { - $storage = \Drupal::entityTypeManager()->getStorage('view'); - $entities = []; - foreach (['affiliated_content', 'affiliated_editors'] as $id) { - if ($view = $storage->load($id)) { - $entities[$id] = $view; - } - } - if (!empty($entities)) { - $storage->delete($entities); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml deleted file mode 100644 index 5a4a025b6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml +++ /dev/null @@ -1,12 +0,0 @@ -domain_content.content_list: - title: Affiliated content - route_name: domain_content.content_list - parent: system.admin_content - description: 'Lists content by domain assignment.' - weight: 10 -domain_content.editors_list: - title: Affiliated editors - route_name: domain_content.editors_list - parent: system.admin_content - description: 'Lists editors by domain assignment.' - weight: 10 diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.module b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.module deleted file mode 100644 index 836b788b0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.module +++ /dev/null @@ -1,40 +0,0 @@ -getStorage('user')->load($account->id()); - $allowed = \Drupal::service('domain_access.manager')->getAccessValues($user); - $id = $domain->id(); - if ($account->hasPermission('publish to any domain') || ($account->hasPermission('publish to any assigned domain') && isset($allowed[$domain->id()]))) { - $operations['domain_content'] = [ - 'title' => t('Content'), - 'url' => Url::fromUri("internal:/admin/content/domain-content/$id"), - // Core operations start at 0 and increment by 10. - 'weight' => 120, - ]; - } - if ($account->hasPermission('assign editors to any domain') || ($account->hasPermission('assign domain editors') && isset($allowed[$domain->id()]))) { - $operations['domain_users'] = [ - 'title' => t('Editors'), - 'url' => Url::fromUri("internal:/admin/content/domain-editors/$id"), - // Core operations start at 0 and increment by 10. - 'weight' => 120, - ]; - } - - return $operations; -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml deleted file mode 100644 index 629da9e91..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -access domain content: - title: 'Access domain content pages' -access domain content editors: - title: 'Access domain editors pages' diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml deleted file mode 100644 index e352d0590..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml +++ /dev/null @@ -1,14 +0,0 @@ -domain_content.content_list: - path: '/admin/content/domain-content' - defaults: - _controller: 'Drupal\domain_content\Controller\DomainContentController::contentList' - _title: 'Affiliated content' - requirements: - _permission: 'access domain content' -domain_content.editors_list: - path: '/admin/content/domain-editors' - defaults: - _controller: 'Drupal\domain_content\Controller\DomainContentController::editorsList' - _title: 'Affiliated editors' - requirements: - _permission: 'access domain content editors' diff --git a/sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php b/sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php deleted file mode 100644 index 385cc3531..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php +++ /dev/null @@ -1,124 +0,0 @@ -getUser(); - $build = [ - '#theme' => 'table', - '#header' => [$this->t('Domain'), $options['column_header']], - ]; - if ($account->hasPermission($options['all_permission'])) { - $build['#rows'][] = [ - Link::fromTextAndUrl($this->t('All affiliates'), Url::fromUri('internal:/admin/content/' . $options['path'] . '/all_affiliates')), - $this->getCount($options['type']), - ]; - } - // Loop through domains. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted(); - $manager = \Drupal::service('domain_access.manager'); - /** @var \Drupal\domain\DomainInterface $domain */ - foreach ($domains as $domain) { - if ($account->hasPermission($options['all_permission']) || $manager->hasDomainPermissions($account, $domain, [$options['permission']])) { - $row = [ - Link::fromTextAndUrl($domain->label(), Url::fromUri('internal:/admin/content/' . $options['path'] . '/' . $domain->id())), - $this->getCount($options['type'], $domain), - ]; - $build['#rows'][] = $row; - } - } - return $build; - } - - /** - * Generates a list of content by domain. - */ - public function contentList() { - $options = [ - 'type' => 'node', - 'column_header' => $this->t('Content count'), - 'permission' => 'publish to any assigned domain', - 'all_permission' => 'publish to any domain', - 'path' => 'domain-content', - ]; - - return $this->buildList($options); - } - - /** - * Generates a list of editors by domain. - */ - public function editorsList() { - $options = [ - 'type' => 'user', - 'column_header' => $this->t('Editor count'), - 'permission' => 'assign domain editors', - 'all_permission' => 'assign editors to any domain', - 'path' => 'domain-editors', - ]; - - return $this->buildList($options); - } - - /** - * Counts the content for a domain. - * - * @param string $entity_type - * The entity type. - * @param \Drupal\domain\DomainInterface $domain - * The domain to query. If passed NULL, checks status for all affiliates. - * - * @return int - * The content count for the given domain. - */ - protected function getCount($entity_type = 'node', DomainInterface $domain = NULL) { - if (is_null($domain)) { - $field = DOMAIN_ACCESS_ALL_FIELD; - $value = 1; - } - else { - $field = DOMAIN_ACCESS_FIELD; - $value = $domain->id(); - } - // Note that we ignore node access so these queries work on any domain. - $query = \Drupal::entityQuery($entity_type) - ->condition($field, $value) - ->accessCheck(FALSE); - - return count($query->execute()); - } - - /** - * Returns a fully loaded user object for the current request. - * - * @return \Drupal\Core\Session\AccountInterface - * The current user object. - */ - protected function getUser() { - $account = $this->currentUser(); - // Advanced grants for edit/delete require permissions. - return \Drupal::entityTypeManager()->getStorage('user')->load($account->id()); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php b/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php deleted file mode 100644 index 10b1ff40f..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php +++ /dev/null @@ -1,30 +0,0 @@ -setRequirement('_permission', 'access domain content'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php b/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php deleted file mode 100644 index eed22abb1..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php +++ /dev/null @@ -1,30 +0,0 @@ -setRequirement('_permission', 'access domain content editors'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php deleted file mode 100644 index 76559bbb6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php +++ /dev/null @@ -1,83 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'administer domains', - 'access administration pages', - 'access domain content', - 'access domain content editors', - 'publish to any domain', - 'assign editors to any domain', - // Edit access is required. This is fastest. - 'bypass node access', - ]); - $this->drupalLogin($this->admin_user); - - // Create users and content. - $this->createDomainContent(); - - $url = 'admin/content/domain-content/all_affiliates'; - - $this->drupalGet($url); - - // All the content should be on domain one. - $old_domain = $this->domains['one_example_com']; - $new_domain = $this->domains['two_example_com']; - - // Domains are linked in the output. - $this->assertRaw($old_domain->label() . ''); - $this->assertNoRaw($new_domain->label() . ''); - - // Add some content to domain two. - $edit = [ - 'node_bulk_form[0]' => TRUE, - 'node_bulk_form[1]' => TRUE, - 'action' => 'domain_access_add_action.two_example_com', - ]; - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - - // Both domains should be present. - $this->assertRaw($old_domain->label() . ''); - $this->assertRaw($new_domain->label() . ''); - - // Remove some content from domain two. - $edit = [ - 'node_bulk_form[0]' => TRUE, - 'node_bulk_form[1]' => TRUE, - 'action' => 'domain_access_remove_action.two_example_com', - ]; - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - - // Domains are linked properly in the output. - $this->assertRaw($old_domain->label() . ''); - $this->assertNoRaw($new_domain->label() . ''); - - // There should be five elements. - $this->assertRaw('node_bulk_form[4]'); - - // Remove one from all affiliates. - $edit = [ - 'node_bulk_form[0]' => TRUE, - 'action' => 'domain_access_none_action', - ]; - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - - // There should be four elements. - $this->assertRaw('node_bulk_form[3]'); - $this->assertNoRaw('node_bulk_form[4]'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php deleted file mode 100644 index 4c23e98fb..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php +++ /dev/null @@ -1,52 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'administer domains', - 'access administration pages', - 'access domain content', - 'access domain content editors', - 'publish to any domain', - 'assign editors to any domain', - ]); - $this->drupalLogin($this->admin_user); - - // Create users and content. - $this->createDomainContent(); - $this->createDomainUsers(); - - // Base Urls for our views. - $urls = [ - 'admin/content/domain-content', - 'admin/content/domain-editors', - ]; - // Test the overview pages. - foreach ($urls as $url) { - $content = $this->drupalGet($url); - $this->assertResponse(200); - // Find the links. - $this->findLink('All affiliates'); - foreach ($this->domains as $id => $domain) { - $this->findLink($domain->label()); - $string = $domain->label() . "5"; - $this->checkContent($content, $string); - } - $string = 'All affiliates5'; - $this->checkContent($content, $string); - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php deleted file mode 100644 index 7b0b6b133..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php +++ /dev/null @@ -1,176 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'administer domains', - 'access administration pages', - 'access domain content', - 'access domain content editors', - 'publish to any domain', - 'assign editors to any domain', - ]); - $this->drupalLogin($this->admin_user); - - // Create users and content. - $this->createDomainContent(); - $this->createDomainUsers(); - - // Base Urls for our views. - $urls = [ - 'admin/content/domain-content', - 'admin/content/domain-editors', - ]; - // Test the overview and domain-specific pages. - foreach ($urls as $url) { - $this->drupalGet($url); - $this->assertResponse(200); - // Find the links. - $this->findLink('All affiliates'); - foreach ($this->domains as $id => $domain) { - $this->findLink($domain->label()); - } - - // All affiliates link. - $this->drupalGet($url . '/all_affiliates'); - $this->assertResponse(200); - - // Individual domain pages. - foreach ($this->domains as $id => $domain) { - $this->drupalGet($url . '/' . $id); - $this->assertResponse(200); - } - } - // This user should be able to see everything but all affiliates. - $this->limited_user = $this->drupalCreateUser([ - 'administer domains', - 'access administration pages', - 'access domain content', - 'access domain content editors', - 'publish to any assigned domain', - 'assign domain editors', - ]); - $this->addDomainsToEntity('user', $this->limited_user->id(), array_keys($this->domains), DOMAIN_ACCESS_FIELD); - - $this->drupalLogin($this->limited_user); - // Test the overview and domain-specific pages. - foreach ($urls as $url) { - $this->drupalGet($url); - $this->assertResponse(200); - // Find the links. - $this->assertNoRaw('All affiliates'); - foreach ($this->domains as $id => $domain) { - $this->findLink($domain->label()); - } - - // All affiliates link. - $this->drupalGet($url . '/all_affiliates'); - $this->assertResponse(403); - - // Individual domain pages. - foreach ($this->domains as $id => $domain) { - $this->drupalGet($url . '/' . $id); - $this->assertResponse(200); - } - } - - // This user should be able to see everything but all affiliates and nothing - // for editor assignments. - $this->editor_user = $this->drupalCreateUser([ - 'access administration pages', - 'access domain content', - 'publish to any assigned domain', - ]); - $this->addDomainsToEntity('user', $this->editor_user->id(), array_keys($this->domains), DOMAIN_ACCESS_FIELD); - - $this->drupalLogin($this->editor_user); - // Test the overview and domain-specific pages. - foreach ($urls as $url) { - $expected = 200; - if ($url == 'admin/content/domain-editors') { - $expected = 403; - } - $this->drupalGet($url); - $this->assertResponse($expected); - // Find the links. - $this->assertNoRaw('All affiliates'); - foreach ($this->domains as $id => $domain) { - if ($expected == 200) { - $this->findLink($domain->label()); - } - else { - $this->findNoLink($domain->label()); - } - } - - // All affiliates link will fail for both paths. - $this->drupalGet($url . '/all_affiliates'); - $this->assertResponse(403); - - // Individual domain pages. - foreach ($this->domains as $id => $domain) { - $this->drupalGet($url . '/' . $id); - $this->assertResponse($expected); - } - } - - // This user should be able to see one domain for editor assignments. - $this->assign_user = $this->drupalCreateUser([ - 'access administration pages', - 'access domain content editors', - 'assign domain editors', - ]); - $ids = array_keys($this->domains); - $assigned_id = end($ids); - $this->addDomainsToEntity('user', $this->assign_user->id(), [$assigned_id], DOMAIN_ACCESS_FIELD); - - $this->drupalLogin($this->assign_user); - // Test the overview and domain-specific pages. - foreach ($urls as $url) { - $expected = 200; - if ($url == 'admin/content/domain-content') { - $expected = 403; - } - $this->drupalGet($url); - $this->assertResponse($expected); - // Find the links. - $this->assertNoRaw('All affiliates'); - foreach ($this->domains as $id => $domain) { - if ($expected == 200 && $id == $assigned_id) { - $this->findLink($domain->label()); - } - else { - $this->findNoLink($domain->label()); - } - } - - // All affiliates link will fail for both paths. - $this->drupalGet($url . '/all_affiliates'); - $this->assertResponse(403); - - // Individual domain pages. - foreach ($this->domains as $id => $domain) { - $this->drupalGet($url . '/' . $id); - if ($expected == 200 && $id == $assigned_id) { - $this->assertResponse(200); - } - else { - $this->assertResponse(403); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php deleted file mode 100644 index 0ae5d4a38..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php +++ /dev/null @@ -1,111 +0,0 @@ -domainCreateTestDomains(5); - - $this->domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - } - - /** - * Creates dummy content for testing. - * - * 25 nodes, 5 per domain and 5 to all affiliates. - */ - public function createDomainContent() { - foreach ($this->domains as $id => $domain) { - for ($i = 0; $i < 5; $i++) { - $this->drupalCreateNode([ - 'type' => 'article', - DOMAIN_ACCESS_FIELD => [$id], - DOMAIN_ACCESS_ALL_FIELD => ($id == 'one_example_com') ? 1 : 0, - ]); - } - } - // Rebuild node access rules. - node_access_rebuild(); - } - - /** - * Creates dummy content for testing. - * - * 25 users, 5 per domain and 5 to all affiliates. - */ - public function createDomainUsers() { - foreach ($this->domains as $id => $domain) { - for ($i = 0; $i < 5; $i++) { - $account[$id] = $this->drupalCreateUser([ - 'access administration pages', - 'access domain content', - 'access domain content editors', - 'publish to any domain', - 'assign editors to any domain', - ]); - $this->addDomainsToEntity('user', $account[$id]->id(), $id, DOMAIN_ACCESS_FIELD); - if ($id == 'one_example_com') { - $this->addDomainsToEntity('user', $account[$id]->id(), 1, DOMAIN_ACCESS_ALL_FIELD); - } - } - } - } - - /** - * Strips whitespace from a page response and runs assertRaw() equivalent. - * - * In tests, we were having difficulty with spacing in tables. This method - * takes some concepts from Mink and rearranges them to work for our tests. - * Notably, we don't pull page content from the session request. - * - * @param string $content - * The generated HTML, such as from drupalGet(). - * @param string $text - * The text string to search for. - */ - public function checkContent($content, $text) { - // Convert all whitespace to spaces. - $content = preg_replace('/\s+/u', ' ', $content); - // Strip all whitespace between tags. - $content = preg_replace('@>\\s+<@', '><', $content); - $regex = '/' . preg_quote($text, '/') . '/ui'; - $message = sprintf('The text "%s" was found in the text of the current page.', $text); - $this->assert((bool) preg_match($regex, $content), $message); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/README.md b/sites/all/modules/contrib/admin/domain/domain_source/README.md deleted file mode 100644 index 7508eeba6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/README.md +++ /dev/null @@ -1,58 +0,0 @@ -Domain Source -====== - -Allows content to be assigned a canonical domain when writing URLs. Domain Source will -ensure that content that appears on multiple domains always links to one URL. - -When links are written to content from another domain, the links -will go to the "source" domain specified for the node. - -Domain Source does not issue redirects. It rewrites links. The only time redirects may -be involved is when content is saved. - -Domain Source Fields ------ - -Domain Source adds a field to each content type that works with or without Domain Access. -The field is optional. If Domain Access is present, only a selected domain may be -assigned as the source domain. - -Domain Source configuration ------ - -The module has a configuration option that allows administrators to disable link rewrites -for specific Drupal paths. These paths are defined by Drupal's routing system. The default' -set of routes are: - -* `canonical` -- the View page of a node -* `delete_form` -- the delete form -* `edit_form` -- the edit form -* `version_history` -- the revisions page -* `revision` -- the revision edit form -* `create` -- not enforced - -Additional routes may be defined by other modules. Most notable Content Translation, -which adds: - -* `content_translation_overview` -- the overview page -* `content_translation_add` -- the add translation link -* `content_translation_edit` -- the edit translation form -* `content_translation_delete` -- the delete translation form - -Additional Entities ------ - -Domain Source is designed to work for content (nodes) but should work with other content -entities. You will need to configure the field for each entity type manually. - -Developer Notes ------ - -Domain Source changes core's `redirect_response_subscriber` service to the -`DomainSourceRedirectResponseSubscriber` class. This allows us to issue redirects to -registered domains and aliases that would otherwise not be recognizes as internal Drupal -links. These redirects typically occur on entity save when the source domain varies from -the current domain. - -Domain Source also implements `OutboundPathProcessorInterface` to rewrite links to an -entity assigned to a source domain. diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml deleted file mode 100644 index d63da0eb3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml +++ /dev/null @@ -1 +0,0 @@ -exclude_routes: {} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml deleted file mode 100644 index 9ae9937de..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - node - enforced: - module: - - domain_source -id: node.field_domain_source -field_name: field_domain_source -entity_type: node -type: entity_reference -settings: - target_type: domain -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml deleted file mode 100644 index bbde9a45a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml +++ /dev/null @@ -1,10 +0,0 @@ -domain_source.settings: - type: config_object - label: 'Domain Source settings' - mapping: - exclude_routes: - type: sequence - label: 'Disable link rewrites for specific entity routes.' - sequence: - type: string - label: 'Route' diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml deleted file mode 100644 index 5ce71d584..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml +++ /dev/null @@ -1,9 +0,0 @@ -views.field.domain_source: - type: views_field - label: 'Domain source' -views.filter.domain_source: - type: views.filter.in_operator - label: 'Domain source' -views.filter_value.domain_source: - type: views.filter_value.in_operator - label: 'Domain source' diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php deleted file mode 100644 index 709c6b337..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php +++ /dev/null @@ -1,65 +0,0 @@ -getStorage('domain')->loadDefaultDomain(); -} - -/** - * Allows modules to specify the target link for a Drupal path. - * - * Note: This hook is not meant to be used for node or entity paths, which - * are handled by hook_domain_source_alter(). This hook is split - * from hook_domain_source_alter() for better performance. - * - * Note that hook_domain_source_alter() only paths that are not content - * entities. - * - * Currently, no modules in the package implement this hook. - * - * There is no return value for this hook. Modify $source by reference by - * loading a valid domain record or set $source = NULL to discard an existing - * $source value and not rewrite the path. - * - * @param array &$source - * The domain array from domain_get_node_match(), passed by reference. - * @param string $path - * The outbound path request. - * @param array $options - * The options for the url, as defined by - * \Drupal\Core\PathProcessor\OutboundPathProcessorInterface. - */ -function hook_domain_source_path_alter(array &$source, $path, array $options) { - // Always make admin links go to the primary domain. - $parts = explode('/', $path); - if (isset($parts[0]) && $parts[0] == 'admin') { - $source = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain(); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml deleted file mode 100644 index 1ba6c6fd4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Domain Source -description: 'Domain-based path rewrites for content.' -type: module -package: Domain -# version: VERSION -# core: 8.x -dependencies: - - drupal:node - - domain:domain - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.install b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.install deleted file mode 100644 index 9bde50b57..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.install +++ /dev/null @@ -1,30 +0,0 @@ -getStorage('node_type')->loadMultiple(); - foreach ($node_types as $type => $info) { - $list[$type] = 'node'; - } - // Install our fields. - foreach ($list as $bundle => $entity_type) { - domain_source_confirm_fields($entity_type, $bundle); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml deleted file mode 100644 index a61d45d8e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml +++ /dev/null @@ -1,7 +0,0 @@ -drupal.domain_source: - version: VERSION - js: - js/domain_source.js: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml deleted file mode 100644 index e40865771..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -domain_source.settings: - title: Domain Source settings - route_name: domain_source.settings - parent: domain.admin - description: 'Domain Source settings' - weight: 15 diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml deleted file mode 100644 index a636149e3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -domain_source.settings: - title: Domain Source settings - route_name: domain_source.settings - base_route: domain.admin diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.module b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.module deleted file mode 100644 index 0e1f37a76..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.module +++ /dev/null @@ -1,302 +0,0 @@ -getStorage('field_config'); - - if (!$field = $field_config_storage->load($id)) { - $field = [ - 'field_name' => DOMAIN_SOURCE_FIELD, - 'entity_type' => $entity_type, - 'label' => 'Domain Source', - 'bundle' => $bundle, - 'required' => FALSE, - 'description' => 'Select the canonical domain for this content.', - 'settings' => [ - 'handler' => 'default:domain', - // Handler_settings are deprecated but seem to be necessary here. - 'handler_settings' => [ - 'target_bundles' => NULL, - 'sort' => ['field' => 'weight', 'direction' => 'ASC'], - ], - 'target_bundles' => NULL, - 'sort' => ['field' => 'weight', 'direction' => 'ASC'], - ], - ]; - $field_config = $field_config_storage->create($field); - $field_config->save(); - } - - // Tell the form system how to behave. Default to radio buttons. - $display = \Drupal::entityTypeManager() - ->getStorage('entity_form_display') - ->load($entity_type . '.' . $bundle . '.default'); - if ($display) { - $display->setComponent(DOMAIN_SOURCE_FIELD, [ - 'type' => 'options_select', - 'weight' => 42, - ])->save(); - } -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - * - * Creates our fields when new node types are created. - * - * @TODO: Make this possible for all entity types. - */ -function domain_source_node_type_insert(EntityInterface $entity) { - /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ - if (!$entity->isSyncing()) { - // Do not fire hook when config sync in progress. - domain_source_confirm_fields('node', $entity->id()); - } -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - * - * In some cases, form display modes are not set when the node type is created. - * be sure to update our field definitions on creation of form_display for - * node types. - */ -function domain_source_entity_form_display_insert(EntityInterface $entity) { - if (!$entity->isSyncing() && $entity->getTargetEntityTypeId() == 'node' && $bundle = $entity->getTargetBundle()) { - domain_source_confirm_fields('node', $bundle); - } -} - -/** - * Returns the source domain associated to an entity. - * - * @param Drupal\Core\Entity\EntityInterface $entity - * The entity to check. - * - * @return string|null - * The value assigned to the entity, either a domain id string or NULL. - */ -function domain_source_get(EntityInterface $entity) { - $source = NULL; - - if (!isset($entity->{DOMAIN_SOURCE_FIELD})) { - return $source; - } - - $value = $entity->get(DOMAIN_SOURCE_FIELD)->offsetGet(0); - if (!empty($value)) { - $target_id = $value->target_id; - if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($target_id)) { - $source = $domain->id(); - } - } - return $source; -} - -/** - * Implements hook_form_alter(). - * - * Find forms that contain the domain source field and allow those to handle - * redirects properly. - */ -function domain_source_form_alter(&$form, &$form_state, $form_id) { - $object = $form_state->getFormObject(); - // Set up our TrustedRedirect handler for form saves. - if (isset($form[DOMAIN_SOURCE_FIELD]) && !empty($object) && is_callable([$object, 'getEntity']) && $entity = $object->getEntity()) { - foreach ($form['actions'] as $key => $element) { - // Redirect submit handlers, but not the preview button. - if ($key != 'preview' && isset($element['#type']) && $element['#type'] == 'submit') { - $form['actions'][$key]['#submit'][] = 'domain_source_form_submit'; - } - } - } -} - -/** - * Validate form submissions. - */ -function domain_source_form_validate($element, FormStateInterface $form_state) { - $values = $form_state->getValues(); - // This is only run if Domain Access is present. - if (isset($values[DOMAIN_SOURCE_FIELD]) && is_array($values[DOMAIN_SOURCE_FIELD]) && isset($values[DOMAIN_ACCESS_FIELD])) { - $access_values = $values[DOMAIN_ACCESS_FIELD]; - $source_value = current($values[DOMAIN_SOURCE_FIELD]); - } - // If no value is selected, that's acceptable. Else run through a check. - // Note that the _none selection returns as [FALSE]. - $source_set = empty($source_value); - foreach ($access_values as $value) { - // Core is inconsistent depending on the field order. - // See https://www.drupal.org/project/domain/issues/2945771#comment-12493199 - if (is_array($value) && $value == $source_value) { - $source_set = TRUE; - } - elseif (is_string($value) && !empty($source_value['target_id']) && $value == $source_value['target_id']) { - $source_set = TRUE; - } - } - if (!$source_set) { - $form_state->setError($element, t('The source domain must be selected as a publishing option.')); - } -} - -/** - * Redirect form submissions to other domains. - */ -function domain_source_form_submit(&$form, FormStateInterface $form_state) { - // Ensure that we have saved an entity. - if ($object = $form_state->getFormObject()) { - $url = $object->getEntity()->url(); - } - // Validate that the URL will be considered "external" by Drupal, which means - // that a scheme value will be present. - if (!empty($url)) { - $uri_parts = parse_url($url); - // If necessary and secure, issue a TrustedRedirectResponse to the new URL. - if (!empty($uri_parts['host'])) { - // Pass a redirect if necessary. - if (DomainRedirectResponse::checkTrustedHost($uri_parts['host'])) { - $response = new TrustedRedirectResponse($url); - $form_state->setResponse($response); - } - } - } -} - -/** - * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm. - */ -function domain_source_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) { - // Add the options hidden from the user silently to the form. - $manager = \Drupal::service('domain_source.element_manager'); - $hide = TRUE; - $form = $manager->setFormOptions($form, $form_state, DOMAIN_SOURCE_FIELD, $hide); - // Check that our field is present and add validation if Domain Access is - // installed. See https://www.drupal.org/node/2952535. - if (isset($form[DOMAIN_SOURCE_FIELD]) && defined('DOMAIN_ACCESS_FIELD') && isset($form[DOMAIN_ACCESS_FIELD])) { - $form[DOMAIN_SOURCE_FIELD]['#element_validate'] = ['domain_source_form_validate']; - // If using a select field, load the JS to show/hide options. - if ($form[DOMAIN_SOURCE_FIELD]['widget']['#type'] == 'select') { - $form['#attached']['library'][] = 'domain_source/drupal.domain_source'; - } - } -} - -/** - * Implements hook_views_data_alter(). - */ -function domain_source_views_data_alter(array &$data) { - $table = 'node__' . DOMAIN_SOURCE_FIELD; - $data[$table][DOMAIN_SOURCE_FIELD]['field']['id'] = 'domain_source'; - $data[$table][DOMAIN_SOURCE_FIELD . '_target_id']['filter']['id'] = 'domain_source'; - // Since domains are not stored in the database, relationships cannot be used. - unset($data[$table][DOMAIN_SOURCE_FIELD]['relationship']); -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Add options for domain source when using Devel Generate. - */ -function domain_source_form_devel_generate_form_content_alter(&$form, &$form_state, $form_id) { - // Add our element to the Devel generate form. - $list = ['_derive' => t('Derive from domain selection')]; - $list += \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(); - $form['domain_source'] = [ - '#title' => t('Domain source'), - '#type' => 'checkboxes', - '#options' => $list, - '#weight' => 4, - '#multiple' => TRUE, - '#size' => count($list) > 5 ? 5 : count($list), - '#default_value' => ['_derive'], - '#description' => t('Sets the source domain for created nodes.'), - ]; -} - -/** - * Implements hook_ENTITY_TYPE_presave(). - * - * Fires only if Devel Generate module is present, to assign test nodes to - * domains. - */ -function domain_source_node_presave(EntityInterface $node) { - domain_source_presave_generate($node); -} - -/** - * Handles presave operations for devel generate. - */ -function domain_source_presave_generate(EntityInterface $entity) { - // Handle devel module settings. - $exists = \Drupal::moduleHandler()->moduleExists('devel_generate'); - $values = []; - $selections = []; - if ($exists && isset($entity->devel_generate)) { - // If set by the form. - if (isset($entity->devel_generate['domain_access'])) { - $selection = array_filter($entity->devel_generate['domain_access']); - if (isset($selection['random-selection'])) { - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $selections = array_rand($domains, ceil(rand(1, count($domains)))); - } - else { - $selections = array_keys($selection); - } - } - if (isset($entity->devel_generate['domain_source'])) { - $selection = $entity->devel_generate['domain_source']; - if ($selection == '_derive') { - if (!empty($selections)) { - $values[DOMAIN_SOURCE_FIELD] = current($selections); - } - else { - $values[DOMAIN_SOURCE_FIELD] = NULL; - } - } - foreach ($values as $name => $value) { - $entity->set($name, $value); - } - } - } -} - - -/** - * Implements hook_hook_info(). - */ -function domain_source_hook_info() { - $hooks['domain_source_alter'] = [ - 'group' => 'domain_source', - ]; - $hooks['domain_source_path_alter'] = [ - 'group' => 'domain_source', - ]; - return $hooks; -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml deleted file mode 100644 index 551e37400..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -domain_source.settings: - path: '/admin/config/domain/domain_source' - defaults: - _title: 'Domain Source settings' - _form: '\Drupal\domain_source\Form\DomainSourceSettingsForm' - requirements: - _permission: 'administer domains' diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml deleted file mode 100644 index 93c38cad4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - domain_source.element_manager: - class: Drupal\domain_source\DomainSourceElementManager - arguments: ['@entity_type.manager'] - domain_source.path_processor: - class: Drupal\domain_source\HttpKernel\DomainSourcePathProcessor - arguments: ['@domain.negotiator', '@module_handler', '@entity_type.manager', '@path.alias_manager', '@config.factory'] - tags: - - { name: path_processor_outbound, priority: 90 } diff --git a/sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml b/sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml deleted file mode 100644 index 6c115c943..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - domain_source.commands: - class: \Drupal\domain_source\Commands\DomainSourceCommands - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js b/sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js deleted file mode 100644 index 6e549663a..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * Attaches behaviors for the Domain Source module. - * - * If Domain Access is present, we show/hide selected publishing domains. This approach - * currently only works with a select field. - */ -(function ($) { - - "use strict"; - - /** - * - * @type {Drupal~behavior} - */ - Drupal.behaviors.domainSourceAllowed = { - attach: function () { - - // Get the initial setting so that it can be reset. - var initialOption = $("#edit-field-domain-source").val(); - - // Onload, fire initial show/hide. - getDomains(); - - // Get the domains selected by the domain access field. - function getDomains() { - var domains = new Array(); - $("#edit-field-domain-access :checked").each(function(index, obj) { - domains.push(obj.value); - }); - setOptions(domains); - } - - // Based on selected domains, show/hide the selection options. - function setOptions(domains) { - $("#edit-field-domain-source option").each(function(index, obj) { - if (jQuery.inArray(obj.value, domains) == -1 && obj.value != '_none') { - // If the current selection is removed, reset the selection to _none. - if ($("#edit-field-domain-source").val() == obj.value) { - $("#edit-field-domain-source").val('_none'); - } - $("#edit-field-domain-source option[value=" + obj.value + "]").hide(); - } - else { - $("#edit-field-domain-source option[value=" + obj.value + "]").show(); - // If we reselected the initial value, reset the select option. - if (obj.value == initialOption) { - $("#edit-field-domain-source").val(obj.value); - } - } - }); - } - - // When the selections change, recalculate the select options. - $( "#edit-field-domain-access" ).on( "change", getDomains ); - } - }; - -})(jQuery); diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php deleted file mode 100644 index 452f0efd3..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php +++ /dev/null @@ -1,79 +0,0 @@ -getFieldEntities(DOMAIN_SOURCE_FIELD); - - return $result; - } - - /** - * @hook option domain:delete - */ - public function deleteOptions(Command $command, AnnotationData $annotationData) { - $command->addOption( - 'source-assign', - '', - InputOption::VALUE_OPTIONAL, - 'Reassign content for Domain Source', - null - ); - } - - /** - * @hook on-event domain-delete - */ - public function domainSourceDomainDelete($target_domain, $options) { - // Run our own deletion routine here. - if (is_null($options['content-assign'])) { - $policy_content = 'prompt'; - } - if (!empty($options['content-assign'])) { - if (in_array($options['content-assign'], $this->reassignment_policies, TRUE)) { - $policy_content = $options['content-assign']; - } - } - - $delete_options = [ - 'entity_filter' => 'node', - 'policy' => $policy_content, - 'field' => DOMAIN_SOURCE_FIELD, - ]; - - return $this->doReassign($target_domain, $delete_options); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php b/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php deleted file mode 100644 index 4568cdf2b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php +++ /dev/null @@ -1,28 +0,0 @@ -getBuildInfo(); - $entity = $form_state->getFormObject()->getEntity(); - $entity_values = $entity->get(DOMAIN_SOURCE_FIELD)->offsetGet(0); - if (isset($field['widget']['#options']) && !empty($entity_values)) { - $value = $entity_values->getValue('target_id'); - $options = array_diff_key(array_flip($value), $field['widget']['#options']); - } - return array_keys($options); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php b/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php deleted file mode 100644 index ce3b00ae4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php +++ /dev/null @@ -1,21 +0,0 @@ -getDefinition('redirect_response_subscriber'); - $definition->setClass('Drupal\domain_source\EventSubscriber\DomainSourceRedirectResponseSubscriber'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php b/sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php deleted file mode 100644 index 9510a26b6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php +++ /dev/null @@ -1,68 +0,0 @@ -getResponse(); - if ($response instanceof RedirectResponse) { - $request = $event->getRequest(); - - // Let the 'destination' query parameter override the redirect target. - // If $response is already a SecuredRedirectResponse, it might reject the - // new target as invalid, in which case proceed with the old target. - $destination = $request->query->get('destination'); - if ($destination) { - // The 'Location' HTTP header must always be absolute. - $destination = $this->getDestinationAsAbsoluteUrl($destination, $request->getSchemeAndHttpHost()); - try { - $response->setTargetUrl($destination); - } - catch (\InvalidArgumentException $e) { - } - } - - // Regardless of whether the target is the original one or the overridden - // destination, ensure that all redirects are safe. - if (!($response instanceof SecuredRedirectResponse)) { - try { - // SecuredRedirectResponse is an abstract class that requires a - // concrete implementation. Default to DomainRedirectResponse, which - // considers only redirects to sites registered via Domain. - $safe_response = DomainRedirectResponse::createFromRedirectResponse($response); - $safe_response->setRequestContext($this->requestContext); - } - catch (\InvalidArgumentException $e) { - // If the above failed, it's because the redirect target wasn't - // local. Do not follow that redirect. Display an error message - // instead. We're already catching one exception, so trigger_error() - // rather than throw another one. - // We don't throw an exception, because this is a client error rather - // than a server error. - $message = 'Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.'; - trigger_error($message, E_USER_ERROR); - $safe_response = new Response($message, 400); - } - $event->setResponse($safe_response); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php deleted file mode 100644 index 332529b5c..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php +++ /dev/null @@ -1,66 +0,0 @@ -getDefinition('node')->getLinkTemplates(); - - $options = []; - foreach ($routes as $route => $path) { - // Some parts of the system prepend drupal:, which the routing - // system doesn't use. The routing system also uses underscores instead - // of dashes. Because Drupal. - $route = str_replace(['-', 'drupal:'], ['_', ''], $route); - $options[$route] = $route; - } - $config = $this->config('domain_source.settings'); - $form['exclude_routes'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Disable link rewrites for the selected routes.'), - '#default_value' => $config->get('exclude_routes') ?: [], - '#options' => $options, - '#description' => $this->t('Check the routes to disable. Any entity URL with a Domain Source field will be rewritten unless its corresponding route is disabled.'), - ]; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config('domain_source.settings') - ->set('exclude_routes', $form_state->getValue('exclude_routes')) - ->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php b/sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php deleted file mode 100644 index 799ececd4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php +++ /dev/null @@ -1,294 +0,0 @@ -negotiator = $negotiator; - $this->moduleHandler = $module_handler; - $this->entityTypeManager = $entity_type_manager; - $this->aliasManager = $alias_manager; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) { - // Load the active domain if not set. - if (empty($options['active_domain'])) { - $active_domain = $this->getActiveDomain(); - } - - // Only act on valid internal paths and when a domain loads. - if (empty($active_domain) || empty($path) || !empty($options['external'])) { - return $path; - } - - // Set the default source information. - $source = NULL; - $options['active_domain'] = $active_domain; - - // Get the current language. - $langcode = NULL; - if (!empty($options['language'])) { - $langcode = $options['language']->getId(); - } - - // Get the URL object for this request. - $alias = $this->aliasManager->getPathByAlias($path, $langcode); - $url = Url::fromUserInput($alias, $options); - - // Check the route, if available. Entities can be configured to - // only rewrite specific routes. - if ($url->isRouted() && $this->allowedRoute($url->getRouteName())) { - // Load the entity to check. - if (!empty($options['entity'])) { - $entity = $options['entity']; - } - else { - $parameters = $url->getRouteParameters(); - if (!empty($parameters)) { - $entity = $this->getEntity($parameters); - } - } - } - - // One hook for entities. - if (!empty($entity)) { - // Enmsure we send the right translation. - if (!empty($langcode) && method_exists($entity, 'hasTranslation') && $entity->hasTranslation($langcode) && $translation = $entity->getTranslation($langcode)) { - $entity = $translation; - } - if (isset($options['domain_target_id'])) { - $target_id = $options['domain_target_id']; - } - else { - $target_id = domain_source_get($entity); - } - if (!empty($target_id)) { - $source = $this->domainStorage()->load($target_id); - } - $options['entity'] = $entity; - $options['entity_type'] = $entity->getEntityTypeId(); - $this->moduleHandler->alter('domain_source', $source, $path, $options); - } - // One for other, because the latter is resource-intensive. - else { - if (isset($options['domain_target_id'])) { - $target_id = $options['domain_target_id']; - $source = $this->domainStorage()->load($target_id); - } - $this->moduleHandler->alter('domain_source_path', $source, $path, $options); - } - // If a source domain is specified, rewrite the link. - if (!empty($source)) { - // Note that url rewrites add a leading /, which getPath() also adds. - $options['base_url'] = trim($source->getPath(), '/'); - $options['absolute'] = TRUE; - } - return $path; - } - - /** - * Derive entity data from a given route's parameters. - * - * @param array $parameters - * An array of route parameters. - * - * @return \Drupal\Core\Entity\EntityInterface|null - * Returns the entity when available, otherwise NULL. - */ - public function getEntity(array $parameters) { - $entity = NULL; - $entity_type = key($parameters); - $entity_types = $this->getEntityTypes(); - foreach ($parameters as $entity_type => $value) { - if (!empty($entity_type) && isset($entity_types[$entity_type])) { - $entity = $this->entityTypeManager->getStorage($entity_type)->load($value); - } - } - return $entity; - } - - /** - * Checks that a route's common name is not disallowed. - * - * Looks at the name (e.g. canonical) of the route without regard for - * the entity type. - * - * @parameter $name - * The route name being checked. - * - * @return bool - * Returns TRUE when allowed, otherwise FALSE. - */ - public function allowedRoute($name) { - $excluded = $this->getExcludedRoutes(); - $parts = explode('.', $name); - $route_name = end($parts); - // Config is stored as an array. Empty items are not excluded. - return !isset($excluded[$route_name]); - } - - /** - * Gets an array of content entity types, keyed by type. - * - * @return \Drupal\Core\Entity\EntityTypeInterface[] - * An array of content entity types, keyed by type. - */ - public function getEntityTypes() { - if (!isset($this->entityTypes)) { - foreach ($this->entityTypeManager->getDefinitions() as $type => $definition) { - if ($definition->getGroup() == 'content') { - $this->entityTypes[$type] = $type; - } - } - } - return $this->entityTypes; - } - - /** - * Gets the settings for domain source path rewrites. - * - * @return array - * The settings for domain source path rewrites. - */ - public function getExcludedRoutes() { - if (!isset($this->excludedRoutes)) { - $config = $this->configFactory->get('domain_source.settings'); - $routes = $config->get('exclude_routes'); - if (is_array($routes)) { - $this->excludedRoutes = array_flip($routes); - } - else { - $this->excludedRoutes = []; - } - } - return $this->excludedRoutes; - } - - /** - * Gets the active domain. - * - * @return \Drupal\domain\DomainInterface - * The active domain. - */ - public function getActiveDomain() { - if (!isset($this->activeDomain)) { - // Ensure that the loader has run. - // In some tests, the kernel event has not. - $active = $this->negotiator->getActiveDomain(); - if (empty($active)) { - $active = $this->negotiator->getActiveDomain(TRUE); - } - $this->activeDomain = $active; - } - return $this->activeDomain; - } - - /** - * Retrieves the domain storage handler. - * - * @return \Drupal\domain\DomainStorageInterface - * The domain storage handler. - */ - protected function domainStorage() { - if (!$this->domainStorage) { - $this->domainStorage = $this->entityTypeManager->getStorage('domain'); - } - return $this->domainStorage; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php deleted file mode 100644 index aedfcf8d6..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php +++ /dev/null @@ -1,50 +0,0 @@ -options['settings']['link'])) { - foreach ($items as &$item) { - $object = $item['raw']; - $entity = $object->getEntity(); - $url = $entity->toUrl()->toString(); - $domain = $item['rendered']['#options']['entity']; - $item['rendered']['#type'] = 'markup'; - $item['rendered']['#markup'] = '' . $domain->label() . ''; - } - uasort($items, [$this, 'sort']); - } - - return $items; - } - - /** - * Sort the domain list, if possible. - */ - private function sort($a, $b) { - $domainA = isset($a['rendered']['#options']['entity']) ? $a['rendered']['#options']['entity'] : 0; - $domainB = isset($b['rendered']['#options']['entity']) ? $b['rendered']['#options']['entity'] : 0; - if ($domainA !== 0) { - return $domainA->getWeight() > $domainB->getWeight(); - } - // We don't have a domain object so sort as best we can. - return $a['rendered']['#plain_text'] > $b['rendered']['#plain_text']; - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php deleted file mode 100644 index 1983bfbf4..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php +++ /dev/null @@ -1,42 +0,0 @@ -valueOptions)) { - $this->valueTitle = $this->t('Domains'); - $this->valueOptions = [ - '_active' => $this->t('Active domain'), - ] + \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(); - } - return $this->valueOptions; - } - - /** - * {@inheritdoc} - */ - public function query() { - $active_index = array_search('_active', (array) $this->value); - if ($active_index !== FALSE) { - $active_id = \Drupal::service('domain.negotiator')->getActiveId(); - $this->value[$active_index] = $active_id; - } - - parent::query(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml b/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml deleted file mode 100644 index 098153fb0..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml +++ /dev/null @@ -1,212 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - rest - - serialization - - user -id: domain_format_test -label: 'Domain format test' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 2 - display_options: - display_extenders: { } - path: domain-format-test - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - rest_export_1: - display_plugin: rest_export - id: rest_export_1 - display_title: 'REST export' - position: 1 - display_options: - display_extenders: { } - path: domain-format-test - row: - type: data_field - options: - field_options: - title: - alias: '' - raw_output: false - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - request_format - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml deleted file mode 100644 index b30a708ef..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Domain Source module tests" -description: "Support module for domain source testing." -type: module -package: Testing -# version: VERSION -# core: 8.x -hidden: TRUE - -dependencies: - - domain - - domain_source - - node - - rest - - serialization - - user - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-1.0-alpha15' -core: '8.x' -project: 'domain' -datestamp: 1550763190 diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module b/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module deleted file mode 100644 index 624ec3f62..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module +++ /dev/null @@ -1,13 +0,0 @@ -getStorage('domain')->loadDefaultDomain(); - } -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php deleted file mode 100644 index 086a3921b..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'page', - 'title' => 'foo', - DOMAIN_ACCESS_FIELD => ['example_com', 'one_example_com', 'two_example_com'], - DOMAIN_ACCESS_ALL_FIELD => 0, - DOMAIN_SOURCE_FIELD => $id, - ]; - $node = $this->createNode($nodes_values); - - // Variables for our tests. - $path = 'node/1'; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $source = $domains[$id]; - $expected = $source->getPath() . $path; - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $uri = 'entity:' . $path; - $uri_path = '/' . $path; - $options = []; - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - - // Get the path processor service. - $paths = \Drupal::service('domain_access.manager'); - $urls = $paths->getContentUrls($node); - $expected = [ - $id => $domains[$id]->getPath() . 'node/1', - 'example_com' => $domains['example_com']->getPath() . 'node/1', - 'two_example_com' => $domains['two_example_com']->getPath() . 'node/1', - ]; - - $this->assertTrue($expected == $urls); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php deleted file mode 100644 index 981c2cbb9..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php +++ /dev/null @@ -1,184 +0,0 @@ -domainCreateTestDomains(5); - } - - /** - * Test runner. - */ - public function testDomainSourceElement() { - $this->runInstalledTest('article'); - $node_type = $this->createContentType(['type' => 'test']); - $this->runInstalledTest('test'); - } - - /** - * Basic test setup. - */ - public function runInstalledTest($node_type) { - $admin = $this->drupalCreateUser([ - 'bypass node access', - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'publish to any domain', - ]); - $this->drupalLogin($admin); - - $this->drupalGet('node/add/article'); - $this->assertSession()->statusCodeEquals(200); - - $nid = $node_type == 'article' ? 1 : 2; - - // Set the title, so the node can be saved. - $this->fillField('title[0][value]', 'Test node'); - - // We expect to find 5 domain options. We set two as selected. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $count = 0; - $ids = ['example_com', 'one_example_com', 'two_example_com']; - foreach ($domains as $domain) { - $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']'; - $this->findField($locator); - if (in_array($domain->id(), $ids)) { - $this->checkField($locator); - } - } - // Find the all affiliates field. - $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]'; - $this->findField($locator); - - // Set all affiliates to TRUE. - $this->checkField($locator); - - // Find the Domain Source field. - $locator = DOMAIN_SOURCE_FIELD; - $this->findField($locator); - // Set it to one_example_com. - $this->selectFieldOption($locator, 'one_example_com'); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Check the URL. - $url = $this->geturl(); - $this->assert(strpos($url, 'node/' . $nid . '/edit') === FALSE, 'Form submitted.'); - - // Edit the node. - $this->drupalGet('node/' . $nid . '/edit'); - $this->assertSession()->statusCodeEquals(200); - - // Set the domain source field to an unselected domain. - $this->selectFieldOption($locator, 'three_example_com'); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->assertEscaped('The source domain must be selected as a publishing option.'); - - // Check the URL. - $url = $this->geturl(); - $this->assert(strpos($url, 'node/' . $nid . '/edit') > 0, 'Form not submitted.'); - - // Set the field properly and save again. - $this->selectFieldOption($locator, 'one_example_com'); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Check the URL. - $url = $this->geturl(); - $this->assert(strpos($url, 'node/' . $nid . '/edit') === FALSE, 'Form submitted.'); - - // Save with no source. - // Edit the node. - $this->drupalGet('node/1/edit'); - $this->assertSession()->statusCodeEquals(200); - - // Set the domain source field to an unselected domain. - $this->selectFieldOption($locator, '_none'); - - // Save the form. - $this->pressButton('edit-submit'); - $this->assertSession()->statusCodeEquals(200); - - // Check the URL. - $url = $this->geturl(); - $this->assert(strpos($url, 'node/' . $nid . '/edit') === FALSE, 'Form submitted.'); - } - - /** - * Test for https://www.drupal.org/project/domain/issues/3010256. - */ - public function testAnonForm() { - // Editor with no domain permissions should not see the element. - $editor = $this->drupalCreateUser([ - 'create article content', - ]); - $this->drupalLogin($editor); - - $this->drupalGet('node/add/article'); - $this->assertSession()->statusCodeEquals(200); - - $locator = DOMAIN_SOURCE_FIELD; - $this->assertSession()->fieldNotExists($locator); - - // Editor with domain permissions should see the element once they - // are assigned to domains. - $editor2 = $this->drupalCreateUser([ - 'create article content', - 'publish to any assigned domain', - ]); - $this->drupalLogin($editor2); - - $this->drupalGet('node/add/article'); - $this->assertSession()->statusCodeEquals(200); - - $locator = DOMAIN_SOURCE_FIELD; - $this->assertSession()->fieldNotExists($locator); - - // Domain assignment. - $ids = ['example_com', 'one_example_com']; - $this->addDomainsToEntity('user', $editor2->id(), $ids, DOMAIN_ACCESS_FIELD); - - $this->drupalGet('node/add/article'); - $this->assertSession()->statusCodeEquals(200); - - $this->assertSession()->fieldExists($locator); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php deleted file mode 100644 index f4dc40982..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php +++ /dev/null @@ -1,174 +0,0 @@ -admin_user = $this->drupalCreateUser([ - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - ]); - $this->drupalLogin($this->admin_user); - - // Visit the article field administration page. - $this->drupalGet('admin/structure/types/manage/article/fields'); - $this->assertResponse(200, 'Manage fields page sourceed.'); - - // Check for a domain field. - $this->assertText('Domain Source', 'Domain form field found.'); - - // Visit the article field display administration page. - $this->drupalGet('admin/structure/types/manage/article/display'); - $this->assertResponse(200, 'Manage field display page sourceed.'); - - // Check for a domain field. - $this->assertText('Domain Source', 'Domain form field found.'); - } - - /** - * Tests the storage of the domain source field. - */ - public function testDomainSourceFieldStorage() { - $this->admin_user = $this->drupalCreateUser([ - 'administer content types', - 'administer node fields', - 'administer node display', - 'administer domains', - 'administer menu', - ]); - $this->drupalLogin($this->admin_user); - - // Create 5 domains. - $this->domainCreateTestDomains(5); - - // Visit the article field display administration page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - - // Check the new field exists on the page. - $this->assertText('Domain Source', 'Found the domain field instance.'); - - // We expect to find 5 domain options + none. - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $string = 'value="' . $domain->id() . '"'; - $this->assertRaw($string, 'Found the domain option.'); - if (!isset($one)) { - $one = $domain->id(); - continue; - } - if (!isset($two)) { - $two = $domain->id(); - $two_path = $domain->getPath(); - } - } - $this->assertRaw('value="_none"', 'Found the _none_ option.'); - - $node_storage = \Drupal::entityTypeManager()->getStorage('node'); - - // Try to post a node, assigned to the second domain. - $edit['title[0][value]'] = 'Test node'; - $edit['field_domain_source'] = $two; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - $this->assertResponse(200); - $node = $node_storage->load(1); - // Check that the value is set. - $value = domain_source_get($node); - $this->assertTrue($value == $two, 'Node saved with proper source record.'); - - // Test the URL. - $url = $node->toUrl()->toString(); - $expected_url = $two_path . 'node/1'; - $this->assertTrue($expected_url == $url, 'URL rewritten correctly.'); - - // Try to post a node, assigned to no domain. - $edit['title[0][value]'] = 'Test node'; - $edit["field_domain_source"] = '_none'; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - $this->assertResponse(200); - $node = $node_storage->load(2); - // Check that the value is set. - $value = domain_source_get($node); - $this->assertNull($value, 'Node saved with proper source record.'); - - // Test the url. - $url = $node->toUrl()->toString(); - $expected_url = base_path() . 'node/2'; - $this->assertTrue($expected_url == $url, 'URL rewritten correctly.'); - - // Place the menu block. - $this->drupalPlaceBlock('system_menu_block:main'); - - // Enable main menu as available menu. - $edit = [ - 'menu_options[main]' => 1, - 'menu_parent' => 'main:', - ]; - $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type')); - - // Create a third node that is assigned to a menu. - $edit = [ - 'title[0][value]' => 'Node 3', - 'menu[enabled]' => 1, - 'menu[title]' => 'Test preview', - 'field_domain_source' => $two, - ]; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - // Test the URL against expectations, and the rendered menu link. - $node = $node_storage->load(3); - $url = $node->toUrl()->toString(); - $expected_url = $two_path . 'node/3'; - $this->assertTrue($expected_url == $url, 'URL rewritten correctly.'); - // Load the page with a menu and check that link. - $this->drupalGet('node/3'); - $this->assertRaw('href="' . $url, 'Menu link rewritten correctly.'); - - // Remove the field from the node type and make sure nothing breaks. - // See https://www.drupal.org/node/2892612 - $id = 'node.article.field_domain_source'; - if ($field = \Drupal::entityManager()->getStorage('field_config')->load($id)) { - $field->delete(); - field_purge_batch(10, $field->uuid()); - drupal_flush_all_caches(); - } - // Visit the article field display administration page. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - // Try to post a node, assigned to no domain. - $edit2['title[0][value]'] = 'Test node'; - $this->drupalPostForm('node/add/article', $edit2, 'Save'); - // Test the URL against expectations, and the rendered menu link. - $node = $node_storage->load(4); - $url = $node->toUrl()->toString(); - $expected_url = '/node/4'; - $this->assertTrue($expected_url == $url, 'No URL rewrite performed.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php deleted file mode 100644 index ae0570954..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php +++ /dev/null @@ -1,98 +0,0 @@ - 'page', - 'title' => 'foo', - DOMAIN_SOURCE_FIELD => $id, - ]; - $node = $this->createNode($node_values); - - // Variables for our tests. - $path = 'node/1'; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $source = $domains[$id]; - $expected = $source->getPath() . $path; - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $uri = 'entity:' . $path; - $uri_path = '/' . $path; - $options = []; - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - - // Exclude the edit path from rewrites. - $config = $this->config('domain_source.settings'); - $config->set('exclude_routes', ['edit_form' => 'edit_form'])->save(); - - // Variables for our tests. - $path = 'node/1/edit'; - $expected = '/' . $path; - $route_name = 'entity.node.edit_form'; - $route_parameters = ['node' => 1]; - $uri = 'internal:/' . $path; - $uri_path = '/' . $path; - $options = []; - - // Because of path cache, we have to flush here. - drupal_flush_all_caches(); - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute' . $url); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php deleted file mode 100644 index 977f1d293..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php +++ /dev/null @@ -1,127 +0,0 @@ -save(); - ConfigurableLanguage::createFromLangcode('af')->save(); - - // Enable content translation for the current entity type. - \Drupal::service('content_translation.manager')->setEnabled('node', 'page', TRUE); - - } - - /** - * Tests domain source language. - */ - public function testDomainSourceLanguage() { - // Create a node, assigned to a source domain. - $id = 'one_example_com'; - // Create one node with no language. - $node = $this->drupalCreateNode([ - 'body' => [[]], - 'status' => 1, - DOMAIN_SOURCE_FIELD => $id, - ]); - - // Programmatically create a translation. - $storage = \Drupal::entityTypeManager()->getStorage('node'); - // Reload the node. - $node = $storage->load(1); - // Create an Afrikaans translation assigned to domain 2. - $id2 = 'two_example_com'; - $translation = $node->addTranslation('af'); - $translation->title->value = $this->randomString(); - $translation->{DOMAIN_SOURCE_FIELD} = $id2; - $translation->status = 1; - $node->save(); - - // Variables for our tests. - $path = 'node/1'; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $source = $domains[$id]; - $expected = $source->getPath() . $path; - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $uri = 'entity:' . $path; - $uri_path = '/' . $path; - $options = []; - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - - // Now test the same for the Arfrikaans translation. - $path = 'node/1'; - $source = $domains[$id2]; - $expected = $source->getPath() . 'af/' . $path; - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $uri = 'entity:' . $path; - $uri_path = '/' . $path; - $language = \Drupal::entityTypeManager()->getStorage('configurable_language')->load('af'); - $options = ['language' => $language]; - - $translation = $node->getTranslation('af'); - $this->assertTrue(domain_source_get($translation) == $id2, domain_source_get($translation)); - - // Because of path cache, we have to flush here. - drupal_flush_all_caches(); - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php deleted file mode 100644 index af6fd6701..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php +++ /dev/null @@ -1,54 +0,0 @@ -createNode(['type' => 'page', 'title' => 'foo', DOMAIN_SOURCE_FIELD => $id]); - - // Variables for our tests. - $path = 'domain-format-test'; - $options = ['query' => ['_format' => 'json']]; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - foreach ($domains as $domain) { - $this->drupalGet($domain->getPath() . $path, $options); - } - $source = $domains[$id]; - $uri_path = '/' . $path; - $expected = $uri_path . '?_format=json'; - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput: ' . $url . ' expected: ' . $expected); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php deleted file mode 100644 index 612f9ca06..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php +++ /dev/null @@ -1,84 +0,0 @@ - 'page', - 'title' => 'foo', - DOMAIN_SOURCE_FIELD => $id, - ]; - $node = $this->createNode($node_values); - - // Variables for our tests. - $path = 'node/1'; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $source = $domains[$id]; - $expected = $source->getPath() . $path; - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $options = []; - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Set up two additional domains. - $domain2 = $domains['two_example_com']; - - // Check against trusted host patterns. - $settings['settings']['trusted_host_patterns'] = (object) [ - 'value' => ['^' . $this->prepareTrustedHostname($domain2->getHostname()) . '$'], - 'required' => TRUE, - ]; - $this->writeSettings($settings); - // This URL should fail due to trusted host omission. - $this->drupalGet($url); - $this->assertRaw('The provided host name is not valid for this server.'); - - // Now switch the node to a domain that is trusted. - $node->{DOMAIN_SOURCE_FIELD} = $domain2->id(); - $node->save(); - // Get the link using Url::fromRoute(). - $expected = $domain2->getPath() . $path; - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - // Assert that the URL is what we expect. - $this->assertTrue($url == $expected, 'fromRoute'); - $this->drupalGet($url); - $this->assertResponse(200, 'Url is validated by trusted host settings.'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php deleted file mode 100644 index 03c5b344e..000000000 --- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php +++ /dev/null @@ -1,70 +0,0 @@ - 'page', - 'title' => 'foo', - DOMAIN_SOURCE_FIELD => $id, - ]; - $node = $this->createNode($nodes_values); - - // Variables for our tests. - $path = 'node/1'; - $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(); - $source = $domains[$id]; - $expected = $source->getPath() . $path; - $route_name = 'entity.node.canonical'; - $route_parameters = ['node' => 1]; - $uri = 'entity:' . $path; - $uri_path = '/' . $path; - $options = []; - - // Get the link using Url::fromRoute(). - $url = URL::fromRoute($route_name, $route_parameters, $options)->toString(); - $this->assertTrue($url == $expected, 'fromRoute'); - - // Get the link using Url::fromUserInput() - $url = URL::fromUserInput($uri_path, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUserInput'); - - // Get the link using Url::fromUri() - $url = URL::fromUri($uri, $options)->toString(); - $this->assertTrue($url == $expected, 'fromUri'); - } - -} diff --git a/sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt b/sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml deleted file mode 100644 index a144636ee..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml +++ /dev/null @@ -1 +0,0 @@ -menu_enabled: [] \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml deleted file mode 100644 index bbdb9fee6..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - menu_link_content -id: menu_link_content.field_domain_access -field_name: field_domain_access -entity_type: menu_link_content -type: entity_reference -settings: - target_type: domain -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml deleted file mode 100644 index 47842d3ce..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - domain - - menu_link_content -id: menu_link_content.field_domain_all_affiliates -field_name: field_domain_all_affiliates -entity_type: menu_link_content -type: boolean -settings: { } -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml deleted file mode 100644 index 49c9ece81..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml +++ /dev/null @@ -1,3 +0,0 @@ -domain_menu_access.menu_enabled: - type: sequence - label: 'Menu enabled' diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml deleted file mode 100644 index c8d1ec748..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Domain Menu Access -description: 'Domain-based access control for menu link.' -type: module -package: Domain -# core: 8.x -dependencies: - - domain:domain - - domain:domain_access - -# Information added by Drupal.org packaging script on 2018-10-25 -version: '8.x-1.0-alpha2+2-dev' -core: '8.x' -project: 'domain_menu_access' -datestamp: 1540442284 diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install deleted file mode 100644 index 7b88e5388..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install +++ /dev/null @@ -1,38 +0,0 @@ - 'menu_link_content', - 'label' => 'Send for all affiliates', - 'description' => 'Make this menu entry available on all domains.', - ]; - domain_access_confirm_fields('menu_link_content', 'menu_link_content', $text); -} - -/** - * Implements hook_uninstall(). - * - * Removes access control fields on uninstall. - */ -function domain_menu_access_uninstall() { - $field_storage_config = \Drupal::entityTypeManager() - ->getStorage('field_storage_config'); - - $id = 'menu_link_content.' . DOMAIN_ACCESS_FIELD; - if ($field = $field_storage_config->load($id)) { - $field->delete(); - } - $id = 'menu_link_content.' . DOMAIN_ACCESS_ALL_FIELD; - if ($field = $field_storage_config->load($id)) { - $field->delete(); - } -} diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml deleted file mode 100644 index 99368c36b..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -domain_menu_access.domain_menu: - title: Domain menu settings - route_name: domain_menu_access.settings - description: 'Manage menu settings for specific domains.' - parent: domain.admin - weight: 10 diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml deleted file mode 100644 index 1df099e6a..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -domain_menu_access.admin: - title: Domain menu settings - route_name: domain_menu_access.settings - base_route: domain.admin diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module deleted file mode 100644 index 46c5d83ca..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module +++ /dev/null @@ -1,54 +0,0 @@ -getFormObject(); - /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $entity */ - $entity = $form_object->getEntity(); - - $config = \Drupal::config('domain_menu_access.settings')->get('menu_enabled'); - - if (!empty($config) && in_array($entity->getMenuName(), $config)) { - $form['domain'] = [ - '#type' => 'details', - '#title' => t('Domain'), - '#open' => TRUE, - '#weight' => 25, - ]; - - $form[DOMAIN_ACCESS_FIELD]['#group'] = 'domain'; - $form[DOMAIN_ACCESS_ALL_FIELD]['#group'] = 'domain'; - - // Add the options hidden from the user silently to the form. - $manager = \Drupal::service('domain.element_manager'); - $form = $manager->setFormOptions($form, $form_state, DOMAIN_ACCESS_FIELD); - } - else { - $form[DOMAIN_ACCESS_FIELD]['#access'] = FALSE; - $form[DOMAIN_ACCESS_ALL_FIELD]['#access'] = FALSE; - } -} diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml deleted file mode 100644 index db9a5386d..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -domain_menu_access.settings: - path: '/admin/config/domain/domain_menu_access/config' - defaults: - _form: '\Drupal\domain_menu_access\Form\DomainMenuAccessSettingsForm' - _title: 'Domain menu configuration' - requirements: - _permission: 'administer domains' diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml deleted file mode 100644 index d7e0f971e..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - domain_menu_access.default_tree_manipulators: - class: Drupal\domain_menu_access\Menu\DomainMenuLinkTreeManipulators - arguments: ['@entity_type.manager', '@domain.negotiator', '@language_manager'] diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php deleted file mode 100644 index 30a9aa85a..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php +++ /dev/null @@ -1,78 +0,0 @@ -config('domain_menu_access.settings')->get('menu_enabled'); - if (!$config) { - $config = []; - } - - $menu = Menu::loadMultiple(); - if (empty($menu)) { - $form['markup'] = [ - '#markup' => $this->t('Your menu list is empty. Please, try add the menu and return here.'), - ]; - } - else { - $form['description'] = [ - '#markup' => $this->t('Please, select menu for enable control by domain records.'), - ]; - /** @var \Drupal\system\Entity\Menu $item */ - foreach ($menu as $key => $item) { - $form[$key] = [ - '#type' => 'checkbox', - '#title' => $item->label(), - '#default_value' => in_array($key, $config) ? '1' : '', - '#description' => $item->getDescription(), - ]; - } - } - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('domain_menu_access.settings'); - $menu = array_keys(Menu::loadMultiple()); - if (!empty($menu) && !empty($form_state->getValues())) { - $menu_enabled = []; - $values = $form_state->getValues(); - foreach ($values as $key => $value) { - if ($value && in_array($key, $menu)) { - $menu_enabled[] = $key; - } - } - $config->set('menu_enabled', $menu_enabled); - $config->save(); - } - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php deleted file mode 100644 index 3f8b3577b..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php +++ /dev/null @@ -1,194 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->domainNegotiator = $domain_negotiator; - $this->languageManager = $language_manager; - } - - /** - * Performs access checking for menu link content in an optimized way. - * - * This manipulator should be added after the generic ::checkAccess(). - * - * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree - * The menu link tree to manipulate. - * - * @return \Drupal\Core\Menu\MenuLinkTreeElement[] - * The manipulated menu link tree. - */ - public function checkDomain(array $tree) { - $current_language = $this->languageManager->getCurrentLanguage(); - - foreach ($tree as $key => $element) { - // Other menu tree manipulators may already have calculated access, do not - // overwrite the existing value in that case if already forbidden. - if (!isset($element->access) || $tree[$key]->access->isAllowed()) { - if ($access = $this->menuLinkCheckAccess($element->link, $current_language)) { - if ($access->isForbidden()) { - $tree[$key]->access = $access; - // Secure unavailable menu link. - $tree[$key]->link = new InaccessibleMenuLink($tree[$key]->link); - $tree[$key]->subtree = []; - } - elseif ($tree[$key]->subtree) { - $tree[$key]->subtree = $this->checkDomain($tree[$key]->subtree); - } - } - } - - if (isset($tree[$key]->access)) { - $tree[$key]->access->addCacheContexts(['url.site']); - } - } - - return $tree; - } - - /** - * Checks access for one menu link instance. - * - * @param \Drupal\Core\Menu\MenuLinkInterface $instance - * The menu link instance. - * @param \Drupal\Core\Language\LanguageInterface $current_language - * The current language. - * - * @return \Drupal\Core\Access\AccessResultInterface|NULL - * The access result. - */ - protected function menuLinkCheckAccess(MenuLinkInterface $instance, LanguageInterface $current_language) { - // Default access. - $access_result = AccessResult::allowed(); - - /** @var MenuLinkContent $entity */ - if ($entity = $this->loadMenuLinkContentEntity($instance)) { - if ($entity->hasTranslation($current_language->getId())) { - $entity = $entity->getTranslation($current_language->getId()); - } - - if (!$this->isAvailableOnAllAffiliates($entity)) { - $domain_access = []; - foreach ($entity->get(DOMAIN_ACCESS_FIELD)->getValue() as $reference) { - $domain_access[] = $reference['target_id']; - } - - $active_domain = $this->domainNegotiator->getActiveDomain(); - if (($active_domain instanceof DomainInterface) && !in_array($active_domain->getOriginalId(), $domain_access)) { - $access_result = AccessResult::forbidden(); - } - } - } - - return $access_result->cachePerPermissions(); - } - - /** - * Check if menu link content is allowed on all affiliates. - * - * @param \Drupal\menu_link_content\Entity\MenuLinkContent $entity - * Menu link content. - * - * @return bool - */ - protected function isAvailableOnAllAffiliates(MenuLinkContent $entity) { - if ($entity->get(DOMAIN_ACCESS_ALL_FIELD)->isEmpty()) { - return FALSE; - } - - $all_affiliates = $entity->get(DOMAIN_ACCESS_ALL_FIELD) - ->first() - ->getString(); - - return !empty($all_affiliates); - } - - /** - * Load menu link content from menu link entry. - * - * @param \Drupal\Core\Menu\MenuLinkInterface $instance - * The menu link instance. - * - * @return \Drupal\menu_link_content\Entity\MenuLinkContent - * The menu link entity. - */ - protected function loadMenuLinkContentEntity(MenuLinkInterface $instance) { - $storage = $this->entityTypeManager->getStorage('menu_link_content'); - $entity = NULL; - - if (!empty($instance->getPluginDefinition()['metadata']['entity_id'])) { - $entity_id = $instance->getPluginDefinition()['metadata']['entity_id']; - // Make sure the current ID is in the list, since each plugin empties - // the list after calling loadMultiple(). Note that the list may include - // multiple IDs added earlier in each plugin's constructor. - static::$entityIdsToLoad[$entity_id] = $entity_id; - $entities = $storage->loadMultiple(array_values(static::$entityIdsToLoad)); - $entity = isset($entities[$entity_id]) ? $entities[$entity_id] : NULL; - static::$entityIdsToLoad = []; - } - - if (!$entity) { - // Fallback to the loading by the UUID. - if ($uuid = $instance->getDerivativeId()) { - $loaded_entities = $storage->loadByProperties(['uuid' => $uuid]); - $entity = reset($loaded_entities); - } - } - - return $entity; - } - -} diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php deleted file mode 100644 index 61a084c6c..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php +++ /dev/null @@ -1,81 +0,0 @@ -getDerivativeId(); - - // Fallback on default menu if not restricted by domain. - if (!$this->isDomainRestricted($menu_name)) { - return parent::build(); - } - $parameters = $this->menuTree->getCurrentRouteMenuTreeParameters($menu_name); - - // Adjust the menu tree parameters based on the block's configuration. - $level = $this->configuration['level']; - $depth = $this->configuration['depth']; - $parameters->setMinDepth($level); - - // When the depth is configured to zero, there is no depth limit. When depth - // is non-zero, it indicates the number of levels that must be displayed. - // Hence this is a relative depth that we must convert to an actual - // (absolute) depth, that may never exceed the maximum depth. - if ($depth > 0) { - $parameters->setMaxDepth(min($level + $depth - 1, $this->menuTree->maxDepth())); - } - - $tree = $this->menuTree->load($menu_name, $parameters); - $manipulators = [ - ['callable' => 'menu.default_tree_manipulators:checkAccess'], - ['callable' => 'domain_menu_access.default_tree_manipulators:checkDomain'], - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - ]; - $tree = $this->menuTree->transform($tree, $manipulators); - - return $this->menuTree->build($tree); - } - - /** - * Check if domain access has been enabled on this menu. - * - * @param string $menu_name - * Menu name. - * - * @return bool - * Config enabled. - */ - protected function isDomainRestricted($menu_name) { - $config = \Drupal::config('domain_menu_access.settings') - ->get('menu_enabled'); - - return in_array($menu_name, $config); - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - return Cache::mergeContexts(parent::getCacheContexts(), ['url.site']); - } - -} diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php deleted file mode 100644 index 499fc4c92..000000000 --- a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php +++ /dev/null @@ -1,65 +0,0 @@ -config = $config; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity.manager')->getStorage('menu'), - $container->get('config.factory')->get('domain_menu_access.settings') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $menu_enabled = $this->config->get('menu_enabled'); - - foreach ($this->menuStorage->loadMultiple() as $menu => $entity) { - if (in_array($menu, $menu_enabled)) { - $this->derivatives[$menu] = $base_plugin_definition; - $this->derivatives[$menu]['admin_label'] = $entity->label(); - $this->derivatives[$menu]['config_dependencies']['config'] = [$entity->getConfigDependencyName()]; - } - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch b/sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch deleted file mode 100644 index e362363d2..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/domain_site_settings.services.yml b/domain_site_settings.services.yml -index 65e9113..6ebd87d 100644 ---- a/domain_site_settings.services.yml -+++ b/domain_site_settings.services.yml -@@ -1,6 +1,6 @@ - services: - domain_site_settings.overrider: - class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride -- arguments: ['@domain.negotiator', '@config.factory'] -+ arguments: ['@config.factory'] - tags: - - {name: config.factory.override, priority: 5} -diff --git a/src/Configuration/DomainConfigOverride.php b/src/Configuration/DomainConfigOverride.php -index 272e052..8497e2a 100644 ---- a/src/Configuration/DomainConfigOverride.php -+++ b/src/Configuration/DomainConfigOverride.php -@@ -16,13 +16,6 @@ use Drupal\Core\Config\ConfigFactoryInterface; - class DomainConfigOverride implements ConfigFactoryOverrideInterface { - - /** -- * The Domain negotiator. -- * -- * @var \Drupal\domain\DomainNegotiatorInterface -- */ -- protected $negotiator; -- -- /** - * The config factory. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface -@@ -32,15 +25,10 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface { - /** - * Constructs a DomainSourcePathProcessor object. - * -- * @param \Drupal\domain\DomainNegotiatorInterface $negotiator -- * The domain negotiator. - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The module handler service. - */ -- public function __construct( -- DomainNegotiatorInterface $negotiator, -- ConfigFactoryInterface $config_factory) { -- $this->negotiator = $negotiator; -+ public function __construct(ConfigFactoryInterface $config_factory) { - $this->configFactory = $config_factory; - } - -@@ -57,7 +45,9 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface { - public function loadOverrides($names = []) { - $overrides = []; - if (in_array('system.site', $names)) { -- $domain = $this->negotiator->getActiveDomain(); -+ /* @var \Drupal\domain\DomainNegotiator $negotiator */ -+ $negotiator = \Drupal::service('domain.negotiator'); -+ $domain = $negotiator->getActiveDomain(); - if (!empty($domain)) { - $domain_key = $domain->id(); - $configFactory = $this->configFactory->get('domain_site_settings.domainconfigsettings'); diff --git a/sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt b/sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/domain_site_settings/README.md b/sites/all/modules/contrib/admin/domain_site_settings/README.md deleted file mode 100644 index 3987015b1..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/README.md +++ /dev/null @@ -1,21 +0,0 @@ -Domain Site Settings -==================== - -Domain Site Settings module for Drupal 8 community users. - -* This module provide the administrator interface -to manage the site basic setting for each domain. - -Configuration: --------------- -Domain Site Settings module have configuration setting page -to set site basic setting against each domains -like 'Site name', 'Slogan', 'Email', 'Front page', '404 page' and '403 page'. - -Configuration page path: -/admin/config/domain/domain_site_settings - -Dependencies: -------------- -- domain -- domain_config diff --git a/sites/all/modules/contrib/admin/domain_site_settings/composer.json b/sites/all/modules/contrib/admin/domain_site_settings/composer.json deleted file mode 100644 index f1c0beafd..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/composer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "drupal/domain_site_settings", - "type": "drupal-module", - "description": "Basic Site Setting for Domains.", - "keywords": ["Drupal"], - "license": "GPL-2.0+", - "homepage": "https://www.drupal.org/project/domain_site_settings", - "minimum-stability": "dev", - "support": { - "issues": "https://www.drupal.org/project/issues/domain_site_settings", - "source": "http://cgit.drupalcode.org/domain_site_settings" - }, - "require": { } -} diff --git a/sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml b/sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml deleted file mode 100644 index d267dfd6b..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml +++ /dev/null @@ -1 +0,0 @@ -domain_site_settings: diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml deleted file mode 100644 index cc1b1a98c..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Domain Site Settings -type: module -description: 'Basic Site Setting for Domains.' -dependencies: - - domain:domain - - domain:domain_config - -package: Domain -# core: 8.x -configure: domain_site_settings.list - -# Information added by Drupal.org packaging script on 2018-09-23 -version: '8.x-1.3' -core: '8.x' -project: 'domain_site_settings' -datestamp: 1537684984 diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml deleted file mode 100644 index 80d81683b..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -domain_site_settings.menu_domain_list: - title: Domains site settings - route_name: domain_site_settings.list - description: 'Change domains site name, email address, slogan, default front page, and error pages.' - parent: domain.admin - weight: 10 diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml deleted file mode 100644 index fbabcf834..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -domain_site_settings.admin: - title: Domains site settings - route_name: domain_site_settings.list - base_route: domain.admin diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml deleted file mode 100644 index 00700cb42..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -domain site settings: - title: 'Domain site settings' - description: 'Allow to access the domain site settings' diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml deleted file mode 100644 index ddde0d9e8..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml +++ /dev/null @@ -1,18 +0,0 @@ -domain_site_settings.list: - path: '/admin/config/domain/domain_site_settings' - defaults: - _controller: '\Drupal\domain_site_settings\Controller\DomainSiteSettingsController::domainList' - _title: 'Domains sites list' - requirements: - _permission: 'domain site settings' - options: - _admin_route: TRUE -domain_site_settings.config_form: - path: '/admin/config/domain/domain_site_settings/{domain_id}/edit' - defaults: - _form: '\Drupal\domain_site_settings\Form\DomainConfigSettingsForm' - _title: 'Domain site settings' - requirements: - _permission: 'domain site settings' - options: - _admin_route: TRUE diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml deleted file mode 100644 index 6ebd87db9..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - domain_site_settings.overrider: - class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride - arguments: ['@config.factory'] - tags: - - {name: config.factory.override, priority: 5} diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php deleted file mode 100644 index 8497e2a2a..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php +++ /dev/null @@ -1,131 +0,0 @@ -configFactory = $config_factory; - } - - /** - * Returns config overrides. - * - * @param array $names - * A list of configuration names that are being loaded. - * - * @return array - * An array keyed by configuration name of override data. Override data - * contains a nested array structure of overrides. - */ - public function loadOverrides($names = []) { - $overrides = []; - if (in_array('system.site', $names)) { - /* @var \Drupal\domain\DomainNegotiator $negotiator */ - $negotiator = \Drupal::service('domain.negotiator'); - $domain = $negotiator->getActiveDomain(); - if (!empty($domain)) { - $domain_key = $domain->id(); - $configFactory = $this->configFactory->get('domain_site_settings.domainconfigsettings'); - if ($configFactory->get($domain_key) !== NULL) { - $site_name = $configFactory->get($domain_key . '.site_name'); - $site_slogan = $configFactory->get($domain_key . '.site_slogan'); - $site_mail = $configFactory->get($domain_key . '.site_mail'); - $site_403 = $configFactory->get($domain_key . '.site_403'); - $site_404 = $configFactory->get($domain_key . '.site_404'); - $site_front = $configFactory->get($domain_key . '.site_frontpage'); - $front = ($site_front !== \NULL) ? $site_front : '/node'; - - // Create the new settings array to override the configuration. - $overrides['system.site'] = [ - 'name' => $site_name, - 'slogan' => $site_slogan, - 'mail' => $site_mail, - 'page' => [ - '403' => $site_403, - '404' => $site_404, - 'front' => $front, - ], - ]; - } - } - } - return $overrides; - } - - /** - * The string to append to the configuration static cache name. - * - * @return string - * A string to append to the configuration static cache name. - */ - public function getCacheSuffix() { - return 'MultiSiteConfigurationOverrider'; - } - - /** - * Gets the cacheability metadata associated with the config factory override. - * - * @param string $name - * The name of the configuration override to get metadata for. - * - * @return \Drupal\Core\Cache\CacheableMetadata - * A cacheable metadata object. - */ - public function getCacheableMetadata($name) { - return new CacheableMetadata(); - } - - /** - * Creates a configuration object for use during install and synchronization. - * - * If the overrider stores its overrides in configuration collections then - * it can have its own implementation of - * \Drupal\Core\Config\StorableConfigBase. Configuration overriders can link - * themselves to a configuration collection by listening to the - * \Drupal\Core\Config\ConfigEvents::COLLECTION_INFO event and adding the - * collections they are responsible for. Doing this will allow installation - * and synchronization to use the overrider's implementation of - * StorableConfigBase. - * - * @see \Drupal\Core\Config\ConfigCollectionInfo - * @see \Drupal\Core\Config\ConfigImporter::importConfig() - * @see \Drupal\Core\Config\ConfigInstaller::createConfiguration() - * - * @param string $name - * The configuration object name. - * @param string $collection - * The configuration collection. - * - * @return \Drupal\Core\Config\StorableConfigBase - * The configuration object for the provided name and collection. - */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { - return NULL; - } - -} diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php deleted file mode 100644 index b5a3d512c..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php +++ /dev/null @@ -1,84 +0,0 @@ -domainLoader = $domain_loader; - } - - /** - * Create function return static domain loader configuration. - * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $container - * Load the ContainerInterface. - * - * @return \static - * return domain loader configuration. - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('domain.loader') - ); - } - - /** - * Function Provide the list of modules. - * - * @return typearray - * Domain list. - */ - public function domainList() { - $domains = $this->domainLoader->loadMultipleSorted(); - $rows = []; - /** @var \Drupal\domain\DomainInterface $domain */ - foreach ($domains as $domain) { - $row = [ - $domain->label(), - $domain->getCanonical(), - Link::fromTextAndUrl($this->t('Edit'), Url::fromRoute('domain_site_settings.config_form', ['domain_id' => $domain->id()])), - ]; - $rows[] = $row; - } - // Build a render array which will be themed as a table. - $build['pager_example'] = [ - '#rows' => $rows, - '#header' => [ - $this->t('Name'), - $this->t('Hostname'), - $this->t('Edit Settings'), - ], - '#type' => 'table', - '#empty' => $this->t('No domain record found.'), - ]; - return $build; - } - -} diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php deleted file mode 100644 index 21b429035..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php +++ /dev/null @@ -1,235 +0,0 @@ -aliasManager = $alias_manager; - $this->pathValidator = $path_validator; - $this->requestContext = $request_context; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), $container->get('path.alias_manager'), $container->get('path.validator'), $container->get('router.request_context') - ); - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return [ - 'domain_site_settings.domainconfigsettings', - ]; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'domain_config_settings_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('domain_site_settings.domainconfigsettings'); - $domain_id = $this->getRequest()->get('domain_id'); - $site_config = $this->config('system.site'); - $site_mail = $site_config->get('mail'); - if (empty($site_mail)) { - $site_mail = ini_get('sendmail_from'); - } - if ($config->get($domain_id) != NULL) { - $site_mail = $config->get($domain_id . '.site_mail'); - } - - $form['site_information'] = [ - '#type' => 'details', - '#title' => $this->t('Site details'), - '#open' => TRUE, - ]; - $form['site_information']['site_name'] = [ - '#type' => 'textfield', - '#title' => $this->t('Site name'), - '#default_value' => ($config->get($domain_id) != NULL) ? $config->get($domain_id . '.site_name') : $site_config->get('name'), - '#required' => TRUE, - ]; - $form['site_information']['site_slogan'] = [ - '#type' => 'textfield', - '#title' => $this->t('Slogan'), - '#default_value' => ($config->get($domain_id) != NULL) ? $config->get($domain_id . '.site_slogan') : $site_config->get('slogan'), - '#description' => $this->t("How this is used depends on your site's theme."), - ]; - $form['site_information']['site_mail'] = [ - '#type' => 'email', - '#title' => $this->t('Email address'), - '#default_value' => $site_mail, - '#description' => $this->t("The From address in automated emails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this email being flagged as spam.)"), - '#required' => TRUE, - ]; - $form['front_page'] = [ - '#type' => 'details', - '#title' => $this->t('Front page'), - '#open' => TRUE, - ]; - $front_page = $site_config->get('page.front') != '/user/login' ? $this->aliasManager->getAliasByPath($site_config->get('page.front')) : ''; - $front_page = ($config->get($domain_id) != NULL) ? $config->get($domain_id . '.site_frontpage') : $front_page; - $form['front_page']['site_frontpage'] = [ - '#type' => 'textfield', - '#title' => $this->t('Default front page'), - '#default_value' => $front_page, - '#size' => 40, - '#description' => $this->t('Optionally, specify a relative URL to display as the front page. Leave blank to display the default front page.'), - '#field_prefix' => $this->requestContext->getCompleteBaseUrl(), - ]; - $form['error_page'] = [ - '#type' => 'details', - '#title' => $this->t('Error pages'), - '#open' => TRUE, - ]; - $form['error_page']['site_403'] = [ - '#type' => 'textfield', - '#title' => $this->t('Default 403 (access denied) page'), - '#default_value' => ($config->get($domain_id) !== NULL) ? $config->get($domain_id . '.site_403') : $site_config->get('page.403'), - '#size' => 40, - '#description' => $this->t('This page is displayed when the requested document is denied to the current user. Leave blank to display a generic "access denied" page.'), - ]; - $form['error_page']['site_404'] = [ - '#type' => 'textfield', - '#title' => $this->t('Default 404 (not found) page'), - '#default_value' => ($config->get($domain_id) !== NULL) ? $config->get($domain_id . '.site_404') : $site_config->get('page.404'), - '#size' => 40, - '#description' => $this->t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.'), - ]; - $form['domain_id'] = [ - '#type' => 'hidden', - '#title' => $this->t('Domain ID'), - '#default_value' => $domain_id, - ]; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // Check for empty front page path. - if ($form_state->isValueEmpty('site_frontpage')) { - // Set to default "user/login". - $form_state->setValueForElement($form['front_page']['site_frontpage'], '/user/login'); - } - else { - // Get the normal path of the front page. - $form_state->setValueForElement($form['front_page']['site_frontpage'], $this->aliasManager->getPathByAlias($form_state->getValue('site_frontpage'))); - } - // Validate front page path. - if (($value = $form_state->getValue('site_frontpage')) && $value[0] !== '/') { - $form_state->setErrorByName('site_frontpage', $this->t("The path '%path' has to start with a slash.", ['%path' => $form_state->getValue('site_frontpage')])); - } - if (!$this->pathValidator->isValid($form_state->getValue('site_frontpage'))) { - $form_state->setErrorByName('site_frontpage', $this->t("The path '%path' is either invalid or you do not have access to it.", ['%path' => $form_state->getValue('site_frontpage')])); - } - // Get the normal paths of both error pages. - if (!$form_state->isValueEmpty('site_403')) { - $form_state->setValueForElement($form['error_page']['site_403'], $this->aliasManager->getPathByAlias($form_state->getValue('site_403'))); - } - if (!$form_state->isValueEmpty('site_404')) { - $form_state->setValueForElement($form['error_page']['site_404'], $this->aliasManager->getPathByAlias($form_state->getValue('site_404'))); - } - if (($value = $form_state->getValue('site_403')) && $value[0] !== '/') { - $form_state->setErrorByName('site_403', $this->t("The path '%path' has to start with a slash.", ['%path' => $form_state->getValue('site_403')])); - } - if (($value = $form_state->getValue('site_404')) && $value[0] !== '/') { - $form_state->setErrorByName('site_404', $this->t("The path '%path' has to start with a slash.", ['%path' => $form_state->getValue('site_404')])); - } - // Validate 403 error path. - if (!$form_state->isValueEmpty('site_403') && !$this->pathValidator->isValid($form_state->getValue('site_403'))) { - $form_state->setErrorByName('site_403', $this->t("The path '%path' is either invalid or you do not have access to it.", ['%path' => $form_state->getValue('site_403')])); - } - // Validate 404 error path. - if (!$form_state->isValueEmpty('site_404') && !$this->pathValidator->isValid($form_state->getValue('site_404'))) { - $form_state->setErrorByName('site_404', $this->t("The path '%path' is either invalid or you do not have access to it.", ['%path' => $form_state->getValue('site_404')])); - } - - parent::validateForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); - - $domain_id = $form_state->getValue('domain_id'); - $site_name = $form_state->getValue('site_name'); - $site_slogan = $form_state->getValue('site_slogan'); - $site_mail = $form_state->getValue('site_mail'); - $site_frontpage = $form_state->getValue('site_frontpage'); - $site_403 = $form_state->getValue('site_403'); - $site_404 = $form_state->getValue('site_404'); - $config = $this->config('domain_site_settings.domainconfigsettings'); - $config->set($domain_id . '.site_name', $site_name); - $config->set($domain_id . '.site_slogan', $site_slogan); - $config->set($domain_id . '.site_mail', $site_mail); - $config->set($domain_id . '.site_frontpage', $site_frontpage); - $config->set($domain_id . '.site_403', $site_403); - $config->set($domain_id . '.site_404', $site_404); - $config->save(); - } - -} diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php deleted file mode 100644 index e80a943af..000000000 --- a/sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php +++ /dev/null @@ -1,46 +0,0 @@ -user = $this->drupalCreateUser(['administer site configuration']); - $this->drupalLogin($this->user); - } - - /** - * Tests that the home page loads with a 200 response. - */ - public function testLoad() { - $this->drupalGet(Url::fromRoute('')); - $this->assertResponse(200); - } - -} diff --git a/sites/all/modules/contrib/admin/features/LICENSE.txt b/sites/all/modules/contrib/admin/features/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/features/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/features/composer.json b/sites/all/modules/contrib/admin/features/composer.json deleted file mode 100644 index de7ea040a..000000000 --- a/sites/all/modules/contrib/admin/features/composer.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "Enables administrators to package configuration into modules", - "license": "GPL-2.0+", - "minimum-stability": "dev", - "name": "drupal/features", - "require": { - "drupal/config_update": "^1.4" - }, - "type": "drupal-module", - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml b/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml deleted file mode 100644 index ea4bb8819..000000000 --- a/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml +++ /dev/null @@ -1,98 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: Default -machine_name: default -description: '' -assignments: - alter: - core: true - uuid: true - user_permissions: true - enabled: true - weight: 0 - base: - types: - config: - comment_type: comment_type - node_type: node_type - content: - user: user - enabled: true - weight: -2 - core: - types: - config: - date_format: date_format - field_storage_config: field_storage_config - entity_form_mode: entity_form_mode - image_style: image_style - menu: menu - responsive_image_style: responsive_image_style - user_role: user_role - entity_view_mode: entity_view_mode - enabled: true - weight: 5 - dependency: - enabled: true - weight: 15 - exclude: - types: - config: - features_bundle: features_bundle - curated: true - module: - installed: true - profile: true - namespace: true - namespace_any: false - enabled: true - weight: -5 - existing: - enabled: true - weight: 12 - forward_dependency: - enabled: true - weight: 4 - namespace: - enabled: true - weight: 0 - optional: - types: - config: {} - enabled: true - weight: 0 - packages: - enabled: true - weight: -20 - profile: - curated: true - standard: - files: true - dependencies: true - types: - config: - block: block - language_content_settings: language_content_settings - configurable_language: configurable_language - migration: migration - shortcut_set: shortcut_set - tour: tour - enabled: true - weight: 10 - site: - types: - config: - action: action - contact_form: contact_form - block_content_type: block_content_type - rdf_mapping: rdf_mapping - search_page: search_page - taxonomy_vocabulary: taxonomy_vocabulary - editor: editor - filter_format: filter_format - enabled: true - weight: 7 -profile_name: '' -is_profile: false - diff --git a/sites/all/modules/contrib/admin/features/config/install/features.settings.yml b/sites/all/modules/contrib/admin/features/config/install/features.settings.yml deleted file mode 100644 index ed8b37a57..000000000 --- a/sites/all/modules/contrib/admin/features/config/install/features.settings.yml +++ /dev/null @@ -1,3 +0,0 @@ -export: - folder: 'custom' -langcode: en diff --git a/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml b/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml deleted file mode 100644 index 3d53f1d9f..000000000 --- a/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml +++ /dev/null @@ -1,188 +0,0 @@ -features.settings: - type: config_entity - label: 'Features settings' - mapping: - export: - type: mapping - label: "Export settings" - mapping: - folder: - type: string - label: "Folder" - langcode: - type: string - label: "Language Code" - -features.bundle.*: - type: config_entity - label: 'Features bundle' - mapping: - machine_name: - type: string - label: "Machine name" - name: - type: string - label: "Name" - description: - type: string - label: "Description" - assignments: - type: sequence - label: "Assignment" - sequence: - type: features.assignment.[%key] - profile_name: - type: string - label: "Profile name" - is_profile: - type: boolean - label: "Is install profile" - -features.assignment.settings: - type: mapping - label: "Assignment settings" - mapping: - enabled: - type: boolean - label: "Enabled" - weight: - type: integer - label: "Weight" - -features.assignment.*: - type: features.assignment.settings - -features.assignment.base: - type: features.assignment.settings - label: "Base type" - mapping: - types: - type: mapping - label: "Types" - mapping: - config: - type: sequence - label: "Configuration Types" - sequence: - type: string - content: - type: sequence - label: "Content entity types" - sequence: - type: string - -features.assignment.core: - type: features.assignment.settings - label: "Core type" - mapping: - types: - type: mapping - label: "Types" - mapping: - config: - type: sequence - label: "Configuration Types" - sequence: - type: string - -features.assignment.exclude: - type: features.assignment.settings - label: "Exclude" - mapping: - types: - type: mapping - label: "Types" - mapping: - config: - type: sequence - label: "Configuration Types" - sequence: - type: string - curated: - type: boolean - label: "Exclude designated site-specific configuration" - module: - type: mapping - label: "Module" - mapping: - installed: - type: boolean - label: "Exclude installed module-provided entity configuration" - profile: - type: boolean - label: "Don't exclude install profile's configuration" - namespace: - type: boolean - label: "Don't exclude non-installed configuration by namespace" - namespace_any: - type: boolean - label: "Don't exclude ANY configuration by namespace" - -features.assignment.optional: - type: features.assignment.settings - label: "Optional" - mapping: - types: - type: mapping - label: "Types" - mapping: - config: - type: sequence - label: "Configuration Types" - sequence: - type: string - -features.assignment.profile: - type: features.assignment.settings - label: "Profile" - mapping: - curated: - type: boolean - label: "Add commonly-needed configuration" - standard: - type: mapping - label: "Standard" - mapping: - files: - type: boolean - label: "Add configuration and files from Standard profile" - dependencies: - type: boolean - label: "Add module and theme dependencies from Standard profile" - types: - type: mapping - label: "Types" - mapping: - config: - type: sequence - label: "Configuration Types" - sequence: - type: string - -features.assignment.site: - type: features.assignment.settings - label: "Site" - mapping: - types: - type: mapping - label: "Types" - mapping: - config: - type: sequence - label: "Configuration Types" - sequence: - type: string - -features.assignment.alter: - type: features.assignment.settings - label: "Alter" - mapping: - core: - type: boolean - label: "Core" - uuid: - type: boolean - label: "UUID" - user_permissions: - type: boolean - label: "User permissions" diff --git a/sites/all/modules/contrib/admin/features/drush.services.yml b/sites/all/modules/contrib/admin/features/drush.services.yml deleted file mode 100644 index 16b0f29c8..000000000 --- a/sites/all/modules/contrib/admin/features/drush.services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - features.commands: - class: \Drupal\features\Commands\FeaturesCommands - arguments: - - '@features_assigner' - - '@features.manager' - - '@features_generator' - - '@config_update.config_diff' - - '@config.storage' - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/admin/features/drush/features.drush8.inc b/sites/all/modules/contrib/admin/features/drush/features.drush8.inc deleted file mode 100644 index 35a76abe8..000000000 --- a/sites/all/modules/contrib/admin/features/drush/features.drush8.inc +++ /dev/null @@ -1,912 +0,0 @@ - 'Display current Features settings.', - 'aliases' => ['fs'], - ]; - - $items['features-list-packages'] = [ - 'description' => 'Display a list of all existing features and packages available to be generated. If a package name is provided as an argument, then all of the configuration objects assigned to that package will be listed.', - 'examples' => [ - "drush features-list-packages" => 'Display a list of all existing featurea and packages available to be generated.', - "drush features-list-packages 'example_article'" => "Display a list of all configuration objects assigned to the 'example_article' package.", - ], - 'arguments' => [ - 'package' => 'The package to list. Optional; if specified, lists all configuration objects assigned to that package. If no package is specified, lists all of the features.', - ], - 'outputformat' => [ - 'default' => 'table', - 'pipe-format' => 'list', - 'field-labels' => [ - 'name' => 'Name', - 'machine_name' => 'Machine name', - 'status' => 'Status', - 'version' => 'Version', - 'state' => 'State', - 'object' => 'Configuration object', - ], - 'output-data-type' => 'format-table', - ], - 'aliases' => ['fl'], - ]; - - $items['features-import-all'] = [ - 'description' => 'Import module config from all installed features.', - 'examples' => [ - "drush features-import-all" => 'Import module config from all installed features.', - ], - 'aliases' => ['fra', 'fia', 'fim-all'], - ]; - - $items['features-export'] = [ - 'description' => "Export the configuration on your site into a custom module.", - 'arguments' => [ - 'package' => 'A space delimited list of features to export.', - ], - 'options' => [ - 'add-profile' => 'Package features into an install profile.', - ], - 'examples' => [ - "drush features-export" => 'Export all available packages.', - "drush features-export example_article example_page" => "Export the example_article and example_page packages.", - "drush features-export --add-profile" => "Export all available packages and add them to an install profile.", - ], - // Add previous "fu" alias for compatibility. - 'aliases' => ['fex', 'fu', 'fua', 'fu-all'], - ]; - - $items['features-add'] = [ - 'description' => "Add a config item to a feature package.", - 'arguments' => [ - 'feature' => 'Feature package to export and add config to.', - 'components' => 'Patterns of config to add, see features-components for the format of patterns.', - ], - 'aliases' => ['fa', 'fe'], - ]; - - $items['features-components'] = [ - 'description' => 'List features components.', - 'arguments' => [ - 'patterns' => 'The features components type to list. Omit this argument to list all components.', - ], - 'options' => [ - 'exported' => [ - 'description' => 'Show only components that have been exported.', - ], - 'not-exported' => [ - 'description' => 'Show only components that have not been exported.', - ], - ], - 'aliases' => ['fc'], - ]; - - $items['features-diff'] = [ - 'description' => "Show the difference between the active config and the default config stored in a feature package.", - 'arguments' => [ - 'feature' => 'The feature in question.', - ], - 'options' => [ - 'ctypes' => 'Comma separated list of component types to limit the output to. Defaults to all types.', - 'lines' => 'Generate diffs with lines of context instead of the usual two.', - ], - 'aliases' => ['fd'], - ]; - - $items['features-import'] = [ - 'description' => "Import a module config into your site.", - 'arguments' => [ - 'feature' => 'A space delimited list of features or feature:component pairs to import.', - ], - 'options' => [ - 'force' => "Force import even if config is not overridden.", - ], - 'examples' => [ - 'drush features-import foo:node.type.page foo:taxonomy.vocabulary.tags bar' => 'Import node and taxonomy config of feature "foo". Import all config of feature "bar".', - ], - 'aliases' => ['fim', 'fr'], - ]; - - foreach ($items as $name => &$item) { - $item['options']['bundle'] = [ - 'description' => 'Use a specific bundle namespace.', - ]; - } - - return $items; -} - -/** - * Applies global options for Features drush commands. - * - * The option --name="bundle_name" sets the bundle namespace. - * - * @return \Drupal\features\FeaturesAssignerInterface -*/ -function _drush_features_options() { - /** @var \Drupal\features\FeaturesAssignerInterface $assigner */ - $assigner = \Drupal::service('features_assigner'); - $bundle_name = drush_get_option('bundle'); - if (!empty($bundle_name)) { - $bundle = $assigner->applyBundle($bundle_name); - if ($bundle->getMachineName() != $bundle_name) { - drush_log(dt('Bundle @name not found. Using default.', ['@name' => $bundle_name]), 'warning'); - } - } - else { - $assigner->assignConfigPackages(); - } - return $assigner; -} - -/** - * Provides Drush command callback for features-status. - */ -function drush_features_status() { - $args = func_get_args(); - $assigner = _drush_features_options(); - - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - $current_bundle = $assigner->getBundle(); - $export_settings = $manager->getExportSettings(); - $methods = $assigner->getEnabledAssigners(); - if ($current_bundle->isDefault()) { - drush_print(dt('Current bundle: none')); - } - else { - drush_print(dt('Current bundle: @name (@machine_name)', - [ - '@name' => $current_bundle->getName(), - '@machine_name' => $current_bundle->getMachineName(), - ])); - } - drush_print(dt('Export folder: @folder', ['@folder' => $export_settings['folder']])); - $dt_args = ['@methods' => implode(', ', array_keys($methods))]; - drush_print(dt('The following assignment methods are enabled:')); - drush_print(dt(' @methods', $dt_args)); - - if (!empty($args)) { - $config = $manager->getConfigCollection(); - if (count($args) > 1) { - print_r(array_keys($config)); - } - else { - print_r($config[$args[0]]); - } - } -} - -/** - * Drush command callback for features-list-packages. - * - * @param string $package_name - * (optional) The package name. - * - * @return array|bool - */ -function drush_features_list_packages($package_name = '') { - $assigner = _drush_features_options(); - $current_bundle = $assigner->getBundle(); - $namespace = $current_bundle->isDefault() ? FeaturesBundleInterface::DEFAULT_BUNDLE : $current_bundle->getMachineName(); - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - $packages = $manager->getPackages(); - - $packages = $manager->filterPackages($packages, $namespace); - $result = []; - - // If no package was specified, list all packages. - if (empty($package_name)) { - drush_hide_output_fields(['object']); - foreach ($packages as $package) { - $overrides = $manager->detectOverrides($package); - $state = $package->getState(); - if (!empty($overrides) && ($package->getStatus() != FeaturesManagerInterface::STATUS_NO_EXPORT)) { - $state = FeaturesManagerInterface::STATE_OVERRIDDEN; - } - - $result[$package->getMachineName()] = [ - 'name' => $package->getName(), - 'machine_name' => $package->getMachineName(), - 'status' => $manager->statusLabel($package->getStatus()), - 'version' => $package->getVersion(), - 'state' => ($state != FeaturesManagerInterface::STATE_DEFAULT) - ? $manager->stateLabel($state) - : '', - ]; - } - return $result; - } - // If a valid package was listed, list its configuration. - else { - foreach ($packages as $package) { - if ($package->getMachineName() == $package_name) { - drush_hide_output_fields([ - 'machine_name', - 'name', - 'status', - 'version', - 'state', - ]); - foreach ($package->getConfig() as $item_name) { - $result[$item_name] = [ - 'object' => $item_name, - ]; - } - return $result; - } - } - - } - - // If no matching package found, return an error. - drush_log(dt('Package "@package" not found.', ['@package' => $package_name]), 'warning'); - return FALSE; -} - -/** - * Drush command callback for features-import-all. - * - */ -function drush_features_import_all() { - $assigner = _drush_features_options(); - $current_bundle = $assigner->getBundle(); - $namespace = $current_bundle->isDefault() ? FeaturesBundleInterface::DEFAULT_BUNDLE : $current_bundle->getMachineName(); - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - $packages = $manager->getPackages(); - $packages = $manager->filterPackages($packages, $namespace); - $overridden = []; - - foreach ($packages as $package) { - $overrides = $manager->detectOverrides($package); - $missing = $manager->detectMissing($package); - if ((!empty($missing) || !empty($overrides)) && ($package->getStatus() == FeaturesManagerInterface::STATUS_INSTALLED)) { - $overridden[] = $package->getMachineName(); - } - } - - if (!empty($overridden)) { - call_user_func_array('drush_features_import', $overridden); - } - else { - drush_log(dt('Current state already matches active config, aborting.'), 'ok'); - } -} - -/** - * Provides Drush command callback for features-export. - */ -function drush_features_export($packages = NULL) { - $packages = func_get_args(); - $assigner = _drush_features_options(); - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - /** @var \Drupal\features\FeaturesGeneratorInterface $generator */ - $generator = \Drupal::service('features_generator'); - - $current_bundle = $assigner->getBundle(); - - if (drush_get_option('add-profile')) { - if ($current_bundle->isDefault) { - return drush_set_error('', dt("Must specify a profile name with --name")); - } - $current_bundle->setIsProfile(TRUE); - } - - $all_packages = $manager->getPackages(); - foreach ($packages as $name) { - if (!isset($all_packages[$name])) { - return drush_set_error('', dt("The package @name does not exist.", ['@name' => $name])); - } - } - - if (empty($packages)) { - $packages = $all_packages; - $dt_args = ['@modules' => implode(', ', array_keys($packages))]; - drush_print(dt('The following extensions will be exported: @modules', $dt_args)); - if (!drush_confirm(dt('Do you really want to continue?'))) { - return drush_user_abort('Aborting.'); - } - } - - // If any packages exist, confirm before overwriting. - if ($existing_packages = $manager->listPackageDirectories($packages, $current_bundle)) { - foreach ($existing_packages as $name => $directory) { - drush_print(dt("The extension @name already exists at @directory.", ['@name' => $name, '@directory' => $directory])); - } - // Apparently, format_plural is not always available. - if (count($existing_packages) == 1) { - $message = dt('Would you like to overwrite it?'); - } - else { - $message = dt('Would you like to overwrite them?'); - } - if (!drush_confirm($message)) { - return drush_user_abort(); - } - } - - // Use the write generation method. - $method_id = FeaturesGenerationWrite::METHOD_ID; - $result = $generator->generatePackages($method_id, $current_bundle, $packages); - - foreach ($result as $message) { - $type = $message['success'] ? 'success' : 'error'; - drush_log($message['message'], $message['variables'], $type); - } -} - -/** - * Adds a component to a features module. - * - * @param - * The selected components. - */ -function drush_features_add() { - if ($args = func_get_args()) { - $assigner = _drush_features_options(); - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - /** @var \Drupal\features\FeaturesGeneratorInterface $generator */ - $generator = \Drupal::service('features_generator'); - - $current_bundle = $assigner->getBundle(); - - $module = array_shift($args); - if (empty($args)) { - return drush_set_error('', 'No components supplied.'); - } - $components = _drush_features_component_list(); - $options = [ - 'exported' => FALSE, - ]; - - $filtered_components = _drush_features_component_filter($components, $args, $options); - $items = $filtered_components['components']; - - if (empty($items)) { - return drush_set_error('', 'No components to add.'); - } - - $packages = [$module]; - // If any packages exist, confirm before overwriting. - if ($existing_packages = $manager->listPackageDirectories($packages)) { - foreach ($existing_packages as $name => $directory) { - drush_print(dt("The extension @name already exists at @directory.", ['@name' => $name, '@directory' => $directory])); - } - // Apparently, format_plural is not always available. - if (count($existing_packages) == 1) { - $message = dt('Would you like to overwrite it?'); - } - else { - $message = dt('Would you like to overwrite them?'); - } - if (!drush_confirm($message)) { - return drush_user_abort(); - } - } - else { - $package = $manager->initPackage($module, NULL, '', 'module', $current_bundle); - list($full_name, $path) = $manager->getExportInfo($package, $current_bundle); - drush_print(dt('Will create a new extension @name in @directory', ['@name' => $full_name, '@directory' => $path])); - if (!drush_confirm(dt('Do you really want to continue?'))) { - drush_die('Aborting.'); - } - } - - $config = _drush_features_build_config($items); - - $manager->assignConfigPackage($module, $config); - - // Use the write generation method. - $method_id = FeaturesGenerationWrite::METHOD_ID; - $result = $generator->generatePackages($method_id, $current_bundle, $packages); - - foreach ($result as $message) { - $type = $message['success'] ? 'success' : 'error'; - drush_log($message['message'], $message['variables'], $type); - } - } - else { - return drush_set_error('', 'No feature name given.'); - } -} - -/** - * Lists components, with pattern matching. - */ -function drush_features_components() { - $args = func_get_args(); - _drush_features_options(); - - $components = _drush_features_component_list(); - ksort($components); - // If no args supplied, prompt with a list. - if (empty($args)) { - $types = array_keys($components); - array_unshift($types, 'all'); - $choice = drush_choice($types, 'Enter a number to choose which component type to list.'); - if ($choice === FALSE) { - return; - } - - $args = ($choice == 0) ? ['*'] : [$types[$choice]]; - } - $options = [ - 'provided by' => TRUE, - ]; - if (drush_get_option(['exported', 'e'], NULL)) { - $options['not exported'] = FALSE; - } - elseif (drush_get_option(['not-exported', 'o'], NULL)) { - $options['exported'] = FALSE; - } - - $filtered_components = _drush_features_component_filter($components, $args, $options); - if ($filtered_components) { - _drush_features_component_print($filtered_components); - } -} - -/** - * Lists the differences in the package config vs the active store. - * - * @param string $package - * The machine name of a package. - */ -function drush_features_diff() { - if (!$args = func_get_args()) { - drush_print_table(drush_features_list_packages()); - return; - } - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - /** @var \Drupal\features\FeaturesAssignerInterface $assigner */ - $assigner = \Drupal::service('features_assigner'); - $assigner->assignConfigPackages(); - - $module = $args[0]; - $filter_ctypes = drush_get_option("ctypes"); - if ($filter_ctypes) { - $filter_ctypes = explode(',', $filter_ctypes); - } - - $feature = $manager->loadPackage($module, TRUE); - if (empty($feature)) { - drush_log(dt('No such feature is available: @module', ['@module' => $module]), 'error'); - return; - } - - $lines = drush_get_option('lines'); - $lines = isset($lines) ? $lines : 2; - - $formatter = new DiffFormatter(); - $formatter->leading_context_lines = $lines; - $formatter->trailing_context_lines = $lines; - $formatter->show_header = FALSE; - - if (drush_get_context('DRUSH_NOCOLOR')) { - $red = $green = "%s"; - } - else { - $red = "\033[31;40m\033[1m%s\033[0m"; - $green = "\033[0;32;40m\033[1m%s\033[0m"; - } - - $overrides = $manager->detectOverrides($feature); - $missing = $manager->reorderMissing($manager->detectMissing($feature)); - $overrides = array_merge($overrides, $missing); - - if (empty($overrides)) { - drush_print(dt('Active config matches stored config for @module.', ['@module' => $module])); - } - else { - /** @var \Drupal\config_update\ConfigDiffInterface $config_diff */ - $config_diff = \Drupal::service('config_update.config_diff'); - /** @var \Drupal\Core\Config\StorageInterface $active_storage */ - $active_storage = \Drupal::service('config.storage'); - - // Print key for colors. - drush_print(dt('Legend: ')); - drush_print(sprintf($red, dt('Code: drush features-import will replace the active config with the displayed code.'))); - drush_print(sprintf($green, dt('Active: drush features-export will update the exported feature with the displayed active config'))); - - foreach ($overrides as $name) { - $message = ''; - if (in_array($name, $missing)) { - $message = sprintf($red, t('(missing from active)')); - $extension = []; - } - else { - $active = $manager->getActiveStorage()->read($name); - $extension = $manager->getExtensionStorages()->read($name); - if (empty($extension)) { - $extension = []; - $message = sprintf($green, t('(not exported)')); - } - $diff = $config_diff->diff($extension, $active); - $rows = explode("\n", $formatter->format($diff)); - } - drush_print(); - drush_print(dt("Config @name @message", ['@name' => $name, '@message' => $message])); - if (!empty($extension)) { - foreach ($rows as $row) { - if (strpos($row, '>') === 0) { - drush_print(sprintf($green, $row)); - } - elseif (strpos($row, '<') === 0) { - drush_print(sprintf($red, $row)); - } - else { - drush_print($row); - } - } - } - } - } -} - -/** - * Imports module config into the active store. - * - * Same as the old "revert" functionality. - */ -function drush_features_import() { - if ($args = func_get_args()) { - _drush_features_options(); - - // Determine if revert should be forced. - $force = drush_get_option('force'); - // Determine if -y was supplied. If so, we can filter out needless output - // from this command. - $skip_confirmation = drush_get_context('DRUSH_AFFIRMATIVE'); - - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - - // Parse list of arguments. - $modules = []; - foreach ($args as $arg) { - $arg = explode(':', $arg); - $module = array_shift($arg); - $component = array_shift($arg); - - if (isset($module)) { - if (empty($component)) { - // If we received just a feature name, this means that we need all of - // its components. - $modules[$module] = TRUE; - } - elseif ($modules[$module] !== TRUE) { - if (!isset($modules[$module])) { - $modules[$module] = []; - } - $modules[$module][] = $component; - } - } - } - - // Process modules. - foreach ($modules as $module => $components_needed) { - - $dt_args['@module'] = $module; - /** @var \Drupal\features\Package $feature */ - $feature = $manager->loadPackage($module, TRUE); - if (empty($feature)) { - drush_log(dt('No such feature is available: @module', $dt_args), 'error'); - return; - } - - if ($feature->getStatus() != FeaturesManagerInterface::STATUS_INSTALLED) { - drush_log(dt('No such feature is installed: @module', $dt_args), 'error'); - return; - } - - // Forcefully revert all components of a feature. - if ($force) { - $components = $feature->getConfigOrig(); - } - // Only revert components that are detected to be Overridden. - else { - $components = $manager->detectOverrides($feature); - $missing = $manager->reorderMissing($manager->detectMissing($feature)); - // Be sure to import missing components first. - $components = array_merge($missing, $components); - } - - if (!empty($components_needed) && is_array($components_needed)) { - $components = array_intersect($components, $components_needed); - } - - if (empty($components)) { - drush_log(dt('Current state already matches active config, aborting.'), 'ok'); - } - else { - // Determine which config the user wants to import/revert. - $config_to_create = []; - foreach ($components as $component) { - $dt_args['@component'] = $component; - $confirmation_message = 'Do you really want to import @module : @component?'; - if ($skip_confirmation || drush_confirm(dt($confirmation_message, $dt_args))) { - $config_to_create[$component] = ''; - } - } - - // Perform the import/revert. - $config_imported = $manager->createConfiguration($config_to_create); - - // List the results. - foreach ($components as $component) { - $dt_args['@component'] = $component; - if (isset($config_imported['new'][$component])) { - drush_log(dt('Imported @module : @component.', $dt_args), 'ok'); - } - elseif (isset($config_imported['updated'][$component])) { - drush_log(dt('Reverted @module : @component.', $dt_args), 'ok'); - } - elseif (!isset($config_to_create[$component])) { - drush_log(dt('Skipping @module : @component.', $dt_args), 'ok'); - } - else { - drush_log(dt('Error importing @module : @component.', $dt_args), 'error'); - } - } - } - } - } - else { - drush_print_table(drush_features_list_packages()); - return; - } -} - -/** - * Returns an array of full config names given a array[$type][$component]. - * - * @param array $items - * The items to return data for. - */ -function _drush_features_build_config(array $items) { - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - $result = []; - foreach ($items as $config_type => $item) { - foreach ($item as $item_name => $title) { - $result[] = $manager->getFullName($config_type, $item_name); - } - } - return $result; -} - -/** - * Returns a listing of all known components, indexed by source. - */ -function _drush_features_component_list() { - $result = []; - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - $config = $manager->getConfigCollection(); - foreach ($config as $item_name => $item) { - $result[$item->getType()][$item->getShortName()] = $item->getLabel(); - } - return $result; -} - -/** - * Filters components by patterns. - */ -function _drush_features_component_filter($all_components, $patterns = [], $options = []) { - $options += [ - 'exported' => TRUE, - 'not exported' => TRUE, - 'provided by' => FALSE, - ]; - $pool = []; - // Maps exported components to feature modules. - $components_map = _drush_features_get_component_map(); - // First filter on exported state. - foreach ($all_components as $source => $components) { - foreach ($components as $name => $title) { - $exported = count($components_map[$source][$name]) > 0; - if ($exported) { - if ($options['exported']) { - $pool[$source][$name] = $title; - } - } - else { - if ($options['not exported']) { - $pool[$source][$name] = $title; - } - } - } - } - - $state_string = ''; - - if (!$options['exported']) { - $state_string = 'unexported'; - } - elseif (!$options['not exported']) { - $state_string = 'exported'; - } - - $selected = []; - foreach ($patterns as $pattern) { - // Rewrite * to %. Let users use both as wildcard. - $pattern = strtr($pattern, ['*' => '%']); - $sources = []; - list($source_pattern, $component_pattern) = explode(':', $pattern, 2); - // If source is empty, use a pattern. - if ($source_pattern == '') { - $source_pattern = '%'; - } - if ($component_pattern == '') { - $component_pattern = '%'; - } - - $preg_source_pattern = strtr(preg_quote($source_pattern, '/'), ['%' => '.*']); - $preg_component_pattern = strtr(preg_quote($component_pattern, '/'), ['%' => '.*']); - // If it isn't a pattern, but a simple string, we don't anchor the - // pattern. This allows for abbreviating. Otherwise, we do, as this seems - // more natural for patterns. - if (strpos($source_pattern, '%') !== FALSE) { - $preg_source_pattern = '^' . $preg_source_pattern . '$'; - } - if (strpos($component_pattern, '%') !== FALSE) { - $preg_component_pattern = '^' . $preg_component_pattern . '$'; - } - $matches = []; - - // Find the sources. - $all_sources = array_keys($pool); - $matches = preg_grep('/' . $preg_source_pattern . '/', $all_sources); - if (count($matches) > 0) { - // If we have multiple matches and the source string wasn't a - // pattern, check if one of the matches is equal to the pattern, and - // use that, or error out. - if (count($matches) > 1 and $preg_source_pattern[0] != '^') { - if (in_array($source_pattern, $matches)) { - $matches = [$source_pattern]; - } - else { - return drush_set_error('', dt('Ambiguous source "@source", matches @matches', [ - '@source' => $source_pattern, - '@matches' => implode(', ', $matches), - ])); - } - } - // Loose the indexes preg_grep preserved. - $sources = array_values($matches); - } - else { - return drush_set_error('', dt('No @state sources match "@source"', ['@state' => $state_string, '@source' => $source_pattern])); - } - - // Now find the components. - foreach ($sources as $source) { - // Find the components. - $all_components = array_keys($pool[$source]); - // See if there's any matches. - $matches = preg_grep('/' . $preg_component_pattern . '/', $all_components); - if (count($matches) > 0) { - // If we have multiple matches and the components string wasn't a - // pattern, check if one of the matches is equal to the pattern, and - // use that, or error out. - if (count($matches) > 1 and $preg_component_pattern[0] != '^') { - if (in_array($component_pattern, $matches)) { - $matches = [$component_pattern]; - } - else { - return drush_set_error('', dt('Ambiguous component "@component", matches @matches', [ - '@component' => $component_pattern, - '@matches' => implode(', ', $matches), - ])); - } - } - if (!is_array($selected[$source])) { - $selected[$source] = []; - } - $selected[$source] += array_intersect_key($pool[$source], array_flip($matches)); - } - else { - // No matches. If the source was a pattern, just carry on, else - // error out. Allows for patterns like :*field* - if ($preg_source_pattern[0] != '^') { - return drush_set_error('', dt('No @state @source components match "@component"', [ - '@state' => $state_string, - '@component' => $component_pattern, - '@source' => $source, - ])); - } - } - } - } - - // Lastly, provide feature module information on the selected components, if - // requested. - $provided_by = []; - if ($options['provided by'] && $options['exported']) { - foreach ($selected as $source => $components) { - foreach ($components as $name => $title) { - $exported = count($components_map[$source][$name]) > 0; - if ($exported) { - $provided_by[$source . ':' . $name] = implode(', ', $components_map[$source][$name]); - } - } - } - } - - return [ - 'components' => $selected, - 'sources' => $provided_by, - ]; -} - -/** - * Provides a component to feature map (port of features_get_component_map). - */ -function _drush_features_get_component_map() { - $result = []; - /** @var \Drupal\features\FeaturesManagerInterface $manager */ - $manager = \Drupal::service('features.manager'); - // Recalc full config list without running assignments. - $config = $manager->getConfigCollection(); - $packages = $manager->getPackages(); - - foreach ($config as $item_name => $item) { - $type = $item->getType(); - $short_name = $item->getShortName(); - $name = $item->getName(); - if (!isset($result[$type][$short_name])) { - $result[$type][$short_name] = []; - } - if (!empty($item->getPackage())) { - $package = $packages[$item->getPackage()]; - $result[$type][$short_name][] = $package->getMachineName(); - } - } - - return $result; -} - -/** - * Prints a list of filtered components. - */ -function _drush_features_component_print($filtered_components) { - $rows = [[dt('Available sources')]]; - foreach ($filtered_components['components'] as $source => $components) { - foreach ($components as $name => $value) { - $row = [$source . ':' . $name]; - if (isset($filtered_components['sources'][$source . ':' . $name])) { - $row[] = dt('Provided by') . ': ' . $filtered_components['sources'][$source . ':' . $name]; - } - $rows[] = $row; - } - } - - drush_print_table($rows, TRUE); -} diff --git a/sites/all/modules/contrib/admin/features/features.info.yml b/sites/all/modules/contrib/admin/features/features.info.yml deleted file mode 100644 index 65cef8a96..000000000 --- a/sites/all/modules/contrib/admin/features/features.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Features' -type: module -description: 'Enables administrators to package configuration into modules.' -package: Development -# core: 8.x -dependencies: - - drupal:config - - config_update:config_update - -# Information added by Drupal.org packaging script on 2018-09-09 -version: '8.x-3.8' -core: '8.x' -project: 'features' -datestamp: 1536512288 diff --git a/sites/all/modules/contrib/admin/features/features.install b/sites/all/modules/contrib/admin/features/features.install deleted file mode 100644 index 5bb46f01f..000000000 --- a/sites/all/modules/contrib/admin/features/features.install +++ /dev/null @@ -1,31 +0,0 @@ -getStorage('features_bundle')->loadMultiple() as $bundle) { - $bundle = \Drupal::configFactory()->getEditable('features.bundle.' . $bundle->id()); - $assignments = $bundle->get('assignments'); - $assignments['alter'] = [ - 'core' => TRUE, - 'uuid' => TRUE, - 'user_permissions' => TRUE, - 'enabled' => TRUE, - 'weight' => 0, - ]; - $bundle->set('assignments', $assignments)->save(); - } -} diff --git a/sites/all/modules/contrib/admin/features/features.module b/sites/all/modules/contrib/admin/features/features.module deleted file mode 100644 index 3bf4bf734..000000000 --- a/sites/all/modules/contrib/admin/features/features.module +++ /dev/null @@ -1,56 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Features module provides a user interface for exporting bundles of configuration into modules. For more information, see the online documentation for Features module', [ - ':url' => 'http://drupal.org/node/2404427', - ]) . '

'; - return $output; - } -} - -/** - * Implements hook_file_download(). - */ -function features_file_download($uri) { - $scheme = file_uri_scheme($uri); - $target = file_uri_target($uri); - - if ($scheme == 'temporary' && $target) { - $request = \Drupal::request(); - $route = $request->attributes->get('_route'); - // Check if we were called by Features download route. - // No additional access checking needed here: route requires - // "export configuration" permission, token is validated by the controller. - // @see \Drupal\features\Controller\FeaturesController::downloadExport() - if ($route == 'features.export_download') { - return [ - 'Content-disposition' => 'attachment; filename="' . $target . '"', - ]; - } - } -} - -/** - * Implements hook_modules_installed(). - */ -function features_modules_installed($modules) { - if (!in_array('features', $modules)) { - /** @var \Drupal\features\FeaturesAssignerInterface $assigner */ - $assigner = \Drupal::service('features_assigner'); - $assigner->purgeConfiguration(); - } -} diff --git a/sites/all/modules/contrib/admin/features/features.routing.yml b/sites/all/modules/contrib/admin/features/features.routing.yml deleted file mode 100644 index 3b6c25b33..000000000 --- a/sites/all/modules/contrib/admin/features/features.routing.yml +++ /dev/null @@ -1,6 +0,0 @@ -features.export_download: - path: '/admin/config/development/features/download/{uri}' - defaults: - _controller: 'Drupal\features\Controller\FeaturesController::downloadExport' - requirements: - _permission: 'export configuration' diff --git a/sites/all/modules/contrib/admin/features/features.services.yml b/sites/all/modules/contrib/admin/features/features.services.yml deleted file mode 100644 index 6122f5353..000000000 --- a/sites/all/modules/contrib/admin/features/features.services.yml +++ /dev/null @@ -1,38 +0,0 @@ -services: - plugin.manager.features_assignment_method: - class: Drupal\features\FeaturesAssignmentMethodManager - arguments: ['@container.namespaces', '@cache.discovery', '@module_handler'] - plugin.manager.features_generation_method: - class: Drupal\features\FeaturesGenerationMethodManager - arguments: ['@container.namespaces', '@cache.discovery', '@module_handler'] - features_assigner: - class: Drupal\features\FeaturesAssigner - arguments: ['@features.manager', '@plugin.manager.features_assignment_method', '@entity.manager', '@config.factory', '@config.storage'] - calls: - - [initFeaturesManager] - features_generator: - class: Drupal\features\FeaturesGenerator - arguments: ['@features.manager', '@plugin.manager.features_generation_method', '@features_assigner'] - calls: - - [initFeaturesManager] - features.manager: - class: Drupal\features\FeaturesManager - arguments: ['@app.root', '@entity.manager', '@config.factory', '@config.storage', '@config.manager', '@module_handler', '@features.config_update'] - - features.config_update: - class: Drupal\config_update\ConfigReverter - arguments: ['@entity.manager', '@config.storage', '@features.extension_storage', '@features.extension_optional_storage', '@config.factory', '@event_dispatcher'] - - features.extension_storage: - class: Drupal\features\FeaturesInstallStorage - arguments: ['@config.storage'] - - features.extension_optional_storage: - class: Drupal\features\FeaturesInstallStorage - arguments: ['@config.storage', 'config/optional'] - - features.config.installer: - class: Drupal\features\FeaturesConfigInstaller - decorates: config.installer - decoration_priority: 9 - arguments: ['@features.config.installer.inner', '@features.manager', '@config.factory', '@config.storage', '@config.typed', '@config.manager', '@event_dispatcher'] diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/css/features_ui.admin.css b/sites/all/modules/contrib/admin/features/modules/features_ui/css/features_ui.admin.css deleted file mode 100644 index 1f8a78178..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/css/features_ui.admin.css +++ /dev/null @@ -1,283 +0,0 @@ -span.features-item-list span { - background: #eee; - border-radius: 5px; - margin-right: 5px; - padding: 2px 5px; - white-space: nowrap; - line-height: 1.7em; -} - -.features-listing span.features-override, -.features-listing a.features-override { - background: #FFCE6F; - border-radius: 5px; - margin-right: 5px; - padding: 2px 5px; - white-space: nowrap; -} - -.features-listing span.features-detected, -.features-listing a.features-detected { - color:#68a; - background:#def; - border-radius: 5px; - margin-right: 5px; - padding: 2px 5px; - white-space: nowrap; -} - -.features-listing span.features-conflict, -.features-listing a.features-conflict { - color: #fff; - background-color: #c30 !important; - border-radius: 5px; - margin-right: 5px; - padding: 2px 5px; - white-space: nowrap; -} - -.features-listing span.features-moved, -.features-listing a.features-moved { - color: #fff; - background-color: #215900 !important; - border-radius: 5px; - margin-right: 5px; - padding: 2px 5px; - white-space: nowrap; -} - -.features-listing span.features-missing, -.features-listing a.features-missing { - color: #fff; - background-color: #0E5EA9 !important; - border-radius: 5px; - margin-right: 5px; - padding: 2px 5px; - white-space: nowrap; -} - -table.features-listing .column-nowrap { - white-space: nowrap; -} - -tr.features-export-header-row td { - border-top: 30px solid white; - background: #eee; - padding-top: 10px; -} - -#features-assignment-methods tr.draggable > td:nth-child(1) { - white-space: nowrap; -} - -/** Styles for Features Export/Listing page **/ -.features-listing td { - vertical-align: top; -} - -.features-listing td.feature-name { - font-size: 14px; - white-space: nowrap; -} - -.features-listing td details { - border: 0; - margin: 0; - height: 20px; -} - -.features-listing details[open] { - height: auto; - overflow: visible; - white-space: normal; -} - -.features-listing td summary { - padding: 0; - text-transform: none; - font-weight: normal; -} - -.features-listing td .features-item-label { - font-weight: bold; -} - -.features-header > div, -.features-header > input { - display: inline-block; -} - -/** Styles for Features Edit page **/ - -.fieldset-legend { - font-size: 14px; -} - -#features-export-info { - width: 49%; - float: left; - position: relative; -} -#features-export-wrapper { - width: 49%; - float: right; - clear: both; - position: relative; -} - -.form-type-checkbox.form-item-conflicts { - clear: left; -} - -div.features-export-list { - font-weight: normal; - font-size: 12px; - border: 1px solid #CCC; - border-top-width: 0; - overflow: hidden; - padding: 0 10px 0 30px; -} - -span.features-component-list span { - white-space:nowrap; - margin-right:5px; - padding:2px 5px; - background:#eee; - border-radius:5px; -} - -div.features-export-empty { - display: none; -} - -span.features-component-list span.features-conflict { - background-color: #c30 !important; - color: #fff; -} - -span.features-component-list .features-detected { - color:#68a; - background:#def; -} - -span.features-component-list .features-dependency { - color:#999; - background:#f8f8f8; -} - -#features-legend .fieldset-wrapper span { - font-style: normal; - color: black; - display: inline-block; - background: transparent; - border: 1px solid #DDD; - border-radius: 5px; - white-space: nowrap; - padding: 0 8px; - margin: 0 10px 0 0; -} -#features-export-wrapper .config-name { - color: #777; -} -#features-export-wrapper .component-detected .form-type-checkbox, -#features-legend .fieldset-wrapper .component-detected { - font-style: italic; - color:#68a; - background:#def; - border-width: 0; -} -#features-export-wrapper .component-added .form-type-checkbox, -#features-legend .fieldset-wrapper .component-added { - font-weight: bold; - background: #EEE; - border-width: 0; -} -#features-export-wrapper .component-conflict.form-type-checkbox, -#features-legend .fieldset-wrapper .component-conflict { - color: #c30 !important; - font-weight: bold !important; -} - -#features-export-wrapper .component-conflict.form-type-checkbox label, -#features-export-wrapper .component-added .form-type-checkbox label { - font-weight: bold !important; -} - -#features-filter input[size="60"].form-text { - width: 200px; -} -#features-filter .fieldset-content, -#features-filter .fieldset-wrapper, -#features-filter fieldset { - border: 0; - padding: 0; - margin: 0; -} -#features-filter fieldset legend { - display: none; -} -#features-filter label, -#features-filter input { - display: inline; - width: auto; -} -#features-filter .form-item { - float: left; - margin: 5px 0; - padding: 0; -} -#features-filter .form-item.form-type-checkbox { - margin: 5px 0; -} -#features-filter span { - float: left; - white-space: normal; - margin: 5px 5px; - padding: 0 5px; - background: transparent; - background: #EEE; - border-radius: 5px; - cursor: pointer; -} -#features-filter span:hover { - background:#def; -} - -#features-export-wrapper div.features-export-parent { - clear: both; - margin: 0 0 10px; -} - -details.features-export-component { - background: #F3F8FB; - margin: 0; - padding: 0 5px; -} -details.features-export-component summary { - white-space: nowrap; - text-transform: none; - font-weight: normal; - font-size: 14px; -} -details.features-export-component summary .component-count { - font-size: 11px; -} -details.features-export-component .details-wrapper { - padding-left: 25px; - padding-top: 0; -} - -/** Styles for Bundle assignment config form **/ -#edit-bundles-wrapper .form-item-bundle-bundle-select { - display: inline-block; -} - -#edit-bundles-wrapper #edit-bundle-remove { - display: inline-block; - font-size: 10px; -} - -/** Styles for plugin config forms **/ -.features-assignment-settings-form .fieldset-wrapper { - padding-left: 16px; -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.admin.inc b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.admin.inc deleted file mode 100644 index 0b7186252..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.admin.inc +++ /dev/null @@ -1,175 +0,0 @@ - ['checkbox'], 'data' => $renderer->render($element['enable'])]; - - // Add the module label and expand/collapse functionalty. - $id = Html::getUniqueId('feature-' . $key); - $col2 = new FormattableMarkup('', - [ - '@id' => $id, - '@for' => $element['enable']['#id'], - '@name' => $renderer->render($element['name']), - ] - ); - $row[] = ['class' => ['module'], 'data' => $col2]; - - $row[] = ['class' => ['machine_name'], 'data' => $renderer->render($element['machine_name'])]; - - $description = t('@details', ['@details' => $renderer->render($element['details'])]); - $details = [ - '#type' => 'details', - '#title' => new FormattableMarkup('@desc', [ '@desc' => $renderer->render($element['description'])]), - '#attributes' => ['id' => $element['enable']['#id'] . '-description'], - '#description' => $description, - ]; - $row[] = [ - 'class' => ['description', 'expand'], - 'data' => $renderer->render($details), - ]; - $row[] = [ - 'class' => ['feature-version'], - 'data' => $renderer->render($element['version']), - ]; - $row[] = [ - 'class' => ['feature-state'], - 'data' => $renderer->render($element['state']), - ]; - - $rows[] = ['data' => $row]; - } - - $table = [ - '#type' => 'tableselect', - '#header' => $form['#header'], - '#options' => $rows, - '#empty' => t('No Features packages available.'), - ]; - return $renderer->render($table); -} - -/** - * Prepares variables for package assignment configuration form. - * - * @param array $variables - * An associative array containing: - * - form: A render element representing the form. - */ -function template_preprocess_features_assignment_configure_form(&$variables) { - $form =& $variables['form']; - - $header = [ - t('Assignment method'), - t('Description'), - t('Enabled'), - t('Weight'), - ]; - - // If there is at least one operation enabled, show the operation column. - if ($form['#show_operations']) { - $header[] = t('Operations'); - } - - $table = [ - '#type' => 'table', - '#weight' => 5, - '#header' => $header, - '#attributes' => ['id' => 'features-assignment-methods'], - '#tabledrag' => [ - [ - 'action' => 'order', - 'relationship' => 'sibling', - 'group' => 'assignment-method-weight', - ], - ], - ]; - - foreach ($form['title'] as $id => $element) { - // Do not take form control structures. - if (is_array($element) && Element::child($id)) { - $table[$id]['#attributes']['class'][] = 'draggable'; - $table[$id]['#weight'] = $element['#weight']; - - $table[$id]['title'] = [ - '#prefix' => '', - $form['title'][$id], - '#suffix' => '', - ]; - $table[$id]['description'] = $form['description'][$id]; - $table[$id]['enabled'] = $form['enabled'][$id]; - $table[$id]['weight'] = $form['weight'][$id]; - if ($form['#show_operations']) { - $table[$id]['operation'] = $form['operation'][$id]; - } - // Unset to prevent rendering along with children. - unset($form['title'][$id]); - unset($form['description'][$id]); - unset($form['enabled'][$id]); - unset($form['weight'][$id]); - unset($form['operation'][$id]); - } - } - - // For some reason, the #weight is not being handled by drupal_render. - // So we remove the actions and then put them back into the form after the - // table. - $actions = $form['actions']; - unset($form['actions']); - $form['table'] = $table; - $form['actions'] = $actions; -} - -/** - * Themes individual items in an item list. - */ -function theme_features_items(array $variables) { - $items = $variables['items']; - - $list = []; - foreach ($items as $item) { - $class = !empty($item['class']) ? $item['class'] : ''; - $list[] = '' . $item['label'] . ''; - } - - return '' . implode(' ', $list) . ''; -} - -/** - * Themes the assignment form. - */ -function theme_assignment_form(array $variables) { - $renderer = \Drupal::service('renderer'); - return $renderer->render($variables['form']); -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.info.yml b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.info.yml deleted file mode 100644 index d78b3f772..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Features UI -type: module -description: 'Provides the user interface for Features.' -package: Development -# core: 8.x -configure: features.assignment -dependencies: - - features:features - -# Information added by Drupal.org packaging script on 2018-09-09 -version: '8.x-3.8' -core: '8.x' -project: 'features' -datestamp: 1536512288 diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.libraries.yml b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.libraries.yml deleted file mode 100644 index 07a4d490a..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.libraries.yml +++ /dev/null @@ -1,11 +0,0 @@ -drupal.features_ui.admin: - version: VERSION - css: - theme: - css/features_ui.admin.css: {} - js: - js/features_ui.admin.js: {} - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.action.yml b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.action.yml deleted file mode 100644 index 93a37b453..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -features_ui.feature_add: - route_name: features.edit - title: 'Create new feature' - appears_on: - - features.export diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.menu.yml b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.menu.yml deleted file mode 100644 index 379a3e4cf..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -features.export: - title: 'Features' - description: 'Package your configuration into feature modules.' - route_name: features.export - parent: system.admin_config_development diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.task.yml b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.task.yml deleted file mode 100644 index fb8d6360d..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.links.task.yml +++ /dev/null @@ -1,14 +0,0 @@ -features.export: - route_name: features.export - title: 'Features' - base_route: features.export - -features.assignment: - route_name: features.assignment - title: 'Configure Bundles' - base_route: features.export - -features.diff: - route_name: features.diff - title: 'Differences' - base_route: features.export diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.module b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.module deleted file mode 100644 index 1860427bd..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.module +++ /dev/null @@ -1,55 +0,0 @@ -' . t('Bundles are used to collect together groups of features. A bundle provides a shared namespace for all features included in it, which prevents conflicts and helps distinguish your features from those produced for other purposes. Common uses of bundles include:', [':namespace' => 'http://en.wikipedia.org/wiki/Namespace']); - $output .= '
    '; - $output .= '
  • ' . t('Custom features for use on a particular site.') . '
  • '; - $output .= '
  • ' . t('The features of a given distribution.', [':distributions' => 'https://www.drupal.org/documentation/build/distributions']) . '
  • '; - $output .= '

'; - $output .= '

' . t('Use the form below to manage bundles. Each bundle comes with a set of assignment methods. By configuring and ordering the assignment methods, you can set the defaults for what does and doesn\'t get packaged into features for your bundle. Use the Bundle select to choose which bundle to edit, or chose --New-- to create a new bundle. The Default bundle does not include a namespace and cannot be deleted.') . '

'; - return $output; - - case 'features.export': - $output = ''; - $output .= '

' . t('Export packages of configuration into modules.') . '

'; - return $output; - } -} - -/** - * Implements hook_theme(). - */ -function features_ui_theme() { - return [ - 'features_listing' => [ - 'render element' => 'form', - 'file' => 'features_ui.admin.inc', - 'function' => 'theme_features_listing', - ], - 'features_assignment_configure_form' => [ - 'render element' => 'form', - 'file' => 'features_ui.admin.inc', - 'function' => 'theme_assignment_form', - ], - 'features_items' => [ - 'variables' => [ - 'items' => [], - ], - 'file' => 'features_ui.admin.inc', - 'function' => 'theme_features_items', - ], - ]; -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.routing.yml b/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.routing.yml deleted file mode 100644 index 9343aee07..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/features_ui.routing.yml +++ /dev/null @@ -1,104 +0,0 @@ -features.export: - path: '/admin/config/development/features' - defaults: - _form: '\Drupal\features_ui\Form\FeaturesExportForm' - _title: 'Features' - requirements: - _permission: 'export configuration' - -features.assignment: - path: '/admin/config/development/features/bundle/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentConfigureForm' - _title: 'Bundle assignment' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_alter: - path: '/admin/config/development/features/bundle/_alter/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentAlterForm' - _title: 'Configure package configuration altering' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_base: - path: '/admin/config/development/features/bundle/_base/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentBaseForm' - _title: 'Configure base package assignment' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_core: - path: '/admin/config/development/features/bundle/_core/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentCoreForm' - _title: 'Configure core package assignment' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_exclude: - path: '/admin/config/development/features/bundle/_exclude/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentExcludeForm' - _title: 'Configure package exclusion' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_optional: - path: '/admin/config/development/features/bundle/_optional/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentOptionalForm' - _title: 'Configure optional package assignment' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_profile: - path: '/admin/config/development/features/bundle/_profile/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentProfileForm' - _title: 'Configure profile package assignment' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.assignment_site: - path: '/admin/config/development/features/bundle/_site/{bundle_name}' - defaults: - _form: '\Drupal\features_ui\Form\AssignmentSiteForm' - _title: 'Configure site package assignment' - bundle_name: NULL - requirements: - _permission: 'administer site configuration' - -features.edit: - path: '/admin/config/development/features/edit/{featurename}' - defaults: - _form: '\Drupal\features_ui\Form\FeaturesEditForm' - _title: 'Edit' - featurename: '' - requirements: - _permission: 'administer site configuration' - -features.diff: - path: '/admin/config/development/features/diff/{featurename}' - defaults: - _form: '\Drupal\features_ui\Form\FeaturesDiffForm' - _title: 'Differences' - featurename: '' - requirements: - _permission: 'administer site configuration' - -features.detect: - path: '/features/api/detect/{name}' - defaults: - _controller: '\Drupal\features_ui\Controller\FeaturesUIController::detect' - requirements: - _permission: 'administer site configuration' diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/js/features_ui.admin.js b/sites/all/modules/contrib/admin/features/modules/features_ui/js/features_ui.admin.js deleted file mode 100644 index d4019681b..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/js/features_ui.admin.js +++ /dev/null @@ -1,401 +0,0 @@ -/** - * jQuery.fn.sortElements - * -------------- - * @param Function comparator: - * Exactly the same behaviour as [1,2,3].sort(comparator) - * - * @param Function getSortable - * A function that should return the element that is - * to be sorted. The comparator will run on the - * current collection, but you may want the actual - * resulting sort to occur on a parent or another - * associated element. - * - * E.g. $('td').sortElements(comparator, function(){ - * return this.parentNode; - * }) - * - * The 's parent () will be sorted instead - * of the itself. - * - * Credit: http://james.padolsey.com/javascript/sorting-elements-with-jquery/ - * - */ -jQuery.fn.sortElements = (function () { - - "use strict"; - - var sort = [].sort; - - return function (comparator, getSortable) { - - getSortable = getSortable || function () {return this;}; - - var placements = this.map(function () { - - var sortElement = getSortable.call(this); - var parentNode = sortElement.parentNode; - - // Since the element itself will change position, we have - // to have some way of storing its original position in - // the DOM. The easiest way is to have a 'flag' node: - var nextSibling = parentNode.insertBefore( - document.createTextNode(''), - sortElement.nextSibling - ); - - return function () { - - if (parentNode === this) { - throw new Error( - "You can't sort elements if any one is a descendant of another." - ); - } - - // Insert before flag: - parentNode.insertBefore(this, nextSibling); - // Remove flag: - parentNode.removeChild(nextSibling); - - }; - - }); - - return sort.call(this, comparator).each(function (i) { - placements[i].call(getSortable.call(this)); - }); - - }; - -})(); - -(function ($) { - - "use strict"; - - Drupal.behaviors.features = { - attach: function (context) { - - // mark any conflicts with a class - if ((typeof drupalSettings.features !== 'undefined') && (typeof drupalSettings.features.conflicts !== 'undefined')) { - // for (var configType in drupalSettings.features.conflicts) { - if (drupalSettings.features.conflicts) { - var configConflicts = drupalSettings.features.conflicts; - $('#features-export-wrapper input[type=checkbox]', context).each(function () { - if (!$(this).hasClass('features-checkall')) { - var key = $(this).attr('name'); - var matches = key.match(/^([^\[]+)(\[.+\])?\[(.+)\]\[(.+)\]$/); - var component = matches[1]; - var item = matches[4]; - if ((component in configConflicts) && (item in configConflicts[component])) { - $(this).parent().addClass('component-conflict'); - } - } - }); - } - //} - } - - function _checkAll(value) { - if (value) { - $('#features-export-wrapper .component-select input[type=checkbox]:visible', context).each(function () { - var move_id = $(this).attr('id'); - $(this).click(); - $('#'+ move_id).prop('checked', true); - }); - } - else { - $('#features-export-wrapper .component-added input[type=checkbox]:visible', context).each(function () { - var move_id = $(this).attr('id'); - $(this).click(); - $('#'+ move_id).prop('checked', false); - }); - } - } - - function updateComponentCountInfo(item, section) { - var parent; - - switch (section) { - case 'select': - parent = $(item).closest('.features-export-list').siblings('.features-export-component'); - $('.component-count', parent).text(function (index, text) { - return +text + 1; - } - ); - break; - case 'added': - case 'detected': - parent = $(item).closest('.features-export-component'); - $('.component-count', parent).text(function (index, text) { - return text - 1; - }); - } - } - - function moveCheckbox(item, section, value) { - updateComponentCountInfo(item, section); - var curParent = item; - if ($(item).hasClass('form-type-checkbox')) { - item = $(item).children('input[type=checkbox]'); - } - else { - curParent = $(item).parents('.form-type-checkbox'); - } - var newParent = $(curParent).parents('.features-export-parent').find('.component-'+section+' .form-checkboxes'); - $(curParent).detach(); - $(curParent).appendTo(newParent); - var list = ['select', 'added', 'detected', 'included']; - for (var i in list) { - if (list[i]) { - $(curParent).removeClass('component-' + list[i]); - $(item).removeClass('component-' + list[i]); - } - } - $(curParent).addClass('component-'+section); - $(item).addClass('component-'+section); - if (value) { - $(item).attr('checked', 'checked'); - } - else { - $(item).removeAttr('checked'); - } - $(newParent).parents('.component-list').removeClass('features-export-empty'); - - // re-sort new list of checkboxes based on labels - $(newParent).find('label').sortElements( - function (a, b) { - return $(a).text() > $(b).text() ? 1 : -1; - }, - function () { - return this.parentNode; - } - ); - } - - // provide timer for auto-refresh trigger - var timeoutID = 0; - var inTimeout = 0; - function _triggerTimeout() { - timeoutID = 0; - _updateDetected(); - } - function _resetTimeout() { - inTimeout++; - // if timeout is already active, reset it - if (timeoutID !== 0) { - window.clearTimeout(timeoutID); - if (inTimeout > 0) { inTimeout--; } - } - timeoutID = window.setTimeout(_triggerTimeout, 500); - } - - function _updateDetected() { - if (!drupalSettings.features.autodetect) { return; } - // query the server for a list of components/items in the feature and update - // the auto-detected items - var items = []; // will contain a list of selected items exported to feature - var components = {}; // contains object of component names that have checked items - $('#features-export-wrapper input[type=checkbox]:checked', context).each(function () { - if (!$(this).hasClass('features-checkall')) { - var key = $(this).attr('name'); - var matches = key.match(/^([^\[]+)(\[.+\])?\[(.+)\]\[(.+)\]$/); - components[matches[1]] = matches[1]; - if (!$(this).hasClass('component-detected')) { - items.push(key); - } - } - }); - var featureName = $('#edit-machine-name').val(); - if (featureName === '') { - featureName = '*'; - } - - var url = Drupal.url('features/api/detect/' + featureName); - var excluded = drupalSettings.features.excluded; - var required = drupalSettings.features.required; - var postData = {'items': items, 'excluded': excluded, 'required': required}; - jQuery.post(url, postData, function (data) { - if (inTimeout > 0) { inTimeout--; } - // if we have triggered another timeout then don't update with old results - if (inTimeout === 0) { - // data is an object keyed by component listing the exports of the feature - for (var component in data) { - if (data[component]) { - var itemList = data[component]; - $('#features-export-wrapper .component-' + component + ' input[type=checkbox]', context).each(function () { - var key = $(this).attr('value'); - // first remove any auto-detected items that are no longer in component - if ($(this).hasClass('component-detected')) { - if (!(key in itemList)) { - moveCheckbox(this, 'select', false); - } - } - // next, add any new auto-detected items - else if ($(this).hasClass('component-select')) { - if (key in itemList) { - moveCheckbox(this, 'detected', itemList[key]); - $(this).prop('checked', true); - $(this).parent().show(); // make sure it's not hidden from filter - } - } - }); - } - } - // loop over all selected components and check for any that have been completely removed - for (var selectedComponent in components) { - if ((data == null) || !(selectedComponent in data)) { - $('#features-export-wrapper .component-' + selectedComponent + ' input[type=checkbox].component-detected', context).each(moveCheckbox(this, 'select', false)); - } - } - } - }, "json"); - } - - // Handle component selection UI - $('#features-export-wrapper input[type=checkbox]', context).click(function () { - _resetTimeout(); - if ($(this).hasClass('component-select')) { - moveCheckbox(this, 'added', true); - } - else if ($(this).hasClass('component-included')) { - moveCheckbox(this, 'added', false); - } - else if ($(this).hasClass('component-added')) { - if ($(this).is(':checked')) { - moveCheckbox(this, 'included', true); - } - else { - moveCheckbox(this, 'select', false); - } - } - }); - - // Handle select/unselect all - $('#features-filter .features-checkall.form-checkbox', context).click(function () { - if ($(this).prop('checked')) { - _checkAll(true); - $(this).next().html(Drupal.t('Deselect all')); - } - else { - _checkAll(false); - $(this).next().html(Drupal.t('Select all')); - } - _resetTimeout(); - }); - - // Handle filtering - - // provide timer for auto-refresh trigger - var filterTimeoutID = 0; - function _triggerFilterTimeout() { - filterTimeoutID = 0; - _updateFilter(); - } - function _resetFilterTimeout() { - // if timeout is already active, reset it - if (filterTimeoutID !== 0) { - window.clearTimeout(filterTimeoutID); - filterTimeoutID = null; - } - filterTimeoutID = window.setTimeout(_triggerFilterTimeout, 200); - } - function _updateFilter() { - var filter = $('#features-filter input').val(); - var regex = new RegExp(filter, 'i'); - // collapse fieldsets - var newState = {}; - var currentState = {}; - $('#features-export-wrapper details.features-export-component', context).each(function () { - // expand parent fieldset - var section = $(this).attr('id'); - var details = $(this); - - currentState[section] = details.prop('open'); - if (!(section in newState)) { - newState[section] = false; - } - - details.find('.form-checkboxes label').each(function () { - if (filter === '') { - // collapse the section, but make checkbox visible - if (currentState[section]) { - details.prop('open', false); - currentState[section] = false; - } - $(this).parent().show(); - } - else if ($(this).text().match(regex)) { - $(this).parent().show(); - newState[section] = true; - } - else { - $(this).parent().hide(); - } - }); - }); - for (var section in newState) { - if (currentState[section] !== newState[section]) { - if (newState[section]) { - $('#'+section).prop('open', true); - } - else { - $('#'+section).prop('open', false); - } - } - } - } - $('#features-filter input', context).bind("input", function () { - _resetFilterTimeout(); - }); - $('#features-filter .features-filter-clear', context).click(function () { - $('#features-filter input').val(''); - _updateFilter(); - }); - - // show the filter bar - $('#features-filter', context).removeClass('element-invisible'); - - // handle Package selection checkboxes in the Differences page - $('.features-diff-listing .features-diff-header input.form-checkbox', context).click(function () { - var value = $(this).prop('checked'); - $('.features-diff-listing .diff-'+$(this).prop('value')+' input.form-checkbox', context).each(function () { - $(this).prop('checked', value); - if (value) { - $(this).parents('tr').addClass('selected'); - } - else { - $(this).parents('tr').removeClass('selected'); - } - }); - }); - - // handle special theming of headers in tableselect - $('td.features-export-header-row', context).each(function () { - var row = $(this).parent('tr'); - row.addClass('features-export-header-row'); - var checkbox = row.find('td input:checkbox'); - if (checkbox.length) { - checkbox.hide(); - } - }); - - // handle clicking anywhere in row on Differences page - $('.features-diff-listing tr td:nth-child(2)', context).click(function () { - var checkbox = $(this).parent().find('td input:checkbox'); - checkbox.prop('checked', !checkbox.prop('checked')).triggerHandler('click'); - if (checkbox.prop('checked')) { - $(this).parents('tr').addClass('selected'); - } - else { - $(this).parents('tr').removeClass('selected'); - } - }); - $('.features-diff-listing thead th:nth-child(2)', context).click(function () { - var checkbox = $(this).parent().find('th input:checkbox'); - checkbox.click(); - }); - } - }; - -})(jQuery); diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Controller/FeaturesUIController.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Controller/FeaturesUIController.php deleted file mode 100644 index 786a51cd0..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Controller/FeaturesUIController.php +++ /dev/null @@ -1,193 +0,0 @@ -featuresManager = $features_manager; - $this->assigner = $assigner; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('features.manager'), - $container->get('features_assigner') - ); - } - - /** - * Returns a list of auto-detected config items for a feature. - * - * @param string $name - * Short machine name of feature to process. - * - * @return array - * List of auto-detected config items, keyed by type and short name. - */ - public function detect($name) { - $detected = []; - $this->assigner->assignConfigPackages(); - $config_collection = $this->featuresManager->getConfigCollection(); - - $items = $_POST['items']; - if (!empty($items)) { - $excluded = (!empty($_POST['excluded'])) ? $_POST['excluded'] : []; - $selected = []; - foreach ($items as $key) { - preg_match('/^([^\[]+)(\[.+\])?\[(.+)\]\[(.+)\]$/', $key, $matches); - if (!empty($matches[1]) && !empty($matches[4])) { - $component = $matches[1]; - $item = $this->domDecode($matches[4]); - if (!isset($excluded[$component][$item])) { - $selected[] = $this->featuresManager->getFullName($component, $item); - } - } - } - $detected = !empty($selected) ? $this->getConfigDependents($selected, $name) : []; - $detected = array_merge($detected, $selected); - } - - $result = []; - foreach ($detected as $config_name) { - $item = $config_collection[$config_name]; - $result[$item->getType()][$item->getShortName()] = $item->getName(); - } - return new JsonResponse($result); - } - - /** - * Returns the configuration dependent on given items. - * - * @param array $item_names - * An array of item names. - * @param string $package_name - * Short machine name of feature to process. - * - * @return array - * An array of config items. - */ - protected function getConfigDependents(array $item_names, $package_name) { - $result = []; - $config_collection = $this->featuresManager->getConfigCollection(); - $packages = $this->featuresManager->getPackages(); - $settings = $this->featuresManager->getSettings(); - $allow_conflicts = $settings->get('conflicts'); - - if (empty($item_names)) { - $item_names = array_keys($config_collection); - } - - // Add any existing auto-detected items already in the package config - $this->package = $packages[$package_name]; - $package_config = isset($this->package) ? $this->package->getConfig() : []; - $package_config = !empty($package_config) ? array_unique(array_merge($package_config, $item_names)) : $item_names; - foreach ($package_config as $config_name) { - if (!$config_collection[$config_name]->getPackageExcluded()) { - $result[] = $config_name; - } - } - - // Now add dependents of the items selected - foreach ($item_names as $item_name) { - if ($config_collection[$item_name]->getPackage()) { - foreach ($config_collection[$item_name]->getDependents() as $dependent_item_name) { - if (isset($config_collection[$dependent_item_name])) { - $allow = TRUE; - if (!$allow_conflicts && $config_collection[$dependent_item_name]->getPackage()) { - if ($packages[$config_collection[$dependent_item_name]->getPackage()]) { - $allow = ($packages[$config_collection[$dependent_item_name]->getPackage()]->getStatus() == FeaturesManagerInterface::STATUS_NO_EXPORT) - || ($config_collection[$item_name]->getPackage() == $config_collection[$dependent_item_name]->getPackage()); - } - } - if ($allow) { - $result[] = $dependent_item_name; - } - } - } - } - } - return $result; - } - - /** - * Encodes a given key. - * - * @param string $key - * The key to encode. - * - * @return string - * The encoded key. - */ - protected function domEncode($key) { - $replacements = $this->domEncodeMap(); - return strtr($key, $replacements); - } - - /** - * Decodes a given key. - * - * @param string $key - * The key to decode. - * - * @return string - * The decoded key. - */ - protected function domDecode($key) { - $replacements = array_flip($this->domEncodeMap()); - return strtr($key, $replacements); - } - - /** - * Returns encoding map for decode and encode options. - * - * @return array - * An encoding map. - */ - protected function domEncodeMap() { - return [ - ':' => '__' . ord(':') . '__', - '/' => '__' . ord('/') . '__', - ',' => '__' . ord(',') . '__', - '.' => '__' . ord('.') . '__', - '<' => '__' . ord('<') . '__', - '>' => '__' . ord('>') . '__', - '%' => '__' . ord('%') . '__', - ')' => '__' . ord(')') . '__', - '(' => '__' . ord('(') . '__', - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentAlterForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentAlterForm.php deleted file mode 100644 index 462ee0ba5..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentAlterForm.php +++ /dev/null @@ -1,76 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $core_setting = $settings['core']; - $uuid_setting = $settings['uuid']; - $user_permissions_setting = $settings['user_permissions']; - - $form['core'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Strip out _core property.'), - '#default_value' => $core_setting, - '#description' => $this->t('Select this option to remove the _core configuration property on export. This property is added by Drupal core when configuration is installed.'), - ]; - - $form['uuid'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Strip out uuid property.'), - '#default_value' => $uuid_setting, - '#description' => $this->t('Select this option to remove the uuid configuration property on export. This property is added by Drupal core when configuration is installed.'), - ]; - - $form['user_permissions'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Strip out user permissions.'), - '#default_value' => $user_permissions_setting, - '#description' => $this->t('Select this option to remove permissions from user roles on export.'), - ]; - - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $settings = array_merge($settings, [ - 'core' => $form_state->getValue('core'), - 'uuid' => $form_state->getValue('uuid'), - 'user_permissions' => $form_state->getValue('user_permissions'), - ]); - - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - - $this->setRedirect($form_state); - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentBaseForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentBaseForm.php deleted file mode 100644 index 44f802217..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentBaseForm.php +++ /dev/null @@ -1,61 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - - // Pass the last argument to limit the select to config entity types that - // provide bundles for other entity types. - $this->setConfigTypeSelect($form, $settings['types']['config'], $this->t('base'), TRUE); - // Pass the last argument to limit the select to content entity types do - // not have config entity provided bundles, thus avoiding duplication with - // the config type select options. - $this->setContentTypeSelect($form, $settings['types']['content'], $this->t('base'), TRUE); - - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_state->setValue('types', array_map('array_filter', $form_state->getValue('types'))); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in types selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $settings['types'] = $form_state->getValue('types'); - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - $this->setRedirect($form_state); - - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentConfigureForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentConfigureForm.php deleted file mode 100644 index 446308275..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentConfigureForm.php +++ /dev/null @@ -1,445 +0,0 @@ -featuresManager = $features_manager; - $this->assigner = $assigner; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('features.manager'), - $container->get('features_assigner') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'features_assignment_configure_form'; - } - - /** - * Load the values from the bundle into the user input. - * Used during Ajax callback since updating #default_values is ignored. - * @param $bundle_name - * @param \Drupal\Core\Form\FormStateInterface $form_state - */ - protected function loadBundleValues($bundle_name, FormStateInterface &$form_state, $current_bundle, $enabled_methods, $methods_weight) { - $input = $form_state->getUserInput(); - if ($bundle_name == self::NEW_BUNDLE_SELECT_VALUE) { - $input['bundle']['name'] = ''; - $input['bundle']['machine_name'] = ''; - $input['bundle']['description'] = ''; - $input['bundle']['is_profile'] = NULL; - $input['bundle']['profile_name'] = ''; - } - else { - $input['bundle']['name'] = $current_bundle->getName(); - $input['bundle']['machine_name'] = $current_bundle->getMachineName(); - $input['bundle']['description'] = $current_bundle->getDescription(); - $input['bundle']['is_profile'] = $current_bundle->isProfile() ? 1 : null; - $input['bundle']['profile_name'] = $current_bundle->isProfile() ? $current_bundle->getProfileName() : ''; - } - - foreach ($methods_weight as $method_id => $weight) { - $enabled = isset($enabled_methods[$method_id]); - $input['weight'][$method_id] = $weight; - $input['enabled'][$method_id] = $enabled ? 1 : null; - } - - $form_state->setUserInput($input); - } - - /** - * Detects if an element triggered the form submission via Ajax. - * TODO: SHOULDN'T NEED THIS! BUT DRUPAL IS CALLING buildForm AFTER THE - * BUNDLE AJAX IS SELECTED AND DOESN'T HAVE getTriggeringElement() SET YET. - */ - protected function elementTriggeredScriptedSubmission(FormStateInterface &$form_state) { - $input = $form_state->getUserInput(); - if (!empty($input['_triggering_element_name'])) { - return $input['_triggering_element_name']; - } - return ''; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $bundle_name = NULL) { - $load_values = FALSE; - $trigger = $form_state->getTriggeringElement(); - // TODO: See if there is a Drupal Core issue for this. - // Sometimes the first ajax call on the page causes buildForm to be called - // twice! First time form_state->getTriggeringElement is NOT SET, but - // the form_state['input'] shows the _triggering_element_name. Then the - // SECOND time it is called the getTriggeringElement is fine. - $real_trigger = $this->elementTriggeredScriptedSubmission($form_state); - if (!isset($trigger) && ($real_trigger == 'bundle[bundle_select]')) { - $input = $form_state->getUserInput(); - $bundle_name = $input['bundle']['bundle_select']; - if ($bundle_name != self::NEW_BUNDLE_SELECT_VALUE) { - $this->assigner->setCurrent($this->assigner->getBundle($bundle_name)); - } - $load_values = TRUE; - } - elseif ($trigger['#name'] == 'bundle[bundle_select]') { - $bundle_name = $form_state->getValue(['bundle', 'bundle_select']); - if ($bundle_name != self::NEW_BUNDLE_SELECT_VALUE) { - $this->assigner->setCurrent($this->assigner->getBundle($bundle_name)); - } - $load_values = TRUE; - } - elseif ($trigger['#name'] == 'removebundle') { - $current_bundle = $this->assigner->loadBundle($bundle_name); - $bundle_name = $current_bundle->getMachineName(); - $this->assigner->removeBundle($bundle_name); - return $this->redirect('features.assignment', ['']); - } - if (!isset($current_bundle)) { - switch ($bundle_name) { - // If no bundle is selected, use the current one. - case NULL: - $current_bundle = $this->assigner->loadBundle(); - $bundle_name = $current_bundle->getMachineName(); - break; - case self::NEW_BUNDLE_SELECT_VALUE: - $current_bundle = $this->assigner->loadBundle(FeaturesBundleInterface::DEFAULT_BUNDLE); - break; - default: - $current_bundle = $this->assigner->loadBundle($bundle_name); - break; - } - } - - $enabled_methods = $current_bundle->getEnabledAssignments(); - $methods_weight = $current_bundle->getAssignmentWeights(); - - // Add missing data to the methods lists. - $assignment_info = $this->assigner->getAssignmentMethods(); - foreach ($assignment_info as $method_id => $method) { - if (!isset($methods_weight[$method_id])) { - $methods_weight[$method_id] = isset($method['weight']) ? $method['weight'] : 0; - } - } - // Order methods list by weight. - asort($methods_weight); - - if ($load_values) { - $this->loadBundleValues($bundle_name, $form_state, $current_bundle, $enabled_methods, $methods_weight); - } - - $form = [ - '#attached' => [ - 'library' => [ - // Provides the copyFieldValue behavior invoked below. - 'system/drupal.system', - 'features_ui/drupal.features_ui.admin', - ], - ], - // '#attributes' => array('class' => 'edit-bundles-wrapper'), - '#tree' => TRUE, - '#show_operations' => FALSE, - 'weight' => ['#tree' => TRUE], - '#prefix' => '
', - '#suffix' => '
', - ]; - - $form['bundle'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Bundle'), - '#tree' => TRUE, - '#weight' => -9, - ]; - - if ($bundle_name == self::NEW_BUNDLE_SELECT_VALUE) { - $default_values = [ - 'bundle_select' => self::NEW_BUNDLE_SELECT_VALUE, - 'name' => '', - 'machine_name' => '', - 'description' => '', - 'is_profile' => FALSE, - 'profile_name' => '', - ]; - } - else { - $default_values = [ - 'bundle_select' => $current_bundle->getMachineName(), - 'name' => $current_bundle->getName(), - 'machine_name' => $current_bundle->getMachineName(), - 'description' => $current_bundle->getDescription(), - 'is_profile' => $current_bundle->isProfile(), - 'profile_name' => $current_bundle->getProfileName(), - ]; - } - $form['bundle']['bundle_select'] = [ - '#title' => $this->t('Bundle'), - '#title_display' => 'invisible', - '#type' => 'select', - '#options' => [self::NEW_BUNDLE_SELECT_VALUE => $this->t('--New--')] + $this->assigner->getBundleOptions(), - '#default_value' => $default_values['bundle_select'], - '#ajax' => [ - 'callback' => '::updateForm', - 'wrapper' => 'edit-bundles-wrapper', - ], - ]; - - // Don't show the remove button for the default bundle or when adding a new - // bundle. - if ($bundle_name != self::NEW_BUNDLE_SELECT_VALUE && !$current_bundle->isDefault()) { - $form['bundle']['remove'] = [ - '#type' => 'button', - '#name' => 'removebundle', - '#value' => $this->t('Remove bundle'), - ]; - } - - $form['bundle']['name'] = [ - '#title' => $this->t('Bundle name'), - '#type' => 'textfield', - '#description' => $this->t('A unique human-readable name of this bundle.'), - '#default_value' => $default_values['name'], - '#required' => TRUE, - '#disabled' => $bundle_name == FeaturesBundleInterface::DEFAULT_BUNDLE, - ]; - - // Don't allow changing the default bundle machine name. - if ($bundle_name == FeaturesBundleInterface::DEFAULT_BUNDLE) { - $form['bundle']['machine_name'] = [ - '#type' => 'value', - '#value' => $default_values['machine_name'], - ]; - } - else { - $form['bundle']['machine_name'] = [ - '#title' => $this->t('Machine name'), - '#type' => 'machine_name', - '#required' => TRUE, - '#default_value' => $default_values['machine_name'], - '#description' => $this->t('A unique machine-readable name of this bundle. Used to prefix exported packages. It must only contain lowercase letters, numbers, and underscores.'), - '#machine_name' => [ - 'source' => ['bundle', 'name'], - 'exists' => [$this, 'bundleExists'], - ], - ]; - } - - $form['bundle']['description'] = [ - '#title' => $this->t('Distribution description'), - '#type' => 'textfield', - '#default_value' => $default_values['description'], - '#description' => $this->t('A description of the bundle.'), - '#size' => 80, - ]; - - $form['bundle']['is_profile'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Include install profile'), - '#default_value' => $default_values['is_profile'], - '#description' => $this->t('Select this option to have your features packaged into an install profile.'), - '#attributes' => [ - 'data-add-profile' => 'status', - ], - ]; - - $show_and_require_if_profile_checked = [ - 'visible' => [ - ':input[data-add-profile="status"]' => ['checked' => TRUE], - ], - 'required' => [ - ':input[data-add-profile="status"]' => ['checked' => TRUE], - ], - ]; - - $form['bundle']['profile_name'] = [ - '#title' => $this->t('Profile name'), - '#type' => 'textfield', - '#default_value' => $default_values['profile_name'], - '#description' => $this->t('The machine name (directory name) of your profile.'), - '#size' => 30, - // Show and require only if the profile.add option is selected. - '#states' => $show_and_require_if_profile_checked, - ]; - - // Attach the copyFieldValue behavior to the profile_name field. In - // practice this only works if a user tabs through the bundle machine name - // field or manually edits it. - $form['#attached']['drupalSettings']['copyFieldValue']['edit-bundle-machine-name'] = ['edit-bundle-profile-name']; - - foreach ($methods_weight as $method_id => $weight) { - - // A packaging method might no longer be available if the defining module - // has been uninstalled after the last configuration saving. - if (!isset($assignment_info[$method_id])) { - continue; - } - - $enabled = isset($enabled_methods[$method_id]); - $method = $assignment_info[$method_id]; - - $method_name = Html::escape($method['name']); - - $form['weight'][$method_id] = [ - '#type' => 'weight', - '#title' => $this->t('Weight for @title package assignment method', ['@title' => Unicode::strtolower($method_name)]), - '#title_display' => 'invisible', - '#default_value' => $weight, - '#attributes' => ['class' => ['assignment-method-weight']], - '#delta' => 20, - ]; - - $form['title'][$method_id] = ['#markup' => $method_name]; - - $form['enabled'][$method_id] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enable @title package assignment method', ['@title' => Unicode::strtolower($method_name)]), - '#title_display' => 'invisible', - '#default_value' => $enabled, - ]; - - $form['description'][$method_id] = ['#markup' => $method['description']]; - - $config_op = []; - if (isset($method['config_route_name'])) { - $config_op['configure'] = [ - 'title' => $this->t('Configure'), - 'url' => Url::fromRoute($method['config_route_name'], ['bundle_name' => $current_bundle->getMachineName()]), - ]; - // If there is at least one operation enabled, show the operation - // column. - $form['#show_operations'] = TRUE; - } - $form['operation'][$method_id] = [ - '#type' => 'operations', - '#links' => $config_op, - ]; - } - - $form['actions'] = ['#type' => 'actions', '#weight' => 9]; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#button_type' => 'primary', - '#value' => $this->t('Save settings'), - ]; - - return $form; - } - - /** - * Ajax callback for handling switching the bundle selector. - */ - public function updateForm($form, FormStateInterface $form_state) { - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - if ($form_state->getValue(['bundle', 'is_profile']) && empty($form_state->getValue(['bundle', 'profile_name']))) { - $form_state->setErrorByName('bundle][profile_name', $this->t('To create a profile, please enter a profile name.')); - } - - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - $enabled_methods = array_filter($form_state->getValue('enabled')); - ksort($enabled_methods); - $method_weights = $form_state->getValue('weight'); - ksort($method_weights); - - $machine_name = $form_state->getValue(['bundle', 'machine_name']); - - // If this is a new bundle, create it. - if ($form_state->getValue(['bundle', 'bundle_select']) == self::NEW_BUNDLE_SELECT_VALUE) { - $bundle = $this->assigner->createBundleFromDefault($machine_name); - } - // Otherwise, load the current bundle and rename if needed. - else { - $bundle = $this->assigner->loadBundle(); - $old_name = $bundle->getMachineName(); - $new_name = $form_state->getValue(['bundle', 'machine_name']); - if ($old_name != $new_name) { - $bundle = $this->assigner->renameBundle($old_name, $new_name); - } - } - - $bundle->setName($form_state->getValue(['bundle', 'name'])); - $bundle->setDescription($form_state->getValue(['bundle', 'description'])); - $bundle->setEnabledAssignments(array_keys($enabled_methods)); - $bundle->setAssignmentWeights($method_weights); - $bundle->setIsProfile($form_state->getValue(['bundle', 'is_profile'])); - $bundle->setProfileName($form_state->getValue(['bundle', 'profile_name'])); - $bundle->save(); - $this->assigner->setBundle($bundle); - $this->assigner->setCurrent($bundle); - - $form_state->setRedirect('features.assignment'); - drupal_set_message($this->t('Package assignment configuration saved.')); - } - - /** - * Callback for machine_name exists() - * @param $value - * @param $element - * @param $form_state - * @return bool - */ - public function bundleExists($value, $element, $form_state) { - $bundle = $this->assigner->getBundle($value); - return isset($bundle); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentCoreForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentCoreForm.php deleted file mode 100644 index 0e186b814..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentCoreForm.php +++ /dev/null @@ -1,54 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - - $this->setConfigTypeSelect($form, $settings['types']['config'], $this->t('core')); - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_state->setValue('types', array_map('array_filter', $form_state->getValue('types'))); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in types selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $settings['types'] = $form_state->getValue('types'); - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - $this->setRedirect($form_state); - - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentExcludeForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentExcludeForm.php deleted file mode 100644 index 459bf7ce8..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentExcludeForm.php +++ /dev/null @@ -1,131 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $module_settings = $settings['module']; - $curated_settings = $settings['curated']; - - $this->setConfigTypeSelect($form, $settings['types']['config'], $this->t('exclude'), FALSE, - $this->t("Select types of configuration that should be excluded from packaging.")); - - $form['curated'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Exclude designated site-specific configuration'), - '#default_value' => $curated_settings, - '#description' => $this->t('Select this option to exclude a curated list of site-specific configuration from packaging.'), - ]; - - $form['module'] = [ - '#type' => 'fieldset', - '#tree' => TRUE, - '#title' => $this->t('Exclude configuration provided by modules'), - ]; - - $form['module']['installed'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Exclude installed module-provided entity configuration'), - '#default_value' => $module_settings['installed'], - '#description' => $this->t('Select this option to exclude configuration provided by INSTALLED modules from reassignment.'), - '#attributes' => [ - 'data-module-installed' => 'status', - ], - ]; - - $show_if_module_installed_checked = [ - 'visible' => [ - ':input[data-module-installed="status"]' => ['checked' => TRUE], - ], - ]; - - $info = system_get_info('module', drupal_get_profile()); - $form['module']['profile'] = [ - '#type' => 'checkbox', - '#title' => $this->t("Don't exclude install profile's configuration"), - '#default_value' => $module_settings['profile'], - '#description' => $this->t("Select this option to allow configuration provided by the site's install profile (%profile) to be reassigned.", ['%profile' => $info['name']]), - '#states' => $show_if_module_installed_checked, - ]; - - $bundle_name = $this->currentBundle->getMachineName(); - $bundle_name = !empty($bundle_name) ? $bundle_name : $this->t('none'); - $form['module']['namespace'] = [ - '#type' => 'checkbox', - '#title' => $this->t("Don't exclude non-installed configuration by namespace"), - '#default_value' => $module_settings['namespace'], - '#description' => $this->t("Select this option to allow configuration provided by uninstalled modules with the bundle namespace (%namespace_*) to be reassigned.", ['%namespace' => $bundle_name]), - '#states' => $show_if_module_installed_checked, - '#attributes' => [ - 'data-namespace' => 'status', - ], - ]; - - $show_if_namespace_checked = [ - 'visible' => [ - ':input[data-namespace="status"]' => ['checked' => TRUE], - ':input[data-module-installed="status"]' => ['checked' => TRUE], - ], - ]; - - $form['module']['namespace_any'] = [ - '#type' => 'checkbox', - '#title' => $this->t("Don't exclude ANY configuration by namespace"), - '#default_value' => $module_settings['namespace_any'], - '#description' => $this->t("Select this option to allow configuration provided by ANY modules with the bundle namespace (%namespace_*) to be reassigned. - Warning: Can cause installed configuration to be reassigned to different packages.", ['%namespace' => $bundle_name]), - '#states' => $show_if_namespace_checked, - ]; - - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_state->setValue('types', array_map('array_filter', $form_state->getValue('types'))); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $settings = array_merge($settings, [ - 'types' => $form_state->getValue('types'), - 'curated' => $form_state->getValue('curated'), - 'module' => $form_state->getValue('module'), - ]); - - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - - $this->setRedirect($form_state); - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentFormBase.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentFormBase.php deleted file mode 100644 index 9b7dca927..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentFormBase.php +++ /dev/null @@ -1,176 +0,0 @@ -featuresManager = $features_manager; - $this->assigner = $assigner; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('features.manager'), - $container->get('features_assigner'), - $container->get('entity_type.manager') - ); - } - - /** - * Adds configuration types checkboxes. - */ - protected function setConfigTypeSelect(&$form, $defaults, $type, $bundles_only = FALSE, $description = '') { - $options = $this->featuresManager->listConfigTypes($bundles_only); - - if (!isset($form['types'])) { - $form['types'] = [ - '#type' => 'container', - '#tree' => TRUE, - ]; - } - - $form['types']['config'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Configuration types'), - '#description' => !empty($description) ? $description : $this->t('Select types of configuration that should be considered @type types.', ['@type' => $type]), - '#options' => $options, - '#default_value' => $defaults, - ]; - } - - /** - * Adds content entity types checkboxes. - */ - protected function setContentTypeSelect(&$form, $defaults, $type, $exclude_has_config_bundles = TRUE) { - $entity_types = $this->entityTypeManager->getDefinitions(); - - $has_config_bundle = []; - foreach ($entity_types as $definition) { - if ($entity_type_id = $definition->getBundleOf()) { - $has_config_bundle[] = $entity_type_id; - } - } - $options = []; - - foreach ($entity_types as $entity_type_id => $entity_type) { - if (!$entity_type instanceof ContentEntityTypeInterface) { - continue; - } - if ($exclude_has_config_bundles && in_array($entity_type_id, $has_config_bundle)) { - continue; - } - $options[$entity_type_id] = $entity_type->getLabel() ?: $entity_type_id; - } - - // Sort the entity types by label. - uasort($options, 'strnatcasecmp'); - - if (!isset($form['types'])) { - $form['types'] = [ - '#type' => 'container', - '#tree' => TRUE, - ]; - } - - $form['types']['content'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Content entity types'), - '#description' => $this->t('Select content entity types that should be considered @type types.', ['@type' => $type]), - '#options' => $options, - '#default_value' => $defaults, - ]; - } - - /** - * Adds a "Save settings" submit action. - */ - protected function setActions(&$form, $method_id = NULL) { - $assignment_info = $this->assigner->getAssignmentMethods(); - if (isset($method_id) && isset($assignment_info[$method_id])) { - $method = $assignment_info[$method_id]; - $form['help_text'] = [ - '#markup' => $method['description'], - '#prefix' => '

', - '#suffix' => '

', - '#weight' => -99, - ]; - } - - $form['actions'] = ['#type' => 'actions']; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#button_type' => 'primary', - '#value' => $this->t('Save settings'), - ]; - $form['#attributes']['class'][] = 'features-assignment-settings-form'; - $form['#attached'] = [ - 'library' => [ - 'features_ui/drupal.features_ui.admin', - ]]; - } - - /** - * Redirects back to the Bundle config form. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - */ - protected function setRedirect(FormStateInterface $form_state) { - $form_state->setRedirect('features.assignment', ['bundle_name' => $this->currentBundle->getMachineName()]); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentOptionalForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentOptionalForm.php deleted file mode 100644 index 756fb5489..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentOptionalForm.php +++ /dev/null @@ -1,54 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - - $this->setConfigTypeSelect($form, $settings['types']['config'], $this->t('optional')); - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_state->setValue('types', array_map('array_filter', $form_state->getValue('types'))); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in types selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $settings['types'] = $form_state->getValue('types'); - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - $this->setRedirect($form_state); - - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentProfileForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentProfileForm.php deleted file mode 100644 index 88c86348d..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentProfileForm.php +++ /dev/null @@ -1,88 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - - $this->setConfigTypeSelect($form, $settings['types']['config'], $this->t('profile')); - - $form['curated'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Add commonly-needed configuration'), - '#default_value' => $settings['curated'], - '#description' => $this->t('Select this option to add a curated list of commonly-needed configuration including cron- and theme-related settings to the install profile.'), - ]; - - $standard_settings = $settings['standard']; - - $form['standard'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Crib from the Standard profile'), - '#tree' => TRUE, - ]; - $form['standard']['files'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Crib code'), - '#default_value' => $standard_settings['files'], - '#description' => $this->t('Select this option to add configuration and other files to the optional install profile from the Drupal core Standard install profile. Without these additions, a generated install profile will be missing some important initial setup.'), - ]; - $form['standard']['dependencies'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Crib dependencies'), - '#default_value' => $standard_settings['dependencies'], - '#description' => $this->t('Select this option to add module and theme dependencies from the Standard install profile.'), - ]; - - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_state->setValue('types', array_map('array_filter', $form_state->getValue('types'))); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - - $settings = array_merge($settings, [ - 'curated' => $form_state->getValue('curated'), - 'standard' => $form_state->getValue('standard'), - 'types' => $form_state->getValue('types'), - ]); - - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - $this->setRedirect($form_state); - - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentSiteForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentSiteForm.php deleted file mode 100644 index 443d1f945..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/AssignmentSiteForm.php +++ /dev/null @@ -1,54 +0,0 @@ -currentBundle = $this->assigner->loadBundle($bundle_name); - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - - $this->setConfigTypeSelect($form, $settings['types']['config'], $this->t('site')); - $this->setActions($form, self::METHOD_ID); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_state->setValue('types', array_map('array_filter', $form_state->getValue('types'))); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Merge in types selections. - $settings = $this->currentBundle->getAssignmentSettings(self::METHOD_ID); - $settings['types'] = $form_state->getValue('types'); - $this->currentBundle->setAssignmentSettings(self::METHOD_ID, $settings)->save(); - $this->setRedirect($form_state); - - drupal_set_message($this->t('Package assignment configuration saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesDiffForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesDiffForm.php deleted file mode 100644 index b04ca241a..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesDiffForm.php +++ /dev/null @@ -1,270 +0,0 @@ -featuresManager = $features_manager; - $this->assigner = $assigner; - $this->configDiff = $config_diff; - $this->diffFormatter = $diff_formatter; - $this->configRevert = $config_revert; - $this->diffFormatter->show_header = FALSE; - $this->diffFormatter->leading_context_lines = 0; - $this->diffFormatter->trailing_context_lines = 0; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('features.manager'), - $container->get('features_assigner'), - $container->get('config_update.config_diff'), - $container->get('diff.formatter'), - $container->get('features.config_update') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'features_diff_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $featurename = '') { - $current_bundle = $this->assigner->applyBundle(); - $packages = $this->featuresManager->getPackages(); - $form = []; - - $machine_name = ''; - if (!empty($featurename) && empty($packages[$featurename])) { - drupal_set_message($this->t('Feature @name does not exist.', ['@name' => $featurename]), 'error'); - return []; - } - elseif (!empty($featurename)) { - $machine_name = $packages[$featurename]->getMachineName(); - $packages = [$packages[$featurename]]; - } - else { - $packages = $this->featuresManager->filterPackages($packages, $current_bundle->getMachineName()); - } - - $header = [ - 'row' => [ - 'data' => !empty($machine_name) - ? $this->t('Differences in @name', ['@name' => $machine_name]) - : ($current_bundle->isDefault() ? $this->t('All differences') : $this->t('All differences in bundle: @bundle', ['@bundle' => $current_bundle->getName()])), - ], - ]; - - $options = []; - foreach ($packages as $package) { - if ($package->getStatus() != FeaturesManagerInterface::STATUS_NO_EXPORT) { - $missing = $this->featuresManager->reorderMissing($this->featuresManager->detectMissing($package)); - $overrides = $this->featuresManager->detectOverrides($package, TRUE); - if (!empty($overrides) || !empty($missing)) { - $options += [ - $package->getMachineName() => [ - 'row' => [ - 'data' => [ - '#type' => 'html_tag', - '#tag' => 'h2', - '#value' => Html::escape($package->getName()), - ], - ], - '#attributes' => [ - 'class' => 'features-diff-header', - ], - ], - ]; - $options += $this->diffOutput($package, $overrides, $missing); - } - } - } - - $form['diff'] = [ - '#type' => 'tableselect', - '#header' => $header, - '#options' => $options, - '#attributes' => ['class' => ['features-diff-listing']], - '#empty' => $this->t('No differences exist in exported features.'), - ]; - - $form['actions'] = ['#type' => 'actions', '#tree' => TRUE]; - $form['actions']['revert'] = [ - '#type' => 'submit', - '#value' => $this->t('Import changes'), - ]; - $form['actions']['help'] = [ - '#markup' => $this->t('Import the selected changes above into the active configuration.'), - ]; - - $form['#attached']['library'][] = 'system/diff'; - $form['#attached']['library'][] = 'features_ui/drupal.features_ui.admin'; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->assigner->assignConfigPackages(); - $config = $this->featuresManager->getConfigCollection(); - $items = array_filter($form_state->getValue('diff')); - if (empty($items)) { - drupal_set_message($this->t('No configuration was selected for import.'), 'warning'); - return; - } - foreach ($items as $config_name) { - if (isset($config[$config_name])) { - $item = $config[$config_name]; - $type = ConfigurationItem::fromConfigStringToConfigType($item->getType()); - $this->configRevert->revert($type, $item->getShortName()); - } - else { - $item = $this->featuresManager->getConfigType($config_name); - $type = ConfigurationItem::fromConfigStringToConfigType($item['type']); - $this->configRevert->import($type, $item['name_short']); - } - drupal_set_message($this->t('Imported @name', ['@name' => $config_name])); - } - } - - /** - * Returns a form element for the given overrides. - * - * @param \Drupal\features\Package $package - * A package. - * @param array $overrides - * An array of overrides. - * @param array $missing - * An array of missing config. - * - * @return array - * A form element. - */ - protected function diffOutput(Package $package, $overrides, $missing = []) { - $element = []; - $config = $this->featuresManager->getConfigCollection(); - $components = array_merge($missing, $overrides); - - $header = [ - ['data' => '', 'class' => 'diff-marker'], - ['data' => $this->t('Active site config'), 'class' => 'diff-context'], - ['data' => '', 'class' => 'diff-marker'], - ['data' => $this->t('Feature code config'), 'class' => 'diff-context'], - ]; - - foreach ($components as $name) { - $rows[] = [['data' => $name, 'colspan' => 4, 'header' => TRUE]]; - - if (!isset($config[$name])) { - $details = [ - '#markup' => $this->t('Component in feature missing from active config.'), - ]; - } - else { - $active = $this->featuresManager->getActiveStorage()->read($name); - $extension = $this->featuresManager->getExtensionStorages()->read($name); - if (empty($extension)) { - $details = [ - '#markup' => $this->t('Dependency detected in active config but not exported to the feature.'), - ]; - } - else { - $diff = $this->configDiff->diff($active, $extension); - $details = [ - '#type' => 'table', - '#header' => $header, - '#rows' => $this->diffFormatter->format($diff), - '#attributes' => ['class' => ['diff', 'features-diff']], - ]; - } - } - $element[$name] = [ - 'row' => [ - 'data' => [ - '#type' => 'details', - '#title' => Html::escape($name), - '#open' => TRUE, - '#description' => [ - 'data' => $details, - ], - ], - ], - '#attributes' => [ - 'class' => 'diff-' . $package->getMachineName(), - ], - ]; - } - - return $element; - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesEditForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesEditForm.php deleted file mode 100644 index 628087657..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesEditForm.php +++ /dev/null @@ -1,1091 +0,0 @@ -featuresManager = $features_manager; - $this->assigner = $assigner; - $this->generator = $generator; - $this->configRevert = $config_revert; - $this->excluded = []; - $this->required = []; - $this->conflicts = []; - $this->missing = []; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('features.manager'), - $container->get('features_assigner'), - $container->get('features_generator'), - $container->get('features.config_update') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'features_edit_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $featurename = '') { - $session = $this->getRequest()->getSession(); - $trigger = $form_state->getTriggeringElement(); - if ($trigger['#name'] == 'package') { - // Save current bundle name for later ajax callback. - $this->oldBundle = $this->bundle; - } - elseif ($trigger['#name'] == 'conflicts') { - if (isset($session)) { - $session->set('features_allow_conflicts', $form_state->getValue('conflicts')); - } - } - if (!$form_state->isValueEmpty('package')) { - $bundle_name = $form_state->getValue('package'); - $bundle = $this->assigner->getBundle($bundle_name); - } - else { - $bundle = $this->assigner->loadBundle(); - } - // Only store bundle name, not full object. - $this->bundle = $bundle->getMachineName(); - - $this->allowConflicts = FALSE; - if (isset($session)) { - $this->allowConflicts = $session->get('features_allow_conflicts', FALSE); - } - - // Pass the $force argument as TRUE because we want to include any excluded - // configuration items. These should show up as automatically assigned, but - // not selected, thus allowing the admin to reselect if desired. - // @see FeaturesManagerInterface::assignConfigPackage() - $this->assigner->assignConfigPackages(TRUE); - - $packages = $this->featuresManager->getPackages(); - if (empty($packages[$featurename])) { - $featurename = str_replace(['-', ' '], '_', $featurename); - $this->package = $this->featuresManager->initPackage($featurename, NULL, '', 'module', $bundle); - } - else { - $this->package = $packages[$featurename]; - } - - if (!empty($packages[$featurename]) && $this->package->getBundle() !== $this->bundle && $form_state->isValueEmpty('package')) { - // Make sure the current bundle matches what is stored in the package. - // But only do this if the Package value hasn't been manually changed. - $bundle = $this->assigner->getBundle($this->package->getBundle()); - if (empty($bundle)) { - // Create bundle if it doesn't exist yet - $bundle = $this->assigner->createBundleFromDefault($this->package->getBundle()); - } - $this->bundle = $bundle->getMachineName(); - $this->assigner->reset(); - $this->assigner->assignConfigPackages(TRUE); - $packages = $this->featuresManager->getPackages(); - $this->package = $packages[$featurename]; - } - - $form = [ - '#show_operations' => FALSE, - '#prefix' => '
', - '#suffix' => '
', - ]; - - $form['info'] = [ - '#type' => 'fieldset', - '#title' => $this->t('General Information'), - '#tree' => FALSE, - '#weight' => 2, - '#prefix' => "
", - '#suffix' => '
', - ]; - - $form['info']['name'] = [ - '#title' => $this->t('Name'), - '#description' => $this->t('Example: Image gallery') . ' (' . $this->t('Do not begin name with numbers.') . ')', - '#type' => 'textfield', - '#default_value' => $this->package->getName(), - ]; - if (!$bundle->isDefault()) { - $form['info']['name']['#description'] .= '
' . - $this->t('The namespace "@name_" will be prepended to the machine name', ['@name' => $bundle->getMachineName()]); - } - - $form['info']['machine_name'] = [ - '#type' => 'machine_name', - '#title' => $this->t('Machine-readable name'), - '#description' => $this->t('Example: image_gallery') . ' ' . $this->t('May only contain lowercase letters, numbers and underscores.'), - '#required' => TRUE, - '#default_value' => $bundle->getShortName($this->package->getMachineName()), - '#machine_name' => [ - 'source' => ['info', 'name'], - 'exists' => [$this, 'featureExists'], - ], - ]; - if (!$bundle->isDefault()) { - $form['info']['machine_name']['#description'] .= '
' . - $this->t('NOTE: Do NOT include the namespace prefix "@name_"; it will be added automatically.', ['@name' => $bundle->getMachineName()]); - } - - $form['info']['description'] = [ - '#title' => $this->t('Description'), - '#description' => $this->t('Provide a short description of what users should expect when they install your feature.'), - '#type' => 'textarea', - '#rows' => 3, - '#default_value' => $this->package->getDescription(), - ]; - - $form['info']['package'] = [ - '#title' => $this->t('Bundle'), - '#type' => 'select', - '#options' => $this->assigner->getBundleOptions(), - '#default_value' => $bundle->getMachineName(), - '#ajax' => [ - 'callback' => '::updateBundle', - 'wrapper' => 'features-export-info', - ], - ]; - - $form['info']['version'] = [ - '#title' => $this->t('Version'), - '#description' => $this->t('Examples: 8.x-1.0, 8.x-1.0-beta1'), - '#type' => 'textfield', - '#required' => FALSE, - '#default_value' => $this->package->getVersion(), - '#size' => 30, - ]; - - list($full_name, $path) = $this->featuresManager->getExportInfo($this->package, $bundle); - $form['info']['directory'] = [ - '#title' => $this->t('Path'), - '#description' => $this->t('Path to export package using Write action, relative to root directory.'), - '#type' => 'textfield', - '#required' => FALSE, - '#default_value' => $path, - '#size' => 30, - ]; - - $require_all = $this->package->getRequiredAll(); - $form['info']['require_all'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Mark all config as required'), - '#default_value' => $this->package->getRequiredAll(), - '#description' => $this->t('Required config will be assigned to this feature regardless of other assignment plugins.'), - ]; - - $form['conflicts'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Allow conflicts'), - '#default_value' => $this->allowConflicts, - '#description' => $this->t('Allow configuration to be exported to more than one feature.'), - '#weight' => 8, - '#ajax' => [ - 'callback' => '::updateForm', - 'wrapper' => 'features-edit-wrapper', - ], - ]; - - $generation_info = []; - if (\Drupal::currentUser()->hasPermission('export configuration')) { - // Offer available generation methods. - $generation_info = $this->generator->getGenerationMethods(); - // Sort generation methods by weight. - uasort($generation_info, '\Drupal\Component\Utility\SortArray::sortByWeightElement'); - } - - $form['actions'] = ['#type' => 'actions', '#tree' => TRUE]; - foreach ($generation_info as $method_id => $method) { - $form['actions'][$method_id] = [ - '#type' => 'submit', - '#name' => $method_id, - '#value' => $this->t('@name', ['@name' => $method['name']]), - '#attributes' => [ - 'title' => Html::escape($method['description']), - ], - ]; - } - - // Build the Component Listing panel on the right. - $form['export'] = $this->buildComponentList($form_state); - - if (!empty($this->missing)) { - if ($this->allowConflicts) { - $form['actions']['#prefix'] = '' . - $this->t('WARNING: Package contains configuration missing from site.') . '
' . - $this->t('This configuration will be removed if you export it.') . - '
'; - } - else { - foreach ($generation_info as $method_id => $method) { - unset($form['actions'][$method_id]); - } - $form['actions']['#prefix'] = '' . - $this->t('Package contains configuration missing from site.') . '
' . - $this->t('Import the feature to create the missing config before you can export it.') . '
' . - $this->t('Or, enable the Allow Conflicts option above.') . - '
'; - } - $form['actions']['import_missing'] = [ - '#type' => 'submit', - '#name' => 'import_missing', - '#value' => $this->t('Import Missing'), - '#attributes' => [ - 'title' => $this->t('Import only the missing configuration items.'), - ], - ]; - } - - $form['#attached'] = [ - 'library' => [ - 'features_ui/drupal.features_ui.admin', - ], - 'drupalSettings' => [ - 'features' => [ - 'excluded' => $this->excluded, - 'required' => $this->required, - 'conflicts' => $this->conflicts, - 'autodetect' => TRUE, - ], - ], - ]; - - return $form; - } - - /** - * Provides an ajax callback for handling conflict checkbox. - */ - public function updateForm($form, FormStateInterface $form_state) { - return $form; - } - - /** - * Provides an ajax callback for handling switching the bundle selector. - */ - public function updateBundle($form, FormStateInterface $form_state) { - $old_bundle = $this->assigner->getBundle($this->oldBundle); - $bundle_name = $form_state->getValue('package'); - $bundle = $this->assigner->getBundle($bundle_name); - if (isset($bundle) && isset($old_bundle)) { - $short_name = $old_bundle->getShortName($this->package->getMachineName()); - if ($bundle->isDefault()) { - $short_name = $old_bundle->getFullName($short_name); - } - $this->package->setMachineName($bundle->getFullName($short_name)); - $form['info']['machine_name']['#value'] = $bundle->getShortName($this->package->getMachineName()); - } - return $form['info']; - } - - /** - * Callback for machine_name exists() - * @param $value - * @param $element - * @param $form_state - * @return bool - */ - public function featureExists($value, $element, $form_state) { - $bundle = $this->assigner->getBundle($this->bundle); - $value = $bundle->getFullName($value); - $packages = $this->featuresManager->getPackages(); - // A package may conflict only if it's been exported. - return (isset($packages[$value]) && ($packages[$value]->getState() !== FeaturesManagerInterface::STATUS_NO_EXPORT)) || \Drupal::moduleHandler()->moduleExists($value); - } - - /** - * Returns the render array elements for the Components selection on the Edit - * form. - */ - protected function buildComponentList(FormStateInterface $form_state) { - $element = [ - '#type' => 'fieldset', - '#title' => $this->t('Components'), - '#description' => $this->t('Expand each component section and select which items should be included in this feature export.'), - '#tree' => FALSE, - '#prefix' => "
", - '#suffix' => '
', - '#weight' => 1, - ]; - - // Filter field used in javascript, so javascript will unhide it. - $element['features_filter_wrapper'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Filters'), - '#tree' => FALSE, - '#prefix' => "
", - '#suffix' => '
', - '#weight' => -10, - ]; - $element['features_filter_wrapper']['features_filter'] = [ - '#type' => 'textfield', - '#title' => $this->t('Search'), - '#hidden' => TRUE, - '#default_value' => '', - '#suffix' => "" . $this->t('Clear') . "", - ]; - $element['features_filter_wrapper']['checkall'] = [ - '#type' => 'checkbox', - '#default_value' => FALSE, - '#hidden' => TRUE, - '#title' => $this->t('Select all'), - '#attributes' => [ - 'class' => ['features-checkall'], - ], - ]; - - $sections = ['included', 'detected', 'added']; - $config_types = $this->featuresManager->listConfigTypes(); - - // Generate the export array for the current feature and user selections. - $export = $this->getComponentList($form_state); - - foreach ($export['components'] as $component => $component_info) { - - $component_items_count = count($component_info['_features_options']['sources']); - $label = new FormattableMarkup('@component (@count)', - [ - '@component' => $config_types[$component], - '@count' => $component_items_count, - ] - ); - - $count = 0; - foreach ($sections as $section) { - $count += count($component_info['_features_options'][$section]); - } - $extra_class = ($count == 0) ? 'features-export-empty' : ''; - $component_name = str_replace('_', '-', Html::escape($component)); - - if ($count + $component_items_count > 0) { - $element[$component] = [ - '#markup' => '', - '#tree' => TRUE, - ]; - - $element[$component]['sources'] = [ - '#type' => 'details', - '#title' => $label, - '#tree' => TRUE, - '#open' => FALSE, - '#attributes' => ['class' => ['features-export-component']], - '#prefix' => "
", - ]; - $element[$component]['sources']['selected'] = [ - '#type' => 'checkboxes', - '#id' => "edit-sources-$component_name", - '#options' => $this->domDecodeOptions($component_info['_features_options']['sources']), - '#default_value' => $this->domDecodeOptions($component_info['_features_selected']['sources'], FALSE), - '#attributes' => ['class' => ['component-select']], - '#prefix' => "", - '#suffix' => '', - ]; - - $element[$component]['before-list'] = [ - '#markup' => "
", - ]; - - foreach ($sections as $section) { - $element[$component][$section] = [ - '#type' => 'checkboxes', - '#options' => !empty($component_info['_features_options'][$section]) ? - $this->domDecodeOptions($component_info['_features_options'][$section]) : [], - '#default_value' => !empty($component_info['_features_selected'][$section]) ? - $this->domDecodeOptions($component_info['_features_selected'][$section], FALSE) : [], - '#attributes' => ['class' => ['component-' . $section]], - '#prefix' => "", - '#suffix' => '', - ]; - } - - // Close both the before-list as well as the sources div. - $element[$component]['after-list'] = [ - '#markup' => "
", - ]; - } - } - - $element['features_missing'] = [ - '#theme' => 'item_list', - '#items' => $export['missing'], - '#title' => $this->t('Configuration missing from active site:'), - '#suffix' => '
' . - $this->t('Import the feature to create the missing config listed above.') . - '
', - ]; - - $element['features_legend'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Legend'), - '#tree' => FALSE, - '#prefix' => "
", - '#suffix' => '
', - ]; - $element['features_legend']['legend'] = [ - '#markup' => - "" . $this->t('Normal') . " " . - "" . $this->t('Added') . " " . - "" . $this->t('Auto detected') . " " . - "" . $this->t('Conflict') . " ", - ]; - - return $element; - } - - /** - * Returns the full feature export array based upon user selections in - * form_state. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * Optional form_state information for user selections. Can be updated to - * reflect new selection status. - * - * @return \Drupal\features\Package - * New export array to be exported - * array['components'][$component_name] = $component_info - * $component_info['_features_options'][$section] is list of available options - * $component_info['_features_selected'][$section] is option state TRUE/FALSE - * $section = array('sources', included', 'detected', 'added') - * sources - options that are available to be added to the feature - * included - options that have been previously exported to the feature - * detected - options that have been auto-detected - * added - newly added options to the feature - * - * NOTE: This routine gets a bit complex to handle all of the different - * possible user checkbox selections and de-selections. - * Cases to test: - * 1a) uncheck Included item -> mark as Added but unchecked - * 1b) re-check unchecked Added item -> return it to Included check item - * 2a) check Sources item -> mark as Added and checked - * 2b) uncheck Added item -> return it to Sources as unchecked - * 3a) uncheck Included item that still exists as auto-detect -> mark as - * Detected but unchecked - * 3b) re-check Detected item -> return it to Included and checked - * 4a) check Sources item should also add any auto-detect items as Detected - * and checked - * 4b) uncheck Sources item with auto-detect and auto-detect items should - * return to Sources and unchecked - * 5a) uncheck a Detected item -> refreshing page should keep it as - * unchecked Detected - * 6) when nothing changes, refresh should not change any state - * 7) should never see an unchecked Included item - */ - protected function getComponentList(FormStateInterface $form_state) { - $config = $this->featuresManager->getConfigCollection(); - - $package_name = $this->package->getMachineName(); - // Auto-detect dependencies for included config. - $package_config = $this->package->getConfig(); - if (!empty($this->package->getConfigOrig())) { - $package_config = array_unique(array_merge($package_config, $this->package->getConfigOrig())); - } - if (!empty($package_config)) { - $this->featuresManager->assignConfigDependents($package_config, $package_name); - } - - $packages = $this->featuresManager->getPackages(); - // Re-fetch the package in case config was updated with Dependents above. - $this->package = $packages[$package_name]; - - // Make a map of all config data. - $components = []; - $this->conflicts = []; - foreach ($config as $item_name => $item) { - if (($item->getPackage() != $package_name) && - !empty($packages[$item->getPackage()]) && ($packages[$item->getPackage()]->getStatus() != FeaturesManagerInterface::STATUS_NO_EXPORT)) { - $this->conflicts[$item->getType()][$item->getShortName()] = $item->getLabel(); - } - if ($this->allowConflicts - || !isset($this->conflicts[$item->getType()][$item->getShortName()]) - || ($this->package->getConfigOrig() && in_array($item_name, $this->package->getConfigOrig()))) { - $components[$item->getType()][$item->getShortName()] = $item->getLabel(); - } - } - - // Make a map of the config data already exported to the Feature. - $this->missing = []; - $exported_features_info = []; - foreach ($this->package->getConfigOrig() as $item_name) { - // Make sure the extension provided item exists in the active - // configuration storage. - if (isset($config[$item_name])) { - $item = $config[$item_name]; - // Remove any conflicts if those are not being allowed. - // if ($this->allowConflicts || !isset($this->conflicts[$item['type']][$item['name_short']])) { - $exported_features_info[$item->getType()][$item->getShortName()] = $item->getLabel(); - // } - } - else { - $this->missing[] = $item_name; - } - } - $exported_features_info['dependencies'] = $this->package->getDependencyInfo(); - - // Make a map of any config specifically excluded and/or required. - foreach (['excluded', 'required'] as $constraint) { - $this->{$constraint} = []; - $info = !empty($this->package->{'get' . $constraint}()) ? $this->package->{'get' . $constraint}() : []; - // $info may be boolean. - if (is_array($info)) { - foreach ($info as $item_name) { - if (!isset($config[$item_name])) { - continue; - } - $item = $config[$item_name]; - $this->{$constraint}[$item->getType()][$item->getShortName()] = $item->getLabel(); - } - } - } - - // Make a map of the config data to be exported within the Feature. - $new_features_info = []; - foreach ($this->package->getConfig() as $item_name) { - $item = $config[$item_name]; - $new_features_info[$item->getType()][$item->getShortName()] = $item->getLabel(); - } - $new_features_info['dependencies'] = $this->package->getDependencies(); - - // Assemble the combined component list. - $config_new = []; - $sections = ['sources', 'included', 'detected', 'added']; - - // Generate list of config to be exported. - $config_count = []; - foreach ($components as $component => $component_info) { - // User-selected components take precedence. - $config_new[$component] = []; - $config_count[$component] = 0; - // Add selected items from Sources checkboxes. - if (!$form_state->isValueEmpty([$component, 'sources', 'selected'])) { - $config_new[$component] = array_merge($config_new[$component], $this->domDecodeOptions(array_filter($form_state->getValue([ - $component, - 'sources', - 'selected', - ])))); - $config_count[$component]++; - } - // Add selected items from already Included, newly Added, auto-detected - // checkboxes. - foreach (['included', 'added', 'detected'] as $section) { - if (!$form_state->isValueEmpty([$component, $section])) { - $config_new[$component] = array_merge($config_new[$component], $this->domDecodeOptions(array_filter($form_state->getValue([$component, $section])))); - $config_count[$component]++; - } - } - // Only fallback to an existing feature's values if there are no export - // options for the component. - if ($component == 'dependencies') { - if (($config_count[$component] == 0) && !empty($exported_features_info['dependencies'])) { - $config_new[$component] = array_combine($exported_features_info['dependencies'], $exported_features_info['dependencies']); - } - } - elseif (($config_count[$component] == 0) && !empty($exported_features_info[$component])) { - $config_names = array_keys($exported_features_info[$component]); - $config_new[$component] = array_combine($config_names, $config_names); - } - } - - // Generate new populated feature. - $export['package'] = $this->package; - $export['config_new'] = $config_new; - - // Now fill the $export with categorized sections of component options - // based upon user selections and de-selections. - foreach ($components as $component => $component_info) { - $component_export = $component_info; - foreach ($sections as $section) { - $component_export['_features_options'][$section] = []; - $component_export['_features_selected'][$section] = []; - } - if (!empty($component_info)) { - $exported_components = !empty($exported_features_info[$component]) ? $exported_features_info[$component] : []; - $new_components = !empty($new_features_info[$component]) ? $new_features_info[$component] : []; - - foreach ($component_info as $key => $label) { - $config_name = $this->featuresManager->getFullName($component, $key); - // If checkbox in Sources is checked, move it to Added section. - if (!$form_state->isValueEmpty([$component, 'sources', 'selected', $key])) { - $form_state->setValue([$component, 'sources', 'selected', $key], FALSE); - $form_state->setValue([$component, 'added', $key], 1); - $component_export['_features_options']['added'][$key] = $this->configLabel($component, $key, $label); - $component_export['_features_selected']['added'][$key] = $key; - // If this was previously excluded, we don't need to set it as - // required because it was automatically assigned. - if (isset($this->excluded[$component][$key])) { - unset($this->excluded[$component][$key]); - } - else { - $this->required[$component][$key] = $key; - } - } - elseif (isset($new_components[$key]) || isset($config_new[$component][$key])) { - // Option is in the New exported array. - if (isset($exported_components[$key])) { - // Option was already previously exported so it's part of the - // Included checkboxes. - $section = 'included'; - $default_value = $key; - // If Included item was un-selected (removed from export - // $config_new) but was re-detected in the $new_components - // means it was an auto-detect that was previously part of the - // export and is now de-selected in UI. - if ($form_state->isSubmitted() && - ($form_state->hasValue([$component, 'included', $key]) || - ($form_state->isValueEmpty([$component, 'detected', $key]))) && - empty($config_new[$component][$key])) { - $section = 'detected'; - $default_value = FALSE; - } - // Unless it's unchecked in the form, then move it to Newly - // disabled item. - elseif ($form_state->isSubmitted() && - $form_state->isValueEmpty([$component, 'added', $key]) && - $form_state->isValueEmpty([$component, 'detected', $key]) && - $form_state->isValueEmpty([$component, 'included', $key])) { - $section = 'added'; - $default_value = FALSE; - } - } - else { - // Option was in New exported array, but NOT in already exported - // so it's a user-selected or an auto-detect item. - $section = 'detected'; - $default_value = NULL; - // Check for item explicitly excluded. - if (isset($this->excluded[$component][$key]) && !$form_state->isSubmitted()) { - $default_value = FALSE; - } - else { - $default_value = $key; - } - // If it's already checked in Added or Sources, leave it in Added - // as checked. - if ($form_state->isSubmitted() && - (!$form_state->isValueEmpty([$component, 'added', $key]) || - !$form_state->isValueEmpty([$component, 'sources', 'selected', $key]))) { - $section = 'added'; - $default_value = $key; - } - // If it's already been unchecked, leave it unchecked. - elseif ($form_state->isSubmitted() && - $form_state->isValueEmpty([$component, 'sources', 'selected', $key]) && - $form_state->isValueEmpty([$component, 'detected', $key]) && - !$form_state->hasValue([$component, 'added', $key])) { - $section = 'detected'; - $default_value = FALSE; - } - } - $component_export['_features_options'][$section][$key] = $this->configLabel($component, $key, $label); - $component_export['_features_selected'][$section][$key] = $default_value; - // Save which dependencies are specifically excluded from - // auto-detection. - if (($section == 'detected') && ($default_value === FALSE)) { - // If this was previously required, we don't need to set it as - // excluded because it wasn't automatically assigned. - if (!isset($this->required[$component][$key]) || ($this->package->getRequired() === TRUE)) { - $this->excluded[$component][$key] = $key; - } - unset($this->required[$component][$key]); - // Remove excluded item from export. - if ($component == 'dependencies') { - $export['package']->removeDependency($key); - } - else { - $export['package']->removeConfig($config_name); - } - } - else { - unset($this->excluded[$component][$key]); - } - // Remove the 'input' and set the 'values' so Drupal stops looking - // at 'input'. - if ($form_state->isSubmitted()) { - if (!$default_value) { - $form_state->setValue([$component, $section, $key], FALSE); - } - else { - $form_state->setValue([$component, $section, $key], 1); - } - } - } - elseif (!$form_state->isSubmitted() && isset($exported_components[$key])) { - // Component is not part of new export, but was in original export. - // Mark component as Added when creating initial form. - $component_export['_features_options']['added'][$key] = $this->configLabel($component, $key, $label); - $component_export['_features_selected']['added'][$key] = $key; - } - else { - // Option was not part of the new export. - $added = FALSE; - foreach (['included', 'added'] as $section) { - // Restore any user-selected checkboxes. - if (!$form_state->isValueEmpty([$component, $section, $key])) { - $component_export['_features_options'][$section][$key] = $this->configLabel($component, $key, $label); - $component_export['_features_selected'][$section][$key] = $key; - $added = TRUE; - } - } - if (!$added) { - // If not Included or Added, then put it back in the unchecked - // Sources checkboxes. - $component_export['_features_options']['sources'][$key] = $this->configLabel($component, $key, $label); - $component_export['_features_selected']['sources'][$key] = FALSE; - } - } - } - } - $export['components'][$component] = $component_export; - } - $export['features_exclude'] = $this->excluded; - $export['features_require'] = $this->required; - $export['conflicts'] = $this->conflicts; - $export['missing'] = $this->missing; - - return $export; - } - - /** - * Returns a formatted and sanitized label for a config item. - * - * @param string $type - * The config type. - * @param string $key - * The short machine name of the item. - * @param string $label - * The human label for the item. - */ - protected function configLabel($type, $key, $label) { - $value = Html::escape($label); - if ($key != $label) { - $value .= ' (' . Html::escape($key) . ')'; - } - if (isset($this->conflicts[$type][$key])) { - // Show what package the conflict is stored in. - $config = $this->featuresManager->getConfigCollection(); - $config_name = $this->featuresManager->getFullName($type, $key); - $package_name = isset($config[$config_name]) ? $config[$config_name]->getPackage() : ''; - // Get the full machine name instead of the short name. - $packages = $this->featuresManager->getPackages(); - if (isset($packages[$package_name])) { - $package_name = $packages[$package_name]->getMachineName(); - } - $value .= ' [' . $this->t('in') . ' ' . Html::escape($package_name) . ']'; - } - return Xss::filterAdmin($value); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $bundle = $this->assigner->getBundle($this->bundle); - $this->assigner->assignConfigPackages(); - - $this->package->setName($form_state->getValue('name')); - $this->package->setMachineName($form_state->getValue('machine_name')); - $this->package->setDescription($form_state->getValue('description')); - $this->package->setVersion($form_state->getValue('version')); - $this->package->setDirectory($form_state->getValue('directory')); - $this->package->setBundle($bundle->getMachineName()); - // Save it first just to create it in case it's a new package. - $this->featuresManager->setPackage($this->package); - - $config = $this->updatePackageConfig($form_state); - $this->featuresManager->assignConfigPackage($this->package->getMachineName(), $config, TRUE); - $this->package->setExcluded($this->updateExcluded()); - if ($form_state->getValue('require_all')) { - $this->package->setRequired(TRUE); - } - else { - $required = $this->updateRequired(); - $this->package->setRequired($required); - } - // Now save it with the selected config data. - $this->featuresManager->setPackage($this->package); - - $method_id = NULL; - $trigger = $form_state->getTriggeringElement(); - $op = $form_state->getValue('op'); - if (!empty($trigger) && empty($op)) { - $method_id = $trigger['#name']; - } - - // Set default redirect, but allow generators to change it later. - $form_state->setRedirect('features.edit', ['featurename' => $this->package->getMachineName()]); - if ($method_id == 'import_missing') { - $this->importMissing(); - } - elseif (!empty($method_id)) { - $packages = [$this->package->getMachineName()]; - $this->generator->generatePackages($method_id, $bundle, $packages); - $this->generator->applyExportFormSubmit($method_id, $form, $form_state); - } - - $this->assigner->setCurrent($bundle); - } - - /** - * Updates the config stored in the package from the current edit form. - * - * @return array - * Config array to be exported. - */ - protected function updatePackageConfig(FormStateInterface $form_state) { - $config = []; - $components = $this->getComponentList($form_state); - foreach ($components['config_new'] as $config_type => $items) { - foreach ($items as $name) { - $config[] = $this->featuresManager->getFullName($config_type, $name); - } - } - return $config; - } - - /** - * Imports the configuration missing from the active store - */ - protected function importMissing() { - $config = $this->featuresManager->getConfigCollection(); - $missing = $this->featuresManager->reorderMissing($this->missing); - foreach ($missing as $config_name) { - if (!isset($config[$config_name])) { - $item = $this->featuresManager->getConfigType($config_name); - $type = ConfigurationItem::fromConfigStringToConfigType($item['type']); - try { - $this->configRevert->import($type, $item['name_short']); - drupal_set_message($this->t('Imported @name', ['@name' => $config_name])); - } catch (\Exception $e) { - drupal_set_message($this->t('Error importing @name : @message', - ['@name' => $config_name, '@message' => $e->getMessage()]), 'error'); - } - } - } - } - - /** - * Updates the list of excluded config. - * - * @return array - * The list of excluded config in a simple array of full config names - * suitable for storing in the info.yml file. - */ - protected function updateExcluded() { - return $this->updateConstrained('excluded'); - } - - /** - * Updates the list of required config. - * - * @return array - * The list of required config in a simple array of full config names - * suitable for storing in the info.yml file. - */ - protected function updateRequired() { - return $this->updateConstrained('required'); - } - - /** - * Returns a list of constrained (excluded or required) configuration. - * - * @param string $constraint - * The constraint (excluded or required). - * @return array - * The list of constrained config in a simple array of full config names - * suitable for storing in the info.yml file. - */ - protected function updateConstrained($constraint) { - $constrained = []; - foreach ($this->{$constraint} as $type => $item) { - foreach ($item as $name => $value) { - $constrained[] = $this->featuresManager->getFullName($type, $name); - } - } - return $constrained; - } - - /** - * Encodes a given key. - * - * @param string $key - * The key to encode. - * - * @return string - * The encoded key. - */ - protected function domEncode($key) { - $replacements = $this->domEncodeMap(); - return strtr($key, $replacements); - } - - /** - * Decodes a given key. - * - * @param string $key - * The key to decode. - * - * @return string - * The decoded key. - */ - protected function domDecode($key) { - $replacements = array_flip($this->domEncodeMap()); - return strtr($key, $replacements); - } - - /** - * Decodes an array of option values that have been encoded by - * features_dom_encode_options(). - * - * @param array $options - * The key to encode. - * @param bool $keys_only - * Whether to decode only the keys. - * - * @return array - * An array of encoded options. - */ - protected function domDecodeOptions(array $options, $keys_only = FALSE) { - $replacements = array_flip($this->domEncodeMap()); - $encoded = []; - foreach ($options as $key => $value) { - $encoded[strtr($key, $replacements)] = $keys_only ? $value : strtr($value, $replacements); - } - return $encoded; - } - - /** - * Returns encoding map for decode and encode options. - * - * @return array - * An encoding map. - */ - protected function domEncodeMap() { - return [ - ':' => '__' . ord(':') . '__', - '/' => '__' . ord('/') . '__', - ',' => '__' . ord(',') . '__', - '.' => '__' . ord('.') . '__', - '<' => '__' . ord('<') . '__', - '>' => '__' . ord('>') . '__', - '%' => '__' . ord('%') . '__', - ')' => '__' . ord(')') . '__', - '(' => '__' . ord('(') . '__', - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesExportForm.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesExportForm.php deleted file mode 100644 index bed30b10e..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Form/FeaturesExportForm.php +++ /dev/null @@ -1,561 +0,0 @@ -featuresManager = $features_manager; - $this->assigner = $assigner; - $this->generator = $generator; - $this->moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('features.manager'), - $container->get('features_assigner'), - $container->get('features_generator'), - $container->get('module_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'features_export_form'; - } - - /** - * Detects if an element triggered the form submission via Ajax. - * TODO: SHOULDN'T NEED THIS! BUT DRUPAL IS CALLING buildForm AFTER THE - * BUNDLE AJAX IS SELECTED AND DOESN'T HAVE getTriggeringElement() SET YET. - */ - protected function elementTriggeredScriptedSubmission(FormStateInterface &$form_state) { - $input = $form_state->getUserInput(); - if (!empty($input['_triggering_element_name'])) { - return $input['_triggering_element_name']; - } - return ''; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $trigger = $form_state->getTriggeringElement(); - // TODO: See if there is a Drupal Core issue for this. - // Sometimes the first ajax call on the page causes buildForm to be called - // twice! First time form_state->getTriggeringElement is NOT SET, but - // the form_state['input'] shows the _triggering_element_name. Then the - // SECOND time it is called the getTriggeringElement is fine. - $real_trigger = $this->elementTriggeredScriptedSubmission($form_state); - if (!isset($trigger) && ($real_trigger == 'bundle')) { - $input = $form_state->getUserInput(); - $bundle_name = $input['bundle']; - $this->assigner->setCurrent($this->assigner->getBundle($bundle_name)); - } - elseif ($trigger['#name'] == 'bundle') { - $bundle_name = $form_state->getValue('bundle', ''); - $this->assigner->setCurrent($this->assigner->getBundle($bundle_name)); - } - else { - $this->assigner->loadBundle(); - } - $current_bundle = $this->assigner->getBundle(); - $this->assigner->assignConfigPackages(); - - $packages = $this->featuresManager->getPackages(); - $config_collection = $this->featuresManager->getConfigCollection(); - - // Add in un-packaged configuration items. - $this->addUnpackaged($packages, $config_collection); - - $packages = $this->featuresManager->filterPackages($packages, $current_bundle->getMachineName()); - - // Pass the packages and bundle data for use in the form pre_render - // callback. - $form['#packages'] = $packages; - $form['#profile_package'] = $current_bundle->getProfileName(); - $form['header'] = [ - '#type' => 'container', - '#attributes' => ['class' => 'features-header'], - ]; - - $bundle_options = $this->assigner->getBundleOptions(); - - // If there are no custom bundles, provide message. - if (count($bundle_options) < 2) { - drupal_set_message($this->t('You have not yet created any bundles. Before generating features, you may wish to create a bundle to group your features within.', [':create' => Url::fromRoute('features.assignment')->toString()])); - } - - $form['#prefix'] = '
'; - $form['#suffix'] = '
'; - $form['header']['bundle'] = [ - '#title' => $this->t('Bundle'), - '#type' => 'select', - '#options' => $bundle_options, - '#default_value' => $current_bundle->getMachineName(), - '#prefix' => '
', - '#suffix' => '
', - '#ajax' => [ - 'callback' => '::updatePreview', - 'wrapper' => 'edit-features-preview-wrapper', - ], - '#attributes' => [ - 'data-new-package-set' => 'status', - ], - ]; - - $form['preview'] = $this->buildListing($packages, $current_bundle); - - $form['#attached'] = [ - 'library' => [ - 'features_ui/drupal.features_ui.admin', - ], - ]; - - if (\Drupal::currentUser()->hasPermission('export configuration')) { - // Offer available generation methods. - $generation_info = $this->generator->getGenerationMethods(); - // Sort generation methods by weight. - uasort($generation_info, '\Drupal\Component\Utility\SortArray::sortByWeightElement'); - - $form['description'] = [ - '#markup' => '

' . $this->t('Use an export method button below to generate the selected features.') . '

', - ]; - - $form['actions'] = ['#type' => 'actions', '#tree' => TRUE]; - foreach ($generation_info as $method_id => $method) { - $form['actions'][$method_id] = [ - '#type' => 'submit', - '#name' => $method_id, - '#value' => $this->t('@name', ['@name' => $method['name']]), - '#attributes' => [ - 'title' => Html::escape($method['description']), - ], - ]; - } - } - - $form['#pre_render'][] = [get_class($this), 'preRenderRemoveInvalidCheckboxes']; - - return $form; - } - - /** - * Handles switching the configuration type selector. - */ - public function updatePreview($form, FormStateInterface $form_state) { - // We should really be able to add this pre_render callback to the - // 'preview' element. However, since doing so leads to an error (no rows - // are displayed), we need to instead explicitly invoke it here for the - // processing to apply to the Ajax-rendered form element. - $form = $this->preRenderRemoveInvalidCheckboxes($form); - return $form['preview']; - } - - /** - * Builds the portion of the form showing a listing of features. - * - * @param \Drupal\features\Package[] $packages - * The packages. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * The current bundle - * - * @return array - * A render array of a form element. - */ - protected function buildListing(array $packages, FeaturesBundleInterface $bundle) { - - $header = [ - 'name' => ['data' => $this->t('Feature')], - 'machine_name' => ['data' => $this->t('')], - 'details' => ['data' => $this->t('Description'), 'class' => [RESPONSIVE_PRIORITY_LOW]], - 'version' => ['data' => $this->t('Version'), 'class' => [RESPONSIVE_PRIORITY_LOW]], - 'status' => ['data' => $this->t('Status'), 'class' => [RESPONSIVE_PRIORITY_LOW]], - 'state' => ['data' => $this->t('State'), 'class' => [RESPONSIVE_PRIORITY_LOW]], - ]; - - $options = []; - $first = TRUE; - foreach ($packages as $package) { - if ($first && $package->getStatus() == FeaturesManagerInterface::STATUS_NO_EXPORT) { - // Don't offer new non-profile packages that are empty. - if ($package->getStatus() === FeaturesManagerInterface::STATUS_NO_EXPORT && - !$bundle->isProfilePackage($package->getMachineName()) && - empty($package->getConfig())) { - continue; - } - $first = FALSE; - $options[] = [ - 'name' => [ - 'data' => $this->t('The following packages are not exported.'), - 'class' => 'features-export-header-row', - 'colspan' => 6, - ], - ]; - } - $options[$package->getMachineName()] = $this->buildPackageDetail($package, $bundle); - } - - $element = [ - '#type' => 'tableselect', - '#header' => $header, - '#options' => $options, - '#attributes' => ['class' => ['features-listing']], - '#prefix' => '
', - '#suffix' => '
', - ]; - - return $element; - } - - /** - * Builds the details of a package. - * - * @param \Drupal\features\Package $package - * The package. - * @param \Drupal\features\FeaturesBundleInterface - * The current bundle. - * - * @return array - * A render array of a form element. - */ - protected function buildPackageDetail(Package $package, FeaturesBundleInterface $bundle) { - $config_collection = $this->featuresManager->getConfigCollection(); - - $url = Url::fromRoute('features.edit', ['featurename' => $package->getMachineName()]); - - $element['name'] = [ - 'data' => \Drupal::l($package->getName(), $url), - 'class' => ['feature-name'], - ]; - $machine_name = $package->getMachineName(); - // Except for the 'unpackaged' pseudo-package, display the full name, since - // that's what will be generated. - if ($machine_name !== 'unpackaged') { - $machine_name = $bundle->getFullName($machine_name); - } - $element['machine_name'] = $machine_name; - $element['status'] = [ - 'data' => $this->featuresManager->statusLabel($package->getStatus()), - 'class' => ['column-nowrap'], - ]; - // Use 'data' instead of plain string value so a blank version doesn't - // remove column from table. - $element['version'] = [ - 'data' => Html::escape($package->getVersion()), - 'class' => ['column-nowrap'], - ]; - $overrides = $this->featuresManager->detectOverrides($package); - $new_config = $this->featuresManager->detectNew($package); - $conflicts = []; - $missing = []; - $moved = []; - - if ($package->getStatus() == FeaturesManagerInterface::STATUS_NO_EXPORT) { - $overrides = []; - $new_config = []; - } - // Bundle package configuration by type. - $package_config = []; - foreach ($package->getConfig() as $item_name) { - if (isset($config_collection[$item_name])) { - $item = $config_collection[$item_name]; - $package_config[$item->getType()][] = [ - 'name' => Html::escape($item_name), - 'label' => Html::escape($item->getLabel()), - 'class' => in_array($item_name, $overrides) ? 'features-override' : - (in_array($item_name, $new_config) ? 'features-detected' : ''), - ]; - } - } - // Conflict config from other modules. - foreach ($package->getConfigOrig() as $item_name) { - if (!isset($config_collection[$item_name])) { - $missing[] = $item_name; - $package_config['missing'][] = [ - 'name' => Html::escape($item_name), - 'label' => Html::escape($item_name), - 'class' => 'features-missing', - ]; - } - elseif (!in_array($item_name, $package->getConfig())) { - $item = $config_collection[$item_name]; - if (empty($item->getProvider())) { - $conflicts[] = $item_name; - $package_name = !empty($item->getPackage()) ? $item->getPackage() : $this->t('PACKAGE NOT ASSIGNED'); - $package_config[$item->getType()][] = [ - 'name' => Html::escape($package_name), - 'label' => Html::escape($item->getLabel()), - 'class' => 'features-conflict', - ]; - } - else { - $moved[] = $item_name; - $package_name = !empty($item->getPackage()) ? $item->getPackage() : $this->t('PACKAGE NOT ASSIGNED'); - $package_config[$item->getType()][] = [ - 'name' => $this->t('Moved to @package', ['@package' => $package_name]), - 'label' => Html::escape($item->getLabel()), - 'class' => 'features-moved', - ]; - } - } - } - // Add dependencies. - $package_config['dependencies'] = []; - foreach ($package->getDependencies() as $dependency) { - $package_config['dependencies'][] = [ - 'name' => $dependency, - 'label' => $this->moduleHandler->moduleExists($dependency) ? $this->moduleHandler->getName($dependency) : $dependency, - 'class' => '', - ]; - } - - $class = ''; - $state_links = []; - if (!empty($conflicts)) { - $state_links[] = [ - '#type' => 'link', - '#title' => $this->t('Conflicts'), - '#url' => Url::fromRoute('features.edit', ['featurename' => $package->getMachineName()]), - '#attributes' => ['class' => ['features-conflict']], - ]; - } - if (!empty($overrides)) { - $state_links[] = [ - '#type' => 'link', - '#title' => $this->featuresManager->stateLabel(FeaturesManagerInterface::STATE_OVERRIDDEN), - '#url' => Url::fromRoute('features.diff', ['featurename' => $package->getMachineName()]), - '#attributes' => ['class' => ['features-override']], - ]; - } - if (!empty($new_config)) { - $state_links[] = [ - '#type' => 'link', - '#title' => $this->t('New detected'), - '#url' => Url::fromRoute('features.diff', ['featurename' => $package->getMachineName()]), - '#attributes' => ['class' => ['features-detected']], - ]; - } - if (!empty($missing) && ($package->getStatus() == FeaturesManagerInterface::STATUS_INSTALLED)) { - $state_links[] = [ - '#type' => 'link', - '#title' => $this->t('Missing'), - '#url' => Url::fromRoute('features.edit', ['featurename' => $package->getMachineName()]), - '#attributes' => ['class' => ['features-missing']], - ]; - } - if (!empty($moved)) { - $state_links[] = [ - '#type' => 'link', - '#title' => $this->t('Moved'), - '#url' => Url::fromRoute('features.edit', ['featurename' => $package->getMachineName()]), - '#attributes' => ['class' => ['features-moved']], - ]; - } - if (!empty($state_links)) { - $element['state'] = [ - 'data' => $state_links, - 'class' => ['column-nowrap'], - ]; - } - else { - $element['state'] = ''; - } - - $config_types = $this->featuresManager->listConfigTypes(); - // Add dependencies. - $config_types['dependencies'] = $this->t('Dependencies'); - $config_types['missing'] = $this->t('Missing'); - uasort($config_types, 'strnatcasecmp'); - - $rows = array(); - // Use sorted array for order. - foreach ($config_types as $type => $label) { - // For each component type, offer alternating rows. - $row = array(); - if (isset($package_config[$type])) { - $row[] = array( - 'data' => array( - '#type' => 'html_tag', - '#tag' => 'span', - '#value' => Html::escape($label), - '#attributes' => array( - 'title' => Html::escape($type), - 'class' => 'features-item-label', - ), - ), - ); - $row[] = array( - 'data' => array( - '#theme' => 'features_items', - '#items' => $package_config[$type], - '#value' => Html::escape($label), - '#title' => Html::escape($type), - ), - 'class' => 'item', - ); - $rows[] = $row; - } - } - $element['table'] = array( - '#type' => 'table', - '#rows' => $rows, - ); - - $details = array(); - $details['description'] = array( - '#markup' => Xss::filterAdmin($package->getDescription()), - ); - $details['table'] = array( - '#type' => 'details', - '#title' => $this->t('Included configuration'), - '#description' => array('data' => $element['table']), - ); - $element['details'] = array( - 'class' => array('description', 'expand'), - 'data' => $details, - ); - - return $element; - } - - /** - * Adds a pseudo-package to display unpackaged configuration. - * - * @param array $packages - * An array of package names. - * @param \Drupal\features\ConfigurationItem[] $config_collection - * A collection of configuration. - */ - protected function addUnpackaged(array &$packages, array $config_collection) { - $packages['unpackaged'] = new Package('unpackaged', [ - 'name' => $this->t('Unpackaged'), - 'description' => $this->t('Configuration that has not been added to any package.'), - 'config' => [], - 'status' => FeaturesManagerInterface::STATUS_NO_EXPORT, - 'version' => '', - ]); - foreach ($config_collection as $item_name => $item) { - if (!$item->getPackage() && !$item->isExcluded() && !$item->isProviderExcluded()) { - $packages['unpackaged']->appendConfig($item_name); - } - } - } - - /** - * Denies access to the checkboxes for uninstalled or empty packages and the - * "unpackaged" pseudo-package. - * - * @param array $form - * The form build array to alter. - * - * @return array - * The form build array. - */ - public static function preRenderRemoveInvalidCheckboxes(array $form) { - /** @var \Drupal\features\Package $package */ - foreach ($form['#packages'] as $package) { - // Remove checkboxes for packages that: - // - have no configuration assigned and are not the profile, or - // - are the "unpackaged" pseudo-package. - if ((empty($package->getConfig()) && !($package->getMachineName() == $form['#profile_package'])) || - $package->getMachineName() == 'unpackaged') { - $form['preview'][$package->getMachineName()]['#access'] = FALSE; - } - } - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $current_bundle = $this->assigner->loadBundle(); - $this->assigner->assignConfigPackages(); - - $package_names = array_filter($form_state->getValue('preview')); - - if (empty($package_names)) { - drupal_set_message($this->t('Please select one or more packages to export.'), 'warning'); - return; - } - - $method_id = NULL; - $trigger = $form_state->getTriggeringElement(); - $op = $form_state->getValue('op'); - if (!empty($trigger) && empty($op)) { - $method_id = $trigger['#name']; - } - - if (!empty($method_id)) { - $this->generator->generatePackages($method_id, $current_bundle, $package_names); - $this->generator->applyExportFormSubmit($method_id, $form, $form_state); - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesBundleUITest.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesBundleUITest.php deleted file mode 100644 index 091c55e22..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesBundleUITest.php +++ /dev/null @@ -1,188 +0,0 @@ -bundleStorage = \Drupal::entityTypeManager()->getStorage('features_bundle'); - - $admin_user = $this->createUser(['administer site configuration', 'export configuration', 'administer modules']); - $this->drupalLogin($admin_user); - $this->drupalPlaceBlock('local_actions_block'); - } - - /** - * Get the default features bundle. - * - * @return \Drupal\features\FeaturesBundleInterface - * The features bundle. - */ - protected function defaultBundle() { - return $this->bundleStorage->load(FeaturesBundleInterface::DEFAULT_BUNDLE); - } - - /** - * Completely remove a features assignment method from the bundle. - * - * @param string $method_id - * The assignment method ID. - */ - protected function removeAssignment($method_id) { - $bundle = $this->defaultBundle(); - $assignments = $bundle->get('assignments'); - unset($assignments[$method_id]); - $bundle->set('assignments', $assignments); - $bundle->save(); - } - - /** - * Tests configuring an assignment. - */ - public function testAssignmentConfigure() { - // Check initial values. - $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); - $this->assertTrue(isset($settings['types']['config']['features_bundle']), 'Excluding features_bundle'); - $this->assertFalse(isset($settings['types']['config']['system_simple']), 'Not excluding system_simple'); - $this->assertFalse(isset($settings['types']['config']['user_role']), 'Not excluding user_role'); - $this->assertTrue($settings['curated'], 'Excluding curated items'); - $this->assertTrue($settings['module']['namespace'], 'Excluding by namespace'); - - // Check initial form. - $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); - $this->assertFieldChecked('edit-types-config-features-bundle', 'features_bundle is checked'); - $this->assertNoFieldChecked('edit-types-config-system-simple', 'system_simple is not checked'); - $this->assertNoFieldChecked('edit-types-config-user-role', 'user_role is not checked'); - $this->assertFieldChecked('edit-curated', 'curated is checked'); - $this->assertFieldChecked('edit-module-namespace', 'namespace is checked'); - - // Configure the form. - $this->drupalPostForm(NULL, [ - 'types[config][system_simple]' => TRUE, - 'types[config][user_role]' => FALSE, - 'curated' => TRUE, - 'module[namespace]' => FALSE, - ], $this->t('Save settings')); - - // Check form results. - $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); - $this->assertFieldChecked('edit-types-config-features-bundle', 'Saved, features_bundle is checked'); - $this->assertFieldChecked('edit-types-config-system-simple', 'Saved, system_simple is checked'); - $this->assertNoFieldChecked('edit-types-config-user-role', 'Saved, user_role is not checked'); - $this->assertFieldChecked('edit-curated', 'Saved, curated is checked'); - $this->assertNoFieldChecked('edit-module-namespace', 'Saved, namespace is not checked'); - - // Check final values. - $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); - $this->assertTrue(isset($settings['types']['config']['features_bundle']), 'Saved, excluding features_bundle'); - $this->assertTrue(isset($settings['types']['config']['system_simple']), 'Saved, excluding system_simple'); - $this->assertFalse(isset($settings['types']['config']['user_role']), 'Saved, not excluding user_role'); - $this->assertTrue($settings['curated'], 'Saved, excluding curated items'); - $this->assertFalse($settings['module']['namespace'], 'Saved, not excluding by namespace'); - } - - /** - * Tests configuring an assignment that didn't exist before. - */ - public function testNewAssignmentConfigure() { - $this->removeAssignment('exclude'); - - // Is it really removed? - $all_settings = $this->defaultBundle()->getAssignmentSettings(); - $this->assertFalse(isset($all_settings['exclude']), 'Exclude plugin is unknown'); - - // Can still get settings. - $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); - $this->assertFalse($settings['enabled'], 'Disabled exclude plugin'); - $this->assertFalse(isset($settings['types']['config']['features_bundle']), 'Not excluding features_bundle'); - $this->assertFalse(isset($settings['types']['config']['system_simple']), 'Not excluding system_simple'); - $this->assertFalse(isset($settings['types']['config']['user_role']), 'Not excluding user_role'); - $this->assertFalse($settings['curated'], 'Not excluding curated items'); - $this->assertFalse($settings['module']['namespace'], 'Not excluding by namespace'); - - // Can we visit the config page with no settings? - $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); - $this->assertNoFieldChecked('edit-types-config-features-bundle', 'features_bundle is not checked'); - $this->assertNoFieldChecked('edit-types-config-system-simple', 'system_simple is not checked'); - $this->assertNoFieldChecked('edit-types-config-user-role', 'user_role is not checked'); - $this->assertNoFieldChecked('edit-curated', 'curated is not checked'); - $this->assertNoFieldChecked('edit-module-namespace', 'namespace is not checked'); - - // Can we enable the method? - $this->drupalGet('admin/config/development/features/bundle'); - $this->assertNoFieldChecked('edit-enabled-exclude', 'Exclude disabled'); - $this->drupalPostForm(NULL, [ - 'enabled[exclude]' => TRUE, - ], $this->t('Save settings')); - $this->assertFieldChecked('edit-enabled-exclude', 'Exclude enabled'); - - // Check new settings. - $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); - $this->assertTrue($settings['enabled'], 'Enabled exclude plugin'); - $this->assertFalse(isset($settings['types']['config']['features_bundle']), 'Not excluding features_bundle'); - $this->assertFalse(isset($settings['types']['config']['system_simple']), 'Not excluding system_simple'); - $this->assertFalse(isset($settings['types']['config']['user_role']), 'Not excluding user_role'); - $this->assertFalse($settings['curated'], 'Not excluding curated items'); - $this->assertFalse($settings['module']['namespace'], 'Not excluding by namespace'); - - // Can we run assignment with no settings? - $this->drupalGet('admin/config/development/features'); - - // Can we configure the method? - $this->drupalPostForm('admin/config/development/features/bundle/_exclude/default', [ - 'types[config][system_simple]' => TRUE, - 'types[config][user_role]' => FALSE, - 'curated' => TRUE, - 'module[namespace]' => FALSE, - ], $this->t('Save settings')); - - // Check form results. - $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); - $this->assertNoFieldChecked('edit-types-config-features-bundle', 'Saved, features_bundle is not checked'); - $this->assertFieldChecked('edit-types-config-system-simple', 'Saved, system_simple is checked'); - $this->assertNoFieldChecked('edit-types-config-user-role', 'Saved, user_role is not checked'); - $this->assertFieldChecked('edit-curated', 'Saved, curated is checked'); - $this->assertNoFieldChecked('edit-module-namespace', 'Saved, namespace is not checked'); - - // Check final values. - $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); - $this->assertFalse(isset($settings['types']['config']['features_bundle']), 'Saved, not excluding features_bundle'); - $this->assertTrue(isset($settings['types']['config']['system_simple']), 'Saved, excluding system_simple'); - $this->assertFalse(isset($settings['types']['config']['user_role']), 'Saved, not excluding user_role'); - $this->assertTrue($settings['curated'], 'Saved, excluding curated items'); - $this->assertFalse($settings['module']['namespace'], 'Saved, not excluding by namespace'); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesCreateUITest.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesCreateUITest.php deleted file mode 100644 index 70c1da4d3..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesCreateUITest.php +++ /dev/null @@ -1,184 +0,0 @@ - 2) ? 'modules[' : 'modules[Other]['; - - $feature_name = 'test_feature2'; - $admin_user = $this->createUser(['administer site configuration', 'export configuration', 'administer modules']); - $this->drupalLogin($admin_user); - $this->drupalPlaceBlock('local_actions_block'); - $this->drupalGet('admin/config/development/features'); - $this->clickLink('Create new feature'); - $this->assertResponse(200); - - $edit = [ - 'name' => 'Test feature', - 'machine_name' => $feature_name, - 'description' => 'Test description: giraffe', - 'version' => '8.x-1.0', - 'system_simple[sources][selected][system.theme]' => TRUE, - 'system_simple[sources][selected][user.settings]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Download Archive')); - - $this->assertResponse(200); - $archive = $this->getRawContent(); - $filename = tempnam($this->tempFilesDirectory, 'feature'); - file_put_contents($filename, $archive); - - $archive = new ArchiveTar($filename); - $files = $archive->listContent(); - - $this->assertEqual(4, count($files)); - $this->assertEqual($feature_name . '/' . $feature_name . '.info.yml', $files[0]['filename']); - $this->assertEqual($feature_name . '/' . $feature_name . '.features.yml', $files[1]['filename']); - $this->assertEqual($feature_name . '/config/install/system.theme.yml', $files[2]['filename']); - $this->assertEqual($feature_name . '/config/install/user.settings.yml', $files[3]['filename']); - - // Ensure that the archive contains the expected values. - $info_filename = tempnam($this->tempFilesDirectory, 'feature'); - file_put_contents($info_filename, $archive->extractInString($feature_name . '/' . $feature_name . '.info.yml')); - $features_info_filename = tempnam($this->tempFilesDirectory, 'feature'); - file_put_contents($features_info_filename, $archive->extractInString($feature_name . '/' . $feature_name . '.features.yml')); - /** @var \Drupal\Core\Extension\InfoParser $info_parser */ - $info_parser = \Drupal::service('info_parser'); - $parsed_info = $info_parser->parse($info_filename); - $this->assertEqual('Test feature', $parsed_info['name']); - $parsed_features_info = Yaml::decode(file_get_contents($features_info_filename)); - $this->assertEqual([ - 'required' => ['system.theme', 'user.settings'], - ], $parsed_features_info); - - $archive->extract(\Drupal::service('kernel')->getSitePath() . '/modules'); - $module_path = \Drupal::service('kernel')->getSitePath() . '/modules/' . $feature_name; - - // Ensure that the features listing renders the right content. - $this->drupalGet('admin/config/development/features'); - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertLink('Test feature'); - $this->assertEqual($feature_name, (string) $tr->children()[2]); - $description_column = (string) $tr->children()[3]->asXml(); - $this->assertTrue(strpos($description_column, 'system.theme') !== FALSE); - $this->assertTrue(strpos($description_column, 'user.settings') !== FALSE); - $this->assertRaw('Test description: giraffe'); - $this->assertEqual('Uninstalled', (string) $tr->children()[5]); - $this->assertEqual('', (string) $tr->children()[6]); - - // Remove one and add new configuration. - $this->clickLink('Test feature'); - $edit = [ - 'system_simple[included][system.theme]' => FALSE, - 'user_role[sources][selected][authenticated]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Write')); - $info_filename = $module_path . '/' . $feature_name . '.info.yml'; - - $parsed_info = $info_parser->parse($info_filename); - $this->assertEqual('Test feature', $parsed_info['name']); - - $features_info_filename = $module_path . '/' . $feature_name . '.features.yml'; - $parsed_features_info = Yaml::decode(file_get_contents($features_info_filename)); - $this->assertEqual([ - 'excluded' => ['system.theme'], - 'required' => true, - ], $parsed_features_info); - - $this->drupalGet('admin/modules'); - $edit = [ - $name_prefix . $feature_name . '][enable]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Install')); - - // Check that the feature is listed as installed. - $this->drupalGet('admin/config/development/features'); - - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertEqual('Installed', (string) $tr->children()[5]); - - // Check that a config change results in a feature marked as changed. - \Drupal::configFactory()->getEditable('user.settings') - ->set('anonymous', 'Anonymous giraffe') - ->save(); - - $this->drupalGet('admin/config/development/features'); - - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertTrue(strpos($tr->children()[6]->asXml(), 'Changed') !== FALSE); - - // Uninstall module. - $this->drupalPostForm('admin/modules/uninstall', [ - 'uninstall[' . $feature_name . ']' => TRUE, - ], $this->t('Uninstall')); - $this->drupalPostForm(NULL, [], $this->t('Uninstall')); - - $this->drupalGet('admin/config/development/features'); - - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertTrue(strpos($tr->children()[6]->asXml(), 'Changed') !== FALSE); - - $this->clickLink($this->t('Changed')); - $this->drupalGet('admin/config/development/features/diff/' . $feature_name); - $this->assertRaw('anonymous : Anonymous giraffe'); - $this->assertRaw('anonymous : Anonymous'); - - $this->drupalGet('admin/modules'); - $edit = [ - $name_prefix . $feature_name . '][enable]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Install')); - $this->drupalGet('admin/config/development/features'); - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertEqual('Installed', (string) $tr->children()[5]); - - // Ensure that the changed config got overridden. - $this->assertEqual('Anonymous', \Drupal::config('user.settings')->get('anonymous')); - - // Change the value, export and ensure that its not shown as changed. - \Drupal::configFactory()->getEditable('user.settings') - ->set('anonymous', 'Anonymous giraffe') - ->save(); - - // Ensure that exporting this change will result in an unchanged feature. - $this->drupalGet('admin/config/development/features'); - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertTrue(strpos($tr->children()[6]->asXml(), 'Changed') !== FALSE); - - $this->clickLink('Test feature'); - $this->drupalPostForm(NULL, [], $this->t('Write')); - - $this->drupalGet('admin/config/development/features'); - $tr = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]')[0]; - $this->assertEqual('Installed', (string) $tr->children()[5]); - } - -} diff --git a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesUITest.php b/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesUITest.php deleted file mode 100644 index 12f92ae5b..000000000 --- a/sites/all/modules/contrib/admin/features/modules/features_ui/src/Tests/FeaturesUITest.php +++ /dev/null @@ -1,49 +0,0 @@ -drupalCreateUser(['administer site configuration', 'export configuration', 'administer modules']); - $this->drupalLogin($admin_user); - $this->drupalGet('admin/config/development/features'); - // Check the message is displaying if there are no custom bundles. - $this->assertText($this->t('You have not yet created any bundles. Before generating features, you may wish to create a bundle to group your features within.')); - // Creating custom bundle. - $this->drupalGet('admin/config/development/features/bundle'); - $this->drupalPostAjaxForm(NULL, ['bundle[bundle_select]' => 'new'], 'bundle[bundle_select]'); - $edit = [ - 'bundle[name]' => 'foo', - 'bundle[machine_name]' => 'foo', - 'bundle[description]' => $this->randomString(), - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Save settings')); - $this->drupalGet('admin/config/development/features'); - // Check the message is not displaying if there are custom bundles. - $this->assertNoText($this->t('You have not yet created any bundles. Before generating features, you may wish to create a bundle to group your features within.')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Commands/FeaturesCommands.php b/sites/all/modules/contrib/admin/features/src/Commands/FeaturesCommands.php deleted file mode 100644 index a0dec38e3..000000000 --- a/sites/all/modules/contrib/admin/features/src/Commands/FeaturesCommands.php +++ /dev/null @@ -1,1053 +0,0 @@ - NULL, - ]; - - const OPTIONS_ADD = self::OPTIONS; - - const OPTIONS_COMPONENTS = self::OPTIONS + [ - 'exported' => NULL, - 'format' => 'table', - 'not-exported' => NULL, - ]; - - const OPTIONS_DIFF = self::OPTIONS + [ - 'ctypes' => NULL, - 'lines' => NULL, - ]; - - const OPTIONS_EXPORT = self::OPTIONS + [ - 'add-profile' => NULL, - ]; - - const OPTIONS_IMPORT = self::OPTIONS + [ - 'force' => NULL, - ]; - - const OPTIONS_IMPORT_ALL = self::OPTIONS; - - const OPTIONS_LIST = self::OPTIONS + [ - 'format' => 'table', - ]; - - const OPTIONS_STATUS = self::OPTIONS; - - /** - * The features_assigner service. - * - * @var \Drupal\features\FeaturesAssignerInterface - */ - protected $assigner; - - /** - * The features.manager service. - * - * @var \Drupal\features\FeaturesManagerInterface - */ - protected $manager; - - /** - * The features_generator service. - * - * @var \Drupal\features\FeaturesGeneratorInterface - */ - protected $generator; - - /** - * The config_update.config_diff service. - * - * @var \Drupal\config_update\ConfigDiffInterface - */ - protected $configDiff; - - /** - * The config.storage service. - * - * @var \Drupal\Core\Config\StorageInterface - */ - protected $configStorage; - - /** - * FeaturesCommands constructor. - * - * @param \Drupal\features\FeaturesAssignerInterface $assigner - * The features_assigner service. - * @param \Drupal\features\FeaturesManagerInterface $manager - * The features.manager service. - * @param \Drupal\features\FeaturesGeneratorInterface $generator - * The features_generator service. - * @param \Drupal\config_update\ConfigDiffInterface $configDiff - * The config_update.config_diff service. - * @param \Drupal\Core\Config\StorageInterface $configStorage - * The config.storage service. - */ - public function __construct( - FeaturesAssignerInterface $assigner, - FeaturesManagerInterface $manager, - FeaturesGeneratorInterface $generator, - ConfigDiffInterface $configDiff, - StorageInterface $configStorage - ) { - parent::__construct(); - $this->assigner = $assigner; - $this->configDiff = $configDiff; - $this->configStorage = $configStorage; - $this->generator = $generator; - $this->manager = $manager; - } - - /** - * Applies global options for Features drush commands, including the bundle. - * - * The option --name="bundle_name" sets the bundle namespace. - * - * @return \Drupal\features\FeaturesAssignerInterface - * The features.assigner with options applied. - */ - protected function featuresOptions(array $options) { - $bundleName = $this->getOption($options, 'bundle'); - if (!empty($bundleName)) { - $bundle = $this->assigner->applyBundle($bundleName); - if ($bundle->getMachineName() !== $bundleName) { - $this->logger()->warning('Bundle {name} not found. Using default.', [ - 'name' => $bundleName, - ]); - } - } - else { - $this->assigner->assignConfigPackages(); - } - return $this->assigner; - } - - /** - * Get the value of an option. - * - * @param array $options - * The options array. - * @param string $name - * The option name. - * @param mixed $default - * The default value of the option. - * - * @return mixed|null - * The option value, defaulting to NULL. - */ - protected function getOption(array $options, $name, $default = NULL) { - return isset($options[$name]) - ? $options[$name] - : $default; - } - - /** - * Display current Features settings. - * - * @param string $keys - * A possibly empty, comma-separated, list of config information to display. - * - * @command features:status - * - * @option bundle Use a specific bundle namespace. - * - * @aliases fs,features-status - */ - public function status($keys = NULL, array $options = self::OPTIONS_STATUS) { - $this->featuresOptions($options); - - $currentBundle = $this->assigner->getBundle(); - $export_settings = $this->manager->getExportSettings(); - $methods = $this->assigner->getEnabledAssigners(); - $output = $this->output(); - if ($currentBundle->isDefault()) { - $output->writeln(dt('Current bundle: none')); - } - else { - $output->writeln(dt('Current bundle: @name (@machine_name)', [ - '@name' => $currentBundle->getName(), - '@machine_name' => $currentBundle->getMachineName(), - ])); - } - $output->writeln(dt('Export folder: @folder', [ - '@folder' => $export_settings['folder'], - ])); - $output - ->writeln(dt('The following assignment methods are enabled:')); - $output->writeln(dt(' @methods', [ - '@methods' => implode(', ', array_keys($methods)), - ])); - - if (!empty($keys)) { - $config = $this->manager->getConfigCollection(); - $keys = StringUtils::csvToArray($keys); - $data = count($keys) > 1 - ? array_keys($config) - : $config[$keys[0]]; - $output->writeln(print_r($data, TRUE)); - } - } - - /** - * Display a list of all generate-able existing features and packages. - * - * If a package name is provided as an argument, then all of the configuration - * objects assigned to that package will be listed. - * - * @param string $package_name - * The package to list. Optional; if specified, lists all configuration - * objects assigned to that package. If no package is specified, lists all - * of the features. - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields|bool - * The command output, or FALSE if a requested package was not found. - * - * @command features:list:packages - * - * @option bundle Use a specific bundle namespace. - * - * @usage drush features:list:packages - * Display a list of all existing features and packages available to be - * generated. - * @usage drush features:list:packages 'example_article' - * Display a list of all configuration objects assigned to the - * 'example_article' package. - * - * @field-labels - * config: Config - * name: Name - * machine_name: Machine name - * status: Status - * version: Version - * state: State - * - * @aliases fl,features-list-packages - */ - public function listPackages($package_name = NULL, $options = self::OPTIONS_LIST) { - $assigner = $this->featuresOptions($options); - $current_bundle = $assigner->getBundle(); - $namespace = $current_bundle->isDefault() ? FeaturesBundleInterface::DEFAULT_BUNDLE : $current_bundle->getMachineName(); - - $manager = $this->manager; - $packages = $manager->getPackages(); - - $packages = $manager->filterPackages($packages, $namespace); - $result = []; - - // If no package was specified, list all packages. - if (empty($package_name)) { - foreach ($packages as $package) { - $overrides = $manager->detectOverrides($package); - $state = $package->getState(); - if (!empty($overrides) && ($package->getStatus() != FeaturesManagerInterface::STATUS_NO_EXPORT)) { - $state = FeaturesManagerInterface::STATE_OVERRIDDEN; - } - - $packageState = ($state != FeaturesManagerInterface::STATE_DEFAULT) - ? $manager->stateLabel($state) - : ''; - - $result[$package->getMachineName()] = [ - 'name' => $package->getName(), - 'machine_name' => $package->getMachineName(), - 'status' => $manager->statusLabel($package->getStatus()), - 'version' => $package->getVersion(), - 'state' => $packageState, - ]; - } - return new RowsOfFields($result); - } - - // A valid package was listed. - $package = $this->manager->findPackage($package_name); - - // If no matching package found, return an error. - if (empty($package)) { - $this->logger()->warning(dt('Package "@package" not found.', [ - '@package' => $package_name, - ])); - return FALSE; - } - - // This is a valid package, list its configuration. - $config = array_map(function ($name) { - return ['config' => $name]; - }, $package->getConfig()); - - return new RowsOfFields($config); - } - - /** - * Import module config from all installed features. - * - * @command features:import:all - * - * @option bundle Use a specific bundle namespace. - * - * @usage drush features-import-all - * Import module config from all installed features. - * - * @aliases fra,fia,fim-all,features-import-all - */ - public function importAll($options = self::OPTIONS_IMPORT_ALL) { - $assigner = $this->featuresOptions($options); - $currentBundle = $assigner->getBundle(); - $namespace = $currentBundle->isDefault() ? FeaturesBundleInterface::DEFAULT_BUNDLE : $currentBundle->getMachineName(); - - $manager = $this->manager; - $packages = $manager->getPackages(); - $packages = $manager->filterPackages($packages, $namespace); - $overridden = []; - - foreach ($packages as $package) { - $overrides = $manager->detectOverrides($package); - $missing = $manager->detectMissing($package); - if ((!empty($missing) || !empty($overrides)) && ($package->getStatus() == FeaturesManagerInterface::STATUS_INSTALLED)) { - $overridden[] = $package->getMachineName(); - } - } - - if (!empty($overridden)) { - $this->import($overridden); - } - else { - $this->logger->info(dt('Current state already matches active config, aborting.')); - } - } - - /** - * Export the configuration on your site into a custom module. - * - * @param array $packages - * A list of features to export. - * - * @command features:export - * - * @option add-profile Package features into an install profile. - * @option bundle Use a specific bundle namespace. - * - * @usage drush features-export - * Export all available packages. - * @usage drush features-export example_article example_page - * Export the example_article and example_page packages. - * @usage drush features-export --add-profile - * Export all available packages and add them to an install profile. - * - * @aliases fex,fu,fua,fu-all,features-export - * - * @throws \Drupal\features\Exception\DomainException - * @throws \Drupal\features\Exception\InvalidArgumentException - * @throws \Drush\Exceptions\UserAbortException - * @throws \Exception - */ - public function export(array $packages, $options = self::OPTIONS_EXPORT) { - $assigner = $this->featuresOptions($options); - $manager = $this->manager; - $generator = $this->generator; - - $current_bundle = $assigner->getBundle(); - - if ($options['add-profile']) { - if ($current_bundle->isDefault) { - throw new InvalidArgumentException(dt("Must specify a profile name with --name")); - } - $current_bundle->setIsProfile(TRUE); - } - - $all_packages = $manager->getPackages(); - foreach ($packages as $name) { - if (!isset($all_packages[$name])) { - throw new DomainException(dt("The package @name does not exist.", [ - '@name' => $name, - ])); - } - } - - if (empty($packages)) { - $packages = $all_packages; - $dt_args = ['@modules' => implode(', ', array_keys($packages))]; - drush_print(dt('The following extensions will be exported: @modules', - $dt_args)); - if (!$this->io()->confirm('Do you really want to continue?')) { - throw new UserAbortException(); - } - } - else { - $packages = array_combine($packages, $packages); - } - - // If any packages exist, confirm before overwriting. - if ($existing_packages = $manager->listPackageDirectories($packages, - $current_bundle)) { - foreach ($existing_packages as $name => $directory) { - drush_print(dt("The extension @name already exists at @directory.", - ['@name' => $name, '@directory' => $directory])); - } - // Apparently, format_plural is not always available. - if (count($existing_packages) == 1) { - $message = dt('Would you like to overwrite it?'); - } - else { - $message = dt('Would you like to overwrite them?'); - } - if (!$this->io()->confirm($message)) { - throw new UserAbortException(); - } - } - - // Use the write generation method. - $method_id = FeaturesGenerationWrite::METHOD_ID; - $result = $generator->generatePackages($method_id, $current_bundle, array_keys($packages)); - - foreach ($result as $message) { - $method = $message['success'] ? 'success' : 'error'; - $this->logger()->$method(dt($message['message'], $message['variables'])); - } - } - - /** - * Add a config item to a feature package. - * - * @param array|null $components - * Patterns of config to add, see features:components for the format to use. - * - * @command features:add - * - * @todo @param $feature Feature package to export and add config to. - * - * @option bundle Use a specific bundle namespace. - * - * @aliases fa,fe,features-add - * - * @throws \Drush\Exceptions\UserAbortException - * @throws \Exception - */ - public function add($components = NULL, $options = self::OPTIONS_ADD) { - if ($components) { - $assigner = $this->featuresOptions($options); - $manager = $this->manager; - $generator = $this->generator; - - $current_bundle = $assigner->getBundle(); - - $module = array_shift($args); - if (empty($args)) { - throw new \Exception('No components supplied.'); - } - $components = $this->componentList(); - $options = [ - 'exported' => FALSE, - ]; - - $filtered_components = $this->componentFilter($components, $args, - $options); - $items = $filtered_components['components']; - - if (empty($items)) { - throw new \Exception('No components to add.'); - } - - $packages = [$module]; - // If any packages exist, confirm before overwriting. - if ($existing_packages = $manager->listPackageDirectories($packages)) { - foreach ($existing_packages as $name => $directory) { - drush_print(dt("The extension @name already exists at @directory.", - ['@name' => $name, '@directory' => $directory])); - } - // Apparently, format_plural is not always available. - if (count($existing_packages) == 1) { - $message = dt('Would you like to overwrite it?'); - } - else { - $message = dt('Would you like to overwrite them?'); - } - if (!$this->io()->confirm($message)) { - throw new UserAbortException(); - } - } - else { - $package = $manager->initPackage($module, NULL, '', 'module', - $current_bundle); - list($full_name, $path) = $manager->getExportInfo($package, - $current_bundle); - drush_print(dt('Will create a new extension @name in @directory', - ['@name' => $full_name, '@directory' => $path])); - if (!$this->io()->confirm(dt('Do you really want to continue?'))) { - throw new UserAbortException(); - } - } - - $config = $this->buildConfig($items); - - $manager->assignConfigPackage($module, $config); - - // Use the write generation method. - $method_id = FeaturesGenerationWrite::METHOD_ID; - $result = $generator->generatePackages($method_id, $current_bundle, - $packages); - - foreach ($result as $message) { - $method = $message['success'] ? 'success' : 'error'; - $this->logger()->$method(dt($message['message'], - $message['variables'])); - } - } - else { - throw new \Exception('No feature name given.'); - } - } - - /** - * List features components. - * - * @param array $patterns - * The components types to list. Omit this argument to list them all. - * - * @command features:components - * - * @option exported Show only components that have been exported. - * @option not-exported Show only components that have not been exported. - * @option bundle Use a specific bundle namespace. - * - * @aliases fc,features-components - * - * @field-labels - * source: Available sources - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields|null - * The command output. May be empty. - */ - public function components(array $patterns, $options = self::OPTIONS_COMPONENTS) { - $args = $patterns; - $this->featuresOptions($options); - - $components = $this->componentList(); - ksort($components); - // If no args supplied, prompt with a list. - if (empty($args)) { - $types = array_keys($components); - array_unshift($types, 'all'); - $choice = $this->io() - ->choice('Enter a number to choose which component type to list.', $types); - if ($choice === FALSE) { - return NULL; - } - - $args = ($choice == 0) ? ['*'] : [$types[$choice]]; - } - $options = [ - 'provided by' => TRUE, - ]; - if ($options['exported']) { - $options['not exported'] = FALSE; - } - elseif ($options['not-exported']) { - $options['exported'] = FALSE; - } - - $filtered_components = $this->componentFilter($components, $args, $options); - if ($filtered_components) { - return $this->componentPrint($filtered_components); - } - } - - /** - * Show the difference between active|default config from a feature package. - * - * @param string $feature - * The feature in question. - * - * @command features:diff - * - * @option ctypes Comma-separated list of component types to limit the output - * to. Defaults to all types. - * @option lines Generate diffs with lines of context instead of the - * usual two. - * @option bundle Use a specific bundle namespace. - * - * @aliases fd,features-diff - * - * @throws \Exception - */ - public function diff($feature, $options = self::OPTIONS_DIFF) { - $manager = $this->manager; - $assigner = $this->featuresOptions($options); - $assigner->assignConfigPackages(); - - $module = $feature; - - // @FIXME Actually do something with the "ctypes" option. - $filter_ctypes = $options['ctypes']; - if ($filter_ctypes) { - $filter_ctypes = explode(',', $filter_ctypes); - } - - $feature = $manager->loadPackage($module, TRUE); - if (empty($feature)) { - throw new DomainException(dt('No such feature is available: @module', [ - '@module' => $module, - ])); - } - - $lines = $options['lines']; - $lines = isset($lines) ? $lines : 2; - - $formatter = new DiffFormatter(); - $formatter->leading_context_lines = $lines; - $formatter->trailing_context_lines = $lines; - $formatter->show_header = FALSE; - - if (drush_get_context('DRUSH_NOCOLOR')) { - $red = $green = "%s"; - } - else { - $red = "\033[31;40m\033[1m%s\033[0m"; - $green = "\033[0;32;40m\033[1m%s\033[0m"; - } - - $overrides = $manager->detectOverrides($feature); - $missing = $manager->reorderMissing($manager->detectMissing($feature)); - $overrides = array_merge($overrides, $missing); - - $output = $this->output(); - - if (empty($overrides)) { - $output->writeln(dt('Active config matches stored config for @module.', [ - '@module' => $module, - ])); - } - else { - $config_diff = $this->configDiff; - - // Print key for colors. - $output->writeln(dt('Legend: ')); - $output->writeln(sprintf($red, - dt('Code: drush features-import will replace the active config with the displayed code.'))); - $output->writeln(sprintf($green, - dt('Active: drush features-export will update the exported feature with the displayed active config'))); - - foreach ($overrides as $name) { - $message = ''; - if (in_array($name, $missing)) { - $extension = []; - $message = sprintf($red, dt('(missing from active)')); - } - else { - $active = $manager->getActiveStorage()->read($name); - $extension = $manager->getExtensionStorages()->read($name); - if (empty($extension)) { - $extension = []; - $message = sprintf($green, dt('(not exported)')); - } - $diff = $config_diff->diff($extension, $active); - $rows = explode("\n", $formatter->format($diff)); - } - - $output->writeln(''); - $output->writeln(dt("Config @name @message", [ - '@name' => $name, - '@message' => $message, - ])); - - if (!empty($extension)) { - foreach ($rows as $row) { - if (strpos($row, '>') === 0) { - $output->writeln(sprintf($green, $row)); - } - elseif (strpos($row, '<') === 0) { - $output->writeln(sprintf($red, $row)); - } - else { - $output->writeln($row); - } - } - } - } - } - } - - /** - * Import a module config into your site. - * - * @param string $feature - * A comma-delimited list of features or feature:component pairs to import. - * - * @command features:import - * - * @option force Force import even if config is not overridden. - * @option bundle Use a specific bundle namespace. - * - * @usage drush features-import foo:node.type.page - * foo:taxonomy.vocabulary.tags bar Import node and taxonomy config of - * feature "foo". Import all config of feature "bar". - * - * @aliases fim,fr,features-import - * - * @throws \Exception - */ - public function import($feature, $options = self::OPTIONS_IMPORT) { - $this->featuresOptions($options); - - $features = StringUtils::csvToArray($feature); - if (empty($features)) { - drush_invoke_process('@self', 'features:list:packages', [], $options); - return; - } - - // Determine if revert should be forced. - $force = $this->getOption($options, 'force'); - - // Determine if -y was supplied. If so, we can filter out needless output - // from this command. - $skip_confirmation = drush_get_context('DRUSH_AFFIRMATIVE'); - $manager = $this->manager; - - // Parse list of arguments. - $modules = []; - foreach ($features as $featureString) { - list($module, $component) = explode(':', $featureString); - - // We cannot use just a component name without its module. - if (empty($module)) { - continue; - } - - // We received just a feature name, meaning we need all of its components. - if (empty($component)) { - $modules[$module] = TRUE; - continue; - } - - if (empty($modules[$module])) { - $modules[$module] = []; - } - - if ($modules[$module] !== TRUE) { - $modules[$module][] = $component; - } - } - - // Process modules. - foreach ($modules as $module => $componentsNeeded) { - // Reset the arguments on each loop pass. - $dt_args = ['@module' => $module]; - - /** @var \Drupal\features\Package $feature */ - $feature = $manager->loadPackage($module, TRUE); - if (empty($feature)) { - throw new DomainException(dt('No such feature is available: @module', $dt_args)); - } - - if ($feature->getStatus() != FeaturesManagerInterface::STATUS_INSTALLED) { - throw new DomainException(dt('No such feature is installed: @module', $dt_args)); - } - - // Forcefully revert all components of a feature. - if ($force) { - $components = $feature->getConfigOrig(); - } - // Only revert components that are detected to be Overridden. - else { - $overrides = $manager->detectOverrides($feature); - $missing = $manager->reorderMissing($manager->detectMissing($feature)); - - // Be sure to import missing components first. - $components = array_merge($missing, $overrides); - } - - if (!empty($componentsNeeded) && is_array($componentsNeeded)) { - $components = array_intersect($components, $componentsNeeded); - } - - if (empty($components)) { - $this->logger()->info(dt('Current state already matches active config, aborting.')); - continue; - } - - // Determine which config the user wants to import/revert. - $configToCreate = []; - foreach ($components as $component) { - $dt_args['@component'] = $component; - $confirmation_message = 'Do you really want to import @module : @component?'; - if ($skip_confirmation || $this->io()->confirm(dt($confirmation_message, $dt_args))) { - $configToCreate[$component] = ''; - } - } - - // Perform the import/revert. - $importedConfig = $manager->createConfiguration($configToCreate); - - // List the results. - foreach ($components as $component) { - $dt_args['@component'] = $component; - if (isset($importedConfig['new'][$component])) { - $this->logger()->info(dt('Imported @module : @component.', $dt_args)); - } - elseif (isset($importedConfig['updated'][$component])) { - $this->logger()->info(dt('Reverted @module : @component.', $dt_args)); - } - elseif (!isset($configToCreate[$component])) { - $this->logger()->info(dt('Skipping @module : @component.', $dt_args)); - } - else { - $this->logger()->error(dt('Error importing @module : @component.', $dt_args)); - } - } - } - } - - /** - * Returns an array of full config names given a array[$type][$component]. - * - * @param array $items - * The items to return data for. - * - * @return array - * An array of config items. - */ - protected function buildConfig(array $items) { - $result = []; - foreach ($items as $config_type => $item) { - foreach ($item as $item_name => $title) { - $result[] = $this->manager->getFullName($config_type, $item_name); - } - } - return $result; - } - - /** - * Returns a listing of all known components, indexed by source. - */ - protected function componentList() { - $result = []; - $config = $this->manager->getConfigCollection(); - foreach ($config as $item) { - $result[$item->getType()][$item->getShortName()] = $item->getLabel(); - } - return $result; - } - - /** - * Filters components by patterns. - */ - protected function componentFilter($all_components, $patterns = [], $options = []) { - $options += [ - 'exported' => TRUE, - 'not exported' => TRUE, - 'provided by' => FALSE, - ]; - $pool = []; - // Maps exported components to feature modules. - $components_map = $this->componentMap(); - // First filter on exported state. - foreach ($all_components as $source => $components) { - foreach ($components as $name => $title) { - $exported = count($components_map[$source][$name]) > 0; - if ($exported) { - if ($options['exported']) { - $pool[$source][$name] = $title; - } - } - else { - if ($options['not exported']) { - $pool[$source][$name] = $title; - } - } - } - } - - $state_string = ''; - - if (!$options['exported']) { - $state_string = 'unexported'; - } - elseif (!$options['not exported']) { - $state_string = 'exported'; - } - - $selected = []; - foreach ($patterns as $pattern) { - // Rewrite * to %. Let users use both as wildcard. - $pattern = strtr($pattern, ['*' => '%']); - $sources = []; - list($source_pattern, $component_pattern) = explode(':', $pattern, 2); - // If source is empty, use a pattern. - if ($source_pattern == '') { - $source_pattern = '%'; - } - if ($component_pattern == '') { - $component_pattern = '%'; - } - - $preg_source_pattern = strtr(preg_quote($source_pattern, '/'), - ['%' => '.*']); - $preg_component_pattern = strtr(preg_quote($component_pattern, '/'), - ['%' => '.*']); - // If it isn't a pattern, but a simple string, we don't anchor the - // pattern. This allows for abbreviating. Otherwise, we do, as this seems - // more natural for patterns. - if (strpos($source_pattern, '%') !== FALSE) { - $preg_source_pattern = '^' . $preg_source_pattern . '$'; - } - if (strpos($component_pattern, '%') !== FALSE) { - $preg_component_pattern = '^' . $preg_component_pattern . '$'; - } - $matches = []; - - // Find the sources. - $all_sources = array_keys($pool); - $matches = preg_grep('/' . $preg_source_pattern . '/', $all_sources); - if (count($matches) > 0) { - // If we have multiple matches and the source string wasn't a - // pattern, check if one of the matches is equal to the pattern, and - // use that, or error out. - if (count($matches) > 1 and $preg_source_pattern[0] != '^') { - if (in_array($source_pattern, $matches)) { - $matches = [$source_pattern]; - } - else { - throw new \Exception(dt('Ambiguous source "@source", matches @matches', - [ - '@source' => $source_pattern, - '@matches' => implode(', ', $matches), - ])); - } - } - // Loose the indexes preg_grep preserved. - $sources = array_values($matches); - } - else { - throw new \Exception(dt('No @state sources match "@source"', - ['@state' => $state_string, '@source' => $source_pattern])); - } - - // Now find the components. - foreach ($sources as $source) { - // Find the components. - $all_components = array_keys($pool[$source]); - // See if there's any matches. - $matches = preg_grep('/' . $preg_component_pattern . '/', - $all_components); - if (count($matches) > 0) { - // If we have multiple matches and the components string wasn't a - // pattern, check if one of the matches is equal to the pattern, and - // use that, or error out. - if (count($matches) > 1 and $preg_component_pattern[0] != '^') { - if (in_array($component_pattern, $matches)) { - $matches = [$component_pattern]; - } - else { - throw new \Exception(dt('Ambiguous component "@component", matches @matches', - [ - '@component' => $component_pattern, - '@matches' => implode(', ', $matches), - ])); - } - } - if (!is_array($selected[$source])) { - $selected[$source] = []; - } - $selected[$source] += array_intersect_key($pool[$source], - array_flip($matches)); - } - else { - // No matches. If the source was a pattern, just carry on, else - // error out. Allows for patterns like ":*field*". - if ($preg_source_pattern[0] != '^') { - throw new \Exception(dt('No @state @source components match "@component"', - [ - '@state' => $state_string, - '@component' => $component_pattern, - '@source' => $source, - ])); - } - } - } - } - - // Lastly, provide feature module information on the selected components, if - // requested. - $provided_by = []; - if ($options['provided by'] && $options['exported']) { - foreach ($selected as $source => $components) { - foreach ($components as $name => $title) { - $exported = count($components_map[$source][$name]) > 0; - if ($exported) { - $provided_by[$source . ':' . $name] = implode(', ', - $components_map[$source][$name]); - } - } - } - } - - return [ - 'components' => $selected, - 'sources' => $provided_by, - ]; - } - - /** - * Provides a component to feature map (port of features_get_component_map). - */ - protected function componentMap() { - $result = []; - $manager = $this->manager; - // Recalc full config list without running assignments. - $config = $manager->getConfigCollection(); - $packages = $manager->getPackages(); - - foreach ($config as $item) { - $type = $item->getType(); - $short_name = $item->getShortName(); - if (!isset($result[$type][$short_name])) { - $result[$type][$short_name] = []; - } - if (!empty($item->getPackage())) { - $package = $packages[$item->getPackage()]; - $result[$type][$short_name][] = $package->getMachineName(); - } - } - - return $result; - } - - /** - * Prints a list of filtered components. - */ - protected function componentPrint($filtered_components) { - $rows = []; - foreach ($filtered_components['components'] as $source => $components) { - foreach ($components as $name => $value) { - $row = ['source' => $source . ':' . $name]; - if (isset($filtered_components['sources'][$source . ':' . $name])) { - $row['source'] = dt('Provided by') . ': ' . $filtered_components['sources'][$source . ':' . $name]; - } - $rows[] = $row; - } - } - - return new RowsOfFields($rows); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/ConfigurationItem.php b/sites/all/modules/contrib/admin/features/src/ConfigurationItem.php deleted file mode 100644 index 52e395861..000000000 --- a/sites/all/modules/contrib/admin/features/src/ConfigurationItem.php +++ /dev/null @@ -1,351 +0,0 @@ -name = $name; - $this->data = $data; - - $properties = get_object_vars($this); - foreach ($additional_properties as $property => $value) { - if (!array_key_exists($property, $properties)) { - throw new \InvalidArgumentException('Invalid property: ' . $property); - } - $this->{$property} = $value; - } - } - - /** - * Calculates the config type usable in configuration. - * - * By default Drupal uses system.simple as config type, which cannot be used - * inside configuration itself. Therefore convert it to system_simple. - * - * @param string $type - * The config type provided by core. - * - * @return string - * The config type as string without dots. - */ - public static function fromConfigTypeToConfigString($type) { - return $type == 'system.simple' ? FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG : $type; - } - - /** - * Converts a config type string in configuration back to the config type. - * - * @param string $type - * The config type as string without dots. - * - * @return string - * The config type provided by core. - */ - public static function fromConfigStringToConfigType($type) { - return $type == FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG ? 'system.simple' : $type; - } - - /** - * @return mixed - */ - public function getName() { - return $this->name; - } - - /** - * @param mixed $name - * - * @return ConfigurationItem - */ - public function setName($name) { - $this->name = $name; - return $this; - } - - /** - * @return mixed - */ - public function getShortName() { - return $this->shortName; - } - - /** - * @param mixed $shortName - * - * @return ConfigurationItem - */ - public function setShortName($shortName) { - $this->shortName = $shortName; - return $this; - } - - /** - * @return mixed - */ - public function getLabel() { - return $this->label; - } - - /** - * @param mixed $label - * - * @return ConfigurationItem - */ - public function setLabel($label) { - $this->label = $label; - return $this; - } - - /** - * @return mixed - */ - public function getType() { - return $this->type; - } - - /** - * @param mixed $type - * - * @return ConfigurationItem - */ - public function setType($type) { - $this->type = $type; - return $this; - } - - /** - * @return mixed - */ - public function getData() { - return $this->data; - } - - /** - * @param mixed array - * - * @return ConfigurationItem - */ - public function setData(array $data) { - $this->data = $data; - return $this; - } - - /** - * @return string[] - */ - public function getDependents() { - return $this->dependents; - } - - /** - * @param array $dependents - * - * @return ConfigurationItem - */ - public function setDependents($dependents) { - $this->dependents = $dependents; - return $this; - } - - /** - * @return mixed - */ - public function getSubdirectory() { - return $this->subdirectory; - } - - /** - * @param mixed $subdirectory - * - * @return ConfigurationItem - */ - public function setSubdirectory($subdirectory) { - $this->subdirectory = $subdirectory; - return $this; - } - - /** - * @return mixed - */ - public function getPackage() { - return $this->package; - } - - /** - * @param mixed $package - * - * @return ConfigurationItem - */ - public function setPackage($package) { - $this->package = $package; - return $this; - } - - /** - * @return boolean - */ - public function isExcluded() { - return $this->excluded; - } - - /** - * @param boolean $excluded - * - * @return ConfigurationItem - */ - public function setExcluded($excluded) { - $this->excluded = $excluded; - return $this; - } - - /** - * @return boolean - */ - public function isProviderExcluded() { - return $this->providerExcluded; - } - - /** - * @param boolean $providerExcluded - * - * @return ConfigurationItem - */ - public function setProviderExcluded($providerExcluded) { - $this->providerExcluded = $providerExcluded; - return $this; - } - - /** - * @return string - */ - public function getProvider() { - return $this->provider; - } - - /** - * @param string $provider - */ - public function setProvider($provider) { - $this->provider = $provider; - return $this; - } - - /** - * @return string[] - */ - public function getPackageExcluded() { - return $this->packageExcluded; - } - - /** - * @param array $packageExcluded - * - * @return ConfigurationItem - */ - public function setPackageExcluded($packageExcluded) { - $this->packageExcluded = $packageExcluded; - return $this; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Controller/FeaturesController.php b/sites/all/modules/contrib/admin/features/src/Controller/FeaturesController.php deleted file mode 100644 index e456577e3..000000000 --- a/sites/all/modules/contrib/admin/features/src/Controller/FeaturesController.php +++ /dev/null @@ -1,77 +0,0 @@ -get('csrf_token') - ); - } - - /** - * Constructs a FeaturesController object. - * - * @param \Drupal\system\FileDownloadController $file_download_controller - * The file download controller. - * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token - * The CSRF token generator. - */ - public function __construct(FileDownloadController $file_download_controller, CsrfTokenGenerator $csrf_token) { - $this->fileDownloadController = $file_download_controller; - $this->csrfToken = $csrf_token; - } - - /** - * Downloads a tarball of the site configuration. - * - * @param string $uri - * The URI to download. - * @param \Symfony\Component\HttpFoundation\Request $request - * The request. - * - * @return \Symfony\Component\HttpFoundation\BinaryFileResponse - * The downloaded file. - */ - public function downloadExport($uri, Request $request) { - if ($uri) { - // @todo Simplify once https://www.drupal.org/node/2630920 is solved. - if (!$this->csrfToken->validate($request->query->get('token'), $uri)) { - throw new AccessDeniedHttpException(); - } - - $request = new Request(['file' => $uri]); - return $this->fileDownloadController->download($request, 'temporary'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Entity/FeaturesBundle.php b/sites/all/modules/contrib/admin/features/src/Entity/FeaturesBundle.php deleted file mode 100644 index ced0be6de..000000000 --- a/sites/all/modules/contrib/admin/features/src/Entity/FeaturesBundle.php +++ /dev/null @@ -1,310 +0,0 @@ -id in the long run. - return $this->getMachineName(); - } - - /** - * {@inheritdoc} - */ - public function isDefault() { - return $this->machine_name == static::DEFAULT_BUNDLE; - } - - /** - * {@inheritdoc} - */ - public function getMachineName() { - return $this->machine_name; - } - - /** - * {@inheritdoc} - */ - public function setMachineName($machine_name) { - $this->machine_name = $machine_name; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function setName($name) { - $this->name = $name; - } - - /** - * {@inheritdoc} - */ - public function getFullName($short_name) { - if ($this->isDefault() || - // If it's already prefixed, don't repeat the prefix. - $this->inBundle($short_name) || - // If we are a profile, don't duplicate the bundle if same as profile. - $this->isProfilePackage($short_name)) { - return $short_name; - } - else { - return $this->machine_name . '_' . $short_name; - } - } - - /** - * {@inheritdoc} - */ - public function getShortName($machine_name) { - if (!$this->isProfilePackage($machine_name) && $this->inBundle($machine_name)) { - return substr($machine_name, strlen($this->getMachineName()) + 1, strlen($machine_name) - strlen($this->getMachineName()) - 1); - } - return $machine_name; - } - - /** - * {@inheritdoc} - */ - public function inBundle($machine_name) { - return ($this->isProfilePackage($machine_name) || strpos($machine_name, $this->machine_name . '_') === 0); - } - - /** - * {@inheritdoc} - */ - public function isProfilePackage($machine_name) { - return ($this->isProfile() && $machine_name == $this->getProfileName()); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->description; - } - - /** - * {@inheritdoc} - */ - public function setDescription($description) { - $this->description = $description; - } - - /** - * {@inheritdoc} - */ - public function isProfile() { - return $this->is_profile; - } - - /** - * {@inheritdoc} - */ - public function setIsProfile($value) { - $this->is_profile = $value; - } - - /** - * {@inheritdoc} - */ - public function getProfileName() { - $name = $this->isProfile() ? $this->profile_name : ''; - // Use Settings::get to fetch current profile name so we can easily test. - return !empty($name) ? $name : Settings::get('install_profile'); - } - - /** - * {@inheritdoc} - */ - public function setProfileName($machine_name) { - $this->profile_name = $machine_name; - } - - /** - * {@inheritdoc} - */ - public function getEnabledAssignments() { - $list = []; - foreach ($this->assignments as $method_id => $method) { - if ($method['enabled']) { - $list[$method_id] = $method_id; - } - } - return $list; - } - - /** - * {@inheritdoc} - */ - public function setEnabledAssignments(array $assignments) { - // Add any new assignments that we don't yet know about. - $new_assignments = array_diff($assignments, array_keys($this->assignments)); - foreach ($new_assignments as $method_id) { - $this->assignments[$method_id] = $this->getAssignmentSettings($method_id); - } - - foreach ($this->assignments as $method_id => &$method) { - $method['enabled'] = in_array($method_id, $assignments); - } - } - - /** - * {@inheritdoc} - */ - public function getAssignmentWeights() { - $list = []; - foreach ($this->assignments as $method_id => $method) { - $list[$method_id] = $method['weight']; - } - return $list; - } - - /** - * {@inheritdoc} - */ - public function setAssignmentWeights(array $assignments) { - foreach ($this->assignments as $method_id => &$method) { - if (isset($assignments[$method_id])) { - $method['weight'] = $assignments[$method_id]; - } - } - } - - /** - * Return array of default settings for the given plugin method - * - * @param $method_id - * @return array - */ - protected function getDefaultSettings($method_id) { - $settings = ['enabled' => FALSE, 'weight' => 0]; - - $manager = \Drupal::service('plugin.manager.features_assignment_method'); - $definition = $manager->getDefinition($method_id); - - if (isset($definition['weight'])) { - $settings['weight'] = $definition['weight']; - } - if (isset($definition['default_settings'])) { - $settings += $definition['default_settings']; - } - - return $settings; - } - - /** - * {@inheritdoc} - */ - public function getAssignmentSettings($method_id = NULL) { - if (isset($method_id)) { - if (isset($this->assignments[$method_id])) { - return $this->assignments[$method_id]; - } - else { - // Use defaults. - return $this->getDefaultSettings($method_id); - } - } - else { - $list = []; - foreach (array_keys($this->assignments) as $method_id) { - $list[$method_id] = $this->getAssignmentSettings($method_id); - } - return $list; - } - } - - /** - * {@inheritdoc} - */ - public function setAssignmentSettings($method_id, array $settings) { - if (isset($method_id)) { - $this->assignments[$method_id] = $settings; - } - else { - foreach ($settings as $method_id => $method_settings) { - if (!empty($method_settings)) { - $this->setAssignmentSettings($method_id, $method_settings); - } - } - } - return $this; - } - - /** - * {@inheritdoc} - */ - public function remove() { - $this->delete(); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Exception/DomainException.php b/sites/all/modules/contrib/admin/features/src/Exception/DomainException.php deleted file mode 100644 index c496d3b0e..000000000 --- a/sites/all/modules/contrib/admin/features/src/Exception/DomainException.php +++ /dev/null @@ -1,7 +0,0 @@ -featuresManager = $features_manager; - $this->assignerManager = $assigner_manager; - $this->entityTypeManager = $entity_type_manager; - $this->configFactory = $config_factory; - $this->configStorage = $config_storage; - $this->bundles = $this->getBundleList(); - $this->currentBundle = $this->getBundle(FeaturesBundleInterface::DEFAULT_BUNDLE); - // Ensure bundle information is fresh. - $this->createBundlesFromPackages(); - } - - /** - * Initializes the injected features manager with the assigner. - * - * This should be called right after instantiating the assigner to make it - * available to the features manager without introducing a circular - * dependency. - */ - public function initFeaturesManager() { - $this->featuresManager->setAssigner($this); - } - - /** - * {@inheritdoc} - */ - public function reset() { - $this->methods = []; - $this->featuresManager->reset(); - } - - /** - * Gets enabled assignment methods. - * - * @return array - * An array of enabled assignment methods, sorted by weight. - */ - public function getEnabledAssigners() { - $enabled = $this->currentBundle->getEnabledAssignments(); - $weights = $this->currentBundle->getAssignmentWeights(); - foreach ($enabled as $key => $value) { - $enabled[$key] = $weights[$key]; - } - asort($enabled); - return $enabled; - } - - /** - * Clean up the package list after all config has been assigned - */ - protected function cleanup() { - $packages = $this->featuresManager->getPackages(); - foreach ($packages as $index => $package) { - if ($package->getStatus() === FeaturesManagerInterface::STATUS_NO_EXPORT && empty($package->getConfig()) && empty($package->getConfigOrig())) { - unset($packages[$index]); - } - } - $this->featuresManager->setPackages($packages); - } - - /** - * {@inheritdoc} - */ - public function assignConfigPackages($force = FALSE) { - foreach ($this->getEnabledAssigners() as $method_id => $info) { - $this->applyAssignmentMethod($method_id, $force); - } - $this->cleanup(); - } - - /** - * {@inheritdoc} - */ - public function applyAssignmentMethod($method_id, $force = FALSE) { - $this->getAssignmentMethodInstance($method_id)->assignPackages($force); - } - - /** - * {@inheritdoc} - */ - public function getAssignmentMethods() { - return $this->assignerManager->getDefinitions(); - } - - /** - * Returns an instance of the specified package assignment method. - * - * @param string $method_id - * The string identifier of the package assignment method to use to package - * configuration. - * - * @return \Drupal\features\FeaturesAssignmentMethodInterface - */ - protected function getAssignmentMethodInstance($method_id) { - if (!isset($this->methods[$method_id])) { - $instance = $this->assignerManager->createInstance($method_id, []); - $instance->setFeaturesManager($this->featuresManager); - $instance->setAssigner($this); - $instance->setEntityTypeManager($this->entityTypeManager); - $instance->setConfigFactory($this->configFactory); - $this->methods[$method_id] = $instance; - } - return $this->methods[$method_id]; - } - - /** - * {@inheritdoc} - */ - public function purgeConfiguration() { - // Ensure that we are getting the defined package assignment information. - // An invocation of \Drupal\Core\Extension\ModuleHandler::install() or - // \Drupal\Core\Extension\ModuleHandler::uninstall() could invalidate the - // cached information. - $this->assignerManager->clearCachedDefinitions(); - $this->featuresManager->reset(); - } - - /** - * {@inheritdoc} - */ - public function getBundle($name = NULL) { - if (empty($name)) { - return $this->currentBundle; - } - elseif (isset($this->bundles[$name])) { - return $this->bundles[$name]; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function setBundle(FeaturesBundleInterface $bundle, $current = TRUE) { - $this->bundles[$bundle->getMachineName()] = $bundle; - if (isset($this->currentBundle) && ($current || ($bundle->getMachineName() == $this->currentBundle->getMachineName()))) { - $this->currentBundle = $bundle; - } - } - - /** - * {@inheritdoc} - */ - public function findBundle(array $info, $features_info = NULL) { - $bundle = NULL; - if (!empty($features_info['bundle'])) { - $bundle = $this->getBundle($features_info['bundle']); - } - elseif (!empty($info['package'])) { - $bundle = $this->findBundleByName($info['package']); - } - if (!isset($bundle)) { - // Return the default bundle. - return $this->getBundle(FeaturesBundleInterface::DEFAULT_BUNDLE); - } - return $bundle; - } - - /** - * {@inheritdoc} - */ - public function setCurrent(FeaturesBundleInterface $bundle) { - $this->currentBundle = $bundle; - $session = \Drupal::request()->getSession(); - if (isset($session)) { - $session->set('features_current_bundle', $bundle->getMachineName()); - } - return $bundle; - } - - /** - * {@inheritdoc} - */ - public function getBundleList() { - if (empty($this->bundles)) { - $this->bundles = []; - foreach ($this->entityTypeManager->getStorage('features_bundle')->loadMultiple() as $machine_name => $bundle) { - $this->bundles[$machine_name] = $bundle; - } - } - return $this->bundles; - } - - /** - * {@inheritdoc} - */ - public function findBundleByName($name, $create = FALSE) { - $bundles = $this->getBundleList(); - foreach ($bundles as $machine_name => $bundle) { - if ($name == $bundle->getName()) { - return $bundle; - } - } - $machine_name = strtolower(str_replace([' ', '-'], '_', $name)); - if (isset($bundles[$machine_name])) { - return $bundles[$machine_name]; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function createBundleFromDefault($machine_name, $name = NULL, $description = NULL, $is_profile = FALSE, $profile_name = NULL) { - // Duplicate the default bundle to get its default configuration. - $default = $this->getBundle(FeaturesBundleInterface::DEFAULT_BUNDLE); - if (!$default) { - // If we don't have the default installed, generate it from the install - // config file. - $ext_storage = new ExtensionInstallStorage($this->configStorage); - $record = $ext_storage->read('features.bundle.default'); - $bundle_storage = $this->entityTypeManager->getStorage('features_bundle'); - $default = $bundle_storage->createFromStorageRecord($record); - } - - /** @var \Drupal\features\Entity\FeaturesBundle $bundle */ - $bundle = $default->createDuplicate(); - - $bundle->setMachineName($machine_name); - $name = !empty($name) ? $name : $machine_name; - $bundle->setName($name); - if (isset($description)) { - $bundle->setDescription($description); - } - else { - $bundle->setDescription(t('Auto-generated bundle from package @name', ['@name' => $name])); - } - $bundle->setIsProfile($is_profile); - if (isset($profile_name)) { - $bundle->setProfileName($profile_name); - } - $bundle->save(); - $this->setBundle($bundle); - - return $bundle; - } - - /** - * {@inheritdoc} - */ - public function createBundlesFromPackages() { - $existing_bundles = $this->getBundleList(); - $new_bundles = []; - // Only parse from installed features. - $modules = $this->featuresManager->getFeaturesModules(NULL, TRUE); - - foreach ($modules as $module) { - $info = $this->featuresManager->getExtensionInfo($module); - // @todo This entire function could be simplified a lot using packages. - $features_info = $this->featuresManager->getFeaturesInfo($module); - // Create a new bundle if: - // - the feature specifies a bundle and - // - that bundle doesn't yet exist locally. - // Allow profiles to override previous values. - if (!empty($features_info['bundle']) && - !isset($existing_bundles[$features_info['bundle']]) && - (!in_array($features_info['bundle'], $new_bundles) || $info['type'] == 'profile')) { - if ($info['type'] == 'profile') { - $new_bundle = [ - 'name' => $info['name'], - 'description' => $info['description'], - 'is_profile' => TRUE, - 'profile_name' => $module->getName(), - ]; - } - else { - $new_bundle = [ - 'name' => isset($info['package']) ? $info['package'] : ucwords(str_replace('_', ' ', $features_info['bundle'])), - 'description' => NULL, - 'is_profile' => FALSE, - 'profile_name' => NULL, - ]; - } - $new_bundle['machine_name'] = $features_info['bundle']; - $new_bundles[$new_bundle['machine_name']] = $new_bundle; - } - } - foreach ($new_bundles as $new_bundle) { - $this->createBundleFromDefault($new_bundle['machine_name'], $new_bundle['name'], $new_bundle['description'], $new_bundle['is_profile']); - } - - } - - /** - * {@inheritdoc} - */ - public function getBundleOptions() { - $list = $this->getBundleList(); - $result = []; - foreach ($list as $machine_name => $bundle) { - $result[$machine_name] = $bundle->getName(); - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function applyBundle($machine_name = NULL) { - $this->reset(); - $bundle = $this->loadBundle($machine_name); - if (isset($bundle)) { - $this->assignConfigPackages(); - return $this->currentBundle; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function renameBundle($old_machine, $new_machine) { - $is_current = (isset($this->currentBundle) && ($old_machine == $this->currentBundle->getMachineName())); - $bundle = $this->getBundle($old_machine); - if ($bundle->getMachineName() != '') { - // Remove old bundle from the list if it's not the Default bundle. - unset($this->bundles[$old_machine]); - } - $bundle->setMachineName($new_machine); - $this->setBundle($bundle); - // Put the bundle into the list with the correct name. - $this->bundles[$bundle->getMachineName()] = $bundle; - if ($is_current) { - $this->setCurrent($bundle); - } - return $bundle; - } - - /** - * {@inheritdoc} - */ - public function loadBundle($machine_name = NULL) { - if (!isset($machine_name)) { - $session = \Drupal::request()->getSession(); - if (isset($session)) { - $machine_name = isset($session) ? $session->get('features_current_bundle', FeaturesBundleInterface::DEFAULT_BUNDLE) : FeaturesBundleInterface::DEFAULT_BUNDLE; - } - } - $bundle = $this->getBundle($machine_name); - if (!isset($bundle)) { - // If bundle no longer exists then return default. - $bundle = $this->bundles[FeaturesBundleInterface::DEFAULT_BUNDLE]; - } - return $this->setCurrent($bundle); - } - - /** - * {@inheritdoc} - */ - public function removeBundle($machine_name) { - $bundle = $this->getBundle($machine_name); - if (isset($bundle) && !$bundle->isDefault()) { - unset($this->bundles[$machine_name]); - $bundle->remove(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesAssignerInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesAssignerInterface.php deleted file mode 100644 index 946c6ec8b..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesAssignerInterface.php +++ /dev/null @@ -1,228 +0,0 @@ - - * @endcode - * - * For more information, see - * @link http://drupal.org/node/2404473 Developing for Features 3.x @endlink - */ -interface FeaturesAssignerInterface { - - /** - * The package assignment method id for the package assigner itself. - */ - const METHOD_ID = 'assigner-default'; - - /** - * Resets the assigned packages and the method instances. - */ - public function reset(); - - /** - * Apply all enabled package assignment methods. - * - * @param bool $force - * (optional) If TRUE, assign config regardless of restrictions such as it - * being already assigned to a package. - */ - public function assignConfigPackages($force = FALSE); - - /** - * Applies a given package assignment method. - * - * @param string $method_id - * The string identifier of the package assignment method to use to package - * configuration. - * @param bool $force - * (optional) If TRUE, assign config regardless of restrictions such as it - * being already assigned to a package. - */ - public function applyAssignmentMethod($method_id, $force = FALSE); - - /** - * Returns the enabled package assignment methods. - * - * @return array - * An array of package assignment method IDs. - */ - public function getAssignmentMethods(); - - /** - * Resaves the configuration to purge missing assignment methods. - */ - public function purgeConfiguration(); - - /** - * Returns a FeaturesBundle object. - * - * @param string $name - * machine name of package set. If omitted, returns the current bundle. - * - * @return \Drupal\features\FeaturesBundleInterface - * A features bundle object. - */ - public function getBundle($name = NULL); - - /** - * Stores a features bundle. - * - * Added to list if machine_name is new. - * - * @param \Drupal\features\FeaturesBundleInterface $bundle - * A features bundle. - * @param bool $current - * Determine if the current bundle is set to $bundle. - * If False, the current bundle is only updated if it already has the same - * machine name as the $bundle. - */ - public function setBundle(FeaturesBundleInterface $bundle, $current = TRUE); - - /** - * Searches for a bundle that matches the $info.yml or $features.yml export. - * - * Creates a new bundle as needed. - * - * @param array $info - * The bundle info. - * @param mixed $features_info - * The features info. - * - * @return \Drupal\features\FeaturesBundleInterface - * A bundle. - */ - public function findBundle(array $info, $features_info = NULL); - - /** - * Sets the currently active bundle. - * - * Updates value in current SESSION. - * - * @param \Drupal\features\FeaturesBundleInterface $bundle - * A features bundle object. - */ - public function setCurrent(FeaturesBundleInterface $bundle); - - /** - * Returns an array of all existing features bundles. - * - * @return \Drupal\features\FeaturesBundleInterface[] - * Keyed by machine_name with value of - * \Drupal\features\FeaturesBundleInterface. - */ - public function getBundleList(); - - /** - * Returns a named bundle. - * - * First searches by Human name, then by machine_name. - * - * @param string $name - * The bundle name to search by. - * - * @return \Drupal\features\FeaturesBundleInterface - * A features bundle object. - */ - public function findBundleByName($name); - - /** - * Creates a new bundle by duplicating the default bundle and customizing. - * - * @param string $machine_name - * Machine name. - * @param string $name - * (optional) Human readable name of the bundle. - * @param string $description - * (optional) Description of the bundle. - * @param bool $is_profile - * (optional) TRUE if a profile is used with this bundle. - * @param string $profile_name - * (optional) The machine name of the profile. - * - * @return \Drupal\features\FeaturesBundleInterface - * A features bundle object. - */ - public function createBundleFromDefault($name, $machine_name = '', $description = '', $is_profile = FALSE, $profile_name = NULL); - - /** - * Creates bundles by parsing information from installed packages. - */ - public function createBundlesFromPackages(); - - /** - * Returns an array of bundle names suitable for a select option list. - * - * @return array - * An array of bundles, keyed by machine_name, with values being human - * readable names. - */ - public function getBundleOptions(); - - /** - * Makes the named bundle the current bundle. - * - * @param string $machine_name - * The name of a features bundle. If omitted, gets the last bundle from the - * Session. - * - * @return \Drupal\features\FeaturesBundleInterface - * A features bundle object. - */ - public function applyBundle($machine_name = NULL); - - /** - * Renames a bundle. - * - * @param string $old_machine - * The old machine name of a bundle. - * @param string $new_machine - * The new machine name of a bundle. - * - * @return \Drupal\features\FeaturesBundleInterface - * A features bundle object. - */ - public function renameBundle($old_machine, $new_machine); - - /** - * Loads a named bundle. - * - * @param string $machine_name - * (optional) The name of a features bundle. - * Defaults to NULL, gets the last bundle from the session. - * - * @return \Drupal\features\FeaturesBundleInterface - * A features bundle object. - */ - public function loadBundle($machine_name = NULL); - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodBase.php b/sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodBase.php deleted file mode 100644 index 2b7465756..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodBase.php +++ /dev/null @@ -1,124 +0,0 @@ -featuresManager = $features_manager; - } - - /** - * {@inheritdoc} - */ - public function setAssigner(FeaturesAssignerInterface $assigner) { - $this->assigner = $assigner; - } - - /** - * {@inheritdoc} - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) { - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public function setConfigFactory(ConfigFactoryInterface $config_factory) { - $this->configFactory = $config_factory; - } - - /** - * Assigns configuration of the types specified in a setting to a package. - * - * @param string $machine_name - * Machine name of the package. - * @param bool $force - * (optional) If TRUE, assign config regardless of restrictions such as it - * being already assigned to a package. - */ - protected function assignPackageByConfigTypes($machine_name, $force = FALSE) { - $current_bundle = $this->assigner->getBundle(); - $settings = $current_bundle->getAssignmentSettings($this->getPluginId()); - $types = $settings['types']['config']; - - $config_collection = $this->featuresManager->getConfigCollection(); - - foreach ($config_collection as $item_name => $item) { - // Don't assign configuration that's provided by an extension. - if (in_array($item->getType(), $types) && !($item->isProviderExcluded())) { - try { - $this->featuresManager->assignConfigPackage($machine_name, [$item_name]); - } - catch (\Exception $exception) { - \Drupal::logger('features')->error($exception->getMessage()); - } - } - } - } - - /** - * Assigns a given subdirectory to configuration of specified types. - * - * @param string $subdirectory - * The subdirectory that designated configuration should be exported to. - */ - protected function assignSubdirectoryByConfigTypes($subdirectory) { - $current_bundle = $this->assigner->getBundle(); - $settings = $current_bundle->getAssignmentSettings($this->getPluginId()); - $types = $settings['types']['config']; - - if (!empty($types)) { - $config_collection = $this->featuresManager->getConfigCollection(); - - foreach ($config_collection as &$item) { - if (in_array($item->getType(), $types)) { - $item->setSubdirectory($subdirectory); - } - } - // Clean up the $item pass by reference. - unset($item); - - $this->featuresManager->setConfigCollection($config_collection); - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodInterface.php deleted file mode 100644 index abb29f19d..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesAssignmentMethodInterface.php +++ /dev/null @@ -1,56 +0,0 @@ -alterInfo('features_assignment_info'); - $this->setCacheBackend($cache_backend, 'features_assignment_methods'); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesBundleInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesBundleInterface.php deleted file mode 100644 index 83dfbf5a9..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesBundleInterface.php +++ /dev/null @@ -1,240 +0,0 @@ -data, function (ConfigEntityDependency $entity) use ($type, $name) { - return $entity->hasDependency($type, $name); - }); - } - // If checking content, module, or theme dependencies, discover which - // entities are dependent on the entities that have a direct dependency. - foreach ($dependent_entities as $entity) { - $entities_to_check[] = $entity->getConfigDependencyName(); - } - } - $dependencies = array_merge($this->createGraphConfigEntityDependencies($entities_to_check), $dependent_entities); - if (!$this->sorted_graph) { - // Sort dependencies in the reverse order of the graph. So the least - // dependent is at the top. For example, this ensures that fields are - // always after field storages. This is because field storages need to be - // created before a field. - $this->sorted_graph = $this->getGraph(); - uasort($this->sorted_graph, [$this, 'sortGraph']); - } - return array_replace(array_intersect_key($this->sorted_graph, $dependencies), $dependencies); - } - - /** - * {@inheritdoc} - */ - public function setData(array $data) { - parent::setData($data); - $this->sorted_graph = NULL; - return $this; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesConfigInstaller.php b/sites/all/modules/contrib/admin/features/src/FeaturesConfigInstaller.php deleted file mode 100644 index da4c2a941..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesConfigInstaller.php +++ /dev/null @@ -1,109 +0,0 @@ -configInstaller = $config_installer; - $this->featuresManager = $features_manager; - - list($major, $minor, ) = explode('.', \Drupal::VERSION); - if ($major == 8 && $minor > 2) { - // D8.3 added the %install_profile% argument. - $install_profile = \Drupal::installProfile(); - parent::__construct($config_factory, $active_storage, $typed_config, $config_manager, $event_dispatcher, $install_profile); - } - else { - parent::__construct($config_factory, $active_storage, $typed_config, $config_manager, $event_dispatcher); - } - } - - /** - * {@inheritdoc} - */ - protected function findPreExistingConfiguration(StorageInterface $storage) { - // Override - // Drupal\Core\Config\ConfigInstaller::findPreExistingConfiguration(). - // Allow config that already exists coming from Features. - $features_config = array_keys($this->featuresManager->listExistingConfig()); - // Map array so we can use isset instead of in_array for faster access. - $features_config = array_combine($features_config, $features_config); - $existing_configuration = []; - // Gather information about all the supported collections. - $collection_info = $this->configManager->getConfigCollectionInfo(); - - foreach ($collection_info->getCollectionNames() as $collection) { - $config_to_create = array_keys($this->getConfigToCreate($storage, $collection)); - $active_storage = $this->getActiveStorages($collection); - foreach ($config_to_create as $config_name) { - if ($active_storage->exists($config_name)) { - // Test if config is part of a Feature package. - if (!isset($features_config[$config_name])) { - $existing_configuration[$collection][] = $config_name; - } - } - } - } - return $existing_configuration; - } - - /** - * Creates configuration in a collection based on the provided list. - * - * @param string $collection - * The configuration collection. - * @param array $config_to_create - * An array of configuration data to create, keyed by name. - */ - public function createConfiguration($collection, array $config_to_create) { - return parent::createConfiguration($collection, $config_to_create); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStorages.php b/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStorages.php deleted file mode 100644 index 67dce968e..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStorages.php +++ /dev/null @@ -1,121 +0,0 @@ -configStorage = $config_storage; - } - - /** - * {@inheritdoc} - */ - public function getExtensionStorages() { - return $this->extensionStorages; - } - - /** - * {@inheritdoc} - */ - public function addStorage($directory = InstallStorage::CONFIG_INSTALL_DIRECTORY) { - $this->extensionStorages[$directory] = new FeaturesInstallStorage($this->configStorage, $directory); - $this->reset(); - } - - /** - * {@inheritdoc} - */ - public function read($name) { - $list = $this->listAllByDirectory(''); - if (isset($list[$name])) { - $directory = $list[$name]; - return $this->extensionStorages[$directory]->read($name); - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function listAll($prefix = '') { - return array_keys($this->listAllByDirectory($prefix)); - } - - /** - * {@inheritdoc} - */ - public function listExtensionConfig(Extension $extension) { - $extension_config = []; - foreach ($this->extensionStorages as $directory => $extension_storage) { - $extension_config = array_merge($extension_config, array_keys($extension_storage->getComponentNames([ - $extension->getName() => $extension, - ]))); - } - return $extension_config; - } - - /** - * Resets packages and configuration assignment. - */ - protected function reset() { - $this->configurationLists = []; - } - - /** - * Returns a list of all configuration available from extensions. - * - * @param string $prefix - * (optional) The prefix to search for. If omitted, all configuration object - * names that exist are returned. - * - * @return array - * An array with configuration item names as keys and configuration - * directories as values. - */ - protected function listAllByDirectory($prefix = '') { - if (!isset($this->configurationLists[$prefix])) { - $this->configurationLists[$prefix] = []; - foreach ($this->extensionStorages as $directory => $extension_storage) { - $this->configurationLists[$prefix] += array_fill_keys($extension_storage->listAll($prefix), $directory); - } - } - return $this->configurationLists[$prefix]; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectory.php b/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectory.php deleted file mode 100644 index 6c0269e9e..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectory.php +++ /dev/null @@ -1,24 +0,0 @@ -configurationLists[$prefix])) { - $this->configurationLists[$prefix] = []; - foreach ($this->extensionStorages as $directory => $extension_storage) { - $this->configurationLists[$prefix] += array_fill_keys($extension_storage->listAll($prefix), $directory); - } - } - return $this->configurationLists[$prefix]; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectoryInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectoryInterface.php deleted file mode 100644 index e955cecce..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesExtensionStoragesByDirectoryInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -featuresManager = $features_manager; - } - - /** - * {@inheritdoc} - */ - public function setAssigner(FeaturesAssignerInterface $assigner) { - $this->assigner = $assigner; - } - - /** - * {@inheritdoc} - */ - public function exportFormSubmit(array &$form, FormStateInterface $form_state) { - - } - - /** - * Merges an info file into a package's info file. - * - * @param string $package_info - * The Yaml encoded package info. - * @param string $info_file_uri - * The info file's URI. - */ - protected function mergeInfoFile($package_info, $info_file_uri) { - $package_info = Yaml::decode($package_info); - /** @var \Drupal\Core\Extension\InfoParserInterface $existing_info */ - $existing_info = \Drupal::service('info_parser')->parse($info_file_uri); - return Yaml::encode($this->featuresManager->mergeInfoArray($existing_info, $package_info)); - } - - /** - * {@inheritdoc} - */ - public function prepare(array &$packages = [], FeaturesBundleInterface $bundle = NULL) { - // If no packages were specified, get all packages. - if (empty($packages)) { - $packages = $this->featuresManager->getPackages(); - } - - // If any packages exist, read in their files. - $existing_packages = $this->featuresManager->listPackageDirectories(array_keys($packages), $bundle); - - foreach ($packages as &$package) { - list($full_name, $path) = $this->featuresManager->getExportInfo($package, $bundle); - if (empty($package->getDirectory())) { - $package->setDirectory($path); - } - - // If this is the profile, its directory is already assigned. - if (!isset($bundle) || !$bundle->isProfilePackage($package->getMachineName())) { - $current_path = $package->getDirectory(); - if (strpos($current_path, $full_name) < strlen($current_path) - strlen($full_name)) { - // Only append package name if it isn't already there. - $package->setDirectory($package->getDirectory() . '/' . $full_name); - } - } - - $this->preparePackage($package, $existing_packages, $bundle); - } - // Clean up the $package pass by reference. - unset($package); - } - - /** - * Performs any required changes on a package prior to generation. - * - * @param \Drupal\features\Package $package - * The package to be prepared. - * @param array $existing_packages - * An array of existing packages with machine names as keys and paths as - * values. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * Optional bundle used for export - */ - abstract protected function preparePackage(Package $package, array $existing_packages, FeaturesBundleInterface $bundle = NULL); - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodInterface.php deleted file mode 100644 index 92b939280..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesGenerationMethodInterface.php +++ /dev/null @@ -1,67 +0,0 @@ -cacheBackend = $cache_backend; - $this->cacheKeyPrefix = 'features_generation_methods'; - $this->cacheKey = 'features_generation_methods'; - $this->alterInfo('features_generation_info'); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesGenerator.php b/sites/all/modules/contrib/admin/features/src/FeaturesGenerator.php deleted file mode 100644 index ae21e60b7..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesGenerator.php +++ /dev/null @@ -1,173 +0,0 @@ -featuresManager = $features_manager; - $this->generatorManager = $generator_manager; - $this->assigner = $assigner; - } - - /** - * Initializes the injected features manager with the generator. - * - * This should be called right after instantiating the generator to make it - * available to the features manager without introducing a circular - * dependency. - */ - public function initFeaturesManager() { - $this->featuresManager->setGenerator($this); - } - - /** - * {@inheritdoc} - */ - public function reset() { - $this->methods = []; - } - - /** - * {@inheritdoc} - */ - public function applyGenerationMethod($method_id, array $packages = [], FeaturesBundleInterface $bundle = NULL) { - $method = $this->getGenerationMethodInstance($method_id); - $method->prepare($packages, $bundle); - return $method->generate($packages, $bundle); - } - - /** - * {@inheritdoc} - */ - public function applyExportFormSubmit($method_id, &$form, FormStateInterface $form_state) { - $method = $this->getGenerationMethodInstance($method_id); - $method->exportFormSubmit($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function getGenerationMethods() { - return $this->generatorManager->getDefinitions(); - } - - /** - * Returns an instance of the specified package generation method. - * - * @param string $method_id - * The string identifier of the package generation method to use to package - * configuration. - * - * @return \Drupal\features\FeaturesGenerationMethodInterface - */ - protected function getGenerationMethodInstance($method_id) { - if (!isset($this->methods[$method_id])) { - $instance = $this->generatorManager->createInstance($method_id, []); - $instance->setFeaturesManager($this->featuresManager); - $instance->setAssigner($this->assigner); - $this->methods[$method_id] = $instance; - } - return $this->methods[$method_id]; - } - - /** - * {@inheritdoc} - */ - public function generatePackages($method_id, FeaturesBundleInterface $bundle, array $package_names = []) { - $this->featuresManager->setPackageBundleNames($bundle, $package_names); - return $this->generate($method_id, $bundle, $package_names); - } - - /** - * Generates a file representation of configuration packages and, optionally, - * an install profile. - * - * @param string $method_id - * The ID of the generation method to use. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * The bundle used for the generation. - * @param string[] $package_names - * Names of packages to be generated. If none are specified, all - * available packages will be added. - * - * @return array - * Array of results for profile and/or packages, each result including the - * following keys: - * - 'success': boolean TRUE or FALSE for successful writing. - * - 'display': boolean TRUE if the message should be displayed to the - * user, otherwise FALSE. - * - 'message': a message about the result of the operation. - * - 'variables': an array of substitutions to be used in the message. - */ - protected function generate($method_id, FeaturesBundleInterface $bundle, array $package_names = []) { - $packages = $this->featuresManager->getPackages(); - - // Filter out the packages that weren't requested. - if (!empty($package_names)) { - $packages = array_intersect_key($packages, array_fill_keys($package_names, NULL)); - } - - $this->featuresManager->assignInterPackageDependencies($bundle, $packages); - - // Prepare the files. - $this->featuresManager->prepareFiles($packages); - - $return = $this->applyGenerationMethod($method_id, $packages, $bundle); - - foreach ($return as $message) { - if ($message['display']) { - $type = $message['success'] ? 'status' : 'error'; - drupal_set_message($this->t($message['message'], $message['variables']), $type); - } - $type = $message['success'] ? 'notice' : 'error'; - \Drupal::logger('features')->{$type}($message['message'], $message['variables']); - } - return $return; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesGeneratorInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesGeneratorInterface.php deleted file mode 100644 index 0cafa1451..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesGeneratorInterface.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @endcode - * - * For more information, see - * @link http://drupal.org/node/2404473 Developing for Features 3.x @endlink - */ -interface FeaturesGeneratorInterface { - - /** - * The package generation method id for the package generator itself. - */ - const METHOD_ID = 'generator-default'; - - /** - * Resets the assigned packages and the method instances. - */ - public function reset(); - - /** - * Apply a given package generation method. - * - * @param string $method_id - * The string identifier of the package generation method to use to package - * configuration. - * @param array $packages - * Array of package data. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * The optional bundle used for the generation. Used to generate profiles. - * - * @return array - * Array of results for profile and/or packages, each result including the - * following keys: - * - 'success': boolean TRUE or FALSE for successful writing. - * - 'display': boolean TRUE if the message should be displayed to the - * user, otherwise FALSE. - * - 'message': a message about the result of the operation. - * - 'variables': an array of substitutions to be used in the message. - */ - public function applyGenerationMethod($method_id, array $packages = [], FeaturesBundleInterface $bundle = NULL); - - /** - * Responds to the submission of - * \Drupal\features_ui\Form\FeaturesExportForm. - */ - public function applyExportFormSubmit($method_id, &$form, FormStateInterface $form_state); - - /** - * Returns the enabled package generation methods. - * - * @return array - * An array of package generation method definitions keyed by method id. - */ - public function getGenerationMethods(); - - /** - * Generates file representations of configuration packages. - * - * @param string $method_id - * The ID of the generation method to use. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * The bundle used for the generation. - * @param array $package_names - * Array of names of packages to be generated. If none are specified, all - * available packages will be added. - */ - public function generatePackages($method_id, FeaturesBundleInterface $bundle, array $package_names = []); - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesInstallStorage.php b/sites/all/modules/contrib/admin/features/src/FeaturesInstallStorage.php deleted file mode 100644 index 666b5d680..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesInstallStorage.php +++ /dev/null @@ -1,163 +0,0 @@ - 2) { - // D8.3 added the %profile% argument. - $profile = \Drupal::installProfile(); - parent::__construct($config_storage, $directory, $collection, FALSE, $profile); - } - else { - parent::__construct($config_storage, $directory, $collection, FALSE); - } - } - - /** - * Returns a map of all config object names and their folders. - * - * The list is based on installed modules and themes. The active - * configuration storage is used rather than - * \Drupal\Core\Extension\ModuleHandler and - * \Drupal\Core\Extension\ThemeHandler in order to resolve circular - * dependencies between these services and - * \Drupal\Core\Config\ConfigInstaller and - * \Drupal\Core\Config\TypedConfigManager. - * - * NOTE: This code is copied from ExtensionInstallStorage::getAllFolders() with - * the following changes (Notes in CHANGED below) - * - Load all modules whether installed or not - * - * @return array - * An array mapping config object names with directories. - */ - public function getAllFolders() { - if (!isset($this->folders)) { - $this->folders = []; - $this->folders += $this->getCoreNames(); - - $install_profile = Settings::get('install_profile'); - $profile = drupal_get_profile(); - $extensions = $this->configStorage->read('core.extension'); - // @todo Remove this scan as part of https://www.drupal.org/node/2186491 - $listing = new ExtensionDiscovery(\Drupal::root()); - - // CHANGED START: Add profile directories for any bundles that use a profile. - $listing->setProfileDirectoriesFromSettings(); - $profile_directories = $listing->getProfileDirectories(); - if ($this->includeProfile) { - // Add any profiles used in bundles. - /** @var \Drupal\features\FeaturesAssignerInterface $assigner */ - $assigner = \Drupal::service('features_assigner'); - $bundles = $assigner->getBundleList(); - foreach ($bundles as $bundle_name => $bundle) { - if ($bundle->isProfile()) { - // Register the profile directory. - $profile_directory = 'profiles/' . $bundle->getProfileName(); - if (is_dir($profile_directory)) { - $profile_directories[] = $profile_directory; - } - } - } - } - $listing->setProfileDirectories($profile_directories); - // CHANGED END - - if (!empty($extensions['module'])) { - - // CHANGED START: Find ANY modules, not just installed ones. - //$modules = $extensions['module']; - $module_list_scan = $listing->scan('module'); - $modules = $module_list_scan; - // CHANGED END - - // Remove the install profile as this is handled later. - unset($modules[$install_profile]); - $profile_list = $listing->scan('profile'); - if ($profile && isset($profile_list[$profile])) { - // Prime the drupal_get_filename() static cache with the profile info - // file location so we can use drupal_get_path() on the active profile - // during the module scan. - // @todo Remove as part of https://www.drupal.org/node/2186491 - drupal_get_filename('profile', $profile, $profile_list[$profile]->getPathname()); - } - // CHANGED START: Put Features modules first in list returned. - // to allow features to override config provided by other extensions. - $featuresManager = \Drupal::service('features.manager'); - $features_list = []; - $module_list = []; - foreach (array_keys($module_list_scan) as $module) { - if ($featuresManager->isFeatureModule($module_list_scan[$module])) { - $features_list[$module] = $module_list_scan[$module]; - } - else { - $module_list[$module] = $module_list_scan[$module]; - } - } - $this->folders += $this->getComponentNames($features_list); - $this->folders += $this->getComponentNames($module_list); - // CHANGED END - } - if (!empty($extensions['theme'])) { - $theme_list_scan = $listing->scan('theme'); - foreach (array_keys($extensions['theme']) as $theme) { - if (isset($theme_list_scan[$theme])) { - $theme_list[$theme] = $theme_list_scan[$theme]; - } - } - $this->folders += $this->getComponentNames($theme_list); - } - - if ($this->includeProfile) { - // The install profile can override module default configuration. We do - // this by replacing the config file path from the module/theme with the - // install profile version if there are any duplicates. - if (isset($profile)) { - if (!isset($profile_list)) { - $profile_list = $listing->scan('profile'); - } - if (isset($profile_list[$profile])) { - $profile_folders = $this->getComponentNames([$profile_list[$profile]]); - $this->folders = $profile_folders + $this->folders; - } - } - } - } - - return $this->folders; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesManager.php b/sites/all/modules/contrib/admin/features/src/FeaturesManager.php deleted file mode 100644 index 07c46e042..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesManager.php +++ /dev/null @@ -1,1399 +0,0 @@ -root = $root; - $this->entityTypeManager = $entity_type_manager; - $this->configStorage = $config_storage; - $this->configManager = $config_manager; - $this->moduleHandler = $module_handler; - $this->configFactory = $config_factory; - $this->configReverter = $config_reverter; - $this->settings = $config_factory->getEditable('features.settings'); - $this->extensionStorages = new FeaturesExtensionStoragesByDirectory($this->configStorage); - $this->extensionStorages->addStorage(InstallStorage::CONFIG_INSTALL_DIRECTORY); - $this->extensionStorages->addStorage(InstallStorage::CONFIG_OPTIONAL_DIRECTORY); - $this->packages = []; - $this->packagesPrefixed = FALSE; - $this->configCollection = []; - } - - /** - * {@inheritdoc} - */ - public function setRoot($root) { - $this->root = $root; - // Clear cache. - $this->featureInfoCache = []; - } - - /** - * {@inheritdoc} - */ - public function getActiveStorage() { - return $this->configStorage; - } - - /** - * {@inheritdoc} - */ - public function getExtensionStorages() { - return $this->extensionStorages; - } - - /** - * {@inheritdoc} - */ - public function getFullName($type, $name) { - if ($type == FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG || !$type) { - return $name; - } - - $definition = $this->entityTypeManager->getDefinition($type); - $prefix = $definition->getConfigPrefix() . '.'; - return $prefix . $name; - } - - /** - * {@inheritdoc} - */ - public function getConfigType($fullname) { - $result = [ - 'type' => '', - 'name_short' => '', - ]; - $prefix = FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG . '.'; - if (strpos($fullname, $prefix) !== FALSE) { - $result['type'] = FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG; - $result['name_short'] = substr($fullname, strlen($prefix)); - } - else { - foreach ($this->entityTypeManager->getDefinitions() as $entity_type => $definition) { - if ($definition->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface')) { - $prefix = $definition->getConfigPrefix() . '.'; - if (strpos($fullname, $prefix) === 0) { - $result['type'] = $entity_type; - $result['name_short'] = substr($fullname, strlen($prefix)); - } - } - } - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function reset() { - $this->packages = []; - // Don't use getConfigCollection because reset() may be called in - // cases where we don't need to load config. - foreach ($this->configCollection as $config) { - $config->setPackage(NULL); - } - } - - /** - * {@inheritdoc} - */ - public function getConfigCollection($reset = FALSE) { - $this->initConfigCollection($reset); - return $this->configCollection; - } - - /** - * {@inheritdoc} - */ - public function setConfigCollection(array $config_collection) { - $this->configCollection = $config_collection; - } - - /** - * {@inheritdoc} - */ - public function getPackages() { - return $this->packages; - } - - /** - * {@inheritdoc} - */ - public function setPackages(array $packages) { - $this->packages = $packages; - } - - /** - * {@inheritdoc} - */ - public function getPackage($machine_name) { - if (isset($this->packages[$machine_name])) { - return $this->packages[$machine_name]; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function findPackage($machine_name) { - $result = $this->getPackage($machine_name); - if (!isset($result)) { - // Didn't find direct match, but now go through and look for matching - // full name (bundle_machinename) - foreach ($this->packages as $name => $package) { - if ($package->getFullName() == $machine_name) { - return $this->packages[$name]; - } - } - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function setPackage(Package $package) { - if ($package->getMachineName()) { - $this->packages[$package->getMachineName()] = $package; - } - } - - /** - * {@inheritdoc} - */ - public function loadPackage($module_name, $any = FALSE) { - $package = $this->getPackage($module_name); - // Load directly from module if packages are not loaded or - // if we want to include ANY module regardless of its a feature. - if ((empty($this->packages) || $any) && !isset($package)) { - $module_list = $this->moduleHandler->getModuleList(); - if (!empty($module_list[$module_name])) { - $extension = $module_list[$module_name]; - $package = $this->initPackageFromExtension($extension); - $config = $this->listExtensionConfig($extension); - $package->setConfigOrig($config); - $package->setStatus(FeaturesManagerInterface::STATUS_INSTALLED); - } - } - return $package; - } - - /** - * {@inheritdoc} - */ - public function filterPackages(array $packages, $namespace = '', $only_exported = FALSE) { - $result = []; - /** @var \Drupal\features\Package $package */ - foreach ($packages as $key => $package) { - // A package matches the namespace if: - // - it's prefixed with the namespace, or - // - it's assigned to a bundle named for the namespace, or - // - the namespace is the default bundle and it has an empty bundle, and - // - we're not removing only exported packages, or - // - we are removing only exported packages and it's not exported. - if ((strpos($package->getMachineName(), $namespace . '_') === 0 || - ($package->getBundle() && $package->getBundle() === $namespace) || - ($namespace === FeaturesBundleInterface::DEFAULT_BUNDLE && empty($package->getBundle()))) && - (!$only_exported || ($package->getStatus() === FeaturesManagerInterface::STATUS_NO_EXPORT))) { - $result[$key] = $package; - } - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function getAssigner() { - if (empty($this->assigner)) { - $this->setAssigner(\Drupal::service('features_assigner')); - } - return $this->assigner; - } - - /** - * {@inheritdoc} - */ - public function setAssigner(FeaturesAssignerInterface $assigner) { - $this->assigner = $assigner; - $this->reset(); - } - - /** - * {@inheritdoc} - */ - public function getGenerator() { - return $this->generator; - } - - /** - * {@inheritdoc} - */ - public function setGenerator(FeaturesGeneratorInterface $generator) { - $this->generator = $generator; - } - - /** - * {@inheritdoc} - */ - public function getExportSettings() { - return $this->settings->get('export'); - } - - /** - * {@inheritdoc} - */ - public function getSettings() { - return $this->settings; - } - - /** - * {@inheritdoc} - */ - public function getExtensionInfo(Extension $extension) { - return \Drupal::service('info_parser')->parse($this->root . '/' . $extension->getPathname()); - } - - /** - * {@inheritdoc} - */ - public function isFeatureModule(Extension $module, FeaturesBundleInterface $bundle = NULL) { - if ($features_info = $this->getFeaturesInfo($module)) { - // If no bundle was requested, it's enough that this is a feature. - if (is_null($bundle)) { - return TRUE; - } - // If the default bundle was requested, look for features where - // the bundle is not set. - elseif ($bundle->isDefault()) { - return !isset($features_info['bundle']); - } - // If we have a bundle name, look for it. - else { - return (isset($features_info['bundle']) && ($features_info['bundle'] == $bundle->getMachineName())); - } - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function listPackageDirectories(array $machine_names = [], FeaturesBundleInterface $bundle = NULL) { - if (empty($machine_names)) { - $machine_names = array_keys($this->getPackages()); - } - - // If the bundle is a profile, then add the profile's machine name. - if (isset($bundle) && $bundle->isProfile() && !in_array($bundle->getProfileName(), $machine_names)) { - $machine_names[] = $bundle->getProfileName(); - } - - // If we are checking the default bundle, return all features. - if (isset($bundle) && $bundle->isDefault()) { - $bundle = NULL; - } - - $modules = $this->getFeaturesModules($bundle); - // Filter to include only the requested packages. - $modules = array_filter($modules, function ($module) use ($bundle, $machine_names) { - return in_array($module->getName(), $machine_names); - }); - - $directories = []; - foreach ($modules as $module) { - $directories[$module->getName()] = $module->getPath(); - } - - return $directories; - } - - /** - * {@inheritdoc} - */ - public function getAllModules() { - static $modules; - - if (!isset($modules)) { - // ModuleHandler::getModuleDirectories() returns data only for installed - // modules. system_rebuild_module_data() includes only the site's install - // profile directory, while we may need to include a custom profile. - // @see _system_rebuild_module_data(). - $listing = new ExtensionDiscovery($this->root); - - $profile_directories = $listing->setProfileDirectoriesFromSettings()->getProfileDirectories(); - $installed_profile = $this->drupalGetProfile(); - if (isset($bundle) && $bundle->isProfile()) { - $profile_directory = 'profiles/' . $bundle->getProfileName(); - if (($bundle->getProfileName() != $installed_profile) && is_dir($profile_directory)) { - $profile_directories[] = $profile_directory; - } - } - $listing->setProfileDirectories($profile_directories); - - // Find modules. - $modules = $listing->scan('module'); - - // Find installation profiles. - $profiles = $listing->scan('profile'); - - foreach ($profiles as $key => $profile) { - $modules[$key] = $profile; - } - } - - return $modules; - } - - /** - * {@inheritdoc} - */ - public function getFeaturesModules(FeaturesBundleInterface $bundle = NULL, $installed = FALSE) { - $modules = $this->getAllModules(); - - // Filter by bundle. - $features_manager = $this; - $modules = array_filter($modules, function ($module) use ($features_manager, $bundle) { - return $features_manager->isFeatureModule($module, $bundle); - }); - - // Filtered by installed status. - if ($installed) { - $features_manager = $this; - $modules = array_filter($modules, function ($extension) use ($features_manager) { - return $features_manager->extensionEnabled($extension); - }); - } - - return $modules; - } - - /** - * {@inheritdoc} - */ - public function extensionEnabled(Extension $extension) { - return $this->moduleHandler->moduleExists($extension->getName()); - } - - /** - * {@inheritdoc} - */ - public function initPackage($machine_name, $name = NULL, $description = '', $type = 'module', FeaturesBundleInterface $bundle = NULL, Extension $extension = NULL) { - if (isset($this->packages[$machine_name])) { - return $this->packages[$machine_name]; - } - // Also look for existing package within the bundle - elseif (isset($bundle) && isset($this->packages[$bundle->getFullName($machine_name)])) { - return $this->packages[$bundle->getFullName($machine_name)]; - } - return $this->packages[$machine_name] = $this->getPackageObject($machine_name, $name, $description, $type, $bundle, $extension); - } - - /** - * {@inheritdoc} - */ - public function initPackageFromExtension(Extension $extension) { - $info = $this->getExtensionInfo($extension); - $features_info = $this->getFeaturesInfo($extension); - $bundle = $this->getAssigner()->findBundle($info, $features_info); - // Use the full extension name as the short_name. Important to allow - // multiple modules with different namespaces such as oa_media, test_media. - $short_name = $extension->getName(); - return $this->initPackage($short_name, $info['name'], !empty($info['description']) ? $info['description'] : '', $info['type'], $bundle, $extension); - } - - /** - * Helper function to update dependencies array for a specific config item - * @param \Drupal\features\ConfigurationItem $config a config item - * @param array $module_list - * @return array $dependencies - */ - protected function getConfigDependency(ConfigurationItem $config, $module_list = []) { - $dependencies = []; - $type = $config->getType(); - - // For configuration in the InstallStorage::CONFIG_INSTALL_DIRECTORY - // directory, set any dependencies of the configuration item as package - // dependencies. - // As its name implies, the core-provided - // InstallStorage::CONFIG_OPTIONAL_DIRECTORY should not create - // dependencies. - if ($config->getSubdirectory() === InstallStorage::CONFIG_INSTALL_DIRECTORY) { - if ($type === FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG) { - $dependencies[] = strtok($config->getName(), '.'); - } - else { - $dependencies[] = $this->entityTypeManager->getDefinition($type)->getProvider(); - } - - if (isset($config->getData()['dependencies']['module'])) { - $dependencies = array_merge($dependencies, $config->getData()['dependencies']['module']); - } - - // Only return dependencies for installed modules and not, for example, - // 'core'. - $dependencies = array_intersect($dependencies, array_keys($module_list)); - } - - return $dependencies; - } - - /** - * {@inheritdoc} - */ - public function assignConfigPackage($package_name, array $item_names, $force = FALSE) { - $config_collection = $this->getConfigCollection(); - $module_list = $this->moduleHandler->getModuleList(); - - $packages =& $this->packages; - if (isset($packages[$package_name])) { - $package =& $packages[$package_name]; - } - else { - throw new \Exception($this->t('Failed to package @package_name. Package not found.', ['@package_name' => $package_name])); - } - - foreach ($item_names as $item_name) { - if (isset($config_collection[$item_name])) { - // Add to the package if: - // - force is set or - // - the item hasn't already been assigned elsewhere, and - // - the package hasn't been excluded. - // - and the item isn't already in the package. - - $item = &$config_collection[$item_name]; - $already_assigned = !empty($item->getPackage()); - // If this is the profile package, we can reassign extension-provided configuration. - $package_bundle = $this->getAssigner()->getBundle($package->getBundle()); - $is_profile_package = isset($package_bundle) ? $package_bundle->isProfilePackage($package_name) : FALSE; - // An item is assignable if: - // - it is not provider excluded or this is the profile package, and - // - it is not flagged as excluded. - $assignable = (!$item->isProviderExcluded() || $is_profile_package) && !$item->isExcluded(); - // An item is assignable if it was provided by the current package - $assignable = $assignable || ($item->getProvider() == $package->getMachineName()); - $excluded_from_package = in_array($package_name, $item->getPackageExcluded()); - $already_in_package = in_array($item_name, $package->getConfig()); - if (($force || (!$already_assigned && $assignable && !$excluded_from_package)) && !$already_in_package) { - // Add the item to the package's config array. - $package->appendConfig($item_name); - // Mark the item as already assigned. - $item->setPackage($package_name); - - $module_dependencies = $this->getConfigDependency($item, $module_list); - $package->setDependencies($this->mergeUniqueItems($package->getDependencies(), $module_dependencies)); - } - // Return memory - unset($item); - } - } - - $this->setConfigCollection($config_collection); - } - - /** - * {@inheritdoc} - */ - public function assignConfigByPattern(array $patterns) { - // Regular expressions for items that are likely to generate false - // positives when assigned by pattern. - $false_positives = [ - // Blocks with the page title should not be assigned to a 'page' package. - '/block\.block\..*_page_title/', - ]; - $config_collection = $this->getConfigCollection(); - // Sort by key so that specific package will claim items before general - // package. E.g., event_registration and registration_event will claim - // before event. - uksort($patterns, function($a, $b) { - // Count underscores to determine specificity of the package. - return (int) (substr_count($a, '_') <= substr_count($b, '_')); - }); - foreach ($patterns as $pattern => $machine_name) { - if (isset($this->packages[$machine_name])) { - foreach ($config_collection as $item_name => $item) { - // Test for and skip false positives. - foreach ($false_positives as $false_positive) { - if (preg_match($false_positive, $item_name)) { - continue 2; - } - } - - if (!$item->getPackage() && preg_match('/(\.|-|_|^)' . $pattern . '(\.|-|_|$)/', $item->getShortName())) { - try { - $this->assignConfigPackage($machine_name, [$item_name]); - } - catch (\Exception $exception) { - \Drupal::logger('features')->error($exception->getMessage()); - } - } - } - } - } - } - - /** - * {@inheritdoc} - */ - public function assignConfigDependents(array $item_names = NULL, $package = NULL) { - $config_collection = $this->getConfigCollection(); - if (empty($item_names)) { - $item_names = array_keys($config_collection); - } - foreach ($item_names as $item_name) { - // Make sure the extension provided item exists in the active - // configuration storage. - if (isset($config_collection[$item_name]) && $config_collection[$item_name]->getPackage()) { - foreach ($config_collection[$item_name]->getDependents() as $dependent_item_name) { - if (isset($config_collection[$dependent_item_name]) && (!empty($package) || empty($config_collection[$dependent_item_name]->getPackage()))) { - try { - $package_name = !empty($package) ? $package : $config_collection[$item_name]->getPackage(); - $this->assignConfigPackage($package_name, [$dependent_item_name]); - } - catch (\Exception $exception) { - \Drupal::logger('features')->error($exception->getMessage()); - } - } - } - } - } - } - - /** - * {@inheritdoc} - */ - public function setPackageBundleNames(FeaturesBundleInterface $bundle, array &$package_names = []) { - $this->packagesPrefixed = TRUE; - if (!$bundle->isDefault()) { - $new_package_names = []; - // Assign the selected bundle to the exports. - $packages = $this->getPackages(); - if (empty($package_names)) { - $package_names = array_keys($packages); - } - foreach ($package_names as $package_name) { - // Rename package to use bundle prefix. - $package = $packages[$package_name]; - - // The install profile doesn't need renaming. - if ($package->getType() != 'profile') { - unset($packages[$package_name]); - $package->setMachineName($bundle->getFullName($package->getMachineName())); - $packages[$package->getMachineName()] = $package; - } - - // Set the bundle machine name. - $packages[$package->getMachineName()]->setBundle($bundle->getMachineName()); - $new_package_names[] = $package->getMachineName(); - } - $this->setPackages($packages); - $package_names = $new_package_names; - } - } - - /** - * {@inheritdoc} - */ - public function assignPackageDependencies(Package $package = NULL) { - if (is_null($package)) { - $packages = $this->getPackages(); - } - else { - $packages = [$package]; - } - $module_list = $this->moduleHandler->getModuleList(); - $config_collection = $this->getConfigCollection(); - - foreach ($packages as $package) { - $module_dependencies = []; - foreach ($package->getConfig() as $item_name) { - if (isset($config_collection[$item_name])) { - $dependencies = $this->getConfigDependency($config_collection[$item_name], $module_list); - $module_dependencies = array_merge($module_dependencies, $dependencies); - } - } - $package->setDependencies($this->mergeUniqueItems($package->getDependencies(), $module_dependencies)); - } - } - - /** - * {@inheritdoc} - */ - public function assignInterPackageDependencies(FeaturesBundleInterface $bundle, array &$packages) { - if (!$this->packagesPrefixed) { - throw new \Exception($this->t('The packages have not yet been prefixed with a bundle name.')); - } - - $config_collection = $this->getConfigCollection(); - $module_list = $this->moduleHandler->getModuleList(); - - /** @var \Drupal\features\Package[] $packages */ - foreach ($packages as $package) { - foreach ($package->getConfig() as $item_name) { - if (!empty($config_collection[$item_name]->getData()['dependencies']['config'])) { - foreach ($config_collection[$item_name]->getData()['dependencies']['config'] as $dependency_name) { - if (isset($config_collection[$dependency_name]) && - // For configuration in the - // InstallStorage::CONFIG_INSTALL_DIRECTORY directory, set any - // package dependencies of the configuration item. - // As its name implies, the core-provided - // InstallStorage::CONFIG_OPTIONAL_DIRECTORY should not create - // dependencies. - ($config_collection[$dependency_name]->getSubdirectory() === InstallStorage::CONFIG_INSTALL_DIRECTORY)) { - // If the required item is assigned to one of the packages, add - // a dependency on that package. - $dependency_set = FALSE; - if ($dependency_package = $config_collection[$dependency_name]->getPackage()) { - $package_name = $bundle->getFullName($dependency_package); - // Package shouldn't be dependent on itself. - if ($package_name && array_key_exists($package_name, $packages) && $package_name != $package->getMachineName() && isset($module_list[$package_name])) { - $package->setDependencies($this->mergeUniqueItems($package->getDependencies(), [$package_name])); - $dependency_set = TRUE; - } - } - // Otherwise, if the dependency is provided by an existing - // feature, add a dependency on that feature. - if (!$dependency_set && $extension_name = $config_collection[$dependency_name]->getProvider()) { - // No extension should depend on the install profile. - $package_name = $bundle->getFullName($package->getMachineName()); - if ($extension_name != $package_name && $extension_name != $this->drupalGetProfile() && isset($module_list[$extension_name])) { - $package->setDependencies($this->mergeUniqueItems($package->getDependencies(), [$extension_name])); - } - } - } - } - } - } - } - // Unset the $package pass by reference. - unset($package); - } - - /** - * Gets the name of the currently active installation profile. - * - * @return string|null $profile - * The name of the installation profile or NULL if no installation profile is - * currently active. This is the case for example during the first steps of - * the installer or during unit tests. - */ - protected function drupalGetProfile() { - return drupal_get_profile(); - } - - /** - * Merges a set of new item into an array and sorts the result. - * - * Only unique values are retained. - * - * @param array $items - * An array of items. - * @param array $new_items - * An array of new items to be merged in. - * - * @return array - * The merged, sorted and unique items. - */ - protected function mergeUniqueItems($items, $new_items) { - $items = array_unique(array_merge($items, $new_items)); - sort($items); - return $items; - } - - /** - * Initializes and returns a package or profile array. - * - * @param string $machine_name - * Machine name of the package. - * @param string $name - * (optional) Human readable name of the package. - * @param string $description - * (optional) Description of the package. - * @param string $type - * (optional) Type of project. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * (optional) Bundle to use to add profile directories to the scan. - * @param \Drupal\Core\Extension\Extension $extension - * (optional) An Extension object. - * - * @return \Drupal\features\Package - * An array of package properties; see - * FeaturesManagerInterface::getPackages(). - */ - protected function getPackageObject($machine_name, $name = NULL, $description = '', $type = 'module', FeaturesBundleInterface $bundle = NULL, Extension $extension = NULL) { - if (!isset($bundle)) { - $bundle = $this->getAssigner()->getBundle(); - } - $package = new Package($machine_name, [ - 'name' => isset($name) ? $name : ucwords(str_replace(['_', '-'], ' ', $machine_name)), - 'description' => $description, - 'type' => $type, - 'core' => Drupal::CORE_COMPATIBILITY, - 'dependencies' => [], - 'themes' => [], - 'config' => [], - 'status' => FeaturesManagerInterface::STATUS_DEFAULT, - 'version' => '', - 'state' => FeaturesManagerInterface::STATE_DEFAULT, - 'files' => [], - 'bundle' => $bundle->isDefault() ? '' : $bundle->getMachineName(), - 'extension' => NULL, - 'info' => [], - 'configOrig' => [], - ]); - - // If no extension was passed in, look for a match. - if (!isset($extension)) { - $module_list = $this->getFeaturesModules($bundle); - $module_name = $package->getMachineName(); - if (isset($module_list[$module_name])) { - $extension = $module_list[$module_name]; - } - } - - // If there is an extension, set extension-specific properties. - if (isset($extension)) { - $info = $this->getExtensionInfo($extension); - $features_info = $this->getFeaturesInfo($extension); - $package->setExtension($extension); - $package->setInfo($info); - $package->setFeaturesInfo($features_info); - $package->setConfigOrig($this->listExtensionConfig($extension)); - $package->setStatus($this->extensionEnabled($extension) - ? FeaturesManagerInterface::STATUS_INSTALLED - : FeaturesManagerInterface::STATUS_UNINSTALLED); - $package->setVersion(isset($info['version']) ? $info['version'] : ''); - } - - return $package; - } - - /** - * Generates and adds .info.yml files to a package. - * - * @param \Drupal\features\Package $package - * The package. - */ - protected function addInfoFile(Package $package) { - $info = [ - 'name' => $package->getName(), - 'description' => $package->getDescription(), - 'type' => $package->getType(), - 'core' => $package->getCore(), - 'dependencies' => $package->getDependencies(), - 'themes' => $package->getThemes(), - 'version' => $package->getVersion(), - ]; - - $features_info = []; - - // Assign to a "package" named for the profile. - if ($package->getBundle()) { - $bundle = $this->getAssigner()->getBundle($package->getBundle()); - } - // Save the current bundle in the info file so the package - // can be reloaded later by the AssignmentPackages plugin. - if (isset($bundle) && !$bundle->isDefault()) { - $info['package'] = $bundle->getName(); - $features_info['bundle'] = $bundle->getMachineName(); - } - else { - unset($features_info['bundle']); - } - - if ($package->getConfig()) { - foreach (['excluded', 'required'] as $constraint) { - if (!empty($package->{'get' . $constraint}())) { - $features_info[$constraint] = $package->{'get' . $constraint}(); - } - else { - unset($features_info[$constraint]); - } - } - - if (empty($features_info)) { - $features_info = TRUE; - } - } - - // The name and description need to be cast as strings from the - // TranslatableMarkup objects returned by t() to avoid raising an - // InvalidDataTypeException on Yaml serialization. - foreach (['name', 'description'] as $key) { - $info[$key] = (string) $info[$key]; - } - - // Add profile-specific info data. - if ($info['type'] == 'profile') { - // Set the distribution name. - $info['distribution'] = [ - 'name' => $info['name'] - ]; - } - - $package->appendFile([ - 'filename' => $package->getMachineName() . '.info.yml', - 'subdirectory' => NULL, - // Filter to remove any empty keys, e.g., an empty themes array. - 'string' => Yaml::encode(array_filter($info)) - ], 'info'); - - $package->appendFile([ - 'filename' => $package->getMachineName() . '.features.yml', - 'subdirectory' => NULL, - 'string' => Yaml::encode($features_info) - ], 'features'); - } - - /** - * Generates and adds files to a given package or profile. - */ - protected function addPackageFiles(Package $package) { - $config_collection = $this->getConfigCollection(); - // Always add .info.yml and .features.yml files. - $this->addInfoFile($package); - // Only add files if there is at least one piece of configuration present. - if ($package->getConfig()) { - // Add configuration files. - foreach ($package->getConfig() as $name) { - $config = $config_collection[$name]; - - $package->appendFile([ - 'filename' => $config->getName() . '.yml', - 'subdirectory' => $config->getSubdirectory(), - 'string' => Yaml::encode($config->getData()) - ], $name); - } - } - } - - /** - * {@inheritdoc} - */ - public function mergeInfoArray(array $info1, array $info2, array $keys = []) { - // If keys were specified, use only those. - if (!empty($keys)) { - $info2 = array_intersect_key($info2, array_fill_keys($keys, NULL)); - } - - $info = NestedArray::mergeDeep($info1, $info2); - - // Process the dependencies and themes keys. - $keys = ['dependencies', 'themes']; - foreach ($keys as $key) { - if (isset($info[$key]) && is_array($info[$key])) { - // NestedArray::mergeDeep() may produce duplicate values. - $info[$key] = array_unique($info[$key]); - sort($info[$key]); - } - } - return $info; - } - - /** - * {@inheritdoc} - */ - public function listConfigTypes($bundles_only = FALSE) { - $definitions = []; - foreach ($this->entityTypeManager->getDefinitions() as $entity_type => $definition) { - if ($definition->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface')) { - if (!$bundles_only || $definition->getBundleOf()) { - $definitions[$entity_type] = $definition; - } - } - } - $entity_types = array_map(function (EntityTypeInterface $definition) { - return $definition->getLabel(); - }, $definitions); - // Sort the entity types by label, then add the simple config to the top. - uasort($entity_types, 'strnatcasecmp'); - return $bundles_only ? $entity_types : [ - FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG => $this->t('Simple configuration'), - ] + $entity_types; - } - - /** - * {@inheritdoc} - */ - public function listExtensionConfig(Extension $extension) { - return $this->extensionStorages->listExtensionConfig($extension); - } - - /** - * {@inheritdoc} - */ - public function listExistingConfig($installed = FALSE, FeaturesBundleInterface $bundle = NULL) { - $config = []; - $existing = $this->getFeaturesModules($bundle, $installed); - foreach ($existing as $extension) { - // Keys are configuration item names and values are providing extension - // name. - $new_config = array_fill_keys($this->listExtensionConfig($extension), $extension->getName()); - $config = array_merge($config, $new_config); - } - return $config; - } - - /** - * {@inheritdoc} - */ - public function listConfigByType($config_type) { - // For a given entity type, load all entities. - if ($config_type && $config_type !== FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG) { - $entity_storage = $this->entityTypeManager->getStorage($config_type); - $names = []; - foreach ($entity_storage->loadMultiple() as $entity) { - $entity_id = $entity->id(); - $label = $entity->label() ?: $entity_id; - $names[$entity_id] = $label; - } - } - // Handle simple configuration. - else { - $definitions = []; - foreach ($this->entityTypeManager->getDefinitions() as $entity_type => $definition) { - if ($definition->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface')) { - $definitions[$entity_type] = $definition; - } - } - // Gather the config entity prefixes. - $config_prefixes = array_map(function (EntityTypeInterface $definition) { - return $definition->getConfigPrefix() . '.'; - }, $definitions); - - // Find all config, and then filter our anything matching a config prefix. - $names = $this->configStorage->listAll(); - $names = array_combine($names, $names); - foreach ($names as $item_name) { - foreach ($config_prefixes as $config_prefix) { - if (strpos($item_name, $config_prefix) === 0) { - unset($names[$item_name]); - } - } - } - } - return $names; - } - - /** - * Creates a high performant version of the ConfigDependencyManager. - * - * @return \Drupal\features\FeaturesConfigDependencyManager - * A high performant version of the ConfigDependencyManager. - * - * @see \Drupal\Core\Config\Entity\ConfigDependencyManager - */ - protected function getFeaturesConfigDependencyManager() { - $dependency_manager = new FeaturesConfigDependencyManager(); - // Read all configuration using the factory. This ensures that multiple - // deletes during the same request benefit from the static cache. Using the - // factory also ensures configuration entity dependency discovery has no - // dependencies on the config entity classes. Assume data with UUID is a - // config entity. Only configuration entities can be depended on so we can - // ignore everything else. - $data = array_map(function(Drupal\Core\Config\ImmutableConfig $config) { - $data = $config->get(); - if (isset($data['uuid'])) { - return $data; - } - return FALSE; - }, $this->configFactory->loadMultiple($this->configStorage->listAll())); - $dependency_manager->setData(array_filter($data)); - return $dependency_manager; - } - - /** - * Loads configuration from storage into a property. - */ - protected function initConfigCollection($reset = FALSE) { - if ($reset || empty($this->configCollection)) { - $config_collection = []; - $config_types = $this->listConfigTypes(); - $dependency_manager = $this->getFeaturesConfigDependencyManager(); - // List configuration provided by installed features. - $existing_config = $this->listExistingConfig(NULL); - $existing_config_by_directory = $this->extensionStorages->listAllByDirectory(); - foreach (array_keys($config_types) as $config_type) { - $config = $this->listConfigByType($config_type); - foreach ($config as $item_name => $label) { - $name = $this->getFullName($config_type, $item_name); - $data = $this->configStorage->read($name); - - $config_collection[$name] = (new ConfigurationItem($name, $data, [ - 'shortName' => $item_name, - 'label' => $label, - 'type' => $config_type, - 'dependents' => array_keys($dependency_manager->getDependentEntities('config', $name)), - // Default to the install directory. - 'subdirectory' => isset($existing_config_by_directory[$name]) ? $existing_config_by_directory[$name] : InstallStorage::CONFIG_INSTALL_DIRECTORY, - 'package' => '', - 'providerExcluded' => NULL, - 'provider' => isset($existing_config[$name]) ? $existing_config[$name] : NULL, - 'packageExcluded' => [], - ])); - } - } - $this->setConfigCollection($config_collection); - } - } - - /** - * {@inheritdoc} - */ - public function prepareFiles(array $packages) { - foreach ($packages as $package) { - $this->addPackageFiles($package); - } - } - - /** - * {@inheritdoc} - */ - public function getExportInfo(Package $package, FeaturesBundleInterface $bundle = NULL) { - $full_name = isset($bundle) ? $bundle->getFullName($package->getMachineName()) : $package->getMachineName(); - - $path = ''; - - // Adjust export directory to be in profile. - if (isset($bundle) && $bundle->isProfile()) { - $path .= 'profiles/' . $bundle->getProfileName(); - } - - // If this is not the profile package, nest the directory. - if (!isset($bundle) || !$bundle->isProfilePackage($package->getMachineName())) { - $path .= empty($path) ? 'modules' : '/modules'; - $export_settings = $this->getExportSettings(); - if (!empty($export_settings['folder'])) { - $path .= '/' . $export_settings['folder']; - } - } - - // Use the same path of a package to override it. - if ($extension = $package->getExtension()) { - $extension_path = $extension->getPath(); - $path = dirname($extension_path); - } - - return [$full_name, $path]; - } - - /** - * {@inheritdoc} - */ - public function detectOverrides(Package $feature, $include_new = FALSE) { - /** @var \Drupal\config_update\ConfigDiffInterface $config_diff */ - $config_diff = \Drupal::service('config_update.config_diff'); - - $different = []; - foreach ($feature->getConfig() as $name) { - $active = $this->configStorage->read($name); - $extension = $this->extensionStorages->read($name); - $extension = !empty($extension) ? $extension : []; - if (($include_new || !empty($extension)) && !$config_diff->same($extension, $active)) { - $different[] = $name; - } - } - - if (!empty($different)) { - $feature->setState(FeaturesManagerInterface::STATE_OVERRIDDEN); - } - return $different; - } - - /** - * {@inheritdoc} - */ - public function detectNew(Package $feature) { - $result = []; - foreach ($feature->getConfig() as $name) { - $extension = $this->extensionStorages->read($name); - if (empty($extension)) { - $result[] = $name; - } - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function detectMissing(Package $feature) { - $config = $this->getConfigCollection(); - $result = []; - foreach ($feature->getConfigOrig() as $name) { - if (!isset($config[$name])) { - $result[] = $name; - } - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function reorderMissing(array $missing) { - $list = []; - $result = []; - foreach ($missing as $full_name) { - $this->addConfigList($full_name, $list); - } - foreach ($list as $full_name) { - if (in_array($full_name, $missing)) { - $result[] = $full_name; - } - } - return $result; - } - - protected function addConfigList($full_name, &$list) { - $index = array_search($full_name, $list); - if ($index !== FALSE) { - unset($list[$index]); - } - array_unshift($list, $full_name); - $value = $this->extensionStorages->read($full_name); - if (isset($value['dependencies']['config'])) { - foreach ($value['dependencies']['config'] as $config_name) { - $this->addConfigList($config_name, $list); - } - } - } - - /** - * {@inheritdoc} - */ - public function statusLabel($status) { - switch ($status) { - case FeaturesManagerInterface::STATUS_NO_EXPORT: - return $this->t('Not exported'); - - case FeaturesManagerInterface::STATUS_UNINSTALLED: - return $this->t('Uninstalled'); - - case FeaturesManagerInterface::STATUS_INSTALLED: - return $this->t('Installed'); - } - } - - /** - * {@inheritdoc} - */ - public function stateLabel($state) { - switch ($state) { - case FeaturesManagerInterface::STATE_DEFAULT: - return $this->t('Default'); - - case FeaturesManagerInterface::STATE_OVERRIDDEN: - return $this->t('Changed'); - } - } - - /** - * {@inheritdoc} - */ - public function getFeaturesInfo(Extension $extension) { - $module_name = $extension->getName(); - if (isset($this->featureInfoCache[$module_name])) { - return $this->featureInfoCache[$module_name]; - } - $features_info = NULL; - $filename = $this->root . '/' . $extension->getPath() . '/' . $module_name . '.features.yml'; - if (file_exists($filename)) { - $features_info = Yaml::decode(file_get_contents($filename)); - } - $this->featureInfoCache[$module_name] = $features_info; - return $features_info; - } - - /** - * {@inheritdoc} - */ - public function createConfiguration(array $config_to_create) { - $existing_config = $this->getConfigCollection(); - - // If config data is not specified, load it from the extension storage. - foreach ($config_to_create as $name => $item) { - if (empty($item)) { - $config = $this->configReverter->getFromExtension('', $name); - // For testing purposes, if it couldn't load from a module, get config - // from the cached Config Collection - if (empty($config) && isset($existing_config[$name])) { - $config = $existing_config[$name]->getData(); - } - $config_to_create[$name] = $config; - } - } - - // Determine which config is new vs existing. - $existing = array_intersect_key($config_to_create, $existing_config); - $new = array_diff_key($config_to_create, $existing); - - // The FeaturesConfigInstaller exposes the normally protected createConfiguration - // function from Core ConfigInstaller than handles the creation of new - // config or the changing of existing config. - /** @var \Drupal\features\FeaturesConfigInstaller $config_installer */ - $config_installer = \Drupal::service('features.config.installer'); - $config_installer->createConfiguration(StorageInterface::DEFAULT_COLLECTION, $config_to_create); - - // Collect results for new and updated config. - $new_config = $this->getConfigCollection(TRUE); - $result['updated'] = array_intersect_key($new_config, $existing); - $result['new'] = array_intersect_key($new_config, $new); - return $result; - } - - /** - * {@inheritdoc} - */ - public function import($modules, $any = FALSE) { - $result = []; - foreach ($modules as $module_name) { - $package = $this->loadPackage($module_name, $any); - $components = isset($package) ? $package->getConfigOrig() : []; - if (empty($components)) { - continue; - } - $result[$module_name] = $this->createConfiguration(array_fill_keys($components, [])); - } - return $result; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/FeaturesManagerInterface.php b/sites/all/modules/contrib/admin/features/src/FeaturesManagerInterface.php deleted file mode 100644 index 2f47e5248..000000000 --- a/sites/all/modules/contrib/admin/features/src/FeaturesManagerInterface.php +++ /dev/null @@ -1,647 +0,0 @@ -getProfileName() is 'example', a - * directory profiles/example will be scanned if it exists. Therefore, when - * regenerating package modules, existing ones from a prior export will be - * recognized. - * - * @param string[] $machine_names - * Package machine names to return directories for. If omitted, return all - * directories. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * Optional bundle to use to add profile directories to the scan. - * - * @return array - * Array of package directories keyed by package machine name. - */ - public function listPackageDirectories(array $machine_names = [], FeaturesBundleInterface $bundle = NULL); - - /** - * Assigns a set of configuration items to a given package or profile. - * - * @param string $package_name - * Machine name of a package or the profile. - * @param string[] $item_names - * Configuration item names. - * @param bool $force - * (optional) If TRUE, assign config regardless of restrictions such as it - * being already assigned to a package. - * - * @throws Exception - */ - public function assignConfigPackage($package_name, array $item_names, $force = FALSE); - - /** - * Assigns configuration items with names matching given strings to given - * packages. - * - * @param array $patterns - * Array with string patterns as keys and package machine names as values. - */ - public function assignConfigByPattern(array $patterns); - - /** - * For given configuration items, assigns any dependent configuration to the - * same package. - * - * @param string[] $item_names - * Configuration item names. - * @param string $package - * Short machine name of package to assign dependent config to. If NULL, - * use the current package of the parent config items. - */ - public function assignConfigDependents(array $item_names = NULL, $package = NULL); - - /** - * Adds the optional bundle prefix to package machine names. - * - * @param \Drupal\features\FeaturesBundleInterface $bundle - * The bundle used for the generation. - * @param string[] &$package_names - * (optional) Array of package names, passed by reference. - */ - public function setPackageBundleNames(FeaturesBundleInterface $bundle, array &$package_names = []); - - /** - * Assigns dependencies from config items into the package. - * - * @param \Drupal\features\Package[] $packages - * An array of packages. NULL for all packages - */ - public function assignPackageDependencies(Package $package = NULL); - - /** - * Assigns dependencies between packages based on configuration dependencies. - * - * \Drupal\features\FeaturesBundleInterface::setPackageBundleNames() must be - * called prior to calling this method. - * - * @param \Drupal\features\FeaturesBundleInterface $bundle - * A features bundle. - * @param \Drupal\features\Package[] $packages - * An array of packages. - */ - public function assignInterPackageDependencies(FeaturesBundleInterface $bundle, array &$packages); - - /** - * Merges two info arrays and processes the resulting array. - * - * Ensures values are unique and sorted. - * - * @param array $info1 - * The first array. - * @param array $info2 - * The second array. - * @param string[] $keys - * Keys to merge. If not specified, all keys present will be merged. - * - * @return array - * An array with the merged and processed results. - * - * @fixme Should this be moved to the package object or a related helper? - */ - public function mergeInfoArray(array $info1, array $info2, array $keys = []); - - /** - * Lists the types of configuration available on the site. - * - * @param boolean $bundles_only - * Whether to list only configuration types that provide bundles. - * - * @return array - * An array with machine name keys and human readable values. - */ - public function listConfigTypes($bundles_only = FALSE); - - /** - * Lists stored configuration for a given configuration type. - * - * @param string $config_type - * The type of configuration. - */ - public function listConfigByType($config_type); - - /** - * Returns a list of all modules present on the site's file system. - * - * @return Drupal\Core\Extension\Extension[] - * An array of extension objects. - */ - public function getAllModules(); - - /** - * Returns a list of Features modules regardless of if they are installed. - * - * @param \Drupal\features\FeaturesBundleInterface $bundle - * Optional bundle to filter module list. - * If given, only modules matching the bundle namespace will be returned. - * If the bundle uses a profile, only modules in the profile will be - * returned. - * @param bool $installed - * List only installed modules. - * - * @return Drupal\Core\Extension\Extension[] - * An array of extension objects. - */ - public function getFeaturesModules(FeaturesBundleInterface $bundle = NULL, $installed = FALSE); - - /** - * Lists names of configuration objects provided by a given extension. - * - * @param \Drupal\Core\Extension\Extension $extension - * An Extension object. - * - * @return array - * An array of configuration object names. - */ - public function listExtensionConfig(Extension $extension); - - /** - * Lists names of configuration items provided by existing Features modules. - * - * @param bool $installed - * List only installed Features. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * (optional) Bundle to find existing configuration for. - * - * @return array - * An array with config names as keys and providing module names as values. - */ - public function listExistingConfig($installed = FALSE, FeaturesBundleInterface $bundle = NULL); - - /** - * Iterates through packages and prepares file names and contents. - * - * @param array $packages - * An array of packages. - */ - public function prepareFiles(array $packages); - - /** - * Returns the full name of a config item. - * - * @param string $type - * The config type, or '' to indicate $name is already prefixed. - * @param string $name - * The config name, without prefix. - * - * @return string - * The config item's full name. - */ - public function getFullName($type, $name); - - /** - * Returns the short name and type of a full config name. - * - * @param string $fullname - * The full configuration name - * @return array - * 'type' => string the config type - * 'name_short' => string the short config name, without prefix. - */ - public function getConfigType($fullname); - - /** - * Returns the full machine name and directory for exporting a package. - * - * @param \Drupal\features\Package $package - * The package. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * Optional bundle being used for export. - * - * @return array - * An array with the full name as the first item and directory as second - * item. - */ - public function getExportInfo(Package $package, FeaturesBundleInterface $bundle = NULL); - - /** - * Determines if the module is a Features package, optionally testing by - * bundle. - * - * @param \Drupal\Core\Extension\Extension $module - * An extension object. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * (optional) Bundle to filter by. - * - * @return bool - * TRUE if the given module is a Features package of the given bundle (if any). - */ - public function isFeatureModule(Extension $module, FeaturesBundleInterface $bundle); - - /** - * Determines which config is overridden in a package. - * - * @param \Drupal\features\Package $feature - * The package array. - * The 'state' property is updated if overrides are detected. - * @param bool $include_new - * If set, include newly detected config not yet exported. - * - * @result array $different - * The array of config items that are overridden. - * - * @see \Drupal\features\FeaturesManagerInterface::detectNew() - */ - public function detectOverrides(Package $feature, $include_new = FALSE); - - /** - * Determines which config has not been exported to the feature. - * - * Typically added as an auto-detected dependency. - * - * @param \Drupal\features\Package $feature - * The package array. - * - * @return array - * The array of config items that are overridden. - */ - public function detectNew(Package $feature); - - /** - * Determines which config is exported in the feature but not in the active. - * - * @param \Drupal\features\Package $feature - * The package array. - * - * @return array - * The array of config items that are missing from active store. - */ - public function detectMissing(Package $feature); - - /** - * Sort the Missing config into order by dependencies. - * @param array $missing config items - * @return array of config items in dependency order - */ - public function reorderMissing(array $missing); - - /** - * Helper function that returns a translatable label for the different status - * constants. - * - * @param int $status - * A status constant. - * - * @return string - * A translatable label. - */ - public function statusLabel($status); - - /** - * Helper function that returns a translatable label for the different state - * constants. - * - * @param int $state - * A state constant. - * - * @return string - * A translatable label. - */ - public function stateLabel($state); - - /** - * @param \Drupal\Core\Extension\Extension $extension - * - * @return array - */ - public function getFeaturesInfo(Extension $extension); - - /** - * Creates configuration in a collection based on the provided list. - * - * @param array $config_to_create - * An array of configuration data to create, keyed by name. - * @return array of config imported - * 'new': list of new config created keyed by name. - * 'updated': list of updated config keyed by name. - */ - public function createConfiguration(array $config_to_create); - - /** - * @param array $modules - * An array of module names to import (revert) - * @param bool $any - * Set to TRUE to import config from non-Features modules - * @return array of config imported - * keyed by name of module, then: - * 'new': list of new config created keyed by name. - * 'updated': list of updated config keyed by name. - */ - public function import($modules, $any = FALSE); - -} diff --git a/sites/all/modules/contrib/admin/features/src/Package.php b/sites/all/modules/contrib/admin/features/src/Package.php deleted file mode 100644 index c7f2872a2..000000000 --- a/sites/all/modules/contrib/admin/features/src/Package.php +++ /dev/null @@ -1,562 +0,0 @@ -machineName = $machine_name; - - $properties = get_object_vars($this); - foreach ($additional_properties as $property => $value) { - if (!array_key_exists($property, $properties)) { - throw new \InvalidArgumentException('Invalid property: ' . $property); - } - $this->{$property} = $value; - } - } - - /** - * @return mixed - */ - public function getMachineName() { - return $this->machineName; - } - - /** - * Return TRUE if the machine_name already has the bundle prefix. - * - * @param string $machine_name - * @param string $bundle_name - * @return bool - */ - protected function inBundle($machine_name, $bundle_name) { - return strpos($machine_name, $bundle_name . '_') === 0; - } - - /** - * Return the full name of the package by prefixing it with bundle as needed - * - * NOTE: When possible, use the Bundle::getFullName method since it can - * better handle cases where a bundle is a profile. - * - * @return string - */ - public function getFullName() { - if (empty($this->bundle) || $this->inBundle($this->machineName, $this->bundle)) { - return $this->machineName; - } - else { - return $this->bundle . '_' . $this->machineName; - } - } - - /** - * @return string - */ - public function getName() { - return $this->name; - } - - /** - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * @return string - */ - public function getVersion() { - return $this->version; - } - - /** - * @return int - */ - public function getStatus() { - return $this->status; - } - - /** - * @return string[] - */ - public function getConfig() { - return $this->config; - } - - /** - * Append a new filename. - * - * @param string $config - * - * @return $this - */ - public function appendConfig($config) { - $this->config[] = $config; - $this->config = array_unique($this->config); - return $this; - } - - public function removeConfig($name) { - $this->config = array_diff($this->config, [$name]); - return $this; - } - - /** - * @return string - */ - public function getBundle() { - return $this->bundle; - } - - /** - * @return string[] - */ - public function getExcluded() { - return $this->excluded; - } - - /** - * @return string[]|bool - */ - public function getRequired() { - return $this->required; - } - - /** - * @return bool - */ - public function getRequiredAll() { - // Mark all as required if the package is not yet exported. - if ($this->getStatus() === FeaturesManagerInterface::STATUS_NO_EXPORT) { - return TRUE; - } - - // Mark all as required if required is TRUE. - if (is_bool($this->required)) { - return $this->required; - } - - // Mark all as required if required contains all the exported config. - $config_orig = $this->getConfigOrig(); - $diff = array_diff($config_orig, $this->required); - return empty($diff); - } - - /** - * @return string[] - */ - public function getConfigOrig() { - return $this->configOrig; - } - - /** - * @return string - */ - public function getCore() { - return $this->core; - } - - /** - * @return string - */ - public function getType() { - return $this->type; - } - - /** - * @return \string[] - */ - public function getThemes() { - return $this->themes; - } - - /** - * @return array - */ - public function getInfo() { - return $this->info; - } - - /** - * @return mixed - */ - public function getState() { - return $this->state; - } - - /** - * @return string - */ - public function getDirectory() { - return $this->directory; - } - - /** - * @return mixed - */ - public function getFiles() { - return $this->files; - } - - /** - * @return \Drupal\Core\Extension\Extension - */ - public function getExtension() { - return $this->extension; - } - - public function getDependencies() { - return $this->dependencies; - } - - public function removeDependency($name) { - $this->dependencies = array_diff($this->dependencies, [$name]); - return $this; - } - - public function getDependencyInfo() { - return isset($this->info['dependencies']) ? $this->info['dependencies'] : []; - } - - /** - * Returns the features info. - * - * @return array - */ - public function getFeaturesInfo() { - $info = []; - if (!empty($this->bundle)) { - $info['bundle'] = $this->bundle; - } - if (!empty($this->excluded)) { - $info['excluded'] = $this->excluded; - } - if ($this->required !== FALSE) { - $info['required'] = $this->required; - } - return $info; - } - - /** - * Sets a new machine name. - * - * @param string $machine_name - * The machine name - * - * @return $this - */ - public function setMachineName($machine_name) { - $this->machineName = $machine_name; - return $this; - } - - /** - * @param string $name - * - * @return $this - */ - public function setName($name) { - $this->name = $name; - return $this; - } - - /** - * @param string $description - * - * @return $this - */ - public function setDescription($description) { - $this->description = $description; - return $this; - } - - /** - * @param string $version - * - * @return $this - */ - public function setVersion($version) { - $this->version = $version; - return $this; - } - - /** - * @param string $bundle - * - * @return $this - */ - public function setBundle($bundle) { - $this->bundle = $bundle; - return $this; - } - - /** - * @param array $info - * - * @return $this - */ - public function setInfo($info) { - $this->info = $info; - return $this; - } - - /** - * @param \string[] $features_info - * - * @return $this - */ - public function setFeaturesInfo($features_info) { - if (isset($features_info['bundle'])) { - $this->setBundle($features_info['bundle']); - } - $this->setRequired(isset($features_info['required']) ? $features_info['required'] : false); - $this->setExcluded(isset($features_info['excluded']) ? $features_info['excluded'] : []); - - return $this; - } - - /** - * @param \string[] $dependencies - * - * @return $this - */ - public function setDependencies($dependencies) { - $this->dependencies = $dependencies; - return $this; - } - - /** - * @param string $dependency - * - * return $this - */ - public function appendDependency($dependency) { - $this->dependencies[] = $dependency; - return $this; - } - - /** - * @param int $status - * - * @return $this - */ - public function setStatus($status) { - $this->status = $status; - return $this; - } - - /** - * @param \string[] $config - * - * @return $this - */ - public function setConfig($config) { - $this->config = $config; - return $this; - } - - /** - * @param bool $excluded - */ - public function setExcluded($excluded) { - $this->excluded = $excluded; - } - - /** - * @param bool $required - */ - public function setRequired($required) { - $this->required = $required; - } - - /** - * @param string $core - */ - public function setCore($core) { - $this->core = $core; - } - - /** - * @param string $type - */ - public function setType($type) { - $this->type = $type; - } - - /** - * @param \string[] $themes - */ - public function setThemes($themes) { - $this->themes = $themes; - } - - /** - * @param int $state - */ - public function setState($state) { - $this->state = $state; - } - - /** - * @param string $directory - */ - public function setDirectory($directory) { - $this->directory = $directory; - } - - /** - * @param \string[] $files - */ - public function setFiles($files) { - $this->files = $files; - } - - /** - * @param array $file_array - * - * @return $this - */ - public function appendFile(array $file_array, $key = NULL) { - if (!isset($key)) { - $this->files[] = $file_array; - } - else { - $this->files[$key] = $file_array; - } - return $this; - } - - /** - * @param \Drupal\Core\Extension\Extension $extension - */ - public function setExtension($extension) { - $this->extension = $extension; - } - - /** - * @param \string[] $configOrig - */ - public function setConfigOrig($configOrig) { - $this->configOrig = $configOrig; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentAlter.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentAlter.php deleted file mode 100644 index 91cbf12f2..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentAlter.php +++ /dev/null @@ -1,63 +0,0 @@ -assigner->getBundle(); - $settings = $current_bundle->getAssignmentSettings($this->getPluginId()); - - // Alter configuration items. - if ($settings['core'] || $settings['uuid'] || $settings['user_permissions']) { - $config_collection = $this->featuresManager->getConfigCollection(); - foreach ($config_collection as &$config) { - $data = $config->getData(); - if ($settings['core']) { - unset($data['_core']); - } - // Unset UUID for configuration entities. - if ($settings['uuid'] && $config->getType() !== FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG) { - unset($data['uuid']); - } - // Unset permissions for user roles. Doing so facilitates packaging - // roles that may have permissions that relate to multiple packages. - if ($settings['user_permissions'] && $config->getType() == 'user_role') { - // Unset and not empty permissions data to prevent loss of configured - // role permissions in the event of a feature revert. - unset($data['permissions']); - } - $config->setData($data); - } - // Clean up the $config pass by reference. - unset($config); - - // Register the updated data. - $this->featuresManager->setConfigCollection($config_collection); - } - - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentBaseType.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentBaseType.php deleted file mode 100644 index a8f83cb64..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentBaseType.php +++ /dev/null @@ -1,68 +0,0 @@ -assigner->getBundle(); - $settings = $current_bundle->getAssignmentSettings($this->getPluginId()); - $config_base_types = $settings['types']['config']; - - $config_types = $this->featuresManager->listConfigTypes(); - $config_collection = $this->featuresManager->getConfigCollection(); - - foreach ($config_collection as $item_name => $item) { - if (in_array($item->getType(), $config_base_types)) { - if (is_null($this->featuresManager->findPackage($item->getShortName())) && !$item->getPackage()) { - $description = $this->t('Provides @label @type and related configuration.', ['@label' => $item->getLabel(), '@type' => Unicode::strtolower($config_types[$item->getType()])]); - if (isset($item->getData()['description'])) { - $description .= ' ' . $item->getData()['description']; - } - $this->featuresManager->initPackage($item->getShortName(), $item->getLabel(), $description, 'module', $current_bundle); - // Update list with the package we just added. - try { - $this->featuresManager->assignConfigPackage($item->getShortName(), [$item_name]); - } - catch (\Exception $exception) { - \Drupal::logger('features')->error($exception->getMessage()); - } - } - } - } - - $entity_types = $this->entityTypeManager->getDefinitions(); - - $content_base_types = $settings['types']['content']; - foreach ($content_base_types as $entity_type_id) { - if (!isset($packages[$entity_type_id]) && isset($entity_types[$entity_type_id])) { - $label = $entity_types[$entity_type_id]->getLabel(); - $description = $this->t('Provide @label related configuration.', ['@label' => $label]); - $this->featuresManager->initPackage($entity_type_id, $label, $description, 'module', $current_bundle); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentCoreType.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentCoreType.php deleted file mode 100644 index d221b31a8..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentCoreType.php +++ /dev/null @@ -1,37 +0,0 @@ -assigner->getBundle(); - $machine_name = 'core'; - $name = $this->t('Core'); - $description = $this->t('Provides core components required by other features.'); - $package = $this->featuresManager->initPackage($machine_name, $name, $description, 'module', $current_bundle); - $this->assignPackageByConfigTypes($package->getMachineName(), $force); - } - - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentDependency.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentDependency.php deleted file mode 100644 index e8b596e68..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentDependency.php +++ /dev/null @@ -1,26 +0,0 @@ -featuresManager->assignConfigDependents(); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExclude.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExclude.php deleted file mode 100644 index 75fecb92d..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExclude.php +++ /dev/null @@ -1,149 +0,0 @@ -assigner->getBundle(); - $settings = $current_bundle->getAssignmentSettings($this->getPluginId()); - - $config_collection = $this->featuresManager->getConfigCollection(); - - // Exclude by configuration type. - $exclude_types = $settings['types']['config']; - if (!empty($exclude_types)) { - foreach ($config_collection as $item_name => $item) { - // Don't exclude already-assigned items. - if (empty($item->getPackage()) && in_array($item->getType(), $exclude_types)) { - $item->setExcluded(TRUE); - } - } - } - - // Exclude configuration already provided by modules. - $exclude_module = $settings['module']; - if (!empty($exclude_module['installed'])) { - $install_list = $this->featuresManager->getExtensionStorages()->listAll(); - - // There are two settings that can limit what's included. - // First, we can skip configuration provided by the install profile. - $module_profile = !empty($exclude_module['profile']); - // Second, we can skip configuration provided by namespaced modules. - $module_namespace = !empty($exclude_module['namespace']); - if ($module_profile || $module_namespace) { - $profile_list = []; - $extension_list = []; - // Load the names of any configuration objects provided by the install - // profile. - if ($module_profile) { - $all_modules = $this->featuresManager->getAllModules(); - // FeaturesBundleInterface::getProfileName() would return the profile - // for the current bundle, if any. We want the profile that was - // installed. - $profile_name = drupal_get_profile(); - if (isset($all_modules[$profile_name])) { - $profile_list = $this->featuresManager->listExtensionConfig($all_modules[$profile_name]); - // If the configuration has been assigned to a feature that's - // present on the file system, don't make an exception for it. - foreach ($all_modules as $name => $extension) { - if ($name != $profile_name && $this->featuresManager->isFeatureModule($extension)) { - $profile_list = array_diff($profile_list, $this->featuresManager->listExtensionConfig($extension)); - } - } - } - } - // Load the names of any configuration objects provided by modules - // having the namespace of the current package set. - if ($module_namespace) { - $modules = $this->featuresManager->getFeaturesModules($current_bundle); - foreach ($modules as $extension) { - // Only make exception for uninstalled modules or - // if namespace_any is set - if (!empty($exclude_module['namespace_any']) || !$this->featuresManager->extensionEnabled($extension)) { - $extension_list = array_merge($extension_list, $this->featuresManager->listExtensionConfig($extension)); - } - } - } - // If any configuration was found, remove it from the list. - $install_list = array_diff($install_list, $profile_list, $extension_list); - } - foreach ($install_list as $item_name) { - if (isset($config_collection[$item_name])) { - // Flag extension-provided configuration, which should not be added - // to regular features but can be added to an install profile. - $config_collection[$item_name]->setProviderExcluded(TRUE); - } - } - } - - // Exclude configuration items on a curated list of site-specific - // configuration. - if ($settings['curated']) { - $item_names = [ - 'core.extension', - 'field.settings', - 'field_ui.settings', - 'filter.settings', - 'forum.settings', - 'image.settings', - 'node.settings', - 'system.authorize', - 'system.date', - 'system.file', - 'system.diff', - 'system.logging', - 'system.maintenance', - 'system.performance', - 'system.site', - 'update.settings', - ]; - foreach ($item_names as $item_name) { - unset($config_collection[$item_name]); - } - // Unset role-related actions that are automatically created by the - // User module. - // @see user_user_role_insert() - $prefixes = [ - 'system.action.user_add_role_action.', - 'system.action.user_remove_role_action.', - ]; - foreach (array_keys($config_collection) as $item_name) { - foreach ($prefixes as $prefix) { - if (strpos($item_name, $prefix) === 0) { - unset($config_collection[$item_name]); - } - } - } - } - - // Register the updated data. - $this->featuresManager->setConfigCollection($config_collection); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php deleted file mode 100644 index 6d78628d2..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php +++ /dev/null @@ -1,58 +0,0 @@ -featuresManager->listExtensionConfig($extension); - try { - $this->featuresManager->assignConfigPackage($machine_name, $config); - } - catch (\Exception $exception) { - \Drupal::logger('features')->error($exception->getMessage()); - } - } - - /** - * {@inheritdoc} - */ - public function assignPackages($force = FALSE) { - $packages = $this->featuresManager->getPackages(); - - // Assign config to installed modules first. - foreach ($packages as $name => $package) { - // @todo Introduce $package->isInstalled() and / or $package->isUninstalled(). - if ($package->getStatus() === FeaturesManagerInterface::STATUS_INSTALLED) { - $this->safeAssignConfig($package->getMachineName(), $package->getExtension()); - } - } - // Now assign to uninstalled modules. - foreach ($packages as $name => $package) { - if ($package->getStatus() === FeaturesManagerInterface::STATUS_UNINSTALLED) { - $this->safeAssignConfig($package->getMachineName(), $package->getExtension()); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentForwardDependency.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentForwardDependency.php deleted file mode 100644 index c0c5801e5..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentForwardDependency.php +++ /dev/null @@ -1,78 +0,0 @@ -featuresManager->getConfigCollection(); - $ordered = $this->dependencyOrder($config_collection); - - foreach ($ordered as $name) { - $item = $config_collection[$name]; - if ($item->getPackage()) { - // Already has a package, not our business. - continue; - } - - // Find packages of dependent items. - $dependent_packages = []; - foreach ($item->getDependents() as $dependent) { - if (isset($config_collection[$dependent])) { - if ($package = $config_collection[$dependent]->getPackage()) { - $dependent_packages[$package] = $package; - } - } - } - - // If zero or multiple packages, we don't know what to do. - if (count($dependent_packages) == 1) { - $package = key($dependent_packages); - $this->featuresManager->assignConfigPackage($package, [$name]); - } - } - } - - /** - * Get config items such that each item comes before anything it depends on. - * - * @param \Drupal\features\ConfigurationItem[] $config_collection - * A collection of configuration items. - * - * @return string[] - * The names of configuration items, in dependency order. - */ - protected function dependencyOrder($config_collection) { - // Populate a graph. - $graph = []; - foreach ($config_collection as $config) { - $graph[$config->getName()] = []; - foreach ($config->getDependents() as $dependent) { - $graph[$config->getName()]['edges'][$dependent] = 1; - } - } - $graph_object = new Graph($graph); - $graph = $graph_object->searchAndSort(); - - // Order by inverse weight. - $weights = array_column($graph, 'weight'); - array_multisort($weights, SORT_DESC, $graph); - return array_keys($graph); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentNamespace.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentNamespace.php deleted file mode 100644 index bc2b6d00f..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentNamespace.php +++ /dev/null @@ -1,38 +0,0 @@ -featuresManager->getPackages(); - $current_bundle = $this->assigner->getBundle(); - - // Build an array of patterns. - // Keys are short names while values are full machine names. - // We need full names because existing packages may receive machine names - // prefixed with a bundle name. - $patterns = []; - foreach ($packages as $package) { - $machine_name = $package->getMachineName(); - $pattern = $current_bundle->getShortName($machine_name); - $patterns[$pattern] = $machine_name; - } - $this->featuresManager->assignConfigByPattern($patterns); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentOptionalType.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentOptionalType.php deleted file mode 100644 index d76835785..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentOptionalType.php +++ /dev/null @@ -1,33 +0,0 @@ -assignSubdirectoryByConfigTypes(InstallStorage::CONFIG_OPTIONAL_DIRECTORY); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentPackages.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentPackages.php deleted file mode 100644 index 759e9efc7..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentPackages.php +++ /dev/null @@ -1,53 +0,0 @@ -assigner->getBundle(); - $existing = $this->featuresManager->getFeaturesModules(); - foreach ($existing as $extension) { - $package = $this->featuresManager->initPackageFromExtension($extension); - $short_name = $package->getMachineName(); - - // Copy over package excluded settings, if any. - if ($package->getExcluded()) { - $config_collection = $this->featuresManager->getConfigCollection(); - foreach ($package->getExcluded() as $config_name) { - if (isset($config_collection[$config_name])) { - $package_excluded = $config_collection[$config_name]->getPackageExcluded(); - $package_excluded[] = $short_name; - $config_collection[$config_name]->setPackageExcluded($package_excluded); - } - } - $this->featuresManager->setConfigCollection($config_collection); - } - - // Assign required components, if any. - if ($package->getRequired() !== FALSE) { - $config = $package->getRequired(); - if (empty($config) || !is_array($config)) { - // if required is "true" or empty, add all config as required - $config = $this->featuresManager->listExtensionConfig($extension); - } - $this->featuresManager->assignConfigPackage($short_name, $config); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentProfile.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentProfile.php deleted file mode 100644 index 81c503e07..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentProfile.php +++ /dev/null @@ -1,177 +0,0 @@ -assigner->getBundle(); - - if ($current_bundle->isProfile()) { - $settings = $current_bundle->getAssignmentSettings($this->getPluginId()); - - // Ensure the profile package exists. - $profile_name = $current_bundle->getProfileName(); - - $profile_package = $this->featuresManager->getPackage($profile_name); - if (empty($profile_package)) { - $profile_package = $this->featuresManager->initPackage($profile_name, $current_bundle->getName(), $current_bundle->getDescription(), 'profile', $current_bundle); - } - - // Assign configuration by type. - $this->assignPackageByConfigTypes($profile_name, $force); - - // Include a curated list of configuration. - if ($settings['curated']) { - $config_collection = $this->featuresManager->getConfigCollection(); - $item_names = [ - 'automated_cron.settings', - 'system.cron', - 'system.theme', - ]; - $theme_settings = $this->configFactory->get('system.theme'); - foreach (['default', 'admin'] as $key) { - $item_names[] = $theme_settings->get($key) . '.settings'; - } - foreach ($item_names as $item_name) { - if (isset($config_collection[$item_name])) { - try { - $this->featuresManager->assignConfigPackage($profile_name, [$item_name]); - } - catch (\Exception $exception) { - \Drupal::logger('features')->error($exception->getMessage()); - } - } - } - } - - // Only read in from the Standard profile if this profile doesn't already - // exist. - $package_directories = $this->featuresManager->listPackageDirectories([], $current_bundle); - if (!isset($package_directories[$profile_name])) { - $standard_directory = 'core/profiles/standard'; - // Conditionally add files from the 'standard' install profile. - if ($settings['standard']['files']) { - // Add configuration from the Standard profile. - $config_collection = $this->featuresManager->getConfigCollection(); - $subdirectory = InstallStorage::CONFIG_INSTALL_DIRECTORY; - $item_names = $this->listRequiredStandardConfig(); - foreach ($item_names as $item_name) { - // If the configuration is present on the site, assign it. - if (isset($config_collection[$item_name])) { - // Only assign it if it's not already assigned to a package. - // @todo: if it's provided by a module, add a dependency. - if (!$config_collection[$item_name]->getPackage()) { - $this->featuresManager->assignConfigPackage($profile_name, [$item_name], $force); - // Reload the profile to refresh the config array after the addition. - $profile_package = $this->featuresManager->getPackage($profile_name); - } - // If it's already assigned to a package in the current bundle, - // add a dependency. - else { - $machine_name = $current_bundle->getFullName($config_collection[$item_name]->getPackage()); - if (!in_array($machine_name, $profile_package->getDependencies())) { - $profile_package->appendDependency($machine_name); - } - } - } - // Otherwise, copy it over from Standard. - else { - $filename = $item_name . '.yml'; - $profile_package->appendFile([ - 'filename' => $filename, - 'subdirectory' => $subdirectory, - 'string' => file_get_contents($standard_directory . '/' . $subdirectory . '/' . $filename) - ]); - } - } - - // Add .profile and .install files from Standard. - $files = [ - 'install', - 'profile', - ]; - // Iterate through the files. - foreach ($files as $extension) { - $filename = $standard_directory . '/standard.' . $extension; - if (file_exists($filename)) { - // Read the file contents. - $string = file_get_contents($filename); - // Substitute the profile's machine name and name for the Standard - // profile's equivalents. - $string = str_replace( - ['standard', 'Standard'], - [$profile_name, $current_bundle->getName()], - $string - ); - // Add the files to those to be output. - $profile_package->appendFile([ - 'filename' => $profile_name . '.' . $extension, - 'subdirectory' => NULL, - 'string' => $string - ], $extension); - } - } - } - // Conditionally merge in module and theme dependencies from the - // 'standard' install profile. - if ($settings['standard']['dependencies']) { - $info_file_uri = $standard_directory . '/standard.info.yml'; - if (file_exists($info_file_uri)) { - $profile_info = \Drupal::service('info_parser')->parse($info_file_uri); - $info = [ - 'dependencies' => $profile_package->getDependencies(), - 'themes' => $profile_package->getThemes(), - ]; - $info = $this->featuresManager->mergeInfoArray($info, $profile_info); - $profile_package->setDependencies($info['dependencies']); - $profile_package->setThemes($info['themes']); - } - } - $this->featuresManager->setPackage($profile_package); - } - } - } - - /** - * Returns the list of configuration items required by the Standard install - * profile. - * - * If install code is adapted from the Standard profile, these configuration - * items will be required. - * - * @return array - * An array of configuration item names. - */ - protected function listRequiredStandardConfig() { - return [ - 'contact.form.feedback', - 'user.role.administrator' - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentSiteType.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentSiteType.php deleted file mode 100644 index 026965820..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesAssignment/FeaturesAssignmentSiteType.php +++ /dev/null @@ -1,36 +0,0 @@ -assigner->getBundle(); - $machine_name = 'site'; - $name = $this->t('Site'); - $description = $this->t('Provides site components.'); - $package = $this->featuresManager->initPackage($machine_name, $name, $description, 'module', $current_bundle); - $this->assignPackageByConfigTypes($package->getMachineName(), $force); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php deleted file mode 100644 index a40c7a6dc..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationArchive.php +++ /dev/null @@ -1,292 +0,0 @@ -root = $root; - $this->csrfToken = $csrf_token; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $container->get('app.root'), - $container->get('csrf_token') - ); - } - - /** - * The package generation method id. - */ - const METHOD_ID = 'archive'; - - /** - * The filename being written. - * - * @var string - */ - protected $archiveName; - - /** - * Reads and merges in existing files for a given package or profile. - */ - protected function preparePackage(Package $package, array $existing_packages, FeaturesBundleInterface $bundle = NULL) { - if (isset($existing_packages[$package->getMachineName()])) { - $existing_directory = $existing_packages[$package->getMachineName()]; - } - else { - $existing_directory = $package->getDirectory(); - } - $existing_directory = $this->root . '/' . $existing_directory; - - if (is_dir($existing_directory)) { - // Scan for all files. - $files = file_scan_directory($existing_directory, '/.*/'); - // Skip any existing .features.yml as it will be replaced. - $exclude_files = [ - $package->getMachineName() . '.features', - ]; - foreach ($files as $file) { - // Skip files in the any existing configuration directory, as these - // will be replaced. - foreach (array_keys($this->featuresManager->getExtensionStorages()->getExtensionStorages()) as $directory) { - if (strpos($file->uri, $directory) !== FALSE) { - continue 2; - } - } - // Merge in the info file. - if ($file->name == $package->getMachineName() . '.info') { - $files = $package->getFiles(); - $files['info']['string'] = $this->mergeInfoFile($package->getFiles()['info']['string'], $file->uri); - $package->setFiles($files); - } - // Read in remaining files. - elseif (!in_array($file->name, $exclude_files)) { - // Determine if the file is within a subdirectory of the - // extension's directory. - $file_directory = dirname($file->uri); - if ($file_directory !== $existing_directory) { - $subdirectory = substr($file_directory, strlen($existing_directory) + 1); - } - else { - $subdirectory = NULL; - } - $package->appendFile([ - 'filename' => $file->filename, - 'subdirectory' => $subdirectory, - 'string' => file_get_contents($file->uri) - ]); - } - } - } - } - - /** - * {@inheritdoc} - */ - public function generate(array $packages = [], FeaturesBundleInterface $bundle = NULL) { - - // If no packages were specified, get all packages. - if (empty($packages)) { - $packages = $this->featuresManager->getPackages(); - } - - // Determine the best name for the tar archive. - // Single package export, so name by package name. - if (count($packages) == 1) { - $filename = current($packages)->getMachineName(); - } - // Profile export, so name by profile. - elseif (isset($bundle) && $bundle->isProfile()) { - $filename = $bundle->getProfileName(); - } - // Non-default bundle, so name by bundle. - elseif (isset($bundle) && !$bundle->isDefault()) { - $filename = $bundle->getMachineName(); - } - // Set a fallback name. - else { - $filename = 'generated_features'; - } - - $return = []; - - $this->archiveName = $filename . '.tar.gz'; - $archive_name = file_directory_temp() . '/' . $this->archiveName; - if (file_exists($archive_name)) { - file_unmanaged_delete($archive_name); - } - - $archiver = new ArchiveTar($archive_name); - - // Add package files. - foreach ($packages as $package) { - if (count($packages) == 1) { - // Single module export, so don't generate entire modules dir structure. - $package->setDirectory($package->getMachineName()); - } - $this->generatePackage($return, $package, $archiver); - } - - return $return; - } - - /** - * Writes a package or profile's files to an archive. - * - * @param array &$return - * The return value, passed by reference. - * @param \Drupal\features\Package $package - * The package or profile. - * @param ArchiveTar $archiver - * The archiver. - */ - protected function generatePackage(array &$return, Package $package, ArchiveTar $archiver) { - $success = TRUE; - foreach ($package->getFiles() as $file) { - try { - $this->generateFile($package->getDirectory(), $file, $archiver); - } - catch (\Exception $exception) { - $this->failure($return, $package, $exception); - $success = FALSE; - break; - } - } - if ($success) { - $this->success($return, $package); - } - } - - /** - * Registers a successful package or profile archive operation. - * - * @param array &$return - * The return value, passed by reference. - * @param \Drupal\features\Package $package - * The package or profile. - */ - protected function success(array &$return, Package $package) { - $type = $package->getType() == 'module' ? $this->t('Package') : $this->t('Profile'); - $return[] = [ - 'success' => TRUE, - // Archive writing doesn't merit a message, and if done through the UI - // would appear on the subsequent page load. - 'display' => FALSE, - 'message' => '@type @package written to archive.', - 'variables' => [ - '@type' => $type, - '@package' => $package->getName(), - ], - ]; - } - - /** - * Registers a failed package or profile archive operation. - * - * @param array &$return - * The return value, passed by reference. - * @param \Drupal\features\Package $package - * The package or profile. - * @param \Exception $exception - * The exception object. - * @param string $message - * Error message when there isn't an Exception object. - */ - protected function failure(array &$return, Package $package, \Exception $exception = NULL, $message = '') { - $type = $package->getType() == 'module' ? $this->t('Package') : $this->t('Profile'); - $return[] = [ - 'success' => FALSE, - // Archive writing doesn't merit a message, and if done through the UI - // would appear on the subsequent page load. - 'display' => FALSE, - 'message' => '@type @package not written to archive. Error: @error.', - 'variables' => [ - '@type' => $type, - '@package' => $package->getName(), - '@error' => isset($exception) ? $exception->getMessage() : $message, - ], - ]; - } - - /** - * Writes a file to the file system, creating its directory as needed. - * - * @param string $directory - * The extension's directory. - * @param array $file - * Array with the following keys: - * - 'filename': the name of the file. - * - 'subdirectory': any subdirectory of the file within the extension - * directory. - * - 'string': the contents of the file. - * @param ArchiveTar $archiver - * The archiver. - * - * @throws Exception - */ - protected function generateFile($directory, array $file, ArchiveTar $archiver) { - $filename = $directory; - if (!empty($file['subdirectory'])) { - $filename .= '/' . $file['subdirectory']; - } - $filename .= '/' . $file['filename']; - // Set the mode to 0644 rather than the default of 0600. - if ($archiver->addString($filename, $file['string'], FALSE, ['mode' => 0644]) === FALSE) { - throw new \Exception($this->t('Failed to archive file @filename.', ['@filename' => $file['filename']])); - } - } - - /** - * {@inheritdoc} - */ - public function exportFormSubmit(array &$form, FormStateInterface $form_state) { - // Redirect to the archive file download. - $form_state->setRedirect('features.export_download', ['uri' => $this->archiveName, 'token' => $this->csrfToken->get($this->archiveName)]); - } - -} diff --git a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php b/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php deleted file mode 100644 index 5844c0e2d..000000000 --- a/sites/all/modules/contrib/admin/features/src/Plugin/FeaturesGeneration/FeaturesGenerationWrite.php +++ /dev/null @@ -1,237 +0,0 @@ -root = $root; - $this->fileSystem = $fileSystem; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $container->get('app.root'), - $container->get('file_system') - ); - } - - /** - * Reads and merges in existing files for a given package or profile. - * - * @param \Drupal\features\Package &$package - * The package. - * @param array $existing_packages - * An array of existing packages. - * @param \Drupal\features\FeaturesBundleInterface $bundle - * The bundle the package belongs to. - */ - protected function preparePackage(Package $package, array $existing_packages, FeaturesBundleInterface $bundle = NULL) { - // If this package is already present, prepare files. - if (isset($existing_packages[$package->getMachineName()])) { - $existing_directory = $existing_packages[$package->getMachineName()]; - $package->setDirectory($existing_directory); - } - else { - $existing_directory = $package->getDirectory(); - } - - // Merge in the info file. - $info_file_uri = $this->root . '/' . $existing_directory . '/' . $package->getMachineName() . '.info.yml'; - if (file_exists($info_file_uri)) { - $files = $package->getFiles(); - $files['info']['string'] = $this->mergeInfoFile($package->getFiles()['info']['string'], $info_file_uri); - $package->setFiles($files); - - // Remove the config directories, as they will be replaced. - foreach (array_keys($this->featuresManager->getExtensionStorages() - ->getExtensionStorages()) as $directory) { - $config_directory = $this->root . '/' . $existing_directory . '/' . $directory; - if (is_dir($config_directory)) { - file_unmanaged_delete_recursive($config_directory); - } - } - } - } - - /** - * {@inheritdoc} - */ - public function generate(array $packages = [], FeaturesBundleInterface $bundle = NULL) { - // If no packages were specified, get all packages. - if (empty($packages)) { - $packages = $this->featuresManager->getPackages(); - } - - $return = []; - - // Add package files. - // We need to update the system.module.files state because it's cached. - // Cannot just call system_rebuild_module_data() because $listing->scan() has - // it's own internal static cache that we cannot clear at this point. - $files = \Drupal::state()->get('system.module.files'); - foreach ($packages as $package) { - $this->generatePackage($return, $package); - if (!isset($files[$package->getMachineName()]) && isset($package->getFiles()['info'])) { - $files[$package->getMachineName()] = $package->getDirectory() . '/' . $package->getFiles()['info']['filename']; - } - } - - // Rebuild system module cache - \Drupal::state()->set('system.module.files', $files); - - return $return; - } - - /** - * Writes a package or profile's files to the file system. - * - * @param array &$return - * The return value, passed by reference. - * @param \Drupal\features\Package $package - * The package or profile. - */ - protected function generatePackage(array &$return, Package $package) { - if (!$package->getFiles()) { - $this->failure($return, $package, NULL, $this->t('No configuration was selected to be exported.')); - return; - } - $success = TRUE; - foreach ($package->getFiles() as $file) { - try { - $this->generateFile($package->getDirectory(), $file); - } - catch (\Exception $exception) { - $this->failure($return, $package, $exception); - $success = FALSE; - break; - } - } - if ($success) { - $this->success($return, $package); - } - } - - /** - * Registers a successful package or profile write operation. - * - * @param array &$return - * The return value, passed by reference. - * @param \Drupal\features\Package $package - * The package or profile. - */ - protected function success(array &$return, Package $package) { - $type = $package->getType() == 'module' ? $this->t('Package') : $this->t('Profile'); - $return[] = [ - 'success' => TRUE, - 'display' => TRUE, - 'message' => '@type @package written to @directory.', - 'variables' => [ - '@type' => $type, - '@package' => $package->getName(), - '@directory' => $package->getDirectory(), - ], - ]; - } - - /** - * Registers a failed package or profile write operation. - * - * @param array &$return - * The return value, passed by reference. - * @param \Drupal\features\Package $package - * The package or profile. - * @param \Exception $exception - * The exception object. - * @param string $message - * Error message when there isn't an Exception object. - */ - protected function failure(array &$return, Package $package, \Exception $exception = NULL, $message = '') { - $type = $package->getType() == 'module' ? $this->t('Package') : $this->t('Profile'); - $return[] = [ - 'success' => FALSE, - 'display' => TRUE, - 'message' => '@type @package not written to @directory. Error: @error.', - 'variables' => [ - '@type' => $type, - '@package' => $package->getName(), - '@directory' => $package->getDirectory(), - '@error' => isset($exception) ? $exception->getMessage() : $message, - ], - ]; - } - - /** - * Writes a file to the file system, creating its directory as needed. - * - * @param string $directory - * The extension's directory. - * @param array $file - * Array with the following keys: - * - 'filename': the name of the file. - * - 'subdirectory': any subdirectory of the file within the extension - * directory. - * - 'string': the contents of the file. - * - * @throws Exception - */ - protected function generateFile($directory, array $file) { - if (!empty($file['subdirectory'])) { - $directory .= '/' . $file['subdirectory']; - } - $directory = $this->root . '/' . $directory; - if (!is_dir($directory)) { - if ($this->fileSystem->mkdir($directory, NULL, TRUE) === FALSE) { - throw new \Exception($this->t('Failed to create directory @directory.', ['@directory' => $directory])); - } - } - if (file_put_contents($directory . '/' . $file['filename'], $file['string']) === FALSE) { - throw new \Exception($this->t('Failed to write file @filename.', ['@filename' => $file['filename']])); - } - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/core.date_format.short.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/core.date_format.short.yml deleted file mode 100644 index f7fbe193a..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/core.date_format.short.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: short -label: 'Default short date' -locked: false -pattern: 'm/d/Y - H:i' diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/system.cron.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/system.cron.yml deleted file mode 100644 index e6f30d3d2..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/config/install/system.cron.yml +++ /dev/null @@ -1,3 +0,0 @@ -threshold: - requirements_warning: 172800 - requirements_error: 1209600 diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.features.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.features.yml deleted file mode 100644 index cbe4b9e2f..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.features.yml +++ /dev/null @@ -1,3 +0,0 @@ -bundle: test -excluded: - - system.theme diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.info.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.info.yml deleted file mode 100644 index b90578e88..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_feature/test_feature.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: feature -type: module -# core: 8.x -package: Test -# Force this to install after features. -dependencies: - - features - -# Information added by Drupal.org packaging script on 2018-09-09 -version: '8.x-3.8' -core: '8.x' -project: 'features' -datestamp: 1536512288 diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/config/install/core.date_format.long.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/config/install/core.date_format.long.yml deleted file mode 100644 index 9e385f1c1..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/config/install/core.date_format.long.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: long -label: 'Default long date' -locked: false -pattern: 'l, F j, Y - H:i' diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.features.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.features.yml deleted file mode 100644 index 3387e5fee..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.features.yml +++ /dev/null @@ -1,5 +0,0 @@ -bundle: test_mybundle -excluded: - - system.theme -required: - - core.date_format.long diff --git a/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.info.yml b/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.info.yml deleted file mode 100644 index 2f0e6404a..000000000 --- a/sites/all/modules/contrib/admin/features/tests/modules/test_mybundle_core/test_mybundle_core.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Test Core -type: module -# core: 8.x -package: Test -# Ensure features is enabled first -dependencies: - - features - -# Information added by Drupal.org packaging script on 2018-09-09 -version: '8.x-3.8' -core: '8.x' -project: 'features' -datestamp: 1536512288 diff --git a/sites/all/modules/contrib/admin/features/tests/src/Kernel/Entity/FeaturesBundleIntegrationTest.php b/sites/all/modules/contrib/admin/features/tests/src/Kernel/Entity/FeaturesBundleIntegrationTest.php deleted file mode 100644 index aaf62bc72..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Kernel/Entity/FeaturesBundleIntegrationTest.php +++ /dev/null @@ -1,82 +0,0 @@ - 'test', - 'name' => 'Test', - ]); - $bundle->save(); - - /** @var \Drupal\features\Entity\FeaturesBundle $bundle */ - $bundle = FeaturesBundle::load('test'); - $this->assertEquals('Test', $bundle->getName()); - } - - /** - * @covers ::isDefault - */ - public function testIsDefaultWithDefaultBundle() { - $bundle = FeaturesBundle::create([ - 'machine_name' => FeaturesBundleInterface::DEFAULT_BUNDLE, - ]); - - $this->assertTrue($bundle->isDefault()); - } - - /** - * @covers ::isDefault - */ - public function testIsDefaultWithNonDefaultBundle() { - $bundle = FeaturesBundle::create([ - 'machine_name' => 'other', - ]); - - $this->assertFalse($bundle->isDefault()); - } - - /** - * @covers ::getFullName - */ - public function testGetFullName() { - } - - /** - * @covers ::getShortName - */ - public function testGetShortName() { - } - - /** - * @covers ::getProfileName - * @covers ::setProfileName - */ - public function testGetProfile() { - $bundle = FeaturesBundle::create([ - 'machine_name' => 'other', - 'profile_name' => 'example', - 'is_profile' => TRUE, - ]); - $this->assertEquals('example', $bundle->getProfileName()); - - $bundle->setProfileName('example2'); - $this->assertEquals('example2', $bundle->getProfileName()); - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignTest.php b/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignTest.php deleted file mode 100644 index 59b4ad961..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignTest.php +++ /dev/null @@ -1,855 +0,0 @@ -installConfig('features'); - $this->installConfig('system'); - - $this->featuresManager = \Drupal::service('features.manager'); - $this->assigner = \Drupal::service('features_assigner'); - $this->bundle = $this->assigner->getBundle(); - - // Turn off all assignment plugins. - $this->bundle->setEnabledAssignments([]); - - // Start with an empty configuration collection. - $this->featuresManager->setConfigCollection([]); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentAlter - */ - public function testAssignAlter() { - $method_id = 'alter'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Add some configuration. - $this->addConfigurationItem('example.settings', [ - '_core' => ['something'], - 'uuid' => 'something', - ], - [ - 'type' => FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG, - ]); - $this->addConfigurationItem('node.type.article', [ - '_core' => ['something'], - 'uuid' => 'something', - 'permissions' => [ - 'first', - 'second', - ], - ], - [ - 'type' => 'node_type', - ]); - $this->addConfigurationItem('user.role.test', [ - '_core' => ['something'], - 'uuid' => 'something', - 'permissions' => [ - 'first', - 'second', - ], - ], - [ - 'type' => 'user_role', - ]); - - // Set all settings to FALSE. - $settings = [ - 'core' => FALSE, - 'uuid' => FALSE, - 'user_permissions' => FALSE, - ]; - $this->bundle->setAssignmentSettings($method_id, $settings); - - $this->assigner->applyAssignmentMethod($method_id); - - $config = $this->featuresManager->getConfigCollection(); - $this->assertNotEmpty($config['example.settings'], 'Expected config not created.'); - $this->assertNotEmpty($config['node.type.article'], 'Expected config not created.'); - $this->assertNotEmpty($config['user.role.test'], 'Expected config not created.'); - - $example_settings_data = $config['example.settings']->getData(); - $this->assertEquals($example_settings_data['_core'], ['something'], 'Expected _core value missing.'); - $this->assertEquals($example_settings_data['uuid'], 'something', 'Expected uuid value missing.'); - - $node_type_data = $config['node.type.article']->getData(); - $this->assertEquals($node_type_data['_core'], ['something'], 'Expected _core value missing.'); - $this->assertEquals($node_type_data['uuid'], 'something', 'Expected uuid value missing.'); - $this->assertEquals($node_type_data['permissions'], [ - 'first', - 'second', - ], 'Expected permissions value missing.'); - - $user_role_data = $config['user.role.test']->getData(); - $this->assertEquals($user_role_data['_core'], ['something'], 'Expected _core value missing.'); - $this->assertEquals($user_role_data['uuid'], 'something', 'Expected uuid value missing.'); - $this->assertEquals($user_role_data['permissions'], [ - 'first', - 'second', - ], 'Expected permissions value missing.'); - - // Set all settings to TRUE. - $settings = [ - 'core' => TRUE, - 'uuid' => TRUE, - 'user_permissions' => TRUE, - ]; - $this->bundle->setAssignmentSettings($method_id, $settings); - - $this->assigner->applyAssignmentMethod($method_id); - - $config = $this->featuresManager->getConfigCollection(); - $this->assertNotEmpty($config['example.settings'], 'Expected config not created.'); - $this->assertNotEmpty($config['node.type.article'], 'Expected config not created.'); - $this->assertNotEmpty($config['user.role.test'], 'Expected config not created.'); - - $example_settings_data = $config['example.settings']->getData(); - $this->assertFalse(isset($example_settings_data['_core']), 'Unexpected _core value present.'); - // uuid should be retained for simple configuration. - $this->assertEquals($example_settings_data['uuid'], 'something', 'Expected uuid value missing.'); - - $node_type_data = $config['node.type.article']->getData(); - $this->assertFalse(isset($node_type_data['_core']), 'Unexpected _core value present.'); - $this->assertFalse(isset($node_type_data['uuid']), 'Unexpected uuid value present.'); - // permissions should be stripped only for user_role configuration. - $this->assertEquals($node_type_data['permissions'], [ - 'first', - 'second', - ], 'Expected permissions value missing.'); - - $user_role_data = $config['user.role.test']->getData(); - $this->assertFalse(isset($user_role_data['_core']), 'Unexpected _core value present.'); - $this->assertFalse(isset($user_role_data['uuid']), 'Unexpected uuid value present.'); - $this->assertFalse(isset($user_role_data['permissions']), 'Unexpected permissions value present.'); - - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentBaseType - */ - public function testAssignBase() { - $method_id = 'base'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Test the default options for the base assignment method. - - // Test node type assignments. - // Declare the node_type entity 'article'. - $this->addConfigurationItem('node.type.article', [], [ - 'shortName' => 'article', - 'label' => 'Article', - 'type' => 'node_type', - 'dependents' => ['field.field.node.article.body'], - ]); - - // Add a piece of dependent configuration. - $this->addConfigurationItem('field.field.node.article.body', [], [ - 'shortName' => 'node.article.body', - 'label' => 'Body', - 'type' => 'field_config', - 'dependents' => [], - ]); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - - $expected_package_names = ['article', 'user']; - - $this->assertEquals($expected_package_names, array_keys($packages), 'Expected packages not created.'); - - // Dependents like field.field.node.article.body should not be assigned. - $expected_config_items = [ - 'node.type.article', - ]; - - $this->assertEquals($expected_config_items, $packages['article']->getConfig(), 'Expected configuration items not present in article package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentCoreType - */ - public function testAssignCore() { - $method_id = 'core'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Test the default options for the core assignment method. - - // Add a piece of configuration of a core type. - $this->addConfigurationItem('field.storage.node.body', [], [ - 'shortName' => 'node.body', - 'label' => 'node.body', - 'type' => 'field_storage_config', - 'dependents' => ['field.field.node.article.body'], - ]); - - // Add a piece of configuration of a non-core type. - $this->addConfigurationItem('field.field.node.article.body', [], [ - 'shortName' => 'node.article.body', - 'label' => 'Body', - 'type' => 'field_config', - 'dependents' => [], - ]); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - - $expected_package_names = ['core']; - - $this->assertEquals($expected_package_names, array_keys($packages), 'Expected packages not created.'); - - $this->assertTrue(in_array('field.storage.node.body', $packages['core']->getConfig(), 'Expected configuration item not present in core package.')); - $this->assertFalse(in_array('field.field.node.article.body', $packages['core']->getConfig(), 'Unexpected configuration item present in core package.')); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentDependency - */ - public function testAssignDependency() { - $method_id = 'dependency'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Test the default options for the base assignment method. - - // Test node type assignments. - // Declare the node_type entity 'article'. - $this->addConfigurationItem('node.type.article', [], [ - 'shortName' => 'article', - 'label' => 'Article', - 'type' => 'node_type', - 'dependents' => ['field.field.node.article.body'], - ]); - - // Add a piece of dependent configuration. - $this->addConfigurationItem('field.field.node.article.body', [], [ - 'shortName' => 'node.article.body', - 'label' => 'Body', - 'type' => 'field_config', - 'dependents' => [], - ]); - - $this->featuresManager->initPackage(self::PACKAGE_NAME, 'My test package'); - $this->featuresManager->assignConfigPackage(self::PACKAGE_NAME, ['node.type.article']); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - - $expected_package_names = [self::PACKAGE_NAME]; - - $this->assertEquals($expected_package_names, array_keys($packages), 'Expected packages not created.'); - - $expected_config_items = [ - 'node.type.article', - 'field.field.node.article.body', - ]; - - $this->assertEquals($expected_config_items, $packages[self::PACKAGE_NAME]->getConfig(), 'Expected configuration items not present in article package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentExclude - */ - public function testAssignExclude() { - $method_id = 'exclude'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - // Also enable Packages and Core plugins. - $this->enableAssignmentMethod('packages', FALSE); - $this->enableAssignmentMethod('core', FALSE); - - // Apply the bundle - $this->bundle = $this->assigner->loadBundle('test_mybundle'); - - $this->assigner->applyAssignmentMethod('packages'); - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages[self::TEST_INSTALLED_PACKAGE], 'Expected package not created.'); - - // 1. When Required is set to True, config should stay with the module - // First, test with "Required" set to True. - $packages[self::TEST_INSTALLED_PACKAGE]->setRequired(true); - $this->featuresManager->setPackages($packages); - - $this->assigner->applyAssignmentMethod('exclude'); - $this->assigner->applyAssignmentMethod('core'); - $this->assigner->applyAssignmentMethod('existing'); - $packages = $this->featuresManager->getPackages(); - - $expected_config_items = [ - 'core.date_format.long', - ]; - - $this->assertEquals($expected_config_items, $packages[self::TEST_INSTALLED_PACKAGE]->getConfig(), 'Expected configuration items not present in existing test_core package.'); - - // 2. When Required is set to False, config still stays with module - // Because the module is installed. - $this->reset(); - $this->bundle = $this->assigner->loadBundle('test_mybundle'); - - $this->assigner->applyAssignmentMethod('packages'); - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages[self::TEST_INSTALLED_PACKAGE], 'Expected test_mybundle_core package not created.'); - - // Set "Required" set to False - $packages[self::TEST_INSTALLED_PACKAGE]->setRequired(false); - $this->featuresManager->setPackages($packages); - - $this->assigner->applyAssignmentMethod('exclude'); - $this->assigner->applyAssignmentMethod('core'); - $this->assigner->applyAssignmentMethod('existing'); - $packages = $this->featuresManager->getPackages(); - $this->assertFalse(array_key_exists('core', $packages), 'Core package should not be created.'); - - $expected_config_items = [ - 'core.date_format.long', - ]; - $this->assertEquals($expected_config_items, $packages[self::TEST_INSTALLED_PACKAGE]->getConfig(), 'Expected configuration items not present in existing test_core package.'); - - // 3. When Required is set to False and module is NOT installed, - // Config stays with module if it doesn't match the current namespace - $this->reset(); - // Load a bundle different from TEST_UNINSTALLED_PACKAGE - $this->bundle = $this->assigner->loadBundle('test_mybundle'); - - $this->assigner->applyAssignmentMethod('packages'); - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages[self::TEST_UNINSTALLED_PACKAGE], 'Expected test_feature package not created.'); - $this->assertNotEmpty($packages[self::TEST_INSTALLED_PACKAGE], 'Expected test_mybundle_core package not created.'); - - // Mark package as uninstalled, set "Required" set to False - $packages[self::TEST_UNINSTALLED_PACKAGE]->setRequired(false); - $this->featuresManager->setPackages($packages); - - $this->assigner->applyAssignmentMethod('exclude'); - $this->assigner->applyAssignmentMethod('core'); - $this->assigner->applyAssignmentMethod('existing'); - $packages = $this->featuresManager->getPackages(); - $this->assertFalse(array_key_exists('core', $packages), 'Core package should not be created.'); - - $expected_config_items = [ - 'core.date_format.short', - 'system.cron', - ]; - $this->assertEquals($expected_config_items, $packages[self::TEST_UNINSTALLED_PACKAGE]->getConfig(), 'Expected configuration items not present in existing test_feature package.'); - - // 4. When Required is set to False and module is NOT installed, - // Config is reassigned within modules that match the namespace. - $this->reset(); - // Load the bundle used in TEST_UNINSTALLED_PACKAGE - $this->bundle = $this->assigner->loadBundle('test'); - if (empty($this->bundle) || $this->bundle->isDefault()) { - // Since we uninstalled the test_feature, we probably need to create - // an empty "test" bundle - $this->bundle = $this->assigner->createBundleFromDefault('test'); - } - - $this->assigner->applyAssignmentMethod('packages'); - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages[self::TEST_UNINSTALLED_PACKAGE], 'Expected test_feature package not created.'); - - // Set "Required" set to False - $packages[self::TEST_UNINSTALLED_PACKAGE]->setRequired(false); - $this->featuresManager->setPackages($packages); - - $this->assigner->applyAssignmentMethod('exclude'); - $this->assigner->applyAssignmentMethod('core'); - $this->assigner->applyAssignmentMethod('existing'); - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages['core'], 'Expected Core package not created.'); - - // Ensure "core" package is not confused with "test_core" module - // Since we are in a bundle - $this->assertEmpty($packages['core']->getExtension(), 'Autogenerated core package should not have an extension'); - - // Core config should be reassigned from TEST_UNINSTALLED_PACKAGE into Core - $expected_config_items = [ - 'system.cron', - ]; - $this->assertEquals($expected_config_items, $packages[self::TEST_UNINSTALLED_PACKAGE]->getConfig(), 'Expected configuration items not present in existing test_feature package.'); - $expected_config_items = [ - 'core.date_format.short', - ]; - $this->assertEquals($expected_config_items, $packages['core']->getConfig(), 'Expected configuration items not present in core package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentExclude - */ - public function testAssignExisting() { - $method_id = 'existing'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - // Also enable Packages plugin. - $this->enableAssignmentMethod('packages', FALSE); - - // First create the existing packages. - $this->assigner->applyAssignmentMethod('packages'); - // Now move config into those existing packages. - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages[self::TEST_INSTALLED_PACKAGE], 'Expected package not created.'); - $this->assertNotEmpty($packages[self::TEST_UNINSTALLED_PACKAGE], 'Expected package not created.'); - - // Turn off any "required" option in package to let config get reassigned - $package = $packages[self::TEST_INSTALLED_PACKAGE]; - $package->setRequired(true); - - $expected_config_items = [ - 'core.date_format.long', - ]; - $this->assertEquals($expected_config_items, $packages[self::TEST_INSTALLED_PACKAGE]->getConfig(), 'Expected configuration items not present in existing package.'); - - $expected_config_items = [ - 'core.date_format.short', - 'system.cron', - ]; - $this->assertEquals($expected_config_items, $packages[self::TEST_UNINSTALLED_PACKAGE]->getConfig(), 'Expected configuration items not present in existing package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentForwardDependency - */ - public function testAssignForwardDependency() { - $method_id = 'forward_dependency'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Add some configuration. - // Two parent items. - $this->addConfigurationItem('parent1', [], [ - 'type' => 'node_type', - 'dependents' => ['grandparent'], - ]); - $this->addConfigurationItem('parent2', [], [ - 'type' => 'node_type', - 'dependents' => [], - ]); - // Something that belongs to just one parent. - $this->addConfigurationItem('child1', [], [ - 'type' => 'node_type', - 'dependents' => ['parent1'], - ]); - // Something that belongs to both parents. - $this->addConfigurationItem('child2', [], [ - 'type' => 'node_type', - 'dependents' => ['parent1', 'parent2'], - ]); - // Something that indirectly belongs to parent1. - $this->addConfigurationItem('grandchild', [], [ - 'type' => 'node_type', - 'dependents' => ['child1'], - ]); - // A dependent, not a dependency. - $this->addConfigurationItem('grandparent', [], [ - 'type' => 'node_type', - 'dependents' => [], - ]); - // Something completely unrelated. - $this->addConfigurationItem('stranger', [], [ - 'type' => 'node_type', - 'dependents' => [], - ]); - - $this->featuresManager->initPackage(self::PACKAGE_NAME, 'My test package'); - $this->featuresManager->assignConfigPackage(self::PACKAGE_NAME, ['parent1']); - - $other_package_name = 'other_package'; - $this->featuresManager->initPackage($other_package_name, 'Other package'); - $this->featuresManager->assignConfigPackage($other_package_name, ['parent2']); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - $expected_package_names = [self::PACKAGE_NAME, $other_package_name]; - sort($expected_package_names); - $actual_package_names = array_keys($packages); - sort($actual_package_names); - $this->assertEquals($expected_package_names, $actual_package_names, 'Expected packages not created.'); - - $expected_config_items = [ - 'parent1', - 'child1', - 'grandchild', - ]; - sort($expected_config_items); - $actual_config_items = $packages[self::PACKAGE_NAME]->getConfig(); - sort($actual_config_items); - - $this->assertEquals($expected_config_items, $actual_config_items, 'Expected configuration items not present in article package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentNamespace - */ - public function testAssignNamespace() { - $method_id = 'namespace'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Apply the bundle - $this->bundle = $this->assigner->loadBundle('test_mybundle'); - - $package_data = [ - 'article' => [ - // Items that should be assigned to 'article'. - 'article', - 'article-after', - 'before.article', - 'something_article', - 'something-article', - 'something.article', - 'article_something', - 'article-something', - 'article.something', - 'something_article_something', - 'something-article-something', - 'something.article.something', - 'something.article_something', - ], - 'article_after' => [ - // Items that should be assigned to 'article_after'. - 'article_after', - 'something_article_after', - 'something-article_after', - 'something.article_after', - 'article_after_something', - 'article_after-something', - 'article_after.something', - 'something_article_after_something', - 'something-article_after-something', - 'something.article_after.something', - 'something.article_after_something', - ], - 'before_article' => [ - // Items that should be assigned to 'before_article'. - 'before_article', - 'something_before_article', - 'something-before_article', - 'something.before_article', - 'before_article_something', - 'before_article-something', - 'before_article.something', - 'something_before_article_something', - 'something-before_article-something', - 'something.before_article.something', - 'something.before_article_something', - ], - // Emulate an existing feature, which has a machine name prefixed by - // the bundle name. - 'test_mybundle_page' => [ - // Items that should be assigned to 'test_mybundle_page'. - // Items should match the short name, 'page'. - 'page', - 'page-after', - 'before.page', - 'something_page', - 'something-page', - 'something.page', - 'page_something', - 'page-something', - 'page.something', - 'something_page_something', - 'something-page-something', - 'something.page.something', - 'something.page_something', - ], - ]; - - foreach ($package_data as $machine_name => $config_short_names) { - $this->featuresManager->initPackage($machine_name, 'My test package ' . $machine_name); - foreach ($config_short_names as $short_name) { - $this->addConfigurationItem('node.type.' . $short_name, [], [ - 'type' => 'node_type', - 'shortName' => $short_name, - ]); - } - } - - // Add some config that should not be matched. - $config_short_names = [ - 'example', - 'example_something', - 'article~', - 'myarticle', - ]; - foreach ($config_short_names as $short_name) { - $this->addConfigurationItem('node.type.' . $short_name, [], [ - 'type' => 'node_type', - 'shortName' => $short_name, - ]); - } - - $this->assigner->applyAssignmentMethod($method_id); - $packages = $this->featuresManager->getPackages(); - - foreach ($package_data as $machine_name => $config_short_names) { - $this->assertNotEmpty($packages[$machine_name], 'Expected package ' . $machine_name . ' not created.'); - array_walk($config_short_names, function(&$value) { - $value = 'node.type.' . $value; - }); - sort($config_short_names); - $package_config = $packages[$machine_name]->getConfig(); - sort($package_config); - $this->assertEquals($config_short_names, $package_config, 'Expected configuration items not present in ' . $machine_name . ' package.'); - } - - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentOptionalType - */ - public function testAssignOptionalType() { - $method_id = 'optional'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - $settings = [ - 'types' => [ - 'config' => ['image_style'], - ], - ]; - $this->bundle->setAssignmentSettings($method_id, $settings); - - // Add some configuration. - $this->addConfigurationItem('node.type.article', [], [ - 'type' => 'node_type', - ]); - $this->addConfigurationItem('image.style.test', [], [ - 'type' => 'image_style', - ]); - $this->featuresManager->initPackage(self::PACKAGE_NAME, 'My test package'); - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages[self::PACKAGE_NAME], 'Expected package not created.'); - - $config = $this->featuresManager->getConfigCollection(); - $this->assertNotEmpty($config['node.type.article'], 'Expected config not created.'); - $this->assertNotEmpty($config['image.style.test'], 'Expected config not created.'); - - $this->assertNull($config['node.type.article']->getSubdirectory(), 'Expected package subdirectory not set to default.'); - $this->assertEquals($config['image.style.test']->getSubdirectory(), InstallStorage::CONFIG_OPTIONAL_DIRECTORY, 'Expected package subdirectory not set to optional.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentPackages - */ - public function testAssignPackages() { - $method_id = 'packages'; - - // A configuration item that will be excluded. - $this->addConfigurationItem('system.theme', [], [ - 'type' => FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG, - ]); - // A configuration item that will be required. - $this->addConfigurationItem('core.date_format.long', [], [ - 'type' => 'date_format', - ]); - // A configuration item that will be neither excluded nor required. - $this->addConfigurationItem('system.theme', [], [ - 'type' => FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG, - ]); - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - - $this->assertNotEmpty($packages[self::TEST_INSTALLED_PACKAGE], 'Expected package not created.'); - - $config = $this->featuresManager->getConfigCollection(); - - $this->assertTrue(in_array(self::TEST_INSTALLED_PACKAGE, $config['system.theme']->getPackageExcluded()), 'Configuration item not excluded from package.'); - $this->assertFalse(in_array(self::TEST_INSTALLED_PACKAGE, $config['system.site']->getPackageExcluded()), 'Configuration item excluded from package.'); - - $this->assertEquals(self::TEST_INSTALLED_PACKAGE, $config['core.date_format.long']->getPackage(), 'Required item not assigned to package.'); - $this->assertNotEquals(self::TEST_INSTALLED_PACKAGE, $config['system.site']->getPackage(), 'Unrequired item assigned to package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentProfile - */ - public function testAssignProfile() { - $method_id = 'profile'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Add some configuration. - $this->addConfigurationItem('shortcut.myshortcut', [], [ - 'type' => 'shortcut_set', - ]); - $this->addConfigurationItem('node.type.article', [], [ - 'type' => 'node_type', - ]); - $this->addConfigurationItem('image.style.test', [], [ - 'type' => 'image_style', - ]); - $this->addConfigurationItem('system.cron', [], [ - 'type' => FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG, - ]); - $this->bundle = $this->assigner->createBundleFromDefault('myprofile'); - $this->bundle->setProfileName('myprofile'); - $this->bundle->setIsProfile(TRUE); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - $this->assertNotEmpty($packages['myprofile'], 'Expected package not created.'); - - $expected_config_items = [ - 'shortcut.myshortcut', - 'system.cron', - 'system.theme', - ]; - $this->assertEquals($expected_config_items, $packages['myprofile']->getConfig(), 'Expected configuration items not present in package.'); - } - - /** - * @covers Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentSiteType - */ - public function testAssignSiteType() { - $method_id = 'site'; - - // Enable the method. - $this->enableAssignmentMethod($method_id); - - // Test the default options for the site assignment method. - - // Add a piece of configuration of a site type. - $this->addConfigurationItem('filter.format.plain_text', [], [ - 'shortName' => 'plain_text', - 'label' => 'Plain text', - 'type' => 'filter_format', - ]); - - // Add a piece of configuration of a non-site type. - $this->addConfigurationItem('field.field.node.article.body', [], [ - 'shortName' => 'node.article.body', - 'label' => 'Body', - 'type' => 'field_config', - 'dependents' => [], - ]); - - $this->assigner->applyAssignmentMethod($method_id); - - $packages = $this->featuresManager->getPackages(); - - $expected_package_names = ['site']; - - $this->assertEquals($expected_package_names, array_keys($packages), 'Expected packages not created.'); - - $this->assertTrue(in_array('filter.format.plain_text', $packages['site']->getConfig(), 'Expected configuration item not present in site package.')); - $this->assertFalse(in_array('field.field.node.article.body', $packages['site']->getConfig(), 'Unexpected configuration item present in site package.')); - } - - /** - * Enables a specified assignment method. - * - * @param string $method_id - * The ID of an assignment method. - * @param bool $exclusive - * (optional) Whether to set the method as the only enabled method. - * Defaults to TRUE. - */ - protected function enableAssignmentMethod($method_id, $exclusive = TRUE) { - if ($exclusive) { - $this->bundle->setEnabledAssignments([$method_id]); - } - else { - $enabled = array_keys($this->bundle->getEnabledAssignments()); - $enabled[] = $method_id; - $this->bundle->setEnabledAssignments($enabled); - } - } - - /** - * Adds a configuration item. - * - * @param string $name - * The config name. - * @param array $data - * The config data. - * @param array $properties - * (optional) Additional properties set on the object. - */ - protected function addConfigurationItem($name, array $data = [], array $properties = []) { - $config_collection = $this->featuresManager->getConfigCollection(); - $config_collection[$name] = new ConfigurationItem($name, $data, $properties); - $this->featuresManager->setConfigCollection($config_collection); - } - - /** - * Reset the config to reapply assignment plugins - */ - protected function reset() { - $this->assigner->reset(); - // Start with an empty configuration collection. - $this->featuresManager->setConfigCollection([]); - } -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignerTest.php b/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignerTest.php deleted file mode 100644 index 0477ece05..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesAssignerTest.php +++ /dev/null @@ -1,67 +0,0 @@ -configImporter->import(). - $this->installConfig('system'); - } - - /** - * Test bundle auto-creation during config import. - * - * We check the case where the import also causes features to be installed, - * so at the time auto-creation happens there's not yet a default bundle. - */ - public function testBundleAutoCreationImport() { - // Install the feature. - $installer = $this->container->get('module_installer'); - // Have to do these separately so features_modules_installed() doesn't - // just exit. - $installer->install(['features']); - $installer->install(['test_feature']); - - // Save config. - $this->copyConfig( - $this->container->get('config.storage'), - $this->container->get('config.storage.sync') - ); - - // Uninstall modules. - $installer->uninstall(['features', 'test_feature']); - - // Restore the config from after install. - $this->configImporter()->import(); - - // Find the auto-created bundle. - $bundle_storage = $this->container->get('entity_type.manager') - ->getStorage('features_bundle'); - $bundle = $bundle_storage->load('test'); - $this->assertNotNull($bundle, "Features bundle doesn't exist"); - $this->assertContains( - 'Auto-generated bundle', - $bundle->getDescription(), - "Features bundle not auto-created"); - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesGenerateTest.php b/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesGenerateTest.php deleted file mode 100644 index d17c8221f..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesGenerateTest.php +++ /dev/null @@ -1,210 +0,0 @@ -installConfig('features'); - $this->installConfig('system'); - - $this->featuresManager = \Drupal::service('features.manager'); - $this->generator = \Drupal::service('features_generator'); - $this->assigner = \Drupal::service('features_assigner'); - - $this->featuresManager->initPackage(self::PACKAGE_NAME, 'My test package'); - $package = $this->featuresManager->getPackage(self::PACKAGE_NAME); - $package->appendConfig('system.site'); - $this->featuresManager->setPackage($package); - } - - /** - * @covers \Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationArchive - */ - public function testExportArchive() { - $filename = file_directory_temp() . '/' . self::PACKAGE_NAME . '.tar.gz'; - if (file_exists($filename)) { - unlink($filename); - } - $this->assertFalse(file_exists($filename), 'Archive file already exists.'); - - $this->generator->generatePackages('archive', $this->assigner->getBundle(), [self::PACKAGE_NAME]); - $this->assertTrue(file_exists($filename), 'Archive file was not generated.'); - - $archive = new ArchiveTar($filename); - $files = $archive->listContent(); - - $this->assertEquals(3, count($files)); - $this->assertEquals(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.info.yml', $files[0]['filename']); - $this->assertEquals(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.features.yml', $files[1]['filename']); - $this->assertEquals(self::PACKAGE_NAME . '/config/install/system.site.yml', $files[2]['filename']); - - $expected_info = [ - "name" => "My test package", - "type" => "module", - "core" => "8.x", - ]; - $info = Yaml::decode($archive->extractInString(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.info.yml')); - $this->assertEquals($expected_info, $info, 'Incorrect info file generated'); - } - - public function testGeneratorWithBundle() { - $filename = file_directory_temp() . '/' . self::BUNDLE_NAME . '_' . self::PACKAGE_NAME . '.tar.gz'; - if (file_exists($filename)) { - unlink($filename); - } - $this->assertFalse(file_exists($filename), 'Archive file already exists.'); - - $bundle = FeaturesBundle::create([ - 'machine_name' => self::BUNDLE_NAME - ]); - - $this->generator->generatePackages('archive', $bundle, [self::PACKAGE_NAME]); - - $package = $this->featuresManager->getPackage(self::PACKAGE_NAME); - $this->assertNull($package); - - $package = $this->featuresManager->getPackage( self::BUNDLE_NAME . '_' . self::PACKAGE_NAME); - $this->assertEquals(self::BUNDLE_NAME . '_' . self::PACKAGE_NAME, $package->getMachineName()); - $this->assertEquals(self::BUNDLE_NAME, $package->getBundle()); - - $this->assertTrue(file_exists($filename), 'Archive file was not generated.'); - } - - /** - * @covers \Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationWrite - */ - public function testExportWrite() { - // Set a fake drupal root, so the testbot can also write into it. - vfsStream::setup('drupal'); - \Drupal::getContainer()->set('app.root', 'vfs://drupal'); - $this->featuresManager->setRoot('vfs://drupal'); - - $package = $this->featuresManager->getPackage(self::PACKAGE_NAME); - // Find out where package will be exported - list($full_name, $path) = $this->featuresManager->getExportInfo($package, $this->assigner->getBundle()); - $path = 'vfs://drupal/' . $path . '/' . $full_name; - if (file_exists($path)) { - file_unmanaged_delete_recursive($path); - } - $this->assertFalse(file_exists($path), 'Package directory already exists.'); - - $this->generator->generatePackages('write', $this->assigner->getBundle(), [self::PACKAGE_NAME]); - $info_file_uri = $path . '/' . self::PACKAGE_NAME . '.info.yml'; - $this->assertTrue(file_exists($path), 'Package directory was not generated.'); - $this->assertTrue(file_exists($info_file_uri), 'Package info.yml not generated.'); - $this->assertTrue(file_exists($path . '/config/install'), 'Package config/install not generated.'); - $this->assertTrue(file_exists($path . '/config/install/system.site.yml'), 'Config.yml not exported.'); - - $expected_info = [ - "name" => "My test package", - "type" => "module", - "core" => "8.x", - ]; - $info = Yaml::decode(file_get_contents($info_file_uri)); - $this->assertEquals($expected_info, $info, 'Incorrect info file generated'); - - // Now, add stuff to the feature and re-export to ensure it is preserved - // Add a dependency to the package itself to see that it gets exported. - $package->setDependencies(['user']); - $this->featuresManager->setPackage($package); - // Add dependency and custom key to the info file to simulate manual edit. - $info['dependencies'] = ['node']; - $info['mykey'] = "test value"; - $info_contents = Yaml::encode($info); - file_put_contents($info_file_uri, $info_contents); - - // Add an extra file that should be retained. - $css_file = $path . '/' . self::PACKAGE_NAME . '.css'; - $file_contents = "This is a dummy file"; - file_put_contents($css_file, $file_contents); - - // Add a config file that should be removed since it's not part of the - // feature. - $config_file = $path . '/config/install/node.type.mytype.yml'; - file_put_contents($config_file, $file_contents); - - $this->generator->generatePackages('write', $this->assigner->getBundle(), [self::PACKAGE_NAME]); - $this->assertTrue(file_exists($info_file_uri), 'Package info.yml not generated.'); - $expected_info = [ - "name" => "My test package", - "type" => "module", - "core" => "8.x", - "dependencies" => ["node", "user"], - "mykey" => "test value", - ]; - $info = Yaml::decode(file_get_contents($info_file_uri)); - $this->assertEquals($expected_info, $info, 'Incorrect info file generated'); - $this->assertTrue(file_exists($css_file), 'Extra file was not retained.'); - $this->assertFalse(file_exists($config_file), 'Config directory was not cleaned.'); - $this->assertEquals($file_contents, file_get_contents($css_file), 'Extra file contents not retained'); - - // Next, test that generating an Archive picks up the extra files. - $filename = file_directory_temp() . '/' . self::PACKAGE_NAME . '.tar.gz'; - if (file_exists($filename)) { - unlink($filename); - } - $this->assertFalse(file_exists($filename), 'Archive file already exists.'); - $this->generator->generatePackages('archive', $this->assigner->getBundle(), [self::PACKAGE_NAME]); - $this->assertTrue(file_exists($filename), 'Archive file was not generated.'); - - $archive = new ArchiveTar($filename); - $files = $archive->listContent(); - - $this->assertEquals(4, count($files)); - $this->assertEquals(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.info.yml', $files[0]['filename']); - $this->assertEquals(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.features.yml', $files[1]['filename']); - $this->assertEquals(self::PACKAGE_NAME . '/config/install/system.site.yml', $files[2]['filename']); - $this->assertEquals(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.css', $files[3]['filename']); - - $expected_info = [ - "name" => "My test package", - "type" => "module", - "core" => "8.x", - "dependencies" => ["node", "user"], - "mykey" => "test value", - ]; - $info = Yaml::decode($archive->extractInString(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.info.yml')); - $this->assertEquals($expected_info, $info, 'Incorrect info file generated'); - $this->assertEquals($file_contents, $archive->extractInString(self::PACKAGE_NAME . '/' . self::PACKAGE_NAME . '.css'), 'Extra file contents not retained'); - } -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesManagerKernelTest.php b/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesManagerKernelTest.php deleted file mode 100644 index 2ee794881..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Kernel/FeaturesManagerKernelTest.php +++ /dev/null @@ -1,103 +0,0 @@ -installConfig('features'); - $this->installConfig('system'); - - $this->featuresManager = $this->container->get('features.manager'); - $this->configFactory = $this->container->get('config.factory'); - } - - /** - * @covers \Drupal\features\FeaturesManager::createConfiguration - */ - public function testCreateConfiguration() { - $config_name = 'system_simple.testcreate'; - $config = [ - 'string_value' => 'example', - 'array_value' => [ - 'item1' => 'value1', - 'item2' => 'value2', - ], - ]; - $this->featuresManager->createConfiguration([$config_name => $config]); - $config_item = $this->configFactory->get($config_name); - $this->assertEquals($config['string_value'], $config_item->get('string_value'), 'Test config string saved'); - $this->assertEquals($config['array_value'], $config_item->get('array_value'), 'Test config array saved'); - } - - /** - * @covers \Drupal\features\FeaturesManager::import - */ - public function testImport() { - $packages = [ - 'package' => new Package('package', [ - 'configOrig' => ['system_simple.example' => 'system_simple.example'], - 'dependencies' => [], - 'bundle' => '', - ]), - 'package2' => new Package('package2', [ - 'configOrig' => ['system_simple.example2' => 'system_simple.example2'], - 'dependencies' => [], - 'bundle' => '', - ]), - 'package3' => new Package('package3', [ - 'configOrig' => ['system_simple.example3' => 'system_simple.example3'], - 'dependencies' => [], - 'bundle' => '', - ]), - ]; - $this->featuresManager->setPackages($packages); - - // Create all three configuration items. - $config_item = new ConfigurationItem('system_simple.example', ['value' => 'example'], ['package' => 'package']); - $config_item2 = new ConfigurationItem('system_simple.example2', ['value' => 'example2'], ['package' => 'package2']); - $config_item3 = new ConfigurationItem('system_simple.example3', ['value' => 'example3'], ['package' => 'package3']); - // Only save example and example3 as currently active config (so example2 will be new). - $this->featuresManager->setConfigCollection(['system_simple.example' => $config_item, 'system_simple.example3' => $config_item3]); - - // Only import example and example2, so example3 is unchanged. - $result = $this->featuresManager->import(['package', 'package2']); - $this->assertEquals(['system_simple.example'], array_keys($result['package']['updated']), 'Expected config updated'); - $this->assertEquals(['system_simple.example2'], array_keys($result['package2']['new']), 'Expected config created'); - - // Test if config was actually saved to the Factory. - // Cannot test for example2 because we didn't save the original config data - // and Package2 isn't a real module so config can't be loaded from module. - $example = $this->configFactory->get('system_simple.example')->get('value'); - $this->assertEquals('example', $example, 'Example config saved'); - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Unit/ConfigurationItemTest.php b/sites/all/modules/contrib/admin/features/tests/src/Unit/ConfigurationItemTest.php deleted file mode 100644 index 255ee8339..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Unit/ConfigurationItemTest.php +++ /dev/null @@ -1,21 +0,0 @@ -assertEquals('system.simple', ConfigurationItem::fromConfigStringToConfigType(FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG)); - $this->assertEquals('node', ConfigurationItem::fromConfigStringToConfigType('node')); - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesBundleTest.php b/sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesBundleTest.php deleted file mode 100644 index 726df5e04..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesBundleTest.php +++ /dev/null @@ -1,206 +0,0 @@ -prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); - $container->get('plugin.manager.features_assignment_method') - ->willReturn($manager); - \Drupal::setContainer($container->reveal()); - } - - /** - * @covers ::getEnabledAssignments - * @covers ::getAssignmentWeights - * @covers ::getAssignmentSettings - * @covers ::setAssignmentSettings - * @covers ::setAssignmentWeights - * @covers ::setEnabledAssignments - */ - public function testAssignmentSetting() { - // Create an entity. - $settings = [ - 'foo' => [ - 'enabled' => TRUE, - 'weight' => 0, - 'my_setting' => 42, - ], - 'bar' => [ - 'enabled' => FALSE, - 'weight' => 1, - 'another_setting' => 'value', - ], - ]; - $bundle = new FeaturesBundle([ - 'assignments' => $settings, - ], 'features_bundle'); - - // Get assignments and attributes. - $this->assertArrayEquals( - $bundle->getEnabledAssignments(), - ['foo' => 'foo'], - 'Can get enabled assignments' - ); - $this->assertArrayEquals( - $bundle->getAssignmentWeights(), - ['foo' => 0, 'bar' => 1], - 'Can get assignment weights' - ); - $this->assertArrayEquals( - $bundle->getAssignmentSettings('foo'), - $settings['foo'], - 'Can get assignment settings' - ); - $this->assertArrayEquals( - $bundle->getAssignmentSettings(), - $settings, - 'Can get all assignment settings' - ); - - // Change settings. - $settings['foo']['my_setting'] = 97; - $bundle->setAssignmentSettings('foo', $settings['foo']); - $this->assertArrayEquals( - $bundle->getAssignmentSettings('foo'), - $settings['foo'], - 'Can change assignment settings' - ); - - // Change weights. - $settings['foo']['weight'] = 1; - $settings['bar']['weight'] = 0; - $bundle->setAssignmentWeights(['foo' => 1, 'bar' => 0]); - $this->assertArrayEquals( - $bundle->getAssignmentWeights(), - ['foo' => 1, 'bar' => 0], - 'Can change assignment weights' - ); - $this->assertArrayEquals( - $bundle->getAssignmentSettings(), - $settings, - 'Weight changes are reflected in settings' - ); - - // Enable existing assignment. - $settings['bar']['enabled'] = TRUE; - $bundle->setEnabledAssignments(['foo', 'bar']); - $this->assertArrayEquals( - $bundle->getEnabledAssignments(), - ['foo' => 'foo', 'bar' => 'bar'], - 'Can enable assignment' - ); - $this->assertArrayEquals( - $bundle->getAssignmentSettings(), - $settings, - 'Enabled assignment status is reflected in settings' - ); - - // Disable existing assignments. - $settings['foo']['enabled'] = FALSE; - $settings['bar']['enabled'] = FALSE; - $bundle->setEnabledAssignments([]); - $this->assertArrayEquals( - $bundle->getEnabledAssignments(), - [], - 'Can disable assignments' - ); - $this->assertArrayEquals( - $bundle->getAssignmentSettings(), - $settings, - 'Disabled assignment status is reflected in settings' - ); - - // Enable a new assignment. - $settings['foo']['enabled'] = TRUE; - $settings['iggy'] = ['enabled' => TRUE, 'weight' => 0, 'new_setting' => 3]; - $bundle->setEnabledAssignments(['foo', 'iggy']); - $this->assertArrayEquals( - $bundle->getEnabledAssignments(), - ['foo' => 'foo', 'iggy' => 'iggy'], - 'Can enable new assignment' - ); - $bundle->setAssignmentSettings('iggy', $settings['iggy']); - $this->assertArrayEquals( - $bundle->getAssignmentSettings(), - $settings, - 'New enabled assignment status is reflected in settings' - ); - - } - - /** - * @covers ::getFullName - * @covers ::getShortName - * @covers ::SetIsProfile - * @covers ::isProfile - * @covers ::getProfileName - * @covers ::isProfilePackage - * @covers ::inBundle - */ - public function testFullname() { - $bundle = new FeaturesBundle([ - 'machine_name' => 'mybundle', - 'profile_name' => 'mybundle' - ], 'mybundle'); - $this->assertFalse($bundle->isProfile()); - // Settings:get('profile_name') isn't defined in test, so this returns NULL. - $this->assertNull($bundle->getProfileName()); - $this->assertFalse($bundle->isProfilePackage('mybundle')); - $this->assertEquals('mybundle_test', $bundle->getFullName('test')); - $this->assertEquals('mybundle_test', $bundle->getFullName('mybundle_test')); - $this->assertEquals('mybundle_mybundle', $bundle->getFullName('mybundle')); - $this->assertEquals('test', $bundle->getShortName('test')); - $this->assertEquals('test', $bundle->getShortName('mybundle_test')); - $this->assertEquals('mybundle', $bundle->getShortName('mybundle_mybundle')); - $this->assertEquals('mybundle', $bundle->getShortName('mybundle')); - $this->assertFalse($bundle->inBundle('test')); - $this->assertTrue($bundle->inBundle('mybundle_test')); - $this->assertFalse($bundle->inBundle('mybundle')); - - // Now test it as a profile bundle. - $bundle->setIsProfile(TRUE); - $this->assertTrue($bundle->isProfile()); - $this->assertTrue($bundle->isProfilePackage('mybundle')); - $this->assertFalse($bundle->isProfilePackage('standard')); - $this->assertEquals('mybundle', $bundle->getProfileName()); - $this->assertEquals('mybundle', $bundle->getFullName('mybundle')); - $this->assertFalse($bundle->inBundle('test')); - $this->assertTrue($bundle->inBundle('mybundle_test')); - $this->assertTrue($bundle->inBundle('mybundle')); - } - -} - -/** - * A dummy plugin manager, to help testing. - */ -class DummyPluginManager { - public function getDefinition($method_id) { - $definition = [ - 'enabled' => TRUE, - 'weight' => 0, - 'default_settings' => [ - 'my_setting' => 42, - ], - ]; - return $definition; - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesManagerTest.php b/sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesManagerTest.php deleted file mode 100644 index f53937a7c..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Unit/FeaturesManagerTest.php +++ /dev/null @@ -1,989 +0,0 @@ -set('string_translation', $this->getStringTranslationStub()); - $container->set('app.root', $this->root); - // Since in Drupal 8.3 the "\Drupal::installProfile()" was introduced - // then we have to spoof a value for the "install_profile" parameter - // because it will be used by "ExtensionInstallStorage" class, which - // extends the "FeaturesInstallStorage". - // @see \Drupal\features\FeaturesConfigInstaller::__construct() - $container->setParameter('install_profile', ''); - \Drupal::setContainer($container); - - $entity_type = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface'); - $entity_type->expects($this->any()) - ->method('getConfigPrefix') - ->willReturn('custom'); - $entity_type->expects($this->any()) - ->method('getProvider') - ->willReturn('my_module'); - $this->entityTypeManager = $this->getMock('\Drupal\Core\Entity\EntityTypeManagerInterface'); - $this->entityTypeManager->expects($this->any()) - ->method('getDefinition') - ->willReturn($entity_type); - $this->configFactory = $this->getMock(ConfigFactoryInterface::class); - $this->configStorage = $this->getMock(StorageInterface::class); - $this->configManager = $this->getMock(ConfigManagerInterface::class); - $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class); - // getModuleList should return an array of extension objects. - // but we just need isset($module_list[$provider]) for - // ::getConfigDependency() and ::assignInterPackageDependencies(). - $this->moduleHandler->expects($this->any()) - ->method('getModuleList') - ->willReturn([ - 'my_module' => true, - 'example' => true, - 'example3' => true, - 'my_feature' => true, - 'my_other_feature' => true, - 'package' => true, - 'package2' => true, - 'package3' => true, - 'giraffe_package' => true, - 'giraffe_package2' => true, - 'giraffe_package3' => true, - ]); - $this->configReverter = $this->getMock(ConfigRevertInterface::class); - $this->configReverter->expects($this->any()) - ->method('import') - ->willReturn(true); - $this->configReverter->expects($this->any()) - ->method('revert') - ->willReturn(true); - $this->featuresManager = new FeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - } - - /** - * @covers ::getActiveStorage - */ - public function testGetActiveStorage() { - $this->assertInstanceOf('\Drupal\Core\Config\StorageInterface', $this->featuresManager->getActiveStorage()); - } - - /** - * @covers ::getExtensionStorages - */ - public function testGetExtensionStorages() { - $this->assertInstanceOf('\Drupal\features\FeaturesExtensionStoragesInterface', $this->featuresManager->getExtensionStorages()); - } - - /** - * @covers ::getFullName - * @dataProvider providerTestGetFullName - */ - public function testGetFullName($type, $name, $expected) { - $this->assertEquals($this->featuresManager->getFullName($type, $name), $expected); - } - - /** - * Data provider for ::testGetFullName(). - */ - public function providerTestGetFullName() { - return [ - [NULL, 'name', 'name'], - [FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG, 'name', 'name'], - ['custom', 'name', 'custom.name'], - ]; - } - - /** - * @covers ::getPackage - * @covers ::getPackages - * @covers ::reset - * @covers ::setPackages - */ - public function testPackages() { - $packages = ['foo' => 'bar']; - $this->featuresManager->setPackages($packages); - $this->assertEquals($packages, $this->featuresManager->getPackages()); - $this->assertEquals('bar', $this->featuresManager->getPackage('foo')); - $this->featuresManager->reset(); - $this->assertArrayEquals([], $this->featuresManager->getPackages()); - $this->assertNull($this->featuresManager->getPackage('foo')); - } - - /** - * @covers ::setConfigCollection - * @covers ::getConfigCollection - */ - public function testConfigCollection() { - $config = ['config' => new ConfigurationItem('', [])]; - $this->featuresManager->setConfigCollection($config); - $this->assertArrayEquals($config, $this->featuresManager->getConfigCollection()); - } - - /** - * @covers ::setPackage - * @covers ::getPackage - */ - public function testSetPackage() { - $package = new Package('foo'); - $this->featuresManager->setPackage($package); - $this->assertEquals($package, $this->featuresManager->getPackage('foo')); - } - - /** - * @covers ::filterPackages - */ - public function testGetPackages() { - $packages = [ - 'package' => new Package('package', [ - 'bundle' => '', - 'status' => FeaturesManagerInterface::STATUS_NO_EXPORT, - ]), - 'package2' => new Package('package2', [ - 'bundle' => '', - 'status' => FeaturesManagerInterface::STATUS_UNINSTALLED, - ]), - 'package3' => new Package('package3', [ - 'bundle' => 'my_bundle', - 'status' => FeaturesManagerInterface::STATUS_NO_EXPORT, - ]), - 'package4' => new Package('package4', [ - 'bundle' => 'my_bundle', - 'status' => FeaturesManagerInterface::STATUS_UNINSTALLED, - ]), - ]; - - // Filter for the default bundle. - $filtered_packages = $this->featuresManager->filterPackages($packages, FeaturesBundleInterface::DEFAULT_BUNDLE); - $this->assertEquals(['package', 'package2'], array_keys($filtered_packages)); - - // Filter for a custom bundle. - $filtered_packages = $this->featuresManager->filterPackages($packages, 'my_bundle'); - $this->assertEquals(['package3', 'package4'], array_keys($filtered_packages)); - - // Filter for a non-matching bundle. - $filtered_packages = $this->featuresManager->filterPackages($packages, 'some_bundle'); - $this->assertEquals([], array_keys($filtered_packages)); - - // Filter for the default bundle removing only exported. - $filtered_packages = $this->featuresManager->filterPackages($packages, FeaturesBundleInterface::DEFAULT_BUNDLE, TRUE); - $this->assertEquals(['package'], array_keys($filtered_packages)); - - // Filter for a custom bundle removing only exported. - $filtered_packages = $this->featuresManager->filterPackages($packages, 'my_bundle', TRUE); - $this->assertEquals(['package3'], array_keys($filtered_packages)); - - // Filter for a non-matching bundle removing only exported. - $filtered_packages = $this->featuresManager->filterPackages($packages, 'some_bundle', TRUE); - $this->assertEquals([], array_keys($filtered_packages)); - } - - - protected function getAssignInterPackageDependenciesConfigCollection() { - $config_collection = []; - $config_collection['example.config'] = (new ConfigurationItem('example.config', [ - 'dependencies' => [ - 'config' => [ - 'example.config2', - 'example.config3', - 'example.config4', - 'example.config5', - 'example.config6', - 'example.config7', - ], - ], - ])) - ->setSubdirectory(InstallStorage::CONFIG_INSTALL_DIRECTORY) - ->setPackage('package'); - $config_collection['example.config2'] = (new ConfigurationItem('example.config2', [ - 'dependencies' => [], - ])) - ->setSubdirectory(InstallStorage::CONFIG_INSTALL_DIRECTORY) - ->setPackage('package2') - ->setProvider('my_feature'); - $config_collection['example.config3'] = (new ConfigurationItem('example.config3', [ - 'dependencies' => [], - ])) - ->setSubdirectory(InstallStorage::CONFIG_INSTALL_DIRECTORY) - ->setProvider('my_other_feature'); - $config_collection['example.config4'] = (new ConfigurationItem('example.config3', [ - 'dependencies' => [], - ])) - ->setSubdirectory(InstallStorage::CONFIG_INSTALL_DIRECTORY) - ->setProvider(static::PROFILE_NAME); - $config_collection['example.config5'] = (new ConfigurationItem('example.config5', [ - 'dependencies' => [], - ])) - ->setSubdirectory(InstallStorage::CONFIG_OPTIONAL_DIRECTORY) - ->setPackage('package3'); - $config_collection['example.config6'] = (new ConfigurationItem('example.config6', [ - 'dependencies' => [], - ])) - ->setSubdirectory(InstallStorage::CONFIG_INSTALL_DIRECTORY) - ->setProvider('my_uninstalled_feature'); - $config_collection['example.config7'] = (new ConfigurationItem('example.config7', [ - 'dependencies' => [], - ])) - ->setSubdirectory(InstallStorage::CONFIG_INSTALL_DIRECTORY) - ->setProvider('package4'); - - return $config_collection; - } - - /** - * @covers ::assignInterPackageDependencies - */ - public function testAssignInterPackageDependenciesWithoutBundle() { - $assigner = $this->prophesize(FeaturesAssignerInterface::class); - $bundle = $this->prophesize(FeaturesBundleInterface::class); - // Provide a bundle without any prefix. - $bundle->getFullName('package')->willReturn('package'); - $bundle->getFullName('package2')->willReturn('package2'); - $bundle->getFullName('package3')->willReturn('package3'); - $bundle->getFullName('package4')->willReturn('package4'); - $bundle->isDefault()->willReturn(TRUE); - $assigner->getBundle()->willReturn($bundle->reveal()); - // Use the wrapper because we need ::drupalGetProfile(). - $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - $features_manager->setAssigner($assigner->reveal()); - - $features_manager->setConfigCollection($this->getAssignInterPackageDependenciesConfigCollection()); - - $packages = [ - 'package' => new Package('package', [ - 'config' => ['example.config', 'example.config3'], - 'dependencies' => [], - 'bundle' => '', - ]), - 'package2' => new Package('package2', [ - 'config' => ['example.config2'], - 'dependencies' => [], - 'bundle' => '', - ]), - 'package3' => new Package('package3', [ - 'config' => ['example.config5'], - 'dependencies' => [], - 'bundle' => '', - ]), - 'package4' => new Package('package4', [ - 'config' => ['example.config7'], - 'dependencies' => [], - 'bundle' => '', - ]), - ]; - - $features_manager->setPackages($packages); - // Dependencies require the full package names. - $package_names = array_keys($packages); - $features_manager->setPackageBundleNames($bundle->reveal(), $package_names); - $packages = $features_manager->getPackages(); - $features_manager->assignInterPackageDependencies($bundle->reveal(), $packages); - // example.config3 has a providing_feature but no assigned package. - // my_package2 provides configuration required by configuration in - // my_package. - // Because package assignments take precedence over providing_feature ones, - // package2 should have been assigned rather than my_feature. - // Because it is assigned to the InstallStorage::CONFIG_OPTIONAL_DIRECTORY - // subdirectory, example.config5 does not create a dependency on its - // providing feature, package3. - // Because it's provided by an uninstalled module, example.config6 doesn't - // create a dependency on my_uninstalled_feature. - // Because it's provided by an uninstalled module, example.config7 doesn't - // create a dependency on package4. - $this->assertEquals(['my_other_feature', 'package2'], $packages['package']->getDependencies()); - $this->assertEquals([], $packages['package2']->getDependencies()); - } - - /** - * @covers ::assignInterPackageDependencies - */ - public function testAssignInterPackageDependenciesWithBundle() { - $assigner = $this->prophesize(FeaturesAssignerInterface::class); - $bundle = $this->prophesize(FeaturesBundleInterface::class); - // Provide a bundle without any prefix. - $bundle->getFullName('package')->willReturn('giraffe_package'); - $bundle->getFullName('package2')->willReturn('giraffe_package2'); - $bundle->getFullName('package3')->willReturn('giraffe_package3'); - $bundle->getFullName('package4')->willReturn('giraffe_package4'); - $bundle->getFullName('giraffe_package')->willReturn('giraffe_package'); - $bundle->getFullName('giraffe_package2')->willReturn('giraffe_package2'); - $bundle->isDefault()->willReturn(FALSE); - $bundle->getMachineName()->willReturn('giraffe'); - $assigner->getBundle('giraffe')->willReturn($bundle->reveal()); - // Use the wrapper because we need ::drupalGetProfile(). - $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - $features_manager->setAssigner($assigner->reveal()); - $features_manager->setConfigCollection($this->getAssignInterPackageDependenciesConfigCollection()); - - $packages = [ - 'package' => new Package('package', [ - 'config' => ['example.config'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ]), - 'package2' => new Package('package2', [ - 'config' => ['example.config2'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ]), - 'package3' => new Package('package3', [ - 'config' => ['example.config5'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ]), - 'package4' => new Package('package4', [ - 'config' => ['example.config7'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ]), - ]; - - $features_manager->setPackages($packages); - // Dependencies require the full package names. - $package_names = array_keys($packages); - $features_manager->setPackageBundleNames($bundle->reveal(), $package_names); - $packages = $features_manager->getPackages(); - $features_manager->assignInterPackageDependencies($bundle->reveal(), $packages); - // example.config3 has a providing_feature but no assigned package. - // my_package2 provides configuration required by configuration in - // my_package. - // Because package assignments take precedence over providing_feature ones, - // package2 should have been assigned rather than my_feature. - // Because it is assigned to the InstallStorage::CONFIG_OPTIONAL_DIRECTORY - // subdirectory, example.config5 does not create a dependency on its - // providing feature, package3. - // Because it's provided by an uninstalled module, example.config6 doesn't - // create a dependency on my_uninstalled_feature. - // Because it's provided by an uninstalled module, example.config7 doesn't - // create a dependency on giraffe_package4. - $expected = ['giraffe_package2', 'my_other_feature']; - $this->assertEquals($expected, $packages['giraffe_package']->getDependencies()); - } - - /** - * @covers ::assignInterPackageDependencies - * @expectedException \Exception - * @expectedExceptionMessage The packages have not yet been prefixed with a bundle name - */ - public function testAssignInterPackageDependenciesPrematureCall() { - $bundle = $this->prophesize(FeaturesBundleInterface::class); - $packages = [ - 'package' => new Package('package', [ - 'config' => ['example.config', 'example.config3'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ]), - ]; - - $this->featuresManager->assignInterPackageDependencies($bundle->reveal(), $packages); - } - - /** - * @covers ::reset - */ - public function testReset() { - $packages = [ - 'package' => [ - 'machine_name' => 'package', - 'config' => ['example.config', 'example.config3'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ], - 'package2' => [ - 'machine_name' => 'package2', - 'config' => ['example.config2'], - 'dependencies' => [], - 'bundle' => 'giraffe', - ], - ]; - $this->featuresManager->setPackages($packages); - - $config_item = new ConfigurationItem('example', [], ['package' => 'package']); - $config_item2 = new ConfigurationItem('example2', [], ['package' => 'package2']); - $this->featuresManager->setConfigCollection([$config_item, $config_item2]); - - $this->featuresManager->reset(); - $this->assertEmpty($this->featuresManager->getPackages()); - $config_collection = $this->featuresManager->getConfigCollection(); - $this->assertEquals('', $config_collection[0]->getPackage()); - $this->assertEquals('', $config_collection[1]->getPackage()); - } - - - /** - * @covers ::detectMissing - */ - public function testDetectMissing() { - $package = new Package('test-package', [ - 'configOrig' => ['test_config', 'test_config_non_existing'], - ]); - - $config_collection = []; - $config_collection['test_config'] = new ConfigurationItem('test_config', []); - $this->featuresManager->setConfigCollection($config_collection); - - $this->assertEquals(['test_config_non_existing'], $this->featuresManager->detectMissing($package)); - } - - /** - * @covers ::detectOverrides - */ - public function testDetectOverrides() { - $config_diff = $this->prophesize(ConfigDiffInterface::class); - $config_diff->same(Argument::cetera())->will(function($args) { - return $args[0] == $args[1]; - }); - \Drupal::getContainer()->set('config_update.config_diff', $config_diff->reveal()); - - $package = new Package('test-package', [ - 'config' => ['test_config', 'test_overridden'], - ]); - - $config_storage = $this->prophesize(StorageInterface::class); - $config_storage->read('test_config')->willReturn([ - 'key' => 'value', - ]); - $config_storage->read('test_overridden')->willReturn([ - 'key2' => 'value2', - ]); - - $extension_storage = $this->prophesize(FeaturesExtensionStoragesInterface::class); - $extension_storage->read('test_config')->willReturn([ - 'key' => 'value', - ]); - $extension_storage->read('test_overridden')->willReturn([ - 'key2' => 'value0', - ]); - - - $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $config_storage->reveal(), $this->configManager, $this->moduleHandler, $this->configReverter); - $features_manager->setExtensionStorages($extension_storage->reveal()); - - $this->assertEquals(['test_overridden'], $features_manager->detectOverrides($package)); - } - - /** - * @covers ::assignConfigPackage - */ - public function testAssignConfigPackageWithNonProviderExcludedConfig() { - $assigner = $this->prophesize(FeaturesAssignerInterface::class); - $bundle = $this->prophesize(FeaturesBundleInterface::class); - $bundle->isProfilePackage('test_package')->willReturn(FALSE); - $bundle->isProfilePackage('test_package2')->willReturn(FALSE); - $assigner->getBundle(NULL)->willReturn($bundle->reveal()); - $this->featuresManager->setAssigner($assigner->reveal()); - - $config_collection = [ - 'test_config' => new ConfigurationItem('test_config', []), - 'test_config2' => new ConfigurationItem('test_config2', [ - 'dependencies' => [ - 'module' => ['example', 'example2'], - ] - ], [ - 'subdirectory' => InstallStorage::CONFIG_INSTALL_DIRECTORY, - ]), - 'example3.settings' => new ConfigurationItem('example3.settings', [], [ - 'type' => FeaturesManagerInterface::SYSTEM_SIMPLE_CONFIG, - 'subdirectory' => InstallStorage::CONFIG_INSTALL_DIRECTORY, - ]), - 'test_config3' => new ConfigurationItem('test_config3', [ - 'dependencies' => [ - 'module' => ['example2'], - ] - ], [ - 'subdirectory' => InstallStorage::CONFIG_OPTIONAL_DIRECTORY, - ]), - ]; - $this->featuresManager->setConfigCollection($config_collection); - - $package = new Package('test_package'); - $this->featuresManager->setPackage($package); - - $this->featuresManager->assignConfigPackage('test_package', ['test_config', 'test_config2', 'example3.settings']); - - $this->assertEquals(['test_config', 'test_config2', 'example3.settings'], $this->featuresManager->getPackage('test_package')->getConfig()); - // 'example2' is not returned by ::getModuleList() and so isn't a - // dependency. - $this->assertEquals(['example', 'example3', 'my_module'], $this->featuresManager->getPackage('test_package')->getDependencies()); - - // Test optional config, which doesn't create module dependencies. - $package = new Package('test_package2'); - $this->featuresManager->setPackage($package); - - $this->featuresManager->assignConfigPackage('test_package2', ['test_config3']); - - $this->assertEquals(['test_config3'], $this->featuresManager->getPackage('test_package2')->getConfig()); - $this->assertEquals([], $this->featuresManager->getPackage('test_package2')->getDependencies()); - } - - /** - * @covers ::assignConfigPackage - */ - public function testAssignConfigPackageWithProviderExcludedConfig() { - $config_collection = [ - 'test_config' => new ConfigurationItem('test_config', []), - 'test_config2' => new ConfigurationItem('test_config2', [], ['providerExcluded' => TRUE]), - ]; - $this->featuresManager->setConfigCollection($config_collection); - - $feature_assigner = $this->prophesize(FeaturesAssignerInterface::class); - $feature_assigner->getBundle(NULL)->willReturn(new FeaturesBundle(['machine_name' => FeaturesBundleInterface::DEFAULT_BUNDLE], 'features_bundle')); - $this->featuresManager->setAssigner($feature_assigner->reveal()); - - $package = new Package('test_package'); - $original_package = clone $package; - - $this->featuresManager->setPackage($package); - $this->featuresManager->assignConfigPackage('test_package', ['test_config', 'test_config2']); - $this->assertEquals(['test_config'], $this->featuresManager->getPackage('test_package')->getConfig(), 'just assign new packages'); - - $this->featuresManager->setPackage($original_package); - $this->featuresManager->assignConfigPackage('test_package', ['test_config', 'test_config2'], TRUE); - $this->assertEquals(['test_config', 'test_config2'], $this->featuresManager->getPackage('test_package')->getConfig(), 'just assign new packages'); - } - - /** - * @covers ::assignConfigPackage - */ - public function testAssignConfigPackageWithPackageExcludedConfig() { - $config_collection = [ - 'test_config' => new ConfigurationItem('test_config', []), - 'test_config2' => new ConfigurationItem('test_config2', [], ['packageExcluded' => ['test_package']]), - ]; - $this->featuresManager->setConfigCollection($config_collection); - - $feature_assigner = $this->prophesize(FeaturesAssignerInterface::class); - $feature_assigner->getBundle(NULL)->willReturn(new FeaturesBundle(['machine_name' => 'default'], 'features_bundle')); - $this->featuresManager->setAssigner($feature_assigner->reveal()); - - $package = new Package('test_package'); - $original_package = clone $package; - - $this->featuresManager->setPackage($package); - $this->featuresManager->assignConfigPackage('test_package', ['test_config', 'test_config2']); - $this->assertEquals(['test_config'], $this->featuresManager->getPackage('test_package')->getConfig(), 'just assign new packages'); - - $this->featuresManager->setPackage($original_package); - $this->featuresManager->assignConfigPackage('test_package', ['test_config', 'test_config2'], TRUE); - $this->assertEquals(['test_config', 'test_config2'], $this->featuresManager->getPackage('test_package')->getConfig(), 'just assign new packages'); - } - - /** - * @covers ::initPackageFromExtension - * @covers ::getPackageObject - */ - public function testInitPackageFromNonInstalledExtension() { - $extension = new Extension($this->root, 'module', 'modules/test_module/test_module.info.yml'); - - $info_parser = $this->prophesize(InfoParserInterface::class); - $info_parser->parse($this->root . '/modules/test_module/test_module.info.yml')->willReturn([ - 'name' => 'Test module', - 'description' => 'test description', - 'type' => 'module', - ]); - \Drupal::getContainer()->set('info_parser', $info_parser->reveal()); - - $bundle = $this->prophesize(FeaturesBundle::class); - $bundle->getFullName('test_module')->willReturn('test_module'); - $bundle->isDefault()->willReturn(TRUE); - - $assigner = $this->prophesize(FeaturesAssignerInterface::class); - $assigner->findBundle(Argument::cetera())->willReturn($bundle->reveal()); - $this->featuresManager->setAssigner($assigner->reveal()); - - $result = $this->featuresManager->initPackageFromExtension($extension); - $this->assertInstanceOf(Package::class, $result); - // Ensure that that calling the function twice works. - $result = $this->featuresManager->initPackageFromExtension($extension); - $this->assertInstanceOf(Package::class, $result); - - $this->assertEquals('test_module', $result->getMachineName()); - $this->assertEquals('Test module', $result->getName()); - $this->assertEquals('test description', $result->getDescription()); - $this->assertEquals('module', $result->getType()); - - $this->assertEquals(FeaturesManagerInterface::STATUS_UNINSTALLED, $result->getStatus()); - } - - /** - * @covers ::initPackageFromExtension - * @covers ::getPackageObject - */ - public function testInitPackageFromInstalledExtension() { - $extension = new Extension($this->root, 'module', 'modules/test_module/test_module.info.yml'); - - $info_parser = $this->prophesize(InfoParserInterface::class); - $info_parser->parse($this->root . '/modules/test_module/test_module.info.yml')->willReturn([ - 'name' => 'Test module', - 'description' => 'test description', - 'type' => 'module', - ]); - \Drupal::getContainer()->set('info_parser', $info_parser->reveal()); - - $bundle = $this->prophesize(FeaturesBundle::class); - $bundle->getFullName('test_module')->willReturn('test_module'); - $bundle->isDefault()->willReturn(TRUE); - - $assigner = $this->prophesize(FeaturesAssignerInterface::class); - $assigner->findBundle(Argument::cetera())->willReturn($bundle->reveal()); - $this->featuresManager->setAssigner($assigner->reveal()); - - $this->moduleHandler->expects($this->any()) - ->method('moduleExists') - ->with('test_module') - ->willReturn(TRUE); - - $result = $this->featuresManager->initPackageFromExtension($extension); - $this->assertEquals(FeaturesManagerInterface::STATUS_INSTALLED, $result->getStatus()); - } - - public function testDetectNewWithNoConfig() { - $package = new Package('test_feature'); - - $this->assertEmpty($this->featuresManager->detectNew($package)); - } - - public function testDetectNewWithNoNewConfig() { - $package = new Package('test_feature', ['config' => ['test_config']]); - - $extension_storage = $this->prophesize(FeaturesExtensionStoragesInterface::class); - $extension_storage->read('test_config')->willReturn([ - 'key' => 'value', - ]); - - $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - $features_manager->setExtensionStorages($extension_storage->reveal()); - - $this->assertEmpty($features_manager->detectNew($package)); - } - - public function testDetectNewWithNewConfig() { - $package = new Package('test_feature', ['config' => ['test_config']]); - - $extension_storage = $this->prophesize(FeaturesExtensionStoragesInterface::class); - $extension_storage->read('test_config')->willReturn(FALSE); - - $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - $features_manager->setExtensionStorages($extension_storage->reveal()); - - $this->assertEquals(['test_config'], $features_manager->detectNew($package)); - } - - /** - * @todo This could have of course much more test coverage. - * - * @covers ::mergeInfoArray - * - * @dataProvider providerTestMergeInfoArray - */ - public function testMergeInfoArray($expected, $info1, $info2, $keys = []) { - $this->assertSame($expected, $this->featuresManager->mergeInfoArray($info1, $info2, $keys)); - } - - public function providerTestMergeInfoArray() { - $data = []; - $data['empty-info'] = [[], [], []]; - $data['override-info'] = [ - ['name' => 'New name', 'core' => '8.x'], - ['name' => 'Old name', 'core' => '8.x'], - ['name' => 'New name'] - ]; - $data['dependency-merging'] = [ - ['dependencies' => ['a', 'b', 'c', 'd', 'e']], - ['dependencies' => ['b', 'd', 'c']], - ['dependencies' => ['a', 'b', 'e']], - [], - ]; - - return $data; - } - - /** - * @covers ::initPackage - **/ - public function testInitPackageWithNewPackage() { - $bundle = new FeaturesBundle(['machine_name' => 'test'], 'features_bundle'); - - $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - $features_manager->setAllModules([]); - - $package = $features_manager->initPackage('test_feature', 'test name', 'test description', 'module', $bundle); - - $this->assertInstanceOf(Package::class, $package); - $this->assertEquals('test_feature', $package->getMachineName()); - $this->assertEquals('test name', $package->getName()); - $this->assertEquals('test description', $package->getDescription()); - $this->assertEquals('module', $package->getType()); - $this->assertEquals(['bundle' => 'test'], $package->getFeaturesInfo()); - $this->assertEquals('test', $package->getBundle()); - $this->assertEquals(FALSE, $package->getRequired()); - $this->assertEquals([], $package->getExcluded()); - } - - /** - * @covers ::getFeaturesInfo - * @covers ::getFeaturesModules - **/ - public function testInitPackageWithExistingPackage() { - $bundle = new FeaturesBundle(['machine_name' => 'test'], 'features_bundle'); - - $features_manager = new TestFeaturesManager('vfs://drupal', $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - - vfsStream::setup('drupal'); - \Drupal::getContainer()->set('app.root', 'vfs://drupal'); - vfsStream::create([ - 'modules' => [ - 'test_feature' => [ - 'test_feature.info.yml' => << <<setAllModules(['test_feature' => $extension]); - - $this->moduleHandler->expects($this->any()) - ->method('exists') - ->with('test_feature') - ->willReturn(TRUE); - - $info_parser = new InfoParser(); - \Drupal::getContainer()->set('info_parser', $info_parser); - - $package = $features_manager->initPackage('test_feature', 'test name', 'test description', 'module', $bundle); - - $this->assertEquals([ - 'bundle' => 'test', - 'excluded' => [ - 0 => 'system.theme', - ], - 'required' => TRUE, - ], $features_manager->getFeaturesInfo($extension)); - $this->assertEquals(['test_feature' => $extension], $features_manager->getFeaturesModules($bundle)); - - $this->assertInstanceOf(Package::class, $package); - $this->assertEquals([ - 'bundle' => 'test', - 'excluded' => [ - 0 => 'system.theme', - ], - 'required' => TRUE, - ], $package->getFeaturesInfo()); - $this->assertEquals('test', $package->getBundle()); - $this->assertEquals(TRUE, $package->getRequired()); - $this->assertEquals(['system.theme'], $package->getExcluded()); - } - - /** - * @covers ::prepareFiles - * @covers ::addInfoFile - */ - public function testPrepareFiles() { - $packages = []; - $packages['test_feature'] = new Package('test_feature', [ - 'config' => ['test_config'], - 'name' => 'Test feature', - ]); - - $packages['test_feature2'] = new Package('test_feature2', [ - 'config' => ['test_config2'], - 'name' => 'Test feature 2', - 'type' => 'profile', - 'excluded' => ['my_config'], - 'required' => ['test_config2'], - ]); - - $config_collection = []; - $config_collection['test_config'] = new ConfigurationItem('test_config', ['foo' => 'bar']); - $config_collection['test_config2'] = new ConfigurationItem('test_config2', ['foo' => 'bar']); - - $this->featuresManager->setConfigCollection($config_collection); - $this->featuresManager->prepareFiles($packages); - - // Test test_feature package. - $files = $packages['test_feature']->getFiles(); - $this->assertCount(3, $files); - $this->assertEquals('test_feature.info.yml', $files['info']['filename']); - $this->assertEquals(Yaml::encode([ - 'name' => 'Test feature', - 'type' => 'module', - 'core' => '8.x', - ]), $files['info']['string']); - $this->assertEquals(Yaml::encode(TRUE), $files['features']['string']); - - $this->assertEquals('test_config.yml', $files['test_config']['filename']); - $this->assertEquals(Yaml::encode([ - 'foo' => 'bar' - ]), $files['test_config']['string']); - - $this->assertEquals('test_feature.features.yml', $files['features']['filename']); - $this->assertEquals(Yaml::encode(TRUE), $files['features']['string']); - - // Test test_feature2 package. - $files = $packages['test_feature2']->getFiles(); - - $this->assertEquals(Yaml::encode([ - 'excluded' => ['my_config'], - 'required' => ['test_config2'], - ]), $files['features']['string']); - } - - /** - * @covers ::getExportInfo - */ - public function testGetExportInfoWithoutBundle() { - $config_factory = $this->getConfigFactoryStub([ - 'features.settings' => [ - 'export' => [ - 'folder' => 'custom', - ], - ], - ]); - $this->featuresManager = new FeaturesManager($this->root, $this->entityTypeManager, $config_factory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - - $package = new Package('test_feature'); - $result = $this->featuresManager->getExportInfo($package); - - $this->assertEquals(['test_feature', 'modules/custom'], $result); - } - - /** - * @covers ::getExportInfo - */ - public function testGetExportInfoWithBundle() { - $config_factory = $this->getConfigFactoryStub([ - 'features.settings' => [ - 'export' => [ - 'folder' => 'custom', - ], - ], - ]); - $this->featuresManager = new FeaturesManager($this->root, $this->entityTypeManager, $config_factory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter); - - $package = new Package('test_feature'); - $bundle = new FeaturesBundle(['machine_name' => 'test_bundle'], 'features_bundle'); - - $result = $this->featuresManager->getExportInfo($package, $bundle); - - $this->assertEquals(['test_bundle_test_feature', 'modules/custom'], $result); - } - -} - -class TestFeaturesManager extends FeaturesManager { - - protected $allModules; - - /** - * @param \Drupal\features\FeaturesExtensionStoragesInterface $extensionStorages - */ - public function setExtensionStorages($extensionStorages) { - $this->extensionStorages = $extensionStorages; - } - - /** - * {@inheritdoc} - */ - public function getAllModules() { - if (isset($this->allModules)) { - return $this->allModules; - } - return parent::getAllModules(); - } - - /** - * @param mixed $all_modules - */ - public function setAllModules($all_modules) { - $this->allModules = $all_modules; - return $this; - } - - protected function drupalGetProfile() { - return FeaturesManagerTest::PROFILE_NAME; - } - -} diff --git a/sites/all/modules/contrib/admin/features/tests/src/Unit/PackageTest.php b/sites/all/modules/contrib/admin/features/tests/src/Unit/PackageTest.php deleted file mode 100644 index f1b322231..000000000 --- a/sites/all/modules/contrib/admin/features/tests/src/Unit/PackageTest.php +++ /dev/null @@ -1,53 +0,0 @@ -assertEquals([], $package->getFeaturesInfo()); - $package->setFeaturesInfo(['bundle' => 'test_bundle']); - $this->assertEquals(['bundle' => 'test_bundle'], $package->getFeaturesInfo()); - $this->assertEquals('test_bundle', $package->getBundle()); - } - - public function testGetConfig() { - $package = new Package('test_feature', ['config' => ['test_config_a', 'test_config_b']]); - $this->assertEquals(['test_config_a', 'test_config_b'], $package->getConfig()); - return $package; - } - - /** - * @depends testGetConfig - * @covers ::appendConfig - */ - public function testAppendConfig(Package $package) { - $package->appendConfig('test_config_a'); - $package->appendConfig('test_config_c'); - - $this->assertEquals(['test_config_a', 'test_config_b', 'test_config_c'], array_values($package->getConfig())); - return $package; - } - - /** - * @depends testAppendConfig - * @covers ::removeConfig - */ - public function testRemoveConfig(Package $package) { - $package->removeConfig('test_config_a'); - - $this->assertEquals(['test_config_b', 'test_config_c'], array_values($package->getConfig())); - } - -} diff --git a/sites/all/modules/contrib/admin/filter_perms/LICENSE.txt b/sites/all/modules/contrib/admin/filter_perms/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/filter_perms/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/filter_perms/filter_perms.info.yml b/sites/all/modules/contrib/admin/filter_perms/filter_perms.info.yml deleted file mode 100644 index 5b652de0a..000000000 --- a/sites/all/modules/contrib/admin/filter_perms/filter_perms.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: 'Filter permissions' -description: 'Provides role and module filters to simplify the user permissions page.' -package: 'Administration' -# core: 8.x -dependencies: - - user - -# Information added by Drupal.org packaging script on 2016-07-27 -version: '8.x-1.x-dev' -core: '8.x' -project: 'filter_perms' -datestamp: 1469646196 diff --git a/sites/all/modules/contrib/admin/filter_perms/filter_perms.services.yml b/sites/all/modules/contrib/admin/filter_perms/filter_perms.services.yml deleted file mode 100644 index b064ea195..000000000 --- a/sites/all/modules/contrib/admin/filter_perms/filter_perms.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - filter_perms.route_subscriber: - class: Drupal\filter_perms\Routing\RouteSubscriber - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsForm.php b/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsForm.php deleted file mode 100644 index 9443ce0e7..000000000 --- a/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsForm.php +++ /dev/null @@ -1,261 +0,0 @@ -keyValueExpirable = $key_value_expirable; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('user.permissions'), - $container->get('entity.manager')->getStorage('user_role'), - $container->get('module_handler'), - $container->get('keyvalue.expirable')->get('filter_perms_list') - ); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Render role/permission overview: - $hide_descriptions = system_admin_compact_mode(); - - $form['system_compact_link'] = array( - '#id' => FALSE, - '#type' => 'system_compact_link', - ); - - $permissions = $this->permissionHandler->getPermissions(); - - $providers = array(); - foreach ($permissions as $permission) { - $providers[$permission['provider']] = $permission['provider']; - } - - $roles = $this->getRoles(); - - $defined_roles = array(); - foreach ($roles as $role_name => $role) { - $defined_roles[$role_name] = $role->label(); - } - - $filter = $this->getFilterSettings(); - - $form['filters'] = array( - '#type' => 'details', - '#title' => $this->t('Permission Filters'), - '#open' => TRUE, - ); - $form['filters']['container'] = array( - '#type' => 'container', - '#attributes' => array('class' => array('form--inline', 'clearfix')), - ); - // Displays all user roles. - $form['filters']['container']['roles'] = array( - '#title' => $this->t('Roles to display'), - '#type' => 'select', - '#options' => array(self::ALL_OPTIONS => '--All Roles') + $defined_roles, - '#default_value' => $filter['roles'], - '#size' => 8, - '#multiple' => TRUE, - ); - // Displays all modules which define permissions. - $form['filters']['container']['modules'] = array( - '#title' => $this->t('Modules to display'), - '#type' => 'select', - '#options' => array(self::ALL_OPTIONS => '--All Modules') + $providers, - '#default_value' => $filter['modules'], - '#size' => 8, - '#multiple' => TRUE, - ); - $form['filters']['action'] = array('#type' => 'actions'); - $form['filters']['action']['submit'] = array( - '#type' => 'submit', - '#value' => $this->t('Filter Permissions'), - '#submit' => array('::submitFormFilter'), - ); - - $role_names = $role_permissions = $admin_roles = array(); - - foreach ($roles as $role_name => $role) { - if (in_array(self::ALL_OPTIONS, $filter['roles']) || in_array($role_name, $filter['roles'])) { - // Retrieve role names for columns. - $role_names[$role_name] = $role->label(); - // Fetch permissions for the roles. - $role_permissions[$role_name] = $role->getPermissions(); - $admin_roles[$role_name] = $role->isAdmin(); - } - } - - // Store $role_names for use when saving the data. - $form['role_names'] = array( - '#type' => 'value', - '#value' => $role_names, - ); - - $permissions_by_provider = array(); - foreach ($permissions as $permission_name => $permission) { - if (in_array(self::ALL_OPTIONS, $filter['modules']) || in_array($permission['provider'], $filter['modules'])) { - $permissions_by_provider[$permission['provider']][$permission_name] = $permission; - } - } - - $form['permissions'] = array( - '#type' => 'table', - '#header' => array($this->t('Permission')), - '#id' => 'permissions', - '#attributes' => ['class' => ['permissions', 'js-permissions']], - '#sticky' => TRUE, - '#empty' => $this->t('Please select at least one value from both the Roles and Modules select boxes above and then click the "Filter Permissions" button.'), - ); - - // Only build the rest of the form if there are any filter settings. - if (empty($role_names) || empty($permissions_by_provider)) { - return $form; - } - - foreach ($role_names as $name) { - $form['permissions']['#header'][] = array( - 'data' => $name, - 'class' => array('checkbox'), - ); - } - - foreach ($permissions_by_provider as $provider => $permissions) { - // Module name. - $form['permissions'][$provider] = array(array( - '#wrapper_attributes' => array( - 'colspan' => count($role_names) + 1, - 'class' => array('module'), - 'id' => 'module-' . $provider, - ), - '#markup' => $this->moduleHandler->getName($provider), - )); - foreach ($permissions as $perm => $perm_item) { - // Fill in default values for the permission. - $perm_item += array( - 'description' => '', - 'restrict access' => FALSE, - 'warning' => !empty($perm_item['restrict access']) ? $this->t('Warning: Give to trusted roles only; this permission has security implications.') : '', - ); - $form['permissions'][$perm]['description'] = array( - '#type' => 'inline_template', - '#template' => '
{{ title }}{% if description or warning %}
{% if warning %}{{ warning }} {% endif %}{{ description }}
{% endif %}
', - '#context' => array( - 'title' => $perm_item['title'], - ), - ); - // Show the permission description. - if (!$hide_descriptions) { - $form['permissions'][$perm]['description']['#context']['description'] = $perm_item['description']; - $form['permissions'][$perm]['description']['#context']['warning'] = $perm_item['warning']; - } - foreach ($role_names as $rid => $name) { - $form['permissions'][$perm][$rid] = array( - '#title' => $name . ': ' . $perm_item['title'], - '#title_display' => 'invisible', - '#wrapper_attributes' => array( - 'class' => array('checkbox'), - ), - '#type' => 'checkbox', - '#default_value' => in_array($perm, $role_permissions[$rid]) ? 1 : 0, - '#attributes' => array('class' => array('rid-' . $rid, 'js-rid-' . $rid)), - '#parents' => array($rid, $perm), - ); - // Show a column of disabled but checked checkboxes. - if ($admin_roles[$rid]) { - $form['permissions'][$perm][$rid]['#disabled'] = TRUE; - $form['permissions'][$perm][$rid]['#default_value'] = TRUE; - } - } - } - } - - $form['actions'] = array('#type' => 'actions'); - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => $this->t('Save permissions'), - '#button_type' => 'primary', - ); - - $form['#attached']['library'][] = 'user/drupal.user.permissions'; - - return $form; - } - - /** - * Saves the roles and modules selection. - */ - public function submitFormFilter(array &$form, FormStateInterface $form_state) { - $this->saveFilterSettings($form_state->getValue('roles'), $form_state->getValue('modules')); - } - - /** - * Saves the filter settings for the current user. - * - * @param array $roles - * The roles to filter by. - * @param array $modules - * The modules to filter by. - */ - protected function saveFilterSettings(array $roles, array $modules) { - $values = array('roles' => $roles, 'modules' => $modules); - $this->keyValueExpirable->setWithExpire($this->currentUser()->id(), $values, 3600); - } - - /** - * Retrieve the filter settings for the current user. - * - * @return array - * The filter setting for the current user. - */ - protected function getFilterSettings() { - $default = array('roles' => array(), 'modules' => array()); - return $this->keyValueExpirable->get($this->currentUser()->id(), $default); - } - -} diff --git a/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php b/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php deleted file mode 100644 index 14e594c6a..000000000 --- a/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php +++ /dev/null @@ -1,24 +0,0 @@ -saveFilterSettings((array) $user_role->id(), (array) self::ALL_OPTIONS); - return $this->redirect('user.admin_permissions'); - } - -} diff --git a/sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php b/sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php deleted file mode 100644 index 7998c93fb..000000000 --- a/sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php +++ /dev/null @@ -1,25 +0,0 @@ -get('user.admin_permissions')) { - $route->setDefault('_form', '\Drupal\filter_perms\Form\PermissionsForm'); - } - if ($route = $collection->get('entity.user_role.edit_permissions_form')) { - $route->setDefault('_form', '\Drupal\filter_perms\Form\PermissionsRoleSpecificForm'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/LICENSE.txt b/sites/all/modules/contrib/admin/login_destination/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/login_destination/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/login_destination/README.txt b/sites/all/modules/contrib/admin/login_destination/README.txt deleted file mode 100644 index f83ee80d1..000000000 --- a/sites/all/modules/contrib/admin/login_destination/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -The Login Destination module provides a way to customize the destination that a -user is redirected to after logging in, registering to the site, using a -one-time login link or logging out. - -The configuration consists of specifying so called login destination rules that -are evaluated when the login or logout takes place. Those rules are evaluated -against certain conditions and the user is taken to the destination specified -by the first matching rule. If the destination is empty, no redirect is -performed aka user is taken to the default destination. You can define pages -from which a user logs in/out to be a matching criterion. You can also select -certain user roles that are matched against those of a user. Note that only one -role has to match in order for the redirect to take place. If no roles are -selected the redirect is performed regardless of user roles. - -The destination you specify can be an internal page or an external URL. -Remember to precede the url with http://. You can also use the tag to -redirect to the front page. In case of -login/register form the page from which the user entered the form is treated as -the current page. Note that if you provide your own login/logout links you have -to add the 'current' GET parameter to them so Login Destination knows where -your users come from. - -It also possible to set some advanced parameters on the setting page. Every -time in Drupal you can specify the 'destination' GET parameter in url to -redirect the user to a custom page. If you check the option -'Preserve the destination parameter' Login Destination will give priority to -this parameter over its own module settings. However with this option enabled -the redirect from the login block will not work. In some rare cases you can -also redirect the user just after using the one-time login link, before given -the possibility to change their password. Do this by checking the -'Redirect immediately after using one-time login link' option. diff --git a/sites/all/modules/contrib/admin/login_destination/composer.json b/sites/all/modules/contrib/admin/login_destination/composer.json deleted file mode 100644 index 339bfbab7..000000000 --- a/sites/all/modules/contrib/admin/login_destination/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "drupal/login_destination", - "description": "The Login Destination module add possibility customize the destination that the user is redirected to after login.", - "type": "drupal-module" -} diff --git a/sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml b/sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml deleted file mode 100644 index 8083316c1..000000000 --- a/sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml +++ /dev/null @@ -1,2 +0,0 @@ -preserve_destination: FALSE -immediate_redirect: FALSE diff --git a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml b/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml deleted file mode 100644 index 0bf05a874..000000000 --- a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml +++ /dev/null @@ -1,34 +0,0 @@ -login_destination.destination.*: - type: config_entity - label: 'Login destination configuration entity' - mapping: - name: - type: string - label: 'Login destination rule machine name' - label: - type: string - label: 'Short description of the rule' - triggers: - type: array - label: 'Triggers' - destination_path: - type: string - label: 'Destination' - pages_type: - type: integer - label: 'Pages type' - pages: - type: string - label: 'Pages' - roles: - type: array - label: 'Roles' - weight: - type: integer - label: 'Weight' - enabled: - type: boolean - label: 'Enabled' - uuid: - type: string - label: 'UUID' diff --git a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml b/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml deleted file mode 100644 index cf22ec35b..000000000 --- a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml +++ /dev/null @@ -1,10 +0,0 @@ -login_destination.settings: - type: config_object - label: 'Login destination settings' - mapping: - preserve_destination: - type: boolean - label: 'Preserve the destination parameter' - immediate_redirect: - type: boolean - label: 'Redirect immediately after using one-time login link' diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.info.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.info.yml deleted file mode 100644 index 749c6ab6d..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Login Destination -type: module -description: Add possibility customize the destination that the user is redirected to after login. -package: User -# core: 8.x -configure: login_destination.settings - -# Information added by Drupal.org packaging script on 2018-01-01 -version: '8.x-1.x-dev' -core: '8.x' -project: 'login_destination' -datestamp: 1514805488 diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml deleted file mode 100644 index f471bac56..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -login_destination.add: - route_name: login_destination.add - title: 'Add Login Destination' - appears_on: - - login_destination.list diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml deleted file mode 100644 index ea72d5428..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -login_destination.list: - title: 'Login destinations' - parent: user.admin_index - description: 'Customize the destination that the user is redirected to after login.' - weight: -5 - route_name: login_destination.list diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml deleted file mode 100644 index 1f10816f6..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml +++ /dev/null @@ -1,9 +0,0 @@ -login_destination.list: - title: 'Login destinations' - route_name: login_destination.list - base_route: login_destination.list - -login_destination.settings: - title: 'Settings' - route_name: login_destination.settings - base_route: login_destination.list diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.module b/sites/all/modules/contrib/admin/login_destination/login_destination.module deleted file mode 100644 index 3fa5a08da..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.module +++ /dev/null @@ -1,148 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Login Destination module allows you to customize the destination that the user is redirected to after logging in, registering to the site, using a one-time login link or logging out. The destination can be an internal page or an external URL. You may specify certain conditions like pages or user roles and make the destination depend upon them.') . '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '
'; - $output .= '
' . t('Creating login destinations') . '
'; - $output .= '
' . t('Users with sufficient permissions can create login destination through the !link. The page listing the login destinations provides an interface to add, edit and delete them', [ - '!link' => (string) \Drupal::l('Login destination page', Url::fromRoute('login_destination.list')), - ]) . '
'; - $output .= '
' . t('Assigning destinations') . '
'; - $output .= '
' . t('You can add login destinations and specify the page where the user will be redirected when it logs in or logs out. You can also configure specific pages where the destination can work or not and select for what user roles the login destination applies') . '
'; - $output .= '
'; - return $output; - - case 'login_destination.list': - $output = '

' . t('Login destination rules are evaluated each time a user logs in, registers to the site, uses a one-time login link or logs out. Each rule consists of the destination, path conditions and user roles conditions. First matching rule gets executed.') . '

'; - return $output; - } -} - -/** - * Implements hook_user_login(). - */ -function login_destination_user_login(AccountInterface $account) { - if (isset($account->user_is_new) && $account->user_is_new) { - // User is just registered. - login_destination_perform_redirect('registration', $account); - } - elseif (\Drupal::service('current_route_match')->getRouteName() === 'user.reset.login') { - // User is used a one-time login link. - login_destination_perform_redirect('one-time-login', $account); - } - else { - login_destination_perform_redirect('login', $account); - } -} - -/** - * Implements hook_user_logout(). - */ -function login_destination_user_logout(AccountInterface $account) { - login_destination_perform_redirect('logout', $account); -} - -/** - * Implements hook_toolbar_alter(). - */ -function login_destination_toolbar_alter(&$items) { - if (empty($items['user']['tray']['user_links'])) { - return; - } - // Disable cache for user links in toolbar, to be able set current param. - $items['user']['tray']['user_links']['#cache']['context'] = []; - $items['user']['tray']['user_links']['#cache']['max-age'] = 0; - - if (\Drupal::currentUser()->isAnonymous()) { - $url_login = Url::fromRoute('user.login'); - // Change route name, since route "user.page" always redirects to "user.login". - $items['user']['tray']['user_links']['#links']['login']['url'] = $url_login; - $url = &$items['user']['tray']['user_links']['#links']['login']['url']; - } - else { - $url = &$items['user']['tray']['user_links']['#links']['logout']['url']; - } - // Get current path. - $current = \Drupal::service('path.current')->getPath(); - - // Add current param to be able to evaluate previous page. - $url->setOptions(['query' => ['current' => $current]]); -} - -/** - * Implements hook_link_alter(). - */ -function login_destination_link_alter(&$variables) { - $routes = [ - 'user.login', - 'user.logout' - ]; - /* @var Drupal\Core\Url $url */ - $url = $variables['url']; - if ($url->isExternal()) { - return; - } - - if ($url->isRouted() && !in_array($url->getRouteName(), $routes)) { - return; - } - - // Get current path. - $current = \Drupal::service('path.current')->getPath(); - $variables['options']['query']['current'] = $current; -} - -/** - * Implements hook_entity_presave(). - */ -function login_destination_entity_presave(EntityInterface $entity) { - // Verify that entity is a user entity, and this is new entity. - if (!$entity instanceof UserInterface || !$entity->isNew()) { - return; - } - // Save parameter to user entity, which will allow us understand that user - // is just created. Do not need to save parameter, when needs verification - // by administrator. - $needs_verification = \Drupal::config('user.settings')->get('verify_mail'); - if ($needs_verification || !$entity->isActive()) { - return; - } - $entity->user_is_new = TRUE; -} - -/** - * Evaluate rules and perform redirect. - * - * This function is intended to be used by external modules. - * - * @param string $trigger - * Action of login destination rule. - * @param \Drupal\Core\Session\AccountInterface $account - * User Account. - */ -function login_destination_perform_redirect($trigger, AccountInterface $account) { - /* @var Drupal\login_destination\LoginDestinationManager $service */ - $service = \Drupal::service('login_destination.manager'); - $destination = $service->findDestination($trigger, $account); - if ($destination) { - $service->prepareDestination($destination); - } -} diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml deleted file mode 100644 index 03d6971af..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -administer login destination settings: - title: 'Administer Login Destination settings' diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml deleted file mode 100644 index ef926fe2c..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml +++ /dev/null @@ -1,40 +0,0 @@ -login_destination.settings: - path: '/admin/config/people/login-destination/settings' - defaults: - _form: '\Drupal\login_destination\Form\LoginDestinationSettingsForm' - _title: 'Login destination Settings' - requirements: - _permission: 'administer login destination settings' - -login_destination.list: - path: '/admin/config/people/login-destination' - defaults: - _content: '\Drupal\Core\Entity\Controller\EntityListController::listing' - _entity_list: 'login_destination' - _title: 'Login destinations' - requirements: - _permission: 'administer login destination settings' - -login_destination.add: - path: '/admin/config/people/login-destination/add' - defaults: - _entity_form: login_destination.add - _title: 'Add login destination rule' - requirements: - _permission: 'administer login destination settings' - -entity.login_destination.edit_form: - path: '/admin/config/people/login-destination/{login_destination}/edit' - defaults: - _entity_form: login_destination.edit - _title: 'Edit login destination rule' - requirements: - _permission: 'administer login destination settings' - -entity.login_destination.delete_form: - path: '/admin/config/people/login-destination/{login_destination}/delete' - defaults: - _entity_form: login_destination.delete - _title: 'Delete login destination rule' - requirements: - _permission: 'administer login destination settings' diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.services.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.services.yml deleted file mode 100644 index 05248188a..000000000 --- a/sites/all/modules/contrib/admin/login_destination/login_destination.services.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - login_destination.manager: - class: Drupal\login_destination\LoginDestinationManager - arguments: ['@entity_type.manager', '@path.alias_manager', '@path.matcher', '@path.current', '@config.factory', '@request_stack'] diff --git a/sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php b/sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php deleted file mode 100644 index 3a13309a4..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php +++ /dev/null @@ -1,92 +0,0 @@ - $this->t('Label'), - 'destination' => $this->t('Destination'), - 'triggers' => $this->t('Triggers'), - 'pages' => $this->t('Pages'), - 'roles' => $this->t('Roles'), - 'enabled' => $this->t('Enabled'), - ]; - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - /** @var LoginDestination $entity */ - $row['label'] = $entity->getLabel(); - - if ($entity->isDestinationCurrent()) { - $row['destination'] = [ - '#markup' => $entity->viewDestination(), - ]; - } - else { - $row['destination'] = [ - '#type' => 'link', - '#title' => $entity->viewDestination(), - '#url' => Url::fromUri($entity->getDestination()), - ]; - } - $row['triggers'] = [ - '#markup' => $entity->viewTriggers(), - ]; - $row['pages'] = [ - '#markup' => $entity->viewPages(), - ]; - $row['roles'] = [ - '#markup' => $entity->viewRoles(), - ]; - $row['enabled'] = [ - '#type' => 'checkbox', - '#default_value' => $entity->isEnabled(), - ]; - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); - foreach ($form_state->getValue($this->entitiesKey) as $id => $value) { - // Save entity only when its weight was changed. - $this->entities[$id]->set('enabled', $value['enabled']); - $this->entities[$id]->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php b/sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php deleted file mode 100644 index 686459107..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php +++ /dev/null @@ -1,349 +0,0 @@ -name; - } - - /** - * @inheritdoc - */ - public function getLabel() { - return $this->label; - } - - /** - * @inheritdoc - */ - public function getMachineName() { - return $this->name; - } - - /** - * @inheritdoc - */ - public function getTriggers() { - return $this->triggers; - } - - /** - * @inheritdoc - */ - public function getDestination() { - return $this->destination_path; - } - - /** - * @inheritdoc - */ - public function getPagesType() { - return $this->pages_type; - } - - /** - * @inheritdoc - */ - public function getPages() { - return $this->pages; - } - - /** - * @inheritdoc - */ - public function getRoles() { - return $this->roles; - } - - /** - * @inheritdoc - */ - public function getWeight() { - return $this->weight; - } - - /** - * {@inheritdoc} - */ - public function viewTriggers() { - $items = []; - foreach ($this->triggers as $trigger) { - if (empty($trigger)) { - continue; - } - switch ($trigger) { - case LoginDestination::TRIGGER_REGISTRATION: - $items[] = t('Registration'); - break; - - case LoginDestination::TRIGGER_LOGIN: - $items[] = t('Login'); - break; - - case LoginDestination::TRIGGER_ONE_TIME_LOGIN: - $items[] = t('One-time login link'); - break; - - case LoginDestination::TRIGGER_LOGOUT: - $items[] = t('Logout'); - break; - } - } - return $this->renderItemList($items, t('All triggers')); - } - - /** - * {@inheritdoc} - */ - public function viewRoles() { - $roles = $this->getAllSystemRoles(); - $items = array_values(array_intersect_key($roles, $this->roles)); - return $this->renderItemList($items, t('All roles')); - } - - /** - * {@inheritdoc} - */ - public function viewPages() { - $type = $this->pages_type; - $pages = trim($this->pages); - - if (empty($pages)) { - if ($type == self::REDIRECT_NOT_LISTED) { - return t('All pages'); - } - return t('No pages'); - } - - $pages = explode("\n", preg_replace('/\r/', '', $this->pages)); - $items = []; - foreach ($pages as $page) { - $items[] = $type == self::REDIRECT_NOT_LISTED ? '~ ' . $page : $page; - } - - return $this->renderItemList($items, t('Empty')); - } - - /** - * {@inheritdoc} - */ - public function viewDestination() { - if ($this->isDestinationCurrent()) { - $scheme = 'internal'; - } - else { - $url = Url::fromUri($this->destination_path); - $label = $this->destination_path; - if ($url->isExternal()) { - return Html::escape($label); - } - $scheme = parse_url($this->destination_path, PHP_URL_SCHEME); - } - if ($scheme === 'internal') { - return t('Internal destination'); - } - if ($scheme === 'entity') { - $params = $url->getRouteParameters(); - $entity = \Drupal::entityTypeManager() - ->getStorage('node') - ->load(reset($params)); - return $entity->get('title')->value; - } - - return Html::escape($this->destination_path); - } - - /** - * Check is destination path links to a current page or not. - * - * @return bool - * TRUE or FALSE. - */ - public function isDestinationCurrent() { - return Unicode::strpos($this->destination_path, '') !== FALSE; - } - - /** - * Render item list. - * - * @param array $array - * List of items. - * @param string $empty_message - * Default empty message. - * - * @return string|\Drupal\Core\Render\Markup - * List of items or empty message. - */ - protected function renderItemList(array $array, $empty_message) { - $items = []; - foreach ($array as $value) { - if (!empty($value)) { - $items[] = Html::escape($value); - } - } - - if (count($items) === 0) { - return $empty_message; - } - - $item_list = [ - '#theme' => 'item_list', - '#items' => $items, - '#list_type' => 'ul', - ]; - return \Drupal::service('renderer')->render($item_list); - } - - /** - * Get all roles in the system. - * - * @return array - * List of system roles. - */ - public function getAllSystemRoles() { - $role_options = []; - foreach (user_roles(TRUE) as $role) { - $role_options[$role->id()] = $role->label(); - } - return $role_options; - } - - /** - * {@inheritdoc} - */ - public function isEnabled() { - return $this->enabled; - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php b/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php deleted file mode 100644 index 0305fa194..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php +++ /dev/null @@ -1,52 +0,0 @@ -entity; - return $this->t('Are you sure you want to delete the login destination "@destination"?', [ - '@destination' => $login_destination->getLabel(), - ]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('login_destination.list'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var $login_destination \Drupal\login_destination\Entity\LoginDestination */ - $login_destination = $this->entity; - $login_destination->delete(); - drupal_set_message($this->t('The login destination %destination has been deleted.', [ - '%destination' => $login_destination->getLabel(), - ])); - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php b/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php deleted file mode 100644 index 9ff5a9559..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php +++ /dev/null @@ -1,301 +0,0 @@ -loginDestinationStorage = $login_destination_storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('entity_type.manager') - ->getStorage('login_destination')); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - /** @var $login_destination LoginDestination */ - $login_destination = $this->entity; - - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#default_value' => $login_destination->getLabel(), - '#description' => $this->t('A short description of this login destination rule.'), - '#required' => TRUE, - ]; - - $form['name'] = [ - '#type' => 'machine_name', - '#machine_name' => [ - 'exists' => [$this->loginDestinationStorage, 'load'], - ], - '#disabled' => !$login_destination->isNew(), - '#default_value' => $login_destination->id(), - '#required' => TRUE, - '#description' => $this->t('A unique machine-readable name for this login destination rule.'), - ]; - - $form['triggers'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Redirect upon triggers'), - '#options' => [ - LoginDestination::TRIGGER_REGISTRATION => $this->t('Registration'), - LoginDestination::TRIGGER_LOGIN => $this->t('Login'), - LoginDestination::TRIGGER_ONE_TIME_LOGIN => $this->t('One-time login link'), - LoginDestination::TRIGGER_LOGOUT => $this->t('Logout'), - ], - '#required' => TRUE, - '#default_value' => !empty($login_destination->triggers) ? $login_destination->getTriggers() : [], - '#description' => $this->t('Redirect only upon selected trigger(s).'), - ]; - - $form['destination_path'] = [ - '#type' => 'entity_autocomplete', - '#target_type' => 'node', - '#placeholder' => '', - '#attributes' => [ - 'data-autocomplete-first-character-blacklist' => '/#?', - ], - '#title' => $this->t('Redirect destination'), - '#default_value' => $this->getUriAsDisplayableString($login_destination->getDestination()), - '#element_validate' => [[$this, 'validateUriElement']], - '#maxlength' => 2048, - '#required' => TRUE, - '#process_default_value' => FALSE, - '#description' => $this->t('Start typing the title of a piece of content to select it. You can also enter an internal path such as %add-node or an external URL such as %url. Enter %front to link to the front page. Enter %current to link to a current page.', [ - '%front' => '', - '%current' => '', - '%add-node' => '/node/add', - '%url' => 'http://example.com', - ]), - ]; - - $form['pages_type'] = [ - '#type' => 'radios', - '#title' => $this->t('Redirect from specific pages'), - '#default_value' => $login_destination->getPagesType(), - '#options' => [ - $login_destination::REDIRECT_NOT_LISTED => $this->t('All pages except those listed'), - $login_destination::REDIRECT_LISTED => $this->t('Only the listed pages'), - ], - ]; - - $form['pages'] = [ - '#type' => 'textarea', - '#default_value' => $login_destination->getPages(), - '#description' => $this->t('Specify pages by using their paths. Enter one path per line. The \'*\' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page. %login is the login form. %register is the registration form. %reset is the one-time login (e-mail validation).', [ - '%blog' => 'blog', - '%blog-wildcard' => '/blog/*', - '%front' => '', - '%login' => '/user', - '%register' => '/user/register', - '%reset' => '/user/*/edit', - ]), - ]; - - $form['roles'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Redirect users with roles'), - '#options' => $login_destination->getAllSystemRoles(), - '#default_value' => $login_destination->getRoles(), - '#description' => $this->t('Redirect only the selected role(s). If you select no roles, all users will be redirected.'), - ]; - - $form['uuid'] = [ - '#type' => 'value', - '#value' => $login_destination->get('uuid'), - ]; - - return parent::form($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - // Get selected roles. - $roles = array_filter($form_state->getValue('roles')); - - // Set filtered values. - $form_state->setValue('roles', $roles); - $form_state->setValue('triggers', array_filter($form_state->getValue('triggers'))); - - // Get entered by user destination path. - $destination = $form_state->getValue('destination_path'); - // @todo verify that selected role has access to entered path. - // @todo verify entered paths to specific pages. - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - /* @var $login_destination \Drupal\login_destination\Entity\LoginDestination */ - $login_destination = $this->entity; - - if ($login_destination->save()) { - drupal_set_message($this->t('Saved the %label login destination.', [ - '%label' => $login_destination->getLabel(), - ])); - } - else { - drupal_set_message($this->t('The %label login destination was not saved.', [ - '%label' => $login_destination->getLabel(), - ])); - } - $form_state->setRedirect('login_destination.list'); - } - - /** - * Form element validation handler for the 'uri' element. - * - * Disallows saving inaccessible or untrusted URLs. - * - * @see LinkWidget::validateUriElement() - */ - public function validateUriElement($element, FormStateInterface $form_state, $form) { - $uri = $this->getUserEnteredStringAsUri($element['#value']); - $form_state->setValueForElement($element, $uri); - - // If getUserEnteredStringAsUri() mapped the entered value to a 'internal:' - // URI , ensure the raw value begins with '/', '?' or '#'. - // @todo '' is valid input for BC reasons, may be removed by - // https://www.drupal.org/node/2421941 - if (parse_url($uri, PHP_URL_SCHEME) === 'internal' && !in_array($element['#value'][0], [ - '/', - '?', - '#', - ], TRUE) && substr($element['#value'], 0, 7) !== '' - && substr($element['#value'], 0, 9) !== '' - ) { - $form_state->setError($element, t('Manually entered paths should start with /, ? or #.')); - return; - } - } - - /** - * Gets the URI without the 'internal:' or 'entity:' scheme. - * - * The following two forms of URIs are transformed: - * - 'entity:' URIs: to entity autocomplete ("label (entity id)") strings; - * - 'internal:' URIs: the scheme is stripped. - * - * This method is the inverse of ::getUserEnteredStringAsUri(). - * - * @param string $uri - * The URI to get the displayable string for. - * - * @return string - * - * @see LinkWidget::getUriAsDisplayableString() - */ - protected function getUriAsDisplayableString($uri) { - $scheme = parse_url($uri, PHP_URL_SCHEME); - - // By default, the displayable string is the URI. - $displayable_string = $uri; - - // A different displayable string may be chosen in case of the 'internal:' - // or 'entity:' built-in schemes. - if ($scheme === 'internal') { - $uri_reference = explode(':', $uri, 2)[1]; - - // @todo '' is valid input for BC reasons, may be removed by - // https://www.drupal.org/node/2421941 - $path = parse_url($uri, PHP_URL_PATH); - if ($path === '/') { - $uri_reference = '' . substr($uri_reference, 1); - } - - $displayable_string = $uri_reference; - } - elseif ($scheme === 'entity') { - list($entity_type, $entity_id) = explode('/', substr($uri, 7), 2); - // Show the 'entity:' URI as the entity autocomplete would. - $entity_manager = \Drupal::entityTypeManager(); - if ($entity_manager->getDefinition($entity_type, FALSE) && $entity = \Drupal::entityTypeManager() - ->getStorage($entity_type) - ->load($entity_id) - ) { - $displayable_string = EntityAutocomplete::getEntityLabels(array($entity)); - } - } - - return $displayable_string; - } - - /** - * Gets the user-entered string as a URI. - * - * The following two forms of input are mapped to URIs: - * - entity autocomplete ("label (entity id)") strings: to 'entity:' URIs; - * - strings without a detectable scheme: to 'internal:' URIs. - * - * This method is the inverse of ::getUriAsDisplayableString(). - * - * @param string $string - * The user-entered string. - * - * @return string - * The URI, if a non-empty $uri was passed. - * - * @see LinkWidget::getUserEnteredStringAsUri() - */ - protected function getUserEnteredStringAsUri($string) { - // By default, assume the entered string is an URI. - $uri = $string; - - // Detect entity autocomplete string, map to 'entity:' URI. - $entity_id = EntityAutocomplete::extractEntityIdFromAutocompleteInput($string); - if ($entity_id !== NULL) { - // @todo Support entity types other than 'node'. Will be fixed in - // https://www.drupal.org/node/2423093. - $uri = 'entity:node/' . $entity_id; - } - // Detect a schemeless string, map to 'internal:' URI. - elseif (!empty($string) && parse_url($string, PHP_URL_SCHEME) === NULL) { - // @todo '' is valid input for BC reasons, may be removed by - // https://www.drupal.org/node/2421941 - // - '' -> '/' - // - '#foo' -> '/#foo' - if (strpos($string, '') === 0) { - $string = '/' . substr($string, strlen('')); - } - $uri = 'internal:' . $string; - } - - return $uri; - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php b/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php deleted file mode 100644 index 1b9cfad74..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php +++ /dev/null @@ -1,60 +0,0 @@ -config('login_destination.settings'); - $form['settings']['preserve_destination'] = [ - '#type' => 'checkbox', - '#default_value' => $config->get('preserve_destination'), - '#title' => t('Preserve the destination parameter'), - '#description' => t("The 'destination' GET parameter will have priority over the settings of this module. With this setting enabled, redirect from the user login block will not work."), - ]; - $form['settings']['immediate_redirect'] = [ - '#type' => 'checkbox', - '#default_value' => $config->get('immediate_redirect'), - '#title' => t('Redirect immediately after using one-time login link'), - '#description' => t('User will be redirected before given the possibility to change their password.'), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * @inheritdoc - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('login_destination.settings'); - $config->set('preserve_destination', $form_state->getValue('preserve_destination')); - $config->set('immediate_redirect', $form_state->getValue('immediate_redirect')); - $config->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php b/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php deleted file mode 100644 index 6bacf1767..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php +++ /dev/null @@ -1,117 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->aliasManager = $alias_manager; - $this->pathMatcher = $path_matcher; - $this->currentPath = $current_path; - $this->configFactory = $config_factory; - $this->requestStack = $request_stack; - } - - /** - * {@inheritdoc} - */ - public function findDestination($trigger, AccountInterface $account) { - $destinations = $this->entityTypeManager->getStorage('login_destination') - ->loadMultiple(); - uasort($destinations, '\Drupal\login_destination\Entity\LoginDestination::sort'); - - $path = $this->getCurrentPath(); - $path_alias = Unicode::strtolower($this->aliasManager->getAliasByPath($path)); - - // Get user roles. - $user_roles = $account->getRoles(); - - /** @var LoginDestination $destination */ - foreach ($destinations as $destination) { - if (!$destination->isEnabled()) { - continue; - } - - // Determine if the trigger matches that of the login destination rule. - $destination_triggers = $destination->getTriggers(); - if (!in_array($trigger, $destination_triggers)) { - continue; - } - $destination_roles = $destination->getRoles(); - - $role_match = array_intersect($user_roles, $destination_roles); - // Ensure the user logging in has a role allowed by the login destination rule. - // Or Login Destination Rule does not have any selected roles. - if (empty($role_match) && !empty($destination_roles)) { - continue; - } - - $pages = Unicode::strtolower($destination->getPages()); - if (!empty($pages)) { - $type = $destination->getPagesType(); - $page_match = $this->pathMatcher->matchPath($path_alias, $pages) || $this->pathMatcher->matchPath($path, $pages); - - // Make sure the page matches(or does not match if the rule specifies that). - if (($page_match && $type == $destination::REDIRECT_LISTED) || (!$page_match && $type == $destination::REDIRECT_NOT_LISTED)) { - - return $destination; - } - continue; - } - - return $destination; - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function prepareDestination(LoginDestination $destination) { - // Get config with settings. - $config = $this->configFactory->get('login_destination.settings'); - if ($config->get('preserve_destination')) { - // Get current destination value. - $drupal_destination = $this->requestStack->getCurrentRequest()->query->get('destination'); - if (UrlHelper::isExternal($drupal_destination)) { - $drupal_destination = NULL; - } - // Determine if a destination exist in the URL. - if (!empty($drupal_destination)) { - return; - } - } - - // Prepare destination path. - $path = $destination->getDestination(); - // Check if rules refers to the current page. - if ($destination->isDestinationCurrent()) { - $request = $this->requestStack->getCurrentRequest(); - $query = $request->get('current'); - $path_destination = !empty($query) ? $query : ''; - } - else { - $path_destination = Url::fromUri($path)->toString(); - } - - // Set destination to current request. - $this->requestStack->getCurrentRequest()->query->set('destination', $path_destination); - } - - /** - * Get current path. - * - * @return string - */ - protected function getCurrentPath() { - $current = $this->requestStack->getCurrentRequest()->get('current', ''); - if (empty($current)) { - $current = $this->currentPath->getPath(); - } - return $current; - } - -} diff --git a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php b/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php deleted file mode 100644 index 46c1b7973..000000000 --- a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/matomo/README.txt b/sites/all/modules/contrib/admin/matomo/README.txt deleted file mode 100644 index 9d5dd11a2..000000000 --- a/sites/all/modules/contrib/admin/matomo/README.txt +++ /dev/null @@ -1,109 +0,0 @@ - -Module: Matomo Analytics -Author: Alexander Hass - - -Description -=========== -Adds the Matomo tracking system to your website. - -Requirements -============ - -* Matomo installation -* Matomo website ID - - -Installation -============ -* Copy the 'matomo' module directory in to your Drupal 'modules' -directory as usual. - - -Usage -===== -In the settings page enter your Matomo website ID. - -All pages will now have the required JavaScript added to the -HTML footer can confirm this by viewing the page source from -your browser. - -Page specific tracking -==================================================== -The default is set to "Add to every page except the listed pages". By -default the following pages are listed for exclusion: - -/admin -/admin/* -/batch -/node/add* -/node/*/* -/user/*/* - -These defaults are changeable by the website administrator or any other -user with 'Administer Matomo' permission. - -Like the blocks visibility settings in Drupal core, there is a choice for -"Add if the following PHP code returns TRUE." Sample PHP snippets that can be -used in this textarea can be found on the handbook page "Overview-approach to -block visibility" at https://drupal.org/node/64135. - -Custom variables -================= -One example for custom variables tracking is the "User roles" tracking. Enter -the below configuration data into the custom variables settings form under -admin/config/system/matomo. - -Slot: 1 -Name: User roles -Value: [current-user:matomo-role-names] -Scope: Visitor - -Slot: 1 -Name: User ids -Value: [current-user:matomo-role-ids] -Scope: Visitor - -More details about custom variables can be found in the Matomo API documentation -at https://matomo.org/docs/javascript-tracking/#toc-custom-variables. - - -Advanced Settings -================= -You can include additional JavaScript snippets in the custom javascript -code textarea. These can be found on various blog posts, or on the -official Matomo pages. Support is not provided for any customisations -you include. - -To speed up page loading you may also cache the Matomo "piwik.js" -file locally. - -Known issues -============ -Drupal requirements (https://drupal.org/requirements) tell you to configure -PHP with "session.save_handler = user", but your Matomo installation may -not work with this configuration and gives you a server error 500. - -1. You are able to workaround with the PHP default in your php.ini: - - [Session] - session.save_handler = files - -2. With Apache you may overwrite the PHP setting for the Matomo directory only. - If Matomo is installed in /matomo you are able to create a .htaccess file in - this directory with the below code: - - # PHP 4, Apache 1. - - php_value session.save_handler files - - - # PHP 4, Apache 2. - - php_value session.save_handler files - - - # PHP 5, Apache 1 and 2. - - php_value session.save_handler files - diff --git a/sites/all/modules/contrib/admin/matomo/composer.json b/sites/all/modules/contrib/admin/matomo/composer.json deleted file mode 100644 index 8799b1bfe..000000000 --- a/sites/all/modules/contrib/admin/matomo/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "drupal/matomo", - "description": "Adds Matomo javascript tracking code to all your site's pages", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/matomo", - "authors": [ - { - "name": "hass", - "homepage": "https://www.drupal.org/u/hass" - }, - { - "name": "See other contributors", - "homepage":"https://www.drupal.org/node/247808/committers" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/matomo", - "source": "https://git.drupal.org/project/matomo.git" - }, - "license": "GPL-2.0+", - "require": { - "drupal/core": "~8.5" - } -} diff --git a/sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml b/sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml deleted file mode 100644 index bb7df96fd..000000000 --- a/sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml +++ /dev/null @@ -1,29 +0,0 @@ -site_id: '' -url_http: '' -url_https: '' -domain_mode: 0 -visibility: - request_path_mode: 0 - request_path_pages: "/admin\n/admin/*\n/batch\n/node/add*\n/node/*/*\n/user/*/*" - user_role_mode: 0 - user_role_roles: { } - user_account_mode: 1 -track: - mailto: true - files: true - files_extensions: '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip' - colorbox: true - userid: false - messages: { } - site_search: false -privacy: - donottrack: true -custom: - variable: { } -codesnippet: - before: '' - after: '' -translation_set: false -cache: false -page_title_hierarchy: false -page_title_hierarchy_exclude_home: true diff --git a/sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml b/sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml deleted file mode 100644 index 1b9d213b6..000000000 --- a/sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml +++ /dev/null @@ -1,120 +0,0 @@ -# Schema for the configuration files of the matomo module. - -matomo.settings: - type: config_object - label: 'Matomo settings' - mapping: - site_id: - type: string - label: 'Matomo site ID' - url_http: - type: string - label: 'Matomo HTTP URL' - url_https: - type: string - label: 'Matomo HTTPS URL' - domain_mode: - type: integer - label: 'What are you tracking?' - visibility: - type: mapping - label: 'Visibility' - mapping: - request_path_mode: - type: integer - label: 'Add tracking to specific pages' - request_path_pages: - type: string - label: 'Pages by their paths' - user_role_mode: - type: integer - label: 'Add tracking for specific roles' - user_role_roles: - type: sequence - label: 'Roles' - sequence: - type: string - label: 'Role' - user_account_mode: - type: integer - label: 'Allow users to customize tracking on their account page' - track: - type: mapping - label: 'Links and downloads' - mapping: - mailto: - type: boolean - label: 'Track clicks on mailto links' - files: - type: boolean - label: 'Track downloads' - files_extensions: - type: string - label: 'File extension list' - colorbox: - type: boolean - label: 'Track content in colorbox modal dialogs' - userid: - type: boolean - label: 'Track User ID' - messages: - type: sequence - label: 'Track messages of type' - sequence: - type: string - label: 'Message type' - site_search: - type: boolean - label: 'Track internal search' - privacy: - type: mapping - label: 'Privacy' - mapping: - donottrack: - type: boolean - label: 'Universal web tracking opt-out' - custom: - type: mapping - label: 'Custom variables' - mapping: - variable: - type: sequence - label: 'Custom variable' - sequence: - type: mapping - label: 'Variable' - mapping: - slot: - type: integer - label: 'Slot number' - name: - type: string - label: 'The custom variable name.' - value: - type: string - label: 'The custom variable value.' - scope: - type: string - label: 'The scope for the custom variable.' - codesnippet: - type: mapping - label: 'Custom code snippets' - mapping: - before: - type: string - label: 'Code snippet (before)' - after: - type: string - label: 'Code snippet (after)' - translation_set: - type: boolean - label: 'Track translation sets as one unit' - cache: - type: boolean - label: 'Locally cache tracking code file' - page_title_hierarchy: - type: boolean - label: 'Show page titles as hierarchy like breadcrumbs' - page_title_hierarchy_exclude_home: - type: boolean - label: 'Hide home page from hierarchy' diff --git a/sites/all/modules/contrib/admin/matomo/js/matomo.admin.js b/sites/all/modules/contrib/admin/matomo/js/matomo.admin.js deleted file mode 100644 index 2f68188fe..000000000 --- a/sites/all/modules/contrib/admin/matomo/js/matomo.admin.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @file - * Matomo admin behaviors. - */ - -(function ($) { - - "use strict"; - - /** - * Provide the summary information for the tracking settings vertical tabs. - */ - Drupal.behaviors.trackingSettingsSummary = { - attach: function () { - // Make sure this behavior is processed only if drupalSetSummary is defined. - if (typeof jQuery.fn.drupalSetSummary === 'undefined') { - return; - } - - $('#edit-page-visibility-settings').drupalSetSummary(function (context) { - var $radio = $('input[name="matomo_visibility_request_path_mode"]:checked', context); - if ($radio.val() === '0') { - if (!$('textarea[name="matomo_visibility_request_path_pages"]', context).val()) { - return Drupal.t('Not restricted'); - } - else { - return Drupal.t('All pages with exceptions'); - } - } - else { - return Drupal.t('Restricted to certain pages'); - } - }); - - $('#edit-role-visibility-settings').drupalSetSummary(function (context) { - var vals = []; - $('input[type="checkbox"]:checked', context).each(function () { - vals.push($.trim($(this).next('label').text())); - }); - if (!vals.length) { - return Drupal.t('Not restricted'); - } - else if ($('input[name="matomo_visibility_user_role_mode"]:checked', context).val() === '1') { - return Drupal.t('Excepted: @roles', {'@roles': vals.join(', ')}); - } - else { - return vals.join(', '); - } - }); - - $('#edit-user-visibility-settings').drupalSetSummary(function (context) { - var $radio = $('input[name="matomo_visibility_user_account_mode"]:checked', context); - if ($radio.val() === '0') { - return Drupal.t('Not customizable'); - } - else if ($radio.val() === '1') { - return Drupal.t('On by default with opt out'); - } - else { - return Drupal.t('Off by default with opt in'); - } - }); - - $('#edit-linktracking').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-matomo-trackmailto', context).is(':checked')) { - vals.push(Drupal.t('Mailto links')); - } - if ($('input#edit-matomo-trackfiles', context).is(':checked')) { - vals.push(Drupal.t('Outbound links')); - vals.push(Drupal.t('Downloads')); - } - if ($('input#edit-matomo-trackcolorbox', context).is(':checked')) { - vals.push(Drupal.t('Colorbox')); - } - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-messagetracking').drupalSetSummary(function (context) { - var vals = []; - $('input[type="checkbox"]:checked', context).each(function () { - vals.push($.trim($(this).next('label').text())); - }); - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-search').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-matomo-site-search', context).is(':checked')) { - vals.push(Drupal.t('Site search')); - } - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-domain-tracking').drupalSetSummary(function (context) { - var $radio = $('input[name="matomo_domain_mode"]:checked', context); - if ($radio.val() === '0') { - return Drupal.t('A single domain'); - } - else if ($radio.val() === '1') { - return Drupal.t('One domain with multiple subdomains'); - } - }); - - $('#edit-page-title-hierarchy').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-matomo-page-title-hierarchy', context).is(':checked')) { - vals.push(Drupal.t('Show page titles')); - } - if ($('input#edit-matomo-page-title-hierarchy-exclude-home', context).is(':checked')) { - vals.push(Drupal.t('Hide home page')); - } - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-privacy').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-matomo-privacy-donottrack', context).is(':checked')) { - vals.push(Drupal.t('Universal web tracking opt-out')); - } - if (!vals.length) { - return Drupal.t('No privacy'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - } - }; - -})(jQuery); diff --git a/sites/all/modules/contrib/admin/matomo/js/matomo.js b/sites/all/modules/contrib/admin/matomo/js/matomo.js deleted file mode 100644 index 9b3a7b34d..000000000 --- a/sites/all/modules/contrib/admin/matomo/js/matomo.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file - * Attaches several event listener to a web page. - */ - -(function ($, drupalSettings) { - - "use strict"; - - $(document).ready(function () { - - // Attach mousedown, keyup, touchstart events to document only and catch - // clicks on all elements. - $(document.body).bind("mousedown keyup touchstart", function (event) { - - // Catch the closest surrounding link of a clicked element. - $(event.target).closest("a,area").each(function () { - - if (drupalSettings.matomo.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { - // Mailto link clicked. - _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]); - } - - }); - }); - - // Colorbox: This event triggers when the transition has completed and the - // newly loaded content has been revealed. - if (drupalSettings.matomo.trackColorbox) { - $(document).bind("cbox_complete", function () { - var href = $.colorbox.element().attr("href"); - if (href) { - _paq.push(["setCustomUrl", href]); - _paq.push(["trackPageView"]); - } - }); - } - - }); - -})(jQuery, drupalSettings); diff --git a/sites/all/modules/contrib/admin/matomo/matomo.info.yml b/sites/all/modules/contrib/admin/matomo/matomo.info.yml deleted file mode 100644 index 4bc2bc4aa..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'Matomo Analytics' -type: module -description: "Adds Matomo javascript tracking code to all your site's pages." -package: Statistics -# core: 8.x -configure: matomo.admin_settings_form -dependencies: - - drupal:system (>= 8.5) -test_dependencies: - - php:php - - token:token - -# Information added by Drupal.org packaging script on 2019-02-08 -version: '8.x-1.9' -core: '8.x' -project: 'matomo' -datestamp: 1549615102 diff --git a/sites/all/modules/contrib/admin/matomo/matomo.install b/sites/all/modules/contrib/admin/matomo/matomo.install deleted file mode 100644 index b3f5a0b61..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.install +++ /dev/null @@ -1,55 +0,0 @@ -grantPermission('opt-in or out of matomo tracking'); - $success = $role->save(); - if ($success) { - $messenger = \Drupal::messenger(); - $messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', ['%module' => 'Matomo Analytics', '%permission' => t('Opt-in or out of tracking')]), 'status'); - } -} - -/** - * Implements hook_uninstall(). - * - * Remove cache directory if module is uninstalled. - */ -function matomo_uninstall() { - matomo_clear_js_cache(); -} - -/** - * Implements hook_requirements(). - */ -function matomo_requirements($phase) { - $requirements = []; - - if ($phase == 'runtime') { - $config = \Drupal::config('matomo.settings'); - - // Raise warning if Matomo user account has not been set yet. - if (!preg_match('/^\d{1,}$/', $config->get('site_id'))) { - $requirements['matomo_site_id'] = [ - 'title' => t('Matomo module'), - 'description' => t('Matomo module has not been configured yet. Please configure its settings from the Matomo settings page.', [':url' => Url::fromRoute('matomo.admin_settings_form')->toString()]), - 'severity' => REQUIREMENT_WARNING, - 'value' => t('Not configured'), - ]; - } - } - - return $requirements; -} diff --git a/sites/all/modules/contrib/admin/matomo/matomo.libraries.yml b/sites/all/modules/contrib/admin/matomo/matomo.libraries.yml deleted file mode 100644 index abcd74059..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.libraries.yml +++ /dev/null @@ -1,15 +0,0 @@ -matomo: - version: VERSION - js: - js/matomo.js: {} - dependencies: - - core/jquery - - core/drupalSettings - -matomo.admin: - version: VERSION - js: - js/matomo.admin.js: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml b/sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml deleted file mode 100644 index c88165a25..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -matomo.admin_settings_form: - title: 'Matomo Analytics' - parent: system.admin_config_system - description: 'Configure the settings used to generate your Matomo tracking code.' - route_name: matomo.admin_settings_form diff --git a/sites/all/modules/contrib/admin/matomo/matomo.links.task.yml b/sites/all/modules/contrib/admin/matomo/matomo.links.task.yml deleted file mode 100644 index aa22e5a6e..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -matomo.admin_settings_form_tab: - route_name: matomo.admin_settings_form - title: Settings - base_route: matomo.admin_settings_form diff --git a/sites/all/modules/contrib/admin/matomo/matomo.module b/sites/all/modules/contrib/admin/matomo/matomo.module deleted file mode 100644 index 2c422ff4d..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.module +++ /dev/null @@ -1,729 +0,0 @@ - - */ - -use Drupal\Component\Serialization\Json; -use Drupal\Component\Utility\Crypt; -use Drupal\Component\Utility\Unicode; -use Drupal\Component\Utility\UrlHelper; -use Drupal\Core\Cache\Cache; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\Core\Site\Settings; -use Drupal\Core\Url; -use Drupal\matomo\MatomoInterface; -use Drupal\node\NodeInterface; -use GuzzleHttp\Exception\RequestException; -use Drupal\matomo\Component\Render\MatomoJavaScriptSnippet; - -/** - * Implements hook_help(). - */ -function matomo_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'matomo.admin_settings_form': - return t('Matomo Analytics is an open source (GPL license) web analytics software. It gives interesting reports on your website visitors, your popular pages, the search engines keywords they used, the language they speak... and so much more. Matomo aims to be an open source alternative to Google Analytics.', [':pk_url' => 'https://www.matomo.org/']); - } -} - -/** - * Implements hook_page_attachments(). - * - * Insert JavaScript to the appropriate scope/region of the page. - */ -function matomo_page_attachments(array &$page) { - $account = \Drupal::currentUser(); - $config = \Drupal::config('matomo.settings'); - $id = $config->get('site_id'); - $request = \Drupal::request(); - - // Add module cache tags. - $page['#cache']['tags'] = Cache::mergeTags(isset($page['#cache']['tags']) ? $page['#cache']['tags'] : [], $config->getCacheTags()); - - // Get page http status code for visibility filtering. - $status = NULL; - if ($exception = $request->attributes->get('exception')) { - $status = $exception->getStatusCode(); - } - $trackable_status_codes = [ - // "Forbidden" status code. - '403', - // "Not Found" status code. - '404', - ]; - - // 1. Check if the matomo account number has a valid value. - // 2. Track page views based on visibility value. - // 3. Check if we should track the currently active user's role. - if (preg_match('/^\d{1,}$/', $id) && (_matomo_visibility_pages() || in_array($status, $trackable_status_codes)) && _matomo_visibility_user($account)) { - - $url_http = $config->get('url_http'); - $url_https = $config->get('url_https'); - - $set_custom_url = ''; - $set_document_title = ''; - - // Add link tracking. - $link_settings = []; - $link_settings['trackMailto'] = $config->get('track.mailto'); - - if ((\Drupal::moduleHandler()->moduleExists('colorbox')) && $track_colorbox = $config->get('track.colorbox')) { - $link_settings['trackColorbox'] = $track_colorbox; - } - - $page['#attached']['drupalSettings']['matomo'] = $link_settings; - $page['#attached']['library'][] = 'matomo/matomo'; - - // Matomo can show a tree view of page titles that represents the site - // structure if setDocumentTitle() provides the page titles as a "/" - // delimited list. This may makes it easier to browse through the statistics - // of page titles on larger sites. - if ($config->get('page_title_hierarchy') == TRUE) { - $titles = _matomo_get_hierarchy_titles(); - - // Remove all empty titles. - $titles = array_filter($titles); - - if (!empty($titles)) { - // Encode title, at least to keep "/" intact. - $titles = array_map('rawurlencode', $titles); - - $set_document_title = Json::encode(implode('/', $titles)); - } - } - - // Add messages tracking. - $message_events = ''; - if ($message_types = $config->get('track.messages')) { - $message_types = array_values(array_filter($message_types)); - $status_heading = [ - 'status' => t('Status message'), - 'warning' => t('Warning message'), - 'error' => t('Error message'), - ]; - - foreach (\Drupal::messenger()->all(NULL, FALSE) as $type => $messages) { - // Track only the selected message types. - if (in_array($type, $message_types)) { - foreach ($messages as $message) { - $message_events .= '_paq.push(["trackEvent", ' . Json::encode(t('Messages')) . ', ' . Json::encode($status_heading[$type]) . ', ' . Json::encode(strip_tags($message)) . ']);'; - } - } - } - } - - // If this node is a translation of another node, pass the original - // node instead. - if (\Drupal::moduleHandler()->moduleExists('content_translation') && $config->get('translation_set')) { - // Check if we have a node object, it has translation enabled, and its - // language code does not match its source language code. - if ($request->attributes->has('node')) { - $node = $request->attributes->get('node'); - if ($node instanceof NodeInterface && \Drupal::service('entity.repository')->getTranslationFromContext($node) !== $node->getUntranslated()) { - $set_custom_url = Json::encode(Url::fromRoute('entity.node.canonical', ['node' => $node->id()], ['language' => $node->getUntranslated()->language()])->toString()); - } - } - } - - // Track access denied (403) and file not found (404) pages. - if ($status == '403') { - $set_document_title = '"403/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)'; - } - elseif ($status == '404') { - $set_document_title = '"404/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)'; - } - - // #2693595: User has entered an invalid login and clicked on forgot - // password link. This link contains the username or email address and may - // get send to Matomo if we do not override it. Override only if 'name' - // query param exists. Last custom url condition, this need to win. - // - // URLs to protect are: - // - user/password?name=username - // - user/password?name=foo@example.com - if (\Drupal::routeMatch()->getRouteName() == 'user.pass' && $request->query->has('name')) { - $set_custom_url = Json::encode(Url::fromRoute('user.pass')->toString()); - } - - // Add custom variables. - $matomo_custom_vars = $config->get('custom.variable'); - $custom_variable = ''; - for ($i = 1; $i < 6; $i++) { - $custom_var_name = !empty($matomo_custom_vars[$i]['name']) ? $matomo_custom_vars[$i]['name'] : ''; - if (!empty($custom_var_name)) { - $custom_var_value = !empty($matomo_custom_vars[$i]['value']) ? $matomo_custom_vars[$i]['value'] : ''; - $custom_var_scope = !empty($matomo_custom_vars[$i]['scope']) ? $matomo_custom_vars[$i]['scope'] : 'visit'; - - $types = []; - if ($request->attributes->has('node')) { - $node = $request->attributes->get('node'); - if ($node instanceof NodeInterface) { - $types += ['node' => $node]; - } - } - $custom_var_name = \Drupal::token()->replace($custom_var_name, $types, ['clear' => TRUE]); - $custom_var_value = \Drupal::token()->replace($custom_var_value, $types, ['clear' => TRUE]); - - // Suppress empty custom names and/or variables. - if (!Unicode::strlen(trim($custom_var_name)) || !Unicode::strlen(trim($custom_var_value))) { - continue; - } - - // Custom variables names and values are limited to 200 characters in - // length. It is recommended to store values that are as small as - // possible to ensure that the Matomo Tracking request URL doesn't go - // over the URL limit for the webserver or browser. - $custom_var_name = rtrim(substr($custom_var_name, 0, 200)); - $custom_var_value = rtrim(substr($custom_var_value, 0, 200)); - - // Add variables to tracker. - $custom_variable .= '_paq.push(["setCustomVariable", ' . Json::encode($i) . ', ' . Json::encode($custom_var_name) . ', ' . Json::encode($custom_var_value) . ', ' . Json::encode($custom_var_scope) . ']);'; - } - } - - // Add any custom code snippets if specified. - $codesnippet_before = $config->get('codesnippet.before'); - $codesnippet_after = $config->get('codesnippet.after'); - - // Build tracker code. - // @see https://matomo.org/docs/javascript-tracking/#toc-asynchronous-tracking - $script = 'var _paq = _paq || [];'; - $script .= '(function(){'; - $script .= 'var u=(("https:" == document.location.protocol) ? "' . UrlHelper::filterBadProtocol($url_https) . '" : "' . UrlHelper::filterBadProtocol($url_http) . '");'; - $script .= '_paq.push(["setSiteId", ' . Json::encode($id) . ']);'; - $script .= '_paq.push(["setTrackerUrl", u+"piwik.php"]);'; - - // Track logged in users across all devices. - if ($config->get('track.userid') && $account->isAuthenticated()) { - $script .= '_paq.push(["setUserId", ' . Json::encode(matomo_user_id_hash($account->id())) . ']);'; - } - - // Set custom url. - if (!empty($set_custom_url)) { - $script .= '_paq.push(["setCustomUrl", ' . $set_custom_url . ']);'; - } - // Set custom document title. - if (!empty($set_document_title)) { - $script .= '_paq.push(["setDocumentTitle", ' . $set_document_title . ']);'; - } - - // Custom file download extensions. - if ($config->get('track.files') && !($config->get('track.files_extensions') == MatomoInterface::MATOMO_TRACKFILES_EXTENSIONS)) { - $script .= '_paq.push(["setDownloadExtensions", ' . Json::encode($config->get('track.files_extensions')) . ']);'; - } - - // Disable tracking for visitors who have opted out from tracking via DNT - // (Do-Not-Track) header. - if ($config->get('privacy.donottrack')) { - $script .= '_paq.push(["setDoNotTrack", 1]);'; - } - - // Domain tracking type. - global $cookie_domain; - $domain_mode = $config->get('domain_mode'); - - // Per RFC 2109, cookie domains must contain at least one dot other than the - // first. For hosts such as 'localhost' or IP Addresses we don't set a - // cookie domain. - if ($domain_mode == 1 && count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { - $script .= '_paq.push(["setCookieDomain", ' . Json::encode($cookie_domain) . ']);'; - } - - // Ordering $custom_variable before $codesnippet_before allows users to add - // custom code snippets that may use deleteCustomVariable() and/or - // getCustomVariable(). - if (!empty($custom_variable)) { - $script .= $custom_variable; - } - if (!empty($codesnippet_before)) { - $script .= $codesnippet_before; - } - - // Site search tracking support. - // NOTE: It's recommended not to call trackPageView() on the Site Search - // Result page. - if (\Drupal::moduleHandler()->moduleExists('search') && $config->get('track.site_search') && (strpos(\Drupal::routeMatch()->getRouteName(), 'search.view') === 0) && $keys = ($request->query->has('keys') ? trim($request->get('keys')) : '')) { - // Parameters: - // 1. Search keyword searched for. Example: "Banana" - // 2. Search category selected in your search engine. If you do not need - // this, set to false. Example: "Organic Food" - // 3. Number of results on the Search results page. Zero indicates a - // 'No Result Search Keyword'. Set to false if you don't know. - // - // hook_preprocess_search_results() is not executed if search result is - // empty. Make sure the counter is set to 0 if there are no results. - $script .= '_paq.push(["trackSiteSearch", ' . Json::encode($keys) . ', false, (window.matomo_search_results) ? window.matomo_search_results : 0]);'; - } - else { - $script .= '_paq.push(["trackPageView"]);'; - } - - // Add link tracking. - if ($config->get('track.files')) { - // Disable tracking of links with ".no-tracking" and ".colorbox" classes. - $ignore_classes = [ - 'no-tracking', - 'colorbox', - ]; - // Disable the download & outlink tracking for specific CSS classes. - // Custom code snippets with 'setIgnoreClasses' will override the value. - // @see https://developer.matomo.org/api-reference/tracking-javascript#disable-the-download-amp-outlink-tracking-for-specific-css-classes - $script .= '_paq.push(["setIgnoreClasses", ' . Json::encode($ignore_classes) . ']);'; - - // Enable download & outlink link tracking. - $script .= '_paq.push(["enableLinkTracking"]);'; - } - - if (!empty($message_events)) { - $script .= $message_events; - } - if (!empty($codesnippet_after)) { - $script .= $codesnippet_after; - } - - $script .= 'var d=document,'; - $script .= 'g=d.createElement("script"),'; - $script .= 's=d.getElementsByTagName("script")[0];'; - $script .= 'g.type="text/javascript";'; - $script .= 'g.defer=true;'; - $script .= 'g.async=true;'; - - // Should a local cached copy of the tracking code be used? - if ($config->get('cache') && $url = _matomo_cache($url_http . 'piwik.js')) { - // A dummy query-string is added to filenames, to gain control over - // browser-caching. The string changes on every update or full cache - // flush, forcing browsers to load a new copy of the files, as the - // URL changed. - $query_string = '?' . (\Drupal::state()->get('system.css_js_query_string') ?: '0'); - - $script .= 'g.src="' . $url . $query_string . '";'; - } - else { - $script .= 'g.src=u+"piwik.js";'; - } - - $script .= 's.parentNode.insertBefore(g,s);'; - $script .= '})();'; - - // Add tracker code. - $page['#attached']['html_head'][] = [ - [ - '#tag' => 'script', - '#value' => new MatomoJavaScriptSnippet($script), - ], - 'matomo_tracking_script', - ]; - } -} - -/** - * Generate user id hash to implement USER_ID. - * - * The USER_ID value should be a unique, persistent, and non-personally - * identifiable string identifier that represents a user or signed-in - * account across devices. - * - * @param int $uid - * User id. - * - * @return string - * User id hash. - */ -function matomo_user_id_hash($uid) { - return Crypt::hmacBase64($uid, \Drupal::service('private_key')->get() . Settings::getHashSalt()); -} - -/** - * Implements hook_entity_extra_field_info(). - */ -function matomo_entity_extra_field_info() { - $extra['user']['user']['form']['matomo'] = [ - 'label' => t('Matomo settings'), - 'description' => t('Matomo module form element.'), - 'weight' => 3, - ]; - - return $extra; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Allow users to decide if tracking code will be added to pages or not. - */ -function matomo_form_user_form_alter(&$form, FormStateInterface $form_state) { - $config = \Drupal::config('matomo.settings'); - $account = $form_state->getFormObject()->getEntity(); - - if ($account->hasPermission('opt-in or out of matomo tracking') && ($visibility_users = $config->get('visibility.user_account_mode')) != 0 && _matomo_visibility_roles($account)) { - $account_data_matomo = \Drupal::service('user.data')->get('matomo', $account->id()); - - $form['matomo'] = [ - '#type' => 'details', - '#title' => t('Matomo settings'), - '#weight' => 3, - '#open' => TRUE, - ]; - - switch ($visibility_users) { - case 1: - $description = t('Users are tracked by default, but you are able to opt out.'); - break; - - case 2: - $description = t('Users are not tracked by default, but you are able to opt in.'); - break; - } - - // Disable tracking for visitors who have opted out from tracking via DNT - // (Do-Not-Track) header. - $disabled = FALSE; - if ($config->get('privacy.donottrack') && !empty($_SERVER['HTTP_DNT'])) { - $disabled = TRUE; - - // Override settings value. - $account_data_matomo['users'] = FALSE; - - $description .= ''; - $description .= ' ' . t('You have opted out from tracking via browser privacy settings.'); - $description .= ''; - } - - // Migrate old piwik settings to matomo. - $account_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id()); - if (isset($account_data_piwik['user_account_users'])) { - $account_data_matomo['user_account_users'] = $account_data_piwik['user_account_users']; - } - - $form['matomo']['user_account_users'] = [ - '#type' => 'checkbox', - '#title' => t('Enable user tracking'), - '#description' => $description, - '#default_value' => isset($account_data_matomo['user_account_users']) ? $account_data_matomo['user_account_users'] : ($visibility_users == 1), - '#disabled' => $disabled, - ]; - - // hook_user_update() is missing in D8, add custom submit handler. - $form['actions']['submit']['#submit'][] = 'matomo_user_profile_form_submit'; - } -} - -/** - * Submit callback for user profile form to save the Matomo setting. - */ -function matomo_user_profile_form_submit($form, FormStateInterface $form_state) { - $account = $form_state->getFormObject()->getEntity(); - if ($account->id() && $form_state->hasValue('user_account_users')) { - \Drupal::service('user.data')->set('matomo', $account->id(), 'user_account_users', (int) $form_state->getValue('user_account_users')); - } - - // Remove old piwik setting to complete migration to matomo. - $account_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id()); - if (isset($account_data_piwik)) { - \Drupal::service('user.data')->delete('piwik', $account->id()); - } -} - -/** - * Implements hook_cron(). - */ -function matomo_cron() { - $config = \Drupal::config('matomo.settings'); - $request_time = \Drupal::time()->getRequestTime(); - - // Regenerate the piwik.js every day. - if ($request_time - \Drupal::state()->get('matomo.last_cache') >= 86400 && $config->get('cache')) { - _matomo_cache($config->get('url_http') . 'piwik.js', TRUE); - \Drupal::state()->set('matomo.last_cache', $request_time); - } -} - -/** - * Implements hook_preprocess_item_list__search_results(). - * - * Collects and adds the number of search results to the head. - */ -function matomo_preprocess_item_list__search_results(&$variables) { - $config = \Drupal::config('matomo.settings'); - - // Only run on search results list. - if ($config->get('track.site_search')) { - // There is no search result $variable available that hold the number of - // items found. The variable $variables['items'] has the current page items - // only. But the pager item mumber can tell the number of search results. - global $pager_total_items; - - $variables['#attached']['html_head'][] = [ - [ - '#tag' => 'script', - '#value' => 'window.matomo_search_results = ' . intval($pager_total_items[0]) . ';', - '#weight' => JS_LIBRARY - 1, - ], - 'matomo_search_script', - ]; - } -} - -/** - * Download/Synchronize/Cache tracking code file locally. - * - * @param string $location - * The full URL to the external javascript file. - * @param bool $synchronize - * Synchronize to local cache if remote file has changed. - * - * @return mixed - * The path to the local javascript file on success, boolean FALSE on failure. - */ -function _matomo_cache($location, $synchronize = FALSE) { - $path = 'public://matomo'; - $file_destination = $path . '/' . basename($location); - - if (!file_exists($file_destination) || $synchronize) { - // Download the latest tracking code. - try { - $data = \Drupal::httpClient() - ->get($location) - ->getBody(TRUE); - - if (file_exists($file_destination)) { - // Synchronize tracking code and and replace local file if outdated. - $data_hash_local = Crypt::hashBase64(file_get_contents($file_destination)); - $data_hash_remote = Crypt::hashBase64($data); - // Check that the files directory is writable. - if ($data_hash_local != $data_hash_remote && file_prepare_directory($path)) { - // Save updated tracking code file to disk. - file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE); - // Based on Drupal Core class AssetDumper. - if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) { - file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE); - } - \Drupal::logger('matomo')->info('Locally cached tracking code file has been updated.'); - - // Change query-strings on css/js files to enforce reload for all - // users. - _drupal_flush_css_js(); - } - } - else { - // Check that the files directory is writable. - if (file_prepare_directory($path, FILE_CREATE_DIRECTORY)) { - // There is no need to flush JS here as core refreshes JS caches - // automatically, if new files are added. - file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE); - // Based on Drupal Core class AssetDumper. - if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) { - file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE); - } - \Drupal::logger('matomo')->info('Locally cached tracking code file has been saved.'); - - // Return the local JS file path. - return file_url_transform_relative(file_create_url($file_destination)); - } - } - } - catch (RequestException $exception) { - watchdog_exception('matomo', $exception); - } - } - else { - // Return the local JS file path. - return file_url_transform_relative(file_create_url($file_destination)); - } -} - -/** - * Delete cached files and directory. - */ -function matomo_clear_js_cache() { - $path = 'public://matomo'; - if (file_prepare_directory($path)) { - file_scan_directory($path, '/.*/', ['callback' => 'file_unmanaged_delete']); - \Drupal::service('file_system')->rmdir($path); - - // Change query-strings on css/js files to enforce reload for all users. - _drupal_flush_css_js(); - - \Drupal::logger('matomo')->info('Local cache has been purged.'); - } -} - -/** - * Tracking visibility check for an user object. - * - * @param object $account - * A user object containing an array of roles to check. - * - * @return bool - * TRUE if the current user is being tracked by Matomo, otherwise FALSE. - */ -function _matomo_visibility_user($account) { - $config = \Drupal::config('matomo.settings'); - $enabled = FALSE; - - // Is current user a member of a role that should be tracked? - if (_matomo_visibility_roles($account)) { - - // Use the user's block visibility setting, if necessary. - if (($visibility_user_account_mode = $config->get('visibility.user_account_mode')) != 0) { - $user_data_matomo = \Drupal::service('user.data')->get('matomo', $account->id()); - if ($account->id() && isset($user_data_matomo['user_account_users'])) { - $enabled = $user_data_matomo['user_account_users']; - } - else { - $enabled = ($visibility_user_account_mode == 1); - } - } - else { - $enabled = TRUE; - } - - } - - return $enabled; -} - -/** - * Tracking visibility check for user roles. - * - * Based on visibility setting this function returns TRUE if Matomo code should - * be added for the current role and otherwise FALSE. - * - * @param object $account - * A user object containing an array of roles to check. - * - * @return bool - * TRUE if JS code should be added for the current role and otherwise FALSE. - */ -function _matomo_visibility_roles($account) { - $config = \Drupal::config('matomo.settings'); - $enabled = $visibility_user_role_mode = $config->get('visibility.user_role_mode'); - $user_role_roles = $config->get('visibility.user_role_roles'); - - if (count($user_role_roles) > 0) { - // One or more roles are selected. - foreach (array_values($account->getRoles()) as $user_role) { - // Is the current user a member of one of these roles? - if (in_array($user_role, $user_role_roles)) { - // Current user is a member of a role that should be tracked/excluded - // from tracking. - $enabled = !$visibility_user_role_mode; - break; - } - } - } - else { - // No role is selected for tracking, therefore all roles should be tracked. - $enabled = TRUE; - } - - return $enabled; -} - -/** - * Tracking visibility check for pages. - * - * Based on visibility setting this function returns TRUE if JS code should - * be added to the current page and otherwise FALSE. - */ -function _matomo_visibility_pages() { - static $page_match; - - // Cache visibility result if function is called more than once. - if (!isset($page_match)) { - $config = \Drupal::config('matomo.settings'); - $visibility_request_path_mode = $config->get('visibility.request_path_mode'); - $visibility_request_path_pages = $config->get('visibility.request_path_pages'); - - // Match path if necessary. - if (!empty($visibility_request_path_pages)) { - // Convert path to lowercase. This allows comparison of the same path - // with different case. Ex: /Page, /page, /PAGE. - $pages = Unicode::strtolower($visibility_request_path_pages); - if ($visibility_request_path_mode < 2) { - // Compare the lowercase path alias (if any) and internal path. - $path = \Drupal::service('path.current')->getPath(); - $path_alias = Unicode::strtolower(\Drupal::service('path.alias_manager')->getAliasByPath($path)); - $page_match = \Drupal::service('path.matcher')->matchPath($path_alias, $pages) || (($path != $path_alias) && \Drupal::service('path.matcher')->matchPath($path, $pages)); - // When $visibility_request_path_mode has a value of 0, the tracking - // code is displayed on all pages except those listed in $pages. When - // set to 1, it is displayed only on those pages listed in $pages. - $page_match = !($visibility_request_path_mode xor $page_match); - } - elseif (\Drupal::moduleHandler()->moduleExists('php')) { - $page_match = php_eval($visibility_request_path_pages); - } - else { - $page_match = FALSE; - } - } - else { - $page_match = TRUE; - } - - } - return $page_match; -} - -/** - * Get the page titles trail for the current page. - * - * Based on menu_get_active_breadcrumb(). - * - * @return array - * All page titles, including current page. - */ -function _matomo_get_hierarchy_titles() { - $titles = []; - $path = Url::fromRoute('')->toString(); - $config = \Drupal::config('system.site'); - $matomo_conf = \Drupal::config('matomo.settings'); - - // No breadcrumb for the front page. - if (($path === Url::fromUserInput($config->get('page.front'))->toString())) { - return $titles; - } - - // Load up the menu tree. - // TODO: Check this is a sane approach. - $menu_tree = \Drupal::menuTree(); - $menu_name = \Drupal::config('system.menu.main')->get('id'); - - // Build the typical default set of menu tree parameters. - $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name); - - // Load the tree based on this set of parameters. - $tree = $menu_tree->load($menu_name, $parameters); - - // Transform the tree using the manipulators. - $manipulators = [ - // Only show links that are accessible for the current user. - ['callable' => 'menu.default_tree_manipulators:checkAccess'], - // Use the default sorting of menu links. - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - // Fatten the menu. - ['callable' => 'menu.default_tree_manipulators:flatten'], - ]; - $tree = $menu_tree->transform($tree, $manipulators); - - if (!empty($tree)) { - foreach ($tree as $menu_item) { - // If the item is in the active trail and we don't have a front page link - // when we have set to exclude home from the breadcrumbs then add the - // title. - if ($menu_item->inActiveTrail && !($matomo_conf->get('page_title_hierarchy_exclude_home') && $menu_item->link->getRouteName() == '')) { - $titles[] = $menu_item->link->getTitle(); - } - } - } - - return $titles; -} diff --git a/sites/all/modules/contrib/admin/matomo/matomo.permissions.yml b/sites/all/modules/contrib/admin/matomo/matomo.permissions.yml deleted file mode 100644 index 27ad40274..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.permissions.yml +++ /dev/null @@ -1,14 +0,0 @@ -administer matomo: - title: 'Administer Matomo' - description: 'Perform maintenance tasks for Matomo.' -opt-in or out of matomo tracking: - title: 'Opt-in or out of tracking' - description: 'Allow users to decide if tracking code will be added to pages or not.' -use php for matomo tracking visibility: - title: 'Use PHP for tracking visibility' - description: 'Enter PHP code in the field for tracking visibility settings.' - restrict access: true -add js snippets for matomo: - title: 'Add JavaScript snippets' - description: 'Enter JavaScript code snippets for advanced Matomo functionality.' - restrict access: true diff --git a/sites/all/modules/contrib/admin/matomo/matomo.routing.yml b/sites/all/modules/contrib/admin/matomo/matomo.routing.yml deleted file mode 100644 index 68c1f0ae0..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -matomo.admin_settings_form: - path: '/admin/config/system/matomo' - defaults: - _form: '\Drupal\matomo\Form\MatomoAdminSettingsForm' - _title: 'Matomo Analytics' - requirements: - _permission: 'administer matomo' diff --git a/sites/all/modules/contrib/admin/matomo/matomo.tokens.inc b/sites/all/modules/contrib/admin/matomo/matomo.tokens.inc deleted file mode 100644 index 1b4cafa3b..000000000 --- a/sites/all/modules/contrib/admin/matomo/matomo.tokens.inc +++ /dev/null @@ -1,60 +0,0 @@ - t('User role names'), - 'description' => t('The role names the user account is a member of as comma separated list.'), - 'needs-data' => 'user', - ]; - $user['matomo-role-ids'] = [ - 'name' => t('User role ids'), - 'description' => t('The role ids the user account is a member of as comma separated list.'), - 'needs-data' => 'user', - ]; - - return [ - 'tokens' => ['user' => $user], - ]; -} - -/** - * Implements hook_tokens(). - */ -function matomo_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { - $sanitize = !empty($options['sanitize']); - $replacements = []; - - if ($type == 'user' && !empty($data['user'])) { - $account = $data['user']; - - foreach ($tokens as $name => $original) { - switch ($name) { - // Basic user account information. - case 'matomo-role-names': - $names = implode(',', $account->getRoles()); - $replacements[$original] = $sanitize ? Html::escape($names) : $names; - $bubbleable_metadata->addCacheableDependency($account); - break; - - case 'matomo-role-ids': - $ids = implode(',', array_keys($account->getRoles())); - $replacements[$original] = $sanitize ? Html::escape($ids) : $ids; - $bubbleable_metadata->addCacheableDependency($account); - break; - } - } - } - - return $replacements; -} diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml deleted file mode 100644 index dd365ed48..000000000 --- a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml +++ /dev/null @@ -1,70 +0,0 @@ -id: d6_piwik_settings -label: Piwik 6 configuration -migration_tags: - - Drupal 6 - - Configuration -source: - plugin: variable - variables: - - piwik_cache - - piwik_codesnippet_after - - piwik_codesnippet_before - - piwik_custom - - piwik_domain_mode - - piwik_pages - - piwik_privacy_donottrack - - piwik_roles - - piwik_site_id - - piwik_site_search - - piwik_trackmessages - - piwik_track - - piwik_trackfiles_extensions - - piwik_trackmailto - - piwik_trackuserid - - piwik_translation_set - - piwik_url_http - - piwik_url_https - - piwik_visibility_pages - - piwik_visibility_roles - - piwik_page_title_hierarchy - - piwik_page_title_hierarchy_exclude_home - source_module: piwik -process: - cache: piwik_cache - 'codesnippet/after': piwik_codesnippet_after - 'codesnippet/before': piwik_codesnippet_before - domain_mode: piwik_domain_mode - 'privacy/donottrack': piwik_privacy_donottrack - site_id: piwik_site_id - 'track/files': piwik_track - 'track/files_extensions': piwik_trackfiles_extensions - 'track/mailto': piwik_trackmailto - 'track/messages': piwik_trackmessages - 'track/site_search': piwik_site_search - 'track/userid': piwik_trackuserid - 'translation_set': piwik_translation_set - url_http: piwik_url_http - url_https: piwik_url_https - 'visibility/user_account_mode': piwik_custom - 'visibility/request_path_mode': piwik_visibility_pages - 'visibility/request_path_pages': - plugin: matomo_visibility_pages - source: - - piwik_visibility_pages - - piwik_pages - # If Piwik uses PHP visibility, don't migrate it unless the PHP module is - # enabled. - skip_php: true - 'visibility/user_role_mode': piwik_visibility_roles - 'visibility/user_role_roles': - plugin: matomo_visibility_roles - source: - - piwik_roles - page_title_hierarchy: piwik_page_title_hierarchy - page_title_hierarchy_exclude_home: piwik_page_title_hierarchy_exclude_home -destination: - plugin: config - config_name: matomo.settings -migration_dependencies: - optional: - - d6_user_role diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml deleted file mode 100644 index 65fcce9fd..000000000 --- a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml +++ /dev/null @@ -1,22 +0,0 @@ -id: d6_piwik_user_settings -label: Piwik user settings -migration_tags: - - Drupal 6 -source: - plugin: d6_user - constants: - key: user_account_users - module: piwik -process: - uid: uid - key: 'constants/key' - module: 'constants/module' - settings: - plugin: skip_row_if_not_set - index: 'custom' - source: data/piwik -destination: - plugin: user_data -migration_dependencies: - required: - - d6_user diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml deleted file mode 100644 index 601a69892..000000000 --- a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml +++ /dev/null @@ -1,77 +0,0 @@ -id: d7_matomo_settings -label: Matomo 7 configuration -migration_tags: - - Drupal 7 - - Configuration -source: - plugin: variable - variables: - - matomo_cache - - matomo_codesnippet_after - - matomo_codesnippet_before - - matomo_custom - - matomo_custom_var - - matomo_domain_mode - - matomo_pages - - matomo_privacy_donottrack - - matomo_roles - - matomo_site_id - - matomo_site_search - - matomo_track - - matomo_trackcolorbox - - matomo_trackfiles_extensions - - matomo_trackmailto - - matomo_trackmessages - - matomo_trackuserid - - matomo_translation_set - - matomo_url_http - - matomo_url_https - - matomo_visibility_pages - - matomo_visibility_roles - - matomo_page_title_hierarchy - - matomo_page_title_hierarchy_exclude_home - source_module: matomo -process: - cache: matomo_cache - 'codesnippet/after': matomo_codesnippet_after - 'codesnippet/before': matomo_codesnippet_before - 'custom/variable': - plugin: matomo_custom_vars - source: - - matomo_custom_var - domain_mode: matomo_domain_mode - 'privacy/donottrack': matomo_privacy_donottrack - site_id: matomo_site_id - 'track/colorbox': matomo_trackcolorbox - 'track/files': matomo_track - 'track/files_extensions': matomo_trackfiles_extensions - 'track/mailto': matomo_trackmailto - 'track/messages': matomo_trackmessages - 'track/site_search': matomo_site_search - 'track/userid': matomo_trackuserid - 'translation_set': matomo_translation_set - url_http: matomo_url_http - url_https: matomo_url_https - 'visibility/user_account_mode': matomo_custom - 'visibility/request_path_mode': matomo_visibility_pages - 'visibility/request_path_pages': - plugin: matomo_visibility_pages - source: - - matomo_visibility_pages - - matomo_pages - # If Matomo uses PHP visibility, don't migrate it unless the PHP module is - # enabled. - skip_php: true - 'visibility/user_role_mode': matomo_visibility_roles - 'visibility/user_role_roles': - plugin: matomo_visibility_roles - source: - - matomo_roles - page_title_hierarchy: matomo_page_title_hierarchy - page_title_hierarchy_exclude_home: matomo_page_title_hierarchy_exclude_home -destination: - plugin: config - config_name: matomo.settings -migration_dependencies: - optional: - - d7_user_role diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml deleted file mode 100644 index 676a9f792..000000000 --- a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml +++ /dev/null @@ -1,22 +0,0 @@ -id: d7_matomo_user_settings -label: Matomo user settings -migration_tags: - - Drupal 7 -source: - plugin: d7_user - constants: - key: user_account_users - module: matomo -process: - uid: uid - key: 'constants/key' - module: 'constants/module' - settings: - plugin: skip_row_if_not_set - index: 'custom' - source: data/matomo -destination: - plugin: user_data -migration_dependencies: - required: - - d7_user diff --git a/sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php b/sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php deleted file mode 100644 index 3fd6ff84d..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php +++ /dev/null @@ -1,43 +0,0 @@ -string = (string) $string; - } - - /** - * {@inheritdoc} - */ - public function __toString() { - return $this->string; - } - - /** - * {@inheritdoc} - */ - public function jsonSerialize() { - return $this->__toString(); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php b/sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php deleted file mode 100644 index bd6e68722..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php +++ /dev/null @@ -1,752 +0,0 @@ -currentUser = $currentUser; - $this->moduleHandler = $moduleHandler; - $this->httpClient = $httpClient; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'matomo_admin_settings'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['matomo.settings']; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('matomo.settings'); - - $form['general'] = [ - '#type' => 'details', - '#title' => $this->t('General settings'), - '#open' => TRUE, - ]; - - $form['general']['matomo_site_id'] = [ - '#default_value' => $config->get('site_id'), - '#description' => $this->t('The user account number is unique to the websites domain. Click the Settings link in your Matomo account, then the Websites tab and enter the appropriate site ID into this field.'), - '#maxlength' => 20, - '#required' => TRUE, - '#size' => 15, - '#title' => $this->t('Matomo site ID'), - '#type' => 'textfield', - ]; - $form['general']['matomo_url_http'] = [ - '#default_value' => $config->get('url_http'), - '#description' => $this->t('The URL to your Matomo base directory. Example: "http://www.example.com/matomo/".'), - '#maxlength' => 255, - '#required' => TRUE, - '#size' => 80, - '#title' => $this->t('Matomo HTTP URL'), - '#type' => 'textfield', - ]; - $form['general']['matomo_url_https'] = [ - '#default_value' => $config->get('url_https'), - '#description' => $this->t('The URL to your Matomo base directory with SSL certificate installed. Required if you track a SSL enabled website. Example: "https://www.example.com/matomo/".'), - '#maxlength' => 255, - '#size' => 80, - '#title' => $this->t('Matomo HTTPS URL'), - '#type' => 'textfield', - ]; - // Required for automated form save testing only. - $form['general']['matomo_url_skiperror'] = [ - '#type' => 'hidden', - '#default_value' => FALSE, - ]; - - // Visibility settings. - $form['tracking_scope'] = [ - '#type' => 'vertical_tabs', - '#title' => $this->t('Tracking scope'), - '#attached' => [ - 'library' => [ - 'matomo/matomo.admin', - ], - ], - ]; - - $form['tracking']['domain_tracking'] = [ - '#type' => 'details', - '#title' => $this->t('Domains'), - '#group' => 'tracking_scope', - ]; - - global $cookie_domain; - $multiple_sub_domains = []; - foreach (['www', 'app', 'shop'] as $subdomain) { - if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { - $multiple_sub_domains[] = $subdomain . $cookie_domain; - } - // IP addresses or localhost. - else { - $multiple_sub_domains[] = $subdomain . '.example.com'; - } - } - - $form['tracking']['domain_tracking']['matomo_domain_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('What are you tracking?'), - '#options' => [ - 0 => $this->t('A single domain (default)'), - 1 => $this->t('One domain with multiple subdomains'), - ], - 0 => [ - '#description' => $this->t('Domain: @domain', ['@domain' => $_SERVER['HTTP_HOST']]), - ], - 1 => [ - '#description' => $this->t('Examples: @domains', ['@domains' => implode(', ', $multiple_sub_domains)]), - ], - '#default_value' => $config->get('domain_mode'), - ]; - - // Page specific visibility configurations. - $account = $this->currentUser; - $php_access = $account->hasPermission('use php for matomo tracking visibility'); - $visibility_request_path_pages = $config->get('visibility.request_path_pages'); - - $form['tracking']['page_visibility_settings'] = [ - '#type' => 'details', - '#title' => $this->t('Pages'), - '#group' => 'tracking_scope', - ]; - - if ($config->get('visibility.request_path_mode') == 2 && !$php_access) { - // No permission to change PHP snippets, but keep existing settings. - $form['tracking']['page_visibility_settings'] = []; - $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_mode'] = ['#type' => 'value', '#value' => 2]; - $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_pages'] = ['#type' => 'value', '#value' => $visibility_request_path_pages]; - } - else { - $options = [ - $this->t('Every page except the listed pages'), - $this->t('The listed pages only'), - ]; - $description = $this->t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", ['%blog' => '/blog', '%blog-wildcard' => '/blog/*', '%front' => '']); - - if ($this->moduleHandler->moduleExists('php') && $php_access) { - $options[] = $this->t('Pages on which this PHP code returns TRUE (experts only)'); - $title = $this->t('Pages or PHP code'); - $description .= ' ' . $this->t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', ['%php' => '']); - } - else { - $title = $this->t('Pages'); - } - $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('Add tracking to specific pages'), - '#options' => $options, - '#default_value' => $config->get('visibility.request_path_mode'), - ]; - $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_pages'] = [ - '#type' => 'textarea', - '#title' => $title, - '#title_display' => 'invisible', - '#default_value' => !empty($visibility_request_path_pages) ? $visibility_request_path_pages : '', - '#description' => $description, - '#rows' => 10, - ]; - } - - // Render the role overview. - $visibility_user_role_roles = $config->get('visibility.user_role_roles'); - - $form['tracking']['role_visibility_settings'] = [ - '#type' => 'details', - '#title' => $this->t('Roles'), - '#group' => 'tracking_scope', - ]; - - $form['tracking']['role_visibility_settings']['matomo_visibility_user_role_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('Add tracking for specific roles'), - '#options' => [ - $this->t('Add to the selected roles only'), - $this->t('Add to every role except the selected ones'), - ], - '#default_value' => $config->get('visibility.user_role_mode'), - ]; - $form['tracking']['role_visibility_settings']['matomo_visibility_user_role_roles'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Roles'), - '#default_value' => !empty($visibility_user_role_roles) ? $visibility_user_role_roles : [], - '#options' => array_map('\Drupal\Component\Utility\Html::escape', user_role_names()), - '#description' => $this->t('If none of the roles are selected, all users will be tracked. If a user has any of the roles checked, that user will be tracked (or excluded, depending on the setting above).'), - ]; - - // Standard tracking configurations. - $visibility_user_account_mode = $config->get('visibility.user_account_mode'); - - $form['tracking']['user_visibility_settings'] = [ - '#type' => 'details', - '#title' => $this->t('Users'), - '#group' => 'tracking_scope', - ]; - $t_permission = ['%permission' => $this->t('Opt-in or out of tracking')]; - $form['tracking']['user_visibility_settings']['matomo_visibility_user_account_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('Allow users to customize tracking on their account page'), - '#options' => [ - 0 => $this->t('No customization allowed'), - 1 => $this->t('Tracking on by default, users with %permission permission can opt out', $t_permission), - 2 => $this->t('Tracking off by default, users with %permission permission can opt in', $t_permission), - ], - '#default_value' => !empty($visibility_user_account_mode) ? $visibility_user_account_mode : 0, - ]; - $form['tracking']['user_visibility_settings']['matomo_trackuserid'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track User ID'), - '#default_value' => $config->get('track.userid'), - '#description' => $this->t('User ID enables the analysis of groups of sessions, across devices, using a unique, persistent, and non-personally identifiable ID string representing a user. Learn more about the benefits of using User ID.', [':url' => 'https://matomo.org/docs/user-id/']), - ]; - - // Link specific configurations. - $form['tracking']['linktracking'] = [ - '#type' => 'details', - '#title' => $this->t('Links and downloads'), - '#group' => 'tracking_scope', - ]; - $form['tracking']['linktracking']['matomo_trackmailto'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track clicks on mailto links'), - '#default_value' => $config->get('track.mailto'), - ]; - $form['tracking']['linktracking']['matomo_trackfiles'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track clicks on outbound links and downloads (clicks on file links) for the following extensions'), - '#default_value' => $config->get('track.files'), - ]; - $form['tracking']['linktracking']['matomo_trackfiles_extensions'] = [ - '#title' => $this->t('List of download file extensions'), - '#title_display' => 'invisible', - '#type' => 'textfield', - '#default_value' => $config->get('track.files_extensions'), - '#description' => $this->t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: @extensions', ['@extensions' => MatomoInterface::MATOMO_TRACKFILES_EXTENSIONS]), - '#maxlength' => 500, - '#states' => [ - 'enabled' => [ - ':input[name="matomo_trackfiles"]' => ['checked' => TRUE], - ], - // Note: Form required marker is not visible as title is invisible. - 'required' => [ - ':input[name="matomo_trackfiles"]' => ['checked' => TRUE], - ], - ], - ]; - - $colorbox_dependencies = '
'; - $colorbox_dependencies .= $this->t('Requires: @module-list', ['@module-list' => ($this->moduleHandler->moduleExists('colorbox') ? $this->t('@module (enabled)', ['@module' => 'Colorbox']) : $this->t('@module (disabled)', ['@module' => 'Colorbox']))]); - $colorbox_dependencies .= '
'; - - $form['tracking']['linktracking']['matomo_trackcolorbox'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track content in colorbox modal dialogs'), - '#description' => $this->t('Enable to track the content shown in colorbox modal windows.') . $colorbox_dependencies, - '#default_value' => $config->get('track.colorbox'), - '#disabled' => ($this->moduleHandler->moduleExists('colorbox') ? FALSE : TRUE), - ]; - - // Message specific configurations. - $form['tracking']['messagetracking'] = [ - '#type' => 'details', - '#title' => $this->t('Messages'), - '#group' => 'tracking_scope', - ]; - $track_messages = $config->get('track.messages'); - $form['tracking']['messagetracking']['matomo_trackmessages'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Track messages of type'), - '#default_value' => !empty($track_messages) ? $track_messages : [], - '#description' => $this->t('This will track the selected message types shown to users. Tracking of form validation errors may help you identifying usability issues in your site. Every message is tracked as one individual event. Messages from excluded pages cannot be tracked.'), - '#options' => [ - 'status' => $this->t('Status message'), - 'warning' => $this->t('Warning message'), - 'error' => $this->t('Error message'), - ], - ]; - - $form['tracking']['search'] = [ - '#type' => 'details', - '#title' => $this->t('Search'), - '#group' => 'tracking_scope', - ]; - - $site_search_dependencies = '
'; - $site_search_dependencies .= $this->t('Requires: @module-list', ['@module-list' => ($this->moduleHandler->moduleExists('search') ? $this->t('@module (enabled)', ['@module' => 'Search']) : $this->t('@module (disabled)', ['@module' => 'Search']))]); - $site_search_dependencies .= '
'; - - $form['tracking']['search']['matomo_site_search'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track internal search'), - '#description' => $this->t('If checked, internal search keywords are tracked.') . $site_search_dependencies, - '#default_value' => $config->get('track.site_search'), - '#disabled' => ($this->moduleHandler->moduleExists('search') ? FALSE : TRUE), - ]; - - // Privacy specific configurations. - $form['tracking']['privacy'] = [ - '#type' => 'details', - '#title' => $this->t('Privacy'), - '#group' => 'tracking_scope', - ]; - $form['tracking']['privacy']['matomo_privacy_donottrack'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Universal web tracking opt-out'), - '#description' => $this->t('If enabled and your Matomo server receives the Do-Not-Track header from the client browser, the Matomo server will not track the user. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision.', [':donottrack' => 'https://www.eff.org/issues/do-not-track']), - '#default_value' => $config->get('privacy.donottrack'), - ]; - - // Matomo page title tree view settings. - $form['page_title_hierarchy'] = [ - '#type' => 'details', - '#title' => $this->t('Page titles hierarchy'), - '#description' => $this->t('This functionality enables a dynamically expandable tree view of your site page titles in your Matomo statistics. See in Matomo statistics under Actions > Page titles.'), - '#group' => 'tracking_scope', - ]; - $form['page_title_hierarchy']['matomo_page_title_hierarchy'] = [ - '#type' => 'checkbox', - '#title' => $this->t("Show page titles as hierarchy like breadcrumbs"), - '#description' => $this->t('By default Matomo tracks the current page title and shows you a flat list of the most popular titles. This enables a breadcrumbs like tree view.'), - '#default_value' => $config->get('page_title_hierarchy'), - ]; - $form['page_title_hierarchy']['matomo_page_title_hierarchy_exclude_home'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Hide home page from hierarchy'), - '#description' => $this->t('If enabled, the "Home" item will be removed from the hierarchy to flatten the structure in the Matomo statistics. Hits to the home page will still be counted, but for other pages the hierarchy will start at level Home+1.'), - '#default_value' => $config->get('page_title_hierarchy_exclude_home'), - ]; - - // Custom variables. - $form['matomo_custom_var'] = [ - '#description' => $this->t('You can add Matomos Custom Variables here. These will be added to every page that Matomo tracking code appears on. Custom variable names and values are limited to 200 characters in length. Keep the names and values as short as possible and expect long values to get trimmed. You may use tokens in custom variable names and values. Global and user tokens are always available; on node pages, node tokens are also available.', [':custom_var_documentation' => 'https://matomo.org/docs/custom-variables/']), - '#title' => $this->t('Custom variables'), - '#tree' => TRUE, - '#type' => 'details', - ]; - - $form['matomo_custom_var']['slots'] = [ - '#type' => 'table', - '#header' => [ - ['data' => $this->t('Slot')], - ['data' => $this->t('Name')], - ['data' => $this->t('Value')], - ['data' => $this->t('Scope')], - ], - ]; - - $matomo_custom_vars = $config->get('custom.variable'); - - // Matomo supports up to 5 custom variables. - for ($i = 1; $i < 6; $i++) { - $form['matomo_custom_var']['slots'][$i]['slot'] = [ - '#default_value' => $i, - '#description' => $this->t('Slot number'), - '#disabled' => TRUE, - '#size' => 1, - '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'textfield', - ]; - $form['matomo_custom_var']['slots'][$i]['name'] = [ - '#default_value' => isset($matomo_custom_vars[$i]['name']) ? $matomo_custom_vars[$i]['name'] : '', - '#description' => $this->t('The custom variable name.'), - '#maxlength' => 100, - '#size' => 20, - '#title' => $this->t('Custom variable name #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'textfield', - ]; - $form['matomo_custom_var']['slots'][$i]['value'] = [ - '#default_value' => isset($matomo_custom_vars[$i]['value']) ? $matomo_custom_vars[$i]['value'] : '', - '#description' => $this->t('The custom variable value.'), - '#maxlength' => 255, - '#title' => $this->t('Custom variable value #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'textfield', - '#element_validate' => [[get_class($this), 'tokenElementValidate']], - '#token_types' => ['node'], - ]; - if ($this->moduleHandler->moduleExists('token')) { - $form['matomo_custom_var']['slots'][$i]['value']['#element_validate'][] = 'token_element_validate'; - } - $form['matomo_custom_var']['slots'][$i]['scope'] = [ - '#default_value' => isset($matomo_custom_vars[$i]['scope']) ? $matomo_custom_vars[$i]['scope'] : '', - '#description' => $this->t('The scope for the custom variable.'), - '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'select', - '#options' => [ - 'visit' => $this->t('Visit'), - 'page' => $this->t('Page'), - ], - ]; - } - - $form['matomo_custom_var']['matomo_custom_var_description'] = [ - '#type' => 'item', - '#description' => $this->t("You can supplement Matomos' basic IP address tracking of visitors by segmenting users based on custom variables. Make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties' websites) with any personally identifying information from any source as part of your use (or such third parties' use) of the Matomo' service."), - ]; - if ($this->moduleHandler->moduleExists('token')) { - $form['matomo_custom_var']['matomo_custom_var_token_tree'] = [ - '#theme' => 'token_tree_link', - '#token_types' => ['node'], - ]; - } - - // Advanced feature configurations. - $form['advanced'] = [ - '#type' => 'details', - '#title' => $this->t('Advanced settings'), - '#open' => FALSE, - ]; - - $form['advanced']['matomo_cache'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Locally cache tracking code file'), - '#description' => $this->t('If checked, the tracking code file is retrieved from your Matomo site and cached locally. It is updated daily to ensure updates to tracking code are reflected in the local copy.'), - '#default_value' => $config->get('cache'), - ]; - - // Allow for tracking of the originating node when viewing translation sets. - if ($this->moduleHandler->moduleExists('content_translation')) { - $form['advanced']['matomo_translation_set'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track translation sets as one unit'), - '#description' => $this->t('When a node is part of a translation set, record statistics for the originating node instead. This allows for a translation set to be treated as a single unit.'), - '#default_value' => $config->get('translation_set'), - ]; - } - - $user_access_add_js_snippets = !$this->currentUser()->hasPermission('add js snippets for matomo'); - $user_access_add_js_snippets_permission_warning = $user_access_add_js_snippets ? ' ' . $this->t('This field has been disabled because you do not have sufficient permissions to edit it.') . '' : ''; - $form['advanced']['codesnippet'] = [ - '#type' => 'details', - '#title' => $this->t('Custom JavaScript code'), - '#open' => TRUE, - '#description' => $this->t('You can add custom Matomo code snippets here. These will be added to every page that Matomo appears on. Do not include the <script> tags, and always end your code with a semicolon (;).', [':snippets' => 'https://matomo.org/docs/javascript-tracking/']), - ]; - $form['advanced']['codesnippet']['matomo_codesnippet_before'] = [ - '#type' => 'textarea', - '#title' => $this->t('Code snippet (before)'), - '#default_value' => $config->get('codesnippet.before'), - '#disabled' => $user_access_add_js_snippets, - '#rows' => 5, - '#description' => $this->t('Code in this textarea will be added before _paq.push(["trackPageView"]).') . $user_access_add_js_snippets_permission_warning, - ]; - $form['advanced']['codesnippet']['matomo_codesnippet_after'] = [ - '#type' => 'textarea', - '#title' => $this->t('Code snippet (after)'), - '#default_value' => $config->get('codesnippet.after'), - '#disabled' => $user_access_add_js_snippets, - '#rows' => 5, - '#description' => $this->t('Code in this textarea will be added after _paq.push(["trackPageView"]). This is useful if you\'d like to track a site in two accounts.') . $user_access_add_js_snippets_permission_warning, - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - // Custom variables validation. - foreach ($form_state->getValue(['matomo_custom_var', 'slots']) as $custom_var) { - $form_state->setValue(['matomo_custom_var', 'slots', $custom_var['slot'], 'name'], trim($custom_var['name'])); - $form_state->setValue(['matomo_custom_var', 'slots', $custom_var['slot'], 'value'], trim($custom_var['value'])); - - // Validate empty names/values. - if (empty($custom_var['name']) && !empty($custom_var['value'])) { - $form_state->setErrorByName("matomo_custom_var][slots][" . $custom_var['slot'] . "][name", $this->t('The custom variable @slot-number requires a Name if a Value has been provided.', ['@slot-number' => $custom_var['slot']])); - } - elseif (!empty($custom_var['name']) && empty($custom_var['value'])) { - $form_state->setErrorByName("matomo_custom_var][slots][" . $custom_var['slot'] . "][value", $this->t('The custom variable @slot-number requires a Value if a Name has been provided.', ['@slot-number' => $custom_var['slot']])); - } - } - $form_state->setValue('matomo_custom_var', $form_state->getValue(['matomo_custom_var', 'slots'])); - - // Trim some text area values. - $form_state->setValue('matomo_site_id', trim($form_state->getValue('matomo_site_id'))); - $form_state->setValue('matomo_visibility_request_path_pages', trim($form_state->getValue('matomo_visibility_request_path_pages'))); - $form_state->setValue('matomo_codesnippet_before', trim($form_state->getValue('matomo_codesnippet_before'))); - $form_state->setValue('matomo_codesnippet_after', trim($form_state->getValue('matomo_codesnippet_after'))); - $form_state->setValue('matomo_visibility_user_role_roles', array_filter($form_state->getValue('matomo_visibility_user_role_roles'))); - $form_state->setValue('matomo_trackmessages', array_filter($form_state->getValue('matomo_trackmessages'))); - - if (!preg_match('/^\d{1,}$/', $form_state->getValue('matomo_site_id'))) { - $form_state->setErrorByName('matomo_site_id', $this->t('A valid Matomo site ID is an integer only.')); - } - - $url = $form_state->getValue('matomo_url_http') . 'piwik.php'; - try { - $result = $this->httpClient->get($url); - if ($result->getStatusCode() != 200 && $form_state->getValue('matomo_url_skiperror') == FALSE) { - $form_state->setErrorByName('matomo_url_http', $this->t('The validation of "@url" failed with error "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $result->getReasonPhrase(), - '@code' => $result->getStatusCode(), - ])); - } - } - catch (RequestException $exception) { - $form_state->setErrorByName('matomo_url_http', $this->t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $exception->getMessage(), - '@code' => $exception->getCode(), - ])); - } - - $matomo_url_https = $form_state->getValue('matomo_url_https'); - if (!empty($matomo_url_https)) { - $url = $matomo_url_https . 'piwik.php'; - try { - $result = $this->httpClient->get($url); - if ($result->getStatusCode() != 200 && $form_state->getValue('matomo_url_skiperror') == FALSE) { - $form_state->setErrorByName('matomo_url_https', $this->t('The validation of "@url" failed with error "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $result->getReasonPhrase(), - '@code' => $result->getStatusCode(), - ])); - } - } - catch (RequestException $exception) { - $form_state->setErrorByName('matomo_url_https', $this->t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $exception->getMessage(), - '@code' => $exception->getCode(), - ])); - } - } - - // Verify that every path is prefixed with a slash, but don't check PHP - // code snippets and do not check for slashes if no paths configured. - if ($form_state->getValue('matomo_visibility_request_path_mode') != 2 && !empty($form_state->getValue('matomo_visibility_request_path_pages'))) { - $pages = preg_split('/(\r\n?|\n)/', $form_state->getValue('matomo_visibility_request_path_pages')); - foreach ($pages as $page) { - if (strpos($page, '/') !== 0 && $page !== '') { - $form_state->setErrorByName('matomo_visibility_request_path_pages', $this->t('Path "@page" not prefixed with slash.', ['@page' => $page])); - // Drupal forms show one error only. - break; - } - } - } - - // Clear obsolete local cache if cache has been disabled. - if ($form_state->isValueEmpty('matomo_cache') && $form['advanced']['matomo_cache']['#default_value']) { - matomo_clear_js_cache(); - } - - // This is for the Newbie's who cannot read a text area description. - if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('matomo_codesnippet_before'))) { - $form_state->setErrorByName('matomo_codesnippet_before', $this->t('Do not include the <script> tags in the javascript code snippets.')); - } - if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('matomo_codesnippet_after'))) { - $form_state->setErrorByName('matomo_codesnippet_after', $this->t('Do not include the <script> tags in the javascript code snippets.')); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('matomo.settings'); - $config - ->set('site_id', $form_state->getValue('matomo_site_id')) - ->set('url_http', $form_state->getValue('matomo_url_http')) - ->set('url_https', $form_state->getValue('matomo_url_https')) - ->set('codesnippet.before', $form_state->getValue('matomo_codesnippet_before')) - ->set('codesnippet.after', $form_state->getValue('matomo_codesnippet_after')) - ->set('custom.variable', $form_state->getValue('matomo_custom_var')) - ->set('domain_mode', $form_state->getValue('matomo_domain_mode')) - ->set('track.files', $form_state->getValue('matomo_trackfiles')) - ->set('track.files_extensions', $form_state->getValue('matomo_trackfiles_extensions')) - ->set('track.colorbox', $form_state->getValue('matomo_trackcolorbox')) - ->set('track.userid', $form_state->getValue('matomo_trackuserid')) - ->set('track.mailto', $form_state->getValue('matomo_trackmailto')) - ->set('track.messages', $form_state->getValue('matomo_trackmessages')) - ->set('track.site_search', $form_state->getValue('matomo_site_search')) - ->set('privacy.donottrack', $form_state->getValue('matomo_privacy_donottrack')) - ->set('cache', $form_state->getValue('matomo_cache')) - ->set('visibility.request_path_mode', $form_state->getValue('matomo_visibility_request_path_mode')) - ->set('visibility.request_path_pages', $form_state->getValue('matomo_visibility_request_path_pages')) - ->set('visibility.user_account_mode', $form_state->getValue('matomo_visibility_user_account_mode')) - ->set('visibility.user_role_mode', $form_state->getValue('matomo_visibility_user_role_mode')) - ->set('visibility.user_role_roles', $form_state->getValue('matomo_visibility_user_role_roles')) - ->save(); - - if ($form_state->hasValue('matomo_translation_set')) { - $config->set('translation_set', $form_state->getValue('matomo_translation_set'))->save(); - } - - parent::submitForm($form, $form_state); - } - - /** - * Validate a form element that should have tokens in it. - * - * For example: - * @code - * $form['my_node_text_element'] = [ - * '#type' => 'textfield', - * '#title' => $this->t('Some text to token-ize that has a node context.'), - * '#default_value' => 'The title of this node is [node:title].', - * '#element_validate' => [[get_class($this), 'tokenElementValidate']], - * ]; - * @endcode - */ - public static function tokenElementValidate(&$element, FormStateInterface $form_state) { - $value = isset($element['#value']) ? $element['#value'] : $element['#default_value']; - - if (!Unicode::strlen($value)) { - // Empty value needs no further validation since the element should depend - // on using the '#required' FAPI property. - return $element; - } - - $tokens = \Drupal::token()->scan($value); - $invalid_tokens = static::getForbiddenTokens($tokens); - if ($invalid_tokens) { - $form_state->setError($element, t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => $element['#title'], '@invalid-tokens' => implode(', ', $invalid_tokens)])); - } - - return $element; - } - - /** - * Get an array of all forbidden tokens. - * - * @param array $value - * An array of token values. - * - * @return array - * A unique array of invalid tokens. - */ - protected static function getForbiddenTokens(array $value) { - $invalid_tokens = []; - $value_tokens = is_string($value) ? \Drupal::token()->scan($value) : $value; - - foreach ($value_tokens as $tokens) { - if (array_filter($tokens, 'static::containsForbiddenToken')) { - $invalid_tokens = array_merge($invalid_tokens, array_values($tokens)); - } - } - - array_unique($invalid_tokens); - return $invalid_tokens; - } - - /** - * Validate if string contains forbidden tokens not allowed by privacy rules. - * - * @param string $token_string - * A string with one or more tokens to be validated. - * - * @return bool - * TRUE if blacklisted token has been found, otherwise FALSE. - */ - protected static function containsForbiddenToken($token_string) { - // List of strings in tokens with personal identifying information not - // allowed for privacy reasons. See section 8.1 of the Google Analytics - // terms of use for more detailed information. - // - // This list can never ever be complete. For this reason it tries to use a - // regex and may kill a few other valid tokens, but it's the only way to - // protect users as much as possible from admins with illegal ideas. - // - // User tokens are not prefixed with colon to catch 'current-user' and - // 'user'. - // - // TODO: If someone have better ideas, share them, please! - $token_blacklist = [ - ':account-name]', - ':author]', - ':author:edit-url]', - ':author:url]', - ':author:path]', - ':current-user]', - ':current-user:original]', - ':display-name]', - ':fid]', - ':mail]', - ':name]', - ':uid]', - ':one-time-login-url]', - ':owner]', - ':owner:cancel-url]', - ':owner:edit-url]', - ':owner:url]', - ':owner:path]', - 'user:cancel-url]', - 'user:edit-url]', - 'user:url]', - 'user:path]', - 'user:picture]', - // addressfield_tokens.module - ':first-name]', - ':last-name]', - ':name-line]', - ':mc-address]', - ':thoroughfare]', - ':premise]', - // realname.module - ':name-raw]', - // token.module - ':ip-address]', - ]; - - return preg_match('/' . implode('|', array_map('preg_quote', $token_blacklist)) . '/i', $token_string); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - // Load the service required to construct this class. - $container->get('config.factory'), - $container->get('current_user'), - $container->get('module_handler'), - $container->get('http_client') - ); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php b/sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php deleted file mode 100644 index db12818d6..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -moduleHandler = $module_handler; - $this->migrationPlugin = $migration_plugin; - - if (isset($configuration['skip_php'])) { - $this->skipPHP = $configuration['skip_php']; - } - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - $migration_configuration = [ - 'migration' => [ - 'd6_user_role', - 'd7_user_role', - ], - ]; - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration) - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - list($old_visibility, $pages) = $value; - - $request_path_pages = ''; - - if ($pages) { - // 2 == BLOCK_VISIBILITY_PHP in Drupal 6 and 7. - if ($old_visibility == 2) { - // If the PHP module is present, migrate the visibility code unaltered. - if ($this->moduleHandler->moduleExists('php')) { - $request_path_pages = $pages; - } - // Skip the row if we're configured to. If not, we don't need to do - // anything else -- the block will simply have no PHP or request_path - // visibility configuration. - elseif ($this->skipPHP) { - throw new MigrateSkipRowException(); - } - } - else { - $paths = preg_split("(\r\n?|\n)", $pages); - foreach ($paths as $key => $path) { - $paths[$key] = $path === '' ? $path : '/' . ltrim($path, '/'); - } - $request_path_pages = implode("\n", $paths); - } - } - - return $request_path_pages; - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php b/sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php deleted file mode 100644 index d26907b46..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php +++ /dev/null @@ -1,87 +0,0 @@ -moduleHandler = $module_handler; - $this->migrationPlugin = $migration_plugin; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - $migration_configuration = [ - 'migration' => [ - 'd6_user_role', - 'd7_user_role', - ], - ]; - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration) - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - list($roles) = $value; - - // Remove role IDs disabled in D6/D7. - $roles = array_filter($roles); - - $user_role_roles = []; - - if ($roles) { - foreach ($roles as $key => $role_id) { - $roles[$key] = $this->migrationPlugin->transform($role_id, $migrate_executable, $row, $destination_property); - } - $user_role_roles = array_combine($roles, $roles); - } - - return $user_role_roles; - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php deleted file mode 100644 index bddf51de6..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php +++ /dev/null @@ -1,222 +0,0 @@ -noSnippetUser = $this->drupalCreateUser($permissions); - $permissions[] = 'add js snippets for matomo'; - $this->admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if configuration is possible. - */ - public function testMatomoConfiguration() { - // Check for setting page's presence. - $this->drupalGet('admin/config/system/matomo'); - $this->assertRaw(t('Matomo site ID'), '[testMatomoConfiguration]: Settings page displayed.'); - - // Check for account code validation. - $edit['matomo_site_id'] = $this->randomMachineName(2); - $edit['matomo_url_http'] = 'http://www.example.com/matomo/'; - $this->drupalPostForm('admin/config/system/matomo', $edit, 'Save configuration'); - $this->assertRaw(t('A valid Matomo site ID is an integer only.'), '[testMatomoConfiguration]: Invalid Matomo site ID number validated.'); - - // Verify that invalid URLs throw a form error. - $edit = []; - $edit['matomo_site_id'] = 1; - $edit['matomo_url_http'] = 'http://www.example.com/matomo/'; - $edit['matomo_url_https'] = 'https://www.example.com/matomo/'; - $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration')); - $this->assertRaw('The validation of "http://www.example.com/matomo/piwik.php" failed with an exception', '[testMatomoConfiguration]: HTTP URL exception shown.'); - $this->assertRaw('The validation of "https://www.example.com/matomo/piwik.php" failed with an exception', '[testMatomoConfiguration]: HTTPS URL exception shown.'); - - // User should have access to code snippets. - $this->assertFieldByName('matomo_codesnippet_before'); - $this->assertFieldByName('matomo_codesnippet_after'); - $this->assertNoFieldByXPath("//textarea[@name='matomo_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is enabled.'); - $this->assertNoFieldByXPath("//textarea[@name='matomo_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is enabled.'); - - // Login as user without JS permissions. - $this->drupalLogin($this->noSnippetUser); - $this->drupalGet('admin/config/system/matomo'); - - // User should *not* have access to snippets, but create fields. - $this->assertFieldByName('matomo_codesnippet_before'); - $this->assertFieldByName('matomo_codesnippet_after'); - $this->assertFieldByXPath("//textarea[@name='matomo_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is disabled.'); - $this->assertFieldByXPath("//textarea[@name='matomo_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is disabled.'); - } - - /** - * Tests if page visibility works. - */ - public function testMatomoPageVisibility() { - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Show tracking on "every page except the listed pages". - $this->config('matomo.settings')->set('visibility.request_path_mode', 0)->save(); - // Disable tracking one "admin*" pages only. - $this->config('matomo.settings')->set('visibility.request_path_pages', "/admin\n/admin/*")->save(); - // Enable tracking only for authenticated users only. - $this->config('matomo.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw('/matomo/js/matomo.js', '[testMatomoPageVisibility]: Custom tracking script is is displayed for authenticated users.'); - $this->assertRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is displayed for authenticated users.'); - - // Test whether tracking code is not included on pages to omit. - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is not displayed on admin page.'); - $this->drupalGet('admin/config/system/matomo'); - // Checking for tracking URI here, as $site_id is displayed in the form. - $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is not displayed on admin subpage.'); - - // Test whether tracking code display is properly flipped. - $this->config('matomo.settings')->set('visibility.request_path_mode', 1)->save(); - $this->drupalGet('admin'); - $this->assertRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is displayed on admin page.'); - $this->drupalGet('admin/config/system/matomo'); - // Checking for tracking URI here, as $site_id is displayed in the form. - $this->assertRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is displayed on admin subpage.'); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is NOT displayed on front page.'); - - // Test whether tracking code is not display for anonymous. - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is NOT displayed for anonymous.'); - - // Switch back to every page except the listed pages. - $this->config('matomo.settings')->set('visibility.request_path_mode', 0)->save(); - // Enable tracking code for all user roles. - $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save(); - - // Test whether 403 forbidden tracking code is shown if user has no access. - $this->drupalGet('admin'); - $this->assertRaw('"403/URL = "', '[testMatomoPageVisibility]: 403 Forbidden tracking code shown if user has no access.'); - - // Test whether 404 not found tracking code is shown on non-existent pages. - $this->drupalGet($this->randomMachineName(64)); - $this->assertRaw('"404/URL = "', '[testMatomoPageVisibility]: 404 Not Found tracking code shown on non-existent page.'); - } - - /** - * Tests if tracking code is properly added to the page. - */ - public function testMatomoTrackingCode() { - $site_id = '2'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Show tracking code on every page except the listed pages. - $this->config('matomo.settings')->set('visibility.request_path_mode', 0)->save(); - // Enable tracking code for all user roles. - $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save(); - - /* Sample JS code as added to page: - - */ - - // Test whether tracking code uses latest JS. - $this->config('matomo.settings')->set('cache', 0)->save(); - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoTrackingCode]: Latest tracking code used.'); - - // Test if tracking of User ID is enabled. - $this->config('matomo.settings')->set('track.userid', 1)->save(); - $this->drupalGet(''); - $this->assertRaw('_paq.push(["setUserId", ', '[testMatomoTrackingCode]: Tracking code for User ID is enabled.'); - - // Test if tracking of User ID is disabled. - $this->config('matomo.settings')->set('track.userid', 0)->save(); - $this->drupalGet(''); - $this->assertNoRaw('_paq.push(["setUserId", ', '[testMatomoTrackingCode]: Tracking code for User ID is disabled.'); - - // Test whether single domain tracking is active. - $this->drupalGet(''); - $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testMatomoTrackingCode]: Single domain tracking is active.'); - - // Enable "One domain with multiple subdomains". - $this->config('matomo.settings')->set('domain_mode', 1)->save(); - $this->drupalGet(''); - - // Test may run on localhost, an ipaddress or real domain name. - // TODO: Workaround to run tests successfully. This feature cannot tested - // reliable. - global $cookie_domain; - if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { - $this->assertRaw('_paq.push(["setCookieDomain"', '[testMatomoTrackingCode]: One domain with multiple subdomains is active on real host.'); - } - else { - // Special cases, Localhost and IP addresses don't show 'setCookieDomain'. - $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testMatomoTrackingCode]: One domain with multiple subdomains may be active on localhost (test result is not reliable).'); - } - - // Test whether the BEFORE and AFTER code is added to the tracker. - $this->config('matomo.settings')->set('codesnippet.before', '_paq.push(["setLinkTrackingTimer", 250]);')->save(); - $this->config('matomo.settings')->set('codesnippet.after', '_paq.push(["t2.setSiteId", 2]);if(1 == 1 && 2 < 3 && 2 > 1){console.log("Matomo: Custom condition works.");}_gaq.push(["t2.trackPageView"]);')->save(); - $this->drupalGet(''); - $this->assertRaw('setLinkTrackingTimer', '[testMatomoTrackingCode]: Before codesnippet has been found with "setLinkTrackingTimer" set.'); - $this->assertRaw('t2.trackPageView', '[testMatomoTrackingCode]: After codesnippet with "t2" tracker has been found.'); - $this->assertRaw('if(1 == 1 && 2 < 3 && 2 > 1){console.log("Matomo: Custom condition works.");}', '[testMatomoTrackingCode]: JavaScript code is not HTML escaped.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php deleted file mode 100644 index f3e08520a..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php +++ /dev/null @@ -1,59 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if user password page urls are overridden. - */ - public function testMatomoUserPasswordPage() { - $base_path = base_path(); - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - $this->drupalGet('user/password', ['query' => ['name' => 'foo']]); - $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);'); - - $this->drupalGet('user/password', ['query' => ['name' => 'foo@example.com']]); - $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);'); - - $this->drupalGet('user/password'); - $this->assertNoRaw('_paq.push(["setCustomUrl", "', '[testMatomoCustomUrls]: Custom url not set.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php deleted file mode 100644 index ad1d33e02..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php +++ /dev/null @@ -1,133 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if custom variables are properly added to the page. - */ - public function testMatomoCustomVariables() { - $site_id = '3'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Basic test if the feature works. - $custom_vars = [ - 1 => [ - 'slot' => 1, - 'name' => 'Foo 1', - 'value' => 'Bar 1', - 'scope' => 'visit', - ], - 2 => [ - 'slot' => 2, - 'name' => 'Foo 2', - 'value' => 'Bar 2', - 'scope' => 'page', - ], - 3 => [ - 'slot' => 3, - 'name' => 'Foo 3', - 'value' => 'Bar 3', - 'scope' => 'page', - ], - 4 => [ - 'slot' => 4, - 'name' => 'Foo 4', - 'value' => 'Bar 4', - 'scope' => 'visit', - ], - 5 => [ - 'slot' => 5, - 'name' => 'Foo 5', - 'value' => 'Bar 5', - 'scope' => 'visit', - ], - ]; - $this->config('matomo.settings')->set('custom.variable', $custom_vars)->save(); - $this->drupalGet(''); - - foreach ($custom_vars as $slot) { - $this->assertRaw('_paq.push(["setCustomVariable", ' . Json::encode($slot['slot']) . ', ' . Json::encode($slot['name']) . ', ' . Json::encode($slot['value']) . ', ' . Json::encode($slot['scope']) . ']);', '[testMatomoCustomVariables]: setCustomVariable ' . $slot['slot'] . ' is shown.'); - } - - // Test whether tokens are replaced in custom variable names. - $site_slogan = $this->randomMachineName(16); - $this->config('system.site')->set('slogan', $site_slogan)->save(); - - $custom_vars = [ - 1 => [ - 'slot' => 1, - 'name' => 'Name: [site:slogan]', - 'value' => 'Value: [site:slogan]', - 'scope' => 'visit', - ], - 2 => [ - 'slot' => 2, - 'name' => '', - 'value' => $this->randomMachineName(16), - 'scope' => 'page', - ], - 3 => [ - 'slot' => 3, - 'name' => $this->randomMachineName(16), - 'value' => '', - 'scope' => 'visit', - ], - 4 => [ - 'slot' => 4, - 'name' => '', - 'value' => '', - 'scope' => 'page', - ], - 5 => [ - 'slot' => 5, - 'name' => '', - 'value' => '', - 'scope' => 'visit', - ], - ]; - $this->config('matomo.settings')->set('custom.variable', $custom_vars)->save(); - $this->verbose('
' . print_r($custom_vars, TRUE) . '
'); - - $this->drupalGet(''); - $this->assertRaw('_paq.push(["setCustomVariable", 1, ' . Json::encode("Name: $site_slogan") . ', ' . Json::encode("Value: $site_slogan") . ', "visit"]', '[testMatomoCustomVariables]: Tokens have been replaced in custom variable.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 2,', '[testMatomoCustomVariables]: Value with empty name is not shown.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 3,', '[testMatomoCustomVariables]: Name with empty value is not shown.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 4,', '[testMatomoCustomVariables]: Empty name and value is not shown.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 5,', '[testMatomoCustomVariables]: Empty name and value is not shown.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php deleted file mode 100644 index 47a43412d..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php +++ /dev/null @@ -1,107 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions_admin_user); - - // Administrator who cannot configure tracking visibility with PHP. - $permissions_delegated_admin_user = [ - 'access administration pages', - 'administer matomo', - ]; - $this->delegated_admin_user = $this->drupalCreateUser($permissions_delegated_admin_user); - } - - /** - * Tests if PHP module integration works. - */ - public function testMatomoPhpFilter() { - $site_id = '1'; - $this->drupalLogin($this->admin_user); - - $edit = []; - $edit['matomo_site_id'] = $site_id; - $edit['matomo_url_http'] = 'http://www.example.com/matomo/'; - $edit['matomo_url_https'] = 'https://www.example.com/matomo/'; - // Skip url check errors in automated tests. - $edit['matomo_url_skiperror'] = TRUE; - $edit['matomo_visibility_request_path_mode'] = 2; - $edit['matomo_visibility_request_path_pages'] = ''; - $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration')); - - // Compare saved setting with posted setting. - $matomo_visibility_request_path_pages = \Drupal::config('matomo.settings')->get('visibility.request_path_pages'); - $this->assertEqual('', $matomo_visibility_request_path_pages, '[testMatomoPhpFilter]: PHP code snippet is intact.'); - - // Check tracking code visibility. - $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save(); - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoPhpFilter]: Tracking is displayed on frontpage page.'); - $this->drupalGet('admin'); - $this->assertRaw('u+"piwik.php"', '[testMatomoPhpFilter]: Tracking is displayed on admin page.'); - - $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save(); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoPhpFilter]: Tracking is not displayed on frontpage page.'); - - // Test administration form. - $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save(); - $this->drupalGet('admin/config/system/matomo'); - $this->assertRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testMatomoPhpFilter]: Permission to administer PHP for tracking visibility.'); - $this->assertRaw(Html::escape(''), '[testMatomoPhpFilter]: PHP code snippted is displayed.'); - - // Login the delegated user and check if fields are visible. - $this->drupalLogin($this->delegated_admin_user); - $this->drupalGet('admin/config/system/matomo'); - $this->assertNoRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testMatomoPhpFilter]: No permission to administer PHP for tracking visibility.'); - $this->assertRaw(Html::escape(''), '[testMatomoPhpFilter]: No permission to view PHP code snippted.'); - - // Set a different value and verify that this is still the same after the - // post. - $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save(); - - $edit = []; - $edit['matomo_site_id'] = $site_id; - $edit['matomo_url_http'] = 'http://www.example.com/matomo/'; - $edit['matomo_url_https'] = 'https://www.example.com/matomo/'; - // Required for testing only. - $edit['matomo_url_skiperror'] = TRUE; - $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration')); - - // Compare saved setting with posted setting. - $matomo_visibility_request_path_mode = $this->config('matomo.settings')->get('visibility.request_path_mode'); - $matomo_visibility_request_path_pages = $this->config('matomo.settings')->get('visibility.request_path_pages'); - $this->assertEqual(2, $matomo_visibility_request_path_mode, '[testMatomoPhpFilter]: Pages on which this PHP code returns TRUE is selected.'); - $this->assertEqual('', $matomo_visibility_request_path_pages, '[testMatomoPhpFilter]: PHP code snippet is intact.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php deleted file mode 100644 index 92c01bb9f..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php +++ /dev/null @@ -1,107 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if roles based tracking works. - */ - public function testMatomoRolesTracking() { - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Test if the default settings are working as expected. - // Add to the selected roles only. - $this->config('matomo.settings')->set('visibility.user_role_mode', 0)->save(); - // Enable tracking for all users. - $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed for anonymous users on frontpage with default settings.'); - $this->drupalGet('admin'); - $this->assertRaw('"403/URL = "', '[testMatomoRoleVisibility]: 403 Forbidden tracking code is displayed for anonymous users in admin section with default settings.'); - - $this->drupalLogin($this->admin_user); - - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed for authenticated users on frontpage with default settings.'); - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed for authenticated users in admin section with default settings.'); - - // Test if the non-default settings are working as expected. - // Enable tracking only for authenticated users. - $this->config('matomo.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save(); - - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed for authenticated users only on frontpage.'); - - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed for anonymous users on frontpage.'); - - // Add to every role except the selected ones. - $this->config('matomo.settings')->set('visibility.user_role_mode', 1)->save(); - // Enable tracking for all users. - $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is added to every role and displayed for anonymous users.'); - $this->drupalGet('admin'); - $this->assertRaw('"403/URL = "', '[testMatomoRoleVisibility]: 403 Forbidden tracking code is shown for anonymous users if every role except the selected ones is selected.'); - - $this->drupalLogin($this->admin_user); - - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is added to every role and displayed on frontpage for authenticated users.'); - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is added to every role and NOT displayed in admin section for authenticated users.'); - - // Disable tracking for authenticated users. - $this->config('matomo.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save(); - - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed on frontpage for excluded authenticated users.'); - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed in admin section for excluded authenticated users.'); - - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed on frontpage for included anonymous users.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php deleted file mode 100644 index 72c18358b..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php +++ /dev/null @@ -1,97 +0,0 @@ -drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - - $permissions = [ - 'access administration pages', - 'administer matomo', - 'search content', - 'create page content', - 'edit own page content', - ]; - - // User to set up matomo. - $this->admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if search tracking is properly added to the page. - */ - public function testMatomoSearchTracking() { - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw($site_id, '[testMatomoSearch]: Tracking code is displayed for authenticated users.'); - - $this->drupalGet('search/node'); - $this->assertNoRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search tracker not added to page.'); - - // Enable site search support. - $this->config('matomo.settings')->set('track.site_search', 1)->save(); - - // Search for random string. - $search = []; - $search['keys'] = $this->randomMachineName(8); - - // Create a node to search for. - $edit = []; - $edit['title[0][value]'] = 'This is a test title'; - $edit['body[0][value]'] = 'This test content contains ' . $search['keys'] . ' string.'; - - // Fire a search, it's expected to get 0 results. - $this->drupalPostForm('search/node', $search, t('Search')); - $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search results tracker is displayed.'); - $this->assertRaw('window.matomo_search_results = 0;', '[testMatomoSearch]: Search yielded no results.'); - - // Save the node. - $this->drupalPostForm('node/add/page', $edit, t('Save')); - $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.'); - - // Index the node or it cannot found. - $this->cronRun(); - - $this->drupalPostForm('search/node', $search, t('Search')); - $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search results tracker is displayed.'); - $this->assertRaw('window.matomo_search_results = 1;', '[testMatomoSearch]: One search result found.'); - - $this->drupalPostForm('node/add/page', $edit, t('Save')); - $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.'); - - // Index the node or it cannot found. - $this->cronRun(); - - $this->drupalPostForm('search/node', $search, t('Search')); - $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search results tracker is displayed.'); - $this->assertRaw('window.matomo_search_results = 2;', '[testMatomoSearch]: Two search results found.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php deleted file mode 100644 index 2d4f0aa02..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php +++ /dev/null @@ -1,73 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if status messages tracking is properly added to the page. - */ - public function testMatomoStatusMessages() { - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Enable logging of errors only. - $this->config('matomo.settings')->set('track.messages', ['error' => 'error'])->save(); - - $this->drupalPostForm('user/login', [], t('Log in')); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Username field is required."]);', '[testMatomoStatusMessages]: trackEvent "Username field is required." is shown.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Password field is required."]);', '[testMatomoStatusMessages]: trackEvent "Password field is required." is shown.'); - - // Testing this Drupal::messenger() requires an extra test module. - $this->drupalGet('matomo-test/drupal-messenger-add-message'); - $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testMatomoStatusMessages]: Example status message is not enabled for tracking.'); - $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testMatomoStatusMessages]: Example warning message is not enabled for tracking.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testMatomoStatusMessages]: Example error message is shown.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testMatomoStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.'); - - // Enable logging of status, warnings and errors. - $this->config('matomo.settings')->set('track.messages', [ - 'status' => 'status', - 'warning' => 'warning', - 'error' => 'error', - ])->save(); - - $this->drupalGet('matomo-test/drupal-messenger-add-message'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testMatomoStatusMessages]: Example status message is enabled for tracking.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testMatomoStatusMessages]: Example warning message is enabled for tracking.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testMatomoStatusMessages]: Example error message is shown.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testMatomoStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php deleted file mode 100644 index 2807e9649..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php +++ /dev/null @@ -1,78 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if the module cleans up the disk on uninstall. - */ - public function testMatomoUninstall() { - $cache_path = 'public://matomo'; - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Enable local caching of piwik.js. - $this->config('matomo.settings')->set('cache', 1)->save(); - - // Load front page to get the piwik.js downloaded into local cache. But - // loading the piwik.js is not possible as "url_http" is a test dummy only. - // Create a dummy file to complete the rest of the tests. - file_prepare_directory($cache_path, FILE_CREATE_DIRECTORY); - $data = $this->randomMachineName(128); - $file_destination = $cache_path . '/piwik.js'; - file_unmanaged_save_data($data, $file_destination); - file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE); - - // Test if the directory and piwik.js exists. - $this->assertTrue(file_prepare_directory($cache_path), 'Cache directory "public://matomo" has been found.'); - $this->assertTrue(file_exists($cache_path . '/piwik.js'), 'Cached piwik.js tracking file has been found.'); - $this->assertTrue(file_exists($cache_path . '/piwik.js.gz'), 'Cached piwik.js.gz tracking file has been found.'); - - // Uninstall the module. - $edit = []; - $edit['uninstall[matomo]'] = TRUE; - $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); - $this->assertNoText(\Drupal::translation()->translate('Configuration deletions'), 'No configuration deletions listed on the module install confirmation page.'); - $this->drupalPostForm(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); - - // Test if the directory and all files have been removed. - $this->assertFalse(file_scan_directory($cache_path, '/.*/'), 'Cached JavaScript files have been removed.'); - $this->assertFalse(file_prepare_directory($cache_path), 'Cache directory "public://matomo" has been removed.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php deleted file mode 100644 index e56b3cda1..000000000 --- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php +++ /dev/null @@ -1,73 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if "allow users to customize tracking on their account page" works. - */ - public function testMatomoUserFields() { - $site_id = '1'; - $this->config('matomo.settings')->set('site_id', $site_id)->save(); - $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save(); - $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save(); - - // Check if the pseudo field is shown on account forms. - $this->drupalGet('admin/config/people/accounts/form-display'); - $this->assertResponse(200); - $this->assertRaw(t('Matomo settings'), '[testMatomoUserFields]: Matomo settings field exists on Manage form display.'); - - // No customization allowed. - $this->config('matomo.settings')->set('visibility.user_account_mode', 0)->save(); - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - $this->assertResponse(200); - $this->assertNoRaw(t('Matomo settings'), '[testMatomoUserFields]: Matomo settings field does not exist on user edit page.'); - - // Tracking on by default, users with opt-in or out of matomo tracking permission - // can opt out. - $this->config('matomo.settings')->set('visibility.user_account_mode', 1)->save(); - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - $this->assertResponse(200); - $this->assertRaw(t('Users are tracked by default, but you are able to opt out.'), '[testMatomoUserFields]: Matomo settings field exists on on user edit page'); - - // Tracking off by default, users with opt-in or out of matomo tracking permission - // can opt in. - $this->config('matomo.settings')->set('visibility.user_account_mode', 2)->save(); - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - $this->assertResponse(200); - $this->assertRaw(t('Users are not tracked by default, but you are able to opt in.'), '[testMatomoUserFields]: Matomo settings field exists on on user edit page.'); - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml b/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml deleted file mode 100644 index 77399b4bd..000000000 --- a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Matomo test' -type: module -description: 'Support module for Matomo testing.' -package: Testing -# core: 8.x - -# Information added by Drupal.org packaging script on 2019-02-08 -version: '8.x-1.9' -core: '8.x' -project: 'matomo' -datestamp: 1549615102 diff --git a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml b/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml deleted file mode 100644 index ad1fcf645..000000000 --- a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -matomo_test.drupal_messenger_add_message: - path: '/matomo-test/drupal-messenger-add-message' - defaults: - _title: 'Add messages with Drupal::messenger()' - _controller: '\Drupal\matomo_test\Controller\MatomoTestController::drupalAddMessageTest' - requirements: - _access: 'TRUE' diff --git a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php b/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php deleted file mode 100644 index a37b78342..000000000 --- a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php +++ /dev/null @@ -1,28 +0,0 @@ -messenger()->addMessage($this->t('Example status message.'), 'status'); - $this->messenger()->addMessage($this->t('Example warning message.'), 'warning'); - $this->messenger()->addMessage($this->t('Example error message.'), 'error'); - $this->messenger()->addMessage($this->t('Example error message with html tags and link.'), 'error'); - - return []; - } - -} diff --git a/sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php b/sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php deleted file mode 100644 index af155f120..000000000 --- a/sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php +++ /dev/null @@ -1,103 +0,0 @@ -adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - } - - /** - * Tests the fields that allow to configure tracking of specific pages. - * - * @param string $pages - * A list of pages that should be tracked. One page per line. - * @param bool $validation_error_expected - * TRUE if a validation error should be thrown. FALSE otherwise. - * - * @dataProvider pageTrackingProvider - */ - public function testPageTracking($pages, $validation_error_expected) { - $edit = [ - 'matomo_visibility_request_path_mode' => 0, - 'matomo_visibility_request_path_pages' => $pages, - ]; - $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration')); - $has_validation_error = (bool) $this->getSession()->getPage()->find('css', '#edit-matomo-visibility-request-path-pages.error'); - $this->assertEquals($validation_error_expected, $has_validation_error); - } - - /** - * Provides test data for ::testPageTracking(). - * - * @return array - * An array of test cases, each test case is an array with two values: - * 0. A string containing a list of pages to track. - * 1. A boolean indicating whether or not a validation error is expected to - * be thrown. - */ - public function pageTrackingProvider() { - return [ - [ - // No validation error should be thrown for an empty page list. - '', - FALSE, - ], - [ - // No validation error should be thrown for a list of valid pages. - << -TXT - , - FALSE, - ], - [ - // A validation error should be thrown if one of the pages doesn't start - // with a slash. - << -TXT - , - TRUE, - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt b/sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt b/sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt deleted file mode 100644 index e757cbbd1..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt +++ /dev/null @@ -1,14 +0,0 @@ - -MENU ADMIN PER MENU -http://drupal.org/project/menu_admin_per_menu - -DESCRIPTION -By default, Drupal 7 allows only users with "Administer menus and menu items" to add, modify or delete menu items. -In case you want for instance to let certain users manage Main menu or Navigation menu but not Management menu, this module provides this functionality. - -INSTALLATION -Please read instructions at: http://drupal.org/project/menu_admin_per_menu - -CONTACT -Henri MEDOT -http://www.absyx.fr diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php deleted file mode 100644 index f6a96f978..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php +++ /dev/null @@ -1,42 +0,0 @@ -id()) { - $perm_menus['administer custom-menu menu items'] = 'custom-menu'; - } -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml deleted file mode 100644 index a3edbaa5a..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Menu Admin per Menu -type: module -description: Allows to give roles per menu admin permissions without giving them full administer menu permission. -package: Administration -# core: 8.x -dependencies: - - menu_ui - -# Information added by Drupal.org packaging script on 2017-10-05 -version: '8.x-1.0' -core: '8.x' -project: 'menu_admin_per_menu' -datestamp: 1507184951 diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install deleted file mode 100644 index 5ffe8a702..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install +++ /dev/null @@ -1,14 +0,0 @@ -getFormObject(); - if ($form_object instanceof MenuLinkEditForm - || $form_object instanceof MenuLinkContentForm) { - $account = \Drupal::currentUser(); - if (!$account->hasPermission('administer menu')) { - $options = $form['menu_parent']['#options']; - $form['menu_parent']['#options'] = menu_admin_per_menu_filter_parent_options($account, $options); - } - } - if ($form_object instanceof MenuForm) { - $account = \Drupal::currentUser(); - if (!$account->hasPermission('administer menu')) { - $form['id']['#access'] = FALSE; - $form['label']['#access'] = FALSE; - $form['description']['#access'] = FALSE; - $form['langcode']['#access'] = FALSE; - } - } -} - -/** - * Implements hook_form_BASE_FORM_ID_alter() for node_form. - */ -function menu_admin_per_menu_form_node_form_alter(&$form, FormStateInterface $form_state) { - $account = \Drupal::currentUser(); - if (!$account->hasPermission('administer menu')) { - /** @var \Drupal\menu_admin_per_menu\MenuAdminPerMenuAccessInterface $allowedMenusService */ - $allowedMenusService = \Drupal::service('menu_admin_per_menu.allowed_menus'); - $allowed_menus = $allowedMenusService->getPerMenuPermissions($account); - - $default_value = &$form['menu']['link']['menu_parent']['#default_value']; - list($current_menu, ) = explode(':', $default_value, 2); - // Disallow editing the menu item if there is a pre-existing menu item - // belonging to a menu the user does not have permission to access. - if (!empty($current_menu) && !in_array($current_menu, $allowed_menus)) { - $form['menu']['#access'] = FALSE; - return; - } - - $options = &$form['menu']['link']['menu_parent']['#options']; - $options = menu_admin_per_menu_filter_parent_options($account, $options ? $options : []); - $form['menu']['#access'] = count($options) > 0; - } -} - -/** - * Removes menu items for menus a user does not have permission to access. - * - * @param \Drupal\Core\Session\AccountInterface - * The user to check for access. - * @param array $options - * An array of menu item labels keyed by menu item ID. - * - * @return array - * Filtered menu item labels keyed by menu item ID. - */ -function menu_admin_per_menu_filter_parent_options(AccountInterface $account, array $options) { - /** @var \Drupal\menu_admin_per_menu\MenuAdminPerMenuAccessInterface $allowedMenusService */ - $allowedMenusService = \Drupal::service('menu_admin_per_menu.allowed_menus'); - $allowed_menus = $allowedMenusService->getPerMenuPermissions($account); - - foreach ($options as $key => $option) { - list($menu, ) = explode(':', $key, 2); - if (!in_array($menu, $allowed_menus)) { - unset($options[$key]); - } - } - - return $options; -} - -/** - * Implements hook_ENTITY_TYPE_access() for entity type "menu_link_content". - */ -function menu_admin_per_menu_menu_link_content_access(EntityInterface $entity, $operation, AccountInterface $account) { - /** @var \Drupal\menu_admin_per_menu\MenuAdminPerMenuAccessInterface $allowedMenusService */ - $allowedMenusService = \Drupal::service('menu_admin_per_menu.allowed_menus'); - return $allowedMenusService->menuItemAccess($account, $entity); -} diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml deleted file mode 100644 index abc56f298..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -permission_callbacks: - - \Drupal\menu_admin_per_menu\MenuAdminPerMenuPermissions::permissions diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml deleted file mode 100644 index 9cfed907b..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - menu_admin_per_menu.route_subscriber: - class: Drupal\menu_admin_per_menu\Routing\RouteSubscriber - tags: - - { name: event_subscriber } - menu_admin_per_menu.allowed_menus: - class: Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php deleted file mode 100644 index c5f3f366c..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php +++ /dev/null @@ -1,91 +0,0 @@ - $title) { - $permission = 'administer ' . $name . ' menu items'; - if ($account->hasPermission($permission)) { - $perms_menu[$permission] = $name; - } - } - \Drupal::moduleHandler()->alter('menu_admin_per_menu_get_permissions', $perms_menu, $account); - } - - - return $perms_menu; - } - - /** - * {@inheritdoc} - */ - public function menusOverviewAccess(AccountInterface $account) { - if ($account->hasPermission('administer menu')) { - return AccessResult::allowed(); - } - $permissions = $this::getPerMenuPermissions($account); - if ($account->hasPermission('administer menu') || $permissions) { - return AccessResult::allowed(); - } - return AccessResult::neutral(); - } - - /** - * {@inheritdoc} - */ - public function menuAccess(AccountInterface $account, Menu $menu) { - $permission = 'administer ' . $menu->get('id') . ' menu items'; - $permissions = $this::getPerMenuPermissions($account); - if ($account->hasPermission('administer menu') - || isset($permissions[$permission])) { - return AccessResult::allowed(); - } - return AccessResult::neutral(); - } - - /** - * {@inheritdoc} - */ - public function menuItemAccess(AccountInterface $account, MenuLinkContent $menu_link_content = NULL) { - $permission = 'administer ' . $menu_link_content->getMenuName() . ' menu items'; - $permissions = $this::getPerMenuPermissions($account); - if ($account->hasPermission('administer menu') - || isset($permissions[$permission])) { - return AccessResult::allowed(); - } - return AccessResult::neutral(); - } - - /** - * {@inheritdoc} - */ - public function menuLinkAccess(AccountInterface $account, MenuLinkInterface $menu_link_plugin = NULL) { - $permission = 'administer ' . $menu_link_plugin->getMenuName() . ' menu items'; - $permissions = $this::getPerMenuPermissions($account); - if ($account->hasPermission('administer menu') - || isset($permissions[$permission])) { - return AccessResult::allowed(); - } - return AccessResult::neutral(); - } - -} diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php deleted file mode 100644 index 233ccfb58..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php +++ /dev/null @@ -1,67 +0,0 @@ -allowedMenusService = $allowed_menus; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('menu_admin_per_menu.allowed_menus') - ); - } - - /** - * Constructs menus overview page. - */ - public function menuOverviewPage() { - $account = $this->currentUser(); - $menu_table = $this->entityTypeManager()->getListBuilder('menu')->render(); - if ($account->hasPermission('administer menu')) { - return $menu_table; - } - $allowed_menus = $this->allowedMenusService->getPerMenuPermissions($account); - foreach ($menu_table['table']['#rows'] as $menu_key => $menu_item) { - if (!isset($allowed_menus["administer $menu_key menu items"])) { - unset($menu_table['table']['#rows'][$menu_key]); - } - else { - $menu_row = &$menu_table['table']['#rows'][$menu_key]; - $menu_operations = &$menu_row['operations']['data']['#links']; - $menu_operations['list']['title'] = $this->t('List links'); - $menu_operations['list']['url'] = Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_key]); - $menu_operations['add']['title'] = $this->t('Add link'); - $menu_operations['add']['url'] = Url::fromRoute('entity.menu.add_link_form', ['menu' => $menu_key]); - } - } - return $menu_table; - } - -} diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php deleted file mode 100644 index 3deab4574..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php +++ /dev/null @@ -1,76 +0,0 @@ -getExistingMenus(); - foreach ($menus as $name => $title) { - $permission = 'administer ' . $name . ' menu items'; - $permissions[$permission] = [ - 'title' => $this->t('Administer @menu menu items', ['@menu' => $title]), - ]; - } - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php deleted file mode 100644 index 958ac0f25..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php +++ /dev/null @@ -1,58 +0,0 @@ -all(); - foreach ($routes as $route_name => $route) { - switch ($route_name) { - case 'entity.menu.collection': - $route->setDefaults(['_controller' => '\Drupal\menu_admin_per_menu\Controller\MenuAdminPerMenuController::menuOverviewPage']); - $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menusOverviewAccess']); - break; - - case 'entity.menu.edit_form': - case 'entity.menu.add_link_form': - $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuAccess']); - break; - - case 'menu_ui.link_edit': - case 'menu_ui.link_reset': - $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuLinkAccess']); - break; - - case 'entity.menu_link_content.canonical': - case 'entity.menu_link_content.delete_form': - case 'entity.menu_link_content.content_translation_overview': - case 'entity.menu_link_content.content_translation_add': - case 'entity.menu_link_content.content_translation_edit': - case 'entity.menu_link_content.content_translation_delete': - $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuItemAccess']); - break; - - } - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - // Run after content_translation, which has priority -210. - $events[RoutingEvents::ALTER] = ['onAlterRoutes', -220]; - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php deleted file mode 100644 index 5786ec3e5..000000000 --- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php +++ /dev/null @@ -1,116 +0,0 @@ -profile != 'standard') { - $this->drupalCreateContentType([ - 'type' => 'page', - 'name' => 'Basic page', - 'display_submitted' => FALSE, - ]); - } - - $this->drupalPlaceBlock('system_menu_block:main'); - - $this->contentOnlyUser = $this->drupalCreateUser([ - 'access content', - 'administer content types', - ]); - $this->contentAndMenuUser = $this->drupalCreateUser([ - 'access content', - 'administer content types', - 'administer main menu items', - ]); - $this->anonymousUser = $this->drupalCreateUser([ - 'access content', - ]); - } - - /** - * Test menu re-save by users without permission. - * - * Tests that a menu still exists and remains existing if a user without the - * menu permissions resaves a node. - */ - public function testResaveMenuLinkWithoutAccess() { - $menu_link_title = $this->randomString(); - - // Save the node with the menu. - $this->drupalLogin($this->contentAndMenuUser); - $edit = [ - 'title[0][value]' => $this->randomString(), - 'body[0][value]' => $this->randomString(), - 'menu[enabled]' => 1, - 'menu[title]' => $menu_link_title, - ]; - $this->drupalPostForm('node/add/page', $edit, t('Save')); - - // Ensure the menu is in place. - $this->assertLink($menu_link_title); - - // Logout. - $this->drupalLogout(); - - // Save the node again as someone without permission. - $this->drupalLogin($this->contentOnlyUser); - $edit = [ - 'title[0][value]' => $this->randomString(), - 'body[0][value]' => $this->randomString(), - ]; - $this->drupalPostForm('node/add/page', $edit, t('Save')); - - // Ensure the menu is still in place. - $this->assertLink($menu_link_title); - - // Ensure anonymous users with "access content" permission can see this - // menu. - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertLink($menu_link_title); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/.codeclimate.yml b/sites/all/modules/contrib/admin/metatag/.codeclimate.yml deleted file mode 100644 index e8b0bd077..000000000 --- a/sites/all/modules/contrib/admin/metatag/.codeclimate.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -engines: - csslint: - enabled: true - duplication: - enabled: true - config: - languages: - - javascript - - php - eslint: - enabled: true - fixme: - enabled: true - phpmd: - enabled: true -ratings: - paths: - - "**.css" - - "**.inc" - - "**.install" - - "**.js" - - "**.module" - - "**.php" - - "**.test" diff --git a/sites/all/modules/contrib/admin/metatag/.csslintrc b/sites/all/modules/contrib/admin/metatag/.csslintrc deleted file mode 100644 index aacba956e..000000000 --- a/sites/all/modules/contrib/admin/metatag/.csslintrc +++ /dev/null @@ -1,2 +0,0 @@ ---exclude-exts=.min.css ---ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes diff --git a/sites/all/modules/contrib/admin/metatag/.eslintignore b/sites/all/modules/contrib/admin/metatag/.eslintignore deleted file mode 100644 index 96212a359..000000000 --- a/sites/all/modules/contrib/admin/metatag/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/*{.,-}min.js diff --git a/sites/all/modules/contrib/admin/metatag/.eslintrc b/sites/all/modules/contrib/admin/metatag/.eslintrc deleted file mode 100644 index 9faa37508..000000000 --- a/sites/all/modules/contrib/admin/metatag/.eslintrc +++ /dev/null @@ -1,213 +0,0 @@ -ecmaFeatures: - modules: true - jsx: true - -env: - amd: true - browser: true - es6: true - jquery: true - node: true - -# http://eslint.org/docs/rules/ -rules: - # Possible Errors - comma-dangle: [2, never] - no-cond-assign: 2 - no-console: 0 - no-constant-condition: 2 - no-control-regex: 2 - no-debugger: 2 - no-dupe-args: 2 - no-dupe-keys: 2 - no-duplicate-case: 2 - no-empty: 2 - no-empty-character-class: 2 - no-ex-assign: 2 - no-extra-boolean-cast: 2 - no-extra-parens: 0 - no-extra-semi: 2 - no-func-assign: 2 - no-inner-declarations: [2, functions] - no-invalid-regexp: 2 - no-irregular-whitespace: 2 - no-negated-in-lhs: 2 - no-obj-calls: 2 - no-regex-spaces: 2 - no-sparse-arrays: 2 - no-unexpected-multiline: 2 - no-unreachable: 2 - use-isnan: 2 - valid-jsdoc: 0 - valid-typeof: 2 - - # Best Practices - accessor-pairs: 2 - block-scoped-var: 0 - complexity: [2, 6] - consistent-return: 0 - curly: 0 - default-case: 0 - dot-location: 0 - dot-notation: 0 - eqeqeq: 2 - guard-for-in: 2 - no-alert: 2 - no-caller: 2 - no-case-declarations: 2 - no-div-regex: 2 - no-else-return: 0 - no-empty-label: 2 - no-empty-pattern: 2 - no-eq-null: 2 - no-eval: 2 - no-extend-native: 2 - no-extra-bind: 2 - no-fallthrough: 2 - no-floating-decimal: 0 - no-implicit-coercion: 0 - no-implied-eval: 2 - no-invalid-this: 0 - no-iterator: 2 - no-labels: 0 - no-lone-blocks: 2 - no-loop-func: 2 - no-magic-number: 0 - no-multi-spaces: 0 - no-multi-str: 0 - no-native-reassign: 2 - no-new-func: 2 - no-new-wrappers: 2 - no-new: 2 - no-octal-escape: 2 - no-octal: 2 - no-proto: 2 - no-redeclare: 2 - no-return-assign: 2 - no-script-url: 2 - no-self-compare: 2 - no-sequences: 0 - no-throw-literal: 0 - no-unused-expressions: 2 - no-useless-call: 2 - no-useless-concat: 2 - no-void: 2 - no-warning-comments: 0 - no-with: 2 - radix: 2 - vars-on-top: 0 - wrap-iife: 2 - yoda: 0 - - # Strict - strict: 0 - - # Variables - init-declarations: 0 - no-catch-shadow: 2 - no-delete-var: 2 - no-label-var: 2 - no-shadow-restricted-names: 2 - no-shadow: 0 - no-undef-init: 2 - no-undef: 0 - no-undefined: 0 - no-unused-vars: 0 - no-use-before-define: 0 - - # Node.js and CommonJS - callback-return: 2 - global-require: 2 - handle-callback-err: 2 - no-mixed-requires: 0 - no-new-require: 0 - no-path-concat: 2 - no-process-exit: 2 - no-restricted-modules: 0 - no-sync: 0 - - # Stylistic Issues - array-bracket-spacing: 0 - block-spacing: 0 - brace-style: 0 - camelcase: 0 - comma-spacing: 0 - comma-style: 0 - computed-property-spacing: 0 - consistent-this: 0 - eol-last: 0 - func-names: 0 - func-style: 0 - id-length: 0 - id-match: 0 - indent: 0 - jsx-quotes: 0 - key-spacing: 0 - linebreak-style: 0 - lines-around-comment: 0 - max-depth: 0 - max-len: 0 - max-nested-callbacks: 0 - max-params: 0 - max-statements: [2, 30] - new-cap: 0 - new-parens: 0 - newline-after-var: 0 - no-array-constructor: 0 - no-bitwise: 0 - no-continue: 0 - no-inline-comments: 0 - no-lonely-if: 0 - no-mixed-spaces-and-tabs: 0 - no-multiple-empty-lines: 0 - no-negated-condition: 0 - no-nested-ternary: 0 - no-new-object: 0 - no-plusplus: 0 - no-restricted-syntax: 0 - no-spaced-func: 0 - no-ternary: 0 - no-trailing-spaces: 0 - no-underscore-dangle: 0 - no-unneeded-ternary: 0 - object-curly-spacing: 0 - one-var: 0 - operator-assignment: 0 - operator-linebreak: 0 - padded-blocks: 0 - quote-props: 0 - quotes: 0 - require-jsdoc: 0 - semi-spacing: 0 - semi: 0 - sort-vars: 0 - space-after-keywords: 0 - space-before-blocks: 0 - space-before-function-paren: 0 - space-before-keywords: 0 - space-in-parens: 0 - space-infix-ops: 0 - space-return-throw-case: 0 - space-unary-ops: 0 - spaced-comment: 0 - wrap-regex: 0 - - # ECMAScript 6 - arrow-body-style: 0 - arrow-parens: 0 - arrow-spacing: 0 - constructor-super: 0 - generator-star-spacing: 0 - no-arrow-condition: 0 - no-class-assign: 0 - no-const-assign: 0 - no-dupe-class-members: 0 - no-this-before-super: 0 - no-var: 0 - object-shorthand: 0 - prefer-arrow-callback: 0 - prefer-const: 0 - prefer-reflect: 0 - prefer-spread: 0 - prefer-template: 0 - require-yield: 0 diff --git a/sites/all/modules/contrib/admin/metatag/CHANGELOG.txt b/sites/all/modules/contrib/admin/metatag/CHANGELOG.txt deleted file mode 100644 index 8955618d3..000000000 --- a/sites/all/modules/contrib/admin/metatag/CHANGELOG.txt +++ /dev/null @@ -1,518 +0,0 @@ -Metatag 8.x-1.8, 2019-02-20 ---------------------------- -By samuel.mortenson, Berdir, DamienMcKenna: Fix data property definition. - - -Metatag 8.x-1.7, 2018-08-31 ---------------------------- -#2994979 by DamienMcKenna, dspachos, ynotpeanutbutter, oxy86, IT-Cru, kdeds, - zenimagine: Fixed backwards compatibility break when support for multiple- - value tags was added. -#2990923 by th_tushar, DamienMcKenna: Fixed coding standards. - - -Metatag 8.x-1.6, 2018-08-21 ---------------------------- -#2961777 by thejimbirch, Baysaa: "Geographical position" (geo.position) should - use semi-colon instead of comma. -#2964626 by idebr: og:image:secure_url allows for multiple values. -#2865267 by DamienMcKenna, okonvicka, aldibier: tags empty after - installing Metatag. -#2962426 by dragonwize: Image URL double encoded. -#2973277 by mvantuch, DamienMcKenna: Support for og:image:alt. -#2977002 by DamienMcKenna, maxoid: Enable testing on the two og product meta - tags. -#2977545 by pmelab, bappa.sarkar, DamienMcKenna: GraphQL throws an error due to - Metatag's use of a custom data structure. -#2925714 by acbramley, vakulrai, Berdir, nkoporec: Replace deprecated - BaseFieldDefinition ::setQueryable. -#2957411 by pmelab: Field item empty check on empty arrays. -#2958743 by DamienMcKenna, AdamEvertsson, StepanISK, trong.nguyen.tcec, - chiefme, quixxel, rjg, CProfessionals: Ignore update.php requests when - loading entities; error message when updating from 8.x-1.0 to 8.x-1.5. -#2961918 by thejimbirch, Michelle: Add the site.webmanifest meta tag. -#2895577 by plopesc, drupallogic: Error loading - /admin/config/search/metatag?page=1. -#2943954 by thejimbirch, DamienMcKenna: Document an approach to simplify - overriding meta tags on a per-entity basis. -#2968902 by DamienMcKenna, Berdir: Default user page title token should use - [user:display-name]. -#2977197 by justin., DamienMcKenna: Allow modules to override the entity used - for token replacements. -#2691313 by KarenS, carstenG, DamienMcKenna, Michelle, marysmech: New option to - control which meta tag groups are used on each form. -#2563657 by plopesc, scotthooker, dawehner, ryanissamson, KevinVb, dobrzyns, - PieterDC, peter.keppert, piggito, DamienMcKenna, Grayle, kunal.kursija, - Citizen Dan, al0a, kaushashah, yohanaraujo07@gmail.com, markandrewsutton, - fuzzyjared, igalafate, PascoS, rybchynski: Panels / Page Manager - integration. -#2989295 by JKerschner: Coding style improvements. -#2987852 by Chris Burge: Allow meta tags to be altered before page attachment. -#2989543 by JKerschner: Remove unused variables and imports. -#2753595 by sinn, thejimbirch: W3C validation error on xmlns attribute. -#2988072 by juanolalla: Allow contex entity to be overriden in alter hook. -#2628934 by nikunjkotecha, smaz, e.escribano, idebr, DamienMcKenna, - ZapevalovAnton, caspervoogt: Full support for meta tags that allow multiple - values. -#2987904 by thejimbirch: Remove groups redundantly stored in the main module. -#2987107 by ziomizar: Add support for bubbeable metadata in the MetatagToken - service. -#2978106 by Rolf van de Krol: Translated metatags not showing in normalized - entity representations (i.e. REST). -#2799861 by kalpaitch, DamienMcKenna, dmitry.yankouski, ckaotik: Canonical links - repeated when using Panels pages. -#2532596 by alzz, DamienMcKenna, thejimbirch: Add new meta tag: google. - - -Metatag 8.x-1.5, 2018-03-29 ---------------------------- -#2932596 by yo30, Punk_UnDeaD: Wrong method in abstract class LinkSizesBase. -#2933940 by DamienMcKenna: og:image must be at least 200x200 otherwise it is - ignored by Facebook. -#2936371 by gaurav.kapoor: Unused variable in metatag defaults class revert - function. -#2923080 by DamienMcKenna, pingwin4eg, pazhyn: Undefined offset: 1 in - metatag_mobile_page_attachments_alter. -#2930037 by smurrayatwork, rbayliss, moshe weitzman: Missing ampersand with - drupal_static causes multiple calls to metatag_get_tags_from_route(). -#2899234 by DamienMcKenna, JeffM2001, twang, heddn, edurenye, ShaunDychko: - Missing dependency (drupal:serialization) / Fatal error: Class NormalizerBase - not found. -#2945799 by DamienMcKenna, webfaqtory: Undefined variable: tag_id in - MetatagManager->sortedGroupsWithTags(). -#2953313 by DamienMcKenna: Add a function for getting the meta tags in a human - readable format - metatag_generate_entity_metatags(). -#2953635 by DamienMcKenna: MetatagStringTest has the wrong @group. -#2937683 by prafullsranjan, DamienMcKenna: Further improve module's coding - standards compliance. -#2939608 by alberto56: Invalid argument supplied for foreach() in - MetatagNormalizer. -#2936876 by bonus, DamienMcKenna: Add support for Pinterest meta namespace. -#2938025 by DamienMcKenna, Oliver Eyton-Williams: Incorrect rel attribute on - hreflang tags. -#2954214 by DamienMcKenna: composer.json improvements. -#2908119 by LEalex, DamienMcKenna, jeffam, BenStallings: Set "link" HTTP header - for canonical URL and shortlink tags. -#2954169 by yasmeensalah, DamienMcKenna: Translations of description meta tags - shouldn't be limited to 128 characters. -#2897450 by edurenye: Add product:price:amount and product:price:currency OG - tags. -#2922581 by roborew: Metatag causes error when used with Replication Modules to - deploy content. -#2947493 by DamienMcKenna, kala4ek: Adding forms of custom entities are broken. -#2828607 by pingevt, DamienMcKenna: Add OG book meta tags. -#2954522 by DamienMcKenna: Correct spelling of "meta tags". -#2809351 by DamienMcKenna, thejimbirch: Add the advanced Dublin Core meta tags. -#2956199 by DamienMcKenna: Remove separate admin pages for Views integration. -#2956227 by DamienMcKenna: Test improvements from 2883718-20. -#2900368 by plopesc: Don't allow certain defaults to be removed. -#2840751 by ocastle, ElegguaDP, Wim Leers, keopx, adamzimmermann: - Protocol-relative URLs are broken. -#2925974 by keopx, ocastle, DamienMcKenna, Wim Leers, mangy.fox: Twitter Cards - (and others) require absolute URLs. - - -Metatag 8.x-1.4, 2017-12-21 ---------------------------- -#2882769 by DamienMcKenna: Added a hook_requirements() message about the - Schema.org Metatag module. -#2864079 by DamienMcKenna: Resolve coding standards violations. -#2928394 by DamienMcKenna, mattlt: Error: Trait metatag_views\ - MetatagViewsValuesCleanerTrait not found. -#2932110 by thejimbirch: Update Description's meta description to 320 chars - (for 2018). -#2932285 by DamienMcKenna, Sophie.SK: After updating Redirect to 1.0, config - import fails: route does not exist. -#2932316 by DamienMcKenna, Sophie.SK: Error on main defaults page if no config - objects exist. -#2932361 by DamienMcKenna: Improve coding standards on Metatag 8.x-1.x. -#2930001 by Aurif3x, DamienMcKenna: New meta tag: Set-Cookie. -#2810635 by DamienMcKenna: Automatically add hreflang meta tags for each enabled - language. - - -Metatag 8.x-1.3, 2017-09-29 ---------------------------- -#2898975 by DamienMcKenna: Correct restui entry in composer.json. -#2899045 by DamienMcKenna: Fixed problems in MetatagNodeTranslationTest. -#2899234 by DamienMcKenna: Expand Devel/WebProfiler tests to make sure they work - when a content type and node are present. -#2898805 by DamienMcKenna: Small improvements to the test suite, working - towards fixing the 8.4.x support. -#2898805 by DamienMcKenna: Fixes to MetatagNodeTranslationTest to make it work - with 8.4.x. -By DamienMcKenna: Reenable \Drupal\metatag\Tests\MetatagFrontpageTest:: - testFrontPageMetatagsEnabledConfig(). -#2905925 by DamienMcKenna: The Normalizer shouldn't assume all meta tags have a - 'content' attribute; also support the 'href' attribute. -#2906312 by DamienMcKenna: Added the twitter:dnt meta tag. -#2909390/2894868 by Perignon, StijnStroobants: Small typo in MetatagToken. -#2903661 by DamienMcKenna: Don't output 403/404 page node's meta tags on - 403/404 pages. -#2905769 by DamienMcKenna: Improved defaults for the canonical URL meta tag. -#2899752 by DamienMcKenna, huzooka, deepak_zyxware, samuel.mortenson, wanjee, - giangi.vigazzola: Creating a new field bundle inside - hook_entity_base_field_info_alter() is a bad idea and causes problems. -#2906180 by John Lawter: Incorrect Wikipedia link for Advanced > Geographical - position. -#2859111 by acbramley, DamienMcKenna: Remove the second canonical tag on - taxonomy term pages because of a bug in core. -By DamienMcKenna: Changed codebase to only use short array syntax, fixed some - comments. -#2911435 by DamienMcKenna, AdamPS: Streamline the HTML output logic. -#2860088 by AdamPS, DamienMcKenna: Comma separated list in og:image breaks if - one component is empty. -#2905769 by DamienMcKenna: Added tests for how default meta tags are displayed. -#2872382 by Vlad_Bo, DamienMcKenna: Error if there is no node object (custom - node view implementation). -#2217549 by Alan D., Kuldeep K, DamienMcKenna: Integration with the Diff module. - - -Metatag 8.x-1.2, 2017-07-31 ---------------------------- -#2882954 by DamienMcKenna: Added Devel as a test dependency. -#2882954, #2877737 by DamienMcKenna, René-Marc Simard, a.henry: Fixed - compatibility with WebProfiler, added tests to ensure site still works when it - or Devel is enabled. -#2878158 by DamienMcKenna: Listed Context Metadata as a related module. -#2894566 by StijnStroobants: Make all routes start with a leading slash. -By DamienMcKenna: Use ComposerCat to update composer.json. -By DamienMcKenna: Don't list Drupal core as a dependency in composer.json. -#2636852 by hanoii, DamienMcKenna, Grayside, pcho, skorzh, fjgarlin, vincic: - Make Metatag fields available as JSON. -#2893448 by Sam152: Add correct meta tags to latest-version route to support - content moderation. - - -Metatag 8.x-1.1, 2017-05-31 ---------------------------- -#2852737 by DamienMcKenna: Added CodeClimate config files. -#2853252 by dawehner: Ensure the meta tags are ordered correctly. -#2856454 by dbungard: Improvements to UI text, meta tag descriptions, etc. -#2781485 by kalpaitch: Changed MetatagManager to use the instance name rather - than plugin ID to identify plugin instances. -By DamienMcKenna: Ensure all drupalPostForm() calls are preceeded by a - drupalGet() call, and that all drupalGet() calls have an assertResponse(). -#2858057 by nicrodgers: Wrong default values are displayed in the node form when - adding a translation. -#2855445 by rocket.man: Replace deprecated functions (database functions, - format_string()). -#2851582 by mtodor: Filled out missing attributes on the default configuration. -#2862277 by DamienMcKenna: Fixed filename of the MsapplicationStartUrl plugin. -#2864524 by JamesK: Improve field description for the abstract meta tag. -#2848353 by DamienMcKenna, grisendo: Only output one shortlink tag; extended tag - tests to cover an example entity. -#2706941 by ckaotik, monika.de, DamienMcKenna, mariancalinro, adinac: Allow - translations to be longer than 128 characters for tags which use textarea - fields. -#2868750 by DamienMcKenna: List Metatag Cxense as a related module. -#2563633 by ziomizar, DamienMcKenna, ruloweb: Add all of the Favicon meta tags. -#2853515 by ohthehugemanatee: Add default handling to metatag manager. -#2857544 by fjgarlin: Default values not returned on REST default routes. -#2636852 by Greyside: MetatagToken::replace() options array shouldn't assume the - 'clear' attribute is always needed. -By DamienMcKenna: Allow MetatagJsonOutputTest to run. -#2563633 by ziomizar: Misc fixes for the Favicon meta tags. -#2563647 by delta, tom_ek, DamienMcKenna, monika.de, ckaotik, martins.bertins, - cgmonroe, danquah, blazey, paulmckibben, stijn.blomme, danquah, Alex Bukah, - guarav.goyal, kducharm: Views integration. -#2882769 by DamienMcKenna: List Schema Metatag as a related module. -#2856416 by DamienMcKenna: List Metatag Google Scholar as a related module. -#2848543 by DamienMcKenna: Add missing people to README.txt. - - -Metatag 8.x-1.0, 2017-01-31 ---------------------------- -#2841139 by jmolivas: Relocated commands services registration to - console.services.yml file. -#2844429 by DamienMcKenna: There's only one hreflang meta tag so far and it does - not yet support custom tokens like the D7 version does. -#2844504 by DamienMcKenna: Add project names to all dependencies. -#2563631 by DamienMcKenna: Added all AppLinks meta tags. -#2841737 by DamienMcKenna: Renamed the DrupalConsole commands. -#2838175 by dawehner: Allow supported entity routes to be changed through the - new hook_metatag_route_entity(). -#2825867 by Grayside: Improve support for the Typed Data API. -#2649592 by ziomizar, DamienMcKenna: Write tests to cover apostrophe handling. -By DamienMcKenna: Shortened some verbose variable syntax. -#2835752 by DamienMcKenna: Improved hook_help(). -#2789511 by DamienMcKenna: It is a known issue that all Metatag fields must be - removed prior to uninstalling the module. -#2809915 by nicxvan, DamienMcKenna: Document how to programmatically assign - meta tags when creating entities. -#2563645 by DamienMcKenna, Michelle: Improved documentation. - - -Metatag 8.x-1.0-beta12, 2017-01-03 ----------------------------------- -#2823811 by Michelle: metatag_open_graph_preprocess_html() was misspelled. -#2654148 by penyaskito, DamienMcKenna: Not all entity.*.add paths are tied to a - specific entity form, so don't assume they are; this fixes compatibility with - the Lingotek module, possibly others. -By DamienMcKenna: Fixed a typo in README.txt. -#2824442 by jiff: image_src should be a 'link' tag. -#2821476 by DamienMcKenna, Daniel_Rose: Added tests to confirm entity defaults - inherit properly. -#2836124 by DamienMcKenna: Fixed tests for the Dublin Core meta tags. -#2786625 by DamienMcKenna: Added the hreflang=x-default meta tag. -#2532588 by DamienMcKenna, renatog, cebasqueira: Added the Google CSE meta tags. -#2563631 by DamienMcKenna: Added a placeholder to store the AppLinks meta tags. -#2809351 by DamienMcKenna: Added a placeholder to store the DC Advanced meta - tags. -#2835925 by DamienMcKenna: Added a placeholder to store the OG Products meta - tags. -#2563633 by DamienMcKenna: Added a placeholder to store the favicon meta tags. -#2532588 by DamienMcKenna: Follow-up to fix the group assignment of the Google - CSE meta tags. -#2786625 by DamienMcKenna: Follow-up to fix the group assignment of the hreflang - x-default meta tag. -#2563635 by jlbellido, DamienMcKenna: Ported all of the mobile meta tags to the - new Metatag Mobile submodule. -#2840222 by jmolivas: Update for Drupal Console rc13 namespace changes. - - -Metatag 8.x-1.0-beta11, 2016-10-31 ----------------------------------- -#2786795 by agoradesign, heddn: Temporarily disable the DrupalConsole - integration. -#2709985 by DamienMcKenna: Moved the two FB meta tags into a new submodule, - Metatag Facebook, added the fb_pages meta tag. -#2709985 by DamienMcKenna: Fixed the fb:pages meta tag description. -By DamienMcKenna: Updated the description of content-language to clarify its - usage and the fact that Bing may still use it. -#1865228 by DamienMcKenna: Moved the Author meta tag into the GoolgePlus - submodule. -#2797069 by Internet, DamienMcKenna: Corrected the URL to Wikipedia's ICBM page. -#2801023 by trobey: Provide namespaces in dependencies to avoid ambiguity. -#2563627 by gaurav.goyal, DamienMcKenna, cilefen: Added all of the basic Dublin - Core meta tags. -#2795983 by dbungard: Improved help message on the main configuration page. -#2786795 by -enzo-: Fixed Drupal Console integration; now requires rc1. -#2663974 by dawehmer, DamienMcKenna: Added the og:video meta tags. -#2819549 by chr.fritsch: Fixed entity API changes in metatag_update_8103. -#2817309 by chr.fritsch, DamienMcKenna: Fixed default value handling for all - entity forms. Greatly extended the entity field tests for nodes, terms, users - and the entity_test entity. -#2654148 by bmcclure, DamienMcKenna, miiimooo, JeroenT, agoradesign: Improved - support for all entities, exclude certain core entity types, only support - ContentEntityType entities that have 'links' defined. -#2816553 by andyrigby: Renamed article:tags to be article:tag. -#2796701 by jiff, DamienMcKenna: Added tests to cover XSS via meta tag values. -#2796701 by DamienMcKenna: Added tests to cover XSS on the page title and entity - values. - - -Metatag 8.x-1.0-beta10, 2016-08-22 ----------------------------------- -#2747793 by rajeshwari10, cilefen, DamienMcKenna: Removed the @file docblocks. -#2764163 by chrisfree, markdorison: Allow the 'referrer' meta tag to not have a - value selected. -#2762981 by felribeiro, DamienMcKenna: Changed codebase to only use short array - syntax. -#2753595 by sylus: Moved the extra XML namespaces to the OpenGraph module. -#2765137 by balsama: Don't display the installation message during site install, - it looks funny. -#2759843 by DamienMcKenna: Removed the Alexa verification tag. -#2759855 by DamienMcKenna: Removed the Yahoo verification tag. -#2759917 by Nikhilesh Gupta, cilefen: Remove unused imports / 'use' statements. -#2759927 by Nikhilesh Gupta: Replace deprecated \Drupal::entityManager() - with \Drupal::entityTypeManager(). -#2759919 by Nikhilesh Gupta: Replace deprecated entity->urlInfo() with - entity->toUrl(). -#2755225 by jlbellido: Corrected the 'type' tag generator definition in - tag.php.twig. -#2759931 by Nikhilesh Gupta: Replace deprecated ConfigEntityListBuilder:: - getLabel() with entity->label(). -#2761231 by ashwin.shaharkar: Minor fix to image tag form selection logic. -#2745177 by DamienMcKenna, cilefen: Added tests for each submodule to ensure - they can be enabled and that each meta tag can be used. -#2750705 by susannecoates, jalpesh: Updated description of the Google Play app - ID meta tag. -#2752239 by Saphyel, sylus, DamienMcKenna: Temporary fix for DrupalConsole - integration. -#2775245 by DamienMcKenna: Fix tests. -#2776407 by cilefen: Module names must be wrapped in quotes if they contain - certain characters. -By DamienMcKenna: Renamed the custom routes module. -#2745173 by jibellido: Tag generator now appends metatag_tag.schema.yml. -#2673902 by DamienMcKenna: Confirm that forum posts can be loaded when the - module is enabled and outputting meta tags. -#2707791 by ashwin.shaharkar, DamienMcKenna, Shreya Shetty, MattDanger: Changed - the Description and Abstract meta tags to use a textarea, matching the D7 - branch. -#2780025 by DamienMcKenna: Basic tests for the output of every meta tag. Fixes - the output of all Google Plus tags. Fixed the test route module. -#2746031 by jalpesh, cilefen, DamienMcKenna, susannecoates: Fixed output of all - Twitter Cards meta tags. -#2780109 by DamienMcKenna: Always run drupalGet() before drupalPostForm() to - ensure the form loads correctly. -#2748615 by yannickoo, DamienMcKenna, agentrickard, SteffenR, paulmckibben: Try - generating an empty entity on entity-add (e.g. node/add/*) so default values - can be filled in. -#2775441 by tom_ek, DamienMcKenna: Replace deprecated core entity APIs with the - newer ones. -#2762981 by DamienMcKenna: More codebase changes to only use short array syntax. -#2774807 by DamienMcKenna, Berdir, hussainweb: Token browser showed items that - were irrelevant, and didn't show the correct entities on default config forms. -#2748615 by yannickoo, DamienMcKenna, SteffenR: The default configurations were - not loading properly in entity form fields. -#2752239 by DamienMcKenna: Fixes to Drupal:Console integration. -#1865228 by DamienMcKenna, greggles: Added the Author meta tag. -#2493711 by DamienMcKenna: Added the geographical meta tags. -#1343914 by DamienMcKenna, Dave Reid: Added the (Google+) Publisher meta tag. -By DamienMcKenna: Corrected the changelog comment for #2759927. - - -Metatag 8.x-1.0-beta9, 2016-06-02 ---------------------------------- -#2725895 by DamienMcKenna: Fixed the name of the Validation submodule to avoid - YAML validation errors. Yes, somewhat ironic. -#2725989 by dbt102, DamienMcKenna, neerusrijan: Improve hook_help(). - - -Metatag 8.x-1.0-beta8, 2016-05-14 ---------------------------------- -#2723319 by itmaybejj: Fixed misspelling of 'its'. -#2619450 by paulmckibben: Remove core's Canonical URL tag if Metatag is adding - one. -#2712277 by markdorison: Twitter Card Type meta tag wasn't updating. -#2650408 by Raphael Apard, DamienMcKenna, gaurav.goyal, dpacassi, kyberman: - A node's meta tags should not override the front page defaults unless the - defaults are disabled/deleted. -#2684479 by mikeyk, DamienMcKenna, aspilicious: Added 'secure' option as some - meta tags require HTTPS URLs. -#2699297 by DamienMcKenna: Added tests to ensure submodules can be enabled. -#2663974 by IT-Cru, DamienMcKenna: Added the og 'article' meta tags. -#2650848 by ivanjaros, DamienMcKenna: Only show appropriate entities in the - token browser. -#2705851 by vasi: Load field definitions, not field values, when getting a list - of Metatag fields on an entity. -#2708511 by DamienMcKenna: Added the referrer meta tag. -#2563629 by Jim.M, DamienMcKenna: Added site verification tags. -#2721857 by marvin_B8, DamienMcKenna: Added Google+ meta tags. - - -Metatag 8.x-1.0-beta7, 2016-04-03 ---------------------------------- -#2699173 by DamienMcKenna: Fixed OgUpdatedTime annotations. - - -Metatag 8.x-1.0-beta6, 2016-04-02 ---------------------------------- -#2689543 by kplanz: Fixed paths in image meta tags when the site is in a - subdirectory. -By DamienMcKenna: Added a CODE_OF_CONDUCT.txt file that references the Drupal - code of conduct page. -#2690973 by DamienMcKenna: Added schema.yml values for all meta tags to make - them more easily translatable. -#2688963 by DamienMcKenna: Added a note about the Yoast SEO module. -#2696445 by DuaelFr, Simon Georges, DamienMcKenna: Added the twitter:image:alt - meta tag. -#2692117 by penyaskito, DamienMcKenna: Replaced the 'image' attribute with a - general 'type' attribute. - - -Metatag 8.x-1.0-beta5, 2016-03-11 ---------------------------------- -#2563623/2674732/2675208 by DamienMcKenna, esclapes, NickWilde, achton: Quote - submodule strings to avoid YAML compatibility problems. -#2658242 by mr.baileys: Default meta tags were not translated into the entity's - language. -By DamienMcKenna: Added mr.baileys to the D8 contributors list :) -#2664276 by DamienMcKenna, StevenPatz, rajeev_drupal: Wrong default base class - for generated tag plugins. -#2665790 by benjy, Sam152: Use StringTranslationTrait in MetaNameBase. -#2666384 by mr.baileys, Rudrasis, danisha: Added 'configure' link to the module - on the Extend page. -#2563625 by mr.baileys, juliencarnot: All Twitter Cards have been ported. -#2674078 by Raphael Apard: The Generator meta tag is a META tag, not a LINK tag. -#2664448 by mr.baileys: DrupalConsole generator for meta tag groups. -#2663650 by mr.baileys: Caught another small bug in the tag generator. -#2672892 by borisson_: Replaced usage of LoggerChannelFactory with - LoggerChannelFactoryInterface. -#2678196 by mr.baileys: Simplified usage of isAdminRoute(). -#2631408 by mikeyk, juampynr, DamienMcKenna: Filter out HTML from meta tags and - improve image meta tag handling. -#2631826 by juampynr, DamienMcKenna, pguillard: Require the Token module. -#2667850 by mikeyk: Token method was not renamed properly. -By DamienMcKenna: Fixed group name on MetatagTranslationTest. -#2684495 by mikeyk, DamienMcKenna: Fixed bug in translations that was causing - the tests to fail. Also tidied up the tests a little. -#2685355 by mikeyk: Fix image identification. - - -Metatag 8.x-1.0-beta4, 2016-02-06 ---------------------------------- -#2634844 by swentel: Only load entity meta tags on actual content entity pages. -#2648752 by juampynr: Fixed the token browser integration. -#2642430 by juampynr: Moved settings pages under admin/config. -#2646706 by heykarthikwithu: Removed unused 'use' statements. -#2645338 by Dane Powell: Fixed variable assumptions in MetatagFirehose. -#2643370 by flocondetoile: Fixed hook_block(). -#2631408 by juampynr: Filter HTML from the meta tag output. -#2653512 by DamienMcKenna, ivanjaros: Missing ampersand in drupal_static call. -#2630068 by jaxxed, DamienMcKenna: Moved the meta tags fields into the - 'advanced' section of the entity form. -#2657142 by TravisCarden: Incorrect path in MetatagDefaults annotations. -#2656494 by DamienMcKenna, webflo, cyb.tachyon, alexdmccabe: Added translation - support for the default configs. -#2634844 by mr.baileys: Ensure that the entity system doesn't break entity - pages that don't have meta tags enabled. -#2659854 by mr.baileys: The config inheritance info was displayed when not - needed and was not translatable. -#2624422 by mr.baileys: Added tests to confirm meta tag handling is loaded - correctly when there is no default value available. -#2658902 by swentel, DamienMcKenna: Renamed 'Add Metatag defaults' to something - more easily understood. -#2636348 by DamienMcKenna: Config entity not working correctly after updating - from beta2. -By DamienMcKenna: Note in the README.txt that Token is now required. -#2663874 by mr.baileys: Fixed arguments to annotation translations for two - Google meta tags. -#2663650 by DamienMcKenna: Updated/fixed the DrupalConsole integration. -#2663650 by mr.baileys: Further fixes to the DrupalConsole integration. -#2563623 by DamienMcKenna: Moved OG tags to new submodule, added several more. - - -Metatag 8.x-1.0-beta3, 2015-12-08 ---------------------------------- -#2613654 by Michelle, DamienMcKenna: Automatically parse fields for images. -#2563639 by juampynr, DamienMcKenna: Global configurations system. - - -Metatag 8.x-1.0-beta2, 2015-11-23 ---------------------------------- -#2572469 by Berdir, platinum1, rakesh.gectcr, DamienMcKenna: Fixed the - composer.json file. - - -Metatag 8.x-1.0-beta1, 2015-11-19 ---------------------------------- -Initial port by Damien McKenna and Michelle Cox. -#2563663 by kikoalonsob: Don't convert the title to a string. -#2563621 by jmolivas: Fixed DrupalConsole integration. -#2579865 by afi13: Fixed definition of MetatagEmptyFormatter::viewElements(). -#2563667 by vincic: MetatagManager should only be used for objects implementing - ContentEntityInterface. -#2569043 by Michelle: Field defaults weren't loading (core API change). -#2579295 by Michelle: Fixed the field cardinality limitation. -#2563667 by Michelle: Follow-up to add missing namespace. -#2584835 by DamienMcKenna: Fixed double-HTML encoding of the page title. -#2563637 by larowlan: Added some initial tests for the field type. -#2596753 by Michelle: Don't encode apostrophes in the page title. -#2576695 by Andrej Galuf, larowlan, DamienMcKenna: Double slashes in URLs were - being replaced. -#2603548 by DuaelFr: Clear our the head_title array to avoid the site name being - added a second time. -#2617192 by larowlan: Fixed tests due to a core API change. -#2609138 by rakesh.gectcr: Removed unnecessary 'use' statements. -#2593149 by larowlan: Inject dependencies into MetatagManager. -#2593153 by larowlan: Inject dependencies into MetatagToken. -#2593141 by larowlan: Add a MetatagManagerInterface to avoid type-hinting - concrete implementation. -#2581351 by Michelle, larowlan, DamienMcKenna: Don't save default values to the - field, allow them to inherit from the default field settings. -By DamienMcKenna: Updates to the README.txt file. -#2572469 by rakesh.gectcr, DamienMcKenna, jaxxed, timmillwood: Added a - composer.json file. -By DamienMcKenna: Added a LICENSE.txt to enforce the license on git mirrors. diff --git a/sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt b/sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt deleted file mode 100644 index 587ba66b7..000000000 --- a/sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt +++ /dev/null @@ -1,3 +0,0 @@ -Contributor Code of Conduct ---------------------------- -See: https://www.drupal.org/dcoc diff --git a/sites/all/modules/contrib/admin/metatag/LICENSE.txt b/sites/all/modules/contrib/admin/metatag/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/metatag/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/metatag/README.txt b/sites/all/modules/contrib/admin/metatag/README.txt deleted file mode 100644 index da936bf71..000000000 --- a/sites/all/modules/contrib/admin/metatag/README.txt +++ /dev/null @@ -1,331 +0,0 @@ -Metatag -------- -This module allows a site's builder to automatically provide structured -metadata, aka "meta tags", about the site and individual pages. - -In the context of search engine optimization, providing an extensive set of -meta tags may help improve the site's and pages' rankings, thus may aid with -achieving a more prominent display of the content within search engine results. -They can also be used to tailor how content is displayed when shared on social -networks. - -For additional information, see the online documentation: - https://www.drupal.org/docs/8/modules/metatag - -This version should work with all Drupal 8 releases, though it is always -recommended to keep Drupal core installations up to date. - - -Requirements --------------------------------------------------------------------------------- -Metatag for Drupal 8 requires the following: - -* Token - https://www.drupal.org/project/token - Provides a popup browser to see the available tokens for use in meta tag - fields. - - -Features --------------------------------------------------------------------------------- -The primary features include: - -* An administration interface to manage default meta tags. - -* Use of standard fields for entity support, allowing for translation and - revisioning of meta tag values added for individual entities. - -* A large volume of meta tags available, covering commonly used tags, Open - Graph tags, Twitter Cards tags, Dublin Core tags, Google+ tags, App Links - tags, site verification tags and more; all but the basic meta tags are kept - in separate submodules. - -* The fifteen Dublin Core Basic Element Set 1.1 meta tags may be added by - enabling the "Metatag: Dublin Core" submodule. - -* Forty additional Dublin Core meta tags may be added by enabling the "Metatag: - Dublin Core Advanced" submodule. - -* The Open Graph Protocol meta tags, as used by Facebook, Pinterest, LinkedIn - and other sites, may be added by enabling the "Metatag: Open Graph" submodule. - -* The Twitter Cards meta tags may be added by enabling the "Metatag: Twitter - Cards" submodule. - -* Certain meta tags used by Google+ may be added by enabling the "Metatag: - Google+" submodule. - -* Facebook's fb:app_id, fb:admins and fb:pages meta tags may be added by - enabling the "Metatag: Facebook" submodule. These are useful for sites which - are using Facebook widgets or are building custom integration with Facebook's - APIs, but they are not needed by most sites and have no bearing on the - Open Graph meta tags. - -* The Pinterest meta tags may be added by enabling the "Metatag: Pinterest" - submodule. - -* Site verification meta tags can be added, e.g. as used by the Google search - engine to confirm ownership of the site; see the "Metatag: Verification" - submodule. - -* The Metatag: Mobile & UI Adjustments submodule adds the MobileOptimized, - HandheldFriendly, viewport, cleartype, theme-color, format-detection, - apple-mobile-web-app-capable, apple-mobile-web-app-status-bar-style, the - android-app and ios-app alternative link meta tags, and the Android manifest - tag. - -* The hreflang meta tags are available via the Metatag:hreflang submodule. - -* The App Links meta tags may be added by enabling the Metatag: App Links - submodule. - -* Support for meta tags specific to Google Custom Search Appliance are available - in the "Metatag: Google Custom Search Engine (CSE)" submodule. - -* Meta tags specific to Facebook are included in the "Metatag: Facebook" - submodule. - -* A plugin interface allowing for additional meta tags to be easily added via - custom modules. - -* Integration with DrupalConsole [1] to provide a quick method of generating new - meta tags. - - -Standard usage scenario --------------------------------------------------------------------------------- -1. Install the module. -2. Open admin/config/search/metatag. -3. Adjust global and entity defaults. Fill in reasonable default values for any - of the meta tags that need to be customized. Tokens may be used to - automatically assign values. -4. Additional bundle defaults may be added by clicking on "Add metatag - defaults" and filling out the form. -5. To adjust meta tags for a specific entity, the Metatag field must be added - first. Follow these steps: - - 5.1 Go to the "Manage fields" of the bundle where the Metatag field is to - appear. - 5.2 Select "Meta tags" from the "Add a new field" selector. - 5.3 Fill in a label for the field, e.g. "Meta tags", and set an appropriate - machine name, e.g. "meta_tags". - 5.4 Click the "Save and continue" button. - 5.5 If the site supports multiple languages, and translations have been - enabled for this entity, select "Users may translate this field" to use - Drupal's translation system. - - -Simplify the content administration experience --------------------------------------------------------------------------------- -This module and its submodules gives a site's content team the ability to add -every meta tag ever. The standard meta tag form added by the Metatag field on -content entities can be overwhelming to content creators and editors who just -need to manage a few options. - -The easiest way of simplifying this for content teams is to add new fields to -the content type for the meta data fields that are needed and skip adding the -Metatag field entirely, then use tokens for those fields in the defaults -(/admin/config/search/metatag). These fields can be used in the entity's -display, or just left hidden. - - -Alternative option to simplify the content administration experience --------------------------------------------------------------------------------- -On the settings page (/admin/config/search/metatag/settings) are options to -control which meta tag groups are available for each entity bundle. This allows -e.g. the Favicon meta tags to be available for global configurations but to hide -them on entity forms. - - -Programmatically assign meta tags to an entity --------------------------------------------------------------------------------- -There are two ways to assign an entity's meta tags in custom module. Both -scenarios require a "Metatag" field be added to the entity's field settings, the -field name "field_meta_tags" is used but this is completely arbitrary. - -Option 1: - - $entity_type = 'node'; - $values = [ - 'nid' => NULL, - 'type' => 'article', - 'title' => 'Testing metatag creation', - 'uid' => 1, - 'status' => TRUE, - 'field_meta_tags' => serialize([ - 'title' => 'Some title', - 'description' => 'Some description.', - 'keywords' => 'Some,Keywords', - ]), - ]; - $node = \Drupal::entityTypeManager() - ->getStorage($entity_type) - ->create($values); - $node->save(); - -Option 2: - - $node = Node::create([ - 'type' => article, - 'langcode' => 'en', - 'status' => 1, - 'uid' => 1, - ]); - $node->set('title', 'Testing metatag creation'); - $node->set('field_meta_tags', serialize([ - 'title' => 'Some title', - 'description' => 'Some description.', - 'keywords' => 'Some,Keywords', - ])); - $node->save(); - -In both examples, the custom meta tag values will still be merged with the -values defined via the global defaults prior to being output - it is not -necessary to copy each value to the new record. - - -Obtain meta tags for an entity --------------------------------------------------------------------------------- -For developers needing to access the rendered meta tags for a given entity, a -function is provided to make this easy to do: - - $metatags = metatag_generate_entity_metatags($entity); - -This will return an array with the following structure: - - [ - 'title' => [ - '#tag' => 'meta', - '#attributes' => [ - 'name' => 'title', - 'content' => 'The What | D8.4', - ], - ], - 'canonical_url' => [ - '#tag' => 'link', - '#attributes' => [ - 'rel' => 'canonical', - 'href' => 'http://example.com/what', - ], - ], - 'description' => [ - '#tag' => 'meta', - '#attributes' => [ - 'name' => 'description', - 'content' => 'I can't even.', - ], - ], - 'generator' => [ - '#tag' => 'meta', - '#attributes' => [ - 'name' => 'generator', - 'content' => 'Drupal 8!', - ], - ], - ] - -The meta tags are keyed off the meta tag plugin's ID, e.g. "generator". Each -meta tag is then provided as arguments suitable for use in a render array with -the type "html_tag". Extracting the value of the meta tag will depend upon the -type of meta tag, e.g. the generator meta tag uses the "content" attribute while -the link tag uses the "href" attribute. - - -DrupalConsole integration --------------------------------------------------------------------------------- -Using the DrupalConsole, it is possible to generate new meta tags, either for -use in new custom modules that require custom meta tags, or to create patches -for extending Metatag's options. - -To generate a new tag, install DrupalConsole and then use the following command: - - drupal generate:plugin:metatag:tag - -This will guide the site builder through the necessary steps to create a new -meta tag plugin and add it to a module. - -There is also a command for generating meta tag groups: - - drupal generate:plugin:metatag:group - -Again, this provides a guided process to create a new group. - - -Related modules --------------------------------------------------------------------------------- -Some modules are available that extend Metatag with additional or complimentary -functionality: - -* Schema.org Metatag - https://www.drupal.org/project/schema_metatag - Extensive solution for adding schema.org / JSON-LD support to Metatag. - -* Context Metadata - https://www.drupal.org/project/context_metadata - Allow assignment of meta tags based upon different system contexts, e.g. per - path. - -* Real-time SEO for Drupal - https://www.drupal.org/project/yoast_seo - Uses the YoastSEO.js library and service (https://yoast.com/) to provide - realtime feedback on the meta tags. - -* Metatag Cxense - https://www.drupal.org/project/metatag_cxense - Adds support for the Cxense meta tags used by their DMP and Insight services. - -* Metatag Google Scholar - https://www.drupal.org/project/metatag_google_scholar - Adds support for a number of meta tags used with the Google Scholar system. - - -Known issues --------------------------------------------------------------------------------- -* In order to uninstall the module any "Metatag" fields must first be removed - from all entities. In order to see whether there are fields blocking the - module from being uninstalled, load the module uninstall page - (admin/modules/uninstall) and see if any are listed, it will look something - like the following: - The Meta tags field type is used in the following field: - node.field_meta_tags - In order to uninstall the module, go to the appropriate field settings pages - and remove the Metatag field listed in the message. Once this is done it will - be possible to uninstall the module. - - -Credits / contact --------------------------------------------------------------------------------- -Currently maintained by Damien McKenna [2] and Dave Reid [3]. Drupal 7 module -originally written by Dave Reid. Early work on Drupal 8 port by Damien McKenna -and Michelle Cox [4], and sponsored by Mediacurrent [5]; key improvements by -Juampy Novillo Requena [6] with insights from Dave Reid and sponsorship by -Lullabot [7] and Acquia [8]. Additional contributions to the 8.x-1.0 release -from cilefen [9], Daniel Wehner [10], Jesus Manuel Olivas [11], Lee Rowlands -[12], Michael Kandelaars [13], Ivo Van Geertruyen [14], Nikhilesh Gupta B [15], -Rakesh James [16], and many others. - -Ongoing development is sponsored by Mediacurrent. - -The best way to contact the authors is to submit an issue, be it a support -request, a feature request or a bug report, in the project issue queue: - https://www.drupal.org/project/issues/metatag - - -References --------------------------------------------------------------------------------- -1: https://www.drupal.org/project/console -2: https://www.drupal.org/u/damienmckenna -3: https://www.drupal.org/u/dave-reid -4: https://www.drupal.org/u/michelle -5: https://www.mediacurrent.com/ -6: https://www.drupal.org/u/juampynr -7: https://www.lullabot.com/ -8: https://www.acquia.com/ -9: https://www.drupal.org/u/cilefen -10: https://www.drupal.org/u/dawehner -11: https://www.drupal.org/u/jmolivas -12: https://www.drupal.org/u/larowlan -13: https://www.drupal.org/u/mikeyk -14: https://www.drupal.org/u/mr.baileys -15: https://www.drupal.org/u/nikhilesh-gupta -16: https://www.drupal.org/u/rakeshgectcr diff --git a/sites/all/modules/contrib/admin/metatag/composer.json b/sites/all/modules/contrib/admin/metatag/composer.json deleted file mode 100644 index 0e7921859..000000000 --- a/sites/all/modules/contrib/admin/metatag/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "drupal/metatag", - "description": "Manage meta tags for all entities.", - "type": "drupal-module", - "license": "GPL-2.0+", - "keywords": [ - "Drupal", - "seo" - ], - "homepage": "https://www.drupal.org/project/metatag", - "authors": [ - { - "name": "See contributors", - "homepage": "https://www.drupal.org/node/640498/committers", - "role": "Developer" - } - ], - "support": { - "issues": "http://drupal.org/project/issues/metatag", - "source": "http://cgit.drupalcode.org/metatag" - }, - "require": { - "drupal/token": "^1.0" - }, - "require-dev": { - "drupal/devel": "^1.0", - "drupal/redirect": "^1.0", - "drupal/restui": "^1.0", - "drupal/page_manager": "^4.0", - "drupal/schema_metatag": "^1.0" - } -} diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml deleted file mode 100644 index 3f88243f1..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: '403' -label: '403 access denied' -tags: - canonical_url: '[site:url]' - shortlink: '[site:url]' diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml deleted file mode 100644 index 2e44127e9..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: '404' -label: '404 page not found' -tags: - canonical_url: '[site:url]' - shortlink: '[site:url]' diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml deleted file mode 100644 index 3d928f86f..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: front -label: 'Front page' -tags: - canonical_url: '[site:url]' - shortlink: '[site:url]' diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml deleted file mode 100644 index b0ccb81dd..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: global -label: Global -tags: - canonical_url: '[current-page:url]' - title: '[current-page:title] | [site:name]' diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml deleted file mode 100644 index 5e7841a46..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: node -label: Content -tags: - title: '[node:title] | [site:name]' - description: '[node:summary]' - canonical_url: '[node:url]' diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml deleted file mode 100644 index a562d1fa1..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: taxonomy_term -label: 'Taxonomy term' -tags: - canonical_url: '[term:url]' - description: '[term:description]' - title: '[term:name] | [site:name]' diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml deleted file mode 100644 index 06dfbe3d1..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: user -label: User -tags: - canonical_url: '[user:url]' - description: '[site:name]' - title: '[user:display-name] | [site:name]' diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml deleted file mode 100644 index 4d36bc927..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml +++ /dev/null @@ -1,15 +0,0 @@ -metatag.metatag_defaults.*: - type: config_entity - label: 'Metatag defaults' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Type' - tags: - type: sequence - label: 'Tags' - sequence: - type: metatag.metatag_tag.[%key] diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml deleted file mode 100644 index 19c84e429..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml +++ /dev/null @@ -1,67 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.abstract: - type: text - label: 'Abstract' -metatag.metatag_tag.canonical_url: - type: label - label: 'Canonical URL' -metatag.metatag_tag.content_language: - type: label - label: 'Content Language' -metatag.metatag_tag.description: - type: text - label: 'Description' -metatag.metatag_tag.generator: - type: label - label: 'Generator' -metatag.metatag_tag.image_src: - type: label - label: 'Image SRC' -metatag.metatag_tag.keywords: - type: text - label: 'Keywords' -metatag.metatag_tag.news_keywords: - type: label - label: 'Google News Keywords' -metatag.metatag_tag.original_source: - type: label - label: 'Original source' -metatag.metatag_tag.rights: - type: label - label: 'Rights' -metatag.metatag_tag.referrer: - type: label - label: 'Referrer policy' -metatag.metatag_tag.robots: - type: label - label: 'Robots' -metatag.metatag_tag.shortlink: - type: label - label: 'Shortlink' -metatag.metatag_tag.standout: - type: label - label: 'Standout' -metatag.metatag_tag.title: - type: label - label: 'Page title' -metatag.metatag_tag.icbm: - type: label - label: 'ICBM' -metatag.metatag_tag.geo_region: - type: label - label: 'Geographical region' -metatag.metatag_tag.geo_placename: - type: label - label: 'Geographical place name' -metatag.metatag_tag.geo_position: - type: label - label: 'Geographical position' -metatag.metatag_tag.set_cookie: - type: label - label: 'Set Cookie' -metatag.metatag_tag.google: - type: label - label: 'Google' diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml deleted file mode 100644 index 78c0d71be..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Schema for metatag. -field.value.metatag: - type: mapping - label: 'Default value' - mapping: - value: - type: string - label: 'Metatags' diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml deleted file mode 100644 index e7dd55550..000000000 --- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -metatag.settings: - type: mapping - label: 'Metatag settings' - mapping: - entity_type_groups: - type: mapping - label: 'Metatag groups that apply to each entity type' diff --git a/sites/all/modules/contrib/admin/metatag/console.services.yml b/sites/all/modules/contrib/admin/metatag/console.services.yml deleted file mode 100644 index fd8622d31..000000000 --- a/sites/all/modules/contrib/admin/metatag/console.services.yml +++ /dev/null @@ -1,24 +0,0 @@ -services: - metatag.generate_tag: - class: Drupal\metatag\Command\GenerateTagCommand - arguments: ['@metatag.manager', '@metatag.tag_generator', '@?console.extension_manager', '@?console.string_converter', '@?console.chain_queue'] - tags: - - { name: drupal.command } - - metatag.generate_group: - class: Drupal\metatag\Command\GenerateGroupCommand - arguments: ['@metatag.group_generator', '@?console.extension_manager', '@?console.chain_queue'] - tags: - - { name: drupal.command } - - metatag.tag_generator: - class: Drupal\metatag\Generator\MetatagTagGenerator - arguments: ['@?console.extension_manager', '@?console.renderer'] - tags: - - { name: drupal.generator } - - metatag.group_generator: - class: Drupal\metatag\Generator\MetatagGroupGenerator - arguments: ['@?console.extension_manager', '@?console.renderer'] - tags: - - { name: drupal.generator } diff --git a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml b/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml deleted file mode 100644 index a5c5c6a51..000000000 --- a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml +++ /dev/null @@ -1,17 +0,0 @@ -description: Generate a meta tag group. -help: The <info>generate:plugin:metatag:group</info> command helps generate a new metatag group for use with the Metatag module. -welcome: Welcome to the Metatag group generator -options: - label: The user-friendly name for this meta tag group. - description: A long explanation of this meta tag group. - plugin_id: Internal (machine) name for the meta tag group. - class_name: Internal camel-case version of the meta tag group's name. - weight: The sort order for this meta tag group. -questions: - base_class: Enter the base class to use - class_name: Enter the class name for the meta tag group class - module: common.questions.module - weight: Enter the sort order for the meta tag group - label: Enter the label for the meta tag group - description: Enter a longer explanation of what the meta tag group is and how to use it - plugin_id: Enter the internal (machine) name for the meta tag group plugin diff --git a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml b/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml deleted file mode 100644 index 017c9e929..000000000 --- a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml +++ /dev/null @@ -1,31 +0,0 @@ -description: Generate a meta tag. -help: The <info>generate:plugin:metatag:tag</info> command helps generate a new meta tag for use with the Metatag module. -welcome: Welcome to the Metatag tag generator -options: - base_class: The base meta tag class to use. - module: common.options.module - name: Meta tag's HTML "name". - label: The user-friendly name for this meta tag. - description: A long explanation of this meta tag. - plugin_id: Internal (machine) name for the meta tag. - class_name: Internal camel-case version of the meta tag's name. - group: The meta tag's group. - weight: The sort order for this meta tag. - type: Type of the data included in this meta tag value. - secure: Whether this meta tag requires URLs be secure. - multiple: Whether this meta tag allows multiple values. - absolute_url: Whether this meta tag requires absolute URLs. -questions: - base_class: Enter the base class to use - module: common.questions.module - name: Enter the meta tag's formal name, e.g. for the Open Graph "Title" tag use "og:title" - label: Enter a user-friendly version of the meta tag's name - description: Enter a longer explanation of what the meta tag is and how to use it - plugin_id: Enter the internal (machine) name for the meta tag plugin - class_name: Enter a camel-case version of the meta tag's name - group: Select the group the meta tag will use - weight: Enter the sort order for the meta tag - type: Which value type does this meta tag allow? - secure: Must this meta tag for URLs be secure? - multiple: Does this meta tag will allow multiple values? - absolute_url: Does this meta tag require absolute URLs to work? diff --git a/sites/all/modules/contrib/admin/metatag/metatag.api.php b/sites/all/modules/contrib/admin/metatag/metatag.api.php deleted file mode 100644 index cd2ad01d8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.api.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/** - * @file - * Document all supported APIs. - */ - -/** - * Provides a ability to integrate alternative routes with metatags. - * - * Return an entity when the given route/route parameters matches a certain - * entity. All meta tags will be rendered on that page. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * - * @return \Drupal\Core\Entity\EntityInterface|null - * Return an entity, if the route should use metatags. - */ -function hook_metatag_route_entity(\Drupal\Core\Routing\RouteMatchInterface $route_match) { - if ($route_match->getRouteName() === 'example.test_route') { - if ($node = $route_match->getParameter('node')) { - return $node; - } - } -} - -/** - * Alter the meta tags for pages that are not of content entities. - * - * @param array $metatags - * The special meta tags to be added to the page. - * @param array $context - * The context for the current meta tags being generated. Will contain the - * following: - * 'entity' - The entity being processed; passed by reference. - */ -function hook_metatags_alter(array &$metatags, array &$context) { - // Exclude meta tags on frontpage. - if (\Drupal::service('path.matcher')->isFrontPage()) { - $metatags = NULL; - } -} - -/** - * Alter the meta tags for any page prior to page attachment. - * - * @param array $metatag_attachments - * An array of metatag objects to be attached to the current page. - */ -function hook_metatags_attachments_alter(array &$metatag_attachments) { - if (\Drupal::service('path.matcher')->isFrontPage() && \Drupal::currentUser()->isAnonymous()) { - foreach ($metatag_attachments['#attached']['html_head'] as $id => $attachment) { - if ($attachment[1] == 'title') { - $metatag_attachments['#attached']['html_head'][$id][0]['#attributes']['content'] = 'Front Page Title for Anonymous Users'; - } - } - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag.info.yml b/sites/all/modules/contrib/admin/metatag/metatag.info.yml deleted file mode 100644 index e92edaa59..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.info.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Metatag -type: module -description: Manage meta tags for all entities. -# core: 8.x -package: SEO -configure: entity.metatag_defaults.collection -dependencies: - - drupal:field - - token:token -test_dependencies: - - devel:devel - - redirect:redirect - - restui:restui - - schema_metatag:schema_web_page - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag.install b/sites/all/modules/contrib/admin/metatag/metatag.install deleted file mode 100644 index 2f96a4941..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.install +++ /dev/null @@ -1,376 +0,0 @@ -<?php - -/** - * @file - * Install, update and uninstall functions for the metatag module. - */ - -/** - * Implements hook_install(). - */ -function metatag_install() { - // Don't display the message during site installation, it looks funny. - if (!drupal_installation_attempted()) { - drupal_set_message(t("To adjust global defaults, go to admin/config/search/metatag. If you need to set meta tags for a specific entity, edit its bundle and add the Metatag field.")); - } -} - -/** - * Implements hook_requirements(). - */ -function metatag_requirements($phase) { - $requirements = []; - - if ($phase == 'runtime') { - // Recommend the Schema.org Metatag module. - if (!\Drupal::moduleHandler()->moduleExists('schema_metatag')) { - $requirements['metatag_schema'] = [ - 'severity' => REQUIREMENT_INFO, - 'title' => 'Metatag', - 'value' => t('Schema.org Metatag is recommended'), - 'description' => t('The <a href="@module">Schema.org Metatag</a> module is highly recommended to add <a href="@jsonld">JSON-LD</a> -formatted <a href="@schema">schema.org</a> compatible data structures to the site.', [ - '@module' => 'https://www.drupal.org/project/schema_metatag', - '@jsonld' => 'https://json-ld.org', - '@schema' => 'http://schema.org', - ]), - ]; - } - else { - $requirements['metatag_schema'] = [ - 'severity' => REQUIREMENT_OK, - 'title' => 'Metatag', - 'value' => t('Schema.org Metatag is installed'), - 'description' => t('The <a href="@module">Schema.org Metatag</a> module is installed.', [ - '@module' => 'https://www.drupal.org/project/schema_metatag', - ]), - ]; - } - } - - return $requirements; -} - -/** - * Remove tags in field storage that match default or are empty. - */ -function metatag_update_8101() { - // Get all of the field storage entities of type metatag. - $field_storage_configs = \Drupal::entityTypeManager() - ->getStorage('field_storage_config') - ->loadByProperties(['type' => 'metatag']); - - foreach ($field_storage_configs as $field_storage) { - $field_name = $field_storage->getName(); - - // Get the individual fields (field instances) associated with bundles. - $fields = \Drupal::entityTypeManager() - ->getStorage('field_config') - ->loadByProperties(['field_name' => $field_name]); - - // For each of the fields, delete all records that match the defaults. - foreach ($fields as $field) { - // Get the bundle this field is attached to. - $bundle = $field->getTargetBundle(); - - // Get the default value for this field on this bundle. - $field_default_tags_value = $field->getDefaultValueLiteral(); - $field_default_tags_value = $field_default_tags_value[0]['value']; - - // Determine the table and "value" field names. - $field_table = "node__" . $field_name; - $field_value_field = $field_name . "_value"; - - // Delete all records where the field value and default are identical. - \Drupal::database()->delete($field_table) - ->condition('bundle', $bundle, '=') - ->condition($field_value_field, $field_default_tags_value, '=') - ->execute(); - } - } - - return t('Removed all default meta tag records so they can be automatically inherited when the page is loaded.'); -} - -/** - * Remove tags in field storage that match default or are empty. - */ -function metatag_update_8102(&$sandbox) { - // This whole top section only needs to be done the first time. - if (!isset($sandbox['records_processed'])) { - $sandbox['records_processed'] = 0; - $sandbox['total_records'] = 0; - $sandbox['current_field'] = 0; - $sandbox['current_record'] = 0; - - // Counter to enumerate the fields so we can access them in the array - // by number rather than name. - $field_counter = 0; - - // Get all of the field storage entities of type metatag. - $field_storage_configs = \Drupal::entityTypeManager() - ->getStorage('field_storage_config') - ->loadByProperties(['type' => 'metatag']); - - foreach ($field_storage_configs as $field_storage) { - $field_name = $field_storage->getName(); - - // Get the individual fields (field instances) associated with bundles. - $fields = \Drupal::entityTypeManager() - ->getStorage('field_config') - ->loadByProperties(['field_name' => $field_name]); - - // For each of the fields, do the mass delete of exact matches but - // store the overridden records in the sandbox to be batch processed. - foreach ($fields as $field) { - // Get the bundle this field is attached to. - $bundle = $field->getTargetBundle(); - - // Get the default value for this field on this bundle. - $field_default_tags_value = $field->getDefaultValueLiteral(); - $field_default_tags_value = $field_default_tags_value[0]['value']; - $field_default_tags = unserialize($field_default_tags_value); - - // Determine the table and "value" field names. - $field_table = "node__" . $field_name; - $field_value_field = $field_name . "_value"; - - // Get all records where the field data does not match the default. - $query = \Drupal::database()->select($field_table); - $query->addField($field_table, 'entity_id'); - $query->addField($field_table, 'revision_id'); - $query->addField($field_table, 'langcode'); - $query->addField($field_table, $field_value_field); - $query->condition('bundle', $bundle, '='); - $result = $query->execute(); - $records = $result->fetchAll(); - - // Fill in all the sandbox information so we can batch the individual - // record comparing and updating. - $sandbox['fields'][$field_counter]['field_table'] = $field_table; - $sandbox['fields'][$field_counter]['field_value_field'] = $field_value_field; - $sandbox['fields'][$field_counter]['field_default_tags'] = $field_default_tags; - $sandbox['fields'][$field_counter]['records'] = $records; - - $sandbox['total_records'] += count($sandbox['fields'][$field_counter]['records'] = $records); - $field_counter++; - } - } - } - - if ($sandbox['total_records'] == 0) { - // No partially overridden fields so we can skip the whole batch process. - $sandbox['#finished'] = 1; - } - else { - // Begin the batch processing of individual field records. - $max_per_batch = 10; - $counter = 1; - - $current_field = $sandbox['current_field']; - $current_field_records = $sandbox['fields'][$current_field]['records']; - $current_record = $sandbox['current_record']; - - $field_table = $sandbox['fields'][$current_field]['field_table']; - $field_value_field = $sandbox['fields'][$current_field]['field_value_field']; - $field_default_tags = $sandbox['fields'][$current_field]['field_default_tags']; - - // Loop through the field(s) and remove any field data that matches the - // field default for that bundle. Because the ability to override a default - // with "nothing" didn't exist prior to this and because any tag that had - // a default of "nothing" would have that also in the field data, we are - // removing those as well. - while ($counter <= $max_per_batch && $record = $current_field_records[$current_record]) { - // Strip any empty tags or ones matching the field's defaults and leave - // only the overridden tags in $new_tags. - $current_tags = unserialize($record->$field_value_field); - $new_tags = []; - foreach ($current_tags as $key => $tag) { - if (!empty($tag) && $field_default_tags[$key] != $tag) { - $new_tags[$key] = $tag; - } - } - - if (empty($new_tags)) { - // All tags were either empty or matched the default so the record can - // be deleted. - \Drupal::database()->delete($field_table) - ->condition('entity_id', $record->entity_id) - ->condition('revision_id', $record->revision_id) - ->condition('langcode', $record->langcode) - ->execute(); - } - else { - // There are some overridden tags so update the record with just those. - $tags_string = serialize($new_tags); - \Drupal::database()->update($field_table) - ->fields([ - $field_value_field => $tags_string, - ]) - ->condition('entity_id', $record->entity_id) - ->condition('revision_id', $record->revision_id) - ->condition('langcode', $record->langcode) - ->execute(); - } - - $counter++; - $current_record++; - } - - // We ran out of records for the field so start the next batch out with the - // next field. - if (!isset($current_field_records[$current_record])) { - $current_field++; - $current_record = 0; - } - - // We have finished all the fields. All done. - if (!isset($sandbox['fields'][$current_field])) { - $sandbox['records_processed'] += $counter - 1; - $sandbox['#finished'] = 1; - } - // Update the sandbox values to prepare for the next round. - else { - $sandbox['current_field'] = $current_field; - $sandbox['current_record'] = $current_record; - $sandbox['records_processed'] += $counter - 1; - $sandbox['#finished'] = $sandbox['records_processed'] / $sandbox['total_records']; - } - } - - if ($sandbox['total_records'] > 0) { - return (string) t('Processed @processed of @total overridden Metatag records.', [ - '@processed' => $sandbox['records_processed'], - '@total' => $sandbox['total_records'], - ]); - } - else { - return (string) t("There were no overridden Metatag records."); - } -} - -/** - * Move field defaults to Metatag Defaults. - */ -function metatag_update_8103() { - $config_installer = \Drupal::service('config.installer'); - $entity_manager = \Drupal::entityTypeManager(); - - // 1. Install cofiguration. - $sync_status = $config_installer->isSyncing(); - if ($sync_status) { - $source_storage = $config_installer->getSourceStorage(); - } - - // Clear plugin manager caches. - \Drupal::getContainer()->get('plugin.cache_clearer')->clearCachedDefinitions(); - // Install default configuration of the module. - if ($sync_status) { - $config_installer - ->setSyncing(TRUE) - ->setSourceStorage($source_storage); - } - - // Install new configuration for Metatag. - $config_installer->installDefaultConfig('module', 'metatag'); - - // Apply all entity definition changes. - \Drupal::entityDefinitionUpdateManager()->applyUpdates(); - - // 2. Extract Metatag field defaults. - $entity_info = $entity_manager->getDefinitions(); - $tags = []; - - // Get all of the field storage entities of type metatag. - $field_storage_configs = $entity_manager - ->getStorage('field_storage_config') - ->loadByProperties(['type' => 'metatag']); - - foreach ($field_storage_configs as $field_storage) { - $field_name = $field_storage->getName(); - - // Get the individual fields (field instances) associated with bundles. - $fields = $entity_manager->getStorage('field_config') - ->loadByProperties(['field_name' => $field_name]); - foreach ($fields as $field) { - // Adjust the config id depending on whether these are entity defaults - // or bundle defaults. - $entity_type = $field->getTargetEntityTypeId(); - $bundle = $field->getTargetBundle(); - $metatag_defaults_id = $entity_type; - if ($entity_type != $bundle) { - // This is a bundle override. - $metatag_defaults_id = $entity_type . '__' . $bundle; - } - // Extract field default values. - $field_default_tags_value = $field->getDefaultValueLiteral(); - $field_default_tags_value = unserialize($field_default_tags_value[0]['value']); - $field_default_tags_value = array_filter($field_default_tags_value); - // Don't bother copying empty values. - if (!empty($field_default_tags_value)) { - $tags[$metatag_defaults_id] = $field_default_tags_value; - } - } - } - - // 3. Create Config entities with field default values. - if (!empty($tags)) { - $bundleInfoManager = \Drupal::service('entity_type.bundle.info'); - foreach ($tags as $metatag_defaults_id => $values) { - list($entity_type, $entity_bundle) = explode('__', $metatag_defaults_id); - $entity_label = (string) $entity_info[$entity_type]->get('label'); - $bundle_info = $bundleInfoManager->getBundleInfo($entity_type); - $bundle_label = $bundle_info[$entity_bundle]['label']; - $label = $entity_label . ': ' . $bundle_label; - - $metatags_global_manager = $entity_manager->getStorage('metatag_defaults'); - - $entity = $metatags_global_manager->load($metatag_defaults_id); - if ($entity) { - // These are defaults for an existing config entity, such as User. - $entity->set('tags', $values); - } - else { - // These are bundle overrides. - $entity = $metatags_global_manager->create([ - 'id' => $metatag_defaults_id, - 'label' => $label, - 'tags' => $values, - ]); - } - $entity->save(); - } - return (string) t("@count Metatag field defaults have been converted to using global entity defaults.", ['@count' => count($tags)]); - } - else { - return (string) t("There were Metatag field configurations that needed to be converted."); - } -} - -/** - * Rebuild routes after moving Metatag admin from Structure to Config. - */ -function metatag_update_8104() { - \Drupal::service('router.builder')->setRebuildNeeded(); -} - -/** - * Rebuild routes after renaming. - */ -function metatag_update_8105() { - \Drupal::service('router.builder')->setRebuildNeeded(); -} - -/** - * Add the metatag_defaults config entity to the site. - */ -function metatag_update_8106() { - \Drupal::entityDefinitionUpdateManager()->applyUpdates(); -} - -/** - * Enable the new metatag_open_graph module. - */ -function metatag_update_8107() { - \Drupal::service('module_installer')->install(['metatag_open_graph']); - return (string) t("The new Metatag: Open Graph module has been enabled."); -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag.links.action.yml b/sites/all/modules/contrib/admin/metatag/metatag.links.action.yml deleted file mode 100644 index 6ed508f60..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.metatag_defaults.add_form: - route_name: 'entity.metatag_defaults.add_form' - title: 'Add default meta tags' - appears_on: - - entity.metatag_defaults.collection diff --git a/sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml b/sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml deleted file mode 100644 index f1fef7187..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Metatag defaults menu items definition -entity.metatag_defaults.collection: - title: 'Metatag' - route_name: entity.metatag_defaults.collection - description: 'Configure Metatag defaults.' - parent: system.admin_config_search -metatag.settings: - title: 'Settings' - route_name: metatag.settings - description: 'Configure Metatag defaults.' - parent: entity.metatag_defaults.collection diff --git a/sites/all/modules/contrib/admin/metatag/metatag.links.task.yml b/sites/all/modules/contrib/admin/metatag/metatag.links.task.yml deleted file mode 100644 index 637e9beb5..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.links.task.yml +++ /dev/null @@ -1,10 +0,0 @@ -metatag_defaults: - route_name: 'entity.metatag_defaults.collection' - base_route: 'entity.metatag_defaults.collection' - title: 'Metatag defaults' - weight: 0 -metatag.settings: - route_name: 'metatag.settings' - base_route: 'entity.metatag_defaults.collection' - title: 'Settings' - weight: 10 diff --git a/sites/all/modules/contrib/admin/metatag/metatag.module b/sites/all/modules/contrib/admin/metatag/metatag.module deleted file mode 100644 index b9fad84a6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.module +++ /dev/null @@ -1,605 +0,0 @@ -<?php - -/** - * @file - * Contains metatag.module. - */ - -use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\Entity\Display\EntityViewDisplayInterface; -use Drupal\Core\Field\BaseFieldDefinition; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\Core\Url; -use Drupal\taxonomy\TermInterface; -use Drupal\Component\Utility\Html; - -/** - * Implements hook_help(). - */ -function metatag_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the Metatag module. - case 'help.page.metatag': - $output = '<h2>' . t('About') . '</h2>'; - $output .= '<p>' . t('This module allows a site to automatically provide structured metadata, aka "meta tags", about the site and individual pages.'); - $output .= '<p>' . t('In the context of search engine optimization, providing an extensive set of meta tags may help improve the site\'s and pages\' rankings, thus may aid with achieving a more prominent display of the content within search engine results. They can also be used to tailor how content is displayed when shared on social networks. For additional information, see the <a href=":online">online documentation for Metatag</a>.', [':online' => 'https://www.drupal.org/node/1774342']) . '</p>'; - $output .= '<h3>' . t('Intended worflow') . '</h3>'; - $output .= '<p>' . t('The module uses <a href=":tokens">"tokens"</a> to automatically fill in values for different meta tags. Specific values may also be filled in.', [':tokens' => Url::fromRoute('help.page', ['name' => 'token'])->toString()]) . '</p>'; - $output .= '<p>' . t('The best way of using Metatag is as follows:') . '</p>'; - $output .= '<ol>'; - $output .= '<li>' . t('Customize the <a href=":defaults">global defaults</a>, fill in the specific values and tokens that every page should have.', [':defaults' => Url::fromRoute('entity.metatag_defaults.edit_form', ['metatag_defaults' => 'global'])->toString()]) . '</li>'; - $output .= '<li>' . t('Override each of the <a href=":defaults">other defaults</a>, fill in specific values and tokens that each item should have by default. This allows e.g. for all nodes to have different values than taxonomy terms.', [':defaults' => Url::fromRoute('entity.metatag_defaults.collection')->toString()]) . '</li>'; - $output .= '<li>' . t('<a href=":add">Add more default configurations</a> as necessary for different entity types and entity bundles, e.g. for different content types or different vocabularies.', [':add' => Url::fromRoute('entity.metatag_defaults.add_form')->toString()]) . '</li>'; - $output .= '<li>' . t('To override the meta tags for individual entities, e.g. for individual nodes, add the "Metatag" field via the field settings for that entity or bundle type.') . '</li>'; - $output .= '</ol>'; - return $output; - - // The main configuration page. - case 'entity.metatag_defaults.collection': - $output = '<p>' . t('Configure global meta tag default values below. Meta tags may be left as the default.') . '</p>'; - $output .= '<p>' . t('Meta tag patterns are passed down from one level to the next unless they are overridden. To view a summary of the individual meta tags and the pattern for a specific configuration, click on its name below.') . '</p>'; - $output .= '<p>' . t('If the top-level configuration is not specific enough, additional default meta tag configurations can be added for a specific entity type or entity bundle, e.g. for a specific content type.') . '</p>'; - $output .= '<p>' . t('Meta tags can be further refined on a per-entity basis, e.g. for individual nodes, by adding the "Metatag" field to that entity type through its normal field settings pages.') . '</p>'; - return $output; - - // The 'add default meta tags' configuration page. - case 'entity.metatag_defaults.add_form': - $output = '<p>' . t('Use the following form to override the global default meta tags for a specific entity type or entity bundle. In practical terms, this allows the meta tags to be customized for a specific content type or taxonomy vocabulary, so that its content will have different meta tags <em>default values</em> than others.') . '</p>'; - $output .= '<p>' . t('As a reminder, if the "Metatag" field is added to the entity type through its normal field settings, the meta tags can be further refined on a per entity basis; this allows each node to have its meta tags customized on an individual basis.') . '</p>'; - return $output; - } -} - -/** - * Implements hook_form_FORM_ID_alter() for 'field_storage_config_edit_form'. - */ -function metatag_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state) { - if ($form_state->getFormObject()->getEntity()->getType() == 'metatag') { - // Hide the cardinality field. - $form['cardinality_container']['#access'] = FALSE; - $form['cardinality_container']['#disabled'] = TRUE; - } -} - -/** - * Implements hook_form_FORM_ID_alter() for 'field_config_edit_form'. - * - * Configuration defaults are handled via a different mechanism, so do not allow - * any values to be saved. - */ -function metatag_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state) { - if ($form_state->getFormObject()->getEntity()->getType() == 'metatag') { - // Hide the required and default value fields. - $form['required']['#access'] = FALSE; - $form['required']['#disabled'] = TRUE; - $form['default_value']['#access'] = FALSE; - $form['default_value']['#disabled'] = TRUE; - - // Step through the default value structure and erase any '#default_value' - // items that are found. - foreach ($form['default_value']['widget'][0] as &$outer) { - if (is_array($outer)) { - foreach ($outer as &$inner) { - if (is_array($inner) && isset($inner['#default_value'])) { - if (is_array($inner['#default_value'])) { - $inner['#default_value'] = []; - } - else { - $inner['#default_value'] = NULL; - } - } - } - } - } - } -} - -/** - * Implements hook_page_attachments(). - * - * Load all meta tags for this page. - */ -function metatag_page_attachments(array &$attachments) { - if (!metatag_is_current_route_supported()) { - return NULL; - } - - $metatag_attachments = &drupal_static('metatag_attachments'); - - if (is_null($metatag_attachments)) { - // Load the meta tags from the route. - $metatag_attachments = metatag_get_tags_from_route(); - } - if (!$metatag_attachments) { - return NULL; - } - - // Trigger hook_metatags_attachments_alter(). - // Allow modules to rendered metatags prior to attaching. - \Drupal::service('module_handler')->alter('metatags_attachments', $metatag_attachments); - - // If any Metatag items were found, append them. - if (!empty($metatag_attachments['#attached']['html_head'])) { - if (empty($attachments['#attached'])) { - $attachments['#attached'] = []; - } - if (empty($attachments['#attached']['html_head'])) { - $attachments['#attached']['html_head'] = []; - } - - $head_links = []; - foreach ($metatag_attachments['#attached']['html_head'] as $item) { - $attachments['#attached']['html_head'][] = $item; - - // Also add a HTTP header "Link:" for canonical URLs and shortlinks. - // See HtmlResponseAttachmentsProcessor::processHtmlHeadLink() for the - // implementation of the functionality in core. - if (in_array($item[1], ['canonical_url', 'shortlink'])) { - $attributes = $item[0]['#attributes']; - - $href = '<' . Html::escape($attributes['href']) . '>'; - unset($attributes['href']); - if ($param = drupal_http_header_attributes($attributes)) { - $href .= ';' . $param; - } - $head_links[] = $href; - } - } - - // If any HTTP Header items were found, add them too. - if (!empty($head_links)) { - $attachments['#attached']['http_header'][] = [ - 'Link', - implode(', ', $head_links), - FALSE, - ]; - } - } -} - -/** - * Implements hook_module_implements_alter(). - */ -function metatag_module_implements_alter(&$implementations, $hook) { - if ($hook == 'page_attachments_alter') { - // Move metatag_page_attachments_alter() to the end of the list. This is so - // the canonical and shortlink tags can be removed that are added by - // taxonomy_page_attachments_alter(). - // @todo Remove once https://www.drupal.org/node/2282029 is fixed. - $group = $implementations['metatag']; - unset($implementations['metatag']); - $implementations['metatag'] = $group; - } -} - -/** - * Implements hook_page_attachments_alter(). - */ -function metatag_page_attachments_alter(array &$attachments) { - $route_match = \Drupal::routeMatch(); - // Can be removed once https://www.drupal.org/node/2282029 is fixed. - if ($route_match->getRouteName() == 'entity.taxonomy_term.canonical' && ($term = $route_match->getParameter('taxonomy_term')) && $term instanceof TermInterface) { - _metatag_remove_duplicate_entity_tags($attachments); - } -} - -/** - * Implements hook_entity_view_alter(). - */ -function metatag_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) { - // If this is a 403 or 404 page then don't output these meta tags. - // @todo Make the default meta tags load properly so this is unnecessary. - if ($display->getOriginalId() == 'node.403.default' || $display->getOriginalId() == 'node.404.default') { - $build['#attached']['html_head_link'] = []; - return; - } - - // Panelized entities still use the original entity's controller, but with - // custom built entities. In those cases hook_entity_view_alter might be - // called too early, where meta links are not yet set. - // @see \Drupal\node\Controller\NodeController::view - if ($display->getThirdPartySetting('panelizer', 'enable', FALSE)) { - $build['#pre_render'][] = '_metatag_panelizer_pre_render'; - return; - } - - _metatag_remove_duplicate_entity_tags($build); -} - -/** - * Pre render callback for entities processed by Panelizer. - * - * @param array $element - * The render array being processed. - * - * @return array - * The filtered render array. - */ -function _metatag_panelizer_pre_render(array $element) { - _metatag_remove_duplicate_entity_tags($element); - return $element; -} - -/** - * Remove duplicate entity tags from a build. - * - * @param array $build - * The build. - */ -function _metatag_remove_duplicate_entity_tags(array &$build) { - // Some entities are built with a link rel="canonical" and/or link - // rel="shortlink" tag attached. - // If metatag provides them, remove the ones built with the entity. - if (isset($build['#attached']['html_head_link'])) { - $metatag_attachments = &drupal_static('metatag_attachments'); - if (is_null($metatag_attachments)) { - // Load the meta tags from the route. - $metatag_attachments = metatag_get_tags_from_route(); - } - - // Check to see if the page currently outputs a canonical and/or shortlink - // tag. - if (isset($metatag_attachments['#attached']['html_head'])) { - foreach ($metatag_attachments['#attached']['html_head'] as $metatag_item) { - if (in_array($metatag_item[1], ['canonical_url', 'shortlink'])) { - // Metatag provides rel="canonical" and/or rel="shortlink" tags. - foreach ($build['#attached']['html_head_link'] as $key => $item) { - if (isset($item[0]['rel']) && in_array($item[0]['rel'], ['canonical', 'shortlink'])) { - // Remove the link rel="canonical" or link rel="shortlink" tag - // from the entity's build array. - unset($build['#attached']['html_head_link'][$key]); - } - } - } - } - } - } -} - -/** - * Identify whether the current route is supported by the module. - * - * @return bool - * TRUE if the current route is supported. - */ -function metatag_is_current_route_supported() { - // If upgrading, we need to wait for database updates to complete. - $is_ready = \Drupal::service('entity_type.manager') - ->getDefinition('metatag_defaults', FALSE); - if (!$is_ready) { - return FALSE; - } - - // Ignore admin paths. - if (\Drupal::service('router.admin_context')->isAdminRoute()) { - return FALSE; - } - - return TRUE; -} - -/** - * Returns the entity of the current route. - * - * @return Drupal\Core\Entity\EntityInterface - * The entity or NULL if this is not an entity route. - */ -function metatag_get_route_entity() { - $route_match = \Drupal::routeMatch(); - $route_name = $route_match->getRouteName(); - - // Look for a canonical entity view page, e.g. node/{nid}, user/{uid}, etc. - $matches = []; - preg_match('/entity\.(.*)\.(latest[_-]version|canonical)/', $route_name, $matches); - if (!empty($matches[1])) { - $entity_type = $matches[1]; - return $route_match->getParameter($entity_type); - } - - // Look for a rest entity view page, e.g. "node/{nid}?_format=json", etc. - $matches = []; - // Matches e.g. "rest.entity.node.GET.json". - preg_match('/rest\.entity\.(.*)\.(.*)\.(.*)/', $route_name, $matches); - if (!empty($matches[1])) { - $entity_type = $matches[1]; - return $route_match->getParameter($entity_type); - } - - // Look for entity object 'add' pages, e.g. "node/add/{bundle}". - $route_name_matches = []; - preg_match('/(entity\.)?(.*)\.add(_form)?/', $route_name, $route_name_matches); - if (!empty($route_name_matches[2])) { - $entity_type = $route_name_matches[2]; - $definition = Drupal::entityTypeManager()->getDefinition($entity_type, FALSE); - if (!empty($definition)) { - $type = $route_match->getRawParameter($definition->get('bundle_entity_type')); - if (!empty($type)) { - return \Drupal::entityTypeManager() - ->getStorage($entity_type) - ->create([ - $definition->get('entity_keys')['bundle'] => $type, - ]); - } - } - } - - // Look for entity object 'edit' pages, e.g. "node/{entity_id}/edit". - $route_name_matches = []; - preg_match('/entity\.(.*)\.edit_form/', $route_name, $route_name_matches); - if (!empty($route_name_matches[1])) { - $entity_type = $route_name_matches[1]; - $entity_id = $route_match->getRawParameter($entity_type); - - if (!empty($entity_id)) { - return \Drupal::entityTypeManager() - ->getStorage($entity_type) - ->load($entity_id); - } - } - - // Look for entity object 'add content translation' pages, e.g. - // "node/{nid}/translations/add/{source_lang}/{translation_lang}". - $route_name_matches = []; - preg_match('/(entity\.)?(.*)\.content_translation_add/', $route_name, $route_name_matches); - if (!empty($route_name_matches[2])) { - $entity_type = $route_name_matches[2]; - $definition = Drupal::entityTypeManager()->getDefinition($entity_type, FALSE); - if (!empty($definition)) { - $node = $route_match->getParameter($entity_type); - $type = $node->bundle(); - if (!empty($type)) { - return \Drupal::entityTypeManager() - ->getStorage($entity_type) - ->create([ - $definition->get('entity_keys')['bundle'] => $type, - ]); - } - } - } - - // Special handling for the admin user_create page. In this case, there's only - // one bundle and it's named the same as the entity type, so some shortcuts - // can be used. - if ($route_name == 'user.admin_create') { - $entity_type = $type = 'user'; - $definition = Drupal::entityTypeManager()->getDefinition($entity_type); - if (!empty($type)) { - return \Drupal::entityTypeManager() - ->getStorage($entity_type) - ->create([ - $definition->get('entity_keys')['bundle'] => $type, - ]); - } - } - - // Trigger hook_metatag_route_entity(). - if ($entities = \Drupal::moduleHandler()->invokeAll('metatag_route_entity', [$route_match])) { - return reset($entities); - } - - return NULL; -} - -/** - * Implements template_preprocess_html(). - */ -function metatag_preprocess_html(&$variables) { - if (!metatag_is_current_route_supported()) { - return NULL; - } - - $attachments = &drupal_static('metatag_attachments'); - if (is_null($attachments)) { - $attachments = metatag_get_tags_from_route(); - } - - if (!$attachments) { - return NULL; - } - - // Load the page title. - if (!empty($attachments['#attached']['html_head'])) { - foreach ($attachments['#attached']['html_head'] as $key => $attachment) { - if (!empty($attachment[1]) && $attachment[1] == 'title') { - // Empty head_title to avoid the site name and slogan to be appended to - // the meta title. - $variables['head_title'] = []; - $variables['head_title']['title'] = html_entity_decode($attachment[0]['#attributes']['content'], ENT_QUOTES); - break; - } - } - } -} - -/** - * Load the meta tags by processing the route parameters. - * - * @return mixed - * Array of meta tags or NULL. - */ -function metatag_get_tags_from_route($entity = NULL) { - $metatag_manager = \Drupal::service('metatag.manager'); - - // First, get defaults. - $metatags = metatag_get_default_tags($entity); - if (!$metatags) { - return NULL; - } - - // Then, set tag overrides for this particular entity. - if (!$entity) { - $entity = metatag_get_route_entity(); - } - - if (!empty($entity) && $entity instanceof ContentEntityInterface) { - // If content entity does not have an ID the page is likely an "Add" page, - // so do not generate meta tags for entity which has not been created yet. - if (!$entity->id()) { - return NULL; - } - - foreach ($metatag_manager->tagsFromEntity($entity) as $tag => $data) { - $metatags[$tag] = $data; - } - } - - // Trigger hook_metatags_alter(). - // Allow modules to override tags or the entity used for token replacements. - $context = [ - 'entity' => &$entity, - ]; - \Drupal::service('module_handler')->alter('metatags', $metatags, $context); - - // If the entity was changed above, use that for generating the meta tags. - if (isset($context['entity'])) { - $entity = $context['entity']; - } - - return $metatag_manager->generateElements($metatags, $entity); -} - -/** - * Returns default tags for the current route. - * - * @return mixed - * Array of tags or NULL; - */ -function metatag_get_default_tags($entity = NULL) { - /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $global_metatag_manager */ - $global_metatag_manager = \Drupal::entityTypeManager()->getStorage('metatag_defaults'); - // First we load global defaults. - $metatags = $global_metatag_manager->load('global'); - if (!$metatags) { - return NULL; - } - - // Check if this is a special page. - $special_metatags = \Drupal::service('metatag.manager')->getSpecialMetatags(); - if (isset($special_metatags)) { - $metatags->overwriteTags($special_metatags->get('tags')); - } - - // Next check if there is this page is an entity that has meta tags. - else { - if (!$entity) { - $entity = metatag_get_route_entity(); - } - - if (!empty($entity) && $entity instanceof ContentEntityInterface) { - $entity_metatags = $global_metatag_manager->load($entity->getEntityTypeId()); - if ($entity_metatags != NULL) { - // Merge with global defaults. - $metatags->overwriteTags($entity_metatags->get('tags')); - } - - // Finally, check if bundle overrides should be added. - $bundle_metatags = $global_metatag_manager->load($entity->getEntityTypeId() . '__' . $entity->bundle()); - if ($bundle_metatags != NULL) { - // Merge with existing defaults. - $metatags->overwriteTags($bundle_metatags->get('tags')); - } - } - } - - return $metatags->get('tags'); -} - -/** - * Implements hook_entity_base_field_info(). - */ -function metatag_entity_base_field_info(EntityTypeInterface $entity_type) { - $fields = []; - $base_table = $entity_type->getBaseTable(); - $canonical_template_exists = $entity_type->hasLinkTemplate('canonical'); - // Certain classes are just not supported. - $original_class = $entity_type->getOriginalClass(); - $classes_to_skip = [ - 'Drupal\comment\Entity\Comment', - ]; - - // If the entity type doesn't have a base table, has no link template then - // there's no point in supporting it. - if (!empty($base_table) && $canonical_template_exists && !in_array($original_class, $classes_to_skip)) { - $fields['metatag'] = BaseFieldDefinition::create('map') - ->setLabel(t('Metatags')) - ->setDescription(t('The meta tags for the entity.')) - ->setClass('\Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList') - ->setComputed(TRUE) - ->setTranslatable(TRUE) - ->setTargetEntityTypeId($entity_type->id()); - } - - return $fields; -} - -/** - * Implements hook_entity_diff_options(). - */ -function metatag_entity_diff_options($entity_type) { - if (metatag_entity_supports_metatags($entity_type)) { - $options = [ - 'metatag' => t('Metatags'), - ]; - return $options; - } -} - -/** - * Implements hook_entity_diff(). - */ -function metatag_entity_diff($old_entity, $new_entity, $context) { - $result = []; - $entity_type = $context['entity_type']; - $options = variable_get('diff_additional_options_' . $entity_type, []); - if (!empty($options['metatag']) && metatag_entity_supports_metatags($entity_type)) { - // Find meta tags that are set on either the new or old entity. - $tags = []; - foreach (['old' => $old_entity, 'new' => $new_entity] as $entity_key => $entity) { - $language = metatag_entity_get_language($entity_type, $entity); - if (isset($entity->metatags[$language])) { - foreach ($entity->metatags[$language] as $key => $value) { - $tags[$key][$entity_key] = $value['value']; - } - } - } - - $init_weight = 100; - foreach ($tags as $key => $values) { - $id = ucwords('Meta ' . $key); - // @todo Find the default values and show these if not set. - $result[$id] = [ - '#name' => $id, - '#old' => [empty($values['old']) ? '' : $values['old']], - '#new' => [empty($values['new']) ? '' : $values['new']], - '#weight' => $init_weight++, - '#settings' => [ - 'show_header' => TRUE, - ], - ]; - } - } - return $result; -} - -/** - * Turn the meta tags for an entity into a human readable structure. - * - * @param object $entity - * The entity object. - * - * @return array - * All of the meta tags in a nested structure. - */ -function metatag_generate_entity_metatags($entity) { - $values = []; - $raw = metatag_get_tags_from_route($entity); - if (!empty($raw['#attached']['html_head'])) { - foreach ($raw['#attached']['html_head'] as $tag) { - $values[$tag[1]] = $tag[0]; - } - } - return $values; -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag.permissions.yml b/sites/all/modules/contrib/admin/metatag/metatag.permissions.yml deleted file mode 100644 index bdff82ed4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -'administer meta tags': - title: Administer meta tags - description: Control the main settings pages and modify per-object meta tags. - 'restrict access': TRUE diff --git a/sites/all/modules/contrib/admin/metatag/metatag.routing.yml b/sites/all/modules/contrib/admin/metatag/metatag.routing.yml deleted file mode 100644 index d809e4dbc..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.routing.yml +++ /dev/null @@ -1,60 +0,0 @@ -# MetatagDefaults routing definition -entity.metatag_defaults.collection: - path: '/admin/config/search/metatag' - defaults: - _entity_list: 'metatag_defaults' - _title: 'Metatag' - requirements: - _permission: 'administer meta tags' - options: - _admin_route: TRUE - -entity.metatag_defaults.add_form: - path: '/admin/config/search/metatag/add' - defaults: - _entity_form: 'metatag_defaults.add' - _title: 'Add default meta tags' - requirements: - _permission: 'administer meta tags' - options: - _admin_route: TRUE - -entity.metatag_defaults.edit_form: - path: '/admin/config/search/metatag/{metatag_defaults}' - defaults: - _entity_form: 'metatag_defaults.edit' - _title: 'Edit default meta tags' - requirements: - _permission: 'administer meta tags' - options: - _admin_route: TRUE - -entity.metatag_defaults.delete_form: - path: '/admin/config/search/metatag/{metatag_defaults}/delete' - defaults: - _entity_form: 'metatag_defaults.delete' - _title: 'Delete default meta tags' - requirements: - _permission: 'administer meta tags' - options: - _admin_route: TRUE - -entity.metatag_defaults.revert_form: - path: '/admin/config/search/metatag/{metatag_defaults}/revert' - defaults: - _entity_form: 'metatag_defaults.revert' - _title: 'Revert default meta tags' - requirements: - _permission: 'administer meta tags' - options: - _admin_route: TRUE - -metatag.settings: - path: '/admin/config/search/metatag/settings' - defaults: - _form: '\Drupal\metatag\Form\MetatagSettingsForm' - _title: 'Configure the Metatag module' - requirements: - _permission: 'administer meta tags' - options: - _admin_route: TRUE diff --git a/sites/all/modules/contrib/admin/metatag/metatag.services.yml b/sites/all/modules/contrib/admin/metatag/metatag.services.yml deleted file mode 100644 index c55377f13..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag.services.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - plugin.manager.metatag.tag: - class: Drupal\metatag\MetatagTagPluginManager - parent: default_plugin_manager - - plugin.manager.metatag.group: - class: Drupal\metatag\MetatagGroupPluginManager - parent: default_plugin_manager - - metatag.token: - class: Drupal\metatag\MetatagToken - arguments: ['@token'] - - metatag.manager: - class: Drupal\metatag\MetatagManager - arguments: ['@plugin.manager.metatag.group', '@plugin.manager.metatag.tag', '@metatag.token', '@logger.factory', '@entity_type.manager'] diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml deleted file mode 100644 index d8eb413e8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml +++ /dev/null @@ -1,76 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.al_android_app_name: - type: label - label: 'Android app name' -metatag.metatag_tag.al_android_class: - type: label - label: 'Android app Activity Class' -metatag.metatag_tag.al_android_package: - type: label - label: 'Android app package ID' -metatag.metatag_tag.al_android_url: - type: label - label: 'Android app URL scheme' -metatag.metatag_tag.al_ios_url: - type: label - label: 'iOS app URL scheme' -metatag.metatag_tag.al_ios_app_store_id: - type: label - label: 'iOS app store ID' -metatag.metatag_tag.al_ios_app_name: - type: label - label: 'iOS app name' -metatag.metatag_tag.al_ipad_url: - type: label - label: 'iPad app URL scheme' -metatag.metatag_tag.al_ipad_app_store_id: - type: label - label: 'iPad app store ID' -metatag.metatag_tag.al_ipad_app_name: - type: label - label: 'iPad app name' -metatag.metatag_tag.al_iphone_url: - type: label - label: 'iPhone app URL scheme' -metatag.metatag_tag.al_iphone_app_store_id: - type: label - label: 'iPhone app store ID' -metatag.metatag_tag.al_iphone_app_name: - type: label - label: 'iPhone app URL scheme' -metatag.metatag_tag.al_windows_app_id: - type: label - label: 'Windows app GUID' -metatag.metatag_tag.al_windows_app_name: - type: label - label: 'Windows app name' -metatag.metatag_tag.al_windows_url: - type: label - label: 'Windows app URL scheme' -metatag.metatag_tag.al_windows_phone_url: - type: label - label: 'Windows Phone app URL scheme' -metatag.metatag_tag.al_windows_phone_app_id: - type: label - label: 'Windows Phone app GUID' -metatag.metatag_tag.al_windows_phone_app_name: - type: label - label: 'Windows Phone app name' -metatag.metatag_tag.al_windows_universal_url: - type: label - label: 'Windows Universal app URL scheme' -metatag.metatag_tag.al_windows_universal_app_id: - type: label - label: 'Windows Universal app GUID' -metatag.metatag_tag.al_windows_universal_app_name: - type: label - label: 'Windows Universal app name' -metatag.metatag_tag.al_web_url: - type: label - label: 'Web URL' -metatag.metatag_tag.al_web_should_fallback: - type: label - label: 'Should fallback' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml deleted file mode 100644 index 1f79a53f0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: App Links' -type: module -description: Provides support for applinks.org meta tags. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module b/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module deleted file mode 100644 index a350752bc..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_app_links.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_app_links_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_app_links module. - case 'help.page.metatag_app_links': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides support for applinks.org meta tags.') . '</p>'; - return $output; - - default: - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php deleted file mode 100644 index 4f7aad531..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * Provides a plugin for the 'App Links' meta tag group. - * - * @MetatagGroup( - * id = "app_links", - * label = @Translation("App Links"), - * description = @Translation("Meta tags used to expose App Links for app deep linking. See <a href="":url"">applinks.org</a> for details and documentation.", arguments = { ":url" = "http://applinks.org"}), - * weight = 0, - * ) - */ -class AppLinks extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php deleted file mode 100644 index 6702f129b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Android app name meta tag. - * - * @MetatagTag( - * id = "al_android_app_name", - * label = @Translation("Android app name"), - * description = @Translation("The name of the app (suitable for display)."), - * name = "al:android:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlAndroidAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidClass.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidClass.php deleted file mode 100644 index 341e3267c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidClass.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Android app Activity Class meta tag. - * - * @MetatagTag( - * id = "al_android_class", - * label = @Translation("Android app Activity Class"), - * description = @Translation("A fully-qualified Activity class name for intent generation."), - * name = "al:android:class", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlAndroidClass extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidPackage.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidPackage.php deleted file mode 100644 index ae02d86bb..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidPackage.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Android app package ID meta tag. - * - * @MetatagTag( - * id = "al_android_package", - * label = @Translation("Android app package ID"), - * description = @Translation("A fully-qualified package name for intent generation. <strong>This attribute is required by the App Links specification.</strong>"), - * name = "al:android:package", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlAndroidPackage extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php deleted file mode 100644 index bac535c56..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Android app URL scheme meta tag. - * - * @MetatagTag( - * id = "al_android_url", - * label = @Translation("Android app URL scheme"), - * description = @Translation("A custom scheme for the Android app."), - * name = "al:android:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlAndroidUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppName.php deleted file mode 100644 index 489d12f06..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iOS app name meta tag. - * - * @MetatagTag( - * id = "al_ios_app_name", - * label = @Translation("iOS app name"), - * description = @Translation("The name of the app (suitable for display)"), - * name = "al:ios:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIosAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppStoreId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppStoreId.php deleted file mode 100644 index 03d8318a2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosAppStoreId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iOS app store ID meta tag. - * - * @MetatagTag( - * id = "al_ios_app_store_id", - * label = @Translation("iOS app store ID"), - * description = @Translation("The app ID for the app store."), - * name = "al:ios:app_store_id", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIosAppStoreId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosUrl.php deleted file mode 100644 index 8795549d6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIosUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iOS App URL scheme meta tag. - * - * @MetatagTag( - * id = "al_ios_url", - * label = @Translation("iOS app URL scheme"), - * description = @Translation("A custom scheme for the iOS app. <strong>This attribute is required by the app Links specification.</strong>"), - * name = "al:ios:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIosUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php deleted file mode 100644 index e9d2ce522..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iPad app name meta tag. - * - * @MetatagTag( - * id = "al_ipad_app_name", - * label = @Translation("iPad app name"), - * description = @Translation("The name of the app (suitable for display)."), - * name = "al:ipad:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIpadAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppStoreId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppStoreId.php deleted file mode 100644 index 82f54d2d9..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppStoreId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iPad app store ID meta tag. - * - * @MetatagTag( - * id = "al_ipad_app_store_id", - * label = @Translation("iPad app store ID"), - * description = @Translation("The app ID for the app store."), - * name = "al:ipad:app_store_id", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIpadAppStoreId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadUrl.php deleted file mode 100644 index ae4f0e4ce..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iPad App URL scheme meta tag. - * - * @MetatagTag( - * id = "al_ipad_url", - * label = @Translation("iPad app URL scheme"), - * description = @Translation("A custom scheme for the iOS app. <strong>This attribute is required by the app Links specification.</strong>"), - * name = "al:ipad:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIpadUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php deleted file mode 100644 index 2538c6a57..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iPhone app name meta tag. - * - * @MetatagTag( - * id = "al_iphone_app_name", - * label = @Translation("iPhone app name"), - * description = @Translation("The name of the app (suitable for display)."), - * name = "al:iphone:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIphoneAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppStoreId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppStoreId.php deleted file mode 100644 index 4c714c62b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppStoreId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iPad app store ID meta tag. - * - * @MetatagTag( - * id = "al_iphone_app_store_id", - * label = @Translation("iPhone app store ID"), - * description = @Translation("The app ID for the app store."), - * name = "al:iphone:app_store_id", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIphoneAppStoreId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneUrl.php deleted file mode 100644 index 46aa39f08..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks iPhone App URL scheme meta tag. - * - * @MetatagTag( - * id = "al_iphone_url", - * label = @Translation("iPhone app URL scheme"), - * description = @Translation("A custom scheme for the iOS app. <strong>This attribute is required by the app Links specification.</strong>"), - * name = "al:iphone:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlIphoneUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php deleted file mode 100644 index cee2c4c47..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Web Should Fallback meta tag. - * - * @MetatagTag( - * id = "al_web_should_fallback", - * label = @Translation("Should fallback"), - * description = @Translation("Indicates if the web URL should be used as a fallback; defaults to ""true""."), - * name = "al:web:should_fallback", - * group = "app_links", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWebShouldFallback extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebUrl.php deleted file mode 100644 index cc06fe6cc..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Web URL meta tag. - * - * @MetatagTag( - * id = "al_web_url", - * label = @Translation("Web URL"), - * description = @Translation("The web URL; defaults to the URL for the content that contains this tag."), - * name = "al:web:url", - * group = "app_links", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWebUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppId.php deleted file mode 100644 index fbbe6b0d7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows app ID meta tag. - * - * @MetatagTag( - * id = "al_windows_app_id", - * label = @Translation("Windows app ID"), - * description = @Translation("The app ID for the app store."), - * name = "al:windows:app_id", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsAppId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppName.php deleted file mode 100644 index c6bd6760b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows app name meta tag. - * - * @MetatagTag( - * id = "al_windows_app_name", - * label = @Translation("Windows app name"), - * description = @Translation("The name of the app (suitable for display)."), - * name = "al:windows:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppId.php deleted file mode 100644 index dcc04d588..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows Phone app ID meta tag. - * - * @MetatagTag( - * id = "al_windows_phone_app_id", - * label = @Translation("Windows Phone app ID"), - * description = @Translation("The app ID for the app store."), - * name = "al:windows_phone:app_id", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsPhoneAppId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppName.php deleted file mode 100644 index f4254dc09..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows Phone app name meta tag. - * - * @MetatagTag( - * id = "al_windows_phone_app_name", - * label = @Translation("Windows Phone app name"), - * description = @Translation("The name of the app (suitable for display)"), - * name = "al:windows_phone:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsPhoneAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneUrl.php deleted file mode 100644 index c49e98631..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsPhoneUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows Phone app URL scheme meta tag. - * - * @MetatagTag( - * id = "al_windows_phone_url", - * label = @Translation("Windows Phone app URL scheme"), - * description = @Translation("A custom scheme for the iOS app. <strong>This attribute is required by the app Links specification.</strong>"), - * name = "al:windows_phone:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsPhoneUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php deleted file mode 100644 index 353c40087..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows Universal app ID meta tag. - * - * @MetatagTag( - * id = "al_windows_universal_app_id", - * label = @Translation("Windows Universal app ID"), - * description = @Translation("The app ID for the app store."), - * name = "al:windows_universal:app_id", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsUniversalAppId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppName.php deleted file mode 100644 index 3275f9e9b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows Universal app name meta tag. - * - * @MetatagTag( - * id = "al_windows_universal_app_name", - * label = @Translation("Windows Universal app name"), - * description = @Translation("The name of the app (suitable for display)"), - * name = "al:windows_universal:app_name", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsUniversalAppName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalUrl.php deleted file mode 100644 index ba66711bc..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows Universal app URL scheme meta tag. - * - * @MetatagTag( - * id = "al_windows_universal_url", - * label = @Translation("Windows Universal app URL scheme"), - * description = @Translation("A custom scheme for the iOS app. <strong>This attribute is required by the app Links specification.</strong>"), - * name = "al:windows_universal:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsUniversalUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php deleted file mode 100644 index 3aa22ab39..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The AppLinks Windows App URL scheme meta tag. - * - * @MetatagTag( - * id = "al_windows_url", - * label = @Translation("Windows app URL scheme"), - * description = @Translation("A custom scheme for the iOS app. <strong>This attribute is required by the app Links specification.</strong>"), - * name = "al:windows:url", - * group = "app_links", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AlWindowsUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php deleted file mode 100644 index f791a5211..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -namespace Drupal\metatag_app_links\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the App Links tags work correctly. - * - * @group metatag - */ -class MetatagAppLinksTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'al_android_app_name', - 'al_android_class', - 'al_android_package', - 'al_android_url', - 'al_ios_app_name', - 'al_ios_app_store_id', - 'al_ios_url', - 'al_ipad_app_name', - 'al_ipad_app_store_id', - 'al_ipad_url', - 'al_iphone_app_name', - 'al_iphone_app_store_id', - 'al_iphone_url', - 'al_web_should_fallback', - 'al_web_url', - 'al_windows_app_id', - 'al_windows_app_name', - 'al_windows_phone_app_id', - 'al_windows_phone_app_name', - 'al_windows_phone_url', - 'al_windows_universal_app_id', - 'al_windows_universal_app_name', - 'al_windows_universal_url', - 'al_windows_url', - ]; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'property'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_app_links'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - $tag_name = str_replace('al_android_', 'al:android:', $tag_name); - $tag_name = str_replace('al_ios_', 'al:ios:', $tag_name); - $tag_name = str_replace('al_ipad_', 'al:ipad:', $tag_name); - $tag_name = str_replace('al_iphone_', 'al:iphone:', $tag_name); - $tag_name = str_replace('al_web_', 'al:web:', $tag_name); - // Run the Windows subtype replacements first so that the generic Windows - // one can still work. - $tag_name = str_replace('al_windows_phone_', 'al:windows_phone:', $tag_name); - $tag_name = str_replace('al_windows_universal_', 'al:windows_universal:', $tag_name); - $tag_name = str_replace('al_windows_', 'al:windows:', $tag_name); - return $tag_name; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/config/schema/metatag_dc.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_dc/config/schema/metatag_dc.metatag_tag.schema.yml deleted file mode 100644 index afda126fb..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/config/schema/metatag_dc.metatag_tag.schema.yml +++ /dev/null @@ -1,49 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.dcterms_contributor: - type: label - label: 'Dublin Core: Contributor' -metatag.metatag_tag.dcterms_coverage: - type: label - label: 'Dublin Core: Coverage' -metatag.metatag_tag.dcterms_creator: - type: label - label: 'Dublin Core: Creator' -metatag.metatag_tag.dcterms_date: - type: label - label: 'Dublin Core: Date' -metatag.metatag_tag.dcterms_description: - type: text - label: 'Dublin Core: Description' -metatag.metatag_tag.dcterms_format: - type: label - label: 'Dublin Core: Format' -metatag.metatag_tag.dcterms_identifier: - type: label - label: 'Dublin Core: Identifier' -metatag.metatag_tag.dcterms_language: - type: label - label: 'Dublin Core: Language' -metatag.metatag_tag.dcterms_publisher: - type: label - label: 'Dublin Core: Publisher' -metatag.metatag_tag.dcterms_relation: - type: label - label: 'Dublin Core: Relation' -metatag.metatag_tag.dcterms_rights: - type: label - label: 'Dublin Core: Rights' -metatag.metatag_tag.dcterms_source: - type: label - label: 'Dublin Core: Source' -metatag.metatag_tag.dcterms_subject: - type: label - label: 'Dublin Core: Subject' -metatag.metatag_tag.dcterms_title: - type: label - label: 'Dublin Core: Title' -metatag.metatag_tag.dcterms_type: - type: label - label: 'Dublin Core: Type' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/metatag_dc.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_dc/metatag_dc.info.yml deleted file mode 100644 index 33eaa6e0a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/metatag_dc.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Dublin Core' -type: module -description: Provides the fifteen <a href="http://dublincore.org/documents/dces/">Dublin Core Metadata Element Set 1.1</a> meta tags from the <a href="http://dublincore.org/">Dublin Core Metadata Institute</a>. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php deleted file mode 100644 index 0e0cb562f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The DublinCore group. - * - * @MetatagGroup( - * id = "dublin_core", - * label = @Translation("Dublin Core"), - * description = @Translation("Provides the fifteen <a href=':docs'>Dublin Core Metadata Element Set 1.1</a> meta tags from the <a href=':link'>Dublin Core Metadata Institute</a>", arguments = { ":docs" = "http://dublincore.org/documents/dces/", ":link" = "http://dublincore.org/"}), - * weight = 4 - * ) - */ -class DublinCore extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php deleted file mode 100644 index bba68928d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Contributor" meta tag. - * - * @MetatagTag( - * id = "dcterms_contributor", - * label = @Translation("Contributor"), - * description = @Translation("An entity responsible for making contributions to the resource. Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity."), - * name = "dcterms.contributor", - * group = "dublin_core", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Contributor extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Coverage.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Coverage.php deleted file mode 100644 index a0302c843..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Coverage.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Coverage" meta tag. - * - * @MetatagTag( - * id = "dcterms_coverage", - * label = @Translation("Coverage"), - * description = @Translation("The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant. Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges."), - * name = "dcterms.coverage", - * group = "dublin_core", - * weight = 14, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Coverage extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Creator.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Creator.php deleted file mode 100644 index 8aabc6cc6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Creator.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Creator" meta tag. - * - * @MetatagTag( - * id = "dcterms_creator", - * label = @Translation("Creator"), - * description = @Translation("An entity primarily responsible for making the resource. Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity."), - * name = "dcterms.creator", - * group = "dublin_core", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Creator extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Date.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Date.php deleted file mode 100644 index f66352a20..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Date.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Date" meta tag. - * - * @MetatagTag( - * id = "dcterms_date", - * label = @Translation("Date"), - * description = @Translation("A point or period of time associated with an event in the lifecycle of the resource. Date may be used to express temporal information at any level of granularity. Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF]."), - * name = "dcterms.date", - * group = "dublin_core", - * weight = 7, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Date extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Description.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Description.php deleted file mode 100644 index 8ea944f48..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Description.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Description" meta tag. - * - * @MetatagTag( - * id = "dcterms_description", - * label = @Translation("Description"), - * description = @Translation("An account of the resource. Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource."), - * name = "dcterms.description", - * group = "dublin_core", - * weight = 4, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Description extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Format.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Format.php deleted file mode 100644 index cefe34a57..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Format.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Date" meta tag. - * - * @MetatagTag( - * id = "dcterms_format", - * label = @Translation("Format"), - * description = @Translation("The file format, physical medium, or dimensions of the resource. Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME]."), - * name = "dcterms.format", - * group = "dublin_core", - * weight = 9, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Format extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Identifier.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Identifier.php deleted file mode 100644 index ceadeec6b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Identifier.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Identifier" meta tag. - * - * @MetatagTag( - * id = "dcterms_identifier", - * label = @Translation("Identifier"), - * description = @Translation("An unambiguous reference to the resource within a given context. Recommended best practice is to identify the resource by means of a string conforming to a formal identification system."), - * name = "dcterms.identifier", - * group = "dublin_core", - * weight = 10, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Identifier extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Language.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Language.php deleted file mode 100644 index 58d567713..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Language.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Language" meta tag. - * - * @MetatagTag( - * id = "dcterms_language", - * label = @Translation("Language"), - * description = @Translation("A language of the resource. Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646]."), - * name = "dcterms.language", - * group = "dublin_core", - * weight = 12, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Language extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Publisher.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Publisher.php deleted file mode 100644 index 410eeb812..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Publisher.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Publisher" meta tag. - * - * @MetatagTag( - * id = "dcterms_publisher", - * label = @Translation("Publisher"), - * description = @Translation("An entity responsible for making the resource available. Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity."), - * name = "dcterms.publisher", - * group = "dublin_core", - * weight = 5, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Publisher extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Relation.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Relation.php deleted file mode 100644 index ea89c4848..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Relation.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Relation" meta tag. - * - * @MetatagTag( - * id = "dcterms_relation", - * label = @Translation("Relation"), - * description = @Translation("A related resource. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system."), - * name = "dcterms.relation", - * group = "dublin_core", - * weight = 13, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Relation extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Rights.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Rights.php deleted file mode 100644 index a98e9da00..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Rights.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Rights" meta tag. - * - * @MetatagTag( - * id = "dcterms_rights", - * label = @Translation("Rights"), - * description = @Translation("Information about rights held in and over the resource. Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights."), - * name = "dcterms.rights", - * group = "dublin_core", - * weight = 15, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Rights extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Source.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Source.php deleted file mode 100644 index c0700fcfb..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Source.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Source" meta tag. - * - * @MetatagTag( - * id = "dcterms_source", - * label = @Translation("Source"), - * description = @Translation("A related resource from which the described resource is derived. The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system."), - * name = "dcterms.source", - * group = "dublin_core", - * weight = 11, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Source extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Subject.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Subject.php deleted file mode 100644 index 2cdcb9c68..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Subject.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Subject" meta tag. - * - * @MetatagTag( - * id = "dcterms_subject", - * label = @Translation("Subject"), - * description = @Translation("The topic of the resource. Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary. To describe the spatial or temporal topic of the resource, use the Coverage element."), - * name = "dcterms.subject", - * group = "dublin_core", - * weight = 3, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Subject extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Title.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Title.php deleted file mode 100644 index cfafb4081..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Title.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Title" meta tag. - * - * @MetatagTag( - * id = "dcterms_title", - * label = @Translation("Title"), - * description = @Translation("The name given to the resource."), - * name = "dcterms.title", - * group = "dublin_core", - * weight = 1, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Title extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Type.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Type.php deleted file mode 100644 index e34846a4c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Type.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Type" meta tag. - * - * @MetatagTag( - * id = "dcterms_type", - * label = @Translation("Type"), - * description = @Translation("The nature or genre of the resource. Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element."), - * name = "dcterms.type", - * group = "dublin_core", - * weight = 8, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Type extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Tests/MetatagDublinCoreTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Tests/MetatagDublinCoreTagsTest.php deleted file mode 100644 index 8085e7e81..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Tests/MetatagDublinCoreTagsTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\metatag_dc\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Dublin Core tags work correctly. - * - * @group metatag - */ -class MetatagDublinCoreTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'dcterms_contributor', - 'dcterms_coverage', - 'dcterms_creator', - 'dcterms_date', - 'dcterms_description', - 'dcterms_format', - 'dcterms_identifier', - 'dcterms_language', - 'dcterms_publisher', - 'dcterms_relation', - 'dcterms_rights', - 'dcterms_source', - 'dcterms_subject', - 'dcterms_title', - 'dcterms_type', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_dc'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - return str_replace('_', '.', $tag_name); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/config/schema/metatag_dc_advanced.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/config/schema/metatag_dc_advanced.metatag_tag.schema.yml deleted file mode 100644 index a9fdc0ca4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/config/schema/metatag_dc_advanced.metatag_tag.schema.yml +++ /dev/null @@ -1,124 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.dcterms_abstract: - type: label - label: 'Dublin Core: Abstract' -metatag.metatag_tag.dcterms_access_rights: - type: label - label: 'Dublin Core: Access Rights' -metatag.metatag_tag.dcterms_accrual_method: - type: label - label: 'Dublin Core: Accrual Method' -metatag.metatag_tag.dcterms_accrual_periodicity: - type: label - label: 'Dublin Core: Accrual Periodicity' -metatag.metatag_tag.dcterms_accrual_policy: - type: text - label: 'Dublin Core: Accrual Policy' -metatag.metatag_tag.dcterms_alternative: - type: label - label: 'Dublin Core: Alternative Title' -metatag.metatag_tag.dcterms_audience: - type: label - label: 'Dublin Core: Audience' -metatag.metatag_tag.dcterms_available: - type: label - label: 'Dublin Core: Date Available' -metatag.metatag_tag.dcterms_bibliographic_citation: - type: label - label: 'Dublin Core: Bibliographic Citation' -metatag.metatag_tag.dcterms_conforms_to: - type: label - label: 'Dublin Core: Conforms To' -metatag.metatag_tag.dcterms_created: - type: label - label: 'Dublin Core: Date Created' -metatag.metatag_tag.dcterms_date_accepted: - type: label - label: 'Dublin Core: Date Accepted' -metatag.metatag_tag.dcterms_date_copyrighted: - type: label - label: 'Dublin Core: Date Copyrighted' -metatag.metatag_tag.dcterms_date_submitted: - type: label - label: 'Dublin Core: Date Submitted' -metatag.metatag_tag.dcterms_education_level: - type: label - label: 'Dublin Core: Audience Education Level' -metatag.metatag_tag.dcterms_extent: - type: label - label: 'Dublin Core: Extent' -metatag.metatag_tag.dcterms_has_format: - type: label - label: 'Dublin Core: Has Format' -metatag.metatag_tag.dcterms_has_part: - type: label - label: 'Dublin Core: Has Part' -metatag.metatag_tag.dcterms_has_version: - type: label - label: 'Dublin Core: Has Version' -metatag.metatag_tag.dcterms_instructional_method: - type: label - label: 'Dublin Core: Instructional Method' -metatag.metatag_tag.dcterms_is_format_of: - type: label - label: 'Dublin Core: Is Format Of' -metatag.metatag_tag.dcterms_is_part_of: - type: label - label: 'Dublin Core: Is Part Of' -metatag.metatag_tag.dcterms_is_referenced_by: - type: label - label: 'Dublin Core: Is Referenced By' -metatag.metatag_tag.dcterms_is_replaced_by: - type: label - label: 'Dublin Core: Is Replaced By' -metatag.metatag_tag.dcterms_is_required_by: - type: label - label: 'Dublin Core: Is Required By' -metatag.metatag_tag.dcterms_issued: - type: label - label: 'Dublin Core: Date Issued' -metatag.metatag_tag.dcterms_is_version_of: - type: label - label: 'Dublin Core: Is Version Of' -metatag.metatag_tag.dcterms_license: - type: label - label: 'Dublin Core: License' -metatag.metatag_tag.dcterms_mediator: - type: label - label: 'Dublin Core: Mediator' -metatag.metatag_tag.dcterms_medium: - type: label - label: 'Dublin Core: Medium' -metatag.metatag_tag.dcterms_modified: - type: label - label: 'Dublin Core: Date Modified' -metatag.metatag_tag.dcterms_provenance: - type: label - label: 'Dublin Core: Provenance' -metatag.metatag_tag.dcterms_references: - type: label - label: 'Dublin Core: References' -metatag.metatag_tag.dcterms_replaces: - type: label - label: 'Dublin Core: Replaces' -metatag.metatag_tag.dcterms_requires: - type: label - label: 'Dublin Core: Requires' -metatag.metatag_tag.dcterms_rights_holder: - type: label - label: 'Dublin Core: Rights Holder' -metatag.metatag_tag.dcterms_spatial: - type: label - label: 'Dublin Core: Spatial Coverage' -metatag.metatag_tag.dcterms_table_of_contents: - type: label - label: 'Dublin Core: Table Of Contents' -metatag.metatag_tag.dcterms_temporal: - type: label - label: 'Dublin Core: Temporal Coverage' -metatag.metatag_tag.dcterms_valid: - type: label - label: 'Dublin Core: Date Valid' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml deleted file mode 100644 index 45c121342..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Metatag: Dublin Core Advanced' -type: module -description: 'Provides forty additional meta tags from the <a href="http://dublincore.org/">Dublin Core Metadata Institute</a>.' -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - - metatag:metatag_dc - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module deleted file mode 100644 index 5fbbb5e5e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_dc_advanced.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_dc_advanced_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_dc_advanced module. - case 'help.page.metatag_dc_advanced': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides forty additional meta tags from the <a href="http://dublincore.org/">Dublin Core Metadata Institute</a>.') . '</p>'; - return $output; - - default: - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Group/DublinCoreAdvanced.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Group/DublinCoreAdvanced.php deleted file mode 100644 index 273e29245..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Group/DublinCoreAdvanced.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * Provides a plugin for the 'Dublin Core Additional Tags' meta tag group. - * - * @MetatagGroup( - * id = "dublin_core_advanced", - * label = @Translation("Dublin Core Additional Tags"), - * description = @Translation("These tags are not part of the Metadata Element Set but may be useful for certain scenarios."), - * weight = 4, - * ) - */ -class DublinCoreAdvanced extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AbstractTag.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AbstractTag.php deleted file mode 100644 index c1499b8d2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AbstractTag.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "Abstract" meta tag. - * - * @MetatagTag( - * id = "dcterms_abstract", - * label = @Translation("Abstract"), - * description = @Translation("A summary of the resource."), - * name = "dcterms.abstract", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AbstractTag extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccessRights.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccessRights.php deleted file mode 100644 index 0dde2650d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccessRights.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "accessRights" meta tag. - * - * @MetatagTag( - * id = "dcterms_access_rights", - * label = @Translation("Access Rights"), - * description = @Translation("Information about who can access the resource or an indication of its security status. Access Rights may include information regarding access or restrictions based on privacy, security, or other policies."), - * name = "dcterms.accessRights", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AccessRights extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualMethod.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualMethod.php deleted file mode 100644 index 7430431fa..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualMethod.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "accrualMethod" meta tag. - * - * @MetatagTag( - * id = "dcterms_accrual_method", - * label = @Translation("Accrual Method"), - * description = @Translation("The method by which items are added to a collection."), - * name = "dcterms.accrualMethod", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AccrualMethod extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPeriodicity.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPeriodicity.php deleted file mode 100644 index d56c534cd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPeriodicity.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "accrualPeriodicity" meta tag. - * - * @MetatagTag( - * id = "dcterms_accrual_periodicity", - * label = @Translation("Accrual Periodicity"), - * description = @Translation("The frequency with which items are added to a collection."), - * name = "dcterms.accrualPeriodicity", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AccrualPeriodicity extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPolicy.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPolicy.php deleted file mode 100644 index 831a4093d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/AccrualPolicy.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "accrualPolicy" meta tag. - * - * @MetatagTag( - * id = "dcterms_accrual_policy", - * label = @Translation("Accrual Policy"), - * description = @Translation("The policy governing the addition of items to a collection."), - * name = "dcterms.accrualPolicy", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AccrualPolicy extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Alternative.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Alternative.php deleted file mode 100644 index 663484753..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Alternative.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "alternative" meta tag. - * - * @MetatagTag( - * id = "dcterms_alternative", - * label = @Translation("Alternative Title"), - * description = @Translation("An alternative name for the resource. The distinction between titles and alternative titles is application-specific."), - * name = "dcterms.alternative", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Alternative extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Audience.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Audience.php deleted file mode 100644 index ad0548b6e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Audience.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "audience" meta tag. - * - * @MetatagTag( - * id = "dcterms_audience", - * label = @Translation("Audience"), - * description = @Translation("A class of entity for whom the resource is intended or useful."), - * name = "dcterms.audience", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Audience extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Available.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Available.php deleted file mode 100644 index e71689f2a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Available.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "available" meta tag. - * - * @MetatagTag( - * id = "dcterms_available", - * label = @Translation("Date Available"), - * description = @Translation("Date (often a range) that the resource became or will become available."), - * name = "dcterms.available", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Available extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/BibliographicCitation.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/BibliographicCitation.php deleted file mode 100644 index f3be86847..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/BibliographicCitation.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "bibliographicCitation" meta tag. - * - * @MetatagTag( - * id = "dcterms_bibliographic_citation", - * label = @Translation("Bibliographic Citation"), - * description = @Translation("A bibliographic reference for the resource. Recommended practice is to include sufficient bibliographic detail to identify the resource as unambiguously as possible."), - * name = "dcterms.bibliographicCitation", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class BibliographicCitation extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/ConformsTo.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/ConformsTo.php deleted file mode 100644 index 4417c2752..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/ConformsTo.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "conformsTo" meta tag. - * - * @MetatagTag( - * id = "dcterms_conforms_to", - * label = @Translation("Conforms To"), - * description = @Translation("An established standard to which the described resource conforms."), - * name = "dcterms.conformsTo", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ConformsTo extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Created.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Created.php deleted file mode 100644 index 0f71f775b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Created.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "created" meta tag. - * - * @MetatagTag( - * id = "dcterms_created", - * label = @Translation("Date Created"), - * description = @Translation("Date of creation of the resource."), - * name = "dcterms.created", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Created extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateAccepted.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateAccepted.php deleted file mode 100644 index 6d4b462df..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateAccepted.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "dateAccepted" meta tag. - * - * @MetatagTag( - * id = "dcterms_date_accepted", - * label = @Translation("Date Accepted"), - * description = @Translation("Date of acceptance of the resource. Examples of resources to which a Date Accepted may be relevant are a thesis (accepted by a university department) or an article (accepted by a journal)."), - * name = "dcterms.dateAccepted", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class DateAccepted extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateCopyrighted.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateCopyrighted.php deleted file mode 100644 index 893b31991..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateCopyrighted.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "dateCopyrighted" meta tag. - * - * @MetatagTag( - * id = "dcterms_date_copyrighted", - * label = @Translation("Date Copyrighted"), - * description = @Translation("Date of copyright."), - * name = "dcterms.dateCopyrighted", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class DateCopyrighted extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateSubmitted.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateSubmitted.php deleted file mode 100644 index 1a302f7b6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/DateSubmitted.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "dateSubmitted" meta tag. - * - * @MetatagTag( - * id = "dcterms_date_submitted", - * label = @Translation("Date Submitted"), - * description = @Translation("Date of submission of the resource. Examples of resources to which a Date Submitted may be relevant are a thesis (submitted to a university department) or an article (submitted to a journal)."), - * name = "dcterms.dateSubmitted", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class DateSubmitted extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/EducationLevel.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/EducationLevel.php deleted file mode 100644 index 7c5d101cb..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/EducationLevel.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "educationLevel" meta tag. - * - * @MetatagTag( - * id = "dcterms_education_level", - * label = @Translation("Audience Education Level"), - * description = @Translation("A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended."), - * name = "dcterms.educationLevel", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class EducationLevel extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Extent.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Extent.php deleted file mode 100644 index 415484201..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Extent.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "extent" meta tag. - * - * @MetatagTag( - * id = "dcterms_extent", - * label = @Translation("Extent"), - * description = @Translation("The size or duration of the resource."), - * name = "dcterms.extent", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Extent extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasFormat.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasFormat.php deleted file mode 100644 index 6c3d14c72..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasFormat.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "hasFormat" meta tag. - * - * @MetatagTag( - * id = "dcterms_has_format", - * label = @Translation("Has Format"), - * description = @Translation("A related resource that is substantially the same as the pre-existing described resource, but in another format."), - * name = "dcterms.hasFormat", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class HasFormat extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasPart.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasPart.php deleted file mode 100644 index 0924a96ca..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasPart.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "hasPart" meta tag. - * - * @MetatagTag( - * id = "dcterms_has_part", - * label = @Translation("Has Part"), - * description = @Translation("A related resource that is included either physically or logically in the described resource."), - * name = "dcterms.hasPart", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class HasPart extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasVersion.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasVersion.php deleted file mode 100644 index 2b1821ed7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/HasVersion.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "hasVersion" meta tag. - * - * @MetatagTag( - * id = "dcterms_has_version", - * label = @Translation("Has Version"), - * description = @Translation("A related resource that is a version, edition, or adaptation of the described resource."), - * name = "dcterms.hasVersion", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class HasVersion extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/InstructionalMethod.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/InstructionalMethod.php deleted file mode 100644 index dbdfa658c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/InstructionalMethod.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "instructionalMethod" meta tag. - * - * @MetatagTag( - * id = "dcterms_instructional_method", - * label = @Translation("Instructional Method"), - * description = @Translation("A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support. Instructional Method will typically include ways of presenting instructional materials or conducting instructional activities, patterns of learner-to-learner and learner-to-instructor interactions, and mechanisms by which group and individual levels of learning are measured. Instructional methods include all aspects of the instruction and learning processes from planning and implementation through evaluation and feedback."), - * name = "dcterms.instructionalMethod", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class InstructionalMethod extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsFormatOf.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsFormatOf.php deleted file mode 100644 index 426c5dc6a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsFormatOf.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "isFormatOf" meta tag. - * - * @MetatagTag( - * id = "dcterms_is_format_of", - * label = @Translation("Is Format Of"), - * description = @Translation("A related resource that is substantially the same as the described resource, but in another format."), - * name = "dcterms.isFormatOf", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IsFormatOf extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsPartOf.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsPartOf.php deleted file mode 100644 index 18846c628..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsPartOf.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "isPartOf" meta tag. - * - * @MetatagTag( - * id = "dcterms_is_part_of", - * label = @Translation("Is Part Of"), - * description = @Translation("A related resource in which the described resource is physically or logically included."), - * name = "dcterms.isPartOf", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IsPartOf extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReferencedBy.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReferencedBy.php deleted file mode 100644 index 29b4879c3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReferencedBy.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "isReferencedBy" meta tag. - * - * @MetatagTag( - * id = "dcterms_is_referenced_by", - * label = @Translation("Is Referenced By"), - * description = @Translation("A related resource that references, cites, or otherwise points to the described resource."), - * name = "dcterms.isReferencedBy", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IsReferencedBy extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReplacedBy.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReplacedBy.php deleted file mode 100644 index c071d2254..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsReplacedBy.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "isReplacedBy" meta tag. - * - * @MetatagTag( - * id = "dcterms_is_replaced_by", - * label = @Translation("Is Replaced By"), - * description = @Translation("A related resource that supplants, displaces, or supersedes the described resource."), - * name = "dcterms.isReplacedBy", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IsReplacedBy extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsRequiredBy.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsRequiredBy.php deleted file mode 100644 index 5b004f27a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsRequiredBy.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "isRequiredBy" meta tag. - * - * @MetatagTag( - * id = "dcterms_is_required_by", - * label = @Translation("Is Required By"), - * description = @Translation("A related resource that requires the described resource to support its function, delivery, or coherence."), - * name = "dcterms.isRequiredBy", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IsRequiredBy extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsVersionOf.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsVersionOf.php deleted file mode 100644 index deea2d5d1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/IsVersionOf.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "isVersionOf" meta tag. - * - * @MetatagTag( - * id = "dcterms_is_version_of", - * label = @Translation("Is Version Of"), - * description = @Translation("A related resource of which the described resource is a version, edition, or adaptation. Changes in version imply substantive changes in content rather than differences in format."), - * name = "dcterms.isVersionOf", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IsVersionOf extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Issued.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Issued.php deleted file mode 100644 index 0372b23da..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Issued.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "issued" meta tag. - * - * @MetatagTag( - * id = "dcterms_issued", - * label = @Translation("Date Issued"), - * description = @Translation("Date of formal issuance (e.g., publication) of the resource."), - * name = "dcterms.issued", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Issued extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/License.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/License.php deleted file mode 100644 index 282920d2f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/License.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "license" meta tag. - * - * @MetatagTag( - * id = "dcterms_license", - * label = @Translation("License"), - * description = @Translation("A legal document giving official permission to do something with the resource."), - * name = "dcterms.license", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class License extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Mediator.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Mediator.php deleted file mode 100644 index a6d239462..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Mediator.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "mediator" meta tag. - * - * @MetatagTag( - * id = "dcterms_mediator", - * label = @Translation("Mediator"), - * description = @Translation("An entity that mediates access to the resource and for whom the resource is intended or useful. In an educational context, a mediator might be a parent, teacher, teaching assistant, or care-giver."), - * name = "dcterms.mediator", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Mediator extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Medium.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Medium.php deleted file mode 100644 index 2768267fa..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Medium.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "medium" meta tag. - * - * @MetatagTag( - * id = "dcterms_medium", - * label = @Translation("Medium"), - * description = @Translation("The material or physical carrier of the resource."), - * name = "dcterms.medium", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Medium extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Modified.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Modified.php deleted file mode 100644 index 4521c4aee..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Modified.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "modified" meta tag. - * - * @MetatagTag( - * id = "dcterms_modified", - * label = @Translation("Date Modified"), - * description = @Translation("Date on which the resource was changed."), - * name = "dcterms.modified", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Modified extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Provenance.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Provenance.php deleted file mode 100644 index a26c9806a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Provenance.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "provenance" meta tag. - * - * @MetatagTag( - * id = "dcterms_provenance", - * label = @Translation("Provenance"), - * description = @Translation("A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation. The statement may include a description of any changes successive custodians made to the resource."), - * name = "dcterms.provenance", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Provenance extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/References.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/References.php deleted file mode 100644 index a5b41ecd8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/References.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "references" meta tag. - * - * @MetatagTag( - * id = "dcterms_references", - * label = @Translation("References"), - * description = @Translation("A related resource that is referenced, cited, or otherwise pointed to by the described resource."), - * name = "dcterms.references", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class References extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Replaces.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Replaces.php deleted file mode 100644 index 46d8bf4b1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Replaces.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "replaces" meta tag. - * - * @MetatagTag( - * id = "dcterms_replaces", - * label = @Translation("Replaces"), - * description = @Translation("A related resource that is supplanted, displaced, or superseded by the described resource."), - * name = "dcterms.replaces", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Replaces extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Requires.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Requires.php deleted file mode 100644 index 4bb5966e3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Requires.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "requires" meta tag. - * - * @MetatagTag( - * id = "dcterms_requires", - * label = @Translation("Requires"), - * description = @Translation("A related resource that is required by the described resource to support its function, delivery, or coherence."), - * name = "dcterms.requires", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Requires extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/RightsHolder.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/RightsHolder.php deleted file mode 100644 index c7fc7fa81..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/RightsHolder.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "rightsHolder" meta tag. - * - * @MetatagTag( - * id = "dcterms_rights_holder", - * label = @Translation("Rights Holder"), - * description = @Translation("A person or organization owning or managing rights over the resource."), - * name = "dcterms.rightsHolder", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class RightsHolder extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Spatial.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Spatial.php deleted file mode 100644 index 27bd46844..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Spatial.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "spatial" meta tag. - * - * @MetatagTag( - * id = "dcterms_spatial", - * label = @Translation("Spatial Coverage"), - * description = @Translation("Spatial characteristics of the resource."), - * name = "dcterms.spatial", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Spatial extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/TableOfContents.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/TableOfContents.php deleted file mode 100644 index 28a55041c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/TableOfContents.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "tableOfContents" meta tag. - * - * @MetatagTag( - * id = "dcterms_table_of_contents", - * label = @Translation("Table Of Contents"), - * description = @Translation("A list of subunits of the resource."), - * name = "dcterms.tableOfContents", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TableOfContents extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Temporal.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Temporal.php deleted file mode 100644 index 25be75b60..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Temporal.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "temporal" meta tag. - * - * @MetatagTag( - * id = "dcterms_temporal", - * label = @Translation("Temporal Coverage"), - * description = @Translation("Temporal characteristics of the resource."), - * name = "dcterms.temporal", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Temporal extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Valid.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Valid.php deleted file mode 100644 index 443f3fb3b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Plugin/metatag/Tag/Valid.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Dublin Core "valid" meta tag. - * - * @MetatagTag( - * id = "dcterms_valid", - * label = @Translation("Date Valid"), - * description = @Translation("Date (often a range) of validity of a resource."), - * name = "dcterms.valid", - * group = "dublin_core_advanced", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Valid extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Tests/MetatagDublinCoreAdvancedTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Tests/MetatagDublinCoreAdvancedTagsTest.php deleted file mode 100644 index da19cf0c4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/src/Tests/MetatagDublinCoreAdvancedTagsTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Drupal\metatag_dc_advanced\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Dublin Core Advanced tags work correctly. - * - * @group metatag - */ -class MetatagDublinCoreAdvancedTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'dcterms_abstract', - 'dcterms_access_rights', - 'dcterms_accrual_method', - 'dcterms_accrual_periodicity', - 'dcterms_accrual_policy', - 'dcterms_alternative', - 'dcterms_audience', - 'dcterms_available', - 'dcterms_bibliographic_citation', - 'dcterms_conforms_to', - 'dcterms_created', - 'dcterms_date_accepted', - 'dcterms_date_copyrighted', - 'dcterms_date_submitted', - 'dcterms_education_level', - 'dcterms_extent', - 'dcterms_has_format', - 'dcterms_has_part', - 'dcterms_has_version', - 'dcterms_instructional_method', - 'dcterms_is_format_of', - 'dcterms_is_part_of', - 'dcterms_is_referenced_by', - 'dcterms_is_replaced_by', - 'dcterms_is_required_by', - 'dcterms_issued', - 'dcterms_is_version_of', - 'dcterms_license', - 'dcterms_mediator', - 'dcterms_medium', - 'dcterms_modified', - 'dcterms_provenance', - 'dcterms_references', - 'dcterms_replaces', - 'dcterms_requires', - 'dcterms_rights_holder', - 'dcterms_spatial', - 'dcterms_table_of_contents', - 'dcterms_temporal', - 'dcterms_valid', - ]; - - /** - * {@inheritdoc} - */ - private $testTag = 'meta'; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'property'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_dc_advanced'; - parent::setUp(); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/config/schema/metatag_facebook.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_facebook/config/schema/metatag_facebook.metatag_tag.schema.yml deleted file mode 100644 index 17db19694..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/config/schema/metatag_facebook.metatag_tag.schema.yml +++ /dev/null @@ -1,13 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.fb_admins: - type: label - label: 'Facebook Admins' -metatag.metatag_tag.fb_app_id: - type: label - label: 'Facebook App ID' -metatag.metatag_tag.fb_pages: - type: label - label: 'Facebook Pages' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/metatag_facebook.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_facebook/metatag_facebook.info.yml deleted file mode 100644 index 859e96f3d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/metatag_facebook.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Facebook' -type: module -description: A set of meta tags specially for controlling advanced functionality with Facebook. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Group/Facebook.php b/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Group/Facebook.php deleted file mode 100644 index 98e4af39f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Group/Facebook.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\facebook\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The Facebook group. - * - * @MetatagGroup( - * id = "facebook", - * label = @Translation("facebook"), - * description = @Translation("A set of meta tags specially for controlling advanced functionality with <a href=':fb'>Facebook</a>.", arguments = { ":fb" = "https://www.facebook.com/" }), - * weight = 4 - * ) - */ -class Facebook extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAdmins.php b/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAdmins.php deleted file mode 100644 index 0cbf866ed..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAdmins.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_facebook\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Facebook "fb:admins" meta tag. - * - * @MetatagTag( - * id = "fb_admins", - * label = @Translation("Facebook Admins"), - * description = @Translation("A comma-separated list of Facebook user IDs of people who are considered administrators or moderators of this page."), - * name = "fb:admins", - * group = "facebook", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class FbAdmins extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAppId.php b/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAppId.php deleted file mode 100644 index c75a68638..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbAppId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_facebook\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Facebook "fb:app_id" meta tag. - * - * @MetatagTag( - * id = "fb_app_id", - * label = @Translation("Facebook Application ID"), - * description = @Translation("A comma-separated list of Facebook Platform Application IDs applicable for this site."), - * name = "fb:app_id", - * group = "facebook", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class FbAppId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbPages.php b/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbPages.php deleted file mode 100644 index e6ab4ca15..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Plugin/metatag/Tag/FbPages.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_facebook\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Facebook "fb:pages" meta tag. - * - * @MetatagTag( - * id = "fb_pages", - * label = @Translation("Facebook Pages"), - * description = @Translation("Facebook Instant Articles claim URL token."), - * name = "fb:pages", - * group = "facebook", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class FbPages extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Tests/MetatagFacebookTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Tests/MetatagFacebookTagsTest.php deleted file mode 100644 index bd56b6508..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_facebook/src/Tests/MetatagFacebookTagsTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\metatag_facebook\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Facebook tags work correctly. - * - * @group metatag - */ -class MetatagFacebookTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'fb_admins', - 'fb_app_id', - 'fb_pages', - ]; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'property'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_facebook'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - $tag_name = str_replace('fb_', 'fb:', $tag_name); - return $tag_name; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/config/schema/metatag_favicons.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_favicons/config/schema/metatag_favicons.metatag_tag.schema.yml deleted file mode 100644 index e426a0bb6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/config/schema/metatag_favicons.metatag_tag.schema.yml +++ /dev/null @@ -1,70 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.shortcut_icon: - type: label - label: 'Default shortcut icon' -metatag.metatag_tag.mask_ico: - type: label - label: 'Icon: SVG' -metatag.metatag_tag.icon_16x16: - type: label - label: 'Icon: 16px x 16px' -metatag.metatag_tag.icon_32x32: - type: label - label: 'Icon: 32px x 32px' -metatag.metatag_tag.icon_96x96: - type: label - label: 'Icon: 96px x 96px' -metatag.metatag_tag.icon_192x192: - type: label - label: 'Icon: 192px x 192px' -metatag.metatag_tag.apple_touch_icon: - type: label - label: 'Apple touch icon: 60px x 60px' -metatag.metatag_tag.apple_touch_icon_72x72: - type: label - label: 'Apple touch icon: 72px x 72px' -metatag.metatag_tag.apple_touch_icon_76x76: - type: label - label: 'Apple touch icon: 76px x 76px' -metatag.metatag_tag.apple_touch_icon_114x114: - type: label - label: 'Apple touch icon: 114px x 114px' -metatag.metatag_tag.apple_touch_icon_120x120: - type: label - label: 'Apple touch icon: 120px x 120px' -metatag.metatag_tag.apple_touch_icon_144x144: - type: label - label: 'Apple touch icon: 144px x 144px' -metatag.metatag_tag.apple_touch_icon_152x152: - type: label - label: 'Apple touch icon: 152px x 152px' -metatag.metatag_tag.apple_touch_icon_180x180: - type: label - label: 'Apple touch icon: 180px x 180px' -metatag.metatag_tag.apple_touch_icon_precomposed: - type: label - label: 'Apple touch icon (precomposed): 57px x 57px' -metatag.metatag_tag.apple_touch_icon_precomposed_72x72: - type: label - label: 'Apple touch icon (precomposed): 72px x 72px' -metatag.metatag_tag.apple_touch_icon_precomposed_76x76: - type: label - label: 'Apple touch icon (precomposed): 76px x 76px' -metatag.metatag_tag.apple_touch_icon_precomposed_114x114: - type: label - label: 'Apple touch icon (precomposed): 114px x 114px' -metatag.metatag_tag.apple_touch_icon_precomposed_120x120: - type: label - label: 'Apple touch icon (precomposed): 120px x 120px' -metatag.metatag_tag.apple_touch_icon_precomposed_144x144: - type: label - label: 'Apple touch icon (precomposed): 144px x 144px' -metatag.metatag_tag.apple_touch_icon_precomposed_152x152: - type: label - label: 'Apple touch icon (precomposed): 152px x 152px' -metatag.metatag_tag.apple_touch_icon_precomposed_180x180: - type: label - label: 'Apple touch icon (precomposed): 180px x 180px' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.info.yml deleted file mode 100644 index 5ebb9ac31..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: favicons' -type: module -description: Provides support for many different favicons. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.module b/sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.module deleted file mode 100644 index 39a0b19ee..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/metatag_favicons.module +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/** - * @file - * Custom hook implementations for Metatag Favicons. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_favicons_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_favicons module. - case 'help.page.metatag_favicons': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides support for many different favicons.') . '</p>'; - return $output; - - default: - } -} - -/** - * Implements hook_page_attachments_alter(). - */ -function metatag_favicons_page_attachments_alter(array &$attachments) { - // Check html_head_link on attached tags in head. - if (!isset($attachments['#attached']['html_head_link'])) { - return; - } - - // Remove the default shortcut icon if one was set by Metatag. - foreach ($attachments['#attached']['html_head'] as $element) { - if (isset($element[1]) && $element[1] == 'shortcut_icon') { - foreach ($attachments['#attached']['html_head_link'] as $key => $value) { - if (isset($value[0]['rel']) && $value[0]['rel'] == 'shortcut icon') { - unset($attachments['#attached']['html_head_link'][$key]); - } - } - } - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Group/Favicons.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Group/Favicons.php deleted file mode 100644 index 65d340ce0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Group/Favicons.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * Provides a plugin for the 'Favicons & touch icons' meta tag group. - * - * @MetatagGroup( - * id = "favicons", - * label = @Translation("Favicons & touch icons"), - * description = @Translation("Meta tags for displaying favicons of various sizes and types. All values should be either absolute or relative URLs. No effects are added to the ""precomposed"" icons."), - * weight = 0, - * ) - */ -class Favicons extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon.php deleted file mode 100644 index 715c7a3a3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Favicons "apple-touch-icon" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon", - * label = @Translation("Apple touch icon: 60px x 60px"), - * description = @Translation("A PNG image that is 60px wide by 60px high. Used with the non-Retina iPhone, iPod Touch, and Android 2.1+ devices."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 7, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon114x114.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon114x114.php deleted file mode 100644 index 5c97c57d4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon114x114.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon_114x114" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_114x114", - * label = @Translation("Apple touch icon: 114px x 114px"), - * description = @Translation("A PNG image that is 114px wide by 114px high. Used with iPhone with @2x display running iOS <= 6."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 10, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon114x114 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '114x114'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon120x120.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon120x120.php deleted file mode 100644 index ae44e26df..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon120x120.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon_120x120" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_120x120", - * label = @Translation("Apple touch icon: 120px x 120px"), - * description = @Translation("A PNG image that is 120px wide by 120px high. Used with iPhone with @2x display running iOS >= 7."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 11, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon120x120 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '120x120'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon144x144.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon144x144.php deleted file mode 100644 index 77570fd29..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon144x144.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon_144x144" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_144x144", - * label = @Translation("Apple touch icon: 144px x 144px"), - * description = @Translation("A PNG image that is 144px wide by 144px high. Used with iPad with @2x display running iOS <= 6."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 12, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon144x144 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '144x144'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon152x152.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon152x152.php deleted file mode 100644 index a4bc9f497..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon152x152.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon_152x152" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_152x152", - * label = @Translation("Apple touch icon: 152px x 152px"), - * description = @Translation("A PNG image that is 152px wide by 152px high. Used with iPad with @2x display running iOS >= 7."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 13, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon152x152 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '152x152'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon180x180.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon180x180.php deleted file mode 100644 index e1e50f152..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon180x180.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon_180x180" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_180x180", - * label = @Translation("Apple touch icon: 180px x 180px"), - * description = @Translation("A PNG image that is 180px wide by 180px high. Used with iPhone 6 Plus with @3x display."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 14, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon180x180 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '180x180'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon72x72.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon72x72.php deleted file mode 100644 index 0bcaa83d1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon72x72.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "icon_16x16" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_72x72", - * label = @Translation("Apple touch icon: 72px x 72px"), - * description = @Translation("A PNG image that is 72px wide by 72px high. Used with the iPad mini and the first- and second-generation iPad (@1x display) on iOS <= 6."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 8, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon72x72 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '72x72'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon76x76.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon76x76.php deleted file mode 100644 index afe12a3ab..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIcon76x76.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon_76x76" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_76x76", - * label = @Translation("Apple touch icon: 76px x 76px"), - * description = @Translation("A PNG image that is 76px wide by 76px high. Used with the iPad mini and the second-generation iPad (@1x display) on iOS >= 7."), - * name = "apple-touch-icon", - * group = "favicons", - * weight = 9, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIcon76x76 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '76x76'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed.php deleted file mode 100644 index 8b7eaa39e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Favicons "apple-touch-icon-precomposed" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed", - * label = @Translation("Apple touch icon (precomposed): 57px x 57px"), - * description = @Translation("A PNG image that is 57px wide by 57px high. Used with the non-Retina iPhone, iPod Touch, and Android 2.1+ devices."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 15, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed114x114.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed114x114.php deleted file mode 100644 index d6ca57477..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed114x114.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_114x114" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_114x114", - * label = @Translation("Apple touch icon (precomposed): 114px x 114px"), - * description = @Translation("A PNG image that is 114px wide by 114px high. Used with iPhone with @2x display running iOS <= 6."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 18, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed114x114 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '114x114'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed120x120.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed120x120.php deleted file mode 100644 index 2ffc607b1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed120x120.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_120x120" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_120x120", - * label = @Translation("Apple touch icon (precomposed): 120px x 120px"), - * description = @Translation("A PNG image that is 120px wide by 120px high. Used with iPhone with @2x display running iOS >= 7."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 19, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed120x120 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '120x120'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed144x144.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed144x144.php deleted file mode 100644 index e087a433a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed144x144.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_144x144" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_144x144", - * label = @Translation("Apple touch icon (precomposed): 144px x 144px"), - * description = @Translation("A PNG image that is 144px wide by 144px high. Used with iPad with @2x display running iOS <= 6."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 20, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed144x144 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '144x144'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed152x152.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed152x152.php deleted file mode 100644 index 1bd597613..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed152x152.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_152x152" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_152x152", - * label = @Translation("Apple touch icon (precomposed): 152px x 152px"), - * description = @Translation("A PNG image that is 152px wide by 152px high. Used with iPad with @2x display running iOS >= 7."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 21, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed152x152 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '152x152'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed180x180.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed180x180.php deleted file mode 100644 index d4ac4c765..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed180x180.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_180x180" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_180x180", - * label = @Translation("Apple touch icon (precomposed): 180px x 180px"), - * description = @Translation("A PNG image that is 180px wide by 180px high. Used with iPhone 6 Plus with @3x display."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 22, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed180x180 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '180x180'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed72x72.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed72x72.php deleted file mode 100644 index ce1fed66b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed72x72.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_72x72" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_72x72", - * label = @Translation("Apple touch icon (precomposed): 72px x 72px"), - * description = @Translation("A PNG image that is 72px wide by 72px high. Used with the iPad mini and the first- and second-generation iPad (@1x display) on iOS <= 6."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 16, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed72x72 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '72x72'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed76x76.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed76x76.php deleted file mode 100644 index a735e61f8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/AppleTouchIconPrecomposed76x76.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "apple-touch-icon-precomposed_76x76" meta tag. - * - * @MetatagTag( - * id = "apple_touch_icon_precomposed_76x76", - * label = @Translation("Apple touch icon (precomposed): 76px x 76px"), - * description = @Translation("A PNG image that is 76px wide by 76px high. Used with the iPad mini and the second-generation iPad (@1x display) on iOS >= 7."), - * name = "apple-touch-icon-precomposed", - * group = "favicons", - * weight = 17, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleTouchIconPrecomposed76x76 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '76x76'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon16x16.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon16x16.php deleted file mode 100644 index a7d4c54df..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon16x16.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "icon_16x16" meta tag. - * - * @MetatagTag( - * id = "icon_16x16", - * label = @Translation("Icon: 16px x 16px"), - * description = @Translation("A PNG image that is 16px wide by 16px high."), - * name = "icon", - * group = "favicons", - * weight = 3, - * type = "image", - * secure = FALSE, - * multiple = FALSE, - * sizes = "16x16" - * ) - */ -class Icon16x16 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '16x16'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon192x192.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon192x192.php deleted file mode 100644 index 81f28923a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon192x192.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "icon_192x192" meta tag. - * - * @MetatagTag( - * id = "icon_192x192", - * label = @Translation("Icon: 192px x 192px"), - * description = @Translation("A PNG image that is 192px wide by 192px high."), - * name = "icon", - * group = "favicons", - * weight = 6, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Icon192x192 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '192x192'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon32x32.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon32x32.php deleted file mode 100644 index e0cc4a00f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon32x32.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "icon_32x32" meta tag. - * - * @MetatagTag( - * id = "icon_32x32", - * label = @Translation("Icon: 32px x 32px"), - * description = @Translation("A PNG image that is 32px wide by 32px high."), - * name = "icon", - * group = "favicons", - * weight = 4, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Icon32x32 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '32x32'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon96x96.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon96x96.php deleted file mode 100644 index a0a940acb..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/Icon96x96.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -/** - * The Favicons "icon_96x96" meta tag. - * - * @MetatagTag( - * id = "icon_96x96", - * label = @Translation("Icon: 96px x 96px"), - * description = @Translation("A PNG image that is 96px wide by 96px high."), - * name = "icon", - * group = "favicons", - * weight = 5, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Icon96x96 extends LinkSizesBase { - - /** - * {@inheritdoc} - */ - protected function sizes() { - return '96x96'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/LinkSizesBase.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/LinkSizesBase.php deleted file mode 100644 index d4f0f766d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/LinkSizesBase.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * This base plugin allows "link rel" tags with a "sizes" attribute. - */ -abstract class LinkSizesBase extends LinkRelBase { - - /** - * {@inheritdoc} - */ - public function output() { - $element = parent::output(); - - if ($element) { - $element['#attributes'] = [ - 'rel' => $this->name(), - 'sizes' => $this->sizes(), - 'href' => $element['#attributes']['href'], - ]; - } - - return $element; - } - - /** - * The dimensions supported by this icon. - * - * @return string - * A string in the format "XxY" for a given width and height. - */ - protected function sizes() { - return ''; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/MaskIcon.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/MaskIcon.php deleted file mode 100644 index fc5689ce1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/MaskIcon.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Favicons "mask-icon" meta tag. - * - * @MetatagTag( - * id = "mask-icon", - * label = @Translation("Icon: SVG"), - * description = @Translation("A grayscale scalable vector graphic (SVG) file."), - * name = "mask-icon", - * group = "favicons", - * weight = 2, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MaskIcon extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/ShortcutIcon.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/ShortcutIcon.php deleted file mode 100644 index 730a34e6a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Plugin/metatag/Tag/ShortcutIcon.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Favicons "shortcut icon" meta tag. - * - * @MetatagTag( - * id = "shortcut_icon", - * label = @Translation("Default shortcut icon"), - * description = @Translation("The traditional favicon, must be either a GIF, ICO, JPG/JPEG or PNG image."), - * name = "shortcut icon", - * group = "favicons", - * weight = 1, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ShortcutIcon extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Tests/MetatagFaviconsTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Tests/MetatagFaviconsTagsTest.php deleted file mode 100644 index 04f588505..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_favicons/src/Tests/MetatagFaviconsTagsTest.php +++ /dev/null @@ -1,240 +0,0 @@ -<?php - -namespace Drupal\metatag_favicons\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Favicons tags work correctly. - * - * @group metatag - */ -class MetatagFaviconsTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'shortcut_icon', - // 'mask_icon'. - 'icon_16x16', - 'icon_32x32', - 'icon_96x96', - 'icon_192x192', - 'apple_touch_icon', - 'apple_touch_icon_72x72', - 'apple_touch_icon_76x76', - 'apple_touch_icon_114x114', - 'apple_touch_icon_120x120', - 'apple_touch_icon_144x144', - 'apple_touch_icon_152x152', - 'apple_touch_icon_180x180', - 'apple_touch_icon_precomposed', - 'apple_touch_icon_precomposed_72x72', - 'apple_touch_icon_precomposed_76x76', - 'apple_touch_icon_precomposed_114x114', - 'apple_touch_icon_precomposed_120x120', - 'apple_touch_icon_precomposed_144x144', - 'apple_touch_icon_precomposed_152x152', - 'apple_touch_icon_precomposed_180x180', - ]; - - /** - * {@inheritdoc} - */ - private $testTag = 'link'; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'rel'; - - /** - * {@inheritdoc} - */ - private $testValueAttribute = 'href'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_favicons'; - parent::setUp(); - } - - /** - * Implements {tag_name}TestValueAttribute() for 'shortcut icon'. - */ - private function shortcutIconTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'icon_16x16'. - */ - private function icon16x16TestOutputXpath() { - return "//link[@rel='icon' and @sizes='16x16']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'icon_192x192'. - */ - private function icon192x192TestOutputXpath() { - return "//link[@rel='icon' and @sizes='192x192']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'icon_32x32'. - */ - private function icon32x32TestOutputXpath() { - return "//link[@rel='icon' and @sizes='32x32']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'icon_96x96'. - */ - private function icon96x96TestOutputXpath() { - return "//link[@rel='icon' and @sizes='96x96']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_precomposed'. - */ - private function appleTouchIconPrecomposedTestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and not(@sizes)]"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_114x114'. - */ - private function appleTouchIconPrecomposed114x114TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='114x114']"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_120x120'. - */ - private function appleTouchIconPrecomposed120x120TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='120x120']"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_144x144'. - */ - private function appleTouchIconPrecomposed144x144TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='144x144']"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_152x152'. - */ - private function appleTouchIconPrecomposed152x152TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='152x152']"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_180x180'. - */ - private function appleTouchIconPrecomposed180x180TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='180x180']"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_72x72'. - */ - private function appleTouchIconPrecomposed72x72TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='72x72']"; - } - - /** - * Implements {tag_name}TestOutputXpath(). - * - * For 'apple_touch_icon_precomposed_76x76'. - */ - private function appleTouchIconPrecomposed76x76TestOutputXpath() { - return "//link[@rel='apple-touch-icon-precomposed' and @sizes='76x76']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon'. - */ - private function appleTouchIconTestOutputXpath() { - return "//link[@rel='apple-touch-icon' and not(@sizes)]"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_114x114'. - */ - private function appleTouchIcon114x114TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='114x114']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_120x120'. - */ - private function appleTouchIcon120x120TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='120x120']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_144x144'. - */ - private function appleTouchIcon144x144TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='144x144']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_152x152'. - */ - private function appleTouchIcon152x152TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='152x152']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_180x180'. - */ - private function appleTouchIcon180x180TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='180x180']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_72x72'. - */ - private function appleTouchIcon72x72TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='72x72']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'apple_touch_icon_76x76'. - */ - private function appleTouchIcon76x76TestOutputXpath() { - return "//link[@rel='apple-touch-icon' and @sizes='76x76']"; - } - - /** - * Implements {tag_name}TestOutputXpath for 'mask-icon'. - */ - private function maskIconTestTagName() { - return 'mask-icon'; - } - - /** - * Implements {tag_name}TestTagName for 'shortcut icon'. - */ - private function shortcutIconTestTagName() { - return 'shortcut icon'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/config/schema/metatag_google_cse.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/config/schema/metatag_google_cse.metatag_tag.schema.yml deleted file mode 100644 index 823ad974f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/config/schema/metatag_google_cse.metatag_tag.schema.yml +++ /dev/null @@ -1,19 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.thumbnail: - type: label - label: 'Thumbnail' -metatag.metatag_tag.department: - type: label - label: 'Department' -metatag.metatag_tag.audience: - type: label - label: 'Content audience' -metatag.metatag_tag.doc_status: - type: label - label: 'Document status' -metatag.metatag_tag.google_rating: - type: label - label: 'google_rating' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.info.yml deleted file mode 100644 index 4246003b4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Google Custom Search Engine (CSE)' -type: module -description: Provides support for meta tags used for Google Custom Search Engine. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.module b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.module deleted file mode 100644 index 4d1d49ead..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/metatag_google_cse.module +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_google_cse.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_google_cse_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_google_cse module. - case 'help.page.metatag_google_cse': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides support for meta tags used for Google Custom Search Engine.') . '</p>'; - return $output; - - default: - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Group/GoogleCse.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Group/GoogleCse.php deleted file mode 100644 index d9fb5dae6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Group/GoogleCse.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * Provides a plugin for the 'Google Custom Search Engine (CSE)' meta tag group. - * - * @MetatagGroup( - * id = "google_cse", - * label = @Translation("Google Custom Search Engine (CSE)"), - * description = @Translation("Meta tags used to control the mobile browser experience. Some of these meta tags have been replaced by newer mobile browsers. These meta tags usually only need to be set globally, rather than per-page."), - * weight = 80, - * ) - */ -class GoogleCse extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Audience.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Audience.php deleted file mode 100644 index c543362f2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Audience.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'audience' meta tag. - * - * @MetatagTag( - * id = "audience", - * label = @Translation("Content audience"), - * description = @Translation("The content audience, e.g. ""all""."), - * name = "audience", - * group = "google_cse", - * weight = 0, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Audience extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Department.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Department.php deleted file mode 100644 index daf3fa280..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Department.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'department' meta tag. - * - * @MetatagTag( - * id = "department", - * label = @Translation("Department"), - * description = @Translation("Department tag."), - * name = "department", - * group = "google_cse", - * weight = 0, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Department extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/DocStatus.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/DocStatus.php deleted file mode 100644 index 8d59cf81c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/DocStatus.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'doc_status' meta tag. - * - * @MetatagTag( - * id = "doc_status", - * label = @Translation("Document status"), - * description = @Translation("The document status, e.g. ""draft""."), - * name = "doc_status", - * group = "google_cse", - * weight = 0, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class DocStatus extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/GoogleRating.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/GoogleRating.php deleted file mode 100644 index 079d3e661..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/GoogleRating.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'google_rating' meta tag. - * - * @MetatagTag( - * id = "google_rating", - * label = @Translation("Content rating"), - * description = @Translation("Works only with numeric values."), - * name = "rating", - * group = "google_cse", - * weight = 0, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class GoogleRating extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Thumbnail.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Thumbnail.php deleted file mode 100644 index 8d4baecc8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Plugin/metatag/Tag/Thumbnail.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'thumbnail' meta tag. - * - * @MetatagTag( - * id = "thumbnail", - * label = @Translation("Thumbnail"), - * description = @Translation("Use a url of a valid image."), - * name = "thumbnail", - * group = "google_cse", - * weight = 0, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Thumbnail extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Tests/MetatagGoogleCSETagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Tests/MetatagGoogleCSETagsTest.php deleted file mode 100644 index 7544196a7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_cse/src/Tests/MetatagGoogleCSETagsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Drupal\metatag_google_cse\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Google CSE tags work correctly. - * - * @group metatag - */ -class MetatagGoogleCSETagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'audience', - 'department', - 'doc_status', - 'google_rating', - 'thumbnail', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_google_cse'; - parent::setUp(); - } - - /** - * Implements {tag_name}TestTagName() for 'google_rating'. - */ - private function googleRatingTestTagName() { - return 'rating'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/config/schema/metatag_google_plus.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/config/schema/metatag_google_plus.metatag_tag.schema.yml deleted file mode 100644 index 8defd7c35..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/config/schema/metatag_google_plus.metatag_tag.schema.yml +++ /dev/null @@ -1,19 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.google_plus_name: - type: label - label: 'Google Plus: name' -metatag.metatag_tag.google_plus_image: - type: label - label: 'Google Plus: image' -metatag.metatag_tag.google_plus_description: - type: text - label: 'Google Plus: description' -metatag.metatag_tag.google_plus_publisher: - type: label - label: 'Publisher URL' -metatag.metatag_tag.google_plus_author: - type: label - label: 'Author' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/metatag_google_plus.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/metatag_google_plus.info.yml deleted file mode 100644 index da67659b7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/metatag_google_plus.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Google Plus' -type: module -description: Provides support for Google's Plus meta tags. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Group/GooglePlus.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Group/GooglePlus.php deleted file mode 100644 index 1744f672d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Group/GooglePlus.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The GooglePlus group. - * - * @MetatagGroup( - * id = "google_plus", - * label = @Translation("Google Plus"), - * description = @Translation("A set of meta tags specially for controlling the summaries displayed when content is shared on <a href=':plus'>Google Plus</a>.", arguments = { ":plus" = "https://plus.google.com/" }), - * weight = 4 - * ) - */ -class GooglePlus extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Author.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Author.php deleted file mode 100644 index 2cbfa3ada..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Author.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The basic "Author" meta tag. - * - * @MetatagTag( - * id = "google_plus_author", - * label = @Translation("Author"), - * description = @Translation("Used by some search engines to confirm authorship of the content on a page. Should be either the full URL for the author's Google+ profile page or a local page with information about the author."), - * name = "author", - * group = "google_plus", - * weight = 4, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Author extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Description.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Description.php deleted file mode 100644 index 9bcb800f2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Description.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaItempropBase; - -/** - * The GooglePlus "Description" meta tag. - * - * @MetatagTag( - * id = "google_plus_description", - * label = @Translation("Description"), - * description = @Translation("Content description less than 200 characters."), - * name = "itemprop:description", - * group = "google_plus", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Description extends MetaItempropBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Image.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Image.php deleted file mode 100644 index 9fb24d70f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Image.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaItempropBase; - -/** - * The GooglePlus 'image' meta tag. - * - * @MetatagTag( - * id = "google_plus_image", - * label = @Translation("Image"), - * description = @Translation("The URL of an image which should represent the content. For best results use an image that is at least 1200 x 630 pixels in size, but at least 600 x 316 pixels is a recommended minimum. Supports PNG, JPEG and GIF formats."), - * name = "itemprop:image", - * group = "google_plus", - * weight = 3, - * type = "image", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class Image extends MetaItempropBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Name.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Name.php deleted file mode 100644 index 6f68d06ec..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Name.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaItempropBase; - -/** - * The GooglePlus 'name' meta tag. - * - * @MetatagTag( - * id = "google_plus_name", - * label = @Translation("Name"), - * description = @Translation("Content title."), - * name = "itemprop:name", - * group = "google_plus", - * weight = 1, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Name extends MetaItempropBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Publisher.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Publisher.php deleted file mode 100644 index 2e15fd60a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Plugin/metatag/Tag/Publisher.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * Provides a plugin for the 'publisher' meta tag. - * - * @MetatagTag( - * id = "google_plus_publisher", - * label = @Translation("Publisher URL"), - * description = @Translation("Used by some search engines to confirm publication of the content on a page. Should be the full URL for the publication's Google+ profile page."), - * name = "publisher", - * group = "google_plus", - * weight = 5, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Publisher extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Tests/MetatagGooglePlusTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Tests/MetatagGooglePlusTagsTest.php deleted file mode 100644 index dc8eea5ad..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_google_plus/src/Tests/MetatagGooglePlusTagsTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -namespace Drupal\metatag_google_plus\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Google Plus tags work correctly. - * - * @group metatag - */ -class MetatagGooglePlusTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'google_plus_author', - 'google_plus_description', - 'google_plus_image', - 'google_plus_name', - 'google_plus_publisher', - ]; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'itemprop'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_google_plus'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - $tag_name = str_replace('google_plus_', 'itemprop:', $tag_name); - if ($tag_name == 'itemprop:publisher') { - $tag_name = 'publisher'; - } - return $tag_name; - } - - /** - * Implements {tag_name}TestNameAttribute() for 'author'. - */ - private function googlePlusAuthorTestOutputXpath() { - return "//link[@rel='author']"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'author'. - */ - private function googlePlusAuthorTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestNameAttribute() for 'publisher'. - */ - private function googlePlusPublisherTestOutputXpath() { - return "//link[@rel='publisher']"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'publisher'. - */ - private function googlePlusPublisherTestValueAttribute() { - return 'href'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/config/schema/metatag_hreflang.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/config/schema/metatag_hreflang.metatag_tag.schema.yml deleted file mode 100644 index 20ee6303c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/config/schema/metatag_hreflang.metatag_tag.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.hreflang_xdefault: - type: label - label: 'Default locale (x-default)' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.info.yml deleted file mode 100644 index 1901aaed4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Metatag: hreflang" -type: module -description: Provides support for the hreflang meta tag with some extra logic to simplify it. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.module b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.module deleted file mode 100644 index 81e7792d8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/metatag_hreflang.module +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_hreflang.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_hreflang_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_hreflang module. - case 'help.page.metatag_hreflang': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides support for the hreflang meta tag with some extra logic to simplify it.') . '</p>'; - return $output; - - default: - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php deleted file mode 100644 index 0eeef79b3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\metatag_hreflang\Plugin\Derivative; - -use Drupal\Component\Plugin\Derivative\DeriverBase; -use Drupal\Core\Language\Language; -use Drupal\Core\Language\LanguageInterface; - -/** - * Create a new hreflang tag plugin for each enabled language. - */ -class HreflangDeriver extends DeriverBase { - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - // Get a list of all defined languages. - $languages = \Drupal::languageManager() - ->getLanguages(LanguageInterface::STATE_ALL); - - // Now we loop over them and declare the derivatives. - /** @var \Drupal\Core\Language\LanguageInterface $language */ - foreach ($languages as $langcode => $language) { - // Ignore the global values. - if ($langcode == Language::LANGCODE_NOT_SPECIFIED) { - continue; - } - elseif ($langcode == Language::LANGCODE_NOT_APPLICABLE) { - continue; - } - - // The base definition includes the annotations defined in the plugin, - // i.e. HreflangPerLanguage. Each one may be overridden. - $derivative = $base_plugin_definition; - - // Here we fill in any missing keys on the layout annotation. - $derivative['weight']++; - $derivative['id'] = 'hreflang_' . $langcode; - // The 'name' value is used as the value of the 'hreflang' attribute on - // the HTML tag. - $derivative['name'] = $langcode; - $derivative['label'] = t("URL for a version of this page in %langcode", ['%langcode' => $language->getName()]); - $derivative['description'] = ''; - - // Reference derivatives based on their UUID instead of the record ID. - $this->derivatives[$derivative['id']] = $derivative; - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php deleted file mode 100644 index 6d1a25362..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_hreflang\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * A plugin for the 'Alternative language links (hreflang)' meta tag group. - * - * @MetatagGroup( - * id = "hreflang", - * label = @Translation("Alternative language links (hreflang)"), - * description = @Translation("These meta tags are designed to point visitors to versions of the current page in other languages."), - * weight = 60, - * ) - */ -class Hreflang extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangBase.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangBase.php deleted file mode 100644 index 469ca729f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangBase.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Drupal\metatag_hreflang\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * This base plugin allows "link hreflang" tags to be further customized. - */ -abstract class HreflangBase extends LinkRelBase { - - /** - * {@inheritdoc} - */ - public function output() { - $element = parent::output(); - - if ($element) { - // Rewrite the attributes so the hreflang value is before the href value. - $element['#attributes'] = [ - 'rel' => 'alternate', - 'hreflang' => $this->name(), - 'href' => $element['#attributes']['href'], - ]; - } - - return $element; - } - - /** - * {@inheritdoc} - */ - public function name() { - return str_replace('hreflang_', '', parent::name()); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php deleted file mode 100644 index 958afdeb7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_hreflang\Plugin\metatag\Tag; - -/** - * A new hreflang tag will be made available for each language. - * - * The meta tag's values will be based upon this annotation. - * - * @MetatagTag( - * id = "hreflang_per_language", - * deriver = "Drupal\metatag_hreflang\Plugin\Derivative\HreflangDeriver", - * label = @Translation("Hreflang per language"), - * description = @Translation("This plugin will be cloned from these settings for each enabled language."), - * name = "hreflang_per_language", - * group = "hreflang", - * weight = 1, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class HreflangPerLanguage extends HreflangBase { - // Everything will be inherited. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangXDefault.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangXDefault.php deleted file mode 100644 index 5f2ec5b75..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangXDefault.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Drupal\metatag_hreflang\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'hreflang_xdefault' meta tag. - * - * @MetatagTag( - * id = "hreflang_xdefault", - * label = @Translation("Default locale (x-default)"), - * description = @Translation("This should point to the version of the page that is for the main or primary locale, e.g. the original version of an article that is translated into other languages."), - * name = "hreflang_xdefault", - * group = "hreflang", - * weight = 0, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class HreflangXDefault extends HreflangBase { - - /** - * {@inheritdoc} - */ - public function name() { - return 'x-default'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Tests/MetatagHreflangTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Tests/MetatagHreflangTagsTest.php deleted file mode 100644 index dc5d2d3b1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Tests/MetatagHreflangTagsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -namespace Drupal\metatag_hreflang\Tests; - -use Drupal\language\Entity\ConfigurableLanguage; -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag hreflang tags work correctly. - * - * @group metatag - */ -class MetatagHreflangTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'hreflang_xdefault', - 'hreflang_en', - 'hreflang_es', - 'hreflang_fr', - ]; - - /** - * {@inheritdoc} - */ - private $testTag = 'link'; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'alternate'; - - /** - * {@inheritdoc} - */ - private $testValueAttribute = 'href'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - // Need the Language module in order for any of this to work. - parent::$modules[] = 'language'; - // This module. - parent::$modules[] = 'metatag_hreflang'; - parent::setUp(); - - // Enable additional languages. - foreach (['es', 'fr'] as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode)->save(); - } - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - return str_replace('hreflang_', '', $tag_name); - } - - /** - * Implements {tag_name}TestOutputXpath() for 'hreflang_xdefault'. - */ - private function hreflangXdefaultTestOutputXpath() { - return "//link[@hreflang='x-default']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'hreflang_en'. - */ - private function hreflangEnTestOutputXpath() { - return "//link[@hreflang='en']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'hreflang_es'. - */ - private function hreflangEsTestOutputXpath() { - return "//link[@hreflang='es']"; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'hreflang_fr'. - */ - private function hreflangFrTestOutputXpath() { - return "//link[@hreflang='fr']"; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml deleted file mode 100644 index 6431aaa2b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml +++ /dev/null @@ -1,103 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.android_app_link_alternative: - type: label - label: 'Android Mobile: Android App Link Alternative' -metatag.metatag_tag.android_manifest: - type: label - label: 'Android Mobile: Manifest' -metatag.metatag_tag.apple_itunes_app: - type: label - label: 'Apple Mobile: iTunes App' -metatag.metatag_tag.apple_mobile_web_app_capable: - type: label - label: 'Apple Mobile: Web App Capable' -metatag.metatag_tag.apple_mobile_web_app_status_bar_style: - type: label - label: 'Apple Mobile: Web App Status bar color' -metatag.metatag_tag.apple_mobile_web_app_title: - type: label - label: 'Apple Mobile: Web App Title' -metatag.metatag_tag.application_name: - type: label - label: 'Application name' -metatag.metatag_tag.cleartype: - type: label - label: 'Mobile: Cleartype' -metatag.metatag_tag.format_detection: - type: label - label: 'Apple Mobile: Format Detection' -metatag.metatag_tag.handheldfriendly: - type: label - label: 'Mobile: Handheld-Friendly' -metatag.metatag_tag.ios_app_link_alternative: - type: label - label: 'Apple Mobile: iOS App Link Alternative' -metatag.metatag_tag.mobileoptimized: - type: label - label: 'Mobile: Mobile Optimized' -metatag.metatag_tag.msapplication_allowDomainApiCalls: - type: label - label: 'MSApplication - Allow domain API calls' -metatag.metatag_tag.msapplication_allowDomainMetaTags: - type: label - label: 'MSApplication - Allow domain meta tags' -metatag.metatag_tag.msapplication_badge: - type: label - label: 'MSApplication - Badge' -metatag.metatag_tag.msapplication_config: - type: label - label: 'MSApplication - Config' -metatag.metatag_tag.msapplication_navbutton_color: - type: label - label: 'MSApplication - Nav button color' -metatag.metatag_tag.msapplication_notification: - type: label - label: 'MSApplication - Notification' -metatag.metatag_tag.msapplication_square150x150logo: - type: label - label: 'MSApplication - Square logo, 150px x 150px' -metatag.metatag_tag.msapplication_square310x310logo: - type: label - label: 'MSApplication - Square logo, 310px x 310px' -metatag.metatag_tag.msapplication_square70x70logo: - type: label - label: 'MSApplication - Square logo, 70px x 70px' -metatag.metatag_tag.msapplication_starturl: - type: label - label: 'MSApplication - Start URL' -metatag.metatag_tag.msapplication_task: - type: label - label: 'MSApplication - Task' -metatag.metatag_tag.msapplication_task_separator: - type: label - label: 'MSApplication - Task separator' -metatag.metatag_tag.msapplication_tilecolor: - type: label - label: 'MSApplication - Tile color' -metatag.metatag_tag.msapplication_tileimage: - type: label - label: 'MSApplication - Tile image' -metatag.metatag_tag.msapplication_tooltip: - type: label - label: 'MSApplication - Tooltip' -metatag.metatag_tag.msapplication_wide310x150logo: - type: label - label: 'MSApplication - Wide logo, 310px x 150px' -metatag.metatag_tag.msapplication_window: - type: label - label: 'MSApplication - Window' -metatag.metatag_tag.theme_color: - type: label - label: 'Mobile: Theme Color' -metatag.metatag_tag.viewport: - type: label - label: 'Mobile: Viewport' -metatag.metatag_tag.web_manifest: - type: label - label: 'Mobile: Web Manifest' -metatag.metatag_tag.x_ua_compatible: - type: label - label: 'X-UA-Compatible' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml deleted file mode 100644 index da52a0823..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Mobile & UI Adjustments' -type: module -description: Provides support for meta tags used to control the mobile browser experience. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module b/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module deleted file mode 100644 index dfe0ff94c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_mobile.module.. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_mobile_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_mobile module. - case 'help.page.metatag_mobile': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides support for meta tags used to control the mobile browser experience.') . '</p>'; - return $output; - - default: - } -} - -/** - * Implements hook_theme(). - */ -function metatag_mobile_theme() { - $info['metatag_mobile_android_app'] = [ - 'render element' => 'element', - ]; - $info['metatag_mobile_ios_app'] = [ - 'render element' => 'element', - ]; - - return $info; -} - -/** - * Implements hook_page_attachments_alter(). - */ -function metatag_mobile_page_attachments_alter(array &$attachments) { - if (isset($attachments['#attached']['html_head'])) { - // A list of core tags that will be replaced, in the format: - // core tag => Metatag-supplied tag - // This assumes that the module's meta tags are output *before* the core - // tags, if this changes then We're Going To Have A Bad Time. - $dupes = [ - 'MobileOptimized' => 'mobileoptimized', - 'HandheldFriendly' => 'handheldfriendly', - 'viewport' => 'viewport', - ]; - - // Keep track of when the Metatag-supplied meta tags are found, so if the - // core tag is also found it can be removed. - $found = []; - - foreach ($dupes as $core_tag => $meta_tag) { - foreach ($attachments['#attached']['html_head'] as $key => $item) { - if (isset($item[1])) { - // The Metatag values are output before core's, so skip the first item - // found so it can be picked up as the dupe; this is important for the - // "viewport" meta tag where both core and Metatag use the same name. - if ($item[1] == $meta_tag && !isset($found[$meta_tag])) { - $found[$meta_tag] = $key; - } - elseif ($item[1] == $core_tag && isset($found[$meta_tag])) { - // @todo This ought to work, but doesn't? - // $attachments['#attached']['html_head'][$key]['#access'] = FALSE; - unset($attachments['#attached']['html_head'][$key]); - } - } - } - } - } -} - -/** - * Theme callback for an Android app link meta tag. - * - * The format is (all on oneline): - * <link rel="alternate" href="android-app://com.example.Example - * /sitesection/sitepage/thispage" /> - */ -function theme_metatag_mobile_android_app($variables) { - // Pass everything through to the normal 'link' tag theme. - $variables['element']['#name'] = 'alternative'; - $variables['element']['#value'] = 'android-app://' . $variables['element']['#value']; - - return theme('metatag_link_rel', $variables); -} - -/** - * Theme callback for an iOS app link meta tag. - * - * The format is: - * <link rel="alternate" href="ios-app://123456/example/hello-screen" /> - */ -function theme_metatag_mobile_ios_app($variables) { - // Pass everything through to the normal 'link' tag theme. - $variables['element']['#name'] = 'alternative'; - $variables['element']['#value'] = 'ios-app://' . $variables['element']['#value']; - - return theme('metatag_link_rel', $variables); -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php deleted file mode 100644 index b1dfca6c8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Group; - -/** - * The Android mobile group. - * - * @MetatagGroup( - * id = "android_mobile", - * label = @Translation("Android"), - * description = @Translation("Custom meta tags used by the Android OS, browser, etc."), - * weight = 82 - * ) - */ -class AndroidMobile extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AppleMobile.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AppleMobile.php deleted file mode 100644 index fa09276f3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AppleMobile.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Group; - -/** - * The Apple mobile group. - * - * @MetatagGroup( - * id = "apple_mobile", - * label = @Translation("Apple & iOS"), - * description = @Translation("Custom meta tags used by Apple's software, iOS, Safari, etc."), - * weight = 81 - * ) - */ -class AppleMobile extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/Mobile.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/Mobile.php deleted file mode 100644 index 125e59e35..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/Mobile.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Group; - -/** - * Provides a plugin for the 'Mobile & UI Adjustments' meta tag group. - * - * @MetatagGroup( - * id = "mobile", - * label = @Translation("Mobile & UI Adjustments"), - * description = @Translation("Meta tags used to control the mobile browser experience. Some of these meta tags have been replaced by newer mobile browsers. These meta tags usually only need to be set globally, rather than per-page."), - * weight = 80 - * ) - */ -class Mobile extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/WindowsMobile.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/WindowsMobile.php deleted file mode 100644 index f3959c51b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/WindowsMobile.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Group; - -/** - * The Windows mobile group. - * - * @MetatagGroup( - * id = "windows_mobile", - * label = @Translation("Windows & Windows Mobile"), - * description = @Translation("Custom meta tags used by the Windows and Windows Mobile OSes, IE browser, etc."), - * weight = 83 - * ) - */ -class WindowsMobile extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidAppLinkAlternative.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidAppLinkAlternative.php deleted file mode 100644 index a3729435c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidAppLinkAlternative.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Android app link alternative for Android mobile metatag. - * - * @MetatagTag( - * id = "android_app_link_alternative", - * label = @Translation("Android app link alternative"), - * description = @Translation("A custom string for deeplinking to an Android mobile app. Should be in the format 'package_name/host_path', e.g. 'com.example.android/example/hello-screen'. The 'android-app://' prefix will be included automatically."), - * name = "alternate", - * group = "android_mobile", - * weight = 91, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AndroidAppLinkAlternative extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidManifest.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidManifest.php deleted file mode 100644 index 5710e152f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AndroidManifest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Android Manifest for Android mobile metatag. - * - * @MetatagTag( - * id = "android_manifest", - * label = @Translation("Manifest"), - * description = @Translation("A URL to a manifest.json file that describes the application. The <a href='https://developer.chrome.com/multidevice/android/installtohomescreen'>JSON-based manifest</a> provides developers with a centralized place to put metadata associated with a web application."), - * name = "manifest", - * group = "android_mobile", - * weight = 92, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AndroidManifest extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php deleted file mode 100644 index b7bfdd730..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Itunes App for Apple mobile metatag. - * - * @MetatagTag( - * id = "apple_itunes_app", - * label = @Translation("iTunes App details"), - * description = @Translation("This informs iOS devices to display a banner to a specific app. If used, it must provide the 'app-id' value, the 'affiliate-data' and 'app-argument' values are optional."), - * name = "apple-itunes-app", - * group = "apple_mobile", - * weight = 86, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleItunesApp extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppCapable.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppCapable.php deleted file mode 100644 index 19261845d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppCapable.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Web App Capable for Apple mobile metatag. - * - * @MetatagTag( - * id = "apple_mobile_web_app_capable", - * label = @Translation("Web app capable?"), - * description = @Translation("If set to 'yes', the application will run in full-screen mode; the default behavior is to use Safari to display web content."), - * name = "apple-mobile-web-app-capable", - * group = "apple_mobile", - * weight = 87, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleMobileWebAppCapable extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppStatusBarStyle.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppStatusBarStyle.php deleted file mode 100644 index 0586c2cf0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppStatusBarStyle.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Web App status bar style for Apple mobile metatag. - * - * @MetatagTag( - * id = "apple_mobile_web_app_status_bar_style", - * label = @Translation("Status bar color"), - * description = @Translation("Requires the 'Web app capable' meta tag to be set to 'yes'. May be set to 'default', 'black', or 'black-translucent'."), - * name = "apple-mobile-web-app-status-bar-style", - * group = "apple_mobile", - * weight = 88, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleMobileWebAppStatusBarStyle extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppTitle.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppTitle.php deleted file mode 100644 index 38d4beb69..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleMobileWebAppTitle.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Web App title for Apple mobile metatag. - * - * @MetatagTag( - * id = "apple_mobile_web_app_title", - * label = @Translation("Apple Web App Title"), - * description = @Translation("Overrides the long site title when using the Apple Add to Home Screen."), - * name = "apple-mobile-web-app-title", - * group = "apple_mobile", - * weight = 89, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AppleMobileWebAppTitle extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ApplicationName.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ApplicationName.php deleted file mode 100644 index 1a6e40f61..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ApplicationName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'application:name' meta tag. - * - * @MetatagTag( - * id = "application_name", - * label = @Translation("Application name"), - * description = @Translation("The default name displayed with the pinned sites tile (or icon). Set the content attribute to the desired name."), - * name = "application-name", - * group = "windows_mobile", - * weight = 94, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ApplicationName extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Cleartype.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Cleartype.php deleted file mode 100644 index ea9a0da70..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Cleartype.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaHttpEquivBase; - -/** - * The Cleartype for Mobile metatag. - * - * @MetatagTag( - * id = "cleartype", - * label = @Translation("Cleartype"), - * description = @Translation("A legacy meta tag for older versions of Internet Explorer on Windows, use the value 'on' to enable it; this tag is ignored by all other browsers."), - * name = "cleartype", - * group = "mobile", - * weight = 85, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Cleartype extends MetaHttpEquivBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/FormatDetection.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/FormatDetection.php deleted file mode 100644 index 73c186fb5..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/FormatDetection.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Format Detection for Apple mobile metatag. - * - * @MetatagTag( - * id = "format_detection", - * label = @Translation("Format detection"), - * description = @Translation("If set to 'telephone=no' the page will not be checked for phone numbers, which would be presented."), - * name = "format-detection", - * group = "apple_mobile", - * weight = 90, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class FormatDetection extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/HandheldFriendly.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/HandheldFriendly.php deleted file mode 100644 index 29d7e693e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/HandheldFriendly.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Handheld Friendly for Mobile metatag. - * - * @MetatagTag( - * id = "handheldfriendly", - * label = @Translation("Handheld-Friendly"), - * description = @Translation("Some older mobile browsers will expect this meta tag to be set to 'true' to indicate that the site has been designed with mobile browsers in mind."), - * name = "HandheldFriendly", - * group = "mobile", - * weight = 83, - * type = "string", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class HandheldFriendly extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/IosAppLinkAlternative.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/IosAppLinkAlternative.php deleted file mode 100644 index 6efa75313..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/IosAppLinkAlternative.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The iOS App link alternative for Apple mobile metatag. - * - * @MetatagTag( - * id = "ios_app_link_alternative", - * label = @Translation("iOS app link alternative"), - * description = @Translation("A custom string for deeplinking to an iOS mobile app. Should be in the format 'itunes_id/scheme/host_path', e.g. 123456/example/hello-screen'. The 'ios-app://' prefix will be included automatically."), - * name = "alternate", - * group = "apple_mobile", - * weight = 91, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class IosAppLinkAlternative extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MobileOptimized.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MobileOptimized.php deleted file mode 100644 index 22ac9320e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MobileOptimized.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Mobile optimized for Mobile metatag. - * - * @MetatagTag( - * id = "mobileoptimized", - * label = @Translation("Mobile Optimized"), - * description = @Translation("Using the value 'width' tells certain mobile Internet Explorer browsers to display as-is, without being resized. Alternatively a numerical width may be used to indicate the desired page width the page should be rendered in: '240' is the suggested default, '176' for older browsers or '480' for newer devices with high DPI screens."), - * name = "MobileOptimized", - * group = "mobile", - * weight = 82, - * type = "string", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class MobileOptimized extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainApiCalls.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainApiCalls.php deleted file mode 100644 index c21eb621b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainApiCalls.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:allowDomainApiCalls' meta tag. - * - * @MetatagTag( - * id = "msapplication_allowDomainApiCalls", - * label = @Translation("MSApplication - Allow domain API calls"), - * description = @Translation("Allows tasks to be defined on child domains of the fully qualified domain name associated with the pinned site. Should be either 'true' or 'false'."), - * name = "msapplication-allowDomainApiCalls", - * group = "windows_mobile", - * weight = 95, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationAllowDomainApiCalls extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainMetaTags.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainMetaTags.php deleted file mode 100644 index 46b77e644..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationAllowDomainMetaTags.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:allowDomainMetaTags' meta tag. - * - * @MetatagTag( - * id = "msapplication_allowDomainMetaTags", - * label = @Translation("MSApplication - Allow domain meta tags"), - * description = @Translation("Allows tasks to be defined on child domains of the fully qualified domain name associated with the pinned site. Should be either 'true' or 'false'."), - * name = "msapplication-allowDomainMetaTags", - * group = "windows_mobile", - * weight = 96, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationAllowDomainMetaTags extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationBadge.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationBadge.php deleted file mode 100644 index d1d61e0a1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationBadge.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:badge' meta tag. - * - * @MetatagTag( - * id = "msapplication_badge", - * label = @Translation("MSApplication - Badge"), - * description = @Translation("A semi-colon -separated string that must contain the 'polling-uri=' value with the full URL to a <a href='http://go.microsoft.com/fwlink/p/?LinkID=314019'>Badge Schema XML file</a>. May also contain 'frequency=' value set to either 30, 60, 360, 720 or 1440 (default) which specifies (in minutes) how often the URL should be polled."), - * name = "msapplication-badge", - * group = "windows_mobile", - * weight = 97, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationBadge extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php deleted file mode 100644 index 4487b7c7c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:config' meta tag. - * - * @MetatagTag( - * id = "msapplication_config", - * label = @Translation("MSApplication - Config"), - * description = @Translation("Should contain the full URL to a <a href='https://msdn.microsoft.com/en-us/library/dn320426(v=vs.85).aspx'>Browser configuration schema</a> file that further controls tile customizations."), - * name = "msapplication-config", - * group = "windows_mobile", - * weight = 98, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationConfig extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php deleted file mode 100644 index 8d116698b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:navbutton:color' meta tag. - * - * @MetatagTag( - * id = "msapplication_navbutton_color", - * label = @Translation("MSApplication - Nav button color"), - * description = @Translation("Controls the color of the Back and Forward buttons in the pinned site browser window."), - * name = "msapplication-navbutton-color", - * group = "windows_mobile", - * weight = 99, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationNavbuttonColor extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNotification.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNotification.php deleted file mode 100644 index aa7391401..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNotification.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:notification' meta tag. - * - * @MetatagTag( - * id = "msapplication_notification", - * label = @Translation("MSApplication - Notification"), - * description = @Translation("A semi-colon -separated string containing 'polling-uri=' (required), 'polling-uri2=', 'polling-uri3=', 'polling-uri4=' and 'polling-uri5=' to indicate the URLs for notifications. May also contain a 'frequency=' value to specify how often (in minutes) the URLs will be polled; limited to 30, 60, 360, 720 or 1440 (default). May also contain the value 'cycle=' to control the notifications cycle."), - * name = "msapplication-notification", - * group = "windows_mobile", - * weight = 100, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationNotification extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare150x150logo.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare150x150logo.php deleted file mode 100644 index fbf96e0d3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare150x150logo.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:square150x150logo' meta tag. - * - * @MetatagTag( - * id = "msapplication_square150x150logo", - * label = @Translation("MSApplication - Square logo, 150px x 150px"), - * description = @Translation("The URL to a logo file that is 150px by 150px."), - * name = "msapplication-square150x150logo", - * group = "windows_mobile", - * weight = 101, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationSquare150x150logo extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare310x310logo.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare310x310logo.php deleted file mode 100644 index 3f1b07494..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare310x310logo.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:square310x310logo' meta tag. - * - * @MetatagTag( - * id = "msapplication_square310x310logo", - * label = @Translation("MSApplication - Square logo, 310px x 310px"), - * description = @Translation("The URL to a logo file that is 310px by 310px."), - * name = "msapplication-square310x310logo", - * group = "windows_mobile", - * weight = 102, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationSquare310x310logo extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare70x70logo.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare70x70logo.php deleted file mode 100644 index 042d50062..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationSquare70x70logo.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:square70x70logo' meta tag. - * - * @MetatagTag( - * id = "msapplication_square70x70logo", - * label = @Translation("MSApplication - Square logo, 70px x 70px"), - * description = @Translation("The URL to a logo file that is 70px by 70px."), - * name = "msapplication-square70x70logo", - * group = "windows_mobile", - * weight = 103, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationSquare70x70logo extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationStartUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationStartUrl.php deleted file mode 100644 index 12de1c7c7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationStartUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:starturl' meta tag. - * - * @MetatagTag( - * id = "msapplication_starturl", - * label = @Translation("MSApplication - Start URL"), - * description = @Translation("The URL to the root page of the site."), - * name = "msapplication-starturl", - * group = "windows_mobile", - * weight = 105, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationStartUrl extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTask.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTask.php deleted file mode 100644 index 6e4e4d864..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTask.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:task' meta tag. - * - * @MetatagTag( - * id = "msapplication_task", - * label = @Translation("MSApplication - Task"), - * description = @Translation("A semi-colon -separated string defining the 'jump' list task. Should contain the 'name=' value to specify the task's name, the 'action-uri=' value to set the URL to load when the jump list is clicked, the 'icon-uri=' value to set the URL to an icon file to be displayed, and 'window-type=' set to either 'tab' (default), 'self' or 'window' to control how the link opens in the browser."), - * name = "msapplication-task", - * group = "windows_mobile", - * weight = 106, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationTask extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTaskSeparator.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTaskSeparator.php deleted file mode 100644 index 25d502f31..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTaskSeparator.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:task:separator' meta tag. - * - * @MetatagTag( - * id = "msapplication_task_separator", - * label = @Translation("MSApplication - Task separator"), - * description = @Translation(""), - * name = "msapplication-task-separator", - * group = "windows_mobile", - * weight = 107, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationTaskSeparator extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTilecolor.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTilecolor.php deleted file mode 100644 index bf9c33f41..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTilecolor.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:tilecolor' meta tag. - * - * @MetatagTag( - * id = "msapplication_tilecolor", - * label = @Translation("MSApplication - Tile color"), - * description = @Translation("The HTML color to use as the background color for the live tile."), - * name = "msapplication-tilecolor", - * group = "windows_mobile", - * weight = 108, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationTilecolor extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTileimage.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTileimage.php deleted file mode 100644 index 994c7e2e8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTileimage.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:tileimage' meta tag. - * - * @MetatagTag( - * id = "msapplication_tileimage", - * label = @Translation("MSApplication - Tile image"), - * description = @Translation("The URL to an image to use as the background for the live tile."), - * name = "msapplication-tileimage", - * group = "windows_mobile", - * weight = 109, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationTileimage extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTooltip.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTooltip.php deleted file mode 100644 index 7d2df5002..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationTooltip.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:tooltip' meta tag. - * - * @MetatagTag( - * id = "msapplication_tooltip", - * label = @Translation("MSApplication - Tooltip"), - * description = @Translation("Controls the text shown in the tooltip for the pinned site's shortcut."), - * name = "msapplication-tooltip", - * group = "windows_mobile", - * weight = 110, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationTooltip extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWide310x150logo.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWide310x150logo.php deleted file mode 100644 index 52532398d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWide310x150logo.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:wide310x150logo' meta tag. - * - * @MetatagTag( - * id = "msapplication_wide310x150logo", - * label = @Translation("MSApplication - Wide logo, 310px x 150px"), - * description = @Translation("The URL to a logo file that is 310px by 150px."), - * name = "msapplication-wide310x150logo", - * group = "windows_mobile", - * weight = 104, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationWide310x150logo extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWindow.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWindow.php deleted file mode 100644 index 967e2f490..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationWindow.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msapplication:window' meta tag. - * - * @MetatagTag( - * id = "msapplication_window", - * label = @Translation("MSApplication - Window"), - * description = @Translation("A semi-colon -separated value that controls the dimensions of the initial window. Should contain the values 'width=' and 'height=' to control the width and height respectively."), - * name = "msapplication-window", - * group = "windows_mobile", - * weight = 111, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class MsapplicationWindow extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ThemeColor.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ThemeColor.php deleted file mode 100644 index 07cd4a217..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/ThemeColor.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Theme color for Mobile metatag. - * - * @MetatagTag( - * id = "theme_color", - * label = @Translation("Theme Color"), - * description = @Translation("A color in hexidecimal format, e.g. '#0000ff' for blue; must include the '#' symbol. Used by some browsers to control the background color of the toolbar, the color used with an icon, etc."), - * name = "theme-color", - * group = "mobile", - * weight = 81, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ThemeColor extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Viewport.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Viewport.php deleted file mode 100644 index dca933831..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/Viewport.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Viewport for Mobile metatag. - * - * @MetatagTag( - * id = "viewport", - * label = @Translation("Viewport"), - * description = @Translation("Used by most contemporary browsers to control the display for mobile browsers. Please read a guide on responsive web design for details of what values to use."), - * name = "viewport", - * group = "mobile", - * weight = 84, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Viewport extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/WebManifest.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/WebManifest.php deleted file mode 100644 index 5028cae01..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/WebManifest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase; - -/** - * The Web Manifest for Progressive Web Apps. - * - * @MetatagTag( - * id = "web_manifest", - * label = @Translation("Web Manifest"), - * description = @Translation("A URL to a manifest.json file that describes the application. The <a href='https://developer.mozilla.org/en-US/docs/Web/Manifest'>JSON-based manifest</a> provides developers with a centralized place to put metadata associated with a web application."), - * name = "manifest", - * group = "mobile", - * weight = 92, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class WebManifest extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php deleted file mode 100644 index 99c93ee40..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaHttpEquivBase; - -/** - * Provides a plugin for the 'x:ua:compatible' meta tag. - * - * @MetatagTag( - * id = "x_ua_compatible", - * label = @Translation("X-UA-Compatible"), - * description = @Translation("Indicates to IE which rendering engine should be used for the current page."), - * name = "x-ua-compatible", - * group = "windows_mobile", - * weight = 93, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class XUaCompatible extends MetaHttpEquivBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Tests/MetatagMobileTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Tests/MetatagMobileTagsTest.php deleted file mode 100644 index 428744962..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Tests/MetatagMobileTagsTest.php +++ /dev/null @@ -1,238 +0,0 @@ -<?php - -namespace Drupal\metatag_mobile\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag mobile tags work correctly. - * - * @group metatag - */ -class MetatagMobileTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'android_app_link_alternative', - 'android_manifest', - 'apple_itunes_app', - 'apple_mobile_web_app_capable', - 'apple_mobile_web_app_status_bar_style', - 'apple_mobile_web_app_title', - 'application_name', - 'cleartype', - 'format_detection', - 'handheldfriendly', - 'ios_app_link_alternative', - 'mobileoptimized', - 'msapplication_allowDomainApiCalls', - 'msapplication_allowDomainMetaTags', - 'msapplication_badge', - 'msapplication_config', - 'msapplication_navbutton_color', - 'msapplication_notification', - 'msapplication_square150x150logo', - 'msapplication_square310x310logo', - 'msapplication_square70x70logo', - 'msapplication_starturl', - 'msapplication_task', - 'msapplication_task_separator', - 'msapplication_tilecolor', - 'msapplication_tileimage', - 'msapplication_tooltip', - 'msapplication_wide310x150logo', - 'msapplication_window', - 'theme_color', - 'viewport', - 'web_manifest', - 'x_ua_compatible', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_mobile'; - parent::setUp(); - } - - /** - * {@inheritdoc} - */ - private function getTestTagName($tag_name) { - // These tags all use dashes instead of underlines. - $tag_name = str_replace('_', '-', $tag_name); - - // Fix a few specific tags. - $tag_name = str_replace('mobileoptimized', 'MobileOptimized', $tag_name); - $tag_name = str_replace('handheldfriendly', 'HandheldFriendly', $tag_name); - - return $tag_name; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'alternate-handheld'. - */ - private function alternateHandheldTestOutputXpath() { - return "//link[@rel='alternate' and @media='handheld']"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'alternate-handheld'. - */ - private function alternateHandheldTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'amphtml'. - */ - private function amphtmlTestOutputXpath() { - return "//link[@rel='amphtml']"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'amphtml'. - */ - private function amphtmlTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestValue() for 'android_app_link_alternative'. - */ - private function androidAppLinkAlternativeTestValue() { - return 'android-app:' . $this->randomMachineName(); - } - - /** - * Implements {tag_name}TestOutputXpath() for 'android-app-link-alternative'. - */ - private function androidAppLinkAlternativeTestOutputXpath() { - return "//link[@rel='alternate' and starts-with(@href, 'android-app:')]"; - } - - /** - * Implements {tag_name}TestValueAttribute(). - * - * For 'android-app-link-alternative'. - */ - private function androidAppLinkAlternativeTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'android_manifest'. - */ - private function androidManifestTestOutputXpath() { - return "//link[@rel='manifest']"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'android_manifest'. - */ - private function androidManifestTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestNameAttribute() for 'cleartype'. - */ - private function cleartypeTestNameAttribute() { - return 'http-equiv'; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'handheldfriendly'. - */ - private function handheldfriendlyTestOutputXpath() { - return "//meta[@name='HandheldFriendly']"; - } - - /** - * Implements {tag_name}TestValue() for 'ios_app_link_alternative'. - */ - private function iosAppLinkAlternativeTestValue() { - return 'ios-app:' . $this->randomMachineName(); - } - - /** - * Implements {tag_name}TestOutputXpath() for 'ios_app_link_alternative'. - */ - private function iosAppLinkAlternativeTestOutputXpath() { - return "//link[@rel='alternate' and starts-with(@href, 'ios-app:')]"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'ios_app_link_alternative'. - */ - private function iosAppLinkAlternativeTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestOutputXpath() for 'mobileoptimized'. - */ - private function mobileoptimizedTestOutputXpath() { - return "//meta[@name='MobileOptimized']"; - } - - /** - * Implements {tag_name}TestValue() for 'msapplication-square150x150logo'. - */ - private function msapplicationSquare150x150logoTestValue() { - return $this->randomImageUrl(); - } - - /** - * Implements {tag_name}TestValue() for 'msapplication-square310x310logo'. - */ - private function msapplicationSquare310x310logoTestValue() { - return $this->randomImageUrl(); - } - - /** - * Implements {tag_name}TestValue() for 'msapplication-square70x70logo'. - */ - private function msapplicationSquare70x70logoTestValue() { - return $this->randomImageUrl(); - } - - /** - * Implements {tag_name}TestValue() for 'msapplication-tileimage'. - */ - private function msapplicationTileimageTestValue() { - return $this->randomImageUrl(); - } - - /** - * Implements {tag_name}TestValue() for 'msapplication-wide310x150logo'. - */ - private function msapplicationWide310x150logoTestValue() { - return $this->randomImageUrl(); - } - - /** - * Implements {tag_name}TestOutputXpath() for 'web_manifest'. - */ - private function webManifestTestOutputXpath() { - return "//link[@rel='manifest']"; - } - - /** - * Implements {tag_name}TestValueAttribute() for 'web_manifest'. - */ - private function webManifestTestValueAttribute() { - return 'href'; - } - - /** - * Implements {tag_name}TestNameAttribute() for 'x-ua-compatible'. - */ - private function xUaCompatibleTestNameAttribute() { - return 'http-equiv'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml deleted file mode 100644 index 593df480f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml +++ /dev/null @@ -1,133 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.og_country_name: - type: label - label: 'Open Graph: Country name' -metatag.metatag_tag.og_description: - type: text - label: 'Open Graph: Description' -metatag.metatag_tag.og_determiner: - type: label - label: 'Open Graph: Determiner' -metatag.metatag_tag.og_email: - type: label - label: 'Open Graph: Email' -metatag.metatag_tag.og_fax_number: - type: label - label: 'Open Graph: Fax number' -metatag.metatag_tag.og_image: - type: label - label: 'Open Graph: Image' -metatag.metatag_tag.og_image_alt: - type: label - label: 'Open Graph: Image alt' -metatag.metatag_tag.og_image_height: - type: label - label: 'Open Graph: Image height' -metatag.metatag_tag.og_image_secure_url: - type: label - label: 'Open Graph: Image secure URL' -metatag.metatag_tag.og_image_type: - type: label - label: 'Open Graph: Image type' -metatag.metatag_tag.og_image_url: - type: label - label: 'Open Graph: Image URL' -metatag.metatag_tag.og_image_width: - type: label - label: 'Open Graph: Image width' -metatag.metatag_tag.og_latitude: - type: label - label: 'Open Graph: Latitude' -metatag.metatag_tag.og_locale: - type: label - label: 'Open Graph: Locale' -metatag.metatag_tag.og_locale_alternative: - type: label - label: 'Open Graph: Alternative locale' -metatag.metatag_tag.og_locality: - type: label - label: 'Open Graph: Locality' -metatag.metatag_tag.og_longitude: - type: label - label: 'Open Graph: Longitude' -metatag.metatag_tag.og_phone_number: - type: label - label: 'Open Graph: Phone number' -metatag.metatag_tag.og_postal_code: - type: label - label: 'Open Graph: Postal code' -metatag.metatag_tag.og_region: - type: label - label: 'Open Graph: Region' -metatag.metatag_tag.og_see_also: - type: label - label: 'Open Graph: See also' -metatag.metatag_tag.og_site_name: - type: label - label: 'Open Graph: Site name' -metatag.metatag_tag.og_street_address: - type: label - label: 'Open Graph: Street address' -metatag.metatag_tag.og_title: - type: label - label: 'Open Graph: Title' -metatag.metatag_tag.og_type: - type: label - label: 'Open Graph: Type' -metatag.metatag_tag.og_updated_time: - type: label - label: 'Open Graph: Updated time' -metatag.metatag_tag.og_url: - type: label - label: 'Open Graph: URL' -metatag.metatag_tag.og_video: - type: label - label: 'Open Graph: Video URL' -metatag.metatag_tag.og_video_height: - type: label - label: 'Open Graph: Video height' -metatag.metatag_tag.og_video_secure_url: - type: label - label: 'Open Graph: Video Secure URL' -metatag.metatag_tag.og_video_type: - type: label - label: 'Open Graph: Video type' -metatag.metatag_tag.og_video_width: - type: label - label: 'Open Graph: Video width' -metatag.metatag_tag.article_author: - type: label - label: 'Article author' -metatag.metatag_tag.article_expiration_time: - type: label - label: 'Article expiration time' -metatag.metatag_tag.article_modified_time: - type: label - label: 'Article modified time' -metatag.metatag_tag.article_published_time: - type: label - label: 'Article published time' -metatag.metatag_tag.article_publisher: - type: label - label: 'Article publisher' -metatag.metatag_tag.article_section: - type: label - label: 'Article section' -metatag.metatag_tag.article_tag: - type: label - label: 'Article tag(s)' -metatag.metatag_tag.book_author: - type: label - label: 'Book Author' -metatag.metatag_tag.book_isbn: - type: label - label: 'Book ISBN' -metatag.metatag_tag.book_release_date: - type: label - label: 'Book Release Date' -metatag.metatag_tag.book_tag: - type: label - label: 'Book Tags' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml deleted file mode 100644 index 16ef28d0b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Open Graph' -type: module -description: Provides support for Open Graph Protocol meta tags. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install deleted file mode 100644 index 28baa7a4e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install +++ /dev/null @@ -1,127 +0,0 @@ -<?php - -/** - * @file - * Update scripts for the Metatag Open Graph module. - */ - -use Drupal\Core\Entity\ContentEntityBase; -use Drupal\metatag\Entity\MetatagDefaults; - -/** - * Implementations of hook_update_N(). - */ - -/** - * The "article:tags" meta tag was renamed to the correct "article:tag". - */ -function metatag_open_graph_update_8101() { - /* @var $configs Drupal\metatag\Entity\MetatagDefaults */ - $configs = MetatagDefaults::loadMultiple(); - - foreach ($configs as $config) { - $tags = $config->get('tags'); - - if (array_key_exists("article_tags", $tags)) { - $tags['article_tag'] = $tags['article_tags']; - unset($tags['article_tags']); - $config->set("tags", $tags); - $config->save(); - } - } -} - -/** - * The "article_tags" tag config was renamed "article_tag" on content entities. - */ -function metatag_open_graph_update_8102(&$sandbox) { - // Update existing content with reference to old article_tags. - $etm = Drupal::entityTypeManager(); - - if (empty($sandbox)) { - - $field_map = Drupal::getContainer()->get('entity_field.manager')->getFieldMap(); - $sandbox['todo'] = []; - $sandbox['done'] = 0; - $sandbox['max'] = 0; - $sandbox['#finished'] = 0; - - foreach ($field_map as $entity_type => $fields) { - foreach ($fields as $field_name => $field_def) { - if ($field_def['type'] == "metatag") { - // We found a metatag field, so query for all the entities of this - // type that have "article_tags" in the serialized array. - $q = \Drupal::entityQuery($entity_type); - $q->condition($field_name, "article_tags", "CONTAINS"); - $count = $q->count()->execute(); - - if ($count > 0) { - $sandbox['todo'][$entity_type][$field_name] = 0; - $sandbox['max'] += $count; - } - } - } - } - - if ($sandbox['max'] == 0) { - // Nothing to do. - $sandbox['#finished'] = 1; - return; - } - } - - foreach ($sandbox['todo'] as $entity_type => $fields) { - - /* @var $def Drupal\Core\Entity\ContentEntityType */ - $def = Drupal::entityTypeManager()->getDefinition($entity_type); - - // Grab the primary key field for this entity type - // so we can filter and order by it. - $id_col = $def->getKey("id"); - - foreach ($fields as $field_name => $last) { - $q = \Drupal::entityQuery($entity_type); - $q->condition($field_name, "article_tags", "CONTAINS"); - $q->condition($id_col, $last, ">"); - $q->sort($id_col); - $q->pager(20); - $res = $q->execute(); - - if (empty($res)) { - unset($sandbox['todo'][$entity_type][$field_name]); - continue; - } - - $entities = $etm->getStorage($entity_type)->loadMultiple($res); - - foreach ($entities as $entity) { - /* @var $entity ContentEntityBase */ - if ($entity instanceof ContentEntityBase) { - if ($entity->hasField($field_name)) { - /* @var LanguageInterface $langcode */ - foreach ($entity->getTranslationLanguages() as $langcode) { - // For each translation of this entity (including the source)... - $trans = $entity->getTranslation($langcode->getId()); - $tags_serialized = $trans->get($field_name)->value; - if ($tags_serialized) { - // Change key from article_tags to article_tag. - $tags = unserialize($tags_serialized); - if (array_key_exists("article_tags", $tags)) { - $tags['article_tag'] = $tags['article_tags']; - unset($tags['article_tags']); - $trans->set($field_name, serialize($tags)); - $trans->save(); - } - } - } - } - } - - // Store the last pk per entity type and field name. - $sandbox['todo'][$entity_type][$field_name] = $entity->id(); - $sandbox['done']++; - $sandbox['#finished'] = $sandbox['done'] / $sandbox['max']; - } - } - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module deleted file mode 100644 index fa5ffa707..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_open_graph.module. - */ - -/** - * Implements template_preprocess_html(). - */ -function metatag_open_graph_preprocess_html(&$variables) { - if (!metatag_is_current_route_supported()) { - return; - } - - // Add XML namespaces if the RDF module is not enabled as it adds these two - // automatically. - if (!isset($variables['html_attributes'])) { - $variables['html_attributes'] = []; - } - $namespaces = []; - if (!\Drupal::moduleHandler()->moduleExists('rdf')) { - $namespaces = [ - 'prefix' => 'og: http://ogp.me/ns#', - ]; - } - - // Namespaces for Google+. - if (isset($variables['itemtype'])) { - $namespaces['itemscope'] = ''; - $namespaces['itemtype'] = "http://schema.org/{$variables['itemtype']}"; - } - - // Append each namespace. - foreach ($namespaces as $namespace => $uri) { - $variables['html_attributes'][$namespace] = $uri; - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php deleted file mode 100644 index 3e5c8ac58..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The open graph group. - * - * @MetatagGroup( - * id = "open_graph", - * label = @Translation("Open Graph"), - * description = @Translation("The <a href='http://ogp.me/'>Open Graph meta tags</a> are used control how Facebook, Pinterest, LinkedIn and other social networking sites interpret the site's content."), - * weight = 3 - * ) - */ -class OpenGraph extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php deleted file mode 100644 index 2318dcba6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article author" meta tag. - * - * @MetatagTag( - * id = "article_author", - * label = @Translation("Article author"), - * description = @Translation("Links an article to an author's Facebook profile, should be either URLs to the author's profile page or their Facebook profile IDs."), - * name = "article:author", - * group = "open_graph", - * weight = 28, - * type = "label", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class ArticleAuthor extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleExpirationTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleExpirationTime.php deleted file mode 100644 index bcd22cda0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleExpirationTime.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article expiration time" meta tag. - * - * @MetatagTag( - * id = "article_expiration_time", - * label = @Translation("Article expiration date & time"), - * description = @Translation("The date this content will expire, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."), - * name = "article:expiration_time", - * group = "open_graph", - * weight = 34, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ArticleExpirationTime extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php deleted file mode 100644 index 92493f954..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article modified time" meta tag. - * - * @MetatagTag( - * id = "article_modified_time", - * label = @Translation("Article modification date & time"), - * description = @Translation("The date this content was last modified, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."), - * name = "article:modified_time", - * group = "open_graph", - * weight = 33, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ArticleModifiedTime extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php deleted file mode 100644 index c96cab0b7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article published time" meta tag. - * - * @MetatagTag( - * id = "article_published_time", - * label = @Translation("Article publication date & time"), - * description = @Translation("The date this content was published on, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."), - * name = "article:published_time", - * group = "open_graph", - * weight = 32, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ArticlePublishedTime extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php deleted file mode 100644 index 727d85677..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article publisher" meta tag. - * - * @MetatagTag( - * id = "article_publisher", - * label = @Translation("Article publisher"), - * description = @Translation("Links an article to a publisher's Facebook page."), - * name = "article:publisher", - * group = "open_graph", - * weight = 29, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ArticlePublisher extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleSection.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleSection.php deleted file mode 100644 index 627bd3d14..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleSection.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article section" meta tag. - * - * @MetatagTag( - * id = "article_section", - * label = @Translation("Article section"), - * description = @Translation("The primary section of this website the content belongs to."), - * name = "article:section", - * group = "open_graph", - * weight = 30, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ArticleSection extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleTag.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleTag.php deleted file mode 100644 index 699614e53..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleTag.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Article tag" meta tag. - * - * @MetatagTag( - * id = "article_tag", - * label = @Translation("Article tag(s)"), - * description = @Translation("Appropriate keywords for this content."), - * name = "article:tag", - * group = "open_graph", - * weight = 31, - * type = "label", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class ArticleTag extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookAuthor.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookAuthor.php deleted file mode 100644 index da02560b5..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookAuthor.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Book author" meta tag. - * - * @MetatagTag( - * id = "book_author", - * label = @Translation("Book author"), - * description = @Translation("Links a book to an author's Facebook profile, should be either URLs to the author's profile page or their Facebook profile IDs."), - * name = "book:author", - * group = "open_graph", - * weight = 35, - * type = "label", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class BookAuthor extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookISBN.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookISBN.php deleted file mode 100644 index 434525832..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookISBN.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'book:isbn' meta tag. - * - * @MetatagTag( - * id = "book_isbn", - * label = @Translation("ISBN"), - * description = @Translation("The Book's ISBN"), - * name = "book:isbn", - * group = "open_graph", - * weight = 36, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class BookISBN extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookReleaseDate.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookReleaseDate.php deleted file mode 100644 index f2ee39db1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookReleaseDate.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'book:release_date' meta tag. - * - * @MetatagTag( - * id = "book_release_date", - * label = @Translation("Release Date"), - * description = @Translation("The date the book was released."), - * name = "book:release_date", - * group = "open_graph", - * weight = 37, - * type = "date", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class BookReleaseDate extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookTag.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookTag.php deleted file mode 100644 index 0495d299f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/BookTag.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Book tag" meta tag. - * - * @MetatagTag( - * id = "book_tag", - * label = @Translation("Book tag(s)"), - * description = @Translation("Appropriate keywords for this content."), - * name = "book:tag", - * group = "open_graph", - * weight = 38, - * type = "label", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class BookTag extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgCountryName.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgCountryName.php deleted file mode 100644 index de064a0f0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgCountryName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:country_name' meta tag. - * - * @MetatagTag( - * id = "og_country_name", - * label = @Translation("Country name"), - * description = @Translation(""), - * name = "og:country_name", - * group = "open_graph", - * weight = 22, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgCountryName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDescription.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDescription.php deleted file mode 100644 index 8cad733c0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDescription.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Description" meta tag. - * - * @MetatagTag( - * id = "og_description", - * label = @Translation("Description"), - * description = @Translation("A one to two sentence description of the content."), - * name = "og:description", - * group = "open_graph", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgDescription extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDeterminer.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDeterminer.php deleted file mode 100644 index 94b0fe7dd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgDeterminer.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:determiner' meta tag. - * - * @MetatagTag( - * id = "og_determiner", - * label = @Translation("Determiner"), - * description = @Translation("The word that appears before the content's title in a sentence. The default ignores this value, the 'Automatic' value should be sufficient if this is actually needed."), - * name = "og:determiner", - * group = "open_graph", - * weight = 0, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgDeterminer extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgEmail.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgEmail.php deleted file mode 100644 index b0d8060ca..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgEmail.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:email' meta tag. - * - * @MetatagTag( - * id = "og_email", - * label = @Translation("Email address"), - * description = @Translation(""), - * name = "og:email", - * group = "open_graph", - * weight = 23, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgEmail extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgFaxNumber.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgFaxNumber.php deleted file mode 100644 index 42516b253..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgFaxNumber.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:fax_number' meta tag. - * - * @MetatagTag( - * id = "og_fax_number", - * label = @Translation("Fax number"), - * description = @Translation(""), - * name = "og:fax_number", - * group = "open_graph", - * weight = 25, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgFaxNumber extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImage.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImage.php deleted file mode 100644 index 4402ae5da..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImage.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image' meta tag. - * - * @MetatagTag( - * id = "og_image", - * label = @Translation("Image"), - * description = @Translation("The URL of an image which should represent the content. The image must be at least 200 x 200 pixels in size; 600 x 316 pixels is a recommended minimum size, and for best results use an image least 1200 x 630 pixels in size. Supports PNG, JPEG and GIF formats. Should not be used if og:image:url is used. Note: if multiple images are added many services (e.g. Facebook) will default to the largest image, not specifically the first one."), - * name = "og:image", - * group = "open_graph", - * weight = 9, - * type = "image", - * secure = FALSE, - * multiple = TRUE, - * absolute_url = TRUE - * ) - */ -class OgImage extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageAlt.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageAlt.php deleted file mode 100644 index bc239bd30..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageAlt.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image:alt' meta tag. - * - * @MetatagTag( - * id = "og_image_alt", - * label = @Translation("Image 'alt'"), - * description = @Translation("A description of what is in the image, not a caption. If the page specifies an og:image it should specify og:image:alt."), - * name = "og:image:alt", - * group = "open_graph", - * weight = 15, - * type = "string", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = FALSE - * ) - */ -class OgImageAlt extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageHeight.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageHeight.php deleted file mode 100644 index 6221dc5f6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageHeight.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image:height' meta tag. - * - * @MetatagTag( - * id = "og_image_height", - * label = @Translation("Image height"), - * description = @Translation("The height of the above image(s). Note: if both the unsecured and secured images are provided, they should both be the same size."), - * name = "og:image:height", - * group = "open_graph", - * weight = 14, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgImageHeight extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageSecureUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageSecureUrl.php deleted file mode 100644 index b0af05e8a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageSecureUrl.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image:secure_url' meta tag. - * - * @MetatagTag( - * id = "og_image_secure_url", - * label = @Translation("Image Secure URL"), - * description = @Translation("The secure URL (HTTPS) of an image which should represent the content. The image must be at least 50px by 50px and have a maximum aspect ratio of 3:1. Supports PNG, JPEG and GIF formats. All 'http://' URLs will automatically be converted to 'https://'."), - * name = "og:image:secure_url", - * group = "open_graph", - * weight = 11, - * type = "image", - * secure = TRUE, - * multiple = TRUE, - * absolute_url = TRUE - * ) - */ -class OgImageSecureUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageType.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageType.php deleted file mode 100644 index ac039318b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageType.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image:type' meta tag. - * - * @MetatagTag( - * id = "og_image_type", - * label = @Translation("Image type"), - * description = @Translation("The type of image referenced above. Should be either 'image/gif' for a GIF image, 'image/jpeg' for a JPG/JPEG image, or 'image/png' for a PNG image. Note: there should be one value for each image, and having more than there are images may cause problems."), - * name = "og:image:type", - * group = "open_graph", - * weight = 12, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgImageType extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageUrl.php deleted file mode 100644 index 055d8afad..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageUrl.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image:url' meta tag. - * - * @MetatagTag( - * id = "og_image_url", - * label = @Translation("Image URL"), - * description = @Translation("A alternative version of og:image and has exactly the same requirements; only one needs to be used."), - * name = "og:image:url", - * group = "open_graph", - * weight = 10, - * type = "image", - * secure = FALSE, - * multiple = TRUE, - * absolute_url = TRUE - * ) - */ -class OgImageUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php deleted file mode 100644 index 539341bdd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgImageWidth.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:image:width' meta tag. - * - * @MetatagTag( - * id = "og_image_width", - * label = @Translation("Image width"), - * description = @Translation("The height of the above image(s). Note: if both the unsecured and secured images are provided, they should both be the same size."), - * name = "og:image:width", - * group = "open_graph", - * weight = 13, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgImageWidth extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLatitude.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLatitude.php deleted file mode 100644 index e1db6f070..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLatitude.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:latitude' meta tag. - * - * @MetatagTag( - * id = "og_latitude", - * label = @Translation("Latitude"), - * description = @Translation(""), - * name = "og:latitude", - * group = "open_graph", - * weight = 16, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgLatitude extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocale.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocale.php deleted file mode 100644 index 9b3905e3c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocale.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:locale' meta tag. - * - * @MetatagTag( - * id = "og_locale", - * label = @Translation("Locale"), - * description = @Translation("The locale these tags are marked up in, must be in the format language_TERRITORY. Default is 'en_US'."), - * name = "og:locale", - * group = "open_graph", - * weight = 26, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgLocale extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocaleAlternative.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocaleAlternative.php deleted file mode 100644 index 60270cc6e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocaleAlternative.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:locale:alternate' meta tag. - * - * @MetatagTag( - * id = "og_locale_alternative", - * label = @Translation("Alternative locales"), - * description = @Translation("Other locales this content is available in, must be in the format language_TERRITORY, e.g. 'fr_FR'."), - * name = "og:locale:alternate", - * group = "open_graph", - * weight = 27, - * type = "string", - * secure = FALSE, - * multiple = TRUE - * ) - */ -class OgLocaleAlternative extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocality.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocality.php deleted file mode 100644 index 6311367ee..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLocality.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:locality' meta tag. - * - * @MetatagTag( - * id = "og_locality", - * label = @Translation("Locality"), - * description = @Translation(""), - * name = "og:locality", - * group = "open_graph", - * weight = 19, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgLocality extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLongitude.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLongitude.php deleted file mode 100644 index a25c59cf4..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgLongitude.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:longitude' meta tag. - * - * @MetatagTag( - * id = "og_longitude", - * label = @Translation("Longitude"), - * description = @Translation(""), - * name = "og:longitude", - * group = "open_graph", - * weight = 16, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgLongitude extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPhoneNumber.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPhoneNumber.php deleted file mode 100644 index 27f8503c2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPhoneNumber.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:phone_number' meta tag. - * - * @MetatagTag( - * id = "og_phone_number", - * label = @Translation("Phone number"), - * description = @Translation(""), - * name = "og:phone_number", - * group = "open_graph", - * weight = 24, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgPhoneNumber extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPostalCode.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPostalCode.php deleted file mode 100644 index 3e3f2fe00..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgPostalCode.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:postal_code' meta tag. - * - * @MetatagTag( - * id = "og_postal_code", - * label = @Translation("Postal/ZIP code"), - * description = @Translation(""), - * name = "og:postal_code", - * group = "open_graph", - * weight = 21, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgPostalCode extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgRegion.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgRegion.php deleted file mode 100644 index 7bda64b5b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgRegion.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:region' meta tag. - * - * @MetatagTag( - * id = "og_region", - * label = @Translation("Region"), - * description = @Translation(""), - * name = "og:region", - * group = "open_graph", - * weight = 20, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgRegion extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSeeAlso.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSeeAlso.php deleted file mode 100644 index 235ea1e57..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSeeAlso.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:see_also' meta tag. - * - * @MetatagTag( - * id = "og_see_also", - * label = @Translation("See also"), - * description = @Translation("URLs to related content"), - * name = "og:see_also", - * group = "open_graph", - * weight = 16, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgSeeAlso extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSiteName.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSiteName.php deleted file mode 100644 index ce1e1fdbd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgSiteName.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Site name" meta tag. - * - * @MetatagTag( - * id = "og_site_name", - * label = @Translation("Site name"), - * description = @Translation("A human-readable name for the site, e.g., <em>IMDb</em>."), - * name = "og:site_name", - * group = "open_graph", - * weight = 1, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgSiteName extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php deleted file mode 100644 index 79795a94e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:street_address' meta tag. - * - * @MetatagTag( - * id = "og_street_address", - * label = @Translation("Street address"), - * description = @Translation(""), - * name = "og:street_address", - * group = "open_graph", - * weight = 18, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgStreetAddress extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgTitle.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgTitle.php deleted file mode 100644 index 8929887bf..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgTitle.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Title" meta tag. - * - * @MetatagTag( - * id = "og_title", - * label = @Translation("Title"), - * description = @Translation("The title of the content, e.g., <em>The Rock</em>."), - * name = "og:title", - * group = "open_graph", - * weight = 4, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgTitle extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php deleted file mode 100644 index cc2fc11bf..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "Type" meta tag. - * - * @MetatagTag( - * id = "og_type", - * label = @Translation("Content type"), - * description = @Translation("The type of the content, e.g., <em>movie</em>."), - * name = "og:type", - * group = "open_graph", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgType extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php deleted file mode 100644 index 6dd6e45a7..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:updated_time' meta tag. - * - * @MetatagTag( - * id = "og_updated_time", - * label = @Translation("Content modification date & time"), - * description = @Translation("The date this content was last modified, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format. Can be the same as the 'Article modification date' tag."), - * name = "og:updated_time", - * group = "open_graph", - * weight = 15, - * type = "date", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgUpdatedTime extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php deleted file mode 100644 index dd49eedf5..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * The Open Graph "URL" meta tag. - * - * @MetatagTag( - * id = "og_url", - * label = @Translation("Page URL"), - * description = @Translation("Preferred page location or URL to help eliminate duplicate content for search engines, e.g., <em>http://www.imdb.com/title/tt0117500/</em>."), - * name = "og:url", - * group = "open_graph", - * weight = 3, - * type = "uri", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class OgUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php deleted file mode 100644 index f68831485..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:video' meta tag. - * - * @MetatagTag( - * id = "og_video", - * label = @Translation("Video URL"), - * description = @Translation("The URL of an video which should represent the content. For best results use a source that is at least 1200 x 630 pixels in size, but at least 600 x 316 pixels is a recommended minimum. Object types supported include video.episode, video.movie, video.other, and video.tv_show."), - * name = "og:video", - * group = "open_graph", - * weight = 9, - * type = "video", - * secure = FALSE, - * multiple = TRUE, - * absolute_url = TRUE - * ) - */ -class OgVideo extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoHeight.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoHeight.php deleted file mode 100644 index d8d0caaca..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoHeight.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:video:height' meta tag. - * - * @MetatagTag( - * id = "og_video_height", - * label = @Translation("Video height"), - * description = @Translation("The height of the above video(s). Note: if both the unsecured and secured videos are provided, they should both be the same size."), - * name = "og:video:height", - * group = "open_graph", - * weight = 14, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgVideoHeight extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoSecureUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoSecureUrl.php deleted file mode 100644 index 41003ce74..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoSecureUrl.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:video:secure_url' meta tag. - * - * @MetatagTag( - * id = "og_video_secure_url", - * label = @Translation("Video Secure URL"), - * description = @Translation("The secure URL (HTTPS) of an video which should represent the content. The video must be at least 50px by 50px and have a maximum aspect ratio of 3:1. Supports PNG, JPEG and GIF formats. All 'http://' URLs will automatically be converted to 'https://'."), - * name = "og:video:secure_url", - * group = "open_graph", - * weight = 11, - * type = "video", - * secure = TRUE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class OgVideoSecureUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoType.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoType.php deleted file mode 100644 index 10b79382e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoType.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:video:type' meta tag. - * - * @MetatagTag( - * id = "og_video_type", - * label = @Translation("Video type"), - * description = @Translation("The type of video referenced above. Should be either video.episode, video.movie, video.other, and video.tv_show. Note: there should be one value for each video, and having more than there are videos may cause problems."), - * name = "og:video:type", - * group = "open_graph", - * weight = 12, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgVideoType extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoWidth.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoWidth.php deleted file mode 100644 index 5ae8a4e87..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideoWidth.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'og:video:width' meta tag. - * - * @MetatagTag( - * id = "og_video_width", - * label = @Translation("Video width"), - * description = @Translation("The height of the above video(s). Note: if both the unsecured and secured videos are provided, they should both be the same size."), - * name = "og:video:width", - * group = "open_graph", - * weight = 13, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OgVideoWidth extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Tests/MetatagOpenGraphTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Tests/MetatagOpenGraphTagsTest.php deleted file mode 100644 index af726e8e0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Tests/MetatagOpenGraphTagsTest.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Open Graph tags work correctly. - * - * @group metatag - */ -class MetatagOpenGraphTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'article_author', - 'article_expiration_time', - 'article_modified_time', - 'article_published_time', - 'article_publisher', - 'article_section', - 'article_tag', - 'book_author', - 'book_isbn', - 'book_releasedate', - 'book_tag', - 'og_country_name', - 'og_description', - 'og_determiner', - 'og_email', - 'og_fax_number', - 'og_image', - 'og_image_alt', - 'og_image_height', - 'og_image_secure_url', - 'og_image_type', - 'og_image_url', - 'og_image_width', - 'og_latitude', - 'og_locale', - 'og_locale_alternative', - 'og_locality', - 'og_longitude', - 'og_phone_number', - 'og_postal_code', - 'og_region', - 'og_see_also', - 'og_site_name', - 'og_street_address', - 'og_title', - 'og_type', - 'og_updated_time', - 'og_url', - 'og_video', - 'og_video_height', - 'og_video_secure_url', - 'og_video_type', - 'og_video_width', - ]; - - /** - * {@inheritdoc} - */ - private $testTag = 'meta'; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'property'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_open_graph'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - // Replace the first underline with a colon. - $tag_name = str_replace('og_', 'og:', $tag_name); - $tag_name = str_replace('article_', 'article:', $tag_name); - $tag_name = str_replace('book_', 'book:', $tag_name); - - // Some tags have an additional underline that turns into a colon. - $tag_name = str_replace('og:image_', 'og:image:', $tag_name); - $tag_name = str_replace('og:video_', 'og:video:', $tag_name); - - // Additional fixes. - if ($tag_name == 'og:locale_alternative') { - $tag_name = 'og:locale:alternate'; - } - - return $tag_name; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/config/schema/metatag_open_graph_products.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/config/schema/metatag_open_graph_products.metatag_tag.schema.yml deleted file mode 100644 index 68d0e014a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/config/schema/metatag_open_graph_products.metatag_tag.schema.yml +++ /dev/null @@ -1,6 +0,0 @@ -metatag.metatag_tag.og_price_amount: - type: label - label: 'Open Graph Product: Price amount' -metatag.metatag_tag.og_price_currency: - type: label - label: 'Open Graph Product: Price currency' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml deleted file mode 100644 index 2e7721e51..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Metatag: Open Graph Products' -type: module -description: Provides additional Open Graph Protocol meta tags for describing products. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - - metatag:metatag_open_graph - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.module b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.module deleted file mode 100644 index e059787b0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/metatag_open_graph_products.module +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_open_graph_products.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; - -/** - * Implements hook_help(). - */ -function metatag_open_graph_products_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - // Main module help for the metatag_open_graph_products module. - case 'help.page.metatag_open_graph_products': - $output = ''; - $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('Provides additional Open Graph Protocol meta tags for describing products.') . '</p>'; - return $output; - - default: - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php deleted file mode 100644 index 3a254cb23..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph_products\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * Provides a plugin for the 'Open Graph - Products' meta tag group. - * - * @MetatagGroup( - * id = "open_graph_products", - * label = @Translation("Open Graph - Products"), - * description = @Translation("These Open Graph meta tags are for describing products."), - * weight = 0, - * ) - */ -class OpenGraphProducts extends GroupBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceAmount.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceAmount.php deleted file mode 100644 index 0d73285ef..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceAmount.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph_products\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'product:price:amount' meta tag. - * - * @MetatagTag( - * id = "product_price_amount", - * label = @Translation("Product price amount"), - * description = @Translation("The price amount of the product."), - * name = "product:price:amount", - * group = "open_graph_products", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ProductPriceAmount extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceCurrency.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceCurrency.php deleted file mode 100644 index 74536ae7f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Tag/ProductPriceCurrency.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph_products\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'product:price:currency' meta tag. - * - * @MetatagTag( - * id = "product_price_currency", - * label = @Translation("Product price currency"), - * description = @Translation("The price currency of the product."), - * name = "product:price:currency", - * group = "open_graph_products", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ProductPriceCurrency extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Tests/MetatagOpenGraphProductsTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Tests/MetatagOpenGraphProductsTagsTest.php deleted file mode 100644 index 3af3a2ac6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Tests/MetatagOpenGraphProductsTagsTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\metatag_open_graph_products\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Open Graph Product tags work correctly. - * - * @group metatag - */ -class MetatagOpenGraphProductsTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'product_price_amount', - 'product_price_currency', - ]; - - /** - * {@inheritdoc} - */ - private $testTag = 'meta'; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'property'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_open_graph_products'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - // Replace the underlines with a colon. - $tag_name = str_replace('_', ':', $tag_name); - - return $tag_name; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.info.yml deleted file mode 100644 index 4da08b567..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Metatag Page Manager -type: module -description: Provides metatag support for Page Manager variants. -# core: 8.x -package: SEO -dependencies: - - page_manager:page_manager - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.module b/sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.module deleted file mode 100644 index 68e0a5ba8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/metatag_page_manager.module +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -/** - * @file - * Contains metatag_page_manager.module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\page_manager\Entity\PageVariant; -use Drupal\metatag\Entity\MetatagDefaults; - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function metatag_page_manager_form_metatag_defaults_add_form_alter(&$form, FormStateInterface $form_state, $form_id) { - $variants_options['Page Variants'] = _metatag_page_manager_get_variants(); - $form['id']['#options'] = array_merge($form['id']['#options'], $variants_options); -} - -/** - * Implements hook_page_attachments(). - */ -function metatag_page_manager_page_attachments(array &$attachments) { - // Fetch entity from request. - $entity = \Drupal::request()->attributes->get('_entity'); - if ($entity) { - - $key = $entity->getEntityType()->id() . '__' . $entity->id(); - // Get default metatags. - $metatag_defaults = metatag_get_default_tags(); - // Load page variant metatags. - $metatag_variant = MetatagDefaults::load($key); - if ($metatag_variant) { - // Overwrite the metatag defaults with the tags of the page variant. - $metatag_defaults = array_merge($metatag_defaults, $metatag_variant->get('tags')); - - // Set the metatag in the static metatag attachments parameter so the - // metatag module wouldn't overwrite them. - $metatag_attachments = &drupal_static('metatag_attachments'); - - $metatag_manager = \Drupal::service('metatag.manager'); - $metatag_attachments = $metatag_manager->generateElements($metatag_defaults, $entity); - - // If any Metatag items were found, append them. - if (!empty($metatag_attachments['#attached']['html_head'])) { - if (empty($attachments['#attached'])) { - $attachments['#attached'] = []; - } - if (empty($attachments['#attached']['html_head'])) { - $attachments['#attached']['html_head'] = []; - } - foreach ($metatag_attachments['#attached']['html_head'] as $item) { - $attachments['#attached']['html_head'][] = $item; - } - } - } - } -} - -/** - * Returns all available page variants. - * - * @return string[] - * A list of page variants keyed by label. - */ -function _metatag_page_manager_get_variants() { - /** @var \Drupal\page_manager\Entity\PageVariant[] $variants */ - $variants = PageVariant::loadMultiple(); - $variant_options = []; - // Load all metatag defaults so we can filter the variants which already have - // a metatag default configured. - $metatag_defaults = MetatagDefaults::loadMultiple(); - foreach ($variants as $key => $variant) { - $id = $variant->getEntityType()->id() . '__' . $key; - if (!isset($metatag_defaults[$id])) { - $label = $variant->getPage()->label() . ' : ' . $variant->label(); - $variant_options[$id] = $label; - } - } - return $variant_options; -} - -/** - * Implements hook_metatag_alter(). - */ -function metatag_page_manager_metatags_alter(array &$metatags, array &$context) { - if (!$context['entity'] instanceof PageVariant) { - return; - } - - $key = $context['entity']->getEntityType()->id() . '__' . $context['entity']->id(); - $metatag_variant = MetatagDefaults::load($key); - if ($metatag_variant) { - $metatags = array_merge($metatags, $metatag_variant->get('tags')); - } -} - -/** - * Implements hook_metatag_route_entity(). - */ -function metatag_page_manager_metatag_route_entity(RouteMatchInterface $route_match) { - if ($variant = $route_match->getParameter('page_manager_page_variant')) { - return $variant; - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php b/sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php deleted file mode 100644 index 14c228966..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php - -namespace Drupal\metatag_page_manager\Tests\Functional; - -use Drupal\page_manager\Entity\Page; -use Drupal\page_manager\Entity\PageVariant; -use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\metatag\Functional\MetatagHelperTrait; - -/** - * Confirm the Page Manager integration works. - * - * @group metatag - */ -class MetatagPageManagerTest extends BrowserTestBase { - - use MetatagHelperTrait; - - /** - * {@inheritdoc} - */ - public static $modules = [ - // This module. - 'metatag_page_manager', - ]; - - /** - * The assert session object. - * - * @var \Drupal\Tests\WebAssert - */ - public $assertSession; - - /** - * {@inheritdoc} - */ - public function setUp() { - // TODO: Change the autogenerated stub. - parent::setUp(); - - $this->assertSession = $this->assertSession(); - - Page::create([ - 'id' => 'metatag_page_manager_test', - 'label' => 'Metatag Page', - 'path' => '/metatag-test', - ])->save(); - PageVariant::create([ - 'id' => 'metatag_page_manager_variant_test', - 'variant' => 'block_display', - 'label' => 'Metatag Variant', - 'page' => 'metatag_page_manager_test', - 'weight' => 10, - ])->save(); - - \Drupal::service("router.builder")->rebuild(); - - // Log in as user 1. - $this->loginUser1(); - } - - /** - * Tests a single variant page. - */ - public function testSingleVariantPage() { - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - - // Confirm what the page title looks like by default. - $this->assertSession->titleEquals('Metatag Page | Drupal'); - - // Create the Metatag object through the UI to check the custom label. - $edit = [ - 'id' => 'page_variant__metatag_page_manager_variant_test', - 'title' => 'My title', - ]; - - $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save'); - $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Variant'); - - // Clear caches to load the right metatags. - drupal_flush_all_caches(); - - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - - // Confirm what the page title is overridden. - $this->assertSession->titleEquals('My title'); - } - - /** - * Tests a single variant page. - */ - public function testMultipleVariantPage() { - // Add a new variant. - $new_variant = PageVariant::create([ - 'id' => 'metatag_page_manager_multiple_variant_test', - 'variant' => 'block_display', - 'label' => 'Metatag Multiple Variant', - 'page' => 'metatag_page_manager_test', - 'weight' => 0, - ]); - $anonymous_selection = [ - 'id' => 'user_role', - 'roles' => [ - 'anonymous' => 'anonymous', - ], - 'negate' => FALSE, - 'context_mapping' => [ - 'user' => 'current_user', - ], - ]; - $new_variant->set('selection_criteria', [$anonymous_selection]); - $new_variant->save(); - - // Clear caches to load the right metatags. - drupal_flush_all_caches(); - - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - - // Confirm what the page title looks like by default. - $this->assertSession->titleEquals('Metatag Page | Drupal'); - - // Create the Metatag object through the UI to check the custom label. - $edit = [ - 'id' => 'page_variant__metatag_page_manager_variant_test', - 'title' => 'My title', - ]; - - $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save'); - $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Variant'); - - // Clear caches to load the right metatags. - drupal_flush_all_caches(); - - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - - // Confirm what the page title is overridden. - $this->assertSession->titleEquals('My title'); - - // Visiting page as anon user, should get the default title. - $this->drupalLogout(); - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - - // Confirm what the page title looks like by default. - $this->assertSession->titleEquals('Metatag Page | Drupal'); - - // Login and add custom metatag for anonymous user variant. - $this->loginUser1(); - // Create the Metatag object through the UI to check the custom label. - $edit = [ - 'id' => 'page_variant__metatag_page_manager_multiple_variant_test', - 'title' => 'My title anonymous', - ]; - - $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save'); - $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Multiple Variant'); - - // Clear caches to load the right metatags. - drupal_flush_all_caches(); - - // Visit page as logged in user and confirm the right title. - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - $this->assertSession->titleEquals('My title'); - - // Visit page as anonymous user and confirm the right title. - $this->drupalLogout(); - $this->drupalGet('/metatag-test'); - $this->assertSession->statusCodeEquals(200); - $this->assertSession->titleEquals('My title anonymous'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml deleted file mode 100644 index 979e744df..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml +++ /dev/null @@ -1,25 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.pinterest_description: - type: text - label: 'Pinterest: Description' -metatag.metatag_tag.pinterest_id: - type: label - label: 'Pinterest: ID' -metatag.metatag_tag.pinterest_media: - type: label - label: 'Pinterest: Media' -metatag.metatag_tag.pinterest_nohover: - type: label - label: 'Pinterest: No hover' -metatag.metatag_tag.pinterest_nopin: - type: label - label: 'Pinterest: No pin' -metatag.metatag_tag.pinterest_nosearch: - type: label - label: 'Pinterest: No search' -metatag.metatag_tag.pinterest_url: - type: label - label: 'Pinterest: URL' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml deleted file mode 100644 index 3f9142325..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Pinterest' -type: module -description: Provides support for Pinterest's custom meta tags. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php deleted file mode 100644 index 975f5c3dd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The Pinterest group. - * - * @MetatagGroup( - * id = "pinterest", - * label = @Translation("Pinterest"), - * description = @Translation("A set of meta tags used to control how the site's content is consumed by <a href='https://pinterest.com/'>Pinterest</a>."), - * weight = 4 - * ) - */ -class Pinterest extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php deleted file mode 100644 index bd3fe2e6c..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'pin:description' meta tag. - * - * @MetatagTag( - * id = "pinterest_description", - * label = @Translation("Description"), - * description = @Translation("A one to two sentence description of the content."), - * name = "pin:description", - * group = "pinterest", - * weight = 8, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestDescription extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestId.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestId.php deleted file mode 100644 index 346a197a2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestId.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'pin:id' meta tag. - * - * @MetatagTag( - * id = "pinterest_id", - * label = @Translation("Id"), - * description = @Translation("The Canonical Pinterest object to pin."), - * name = "pin:id", - * group = "pinterest", - * weight = 5, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestId extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestMedia.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestMedia.php deleted file mode 100644 index c59e04292..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestMedia.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'pin:media' meta tag. - * - * @MetatagTag( - * id = "pinterest_media", - * label = @Translation("Media"), - * description = @Translation("The URL of media which should represent the content."), - * name = "pin:media", - * group = "pinterest", - * weight = 6, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestMedia extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNohover.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNohover.php deleted file mode 100644 index f725e441a..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNohover.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Pinterest "nohover" meta tag. - * - * @MetatagTag( - * id = "pinterest_nohover", - * label = @Translation("No hover"), - * description = @Translation("Do not show hovering Save or Search buttons, generated by the Pinterest browser extensions."), - * name = "pinterest", - * group = "pinterest", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestNohover extends MetaNameBase { - - /** - * {@inheritdoc} - */ - public function form(array $element = []) { - $form = [ - '#type' => 'checkbox', - '#title' => $this->label(), - '#description' => $this->description(), - '#default_value' => ($this->value === 'nohover') ?: '', - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#element_validate' => [[get_class($this), 'validateTag']], - '#return_value' => 'nohover', - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php deleted file mode 100644 index 5e0265340..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Pinterest "nopin" meta tag. - * - * @MetatagTag( - * id = "pinterest_nopin", - * label = @Translation("No pin"), - * description = @Translation("Do not pin anything from this page. When selected, this option will take precedence over all options below."), - * name = "pinterest", - * group = "pinterest", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestNopin extends MetaNameBase { - - /** - * {@inheritdoc} - */ - public function form(array $element = []) { - $form = [ - '#type' => 'checkbox', - '#title' => $this->label(), - '#description' => $this->description(), - '#default_value' => ($this->value === 'nopin') ?: '', - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#element_validate' => [[get_class($this), 'validateTag']], - '#return_value' => 'nopin', - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php deleted file mode 100644 index 9c0c9437b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Pinterest "nosearch" meta tag. - * - * @MetatagTag( - * id = "pinterest_nosearch", - * label = @Translation("No search"), - * description = @Translation("Do not allow Pinterest visual search to happen from this page."), - * name = "pinterest", - * group = "pinterest", - * weight = 3, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestNosearch extends MetaNameBase { - - /** - * {@inheritdoc} - */ - public function form(array $element = []) { - $form = [ - '#type' => 'checkbox', - '#title' => $this->label(), - '#description' => $this->description(), - '#default_value' => ($this->value === 'nosearch') ?: '', - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#element_validate' => [[get_class($this), 'validateTag']], - '#return_value' => 'nosearch', - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php deleted file mode 100644 index 1ca92be5d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaPropertyBase; - -/** - * Provides a plugin for the 'pin:url' meta tag. - * - * @MetatagTag( - * id = "pinterest_url", - * label = @Translation("URL"), - * description = @Translation("The URL which should represent the content."), - * name = "pin:url", - * group = "pinterest", - * weight = 7, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class PinterestUrl extends MetaPropertyBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Tests/MetatagPinterestTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Tests/MetatagPinterestTagsTest.php deleted file mode 100644 index 06d5cbe6d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Tests/MetatagPinterestTagsTest.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -namespace Drupal\metatag_pinterest\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Pinterest tags work correctly. - * - * @group metatag - */ -class MetatagPinterestTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'pinterest_description', - 'pinterest_id', - 'pinterest_media', - 'pinterest_nopin', - 'pinterest_nohover', - 'pinterest_nosearch', - 'pinterest_url', - ]; - - /** - * {@inheritdoc} - */ - private $testTag = 'meta'; - - /** - * {@inheritdoc} - */ - private $testNameAttribute = 'property'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_pinterest'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - if ($tag_name == ('pinterest_nopin' || 'pinterest_nohover' || 'pinterest_nosearch')) { - $tag_name = 'pinterest'; - } - else { - // Replace "pinterest_" with "pin:". - $tag_name = str_replace('pinterest_', 'pin:', $tag_name); - } - - return $tag_name; - } - - /** - * Implements {tag_name}TestFieldXpath() for 'pinterest'. - */ - private function pinterestTestFieldXpath() { - return "//input[@name='pinterest[index]' and @type='checkbox']"; - } - - /** - * Implements {tag_name}TestKey() for 'pinterest'. - */ - private function pinterestTestKey() { - return 'pinterest[index]'; - } - - /** - * Implements {tag_name}TestValue() for 'pinterest'. - */ - private function pinterestTestValue() { - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/config/schema/metatag_twitter_cards.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/config/schema/metatag_twitter_cards.metatag_tag.schema.yml deleted file mode 100644 index 78ce79f2f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/config/schema/metatag_twitter_cards.metatag_tag.schema.yml +++ /dev/null @@ -1,112 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.twitter_cards_app_id_googleplay: - type: label - label: 'Twitter Cards: Google Play app ID' -metatag.metatag_tag.twitter_cards_app_id_ipad: - type: label - label: 'Twitter Cards: iPad app ID' -metatag.metatag_tag.twitter_cards_app_id_iphone: - type: label - label: 'Twitter Cards: iPhone app ID' -metatag.metatag_tag.twitter_cards_app_name_googleplay: - type: label - label: 'Twitter Cards: Google Play app name' -metatag.metatag_tag.twitter_cards_app_name_ipad: - type: label - label: 'Twitter Cards: iPad app name' -metatag.metatag_tag.twitter_cards_app_name_iphone: - type: label - label: 'Twitter Cards: iPhone app name' -metatag.metatag_tag.twitter_cards_app_store_country: - type: label - label: 'Twitter Cards: App store country' -metatag.metatag_tag.twitter_cards_app_url_googleplay: - type: label - label: 'Twitter Cards: Google Play app URL schema' -metatag.metatag_tag.twitter_cards_app_url_ipad: - type: label - label: 'Twitter Cards: iPad app URL schema' -metatag.metatag_tag.twitter_cards_app_url_iphone: - type: label - label: 'Twitter Cards: iPhone app URL schema' -metatag.metatag_tag.twitter_cards_creator: - type: label - label: "Twitter Cards: Creator's Twitter account" -metatag.metatag_tag.twitter_cards_creator_id: - type: label - label: "Twitter Cards: Creator's Twitter account ID" -metatag.metatag_tag.twitter_cards_data1: - type: label - label: 'Twitter Cards: Data 1' -metatag.metatag_tag.twitter_cards_data2: - type: label - label: 'Twitter Cards: Data 2' -metatag.metatag_tag.twitter_cards_description: - type: text - label: 'Twitter Cards: Description' -metatag.metatag_tag.twitter_cards_donottrack: - type: label - label: 'Twitter Cards: Do Not Track' -metatag.metatag_tag.twitter_cards_gallery_image0: - type: label - label: 'Twitter Cards: 1st gallery image' -metatag.metatag_tag.twitter_cards_gallery_image1: - type: label - label: 'Twitter Cards: 2nd gallery image' -metatag.metatag_tag.twitter_cards_gallery_image2: - type: label - label: 'Twitter Cards: 3rd gallery image' -metatag.metatag_tag.twitter_cards_gallery_image3: - type: label - label: 'Twitter Cards: 4th gallery image' -metatag.metatag_tag.twitter_cards_image: - type: label - label: 'Twitter Cards: Image URL' -metatag.metatag_tag.twitter_cards_image_height: - type: label - label: 'Twitter Cards: Image height' -metatag.metatag_tag.twitter_cards_image_width: - type: label - label: 'Twitter Cards: Image width' -metatag.metatag_tag.twitter_cards_image_alt: - type: label - label: 'Twitter Cards: Image alternative text' -metatag.metatag_tag.twitter_cards_label1: - type: label - label: 'Twitter Cards: Label 1' -metatag.metatag_tag.twitter_cards_label2: - type: label - label: 'Twitter Cards: Label 2' -metatag.metatag_tag.twitter_cards_page_url: - type: label - label: 'Twitter Cards: Page URL' -metatag.metatag_tag.twitter_cards_player: - type: label - label: 'Twitter Cards: Media player URL' -metatag.metatag_tag.twitter_cards_player_height: - type: label - label: 'Twitter Cards: Media player height' -metatag.metatag_tag.twitter_cards_player_stream: - type: label - label: 'Twitter Cards: MP4 media stream URL' -metatag.metatag_tag.twitter_cards_player_stream_content_type: - type: label - label: 'Twitter Cards: MP4 media straem MIME-type' -metatag.metatag_tag.twitter_cards_player_width: - type: label - label: 'Twitter Cards: Media player width' -metatag.metatag_tag.twitter_cards_site: - type: label - label: "Twitter Cards: Site's Twitter account" -metatag.metatag_tag.twitter_cards_site_id: - type: label - label: "Twitter Cards: Site's Twitter account ID" -metatag.metatag_tag.twitter_cards_title: - type: label - label: 'Twitter Cards: Title' -metatag.metatag_tag.twitter_cards_type: - type: label - label: 'Twitter Cards: Type' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml deleted file mode 100644 index ba3461f19..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/metatag_twitter_cards.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Twitter Cards' -type: module -description: Provides support for Twitter's Card meta tags. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Group/TwitterCards.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Group/TwitterCards.php deleted file mode 100644 index 05c064841..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Group/TwitterCards.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The TwitterCards group. - * - * @MetatagGroup( - * id = "twitter_cards", - * label = @Translation("Twitter Cards"), - * description = @Translation("A set of meta tags specially for controlling the summaries displayed when content is shared on <a href='https://twitter.com/'>Twitter</a>."), - * weight = 4 - * ) - */ -class TwitterCards extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php deleted file mode 100644 index 2bb98f487..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app id for Google Play metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_id_googleplay", - * label = @Translation("Google Play app ID"), - * description = @Translation("Your app ID in the Google Play Store (i.e. ""com.android.app"")."), - * name = "twitter:app:id:googleplay", - * group = "twitter_cards", - * weight = 307, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppIdGooglePlay extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIpad.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIpad.php deleted file mode 100644 index fe03147b2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIpad.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app id for ipad metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_id_ipad", - * label = @Translation("iPad app ID"), - * description = @Translation("String value, should be the numeric representation of your iPad app's ID in the App Store."), - * name = "twitter:app:id:ipad", - * group = "twitter_cards", - * weight = 304, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppIdIpad extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIphone.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIphone.php deleted file mode 100644 index bb837ad08..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdIphone.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app id for iphone metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_id_iphone", - * label = @Translation("iPhone app ID"), - * description = @Translation("String value, should be the numeric representation of your iPhone app's ID in the App Store."), - * name = "twitter:app:id:iphone", - * group = "twitter_cards", - * weight = 302, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppIdIphone extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameGooglePlay.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameGooglePlay.php deleted file mode 100644 index 91dd63ff2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameGooglePlay.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app name Google Play metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_name_googleplay", - * label = @Translation("Google Play app name"), - * description = @Translation("The name of the app in the Google Play app store."), - * name = "twitter:app:name:googleplay", - * group = "twitter_cards", - * weight = 306, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppNameGooglePlay extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIpad.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIpad.php deleted file mode 100644 index a16922e0d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIpad.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app name for ipad metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_name_ipad", - * label = @Translation("iPad app name"), - * description = @Translation("The name of the iPad app."), - * name = "twitter:app:name:ipad", - * group = "twitter_cards", - * weight = 303, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppNameIpad extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIphone.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIphone.php deleted file mode 100644 index e95fc0e49..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppNameIphone.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app name for iphone metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_name_iphone", - * label = @Translation("iPhone app name"), - * description = @Translation("The name of the iPhone app."), - * name = "twitter:app:name:iphone", - * group = "twitter_cards", - * weight = 301, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppNameIphone extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppStoreCountry.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppStoreCountry.php deleted file mode 100644 index daa8db184..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppStoreCountry.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app store country code metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_store_country", - * label = @Translation("App store country"), - * description = @Translation("If your application is not available in the US App Store, you must set this value to the two-letter country code for the App Store that contains your application."), - * name = "twitter:app:country", - * group = "twitter_cards", - * weight = 300, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppStoreCountry extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlGooglePlay.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlGooglePlay.php deleted file mode 100644 index eee312155..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlGooglePlay.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app's custom URL scheme for Google Play metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_url_googleplay", - * label = @Translation("Google Play app's custom URL scheme"), - * description = @Translation("The Google Play app's custom URL scheme (must include ""://"" after the scheme name)."), - * name = "twitter:app:url:googleplay", - * group = "twitter_cards", - * weight = 308, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppUrlGooglePlay extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIpad.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIpad.php deleted file mode 100644 index 784d6fd65..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIpad.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app's custom URL scheme for ipad metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_url_ipad", - * label = @Translation("iPad app's custom URL scheme"), - * description = @Translation("The iPad app's custom URL scheme (must include ""://"" after the scheme name)."), - * name = "twitter:app:url:ipad", - * group = "twitter_cards", - * weight = 305, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppUrlIpad extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIphone.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIphone.php deleted file mode 100644 index ad1987e95..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppUrlIphone.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards app's custom URL scheme for iphone metatag. - * - * @MetatagTag( - * id = "twitter_cards_app_url_iphone", - * label = @Translation("iPhone app's custom URL scheme"), - * description = @Translation("The iPhone app's custom URL scheme (must include ""://"" after the scheme name)."), - * name = "twitter:app:url:iphone", - * group = "twitter_cards", - * weight = 302, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsAppUrlIphone extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreator.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreator.php deleted file mode 100644 index 597af1345..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreator.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards creator meta tag. - * - * @MetatagTag( - * id = "twitter_cards_creator", - * label = @Translation("Creator's Twitter account"), - * description = @Translation("The @username for the content creator / author for this page, including the @ symbol."), - * name = "twitter:creator", - * group = "twitter_cards", - * weight = 4, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsCreator extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreatorId.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreatorId.php deleted file mode 100644 index 28ec9a978..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsCreatorId.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards creator id metatag. - * - * @MetatagTag( - * id = "twitter_cards_creator_id", - * label = @Translation("Creator's Twitter account ID"), - * description = @Translation("The numerical Twitter account ID for the content creator / author for this page."), - * name = "twitter:creator:id", - * group = "twitter_cards", - * weight = 4, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsCreatorId extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData1.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData1.php deleted file mode 100644 index af57e20ae..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData1.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'twitter:data1' meta tag. - * - * @MetatagTag( - * id = "twitter_cards_data1", - * label = @Translation("Data 1"), - * description = @Translation("This field expects a string, and allows you to specify the types of data you want to offer (price, country, etc.)."), - * name = "twitter:data1", - * group = "twitter_cards", - * weight = 501, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsData1 extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData2.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData2.php deleted file mode 100644 index ff3ff6571..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsData2.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'twitter:data2' meta tag. - * - * @MetatagTag( - * id = "twitter_cards_data2", - * label = @Translation("Data 2"), - * description = @Translation("This field expects a string, and allows you to specify the types of data you want to offer (price, country, etc.)."), - * name = "twitter:data2", - * group = "twitter_cards", - * weight = 503, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsData2 extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDescription.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDescription.php deleted file mode 100644 index eb3cdbb4b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDescription.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards site's description. - * - * @MetatagTag( - * id = "twitter_cards_description", - * label = @Translation("Description"), - * description = @Translation("A description that concisely summarizes the content of the page, as appropriate for presentation within a Tweet. Do not re-use the title text as the description, or use this field to describe the general services provided by the website. The string will be truncated, by Twitter, at the word to 200 characters."), - * name = "twitter:description", - * group = "twitter_cards", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsDescription extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDoNotTrack.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDoNotTrack.php deleted file mode 100644 index 1d30b0d03..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsDoNotTrack.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards DNT option. - * - * @MetatagTag( - * id = "twitter_cards_donottrack", - * label = @Translation("Do Not Track"), - * description = @Translation("By default Twitter tracks visitors when a tweet is embedded on a page using the official APIs. Setting this to 'on' will <a href=':url'>stop Twitter from tracking visitors</a>.", arguments = { ":url" = "https://dev.twitter.com/web/overview/privacy#what-privacy-options-do-website-publishers-have" }), - * name = "twitter:dnt", - * group = "twitter_cards", - * weight = 5, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsDoNotTrack extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php deleted file mode 100644 index d0545cdeb..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards gallery image0 metatag. - * - * @MetatagTag( - * id = "twitter_cards_gallery_image0", - * label = @Translation("1st gallery image"), - * description = @Translation("A URL to the image representing the first photo in your gallery. This will be able to extract the URL from an image field."), - * name = "twitter:gallery:image0", - * group = "twitter_cards", - * weight = 200, - * type = "image", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class TwitterCardsGalleryImage0 extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage1.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage1.php deleted file mode 100644 index 8de3792ed..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage1.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards gallery image1 metatag. - * - * @MetatagTag( - * id = "twitter_cards_gallery_image1", - * label = @Translation("2nd gallery image"), - * description = @Translation("A URL to the image representing the second photo in your gallery. This will be able to extract the URL from an image field."), - * name = "twitter:gallery:image1", - * group = "twitter_cards", - * weight = 201, - * type = "image", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class TwitterCardsGalleryImage1 extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage2.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage2.php deleted file mode 100644 index 75816ba2f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage2.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards gallery image2 metatag. - * - * @MetatagTag( - * id = "twitter_cards_gallery_image2", - * label = @Translation("3rd gallery image"), - * description = @Translation("A URL to the image representing the third photo in your gallery. This will be able to extract the URL from an image field."), - * name = "twitter:gallery:image2", - * group = "twitter_cards", - * weight = 202, - * type = "image", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class TwitterCardsGalleryImage2 extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage3.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage3.php deleted file mode 100644 index 1c991b88b..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage3.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards gallery image3 metatag. - * - * @MetatagTag( - * id = "twitter_cards_gallery_image3", - * label = @Translation("4th gallery image"), - * description = @Translation("A URL to the image representing the fourth photo in your gallery. This will be able to extract the URL from an image field."), - * name = "twitter:gallery:image3", - * group = "twitter_cards", - * weight = 203, - * type = "image", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class TwitterCardsGalleryImage3 extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImage.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImage.php deleted file mode 100644 index 4fa71b703..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImage.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards image metatag. - * - * @MetatagTag( - * id = "twitter_cards_image", - * label = @Translation("Image URL"), - * description = @Translation("The URL to a unique image representing the content of the page. Do not use a generic image such as your website logo, author photo, or other image that spans multiple pages. Images larger than 120x120px will be resized and cropped square based on longest dimension. Images smaller than 60x60px will not be shown. If the 'type' is set to Photo then the image must be at least 280x150px. This will be able to extract the URL from an image field."), - * name = "twitter:image", - * group = "twitter_cards", - * weight = 7, - * type = "image", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class TwitterCardsImage extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageAlt.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageAlt.php deleted file mode 100644 index 47bb0b245..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageAlt.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards image alternative text metatag. - * - * @MetatagTag( - * id = "twitter_cards_image_alt", - * label = @Translation("Image alternative text"), - * description = @Translation("The alternative text of the image being linked to. Limited to 420 characters."), - * name = "twitter:image:alt", - * group = "twitter_cards", - * weight = 7, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsImageAlt extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageHeight.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageHeight.php deleted file mode 100644 index a89a36a1e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageHeight.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards image height metatag. - * - * @MetatagTag( - * id = "twitter_cards_image_height", - * label = @Translation("Image height"), - * description = @Translation("The height of the image being linked to, in pixels."), - * name = "twitter:image:height", - * group = "twitter_cards", - * weight = 7, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsImageHeight extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageWidth.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageWidth.php deleted file mode 100644 index 5840f7f72..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsImageWidth.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards image width metatag. - * - * @MetatagTag( - * id = "twitter_cards_image_width", - * label = @Translation("Image width"), - * description = @Translation("The width of the image being linked to, in pixels."), - * name = "twitter:image:width", - * group = "twitter_cards", - * weight = 7, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsImageWidth extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel1.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel1.php deleted file mode 100644 index d6ecaa5bf..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel1.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'twitter:label1' meta tag. - * - * @MetatagTag( - * id = "twitter_cards_label1", - * label = @Translation("Label 1"), - * description = @Translation("This field expects a string, and you can specify values for labels such as price, items in stock, sizes, etc."), - * name = "twitter:label1", - * group = "twitter_cards", - * weight = 500, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsLabel1 extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel2.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel2.php deleted file mode 100644 index 294345f41..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsLabel2.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'twitter:label2' meta tag. - * - * @MetatagTag( - * id = "twitter_cards_label2", - * label = @Translation("Label 2"), - * description = @Translation("This field expects a string, and you can specify values for labels such as price, items in stock, sizes, etc."), - * name = "twitter:label2", - * group = "twitter_cards", - * weight = 502, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsLabel2 extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPageUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPageUrl.php deleted file mode 100644 index d1f53e3ad..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPageUrl.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards site's page url metatag. - * - * @MetatagTag( - * id = "twitter_cards_page_url", - * label = @Translation("Page URL"), - * description = @Translation("The permalink / canonical URL of the current page."), - * name = "twitter:url", - * group = "twitter_cards", - * weight = 6, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsPageUrl extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayer.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayer.php deleted file mode 100644 index 11080d3a0..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayer.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards player metatag. - * - * @MetatagTag( - * id = "twitter_cards_player", - * label = @Translation("Media player URL"), - * description = @Translation("The full URL for loading a media player. Required when using a Media player card."), - * name = "twitter:player", - * group = "twitter_cards", - * weight = 400, - * type = "uri", - * secure = FALSE, - * multiple = FALSE, - * absolute_url = TRUE - * ) - */ -class TwitterCardsPlayer extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerHeight.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerHeight.php deleted file mode 100644 index aaac427a3..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerHeight.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards player height metatag. - * - * @MetatagTag( - * id = "twitter_cards_player_height", - * label = @Translation("Media player height"), - * description = @Translation("The height of the media player iframe, in pixels. Required when using a Media player card."), - * name = "twitter:player:height", - * group = "twitter_cards", - * weight = 402, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsPlayerHeight extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStream.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStream.php deleted file mode 100644 index 0be2723a8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStream.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards player stream url metatag. - * - * @MetatagTag( - * id = "twitter_cards_player_stream", - * label = @Translation("MP4 media stream URL"), - * description = @Translation("The full URL for an MP4 video (h.264) or audio (AAC) stream, takes precidence over the other media player field."), - * name = "twitter:player:stream", - * group = "twitter_cards", - * weight = 403, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsPlayerStream extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStreamContentType.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStreamContentType.php deleted file mode 100644 index 558c7aab2..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerStreamContentType.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards player stream content-type metatag. - * - * @MetatagTag( - * id = "twitter_cards_player_stream_content_type", - * label = @Translation("MP4 media stream MIME-type"), - * description = @Translation("The MIME type for the media contained in the stream URL, as defined by <a href=':url'>RFC 4337</a>.", arguments = { ":url" = "http://tools.ietf.org/rfc/rfc4337.txt" }), - * name = "twitter:player:stream:content_type", - * group = "twitter_cards", - * weight = 404, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsPlayerStreamContentType extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php deleted file mode 100644 index ec0895203..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards player width metatag. - * - * @MetatagTag( - * id = "twitter_cards_player_width", - * label = @Translation("Media player width"), - * description = @Translation("The width of the media player iframe, in pixels. Required when using a Media player card."), - * name = "twitter:player:width", - * group = "twitter_cards", - * weight = 401, - * type = "integer", - * secure = FALSE, - * multiple = FALSE - * ); - */ -class TwitterCardsPlayerWidth extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSite.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSite.php deleted file mode 100644 index 94ed630bf..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSite.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards site's account metatag. - * - * @MetatagTag( - * id = "twitter_cards_site", - * label = @Translation("Site's Twitter account"), - * description = @Translation("The @username for the website, which will be displayed in the Card's footer; must include the @ symbol."), - * name = "twitter:site", - * group = "twitter_cards", - * weight = 2, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsSite extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSiteId.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSiteId.php deleted file mode 100644 index cae9faf06..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsSiteId.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards site's id metatag. - * - * @MetatagTag( - * id = "twitter_cards_site_id", - * label = @Translation("Site's Twitter account ID"), - * description = @Translation("The numerical Twitter account ID for the website, which will be displayed in the Card's footer."), - * name = "twitter:site:id", - * group = "twitter_cards", - * weight = 3, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsSiteId extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsTitle.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsTitle.php deleted file mode 100644 index 268dfa4bd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsTitle.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards title metatag. - * - * @MetatagTag( - * id = "twitter_cards_title", - * label = @Translation("Title"), - * description = @Translation("The page's title, which should be concise; it will be truncated at 70 characters by Twitter. This field is required unless this the 'type' field is set to 'photo'."), - * name = "twitter:title", - * group = "twitter_cards", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsTitle extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php deleted file mode 100644 index 9ae322f50..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * The Twitter Cards Type-tag. - * - * @MetatagTag( - * id = "twitter_cards_type", - * label = @Translation("Twitter card type"), - * description = @Translation("Notes:<ul><li>no other fields are required for a Summary card</li><li>Photo card requires the 'image' field</li><li>Media player card requires the 'title', 'description', 'media player URL', 'media player width', 'media player height' and 'image' fields,</li><li>Summary Card with Large Image card requires the 'Summary' field and the 'image' field,</li><li>Gallery Card requires all the 'Gallery Image' fields,</li><li>App Card requires the 'iPhone app ID' field, the 'iPad app ID' field and the 'Google Play app ID' field,</li><li>Product Card requires the 'description' field, the 'image' field, the 'Label 1' field, the 'Data 1' field, the 'Label 2' field and the 'Data 2' field.</li></ul>"), - * name = "twitter:card", - * group = "twitter_cards", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class TwitterCardsType extends MetaNameBase { - - /** - * {@inheritdoc} - */ - public function form(array $element = []) { - $form = [ - '#type' => 'select', - '#title' => $this->label(), - '#description' => $this->description(), - '#options' => [ - 'summary' => t('Summary Card'), - 'summary_large_image' => t('Summary Card with large image'), - 'photo' => t('Photo Card'), - 'gallery' => t('Gallery Card'), - 'app' => t('App Card'), - 'player' => t('Player Card'), - 'product' => t('Product Card'), - ], - '#empty_option' => t('- None -'), - '#empty_value' => '', - '#default_value' => $this->value(), - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#element_validate' => [[get_class($this), 'validateTag']], - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php deleted file mode 100644 index b718d0156..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -namespace Drupal\metatag_twitter_cards\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Twitter Cards tags work correctly. - * - * @group metatag - */ -class MetatagTwitterCardsTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'twitter_cards_app_id_googleplay', - 'twitter_cards_app_id_ipad', - 'twitter_cards_app_id_iphone', - 'twitter_cards_app_name_googleplay', - 'twitter_cards_app_name_ipad', - 'twitter_cards_app_name_iphone', - 'twitter_cards_app_store_country', - 'twitter_cards_app_url_googleplay', - 'twitter_cards_app_url_ipad', - 'twitter_cards_app_url_iphone', - 'twitter_cards_creator', - 'twitter_cards_creator_id', - 'twitter_cards_data1', - 'twitter_cards_data2', - 'twitter_cards_description', - 'twitter_cards_donottrack', - 'twitter_cards_gallery_image0', - 'twitter_cards_gallery_image1', - 'twitter_cards_gallery_image2', - 'twitter_cards_gallery_image3', - 'twitter_cards_image', - 'twitter_cards_image_alt', - 'twitter_cards_image_height', - 'twitter_cards_image_width', - 'twitter_cards_label1', - 'twitter_cards_label2', - 'twitter_cards_page_url', - 'twitter_cards_player', - 'twitter_cards_player_height', - 'twitter_cards_player_stream', - 'twitter_cards_player_stream_content_type', - 'twitter_cards_player_width', - 'twitter_cards_site', - 'twitter_cards_site_id', - 'twitter_cards_title', - 'twitter_cards_type', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_twitter_cards'; - parent::setUp(); - } - - /** - * Twitter meta tags (almost) all have colons instead of underlines. - * - * They also don't have "cards" in their name. - */ - private function getTestTagName($tag_name) { - $tag_name = str_replace('twitter_cards', 'twitter', $tag_name); - $tag_name = str_replace('_', ':', $tag_name); - - if ($tag_name == 'twitter:app:store:country') { - $tag_name = 'twitter:app:country'; - } - elseif ($tag_name == 'twitter:page:url') { - $tag_name = 'twitter:url'; - } - elseif ($tag_name == 'twitter:player:stream:content:type') { - $tag_name = 'twitter:player:stream:content_type'; - } - elseif ($tag_name == 'twitter:type') { - $tag_name = 'twitter:card'; - } - elseif ($tag_name == 'twitter:donottrack') { - $tag_name = 'twitter:dnt'; - } - - return $tag_name; - } - - /** - * Implements {tag_name}TestFieldXpath() for 'twitter_cards_type'. - */ - private function twitterCardsTypeTestFieldXpath() { - return "//select[@name='twitter_cards_type']"; - } - - /** - * Implements {tag_name}TestValue() for 'twitter_cards_type'. - */ - private function twitterCardsTypeTestValue() { - return 'summary_large_image'; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/config/schema/metatag_verification.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_verification/config/schema/metatag_verification.metatag_tag.schema.yml deleted file mode 100644 index 29aafb283..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/config/schema/metatag_verification.metatag_tag.schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -# The 'type' should be "label" for short meta tags and "text" for ones which -# could get longer, especially ones which use a textarea field instead of a -# textfield. - -metatag.metatag_tag.alexa: - type: label - label: 'Site validation: Alexa' -metatag.metatag_tag.baidu: - type: label - label: 'Site validation: Baidu' -metatag.metatag_tag.bing: - type: label - label: 'Site validation: Bing' -metatag.metatag_tag.google: - type: label - label: 'Site validation: Google' -metatag.metatag_tag.norton_safe_web: - type: label - label: 'Site validation: Norton Safe Web' -metatag.metatag_tag.pinterest: - type: label - label: 'Site validation: Pinterest' -metatag.metatag_tag.yahoo: - type: label - label: 'Site validation: Yahoo' -metatag.metatag_tag.yandex: - type: label - label: 'Site validation: Yandex' diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/metatag_verification.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_verification/metatag_verification.info.yml deleted file mode 100644 index 7d4b7e4c1..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/metatag_verification.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag: Verification' -type: module -description: Verifies ownership of a site for search engines and other services. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Group/SiteVerification.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Group/SiteVerification.php deleted file mode 100644 index 4be81b2af..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Group/SiteVerification.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Group; - -use Drupal\metatag\Plugin\metatag\Group\GroupBase; - -/** - * The Site Verification group. - * - * @MetatagGroup( - * id = "site_verification", - * label = @Translation("Site verification"), - * description = @Translation("These meta tags are used to confirm site ownership for search engines and other services."), - * weight = 10 - * ) - */ -class SiteVerification extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Baidu.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Baidu.php deleted file mode 100644 index ac41a8957..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Baidu.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'baidu-site-verification' meta tag. - * - * @MetatagTag( - * id = "baidu", - * label = @Translation("Baidu"), - * description = @Translation("A string provided by <a href=':baidu'>Baidu</a>.", arguments = { ":baidu" = "http://www.baidu.com/" }), - * name = "baidu-site-verification", - * group = "site_verification", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Baidu extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php deleted file mode 100644 index 9679777de..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'msvalidate.01' meta tag. - * - * @MetatagTag( - * id = "bing", - * label = @Translation("Bing"), - * description = @Translation("A string provided by <a href=':bing'>Bing</a>, full details are available from the <a href=':verify_url'>Bing online help</a>.", arguments = { ":bing" = "http://www.bing.com/", ":verify_url" = "http://www.bing.com/webmaster/help/how-to-verify-ownership-of-your-site-afcfefc6" }), - * name = "msvalidate.01", - * group = "site_verification", - * weight = 3, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Bing extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php deleted file mode 100644 index e502a785f..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'google-site-verification' meta tag. - * - * @MetatagTag( - * id = "google", - * label = @Translation("Google"), - * description = @Translation("A string provided by <a href=':google'>Google</a>, full details are available from the <a href=':verify_url'>Google online help</a>.", arguments = { ":google" = "https://www.google.com/", ":verify_url" = "https://support.google.com/webmasters/answer/35179?hl=en" }), - * name = "google-site-verification", - * group = "site_verification", - * weight = 4, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Google extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php deleted file mode 100644 index 94e086a34..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'norton-safeweb-site-verification' meta tag. - * - * @MetatagTag( - * id = "norton_safe_web", - * label = @Translation("Norton Safe Web"), - * description = @Translation("A string provided by <a href=':norton'>Norton Safe Web</a>, full details are available from the <a href=':verify_url'>Norton Safe Web online help</a>.", arguments = { ":norton" = "https://safeweb.norton.com/", ":verify_url" = "https://safeweb.norton.com/help/site_owners" }), - * name = "norton-safeweb-site-verification", - * group = "site_verification", - * weight = 5, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class NortonSafeWeb extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php deleted file mode 100644 index 4c6512f79..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'p:domain_verify' meta tag. - * - * @MetatagTag( - * id = "pinterest", - * label = @Translation("Pinterest"), - * description = @Translation("A string provided by <a href=':pinterest'>Pinterest</a>, full details are available from the <a href=':verify_url'>Pinterest online help</a>.", arguments = { ":pinterest" = "https://www.pinterest.com/", ":verify_url" = "https://help.pinterest.com/en/articles/verify-your-website" }), - * name = "p:domain_verify", - * group = "site_verification", - * weight = 6, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Pinterest extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php deleted file mode 100644 index 23c050428..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Plugin\metatag\Tag; - -use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; - -/** - * Provides a plugin for the 'yandex-verification' meta tag. - * - * @MetatagTag( - * id = "yandex", - * label = @Translation("Yandex"), - * description = @Translation("A string provided by <a href=':yandex'>Yandex</a>, full details are available from the <a href=':verify_url'>Yandex online help</a>.", arguments = { ":yandex" = "http://www.yandex.com/", ":verify_url" = "http://api.yandex.com/webmaster/doc/dg/reference/hosts-type.xml" }), - * name = "yandex-verification", - * group = "site_verification", - * weight = 8, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Yandex extends MetaNameBase { -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php deleted file mode 100644 index 940ede99d..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Drupal\metatag_verification\Tests; - -use Drupal\metatag\Tests\MetatagTagsTestBase; - -/** - * Tests that each of the Metatag Verification tags work correctly. - * - * @group metatag - */ -class MetatagVerificationTagsTest extends MetatagTagsTestBase { - - /** - * {@inheritdoc} - */ - private $tags = [ - 'baidu', - 'bing', - 'google', - 'norton_safe_web', - 'pinterest', - 'yandex', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::$modules[] = 'metatag_verification'; - parent::setUp(); - } - - /** - * Each of these meta tags has a different tag name vs its internal name. - */ - private function getTestTagName($tag_name) { - if ($tag_name == 'baidu') { - $tag_name = 'baidu-site-verification'; - } - elseif ($tag_name == 'bing') { - $tag_name = 'msvalidate.01'; - } - elseif ($tag_name == 'google') { - $tag_name = 'google-site-verification'; - } - elseif ($tag_name == 'norton_safe_web') { - $tag_name = 'norton-safeweb-site-verification'; - } - elseif ($tag_name == 'pinterest') { - $tag_name = 'p:domain_verify'; - } - elseif ($tag_name == 'yandex') { - $tag_name = 'yandex-verification'; - } - - return $tag_name; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/config/schema/metatag_views.views.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_views/config/schema/metatag_views.views.schema.yml deleted file mode 100644 index b98db8cad..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/config/schema/metatag_views.views.schema.yml +++ /dev/null @@ -1,8 +0,0 @@ -views.display_extender.metatag_display_extender: - type: views_display_extender - mapping: - metatags: - type: sequence - label: 'Metatags' - sequence: - type: metatag.metatag_tag.[%key] diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.info.yml deleted file mode 100644 index 20bbe66bf..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Metatag: Views' -type: module -description: Provides views integration for metatags. -# core: 8.x -package: SEO -dependencies: - - metatag:metatag - - drupal:views - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.install b/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.install deleted file mode 100644 index f74343724..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.install +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/** - * @file - * Various install/uninstall hooks for the Metatag Views module. - */ - -/** - * Implements hook_install(). - */ -function metatag_views_install() { - // Enable metatag_display_extender plugin. - $config = \Drupal::service('config.factory')->getEditable('views.settings'); - $display_extenders = $config->get('display_extenders') ?: []; - $display_extenders[] = 'metatag_display_extender'; - $config->set('display_extenders', $display_extenders); - $config->save(); -} - -/** - * Implements hook_uninstall(). - */ -function metatag_views_uninstall() { - // Disable metatag_display_extender plugin. - $config = \Drupal::service('config.factory')->getEditable('views.settings'); - $display_extenders = $config->get('display_extenders') ?: []; - - $key = array_search('metatag_display_extender', $display_extenders); - if ($key !== FALSE) { - unset($display_extenders[$key]); - $config->set('display_extenders', $display_extenders); - $config->save(); - } -} - -/** - * Implementations of hook_update_N(). - */ - -/** - * Notify admins that the custom admin pages were (temporarily) disabled. - */ -function metatag_views_update_8100() { - return (string) t("The custom admin pages for managing Views meta tags at /admin/config/search/metatag/views have been disabled for now, hopefully they'll be back in a future release. Until then, the meta tags can be managed directly on each individual view via the \"Meta tags\" section."); -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module b/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module deleted file mode 100644 index 02b9e9cd8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -/** - * @file - * Contains hook implementations for the metatag_views module. - */ - -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\views\ViewEntityInterface; -use Drupal\views\ViewExecutable; -use Drupal\views\Views; - -/** - * Gets the meta tags of a specific view, if set. - * - * @param mixed $view - * The view id, view config entity or view executable. - * @param string $display_id - * The display id. If empty uses the preselected display if $view is a - * ViewExecutable, otherwise the default display. - * - * @return array|null - * The meta tags if set, null otherwise. - */ -function metatag_get_view_tags($view, $display_id = NULL) { - if (empty($view)) { - return; - } - if ($view instanceof ViewEntityInterface) { - $view = $view->getExecutable(); - } - elseif (is_string($view)) { - $view = Views::getView($view); - } - if (!$view instanceof ViewExecutable) { - return; - } - $view->setDisplay($display_id); - - // And get the list of extenders for this display. - $extenders = $view->getDisplay()->getExtenders(); - if (!isset($extenders['metatag_display_extender'])) { - // If the id of the plugin is not in the list then something is wrong. - return; - } - - // Retrieve the metatag settings from the extender. - return $extenders['metatag_display_extender']->getMetatags(); -} - -/** - * Implements hook_metatags_alter(). - */ -function metatag_views_metatags_alter(array &$metatags, array &$context) { - if (!$context['entity'] instanceof ViewEntityInterface) { - return; - } - - $view = $context['entity']->getExecutable(); - // If display_id is not available, will default to Master display. - $display_id = \Drupal::routeMatch()->getParameter('display_id'); - if ($tags = metatag_get_view_tags($view, $display_id)) { - // Apply view overrides. - $metatags = array_merge($metatags, $tags); - } -} - -/** - * Implements hook_metatag_route_entity(). - */ -function metatag_views_metatag_route_entity(RouteMatchInterface $route_match) { - if ($view_id = $route_match->getParameter('view_id')) { - $entity = \Drupal::entityTypeManager()->getStorage('view')->load($view_id); - return $entity; - } -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php deleted file mode 100644 index 2ddf0b824..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php +++ /dev/null @@ -1,246 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Controller; - -use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Url; -use Drupal\metatag\MetatagManagerInterface; -use Drupal\views\Views; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Class MetatagViewsController. - * - * @package Drupal\metatag_views\Controller - */ -class MetatagViewsController extends ControllerBase { - - /** - * The Views storage interface. - * - * @var \Drupal\Core\Entity\EntityStorageInterface - */ - protected $viewStorage; - - /** - * The Metatag manager interface. - * - * @var \Drupal\metatag\MetatagManagerInterface - */ - protected $metatagManager; - - /** - * Associative array of labels. - * - * @var array - */ - protected $viewLabels; - - /** - * {@inheritdoc} - */ - public function __construct(EntityStorageInterface $viewStorage, MetatagManagerInterface $metatagManager) { - $this->viewStorage = $viewStorage; - $this->metatagManager = $metatagManager; - - // Generate the labels for views and displays. - $this->labels = $this->getViewsAndDisplaysLabels(); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager')->getStorage('view'), - $container->get('metatag.manager') - ); - } - - /** - * Get meta tags for all of the views / displays that have them set. - * - * @return array - * List of tags grouped by view and display. - */ - public static function getTaggedViews() { - $tagged_views = []; - foreach (Views::getEnabledViews() as $view_id => $view) { - $displays = $view->get('display'); - foreach (array_keys($displays) as $display_id) { - if ($tags = metatag_get_view_tags($view_id, $display_id)) { - $tagged_views[$view_id][$display_id] = $tags; - } - } - } - return $tagged_views; - } - - /** - * Generates the renderable array for views meta tags UI. - * - * @return array - * The list of details. - */ - public function listViews() { - $elements = []; - - $elements['header'] = [ - '#markup' => '<p>' . $this->t("To view a list of displays with meta tags set up, click on a view name. To view a summary of meta tags configuration for a particular display, click on the display name. If you need to set meta tags for a specific view, choose Add views meta tags. Reverting the meta tags removes the specific configuration and falls back to defaults.") . '</p>', - ]; - - // Iterate over the values and build the whole UI. - // 1. Top level is a collapsible fieldset with a view name (details) - // 2. Inside each fieldset we have 2 columns -> Display and Operations. - // Display contains point 3. - // Operations contain edit and revert. - // 3. In each display there is a table that has 2 columns: tag name and tag - // value. - $tagged_views = $this->getTaggedViews(); - foreach ($tagged_views as $view_id => $displays) { - $elements[$view_id] = [ - '#type' => 'details', - '#title' => $this->t($this->viewLabels[$view_id]['#label']), - 'details' => $this->buildViewDetails($view_id, $displays), - ]; - } - - return $elements; - } - - /** - * Builds the second "level" of the UI table with display fieldset and ops. - * - * @param string $view_id - * The view display to use. - * @param array $displays - * The displays to process. - * - * @return array - * Render array. - */ - protected function buildViewDetails($view_id, array $displays) { - $element = [ - '#type' => 'table', - '#collapsible' => TRUE, - '#header' => [ - $this->t('Display'), - $this->t('Operations'), - ], - ]; - - foreach ($displays as $display_id => $metatags) { - $metatags = array_filter($metatags); - - $element[$display_id]['details'] = [ - '#type' => 'details', - '#title' => $this->viewLabels[$view_id][$display_id], - ]; - - $params = [ - 'view_id' => $view_id, - 'display_id' => $display_id, - ]; - - // Generate the operations. - $element[$display_id]['ops'] = [ - '#type' => 'operations', - '#links' => [ - 'edit' => [ - 'title' => $this->t('Edit'), - 'url' => Url::fromRoute('metatag_views.metatags.edit', $params), - ], - 'translate' => [ - 'title' => $this->t('Translate'), - 'url' => Url::fromRoute('metatag_views.metatags.translate_overview', $params), - ], - 'revert' => [ - 'title' => $this->t('Revert'), - 'url' => Url::fromRoute('metatag_views.metatags.revert', $params), - ], - ], - ]; - - // Build the rows for each of the metatag types. - $element[$display_id]['details']['table'] = $this->buildDisplayDetailsTable($metatags); - } - - return $element; - } - - /** - * Build the table with metatag values summary. - * - * @param array $tags - * The tags to process. - * - * @return array - * The tag structure in a display element. - */ - protected function buildDisplayDetailsTable(array $tags) { - $element = [ - '#type' => 'table', - ]; - - $i = 0; - foreach ($tags as $tag_name => $tag_value) { - // This is for the case where we have a subarray. - $tag_value = $this->prepareTagValue($tag_value); - if (!$tag_value) { - continue; - } - - $element[$i]['tag_name'] = [ - '#type' => 'markup', - '#markup' => $tag_name, - ]; - - $element[$i]['tag_value'] = [ - '#type' => 'markup', - '#markup' => $tag_value, - ]; - $i++; - } - - return $element; - } - - /** - * Massage the tag value. - * - * @param string $value - * The meta tag to output. - * - * @return string - * An imploded string for meta tags that are nested, ex. robots. - */ - protected function prepareTagValue($value) { - if (is_array($value)) { - $value = implode(', ', array_filter($value)); - } - - return $value; - } - - /** - * Gets label values for the views and their displays. - */ - protected function getViewsAndDisplaysLabels() { - /** @var \Drupal\views\ViewEntityInterface[] $views */ - $views = $this->viewStorage->loadByProperties(['status' => 1]); - - $labels = []; - - foreach ($views as $view_id => $view) { - $displays = $view->get('display'); - $labels[$view_id]['#label'] = $view->label(); - foreach (array_keys($displays) as $display_id) { - $labels[$view_id][$display_id] = $displays[$display_id]['display_title']; - } - } - - $this->viewLabels = $labels; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php deleted file mode 100644 index eec9afc6e..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php +++ /dev/null @@ -1,151 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Controller; - -use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Language\LanguageManagerInterface; -use Drupal\Core\Url; -use Drupal\metatag\MetatagManagerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Translate Views meta tags. - */ -class MetatagViewsTranslationController extends ControllerBase { - - /** - * The View storage interface. - * - * @var \Drupal\Core\Entity\EntityStorageInterface - */ - protected $viewStorage; - - /** - * The Metatag manager. - * - * @var \Drupal\metatag\MetatagManagerInterface - */ - protected $metatagManager; - - /** - * The language manager. - * - * @var \Drupal\Core\Language\LanguageManagerInterface - */ - protected $languageManager; - - /** - * {@inheritdoc} - */ - public function __construct(EntityStorageInterface $viewStorage, MetatagManagerInterface $metatagManager, LanguageManagerInterface $languageManager) { - $this->viewStorage = $viewStorage; - $this->metatagManager = $metatagManager; - $this->languageManager = $languageManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager')->getStorage('view'), - $container->get('metatag.manager'), - $container->get('language_manager') - ); - } - - /** - * Language translations overview page for a views. - * - * @return array - * Page render array. - */ - public function itemPage() { - $view_id = \Drupal::request()->get('view_id'); - $display_id = \Drupal::request()->get('display_id'); - - $view = $this->viewStorage->load($view_id); - $original_langcode = $view->language()->getId(); - - $config_name = $view->getConfigDependencyName(); - $config_path = 'display.' . $display_id . '.display_options.display_extenders.metatag_display_extender.metatags'; - - $configuration = \Drupal::service('config.factory')->get($config_name); - $config_source = $configuration->getOriginal($config_path, FALSE); - - $page['languages'] = [ - '#type' => 'table', - '#header' => [$this->t('Language'), $this->t('Operations')], - ]; - - $languages = $this->languageManager->getLanguages(); - foreach ($languages as $language) { - $langcode = $language->getId(); - $language_name = $language->getName(); - $operations = []; - - // Prepare the language name and the operations depending on whether this - // is the original language or not. - if ($langcode == $original_langcode) { - $language_name = '<strong>' . $this->t('@language (original)', [ - '@language' => $language_name, - ]) . '</strong>'; - - // Default language can only be edited, no add/delete. - $operations['edit'] = [ - 'title' => $this->t('Edit'), - 'url' => Url::fromRoute('metatag_views.metatags.edit', [ - 'view_id' => $view_id, - 'display_id' => $display_id, - ]), - ]; - } - else { - // Get the metatag translation for this language. - $config_translation = $this->languageManager - ->getLanguageConfigOverride($langcode, $config_name) - ->get($config_path); - - // If no translation exists for this language, link to add one. - if (!$config_translation || $config_translation == $config_source) { - $operations['add'] = [ - 'title' => $this->t('Add'), - 'url' => Url::fromRoute('metatag_views.metatags.translate', [ - 'view_id' => $view_id, - 'display_id' => $display_id, - 'langcode' => $langcode, - ]), - ]; - } - else { - // Otherwise, link to edit the existing translation. - $operations['edit'] = [ - 'title' => $this->t('Edit'), - 'url' => Url::fromRoute('metatag_views.metatags.translate', [ - 'view_id' => $view_id, - 'display_id' => $display_id, - 'langcode' => $langcode, - ]), - ]; - // @todo Operations delete. - } - } - - $page['languages'][$langcode]['language'] = [ - '#markup' => $language_name, - ]; - - $page['languages'][$langcode]['operations'] = [ - '#type' => 'operations', - '#links' => $operations, - // Even if the mapper contains multiple language codes, the source - // configuration can still be edited. - // '#access' => ($langcode == $original_langcode) || $operations_access, - ]; - } - - return $page; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php deleted file mode 100644 index 476293df9..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Form; - -use Drupal\Core\Form\FormStateInterface; -use Drupal\metatag_views\Controller\MetatagViewsController; -use Drupal\views\Views; - -/** - * Class MetatagViewsAddForm. - * - * @package Drupal\metatag_views\Form - */ -class MetatagViewsAddForm extends MetatagViewsEditForm { - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'metatag_views_add_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = parent::buildForm($form, $form_state); - - // Add a view select to the edit form. - $views = Views::getViewsAsOptions(FALSE, 'enabled', NULL, TRUE, TRUE); - // Get only the views that do not have the meta tags set yet. - $in_use = MetatagViewsController::getTaggedViews(); - foreach ($in_use as $view_id => $displays) { - foreach (array_keys($displays) as $display_id) { - unset($views[$view_id][$view_id . ':' . $display_id]); - } - } - $views = array_filter($views); - - // Need to create that AFTER the $form['metatags'] as the whole form - // is passed to the $metatagManager->form() which causes duplicated field. - $form['view']['#type'] = 'select'; - $form['view']['#options'] = $views; - $form['view']['#empty_option'] = $this->t('- Select a view -'); - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php deleted file mode 100644 index 0e395e842..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php +++ /dev/null @@ -1,194 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Form; - -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Form\FormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\metatag\MetatagManagerInterface; -use Drupal\metatag_views\MetatagViewsValuesCleanerTrait; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Class MetatagViewsEditForm. - * - * @package Drupal\metatag_views\Form - */ -class MetatagViewsEditForm extends FormBase { - - use MetatagViewsValuesCleanerTrait; - - /** - * Drupal\metatag\MetatagManager definition. - * - * @var \Drupal\metatag\MetatagManager - */ - protected $metatagManager; - - /** - * The Views manager. - * - * @var \Drupal\Core\Entity\EntityStorageInterface - */ - protected $viewsManager; - - /** - * Array of display settings from ViewEntityInterface::getDisplay(). - * - * @var array - */ - protected $display; - - /** - * View entity object. - * - * @var \Drupal\views\ViewEntityInterface - */ - protected $view; - - /** - * {@inheritdoc} - */ - public function __construct(MetatagManagerInterface $metatag_manager, EntityTypeManagerInterface $entity_manager) { - $this->metatagManager = $metatag_manager; - $this->viewsManager = $entity_manager->getStorage('view'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('metatag.manager'), - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'metatag_views_edit_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get the parameters from request. - $view_id = \Drupal::request()->get('view_id'); - $display_id = \Drupal::request()->get('display_id'); - - // Get meta tags from the view entity. - $metatags = []; - if ($view_id && $display_id) { - $metatags = metatag_get_view_tags($view_id, $display_id); - } - - $form['metatags'] = $this->metatagManager->form($metatags, $form, ['view']); - $form['metatags']['#title'] = $this->t('Metatags'); - $form['metatags']['#type'] = 'fieldset'; - - // Need to create that AFTER the $form['metatags'] as the whole form is - // passed to the $metatagManager->form() which causes duplicated field. - $form['view'] = [ - '#type' => 'value', - '#title' => $this->t('View'), - '#weight' => -100, - '#default_value' => $view_id . ':' . $display_id, - '#required' => TRUE, - ]; - - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Submit'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL) { - // Add the outer fieldset. - $element += [ - '#type' => 'details', - ]; - - $element += $this->tokenService->tokenBrowser($token_types); - - $groups_and_tags = $this->sortedGroupsWithTags(); - - $first = TRUE; - foreach ($groups_and_tags as $group_id => $group) { - // Only act on groups that have tags and are in the list of included - // groups (unless that list is null). - if (isset($group['tags']) && (is_null($included_groups) || in_array($group_id, $included_groups))) { - // Create the fieldset. - $element[$group_id]['#type'] = 'details'; - $element[$group_id]['#title'] = $group['label']; - $element[$group_id]['#description'] = $group['description']; - $element[$group_id]['#open'] = $first; - $first = FALSE; - - foreach ($group['tags'] as $tag_id => $tag) { - // Only act on tags in the included tags list, unless that is null. - if (is_null($included_tags) || in_array($tag_id, $included_tags)) { - // Make an instance of the tag. - $tag = $this->tagPluginManager->createInstance($tag_id); - - // Set the value to the stored value, if any. - $tag_value = isset($values[$tag_id]) ? $values[$tag_id] : NULL; - $tag->setValue($tag_value); - - // Create the bit of form for this tag. - $element[$group_id][$tag_id] = $tag->form($element); - } - } - } - } - - return $element; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Get the submitted form values. - $view_name = $form_state->getValue('view'); - list($view_id, $display_id) = explode(':', $view_name); - - $metatags = $form_state->getValues(); - unset($metatags['view']); - $metatags = $this->clearMetatagViewsDisallowedValues($metatags); - - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = $this->viewsManager->load($view_id); - - // Store the meta tags on the view. - $config_name = $view->getConfigDependencyName(); - $config_path = 'display.' . $display_id . '.display_options.display_extenders.metatag_display_extender.metatags'; - - // Set configuration values based on form submission. This always edits the - // original language. - $configuration = $this->configFactory()->getEditable($config_name); - if (empty($this->removeEmptyTags($metatags))) { - $configuration->clear($config_path); - } - else { - $configuration->set($config_path, $metatags); - } - $configuration->save(); - - // Redirect back to the views list. - $form_state->setRedirect('metatag_views.metatags.list'); - - drupal_set_message($this->t('Metatags for @view : @display have been saved.', [ - '@view' => $view->label(), - '@display' => $view->getDisplay($display_id)['display_title'], - ])); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php deleted file mode 100644 index 1bd585929..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Form; - -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Form\ConfirmFormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Defines a form for reverting views metatags. - */ -class MetatagViewsRevertForm extends ConfirmFormBase { - - /** - * Entity manager for views entities. - * - * @var \Drupal\Core\Entity\EntityTypeManagerInterface - */ - protected $viewsManager; - - /** - * The view entity to revert meta tags on. - * - * @var \Drupal\views\ViewEntityInterface - */ - protected $view; - - /** - * The view's display id. - * - * @var string - */ - protected $displayId; - - /** - * {@inheritdoc} - */ - public function __construct(EntityTypeManagerInterface $entity_manager) { - $this->viewsManager = $entity_manager->getStorage('view'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'metatag_views_revert_form'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Do you want to revert meta tags for @view_name : @display_name?', [ - '@view_name' => $this->view->label(), - '@display_name' => $this->view->getDisplay($this->displayId)['display_title'], - ]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('metatag_views.metatags.list'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('You are about to revert the custom meta tags for the %display_name display on the %view_name view. This action cannot be undone.', [ - '%view_name' => $this->view->label(), - '%display_name' => $this->view->getDisplay($this->displayId)['display_title'], - ]); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Revert'); - } - - /** - * {@inheritdoc} - */ - public function getCancelText() { - return $this->t('Cancel'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $view_id = NULL, $display_id = NUL) { - $this->view = $this->viewsManager->load($view_id); - $this->displayId = $display_id; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Removed meta tags from the view. - $config_name = $this->view->getConfigDependencyName(); - $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags'; - - $this->configFactory()->getEditable($config_name) - ->clear($config_path) - ->save(); - - // Redirect back to the views list. - $form_state->setRedirect('metatag_views.metatags.list'); - - drupal_set_message($this->t('Reverted meta tags for @view_name : @display_name', [ - '@view_name' => $this->view->label(), - '@display_name' => $this->view->getDisplay($this->displayId)['display_title'], - ])); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php deleted file mode 100644 index 88875c0a6..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php +++ /dev/null @@ -1,269 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Form; - -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Form\FormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\metatag\MetatagManagerInterface; -use Drupal\metatag\MetatagTagPluginManager; -use Drupal\metatag\MetatagToken; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\language\ConfigurableLanguageManagerInterface; -use Drupal\metatag_views\MetatagViewsValuesCleanerTrait; - -/** - * Class MetatagViewsEditForm. - * - * @package Drupal\metatag_views\Form - */ -class MetatagViewsTranslationForm extends FormBase { - - use MetatagViewsValuesCleanerTrait; - - /** - * Drupal\metatag\MetatagManager definition. - * - * @var \Drupal\metatag\MetatagManager - */ - protected $metatagManager; - - /** - * The language manager. - * - * @var \Drupal\language\ConfigurableLanguageManagerInterface - */ - protected $languageManager; - - /** - * The Views manager. - * - * @var \Drupal\Core\Entity\EntityStorageInterface - */ - protected $viewsManager; - - /** - * The Metatag token service. - * - * @var \Drupal\metatag\MetatagToken - */ - protected $tokenService; - - /** - * The Metatag tag plugin manager. - * - * @var \Drupal\metatag\MetatagTagPluginManager - */ - protected $tagPluginManager; - - /** - * The View entity object. - * - * @var \Drupal\views\ViewEntityInterface - */ - protected $view; - - /** - * View ID. - * - * @var string - */ - protected $viewId; - - /** - * View display ID. - * - * @var string - */ - protected $displayId = 'default'; - - /** - * The language of the translation. - * - * @var \Drupal\Core\Language\LanguageInterface - */ - protected $language; - - /** - * The language of the translation source. - * - * @var \Drupal\Core\Language\LanguageInterface - */ - protected $sourceLanguage; - - /** - * An array of base language data. - * - * @var array - */ - protected $baseData = []; - - /** - * {@inheritdoc} - */ - public function __construct(MetatagManagerInterface $metatag_manager, EntityTypeManagerInterface $entity_manager, MetatagToken $token, MetatagTagPluginManager $tagPluginManager, ConfigurableLanguageManagerInterface $language_manager) { - $this->metatagManager = $metatag_manager; - $this->viewsManager = $entity_manager->getStorage('view'); - $this->tokenService = $token; - $this->tagPluginManager = $tagPluginManager; - $this->languageManager = $language_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('metatag.manager'), - $container->get('entity_type.manager'), - $container->get('metatag.token'), - $container->get('plugin.manager.metatag.tag'), - $container->get('language_manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'metatag_views_translate_form'; - } - - /** - * Gets the translated values while storing a copy of the original values. - */ - protected function prepareValues() { - $config_name = $this->view->getConfigDependencyName(); - $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags'; - - $configuration = \Drupal::service('config.factory')->get($config_name); - $this->baseData = $configuration->getOriginal($config_path, FALSE); - - // Set the translation target language on the configuration factory. - $original_language = $this->languageManager->getConfigOverrideLanguage(); - $this->languageManager->setConfigOverrideLanguage($this->language); - - // Read in translated values. - $configuration = \Drupal::service('config.factory')->get($config_name); - $translated_values = $configuration->get($config_path); - - // Set the configuration language back. - $this->languageManager->setConfigOverrideLanguage($original_language); - - return $translated_values; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get the parameters from request. - $this->viewId = \Drupal::request()->get('view_id'); - $this->displayId = \Drupal::request()->get('display_id'); - $langcode = \Drupal::request()->get('langcode'); - - $this->view = $this->viewsManager->load($this->viewId); - $this->language = $this->languageManager->getLanguage($langcode); - $this->sourceLanguage = $this->view->language(); - - // Get meta tags from the view entity. - $form['#tree'] = TRUE; - $form['#attached']['library'][] = 'config_translation/drupal.config_translation.admin'; - - $form['#title'] = $this->t('Edit @language translation for %view: %display metatags', [ - '%view' => $this->view->label(), - '%display' => $this->view->getDisplay($this->displayId)['display_title'], - '@language' => $this->language->getName(), - ]); - - $form['metatags'] = $this->form($form, $this->prepareValues()); - $form['metatags']['#title'] = t('Metatags'); - $form['metatags']['#type'] = 'fieldset'; - - $form['submit'] = [ - '#type' => 'submit', - '#value' => t('Submit'), - ]; - - return $form; - } - - /** - * Add the translation form element for meta tags available in the source. - */ - public function form(array $element, array $translated_values) { - $translated_values = $this->clearMetatagViewsDisallowedValues($translated_values); - // Only offer form elements for tags present in the source language. - $source_values = $this->removeEmptyTags($this->baseData); - - // Add the outer fieldset. - $element += [ - '#type' => 'details', - ]; - $element += $this->tokenService->tokenBrowser(['view']); - - foreach ($source_values as $tag_id => $value) { - $tag = $this->tagPluginManager->createInstance($tag_id); - $tag->setValue($translated_values[$tag_id]); - - $form_element = $tag->form($element); - $element[$tag_id] = [ - '#theme' => 'config_translation_manage_form_element', - 'source' => [ - '#type' => 'item', - '#title' => $form_element['#title'], - '#markup' => $value, - ], - 'translation' => $form_element, - ]; - } - - return $element; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Get the values of metatags. - $values = $form_state->getValue('metatags'); - $translated_values = array_combine(array_keys($values), array_column($values, 'translation')); - - $config_name = $this->view->getConfigDependencyName(); - $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags'; - - // Set configuration values based on form submission and source values. - $base_config = $this->configFactory()->getEditable($config_name); - $config_translation = $this->languageManager->getLanguageConfigOverride($this->language->getId(), $config_name); - - // Save the configuration values, if they are different from the source - // values in the base configuration. Otherwise remove the override. - $source_values = $this->removeEmptyTags($base_config->get($config_path)); - if ($source_values !== $translated_values) { - $config_translation->set($config_path, $translated_values); - } - else { - $config_translation->clear($config_path); - } - - // If no overrides, delete language specific configuration file. - $saved_config = $config_translation->get(); - if (empty($saved_config)) { - $config_translation->delete(); - } - else { - $config_translation->save(); - } - - // Redirect back to the views list. - $form_state->setRedirect('metatag_views.metatags.translate_overview', [ - 'view_id' => $this->viewId, - 'display_id' => $this->displayId, - ]); - - drupal_set_message($this->t('Successfully updated @language translation.', [ - '@language' => $this->language->getName(), - ])); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php deleted file mode 100644 index a13f8a2bd..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\metatag_views; - -/** - * Collection of helper methods when handling raw tag values. - */ -trait MetatagViewsValuesCleanerTrait { - - /** - * Clears the metatag form state values from illegal elements. - * - * @param array $metatags - * Array of values to submit. - * - * @return array - * Filtered metatag array. - */ - public function clearMetatagViewsDisallowedValues(array $metatags) { - // Get all legal tags. - $tags = $this->metatagManager->sortedTags(); - - // Return only common elements. - $metatags = array_intersect_key($metatags, $tags); - - return $metatags; - } - - /** - * Removes tags that are empty. - */ - public function removeEmptyTags($metatags) { - $metatags = array_filter($metatags, function ($value) { - if (is_array($value)) { - return count(array_filter($value)) > 0; - } - else { - return $value !== ''; - } - }); - return $metatags; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php deleted file mode 100644 index c31a4e825..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php +++ /dev/null @@ -1,187 +0,0 @@ -<?php - -namespace Drupal\metatag_views\Plugin\views\display_extender; - -use Drupal\Core\Form\FormStateInterface; -use Drupal\metatag\MetatagManagerInterface; -use Drupal\metatag\MetatagTagPluginManager; -use Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Metatag display extender plugin. - * - * @ingroup views_display_extender_plugins - * - * @ViewsDisplayExtender( - * id = "metatag_display_extender", - * title = @Translation("Metatag display extender"), - * help = @Translation("Metatag settings for this view."), - * no_ui = FALSE - * ) - */ -class MetatagDisplayExtender extends DisplayExtenderPluginBase { - - /** - * The metatag manager. - * - * @var \Drupal\metatag\MetatagManagerInterface - */ - protected $metatagManager; - - /** - * The plugin manager for metatag tags. - * - * @var \Drupal\metatag\MetatagTagPluginManager - */ - protected $metatagTagManager; - - /** - * Constructs the plugin. - * - * @param array $configuration - * A configuration array containing information about the plugin instance. - * @param string $plugin_id - * The plugin_id for the plugin instance. - * @param mixed $plugin_definition - * The plugin implementation definition. - * @param \Drupal\metatag\MetatagTagPluginManager $metatag_plugin_manager - * The plugin manager for metatag tags. - * @param \Drupal\metatag\MetatagManagerInterface $metatag_manager - * The metatag manager. - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MetatagTagPluginManager $metatag_plugin_manager, MetatagManagerInterface $metatag_manager) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - - $this->metatagTagManager = $metatag_plugin_manager; - $this->metatagManager = $metatag_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('plugin.manager.metatag.tag'), - $container->get('metatag.manager') - ); - } - - /** - * Provide a form to edit options for this plugin. - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - - if ($form_state->get('section') == 'metatags') { - $form['#title'] .= t('The meta tags for this display'); - $metatags = $this->getMetatags(); - - // Build/inject the Metatag form. - $form['metatags'] = $this->metatagManager->form($metatags, $form, ['view']); - } - } - - /** - * Validate the options form. - */ - public function validateOptionsForm(&$form, FormStateInterface $form_state) { - } - - /** - * Handle any special handling on the validate form. - */ - public function submitOptionsForm(&$form, FormStateInterface $form_state) { - if ($form_state->get('section') == 'metatags') { - // Process submitted metatag values and remove empty tags. - $tag_values = []; - $metatags = $form_state->cleanValues()->getValues(); - foreach ($metatags as $tag_id => $tag_value) { - // Some plugins need to process form input before storing it. - // Hence, we set it and then get it. - $tag = $this->metatagTagManager->createInstance($tag_id); - $tag->setValue($tag_value); - if (!empty($tag->value())) { - $tag_values[$tag_id] = $tag->value(); - } - } - $this->options['metatags'] = $tag_values; - } - } - - /** - * Set up any variables on the view prior to execution. - */ - public function preExecute() { - } - - /** - * Inject anything into the query that the display_extender handler needs. - */ - public function query() { - } - - /** - * Provide the default summary for options in the views UI. - * - * This output is returned as an array. - */ - public function optionsSummary(&$categories, &$options) { - $categories['metatags'] = [ - 'title' => t('Meta tags'), - 'column' => 'second', - ]; - $options['metatags'] = [ - 'category' => 'metatags', - 'title' => t('Meta tags'), - 'value' => $this->hasMetatags() ? t('Overridden') : t('Using defaults'), - ]; - } - - /** - * Lists defaultable sections and items contained in each section. - */ - public function defaultableSections(&$sections, $section = NULL) { - } - - /** - * Identify whether or not the current display has custom meta tags defined. - * - * @return bool - * Whether or not the view has overridden metatags. - */ - protected function hasMetatags() { - $metatags = $this->getMetatags(); - return !empty($metatags); - - } - - /** - * Get the Metatag configuration for this display. - * - * @return array - * The meta tag values. - */ - public function getMetatags() { - $metatags = []; - - if (!empty($this->options['metatags'])) { - $metatags = $this->options['metatags']; - } - - return $metatags; - } - - /** - * Sets the meta tags for the given view. - * - * @param array $metatags - * Metatag arrays as suitable for storage. - */ - public function setMetatags(array $metatags) { - $this->options['metatags'] = $metatags; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig b/sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig deleted file mode 100644 index 4c1459be8..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{# -/** - * @file - * Default theme implementation for a form element in config_translation. - * - * Available variables: - * - element: Array that represents the element shown in the form. - * - source: The source of the translation. - * - translation: The translation for the target language. - * - * @see template_preprocess() - * - * @ingroup themeable - */ -#} -<div class="translation-set clearfix"> - <div class="layout-column layout-column--half translation-set__source"> - {{ element.source }} - </div> - <div class="layout-column layout-column--half translation-set__translated"> - {{ element.translation }} - </div> -</div> diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php deleted file mode 100644 index 3aa3e80aa..000000000 --- a/sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -namespace Drupal\Tests\metatag_views\Functional; - -use Drupal\Tests\BrowserTestBase; - -/** - * Confirm the defaults functionality works. - * - * @group panelizer - */ -class MetatagViewsBasicsTest extends BrowserTestBase { - - // Contains helper methods. - use \Drupal\Tests\metatag\Functional\MetatagHelperTrait; - - /** - * {@inheritdoc} - */ - public static $modules = [ - // Modules for core functionality. - 'block', - 'field', - 'field_ui', - 'help', - 'node', - 'user', - - // Views. Duh. Enable the Views UI so it can be fully tested. - 'views', - 'views_ui', - - // Contrib dependencies. - 'token', - 'metatag', - - // This module. - 'metatag_views', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Enable the Bartik theme and make it the default. - $theme = 'bartik'; - \Drupal::service('theme_installer')->install([$theme]); - \Drupal::service('theme_handler')->setDefault($theme); - - // Place the local actions block in the theme so that we can assert the - // presence of local actions and such. - $this->drupalPlaceBlock('local_actions_block', [ - 'region' => 'content', - 'theme' => $theme, - ]); - } - - /** - * Confirm the site isn't broken. - */ - public function testSiteStillWorks() { - // Load the front page. - $this->drupalGet('<front>'); - $this->assertResponse(200); - - // With nothing else configured the front page just has a login form. - $this->assertText('Enter your Drupal username.'); - - // Log in as user 1. - $this->loginUser1(); - - // Load the main Views admin page. - $this->drupalGet('/admin/structure/views'); - $this->assertResponse(200); - - // Enable the Archive view. This should be the first such link while the - // gallery is the second. - $this->clickLink('Enable', 0); - - // Confirm the archive page works. - $this->drupalGet('/archive'); - $this->assertResponse(200); - - // Confirm what the page title looks like by default. - $this->assertTitle('Monthly archive | Drupal'); - - // Load the Arcive view. - $this->drupalGet('/admin/structure/views/view/archive'); - $this->assertResponse(200); - - // Confirm that the Metatag options are present. - $this->assertText('Meta tags:'); - - // Confirm that the page is currently using defaults. - $this->assertText('Using defaults'); - - // Open the 'page' configuration. - $this->clickLink('Page'); - - // Confirm that no changes have been made yet. - $this->assertNoText('Overridden'); - - // Open the settings dialog. - $this->clickLink('Using defaults'); - - // Confirm the settings opened and it has some basic fields. - $this->assertText('Configure the meta tags below.'); - $this->assertFieldByName('title'); - $this->assertFieldByName('description'); - $this->assertFieldByName('op'); - $edit = [ - 'title' => 'Metatag title', - 'description' => 'Metatag description.', - ]; - $this->drupalPostForm(NULL, $edit, 'Apply'); - - // Confirm the Metatag settings are now overridden. - $this->assertText('Overridden'); - - // @todo Confirm there's now a "save" button. - // Save the changes. - $edit = []; - $this->drupalPostForm(NULL, $edit, 'Save'); - - // @todo Confirm the page saved. - // Load the archives page again. - $this->drupalGet('/archive'); - $this->assertResponse(200); - - // Confirm what the page title looks like now. - $this->assertTitle('Metatag title'); - - // Load the Metatag admin page to confirm it still works. - $this->drupalGet('admin/config/search/metatag'); - $this->assertResponse(200); - $this->assertText('Add default meta tags'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php b/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php deleted file mode 100644 index 873cdb078..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\metatag\Annotation; - -use Drupal\Component\Annotation\Plugin; - -/** - * Defines a MetatagGroup annotation object. - * - * @Annotation - */ -class MetatagGroup extends Plugin { - - /** - * The group's internal ID, in machine name format. - * - * @var string - */ - public $id; - - /** - * The name of the group. - * - * @var \Drupal\Core\Annotation\Translation - * - * @ingroup plugin_translatable - */ - public $label; - - /** - * Description of the group. - * - * @var string - */ - public $description; - - /** - * Weight of the group. - * - * @var int - */ - public $weight; - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagTag.php b/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagTag.php deleted file mode 100644 index 948c101f7..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagTag.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -namespace Drupal\metatag\Annotation; - -use Drupal\Component\Annotation\Plugin; - -/** - * Defines a MetatagTag annotation object. - * - * @Annotation - */ -class MetatagTag extends Plugin { - - /** - * The meta tag plugin's internal ID, in machine name format. - * - * @var string - */ - public $id; - - /** - * The display label/name of the meta tag plugin. - * - * @var \Drupal\Core\Annotation\Translation - * - * @ingroup plugin_translatable - */ - public $label; - - /** - * A longer explanation of what the field is for. - * - * @var \Drupal\Core\Annotation\Translation - * - * @ingroup plugin_translatable - */ - public $description; - - /** - * Proper name of the actual meta tag itself. - * - * @var string - */ - public $name; - - /** - * The group this meta tag fits in, corresponds to a MetatagGroup plugin. - * - * @var string - */ - public $group; - - /** - * Weight of the tag. - * - * @var int - */ - public $weight; - - /** - * Type of the meta tag. - * - * Should be either 'date', 'image', 'integer', 'label', 'string' or 'uri'. - * - * @var string - */ - public $type; - - /** - * True if URL must use HTTPS. - * - * @var bool - */ - protected $secure; - - /** - * True if more than one is allowed. - * - * @var bool - */ - public $multiple; - - /** - * True if the URL value(s) must be absolute. - * - * @var bool - */ - protected $absoluteUrl; - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Command/GenerateGroupCommand.php b/sites/all/modules/contrib/admin/metatag/src/Command/GenerateGroupCommand.php deleted file mode 100644 index af11ec50a..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Command/GenerateGroupCommand.php +++ /dev/null @@ -1,197 +0,0 @@ -<?php - -namespace Drupal\metatag\Command; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Command\Command; -use Drupal\Console\Core\Command\Shared\CommandTrait; -use Drupal\Console\Command\Shared\ModuleTrait; -use Drupal\Console\Command\Shared\FormTrait; -use Drupal\Console\Command\Shared\ConfirmationTrait; -use Drupal\Console\Core\Style\DrupalStyle; -use Drupal\metatag\Generator\MetatagGroupGenerator; -use Drupal\Console\Extension\Manager; -use Drupal\Console\Core\Utils\ChainQueue; - -/** - * Class GenerateGroupCommand. - * - * Generate a Metatag group plugin. - * - * @package Drupal\metatag - */ -class GenerateGroupCommand extends Command { - - use CommandTrait; - use ModuleTrait; - use FormTrait; - use ConfirmationTrait; - - /** - * The metatag group generator. - * - * @var \Drupal\metatag\Generator\MetatagGroupGenerator - */ - protected $generator; - - /** - * The console extension manager. - * - * @var \Drupal\Console\Extension\Manager - */ - protected $extensionManager; - - /** - * The console chain queue. - * - * @var \Drupal\Console\Core\Utils\ChainQueue - */ - protected $chainQueue; - - /** - * The GenerateTagCommand constructor. - * - * @param \Drupal\metatag\Generator\MetatagGroupGenerator $generator - * The generator object. - * @param \Drupal\Console\Extension\Manager $extensionManager - * The extension manager object. - * @param \Drupal\Console\Core\Utils\ChainQueue $chainQueue - * The chain queue object. - */ - public function __construct( - MetatagGroupGenerator $generator, - Manager $extensionManager, - ChainQueue $chainQueue - ) { - $this->generator = $generator; - $this->extensionManager = $extensionManager; - $this->chainQueue = $chainQueue; - - parent::__construct(); - } - - /** - * {@inheritdoc} - */ - protected function configure() { - $this - ->setName('generate:plugin:metatag:group') - ->setDescription($this->trans('commands.generate.metatag.group.description')) - ->setHelp($this->trans('commands.generate.metatag.group.help')) - ->addOption('base_class', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.common.options.base_class')) - ->addOption('module', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.common.options.module')) - ->addOption('label', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.group.options.label')) - ->addOption('description', '', InputOption::VALUE_OPTIONAL, - $this->trans('commands.generate.metatag.group.options.description')) - ->addOption('plugin-id', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.group.options.plugin_id')) - ->addOption('class-name', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.group.options.class_name')) - ->addOption('weight', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.group.options.weight')); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); - - // @see Drupal\Console\Command\ConfirmationTrait::confirmGeneration - if (!$this->confirmGeneration($io)) { - return 1; - } - - $base_class = $input->getOption('base_class'); - $module = $input->getOption('module'); - $label = $input->getOption('label'); - $description = $input->getOption('description'); - $plugin_id = $input->getOption('plugin-id'); - $class_name = $input->getOption('class-name'); - $weight = $input->getOption('weight'); - - $this->generator - ->generate($base_class, $module, $label, $description, $plugin_id, $class_name, $weight); - - $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'discovery']); - } - - /** - * {@inheritdoc} - */ - protected function interact(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); - - // --base_class option. - // @todo Turn this into a choice() option. - $base_class = $input->getOption('base_class'); - if (empty($base_class)) { - $base_class = $io->ask( - $this->trans('commands.generate.metatag.group.questions.base_class'), - 'GroupBase' - ); - } - $input->setOption('base_class', $base_class); - - // --module option. - $module = $input->getOption('module'); - if (empty($module)) { - // @see Drupal\AppConsole\Command\Helper\ModuleTrait::moduleQuestion - $module = $this->moduleQuestion($io); - } - $input->setOption('module', $module); - - // --label option. - $label = $input->getOption('label'); - if (empty($label)) { - $label = $io->ask( - $this->trans('commands.generate.metatag.group.questions.label') - ); - } - $input->setOption('label', $label); - - // --description option. - $description = $input->getOption('description'); - if (empty($description)) { - $description = $io->ask( - $this->trans('commands.generate.metatag.group.questions.description') - ); - } - $input->setOption('description', $description); - - // --plugin-id option. - $plugin_id = $input->getOption('plugin-id'); - if (empty($plugin_id)) { - $plugin_id = $io->ask( - $this->trans('commands.generate.metatag.group.questions.plugin_id') - ); - } - $input->setOption('plugin-id', $plugin_id); - - // --class-name option. - $class_name = $input->getOption('class-name'); - if (empty($class_name)) { - $class_name = $io->ask( - $this->trans('commands.generate.metatag.group.questions.class_name') - ); - } - $input->setOption('class-name', $class_name); - - // --weight option. - // @todo Automatically get the next int value based upon the current group. - $weight = $input->getOption('weight'); - if (is_null($weight)) { - $weight = $io->ask( - $this->trans('commands.generate.metatag.group.questions.weight'), - 0 - ); - } - $input->setOption('weight', $weight); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php b/sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php deleted file mode 100644 index f5a829aed..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php +++ /dev/null @@ -1,367 +0,0 @@ -<?php - -namespace Drupal\metatag\Command; - -use Drupal\Console\Command\Shared\ConfirmationTrait; -use Drupal\Console\Command\Shared\FormTrait; -use Drupal\Console\Command\Shared\ModuleTrait; -use Drupal\Console\Core\Command\Shared\CommandTrait; -use Drupal\Console\Core\Style\DrupalStyle; -use Drupal\Console\Core\Utils\ChainQueue; -use Drupal\Console\Core\Utils\StringConverter; -use Drupal\Console\Extension\Manager; -use Drupal\metatag\Generator\MetatagTagGenerator; -use Drupal\metatag\MetatagManager; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Class GenerateTagCommand. - * - * Generate a Metatag tag plugin. - * - * @package Drupal\metatag - */ -class GenerateTagCommand extends Command { - - use CommandTrait; - use ModuleTrait; - use FormTrait; - use ConfirmationTrait; - - /** - * The Metatag manager. - * - * @var \Drupal\metatag\MetatagManager - */ - protected $metatagManager; - - /** - * The Metatag tag generator. - * - * @var \Drupal\metatag\Generator\MetatagTagGenerator - */ - protected $generator; - - /** - * An extension manager. - * - * @var \Drupal\Console\Extension\Manager - */ - protected $extensionManager; - - /** - * The string converter. - * - * @var \Drupal\Console\Core\Utils\StringConverter - */ - protected $stringConverter; - - /** - * The console chain queue. - * - * @var \Drupal\Console\Core\Utils\ChainQueue - */ - protected $chainQueue; - - /** - * The GenerateTagCommand constructor. - * - * @param \Drupal\metatag\MetatagManager $metatagManager - * The metatag manager object. - * @param \Drupal\metatag\Generator\MetatagTagGenerator $generator - * The tag generator object. - * @param \Drupal\Console\Extension\Manager $extensionManager - * The extension manager object. - * @param \Drupal\Console\Core\Utils\StringConverter $stringConverter - * The string converter object. - * @param \Drupal\Console\Core\Utils\ChainQueue $chainQueue - * The chain queue object. - */ - public function __construct( - MetatagManager $metatagManager, - MetatagTagGenerator $generator, - Manager $extensionManager, - StringConverter $stringConverter, - ChainQueue $chainQueue - ) { - $this->metatagManager = $metatagManager; - $this->generator = $generator; - $this->extensionManager = $extensionManager; - $this->stringConverter = $stringConverter; - $this->chainQueue = $chainQueue; - - parent::__construct(); - } - - /** - * {@inheritdoc} - */ - protected function configure() { - $this - ->setName('generate:plugin:metatag:tag') - ->setDescription($this->trans('commands.generate.metatag.tag.description')) - ->setHelp($this->trans('commands.generate.metatag.tag.help')) - ->addOption('base_class', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.common.options.base_class')) - ->addOption('module', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.common.options.module')) - ->addOption('name', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.name')) - ->addOption('label', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.label')) - ->addOption('description', '', InputOption::VALUE_OPTIONAL, - $this->trans('commands.generate.metatag.tag.options.description')) - ->addOption('plugin-id', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.plugin_id')) - ->addOption('class-name', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.class_name')) - ->addOption('group', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.group')) - ->addOption('weight', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.weight')) - ->addOption('type', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.type')) - ->addOption('secure', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.secure')) - ->addOption('multiple', '', InputOption::VALUE_REQUIRED, - $this->trans('commands.generate.metatag.tag.options.multiple')); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - $io = new DrupalStyle($input, $output); - - // @see Drupal\Console\Command\ConfirmationTrait::confirmGeneration - if (!$this->confirmGeneration($io)) { - return 1; - } - - $base_class = $input->getOption('base_class'); - $module = $input->getOption('module'); - $name = $input->getOption('name'); - $label = $input->getOption('label'); - $description = $input->getOption('description'); - $plugin_id = $input->getOption('plugin-id'); - $class_name = $input->getOption('class-name'); - $group = $input->getOption('group'); - $weight = $input->getOption('weight'); - $type = $input->getOption('type'); - $secure = $input->getOption('secure'); - $multiple = $input->getOption('multiple'); - - $this->generator - ->generate($base_class, $module, $name, $label, $description, $plugin_id, $class_name, $group, $weight, $type, $secure, $multiple); - - $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'discovery']); - } - - /** - * {@inheritdoc} - */ - protected function interact(InputInterface $input, OutputInterface $output) { - - $io = new DrupalStyle($input, $output); - - $boolean_options = [ - 'FALSE', - 'TRUE', - ]; - - // @todo Take this from typed data, so it can be extended? - $type_options = [ - 'integer', - 'string', - 'label', - 'uri', - 'image', - ]; - - // --base_class option. - // @todo Turn this into a choice() option. - $base_class = $input->getOption('base_class'); - if (empty($base_class)) { - $base_class = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.base_class'), - 'MetaNameBase' - ); - } - $input->setOption('base_class', $base_class); - - // --module option. - $module = $input->getOption('module'); - if (empty($module)) { - // @see Drupal\AppConsole\Command\Helper\ModuleTrait::moduleQuestion - $module = $this->moduleQuestion($io); - } - $input->setOption('module', $module); - - // --name option. - // @todo Add validation. - $name = $input->getOption('name'); - if (empty($name)) { - $name = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.name') - ); - } - $input->setOption('name', $name); - - // --label option. - $label = $input->getOption('label'); - if (empty($label)) { - $label = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.label'), - $name - ); - } - $input->setOption('label', $label); - - // --description option. - $description = $input->getOption('description'); - if (empty($description)) { - $description = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.description') - ); - } - $input->setOption('description', $description); - - // --plugin-id option. - $plugin_id = $input->getOption('plugin-id'); - if (empty($plugin_id)) { - $plugin_id = $this->nameToPluginId($name); - $plugin_id = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.plugin_id'), - $plugin_id - ); - } - $input->setOption('plugin-id', $plugin_id); - - // --class-name option. - $class_name = $input->getOption('class-name'); - if (empty($class_name)) { - $class_name = $this->nameToClassName($name); - $class_name = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.class_name'), - $class_name - ); - } - $input->setOption('class-name', $class_name); - - // --group option. - $group = $input->getOption('group'); - if (empty($group)) { - $groups = $this->getGroups(); - $group = $io->choice( - $this->trans('commands.generate.metatag.tag.questions.group'), - $groups - ); - } - $input->setOption('group', $group); - - // --weight option. - // @todo Automatically get the next int value based upon the current group. - $weight = $input->getOption('weight'); - if (is_null($weight)) { - $weight = $io->ask( - $this->trans('commands.generate.metatag.tag.questions.weight'), - 0 - ); - } - $input->setOption('weight', $weight); - - // --type option. - // @todo Turn this into an option. - $type = $input->getOption('type'); - if (is_null($type)) { - $type = $io->choice( - $this->trans('commands.generate.metatag.tag.questions.type'), - $type_options, - 0 - ); - } - $input->setOption('type', $type); - - // --secure option. - // @todo Turn this into an option. - $secure = $input->getOption('secure'); - if (is_null($secure)) { - $secure = $io->choice( - $this->trans('commands.generate.metatag.tag.questions.secure'), - $boolean_options, - 0 - ); - } - $input->setOption('secure', $secure); - - // --multiple option. - $multiple = $input->getOption('multiple'); - if (is_null($multiple)) { - $multiple = $io->choice( - $this->trans('commands.generate.metatag.tag.questions.multiple'), - $boolean_options, - 0 - ); - } - $input->setOption('multiple', $multiple); - } - - /** - * Convert the meta tag's name to a plugin ID. - * - * @param string $name - * The meta tag name to convert. - * - * @return string - * The original string with all non-alphanumeric characters converted to - * underline chars. - */ - private function nameToPluginId($name) { - return $this->stringConverter->createMachineName($name); - } - - /** - * Convert the meta tag's name to a class name. - * - * @param string $name - * The meta tag name to convert. - * - * @return string - * The original string with all non-alphanumeric characters removed and - * converted to CamelCase. - */ - private function nameToClassName($name) { - return $this->stringConverter->humanToCamelCase($name); - } - - /** - * All of the meta tag groups. - * - * @return array - * A list of the available groups. - */ - private function getGroups() { - return array_keys($this->metatagManager->sortedGroups()); - } - - /** - * Confirm that a requested group exists. - * - * @param string $group - * A group's machine name. - * - * @return string - * The group's name, if available, otherwise an empty string. - */ - private function validateGroupExist($group) { - $groups = $this->getGroups(); - if (isset($groups[$group])) { - return $group; - } - return ''; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php b/sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php deleted file mode 100644 index da9a8efbb..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php - -namespace Drupal\metatag\Entity; - -use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Config\Entity\ConfigEntityInterface; -use Drupal\Core\Config\FileStorage; -use Drupal\Core\Config\InstallStorage; -use Drupal\Core\Config\StorageInterface; -use Drupal\metatag\MetatagDefaultsInterface; - -/** - * Defines the Metatag defaults entity. - * - * @ConfigEntityType( - * id = "metatag_defaults", - * label = @Translation("Metatag defaults"), - * handlers = { - * "list_builder" = "Drupal\metatag\MetatagDefaultsListBuilder", - * "form" = { - * "add" = "Drupal\metatag\Form\MetatagDefaultsForm", - * "edit" = "Drupal\metatag\Form\MetatagDefaultsForm", - * "delete" = "Drupal\metatag\Form\MetatagDefaultsDeleteForm", - * "revert" = "Drupal\metatag\Form\MetatagDefaultsRevertForm" - * } - * }, - * config_prefix = "metatag_defaults", - * admin_permission = "administer meta tags", - * entity_keys = { - * "id" = "id", - * "label" = "label" - * }, - * links = { - * "edit-form" = "/admin/config/search/metatag/{metatag_defaults}/edit", - * "delete-form" = "/admin/config/search/metatag/{metatag_defaults}/delete", - * "revert-form" = "/admin/config/search/metatag/{metatag_defaults}/revert", - * "collection" = "/admin/config/search/metatag" - * } - * ) - */ -class MetatagDefaults extends ConfigEntityBase implements MetatagDefaultsInterface { - - /** - * The Metatag defaults ID. - * - * @var string - */ - protected $id; - - /** - * The Metatag defaults label. - * - * @var string - */ - protected $label; - - /** - * The default tag values. - * - * @var array - */ - protected $tags = []; - - /** - * Returns TRUE if a tag exists. - * - * @param string $tag_id - * The identifier of the tag. - * - * @return bool - * TRUE if the tag exists. - */ - public function hasTag($tag_id) { - return array_key_exists($tag_id, $this->tags); - } - - /** - * Returns the value of a tag. - * - * @param string $tag_id - * The identifier of the tag. - * - * @return array|null - * Array containing the tag values or NULL if not found. - */ - public function getTag($tag_id) { - if (!$this->hasTag($tag_id)) { - return NULL; - } - return $this->tags[$tag_id]; - } - - /** - * Reverts an entity to its default values. - */ - public function revert() { - $default_install_path = drupal_get_path('module', 'metatag') . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; - $storage = new FileStorage($default_install_path, StorageInterface::DEFAULT_COLLECTION); - $default_config_data = $storage->read('metatag.metatag_defaults.' . $this->id()); - if ($default_config_data) { - $this->set('tags', $default_config_data['tags']); - $this->save(); - } - } - - /** - * Overwrite the current tags with new values. - */ - public function overwriteTags(array $new_tags = []) { - if (!empty($new_tags)) { - // Get the existing tags. - $combined_tags = $this->get('tags'); - - // Loop over the new tags, adding them to the existing tags. - foreach ($new_tags as $tag_name => $data) { - $combined_tags[$tag_name] = $data; - } - - // Save the combination of the existing tags + the new tags. - $this->set('tags', $combined_tags); - } - } - - /** - * {@inheritdoc} - */ - public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) { - // Put always Global in 1st place and front page later if available. - if ($a->id() == 'global') { - return -1; - } - elseif ($b->id() == 'global') { - return 1; - } - elseif ($a->id() == 'front') { - return -1; - } - elseif ($b->id() == 'front') { - return 1; - } - - // Use the default sort function. - return parent::sort($a, $b); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php deleted file mode 100644 index 1bc150d52..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\metatag\Form; - -use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; - -/** - * Builds the form to delete Metatag defaults entities. - */ -class MetatagDefaultsDeleteForm extends EntityConfirmFormBase { - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.metatag_defaults.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - - drupal_set_message( - $this->t('Deleted @label defaults.', - [ - '@label' => $this->entity->label(), - ] - ) - ); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php deleted file mode 100644 index ee2997237..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php +++ /dev/null @@ -1,319 +0,0 @@ -<?php - -namespace Drupal\metatag\Form; - -use Drupal\Core\Entity\ContentEntityType; -use Drupal\Core\Entity\EntityForm; -use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\Form\FormStateInterface; -use Drupal\metatag\MetatagManager; -use Drupal\page_manager\Entity\PageVariant; - -/** - * Class MetatagDefaultsForm. - * - * @package Drupal\metatag\Form - */ -class MetatagDefaultsForm extends EntityForm { - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - $metatag_defaults = $this->entity; - $metatag_manager = \Drupal::service('metatag.manager'); - - $form['#ajax_wrapper_id'] = 'metatag-defaults-form-ajax-wrapper'; - $ajax = [ - 'wrapper' => $form['#ajax_wrapper_id'], - 'callback' => '::rebuildForm', - ]; - $form['#prefix'] = '<div id="' . $form['#ajax_wrapper_id'] . '">'; - $form['#suffix'] = '</div>'; - - $default_type = NULL; - if (!empty($metatag_defaults)) { - $default_type = $metatag_defaults->getOriginalId(); - } - else { - $form_state->set('default_type', $default_type); - } - - $token_types = empty($default_type) ? [] : [explode('__', $default_type)[0]]; - - // Add the token browser at the top. - $form += \Drupal::service('metatag.token')->tokenBrowser($token_types); - - // If this is a new Metatag defaults, then list available bundles. - if ($metatag_defaults->isNew()) { - $options = $this->getAvailableBundles(); - $form['id'] = [ - '#type' => 'select', - '#title' => $this->t('Type'), - '#description' => $this->t('Select the type of default meta tags you would like to add.'), - '#options' => $options, - '#required' => TRUE, - '#default_value' => $default_type, - '#ajax' => $ajax + [ - 'trigger_as' => [ - 'name' => 'select_id_submit', - ], - ], - ]; - $form['select_id_submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Submit'), - '#name' => 'select_id_submit', - '#ajax' => $ajax, - '#attributes' => [ - 'class' => ['js-hide'], - ], - ]; - $values = []; - } - else { - $values = $metatag_defaults->get('tags'); - } - - // Retrieve configuration settings. - $settings = $this->config('metatag.settings'); - $entity_type_groups = $settings->get('entity_type_groups'); - - // Find the current entity type and bundle. - $metatag_defaults_id = $metatag_defaults->id(); - $type_parts = explode('__', $metatag_defaults_id); - $entity_type = $type_parts[0]; - $entity_bundle = isset($type_parts[1]) ? $type_parts[1] : NULL; - - // See if there are requested groups for this entity type and bundle. - $groups = !empty($entity_type_groups[$entity_type]) && !empty($entity_type_groups[$entity_type][$entity_bundle]) ? $entity_type_groups[$entity_type][$entity_bundle] : []; - // Limit the form to requested groups, if any. - if (!empty($groups)) { - $form = $metatag_manager->form($values, $form, [$entity_type], $groups); - } - // Otherwise, display all groups. - else { - $form = $metatag_manager->form($values, $form); - } - - return $form; - } - - /** - * Ajax form submit handler that will return the whole rebuilt form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - * - * @return array - * The form structure. - */ - public function rebuildForm(array &$form, FormStateInterface $form_state) { - return $form; - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - if (isset($actions['delete'])) { - $actions['delete']['#access'] = $actions['delete']['#access'] && !in_array($this->entity->id(), MetatagManager::protectedDefaults()); - } - return $actions; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - if ($form_state->getTriggeringElement()['#name'] == 'select_id_submit') { - $form_state->set('default_type', $form_state->getValue('id')); - $form_state->setRebuild(); - } - else { - parent::submitForm($form, $form_state); - } - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $metatag_defaults = $this->entity; - - // Set the label on new defaults. - if ($metatag_defaults->isNew()) { - $metatag_defaults_id = $form_state->getValue('id'); - - $type_parts = explode('__', $metatag_defaults_id); - $entity_type = $type_parts[0]; - $entity_bundle = isset($type_parts[1]) ? $type_parts[1] : NULL; - - // Get the entity label. - $entity_manager = \Drupal::service('entity_type.manager'); - $entity_info = $entity_manager->getDefinitions(); - $entity_label = (string) $entity_info[$entity_type]->get('label'); - - if (!is_null($entity_bundle)) { - // Get the bundle label. - $bundle_manager = \Drupal::service('entity_type.bundle.info'); - $bundle_info = $bundle_manager->getBundleInfo($entity_type); - if ($entity_type === 'page_variant') { - // Check if page manager is enabled and try to load the page variant - // so the label of the variant can be used. - $moduleHandler = \Drupal::service('module_handler'); - if ($moduleHandler->moduleExists('metatag_page_manager')) { - $page_variant = PageVariant::load($entity_bundle); - $page = $page_variant->getPage(); - if ($page_variant) { - $entity_label .= ': ' . $page->label() . ': ' . $page_variant->label(); - } - } - } - else { - $entity_label .= ': ' . $bundle_info[$entity_bundle]['label']; - } - } - - // Set the label to the config entity. - $this->entity->set('label', $entity_label); - } - - // Set tags within the Metatag entity. - $tag_manager = \Drupal::service('plugin.manager.metatag.tag'); - $tags = $tag_manager->getDefinitions(); - $tag_values = []; - foreach ($tags as $tag_id => $tag_definition) { - if ($form_state->hasValue($tag_id)) { - // Some plugins need to process form input before storing it. Hence, we - // set it and then get it. - $tag = $tag_manager->createInstance($tag_id); - $tag->setValue($form_state->getValue($tag_id)); - if (!empty($tag->value())) { - $tag_values[$tag_id] = $tag->value(); - } - } - } - $metatag_defaults->set('tags', $tag_values); - $status = $metatag_defaults->save(); - - switch ($status) { - case SAVED_NEW: - drupal_set_message($this->t('Created the %label Metatag defaults.', [ - '%label' => $metatag_defaults->label(), - ])); - break; - - default: - drupal_set_message($this->t('Saved the %label Metatag defaults.', [ - '%label' => $metatag_defaults->label(), - ])); - } - - $form_state->setRedirectUrl($metatag_defaults->toUrl('collection')); - } - - /** - * Returns an array of available bundles to override. - * - * @return array - * A list of available bundles as $id => $label. - */ - protected function getAvailableBundles() { - $options = []; - $entity_types = static::getSupportedEntityTypes(); - /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager */ - $entity_manager = \Drupal::service('entity_type.manager'); - /** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */ - $bundle_info = \Drupal::service('entity_type.bundle.info'); - $metatags_defaults_manager = $entity_manager->getStorage('metatag_defaults'); - foreach ($entity_types as $entity_type => $entity_label) { - if (empty($metatags_defaults_manager->load($entity_type))) { - $options[$entity_label][$entity_type] = "$entity_label (Default)"; - } - - $bundles = $bundle_info->getBundleInfo($entity_type); - foreach ($bundles as $bundle_id => $bundle_metadata) { - $metatag_defaults_id = $entity_type . '__' . $bundle_id; - - if (empty($metatags_defaults_manager->load($metatag_defaults_id))) { - $options[$entity_label][$metatag_defaults_id] = $bundle_metadata['label']; - } - } - } - return $options; - } - - /** - * Returns a list of supported entity types. - * - * @return array - * A list of available entity types as $machine_name => $label. - */ - public static function getSupportedEntityTypes() { - $entity_types = []; - - /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager */ - $entity_manager = \Drupal::service('entity_type.manager'); - - // A list of entity types that are not supported. - $unsupported_types = [ - // Custom blocks. - 'block_content', - // Comments. - 'comment', - // Contact messages are the messages submitted on individual contact forms - // so obviously shouldn't get meta tags. - 'contact_message', - // Menu items. - 'menu_link_content', - // Shortcut items. - 'shortcut', - ]; - - // Make a list of supported content types. - foreach ($entity_manager->getDefinitions() as $entity_name => $definition) { - // Skip some entity types that we don't want to support. - if (in_array($entity_name, $unsupported_types)) { - continue; - } - - // Identify supported entities. - if ($definition instanceof ContentEntityType) { - // Only work with entity types that have a list of links, i.e. publicly - // viewable. - $links = $definition->get('links'); - if (!empty($links)) { - $entity_types[$entity_name] = static::getEntityTypeLabel($definition); - } - } - } - - return $entity_types; - } - - /** - * Returns the text label for the entity type specified. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entityType - * The entity type to process. - * - * @return string - * A label. - */ - public static function getEntityTypeLabel(EntityTypeInterface $entityType) { - $label = $entityType->getLabel(); - - if (is_a($label, 'Drupal\Core\StringTranslation\TranslatableMarkup')) { - /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */ - $label = $label->render(); - } - - return $label; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php deleted file mode 100644 index 5d224117d..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\metatag\Form; - -use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; - -/** - * Builds the form to revert Metatag defaults entities. - */ -class MetatagDefaultsRevertForm extends EntityConfirmFormBase { - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to revert %name to its default values?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.metatag_defaults.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Revert'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->revert(); - - drupal_set_message( - $this->t('Reverted @label defaults.', - [ - '@label' => $this->entity->label(), - ] - ) - ); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php deleted file mode 100644 index a77e24603..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -namespace Drupal\metatag\Form; - -use Drupal\Core\Form\ConfigFormBase; -use Drupal\Core\Form\FormStateInterface; - -/** - * Defines the configuration export form. - */ -class MetatagSettingsForm extends ConfigFormBase { - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'metatag_admin_settings'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['metatag.settings']; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $settings = $this->config('metatag.settings')->get('entity_type_groups'); - - $form['entity_type_groups'] = [ - '#type' => 'details', - '#open' => TRUE, - '#title' => $this->t('Entity type / Group Mapping'), - '#description' => $this->t('Identify which metatag groups should be available on which entity type / bundle combination. Unselected groups will not appear on the configuration form for that entity type, reducing the size of the form and increasing performance. If no groups are selected for a type, all groups will appear.'), - '#tree' => TRUE, - ]; - - $metatag_manager = \Drupal::service('metatag.manager'); - $bundle_manager = \Drupal::service('entity_type.bundle.info'); - $metatag_groups = $metatag_manager->sortedGroups(); - $entity_types = MetatagDefaultsForm::getSupportedEntityTypes(); - foreach ($entity_types as $entity_type => $entity_label) { - $bundles = $bundle_manager->getBundleInfo($entity_type); - foreach ($bundles as $bundle_id => $bundle_info) { - // Create an option list for each bundle. - $options = []; - foreach ($metatag_groups as $group_name => $group_info) { - $options[$group_name] = $group_info['label']; - } - // Format a collapsible fieldset for each group for easier readability. - $form['entity_type_groups'][$entity_type][$bundle_id] = [ - '#type' => 'details', - '#title' => $entity_label . ': ' . $bundle_info['label'], - ]; - $form['entity_type_groups'][$entity_type][$bundle_id][] = [ - '#type' => 'checkboxes', - '#options' => $options, - '#default_value' => isset($settings[$entity_type]) && isset($settings[$entity_type][$bundle_id]) ? $settings[$entity_type][$bundle_id] : [], - ]; - } - } - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $settings = $this->config('metatag.settings'); - $value = $form_state->getValue('entity_type_groups'); - $value = static::arrayFilterRecursive($value); - // Remove the extra layer created by collapsible fieldsets. - foreach ($value as $entity_type => $bundle) { - foreach ($bundle as $bundle_id => $groups) { - $value[$entity_type][$bundle_id] = $groups[0]; - } - } - $settings->set('entity_type_groups', $value)->save(); - parent::submitForm($form, $form_state); - } - - /** - * Recursively filter results. - * - * @param array $input - * The array to filter. - * - * @return array - * The filtered array. - */ - public static function arrayFilterRecursive(array $input) { - foreach ($input as &$value) { - if (is_array($value)) { - $value = static::arrayFilterRecursive($value); - } - } - return array_filter($input); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php b/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php deleted file mode 100644 index 9b737e302..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace Drupal\metatag\Generator; - -use Drupal\Console\Core\Generator\Generator; -use Drupal\Console\Extension\Manager; -use Drupal\Console\Core\Utils\TwigRenderer; - -/** - * Drupal Console plugin for generating a group. - */ -class MetatagGroupGenerator extends Generator { - - /** - * The console manager. - * - * @var \Drupal\Console\Extension\Manager - */ - protected $extensionManager; - - /** - * The twig renderer. - * - * @var \Drupal\Console\Core\Utils\TwigRenderer - */ - protected $renderer; - - /** - * MetatagGroupGenerator constructor. - * - * @param \Drupal\Console\Extension\Manager $extensionManager - * An extension manager. - * @param \Drupal\Console\Core\Utils\TwigRenderer $renderer - * Twig renderer. - */ - public function __construct(Manager $extensionManager, TwigRenderer $renderer) { - $this->extensionManager = $extensionManager; - - $renderer->addSkeletonDir(__DIR__ . '/../../templates/'); - $this->setRenderer($renderer); - } - - /** - * Generator plugin. - * - * @param string $base_class - * Base class. - * @param string $module - * Module name. - * @param string $label - * Group label. - * @param string $description - * Group description. - * @param string $plugin_id - * Plugin ID. - * @param string $class_name - * Class name. - * @param string $weight - * Group weight. - */ - public function generate($base_class, $module, $label, $description, $plugin_id, $class_name, $weight) { - $parameters = [ - 'base_class' => $base_class, - 'module' => $module, - 'label' => $label, - 'description' => $description, - 'plugin_id' => $plugin_id, - 'class_name' => $class_name, - 'weight' => $weight, - 'prefix' => '<' . '?php', - ]; - - $this->renderFile( - 'group.php.twig', - $this->extensionManager->getPluginPath($module, 'metatag/Group') . '/' . $class_name . '.php', - $parameters - ); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php b/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php deleted file mode 100644 index ba089b64a..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -namespace Drupal\metatag\Generator; - -use Drupal\Console\Core\Generator\Generator; -use Drupal\Console\Extension\Manager; -use Drupal\Console\Core\Utils\TwigRenderer; - -/** - * Drupal Console plugin for generating a tag. - */ -class MetatagTagGenerator extends Generator { - - /** - * An extension manager. - * - * @var \Drupal\Console\Extension\Manager - */ - protected $extensionManager; - - /** - * The twig renderer. - * - * @var \Drupal\Console\Core\Utils\TwigRenderer - */ - protected $render; - - /** - * MetatagTagGenerator constructor. - * - * @param \Drupal\Console\Extension\Manager $extensionManager - * An extension manager. - * @param \Drupal\Console\Core\Utils\TwigRenderer $render - * Twig renderer. - */ - public function __construct(Manager $extensionManager, TwigRenderer $render) { - $this->extensionManager = $extensionManager; - - $render->addSkeletonDir(__DIR__ . '/../../templates/'); - $this->setRenderer($render); - } - - /** - * Generator plugin. - * - * @param string $base_class - * Base class. - * @param string $module - * Module name. - * @param string $name - * Tag name. - * @param string $label - * Tag label. - * @param string $description - * Tag description. - * @param string $plugin_id - * Plugin ID. - * @param string $class_name - * Class name. - * @param string $group - * Tag group. - * @param string $weight - * Tag weight. - * @param string $type - * Tag type. - * @param bool $secure - * Is secure. - * @param bool $multiple - * Is multiple. - */ - public function generate($base_class, $module, $name, $label, $description, $plugin_id, $class_name, $group, $weight, $type, $secure, $multiple) { - $parameters = [ - 'base_class' => $base_class, - 'module' => $module, - 'name' => $name, - 'label' => $label, - 'description' => $description, - 'plugin_id' => $plugin_id, - 'class_name' => $class_name, - 'group' => $group, - 'weight' => $weight, - 'type' => $type, - 'secure' => $secure, - 'multiple' => $multiple, - 'prefix' => '<' . '?php', - ]; - - $this->renderFile( - 'tag.php.twig', - $this->extensionManager->getPluginPath($module, 'metatag/Tag') . '/' . $class_name . '.php', - $parameters - ); - - $this->renderFile( - 'metatag_tag.schema.yml.twig', - $this->extensionManager->getModule($module)->getPath() . '/config/schema/' . $module . '.metatag_tag.schema.yml', - $parameters, - FILE_APPEND - ); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php b/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php deleted file mode 100644 index 36b2bd80d..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\Config\Entity\ConfigEntityInterface; - -/** - * Provides an interface for defining Metatag defaults entities. - */ -interface MetatagDefaultsInterface extends ConfigEntityInterface { - // Add get/set methods for your configuration properties here. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsListBuilder.php b/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsListBuilder.php deleted file mode 100644 index 0b4945009..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsListBuilder.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\Config\Entity\ConfigEntityListBuilder; -use Drupal\Core\Entity\EntityInterface; - -/** - * Provides a listing of Metatag defaults entities. - */ -class MetatagDefaultsListBuilder extends ConfigEntityListBuilder { - - /** - * {@inheritdoc} - */ - protected function getEntityIds() { - $query = $this->getStorage()->getQuery() - ->condition('id', 'global', '<>'); - - // Only add the pager if a limit is specified. - if ($this->limit) { - $query->pager($this->limit); - } - - $entity_ids = $query->execute(); - - // Load global entity always. - return $entity_ids + $this->getParentIds($entity_ids); - } - - /** - * Gets the parent entity ids for the list of entities to load. - * - * @param array $entity_ids - * The metatag entity ids. - * - * @return array - * The list of parents to load - */ - protected function getParentIds(array $entity_ids) { - $parents = ['global' => 'global']; - foreach ($entity_ids as $entity_id) { - if (strpos($entity_id, '__') !== FALSE) { - $entity_id_array = explode('__', $entity_id); - $parent = reset($entity_id_array); - $parents[$parent] = $parent; - } - } - $parents_query = $this->getStorage()->getQuery() - ->condition('id', $parents, 'IN'); - return $parents_query->execute(); - } - - /** - * {@inheritdoc} - */ - public function buildHeader() { - $header['label'] = $this->t('Type'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row['label'] = $this->getLabelAndConfig($entity); - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - - // Global and entity defaults can be reverted but not deleted. - if (in_array($entity->id(), MetatagManager::protectedDefaults())) { - unset($operations['delete']); - $operations['revert'] = [ - 'title' => t('Revert'), - 'weight' => $operations['edit']['weight'] + 1, - 'url' => $entity->toUrl('revert-form'), - ]; - } - - return $operations; - } - - /** - * Renders the Metatag defaults label plus its configuration. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The Metatag defaults entity. - * - * @return array - * Render array for a table cell. - */ - public function getLabelAndConfig(EntityInterface $entity) { - $output = '<div>'; - $prefix = ''; - $inherits = ''; - if ($entity->id() != 'global') { - $prefix = '<div class="indentation"></div>'; - $inherits .= 'Global'; - } - if (strpos($entity->id(), '__') !== FALSE) { - $prefix .= '<div class="indentation"></div>'; - list($entity_label, $bundle_label) = explode(': ', $entity->get('label')); - $inherits .= ', ' . $entity_label; - } - - if (!empty($inherits)) { - $output .= '<div><p>' . t('Inherits meta tags from: @inherits', [ - '@inherits' => $inherits, - ]) . '</p></div>'; - } - $tags = $entity->get('tags'); - if (count($tags)) { - $output .= '<table> -<tbody>'; - foreach ($tags as $tag_id => $tag_value) { - $output .= '<tr><td>' . $tag_id . ':</td><td>' . $tag_value . '</td></tr>'; - } - $output .= '</tbody></table>'; - } - - $output .= '</div></div>'; - - return [ - 'data' => [ - '#type' => 'details', - '#prefix' => $prefix, - '#title' => $entity->label(), - 'config' => [ - '#markup' => $output, - ], - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php b/sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php deleted file mode 100644 index b019ca9eb..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Plugin\DefaultPluginManager; - -/** - * A Plugin to manage your meta tag group. - */ -class MetatagGroupPluginManager extends DefaultPluginManager { - - /** - * {@inheritdoc} - */ - public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - $subdir = 'Plugin/metatag/Group'; - - // The name of the annotation class that contains the plugin definition. - $plugin_definition_annotation_name = 'Drupal\metatag\Annotation\MetatagGroup'; - - parent::__construct($subdir, $namespaces, $module_handler, NULL, $plugin_definition_annotation_name); - - $this->alterInfo('metatag_groups'); - - $this->setCacheBackend($cache_backend, 'metatag_groups'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagManager.php b/sites/all/modules/contrib/admin/metatag/src/MetatagManager.php deleted file mode 100644 index 57c4ca281..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagManager.php +++ /dev/null @@ -1,578 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Component\Render\PlainTextOutput; -use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Language\LanguageInterface; -use Drupal\Core\Logger\LoggerChannelFactoryInterface; -use Drupal\views\ViewEntityInterface; - -/** - * Class MetatagManager. - * - * @package Drupal\metatag - */ -class MetatagManager implements MetatagManagerInterface { - - /** - * The group plugin manager. - * - * @var \Drupal\metatag\MetatagGroupPluginManager - */ - protected $groupPluginManager; - - /** - * The tag plugin manager. - * - * @var \Drupal\metatag\MetatagTagPluginManager - */ - protected $tagPluginManager; - - /** - * The Metatag defaults. - * - * @var array - */ - protected $metatagDefaults; - - /** - * The Metatag token. - * - * @var \Drupal\metatag\MetatagToken - */ - protected $tokenService; - - /** - * The Metatag logging channel. - * - * @var \Drupal\Core\Logger\LoggerChannelInterface - */ - protected $logger; - - /** - * Constructor for MetatagManager. - * - * @param \Drupal\metatag\MetatagGroupPluginManager $groupPluginManager - * The MetatagGroupPluginManager object. - * @param \Drupal\metatag\MetatagTagPluginManager $tagPluginManager - * The MetatagTagPluginMπanager object. - * @param \Drupal\metatag\MetatagToken $token - * The MetatagToken object. - * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $channelFactory - * The LoggerChannelFactoryInterface object. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager - * The EntityTypeManagerInterface object. - */ - public function __construct(MetatagGroupPluginManager $groupPluginManager, - MetatagTagPluginManager $tagPluginManager, - MetatagToken $token, - LoggerChannelFactoryInterface $channelFactory, - EntityTypeManagerInterface $entityTypeManager) { - $this->groupPluginManager = $groupPluginManager; - $this->tagPluginManager = $tagPluginManager; - $this->tokenService = $token; - $this->logger = $channelFactory->get('metatag'); - $this->metatagDefaults = $entityTypeManager->getStorage('metatag_defaults'); - } - - /** - * Returns the list of protected defaults. - * - * @return array - * Th protected defaults. - */ - public static function protectedDefaults() { - return [ - 'global', - '403', - '404', - 'node', - 'front', - 'taxonomy_term', - 'user', - ]; - } - - /** - * {@inheritdoc} - */ - public function tagsFromEntity(ContentEntityInterface $entity) { - $tags = []; - - $fields = $this->getFields($entity); - - /* @var \Drupal\field\Entity\FieldConfig $field_info */ - foreach ($fields as $field_name => $field_info) { - // Get the tags from this field. - $tags = $this->getFieldTags($entity, $field_name); - } - - return $tags; - } - - /** - * {@inheritdoc} - */ - public function tagsFromEntityWithDefaults(ContentEntityInterface $entity) { - return $this->tagsFromEntity($entity) + $this->defaultTagsFromEntity($entity); - } - - /** - * {@inheritdoc} - */ - public function defaultTagsFromEntity(ContentEntityInterface $entity) { - /** @var \Drupal\metatag\Entity\MetatagDefaults $metatags */ - $metatags = $this->metatagDefaults->load('global'); - if (!$metatags) { - return NULL; - } - // Add/overwrite with tags set on the entity type. - $entity_type_tags = $this->metatagDefaults->load($entity->getEntityTypeId()); - if (!is_null($entity_type_tags)) { - $metatags->overwriteTags($entity_type_tags->get('tags')); - } - // Add/overwrite with tags set on the entity bundle. - $bundle_metatags = $this->metatagDefaults->load($entity->getEntityTypeId() . '__' . $entity->bundle()); - if (!is_null($bundle_metatags)) { - $metatags->overwriteTags($bundle_metatags->get('tags')); - } - return $metatags->get('tags'); - } - - /** - * Gets the group plugin definitions. - * - * @return array - * Group definitions. - */ - protected function groupDefinitions() { - return $this->groupPluginManager->getDefinitions(); - } - - /** - * Gets the tag plugin definitions. - * - * @return array - * Tag definitions - */ - protected function tagDefinitions() { - return $this->tagPluginManager->getDefinitions(); - } - - /** - * {@inheritdoc} - */ - public function sortedGroups() { - $metatag_groups = $this->groupDefinitions(); - - // Pull the data from the definitions into a new array. - $groups = []; - foreach ($metatag_groups as $group_name => $group_info) { - $groups[$group_name]['id'] = $group_info['id']; - $groups[$group_name]['label'] = $group_info['label']->render(); - $groups[$group_name]['description'] = $group_info['description']; - $groups[$group_name]['weight'] = $group_info['weight']; - } - - // Create the 'sort by' array. - $sort_by = []; - foreach ($groups as $group) { - $sort_by[] = $group['weight']; - } - - // Sort the groups by weight. - array_multisort($sort_by, SORT_ASC, $groups); - - return $groups; - } - - /** - * {@inheritdoc} - */ - public function sortedTags() { - $metatag_tags = $this->tagDefinitions(); - - // Pull the data from the definitions into a new array. - $tags = []; - foreach ($metatag_tags as $tag_name => $tag_info) { - $tags[$tag_name]['id'] = $tag_info['id']; - $tags[$tag_name]['label'] = $tag_info['label']->render(); - $tags[$tag_name]['group'] = $tag_info['group']; - $tags[$tag_name]['weight'] = $tag_info['weight']; - } - - // Create the 'sort by' array. - $sort_by = []; - foreach ($tags as $key => $tag) { - $sort_by['group'][$key] = $tag['group']; - $sort_by['weight'][$key] = $tag['weight']; - } - - // Sort the tags by weight. - array_multisort($sort_by['group'], SORT_ASC, $sort_by['weight'], SORT_ASC, $tags); - - return $tags; - } - - /** - * {@inheritdoc} - */ - public function sortedGroupsWithTags() { - $groups = $this->sortedGroups(); - $tags = $this->sortedTags(); - - foreach ($tags as $tag_name => $tag) { - $tag_group = $tag['group']; - - if (!isset($groups[$tag_group])) { - // If the tag is claiming a group that has no matching plugin, log an - // error and force it to the basic group. - $this->logger->error("Undefined group '%group' on tag '%tag'", ['%group' => $tag_group, '%tag' => $tag_name]); - $tag['group'] = 'basic'; - $tag_group = 'basic'; - } - - $groups[$tag_group]['tags'][$tag_name] = $tag; - } - - return $groups; - } - - /** - * {@inheritdoc} - */ - public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL) { - // Add the outer fieldset. - $element += [ - '#type' => 'details', - ]; - - $element += $this->tokenService->tokenBrowser($token_types); - - $groups_and_tags = $this->sortedGroupsWithTags(); - - foreach ($groups_and_tags as $group_name => $group) { - // Only act on groups that have tags and are in the list of included - // groups (unless that list is null). - if (isset($group['tags']) && (is_null($included_groups) || in_array($group_name, $included_groups) || in_array($group['id'], $included_groups))) { - // Create the fieldset. - $element[$group_name]['#type'] = 'details'; - $element[$group_name]['#title'] = $group['label']; - $element[$group_name]['#description'] = $group['description']; - $element[$group_name]['#open'] = FALSE; - - foreach ($group['tags'] as $tag_name => $tag) { - // Only act on tags in the included tags list, unless that is null. - if (is_null($included_tags) || in_array($tag_name, $included_tags) || in_array($tag['id'], $included_tags)) { - // Make an instance of the tag. - $tag = $this->tagPluginManager->createInstance($tag_name); - - // Set the value to the stored value, if any. - $tag_value = isset($values[$tag_name]) ? $values[$tag_name] : NULL; - $tag->setValue($tag_value); - - // Open any groups that have non-empty values. - if (!empty($tag_value)) { - $element[$group_name]['#open'] = TRUE; - } - - // Create the bit of form for this tag. - $element[$group_name][$tag_name] = $tag->form($element); - } - } - } - } - - return $element; - } - - /** - * Returns a list of the Metatag fields on an entity. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity to examine. - * - * @return array - * The fields from the entity which are Metatag fields. - */ - protected function getFields(ContentEntityInterface $entity) { - $field_list = []; - - if ($entity instanceof ContentEntityInterface) { - // Get a list of the metatag field types. - $field_types = $this->fieldTypes(); - - // Get a list of the field definitions on this entity. - $definitions = $entity->getFieldDefinitions(); - - // Iterate through all the fields looking for ones in our list. - foreach ($definitions as $field_name => $definition) { - // Get the field type, ie: metatag. - $field_type = $definition->getType(); - - // Check the field type against our list of fields. - if (isset($field_type) && in_array($field_type, $field_types)) { - $field_list[$field_name] = $definition; - } - } - } - - return $field_list; - } - - /** - * Returns a list of the meta tags with values from a field. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The ContentEntityInterface object. - * @param string $field_name - * The name of the field to work on. - * - * @return array - * Array of field tags. - */ - protected function getFieldTags(ContentEntityInterface $entity, $field_name) { - $tags = []; - foreach ($entity->{$field_name} as $item) { - // Get serialized value and break it into an array of tags with values. - $serialized_value = $item->get('value')->getValue(); - if (!empty($serialized_value)) { - $tags += unserialize($serialized_value); - } - } - - return $tags; - } - - /** - * Returns default meta tags for an entity. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity to work on. - * - * @return array - * The default meta tags appropriate for this entity. - */ - public function getDefaultMetatags(ContentEntityInterface $entity = NULL) { - // Get general global metatags. - $metatags = $this->getGlobalMetatags(); - // If that is empty something went wrong. - if (!$metatags) { - return; - } - - // Check if this is a special page. - $special_metatags = $this->getSpecialMetatags(); - - // Merge with all globals defaults. - if ($special_metatags) { - $metatags->set('tags', array_merge($metatags->get('tags'), $special_metatags->get('tags'))); - } - - // Next check if there is this page is an entity that has meta tags. - // @todo Think about using other defaults, e.g. views. Maybe use plugins? - else { - if (is_null($entity)) { - $entity = metatag_get_route_entity(); - } - - if (!empty($entity)) { - // Get default meta tags for a given entity. - $entity_defaults = $this->getEntityDefaultMetatags($entity); - if ($entity_defaults != NULL) { - $metatags->set('tags', array_merge($metatags->get('tags'), $entity_defaults)); - } - } - } - - return $metatags->get('tags'); - } - - /** - * Returns global meta tags. - * - * @return array - * The global meta tags. - */ - public function getGlobalMetatags() { - return $this->metatagDefaults->load('global'); - } - - /** - * Returns special meta tags. - * - * @return array - * The defaults for this page, if it's a special page. - */ - public function getSpecialMetatags() { - $metatags = NULL; - - if (\Drupal::service('path.matcher')->isFrontPage()) { - $metatags = $this->metatagDefaults->load('front'); - } - elseif (\Drupal::service('current_route_match')->getRouteName() == 'system.403') { - $metatags = $this->metatagDefaults->load('403'); - } - elseif (\Drupal::service('current_route_match')->getRouteName() == 'system.404') { - $metatags = $this->metatagDefaults->load('404'); - } - - return $metatags; - } - - /** - * Returns default meta tags for an entity. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity to work with. - * - * @return array - * The appropriate default meta tags. - */ - public function getEntityDefaultMetatags(ContentEntityInterface $entity) { - $entity_metatags = $this->metatagDefaults->load($entity->getEntityTypeId()); - $metatags = []; - if ($entity_metatags != NULL) { - // Merge with global defaults. - $metatags = array_merge($metatags, $entity_metatags->get('tags')); - } - - // Finally, check if we should apply bundle overrides. - $bundle_metatags = $this->metatagDefaults->load($entity->getEntityTypeId() . '__' . $entity->bundle()); - if ($bundle_metatags != NULL) { - // Merge with existing defaults. - $metatags = array_merge($metatags, $bundle_metatags->get('tags')); - } - - return $metatags; - } - - /** - * Generate the elements that go in the hook_page_attachments attached array. - * - * @param array $tags - * The array of tags as plugin_id => value. - * @param object $entity - * Optional entity object to use for token replacements. - * - * @return array - * Render array with tag elements. - */ - public function generateElements(array $tags, $entity = NULL) { - $elements = []; - $tags = $this->generateRawElements($tags, $entity); - - foreach ($tags as $name => $tag) { - if (!empty($tag)) { - $elements['#attached']['html_head'][] = [ - $tag, - $name, - ]; - } - } - - return $elements; - } - - /** - * Generate the actual meta tag values. - * - * @param array $tags - * The array of tags as plugin_id => value. - * @param object $entity - * Optional entity object to use for token replacements. - * - * @return array - * Render array with tag elements. - */ - public function generateRawElements(array $tags, $entity = NULL) { - // Ignore the update.php path. - $request = \Drupal::request(); - if ($request->getBaseUrl() == '/update.php') { - return []; - } - - $rawTags = []; - - $metatag_tags = $this->tagPluginManager->getDefinitions(); - - // Order the elements by weight first, as some systems like Facebook care. - uksort($tags, function ($tag_name_a, $tag_name_b) use ($metatag_tags) { - $weight_a = isset($metatag_tags[$tag_name_a]['weight']) ? $metatag_tags[$tag_name_a]['weight'] : 0; - $weight_b = isset($metatag_tags[$tag_name_b]['weight']) ? $metatag_tags[$tag_name_b]['weight'] : 0; - - return ($weight_a < $weight_b) ? -1 : 1; - }); - - // Each element of the $values array is a tag with the tag plugin name as - // the key. - foreach ($tags as $tag_name => $value) { - // Check to ensure there is a matching plugin. - if (isset($metatag_tags[$tag_name])) { - // Get an instance of the plugin. - $tag = $this->tagPluginManager->createInstance($tag_name); - - // Render any tokens in the value. - $token_replacements = []; - if ($entity) { - // @todo This needs a better way of discovering the context. - if ($entity instanceof ViewEntityInterface) { - // Views tokens require the ViewExecutable, not the config entity. - // @todo Can we move this into metatag_views somehow? - $token_replacements = ['view' => $entity->getExecutable()]; - } - elseif ($entity instanceof ContentEntityInterface) { - $token_replacements = [$entity->getEntityTypeId() => $entity]; - } - } - - // Set the value as sometimes the data needs massaging, such as when - // field defaults are used for the Robots field, which come as an array - // that needs to be filtered and converted to a string. - // @see Robots::setValue() - $tag->setValue($value); - $langcode = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId(); - - $processed_value = PlainTextOutput::renderFromHtml(htmlspecialchars_decode($this->tokenService->replace($tag->value(), $token_replacements, ['langcode' => $langcode]))); - - // Now store the value with processed tokens back into the plugin. - $tag->setValue($processed_value); - - // Have the tag generate the output based on the value we gave it. - $output = $tag->output(); - - if (!empty($output)) { - $output = $tag->multiple() ? $output : [$output]; - - // Backwards compatibility for modules which don't support this logic. - if (isset($output['#tag'])) { - $output = [$output]; - } - - foreach ($output as $index => $element) { - // Add index to tag name as suffix to avoid having same key. - $index_tag_name = $tag->multiple() ? $tag_name . '_' . $index : $tag_name; - $rawTags[$index_tag_name] = $element; - } - } - } - } - - return $rawTags; - } - - /** - * Returns a list of fields handled by Metatag. - * - * @return array - * A list of supported field types. - */ - protected function fieldTypes() { - // @todo Either get this dynamically from field plugins or forget it and - // just hardcode metatag where this is called. - return ['metatag']; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php b/sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php deleted file mode 100644 index 0cc060cbc..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\Entity\ContentEntityInterface; - -/** - * Class MetatagManager. - * - * @package Drupal\metatag - */ -interface MetatagManagerInterface { - - /** - * Extracts all tags of a given entity. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The content entity to extract meta tags from. - * - * @return array - * Array of metatags. - */ - public function tagsFromEntity(ContentEntityInterface $entity); - - /** - * Extracts all tags of a given entity. - * - * And combines them with sitewide, per-entity-type, and per-bundle defaults. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The content entity to extract meta tags from. - * - * @return array - * Array of metatags. - */ - public function tagsFromEntityWithDefaults(ContentEntityInterface $entity); - - /** - * Extracts all appropriate default tags for an entity. - * - * From sitewide, per-entity-type, and per-bundle defaults. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The content entity for which to calculate defaults. - * - * @return array - * Array of metatags. - */ - public function defaultTagsFromEntity(ContentEntityInterface $entity); - - /** - * Returns an array of group plugin information sorted by weight. - * - * @return array - * Array of groups, sorted by weight. - */ - public function sortedGroups(); - - /** - * Returns an array of tag plugin information sorted by group then weight. - * - * @return array - * Array of tags, sorted by weight. - */ - public function sortedTags(); - - /** - * Returns a weighted array of groups containing their weighted tags. - * - * @return array - * Array of sorted tags, in groups. - */ - public function sortedGroupsWithTags(); - - /** - * Builds the form element for a Metatag field. - * - * If a list of either groups or tags are passed in, those will be used to - * limit the groups/tags on the form. If nothing is passed in, all groups - * and tags will be used. - * - * @param array $values - * Existing values. - * @param array $element - * Existing element. - * @param array $token_types - * Token types to return in the tree. - * @param array $included_groups - * Available group plugins. - * @param array $included_tags - * Available tag plugins. - * - * @return array - * Render array for metatag form. - */ - public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL); - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagServiceProvider.php b/sites/all/modules/contrib/admin/metatag/src/MetatagServiceProvider.php deleted file mode 100644 index aa1ac3051..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagServiceProvider.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\DependencyInjection\ContainerBuilder; -use Drupal\Core\DependencyInjection\ServiceProviderBase; -use Drupal\metatag\Normalizer\MetatagHalNormalizer; -use Drupal\metatag\Normalizer\MetatagNormalizer; -use Symfony\Component\DependencyInjection\Definition; - -/** - * Service Provider for Metatag. - */ -class MetatagServiceProvider extends ServiceProviderBase { - - /** - * {@inheritdoc} - */ - public function alter(ContainerBuilder $container) { - $modules = $container->getParameter('container.modules'); - if (isset($modules['serialization'])) { - // Serialization module is enabled, add our metatag normalizers. - // Priority of the metatag normalizer must be higher than other - // general-purpose typed data and field item normalizers. - $metatag = new Definition(MetatagNormalizer::class); - $metatag->addTag('normalizer', ['priority' => 30]); - $container->setDefinition('metatag.normalizer.metatag', $metatag); - - $metatag_hal = new Definition(MetatagHalNormalizer::class); - $metatag_hal->addTag('normalizer', ['priority' => 31]); - $container->setDefinition('metatag.normalizer.metatag.hal', $metatag_hal); - } - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php b/sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php deleted file mode 100644 index 06562fed2..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Plugin\DefaultPluginManager; - -/** - * A Plugin to manage your meta tag type. - */ -class MetatagTagPluginManager extends DefaultPluginManager { - - /** - * {@inheritdoc} - */ - public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { - $subdir = 'Plugin/metatag/Tag'; - - // The name of the annotation class that contains the plugin definition. - $plugin_definition_annotation_name = 'Drupal\metatag\Annotation\MetatagTag'; - - parent::__construct($subdir, $namespaces, $module_handler, NULL, $plugin_definition_annotation_name); - - $this->alterInfo('metatag_tags'); - - $this->setCacheBackend($cache_backend, 'metatag_tags'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagToken.php b/sites/all/modules/contrib/admin/metatag/src/MetatagToken.php deleted file mode 100644 index e240fc019..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/MetatagToken.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -namespace Drupal\metatag; - -use Drupal\Core\Utility\Token; -use Drupal\Core\Render\BubbleableMetadata; - -/** - * Token handling service. Uses core token service or contributed Token. - */ -class MetatagToken { - - /** - * Token service. - * - * @var \Drupal\Core\Utility\Token - */ - protected $token; - - /** - * Constructs a new MetatagToken object. - * - * @param \Drupal\Core\Utility\Token $token - * Token service. - */ - public function __construct(Token $token) { - $this->token = $token; - } - - /** - * Wrapper for the Token module's string parsing. - * - * @param string $string - * The string to parse. - * @param array $data - * Arguments for token->replace(). - * @param array $options - * Any additional options necessary. - * @param \Drupal\Core\Render\BubbleableMetadata|null $bubbleable_metadata - * (optional) An object to which static::generate() and the hooks and - * functions that it invokes will add their required bubbleable metadata. - * - * @return mixed|string - * The processed string. - */ - public function replace($string, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) { - // Set default requirements for metatag unless options specify otherwise. - $options = $options + [ - 'clear' => TRUE, - ]; - - $replaced = $this->token->replace($string, $data, $options, $bubbleable_metadata); - - // Ensure that there are no double-slash sequences due to empty token - // values. - $replaced = preg_replace('/(?<!:)(?<!)\/+\//', '/', $replaced); - - return $replaced; - } - - /** - * Gatekeeper function to direct to either the core or contributed Token. - * - * @param array $token_types - * The token types to filter the tokens list by. Defaults to an empty array. - * - * @return array - * If token module is installed, a popup browser plus a help text. If not - * only the help text. - */ - public function tokenBrowser(array $token_types = []) { - $form = []; - - $form['intro_text'] = [ - '#markup' => '<p>' . t('<strong>Configure the meta tags below.</strong><br /> To view a summary of the individual meta tags and the pattern for a specific configuration, click on its name below. Use tokens to avoid redundant meta data and search engine penalization. For example, a \'keyword\' value of "example" will be shown on all content using this configuration, whereas using the [node:field_keywords] automatically inserts the "keywords" values from the current entity (node, term, etc).') . '</p>', - ]; - - // Normalize taxonomy tokens. - if (!empty($token_types)) { - $token_types = array_map(function ($value) { - return stripos($value, 'taxonomy_') === 0 ? substr($value, strlen('taxonomy_')) : $value; - }, (array) $token_types); - } - - $form['tokens'] = [ - '#theme' => 'token_tree_link', - '#token_types' => $token_types, - '#global_types' => TRUE, - '#show_nested' => FALSE, - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php b/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php deleted file mode 100644 index 4d0aff94e..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Drupal\metatag\Normalizer; - -/** - * Converts the Metatag field item object structure to Metatag array structure. - */ -class MetatagHalNormalizer extends MetatagNormalizer { - - /** - * {@inheritdoc} - */ - protected $format = ['hal_json']; - - /** - * {@inheritdoc} - */ - public function normalize($field_item, $format = NULL, array $context = []) { - $normalized = parent::normalize($field_item, $format, $context); - - // Mock the field array similar to the other fields. - return [ - 'metatag' => [$normalized], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php b/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php deleted file mode 100644 index 32837dcd6..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\metatag\Normalizer; - -use Drupal\serialization\Normalizer\NormalizerBase; - -/** - * Normalizes metatag into the viewed entity. - */ -class MetatagNormalizer extends NormalizerBase { - - /** - * {@inheritdoc} - */ - protected $supportedInterfaceOrClass = 'Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList'; - - /** - * {@inheritdoc} - */ - public function normalize($field_item, $format = NULL, array $context = []) { - // @see metatag_get_tags_from_route() - $entity = $field_item->getEntity(); - - $tags = metatag_get_tags_from_route($entity); - - $normalized['value'] = []; - if (isset($tags['#attached']['html_head'])) { - foreach ($tags['#attached']['html_head'] as $tag) { - // @todo Work out a proper, long-term fix for this. - if (isset($tag[0]['#attributes']['content'])) { - $normalized['value'][$tag[1]] = $tag[0]['#attributes']['content']; - } - elseif (isset($tag[0]['#attributes']['href'])) { - $normalized['value'][$tag[1]] = $tag[0]['#attributes']['href']; - } - } - } - - if (isset($context['langcode'])) { - $normalized['lang'] = $context['langcode']; - } - - return $normalized; - } - - /** - * {@inheritdoc} - */ - public function supportsDenormalization($data, $type, $format = NULL) { - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php deleted file mode 100644 index 757179967..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\DataType; - -use Drupal\Core\TypedData\Plugin\DataType\StringData; - -/** - * The metatag data type. - * - * The plain value of a metatag is a serialized object represented as a string. - * - * @DataType( - * id = "metatag", - * label = @Translation("Metatag") - * ) - */ -class Metatag extends StringData implements MetatagInterface { - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/MetatagInterface.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/MetatagInterface.php deleted file mode 100644 index 5d41d2824..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/MetatagInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\DataType; - -use Drupal\Core\TypedData\PrimitiveInterface; - -/** - * The metatag data type. - * - * The plain value of a metatag is a serialized object represented as a string. - */ -interface MetatagInterface extends PrimitiveInterface { - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldFormatter/MetatagEmptyFormatter.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldFormatter/MetatagEmptyFormatter.php deleted file mode 100644 index 06b6877d3..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldFormatter/MetatagEmptyFormatter.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\Field\FieldFormatter; - -use Drupal\Core\Field\FormatterBase; -use Drupal\Core\Field\FieldItemListInterface; - -/** - * Plugin implementation of the 'metatag_empty_formatter' formatter. - * - * @FieldFormatter( - * id = "metatag_empty_formatter", - * module = "metatag", - * label = @Translation("Empty formatter"), - * field_types = { - * "metatag" - * } - * ) - */ -class MetatagEmptyFormatter extends FormatterBase { - - /** - * {@inheritdoc} - */ - public function viewElements(FieldItemListInterface $items, $langcode) { - // Does not actually output anything. - return []; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldType/MetatagFieldItem.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldType/MetatagFieldItem.php deleted file mode 100644 index 5e23ffd7c..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldType/MetatagFieldItem.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\Field\FieldType; - -use Drupal\Core\Field\FieldItemBase; -use Drupal\Core\Field\FieldStorageDefinitionInterface; -use Drupal\Core\TypedData\DataDefinition; - -/** - * Plugin implementation of the 'metatag' field type. - * - * @FieldType( - * id = "metatag", - * label = @Translation("Meta tags"), - * description = @Translation("This field stores code meta tags."), - * default_widget = "metatag_firehose", - * default_formatter = "metatag_empty_formatter", - * serialized_property_names = { - * "value" - * } - * ) - */ -class MetatagFieldItem extends FieldItemBase { - - /** - * {@inheritdoc} - */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { - return [ - 'columns' => [ - 'value' => [ - 'type' => 'text', - 'size' => 'big', - 'not null' => FALSE, - ], - ], - ]; - } - - /** - * {@inheritdoc} - */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { - $properties['value'] = DataDefinition::create('metatag') - ->setLabel(t('Metatag')) - ->setRequired(TRUE); - - return $properties; - } - - /** - * {@inheritdoc} - */ - public function isEmpty() { - $value = $this->get('value')->getValue(); - return $value === NULL || $value === '' || $value === serialize([]); - } - - /** - * {@inheritdoc} - */ - public function preSave() { - parent::preSave(); - - // Merge field defaults on top of global ones. - $default_tags = metatag_get_default_tags(); - - // Get the value about to be saved. - $current_value = $this->value; - // Only unserialize if still serialized string. - if (is_string($current_value)) { - $current_tags = unserialize($current_value); - } - else { - $current_tags = $current_value; - } - - // Only include values that differ from the default. - // @todo When site defaults are added, account for those. - $tags_to_save = []; - foreach ($current_tags as $tag_id => $tag_value) { - if (!isset($default_tags[$tag_id]) || ($tag_value != $default_tags[$tag_id])) { - $tags_to_save[$tag_id] = $tag_value; - } - } - - // Update the value to only save overridden tags. - $this->value = serialize($tags_to_save); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php deleted file mode 100644 index 6797f59ae..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\Field\FieldWidget; - -use Drupal\Core\Field\FieldItemListInterface; -use Drupal\Core\Field\WidgetBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Field\FieldDefinitionInterface; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\metatag\MetatagManager; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Advanced widget for metatag field. - * - * @FieldWidget( - * id = "metatag_firehose", - * label = @Translation("Advanced meta tags form"), - * field_types = { - * "metatag" - * } - * ) - */ -class MetatagFirehose extends WidgetBase implements ContainerFactoryPluginInterface { - - /** - * Instance of MetatagManager service. - * - * @var \Drupal\metatag\MetatagManager - */ - protected $metatagManager; - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $plugin_id, - $plugin_definition, - $configuration['field_definition'], - $configuration['settings'], - $configuration['third_party_settings'], - $container->get('metatag.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, MetatagManager $manager) { - parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings); - $this->metatagManager = $manager; - } - - /** - * {@inheritdoc} - */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { - $item = $items[$delta]; - $default_tags = metatag_get_default_tags(); - - // Retrieve the values for each metatag from the serialized array. - $values = []; - if (!empty($item->value)) { - $values = unserialize($item->value); - } - - // Populate fields which have not been overridden in the entity. - if (!empty($default_tags)) { - foreach ($default_tags as $tag_id => $tag_value) { - if (!isset($values[$tag_id]) && !empty($tag_value)) { - $values[$tag_id] = $tag_value; - } - } - } - - // Retrieve configuration settings. - $settings = \Drupal::config('metatag.settings'); - $entity_type_groups = $settings->get('entity_type_groups'); - - // Find the current entity type and bundle. - $entity_type = $item->getEntity()->getentityTypeId(); - $entity_bundle = $item->getEntity()->bundle(); - - // See if there are requested groups for this entity type and bundle. - $groups = !empty($entity_type_groups[$entity_type]) && !empty($entity_type_groups[$entity_type][$entity_bundle]) ? $entity_type_groups[$entity_type][$entity_bundle] : []; - // Limit the form to requested groups, if any. - if (!empty($groups)) { - $element = $this->metatagManager->form($values, $element, [$entity_type], $groups); - } - // Otherwise, display all groups. - else { - $element = $this->metatagManager->form($values, $element, [$entity_type]); - } - - // Put the form element into the form's "advanced" group. - $element['#group'] = 'advanced'; - - return $element; - } - - /** - * {@inheritdoc} - */ - public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { - // Flatten the values array to remove the groups and then serialize all the - // meta tags into one value for storage. - $tag_manager = \Drupal::service('plugin.manager.metatag.tag'); - foreach ($values as &$value) { - $flattened_value = []; - foreach ($value as $group) { - // Exclude the "original delta" value. - if (is_array($group)) { - foreach ($group as $tag_id => $tag_value) { - $tag = $tag_manager->createInstance($tag_id); - $tag->setValue($tag_value); - if (!empty($tag->value())) { - $flattened_value[$tag_id] = $tag->value(); - } - } - } - } - $value = serialize($flattened_value); - } - - return $values; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php deleted file mode 100644 index 69c11265e..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\Field; - -use Drupal\Core\Field\FieldItemList; - -/** - * Defines a metatag list class for better normalization targeting. - */ -class MetatagEntityFieldItemList extends FieldItemList { -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php deleted file mode 100644 index 105ef5366..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/GraphQL/Scalars/MetatagScalar.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\GraphQL\Scalars; - -use Drupal\graphql\Plugin\GraphQL\Scalars\Internal\StringScalar; - -/** - * Metatag module dummy type. - * - * Metatag module defines a custom data type that essentially is a string, but - * not called "string", which causes the GraphQL type system chokes. - * - * @GraphQLScalar( - * id = "metatag", - * name = "metatag", - * type = "string" - * ) - */ -class MetatagScalar extends StringScalar { -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Advanced.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Advanced.php deleted file mode 100644 index ab76679f5..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Advanced.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Group; - -/** - * The advanced group. - * - * @MetatagGroup( - * id = "advanced", - * label = @Translation("Advanced"), - * description = @Translation("Meta tags that might not be needed by many sites."), - * weight = 2 - * ) - */ -class Advanced extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Basic.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Basic.php deleted file mode 100644 index 26705acf7..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/Basic.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Group; - -/** - * The basic group. - * - * @MetatagGroup( - * id = "basic", - * label = @Translation("Basic tags"), - * description = @Translation("Simple meta tags."), - * weight = 1 - * ) - */ -class Basic extends GroupBase { - // Inherits everything from Base. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/GroupBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/GroupBase.php deleted file mode 100644 index 0c2770ce8..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Group/GroupBase.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Group; - -use Drupal\Component\Plugin\PluginBase; - -/** - * Each group will extend this base. - */ -abstract class GroupBase extends PluginBase { - - /** - * Machine name of the meta tag group plugin. - * - * @var string - */ - protected $id; - - /** - * The name of the group. - * - * @var \Drupal\Core\Annotation\Translation - * - * @ingroup plugin_translatable - */ - protected $label; - - /** - * Description of the group. - * - * @var string - */ - protected $description; - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - - // Set the properties from the annotation. - // @todo Should we have setProperty() methods for each of these? - $this->id = $plugin_definition['id']; - $this->label = $plugin_definition['label']; - $this->description = $plugin_definition['description']; - } - - /** - * Get this group's internal ID. - * - * @return string - * This group's ID. - */ - public function id() { - return $this->id; - } - - /** - * Get this group's human-friendly name. - * - * @return string - * This group's human-friendly name. - */ - public function label() { - return $this->label; - } - - /** - * This group object's description. - * - * @return string - * This group's ID. - */ - public function description() { - return $this->description; - } - - /** - * Whether or not this group is being used. - * - * @return bool - * Whether this group has been enabled. - */ - public function isActive() { - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php deleted file mode 100644 index d8786110e..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Abstract" meta tag. - * - * @MetatagTag( - * id = "abstract", - * label = @Translation("Abstract"), - * description = @Translation("A brief and concise summary of the page's content, preferably 150 characters or less. Where as the description meta tag may be used by search engines to display a snippet about the page in search results, the abstract tag may be used to archive a summary about the page. This meta tag is <em>no longer</em> supported by major search engines."), - * name = "abstract", - * group = "basic", - * weight = 3, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class AbstractTag extends MetaNameBase { - - /** - * Generate a form element for this meta tag. - */ - public function form(array $element = []) { - $form = [ - '#type' => 'textarea', - '#title' => $this->label(), - '#default_value' => $this->value(), - '#row' => 2, - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#description' => $this->description(), - '#element_validate' => [[get_class($this), 'validateTag']], - ]; - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php deleted file mode 100644 index 9b2f85a25..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'canonical' meta tag. - * - * @MetatagTag( - * id = "canonical_url", - * label = @Translation("Canonical URL"), - * description = @Translation("A link to the preferred page location or URL of the content of this page, to help eliminate duplicate content penalties from search engines."), - * name = "canonical", - * group = "advanced", - * weight = 1, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class CanonicalUrl extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ContentLanguage.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ContentLanguage.php deleted file mode 100644 index dfc0942e2..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ContentLanguage.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The advanced "Content Language" meta tag. - * - * @MetatagTag( - * id = "content_language", - * label = @Translation("Content Language"), - * description = @Translation("Used to define this page's language code. May be the two letter language code, e.g. ""de"" for German, or the two letter code with a dash and the two letter ISO country code, e.g. ""de-AT"" for German in Austria. Still used by Bing."), - * name = "content-language", - * group = "advanced", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ContentLanguage extends MetaHttpEquivBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Description.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Description.php deleted file mode 100644 index 7616d77fd..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Description.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Description" meta tag. - * - * @MetatagTag( - * id = "description", - * label = @Translation("Description"), - * description = @Translation("A brief and concise summary of the page's content, preferably 320 characters or less. The description meta tag may be used by search engines to display a snippet about the page in search results."), - * name = "description", - * group = "basic", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Description extends MetaNameBase { - - /** - * Generate a form element for this meta tag. - */ - public function form(array $element = []) { - $form = [ - '#type' => 'textarea', - '#title' => $this->label(), - '#default_value' => $this->value(), - '#row' => 2, - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#description' => $this->description(), - '#element_validate' => [[get_class($this), 'validateTag']], - ]; - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php deleted file mode 100644 index 23f19bba4..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Generator" meta tag. - * - * @MetatagTag( - * id = "generator", - * label = @Translation("Generator"), - * description = @Translation("Describes the name and version number of the software or publishing tool used to create the page."), - * name = "generator", - * group = "advanced", - * weight = 4, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Generator extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPlacename.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPlacename.php deleted file mode 100644 index c8c3a7f8d..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPlacename.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'geo.placename' meta tag. - * - * @MetatagTag( - * id = "geo_placename", - * label = @Translation("Geographical place name"), - * description = @Translation("A location's formal name."), - * name = "geo.placename", - * group = "advanced", - * weight = 0, - * type = "label", - * secure = 0, - * multiple = FALSE - * ) - */ -class GeoPlacename extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPosition.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPosition.php deleted file mode 100644 index c50d7c6b2..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoPosition.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'geo.position' meta tag. - * - * @MetatagTag( - * id = "geo_position", - * label = @Translation("Geographical position"), - * description = @Translation("Geo-spatial information in 'latitude; longitude' format, e.g. '50.167958; -97.133185'; <a href='https://en.wikipedia.org/wiki/Geographic_coordinate_system'>see Wikipedia for details</a>."), - * name = "geo.position", - * group = "advanced", - * weight = 0, - * type = "label", - * secure = 0, - * multiple = FALSE - * ) - */ -class GeoPosition extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php deleted file mode 100644 index b939e462f..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'geo.region' meta tag. - * - * @MetatagTag( - * id = "geo_region", - * label = @Translation("Geographical region"), - * description = @Translation("A location's two-letter international country code, with an optional two-letter region, e.g. 'US-NH' for New Hampshire in the USA."), - * name = "geo.region", - * group = "advanced", - * weight = 0, - * type = "label", - * secure = 0, - * multiple = FALSE - * ) - */ -class GeoRegion extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Google.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Google.php deleted file mode 100644 index 0f81d955d..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Google.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'google' meta tag. - * - * @MetatagTag( - * id = "google", - * label = @Translation("Google"), - * description = @Translation("This meta tag communicates with Google. There are currently two directives supported: 'nositelinkssearchbox' to not to show the sitelinks search box, and 'notranslate' to ask Google not to offer a translation of the page. Both options may be added, just separate them with a comma. See <a href='https://support.google.com/webmasters/answer/79812?hl=en'>meta tags that Google understands</a> for further details."), - * name = "google", - * group = "advanced", - * weight = 5, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Google extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php deleted file mode 100644 index 078d2c7a9..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'icbm' meta tag. - * - * @MetatagTag( - * id = "icbm", - * label = @Translation("ICBM"), - * description = @Translation("Geo-spatial information in 'latitude, longitude' format, e.g. '50.167958, -97.133185'; <a href='https://en.wikipedia.org/wiki/ICBM_address'>see Wikipedia for details</a>."), - * name = "icbm", - * group = "advanced", - * weight = 0, - * type = "label", - * secure = 0, - * multiple = FALSE - * ) - */ -class Icbm extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php deleted file mode 100644 index 6c9fe3eaa..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The advanced "Image" meta tag. - * - * @MetatagTag( - * id = "image_src", - * label = @Translation("Image"), - * description = @Translation("An image associated with this page, for use as a thumbnail in social networks and other services."), - * name = "image_src", - * group = "advanced", - * weight = 4, - * type = "image", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ImageSrc extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Keywords.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Keywords.php deleted file mode 100644 index fd59665d1..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Keywords.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Keywords" meta tag. - * - * @MetatagTag( - * id = "keywords", - * label = @Translation("Keywords"), - * description = @Translation("A comma-separated list of keywords about the page. This meta tag is <em>no longer</em> supported by most search engines."), - * name = "keywords", - * group = "basic", - * weight = 4, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Keywords extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php deleted file mode 100644 index 449ce2fb4..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * This base plugin allows "link rel" tags to be further customized. - */ -abstract class LinkRelBase extends MetaNameBase { - - /** - * {@inheritdoc} - */ - public function output() { - $element = parent::output(); - if (!empty($element['#attributes']['content'])) { - $element['#tag'] = 'link'; - $element['#attributes'] = [ - 'rel' => $this->name(), - 'href' => $element['#attributes']['content'], - ]; - unset($element['#attributes']['content']); - } - - return $element; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php deleted file mode 100644 index 607d6bf75..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * This base plugin allows "http-equiv"-style meta tags to be customized. - * - * Used with e.g. the content language meta tag. - */ -abstract class MetaHttpEquivBase extends MetaNameBase { - - /** - * {@inheritdoc} - */ - protected $nameAttribute = 'http-equiv'; - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaItempropBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaItempropBase.php deleted file mode 100644 index 802e247fa..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaItempropBase.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * This base plugin allows "itemprop"-style meta tags be customized. - * - * Used with e.g. the Google Plus tags. - */ -abstract class MetaItempropBase extends MetaNameBase { - - /** - * {@inheritdoc} - */ - protected $nameAttribute = 'itemprop'; - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaNameBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaNameBase.php deleted file mode 100644 index 9212571ef..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaNameBase.php +++ /dev/null @@ -1,413 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -use Drupal\Component\Plugin\PluginBase; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\StringTranslation\StringTranslationTrait; - -/** - * Each meta tag will extend this base. - */ -abstract class MetaNameBase extends PluginBase { - - use StringTranslationTrait; - - /** - * Machine name of the meta tag plugin. - * - * @var string - */ - protected $id; - - /** - * Official metatag name. - * - * @var string - */ - protected $name; - - /** - * The title of the plugin. - * - * @var \Drupal\Core\Annotation\Translation - * - * @ingroup plugin_translatable - */ - protected $label; - - /** - * A longer explanation of what the field is for. - * - * @var \Drupal\Core\Annotation\Translation - * - * @ingroup plugin_translatable - */ - protected $description; - - /** - * The category this meta tag fits in. - * - * @var string - */ - protected $group; - - /** - * Type of the value being stored. - * - * @var string - */ - protected $type; - - /** - * True if URL must use HTTPS. - * - * @var bool - */ - protected $secure; - - /** - * True if more than one is allowed. - * - * @var bool - */ - protected $multiple; - - /** - * True if the URL value(s) must be absolute. - * - * @var bool - */ - protected $absoluteUrl; - - /** - * Retrieves the currently active request object. - * - * @var \Symfony\Component\HttpFoundation\Request - */ - protected $request; - - /** - * The value of the metatag in this instance. - * - * @var mixed - */ - protected $value; - - /** - * The attribute this tag uses for the name. - * - * @var string - */ - protected $nameAttribute = 'name'; - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - - // Set the properties from the annotation. - // @todo Should we have setProperty() methods for each of these? - $this->id = $plugin_definition['id']; - $this->name = $plugin_definition['name']; - $this->label = $plugin_definition['label']; - $this->description = $plugin_definition['description']; - $this->group = $plugin_definition['group']; - $this->weight = $plugin_definition['weight']; - $this->type = $plugin_definition['type']; - $this->secure = $plugin_definition['secure']; - $this->multiple = $plugin_definition['multiple']; - $this->absoluteUrl = !empty($plugin_definition['absolute_url']); - $this->request = \Drupal::request(); - } - - /** - * Obtain the meta tag's internal ID. - * - * @return string - * This meta tag's internal ID. - */ - public function id() { - return $this->id; - } - - /** - * This meta tag's label. - * - * @return string - * The label. - */ - public function label() { - return $this->label; - } - - /** - * The meta tag's description. - * - * @return bool - * This meta tag's description. - */ - public function description() { - return $this->description; - } - - /** - * The meta tag's machine name. - * - * @return string - * This meta tag's machine name. - */ - public function name() { - return $this->name; - } - - /** - * The meta tag group this meta tag belongs to. - * - * @return string - * The meta tag's group name. - */ - public function group() { - return $this->group; - } - - /** - * This meta tag's form field's weight. - * - * @return int|float - * The form API weight for this. May be any number supported by Form API. - */ - public function weight() { - return $this->weight; - } - - /** - * Obtain this meta tag's type. - * - * @return string - * This meta tag's type. - */ - public function type() { - return $this->type; - } - - /** - * Whether or not this meta tag must output secure (HTTPS) URLs. - * - * @return bool - * Whether or not this meta tag must output secure (HTTPS) URLs. - */ - public function secure() { - return $this->secure; - } - - /** - * Whether or not this meta tag supports multiple values. - * - * @return bool - * Whether or not this meta tag supports multiple values. - */ - public function multiple() { - return $this->multiple; - } - - /** - * Whether or not this meta tag must output required absolute URLs. - * - * @return bool - * Whether or not this meta tag must output required absolute URLs. - */ - public function requiresAbsoluteUrl() { - return $this->absoluteUrl; - } - - /** - * Whether or not this meta tag is active. - * - * @return bool - * Whether this meta tag has been enabled. - */ - public function isActive() { - return TRUE; - } - - /** - * Generate a form element for this meta tag. - * - * @param array $element - * The existing form element to attach to. - * - * @return array - * The completed form element. - */ - public function form(array $element = []) { - $form = [ - '#type' => 'textfield', - '#title' => $this->label(), - '#default_value' => $this->value(), - '#maxlength' => 255, - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#description' => $this->description(), - '#element_validate' => [[get_class($this), 'validateTag']], - ]; - - // Optional handling for items that allow multiple values. - if (!empty($this->multiple)) { - $form['#description'] .= ' ' . $this->t('Multiple values may be used, separated by a comma. Note: Tokens that return multiple values will be handled automatically.'); - } - - // Optional handling for images. - if ((!empty($this->type())) && ($this->type() === 'image')) { - $form['#description'] .= ' ' . $this->t('This will be able to extract the URL from an image field.'); - } - - if (!empty($this->absolute_url)) { - $form['#description'] .= ' ' . $this->t('Any relative or protocol-relative URLs will be converted to absolute URLs.'); - } - - // Optional handling for secure paths. - if (!empty($this->secure)) { - $form['#description'] .= ' ' . $this->t('Any links containing http:// will be converted to https://'); - } - - return $form; - } - - /** - * Obtain the current meta tag's raw value. - * - * @return string - * The current raw meta tag value. - */ - public function value() { - return $this->value; - } - - /** - * Assign the current meta tag a value. - * - * @param string $value - * The value to assign this meta tag. - */ - public function setValue($value) { - $this->value = $value; - } - - /** - * Make the string presentable. - * - * @param string $value - * The raw string to process. - * - * @return string - * The meta tag value after processing. - */ - private function tidy($value) { - return trim($value); - } - - /** - * Generate the HTML tag output for a meta tag. - * - * @return array|string - * A render array or an empty string. - */ - public function output() { - if (empty($this->value)) { - // If there is no value, we don't want a tag output. - return $this->multiple() ? [] : ''; - } - - // Parse out the image URL, if needed. - $value = $this->parseImageUrl(); - $values = $this->multiple() ? explode(',', $value) : [$value]; - $elements = []; - foreach ($values as $value) { - $value = $this->tidy($value); - if ($this->requiresAbsoluteUrl()) { - // Relative URL. - if (parse_url($value, PHP_URL_HOST) == NULL) { - $value = $this->request->getSchemeAndHttpHost() . $value; - } - // Protocol-relative URL. - elseif (substr($value, 0, 2) === '//') { - $value = $this->request->getScheme() . ':' . $value; - } - } - - // If tag must be secure, convert all http:// to https://. - if ($this->secure() && strpos($value, 'http://') !== FALSE) { - $value = str_replace('http://', 'https://', $value); - } - - $elements[] = [ - '#tag' => 'meta', - '#attributes' => [ - $this->nameAttribute => $this->name, - 'content' => $value, - ], - ]; - } - - return $this->multiple() ? $elements : reset($elements); - } - - /** - * Validates the metatag data. - * - * @param array $element - * The form element to process. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - */ - public static function validateTag(array &$element, FormStateInterface $form_state) { - // @todo If there is some common validation, put it here. Otherwise, make - // it abstract? - } - - /** - * Extract any image URLs that might be found in a meta tag. - * - * @return string - * A comma separated list of any image URLs found in the meta tag's value, - * or the original string if no images were identified. - */ - protected function parseImageUrl() { - $value = $this->value(); - - // If this contains embedded image tags, extract the image URLs. - if ($this->type() === 'image') { - // If image tag src is relative (starts with /), convert to an absolute - // link; ignore protocol-relative URLs. - global $base_root; - if (strpos($value, '<img src="/') !== FALSE && strpos($value, '<img src="//') === FALSE) { - $value = str_replace('<img src="/', '<img src="' . $base_root . '/', $value); - } - - if ($this->multiple()) { - // Split the string into an array, remove empty items. - $values = array_filter(explode(',', $value)); - } - else { - $values = [$value]; - } - - // Check through the value(s) to see if there are any image tags. - foreach ($values as $key => $val) { - $matches = []; - preg_match('/src="([^"]*)"/', $val, $matches); - if (!empty($matches[1])) { - $values[$key] = $matches[1]; - } - } - $value = implode(',', $values); - - // Remove any HTML tags that might remain. - $value = strip_tags($value); - } - - return $value; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php deleted file mode 100644 index c242d23cf..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * This base plugin allows "property"-style meta tags tobe customized. - * - * Used with e.g. the Open Graph tags. - */ -abstract class MetaPropertyBase extends MetaNameBase { - - /** - * {@inheritdoc} - */ - protected $nameAttribute = 'property'; - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/NewsKeywords.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/NewsKeywords.php deleted file mode 100644 index 081debd6e..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/NewsKeywords.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "NewsKeywords" meta tag. - * - * @MetatagTag( - * id = "news_keywords", - * label = @Translation("News Keywords"), - * description = @Translation("A comma-separated list of keywords about the page. This meta tag is used as an indicator in <a href=':google_news'>Google News</a>.", arguments = { ":google_news" = "https://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297" }), - * name = "news_keywords", - * group = "advanced", - * weight = 2, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class NewsKeywords extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php deleted file mode 100644 index aa3cd820f..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The advanced "Original Source" meta tag. - * - * @MetatagTag( - * id = "original_source", - * label = @Translation("Original source"), - * description = @Translation("Used to indicate the URL that broke the story, and can link to either an internal URL or an external source. If the full URL is not known it is acceptable to use a partial URL or just the domain name."), - * name = "original-source", - * group = "advanced", - * weight = 4, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class OriginalSource extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Referrer.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Referrer.php deleted file mode 100644 index c4be7ab1f..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Referrer.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Referrer policy" meta tag. - * - * @MetatagTag( - * id = "referrer", - * label = @Translation("Referrer policy"), - * description = @Translation("Indicate to search engines and other page scrapers whether or not links should be followed. See <a href='http://w3c.github.io/webappsec/specs/referrer-policy/'>the W3C specifications</a> for further details."), - * name = "referrer", - * group = "advanced", - * weight = 5, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Referrer extends MetaNameBase { - - /** - * {@inheritdoc} - */ - public function form(array $element = []) { - $form = [ - '#type' => 'select', - '#title' => $this->label(), - '#description' => $this->description(), - '#options' => [ - 'no-referrer' => t('No Referrer'), - 'origin' => t('Origin'), - 'no-referrer-when-downgrade' => t('No Referrer When Downgrade'), - 'origin-when-cross-origin' => t('Origin When Cross-Origin'), - 'unsafe-url' => t('Unsafe URL'), - ], - '#empty_option' => t('- None -'), - '#empty_value' => '', - '#default_value' => $this->value(), - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#element_validate' => [[get_class($this), 'validateTag']], - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php deleted file mode 100644 index df692eed3..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Rights" meta tag. - * - * @MetatagTag( - * id = "rights", - * label = @Translation("Rights"), - * description = @Translation("Details about intellectual property, such as copyright or trademarks; does not automatically protect the site's content or intellectual property."), - * name = "rights", - * group = "advanced", - * weight = 5, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Rights extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Robots.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Robots.php deleted file mode 100644 index 363fbbcbf..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Robots.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Robots" meta tag. - * - * @MetatagTag( - * id = "robots", - * label = @Translation("Robots"), - * description = @Translation("Provides search engines with specific directions for what to do when this page is indexed."), - * name = "robots", - * group = "advanced", - * weight = 1, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Robots extends MetaNameBase { - - /** - * Sets the value of this tag. - * - * @param string|array $value - * The value to set to this tag. - * It can be an array if it comes from a form submission or from field - * defaults, in which case - * we transform it to a comma-separated string. - */ - public function setValue($value) { - if (is_array($value)) { - $value = array_filter($value); - $value = implode(', ', array_keys($value)); - } - $this->value = $value; - } - - /** - * {@inheritdoc} - */ - public function form(array $element = []) { - // Prepare the default value as it is stored as a string. - $default_value = []; - if (!empty($this->value)) { - $default_value = explode(', ', $this->value); - } - - $form = [ - '#type' => 'checkboxes', - '#title' => $this->label(), - '#description' => $this->description(), - '#options' => [ - 'index' => t('Allow search engines to index this page (assumed).'), - 'follow' => t('Allow search engines to follow links on this page (assumed).'), - 'noindex' => t('Prevents search engines from indexing this page.'), - 'nofollow' => t('Prevents search engines from following links on this page.'), - 'noarchive' => t('Prevents cached copies of this page from appearing in search results.'), - 'nosnippet' => t('Prevents descriptions from appearing in search results, and prevents page caching.'), - 'noodp' => t('Blocks the <a href=":opendirectory">Open Directory Project</a> description from appearing in search results.', [':opendirectory' => 'http://www.dmoz.org/']), - 'noydir' => t('Prevents Yahoo! from listing this page in the <a href=":ydir">Yahoo! Directory</a>.', [':ydir' => 'http://dir.yahoo.com/']), - 'noimageindex' => t('Prevent search engines from indexing images on this page.'), - 'notranslate' => t('Prevent search engines from offering to translate this page in search results.'), - ], - '#default_value' => $default_value, - '#required' => isset($element['#required']) ? $element['#required'] : FALSE, - '#element_validate' => [[get_class($this), 'validateTag']], - ]; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php deleted file mode 100644 index f72c76318..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'set-cookie' meta tag. - * - * @MetatagTag( - * id = "set_cookie", - * label = @Translation("Set cookie"), - * description = @Translation("<a href='https://www.metatags.org/meta_http_equiv_set_cookie'>Sets a cookie</a> on the visitor's browser. Can be in either NAME=VALUE format, or a more verbose format including the path and expiration date; see the link for full details on the syntax."), - * name = "set-cookie", - * group = "advanced", - * weight = 5, - * type = "string", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class SetCookie extends MetaHttpEquivBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php deleted file mode 100644 index 9df80e5b9..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * Provides a plugin for the 'shortlink' meta tag. - * - * @MetatagTag( - * id = "shortlink", - * label = @Translation("Shortlink URL"), - * description = @Translation("A brief URL, often created by a URL shortening service."), - * name = "shortlink", - * group = "advanced", - * weight = 1, - * type = "uri", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class ShortLink extends LinkRelBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Standout.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Standout.php deleted file mode 100644 index 131f0a4c7..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Standout.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The basic "Standout" meta tag. - * - * @MetatagTag( - * id = "standout", - * label = @Translation("Standout"), - * description = @Translation("Highlight standout journalism on the web, especially for breaking news; used as an indicator in <a href=':google_news'>Google News</a>. Warning: Don't abuse it, to be used a maximum of 7 times per calendar week!", arguments = { ":google_news" = "https://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297" }), - * name = "standout", - * group = "advanced", - * weight = 3, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Standout extends MetaNameBase { - // Nothing here yet. Just a placeholder class for a plugin. -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php deleted file mode 100644 index 4cdbe54b6..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\metatag\Plugin\metatag\Tag; - -/** - * The standard page title. - * - * @MetatagTag( - * id = "title", - * label = @Translation("Page title"), - * description = @Translation("The text to display in the title bar of a visitor's web browser when they view this page. This meta tag may also be used as the title of the page when a visitor bookmarks or favorites this page, or as the page title in a search engine result. It is common to append '[site:name]' to the end of this, so the site's name is automatically added. It is recommended that the title is no greater than 55 - 65 characters long, including spaces."), - * name = "title", - * group = "basic", - * weight = -1, - * type = "label", - * secure = FALSE, - * multiple = FALSE - * ) - */ -class Title extends MetaNameBase { - - /** - * Override the output of this tag so it's an actual TITLE tag. - * - * @todo Override the existing title tag X-) - */ - // public function output() { - // if (empty($this->value)) { - // // If there is no value, we don't want a tag output. - // $element = ''; - // } - // else { - // $element = [ - // '#theme' => 'hidden', - // // '#tag' => 'title', - // '#value' => $this->value(), - // ]; - // } - // - // return $element; - // } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php deleted file mode 100644 index 3072b62e0..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php +++ /dev/null @@ -1,497 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\metatag\MetatagManager; -use Drupal\metatag\Entity\MetatagDefaults; -use Drupal\simpletest\WebTestBase; -use Drupal\Tests\metatag\Functional\MetatagHelperTrait; - -/** - * Tests the Metatag administration. - * - * @group metatag - */ -class MetatagAdminTest extends WebTestBase { - - use MetatagHelperTrait; - - /** - * {@inheritdoc} - */ - public static $modules = [ - 'node', - 'field_ui', - 'test_page_test', - 'token', - 'metatag', - - // @see testAvailableConfigEntities - 'block', - 'block_content', - 'comment', - 'contact', - 'menu_link_content', - 'menu_ui', - 'shortcut', - 'taxonomy', - 'entity_test', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Use the test page as the front page. - $this->config('system.site')->set('page.front', '/test-page')->save(); - - // Create Basic page and Article node types. - if ($this->profile != 'standard') { - $this->drupalCreateContentType([ - 'type' => 'page', - 'name' => 'Basic page', - 'display_submitted' => FALSE, - ]); - $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); - } - } - - /** - * Tests the interface to manage metatag defaults. - */ - public function testDefaults() { - // Save the default title to test the Revert operation at the end. - $metatag_defaults = \Drupal::config('metatag.metatag_defaults.global'); - $default_title = $metatag_defaults->get('tags')['title']; - - // Initiate session with a user who can manage metatags. - $permissions = ['administer site configuration', 'administer meta tags']; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - - // Check that the user can see the list of metatag defaults. - $this->drupalGet('admin/config/search/metatag'); - $this->assertResponse(200); - - // Check that the Global defaults were created. - $this->assertLinkByHref('admin/config/search/metatag/global', 0, t('Global defaults were created on installation.')); - - // Check that Global and entity defaults can't be deleted. - $this->assertNoLinkByHref('admin/config/search/metatag/global/delete', 0, t("Global defaults can't be deleted")); - $this->assertNoLinkByHref('admin/config/search/metatag/node/delete', 0, t("Entity defaults can't be deleted")); - - // Check that the module defaults were injected into the Global config - // entity. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $this->assertFieldById('edit-title', $metatag_defaults->get('title'), t('Metatag defaults were injected into the Global configuration entity.')); - - // Update the Global defaults and test them. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'title' => 'Test title', - 'description' => 'Test description', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - $this->drupalGet('hit-a-404'); - $this->assertResponse(404); - foreach ($values as $metatag => $value) { - $this->assertRaw($value, t('Updated metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag])); - } - - // Check that tokens are processed. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'title' => '[site:name] | Test title', - 'description' => '[site:name] | Test description', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - drupal_flush_all_caches(); - $this->drupalGet('hit-a-404'); - $this->assertResponse(404); - foreach ($values as $metatag => $value) { - $processed_value = \Drupal::token()->replace($value); - $this->assertRaw($processed_value, t('Processed token for metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag])); - } - - // Test the Robots plugin. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $robots_values = ['index', 'follow', 'noydir']; - $values = []; - foreach ($robots_values as $value) { - $values['robots[' . $value . ']'] = TRUE; - } - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - drupal_flush_all_caches(); - - // Trigger a 404 request. - $this->drupalGet('hit-a-404'); - $this->assertResponse(404); - $robots_value = implode(', ', $robots_values); - $this->assertRaw($robots_value, t('Robots metatag has the expected values.')); - - // Test reverting global configuration to its defaults. - $this->drupalGet('admin/config/search/metatag/global/revert'); - $this->assertResponse(200); - $this->drupalPostForm(NULL, [], 'Revert'); - $this->assertText('Reverted Global defaults.'); - $this->assertText($default_title, 'Global title was reverted to its default value.'); - - $this->drupalLogout(); - } - - /** - * Confirm the available entity types show on the add-default page. - */ - public function testAvailableConfigEntities() { - // Initiate session with a user who can manage metatags. - $permissions = [ - 'administer site configuration', - 'administer meta tags', - ]; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - - // Load the default-add page. - $this->drupalGet('admin/config/search/metatag/add'); - $this->assertResponse(200); - - // Confirm the 'type' field exists. - $this->assertFieldByName('id'); - - // Compile a list of entities from the list. - $xpath = $this->xpath("//select[@name='id']"); - $this->verbose('<pre>' . print_r($xpath, TRUE) . '</pre>'); - $types = []; - foreach ($xpath[0]->children() as $item) { - if (!empty($item->option)) { - $data = (array) $item->option; - $types[$data['@attributes']['value']] = $data[0]; - } - } - $this->verbose('<pre>' . print_r($types, TRUE) . '</pre>'); - - // Check through the values that are in the 'select' list, make sure that - // unwanted items are not present. - $this->assertFalse(isset($types['block_content']), 'Custom block entities are not supported.'); - $this->assertFalse(isset($types['comment']), 'Comment entities are not supported.'); - $this->assertFalse(isset($types['menu_link_content']), 'Menu link entities are not supported.'); - $this->assertFalse(isset($types['shortcut']), 'Shortcut entities are not supported.'); - $this->assertTrue(isset($types['node__page']), 'Nodes are supported.'); - $this->assertTrue(isset($types['user__user']), 'Users are supported.'); - $this->assertTrue(isset($types['entity_test']), 'Test entities are supported.'); - } - - /** - * Tests special pages. - */ - public function testSpecialPages() { - // Initiate session with a user who can manage metatags. - $permissions = ['administer site configuration', 'administer meta tags']; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - - // Adjust the front page and test it. - $this->drupalGet('admin/config/search/metatag/front'); - $this->assertResponse(200); - $values = [ - 'description' => 'Front page description', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Front page Metatag defaults.'); - $this->drupalGet('<front>'); - $this->assertResponse(200); - $this->assertRaw($values['description'], t('Front page defaults are used at the front page.')); - - // Adjust the 403 page and test it. - $this->drupalGet('admin/config/search/metatag/403'); - $this->assertResponse(200); - $values = [ - 'description' => '403 page description.', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the 403 access denied Metatag defaults.'); - $this->drupalLogout(); - $this->drupalGet('admin/config/search/metatag'); - $this->assertResponse(403); - $this->assertRaw($values['description'], t('403 page defaults are used at 403 pages.')); - - // Adjust the 404 page and test it. - $this->drupalLogin($account); - $this->drupalGet('admin/config/search/metatag/404'); - $this->assertResponse(200); - $values = [ - 'description' => '404 page description.', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the 404 page not found Metatag defaults.'); - $this->drupalGet('foo'); - $this->assertResponse(404); - $this->assertRaw($values['description'], t('404 page defaults are used at 404 pages.')); - $this->drupalLogout(); - } - - /** - * Tests entity and bundle overrides. - */ - public function testOverrides() { - // Initiate session with a user who can manage metatags. - $permissions = [ - 'administer site configuration', - 'administer meta tags', - 'access content', - 'create article content', - 'administer nodes', - 'create article content', - 'create page content', - ]; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - - // Update the Metatag Node defaults. - $this->drupalGet('admin/config/search/metatag/node'); - $this->assertResponse(200); - $values = [ - 'title' => 'Test title for a node.', - 'description' => 'Test description for a node.', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Content Metatag defaults.'); - - // Create a test node. - $node = $this->drupalCreateNode([ - 'title' => t('Hello, world!'), - 'type' => 'article', - ]); - - // Check that the new values are found in the response. - $this->drupalGet('node/' . $node->id()); - $this->assertResponse(200); - foreach ($values as $metatag => $value) { - $this->assertRaw($value, t('Node metatag @tag overrides Global defaults.', ['@tag' => $metatag])); - } - - // Check that when the node defaults don't define a metatag, the Global one - // is used. - // First unset node defaults. - $this->drupalGet('admin/config/search/metatag/node'); - $this->assertResponse(200); - $values = [ - 'title' => '', - 'description' => '', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Content Metatag defaults.'); - - // Then, set global ones. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'title' => 'Global title', - 'description' => 'Global description', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - - // Next, test that global defaults are rendered since node ones are empty. - // We are creating a new node as doing a get on the previous one would - // return cached results. - // @todo BookTest.php resets the cache of a single node, which is way more - // performant than creating a node for every set of assertions. - // @see BookTest::testDelete() - $node = $this->drupalCreateNode([ - 'title' => t('Hello, world!'), - 'type' => 'article', - ]); - $this->drupalGet('node/' . $node->id()); - $this->assertResponse(200); - foreach ($values as $metatag => $value) { - $this->assertRaw($value, t('Found global @tag tag as Node does not set it.', ['@tag' => $metatag])); - } - - // Now create article overrides and then test them. - $this->drupalGet('admin/config/search/metatag/add'); - $this->assertResponse(200); - $values = [ - 'id' => 'node__article', - 'title' => 'Article title override', - 'description' => 'Article description override', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText(strip_tags(t('Created the %label Metatag defaults.', ['%label' => 'Content: Article']))); - - // Confirm the fields load properly on the node/add/article page. - $node = $this->drupalCreateNode([ - 'title' => t('Hello, world!'), - 'type' => 'article', - ]); - $this->drupalGet('node/' . $node->id()); - $this->assertResponse(200); - unset($values['id']); - foreach ($values as $metatag => $value) { - $this->assertRaw($value, t('Found bundle override for tag @tag.', ['@tag' => $metatag])); - } - - // Test deleting the article defaults. - $this->drupalGet('admin/config/search/metatag/node__article/delete'); - $this->assertResponse(200); - $this->drupalPostForm(NULL, [], 'Delete'); - $this->assertText(t('Deleted @label defaults.', ['@label' => 'Content: Article'])); - } - - /** - * Test that the entity default values load on the entity form. - * - * And that they can then be overridden correctly. - */ - public function testEntityDefaultInheritence() { - // Initiate session with a user who can manage meta tags and content type - // fields. - $permissions = [ - 'administer site configuration', - 'administer meta tags', - 'access content', - 'administer node fields', - 'create article content', - 'administer nodes', - 'create article content', - 'create page content', - ]; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - - // Add a Metatag field to the Article content type. - $this->drupalGet('admin/structure/types/manage/article/fields/add-field'); - $this->assertResponse(200); - $edit = [ - 'new_storage_type' => 'metatag', - 'label' => 'Meta tags', - 'field_name' => 'meta_tags', - ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - $this->assertText(strip_tags(t('Updated field %label field settings.', ['%label' => 'Meta tags']))); - $this->drupalPostForm(NULL, [], t('Save settings')); - $this->assertText(strip_tags(t('Saved %label configuration.', ['%label' => 'Meta tags']))); - - // Try creating an article, confirm the fields are present. This should be - // the node default values that are shown. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]'); - $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]'); - - // Customize the Article content type defaults. - $this->drupalGet('admin/config/search/metatag/add'); - $this->assertResponse(200); - $values = [ - 'id' => 'node__article', - 'title' => 'Article title override', - 'description' => 'Article description override', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText(strip_tags(t('Created the %label Metatag defaults.', ['%label' => 'Content: Article']))); - - // Try creating an article, this time with the overridden defaults. - $this->drupalGet('node/add/article'); - $this->assertResponse(200); - $this->assertFieldByName('field_meta_tags[0][basic][title]', 'Article title override'); - $this->assertFieldByName('field_meta_tags[0][basic][description]', 'Article description override'); - } - - /** - * Test that protected Metatag defaults cannot be deleted. - */ - public function testDefaultProtected() { - // Initiate session with a user who can manage metatags. - $permissions = ['administer site configuration', 'administer meta tags']; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - - // Add default metatag for Articles. - $edit = [ - 'id' => 'node__article', - ]; - $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save'); - - // Check that protected defaults contains "Revert" link instead of "Delete". - foreach (MetatagManager::protectedDefaults() as $protected) { - $this->assertLinkByHref('/admin/config/search/metatag/' . $protected); - $this->assertLinkByHref('/admin/config/search/metatag/' . $protected . '/revert'); - $this->assertNoLinkByHref('/admin/config/search/metatag/' . $protected . '/delete'); - } - - // Confirm that non protected defaults can be deleted. - $this->assertLinkByHref('/admin/config/search/metatag/node__article'); - $this->assertNoLinkByHref('/admin/config/search/metatag/node__article/revert'); - $this->assertLinkByHref('/admin/config/search/metatag/node__article/delete'); - - // Visit each protected default page to confirm "Delete" button is hidden. - foreach (MetatagManager::protectedDefaults() as $protected) { - $this->drupalGet('/admin/config/search/metatag/' . $protected); - $this->assertNoLink('Delete'); - } - - // Confirm that non protected defaults can be deleted. - $this->drupalGet('/admin/config/search/metatag/node__article'); - $this->assertLink('Delete'); - } - - /** - * Test that metatag list page pager works as expected. - */ - public function testListPager() { - $this->loginUser1(); - - $this->drupalGet('admin/config/search/metatag'); - $this->assertLinkByHref('/admin/config/search/metatag/global'); - $this->assertLinkByHref('/admin/config/search/metatag/front'); - $this->assertLinkByHref('/admin/config/search/metatag/403'); - $this->assertLinkByHref('/admin/config/search/metatag/404'); - $this->assertLinkByHref('/admin/config/search/metatag/node'); - $this->assertLinkByHref('/admin/config/search/metatag/taxonomy_term'); - $this->assertLinkByHref('/admin/config/search/metatag/user'); - - // Create 50 vocabularies and generate metatag defaults for all of them. - for ($i = 0; $i < 50; $i++) { - $vocabulary = $this->createVocabulary(); - MetatagDefaults::create([ - 'id' => 'taxonomy_term__' . $vocabulary->id(), - 'label' => 'Taxonomy term: ' . $vocabulary->label(), - ])->save(); - } - - // Reload the page. - $this->drupalGet('admin/config/search/metatag'); - $this->assertLinkByHref('/admin/config/search/metatag/global'); - $this->assertLinkByHref('/admin/config/search/metatag/front'); - $this->assertLinkByHref('/admin/config/search/metatag/403'); - $this->assertLinkByHref('/admin/config/search/metatag/404'); - $this->assertLinkByHref('/admin/config/search/metatag/node'); - $this->assertLinkByHref('/admin/config/search/metatag/taxonomy_term'); - // User entity not visible because it has been pushed to the next page. - $this->assertNoLinkByHref('/admin/config/search/metatag/user'); - $this->clickLinkPartialName('Next'); - - // Go to next page and confirm that parents are loaded and user us present. - $this->assertLinkByHref('/admin/config/search/metatag/global'); - $this->assertLinkByHref('/admin/config/search/metatag/taxonomy_term'); - // Main links not visible in the 2nd page. - $this->assertNoLinkByHref('/admin/config/search/metatag/front'); - $this->assertNoLinkByHref('/admin/config/search/metatag/403'); - $this->assertNoLinkByHref('/admin/config/search/metatag/404'); - $this->assertNoLinkByHref('/admin/config/search/metatag/node'); - // User is present because was pushed to page 2. - $this->assertLinkByHref('/admin/config/search/metatag/user'); - - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php deleted file mode 100644 index f5c45180b..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\simpletest\WebTestBase; - -/** - * Ensures that the Metatag config translations work correctly. - * - * @group metatag - */ -class MetatagConfigTranslationTest extends WebTestBase { - - /** - * Profile to use. - * - * @var string - */ - protected $profile = 'testing'; - - /** - * Admin user. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected $adminUser; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = [ - 'metatag', - 'language', - 'config_translation', - ]; - - /** - * Permissions to grant admin user. - * - * @var array - */ - protected $permissions = [ - // From Metatag. - 'administer meta tags', - - // From system module, in order to access the /admin pages. - 'access administration pages', - - // From language module. - 'administer languages', - - // From config_translations module. - 'translate configuration', - ]; - - /** - * Sets the test up. - */ - protected function setUp() { - parent::setUp(); - $this->adminUser = $this->drupalCreateUser($this->permissions); - $this->drupalLogin($this->adminUser); - - // Enable the French language. - $this->drupalGet('admin/config/regional/language/add'); - $this->assertResponse(200); - $edit = [ - 'predefined_langcode' => 'fr', - ]; - $this->drupalPostForm(NULL, $edit, t('Add language')); - $this->assertRaw(t( - 'The language %language has been created and can now be used.', - ['%language' => t('French')] - )); - } - - /** - * Confirm the config defaults show on the translations page. - */ - public function testConfigTranslationsExist() { - // Ensure the config shows on the admin form. - $this->drupalGet('admin/config/regional/config-translation'); - $this->assertResponse(200); - $this->assertText(t('Metatag defaults')); - - // Load the main metatag_defaults config translation page. - $this->drupalGet('admin/config/regional/config-translation/metatag_defaults'); - $this->assertResponse(200); - // @todo Update this to confirm the H1 is loaded. - $this->assertRaw(t('Metatag defaults')); - - // Load all of the Metatag defaults. - $defaults = \Drupal::configFactory()->listAll('metatag.metatag_defaults'); - - /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */ - $config_manager = \Drupal::service('config.manager'); - - // Confirm each of the configs is available on the translation form. - foreach ($defaults as $config_name) { - if ($config_entity = $config_manager->loadConfigEntityByName($config_name)) { - $this->assertText($config_entity->label()); - } - } - - // Confirm that each config translation page can be loaded. - foreach ($defaults as $config_name) { - if ($config_entity = $config_manager->loadConfigEntityByName($config_name)) { - $this->drupalGet('admin/config/search/metatag/' . $config_entity->id() . '/translate'); - $this->assertResponse(200); - } - else { - $this->error('Unable to load a Metatag default config: ' . $config_name); - } - } - } - - /** - * Confirm the global configs are translatable page. - */ - public function testConfigTranslations() { - // Add something to the Global config. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $edit = [ - 'title' => 'Test title', - 'description' => 'Test description', - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertResponse(200); - $this->assertText(t('Saved the Global Metatag defaults.')); - - // Confirm the config has languages available to translate into. - $this->drupalGet('admin/config/search/metatag/global/translate'); - $this->assertResponse(200); - - // Load the translation form. - $this->drupalGet('admin/config/search/metatag/global/translate/fr/add'); - $this->assertResponse(200); - - // Confirm the meta tag fields are shown on the form. Confirm the fields and - // values separately to make it easier to pinpoint where the problem is if - // one should fail. - $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][title]'); - $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][title]', $edit['title']); - $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][description]'); - $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][description]', $edit['description']); - - // Confirm the form can be saved correctly. - $edit = [ - 'translation[config_names][metatag.metatag_defaults.global][tags][title]' => 'Le title', - 'translation[config_names][metatag.metatag_defaults.global][tags][description]' => 'Le description', - ]; - $this->drupalPostForm(NULL, $edit, t('Save translation')); - $this->assertResponse(200); - $this->assertText(t('Successfully saved French translation')); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php deleted file mode 100644 index b22350c8e..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\entity_test\Entity\EntityTest; -use Drupal\metatag\Entity\MetatagDefaults; -use Drupal\simpletest\WebTestBase; - -/** - * Tests custom route integration. - * - * @group metatag - * - * @see hook_metatag_route_entity() - */ -class MetatagCustomRouteTest extends WebTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - 'node', - // Dependencies. - 'token', - // Metatag itself. - 'metatag', - // This module will be used to load a static page which will inherit the - // global defaults, without loading values from other configs. - 'metatag_test_custom_route', - 'entity_test', - ]; - - /** - * Run tests on the custom route. - */ - public function testCustomRoute() { - $entity_test = EntityTest::create([ - 'name' => 'test name', - 'type' => 'entity_test', - ]); - $entity_test->save(); - - MetatagDefaults::create([ - 'id' => 'entity_test__entity_test', - 'tags' => [ - 'keywords' => 'test', - ], - ])->save(); - - $this->drupalGet('metatag_test_custom_route/' . $entity_test->id()); - $this->assertResponse(200); - $xpath = $this->xpath("//meta[@name='keywords']"); - $this->assertEqual(count($xpath), 1); - $this->assertEqual((string) $xpath[0]->attributes()['content'], 'test'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php deleted file mode 100644 index e56c7f0bb..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -/** - * Ensures that the Metatag field works correctly on nodes. - * - * @group metatag - */ -class MetatagFieldNodeTest extends MetatagFieldTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - // Needed for token handling. - 'token', - - // Needed for the field UI testing. - 'field_ui', - - // Needed to verify that nothing is broken for unsupported entities. - 'contact', - - // The base module. - 'metatag', - - // Some extra custom logic for testing Metatag. - 'metatag_test_tag', - - // Manages the entity type that is being tested. - 'node', - ]; - - /** - * {@inheritdoc} - */ - protected $entityPerms = [ - // From Field UI. - 'administer node fields', - - // From Node. - 'access content', - 'administer content types', - 'administer nodes', - 'bypass node access', - 'create page content', - 'edit any page content', - 'edit own page content', - ]; - - /** - * {@inheritdoc} - */ - protected $entityType = 'node'; - - /** - * {@inheritdoc} - */ - protected $entityLabel = 'Content'; - - /** - * {@inheritdoc} - */ - protected $entityBundle = 'page'; - - /** - * {@inheritdoc} - */ - protected $entityAddPath = 'node/add'; - - /** - * {@inheritdoc} - */ - protected $entityFieldAdminPath = 'admin/structure/types/manage/page/fields'; - - /** - * {@inheritdoc} - */ - protected function setUpEntityType() { - $this->createContentType(['type' => 'page']); - - // 8.3 has the label 'Save and publish'. - if ((floatval(\Drupal::VERSION) <= 8.3)) { - $this->entitySaveButtonLabel = 'Save and publish'; - } - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php deleted file mode 100644 index 36bcbde64..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -/** - * Ensures that the Metatag field works correctly on taxonomy terms. - * - * @group metatag - */ -class MetatagFieldTermTest extends MetatagFieldTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - // Needed for token handling. - 'token', - - // Needed for the field UI testing. - 'field_ui', - - // Needed to verify that nothing is broken for unsupported entities. - 'contact', - - // The base module. - 'metatag', - - // Some extra custom logic for testing Metatag. - 'metatag_test_tag', - - // Manages the entity type that is being tested. - 'taxonomy', - ]; - - /** - * {@inheritdoc} - */ - protected $entityPerms = [ - // From Field UI. - 'administer taxonomy_term fields', - - // From Taxonomy. - 'administer taxonomy', - 'edit terms in tags', - 'delete terms in tags', - ]; - - /** - * {@inheritdoc} - */ - protected $entityType = 'taxonomy_term'; - - /** - * {@inheritdoc} - */ - protected $entityLabel = 'Taxonomy term'; - - /** - * {@inheritdoc} - */ - protected $entityBundle = 'entity_test'; - - /** - * {@inheritdoc} - */ - protected $entityAddPath = 'admin/structure/taxonomy/manage/tags/add'; - - /** - * {@inheritdoc} - */ - protected $entityFieldAdminPath = 'admin/structure/taxonomy/manage/tags/overview/fields'; - - /** - * {@inheritdoc} - */ - protected $entityTitleField = 'name'; - - /** - * {@inheritdoc} - */ - protected function setUpEntityType() { - $new_perms = [ - // From Taxonomy. - 'administer taxonomy', - ]; - $all_perms = array_merge($this->basePerms, $new_perms); - $this->adminUser = $this->drupalCreateUser($all_perms); - $this->drupalLogin($this->adminUser); - $this->drupalGet('admin/structure/taxonomy/add'); - $this->assertResponse(200); - $edit = [ - 'name' => 'Tags', - 'vid' => 'tags', - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->drupalLogout(); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php deleted file mode 100644 index 47d1de01d..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php +++ /dev/null @@ -1,503 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\Core\Cache\Cache; -use Drupal\simpletest\WebTestBase; - -/** - * Base class for ensuring that the Metatag field works correctly. - */ -abstract class MetatagFieldTestBase extends WebTestBase { - - /** - * Profile to use. - * - * @var string - */ - protected $profile = 'testing'; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = [ - // Needed for token handling. - 'token', - - // Needed for the field UI testing. - 'field_ui', - - // Needed to verify that nothing is broken for unsupported entities. - 'contact', - - // The base module. - 'metatag', - - // Some extra custom logic for testing Metatag. - 'metatag_test_tag', - - // Manages the entity type that is being tested. - 'entity_test', - ]; - - /** - * Admin user. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected $adminUser; - - /** - * Basic permissions that all of the entity tests will need. - * - * @var array - */ - protected $basePerms = [ - 'access administration pages', - 'administer meta tags', - ]; - - /** - * Additional permissions needed for this entity type. - * - * @var array - */ - protected $entityPerms = []; - - /** - * The entity type that is being tested. - * - * @var string - */ - protected $entityType = ''; - - /** - * The formal name for this entity type. - * - * @var string - */ - protected $entityLabel = ''; - - /** - * The entity bundle that is being tested. - * - * @var string - */ - protected $entityBundle = ''; - - /** - * The path to add an object for this entity type. - * - * @var string - */ - protected $entityAddPath = ''; - - /** - * The path to access the field admin for this entity bundle. - * - * @var string - */ - protected $entityFieldAdminPath = ''; - - /** - * Whether or not this entity type supports default meta tag values. - * - * @var bool - */ - protected $entitySupportsDefaults = TRUE; - - /** - * The label used on the entity form for the 'save' action. - * - * @var string - */ - protected $entitySaveButtonLabel = 'Save'; - - /** - * The name of the primary title or name field for this entity. - * - * @var string - */ - protected $entityTitleField = 'title'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Any additional configuration that's neede for this entity type. - $this->setUpEntityType(); - - // Merge the base permissions with the custom ones for the entity type and - // create a user with these permissions. - $all_perms = array_merge($this->basePerms, $this->entityPerms); - $this->adminUser = $this->drupalCreateUser($all_perms); - $this->drupalGet('/user/login'); - $this->assertResponse(200); - $this->drupalLogin($this->adminUser); - } - - /** - * {@inheritdoc} - */ - protected function verbose($message, $title = NULL) { - // Handle arrays, objects, etc. - if (!is_string($message)) { - $message = "<pre>\n" . print_r($message, TRUE) . "\n</pre>\n"; - } - - // Optional title to go before the output. - if (!empty($title)) { - $title = '<h2>' . Html::escape($title) . "</h2>\n"; - } - - parent::verbose($title . $message); - } - - /** - * Any additional configuration that's needed for this entity type. - */ - protected function setUpEntityType() {} - - /** - * A list of default values to add to the entity being created. - * - * Defaults to "{$entityTitleField}[0][value]" => $title. - * - * @return array - * Default values. - */ - protected function entityDefaultValues() { - return []; - } - - /** - * Add a Metatag field to this entity type. - */ - protected function addField() { - // Add a metatag field to the entity type test_entity. - $this->drupalGet($this->entityFieldAdminPath . '/add-field'); - $this->assertResponse(200); - $edit = [ - 'label' => 'Metatag', - 'field_name' => 'metatag', - 'new_storage_type' => 'metatag', - ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - - // Clear all settings. - $this->container->get('entity.manager')->clearCachedFieldDefinitions(); - } - - /** - * Confirm that the global default values work correctly. - * - * Specifically when there are no entity or bundle defaults available. - */ - public function testGlobalDefaultsInheritance() { - // First we set global defaults. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $global_values = [ - 'metatag_test_tag' => 'Global description', - ]; - $this->drupalPostForm(NULL, $global_values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - - // Add the field to this entity type. - $this->addField(); - - // Now when we create an entity, global defaults are used to fill the form - // fields. - $this->drupalGet($this->entityAddPath); - $this->assertResponse(200); - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag'], t('The metatag_test_tag field has the global default as the field default does not define it.')); - } - - /** - * Confirm that the entity default values work correctly. - */ - public function testEntityDefaultsInheritance() { - // This test doesn't make sense if the entity doesn't support defaults. - if (!$this->entitySupportsDefaults) { - return; - } - - // Set a global default. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $global_values = [ - 'metatag_test_tag' => 'Global description', - ]; - $this->drupalPostForm(NULL, $global_values, 'Save'); - $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t('Global')]))); - - // Set an entity default. - $this->drupalGet('admin/config/search/metatag/' . $this->entityType); - $this->assertResponse(200); - $entity_values = [ - 'metatag_test_tag' => 'Entity description', - ]; - $this->drupalPostForm(NULL, $entity_values, 'Save'); - $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t($this->entityLabel)]))); - - // Add the field to this entity type. - $this->addField(); - - // Load the entity form for this entity type. - $this->drupalGet($this->entityAddPath); - $this->assertResponse(200); - $this->assertNoText('Fatal error'); - - // Allow the fields to be customized if needed. - $title = 'Barfoo'; - $edit = $this->entityDefaultValues(); - if (empty($edit)) { - $edit = [ - $this->entityTitleField . '[0][value]' => $title, - ]; - } - - // If this entity type supports defaults then verify the global default is - // not present but that the entity default *is* present. - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']); - $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - } - - /** - * Confirm that the default values for an entity bundle work. - * - * When there is no field for overriding the defaults. - * - * @todo - */ - public function testBundleDefaultsInheritance() { - } - - /** - * Confirm a field can be added to the entity bundle. - */ - public function testFieldCanBeAdded() { - $this->drupalGet($this->entityFieldAdminPath . '/add-field'); - $this->assertResponse(200); - $this->assertRaw('<option value="metatag">' . t('Meta tags') . '</option>'); - } - - /** - * Confirm a field can be added to the entity bundle. - */ - public function testEntityFieldsAvailable() { - // Add a field to the entity type. - $this->addField(); - - // Load the entity's form. - $this->drupalGet($this->entityAddPath); - $this->assertResponse(200); - $this->assertNoText('Fatal error'); - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]'); - } - - /** - * Confirm that the default values load correctly for an entity created. - * - * Before the custom field is added. - */ - public function testEntityFieldValuesOldEntity() { - // Set a global default. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $global_values = [ - 'metatag_test_tag' => 'Global description', - ]; - $this->drupalPostForm(NULL, $global_values, 'Save'); - $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t('Global')]))); - - // Set an entity default if it's supported by the entity type. - if ($this->entitySupportsDefaults) { - $this->drupalGet('admin/config/search/metatag/' . $this->entityType); - $this->assertResponse(200); - $entity_values = [ - 'metatag_test_tag' => 'Entity description', - ]; - $this->drupalPostForm(NULL, $entity_values, 'Save'); - $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t($this->entityLabel)]))); - } - - // Load the entity form for this entity type. - $title = 'Barfoo'; - $this->drupalGet($this->entityAddPath); - $this->assertResponse(200); - $this->assertNoText('Fatal error'); - - // Allow the fields to be customized if needed. - $edit = $this->entityDefaultValues(); - if (empty($edit)) { - $edit = [ - $this->entityTitleField . '[0][value]' => $title, - ]; - } - - // Create a new entity object. - $this->drupalPostForm(NULL, $edit, t($this->entitySaveButtonLabel)); - $entities = \Drupal::entityTypeManager() - ->getStorage($this->entityType) - ->loadByProperties([$this->entityTitleField => $title]); - $this->assertEqual(1, count($entities), 'Entity was saved'); - $entity = reset($entities); - - // @todo Confirm the values output correctly. - // Add a field to the entity type. - $this->addField(); - - // Open the 'edit' form for the entity. - $this->drupalGet($entity->toUrl('edit-form')); - $this->assertResponse(200); - - // If this entity type supports defaults then verify the global default is - // not present but that the entity default *is* present. - if ($this->entitySupportsDefaults) { - $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']); - } - else { - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - } - - // @todo Confirm the values output correctly. - } - - /** - * Confirm that the default values load correctly. - * - * For an entity created after the custom field is added. - */ - public function testEntityFieldValuesNewEntity() { - // Set a global default. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $global_values = [ - 'metatag_test_tag' => 'Global description', - ]; - $this->drupalPostForm(NULL, $global_values, 'Save'); - $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t('Global')]))); - - // Set an entity default if it's supported by the entity type. - if ($this->entitySupportsDefaults) { - $this->drupalGet('admin/config/search/metatag/' . $this->entityType); - $this->assertResponse(200); - $entity_values = [ - 'metatag_test_tag' => 'Entity description', - ]; - $this->drupalPostForm(NULL, $entity_values, 'Save'); - $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t($this->entityLabel)]))); - } - - // Add a field to the entity type. - $this->addField(); - - // Load the entity form for this entity type. - $title = 'Barfoo'; - $this->drupalGet($this->entityAddPath); - $this->assertResponse(200); - $this->assertNoText('Fatal error'); - - // If this entity type supports defaults then verify the global default is - // not present but that the entity default *is* present. - if ($this->entitySupportsDefaults) { - $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']); - } - else { - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - } - - // Allow the fields to be customized if needed. - $edit = $this->entityDefaultValues(); - if (empty($edit)) { - $edit = [ - $this->entityTitleField . '[0][value]' => $title, - ]; - } - - // Create a new entity object. - $this->drupalPostForm(NULL, $edit, t($this->entitySaveButtonLabel)); - $entities = \Drupal::entityTypeManager() - ->getStorage($this->entityType) - ->loadByProperties([$this->entityTitleField => $title]); - $this->assertEqual(1, count($entities), 'Entity was saved'); - $entity = reset($entities); - - // @todo Confirm the values output correctly. - // Open the 'edit' form for the entity. - $this->drupalGet($entity->toUrl('edit-form')); - $this->assertResponse(200); - - // If this entity type supports defaults then verify the global default is - // not present but that the entity default *is* present. - if ($this->entitySupportsDefaults) { - $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']); - } - else { - $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']); - } - - // @todo Confirm the values output correctly. - } - - /** - * Tests adding and editing values on a given entity type. - * - * @todo Finish this. - */ - public function tofixTestEntityField() { - // Add a field to the entity type. - $this->addField(); - - // Create a test entity. - $this->drupalGet($this->entityAddPath); - $this->assertResponse(200); - $this->assertNoText('Fatal error'); - $edit = $this->entityDefaultValues($title) + [ - 'field_metatag[0][basic][metatag_test_tag]' => 'Kilimanjaro', - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $entities = \Drupal::entityTypeManager() - ->getStorage('entity_test') - ->loadByProperties([$this->entityTitleField => 'Barfoo']); - $this->assertEqual(1, count($entities), 'Entity was saved'); - $entity = reset($entities); - - // Make sure tags that have a field value but no default value still show - // up. - $this->drupalGet($entity->toUrl()); - $this->assertResponse(200); - $elements = $this->cssSelect('meta[name=metatag_test_tag]'); - $this->assertTrue(count($elements) === 1, 'Found keywords metatag_test_tag from defaults'); - $this->assertEqual((string) $elements[0]['content'], 'Kilimanjaro', 'Field value for metatag_test_tag found when no default set.'); - - // @todo This should not be required, but meta tags does not invalidate - // cache upon setting globals. - Cache::invalidateTags(['entity_test:' . $entity->id()]); - - // Update the Global defaults and test them. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'metatag_test_tag' => 'Purple monkey dishwasher', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - $this->drupalGet($entity->toUrl()); - $this->assertResponse(200); - $elements = $this->cssSelect('meta[name=metatag_test_tag]'); - $this->assertTrue(count($elements) === 1, 'Found test metatag from defaults'); - $this->verbose('<pre>' . print_r($elements, TRUE) . '</pre>'); - $this->assertEqual((string) $elements[0]['content'], $values['metatag_test_tag']); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php deleted file mode 100644 index 95f7da176..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -/** - * Ensure that the Metatag field works correctly for the test entity. - * - * @group metatag - */ -class MetatagFieldTestTest extends MetatagFieldTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - // Needed for token handling. - 'token', - - // Needed for the field UI testing. - 'field_ui', - - // Needed to verify that nothing is broken for unsupported entities. - 'contact', - - // The base module. - 'metatag', - - // Some extra custom logic for testing Metatag. - 'metatag_test_tag', - - // Manages the entity type that is being tested. - 'entity_test', - ]; - - /** - * {@inheritdoc} - */ - protected $entityPerms = [ - 'view test entity', - 'administer entity_test fields', - 'administer entity_test content', - ]; - - /** - * {@inheritdoc} - */ - protected $entityType = 'entity_test'; - - /** - * {@inheritdoc} - */ - protected $entityLabel = 'Test entity'; - - /** - * {@inheritdoc} - */ - protected $entityBundle = 'entity_test'; - - /** - * {@inheritdoc} - */ - protected $entityAddPath = 'entity_test/add'; - - /** - * {@inheritdoc} - */ - protected $entityFieldAdminPath = 'entity_test/structure/entity_test/fields'; - - /** - * Whether or not the entity type supports defaults. - * - * @var bool - * - * @todo Fix this. - */ - protected $entitySupportsDefaults = FALSE; - - /** - * {@inheritdoc} - */ - protected $entityTitleField = 'name'; - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldUserTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldUserTest.php deleted file mode 100644 index 723401414..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldUserTest.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -/** - * Ensures that the Metatag field works correctly on users. - * - * @group metatag - */ -class MetatagFieldUserTest extends MetatagFieldTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - // Needed for token handling. - 'token', - - // Needed for the field UI testing. - 'field_ui', - - // Needed to verify that nothing is broken for unsupported entities. - 'contact', - - // The base module. - 'metatag', - - // Some extra custom logic for testing Metatag. - 'metatag_test_tag', - - // Manages the entity type that is being tested. - 'user', - ]; - - /** - * {@inheritdoc} - */ - protected $entityPerms = [ - // From Field UI. - 'administer user fields', - - // From User. - 'administer account settings', - 'administer users', - ]; - - /** - * {@inheritdoc} - */ - protected $entityType = 'user'; - - /** - * {@inheritdoc} - */ - protected $entityLabel = 'User'; - - /** - * {@inheritdoc} - */ - protected $entityBundle = 'user'; - - /** - * {@inheritdoc} - */ - protected $entityAddPath = 'admin/people/create'; - - /** - * {@inheritdoc} - */ - protected $entityFieldAdminPath = 'admin/config/people/accounts/fields'; - - /** - * {@inheritdoc} - */ - protected $entityTitleField = 'name'; - - /** - * {@inheritdoc} - */ - protected $entitySaveButtonLabel = 'Create new account'; - - /** - * {@inheritdoc} - */ - protected function entityDefaultValues($title = 'Barfoo') { - $password = $this->randomString(16); - return [ - 'mail' => 'test' . $this->adminUser->getEmail(), - 'name' => $title, - 'pass[pass1]' => $password, - 'pass[pass2]' => $password, - ]; - } - - /** - * Confirm the metatag field can be shown on a user registration page. - * - * @todo - */ - public function testFieldsOnUserRegistrationForm() {} - - /** - * Confirm the metatag field can be shown on a normal user's own edit form. - * - * @todo - */ - public function testFieldsOnUserEditForm() {} - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php deleted file mode 100644 index 662cfc942..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\simpletest\WebTestBase; - -/** - * Ensures that meta tags are rendering correctly on forum pages. - * - * @group metatag - */ -class MetatagForumTest extends WebTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = [ - 'token', - 'metatag', - 'node', - 'system', - 'forum', - ]; - - /** - * Administrator user for tests. - * - * @var \Drupal\user\UserInterface - */ - protected $adminUser; - - /** - * Setup basic environment. - */ - protected function setUp() { - parent::setUp(); - - $admin_permissions = [ - 'administer nodes', - 'bypass node access', - 'administer meta tags', - 'administer site configuration', - 'access content', - ]; - - // Create and login user. - $this->adminUser = $this->drupalCreateUser($admin_permissions); - $this->drupalLogin($this->adminUser); - - // Create content type. - $this->drupalCreateContentType(['type' => 'page', 'display_submitted' => FALSE]); - $this->nodeId = $this->drupalCreateNode( - [ - 'title' => $this->randomMachineName(8), - 'promote' => 1, - ])->id(); - - $this->config('system.site')->set('page.front', '/node/' . $this->nodeId)->save(); - } - - /** - * Verify that a forum post can be loaded when Metatag is enabled. - */ - public function testForumPost() { - $this->drupalGet('node/add/forum'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => 'Testing forums', - 'taxonomy_forums' => 1, - 'body[0][value]' => 'Just testing.', - ]; - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - $this->drupalPostForm(NULL, $edit, $save_label); - $this->assertResponse(200); - $this->assertText(t('@type @title has been created.', ['@type' => t('Forum topic'), '@title' => 'Testing forums'])); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php deleted file mode 100644 index a360432c9..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php +++ /dev/null @@ -1,172 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\simpletest\WebTestBase; - -/** - * Ensures that meta tags are rendering correctly on home page. - * - * @group metatag - */ -class MetatagFrontpageTest extends WebTestBase { - - // Use the helper functions from the Functional trait. This is pretty safe but - // remember to rewrite all of these WebTestBase tests using BrowserTestBase - // before the next millenium. - use MetatagHelperTrait; - - /** - * {@inheritdoc} - */ - public static $modules = [ - 'token', - 'metatag', - 'node', - 'system', - 'test_page_test', - ]; - - /** - * The path to a node that is created for testing. - * - * @var string - */ - protected $nodeId; - - /** - * Setup basic environment. - */ - protected function setUp() { - parent::setUp(); - - // Login user 1. - $this->loginUser1(); - - // Create content type. - $this->drupalCreateContentType(['type' => 'page', 'display_submitted' => FALSE]); - $this->nodeId = $this->drupalCreateNode( - [ - 'title' => $this->randomMachineName(8), - 'promote' => 1, - ])->id(); - - $this->config('system.site')->set('page.front', '/node/' . $this->nodeId)->save(); - } - - /** - * The front page config is enabled, its meta tags should be used. - */ - public function testFrontPageMetatagsEnabledConfig() { - // Add something to the front page config. - $this->drupalGet('admin/config/search/metatag/front'); - $this->assertResponse(200); - $edit = [ - 'title' => 'Test title', - 'description' => 'Test description', - 'keywords' => 'testing,keywords', - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertResponse(200); - $this->assertText(t('Saved the Front page Metatag defaults.')); - - // Testing front page metatags. - $this->drupalGet('<front>'); - foreach ($edit as $metatag => $metatag_value) { - $xpath = $this->xpath("//meta[@name='" . $metatag . "']"); - $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $metatag_value); - } - - $node_path = '/node/' . $this->nodeId; - // Testing front page metatags. - $this->drupalGet($node_path); - foreach ($edit as $metatag => $metatag_value) { - $xpath = $this->xpath("//meta[@name='" . $metatag . "']"); - $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $metatag_value); - } - - // Change the front page to a valid custom route. - $site_edit = [ - 'site_frontpage' => '/test-page', - ]; - $this->drupalGet('admin/config/system/site-information'); - $this->assertResponse(200); - $this->drupalPostForm(NULL, $site_edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.'); - return; - - // @todo Finish this? - $this->drupalGet('test-page'); - $this->assertResponse(200); - foreach ($edit as $metatag => $metatag_value) { - $xpath = $this->xpath("//meta[@name='" . $metatag . "']"); - $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $metatag_value); - } - } - - /** - * Test front page meta tags when front page config is disabled. - */ - public function testFrontPageMetatagDisabledConfig() { - // Disable front page metatag, enable node metatag & check. - $this->drupalGet('admin/config/search/metatag/front/delete'); - $this->assertResponse(200); - $this->drupalPostForm(NULL, [], t('Delete')); - $this->assertResponse(200); - $this->assertText(t('Deleted Front page defaults.')); - - // Update the Metatag Node defaults. - $this->drupalGet('admin/config/search/metatag/node'); - $this->assertResponse(200); - $edit = [ - 'title' => 'Test title for a node.', - 'description' => 'Test description for a node.', - ]; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Saved the Content Metatag defaults.'); - $this->drupalGet('<front>'); - foreach ($edit as $metatag => $metatag_value) { - $xpath = $this->xpath("//meta[@name='" . $metatag . "']"); - $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $metatag_value); - } - - // Change the front page to a valid path. - $this->drupalGet('admin/config/system/site-information'); - $this->assertResponse(200); - $edit = [ - 'site_frontpage' => '/test-page', - ]; - $this->drupalPostForm(NULL, $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.'); - - // Front page is custom route. - // Update the Metatag Node global. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $edit = [ - 'title' => 'Test title.', - 'description' => 'Test description.', - ]; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - - // Test Metatags. - $this->drupalGet('test-page'); - $this->assertResponse(200); - foreach ($edit as $metatag => $metatag_value) { - $xpath = $this->xpath("//meta[@name='" . $metatag . "']"); - $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $metatag_value); - } - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php deleted file mode 100644 index fc9538abf..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php +++ /dev/null @@ -1,159 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\Component\Render\FormattableMarkup; -use Drupal\Component\Utility\Html; -use Drupal\taxonomy\Entity\Term; -use Drupal\taxonomy\Entity\Vocabulary; -use Drupal\user\Entity\User; - -/** - * A copy of Drupal\Tests\metatag\Functional\MetatagHelperTrait. - * - * @todo Remove once the other tests are converted over. - */ -trait MetatagHelperTrait { - - /** - * Log in as user 1. - */ - protected function loginUser1() { - // Load user 1. - /* @var \Drupal\user\Entity\User $account */ - $account = User::load(1); - - // Reset the password. - $password = 'foo'; - $account->setPassword($password)->save(); - - // Support old and new tests. - $account->passRaw = $password; - $account->pass_raw = $password; - - // Login. - $this->drupalLogin($account); - } - - /** - * {@inheritdoc} - */ - protected function verbose($message, $title = NULL) { - // Handle arrays, objects, etc. - if (!is_string($message)) { - $message = "<pre>\n" . print_r($message, TRUE) . "\n</pre>\n"; - } - - // Optional title to go before the output. - if (!empty($title)) { - $title = '<h2>' . Html::escape($title) . "</h2>\n"; - } - - parent::verbose($title . $message); - } - - /** - * Create a content type and a node. - * - * @param string $title - * A title for the node that will be returned. - * @param string $body - * The text to use as the body. - * - * @return \Drupal\node\NodeInterface - * A fully formatted node object. - */ - private function createContentTypeNode($title = 'Title test', $body = 'Body test') { - $content_type = 'metatag_test'; - $args = [ - 'type' => $content_type, - 'label' => 'Test content type', - ]; - $this->createContentType($args); - - $args = [ - 'body' => [ - [ - 'value' => $body, - 'format' => filter_default_format(), - ], - ], - 'title' => $title, - 'type' => $content_type, - ]; - - return $this->createNode($args); - } - - /** - * Create a vocabulary. - * - * @param array $values - * Items passed to the vocabulary. If the 'vid' item is not present it will - * be automatically generated. If the 'name' item is not present the 'vid' - * will be used. - * - * @return \Drupal\taxonomy\Entity\Vocabulary - * A fully formatted vocabulary object. - */ - private function createVocabulary(array $values = []) { - // Find a non-existent random type name. - if (!isset($values['vid'])) { - do { - $id = strtolower($this->randomMachineName(8)); - } while (Vocabulary::load($id)); - } - else { - $id = $values['vid']; - } - $values += [ - 'vid' => $id, - 'name' => $id, - ]; - $vocab = Vocabulary::create($values); - $status = $vocab->save(); - - if ($this instanceof \PHPUnit_Framework_TestCase) { - $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString()); - } - else { - $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString()); - } - - return $vocab; - } - - /** - * Create a taxonomy term. - * - * @param array $values - * Items passed to the term. Requires the 'vid' element. - * - * @return Drupal\taxonomy\Entity\Term - * A fully formatted term object. - */ - private function createTerm(array $values = []) { - // Populate defaults array. - $values += [ - 'description' => [ - [ - 'value' => $this->randomMachineName(32), - 'format' => filter_default_format(), - ], - ], - 'name' => $this->randomMachineName(8), - ]; - $term = Term::create($values); - $status = $term->save(); - - if ($this instanceof \PHPUnit_Framework_TestCase) { - $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString()); - } - else { - $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString()); - } - - return $term; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php deleted file mode 100644 index 669726a34..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php +++ /dev/null @@ -1,210 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\language\Entity\ConfigurableLanguage; -use Drupal\simpletest\WebTestBase; - -/** - * Ensures that meta tag values are translated correctly on nodes. - * - * @group metatag - */ -class MetatagNodeTranslationTest extends WebTestBase { - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = [ - 'content_translation', - 'field_ui', - 'metatag', - 'node', - ]; - - /** - * The default language code to use in this test. - * - * @var array - */ - protected $defaultLangcode = 'fr'; - - /** - * Languages to enable. - * - * @var array - */ - protected $additionalLangcodes = ['es']; - - /** - * Administrator user for tests. - * - * @var \Drupal\user\UserInterface - */ - protected $adminUser; - - /** - * Setup basic environment. - */ - protected function setUp() { - parent::setUp(); - - $admin_permissions = [ - 'administer content types', - 'administer content translation', - 'administer languages', - 'administer nodes', - 'administer node fields', - 'bypass node access', - 'create content translations', - 'delete content translations', - 'translate any entity', - 'update content translations', - ]; - - // Create and login user. - $this->adminUser = $this->drupalCreateUser($admin_permissions); - - // Add languages. - foreach ($this->additionalLangcodes as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode)->save(); - } - } - - /** - * Tests the metatag value translations. - */ - public function testMetatagValueTranslation() { - if (floatval(\Drupal::VERSION) <= 8.3) { - $save_label = t('Save and publish'); - $save_label_i18n = t('Save and keep published (this translation)'); - } - else { - $save_label = t('Save'); - $save_label_i18n = t('Save (this translation)'); - } - - // Set up a content type. - $name = $this->randomMachineName() . ' ' . $this->randomMachineName(); - $this->drupalLogin($this->adminUser); - $this->drupalCreateContentType(['type' => 'metatag_node', 'name' => $name]); - - // Add a metatag field to the content type. - $this->drupalGet('admin/structure/types'); - $this->assertResponse(200); - $this->drupalGet('admin/structure/types/manage/metatag_node'); - $this->assertResponse(200); - $edit = [ - 'language_configuration[language_alterable]' => TRUE, - 'language_configuration[content_translation]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, t('Save content type')); - $this->assertResponse(200); - - $this->drupalGet('admin/structure/types/manage/metatag_node/fields/add-field'); - $this->assertResponse(200); - $edit = [ - 'label' => 'Meta tags', - 'field_name' => 'meta_tags', - 'new_storage_type' => 'metatag', - ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->assertResponse(200); - $this->drupalPostForm(NULL, [], t('Save field settings')); - $this->assertResponse(200); - $edit = [ - 'translatable' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, t('Save settings')); - $this->assertResponse(200); - $this->drupalGet('admin/structure/types/manage/metatag_node/fields/node.metatag_node.field_meta_tags'); - $this->assertResponse(200); - - // Set up a node without explicit metatag description. This causes the - // global default to be used, which contains a token (node:summary). The - // token value should be correctly translated. - - // Load the node form. - $this->drupalGet('node/add/metatag_node'); - $this->assertResponse(200); - - // Check the default values are correct. - $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.'); - $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]', 'Default description token is present.'); - - // Create a node. - $edit = [ - 'title[0][value]' => 'Node Français', - 'body[0][value]' => 'French summary.', - ]; - $this->drupalPostForm(NULL, $edit, $save_label); - $this->assertResponse(200); - - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, 'French summary.'); - - $this->drupalGet('node/1/translations/add/en/es'); - $this->assertResponse(200); - // Check the default values are there. - $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.'); - $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]', 'Default description token is present.'); - - $edit = [ - 'title[0][value]' => 'Node Español', - 'body[0][value]' => 'Spanish summary.', - ]; - $this->drupalPostForm(NULL, $edit, $save_label_i18n); - $this->assertResponse(200); - - $this->drupalGet('es/node/1'); - $this->assertResponse(200); - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, 'Spanish summary.'); - $this->assertNotEqual($value, 'French summary.'); - - $this->drupalGet('node/1/edit'); - $this->assertResponse(200); - // Check the default values are there. - $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.'); - $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]', 'Default description token is present.'); - - // Set explicit values on the description metatag instead using the - // defaults. - $this->drupalGet('node/1/edit'); - $this->assertResponse(200); - $edit = [ - 'field_meta_tags[0][basic][description]' => 'Overridden French description.', - ]; - $this->drupalPostForm(NULL, $edit, $save_label_i18n); - $this->assertResponse(200); - - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, 'Overridden French description.'); - $this->assertNotEqual($value, 'Spanish summary.'); - $this->assertNotEqual($value, 'French summary.'); - - $this->drupalGet('es/node/1/edit'); - $this->assertResponse(200); - $edit = [ - 'field_meta_tags[0][basic][description]' => 'Overridden Spanish description.', - ]; - $this->drupalPostForm(NULL, $edit, $save_label_i18n); - $this->assertResponse(200); - - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.'); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, 'Overridden Spanish description.'); - $this->assertNotEqual($value, 'Spanish summary.'); - $this->assertNotEqual($value, 'French summary.'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php deleted file mode 100644 index ac5c7d578..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php +++ /dev/null @@ -1,319 +0,0 @@ -<?php - -namespace Drupal\metatag\Tests; - -use Drupal\simpletest\WebTestBase; - -/** - * Ensures that the Metatag field works correctly. - * - * @group metatag - */ -class MetatagStringTest extends WebTestBase { - - /** - * Admin user. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected $adminUser; - - /** - * Modules to enable. - * - * @var array - */ - public static $modules = [ - 'token', - 'node', - 'field_ui', - 'metatag', - ]; - - /** - * Permissions to grant admin user. - * - * @var array - */ - protected $permissions = [ - 'administer node fields', - 'administer content types', - 'access administration pages', - 'administer meta tags', - 'administer nodes', - 'bypass node access', - 'administer meta tags', - 'administer site configuration', - 'access content', - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->adminUser = $this->drupalCreateUser($this->permissions); - $this->drupalLogin($this->adminUser); - - $this->drupalCreateContentType(['type' => 'page', 'display_submitted' => FALSE]); - - // Add a Metatag field to the content type. - $this->drupalGet('admin/structure/types'); - $this->assertResponse(200); - $this->drupalGet('admin/structure/types/manage/page/fields/add-field'); - $this->assertResponse(200); - $edit = [ - 'label' => 'Metatag', - 'field_name' => 'metatag_field', - 'new_storage_type' => 'metatag', - ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - $this->container->get('entity.manager')->clearCachedFieldDefinitions(); - } - - /** - * Tests that a meta tag with single quote is not double escaped. - */ - public function testSingleQuote() { - $this->checkString("bla'bleblu"); - } - - /** - * Tests that a meta tag with a double quote is not double escaped. - */ - public function testDoubleQuote() { - $this->checkString('bla"bleblu'); - } - - /** - * Tests that a meta tag with an ampersand is not double escaped. - */ - public function testAmpersand() { - $this->checkString("blable&blu"); - } - - /** - * Tests that specific strings are not double escaped. - */ - public function checkString($string) { - $this->checkConfig($string); - $this->checkNode($string); - $this->checkEncodedField($string); - } - - /** - * Tests that a specific config string is not double encoded. - */ - public function checkConfig($string) { - // The original strings. - $title_original = 'Title: ' . $string; - $desc_original = 'Description: ' . $string; - - // The strings after they're encoded, but quotes will not be encoded. - $title_encoded = htmlentities($title_original, ENT_QUOTES); - $desc_encoded = htmlentities($desc_original, ENT_QUOTES); - - // The strings double-encoded, to make sure the tags aren't broken. - $title_encodeded = htmlentities($title_encoded, ENT_QUOTES); - $desc_encodeded = htmlentities($desc_encoded, ENT_QUOTES); - - // Update the Global defaults and test them. - $this->drupalGet('admin/config/search/metatag/front'); - $this->assertResponse(200); - $edit = [ - 'title' => $title_original, - 'description' => $desc_original, - ]; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertResponse(200); - - $metatag_defaults = \Drupal::config('metatag.metatag_defaults.front'); - $default_title = $metatag_defaults->get('tags')['title']; - $default_description = $metatag_defaults->get('tags')['description']; - - // Make sure the title tag is stored correctly. - $this->assertEqual($title_original, $default_title, 'The title tag was stored in its original format.'); - $this->assertNotEqual($title_encoded, $default_title, 'The title tag was not stored in an encoded format.'); - $this->assertNotEqual($title_encodeded, $default_title, 'The title tag was not stored in a double-encoded format.'); - - // Make sure the description tag is stored correctly. - $this->assertEqual($desc_original, $default_description, 'The description tag was stored in its original format.'); - $this->assertNotEqual($desc_encoded, $default_description, 'The description tag was not stored in an encoded format.'); - $this->assertNotEqual($desc_encodeded, $default_description, 'The description tag was not stored in a double-encoded format.'); - - // Set up a node without explicit metatag description. This causes the - // global default to be used, which contains a token (node:summary). The - // token value should be correctly translated. - - // Create a node. - $this->drupalGet('node/add/page'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => $title_original, - 'body[0][value]' => $desc_original, - ]; - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - $this->drupalPostForm(NULL, $edit, $save_label); - - $this->config('system.site')->set('page.front', '/node/1')->save(); - - // Load the front page. - $this->drupalGet('<front>'); - $this->assertResponse(200); - - // Again, with xpath the HTML entities will be parsed automagically. - $xpath_title = (string) current($this->xpath("//title")); - $this->assertEqual($xpath_title, $title_original); - $this->assertNotEqual($xpath_title, $title_encoded); - $this->assertNotEqual($xpath_title, $title_encodeded); - - // The page title should be HTML encoded; have to do this check manually - // because assertRaw() checks the raw HTML, not the parsed strings like - // xpath does. - $this->assertRaw('<title>' . $title_encoded . '', 'Confirmed the node title tag is available in its encoded format.'); - $this->assertNoRaw('' . $title_original . '', 'Confirmed the node title tag is not available in its original format.'); - $this->assertNoRaw('' . $title_encodeded . '', 'Confirmed the node title tag is not double-double-encoded?'); - - // Again, with xpath the HTML entities will be parsed automagically. - $xpath = $this->xpath("//meta[@name='description']"); - $this->assertEqual($xpath[0]['content'], $desc_original); - $this->assertNotEqual($xpath[0]['content'], $desc_encoded); - $this->assertNotEqual($xpath[0]['content'], $desc_encodeded); - } - - /** - * Tests that a specific node string is not double escaped. - */ - public function checkNode($string) { - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - - // The original strings. - $title_original = 'Title: ' . $string; - $desc_original = 'Description: ' . $string; - - // The strings after they're encoded, but quotes will not be encoded. - $title_encoded = htmlentities($title_original, ENT_QUOTES); - $desc_encoded = htmlentities($desc_original, ENT_QUOTES); - - // The strings double-encoded, to make sure the tags aren't broken. - $title_encodeded = htmlentities($title_encoded, ENT_QUOTES); - $desc_encodeded = htmlentities($desc_encoded, ENT_QUOTES); - - // Update the Global defaults and test them. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $edit = [ - 'title' => $title_original, - 'description' => $desc_original, - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertResponse(200); - - // Set up a node without explicit metatag description. This causes the - // global default to be used, which contains a token (node:summary). The - // token value should be correctly translated. - - // Create a node. - $this->drupalGet('node/add/page'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => $title_original, - 'body[0][value]' => $desc_original, - ]; - $this->drupalPostForm(NULL, $edit, $save_label); - $this->assertResponse(200); - - // Load the node page. - $this->drupalGet('node/1'); - $this->assertResponse(200); - - // Again, with xpath the HTML entities will be parsed automagically. - $xpath_title = (string) current($this->xpath("//title")); - $this->assertEqual($xpath_title, $title_original); - $this->assertNotEqual($xpath_title, $title_encoded); - $this->assertNotEqual($xpath_title, $title_encodeded); - - // The page title should be HTML encoded; have to do this check manually - // because assertRaw() checks the raw HTML, not the parsed strings like - // xpath does. - $this->assertRaw('' . $title_encoded . '', 'Confirmed the node title tag is encoded.'); - // Again, with xpath the HTML entities will be parsed automagically. - $xpath = $this->xpath("//meta[@name='description']"); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $desc_original); - $this->assertNotEqual($value, $desc_encoded); - $this->assertNotEqual($value, $desc_encodeded); - - // Normal meta tags should be encoded properly. - $this->assertRaw('"' . $desc_encoded . '"', 'Confirmed the node "description" meta tag string was encoded properly.'); - // Normal meta tags with HTML entities should be displayed in their original - // format. - $this->assertNoRaw('"' . $desc_original . '"', 'Confirmed the node "description" meta tag string does not show in its original form.'); - // Normal meta tags should not be double-encoded. - $this->assertNoRaw('"' . $desc_encodeded . '"', 'Confirmed the node "description" meta tag string was not double-encoded.'); - } - - /** - * Tests that fields with encoded HTML entities will not be double-encoded. - */ - public function checkEncodedField($string) { - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - - // The original strings. - $title_original = 'Title: ' . $string; - $desc_original = 'Description: ' . $string; - - // The strings after they're encoded, but quotes will not be encoded. - $desc_encoded = htmlentities($desc_original, ENT_QUOTES); - - // The strings double-encoded, to make sure the tags aren't broken. - $desc_encodeded = htmlentities($desc_encoded, ENT_QUOTES); - - // Update the Global defaults and test them. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $edit = [ - 'title' => $title_original, - 'description' => $desc_original, - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertResponse(200); - - // Set up a node without explicit metatag description. This causes the - // global default to be used, which contains a token (node:summary). The - // token value should be correctly translated. - - // Create a node. - $this->drupalGet('node/add/page'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => $title_original, - 'body[0][value]' => $desc_original, - ]; - $this->drupalPostForm(NULL, $edit, $save_label); - $this->assertResponse(200); - - // Load the node page. - $this->drupalGet('node/1'); - $this->assertResponse(200); - - // With xpath the HTML entities will be parsed automagically. - $xpath = $this->xpath("//meta[@name='description']"); - $value = (string) $xpath[0]['content']; - $this->assertEqual($value, $desc_original); - $this->assertNotEqual($value, $desc_encoded); - $this->assertNotEqual($value, $desc_encodeded); - - // Normal meta tags should be encoded properly. - $this->assertRaw('"' . $desc_encoded . '"', 'Confirmed the node "description" meta tag string was encoded properly.'); - - // Normal meta tags with HTML entities should be displayed in their original - // format. - $this->assertNoRaw('"' . $desc_original . '"', 'Confirmed the node "description" meta tag string does not show in its original form.'); - - // Normal meta tags should not be double-encoded. - $this->assertNoRaw('"' . $desc_encodeded . '"', 'Confirmed the node "description" meta tag string was not double-encoded.'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php deleted file mode 100644 index c1404835b..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php +++ /dev/null @@ -1,188 +0,0 @@ -adminUser = $this->drupalCreateUser($this->permissions); - $this->drupalLogin($this->adminUser); - - // Add a metatag field to the entity type test_entity. - $this->drupalGet('entity_test/structure/entity_test/fields/add-field'); - $this->assertResponse(200); - $edit = [ - 'label' => 'Metatag', - 'field_name' => 'metatag', - 'new_storage_type' => 'metatag', - ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - $this->container->get('entity.manager')->clearCachedFieldDefinitions(); - } - - /** - * Tests whether HTML is correctly removed from metatags. - * - * Tests three values in meta tags -- one without any HTML; one with raw html; - * and one with escaped HTML. To pass all HTML including escaped should be - * removed. - */ - public function testHtmlIsRemoved() { - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'abstract' => 'No HTML here', - 'description' => '

Surrounded by raw HTML

', - 'keywords' => '<html><body><p class="test">Surrounded by escaped HTML</p></body></html>', - ]; - - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - drupal_flush_all_caches(); - $this->drupalGet('hit-a-404'); - $this->assertResponse(404); - - $this->assertRaw('', t('Test with no HTML content')); - $this->assertRaw('', t('Test with raw HTML content')); - $this->assertRaw('', t('Test with escaped HTML content')); - } - - /** - * Tests the 'secure' meta tag attribute. - * - * Tests insecure values in og:image:secure_url (a tag with secure attribute - * set to TRUE) and in og:image (a tag with secure attribute set to FALSE). To - * To pass og:image_secure should be changed to https:// and og:image - * unchanged. - */ - public function testSecureTagOption() { - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'og_image' => 'http://blahblahblah.com/insecure.jpg', - 'og_image_secure_url' => 'http://blahblahblah.com/secure.jpg', - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - drupal_flush_all_caches(); - $this->drupalGet(''); - $this->assertResponse(200); - - $this->assertRaw('', t('Test og:image with regular http:// link')); - $this->assertRaw('', t('Test og:image:secure_url updated regular http:// link to https://')); - } - - /** - * Check the contact form. - * - * @todo Move this somewhere else. - */ - public function testContactForm() { - // Test a route where the entity for that route does not implement - // ContentEntityInterface. - $controller = \Drupal::entityTypeManager()->getStorage('contact_form'); - $controller->create([ - 'id' => 'test_contact_form', - ])->save(); - $account = $this->drupalCreateUser(['access site-wide contact form']); - $this->drupalLogin($account); - $this->drupalGet('contact/test_contact_form'); - $this->assertResponse(200); - } - - /** - * Check URL handling. - * - * @todo Finish. - */ - public function todoTestUrl() { - // $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - // // Tests meta tags with URLs work. - // $this->drupalGet($this->entity_add_path); - // $this->assertResponse(200); - // $edit = [ - // 'name[0][value]' => 'UrlTags', - // 'user_id[0][target_id]' => 'foo (' . $this->adminUser->id() . ')', - // 'field_metatag[0][advanced][original_source]' => 'http://example.com/foo.html', - // ]; - // $this->drupalPostForm(NULL, $edit, $save_label); - // $entities = entity_load_multiple_by_properties('entity_test', [ - // 'name' => 'UrlTags', - // ]); - // $this->assertEqual(1, count($entities), 'Entity was saved'); - // $entity = reset($entities); - // $this->drupalGet($this->entity_base_path . '/' . $entity->id()); - // $this->assertResponse(200); - // $elements = $this->cssSelect("meta[name='original-source']"); - // $this->assertTrue(count($elements) === 1, 'Found original source metatag from defaults'); - // $this->assertEqual((string) $elements[0]['content'], $edit['field_metatag[0][advanced][original_source]']); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php deleted file mode 100644 index 5cdb3a501..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php +++ /dev/null @@ -1,184 +0,0 @@ -config('system.site')->set('page.front', '/test-page')->save(); - - // Initiate session with a user who can manage meta tags and access content. - $permissions = [ - 'administer site configuration', - 'administer meta tags', - 'access content', - ]; - $account = $this->drupalCreateUser($permissions); - $this->drupalLogin($account); - } - - /** - * Tests that this module's tags are available. - */ - public function testTagsArePresent() { - // Load the global config. - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - - // Confirm the various meta tags are available. - foreach ($this->tags as $tag) { - // Look for a custom method named "{$tagname}TestFieldXpath", if found - // use that method to get the xpath definition for this meta tag, - // otherwise it defaults to just looking for a text input field. - $method = $this->getMethodFromTagCallback($tag, 'test_field_xpath'); - if (method_exists($this, $method)) { - $xpath = $this->$method(); - } - else { - $xpath = "//input[@name='{$tag}' and @type='text']"; - } - - $this->assertFieldByXPath($xpath, NULL, new FormattableMarkup('Found the @tag meta tag field.', ['@tag' => $tag])); - } - - $this->drupalLogout(); - } - - /** - * Confirm that each tag can be saved and that the output is correct. - */ - public function testTagsInputOutput() { - // Create a content type to test with. - $this->createContentType(['type' => 'page']); - $this->drupalCreateNode([ - 'title' => t('Hello, world!'), - 'type' => 'page', - ]); - - // Test a non-entity path and an entity path. The non-entity path inherits - // the global meta tags, the entity path inherits from its entity config. - $paths = [ - [ - 'admin/config/search/metatag/global', - 'metatag_test_custom_route', - 'Saved the Global Metatag defaults.', - ], - [ - 'admin/config/search/metatag/node', - 'node/1', - 'Saved the Content Metatag defaults', - ], - ]; - - foreach ($paths as $item) { - list($path1, $path2, $save_message) = $item; - - // Load the global config. - $this->drupalGet($path1); - $this->assertResponse(200); - - // Update the Global defaults and test them. - $all_values = $values = []; - foreach ($this->tags as $tag_name) { - // Look for a custom method named "{$tagname}TestKey", if found use - // that method to get the test string for this meta tag, otherwise it - // defaults to the meta tag's name. - $method = $this->getMethodFromTagCallback($tag_name, 'TestKey'); - if (method_exists($this, $method)) { - $test_key = $this->$method(); - } - else { - $test_key = $tag_name; - } - - // Look for a custom method named "{$tagname}TestValue", if found use - // that method to get the test string for this meta tag, otherwise it - // defaults to just generating a random string. - $method = $this->getMethodFromTagCallback($tag_name, 'TestValue'); - if (method_exists($this, $method)) { - $test_value = $this->$method(); - } - else { - // Generate a random string. Generating two words of 8 characters each - // with simple machine name -style strings. - $test_value = $this->randomMachineName() . ' ' . $this->randomMachineName(); - } - - $values[$test_key] = $test_value; - $all_values[$tag_name] = $test_value; - } - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText($save_message); - - // Load the test page. - $this->drupalGet($path2); - $this->assertResponse(200); - - // Look for the values. - foreach ($this->tags as $tag_name) { - // Look for a custom method named "{$tag_name}TestOutputXpath", if - // found use that method to get the xpath definition for this meta tag, - // otherwise it defaults to just looking for a meta tag matching: - // <$testTag $testNameAttribute=$tag_name $testValueAttribute=$value /> - $method = $this->getMethodFromTagCallback($tag_name, 'TestOutputXpath'); - if (method_exists($this, $method)) { - $xpath_string = $this->$method(); - } - else { - // Look for a custom method named "{$tag_name}TestTag", if - // found use that method to get the xpath definition for this meta - // tag, otherwise it defaults to $this->testTag. - $method = $this->getMethodFromTagCallback($tag_name, 'TestTag'); - if (method_exists($this, $method)) { - $xpath_tag = $this->$method(); - } - else { - $xpath_tag = $this->testTag; - } - - // Look for a custom method named "{$tag_name}TestNameAttribute", - // if found use that method to get the xpath definition for this meta - // tag, otherwise it defaults to $this->testNameAttribute. - $method = $this->getMethodFromTagCallback($tag_name, 'TestNameAttribute'); - if (method_exists($this, $method)) { - $xpath_name_attribute = $this->$method(); - } - else { - $xpath_name_attribute = $this->testNameAttribute; - } - - // Look for a custom method named "{$tag_name}TestTagName", if - // found use that method to get the xpath definition for this meta - // tag, otherwise it defaults to $tag_name. - $method = $this->getMethodFromTagCallback($tag_name, 'TestTagName'); - if (method_exists($this, $method)) { - $xpath_name_tag = $this->$method(); - } - else { - $xpath_name_tag = $this->getTestTagName($tag_name); - } - - // Compile the xpath. - $xpath_string = "//{$xpath_tag}[@{$xpath_name_attribute}='{$xpath_name_tag}']"; - } - - // Look for a custom method named "{$tag_name}TestValueAttribute", if - // found use that method to get the xpath definition for this meta tag, - // otherwise it defaults to $this->testValueAttribute. - $method = $this->getMethodFromTagCallback($tag_name, 'TestValueAttribute'); - if (method_exists($this, $method)) { - $xpath_value_attribute = $this->$method(); - } - else { - $xpath_value_attribute = $this->testValueAttribute; - } - - // Extract the meta tag from the HTML. - $xpath = $this->xpath($xpath_string); - $this->assertEqual(count($xpath), 1, new FormattableMarkup('One @name tag found.', ['@name' => $tag_name])); - if (count($xpath) !== 1) { - $this->verbose($xpath, $tag_name . ': ' . $xpath_string); - } - - // Run various tests on the output variables. - // Most meta tags have an attribute, but some don't. - if (!empty($xpath_value_attribute)) { - $this->assertTrue($xpath_value_attribute); - $this->assertTrue(isset($xpath[0][$xpath_value_attribute])); - // Help with debugging. - if (!isset($xpath[0][$xpath_value_attribute])) { - $this->verbose($xpath, $tag_name . ': ' . $xpath_string); - } - else { - if ((string) $xpath[0][$xpath_value_attribute] != $all_values[$tag_name]) { - $this->verbose($xpath, $tag_name . ': ' . $xpath_string); - } - $this->assertTrue($xpath[0][$xpath_value_attribute]); - $this->assertEqual($xpath[0][$xpath_value_attribute], $all_values[$tag_name], "The meta tag was found with the expected value."); - } - } - else { - $this->verbose($xpath, $tag_name . ': ' . $xpath_string); - $this->assertTrue((string) $xpath[0]); - $this->assertEqual((string) $xpath[0], $all_values[$tag_name], "The meta tag was found with the expected value."); - } - } - } - - $this->drupalLogout(); - } - - /** - * Convert a tag's internal name to the string which is actually used in HTML. - * - * The meta tag internal name will be machine names, i.e. only contain a-z, - * A-Z, 0-9 and the underline character. Meta tag names will actually contain - * any possible character. - * - * @param string $tag_name - * The tag name to be converted. - * - * @return string - * The converted tag name. - */ - private function getTestTagName($tag_name) { - return $tag_name; - } - - /** - * Generate a random value for testing meta tag fields. - * - * As a reasonable default, this will generating two words of 8 characters - * each with simple machine name -style strings. - * - * @return string - * A normal string. - */ - private function getTestTagValue() { - return $this->randomMachineName() . ' ' . $this->randomMachineName(); - } - - /** - * Generate a URL for an image. - * - * @return string - * An absolute URL to a non-existent image. - */ - private function randomImageUrl() { - return 'http://www.example.com/images/' . $this->randomMachineName() . '.png'; - } - - /** - * Convert a tag name with a callback to a lowerCamelCase method name. - * - * @param string $tag_name - * The meta tag name. - * @param string $callback - * The callback that is to be used. - * - * @return string - * The tag name and callback concatenated together and converted to - * lowerCamelCase. - */ - private function getMethodFromTagCallback($tag_name, $callback) { - return lcfirst(Container::camelize($tag_name . '_' . $callback)); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php deleted file mode 100644 index da5a3e6d8..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php +++ /dev/null @@ -1,213 +0,0 @@ -alert("xss");'; - - /** - * String that causes an alert when meta tags aren't filtered for xss. - * - * @var string - */ - private $xssString = '">adminUser = $this->drupalCreateUser($admin_permissions); - $this->drupalLogin($this->adminUser); - - // Set up a content type. - $this->drupalCreateContentType(['type' => 'metatag_node', 'name' => 'Test Content Type']); - - // Add a metatag field to the content type. - $this->drupalGet('admin/structure/types/manage/metatag_node/fields/add-field'); - $this->assertResponse(200); - $edit = [ - 'label' => 'Metatag', - 'field_name' => 'metatag_field', - 'new_storage_type' => 'metatag', - ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - } - - /** - * Verify XSS injected in global config is not rendered. - */ - public function testXssMetatagConfig() { - $this->drupalGet('admin/config/search/metatag/global'); - $this->assertResponse(200); - $values = [ - 'title' => $this->xssTitleString, - 'abstract' => $this->xssString, - 'image_src' => $this->xssImageString, - ]; - $this->drupalPostForm(NULL, $values, 'Save'); - $this->assertText('Saved the Global Metatag defaults.'); - $this->rebuildAll(); - - // Load the Views-based front page. - $this->drupalGet('node'); - $this->assertResponse(200); - $this->assertText(t('No front page content has been created yet.')); - - // Check for the title tag, which will have the HTML tags removed and then - // be lightly HTML encoded. - $this->assertEscaped(strip_tags($this->xssTitleString)); - $this->assertNoRaw($this->xssTitleString); - - // Check for the basic meta tag. - $this->assertRaw($this->escapedXssTag); - $this->assertNoRaw($this->xssString); - - // Check for the image meta tag. - $this->assertRaw($this->escapedXssImageTag); - $this->assertNoRaw($this->xssImageString); - } - - /** - * Verify XSS injected in the entity metatag override field is not rendered. - */ - public function testXssEntityOverride() { - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - - $this->drupalGet('node/add/metatag_node'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => $this->randomString(32), - 'field_metatag_field[0][basic][title]' => $this->xssTitleString, - 'field_metatag_field[0][basic][abstract]' => $this->xssString, - 'field_metatag_field[0][advanced][image_src]' => $this->xssImageString, - ]; - $this->drupalPostForm(NULL, $edit, $save_label); - - // Check for the title tag, which will have the HTML tags removed and then - // be lightly HTML encoded. - $this->assertEscaped(strip_tags($this->xssTitleString)); - $this->assertNoRaw($this->xssTitleString); - - // Check for the basic meta tag. - $this->assertRaw($this->escapedXssTag); - $this->assertNoRaw($this->xssString); - - // Check for the image meta tag. - $this->assertRaw($this->escapedXssImageTag); - $this->assertNoRaw($this->xssImageString); - } - - /** - * Verify XSS injected in the entity titles are not rendered. - */ - public function testXssEntityTitle() { - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - - $this->drupalGet('node/add/metatag_node'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => $this->xssTitleString, - 'body[0][value]' => $this->randomString() . ' ' . $this->randomString(), - ]; - $this->drupalPostForm(NULL, $edit, $save_label); - - // Check for the title tag, which will have the HTML tags removed and then - // be lightly HTML encoded. - $this->assertEscaped(strip_tags($this->xssTitleString)); - $this->assertNoRaw($this->xssTitleString); - } - - /** - * Verify XSS injected in the entity fields are not rendered. - */ - public function testXssEntityBody() { - $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save'); - - $this->drupalGet('node/add/metatag_node'); - $this->assertResponse(200); - $edit = [ - 'title[0][value]' => $this->randomString(), - 'body[0][value]' => $this->xssTitleString, - ]; - $this->drupalPostForm(NULL, $edit, $save_label); - - // Check the body text. - // $this->assertNoTitle($this->xssTitleString); - $this->assertNoRaw($this->xssTitleString); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php b/sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php deleted file mode 100644 index 72c0833c6..000000000 --- a/sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php +++ /dev/null @@ -1,37 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('Support module for testing handling of a custom route.') . '

'; - return $output; - - default: - } -} - -/** - * Implements hook_metatag_route_entity(). - */ -function metatag_test_custom_route_metatag_route_entity(RouteMatchInterface $route_match) { - if ($route_match->getRouteName() === 'metatag_test_custom_route.entity_route') { - if ($entity_test = $route_match->getParameter('entity_test')) { - return $entity_test; - } - } -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.routing.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.routing.yml deleted file mode 100644 index 1e1a5d41a..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.routing.yml +++ /dev/null @@ -1,15 +0,0 @@ -metatag_test_custom_route.test: - path: '/metatag_test_custom_route' - defaults: - _title: 'Metatag Test' - _controller: '\Drupal\metatag_test_custom_route\Controller\MetatagTestCustomRouteController::test' - requirements: - _permission: 'access content' - - -metatag_test_custom_route.entity_route: - path: '/metatag_test_custom_route/{entity_test}' - defaults: - _entity_view: 'entity_test.full' - requirements: - _permission: 'access content' diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/src/Controller/MetatagTestCustomRouteController.php b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/src/Controller/MetatagTestCustomRouteController.php deleted file mode 100644 index 24a537cd1..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_custom_route/src/Controller/MetatagTestCustomRouteController.php +++ /dev/null @@ -1,23 +0,0 @@ - $this->t('

Hello world!

'), - ]; - - return $render; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml deleted file mode 100644 index f401affa9..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml +++ /dev/null @@ -1,3 +0,0 @@ -metatag.metatag_tag.metatag_test_tag: - type: label - label: 'Metatag Test' diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml deleted file mode 100644 index ab69327c1..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Metatag Tests: Tag' -type: module -description: 'Support module for testing handling of a custom meta tag.' -# core: 8.x -package: Testing -dependencies: - - metatag:metatag - -# Information added by Drupal.org packaging script on 2019-02-20 -version: '8.x-1.8' -core: '8.x' -project: 'metatag' -datestamp: 1550683387 diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml deleted file mode 100644 index 405573206..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml +++ /dev/null @@ -1,3 +0,0 @@ -metatag.metatag_tag.metatag_test_tag: - type: label - label: 'Metatag test' diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module deleted file mode 100644 index 65808d44f..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module +++ /dev/null @@ -1,6 +0,0 @@ -getEditable('system.site') - ->set('page.front', '/node') - ->save(TRUE); - } - - /** - * Test the default values for the front page. - */ - public function testFrontpage() { - $this->drupalGet(''); - $this->assertResponse(200); - $xpath = $this->xpath("//link[@rel='canonical']"); - $this_page_url = $this->buildUrl(''); - $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url); - } - - /** - * Test the default values for a custom route. - */ - public function testCustomRoute() { - $this->drupalGet('metatag_test_custom_route'); - $this->assertResponse(200); - $this->assertText('Hello world!'); - - // Check the meta tags. - $xpath = $this->xpath("//link[@rel='canonical']"); - $this_page_url = $this->buildUrl('/metatag_test_custom_route'); - $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url); - } - - /** - * Test the default values for a Node entity. - */ - public function testNode() { - $node = $this->createContentTypeNode(); - $this_page_url = $node->toUrl('canonical', ['absolute' => TRUE])->toString(); - - // Load the node's entity page. - $this->drupalGet($this_page_url); - $this->assertResponse(200); - - // Check the meta tags. - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url); - } - - /** - * Test the default values for a Term entity. - */ - public function testTerm() { - $vocab = $this->createVocabulary(); - $term = $this->createTerm(['vid' => $vocab->id()]); - $this_page_url = $term->toUrl('canonical', ['absolute' => TRUE])->toString(); - $this->drupalGet($this_page_url); - $this->assertResponse(200); - - // Check the meta tags. - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url); - } - - /** - * Test the default values for a User entity. - */ - public function testUser() { - $this->loginUser1(); - $account = \Drupal::currentUser()->getAccount(); - $this_page_url = $account->toUrl('canonical', ['absolute' => TRUE])->toString(); - - // Load the user's entity page. - $this->drupalGet($this_page_url); - $this->assertResponse(200); - - // Check the meta tags. - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url); - $this->drupalLogout(); - } - - /** - * Test the default values for the user login page, etc. - */ - public function testUserLoginPages() { - $front_url = $this->buildUrl('', ['absolute' => TRUE]);; - - // A list of paths to examine. - $routes = [ - '/user/login', - '/user/register', - '/user/password', - ]; - - foreach ($routes as $route) { - // Identify the path to load. - $this_page_url = $this->buildUrl($route, ['absolute' => TRUE]); - $this->assertTrue(!empty($this_page_url)); - - // Load the path. - $this->drupalGet($this_page_url); - $this->assertResponse(200); - - // Check the meta tags. - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertNotEqual((string) $xpath[0]->getAttribute('href'), $front_url); - $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url); - } - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php deleted file mode 100644 index 654f1bff7..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php +++ /dev/null @@ -1,36 +0,0 @@ -drupalGet('metatag_test_custom_route'); - $this->assertResponse(200); - $this->assertText('Hello world!'); - } - - /** - * Make sure that the system still works when some example content exists. - */ - public function testNode() { - $node = $this->createContentTypeNode(); - $this->drupalGet($node->toUrl()); - $this->assertResponse(200); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php deleted file mode 100644 index 659b5ef63..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php +++ /dev/null @@ -1,157 +0,0 @@ -setPassword($password)->save(); - - // Support old and new tests. - $account->passRaw = $password; - $account->pass_raw = $password; - - // Login. - $this->drupalLogin($account); - } - - /** - * {@inheritdoc} - */ - protected function verbose($message, $title = NULL) { - // Handle arrays, objects, etc. - if (!is_string($message)) { - $message = "
\n" . print_r($message, TRUE) . "\n
\n"; - } - - // Optional title to go before the output. - if (!empty($title)) { - $title = '

' . Html::escape($title) . "

\n"; - } - - parent::verbose($title . $message); - } - - /** - * Create a content type and a node. - * - * @param string $title - * A title for the node that will be returned. - * @param string $body - * The text to use as the body. - * - * @return \Drupal\node\NodeInterface - * A fully formatted node object. - */ - private function createContentTypeNode($title = 'Title test', $body = 'Body test') { - $content_type = 'metatag_test'; - $args = [ - 'type' => $content_type, - 'label' => 'Test content type', - ]; - $this->createContentType($args); - - $args = [ - 'body' => [ - [ - 'value' => $body, - 'format' => filter_default_format(), - ], - ], - 'title' => $title, - 'type' => $content_type, - ]; - - return $this->createNode($args); - } - - /** - * Create a vocabulary. - * - * @param array $values - * Items passed to the vocabulary. If the 'vid' item is not present it will - * be automatically generated. If the 'name' item is not present the 'vid' - * will be used. - * - * @return \Drupal\taxonomy\Entity\Vocabulary - * A fully formatted vocabulary object. - */ - private function createVocabulary(array $values = []) { - // Find a non-existent random type name. - if (!isset($values['vid'])) { - do { - $id = strtolower($this->randomMachineName(8)); - } while (Vocabulary::load($id)); - } - else { - $id = $values['vid']; - } - $values += [ - 'vid' => $id, - 'name' => $id, - ]; - $vocab = Vocabulary::create($values); - $status = $vocab->save(); - - if ($this instanceof \PHPUnit_Framework_TestCase) { - $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString()); - } - else { - $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString()); - } - - return $vocab; - } - - /** - * Create a taxonomy term. - * - * @param array $values - * Items passed to the term. Requires the 'vid' element. - * - * @return Drupal\taxonomy\Entity\Term - * A fully formatted term object. - */ - private function createTerm(array $values = []) { - // Populate defaults array. - $values += [ - 'description' => [ - [ - 'value' => $this->randomMachineName(32), - 'format' => filter_default_format(), - ], - ], - 'name' => $this->randomMachineName(8), - ]; - $term = Term::create($values); - $status = $term->save(); - - if ($this instanceof \PHPUnit_Framework_TestCase) { - $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString()); - } - else { - $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString()); - } - - return $term; - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php deleted file mode 100644 index 44681192f..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php +++ /dev/null @@ -1,135 +0,0 @@ -provisionResource(); - - /* @var\Drupal\node\NodeInterface $node */ - $node = $this->createContentTypeNode('Test JSON output', 'Testing JSON output for a content type'); - $url = $node->toUrl(); - - // Load the node's page. - $this->drupalGet($url); - $this->assertResponse(200); - - // Load the JSON output. - $url->setOption('query', ['_format' => 'json']); - $response = $this->drupalGet($url); - $this->assertResponse(200); - - // Decode the JSON output. - $response = $this->getRawContent(); - $this->assertTrue(!empty($response)); - $json = json_decode($response); - $this->verbose($json, 'JSON output'); - $this->assertTrue(!empty($json)); - - // Confirm the JSON object's values. - $this->assertTrue(isset($json->nid)); - if (isset($json->nid)) { - $this->assertTrue($json->nid[0]->value == $node->id()); - } - $this->assertTrue(isset($json->metatag)); - if (isset($json->metatag)) { - $this->assertTrue($json->metatag->value->title == $node->label() . ' | Drupal'); - // @todo Test other meta tags. - } - } - - /** - * Provisions the REST resource under test. - * - * @param string $entity_type - * The entity type to be enabled; defaults to 'node'. - * @param array $formats - * The allowed formats for this resource; defaults to ['json']. - * @param array $authentication - * The allowed authentication providers for this resource; defaults to - * ['basic_auth']. - */ - protected function provisionResource($entity_type = 'node', array $formats = [], array $authentication = []) { - $this->resourceConfigStorage = $this->container - ->get('entity_type.manager') - ->getStorage('rest_resource_config'); - - // Defaults. - if (empty($formats)) { - $formats[] = 'json'; - } - if (empty($authentication)) { - $authentication[] = 'basic_auth'; - } - - $this->resourceConfigStorage->create([ - 'id' => 'entity.' . $entity_type, - 'granularity' => RestResourceConfigInterface::RESOURCE_GRANULARITY, - 'configuration' => [ - 'methods' => ['GET', 'POST', 'PATCH', 'DELETE'], - 'formats' => $formats, - 'authentication' => $authentication, - ], - 'status' => TRUE, - ])->save(); - - // Ensure that the cache tags invalidator has its internal values reset. - // Otherwise the http_response cache tag invalidation won't work. - // Clear the tag cache. - \Drupal::service('cache_tags.invalidator')->resetChecksums(); - foreach (Cache::getBins() as $backend) { - if (is_callable([$backend, 'reset'])) { - $backend->reset(); - } - } - $this->container->get('config.factory')->reset(); - $this->container->get('state')->resetCache(); - - // Tests using this base class may trigger route rebuilds due to changes to - // RestResourceConfig entities or 'rest.settings'. Ensure the test generates - // routes using an up-to-date router. - \Drupal::service('router.builder')->rebuildIfNeeded(); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php deleted file mode 100644 index 91b444379..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php +++ /dev/null @@ -1,76 +0,0 @@ -loginUser1(); - - // Add language. - $this->drupalGet('/admin/config/regional/language/add'); - $this->assertResponse(200); - $edit = [ - 'predefined_langcode' => 'hu', - ]; - $this->drupalPostForm(NULL, $edit, 'Add language'); - - // Set up a content type. - $this->drupalCreateContentType(['type' => 'article']); - $this->drupalGet('/admin/structure/types/manage/article'); - $this->assertResponse(200); - $edit = [ - 'language_configuration[content_translation]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, 'Save content type'); - } - - /** - * Load the custom route, make sure something is output. - */ - public function testContentTranslationForm() { - $this->drupalGet('/admin/config/regional/content-language'); - $this->assertResponse(200); - $this->assertText('Content language'); - $this->drupalPostForm(NULL, [], 'Save configuration'); - $this->assertResponse(200); - $this->assertText('Settings successfully updated.'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php deleted file mode 100644 index 489b007ba..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php +++ /dev/null @@ -1,60 +0,0 @@ -loginUser1(); - - // Set up a vocabulary. - $vocabulary = Vocabulary::create([ - 'vid' => 'metatag_vocab', - 'name' => $this->randomString(), - ]); - $vocabulary->save(); - $term = Term::create([ - 'vid' => $vocabulary->id(), - 'name' => $this->randomString(), - ]); - $term->save(); - - // Set up meta tags for taxonomy. - $edit = [ - 'canonical_url' => '[current-page:url:unaliased]', - ]; - $this->drupalPostForm('admin/config/search/metatag/taxonomy_term', $edit, 'Save'); - - // Ensure there is only 1 canonical metatag. - $this->drupalGet('taxonomy/term/' . $term->id()); - $xpath = $this->xpath("//link[@rel='canonical']"); - $this->assertEquals(1, count($xpath), 'Exactly one canonical rel meta tag found.'); - } - -} diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php deleted file mode 100644 index bc4330c6d..000000000 --- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php +++ /dev/null @@ -1,19 +0,0 @@ -generateElements([ - 'og_image_width' => 100, - 'og_image_height' => 100, - 'og_image_url' => 'http://www.example.com/example/foo.png', - ]); - - $expected = [ - '#attached' => [ - 'html_head' => [ - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:url', - 'content' => 'http://www.example.com/example/foo.png', - ], - ], - 'og_image_url_0', - ], - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:width', - 'content' => 100, - ], - ], - 'og_image_width', - ], - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:height', - 'content' => 100, - ], - ], - 'og_image_height', - ], - ], - ], - ]; - $this->assertEquals($expected, $tags); - } - - /** - * Tests metatags with multiple values return multiple metatags. - */ - public function testMetatagMultiple() { - /** @var \Drupal\metatag\MetatagManager $metatag_manager */ - $metatag_manager = \Drupal::service('metatag.manager'); - - $tags = $metatag_manager->generateElements([ - 'og_image_width' => 100, - 'og_image_height' => 100, - 'og_image_url' => 'http://www.example.com/example/foo.png, http://www.example.com/example/foo2.png', - ]); - - $expected = [ - '#attached' => [ - 'html_head' => [ - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:url', - 'content' => 'http://www.example.com/example/foo.png', - ], - ], - 'og_image_url_0', - ], - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:url', - 'content' => 'http://www.example.com/example/foo2.png', - ], - ], - 'og_image_url_1', - ], - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:width', - 'content' => 100, - ], - ], - 'og_image_width', - ], - [ - [ - '#tag' => 'meta', - '#attributes' => [ - 'property' => 'og:image:height', - 'content' => 100, - ], - ], - 'og_image_height', - ], - ], - ], - ]; - $this->assertEquals($expected, $tags); - } - -} diff --git a/sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt b/sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml b/sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml deleted file mode 100644 index b64509822..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml +++ /dev/null @@ -1,2 +0,0 @@ -user_special: true -regex_pattern: '{(^node|^user|^taxonomy/term)/([0-9]+)/(.+)}' diff --git a/sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml b/sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml deleted file mode 100644 index 84ba2300d..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml +++ /dev/null @@ -1,9 +0,0 @@ -path_alias_xt.settings: - type: config_object - mapping: - user_special: - type: boolean - label: 'User special' - regex_pattern: - type: string - label: 'RegEx pattern' diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml deleted file mode 100644 index 51fca7b7e..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Extended Path Aliases -description: 'Automatically extend path aliases to include tabs, like about-us/edit for node/123/edit.
Allow these aliases to be entered in page specification wild-cards, about-us*, e.g for block visibility.' - -type: module -# core: 8.x - -dependencies: - - drupal:path - -configure: path_alias_xt.settings_form - -# Information added by Drupal.org packaging script on 2019-01-30 -version: '8.x-1.x-dev' -core: '8.x' -project: 'path_alias_xt' -datestamp: 1548876484 diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml deleted file mode 100644 index ef411e3e0..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -path_alias_xt.settings_form: - title: 'Extended path aliases' - route_name: path_alias_xt.settings_form - description: 'Advanced settings.' - parent: system.admin_config_system diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module deleted file mode 100644 index 725ef7392..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module +++ /dev/null @@ -1,24 +0,0 @@ -'; - $output .= t('Installation instructions are in the README.txt file. Further documentation is on the Extended Path Aliases project page.', - ['@path_alias_xt' => Url::fromUri('http://drupal.org/project/path_alias_xt')->toString()]); - $output .= '

'; - - return ['#markup' => $output]; - } -} diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml deleted file mode 100644 index 6ef8ecb0e..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -administer extended path aliases: - title: 'Administer Extended Path Aliases' diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml deleted file mode 100644 index a9629810e..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml +++ /dev/null @@ -1,9 +0,0 @@ -path_alias_xt.settings_form: - path: '/admin/config/system/path_alias_xt' - defaults: - _form: '\Drupal\path_alias_xt\Form\PathAliasXtSettingsForm' - _title: 'Extended path aliases' - requirements: - _permission: 'administer extended path aliases' - options: - _admin_route: TRUE diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml deleted file mode 100644 index cb85ebec6..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - path_alias_xt.path_processor_alias: - class: Drupal\path_alias_xt\PathAliasXtProcessorAlias - tags: - - { name: path_processor_inbound, priority: 100 } - - { name: path_processor_outbound, priority: 100 } - arguments: ['@path.alias_manager', '@config.factory'] diff --git a/sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php b/sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php deleted file mode 100644 index f9482a2e2..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php +++ /dev/null @@ -1,69 +0,0 @@ -config('path_alias_xt.settings'); - - $form['user_special'] = [ - '#type' => 'checkbox', - '#title' => $this->t('For the current user: instead of /user/uid or its alias, apply the alias for /user.'), - '#default_value' => $config->get('user_special'), - '#description' => $this->t('If ticked and the system path /user has an alias, such as /MyAccount, then /MyAccount will also be applied when a user visits their /user/uid/... pages.
For this feature to work you must complete the full installation procedure outlined in the README.', [ - '@alias' => Url::fromRoute('path.admin_overview')->toString(), - '@README' => Url::fromUserInput('/' . drupal_get_path('module', 'path_alias_xt') . '/README.txt')->toString(), - ]), - ]; - - $form['regex_pattern'] = [ - '#type' => 'textfield', - '#size' => 100, - '#title' => $this->t('Regular expression to match system paths for nodes, users and taxonomy terms'), - '#default_value' => $config->get('regex_pattern'), - '#description' => $this->t("While you can always reset this configuration and recover without permanent damage to your site, a change to this expression may temporarily break all extended aliases. Change only when you know what you're doing."), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('path_alias_xt.settings'); - - foreach ($form_state->getValues() as $key => $value) { - $config->set($key, $value); - } - $config->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php b/sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php deleted file mode 100644 index 2d263a65f..000000000 --- a/sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php +++ /dev/null @@ -1,89 +0,0 @@ -configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function processInbound($path, Request $request) { - $path_to_process = ltrim($path, '/'); - - $removed_elements = []; - $path_elements = explode('/', $path_to_process); - - foreach ($path_elements as $element) { - $candidate_alias = '/' . implode('/', $path_elements); - $source = $this->aliasManager->getPathByAlias($candidate_alias); - - if ($source != $candidate_alias) { - // Change the order of the elements. - krsort($removed_elements); - $return_path = $source; - if (!empty($removed_elements)) { - $return_path .= '/' . implode('/', $removed_elements); - } - - // Validate the path. - // Injecting the service threw ServiceCircularReferenceException. - if (\Drupal::service('path.validator')->getUrlIfValidWithoutAccessCheck($return_path)) { - return $return_path; - } - } - // Remove the last element from the elements array to be able to add it - // to the end of the found path. - $removed_elements[] = array_pop($path_elements); - } - - return $path; - } - - /** - * {@inheritdoc} - */ - public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) { - $path = parent::processOutbound($path, $options, $request, $bubbleable_metadata); - - $config = $this->configFactory->get('path_alias_xt.settings'); - if (preg_match($config->get('regex_pattern'), Unicode::substr($path, 1), $matches)) { - $langcode = isset($options['language']) ? $options['language']->getId() : NULL; - if ($alias = $this->aliasManager->getAliasByPath("/$matches[1]/$matches[2]", $langcode)) { - $path = "$alias/$matches[3]"; - } - } - - return $path; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/LICENSE.txt b/sites/all/modules/contrib/admin/pathauto/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/pathauto/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/pathauto/README.md b/sites/all/modules/contrib/admin/pathauto/README.md deleted file mode 100644 index d21f1356a..000000000 --- a/sites/all/modules/contrib/admin/pathauto/README.md +++ /dev/null @@ -1,83 +0,0 @@ -#Pathauto - -If you are developing for this module, have a look at pathauto.api.php. - -##Description - -The Pathauto module provides support functions for other modules to -automatically generate aliases based on appropriate criteria, with a -central settings path for site administrators. - -Implementations are provided for core entity types: content, taxonomy terms, -and users (including blogs and forum pages). - -Pathauto also provides a way to delete large numbers of aliases. This feature -is available at Administer > Configuration > Search and metadata > URL aliases > -Delete aliases. - -##Benefits - -Besides making the page address more reflective of its content than -"node/138", it's important to know that modern search engines give -heavy weight to search terms which appear in a page's URL. By -automatically using keywords based directly on the page content in the URL, -relevant search engine hits for your page can be significantly -enhanced. - -##Notices - -Pathauto just adds URL aliases to content, users, and taxonomy terms. -Because it's an alias, the standard Drupal URL (for example node/123 or -taxonomy/term/1) will still function as normal. If you have external links -to your site pointing to standard Drupal URLs, or hardcoded links in a module, -template, content or menu which point to standard Drupal URLs it will bypass -the alias set by Pathauto. - -There are reasons you might not want two URLs for the same content on your -site. If this applies to you, please note that you will need to update any -hard coded links in your content or blocks. - -If you use the "system path" (i.e. node/10) for menu items and settings like -that, Drupal will replace it with the url_alias. - -For external links, you might want to consider the Path Redirect or -Global Redirect modules, which allow you to set forwarding either per item or -across the site to your aliased URLs. - -###URLs (not) Getting Replaced With Aliases: -Please bear in mind that only URLs passed through Drupal's Drupal's URL and -Link APIs will be replaced with their aliases during page output. If -a module or your template contains hardcoded links, such as -'href="node/$node->nid"', those won't get replaced with their corresponding -aliases. - -## Disabling Pathauto for a specific content type (or taxonomy) - -When the pattern for a content type is left blank, the default pattern will be -used. But if the default pattern is also blank, Pathauto will be disabled -for that content type. - -## Installing Pathauto -1. Install the module as normal, note that there are two dependencies. -2. Configure the module at admin/config/search/path/patterns - add a new pattern by creating by clicking "Add Pathauto pattern". -3. Fill out "Path pattern" with fx [node:title], choose which content types this applies to, give it a label (the name) and save it. -4. When you save new content from now on, it should automatically be assigned an alternative URL - -##Credits: - -The original module combined the functionality of Mike Ryan's autopath with -Tommy Sundstrom's path_automatic. - -Significant enhancements were contributed by jdmquin @ www.bcdems.net. - -Matt England added the tracker support (tracker support has been removed in -recent changes). - -Other suggestions and patches contributed by the Drupal community. - -Current maintainers: - -- Dave Reid - http://www.davereid.net -- Greg Knaddison - http://www.knaddison.com -- Mike Ryan - http://mikeryan.name -- Frederik 'Freso' S. Olesen - http://freso.dk diff --git a/sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml b/sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml deleted file mode 100644 index 03004aa1d..000000000 --- a/sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml +++ /dev/null @@ -1,20 +0,0 @@ -enabled_entity_types: - - user -punctuation: - hyphen: 1 -verbose : FALSE -separator : '-' -max_length : 100 -max_component_length: 100 -transliterate : TRUE -reduce_ascii : FALSE -case : TRUE -ignore_words : 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with' -update_action : 2 -safe_tokens: - - alias - - path - - join-path - - login-url - - url - - url-brief diff --git a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml b/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml deleted file mode 100644 index 07709b7c0..000000000 --- a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml +++ /dev/null @@ -1,9 +0,0 @@ -id: pathauto_update_alias_node -label: 'Update URL alias' -status: true -langcode: en -type: node -plugin: pathauto_update_alias -dependencies: - module: - - node diff --git a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml b/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml deleted file mode 100644 index 891cbf220..000000000 --- a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml +++ /dev/null @@ -1,9 +0,0 @@ -id: pathauto_update_alias_user -label: 'Update URL alias' -status: true -langcode: en -type: user -plugin: pathauto_update_alias -dependencies: - module: - - user diff --git a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml b/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml deleted file mode 100644 index 1da59f187..000000000 --- a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml +++ /dev/null @@ -1,39 +0,0 @@ -pathauto.settings: - type: config_object - mapping: - enabled_entity_types: - label: Enabled entity types - type: sequence - sequence: - type: string - punctuation: - type: sequence - sequence: - type: integer - verbose: - type: boolean - separator: - type: string - max_length: - type: integer - max_component_length: - type: integer - transliterate: - type: boolean - reduce_ascii: - type: boolean - case: - type: boolean - ignore_words: - type: string - update_action: - type: integer - safe_tokens: - label: Tokens that are safe to use and do not need to be cleaned. - type: sequence - sequence: - type: string - -action.configuration.pathauto_update_alias: - type: action_configuration_default - label: 'Update URL alias' diff --git a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml b/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml deleted file mode 100644 index 14a1ae7b6..000000000 --- a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml +++ /dev/null @@ -1,40 +0,0 @@ -pathauto.pattern.*: - type: config_entity - label: 'Pathauto pattern config' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - uuid: - type: string - type: - type: string - label: 'Pattern type' - pattern: - type: string - label: 'Pattern' - selection_criteria: - type: sequence - label: 'Selection criteria' - sequence: - type: condition.plugin.[id] - label: 'Selection condition' - selection_logic: - type: string - label: 'Selection logic' - weight: - type: integer - label: 'Weight' - relationships: - type: sequence - label: 'Context definitions' - sequence: - - type: mapping - label: 'Relationship' - mapping: - label: - type: label - label: 'Label' diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.api.php b/sites/all/modules/contrib/admin/pathauto/pathauto.api.php deleted file mode 100644 index 6595116fd..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.api.php +++ /dev/null @@ -1,159 +0,0 @@ -query("SELECT 1 FROM {mytable} WHERE path = :path", [':path' => $alias])->fetchField(); -} - -/** - * Alter the pattern to be used before an alias is generated by Pathauto. - * - * This hook will only be called if a default pattern is configured (on - * admin/config/search/path/patterns). - * - * @param \Drupal\pathauto\PathautoPatternInterface $pattern - * The Pathauto pattern to be used. - * @param array $context - * An associative array of additional options, with the following elements: - * - 'module': The module or entity type being aliased. - * - 'op': A string with the operation being performed on the object being - * aliased. Can be either 'insert', 'update', 'return', or 'bulkupdate'. - * - 'source': A string of the source path for the alias (e.g. 'node/1'). - * - 'data': An array of keyed objects to pass to token_replace(). - * - 'bundle': The sub-type or bundle of the object being aliased. - * - 'language': A string of the language code for the alias (e.g. 'en'). - * This can be altered by reference. - */ -function hook_pathauto_pattern_alter(\Drupal\pathauto\PathautoPatternInterface $pattern, array $context) { - // Switch out any [node:created:*] tokens with [node:updated:*] on update. - if ($context['module'] == 'node' && ($context['op'] == 'update')) { - $pattern->setPattern(preg_replace('/\[node:created(\:[^]]*)?\]/', '[node:updated$1]', $pattern->getPattern())); - } -} - -/** - * Alter Pathauto-generated aliases before saving. - * - * @param string $alias - * The automatic alias after token replacement and strings cleaned. - * @param array $context - * An associative array of additional options, with the following elements: - * - 'module': The module or entity type being aliased. - * - 'op': A string with the operation being performed on the object being - * aliased. Can be either 'insert', 'update', 'return', or 'bulkupdate'. - * - 'source': A string of the source path for the alias (e.g. 'node/1'). - * This can be altered by reference. - * - 'data': An array of keyed objects to pass to token_replace(). - * - 'type': The sub-type or bundle of the object being aliased. - * - 'language': A string of the language code for the alias (e.g. 'en'). - * This can be altered by reference. - * - 'pattern': A string of the pattern used for aliasing the object. - */ -function hook_pathauto_alias_alter(&$alias, array &$context) { - // Add a suffix so that all aliases get saved as 'content/my-title.html'. - $alias .= '.html'; - - // Force all aliases to be saved as language neutral. - $context['language'] = Language::LANGCODE_NOT_SPECIFIED; -} - -/** - * Alter the list of punctuation characters for Pathauto control. - * - * @param array $punctuation - * An array of punctuation to be controlled by Pathauto during replacement - * keyed by punctuation name. Each punctuation record should be an array - * with the following key/value pairs: - * - value: The raw value of the punctuation mark. - * - name: The human-readable name of the punctuation mark. This must be - * translated using t() already. - */ -function hook_pathauto_punctuation_chars_alter(array &$punctuation) { - // Add the trademark symbol. - $punctuation['trademark'] = array('value' => '™', 'name' => t('Trademark symbol')); - - // Remove the dollar sign. - unset($punctuation['dollar']); -} diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.info.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.info.yml deleted file mode 100644 index c661dae56..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.info.yml +++ /dev/null @@ -1,21 +0,0 @@ -name : 'Pathauto' -description : 'Provides a mechanism for modules to automatically generate aliases for the content they manage.' -# core: 8.x -type: module - -dependencies: -- ctools:ctools -- drupal:path -- drupal:system (>=8.5) -- token:token - -configure: entity.pathauto_pattern.collection - -recommends: -- redirect:redirect - -# Information added by Drupal.org packaging script on 2018-09-08 -version: '8.x-1.3' -core: '8.x' -project: 'pathauto' -datestamp: 1536407890 diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.install b/sites/all/modules/contrib/admin/pathauto/pathauto.install deleted file mode 100644 index 4b160ba10..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.install +++ /dev/null @@ -1,320 +0,0 @@ -schema(); - if (!$database_schema->tableExists($alias_storage::TABLE)) { - $schema_definition = $alias_storage->schemaDefinition(); - $database_schema->createTable($alias_storage::TABLE, $schema_definition); - } - } -} - -/** - * Updates pathauto widgets to use the path widget ID. - */ -function pathauto_update_8001() { - - // Replace values in the 'entity.definitions.installed' keyvalue collection. - $collection = \Drupal::service('keyvalue')->get('entity.definitions.installed'); - foreach ($collection->getAll() as $key => $definitions) { - if (!is_array($definitions) || empty($definitions['path'])) { - continue; - } - - // Retrieve and change path base field definition. - $path_definition = $definitions['path']; - if (($options = $path_definition->getDisplayOptions('form')) && $options['type'] = 'pathauto') { - $options['type'] = 'path'; - $path_definition->setDisplayOptions('form', $options); - // Save the new value. - $collection->set($key, $definitions); - } - - } - - foreach (EntityFormDisplay::loadMultiple() as $form_display) { - if ($component = $form_display->getComponent('path')) { - if (isset($component['type']) && $component['type'] == 'pathauto') { - $component['type'] = 'path'; - $form_display->setComponent('path', $component); - $form_display->save(); - } - } - } -} - -/** - * Converts patterns from configuration objects to configuration entities. - */ -function pathauto_update_8100() { - \Drupal::service('module_installer')->install(['ctools']); - - $messages = array(); - /** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_bundle_info */ - $entity_bundle_info = \Drupal::service('entity_type.bundle.info'); - $entity_type_manager = \Drupal::entityTypeManager(); - $language_manager = \Drupal::languageManager(); - $entity_type_manager->clearCachedDefinitions(); - \Drupal::service('plugin.manager.alias_type')->clearCachedDefinitions(); - $entity_types = $entity_type_manager->getDefinitions(); - - // 1. Load all patterns. - $config = \Drupal::configFactory()->getEditable('pathauto.pattern'); - $patterns = $config->get('patterns'); - - // 2. Create a configuration entity per pattern. - foreach ($patterns as $entity_type => $entity_patterns) { - if (!array_key_exists($entity_type, $entity_types)) { - // We found an unknown entity type. Report it. - $messages[] = t('Entity of type @type was not processed. It defines the following patterns: @patterns', array( - '@type' => $entity_type, - '@patterns' => print_r($entity_patterns, TRUE), - )); - continue; - } - $entity_label = $entity_types[$entity_type]->getLabel(); - - if (!empty($entity_patterns['default'])) { - // This is a pattern for an entity type, such as "node". - $pattern = PathautoPattern::create([ - 'id' => $entity_type, - 'label' => $entity_label, - 'type' => 'canonical_entities:' . $entity_type, - 'pattern' => $entity_patterns['default'], - 'weight' => 0, - ]); - $pattern->save(); - } - - // Loop over bundles and create patterns if they have a value. - // Bundle keys may have a language suffix for language-dependant patterns. - if (isset($entity_patterns['bundles'])) { - $bundle_info = $entity_bundle_info->getBundleInfo($entity_type); - foreach ($entity_patterns['bundles'] as $bundle => $bundle_patterns) { - if (empty($bundle_patterns['default'])) { - // This bundle does not define a pattern. Move on to the next one. - continue; - } - - if (isset($bundle_info[$bundle])) { - // This is a pattern for a bundle, such as "node_article". - $pattern = PathautoPattern::create([ - 'id' => $entity_type . '_' . $bundle, - 'label' => $entity_label . ' ' . $bundle_info[$bundle]['label'], - 'type' => 'canonical_entities:' . $entity_type, - 'pattern' => $bundle_patterns['default'], - 'weight' => -5, - ]); - - // Add the bundle condition. - $pattern->addSelectionCondition([ - 'id' => 'entity_bundle:' . $entity_type, - 'bundles' => array($bundle => $bundle), - 'negate' => FALSE, - 'context_mapping' => [ $entity_type => $entity_type ], - ]); - - $pattern->save(); - } - else { - // This is either a language dependent pattern such as "article_es" or - // an unknown bundle or langcode. Let's figure it out. - $matches = NULL; - $langcode = NULL; - $extracted_bundle = NULL; - $language = NULL; - preg_match('/^(.*)_([a-z-]*)$/', $bundle, $matches); - if (count($matches) == 3) { - list(, $extracted_bundle, $langcode) = $matches; - $language = $language_manager->getLanguage($langcode); - } - // Validate bundle, langcode and language. - if (!isset($bundle_info[$extracted_bundle]) || ($langcode == NULL) || ($language == NULL)) { - $messages[] = t('Unrecognized entity bundle @entity:@bundle was not processed. It defines the following patterns: @patterns', array( - '@entity' => $entity_type, - '@bundle' => $bundle, - '@patterns' => print_r($entity_patterns, TRUE), - )); - continue; - } - - // This is a pattern for a bundle and a language, such as - // "node_article_es". - $pattern = PathautoPattern::create([ - 'id' => $entity_type . '_' . $extracted_bundle . '_' . str_replace('-', '_', $langcode), - 'label' => $entity_label . ' ' . $bundle_info[$extracted_bundle]['label'] . ' ' . $language->getName(), - 'type' => 'canonical_entities:' . $entity_type, - 'pattern' => $bundle_patterns['default'], - 'weight' => -10, - ]); - - // Add the bundle condition. - $pattern->addSelectionCondition([ - 'id' => 'entity_bundle:' . $entity_type, - 'bundles' => array($extracted_bundle => $extracted_bundle), - 'negate' => FALSE, - 'context_mapping' => [ $entity_type => $entity_type ], - ]); - - // Add the language condition. - $language_mapping = $entity_type . ':' . $entity_type_manager->getDefinition($entity_type)->getKey('langcode') . ':language'; - $pattern->addSelectionCondition([ - 'id' => 'language', - 'langcodes' => [ $langcode => $langcode ], - 'negate' => FALSE, - 'context_mapping' => [ - 'language' => $language_mapping, - ] - ]); - - // Add the context relationship for this language. - $pattern->addRelationship($language_mapping, 'Language'); - - $pattern->save(); - } - } - } - } - - // 3. Delete the old configuration object that stores patterns. - $config->delete(); - - // 4. Print out messages. - if (!empty($messages)) { - return implode('
', $messages); - } -} - -/** - * Update relationship storage. - */ -function pathauto_update_8101() { - foreach (\Drupal::configFactory()->listAll('pathauto.pattern.') as $pattern_config_name) { - $pattern_config = \Drupal::configFactory()->getEditable($pattern_config_name); - - $relationships = []; - foreach ((array) $pattern_config->get('context_definitions') as $context_definition) { - $relationships[$context_definition['id']] = ['label' => $context_definition['label']]; - } - - $pattern_config->clear('context_definitions'); - $pattern_config->set('relationships', $relationships); - $pattern_config->save(); - } -} - -/** - * Update node type conditions from entity_bundle to node_type. - */ -function pathauto_update_8102() { - // Load all pattern configuration entities. - foreach (\Drupal::configFactory()->listAll('pathauto.pattern.') as $pattern_config_name) { - $pattern_config = \Drupal::configFactory()->getEditable($pattern_config_name); - - // Loop patterns and swap the entity_bundle:node plugin by the node_type - // plugin. - if ($pattern_config->get('type') == 'canonical_entities:node') { - $selection_criteria = $pattern_config->get('selection_criteria'); - foreach ($selection_criteria as $uuid => $condition) { - if ($condition['id'] == 'entity_bundle:node') { - $selection_criteria[$uuid]['id'] = 'node_type'; - $pattern_config->set('selection_criteria', $selection_criteria); - $pattern_config->save(); - break; - } - } - } - } -} - -/** - * Fix invalid default value for ignore_words. - */ -function pathauto_update_8103() { - $config_factory = \Drupal::configFactory(); - $config = $config_factory->getEditable('pathauto.settings'); - $ignore_words = $config->get('ignore_words'); - if ($ignore_words === ', in, is,that, the , this, with, ') { - $config->set('ignore_words', 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with')->save(TRUE); - } -} - -/** - * Resave patterns so that lookup keys are updated. - */ -function pathauto_update_8104() { - \Drupal::entityTypeManager()->clearCachedDefinitions(); - // Load all pattern configuration entities and save them, so that the new - // status lookup keys are saved. - foreach (\Drupal::configFactory()->listAll('pathauto.pattern.') as $pattern_config_name) { - $pattern_config = \Drupal::configFactory()->getEditable($pattern_config_name); - $pattern_config->save(); - } -} - -/** - * Ensure the url_alias table exists. - */ -function pathauto_update_8105() { - _pathauto_ensure_url_alias_table_exists(); -} - -/** - * Update default configuration for enabled entity types. - */ -function pathauto_update_8106() { - $config_factory = \Drupal::configFactory(); - $config = $config_factory->getEditable('pathauto.settings'); - $config->set('enabled_entity_types', ['user']); - $config->save(); -} - -/** - * Initialize the new safe tokens setting. - */ -function pathauto_update_8107() { - - $safe_tokens = [ - 'alias', - 'alias', - 'path', - 'join-path', - 'login-url', - 'url', - 'url-brief', - ]; - - \Drupal::configFactory()->getEditable('pathauto.settings') - ->set('safe_tokens', $safe_tokens) - ->save(); -} diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.js b/sites/all/modules/contrib/admin/pathauto/pathauto.js deleted file mode 100644 index 3bdc3d561..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.js +++ /dev/null @@ -1,21 +0,0 @@ -(function ($) { - 'use strict'; - Drupal.behaviors.pathFieldsetSummaries = { - attach: function (context) { - $(context).find('.path-form').drupalSetSummary(function (context) { - var path = $('.js-form-item-path-0-alias input', context).val(); - var automatic = $('.js-form-item-path-0-pathauto input', context).prop('checked'); - - if (automatic) { - return Drupal.t('Automatic alias'); - } - else if (path) { - return Drupal.t('Alias: @alias', {'@alias': path}); - } - else { - return Drupal.t('No alias'); - } - }); - } - }; -})(jQuery); diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml deleted file mode 100644 index ae978aa42..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml +++ /dev/null @@ -1,9 +0,0 @@ -widget: - version: 1.0 - js: - pathauto.js: {} - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - core/drupal.form diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml deleted file mode 100644 index 0afa384db..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.pathauto_pattern.add_form: - route_name: 'entity.pathauto_pattern.add_form' - title: 'Add Pathauto pattern' - appears_on: - - entity.pathauto_pattern.collection diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml deleted file mode 100644 index d6fa0bca5..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml +++ /dev/null @@ -1,23 +0,0 @@ -pathauto.patterns.form: - route_name: entity.pathauto_pattern.collection - base_route: path.admin_overview - title: 'Patterns' - weight: 10 - -pathauto.settings.form: - route_name: pathauto.settings.form - base_route: path.admin_overview - title: 'Settings' - weight: 20 - -pathauto.bulk.update.form: - route_name: pathauto.bulk.update.form - base_route: path.admin_overview - title: 'Bulk generate' - weight: 30 - -pathauto.admin.delete: - route_name: pathauto.admin.delete - base_route: path.admin_overview - title: 'Delete aliases' - weight: 40 diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.module b/sites/all/modules/contrib/admin/pathauto/pathauto.module deleted file mode 100644 index ac7d9b0c0..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.module +++ /dev/null @@ -1,179 +0,0 @@ - 'pathauto')); -} - -/** - * Implements hook_help(). - */ -function pathauto_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'help.page.pathauto': - $output = '

' . t('About') . '

'; - $output .= '

' . t('The Pathauto module provides a mechanism to automate the creation of path aliases. This makes URLs more readable and helps search engines index content more effectively. For more information, see the online documentation for Pathauto.', [':online' => 'https://www.drupal.org/documentation/modules/pathauto']) . '

'; - $output .= '
'; - $output .= '

' . t('Uses') . '

'; - $output .= '
' . t('Pathauto is accessed from the tabs it adds to the list of URL aliases.', [':aliases' => Url::fromRoute('path.admin_overview')->toString()]) . '
'; - $output .= '
' . t('Creating Pathauto Patterns') . '
'; - $output .= '
' . t('The "Patterns" page is used to configure automatic path aliasing. New patterns are created here using the Add Pathauto pattern button which presents a form to simplify pattern creation thru the use of available tokens. The patterns page provides a list of all patterns on the site and allows you to edit and reorder them. An alias is generated for the first pattern that applies.', [':pathauto_pattern' => Url::fromRoute('entity.pathauto_pattern.collection')->toString(), ':add_form' => Url::fromRoute('entity.pathauto_pattern.add_form')->toString()]) . '
'; - $output .= '
' . t('Pathauto Settings') . '
'; - $output .= '
' . t('The "Settings" page is used to customize global Pathauto settings for automated pattern creation.', [':settings' => Url::fromRoute('pathauto.settings.form')->toString()]) . '
'; - $output .= '
' . t('The maximum alias length and maximum component length values default to 100 and have a limit of @max from Pathauto. You should enter a value that is the length of the "alias" column of the url_alias database table minus the length of any strings that might get added to the end of the URL. The recommended and default value is 100.', array('@max' => \Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength())) . '
'; - $output .= '
' . t('Bulk Generation') . '
'; - $output .= '
' . t('The "Bulk Generate" page allows you to create URL aliases for items that currently have no aliases. This is typically used when installing Pathauto on a site that has existing un-aliased content that needs to be aliased in bulk.', [':pathauto_bulk' => Url::fromRoute('pathauto.bulk.update.form')->toString()]) . '
'; - $output .= '
' . t('Delete Aliases') . '
'; - $output .= '
' . t('The "Delete Aliases" page allows you to remove URL aliases from items that have previously been assigned aliases using pathauto.', [':pathauto_delete' => Url::fromRoute('pathauto.admin.delete')->toString()]) . '
'; - $output .= '
'; - return $output; - - case 'entity.pathauto_pattern.collection': - $output = '

' . t('This page provides a list of all patterns on the site and allows you to edit and reorder them.') . '

'; - return $output; - - case 'entity.pathauto_pattern.add_form': - $output = '

' . t('You need to select a pattern type, then a pattern and filter, and a label. Additional types can be enabled on the Settings page.', [':settings' => Url::fromRoute('pathauto.settings.form')->toString()]) . '

'; - return $output; - - case 'pathauto.bulk.update.form': - $output = '

' . t('Bulk generation can be used to generate URL aliases for items that currently have no aliases. This is typically used when installing Pathauto on a site that has existing un-aliased content that needs to be aliased in bulk.') . '
'; - $output .= t('It can also be used to regenerate URL aliases for items that have an old alias and for which the Pathauto pattern has been changed.') . '

'; - $output .= '

' . t('Note that this will only affect items which are configured to have their URL alias automatically set. Items whose URL alias is manually set are not affected.') . '

'; - return $output; - } -} - -/** - * Implements hook_entity_insert(). - */ -function pathauto_entity_insert(EntityInterface $entity) { - \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'insert'); -} - -/** - * Implements hook_entity_update(). - */ -function pathauto_entity_update(EntityInterface $entity) { - \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'update'); -} - -/** - * Implements hook_entity_delete(). - */ -function pathauto_entity_delete(EntityInterface $entity) { - if ($entity->hasLinkTemplate('canonical') && $entity instanceof ContentEntityInterface && $entity->hasField('path')) { - \Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($entity); - $entity->get('path')->first()->get('pathauto')->purge(); - } -} - -/** - * Implements hook_field_info_alter(). - */ -function pathauto_field_info_alter(&$info) { - $info['path']['class'] = PathautoItem::class; - $info['path']['list_class'] = PathautoFieldItemList::class; -} - -/** - * Implements hook_field_widget_info_alter(). - */ -function pathauto_field_widget_info_alter(&$widgets) { - $widgets['path']['class'] = 'Drupal\pathauto\PathautoWidget'; -} - -/** - * Implements hook_entity_base_field_info(). - */ -function pathauto_entity_base_field_info(EntityTypeInterface $entity_type) { - $config = \Drupal::config('pathauto.settings'); - // Verify that the configuration data isn't null (as is the case before the - // module's initialization, in tests), so that in_array() won't fail. - if ($enabled_entity_types = $config->get('enabled_entity_types')) { - if (in_array($entity_type->id(), $enabled_entity_types)) { - $fields['path'] = BaseFieldDefinition::create('path') - ->setCustomStorage(TRUE) - ->setLabel(t('URL alias')) - ->setTranslatable(TRUE) - ->setComputed(TRUE) - ->setDisplayOptions('form', array( - 'type' => 'path', - 'weight' => 30, - )) - ->setDisplayConfigurable('form', TRUE); - - return $fields; - } - } -} - -/** - * Validate the pattern field, to ensure it doesn't contain any characters that - * are invalid in URLs. - */ -function pathauto_pattern_validate($element, FormStateInterface $form_state) { - - if (isset($element['#value'])) { - $title = empty($element['#title']) ? $element['#parents'][0] : $element['#title']; - $invalid_characters = ['#', '?', '&']; - $invalid_characters_used = []; - - foreach ($invalid_characters as $invalid_character) { - if (strpos($element['#value'], $invalid_character) !== FALSE) { - $invalid_characters_used[] = $invalid_character; - } - } - - if (!empty($invalid_characters_used)) { - $form_state->setError($element, t('The %element-title is using the following invalid characters: @invalid-characters.', array('%element-title' => $title, '@invalid-characters' => implode(', ', $invalid_characters_used)))); - } - - if (preg_match('/(\s$)+/', $element['#value'])) { - $form_state->setError($element, t('The %element-title doesn\'t allow the patterns ending with whitespace.', array('%element-title' => $title))); - } - } - - return $element; - -} diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml deleted file mode 100644 index ede9f288c..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml +++ /dev/null @@ -1,6 +0,0 @@ -administer pathauto: - title: 'Administer pathauto' - description: 'Allows a user to configure patterns for automated aliases and bulk delete URL-aliases.' -notify of path changes: - title: 'Notify of Path Changes' - description: 'Determines whether or not users are notified.' diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml deleted file mode 100644 index e55063c5b..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml +++ /dev/null @@ -1,54 +0,0 @@ -entity.pathauto_pattern.collection: - path: '/admin/config/search/path/patterns' - defaults: - _entity_list: 'pathauto_pattern' - _title: 'Patterns' - requirements: - _permission: 'administer pathauto' - -entity.pathauto_pattern.add_form: - path: '/admin/config/search/path/patterns/add' - defaults: - _entity_form: 'pathauto_pattern.default' - _title: 'Add Pathauto pattern' - tempstore_id: 'pathauto.pattern' - requirements: - _permission: 'administer pathauto' - -pathauto.settings.form: - path: '/admin/config/search/path/settings' - defaults: - _form: '\Drupal\pathauto\Form\PathautoSettingsForm' - _title: 'Settings' - requirements: - _permission: 'administer pathauto' - -entity.pathauto_pattern.enable: - path: '/admin/config/search/path/patterns/{pathauto_pattern}/enable' - defaults: - _entity_form: 'pathauto_pattern.enable' - requirements: - _entity_access: 'pathauto_pattern.update' - -entity.pathauto_pattern.disable: - path: '/admin/config/search/path/patterns/{pathauto_pattern}/disable' - defaults: - _entity_form: 'pathauto_pattern.disable' - requirements: - _entity_access: 'pathauto_pattern.update' - -pathauto.bulk.update.form: - path: '/admin/config/search/path/update_bulk' - defaults: - _form: '\Drupal\pathauto\Form\PathautoBulkUpdateForm' - _title: 'Bulk generate' - requirements: - _permission: 'administer url aliases' - -pathauto.admin.delete: - path: '/admin/config/search/path/delete_bulk' - defaults: - _form: '\Drupal\pathauto\Form\PathautoAdminDelete' - _title: 'Delete aliases' - requirements: - _permission: 'administer url aliases' diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.services.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.services.yml deleted file mode 100644 index 8848f7f33..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.services.yml +++ /dev/null @@ -1,26 +0,0 @@ -services: - pathauto.generator: - class: Drupal\pathauto\PathautoGenerator - arguments: ['@config.factory', '@module_handler', '@token', '@pathauto.alias_cleaner', '@pathauto.alias_storage_helper', '@pathauto.alias_uniquifier', '@pathauto.verbose_messenger', '@string_translation', '@token.entity_mapper', '@entity_type.manager'] - pathauto.alias_cleaner: - class: Drupal\pathauto\AliasCleaner - arguments: ['@config.factory', '@pathauto.alias_storage_helper', '@language_manager', '@cache.discovery', '@transliteration', '@module_handler'] - pathauto.alias_storage_helper: - class: Drupal\pathauto\AliasStorageHelper - arguments: ['@config.factory', '@path.alias_storage', '@database','@pathauto.verbose_messenger', '@string_translation'] - tags: - - { name: backend_overridable } - pathauto.alias_uniquifier: - class: Drupal\pathauto\AliasUniquifier - arguments: ['@config.factory', '@pathauto.alias_storage_helper','@module_handler', '@router.route_provider', '@path.alias_manager'] - pathauto.verbose_messenger: - class: Drupal\pathauto\VerboseMessenger - arguments: ['@config.factory', '@current_user', '@messenger'] - plugin.manager.alias_type: - class: Drupal\pathauto\AliasTypeManager - parent: default_plugin_manager - pathauto.settings_cache_tag: - class: Drupal\pathauto\EventSubscriber\PathautoSettingsCacheTag - arguments: ['@entity_field.manager', '@plugin.manager.alias_type'] - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc b/sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc deleted file mode 100644 index 626ff09c5..000000000 --- a/sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc +++ /dev/null @@ -1,49 +0,0 @@ - t('Joined path'), - 'description' => t('The array values each cleaned by Pathauto and then joined with the slash into a string that resembles an URL.'), - ); - - return $info; -} - -/** - * Implements hook_tokens(). - */ -function pathauto_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { - $replacements = array(); - - if ($type == 'array' && !empty($data['array'])) { - $array = $data['array']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'join-path': - $values = array(); - foreach (token_element_children($array) as $key) { - $value = is_array($array[$key]) ? render($array[$key]) : (string) $array[$key]; - $value = \Drupal::service('pathauto.alias_cleaner')->cleanString($value, $options); - $values[] = $value; - } - $replacements[$original] = implode('/', $values); - break; - } - } - } - - return $replacements; -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php b/sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php deleted file mode 100644 index cb8b6d125..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php +++ /dev/null @@ -1,353 +0,0 @@ -configFactory = $config_factory; - $this->aliasStorageHelper = $alias_storage_helper; - $this->languageManager = $language_manager; - $this->cacheBackend = $cache_backend; - $this->transliteration = $transliteration; - $this->moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - public function cleanAlias($alias) { - $config = $this->configFactory->get('pathauto.settings'); - $alias_max_length = min($config->get('max_length'), $this->aliasStorageHelper->getAliasSchemaMaxLength()); - - $output = $alias; - - // Trim duplicate, leading, and trailing separators. Do this before cleaning - // backslashes since a pattern like "[token1]/[token2]-[token3]/[token4]" - // could end up like "value1/-/value2" and if backslashes were cleaned first - // this would result in a duplicate backslash. - $output = $this->getCleanSeparators($output); - - // Trim duplicate, leading, and trailing backslashes. - $output = $this->getCleanSeparators($output, '/'); - - // Shorten to a logical place based on word boundaries. - $output = Unicode::truncate($output, $alias_max_length, TRUE); - - return $output; - } - - /** - * {@inheritdoc} - */ - public function getCleanSeparators($string, $separator = NULL) { - $config = $this->configFactory->get('pathauto.settings'); - - if (!isset($separator)) { - $separator = $config->get('separator'); - } - - $output = $string; - - if (strlen($separator)) { - // Trim any leading or trailing separators. - $output = trim($output, $separator); - - // Escape the separator for use in regular expressions. - $seppattern = preg_quote($separator, '/'); - - // Replace multiple separators with a single one. - $output = preg_replace("/$seppattern+/", $separator, $output); - - // Replace trailing separators around slashes. - if ($separator !== '/') { - $output = preg_replace("/\/+$seppattern\/+|$seppattern\/+|\/+$seppattern/", "/", $output); - } - else { - // If the separator is a slash, we need to re-add the leading slash - // dropped by the trim function. - $output = '/' . $output; - } - } - - return $output; - } - - /** - * {@inheritdoc} - */ - public function cleanString($string, array $options = array()) { - if (empty($this->cleanStringCache)) { - // Generate and cache variables used in this method. - $config = $this->configFactory->get('pathauto.settings'); - $this->cleanStringCache = array( - 'separator' => $config->get('separator'), - 'strings' => array(), - 'transliterate' => $config->get('transliterate'), - 'punctuation' => array(), - 'reduce_ascii' => (bool) $config->get('reduce_ascii'), - 'ignore_words_regex' => FALSE, - 'lowercase' => (bool) $config->get('case'), - 'maxlength' => min($config->get('max_component_length'), $this->aliasStorageHelper->getAliasSchemaMaxLength()), - ); - - // Generate and cache the punctuation replacements for strtr(). - $punctuation = $this->getPunctuationCharacters(); - foreach ($punctuation as $name => $details) { - $action = $config->get('punctuation.' . $name); - switch ($action) { - case PathautoGeneratorInterface::PUNCTUATION_REMOVE: - $this->cleanStringCache['punctuation'][$details['value']] = ''; - break; - - case PathautoGeneratorInterface::PUNCTUATION_REPLACE: - $this->cleanStringCache['punctuation'][$details['value']] = $this->cleanStringCache['separator']; - break; - - case PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING: - // Literally do nothing. - break; - } - } - - // Generate and cache the ignored words regular expression. - $ignore_words = $config->get('ignore_words'); - $ignore_words_regex = preg_replace(array('/^[,\s]+|[,\s]+$/', '/[,\s]+/'), array('', '\b|\b'), $ignore_words); - if ($ignore_words_regex) { - $this->cleanStringCache['ignore_words_regex'] = '\b' . $ignore_words_regex . '\b'; - if (function_exists('mb_eregi_replace')) { - mb_regex_encoding('UTF-8'); - $this->cleanStringCache['ignore_words_callback'] = 'mb_eregi_replace'; - } - else { - $this->cleanStringCache['ignore_words_callback'] = 'preg_replace'; - $this->cleanStringCache['ignore_words_regex'] = '/' . $this->cleanStringCache['ignore_words_regex'] . '/i'; - } - } - } - - // Empty strings do not need any processing. - if ($string === '' || $string === NULL) { - return ''; - } - - $langcode = NULL; - if (!empty($options['language'])) { - $langcode = $options['language']->getId(); - } - elseif (!empty($options['langcode'])) { - $langcode = $options['langcode']; - } - - // Check if the string has already been processed, and if so return the - // cached result. - if (isset($this->cleanStringCache['strings'][$langcode][(string) $string])) { - return $this->cleanStringCache['strings'][$langcode][(string) $string]; - } - - // Remove all HTML tags from the string. - $output = Html::decodeEntities($string); - $output = PlainTextOutput::renderFromHtml($output); - - // Optionally transliterate. - if ($this->cleanStringCache['transliterate']) { - // If the reduce strings to letters and numbers is enabled, don't bother - // replacing unknown characters with a question mark. Use an empty string - // instead. - $output = $this->transliteration->transliterate($output, $langcode, $this->cleanStringCache['reduce_ascii'] ? '' : '?'); - } - - // Replace or drop punctuation based on user settings. - $output = strtr($output, $this->cleanStringCache['punctuation']); - - // Reduce strings to letters and numbers. - if ($this->cleanStringCache['reduce_ascii']) { - $output = preg_replace('/[^a-zA-Z0-9\/]+/', $this->cleanStringCache['separator'], $output); - } - - // Get rid of words that are on the ignore list. - if ($this->cleanStringCache['ignore_words_regex']) { - $words_removed = $this->cleanStringCache['ignore_words_callback']($this->cleanStringCache['ignore_words_regex'], '', $output); - if (mb_strlen(trim($words_removed)) > 0) { - $output = $words_removed; - } - } - - // Always replace whitespace with the separator. - $output = preg_replace('/\s+/', $this->cleanStringCache['separator'], $output); - - // Trim duplicates and remove trailing and leading separators. - $output = $this->getCleanSeparators($this->getCleanSeparators($output, $this->cleanStringCache['separator'])); - - // Optionally convert to lower case. - if ($this->cleanStringCache['lowercase']) { - $output = mb_strtolower($output); - } - - // Shorten to a logical place based on word boundaries. - $output = Unicode::truncate($output, $this->cleanStringCache['maxlength'], TRUE); - - // Cache this result in the static array. - $this->cleanStringCache['strings'][$langcode][(string) $string] = $output; - - return $output; - } - - - /** - * {@inheritdoc} - */ - public function getPunctuationCharacters() { - if (empty($this->punctuationCharacters)) { - $langcode = $this->languageManager->getCurrentLanguage()->getId(); - - $cid = 'pathauto:punctuation:' . $langcode; - if ($cache = $this->cacheBackend->get($cid)) { - $this->punctuationCharacters = $cache->data; - } - else { - $punctuation = array(); - $punctuation['double_quotes'] = array('value' => '"', 'name' => t('Double quotation marks')); - $punctuation['quotes'] = array('value' => '\'', 'name' => t("Single quotation marks (apostrophe)")); - $punctuation['backtick'] = array('value' => '`', 'name' => t('Back tick')); - $punctuation['comma'] = array('value' => ',', 'name' => t('Comma')); - $punctuation['period'] = array('value' => '.', 'name' => t('Period')); - $punctuation['hyphen'] = array('value' => '-', 'name' => t('Hyphen')); - $punctuation['underscore'] = array('value' => '_', 'name' => t('Underscore')); - $punctuation['colon'] = array('value' => ':', 'name' => t('Colon')); - $punctuation['semicolon'] = array('value' => ';', 'name' => t('Semicolon')); - $punctuation['pipe'] = array('value' => '|', 'name' => t('Vertical bar (pipe)')); - $punctuation['left_curly'] = array('value' => '{', 'name' => t('Left curly bracket')); - $punctuation['left_square'] = array('value' => '[', 'name' => t('Left square bracket')); - $punctuation['right_curly'] = array('value' => '}', 'name' => t('Right curly bracket')); - $punctuation['right_square'] = array('value' => ']', 'name' => t('Right square bracket')); - $punctuation['plus'] = array('value' => '+', 'name' => t('Plus sign')); - $punctuation['equal'] = array('value' => '=', 'name' => t('Equal sign')); - $punctuation['asterisk'] = array('value' => '*', 'name' => t('Asterisk')); - $punctuation['ampersand'] = array('value' => '&', 'name' => t('Ampersand')); - $punctuation['percent'] = array('value' => '%', 'name' => t('Percent sign')); - $punctuation['caret'] = array('value' => '^', 'name' => t('Caret')); - $punctuation['dollar'] = array('value' => '$', 'name' => t('Dollar sign')); - $punctuation['hash'] = array('value' => '#', 'name' => t('Number sign (pound sign, hash)')); - $punctuation['at'] = array('value' => '@', 'name' => t('At sign')); - $punctuation['exclamation'] = array('value' => '!', 'name' => t('Exclamation mark')); - $punctuation['tilde'] = array('value' => '~', 'name' => t('Tilde')); - $punctuation['left_parenthesis'] = array('value' => '(', 'name' => t('Left parenthesis')); - $punctuation['right_parenthesis'] = array('value' => ')', 'name' => t('Right parenthesis')); - $punctuation['question_mark'] = array('value' => '?', 'name' => t('Question mark')); - $punctuation['less_than'] = array('value' => '<', 'name' => t('Less-than sign')); - $punctuation['greater_than'] = array('value' => '>', 'name' => t('Greater-than sign')); - $punctuation['slash'] = array('value' => '/', 'name' => t('Slash')); - $punctuation['back_slash'] = array('value' => '\\', 'name' => t('Backslash')); - - // Allow modules to alter the punctuation list and cache the result. - $this->moduleHandler->alter('pathauto_punctuation_chars', $punctuation); - $this->cacheBackend->set($cid, $punctuation); - $this->punctuationCharacters = $punctuation; - } - } - - return $this->punctuationCharacters; - } - - /** - * {@inheritdoc} - */ - public function cleanTokenValues(&$replacements, $data = array(), $options = array()) { - foreach ($replacements as $token => $value) { - // Only clean non-path tokens. - $config = $this->configFactory->get('pathauto.settings'); - $safe_tokens = implode('|', (array) $config->get('safe_tokens')); - if (!preg_match('/:(' . $safe_tokens . ')(:|\]$)/', $token)) { - $replacements[$token] = $this->cleanString($value, $options); - } - } - } - - /** - * {@inheritdoc} - */ - public function resetCaches() { - $this->cleanStringCache = array(); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php b/sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php deleted file mode 100644 index 95d2920f7..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php +++ /dev/null @@ -1,103 +0,0 @@ -configFactory = $config_factory; - $this->aliasStorage = $alias_storage; - $this->database = $database; - $this->messenger = $messenger; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public function getAliasSchemaMaxLength() { - return $this->aliasSchemaMaxLength; - } - - /** - * {@inheritdoc} - */ - public function save(array $path, $existing_alias = NULL, $op = NULL) { - $config = $this->configFactory->get('pathauto.settings'); - - // Alert users if they are trying to create an alias that is the same as the - // internal path. - if ($path['source'] == $path['alias']) { - $this->messenger->addMessage($this->t('Ignoring alias %alias because it is the same as the internal path.', array('%alias' => $path['alias']))); - return NULL; - } - - // Skip replacing the current alias with an identical alias. - if (empty($existing_alias) || $existing_alias['alias'] != $path['alias']) { - $path += array( - 'pathauto' => TRUE, - 'original' => $existing_alias, - 'pid' => NULL, - ); - - // If there is already an alias, respect some update actions. - if (!empty($existing_alias)) { - switch ($config->get('update_action')) { - case PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW: - // Do not create the alias. - return NULL; - - case PathautoGeneratorInterface::UPDATE_ACTION_LEAVE: - // Create a new alias instead of overwriting the existing by leaving - // $path['pid'] empty. - break; - - case PathautoGeneratorInterface::UPDATE_ACTION_DELETE: - // The delete actions should overwrite the existing alias. - $path['pid'] = $existing_alias['pid']; - break; - } - } - - // Save the path array. - $this->aliasStorage->save($path['source'], $path['alias'], $path['language'], $path['pid']); - - if (!empty($existing_alias['pid'])) { - $this->messenger->addMessage($this->t( - 'Created new alias %alias for %source, replacing %old_alias.', - array( - '%alias' => $path['alias'], - '%source' => $path['source'], - '%old_alias' => $existing_alias['alias'], - ) - ) - ); - } - else { - $this->messenger->addMessage($this->t('Created new alias %alias for %source.', array( - '%alias' => $path['alias'], - '%source' => $path['source'], - ))); - } - - return $path; - } - } - - /** - * {@inheritdoc} - */ - public function loadBySource($source, $language = LanguageInterface::LANGCODE_NOT_SPECIFIED) { - $alias = $this->aliasStorage->load([ - 'source' => $source, - 'langcode' => $language, - ]); - // If no alias was fetched and if a language was specified, fallbacks to - // undefined language. - if (!$alias && ($language !== LanguageInterface::LANGCODE_NOT_SPECIFIED)) { - $alias = $this->aliasStorage->load([ - 'source' => $source, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ]); - } - return $alias; - } - - /** - * {@inheritdoc} - */ - public function deleteBySourcePrefix($source) { - $pids = $this->loadBySourcePrefix($source); - if ($pids) { - $this->deleteMultiple($pids); - } - } - - /** - * {@inheritdoc} - */ - public function deleteAll() { - $this->database->truncate('url_alias')->execute(); - } - - /** - * {@inheritdoc} - */ - public function deleteEntityPathAll(EntityInterface $entity, $default_uri = NULL) { - $this->deleteBySourcePrefix('/' . $entity->toUrl('canonical')->getInternalPath()); - if (isset($default_uri) && $entity->toUrl('canonical')->toString() != $default_uri) { - $this->deleteBySourcePrefix($default_uri); - } - } - - /** - * {@inheritdoc} - */ - public function loadBySourcePrefix($source) { - $select = $this->database->select('url_alias', 'u') - ->fields('u', array('pid')); - - $or_group = $select->orConditionGroup() - ->condition('source', $source) - ->condition('source', rtrim($source, '/') . '/%', 'LIKE'); - - return $select - ->condition($or_group) - ->execute() - ->fetchCol(); - } - - /** - * {@inheritdoc} - */ - public function countBySourcePrefix($source) { - $select = $this->database->select('url_alias', 'u') - ->fields('u', array('pid')); - - $or_group = $select->orConditionGroup() - ->condition('source', $source) - ->condition('source', rtrim($source, '/') . '/%', 'LIKE'); - - return $select - ->condition($or_group) - ->countQuery() - ->execute() - ->fetchField(); - } - - /** - * {@inheritdoc} - */ - public function countAll() { - return $this->database->select('url_alias') - ->countQuery() - ->execute() - ->fetchField(); - } - - /** - * Delete multiple URL aliases. - * - * Intent of this is to abstract a potential path_delete_multiple() function - * for Drupal 7 or 8. - * - * @param int[] $pids - * An array of path IDs to delete. - */ - public function deleteMultiple($pids) { - foreach ($pids as $pid) { - $this->aliasStorage->delete(array('pid' => $pid)); - } - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php b/sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php deleted file mode 100644 index 9b3b2bd86..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php +++ /dev/null @@ -1,117 +0,0 @@ -alterInfo('pathauto_alias_types'); - $this->setCacheBackend($cache_backend, 'pathauto_alias_types'); - } - - /** - * Returns plugin definitions that support a given token type. - * - * @param string $type - * The type of token plugin must support to be useful. - * - * @return array - * Plugin definitions. - */ - public function getPluginDefinitionByType($type) { - $definitions = array_filter($this->getDefinitions(), function ($definition) use ($type) { - if (!empty($definition['types']) && in_array($type, $definition['types'])) { - return TRUE; - } - return FALSE; - }); - return $definitions; - } - - /** - * {@inheritdoc} - */ - public function getFallbackPluginId($plugin_id, array $configuration = array()) { - return 'broken'; - } - - /** - * Gets the definition of all visible plugins for this type. - * - * @return array - * An array of plugin definitions (empty array if no definitions were - * found). Keys are plugin IDs. - */ - public function getVisibleDefinitions() { - $definitions = $this->getDefinitions(); - unset($definitions['broken']); - return $definitions; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php b/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php deleted file mode 100644 index 70784e6f4..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php +++ /dev/null @@ -1,169 +0,0 @@ -configFactory = $config_factory; - $this->aliasStorageHelper = $alias_storage_helper; - $this->moduleHandler = $module_handler; - $this->routeProvider = $route_provider; - $this->aliasManager = $alias_manager; - } - - /** - * {@inheritdoc} - */ - public function uniquify(&$alias, $source, $langcode) { - $config = $this->configFactory->get('pathauto.settings'); - - if (!$this->isReserved($alias, $source, $langcode)) { - return; - } - - // If the alias already exists, generate a new, hopefully unique, variant. - $maxlength = min($config->get('max_length'), $this->aliasStorageHelper->getAliasSchemaMaxlength()); - $separator = $config->get('separator'); - $original_alias = $alias; - - $i = 0; - do { - // Append an incrementing numeric suffix until we find a unique alias. - $unique_suffix = $separator . $i; - $alias = Unicode::truncate($original_alias, $maxlength - Unicode::strlen($unique_suffix), TRUE) . $unique_suffix; - $i++; - } while ($this->isReserved($alias, $source, $langcode)); - } - - /** - * {@inheritdoc} - */ - public function isReserved($alias, $source, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED) { - // Check if this alias already exists. - if ($existing_source = $this->aliasManager->getPathByAlias($alias, $langcode)) { - if ($existing_source != $alias) { - // If it is an alias for the provided source, it is allowed to keep using - // it. If not, then it is reserved. - return $existing_source != $source; - } - - } - - // Then check if there is a route with the same path. - if ($this->isRoute($alias)) { - return TRUE; - } - // Finally check if any other modules have reserved the alias. - $args = array( - $alias, - $source, - $langcode, - ); - $implementations = $this->moduleHandler->getImplementations('pathauto_is_alias_reserved'); - foreach ($implementations as $module) { - - $result = $this->moduleHandler->invoke($module, 'pathauto_is_alias_reserved', $args); - - if (!empty($result)) { - // As soon as the first module says that an alias is in fact reserved, - // then there is no point in checking the rest of the modules. - return TRUE; - } - } - - return FALSE; - } - - /** - * Verify if the given path is a valid route. - * - * @param string $path - * A string containing a relative path. - * - * @return bool - * TRUE if the path already exists. - * - * @throws \InvalidArgumentException - */ - public function isRoute($path) { - if (is_file(DRUPAL_ROOT . '/' . $path) || is_dir(DRUPAL_ROOT . '/' . $path)) { - // Do not allow existing files or directories to get assigned an automatic - // alias. Note that we do not need to use is_link() to check for symbolic - // links since this returns TRUE for either is_file() or is_dir() already. - return TRUE; - } - - $routes = $this->routeProvider->getRoutesByPattern($path); - - // Only return true for an exact match, ignore placeholders. - foreach ($routes as $route) { - if ($route->getPath() == $path) { - return TRUE; - } - } - - return FALSE; - - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php b/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php deleted file mode 100644 index 89649eab3..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php +++ /dev/null @@ -1,43 +0,0 @@ -getSelectionConditions() as $id => $condition) { - $criteria[$id] = $condition->getConfiguration(); - } - $this->selection_criteria = $criteria; - - // Invalidate the static caches. - \Drupal::service('pathauto.generator')->resetCaches(); - } - - /** - * {@inheritdoc} - */ - public static function postDelete(EntityStorageInterface $storage, array $entities) { - parent::postDelete($storage, $entities); - // Invalidate the static caches. - \Drupal::service('pathauto.generator')->resetCaches(); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - parent::calculateDependencies(); - - $this->calculatePluginDependencies($this->getAliasType()); - - foreach ($this->getSelectionConditions() as $instance) { - $this->calculatePluginDependencies($instance); - } - - return $this->getDependencies(); - } - - /** - * {@inheritdoc} - */ - public function getPattern() { - return $this->pattern; - } - - /** - * {@inheritdoc} - */ - public function setPattern($pattern) { - $this->pattern = $pattern; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getType() { - return $this->type; - } - - /** - * {@inheritdoc} - */ - public function getAliasType() { - if (!$this->aliasTypeCollection) { - $this->aliasTypeCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.alias_type'), $this->getType(), ['default' => $this->getPattern()]); - } - return $this->aliasTypeCollection->get($this->getType()); - } - - /** - * {@inheritdoc} - */ - public function getWeight() { - return $this->weight; - } - - /** - * {@inheritdoc} - */ - public function setWeight($weight) { - $this->weight = $weight; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getContexts() { - $contexts = $this->getAliasType()->getContexts(); - foreach ($this->getRelationships() as $token => $definition) { - /** @var \Drupal\ctools\TypedDataResolver $resolver */ - $resolver = \Drupal::service('ctools.typed_data.resolver'); - $context = $resolver->convertTokenToContext($token, $contexts); - $context_definition = $context->getContextDefinition(); - if (!empty($definition['label'])) { - $context_definition->setLabel($definition['label']); - } - $contexts[$token] = $context; - } - return $contexts; - } - - /** - * {@inheritdoc} - */ - public function hasRelationship($token) { - return isset($this->relationships[$token]); - } - - /** - * {@inheritdoc} - */ - public function addRelationship($token, $label = NULL) { - if (!$this->hasRelationship($token)) { - $this->relationships[$token] = [ - 'label' => $label, - ]; - } - return $this; - } - - /** - * {@inheritdoc} - */ - public function replaceRelationship($token, $label) { - if ($this->hasRelationship($token)) { - $this->relationships[$token] = [ - 'label' => $label, - ]; - } - return $this; - } - - /** - * {@inheritdoc} - */ - public function removeRelationship($token) { - unset($this->relationships[$token]); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getRelationships() { - return $this->relationships; - } - - /** - * {@inheritdoc} - */ - public function getSelectionConditions() { - if (!$this->selectionConditionCollection) { - $this->selectionConditionCollection = new ConditionPluginCollection(\Drupal::service('plugin.manager.condition'), $this->get('selection_criteria')); - } - return $this->selectionConditionCollection; - } - - /** - * {@inheritdoc} - */ - public function addSelectionCondition(array $configuration) { - $configuration['uuid'] = $this->uuidGenerator()->generate(); - $this->getSelectionConditions()->addInstanceId($configuration['uuid'], $configuration); - return $configuration['uuid']; - } - - /** - * {@inheritdoc} - */ - public function getSelectionCondition($condition_id) { - return $this->getSelectionConditions()->get($condition_id); - } - - /** - * {@inheritdoc} - */ - public function removeSelectionCondition($condition_id) { - $this->getSelectionConditions()->removeInstanceId($condition_id); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getSelectionLogic() { - return $this->selection_logic; - } - - /** - * {@inheritdoc} - */ - public function applies($object) { - if ($this->getAliasType()->applies($object)) { - $definitions = $this->getAliasType()->getContextDefinitions(); - if (count($definitions) > 1) { - throw new \Exception("Alias types do not support more than one context."); - } - $keys = array_keys($definitions); - // Set the context object on our Alias plugin before retrieving contexts. - $this->getAliasType()->setContextValue($keys[0], $object); - /** @var \Drupal\Core\Plugin\Context\ContextInterface[] $base_contexts */ - $contexts = $this->getContexts(); - /** @var \Drupal\Core\Plugin\Context\ContextHandler $context_handler */ - $context_handler = \Drupal::service('context.handler'); - $conditions = $this->getSelectionConditions(); - foreach ($conditions as $condition) { - - // As the context object is kept and only the value is switched out, - // it can over time grow to a huge number of cache contexts. Reset it - // if there are 100 cache tags to prevent cache tag merging getting too - // slow. - foreach ($condition->getContextDefinitions() as $name => $context_definition) { - if (count($condition->getContext($name)->getCacheTags()) > 100) { - $condition->setContext($name, new Context($context_definition)); - } - } - - if ($condition instanceof ContextAwarePluginInterface) { - try { - $context_handler->applyContextMapping($condition, $contexts); - } - catch (ContextException $e) { - watchdog_exception('pathauto', $e); - return FALSE; - } - } - $result = $condition->execute(); - if ($this->getSelectionLogic() == 'and' && !$result) { - return FALSE; - } - elseif ($this->getSelectionLogic() == 'or' && $result) { - return TRUE; - } - } - return TRUE; - } - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php b/sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php deleted file mode 100644 index 698d76b75..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php +++ /dev/null @@ -1,68 +0,0 @@ -entityFieldManager = $entity_field_manager; - $this->aliasTypeManager = $alias_type_manager; - } - - /** - * Invalidate the 'rendered' cache tag whenever the settings are modified. - * - * @param \Drupal\Core\Config\ConfigCrudEvent $event - * The Event to process. - */ - public function onSave(ConfigCrudEvent $event) { - if ($event->getConfig()->getName() === 'pathauto.settings') { - $config = $event->getConfig(); - $original_entity_types = $config->getOriginal('enabled_entity_types'); - - // Clear cached field definitions if the values are changed. - if ($original_entity_types != $config->get('enabled_entity_types')) { - $this->entityFieldManager->clearCachedFieldDefinitions(); - $this->aliasTypeManager->clearCachedDefinitions(); - } - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events[ConfigEvents::SAVE][] = ['onSave']; - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php deleted file mode 100644 index 277c30700..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php +++ /dev/null @@ -1,193 +0,0 @@ -aliasTypeManager = $alias_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.alias_type') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'pathauto_admin_delete'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form['delete'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Choose aliases to delete'), - '#tree' => TRUE, - ]; - - // First we do the "all" case. - $storage_helper = \Drupal::service('pathauto.alias_storage_helper'); - $total_count = $storage_helper->countAll(); - $form['delete']['all_aliases'] = [ - '#type' => 'checkbox', - '#title' => $this->t('All aliases'), - '#default_value' => FALSE, - '#description' => $this->t('Delete all aliases. Number of aliases which will be deleted: %count.', ['%count' => $total_count]), - ]; - - // Next, iterate over all visible alias types. - $definitions = $this->aliasTypeManager->getVisibleDefinitions(); - - foreach ($definitions as $id => $definition) { - /** @var \Drupal\pathauto\AliasTypeInterface $alias_type */ - $alias_type = $this->aliasTypeManager->createInstance($id); - $count = $storage_helper->countBySourcePrefix($alias_type->getSourcePrefix()); - $form['delete']['plugins'][$id] = [ - '#type' => 'checkbox', - '#title' => (string) $definition['label'], - '#default_value' => FALSE, - '#description' => $this->t('Delete aliases for all @label. Number of aliases which will be deleted: %count.', ['@label' => (string) $definition['label'], '%count' => $count]), - ]; - } - - $form['options'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Delete options'), - '#tree' => TRUE, - ]; - - // Provide checkbox for not deleting custom aliases. - $form['options']['keep_custom_aliases'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Only delete automatically generated aliases'), - '#default_value' => TRUE, - '#description' => $this->t('When checked, aliases which have been manually set are not affected by this mass-deletion.'), - ]; - - // Warn them and give a button that shows we mean business. - $form['warning'] = ['#value' => '

' . $this->t('Note: there is no confirmation. Be sure of your action before clicking the "Delete aliases now!" button.
You may want to make a backup of the database and/or the url_alias table prior to using this feature.') . '

']; - $form['buttons']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Delete aliases now!'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $delete_all = $form_state->getValue(['delete', 'all_aliases']); - // Keeping custom aliases forces us to go the slow way to correctly check - // the automatic/manual flag. - if ($form_state->getValue(['options', 'keep_custom_aliases'])) { - $batch = [ - 'title' => $this->t('Bulk deleting URL aliases'), - 'operations' => [['Drupal\pathauto\Form\PathautoAdminDelete::batchStart', [$delete_all]]], - 'finished' => 'Drupal\pathauto\Form\PathautoAdminDelete::batchFinished', - ]; - - if ($delete_all) { - foreach (array_keys($form_state->getValue(['delete', 'plugins'])) as $id) { - $batch['operations'][] = ['Drupal\pathauto\Form\PathautoAdminDelete::batchProcess', [$id]]; - } - } - else { - foreach (array_keys(array_filter($form_state->getValue(['delete', 'plugins']))) as $id) { - $batch['operations'][] = ['Drupal\pathauto\Form\PathautoAdminDelete::batchProcess', [$id]]; - } - } - - batch_set($batch); - } - else if ($delete_all) { - \Drupal::service('pathauto.alias_storage_helper')->deleteAll(); - $this->messenger()->addMessage($this->t('All of your path aliases have been deleted.')); - } - else { - $storage_helper = \Drupal::service('pathauto.alias_storage_helper'); - foreach (array_keys(array_filter($form_state->getValue(['delete', 'plugins']))) as $id) { - $alias_type = $this->aliasTypeManager->createInstance($id); - $storage_helper->deleteBySourcePrefix((string) $alias_type->getSourcePrefix()); - $this->messenger()->addMessage($this->t('All of your %label path aliases have been deleted.', ['%label' => $alias_type->getLabel()])); - } - } - } - - /** - * Batch callback; record if aliases of all types must be deleted. - */ - public static function batchStart($delete_all, &$context) { - $context['results']['delete_all'] = $delete_all; - $context['results']['deletions'] = []; - } - - /** - * Common batch processing callback for all operations. - */ - public static function batchProcess($id, &$context) { - /** @var \Drupal\pathauto\AliasTypeBatchUpdateInterface $alias_type */ - $alias_type = \Drupal::service('plugin.manager.alias_type')->createInstance($id); - $alias_type->batchDelete($context); - } - - /** - * Batch finished callback. - */ - public static function batchFinished($success, $results, $operations) { - if ($success) { - if ($results['delete_all']) { - \Drupal::service('messenger') - ->addMessage(t('All of your automatically generated path aliases have been deleted.')); - } - else if (isset($results['deletions'])) { - foreach (array_values($results['deletions']) as $label) { - \Drupal::service('messenger') - ->addMessage(t('All of your automatically generated %label path aliases have been deleted.', [ - '%label' => $label, - ])); - } - } - } - else { - $error_operation = reset($operations); - \Drupal::service('messenger') - ->addMessage(t('An error occurred while processing @operation with arguments : @args', [ - '@operation' => $error_operation[0], - '@args' => print_r($error_operation[0]), - ])); - } - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php deleted file mode 100644 index 67a026652..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php +++ /dev/null @@ -1,170 +0,0 @@ -aliasTypeManager = $alias_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.alias_type') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'pathauto_bulk_update_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $form = array(); - - $form['#update_callbacks'] = array(); - - $form['update'] = array( - '#type' => 'checkboxes', - '#title' => $this->t('Select the types of paths for which to generate URL aliases'), - '#options' => array(), - '#default_value' => array(), - ); - - $definitions = $this->aliasTypeManager->getVisibleDefinitions(); - - foreach ($definitions as $id => $definition) { - $alias_type = $this->aliasTypeManager->createInstance($id); - if ($alias_type instanceof AliasTypeBatchUpdateInterface) { - $form['update']['#options'][$id] = $alias_type->getLabel(); - } - } - - $form['action'] = array( - '#type' => 'radios', - '#title' => $this->t('Select which URL aliases to generate'), - '#options' => ['create' => $this->t('Generate a URL alias for un-aliased paths only')], - '#default_value' => 'create', - ); - - $config = $this->config('pathauto.settings'); - - if ($config->get('update_action') == PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW) { - // Existing aliases should not be updated. - $form['warning'] = array( - '#markup' => $this->t('Pathauto settings are set to ignore paths which already have a URL alias. You can only create URL aliases for paths having none.', [':url' => Url::fromRoute('pathauto.settings.form')->toString()]), - ); - } - else { - $form['action']['#options']['update'] = $this->t('Update the URL alias for paths having an old URL alias'); - $form['action']['#options']['all'] = $this->t('Regenerate URL aliases for all paths'); - } - - $form['actions']['#type'] = 'actions'; - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => $this->t('Update'), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $batch = array( - 'title' => $this->t('Bulk updating URL aliases'), - 'operations' => array( - array('Drupal\pathauto\Form\PathautoBulkUpdateForm::batchStart', array()), - ), - 'finished' => 'Drupal\pathauto\Form\PathautoBulkUpdateForm::batchFinished', - ); - - $action = $form_state->getValue('action'); - - foreach ($form_state->getValue('update') as $id) { - if (!empty($id)) { - $batch['operations'][] = array('Drupal\pathauto\Form\PathautoBulkUpdateForm::batchProcess', [$id, $action]); - } - } - - batch_set($batch); - } - - /** - * Batch callback; initialize the number of updated aliases. - */ - public static function batchStart(&$context) { - $context['results']['updates'] = 0; - } - - /** - * Common batch processing callback for all operations. - * - * Required to load our include the proper batch file. - */ - public static function batchProcess($id, $action, &$context) { - /** @var \Drupal\pathauto\AliasTypeBatchUpdateInterface $alias_type */ - $alias_type = \Drupal::service('plugin.manager.alias_type')->createInstance($id); - $alias_type->batchUpdate($action, $context); - } - - /** - * Batch finished callback. - */ - public static function batchFinished($success, $results, $operations) { - if ($success) { - if ($results['updates']) { - \Drupal::service('messenger')->addMessage(\Drupal::translation() - ->formatPlural($results['updates'], 'Generated 1 URL alias.', 'Generated @count URL aliases.')); - } - else { - \Drupal::service('messenger') - ->addMessage(t('No new URL aliases to generate.')); - } - } - else { - $error_operation = reset($operations); - \Drupal::service('messenger') - ->addMessage(t('An error occurred while processing @operation with arguments : @args'), [ - '@operation' => $error_operation[0], - '@args' => print_r($error_operation[0]), - ]); - } - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php deleted file mode 100644 index 64a7f6053..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php +++ /dev/null @@ -1,273 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityFieldManager = $entity_field_manager; - $this->aliasTypeManager = $alias_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('entity_type.manager'), - $container->get('entity_field.manager'), - $container->get('plugin.manager.alias_type') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'pathauto_settings_form'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['pathauto.settings']; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('pathauto.settings'); - - $form['enabled_entity_types'] = [ - '#type' => 'details', - '#open' => TRUE, - '#title' => $this->t('Enabled entity types'), - '#description' => $this->t('Enable to add a path field and allow to define alias patterns for the given type. Disabled types already define a path field themselves or currently have a pattern.'), - '#tree' => TRUE, - ]; - - // Get all applicable entity types. - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - // Disable a checkbox if it already exists and if the entity type has - // patterns currently defined or if it isn't defined by us. - $patterns_count = \Drupal::entityQuery('pathauto_pattern') - ->condition('type', 'canonical_entities:' . $entity_type_id) - ->count() - ->execute(); - - if (is_subclass_of($entity_type->getClass(), FieldableEntityInterface::class) && $entity_type->hasLinkTemplate('canonical')) { - $field_definitions = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id); - $form['enabled_entity_types'][$entity_type_id] = [ - '#type' => 'checkbox', - '#title' => $entity_type->getLabel(), - '#default_value' => isset($field_definitions['path']) || in_array($entity_type_id, $config->get('enabled_entity_types')), - '#disabled' => isset($field_definitions['path']) && ($field_definitions['path']->getProvider() != 'pathauto' || $patterns_count), - ]; - } - } - - $form['verbose'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Verbose'), - '#default_value' => $config->get('verbose'), - '#description' => $this->t('Display alias changes (except during bulk updates).'), - ); - - $form['separator'] = array( - '#type' => 'textfield', - '#title' => $this->t('Separator'), - '#size' => 1, - '#maxlength' => 1, - '#default_value' => $config->get('separator'), - '#description' => $this->t('Character used to separate words in titles. This will replace any spaces and punctuation characters. Using a space or + character can cause unexpected results.'), - ); - - $form['case'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Character case'), - '#default_value' => $config->get('case'), - '#description' => $this->t('Convert token values to lowercase.'), - ); - - $max_length = \Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength(); - - $help_link = ''; - if (\Drupal::moduleHandler()->moduleExists('help')) { - $help_link = ' ' . $this->t('See Pathauto help for details.', [':pathauto-help' => Url::fromRoute('help.page', ['name' => 'pathauto'])->toString()]); - } - - $form['max_length'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum alias length'), - '#size' => 3, - '#maxlength' => 3, - '#default_value' => $config->get('max_length'), - '#min' => 1, - '#max' => $max_length, - '#description' => $this->t('Maximum length of aliases to generate. 100 is the recommended length. @max is the maximum possible length.', array('@max' => $max_length)) . $help_link, - ); - - $form['max_component_length'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum component length'), - '#size' => 3, - '#maxlength' => 3, - '#default_value' => $config->get('max_component_length'), - '#min' => 1, - '#max' => $max_length, - '#description' => $this->t('Maximum text length of any component in the alias (e.g., [title]). 100 is the recommended length. @max is the maximum possible length.', ['@max' => $max_length]) . $help_link, - ); - - $description = $this->t('What should Pathauto do when updating an existing content item which already has an alias?'); - if (\Drupal::moduleHandler()->moduleExists('redirect')) { - $description .= ' ' . $this->t('The Redirect module settings affect whether a redirect is created when an alias is deleted.', array(':url' => Url::fromRoute('redirect.settings')->toString())); - } - else { - $description .= ' ' . $this->t('Considering installing the Redirect module to get redirects when your aliases change.', array(':url' => 'http://drupal.org/project/redirect')); - } - - $form['update_action'] = array( - '#type' => 'radios', - '#title' => $this->t('Update action'), - '#default_value' => $config->get('update_action'), - '#options' => array( - PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW => $this->t('Do nothing. Leave the old alias intact.'), - PathautoGeneratorInterface::UPDATE_ACTION_LEAVE => $this->t('Create a new alias. Leave the existing alias functioning.'), - PathautoGeneratorInterface::UPDATE_ACTION_DELETE => $this->t('Create a new alias. Delete the old alias.'), - ), - '#description' => $description, - ); - - $form['transliterate'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Transliterate prior to creating alias'), - '#default_value' => $config->get('transliterate'), - '#description' => $this->t('When a pattern includes certain characters (such as those with accents) should Pathauto attempt to transliterate them into the US-ASCII alphabet?'), - ); - - $form['reduce_ascii'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Reduce strings to letters and numbers'), - '#default_value' => $config->get('reduce_ascii'), - '#description' => $this->t('Filters the new alias to only letters and numbers found in the ASCII-96 set.'), - ); - - $form['ignore_words'] = array( - '#type' => 'textarea', - '#title' => $this->t('Strings to Remove'), - '#default_value' => $config->get('ignore_words'), - '#description' => $this->t('Words to strip out of the URL alias, separated by commas. Do not use this to remove punctuation.'), - ); - - $form['safe_tokens'] = array( - '#type' => 'textarea', - '#title' => $this->t('Safe tokens'), - '#default_value' => implode(', ', $config->get('safe_tokens')), - '#description' => $this->t('List of tokens that are safe to use in alias patterns and do not need to be cleaned. For example urls, aliases, machine names. Separated with a comma.'), - ); - - $form['punctuation'] = array( - '#type' => 'details', - '#title' => $this->t('Punctuation'), - '#open' => FALSE, - '#tree' => TRUE, - ); - - $punctuation = \Drupal::service('pathauto.alias_cleaner')->getPunctuationCharacters(); - - foreach ($punctuation as $name => $details) { - // Use the value from config if it exists. - if ($config->get('punctuation.' . $name) !== NULL) { - $details['default'] = $config->get('punctuation.' . $name); - } - else { - // Otherwise use the correct default. - $details['default'] = $details['value'] == $config->get('separator') ? PathautoGeneratorInterface::PUNCTUATION_REPLACE : PathautoGeneratorInterface::PUNCTUATION_REMOVE; - } - $form['punctuation'][$name] = array( - '#type' => 'select', - '#title' => $details['name'] . ' (' . Html::escape($details['value']) . ')', - '#default_value' => $details['default'], - '#options' => array( - PathautoGeneratorInterface::PUNCTUATION_REMOVE => $this->t('Remove'), - PathautoGeneratorInterface::PUNCTUATION_REPLACE => $this->t('Replace by separator'), - PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING => $this->t('No action (do not replace)'), - ), - ); - } - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - $config = $this->config('pathauto.settings'); - - $form_state->cleanValues(); - - foreach ($form_state->getValues() as $key => $value) { - if ($key == 'enabled_entity_types') { - $enabled_entity_types = []; - foreach ($value as $entity_type_id => $enabled) { - $field_definitions = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id); - // Verify that the entity type is enabled and that it is not defined - // or defined by us before adding it to the configuration, so that - // we do not store an entity type that cannot be enabled or disabled. - if ($enabled && (!isset($field_definitions['path']) || ($field_definitions['path']->getProvider() === 'pathauto'))) { - $enabled_entity_types[] = $entity_type_id; - } - } - $value = $enabled_entity_types; - } - elseif ($key == 'safe_tokens') { - $value = array_filter(array_map('trim', explode(',', $value))); - } - $config->set($key, $value); - } - $config->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php deleted file mode 100644 index 1e1ac3f9c..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php +++ /dev/null @@ -1,54 +0,0 @@ -t('Are you sure you want to disable the pattern %label?', array('%label' => $this->entity->label())); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.pathauto_pattern.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Disable'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Disabled patterns are ignored when generating aliases.'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->disable()->save(); - $this->messenger()->addMessage($this->t('Disabled pattern %label.', [ - '%label' => $this->entity->label(), - ])); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php deleted file mode 100644 index 454c4a1b1..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php +++ /dev/null @@ -1,297 +0,0 @@ -get('plugin.manager.alias_type'), - $container->get('entity_type.bundle.info'), - $container->get('entity_type.manager'), - $container->get('language_manager') - ); - } - - /** - * PatternEditForm constructor. - * - * @param \Drupal\pathauto\AliasTypeManager $manager - * The alias type manager. - * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info - * The entity type bundle info service. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity manager service. - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * The language manager service. - */ - function __construct(AliasTypeManager $manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager) { - $this->manager = $manager; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - $this->entityTypeManager = $entity_type_manager; - $this->languageManager = $language_manager; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $options = []; - foreach ($this->manager->getVisibleDefinitions() as $plugin_id => $plugin_definition) { - $options[$plugin_id] = $plugin_definition['label']; - } - $form['type'] = [ - '#type' => 'select', - '#title' => $this->t('Pattern type'), - '#default_value' => $this->entity->getType(), - '#options' => $options, - '#required' => TRUE, - '#limit_validation_errors' => array(array('type')), - '#submit' => array('::submitSelectType'), - '#executes_submit_callback' => TRUE, - '#ajax' => array( - 'callback' => '::ajaxReplacePatternForm', - 'wrapper' => 'pathauto-pattern', - 'method' => 'replace', - ), - ]; - - $form['pattern_container'] = [ - '#type' => 'container', - '#prefix' => '
', - '#suffix' => '
', - ]; - - // if there is no type yet, stop here. - if ($this->entity->getType()) { - - $alias_type = $this->entity->getAliasType(); - - $form['pattern_container']['pattern'] = array( - '#type' => 'textfield', - '#title' => 'Path pattern', - '#default_value' => $this->entity->getPattern(), - '#size' => 65, - '#maxlength' => 1280, - '#element_validate' => array('token_element_validate', 'pathauto_pattern_validate'), - '#after_build' => array('token_element_validate'), - '#token_types' => $alias_type->getTokenTypes(), - '#min_tokens' => 1, - '#required' => TRUE, - ); - - // Show the token help relevant to this pattern type. - $form['pattern_container']['token_help'] = array( - '#theme' => 'token_tree_link', - '#token_types' => $alias_type->getTokenTypes(), - ); - - // Expose bundle and language conditions. - if ($alias_type->getDerivativeId() && $entity_type = $this->entityTypeManager->getDefinition($alias_type->getDerivativeId())) { - - $default_bundles = []; - $default_languages = []; - foreach ($this->entity->getSelectionConditions() as $condition_id => $condition) { - if (in_array($condition->getPluginId(), ['entity_bundle:' . $entity_type->id(), 'node_type'])) { - $default_bundles = $condition->getConfiguration()['bundles']; - } - elseif ($condition->getPluginId() == 'language') { - $default_languages = $condition->getConfiguration()['langcodes']; - } - } - - if ($entity_type->hasKey('bundle') && $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type->id())) { - $bundle_options = []; - foreach ($bundles as $id => $info) { - $bundle_options[$id] = $info['label']; - } - $form['pattern_container']['bundles'] = array( - '#title' => $entity_type->getBundleLabel(), - '#type' => 'checkboxes', - '#options' => $bundle_options, - '#default_value' => $default_bundles, - '#description' => $this->t('Check to which types this pattern should be applied. Leave empty to allow any.'), - ); - } - - if ($this->languageManager->isMultilingual() && $entity_type->isTranslatable()) { - $language_options = []; - foreach ($this->languageManager->getLanguages() as $id => $language) { - $language_options[$id] = $language->getName(); - } - $form['pattern_container']['languages'] = array( - '#title' => $this->t('Languages'), - '#type' => 'checkboxes', - '#options' => $language_options, - '#default_value' => $default_languages, - '#description' => $this->t('Check to which languages this pattern should be applied. Leave empty to allow any.'), - ); - } - } - } - - $form['label'] = array( - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $this->entity->label(), - '#required' => TRUE, - '#description' => $this->t('A short name to help you identify this pattern in the patterns list.'), - ); - - $form['id'] = array( - '#type' => 'machine_name', - '#title' => $this->t('ID'), - '#maxlength' => 255, - '#default_value' => $this->entity->id(), - '#required' => TRUE, - '#disabled' => !$this->entity->isNew(), - '#machine_name' => array( - 'exists' => 'Drupal\pathauto\Entity\PathautoPattern::load', - ), - ); - - $form['status'] = [ - '#title' => $this->t('Enabled'), - '#type' => 'checkbox', - '#default_value' => $this->entity->status(), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function buildEntity(array $form, FormStateInterface $form_state) { - /** @var \Drupal\pathauto\PathautoPatternInterface $entity */ - $entity = parent::buildEntity($form, $form_state); - - // Will only be used for new patterns. - $default_weight = 0; - - $alias_type = $entity->getAliasType(); - if ($alias_type->getDerivativeId() && $this->entityTypeManager->hasDefinition($alias_type->getDerivativeId())) { - $entity_type = $alias_type->getDerivativeId(); - // First, remove bundle and language conditions. - foreach ($entity->getSelectionConditions() as $condition_id => $condition) { - if (in_array($condition->getPluginId(), ['entity_bundle:' . $entity_type, 'node_type', 'language'])) { - $entity->removeSelectionCondition($condition_id); - } - } - - if ($bundles = array_filter((array) $form_state->getValue('bundles'))) { - $default_weight -= 5; - $plugin_id = $entity_type == 'node' ? 'node_type' : 'entity_bundle:' . $entity_type; - $entity->addSelectionCondition( - [ - 'id' => $plugin_id, - 'bundles' => $bundles, - 'negate' => FALSE, - 'context_mapping' => [ - $entity_type => $entity_type, - ] - ] - ); - } - - if ($languages = array_filter((array) $form_state->getValue('languages'))) { - $default_weight -= 5; - $language_mapping = $entity_type . ':' . $this->entityTypeManager->getDefinition($entity_type)->getKey('langcode') . ':language'; - $entity->addSelectionCondition( - [ - 'id' => 'language', - 'langcodes' => array_combine($languages, $languages), - 'negate' => FALSE, - 'context_mapping' => [ - 'language' => $language_mapping, - ] - ] - ); - $entity->addRelationship($language_mapping, t('Language')); - } - - } - - if ($entity->isNew()) { - $entity->setWeight($default_weight); - } - - return $entity; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - parent::save($form, $form_state); - $this->messenger()->addMessage($this->t('Pattern %label saved.', [ - '%label' => $this->entity->label(), - ])); - $form_state->setRedirectUrl($this->entity->toUrl('collection')); - } - - /** - * Handles switching the type selector. - */ - public function ajaxReplacePatternForm($form, FormStateInterface $form_state) { - return $form['pattern_container']; - } - - /** - * Handles submit call when alias type is selected. - */ - public function submitSelectType(array $form, FormStateInterface $form_state) { - $this->entity = $this->buildEntity($form, $form_state); - $form_state->setRebuild(); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php deleted file mode 100644 index 18f136b55..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php +++ /dev/null @@ -1,54 +0,0 @@ -t('Are you sure you want to enable the pattern %label?', array('%label' => $this->entity->label())); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.pathauto_pattern.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Enable'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return ''; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->enable()->save(); - $this->messenger()->addMessage($this->t('Enabled pattern %label.', [ - '%label' => $this->entity->label(), - ])); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php b/sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php deleted file mode 100644 index e31f48fac..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -ensureComputedValue(); - - // Duplicate the logic instead of calling the parent due to the dynamic - // arguments. - $result = []; - $args = array_slice(func_get_args(), 1); - foreach ($this->list as $delta => $item) { - // call_user_func_array() is way slower than a direct call so we avoid - // using it if have no parameters. - $result[$delta] = $args ? call_user_func_array([$item, $method], $args) : $item->{$method}(); - } - return $result; - } - - /** - * @{inheritdoc} - */ - protected function computeValue() { - parent::computeValue(); - - // For a new entity, default to creating a new alias. - if ($this->getEntity()->isNew()) { - $this->list[0]->set('pathauto', PathautoState::CREATE); - } - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php deleted file mode 100644 index d70ce3b6f..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php +++ /dev/null @@ -1,379 +0,0 @@ -configFactory = $config_factory; - $this->moduleHandler = $module_handler; - $this->token = $token; - $this->aliasCleaner = $alias_cleaner; - $this->aliasStorageHelper = $alias_storage_helper; - $this->aliasUniquifier = $alias_uniquifier; - $this->messenger = $messenger; - $this->stringTranslation = $string_translation; - $this->tokenEntityMapper = $token_entity_mapper; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public function createEntityAlias(EntityInterface $entity, $op) { - // Retrieve and apply the pattern for this content type. - $pattern = $this->getPatternByEntity($entity); - if (empty($pattern)) { - // No pattern? Do nothing (otherwise we may blow away existing aliases...) - return NULL; - } - - $source = '/' . $entity->toUrl()->getInternalPath(); - $config = $this->configFactory->get('pathauto.settings'); - $langcode = $entity->language()->getId(); - - // Core does not handle aliases with language Not Applicable. - if ($langcode == LanguageInterface::LANGCODE_NOT_APPLICABLE) { - $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED; - } - - // Build token data. - $data = [ - $this->tokenEntityMapper->getTokenTypeForEntityType($entity->getEntityTypeId()) => $entity, - ]; - - // Allow other modules to alter the pattern. - $context = array( - 'module' => $entity->getEntityType()->getProvider(), - 'op' => $op, - 'source' => $source, - 'data' => $data, - 'bundle' => $entity->bundle(), - 'language' => &$langcode, - ); - $pattern_original = $pattern->getPattern(); - $this->moduleHandler->alter('pathauto_pattern', $pattern, $context); - $pattern_altered = $pattern->getPattern(); - - // Special handling when updating an item which is already aliased. - $existing_alias = NULL; - if ($op == 'update' || $op == 'bulkupdate') { - if ($existing_alias = $this->aliasStorageHelper->loadBySource($source, $langcode)) { - switch ($config->get('update_action')) { - case PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW: - // If an alias already exists, - // and the update action is set to do nothing, - // then gosh-darn it, do nothing. - return NULL; - } - } - } - - // Replace any tokens in the pattern. - // Uses callback option to clean replacements. No sanitization. - // Pass empty BubbleableMetadata object to explicitly ignore cacheablity, - // as the result is never rendered. - $alias = $this->token->replace($pattern->getPattern(), $data, array( - 'clear' => TRUE, - 'callback' => array($this->aliasCleaner, 'cleanTokenValues'), - 'langcode' => $langcode, - 'pathauto' => TRUE, - ), new BubbleableMetadata()); - - // Check if the token replacement has not actually replaced any values. If - // that is the case, then stop because we should not generate an alias. - // @see token_scan() - $pattern_tokens_removed = preg_replace('/\[[^\s\]:]*:[^\s\]]*\]/', '', $pattern->getPattern()); - if ($alias === $pattern_tokens_removed) { - return NULL; - } - - $alias = $this->aliasCleaner->cleanAlias($alias); - - // Allow other modules to alter the alias. - $context['source'] = &$source; - $context['pattern'] = $pattern; - $this->moduleHandler->alter('pathauto_alias', $alias, $context); - - // If we have arrived at an empty string, discontinue. - if (!mb_strlen($alias)) { - return NULL; - } - - // If the alias already exists, generate a new, hopefully unique, variant. - $original_alias = $alias; - $this->aliasUniquifier->uniquify($alias, $source, $langcode); - if ($original_alias != $alias) { - // Alert the user why this happened. - $this->messenger->addMessage($this->t('The automatically generated alias %original_alias conflicted with an existing alias. Alias changed to %alias.', array( - '%original_alias' => $original_alias, - '%alias' => $alias, - )), $op); - } - - // Return the generated alias if requested. - if ($op == 'return') { - return $alias; - } - - // Build the new path alias array and send it off to be created. - $path = array( - 'source' => $source, - 'alias' => $alias, - 'language' => $langcode, - ); - - $return = $this->aliasStorageHelper->save($path, $existing_alias, $op); - - // Because there is no way to set an altered pattern to not be cached, - // change it back to the original value. - if ($pattern_altered !== $pattern_original) { - $pattern->setPattern($pattern_original); - } - - return $return; - } - - /** - * Loads pathauto patterns for a given entity type ID. - * - * @param string $entity_type_id - * An entity type ID. - * - * @return \Drupal\pathauto\PathautoPatternInterface[] - * A list of patterns, sorted by weight. - */ - protected function getPatternByEntityType($entity_type_id) { - if (!isset($this->patternsByEntityType[$entity_type_id])) { - $ids = \Drupal::entityQuery('pathauto_pattern') - ->condition('type', array_keys(\Drupal::service('plugin.manager.alias_type') - ->getPluginDefinitionByType($this->tokenEntityMapper->getTokenTypeForEntityType($entity_type_id)))) - ->condition('status', 1) - ->sort('weight') - ->execute(); - - $this->patternsByEntityType[$entity_type_id] = \Drupal::entityTypeManager() - ->getStorage('pathauto_pattern') - ->loadMultiple($ids); - } - - return $this->patternsByEntityType[$entity_type_id]; - } - - /** - * {@inheritdoc} - */ - public function getPatternByEntity(EntityInterface $entity) { - $langcode = $entity->language()->getId(); - if (!isset($this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode])) { - foreach ($this->getPatternByEntityType($entity->getEntityTypeId()) as $pattern) { - if ($pattern->applies($entity)) { - $this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode] = $pattern; - break; - } - } - // If still not set. - if (!isset($this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode])) { - $this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode] = NULL; - } - } - return $this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode]; - } - - /** - * {@inheritdoc} - */ - public function resetCaches() { - $this->patterns = []; - $this->patternsByEntityType = []; - $this->aliasCleaner->resetCaches(); - } - - /** - * {@inheritdoc} - */ - public function updateEntityAlias(EntityInterface $entity, $op, array $options = array()) { - // Skip if the entity does not have the path field. - if (!($entity instanceof ContentEntityInterface) || !$entity->hasField('path')) { - return NULL; - } - - // Skip if pathauto processing is disabled. - if ($entity->path->pathauto != PathautoState::CREATE && empty($options['force'])) { - return NULL; - } - - // Only act if this is the default revision. - if ($entity instanceof RevisionableInterface && !$entity->isDefaultRevision()) { - return NULL; - } - - $options += array('language' => $entity->language()->getId()); - $type = $entity->getEntityTypeId(); - - // Skip processing if the entity has no pattern. - if (!$this->getPatternByEntity($entity)) { - return NULL; - } - - // Deal with taxonomy specific logic. - // @todo Update and test forum related code. - if ($type == 'taxonomy_term') { - - $config_forum = $this->configFactory->get('forum.settings'); - if ($entity->getVocabularyId() == $config_forum->get('vocabulary')) { - $type = 'forum'; - } - } - - try { - $result = $this->createEntityAlias($entity, $op); - } - catch (\InvalidArgumentException $e) { - $this->messenger->addError($e->getMessage()); - return NULL; - } - - // @todo Move this to a method on the pattern plugin. - if ($type == 'taxonomy_term') { - foreach ($this->loadTermChildren($entity->id()) as $subterm) { - $this->updateEntityAlias($subterm, $op, $options); - } - } - - return $result; - } - - /** - * Finds all children of a term ID. - * - * @param int $tid - * Term ID to retrieve parents for. - * - * @return \Drupal\taxonomy\TermInterface[] - * An array of term objects that are the children of the term $tid. - */ - protected function loadTermChildren($tid) { - return $this->entityTypeManager->getStorage('taxonomy_term')->loadChildren($tid); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php deleted file mode 100644 index 337df3c53..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php +++ /dev/null @@ -1,90 +0,0 @@ -setLabel(t('Pathauto state')) - ->setDescription(t('Whether an automated alias should be created or not.')) - ->setComputed(TRUE) - ->setClass('\Drupal\pathauto\PathautoState'); - return $properties; - } - - /** - * {@inheritdoc} - */ - public function postSave($update) { - // Only allow the parent implementation to act if pathauto will not create - // an alias. - if ($this->pathauto == PathautoState::SKIP) { - parent::postSave($update); - } - $this->get('pathauto')->persist(); - } - - /** - * {@inheritdoc} - */ - public function isEmpty() { - // Make sure that the pathauto state flag does not get lost if just that is - // changed. - return !$this->alias && !$this->get('pathauto')->hasValue(); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php deleted file mode 100644 index 9782f2e05..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php +++ /dev/null @@ -1,181 +0,0 @@ -t('Label'); - $header['pattern'] = $this->t('Pattern'); - $header['type'] = $this->t('Pattern type'); - $header['conditions'] = $this->t('Conditions'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - /* @var \Drupal\pathauto\PathautoPatternInterface $entity */ - $row['label'] = $entity->label(); - $row['patern']['#markup'] = $entity->getPattern(); - $row['type']['#markup'] = $entity->getAliasType()->getLabel(); - $row['conditions']['#theme'] = 'item_list'; - foreach ($entity->getSelectionConditions() as $condition) { - $row['conditions']['#items'][] = $condition->summary(); - } - return $row + parent::buildRow($entity); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoState.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoState.php deleted file mode 100644 index 4e1f63bc3..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/PathautoState.php +++ /dev/null @@ -1,159 +0,0 @@ -value === NULL) { - // If no value has been set or loaded yet, try to load a value if this - // entity has already been saved. - $this->value = \Drupal::keyValue($this->getCollection()) - ->get(static::getPathautoStateKey($this->parent->getEntity()->id())); - // If it was not yet saved or no value was found, then set the flag to - // create the alias if there is a matching pattern. - if ($this->value === NULL) { - $entity = $this->parent->getEntity(); - $pattern = \Drupal::service('pathauto.generator')->getPatternByEntity($entity); - $this->value = !empty($pattern) ? static::CREATE : static::SKIP; - } - } - return $this->value; - } - - /** - * {@inheritdoc} - */ - public function setValue($value, $notify = TRUE) { - $this->value = $value; - // Notify the parent of any changes. - if ($notify && isset($this->parent)) { - $this->parent->onChange($this->name); - } - } - - /** - * Returns TRUE if a value was set. - */ - public function hasValue() { - return $this->value !== NULL; - } - - /** - * Persists the state. - */ - public function persist() { - \Drupal::keyValue($this->getCollection()) - ->set(static::getPathautoStateKey($this->parent->getEntity()->id()), $this->getValue()); - } - - /** - * Deletes the stored state. - */ - public function purge() { - \Drupal::keyValue($this->getCollection()) - ->delete(static::getPathautoStateKey($this->parent->getEntity()->id())); - } - - /** - * Returns the key value collection that should be used for the given entity. - * - * @return string - */ - protected function getCollection() { - return 'pathauto_state.' . $this->parent->getEntity()->getEntityTypeId(); - } - - /** - * Deletes the URL aliases for multiple entities of the same type. - * - * @param string $entity_type_id - * The entity type ID of entities being deleted. - * @param int[] $pids_by_id - * A list of path IDs keyed by entity ID. - */ - public static function bulkDelete($entity_type_id, array $pids_by_id) { - foreach ($pids_by_id as $id => $pid) { - // Some key-values store entries have computed keys. - $key = static::getPathautoStateKey($id); - if ($key !== $id) { - $pids_by_id[$key] = $pid; - unset($pids_by_id[$id]); - } - } - $states = \Drupal::keyValue("pathauto_state.$entity_type_id") - ->getMultiple(array_keys($pids_by_id)); - - $pids = []; - foreach ($pids_by_id as $id => $pid) { - // Only delete aliases that were created by this module. - if (isset($states[$id]) && $states[$id] == PathautoState::CREATE) { - $pids[] = $pid; - } - } - \Drupal::service('pathauto.alias_storage_helper')->deleteMultiple($pids); - } - - /** - * Gets the key-value store entry key for 'pathauto_state.*' collections. - * - * Normally we want to use the entity ID as key for 'pathauto_state.*' - * collection entries. But some entity types may use string IDs. When such IDs - * are exceeding 128 characters, which is the limit for the 'name' column in - * the {key_value} table, the insertion of the ID in {key_value} will fail. - * Thus we test if we can use the plain ID or we need to store a hashed - * version of the entity ID. Also, it is not possible to rely on the UUID as - * entity types might not have one or might use a non-standard format. - * - * The code is inspired by - * \Drupal\Core\Cache\DatabaseBackend::normalizeCid(). - * - * @param int|string $entity_id - * The entity id for which to compute the key. - * - * @return int|string - * The key used to store the value in the key-value store. - * - * @see \Drupal\Core\Cache\DatabaseBackend::normalizeCid() - */ - public static function getPathautoStateKey($entity_id) { - $entity_id_is_ascii = mb_check_encoding($entity_id, 'ASCII'); - if ($entity_id_is_ascii && strlen($entity_id) <= 128) { - // The original entity ID, if it's an ASCII of 128 characters or less. - return $entity_id; - } - return Crypt::hashBase64($entity_id); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php deleted file mode 100644 index 3ca049008..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php +++ /dev/null @@ -1,71 +0,0 @@ -getEntity(); - - // Taxonomy terms do not have an actual fieldset for path settings. - // Merge in the defaults. - // @todo Impossible to do this in widget, use another solution - /* - $form['path'] += array( - '#type' => 'fieldset', - '#title' => $this->t('URL path settings'), - '#collapsible' => TRUE, - '#collapsed' => empty($form['path']['alias']), - '#group' => 'additional_settings', - '#attributes' => array( - 'class' => array('path-form'), - ), - '#access' => \Drupal::currentUser()->hasPermission('create url aliases') || \Drupal::currentUser()->hasPermission('administer url aliases'), - '#weight' => 30, - '#tree' => TRUE, - '#element_validate' => array('path_form_element_validate'), - );*/ - - $pattern = \Drupal::service('pathauto.generator')->getPatternByEntity($entity); - if (empty($pattern)) { - return $element; - } - - if (\Drupal::currentUser()->hasPermission('administer pathauto')) { - $description = $this->t('Uncheck this to create a custom alias below. Configure URL alias patterns.', ['@admin_link' => Url::fromRoute('entity.pathauto_pattern.collection')->toString()]); - } - else { - $description = $this->t('Uncheck this to create a custom alias below.'); - } - - $element['pathauto'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Generate automatic URL alias'), - '#default_value' => $entity->path->pathauto, - '#description' => $description, - '#weight' => -1, - ); - - // Add JavaScript that will disable the path textfield when the automatic - // alias checkbox is checked. - $element['alias']['#states']['disabled']['input[name="path[' . $delta . '][pathauto]"]'] = array('checked' => TRUE); - - // Override path.module's vertical tabs summary. - $element['alias']['#attached']['library'] = ['pathauto/widget']; - - return $element; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php deleted file mode 100644 index bfe0f48b1..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php +++ /dev/null @@ -1,36 +0,0 @@ -path->pathauto = PathautoState::CREATE; - \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'bulkupdate', array('message' => TRUE)); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $result = AccessResult::allowedIfHasPermission($account, 'create url aliases'); - return $return_as_object ? $result : $result->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php deleted file mode 100644 index c6b03311a..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php +++ /dev/null @@ -1,96 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityFieldManager = $entity_field_manager; - $this->stringTranslation = $string_translation; - $this->tokenEntityMapper = $token_entity_mapper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('entity_field.manager'), - $container->get('string_translation'), - $container->get('token.entity_mapper') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - // An entity type must have a canonical link template and support fields. - if ($entity_type->hasLinkTemplate('canonical') && is_subclass_of($entity_type->getClass(), FieldableEntityInterface::class)) { - $base_fields = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id); - if (!isset($base_fields['path'])) { - // The entity type does not have a path field and is therefore not - // supported. - continue; - } - $this->derivatives[$entity_type_id] = $base_plugin_definition; - $this->derivatives[$entity_type_id]['label'] = $entity_type->getLabel(); - $this->derivatives[$entity_type_id]['types'] = [$this->tokenEntityMapper->getTokenTypeForEntityType($entity_type_id)]; - $this->derivatives[$entity_type_id]['provider'] = $entity_type->getProvider(); - $this->derivatives[$entity_type_id]['context'] = [ - $entity_type_id => new ContextDefinition("entity:$entity_type_id", $this->t('@label being aliased', ['@label' => $entity_type->getLabel()])) - ]; - } - } - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php deleted file mode 100644 index cc48771a3..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php +++ /dev/null @@ -1,24 +0,0 @@ -t('Broken type'); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php deleted file mode 100644 index cdade9424..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php +++ /dev/null @@ -1,342 +0,0 @@ -moduleHandler = $module_handler; - $this->languageManager = $language_manager; - $this->entityTypeManager = $entity_type_manager; - $this->keyValue = $key_value; - $this->database = $database; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('language_manager'), - $container->get('entity_type.manager'), - $container->get('keyvalue'), - $container->get('database') - ); - } - - /** - * {@inheritdoc} - */ - public function getLabel() { - $definition = $this->getPluginDefinition(); - // Cast the admin label to a string since it is an object. - // @see \Drupal\Core\StringTranslation\TranslationWrapper - return (string) $definition['label']; - } - - /** - * {@inheritdoc} - */ - public function getTokenTypes() { - $definition = $this->getPluginDefinition(); - return $definition['types']; - } - - /** - * {@inheritdoc} - */ - public function batchUpdate($action, &$context) { - if (!isset($context['sandbox']['current'])) { - $context['sandbox']['count'] = 0; - $context['sandbox']['current'] = 0; - } - - $entity_type = $this->entityTypeManager->getDefinition($this->getEntityTypeId()); - $id_key = $entity_type->getKey('id'); - - $query = $this->database->select($entity_type->get('base_table'), 'base_table'); - $query->leftJoin('url_alias', 'ua', "CONCAT('" . $this->getSourcePrefix() . "' , base_table.$id_key) = ua.source"); - $query->addField('base_table', $id_key, 'id'); - - switch ($action) { - case 'create': - $query->isNull('ua.source'); - break; - - case 'update': - $query->isNotNull('ua.source'); - break; - - case 'all': - // Nothing to do. We want all paths. - break; - - default: - // Unknown action. Abort! - return; - } - $query->condition('base_table.' . $id_key, $context['sandbox']['current'], '>'); - $query->orderBy('base_table.' . $id_key); - $query->addTag('pathauto_bulk_update'); - $query->addMetaData('entity', $this->getEntityTypeId()); - - // Get the total amount of items to process. - if (!isset($context['sandbox']['total'])) { - $context['sandbox']['total'] = $query->countQuery()->execute()->fetchField(); - - // If there are no entities to update, then stop immediately. - if (!$context['sandbox']['total']) { - $context['finished'] = 1; - return; - } - } - - $query->range(0, 25); - $ids = $query->execute()->fetchCol(); - - $updates = $this->bulkUpdate($ids); - $context['sandbox']['count'] += count($ids); - $context['sandbox']['current'] = !empty($ids) ? max($ids) : 0; - $context['results']['updates'] += $updates; - $context['message'] = $this->t('Updated alias for %label @id.', array('%label' => $entity_type->getLabel(), '@id' => end($ids))); - - if ($context['sandbox']['count'] != $context['sandbox']['total']) { - $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total']; - } - } - - /** - * {@inheritdoc} - */ - public function batchDelete(&$context) { - if (!isset($context['sandbox']['current'])) { - $context['sandbox']['count'] = 0; - $context['sandbox']['current'] = 0; - } - - $entity_type = $this->entityTypeManager->getDefinition($this->getEntityTypeId()); - $id_key = $entity_type->getKey('id'); - - $query = $this->database->select($entity_type->get('base_table'), 'base_table'); - $query->innerJoin('url_alias', 'ua', "CONCAT('" . $this->getSourcePrefix() . "' , base_table.$id_key) = ua.source"); - $query->addField('base_table', $id_key, 'id'); - $query->addField('ua', 'pid'); - $query->condition('ua.pid', $context['sandbox']['current'], '>'); - $query->orderBy('ua.pid'); - $query->addTag('pathauto_bulk_delete'); - $query->addMetaData('entity', $this->getEntityTypeId()); - - // Get the total amount of items to process. - if (!isset($context['sandbox']['total'])) { - $context['sandbox']['total'] = $query->countQuery()->execute()->fetchField(); - - // If there are no entities to delete, then stop immediately. - if (!$context['sandbox']['total']) { - $context['finished'] = 1; - return; - } - } - - $query->range(0, 100); - $pids_by_id = $query->execute()->fetchAllKeyed(); - - PathautoState::bulkDelete($this->getEntityTypeId(), $pids_by_id); - $context['sandbox']['count'] += count($pids_by_id); - $context['sandbox']['current'] = max($pids_by_id); - $context['results']['deletions'][] = $this->getLabel(); - - if ($context['sandbox']['count'] != $context['sandbox']['total']) { - $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total']; - } - } - - /** - * Returns the entity type ID. - * - * @return string - * The entity type ID. - */ - protected function getEntityTypeId() { - return $this->getDerivativeId(); - } - - /** - * Update the URL aliases for multiple entities. - * - * @param array $ids - * An array of entity IDs. - * @param array $options - * An optional array of additional options. - * - * @return int - * The number of updated URL aliases. - */ - protected function bulkUpdate(array $ids, array $options = array()) { - $options += array('message' => FALSE); - $updates = 0; - - $entities = $this->entityTypeManager->getStorage($this->getEntityTypeId())->loadMultiple($ids); - foreach ($entities as $entity) { - // Update aliases for the entity's default language and its translations. - foreach ($entity->getTranslationLanguages() as $langcode => $language) { - $translated_entity = $entity->getTranslation($langcode); - $result = \Drupal::service('pathauto.generator')->updateEntityAlias($translated_entity, 'bulkupdate', $options); - if ($result) { - $updates++; - } - } - } - - if (!empty($options['message'])) { - $this->messenger->addMessage($this->translationManager - ->formatPlural(count($ids), 'Updated 1 %label URL alias.', 'Updated @count %label URL aliases.'), [ - '%label' => $this->getLabel(), - ]); - } - - return $updates; - } - - /** - * Deletes the URL aliases for multiple entities. - * - * @param int[] $pids_by_id - * A list of path IDs keyed by entity ID. - * - * @deprecated Use \Drupal\pathauto\PathautoState::bulkDelete() instead. - */ - protected function bulkDelete(array $pids_by_id) { - PathautoState::bulkDelete($this->getEntityTypeId(), $pids_by_id); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = []; - $dependencies['module'][] = $this->entityTypeManager->getDefinition($this->getEntityTypeId())->getProvider(); - return $dependencies; - } - - /** - * {@inheritdoc} - */ - public function applies($object) { - return $object instanceof FieldableEntityInterface && $object->getEntityTypeId() == $this->getEntityTypeId(); - } - - /** - * {@inheritdoc} - */ - public function getSourcePrefix() { - if (empty($this->prefix)) { - $entity_type = $this->entityTypeManager->getDefinition($this->getEntityTypeId()); - $path = $entity_type->getLinkTemplate('canonical'); - $this->prefix = substr($path, 0, strpos($path, '{')); - } - return $this->prefix; - } - - /** - * {@inheritdoc} - */ - public function setContextValue($name, $value) { - // Overridden to avoid merging existing cacheability metadata, which is not - // relevant for alias type plugins. - $this->context[$name] = new Context($this->getContextDefinition($name), $value); - return $this; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php deleted file mode 100644 index a572593ea..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php +++ /dev/null @@ -1,106 +0,0 @@ -configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('language_manager'), - $container->get('entity_type.manager'), - $container->get('keyvalue'), - $container->get('database'), - $container->get('config.factory') - ); - } - - /** - * {@inheritdoc} - */ - protected function getEntityTypeId() { - return 'taxonomy_term'; - } - - /** - * {@inheritdoc} - */ - public function getSourcePrefix() { - return '/forum/'; - } - - /** - * {@inheritdoc} - */ - public function applies($object) { - if (parent::applies($object)) { - /** @var \Drupal\taxonomy\TermInterface $object */ - $vid = $this->configFactory->get('forum.settings')->get('vocabulary'); - return $object->getVocabularyId() == $vid; - } - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php deleted file mode 100644 index 1db84e9d3..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php +++ /dev/null @@ -1,157 +0,0 @@ -adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - - $this->patterns = array(); - $this->patterns['node'] = $this->createPattern('node', '/content/[node:title]'); - $this->patterns['user'] = $this->createPattern('user', '/users/[user:name]'); - $this->patterns['forum'] = $this->createPattern('forum', '/forums/[term:name]'); - } - - function testBulkUpdate() { - // Create some nodes. - $this->nodes = array(); - for ($i = 1; $i <= 5; $i++) { - $node = $this->drupalCreateNode(); - $this->nodes[$node->id()] = $node; - } - - // Clear out all aliases. - $this->deleteAllAliases(); - - // Bulk create aliases. - $edit = array( - 'update[canonical_entities:node]' => TRUE, - 'update[canonical_entities:user]' => TRUE, - 'update[forum]' => TRUE, - ); - $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update')); - - // This has generated 8 aliases: 5 nodes, 2 users and 1 forum. - $this->assertText('Generated 8 URL aliases.'); - - // Check that aliases have actually been created. - foreach ($this->nodes as $node) { - $this->assertEntityAliasExists($node); - } - $this->assertEntityAliasExists($this->adminUser); - // This is the default "General discussion" forum. - $this->assertAliasExists(['source' => '/taxonomy/term/1']); - - // Add a new node. - $new_node = $this->drupalCreateNode(array('path' => array('alias' => '', 'pathauto' => PathautoState::SKIP))); - - // Run the update again which should not run against any nodes. - $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update')); - $this->assertText('No new URL aliases to generate.'); - $this->assertNoEntityAliasExists($new_node); - - // Make sure existing aliases can be overridden. - $this->drupalPostForm('admin/config/search/path/settings', ['update_action' => PathautoGeneratorInterface::UPDATE_ACTION_DELETE], t('Save configuration')); - - // Patterns did not change, so no aliases should be regenerated. - $edit['action'] = 'all'; - $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update')); - $this->assertText('No new URL aliases to generate.'); - - // Update the node pattern, and leave other patterns alone. Existing nodes - // should get a new alias, except the node above whose alias is manually - // set. Other aliases must be left alone. - $this->patterns['node']->delete(); - $this->patterns['node'] = $this->createPattern('node', '/archive/node-[node:nid]'); - - $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update')); - $this->assertText('Generated 5 URL aliases.'); - - // Prevent existing aliases to be overridden. The bulk generate page should - // only offer to create an alias for paths which have none. - $this->drupalPostForm('admin/config/search/path/settings', ['update_action' => PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW], t('Save configuration')); - - $this->drupalGet('admin/config/search/path/update_bulk'); - $this->assertFieldByName('action', 'create'); - $this->assertText('Pathauto settings are set to ignore paths which already have a URL alias.'); - $this->assertNoFieldByName('action', 'update'); - $this->assertNoFieldByName('action', 'all'); - } - - /** - * Tests alias generation for nodes that existed before installing Pathauto. - */ - function testBulkUpdateExistingContent() { - // Create a node. - $node = $this->drupalCreateNode(); - - // Delete its alias and Pathauto metadata. - \Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($node); - $node->path->first()->get('pathauto')->purge(); - \Drupal::entityTypeManager()->getStorage('node')->resetCache(array($node->id())); - - // Execute bulk generation. - // Bulk create aliases. - $edit = array( - 'update[canonical_entities:node]' => TRUE, - ); - $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update')); - - // Verify that the alias was created for the node. - $this->assertText('Generated 1 URL alias.'); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php deleted file mode 100644 index acaa87be7..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php +++ /dev/null @@ -1,88 +0,0 @@ -drupalCreateContentType(array('type' => 'article')); - $this->addDefaultCommentField('node', 'article'); - - $permissions = array( - 'administer pathauto', - 'administer url aliases', - 'create url aliases', - 'administer nodes', - 'post comments', - ); - $this->adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - } - - /** - * A suite of tests to verify if the feature to enable and disable the - * ability to define alias patterns for a given entity type works. Test with - * the comment module, as it is not enabled by default. - */ - function testEnablingEntityTypes() { - // Verify that the comment entity type is not available when trying to add - // a new pattern, nor "broken". - $this->drupalGet('/admin/config/search/path/patterns/add'); - $this->assertEqual(count($this->cssSelect('option[value = "canonical_entities:comment"]:contains(Comment)')), 0); - $this->assertEqual(count($this->cssSelect('option:contains(Broken)')), 0); - - // Enable the entity type and create a pattern for it. - $this->drupalGet('/admin/config/search/path/settings'); - $edit = [ - 'enabled_entity_types[comment]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, 'Save configuration'); - $this->createPattern('comment', '/comment/[comment:body]'); - - // Create a node, a comment type and a comment entity. - $node = $this->drupalCreateNode(['type' => 'article']); - $this->drupalGet('/node/' . $node->id()); - $edit = [ - 'comment_body[0][value]' => 'test-body', - ]; - $this->drupalPostForm(NULL, $edit, 'Save'); - - // Verify that an alias has been generated and that the type can no longer - // be disabled. - $this->assertAliasExists(['alias' => '/comment/test-body']); - $this->drupalGet('/admin/config/search/path/settings'); - $this->assertEqual(count($this->cssSelect('input[name = "enabled_entity_types[comment]"][disabled = "disabled"]')), 1); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php deleted file mode 100644 index 5cef86a28..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php +++ /dev/null @@ -1,216 +0,0 @@ -drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); - } - - /** - * Test that when an English node is updated, its old English alias is - * updated and its newer French alias is left intact. - */ - function testLanguageAliases() { - - $this->createPattern('node', '/content/[node:title]'); - - // Add predefined French language. - ConfigurableLanguage::createFromLangcode('fr')->save(); - - $node = array( - 'title' => 'English node', - 'langcode' => 'en', - 'path' => array(array( - 'alias' => '/english-node', - 'pathauto' => FALSE, - )), - ); - $node = $this->drupalCreateNode($node); - $english_alias = \Drupal::service('path.alias_storage')->load(array('alias' => '/english-node', 'langcode' => 'en')); - $this->assertTrue($english_alias, 'Alias created with proper language.'); - - // Also save a French alias that should not be left alone, even though - // it is the newer alias. - $this->saveEntityAlias($node, '/french-node', 'fr'); - - // Add an alias with the soon-to-be generated alias, causing the upcoming - // alias update to generate a unique alias with the '-0' suffix. - $this->saveAlias('/node/invalid', '/content/english-node', Language::LANGCODE_NOT_SPECIFIED); - - // Update the node, triggering a change in the English alias. - $node->path->pathauto = PathautoState::CREATE; - $node->save(); - - // Check that the new English alias replaced the old one. - $this->assertEntityAlias($node, '/content/english-node-0', 'en'); - $this->assertEntityAlias($node, '/french-node', 'fr'); - $this->assertAliasExists(array('pid' => $english_alias['pid'], 'alias' => '/content/english-node-0')); - - // Create a new node with the same title as before but without - // specifying a language. - $node = $this->drupalCreateNode(array('title' => 'English node', 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED)); - - // Check that the new node had a unique alias generated with the '-0' - // suffix. - $this->assertEntityAlias($node, '/content/english-node-0', LanguageInterface::LANGCODE_NOT_SPECIFIED); - } - - /** - * Test that patterns work on multilingual content. - */ - function testLanguagePatterns() { - - // Allow other modules to add additional permissions for the admin user. - $permissions = array( - 'administer pathauto', - 'administer url aliases', - 'create url aliases', - 'bypass node access', - 'access content overview', - 'administer languages', - 'translate any entity', - 'administer content translation' - - ); - $admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($admin_user); - - // Add French language. - $edit = array( - 'predefined_langcode' => 'fr', - ); - $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); - - $this->enableArticleTranslation(); - - // Create a pattern for English articles. - $this->drupalGet('admin/config/search/path/patterns/add'); - $edit = array( - 'type' => 'canonical_entities:node', - ); - $this->drupalPostAjaxForm(NULL, $edit, 'type'); - $edit += array( - 'pattern' => '/the-articles/[node:title]', - 'label' => 'English articles', - 'id' => 'english_articles', - 'bundles[article]' => TRUE, - 'languages[en]' => TRUE, - ); - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Pattern English articles saved.'); - - // Create a pattern for French articles. - $this->drupalGet('admin/config/search/path/patterns/add'); - $edit = array( - 'type' => 'canonical_entities:node', - ); - $this->drupalPostAjaxForm(NULL, $edit, 'type'); - $edit += array( - 'pattern' => '/les-articles/[node:title]', - 'label' => 'French articles', - 'id' => 'french_articles', - 'bundles[article]' => TRUE, - 'languages[fr]' => TRUE, - ); - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Pattern French articles saved.'); - - // Create a node and its translation. Assert aliases. - $edit = array( - 'title[0][value]' => 'English node', - 'langcode[0][value]' => 'en', - ); - $this->drupalPostForm('node/add/article', $edit, t('Save')); - $english_node = $this->drupalGetNodeByTitle('English node'); - return; - $this->assertAlias('/node/' . $english_node->id(), '/the-articles/english-node', 'en'); - - $this->drupalGet('node/' . $english_node->id() . '/translations'); - $this->clickLink(t('Add')); - $edit = array( - 'title[0][value]' => 'French node', - ); - $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); - $this->rebuildContainer(); - $english_node = $this->drupalGetNodeByTitle('English node'); - $french_node = $english_node->getTranslation('fr'); - $this->assertAlias('/node/' . $french_node->id(), '/les-articles/french-node', 'fr'); - - // Bulk delete and Bulk generate patterns. Assert aliases. - $this->deleteAllAliases(); - // Bulk create aliases. - $edit = array( - 'update[canonical_entities:node]' => TRUE, - ); - $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update')); - $this->assertText(t('Generated 2 URL aliases.')); - $this->assertAlias('/node/' . $english_node->id(), '/the-articles/english-node', 'en'); - $this->assertAlias('/node/' . $french_node->id(), '/les-articles/french-node', 'fr'); - } - - /** - * Tests the alias created for a node with language Not Applicable. - */ - public function testLanguageNotApplicable() { - $this->drupalLogin($this->rootUser); - $this->enableArticleTranslation(); - - // Create a pattern for nodes. - $pattern = $this->createPattern('node', '/content/[node:title]', -1); - $pattern->save(); - - // Create a node with language Not Applicable. - $node = $this->createNode(['type' => 'article', 'title' => 'Test node', 'langcode' => LanguageInterface::LANGCODE_NOT_APPLICABLE]); - - // Check that the generated alias has language Not Specified. - $alias = \Drupal::service('pathauto.alias_storage_helper')->loadBySource('/node/' . $node->id()); - $this->assertEqual($alias['langcode'], LanguageInterface::LANGCODE_NOT_SPECIFIED, 'PathautoGenerator::createEntityAlias() adjusts the alias langcode from Not Applicable to Not Specified.'); - - // Check that the alias works. - $this->drupalGet('content/test-node'); - $this->assertResponse(200); - } - - /** - * Enables content translation on articles. - */ - protected function enableArticleTranslation() { - // Enable content translation on articles. - $this->drupalGet('admin/config/regional/content-language'); - $edit = array( - 'entity_types[node]' => TRUE, - 'settings[node][article][translatable]' => TRUE, - 'settings[node][article][settings][language][language_alterable]' => TRUE, - ); - $this->drupalPostForm(NULL, $edit, t('Save configuration')); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php deleted file mode 100644 index 691e5a89c..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php +++ /dev/null @@ -1,201 +0,0 @@ -adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - - $this->createPattern('node', '/content/[node:title]'); - $this->createPattern('user', '/users/[user:name]'); - $this->createPattern('taxonomy_term', '/[term:vocabulary]/[term:name]'); - } - - /** - * Tests the deletion of all the aliases. - */ - function testDeleteAll() { - // 1. Test that deleting all the aliases, of any type, works. - $this->generateAliases(); - $edit = array( - 'delete[all_aliases]' => TRUE, - 'options[keep_custom_aliases]' => FALSE, - ); - $this->drupalPostForm('admin/config/search/path/delete_bulk', $edit, t('Delete aliases now!')); - $this->assertText(t('All of your path aliases have been deleted.')); - $this->assertUrl('admin/config/search/path/delete_bulk'); - - // Make sure that all of them are actually deleted. - $aliases = \Drupal::database()->select('url_alias', 'ua')->fields('ua', array())->execute()->fetchAll(); - $this->assertEqual($aliases, array(), "All the aliases have been deleted."); - - // 2. Test deleting only specific (entity type) aliases. - $manager = $this->container->get('plugin.manager.alias_type'); - $pathauto_plugins = array('canonical_entities:node' => 'nodes', 'canonical_entities:taxonomy_term' => 'terms', 'canonical_entities:user' => 'accounts'); - foreach ($pathauto_plugins as $pathauto_plugin => $attribute) { - $this->generateAliases(); - $edit = array( - 'delete[plugins][' . $pathauto_plugin . ']' => TRUE, - 'options[keep_custom_aliases]' => FALSE, - ); - $this->drupalPostForm('admin/config/search/path/delete_bulk', $edit, t('Delete aliases now!')); - $alias_type = $manager->createInstance($pathauto_plugin); - $this->assertRaw(t('All of your %label path aliases have been deleted.', array('%label' => $alias_type->getLabel()))); - // Check that the aliases were actually deleted. - foreach ($this->{$attribute} as $entity) { - $this->assertNoEntityAlias($entity); - } - - // Check that the other aliases are not deleted. - foreach ($pathauto_plugins as $_pathauto_plugin => $_attribute) { - // Skip the aliases that should be deleted. - if ($_pathauto_plugin == $pathauto_plugin) { - continue; - } - foreach ($this->{$_attribute} as $entity) { - $this->assertEntityAliasExists($entity); - } - } - } - - // 3. Test deleting automatically generated aliases only. - $this->generateAliases(); - $edit = array( - 'delete[all_aliases]' => TRUE, - 'options[keep_custom_aliases]' => TRUE, - ); - $this->drupalPostForm('admin/config/search/path/delete_bulk', $edit, t('Delete aliases now!')); - $this->assertText(t('All of your automatically generated path aliases have been deleted.')); - $this->assertUrl('admin/config/search/path/delete_bulk'); - - // Make sure that only custom aliases and aliases with no information about - // their state still exist. - $aliases = \Drupal::database()->select('url_alias', 'ua')->fields('ua', ['source'])->execute()->fetchCol(); - $this->assertEqual($aliases, ['/node/101', '/node/104', '/node/105'], 'Custom aliases still exist.'); - } - - /** - * Helper function to generate aliases. - */ - function generateAliases() { - // Delete all aliases to avoid duplicated aliases. They will be recreated - // below. - $this->deleteAllAliases(); - - // We generate a bunch of aliases for nodes, users and taxonomy terms. If - // the entities are already created we just update them, otherwise we create - // them. - if (empty($this->nodes)) { - // Create a large number of nodes (100+) to make sure that the batch code - // works. - for ($i = 1; $i <= 105; $i++) { - // Set the alias of two nodes manually. - $settings = ($i > 103) ? ['path' => ['alias' => "/custom_alias_$i", 'pathauto' => PathautoState::SKIP]] : []; - $node = $this->drupalCreateNode($settings); - $this->nodes[$node->id()] = $node; - } - } - else { - foreach ($this->nodes as $node) { - if ($node->id() > 103) { - // The alias is set manually. - $node->set('path', ['alias' => '/custom_alias_' . $node->id()]); - } - $node->save(); - } - } - // Delete information about the state of an alias to make sure that aliases - // with no such data are left alone by default. - \Drupal::keyValue('pathauto_state.node')->delete(101); - - if (empty($this->accounts)) { - for ($i = 1; $i <= 5; $i++) { - $account = $this->drupalCreateUser(); - $this->accounts[$account->id()] = $account; - } - } - else { - foreach ($this->accounts as $id => $account) { - $account->save(); - } - } - - if (empty($this->terms)) { - $vocabulary = $this->addVocabulary(array('name' => 'test vocabulary', 'vid' => 'test_vocabulary')); - for ($i = 1; $i <= 5; $i++) { - $term = $this->addTerm($vocabulary); - $this->terms[$term->id()] = $term; - } - } - else { - foreach ($this->terms as $term) { - $term->save(); - } - } - - // Check that we have aliases for the entities. - foreach (array('nodes', 'accounts', 'terms') as $attribute) { - foreach ($this->{$attribute} as $entity) { - $this->assertEntityAliasExists($entity); - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php deleted file mode 100644 index a9376f7ac..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php +++ /dev/null @@ -1,293 +0,0 @@ -drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); - $this->drupalCreateContentType(array('type' => 'article')); - - // Allow other modules to add additional permissions for the admin user. - $permissions = array( - 'administer pathauto', - 'administer url aliases', - 'create url aliases', - 'bypass node access', - 'access content overview', - ); - $this->adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - - $this->createPattern('node', '/content/[node:title]'); - } - - /** - * Tests editing nodes with different settings. - */ - function testNodeEditing() { - // Ensure that the Pathauto checkbox is checked by default on the node add - // form. - $this->drupalGet('node/add/page'); - $this->assertFieldChecked('edit-path-0-pathauto'); - - // Create a node by saving the node form. - $title = ' Testing: node title ['; - $automatic_alias = '/content/testing-node-title'; - $this->drupalPostForm(NULL, array('title[0][value]' => $title), t('Save')); - $node = $this->drupalGetNodeByTitle($title); - - // Look for alias generated in the form. - $this->drupalGet("node/{$node->id()}/edit"); - $this->assertFieldChecked('edit-path-0-pathauto'); - $this->assertFieldByName('path[0][alias]', $automatic_alias, 'Generated alias visible in the path alias field.'); - - // Check whether the alias actually works. - $this->drupalGet($automatic_alias); - $this->assertText($title, 'Node accessible through automatic alias.'); - - // Manually set the node's alias. - $manual_alias = '/content/' . $node->id(); - $edit = array( - 'path[0][pathauto]' => FALSE, - 'path[0][alias]' => $manual_alias, - ); - $this->drupalPostForm($node->toUrl('edit-form'), $edit, t('Save')); - $this->assertText(t('@type @title has been updated.', array('@type' => 'page', '@title' => $title))); - - // Check that the automatic alias checkbox is now unchecked by default. - $this->drupalGet("node/{$node->id()}/edit"); - $this->assertNoFieldChecked('edit-path-0-pathauto'); - $this->assertFieldByName('path[0][alias]', $manual_alias); - - // Submit the node form with the default values. - $this->drupalPostForm(NULL, array('path[0][pathauto]' => FALSE), t('Save')); - $this->assertText(t('@type @title has been updated.', array('@type' => 'page', '@title' => $title))); - - // Test that the old (automatic) alias has been deleted and only accessible - // through the new (manual) alias. - $this->drupalGet($automatic_alias); - $this->assertResponse(404, 'Node not accessible through automatic alias.'); - $this->drupalGet($manual_alias); - $this->assertText($title, 'Node accessible through manual alias.'); - - // Test that the manual alias is not kept for new nodes when the pathauto - // checkbox is ticked. - $title = 'Automatic Title'; - $edit = array( - 'title[0][value]' => $title, - 'path[0][pathauto]' => TRUE, - 'path[0][alias]' => '/should-not-get-created', - ); - $this->drupalPostForm('node/add/page', $edit, t('Save')); - $this->assertNoAliasExists(array('alias' => 'should-not-get-created')); - $node = $this->drupalGetNodeByTitle($title); - $this->assertEntityAlias($node, '/content/automatic-title'); - - // Remove the pattern for nodes, the pathauto checkbox should not be - // displayed. - $ids = \Drupal::entityQuery('pathauto_pattern') - ->condition('type', 'canonical_entities:node') - ->execute(); - foreach (PathautoPattern::loadMultiple($ids) as $pattern) { - $pattern->delete(); - } - - $this->drupalGet('node/add/article'); - $this->assertNoFieldById('edit-path-0-pathauto'); - $this->assertFieldByName('path[0][alias]', ''); - - $edit = array(); - $edit['title'] = 'My test article'; - $this->drupalCreateNode($edit); - //$this->drupalPostForm(NULL, $edit, t('Save')); - $node = $this->drupalGetNodeByTitle($edit['title']); - - // Pathauto checkbox should still not exist. - $this->drupalGet($node->toUrl('edit-form')); - $this->assertNoFieldById('edit-path-0-pathauto'); - $this->assertFieldByName('path[0][alias]', ''); - $this->assertNoEntityAlias($node); - } - - /** - * Test node operations. - */ - function testNodeOperations() { - $node1 = $this->drupalCreateNode(array('title' => 'node1')); - $node2 = $this->drupalCreateNode(array('title' => 'node2')); - - // Delete all current URL aliases. - $this->deleteAllAliases(); - - $this->drupalGet('admin/content'); - - // Check which of the two nodes is first. - if (strpos($this->getTextContent(), 'node1') < strpos($this->getTextContent(), 'node2')) { - $index = 0; - } - else { - $index = 1; - } - - $edit = array( - 'action' => 'pathauto_update_alias_node', - 'node_bulk_form[' . $index . ']' => TRUE, - ); - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - $this->assertText('Update URL alias was applied to 1 item.'); - - $this->assertEntityAlias($node1, '/content/' . $node1->getTitle()); - $this->assertEntityAlias($node2, '/node/' . $node2->id()); - } - - /** - * @todo Merge this with existing node test methods? - */ - public function testNodeState() { - $nodeNoAliasUser = $this->drupalCreateUser(array('bypass node access')); - $nodeAliasUser = $this->drupalCreateUser(array('bypass node access', 'create url aliases')); - - $node = $this->drupalCreateNode(array( - 'title' => 'Node version one', - 'type' => 'page', - 'path' => array( - 'pathauto' => PathautoState::SKIP, - ), - )); - - $this->assertNoEntityAlias($node); - - // Set a manual path alias for the node. - $node->path->alias = '/test-alias'; - $node->save(); - - // Ensure that the pathauto field was saved to the database. - \Drupal::entityTypeManager()->getStorage('node')->resetCache(); - $node = Node::load($node->id()); - $this->assertIdentical($node->path->pathauto, PathautoState::SKIP); - - // Ensure that the manual path alias was saved and an automatic alias was not generated. - $this->assertEntityAlias($node, '/test-alias'); - $this->assertNoEntityAliasExists($node, '/content/node-version-one'); - - // Save the node as a user who does not have access to path fieldset. - $this->drupalLogin($nodeNoAliasUser); - $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertNoFieldByName('path[0][pathauto]'); - - $edit = array('title[0][value]' => 'Node version two'); - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Basic page Node version two has been updated.'); - - $this->assertEntityAlias($node, '/test-alias'); - $this->assertNoEntityAliasExists($node, '/content/node-version-one'); - $this->assertNoEntityAliasExists($node, '/content/node-version-two'); - - // Load the edit node page and check that the Pathauto checkbox is unchecked. - $this->drupalLogin($nodeAliasUser); - $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertNoFieldChecked('edit-path-0-pathauto'); - - // Edit the manual alias and save the node. - $edit = array( - 'title[0][value]' => 'Node version three', - 'path[0][alias]' => '/manually-edited-alias', - ); - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Basic page Node version three has been updated.'); - - $this->assertEntityAlias($node, '/manually-edited-alias'); - $this->assertNoEntityAliasExists($node, '/test-alias'); - $this->assertNoEntityAliasExists($node, '/content/node-version-one'); - $this->assertNoEntityAliasExists($node, '/content/node-version-two'); - $this->assertNoEntityAliasExists($node, '/content/node-version-three'); - - // Programatically save the node with an automatic alias. - \Drupal::entityTypeManager()->getStorage('node')->resetCache(); - $node = Node::load($node->id()); - $node->path->pathauto = PathautoState::CREATE; - $node->save(); - - // Ensure that the pathauto field was saved to the database. - \Drupal::entityTypeManager()->getStorage('node')->resetCache(); - $node = Node::load($node->id()); - $this->assertIdentical($node->path->pathauto, PathautoState::CREATE); - - $this->assertEntityAlias($node, '/content/node-version-three'); - $this->assertNoEntityAliasExists($node, '/manually-edited-alias'); - $this->assertNoEntityAliasExists($node, '/test-alias'); - $this->assertNoEntityAliasExists($node, '/content/node-version-one'); - $this->assertNoEntityAliasExists($node, '/content/node-version-two'); - - $node->delete(); - $this->assertNull(\Drupal::keyValue('pathauto_state.node')->get($node->id()), 'Pathauto state was deleted'); - } - - - /** - * Tests that nodes without a Pathauto pattern can set custom aliases. - */ - public function testCustomAliasWithoutPattern() { - // First, delete all patterns to be sure that there will be no match. - $entity_ids = \Drupal::entityQuery('pathauto_pattern')->execute(); - $entities = PathautoPattern::loadMultiple($entity_ids); - foreach ($entities as $entity) { - $entity->delete(); - } - - // Next, create a node with a custom alias. - $edit = [ - 'title[0][value]' => 'Sample article', - 'path[0][alias]' => '/sample-article', - ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - $this->assertText(t('article Sample article has been created.')); - - // Test the alias. - $this->assertAliasExists(array('alias' => '/sample-article')); - $this->drupalGet('sample-article'); - $this->assertResponse(200, 'A node without a pattern can have a custom alias.'); - - // Now create a node through the API. - $node = Node::create(['type' => 'article', 'title' => 'Sample article API', 'path' => ['alias' => '/sample-article-api']]); - $node->save(); - - // Test the alias. - $this->assertAliasExists(['alias' => '/sample-article-api']); - $this->drupalGet('sample-article-api'); - $this->assertResponse(200); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php deleted file mode 100644 index cbcb6b856..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php +++ /dev/null @@ -1,239 +0,0 @@ - FALSE, - 'separator' => '-', - 'case' => '1', - 'max_length' => '100', - 'max_component_length' => '100', - 'update_action' => '2', - 'transliterate' => '1', - 'reduce_ascii' => FALSE, - 'ignore_words' => 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with', - ); - - /** - * Punctuation form items with default values. - * - * @var array - */ - protected $defaultPunctuations = array( - 'punctuation[double_quotes]' => '0', - 'punctuation[quotes]' => '0', - 'punctuation[backtick]' => '0', - 'punctuation[comma]' => '0', - 'punctuation[period]' => '0', - 'punctuation[hyphen]' => '1', - 'punctuation[underscore]' => '0', - 'punctuation[colon]' => '0', - 'punctuation[semicolon]' => '0', - 'punctuation[pipe]' => '0', - 'punctuation[left_curly]' => '0', - 'punctuation[left_square]' => '0', - 'punctuation[right_curly]' => '0', - 'punctuation[right_square]' => '0', - 'punctuation[plus]' => '0', - 'punctuation[equal]' => '0', - 'punctuation[asterisk]' => '0', - 'punctuation[ampersand]' => '0', - 'punctuation[percent]' => '0', - 'punctuation[caret]' => '0', - 'punctuation[dollar]' => '0', - 'punctuation[hash]' => '0', - 'punctuation[exclamation]' => '0', - 'punctuation[tilde]' => '0', - 'punctuation[left_parenthesis]' => '0', - 'punctuation[right_parenthesis]' => '0', - 'punctuation[question_mark]' => '0', - 'punctuation[less_than]' => '0', - 'punctuation[greater_than]' => '0', - 'punctuation[slash]' => '0', - 'punctuation[back_slash]' => '0', - ); - - /** - * {@inheritdoc} - */ - function setUp() { - parent::setUp(); - - $this->drupalCreateContentType(array('type' => 'article')); - - $permissions = array( - 'administer pathauto', - 'notify of path changes', - 'administer url aliases', - 'create url aliases', - 'bypass node access', - ); - $this->adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - $this->createPattern('node', '/content/[node:title]'); - } - - /** - * Test if the default values are shown correctly in the form. - */ - function testDefaultFormValues() { - $this->drupalGet('/admin/config/search/path/settings'); - $this->assertNoFieldChecked('edit-verbose'); - $this->assertField('edit-separator', $this->defaultFormValues['separator']); - $this->assertFieldChecked('edit-case'); - $this->assertField('edit-max-length', $this->defaultFormValues['max_length']); - $this->assertField('edit-max-component-length', $this->defaultFormValues['max_component_length']); - $this->assertFieldChecked('edit-update-action-2'); - $this->assertFieldChecked('edit-transliterate'); - $this->assertNoFieldChecked('edit-reduce-ascii'); - $this->assertField('edit-ignore-words', $this->defaultFormValues['ignore_words']); - } - - /** - * Test the verbose option. - */ - function testVerboseOption() { - $edit = array('verbose' => '1'); - $this->drupalPostForm('/admin/config/search/path/settings', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.')); - $this->assertFieldChecked('edit-verbose'); - - $title = 'Verbose settings test'; - $this->drupalGet('/node/add/article'); - $this->assertFieldChecked('edit-path-0-pathauto'); - $this->drupalPostForm(NULL, array('title[0][value]' => $title), t('Save')); - $this->assertText('Created new alias /content/verbose-settings-test for'); - - $node = $this->drupalGetNodeByTitle($title); - $this->drupalPostForm('/node/' . $node->id() . '/edit', array('title[0][value]' => 'Updated title'), t('Save')); - $this->assertText('Created new alias /content/updated-title for'); - $this->assertText('replacing /content/verbose-settings-test.'); - } - - /** - * Tests generating aliases with different settings. - */ - function testSettingsForm() { - // Ensure the separator settings apply correctly. - $this->checkAlias('My awesome content', '/content/my.awesome.content', array('separator' => '.')); - - // Ensure the character case setting works correctly. - // Leave case the same as source token values. - $this->checkAlias('My awesome Content', '/content/My-awesome-Content', array('case' => FALSE)); - $this->checkAlias('Change Lower', '/content/change-lower', array('case' => '1')); - - // Ensure the maximum alias length is working. - $this->checkAlias('My awesome Content', '/content/my-awesome', array('max_length' => '23')); - - // Ensure the maximum component length is working. - $this->checkAlias('My awesome Content', '/content/my', array('max_component_length' => '2')); - - // Ensure transliteration option is working. - $this->checkAlias('è é àl ö äl ü', '/content/e-e-al-o-al-u', array('transliterate' => '1')); - $this->checkAlias('è é àl äl ö ü', '/content/è-é-àl-äl-ö-ü', array('transliterate' => FALSE)); - - $ignore_words = 'a, new, very, should'; - $this->checkAlias('a very new alias to test', '/content/alias-to-test', array('ignore_words' => $ignore_words)); - } - - /** - * Test the punctuation setting form items. - */ - function testPunctuationSettings() { - // Test the replacement of punctuations. - $settings = []; - foreach ($this->defaultPunctuations as $key => $punctuation) { - $settings[$key] = PathautoGeneratorInterface::PUNCTUATION_REPLACE; - } - - $title = 'aa"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3'; - $alias = '/content/aa-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-1-2-3'; - $this->checkAlias($title, $alias, $settings); - - // Test the removal of punctuations. - $settings = []; - foreach ($this->defaultPunctuations as $key => $punctuation) { - $settings[$key] = PathautoGeneratorInterface::PUNCTUATION_REMOVE; - } - - $title = 'a"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3'; - $alias = '/content/abcdefghijklmnopqrstuvwxyz123'; - $this->checkAlias($title, $alias, $settings); - - // Keep all punctuations in alias. - $settings = []; - foreach ($this->defaultPunctuations as $key => $punctuation) { - $settings[$key] = PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING; - } - - $title = 'al"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3'; - $alias = '/content/al"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3'; - $this->checkAlias($title, $alias, $settings); - } - - /** - * Helper method to check the an aliases. - * - * @param string $title - * The node title to build the aliases from. - * @param string $alias - * The expected alias. - * @param array $settings - * The form values the alias should be generated with. - */ - protected function checkAlias($title, $alias, $settings = array()) { - // Submit the settings form. - $edit = array_merge($this->defaultFormValues + $this->defaultPunctuations, $settings); - $this->drupalPostForm('/admin/config/search/path/settings', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.')); - - // If we do not clear the caches here, AliasCleaner will use its - // cleanStringCache instance variable. Due to that the creation of aliases - // with $this->createNode() will only work correctly on the first call. - \Drupal::service('pathauto.generator')->resetCaches(); - - // Create a node and check if the settings applied. - $node = $this->createNode( - array( - 'title' => $title, - 'type' => 'article', - ) - ); - - $this->drupalGet($alias); - $this->assertResponse(200); - $this->assertEntityAlias($node, $alias); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php deleted file mode 100644 index 3b92569f7..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php +++ /dev/null @@ -1,101 +0,0 @@ -adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - - $this->createPattern('taxonomy_term', '/[term:vocabulary]/[term:name]'); - } - - /** - * Basic functional testing of Pathauto with taxonomy terms. - */ - function testTermEditing() { - $this->drupalGet('admin/structure'); - $this->drupalGet('admin/structure/taxonomy'); - - // Add vocabulary "tags". - $vocabulary = $this->addVocabulary(array('name' => 'tags', 'vid' => 'tags')); - - // Create term for testing. - $name = 'Testing: term name ['; - $automatic_alias = '/tags/testing-term-name'; - $this->drupalPostForm('admin/structure/taxonomy/manage/tags/add', array('name[0][value]' => $name), 'Save'); - $name = trim($name); - $this->assertText("Created new term $name."); - $term = $this->drupalGetTermByName($name); - - // Look for alias generated in the form. - $this->drupalGet("taxonomy/term/{$term->id()}/edit"); - $this->assertFieldChecked('edit-path-0-pathauto'); - $this->assertFieldByName('path[0][alias]', $automatic_alias, 'Generated alias visible in the path alias field.'); - - // Check whether the alias actually works. - $this->drupalGet($automatic_alias); - $this->assertText($name, 'Term accessible through automatic alias.'); - - // Manually set the term's alias. - $manual_alias = '/tags/' . $term->id(); - $edit = array( - 'path[0][pathauto]' => FALSE, - 'path[0][alias]' => $manual_alias, - ); - $this->drupalPostForm("taxonomy/term/{$term->id()}/edit", $edit, t('Save')); - $this->assertText("Updated term $name."); - - // Check that the automatic alias checkbox is now unchecked by default. - $this->drupalGet("taxonomy/term/{$term->id()}/edit"); - $this->assertNoFieldChecked('edit-path-0-pathauto'); - $this->assertFieldByName('path[0][alias]', $manual_alias); - - // Submit the term form with the default values. - $this->drupalPostForm(NULL, array('path[0][pathauto]' => FALSE), t('Save')); - $this->assertText("Updated term $name."); - - // Test that the old (automatic) alias has been deleted and only accessible - // through the new (manual) alias. - $this->drupalGet($automatic_alias); - $this->assertResponse(404, 'Term not accessible through automatic alias.'); - $this->drupalGet($manual_alias); - $this->assertText($name, 'Term accessible through manual alias.'); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php deleted file mode 100644 index 8c5c97045..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php +++ /dev/null @@ -1,190 +0,0 @@ - mb_strtolower($this->randomMachineName()), - 'type' => $type, - 'pattern' => $pattern, - 'weight' => $weight, - ]); - $pattern->save(); - return $pattern; - } - - /** - * Add a bundle condition to a pathauto pattern. - * - * @param \Drupal\pathauto\PathautoPatternInterface $pattern - * The pattern. - * @param string $entity_type - * The entity type ID. - * @param string $bundle - * The bundle. - */ - protected function addBundleCondition(PathautoPatternInterface $pattern, $entity_type, $bundle) { - $plugin_id = $entity_type == 'node' ? 'node_type' : 'entity_bundle:' . $entity_type; - - $pattern->addSelectionCondition( - [ - 'id' => $plugin_id, - 'bundles' => [ - $bundle => $bundle, - ], - 'negate' => FALSE, - 'context_mapping' => [ - $entity_type => $entity_type, - ] - ] - ); - } - - public function assertToken($type, $object, $token, $expected) { - $bubbleable_metadata = new BubbleableMetadata(); - $tokens = \Drupal::token()->generate($type, array($token => $token), array($type => $object), [], $bubbleable_metadata); - $tokens += array($token => ''); - $this->assertIdentical($tokens[$token], $expected, t("Token value for [@type:@token] was '@actual', expected value '@expected'.", array('@type' => $type, '@token' => $token, '@actual' => $tokens[$token], '@expected' => $expected))); - } - - public function saveAlias($source, $alias, $langcode = Language::LANGCODE_NOT_SPECIFIED) { - \Drupal::service('path.alias_storage')->delete(array('source' => $source, 'language', 'langcode' => $langcode)); - return \Drupal::service('path.alias_storage')->save($source, $alias, $langcode); - } - - public function saveEntityAlias(EntityInterface $entity, $alias, $langcode = NULL) { - // By default, use the entity language. - if (!$langcode) { - $langcode = $entity->language()->getId(); - } - return $this->saveAlias('/' . $entity->toUrl()->getInternalPath(), $alias, $langcode); - } - - public function assertEntityAlias(EntityInterface $entity, $expected_alias, $langcode = NULL) { - // By default, use the entity language. - if (!$langcode) { - $langcode = $entity->language()->getId(); - } - $this->assertAlias('/' . $entity->toUrl()->getInternalPath(), $expected_alias, $langcode); - } - - public function assertEntityAliasExists(EntityInterface $entity) { - return $this->assertAliasExists(array('source' => '/' . $entity->toUrl()->getInternalPath())); - } - - public function assertNoEntityAlias(EntityInterface $entity, $langcode = NULL) { - // By default, use the entity language. - if (!$langcode) { - $langcode = $entity->language()->getId(); - } - $this->assertEntityAlias($entity, '/' . $entity->toUrl()->getInternalPath(), $langcode); - } - - public function assertNoEntityAliasExists(EntityInterface $entity, $alias = NULL) { - $path = array('source' => '/' . $entity->toUrl()->getInternalPath()); - if (!empty($alias)) { - $path['alias'] = $alias; - } - $this->assertNoAliasExists($path); - } - - public function assertAlias($source, $expected_alias, $langcode = Language::LANGCODE_NOT_SPECIFIED) { - \Drupal::service('path.alias_manager')->cacheClear($source); - $this->assertEqual($expected_alias, \Drupal::service('path.alias_manager')->getAliasByPath($source, $langcode), t("Alias for %source with language '@language' is correct.", - array('%source' => $source, '@language' => $langcode))); - } - - public function assertAliasExists($conditions) { - $path = \Drupal::service('path.alias_storage')->load($conditions); - $this->assertTrue($path, t('Alias with conditions @conditions found.', array('@conditions' => var_export($conditions, TRUE)))); - return $path; - } - - public function assertNoAliasExists($conditions) { - $alias = \Drupal::service('path.alias_storage')->load($conditions); - $this->assertFalse($alias, t('Alias with conditions @conditions not found.', array('@conditions' => var_export($conditions, TRUE)))); - } - - public function deleteAllAliases() { - \Drupal::database()->delete('url_alias')->execute(); - \Drupal::service('path.alias_manager')->cacheClear(); - } - - /** - * @param array $values - * - * @return \Drupal\taxonomy\VocabularyInterface - */ - public function addVocabulary(array $values = array()) { - $name = mb_strtolower($this->randomMachineName(5)); - $values += array( - 'name' => $name, - 'vid' => $name, - ); - $vocabulary = Vocabulary::create($values); - $vocabulary->save(); - - return $vocabulary; - } - - public function addTerm(VocabularyInterface $vocabulary, array $values = array()) { - $values += array( - 'name' => mb_strtolower($this->randomMachineName(5)), - 'vid' => $vocabulary->id(), - ); - - $term = Term::create($values); - $term->save(); - return $term; - } - - public function assertEntityPattern($entity_type, $bundle, $langcode = Language::LANGCODE_NOT_SPECIFIED, $expected) { - - $values = [ - 'langcode' => $langcode, - \Drupal::entityTypeManager()->getDefinition($entity_type)->getKey('bundle') => $bundle, - ]; - $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->create($values); - - $pattern = \Drupal::service('pathauto.generator')->getPatternByEntity($entity); - $this->assertIdentical($expected, $pattern->getPattern()); - } - - public function drupalGetTermByName($name, $reset = FALSE) { - if ($reset) { - // @todo - implement cache reset. - } - $terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(array('name' => $name)); - return !empty($terms) ? reset($terms) : FALSE; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php deleted file mode 100644 index b6b9e6643..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php +++ /dev/null @@ -1,191 +0,0 @@ -drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); - $this->drupalCreateContentType(array('type' => 'article')); - - // Allow other modules to add additional permissions for the admin user. - $permissions = array( - 'administer pathauto', - 'administer url aliases', - 'create url aliases', - 'administer nodes', - 'bypass node access', - 'access content overview', - ); - $this->adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - } - - function testSettingsValidation() { - $edit = array(); - $edit['max_length'] = 'abc'; - $edit['max_component_length'] = 'abc'; - $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration'); - /*$this->assertText('The field Maximum alias length is not a valid number.'); - $this->assertText('The field Maximum component length is not a valid number.');*/ - $this->assertNoText('The configuration options have been saved.'); - - $edit['max_length'] = '0'; - $edit['max_component_length'] = '0'; - $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration'); - /*$this->assertText('The field Maximum alias length cannot be less than 1.'); - $this->assertText('The field Maximum component length cannot be less than 1.');*/ - $this->assertNoText('The configuration options have been saved.'); - - $edit['max_length'] = '999'; - $edit['max_component_length'] = '999'; - $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration'); - /*$this->assertText('The field Maximum alias length cannot be greater than 255.'); - $this->assertText('The field Maximum component length cannot be greater than 255.');*/ - $this->assertNoText('The configuration options have been saved.'); - - $edit['max_length'] = '50'; - $edit['max_component_length'] = '50'; - $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration'); - $this->assertText('The configuration options have been saved.'); - } - - function testPatternsWorkflow() { - // Try to save an empty pattern, should not be allowed. - $this->drupalGet('admin/config/search/path/patterns/add'); - $edit = array( - 'type' => 'canonical_entities:node', - ); - $this->drupalPostAjaxForm(NULL, $edit, 'type'); - $edit += array( - 'bundles[page]' => TRUE, - 'label' => 'Page pattern', - 'id' => 'page_pattern', - ); - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Path pattern field is required.'); - $this->assertNoText('The configuration options have been saved.'); - - // Try to save an invalid pattern. - $edit += array( - 'pattern' => '[node:title]/[user:name]/[term:name]', - ); - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Path pattern is using the following invalid tokens: [user:name], [term:name].'); - $this->assertNoText('The configuration options have been saved.'); - - $edit['pattern'] = '#[node:title]'; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('The Path pattern is using the following invalid characters: #.'); - $this->assertNoText('The configuration options have been saved.'); - - // Checking whitespace ending of the string. - $edit['pattern'] = '[node:title] '; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('The Path pattern doesn\'t allow the patterns ending with whitespace.'); - $this->assertNoText('The configuration options have been saved.'); - - // Fix the pattern, then check that it gets saved successfully. - $edit['pattern'] = '[node:title]'; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertText('Pattern Page pattern saved.'); - - \Drupal::service('pathauto.generator')->resetCaches(); - - // Create a node with pattern enabled and check if the pattern applies. - $title = 'Page Pattern enabled'; - $alias = '/page-pattern-enabled'; - $node = $this->createNode(['title' => $title, 'type' => 'page']); - $this->drupalGet($alias); - $this->assertResponse(200); - $this->assertEntityAlias($node, $alias); - - // Edit workflow, set a new label and weight for the pattern. - $this->drupalPostForm('/admin/config/search/path/patterns', ['entities[page_pattern][weight]' => '4'], t('Save')); - $this->clickLink(t('Edit')); - $destination_query = ['query' => ['destination' => Url::fromRoute('entity.pathauto_pattern.collection')->toString()]]; - $this->assertUrl('/admin/config/search/path/patterns/page_pattern', $destination_query); - $this->assertFieldByName('pattern', '[node:title]'); - $this->assertFieldByName('label', 'Page pattern'); - $this->assertFieldChecked('edit-status'); - $this->assertLink(t('Delete')); - - $edit = array('label' => 'Test'); - $this->drupalPostForm('/admin/config/search/path/patterns/page_pattern', $edit, t('Save')); - $this->assertText('Pattern Test saved.'); - // Check that the pattern weight did not change. - $this->assertOptionSelected('edit-entities-page-pattern-weight', '4'); - - // Disable workflow. - $this->drupalGet('/admin/config/search/path/patterns'); - $this->assertNoLink(t('Enable')); - $this->clickLink(t('Disable')); - $this->assertUrl('/admin/config/search/path/patterns/page_pattern/disable', $destination_query); - $this->drupalPostForm(NULL, [], t('Disable')); - $this->assertText('Disabled pattern Test.'); - - // Load the pattern from storage and check if its disabled. - $pattern = PathautoPattern::load('page_pattern'); - $this->assertFalse($pattern->status()); - - \Drupal::service('pathauto.generator')->resetCaches(); - - // Create a node with pattern disabled and check that we have no new alias. - $title = 'Page Pattern disabled'; - $node = $this->createNode(['title' => $title, 'type' => 'page']); - $this->assertNoEntityAlias($node); - - // Enable workflow. - $this->drupalGet('/admin/config/search/path/patterns'); - $this->assertNoLink(t('Disable')); - $this->clickLink(t('Enable')); - $this->assertUrl('/admin/config/search/path/patterns/page_pattern/enable', $destination_query); - $this->drupalPostForm(NULL, [], t('Enable')); - $this->assertText('Enabled pattern Test.'); - - // Reload pattern from storage and check if its enabled. - $pattern = PathautoPattern::load('page_pattern'); - $this->assertTrue($pattern->status()); - - // Delete workflow. - $this->drupalGet('/admin/config/search/path/patterns'); - $this->clickLink(t('Delete')); - $this->assertUrl('/admin/config/search/path/patterns/page_pattern/delete', $destination_query); - $this->assertText(t('This action cannot be undone.')); - $this->drupalPostForm(NULL, [], t('Delete')); - $this->assertText('The pathauto pattern Test has been deleted.'); - - $this->assertFalse(PathautoPattern::load('page_pattern')); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php deleted file mode 100644 index 8d73a3f34..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php +++ /dev/null @@ -1,90 +0,0 @@ -adminUser = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->adminUser); - - $this->createPattern('user', '/users/[user:name]'); - } - - /** - * Basic functional testing of Pathauto with users. - */ - function testUserEditing() { - // There should be no Pathauto checkbox on user forms. - $this->drupalGet('user/' . $this->adminUser->id() . '/edit'); - $this->assertNoFieldById('path[0][pathauto]'); - } - - /** - * Test user operations. - */ - function testUserOperations() { - $account = $this->drupalCreateUser(); - - // Delete all current URL aliases. - $this->deleteAllAliases(); - - // Find the position of just created account in the user_admin_people view. - $view = Views::getView('user_admin_people'); - $view->initDisplay(); - $view->preview('page_1'); - - foreach ($view->result as $key => $row) { - if ($view->field['name']->getValue($row) == $account->getUsername()) { - break; - } - } - - $edit = array( - 'action' => 'pathauto_update_alias_user', - "user_bulk_form[$key]" => TRUE, - ); - $this->drupalPostForm('admin/people', $edit, t('Apply to selected items')); - $this->assertText('Update URL alias was applied to 1 item.'); - - $this->assertEntityAlias($account, '/users/' . mb_strtolower($account->getUsername())); - $this->assertEntityAlias($this->adminUser, '/user/' . $this->adminUser->id()); - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php b/sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php deleted file mode 100644 index a151b9507..000000000 --- a/sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php +++ /dev/null @@ -1,79 +0,0 @@ -configFactory = $config_factory; - $this->account = $account; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public function addMessage($message, $op = NULL) { - - if (!isset($this->isVerbose)) { - $config = $this->configFactory->get('pathauto.settings'); - $this->isVerbose = $config->get('verbose') && $this->account->hasPermission('notify of path changes'); - } - - if (!$this->isVerbose || (isset($op) && in_array($op, array('bulkupdate', 'return')))) { - return FALSE; - } - - if ($message) { - $this->messenger->addMessage($message); - } - - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml deleted file mode 100644 index c95b45a7d..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Pathauto testing module' -type: module -# core: '8.x' -description: 'Pathauto for Entity with string ID.' -package: Testing -dependencies: - - token - -# Information added by Drupal.org packaging script on 2018-09-08 -version: '8.x-1.3' -core: '8.x' -project: 'pathauto' -datestamp: 1536407890 diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php deleted file mode 100644 index afaa157f4..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php +++ /dev/null @@ -1,50 +0,0 @@ -setLabel('ID') - ->setReadOnly(TRUE) - // A bigger value will not be allowed to build the index. - ->setSetting('max_length', 191); - $fields['name'] = BaseFieldDefinition::create('string') - ->setLabel('Name'); - $fields['path'] = BaseFieldDefinition::create('path') - ->setLabel('Path') - ->setComputed(TRUE); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml deleted file mode 100644 index 249516f5c..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml +++ /dev/null @@ -1,231 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy - - user -id: articles -label: articles -module: pathauto_views_test -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - quantity: 9 - style: - type: default - row: - type: 'entity:node' - options: - view_mode: teaser - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - article: article - entity_type: node - entity_field: type - plugin_id: bundle - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: articles - header: { } - footer: { } - empty: { } - relationships: { } - arguments: - tid: - id: tid - table: taxonomy_index - field: tid - relationship: none - group_type: group - admin_label: '' - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - add_table: false - require_value: false - reduce_duplicates: false - plugin_id: taxonomy_index_tid - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: articles - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml deleted file mode 100644 index c11eb783a..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Views Test Config' -type: module -description: 'Provides default views for tests.' -package: Testing -# version: VERSION -# core: 8.x -dependencies: - - views - -# Information added by Drupal.org packaging script on 2018-09-08 -version: '8.x-1.3' -core: '8.x' -project: 'pathauto' -datestamp: 1536407890 diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php deleted file mode 100644 index e72f42d40..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php +++ /dev/null @@ -1,130 +0,0 @@ -register('keyvalue.database', KeyValueDatabaseFactory::class) - ->addArgument(new PhpSerialize()) - ->addArgument($container->get('database')) - ->addTag('persist'); - $container->setAlias('keyvalue', 'keyvalue.database'); - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->installSchema('system', ['key_value']); - $this->installConfig(['system', 'pathauto']); - $this->installEntitySchema('pathauto_string_id_test'); - $this->createPattern('pathauto_string_id_test', '/[pathauto_string_id_test:name]'); - /** @var \Drupal\pathauto\AliasTypeManager $alias_type_manager */ - $alias_type_manager = $this->container->get('plugin.manager.alias_type'); - $this->aliasType = $alias_type_manager->createInstance('canonical_entities:pathauto_string_id_test'); - } - - /** - * Test aliasing entities with long string ID. - * - * @dataProvider entityWithStringIdProvider - * - * @param string|int $id - * The entity ID - * @param string $expected_key - * The expected key for 'pathauto_state.*' collections. - */ - public function testEntityWithStringId($id, $expected_key) { - $entity = PathautoStringIdTest::create([ - 'id' => $id, - 'name' => $name = $this->randomMachineName(), - ]); - $entity->save(); - - // Check that the path was generated. - $this->assertEntityAlias($entity, mb_strtolower("/$name")); - // Check that the path auto state was saved with the expected key. - $value = \Drupal::keyValue('pathauto_state.pathauto_string_id_test')->get($expected_key); - $this->assertEquals(PathautoState::CREATE, $value); - - $context = []; - // Batch delete uses the key-value store collection 'pathauto_state.*. We - // test that after a bulk delete all aliases are removed. Running only once - // the batch delete process is enough as the batch size is 100. - $this->aliasType->batchDelete($context); - - // Check that the paths were removed on batch delete. - $this->assertNoEntityAliasExists($entity, "/$name"); - } - - /** - * Provides test cases for ::testEntityWithStringId(). - * - * @see \Drupal\Tests\pathauto\Kernel\PathautoEntityWithStringIdTest::testEntityWithStringId() - */ - public function entityWithStringIdProvider() { - return [ - 'ascii with less or equal 128 chars' => [ - str_repeat('a', 128), str_repeat('a', 128) - ], - 'ascii with over 128 chars' => [ - str_repeat('a', 191), Crypt::hashBase64(str_repeat('a', 191)) - ], - 'non-ascii with less or equal 128 chars' => [ - str_repeat('社', 128), Crypt::hashBase64(str_repeat('社', 128)) - ], - 'non-ascii with over 128 chars' => [ - str_repeat('社', 191), Crypt::hashBase64(str_repeat('社', 191)) - ], - 'simulating an integer id' => [ - 123, '123' - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php deleted file mode 100644 index 1fffa4d08..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php +++ /dev/null @@ -1,586 +0,0 @@ -installConfig(array('pathauto', 'taxonomy', 'system', 'node')); - - $this->installEntitySchema('user'); - $this->installEntitySchema('node'); - $this->installEntitySchema('taxonomy_term'); - - ConfigurableLanguage::createFromLangcode('fr')->save(); - - $this->installSchema('node', array('node_access')); - $this->installSchema('system', array('url_alias', 'sequences', 'router')); - - $type = NodeType::create(['type' => 'page']); - $type->save(); - node_add_body_field($type); - - $this->nodePattern = $this->createPattern('node', '/content/[node:title]'); - $this->userPattern = $this->createPattern('user', '/users/[user:name]'); - - \Drupal::service('router.builder')->rebuild(); - - $this->currentUser = User::create(array('name' => $this->randomMachineName())); - $this->currentUser->save(); - } - - /** - * Test _pathauto_get_schema_alias_maxlength(). - */ - public function testGetSchemaAliasMaxLength() { - $this->assertIdentical(\Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength(), 255); - } - - /** - * Test pathauto_pattern_load_by_entity(). - */ - public function testPatternLoadByEntity() { - $pattern = $this->createPattern('node', '/article/[node:title]', -1); - $this->addBundleCondition($pattern, 'node', 'article'); - $pattern->save(); - - $pattern = $this->createPattern('node', '/article/en/[node:title]', -2); - $this->addBundleCondition($pattern, 'node', 'article'); - $pattern->addSelectionCondition( - [ - 'id' => 'language', - 'langcodes' => [ - 'en' => 'en', - ], - 'negate' => FALSE, - 'context_mapping' => [ - 'language' => 'node:langcode:language', - ] - ] - ); - - $pattern->addRelationship('node:langcode:language'); - $pattern->save(); - - $pattern = $this->createPattern('node', '/[node:title]', -1); - $this->addBundleCondition($pattern, 'node', 'page'); - $pattern->save(); - - $tests = array( - array( - 'entity' => 'node', - 'values' => [ - 'title' => 'Article fr', - 'type' => 'article', - 'langcode' => 'fr', - ], - 'expected' => '/article/[node:title]', - ), - array( - 'entity' => 'node', - 'values' => [ - 'title' => 'Article en', - 'type' => 'article', - 'langcode' => 'en', - ], - 'expected' => '/article/en/[node:title]', - ), - array( - 'entity' => 'node', - 'values' => [ - 'title' => 'Article und', - 'type' => 'article', - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - 'expected' => '/article/[node:title]', - ), - array( - 'entity' => 'node', - 'values' => [ - 'title' => 'Page', - 'type' => 'page', - ], - 'expected' => '/[node:title]', - ), - array( - 'entity' => 'user', - 'values' => [ - 'name' => 'User', - ], - 'expected' => '/users/[user:name]', - ), - ); - foreach ($tests as $test) { - $entity = \Drupal::entityTypeManager()->getStorage($test['entity'])->create($test['values']); - $entity->save(); - $actual = \Drupal::service('pathauto.generator')->getPatternByEntity($entity); - $this->assertIdentical($actual->getPattern(), $test['expected'], t("Correct pattern returned for @entity_type with @values", array( - '@entity' => $test['entity'], - '@values' => print_r($test['values'], TRUE), - ))); - } - } - - /** - * Test potential conflicts with the same alias in different languages. - */ - public function testSameTitleDifferentLanguages() { - // Create two English articles with the same title. - $edit = [ - 'title' => 'Sample page', - 'type' => 'page', - 'langcode' => 'en', - ]; - $node1 = $this->drupalCreateNode($edit); - $this->assertEntityAlias($node1, '/content/sample-page', 'en'); - - $node2 = $this->drupalCreateNode($edit); - $this->assertEntityAlias($node2, '/content/sample-page-0', 'en'); - - // Now, create a French article with the same title, and verify that it gets - // the basic alias with the correct langcode. - $edit['langcode'] = 'fr'; - $node3 = $this->drupalCreateNode($edit); - $this->assertEntityAlias($node3, '/content/sample-page', 'fr'); - } - - /** - * Test pathauto_cleanstring(). - */ - public function testCleanString() { - - // Test with default settings defined in pathauto.settings.yml. - $this->installConfig(array('pathauto')); - \Drupal::service('pathauto.generator')->resetCaches(); - - $tests = array(); - - // Test the 'ignored words' removal. - $tests['this'] = 'this'; - $tests['this with that'] = 'this-with-that'; - $tests['this thing with that thing'] = 'thing-thing'; - - // Test 'ignored words' removal and duplicate separator removal. - $tests[' - Pathauto is the greatest - module ever - '] = 'pathauto-greatest-module-ever'; - - // Test length truncation and lowering of strings. - $long_string = $this->randomMachineName(120); - $tests[$long_string] = strtolower(substr($long_string, 0, 100)); - - // Test that HTML tags are removed. - $tests['This text has
HTML tags.'] = 'text-has-html-tags'; - $tests[Html::escape('This text has
HTML tags.')] = 'text-has-html-tags'; - - // Transliteration. - $tests['ľščťžýáíéňô'] = 'lsctzyaieno'; - - foreach ($tests as $input => $expected) { - $output = \Drupal::service('pathauto.alias_cleaner')->cleanString($input); - $this->assertEqual($output, $expected, t("Drupal::service('pathauto.alias_cleaner')->cleanString('@input') expected '@expected', actual '@output'", array( - '@input' => $input, - '@expected' => $expected, - '@output' => $output, - ))); - } - } - - /** - * Test pathauto_clean_alias(). - */ - public function testCleanAlias() { - $tests = array(); - $tests['one/two/three'] = '/one/two/three'; - $tests['/one/two/three/'] = '/one/two/three'; - $tests['one//two///three'] = '/one/two/three'; - $tests['one/two--three/-/--/-/--/four---five'] = '/one/two-three/four-five'; - $tests['one/-//three--/four'] = '/one/three/four'; - - foreach ($tests as $input => $expected) { - $output = \Drupal::service('pathauto.alias_cleaner')->cleanAlias($input); - $this->assertEqual($output, $expected, t("Drupal::service('pathauto.generator')->cleanAlias('@input') expected '@expected', actual '@output'", array( - '@input' => $input, - '@expected' => $expected, - '@output' => $output, - ))); - } - } - - /** - * Test pathauto_path_delete_multiple(). - */ - public function testPathDeleteMultiple() { - $this->saveAlias('/node/1', '/node-1-alias'); - $this->saveAlias('/node/1/view', '/node-1-alias/view'); - $this->saveAlias('/node/1', '/node-1-alias-en', 'en'); - $this->saveAlias('/node/1', '/node-1-alias-fr', 'fr'); - $this->saveAlias('/node/2', '/node-2-alias'); - $this->saveAlias('/node/10', '/node-10-alias'); - - \Drupal::service('pathauto.alias_storage_helper')->deleteBySourcePrefix('/node/1'); - $this->assertNoAliasExists(array('source' => "/node/1")); - $this->assertNoAliasExists(array('source' => "/node/1/view")); - $this->assertAliasExists(array('source' => "/node/2")); - $this->assertAliasExists(array('source' => "/node/10")); - } - - /** - * Test the different update actions in \Drupal::service('pathauto.generator')->createEntityAlias(). - */ - public function testUpdateActions() { - $config = $this->config('pathauto.settings'); - - // Test PATHAUTO_UPDATE_ACTION_NO_NEW with unaliased node and 'insert'. - $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW); - $config->save(); - $node = $this->drupalCreateNode(array('title' => 'First title')); - $this->assertEntityAlias($node, '/content/first-title'); - - $node->path->pathauto = PathautoState::CREATE; - - // Default action is PATHAUTO_UPDATE_ACTION_DELETE. - $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_DELETE); - $config->save(); - $node->setTitle('Second title'); - $node->save(); - $this->assertEntityAlias($node, '/content/second-title'); - $this->assertNoAliasExists(array('alias' => '/content/first-title')); - - // Test PATHAUTO_UPDATE_ACTION_LEAVE. - $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_LEAVE); - $config->save(); - $node->setTitle('Third title'); - $node->save(); - $this->assertEntityAlias($node, '/content/third-title'); - $this->assertAliasExists(array('source' => '/' . $node->toUrl()->getInternalPath(), 'alias' => '/content/second-title')); - - $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_DELETE); - $config->save(); - $node->setTitle('Fourth title'); - $node->save(); - $this->assertEntityAlias($node, '/content/fourth-title'); - $this->assertNoAliasExists(array('alias' => '/content/third-title')); - // The older second alias is not deleted yet. - $older_path = $this->assertAliasExists(array('source' => '/' . $node->toUrl()->getInternalPath(), 'alias' => '/content/second-title')); - \Drupal::service('path.alias_storage')->delete($older_path); - - $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW); - $config->save(); - $node->setTitle('Fifth title'); - $node->save(); - $this->assertEntityAlias($node, '/content/fourth-title'); - $this->assertNoAliasExists(array('alias' => '/content/fifth-title')); - - // Test PATHAUTO_UPDATE_ACTION_NO_NEW with unaliased node and 'update'. - $this->deleteAllAliases(); - $node->save(); - $this->assertEntityAlias($node, '/content/fifth-title'); - - // Test PATHAUTO_UPDATE_ACTION_NO_NEW with unaliased node and 'bulkupdate'. - $this->deleteAllAliases(); - $node->setTitle('Sixth title'); - \Drupal::service('pathauto.generator')->updateEntityAlias($node, 'bulkupdate'); - $this->assertEntityAlias($node, '/content/sixth-title'); - } - - /** - * Test that \Drupal::service('pathauto.generator')->createEntityAlias() will - * not create an alias for a pattern that does not get any tokens replaced. - */ - public function testNoTokensNoAlias() { - $this->installConfig(['filter']); - $this->nodePattern - ->setPattern('/content/[node:body]') - ->save(); - - $node = $this->drupalCreateNode(); - $this->assertNoEntityAliasExists($node); - - $node->body->value = 'hello'; - $node->save(); - $this->assertEntityAlias($node, '/content/hello'); - } - - /** - * Test the handling of path vs non-path tokens in pathauto_clean_token_values(). - */ - public function testPathTokens() { - $this->createPattern('taxonomy_term', '/[term:parent:url:path]/[term:name]'); - - $vocab = $this->addVocabulary(); - - $term1 = $this->addTerm($vocab, array('name' => 'Parent term')); - $this->assertEntityAlias($term1, '/parent-term'); - - $term2 = $this->addTerm($vocab, array('name' => 'Child term', 'parent' => $term1->id())); - $this->assertEntityAlias($term2, '/parent-term/child-term'); - - $this->saveEntityAlias($term1, '/My Crazy/Alias/'); - $term2->save(); - $this->assertEntityAlias($term2, '/My Crazy/Alias/child-term'); - } - - /** - * Test using fields for path structures. - */ - function testParentChildPathTokens() { - // First create a field which will be used to create the path. It must - // begin with a letter. - $this->installEntitySchema('taxonomy_term'); - - Vocabulary::create(['vid' => 'tags'])->save(); - - $fieldname = 'a' . mb_strtolower($this->randomMachineName()); - $field_storage = FieldStorageConfig::create(['entity_type' => 'taxonomy_term', 'field_name' => $fieldname, 'type' => 'string']); - $field_storage->save(); - $field = FieldConfig::create(['field_storage' => $field_storage, 'bundle' => 'tags']); - $field->save(); - - $display = entity_get_display('taxonomy_term', 'tags', 'default'); - $display->setComponent($fieldname, ['type' => 'string']); - $display->save(); - - // Make the path pattern of a field use the value of this field appended - // to the parent taxonomy term's pattern if there is one. - $this->createPattern('taxonomy_term', '/[term:parents:join-path]/[term:' . $fieldname . ']'); - - // Start by creating a parent term. - $parent = Term::create(['vid' => 'tags', $fieldname => $this->randomMachineName(), 'name' => $this->randomMachineName()]); - $parent->save(); - - // Create the child term. - $child = Term::create(['vid' => 'tags', $fieldname => $this->randomMachineName(), 'parent' => $parent, 'name' => $this->randomMachineName()]); - $child->save(); - $this->assertEntityAlias($child, '/' . mb_strtolower($parent->getName() . '/' . $child->$fieldname->value)); - - // Re-saving the parent term should not modify the child term's alias. - $parent->save(); - $this->assertEntityAlias($child, '/' . mb_strtolower($parent->getName() . '/' . $child->$fieldname->value)); - } - - /** - * Tests aliases on taxonomy terms. - */ - public function testTaxonomyPattern() { - // Create a vocabulary and test that it's pattern variable works. - $vocab = $this->addVocabulary(array('vid' => 'name')); - $this->createPattern('taxonomy_term', 'base'); - $pattern = $this->createPattern('taxonomy_term', 'bundle', -1); - $this->addBundleCondition($pattern, 'taxonomy_term', 'name'); - $pattern->save(); - $this->assertEntityPattern('taxonomy_term', 'name', Language::LANGCODE_NOT_SPECIFIED, 'bundle'); - } - - function testNoExistingPathAliases() { - $this->config('pathauto.settings') - ->set('punctuation.period', PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING) - ->save(); - - $this->nodePattern - ->setPattern('[node:title]') - ->save(); - - // Check that Pathauto does not create an alias of '/admin'. - $node = $this->drupalCreateNode(array('title' => 'Admin', 'type' => 'page')); - $this->assertEntityAlias($node, '/admin-0'); - - // Check that Pathauto does not create an alias of '/modules'. - $node->setTitle('Modules'); - $node->save(); - $this->assertEntityAlias($node, '/modules-0'); - - // Check that Pathauto does not create an alias of '/index.php'. - $node->setTitle('index.php'); - $node->save(); - $this->assertEntityAlias($node, '/index.php-0'); - - // Check that a safe value gets an automatic alias. This is also a control - // to ensure the above tests work properly. - $node->setTitle('Safe value'); - $node->save(); - $this->assertEntityAlias($node, '/safe-value'); - } - - /** - * Test programmatic entity creation for aliases. - */ - function testProgrammaticEntityCreation() { - $this->createPattern('taxonomy_term', '/[term:vocabulary]/[term:name]'); - $node = $this->drupalCreateNode(array('title' => 'Test node', 'path' => array('pathauto' => TRUE))); - $this->assertEntityAlias($node, '/content/test-node'); - - $vocabulary = $this->addVocabulary(array('name' => 'Tags')); - $term = $this->addTerm($vocabulary, array('name' => 'Test term', 'path' => array('pathauto' => TRUE))); - $this->assertEntityAlias($term, '/tags/test-term'); - - $edit['name'] = 'Test user'; - $edit['mail'] = 'test-user@example.com'; - $edit['pass'] = user_password(); - $edit['path'] = array('pathauto' => TRUE); - $edit['status'] = 1; - $account = User::create($edit); - $account->save(); - $this->assertEntityAlias($account, '/users/test-user'); - } - - /** - * Tests word safe alias truncating. - */ - function testPathAliasUniquifyWordsafe() { - $this->config('pathauto.settings') - ->set('max_length', 26) - ->save(); - - $node_1 = $this->drupalCreateNode(array('title' => 'thequick brownfox jumpedover thelazydog', 'type' => 'page')); - $node_2 = $this->drupalCreateNode(array('title' => 'thequick brownfox jumpedover thelazydog', 'type' => 'page')); - - // Check that alias uniquifying is truncating with $wordsafe param set to - // TRUE. - // If it doesn't path alias result would be content/thequick-brownf-0 - $this->assertEntityAlias($node_1, '/content/thequick-brownfox'); - $this->assertEntityAlias($node_2, '/content/thequick-0'); - } - - /** - * Test if aliases are (not) generated with enabled/disabled patterns. - */ - function testPatternStatus() { - // Create a node to get an alias for. - $title = 'Pattern enabled'; - $alias = '/content/pattern-enabled'; - $node1 = $this->drupalCreateNode(['title' => $title, 'type' => 'page']); - $this->assertEntityAlias($node1, $alias); - - // Disable the pattern, save the node again and make sure the alias is still - // working. - $this->nodePattern->setStatus(FALSE)->save(); - - $node1->save(); - $this->assertEntityAlias($node1, $alias); - - // Create a new node with disabled pattern and make sure there is no new - // alias created. - $title = 'Pattern disabled'; - $node2 = $this->drupalCreateNode(['title' => $title, 'type' => 'page']); - $this->assertNoEntityAlias($node2); - } - - /** - * Tests that enabled entity types generates the necessary fields and plugins. - */ - public function testSettingChangeInvalidatesCache() { - - $this->installConfig(['pathauto']); - - $this->enableModules(['entity_test']); - - $definitions = \Drupal::service('plugin.manager.alias_type')->getDefinitions(); - $this->assertFalse(isset($definitions['canonical_entities:entity_test'])); - - $fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('entity_test'); - $this->assertFalse(isset($fields['path'])); - - $this->config('pathauto.settings') - ->set('enabled_entity_types', ['user', 'entity_test']) - ->save(); - - $definitions = \Drupal::service('plugin.manager.alias_type')->getDefinitions(); - $this->assertTrue(isset($definitions['canonical_entities:entity_test'])); - - $fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('entity_test'); - $this->assertTrue(isset($fields['path'])); - - } - - /** - * Tests that aliases are only generated for default revisions. - */ - public function testDefaultRevision() { - $node1 = $this->drupalCreateNode(['title' => 'Default revision', 'type' => 'page']); - $this->assertEntityAlias($node1, '/content/default-revision'); - - $node1->setNewRevision(TRUE); - $node1->isDefaultRevision(FALSE); - $node1->setTitle('New non-default-revision'); - $node1->save(); - - $this->assertEntityAlias($node1, '/content/default-revision'); - } - - /** - * Tests that the pathauto state property gets set to CREATED for new nodes. - * - * In some cases, this can trigger $node->path to be set up with no default - * value for the pathauto property. - */ - public function testCreateNodeWhileAccessingPath() { - $node = Node::create([ - 'type' => 'article', - 'title' => 'TestAlias', - ]); - $node->path->langcode; - $node->save(); - $this->assertEntityAlias($node, '/content/testalias'); - } - - /** - * Creates a node programmatically. - * - * @param array $settings - * The array of values for the node. - * - * @return \Drupal\node\Entity\Node - * The created node. - */ - protected function drupalCreateNode(array $settings = array()) { - // Populate defaults array. - $settings += array( - 'title' => $this->randomMachineName(8), - 'type' => 'page', - ); - - $node = Node::create($settings); - $node->save(); - - return $node; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php deleted file mode 100644 index 1a05007f6..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php +++ /dev/null @@ -1,114 +0,0 @@ -installConfig(array('pathauto')); - - $array = array( - 'test first arg', - 'The Array / value', - ); - - $tokens = array( - 'join-path' => 'test-first-arg/array-value', - ); - $data['array'] = $array; - $replacements = $this->assertTokens('array', $data, $tokens); - - // Ensure that the cleanTokenValues() method does not alter this token value. - /* @var \Drupal\pathauto\AliasCleanerInterface $alias_cleaner */ - $alias_cleaner = \Drupal::service('pathauto.alias_cleaner'); - $alias_cleaner->cleanTokenValues($replacements, $data, array()); - $this->assertEqual($replacements['[array:join-path]'], 'test-first-arg/array-value'); - - // Test additional token cleaning and its configuration. - $safe_tokens = $this->config('pathauto.settings')->get('safe_tokens'); - $safe_tokens[] = 'safe'; - $this->config('pathauto.settings') - ->set('safe_tokens', $safe_tokens) - ->save(); - - $safe_tokens = [ - '[example:path]', - '[example:url]', - '[example:url-brief]', - '[example:login-url]', - '[example:login-url:relative]', - '[example:url:relative]', - '[example:safe]', - ]; - $unsafe_tokens = [ - '[example:path_part]', - '[example:something_url]', - '[example:unsafe]', - ]; - foreach ($safe_tokens as $token) { - $replacements = [ - $token => 'this/is/a/path', - ]; - $alias_cleaner->cleanTokenValues($replacements); - $this->assertEquals('this/is/a/path', $replacements[$token], "Token $token cleaned."); - } - foreach ($unsafe_tokens as $token) { - $replacements = [ - $token => 'This is not a / path', - ]; - $alias_cleaner->cleanTokenValues($replacements); - $this->assertEquals('not-path', $replacements[$token], "Token $token not cleaned."); - } - } - - /** - * Function copied from TokenTestHelper::assertTokens(). - */ - public function assertTokens($type, array $data, array $tokens, array $options = array()) { - $input = $this->mapTokenNames($type, array_keys($tokens)); - $bubbleable_metadata = new BubbleableMetadata(); - $replacements = \Drupal::token()->generate($type, $input, $data, $options, $bubbleable_metadata); - foreach ($tokens as $name => $expected) { - $token = $input[$name]; - if (!isset($expected)) { - $this->assertTrue(!isset($values[$token]), t("Token value for @token was not generated.", array('@type' => $type, '@token' => $token))); - } - elseif (!isset($replacements[$token])) { - $this->fail(t("Token value for @token was not generated.", array('@type' => $type, '@token' => $token))); - } - elseif (!empty($options['regex'])) { - $this->assertTrue(preg_match('/^' . $expected . '$/', $replacements[$token]), t("Token value for @token was '@actual', matching regular expression pattern '@expected'.", array('@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected))); - } - else { - $this->assertIdentical($replacements[$token], $expected, t("Token value for @token was '@actual', expected value '@expected'.", array('@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected))); - } - } - - return $replacements; - } - - public function mapTokenNames($type, array $tokens = array()) { - $return = array(); - foreach ($tokens as $token) { - $return[$token] = "[$type:$token]"; - } - return $return; - } - -} diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php deleted file mode 100644 index 13c5c058e..000000000 --- a/sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php +++ /dev/null @@ -1,54 +0,0 @@ -getConfigFactoryStub(['pathauto.settings' => ['verbose' => TRUE]]); - $account = $this->createMock(AccountInterface::class); - $account->expects($this->once()) - ->method('hasPermission') - ->withAnyParameters() - ->willReturn(TRUE); - $messenger = $this->createMock(MessengerInterface::class); - - $this->messenger = new VerboseMessenger($config_factory, $account, $messenger); - } - - /** - * Tests add messages. - * - * @covers ::addMessage - */ - public function testAddMessage() { - $this->assertTrue($this->messenger->addMessage("Test message"), "The message was added"); - } - - /** - * @covers ::addMessage - */ - public function testDoNotAddMessageWhileBulkupdate() { - $this->assertFalse($this->messenger->addMessage("Test message", "bulkupdate"), "The message was NOT added"); - } - -} diff --git a/sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt b/sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/permissions_filter/README.txt b/sites/all/modules/contrib/admin/permissions_filter/README.txt deleted file mode 100644 index e2a928552..000000000 --- a/sites/all/modules/contrib/admin/permissions_filter/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -The permission Filter module is a simple approach to provide a search -functionality in the people/permission page. It will help site admin to -get the desired result without scrolling down. - - Install - ------- - Simply install Permission Filter like you would install any other module. - - 1) Copy the permission_filter folder in the modules folder in your Drupal docroot. - - 2) Enable the module using Manage -> Extend (/admin/modules). - - 3) Goto People --> Permissions (/admin/people/permissions). - diff --git a/sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js b/sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js deleted file mode 100644 index 31b616dd7..000000000 --- a/sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file - * Permission page behaviors. - */ - -(function ($, Drupal, debounce) { - - 'use strict'; - Drupal.behaviors.permissionTableFilterByText = { - attach: function (context, settings) { - var $input = $('input.table-filter-text').once('table-filter-text'); - var $table = $($input.attr('data-table')); - var $rowsAndDetails; - var $rows; - var $details; - var searching = false; - - function hidePackageDetails(index, element) { - var $packDetails = $(element); - var $visibleRows = $packDetails.find('tbody tr:visible'); - $packDetails.toggle($visibleRows.length > 0); - } - - function filterPermissionList(e) { - var query = $(e.target).val(); - // Case insensitive expression to find query at the beginning of a word. - var re = new RegExp('\\b' + query, 'i'); - - function showPermissionRow(index, row) { - var $row = $(row); - var $sources = $row.find('.table-filter-text-source, .module, .permission'); - var textMatch = $sources.text().search(re) !== -1; - $row.closest('tr').toggle(textMatch); - } - // Search over all rows and packages. - $rowsAndDetails.show(); - - // Filter if the length of the query is at least 2 characters. - if (query.length >= 2) { - searching = true; - $rows.each(showPermissionRow); - $details.not('[open]').attr('data-drupal-system-state', 'forced-open'); - $details.attr('open', true).each(hidePackageDetails); - - Drupal.announce( - Drupal.t( - '!permissions permissions are available in the modified list.', - {'!permissions': $rowsAndDetails.find('tbody tr:visible').length} - ) - ); - } - else if (searching) { - searching = false; - $rowsAndDetails.show(); - $details.filter('[data-drupal-system-state="forced-open"]') - .removeAttr('data-drupal-system-state') - .attr('open', false); - } - } - - function preventEnterKey(event) { - if (event.which === 13) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if ($table.length) { - $rowsAndDetails = $table.find('tr, details'); - $rows = $table.find('tbody tr'); - $details = $rowsAndDetails.filter('.js-permissions'); - - $input.on({ - keyup: debounce(filterPermissionList, 200), - keydown: preventEnterKey - }); - } - } - }; - -}(jQuery, Drupal, Drupal.debounce)); diff --git a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml b/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml deleted file mode 100644 index 17af6cf51..000000000 --- a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Permission Filter -type: module -description: Create a filter for permission page. -# core: 8.x -package: Other - -# Information added by Drupal.org packaging script on 2016-10-26 -version: '8.x-1.0' -core: '8.x' -project: 'permissions_filter' -datestamp: 1477463041 diff --git a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml b/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml deleted file mode 100644 index 7400ca82e..000000000 --- a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml +++ /dev/null @@ -1,9 +0,0 @@ -permissions_js: - version: VERSION - js: - js/permissions_filter.js: {} - dependencies: - - core/jquery - - core/drupal - - core/drupal.debounce - - core/jquery.once \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module b/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module deleted file mode 100755 index 267a027f9..000000000 --- a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module +++ /dev/null @@ -1,49 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('Create a filter for permission page.') . '

'; - return $output; - - default: - } -} - -/** - * Implements hook_form_alter() on behalf of permissions_filter.module. - */ -function permissions_filter_form_alter(&$form, FormStateInterface $form_state, $form_id) { - if ($form_id == 'user_admin_permissions') { - $form['filters'] = array( - '#type' => 'container', - '#attributes' => array( - 'class' => array('table-filter', 'js-show'), - ), - '#weight' => -1, - ); - $form['filters']['search_permission'] = array( - '#type' => 'search', - '#title' => t('Enter a part of the Permission name or description'), - '#title_display' => 'invisible', - '#size' => 30, - '#placeholder' => t('Filter by name or description'), - '#description' => t('Enter a part of the permission'), - '#attributes' => array( - 'class' => array('table-filter-text'), - 'data-table' => '#user-admin-permissions', - 'autocomplete' => 'off', - ), - ); - $form['#attached']['library'][] = 'permissions_filter/permissions_js'; - } -} diff --git a/sites/all/modules/contrib/admin/piwik/.eslintrc b/sites/all/modules/contrib/admin/piwik/.eslintrc deleted file mode 100644 index c7e9cdfe2..000000000 --- a/sites/all/modules/contrib/admin/piwik/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "globals": { - "_paq": true - } -} diff --git a/sites/all/modules/contrib/admin/piwik/LICENSE.txt b/sites/all/modules/contrib/admin/piwik/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/piwik/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/piwik/README.txt b/sites/all/modules/contrib/admin/piwik/README.txt deleted file mode 100644 index d7c05f410..000000000 --- a/sites/all/modules/contrib/admin/piwik/README.txt +++ /dev/null @@ -1,109 +0,0 @@ - -Module: Piwik - Web analytics -Author: Alexander Hass - - -Description -=========== -Adds the Piwik tracking system to your website. - -Requirements -============ - -* Piwik installation -* Piwik website ID - - -Installation -============ -* Copy the 'piwik' module directory in to your Drupal 'modules' -directory as usual. - - -Usage -===== -In the settings page enter your Piwik website ID. - -All pages will now have the required JavaScript added to the -HTML footer can confirm this by viewing the page source from -your browser. - -Page specific tracking -==================================================== -The default is set to "Add to every page except the listed pages". By -default the following pages are listed for exclusion: - -/admin -/admin/* -/batch -/node/add* -/node/*/* -/user/*/* - -These defaults are changeable by the website administrator or any other -user with 'Administer Piwik' permission. - -Like the blocks visibility settings in Drupal core, there is a choice for -"Add if the following PHP code returns TRUE." Sample PHP snippets that can be -used in this textarea can be found on the handbook page "Overview-approach to -block visibility" at http://drupal.org/node/64135. - -Custom variables -================= -One example for custom variables tracking is the "User roles" tracking. Enter -the below configuration data into the custom variables settings form under -admin/config/system/piwik. - -Slot: 1 -Name: User roles -Value: [current-user:piwik-role-names] -Scope: Visitor - -Slot: 1 -Name: User ids -Value: [current-user:piwik-role-ids] -Scope: Visitor - -More details about custom variables can be found in the Piwik API documentation -at http://piwik.org/docs/javascript-tracking/#toc-custom-variables. - - -Advanced Settings -================= -You can include additional JavaScript snippets in the custom javascript -code textarea. These can be found on various blog posts, or on the -official Piwik pages. Support is not provided for any customisations -you include. - -To speed up page loading you may also cache the Piwik "piwik.js" -file locally. - -Known issues -============ -Drupal requirements (http://drupal.org/requirements) tell you to configure -PHP with "session.save_handler = user", but your Piwik installation may -not work with this configuration and gives you a server error 500. - -1. You are able to workaround with the PHP default in your php.ini: - - [Session] - session.save_handler = files - -2. With Apache you may overwrite the PHP setting for the Piwik directory only. - If Piwik is installed in /piwik you are able to create a .htaccess file in - this directory with the below code: - - # PHP 4, Apache 1. - - php_value session.save_handler files - - - # PHP 4, Apache 2. - - php_value session.save_handler files - - - # PHP 5, Apache 1 and 2. - - php_value session.save_handler files - diff --git a/sites/all/modules/contrib/admin/piwik/composer.json b/sites/all/modules/contrib/admin/piwik/composer.json deleted file mode 100644 index 5419bea3c..000000000 --- a/sites/all/modules/contrib/admin/piwik/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "drupal/piwik", - "description": "Adds Piwik javascript tracking code to all your site's pages", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/piwik", - "authors": [ - { - "name": "hass", - "homepage": "https://www.drupal.org/u/hass" - }, - { - "name": "See other contributors", - "homepage":"https://www.drupal.org/node/247808/committers" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/piwik", - "source": "http://git.drupal.org/project/piwik.git" - }, - "license": "GPL-2.0+", - "require": { - "drupal/matomo": "^1.0" - } -} diff --git a/sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml b/sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml deleted file mode 100644 index d00da26d6..000000000 --- a/sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml +++ /dev/null @@ -1,29 +0,0 @@ -site_id: '' -url_http: '' -url_https: '' -domain_mode: 0 -visibility: - request_path_mode: 0 - request_path_pages: "/admin\n/admin/*\n/batch\n/node/add*\n/node/*/*\n/user/*/*" - user_role_mode: 0 - user_role_roles: { } - user_account_mode: 0 -track: - mailto: true - files: true - files_extensions: '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip' - colorbox: true - userid: false - messages: { } - site_search: false -privacy: - donottrack: true -custom: - variable: { } -codesnippet: - before: '' - after: '' -translation_set: false -cache: false -page_title_hierarchy: false -page_title_hierarchy_exclude_home: true diff --git a/sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml b/sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml deleted file mode 100644 index 442ec6044..000000000 --- a/sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml +++ /dev/null @@ -1,120 +0,0 @@ -# Schema for the configuration files of the piwik module. - -piwik.settings: - type: config_object - label: 'Piwik settings' - mapping: - site_id: - type: string - label: 'Piwik site ID' - url_http: - type: string - label: 'Piwik HTTP URL' - url_https: - type: string - label: 'Piwik HTTPS URL' - domain_mode: - type: integer - label: 'What are you tracking?' - visibility: - type: mapping - label: 'Visibility' - mapping: - request_path_mode: - type: integer - label: 'Add tracking to specific pages' - request_path_pages: - type: string - label: 'Pages by their paths' - user_role_mode: - type: integer - label: 'Add tracking for specific roles' - user_role_roles: - type: sequence - label: 'Roles' - sequence: - type: string - label: 'Role' - user_account_mode: - type: integer - label: 'Allow users to customize tracking on their account page' - track: - type: mapping - label: 'Links and downloads' - mapping: - mailto: - type: boolean - label: 'Track clicks on mailto links' - files: - type: boolean - label: 'Track downloads' - files_extensions: - type: string - label: 'File extension list' - colorbox: - type: boolean - label: 'Track content in colorbox modal dialogs' - userid: - type: boolean - label: 'Track User ID' - messages: - type: sequence - label: 'Track messages of type' - sequence: - type: string - label: 'Message type' - site_search: - type: boolean - label: 'Track internal search' - privacy: - type: mapping - label: 'Privacy' - mapping: - donottrack: - type: boolean - label: 'Universal web tracking opt-out' - custom: - type: mapping - label: 'Custom variables' - mapping: - variable: - type: sequence - label: 'Custom variable' - sequence: - type: mapping - label: 'Variable' - mapping: - slot: - type: integer - label: 'Slot number' - name: - type: string - label: 'The custom variable name.' - value: - type: string - label: 'The custom variable value.' - scope: - type: string - label: 'The scope for the custom variable.' - codesnippet: - type: mapping - label: 'Custom code snippets' - mapping: - before: - type: string - label: 'Code snippet (before)' - after: - type: string - label: 'Code snippet (after)' - translation_set: - type: boolean - label: 'Track translation sets as one unit' - cache: - type: boolean - label: 'Locally cache tracking code file' - page_title_hierarchy: - type: boolean - label: 'Show page titles as hierarchy like breadcrumbs' - page_title_hierarchy_exclude_home: - type: boolean - label: 'Hide home page from hierarchy' diff --git a/sites/all/modules/contrib/admin/piwik/js/piwik.admin.js b/sites/all/modules/contrib/admin/piwik/js/piwik.admin.js deleted file mode 100644 index 04cc91393..000000000 --- a/sites/all/modules/contrib/admin/piwik/js/piwik.admin.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file - * Piwik admin behaviors. - */ - -(function ($, window) { - - "use strict"; - - /** - * Provide the summary information for the tracking settings vertical tabs. - */ - Drupal.behaviors.trackingSettingsSummary = { - attach: function () { - // Make sure this behavior is processed only if drupalSetSummary is defined. - if (typeof jQuery.fn.drupalSetSummary === 'undefined') { - return; - } - - $('#edit-page-visibility-settings').drupalSetSummary(function (context) { - var $radio = $('input[name="piwik_visibility_request_path_mode"]:checked', context); - if ($radio.val() === '0') { - if (!$('textarea[name="piwik_visibility_request_path_pages"]', context).val()) { - return Drupal.t('Not restricted'); - } - else { - return Drupal.t('All pages with exceptions'); - } - } - else { - return Drupal.t('Restricted to certain pages'); - } - }); - - $('#edit-role-visibility-settings').drupalSetSummary(function (context) { - var vals = []; - $('input[type="checkbox"]:checked', context).each(function () { - vals.push($.trim($(this).next('label').text())); - }); - if (!vals.length) { - return Drupal.t('Not restricted'); - } - else if ($('input[name="piwik_visibility_user_role_mode"]:checked', context).val() === '1') { - return Drupal.t('Excepted: @roles', {'@roles': vals.join(', ')}); - } - else { - return vals.join(', '); - } - }); - - $('#edit-user-visibility-settings').drupalSetSummary(function (context) { - var $radio = $('input[name="piwik_visibility_user_account_mode"]:checked', context); - if ($radio.val() === '0') { - return Drupal.t('Not customizable'); - } - else if ($radio.val() === '1') { - return Drupal.t('On by default with opt out'); - } - else { - return Drupal.t('Off by default with opt in'); - } - }); - - $('#edit-linktracking').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-piwik-trackmailto', context).is(':checked')) { - vals.push(Drupal.t('Mailto links')); - } - if ($('input#edit-piwik-trackfiles', context).is(':checked')) { - vals.push(Drupal.t('Outbound links')); - vals.push(Drupal.t('Downloads')); - } - if ($('input#edit-piwik-trackcolorbox', context).is(':checked')) { - vals.push(Drupal.t('Colorbox')); - } - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-messagetracking').drupalSetSummary(function (context) { - var vals = []; - $('input[type="checkbox"]:checked', context).each(function () { - vals.push($.trim($(this).next('label').text())); - }); - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-search').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-piwik-site-search', context).is(':checked')) { - vals.push(Drupal.t('Site search')); - } - if (!vals.length) { - return Drupal.t('Not tracked'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - - $('#edit-domain-tracking').drupalSetSummary(function (context) { - var $radio = $('input[name="piwik_domain_mode"]:checked', context); - if ($radio.val() === '0') { - return Drupal.t('A single domain'); - } - else if ($radio.val() === '1') { - return Drupal.t('One domain with multiple subdomains'); - } - }); - - $('#edit-privacy').drupalSetSummary(function (context) { - var vals = []; - if ($('input#edit-piwik-privacy-donottrack', context).is(':checked')) { - vals.push(Drupal.t('Universal web tracking opt-out')); - } - if (!vals.length) { - return Drupal.t('No privacy'); - } - return Drupal.t('@items enabled', {'@items': vals.join(', ')}); - }); - } - }; - -})(jQuery, window); diff --git a/sites/all/modules/contrib/admin/piwik/js/piwik.js b/sites/all/modules/contrib/admin/piwik/js/piwik.js deleted file mode 100644 index 9a89bfc2c..000000000 --- a/sites/all/modules/contrib/admin/piwik/js/piwik.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file - * Attaches several event listener to a web page. - */ - -(function ($, drupalSettings) { - - "use strict"; - - $(document).ready(function () { - - // Attach mousedown, keyup, touchstart events to document only and catch - // clicks on all elements. - $(document.body).bind("mousedown keyup touchstart", function (event) { - - // Catch the closest surrounding link of a clicked element. - $(event.target).closest("a,area").each(function () { - - if (drupalSettings.piwik.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { - // Mailto link clicked. - _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]); - } - - }); - }); - - // Colorbox: This event triggers when the transition has completed and the - // newly loaded content has been revealed. - if (drupalSettings.piwik.trackColorbox) { - $(document).bind("cbox_complete", function () { - var href = $.colorbox.element().attr("href"); - if (href) { - _paq.push(["setCustomUrl", href]); - _paq.push(["trackPageView"]); - } - }); - } - - }); - -})(jQuery, drupalSettings); diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml deleted file mode 100644 index 03777c171..000000000 --- a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml +++ /dev/null @@ -1,68 +0,0 @@ -id: d6_piwik_settings -label: Piwik 6 configuration -migration_tags: - - Drupal 6 -source: - plugin: variable - variables: - - piwik_cache - - piwik_codesnippet_after - - piwik_codesnippet_before - - piwik_custom - - piwik_domain_mode - - piwik_pages - - piwik_privacy_donottrack - - piwik_roles - - piwik_site_id - - piwik_site_search - - piwik_trackmessages - - piwik_track - - piwik_trackfiles_extensions - - piwik_trackmailto - - piwik_trackuserid - - piwik_translation_set - - piwik_url_http - - piwik_url_https - - piwik_visibility_pages - - piwik_visibility_roles - - piwik_page_title_hierarchy - - piwik_page_title_hierarchy_exclude_home -process: - cache: piwik_cache - 'codesnippet/after': piwik_codesnippet_after - 'codesnippet/before': piwik_codesnippet_before - domain_mode: piwik_domain_mode - 'privacy/donottrack': piwik_privacy_donottrack - site_id: piwik_site_id - 'track/files': piwik_track - 'track/files_extensions': piwik_trackfiles_extensions - 'track/mailto': piwik_trackmailto - 'track/messages': piwik_trackmessages - 'track/site_search': piwik_site_search - 'track/userid': piwik_trackuserid - 'translation_set': piwik_translation_set - url_http: piwik_url_http - url_https: piwik_url_https - 'visibility/user_account_mode': piwik_custom - 'visibility/request_path_mode': piwik_visibility_pages - 'visibility/request_path_pages': - plugin: piwik_visibility_pages - source: - - piwik_visibility_pages - - piwik_pages - # If Piwik uses PHP visibility, don't migrate it unless the PHP module is - # enabled. - skip_php: true - 'visibility/user_role_mode': piwik_visibility_roles - 'visibility/user_role_roles': - plugin: piwik_visibility_roles - source: - - piwik_roles - page_title_hierarchy: piwik_page_title_hierarchy - page_title_hierarchy_exclude_home: piwik_page_title_hierarchy_exclude_home -destination: - plugin: config - config_name: piwik.settings -migration_dependencies: - optional: - - d6_user_role diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml deleted file mode 100644 index 1d2120239..000000000 --- a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml +++ /dev/null @@ -1,24 +0,0 @@ -id: d6_piwik_user_settings -label: Piwik user settings -migration_tags: - - Drupal 6 -source: - plugin: d6_user - constants: - key: user_account_users - module: piwik -process: - uid: uid - key: 'constants/key' - module: 'constants/module' - settings: - # Based on skip_row_if_not_set - plugin: piwik_skip_row_if_not_set - key: custom - module: piwik - source: data -destination: - plugin: user_data -migration_dependencies: - required: - - d6_user diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml deleted file mode 100644 index 28e70388b..000000000 --- a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml +++ /dev/null @@ -1,75 +0,0 @@ -id: d7_piwik_settings -label: Piwik 7 configuration -migration_tags: - - Drupal 7 -source: - plugin: variable - variables: - - piwik_cache - - piwik_codesnippet_after - - piwik_codesnippet_before - - piwik_custom - - piwik_custom_var - - piwik_domain_mode - - piwik_pages - - piwik_privacy_donottrack - - piwik_roles - - piwik_site_id - - piwik_site_search - - piwik_track - - piwik_trackcolorbox - - piwik_trackfiles_extensions - - piwik_trackmailto - - piwik_trackmessages - - piwik_trackuserid - - piwik_translation_set - - piwik_url_http - - piwik_url_https - - piwik_visibility_pages - - piwik_visibility_roles - - piwik_page_title_hierarchy - - piwik_page_title_hierarchy_exclude_home -process: - cache: piwik_cache - 'codesnippet/after': piwik_codesnippet_after - 'codesnippet/before': piwik_codesnippet_before - 'custom/variable': - plugin: piwik_custom_vars - source: - - piwik_custom_var - domain_mode: piwik_domain_mode - 'privacy/donottrack': piwik_privacy_donottrack - site_id: piwik_site_id - 'track/colorbox': piwik_trackcolorbox - 'track/files': piwik_track - 'track/files_extensions': piwik_trackfiles_extensions - 'track/mailto': piwik_trackmailto - 'track/messages': piwik_trackmessages - 'track/site_search': piwik_site_search - 'track/userid': piwik_trackuserid - 'translation_set': piwik_translation_set - url_http: piwik_url_http - url_https: piwik_url_https - 'visibility/user_account_mode': piwik_custom - 'visibility/request_path_mode': piwik_visibility_pages - 'visibility/request_path_pages': - plugin: piwik_visibility_pages - source: - - piwik_visibility_pages - - piwik_pages - # If Piwik uses PHP visibility, don't migrate it unless the PHP module is - # enabled. - skip_php: true - 'visibility/user_role_mode': piwik_visibility_roles - 'visibility/user_role_roles': - plugin: piwik_visibility_roles - source: - - piwik_roles - page_title_hierarchy: piwik_page_title_hierarchy - page_title_hierarchy_exclude_home: piwik_page_title_hierarchy_exclude_home -destination: - plugin: config - config_name: piwik.settings -migration_dependencies: - optional: - - d7_user_role diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml deleted file mode 100644 index f62a1a4bb..000000000 --- a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml +++ /dev/null @@ -1,24 +0,0 @@ -id: d7_piwik_user_settings -label: Piwik user settings -migration_tags: - - Drupal 7 -source: - plugin: d7_user - constants: - key: user_account_users - module: piwik -process: - uid: uid - key: 'constants/key' - module: 'constants/module' - settings: - # Based on skip_row_if_not_set - plugin: piwik_skip_row_if_not_set - key: custom - module: piwik - source: data -destination: - plugin: user_data -migration_dependencies: - required: - - d7_user diff --git a/sites/all/modules/contrib/admin/piwik/piwik.info.yml b/sites/all/modules/contrib/admin/piwik/piwik.info.yml deleted file mode 100644 index 8a5bf7f95..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'Piwik Web Analytics' -type: module -description: "Adds Piwik javascript tracking code to all your site's pages." -package: Statistics -# core: 8.x -configure: piwik.admin_settings_form -test_dependencies: - - php:php - - token:token -dependencies: - - matomo - -# Information added by Drupal.org packaging script on 2018-06-08 -version: '8.x-1.4' -core: '8.x' -project: 'piwik' -datestamp: 1528483684 diff --git a/sites/all/modules/contrib/admin/piwik/piwik.install b/sites/all/modules/contrib/admin/piwik/piwik.install deleted file mode 100644 index 08cfbb8b9..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.install +++ /dev/null @@ -1,132 +0,0 @@ -moduleExists('matomo')) { - // https://matomo.org/blog/2018/01/piwik-is-now-matomo/ - $requirements['piwik_matomo_is_installed'] = array( - 'title' => t('Piwik is now Matomo!'), - 'value' => t('Fails'), - 'severity' => REQUIREMENT_ERROR, - 'description' => t('Piwik has been renamed to Matomo Analytics. Piwik module is blocked now and cannot re-enabled! Please remove piwik module from your system. It is no longer used.'), - ); - } - break; - - case 'runtime': - $config = \Drupal::config('piwik.settings'); - - // Raise warning if Piwik user account has not been set yet. - if (!preg_match('/^\d{1,}$/', $config->get('site_id'))) { - $requirements['piwik_site_id'] = [ - 'title' => t('Piwik module'), - 'description' => t('Piwik module has not been configured yet. Please configure its settings from the Piwik settings page.', [':url' => Url::fromRoute('piwik.admin_settings_form')->toString()]), - 'severity' => REQUIREMENT_WARNING, - 'value' => t('Not configured'), - ]; - } - break; - } - - return $requirements; -} - -/** - * Install Matomo module and migrate all settings. - */ -function piwik_update_8200() { - // Make the update hook failing so it can re-run later again. - if (!module_load_include('module', 'matomo', 'matomo')) { - throw new DrupalUpdateException(t('Matomo module is missing. Download it and re-run update.php')); - } - - $module_enabled = \Drupal::service('module_installer')->install(array('matomo')); - if ($module_enabled) { - $messages[] = t('Successfully installed matomo module.'); - - $piwik_config = \Drupal::configFactory()->getEditable('piwik.settings'); - $matomo_config = \Drupal::configFactory()->getEditable('matomo.settings'); - $matomo_config - ->set('site_id', $piwik_config->get('site_id')) - ->set('url_http', $piwik_config->get('url_http')) - ->set('url_https', $piwik_config->get('url_https')) - ->set('codesnippet.before', $piwik_config->get('codesnippet.before')) - ->set('codesnippet.after', $piwik_config->get('codesnippet.after')) - ->set('custom.variable', $piwik_config->get('custom.variable')) - ->set('domain_mode', $piwik_config->get('domain_mode')) - ->set('track.files', $piwik_config->get('track.files')) - ->set('track.files_extensions', $piwik_config->get('track.files_extensions')) - ->set('track.colorbox', $piwik_config->get('track.colorbox')) - ->set('track.userid', $piwik_config->get('track.userid')) - ->set('track.mailto', $piwik_config->get('track.mailto')) - ->set('track.messages', $piwik_config->get('track.messages')) - ->set('track.site_search', $piwik_config->get('track.site_search')) - ->set('translation_set', $piwik_config->get('translation_set')) - ->set('privacy.donottrack', $piwik_config->get('privacy.donottrack')) - ->set('cache', $piwik_config->get('cache')) - ->set('visibility.request_path_mode', $piwik_config->get('visibility.request_path_mode')) - ->set('visibility.request_path_pages', $piwik_config->get('visibility.request_path_pages')) - ->set('visibility.user_account_mode', $piwik_config->get('visibility.user_account_mode')) - ->set('visibility.user_role_mode', $piwik_config->get('visibility.user_role_mode')) - ->set('visibility.user_role_roles', $piwik_config->get('visibility.user_role_roles')) - ->save(); - $messages[] = t('Copied settings from piwik to matomo module.'); - - // Migrate piwik permissions to matomo. - $permissions = array( - 'administer piwik' => 'administer matomo', - 'opt-in or out of piwik tracking' => 'opt-in or out of matomo tracking', - 'use PHP for piwik tracking visibility' => 'use php for matomo tracking visibility', - 'add JS snippets for piwik' => 'add js snippets for matomo', - ); - foreach (user_roles(FALSE) as $rid => $name) { - $role = \Drupal\user\Entity\Role::load($rid); - foreach ($permissions as $permission_old_key => $permission_new_key) { - if ($role->hasPermission($permission_old_key)) { - $role->grantPermission($permission_new_key); - $messages[] = t('Role "@rid" has permission "@permission_old_key" and "@permission_new_key" granted.', array('@rid' => $rid, '@permission_old_key' => $permission_old_key, '@permission_new_key' => $permission_new_key)); - } - } - $role->save(); - } - $messages[] = t('Copied piwik permissions to matomo module.'); - - // Uninstall piwik module. - $module_uninstalled = \Drupal::service('module_installer')->uninstall(array('piwik'), FALSE); - if ($module_uninstalled) { - $messages[] = t('Successfully uninstalled piwik module. Please remove piwik from your system.'); - drupal_set_message('Piwik is now Matomo! Matomo has been installed. Please remove Piwik module from your system.', 'warning'); - } - else { - $messages[] = t('FAILED to uninstall piwik module.'); - - // Unconfigure piwik to remove piwik tracking code; if piwik module may failed to disable. - $piwik_config->set('site_id', ''); - $messages[] = t('Unconfigured site_id in piwik module to disable double tracking.'); - } - } - - return empty($messages) ? t('FAILED to migrate piwik to matomo module. Please uninstall piwik module and install matomo module manually!') : implode(' ', $messages); -} diff --git a/sites/all/modules/contrib/admin/piwik/piwik.libraries.yml b/sites/all/modules/contrib/admin/piwik/piwik.libraries.yml deleted file mode 100644 index 3d9dfd9b6..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.libraries.yml +++ /dev/null @@ -1,15 +0,0 @@ -piwik: - version: VERSION - js: - js/piwik.js: {} - dependencies: - - core/jquery - - core/drupalSettings - -piwik.admin: - version: VERSION - js: - js/piwik.admin.js: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml b/sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml deleted file mode 100644 index 954821cb8..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -piwik.admin_settings_form: - title: 'Piwik' - parent: system.admin_config_system - description: 'Configure the settings used to generate your Piwik tracking code.' - route_name: piwik.admin_settings_form diff --git a/sites/all/modules/contrib/admin/piwik/piwik.links.task.yml b/sites/all/modules/contrib/admin/piwik/piwik.links.task.yml deleted file mode 100644 index cfce6be59..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -piwik.admin_settings_form_tab: - route_name: piwik.admin_settings_form - title: Settings - base_route: piwik.admin_settings_form diff --git a/sites/all/modules/contrib/admin/piwik/piwik.module b/sites/all/modules/contrib/admin/piwik/piwik.module deleted file mode 100644 index 18dd4b3e5..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.module +++ /dev/null @@ -1,727 +0,0 @@ - - */ - -use Drupal\Component\Serialization\Json; -use Drupal\Component\Utility\Crypt; -use Drupal\Component\Utility\Unicode; -use Drupal\Component\Utility\UrlHelper; -use Drupal\Core\Cache\Cache; -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\Core\Site\Settings; -use Drupal\Core\Url; -use Drupal\node\NodeInterface; -use GuzzleHttp\Exception\RequestException; -use Drupal\piwik\Component\Render\PiwikJavaScriptSnippet; - -/** - * Define the default file extension list that should be tracked as download. - */ -define('PIWIK_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip'); - -/** - * Implements hook_help(). - */ -function piwik_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'piwik.admin_settings_form': - return t('Piwik - Web analytics is an open source (GPL license) web analytics software. It gives interesting reports on your website visitors, your popular pages, the search engines keywords they used, the language they speak... and so much more. Piwik aims to be an open source alternative to Google Analytics.', [':pk_url' => 'http://www.piwik.org/']); - } -} - -/** - * Implements hook_page_attachments(). - * - * Insert JavaScript to the appropriate scope/region of the page. - */ -function piwik_page_attachments(array &$page) { - $account = \Drupal::currentUser(); - $config = \Drupal::config('piwik.settings'); - $id = $config->get('site_id'); - $request = \Drupal::request(); - - // Add module cache tags. - $page['#cache']['tags'] = Cache::mergeTags(isset($page['#cache']['tags']) ? $page['#cache']['tags'] : [], $config->getCacheTags()); - - // Get page http status code for visibility filtering. - $status = NULL; - if ($exception = $request->attributes->get('exception')) { - $status = $exception->getStatusCode(); - } - $trackable_status_codes = [ - // "Forbidden" status code. - '403', - // "Not Found" status code. - '404', - ]; - - // 1. Check if the piwik account number has a valid value. - // 2. Track page views based on visibility value. - // 3. Check if we should track the currently active user's role. - if (preg_match('/^\d{1,}$/', $id) && (_piwik_visibility_pages() || in_array($status, $trackable_status_codes)) && _piwik_visibility_user($account)) { - - $url_http = $config->get('url_http'); - $url_https = $config->get('url_https'); - - $set_custom_url = ''; - $set_document_title = ''; - $set_custom_data = []; - - // Add link tracking. - $link_settings = []; - $link_settings['trackMailto'] = $config->get('track.mailto'); - - if ((\Drupal::moduleHandler()->moduleExists('colorbox')) && $track_colorbox = $config->get('track.colorbox')) { - $link_settings['trackColorbox'] = $track_colorbox; - } - - $page['#attached']['drupalSettings']['piwik'] = $link_settings; - $page['#attached']['library'][] = 'piwik/piwik'; - - // Piwik can show a tree view of page titles that represents the site - // structure if setDocumentTitle() provides the page titles as a "/" - // delimited list. This may makes it easier to browse through the statistics - // of page titles on larger sites. - if ($config->get('page_title_hierarchy') == TRUE) { - $titles = _piwik_get_hierarchy_titles(); - - // Remove all empty titles. - $titles = array_filter($titles); - - if (!empty($titles)) { - // Encode title, at least to keep "/" intact. - $titles = array_map('rawurlencode', $titles); - - $set_document_title = Json::encode(implode('/', $titles)); - } - } - - // Add messages tracking. - $message_events = ''; - if ($message_types = $config->get('track.messages')) { - $message_types = array_values(array_filter($message_types)); - $status_heading = [ - 'status' => t('Status message'), - 'warning' => t('Warning message'), - 'error' => t('Error message'), - ]; - - foreach (drupal_get_messages(NULL, FALSE) as $type => $messages) { - // Track only the selected message types. - if (in_array($type, $message_types)) { - foreach ($messages as $message) { - $message_events .= '_paq.push(["trackEvent", ' . Json::encode(t('Messages')) . ', ' . Json::encode($status_heading[$type]) . ', ' . Json::encode(strip_tags($message)) . ']);'; - } - } - } - } - - // If this node is a translation of another node, pass the original - // node instead. - if (\Drupal::moduleHandler()->moduleExists('content_translation') && $config->get('translation_set')) { - // Check if we have a node object, it has translation enabled, and its - // language code does not match its source language code. - if ($request->attributes->has('node')) { - $node = $request->attributes->get('node'); - if ($node instanceof NodeInterface && \Drupal::service('entity.repository')->getTranslationFromContext($node) !== $node->getUntranslated()) { - $set_custom_url = Json::encode(Url::fromRoute('entity.node.canonical', ['node' => $node->id()], ['language' => $node->getUntranslated()->language()])->toString()); - } - } - } - - // Track access denied (403) and file not found (404) pages. - if ($status == '403') { - $set_document_title = '"403/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)'; - } - elseif ($status == '404') { - $set_document_title = '"404/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)'; - } - - // #2693595: User has entered an invalid login and clicked on forgot - // password link. This link contains the username or email address and may - // get send to Google if we do not override it. Override only if 'name' - // query param exists. Last custom url condition, this need to win. - // - // URLs to protect are: - // - user/password?name=username - // - user/password?name=foo@example.com - if (\Drupal::routeMatch()->getRouteName() == 'user.pass' && $request->query->has('name')) { - $set_custom_url = Json::encode(Url::fromRoute('user.pass')->toString()); - } - - // Add custom variables. - $piwik_custom_vars = $config->get('custom.variable'); - $custom_variable = ''; - for ($i = 1; $i < 6; $i++) { - $custom_var_name = !empty($piwik_custom_vars[$i]['name']) ? $piwik_custom_vars[$i]['name'] : ''; - if (!empty($custom_var_name)) { - $custom_var_value = !empty($piwik_custom_vars[$i]['value']) ? $piwik_custom_vars[$i]['value'] : ''; - $custom_var_scope = !empty($piwik_custom_vars[$i]['scope']) ? $piwik_custom_vars[$i]['scope'] : 'visit'; - - $types = []; - if ($request->attributes->has('node')) { - $node = $request->attributes->get('node'); - if ($node instanceof NodeInterface) { - $types += ['node' => $node]; - } - } - $custom_var_name = \Drupal::token()->replace($custom_var_name, $types, ['clear' => TRUE]); - $custom_var_value = \Drupal::token()->replace($custom_var_value, $types, ['clear' => TRUE]); - - // Suppress empty custom names and/or variables. - if (!Unicode::strlen(trim($custom_var_name)) || !Unicode::strlen(trim($custom_var_value))) { - continue; - } - - // Custom variables names and values are limited to 200 characters in - // length. It is recommended to store values that are as small as - // possible to ensure that the Piwik Tracking request URL doesn't go - // over the URL limit for the webserver or browser. - $custom_var_name = rtrim(substr($custom_var_name, 0, 200)); - $custom_var_value = rtrim(substr($custom_var_value, 0, 200)); - - // Add variables to tracker. - $custom_variable .= '_paq.push(["setCustomVariable", ' . Json::encode($i) . ', ' . Json::encode($custom_var_name) . ', ' . Json::encode($custom_var_value) . ', ' . Json::encode($custom_var_scope) . ']);'; - } - } - - // Add any custom code snippets if specified. - $codesnippet_before = $config->get('codesnippet.before'); - $codesnippet_after = $config->get('codesnippet.after'); - - // Build tracker code. - // @see http://piwik.org/docs/javascript-tracking/#toc-asynchronous-tracking - $script = 'var _paq = _paq || [];'; - $script .= '(function(){'; - $script .= 'var u=(("https:" == document.location.protocol) ? "' . UrlHelper::filterBadProtocol($url_https) . '" : "' . UrlHelper::filterBadProtocol($url_http) . '");'; - $script .= '_paq.push(["setSiteId", ' . Json::encode($id) . ']);'; - $script .= '_paq.push(["setTrackerUrl", u+"piwik.php"]);'; - - // Track logged in users across all devices. - if ($config->get('track.userid') && $account->isAuthenticated()) { - $script .= '_paq.push(["setUserId", ' . Json::encode(piwik_user_id_hash($account->id())) . ']);'; - } - - // Set custom data. - if (!empty($set_custom_data)) { - foreach ($set_custom_data as $custom_data) { - $script .= '_paq.push(["setCustomData", ' . $custom_data . ']);'; - } - } - // Set custom url. - if (!empty($set_custom_url)) { - $script .= '_paq.push(["setCustomUrl", ' . $set_custom_url . ']);'; - } - // Set custom document title. - if (!empty($set_document_title)) { - $script .= '_paq.push(["setDocumentTitle", ' . $set_document_title . ']);'; - } - - // Custom file download extensions. - if ($config->get('track.files') && !($config->get('track.files_extensions') == PIWIK_TRACKFILES_EXTENSIONS)) { - $script .= '_paq.push(["setDownloadExtensions", ' . Json::encode($config->get('track.files_extensions')) . ']);'; - } - - // Disable tracking for visitors who have opted out from tracking via DNT - // (Do-Not-Track) header. - if ($config->get('privacy.donottrack')) { - $script .= '_paq.push(["setDoNotTrack", 1]);'; - } - - // Domain tracking type. - global $cookie_domain; - $domain_mode = $config->get('domain_mode'); - - // Per RFC 2109, cookie domains must contain at least one dot other than the - // first. For hosts such as 'localhost' or IP Addresses we don't set a - // cookie domain. - if ($domain_mode == 1 && count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { - $script .= '_paq.push(["setCookieDomain", ' . Json::encode($cookie_domain) . ']);'; - } - - // Ordering $custom_variable before $codesnippet_before allows users to add - // custom code snippets that may use deleteCustomVariable() and/or - // getCustomVariable(). - if (!empty($custom_variable)) { - $script .= $custom_variable; - } - if (!empty($codesnippet_before)) { - $script .= $codesnippet_before; - } - - // Site search tracking support. - // NOTE: It's recommended not to call trackPageView() on the Site Search - // Result page. - if (\Drupal::moduleHandler()->moduleExists('search') && $config->get('track.site_search') && (strpos(\Drupal::routeMatch()->getRouteName(), 'search.view') === 0) && $keys = ($request->query->has('keys') ? trim($request->get('keys')) : '')) { - // Parameters: - // 1. Search keyword searched for. Example: "Banana" - // 2. Search category selected in your search engine. If you do not need - // this, set to false. Example: "Organic Food" - // 3. Number of results on the Search results page. Zero indicates a - // 'No Result Search Keyword'. Set to false if you don't know. - // - // hook_preprocess_search_results() is not executed if search result is - // empty. Make sure the counter is set to 0 if there are no results. - $script .= '_paq.push(["trackSiteSearch", ' . Json::encode($keys) . ', false, (window.piwik_search_results) ? window.piwik_search_results : 0]);'; - } - else { - $script .= '_paq.push(["trackPageView"]);'; - } - - // Add link tracking. - if ($config->get('track.files')) { - // Disable tracking of links with ".no-tracking" and ".colorbox" classes. - $ignore_classes = [ - 'no-tracking', - 'colorbox', - ]; - // Disable the download & outlink tracking for specific CSS classes. - // Custom code snippets with 'setIgnoreClasses' will override the value. - // @see http://developer.piwik.org/api-reference/tracking-javascript#disable-the-download-amp-outlink-tracking-for-specific-css-classes - $script .= '_paq.push(["setIgnoreClasses", ' . Json::encode($ignore_classes) . ']);'; - - // Enable download & outlink link tracking. - $script .= '_paq.push(["enableLinkTracking"]);'; - } - - if (!empty($message_events)) { - $script .= $message_events; - } - if (!empty($codesnippet_after)) { - $script .= $codesnippet_after; - } - - $script .= 'var d=document,'; - $script .= 'g=d.createElement("script"),'; - $script .= 's=d.getElementsByTagName("script")[0];'; - $script .= 'g.type="text/javascript";'; - $script .= 'g.defer=true;'; - $script .= 'g.async=true;'; - - // Should a local cached copy of the tracking code be used? - if ($config->get('cache') && $url = _piwik_cache($url_http . 'piwik.js')) { - // A dummy query-string is added to filenames, to gain control over - // browser-caching. The string changes on every update or full cache - // flush, forcing browsers to load a new copy of the files, as the - // URL changed. - $query_string = '?' . (\Drupal::state()->get('system.css_js_query_string') ?: '0'); - - $script .= 'g.src="' . $url . $query_string . '";'; - } - else { - $script .= 'g.src=u+"piwik.js";'; - } - - $script .= 's.parentNode.insertBefore(g,s);'; - $script .= '})();'; - - // Add tracker code. - $page['#attached']['html_head'][] = [ - [ - '#tag' => 'script', - '#value' => new PiwikJavaScriptSnippet($script), - ], - 'piwik_tracking_script', - ]; - } -} - -/** - * Generate user id hash to implement USER_ID. - * - * The USER_ID value should be a unique, persistent, and non-personally - * identifiable string identifier that represents a user or signed-in - * account across devices. - * - * @param int $uid - * User id. - * - * @return string - * User id hash. - */ -function piwik_user_id_hash($uid) { - return Crypt::hmacBase64($uid, \Drupal::service('private_key')->get() . Settings::getHashSalt()); -} - -/** - * Implements hook_entity_extra_field_info(). - */ -function piwik_entity_extra_field_info() { - $extra['user']['user']['form']['piwik'] = [ - 'label' => t('Piwik settings'), - 'description' => t('Piwik module form element.'), - 'weight' => 3, - ]; - - return $extra; -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Allow users to decide if tracking code will be added to pages or not. - */ -function piwik_form_user_form_alter(&$form, FormStateInterface $form_state) { - $config = \Drupal::config('piwik.settings'); - $account = $form_state->getFormObject()->getEntity(); - - if ($account->hasPermission('opt-in or out of piwik tracking') && ($visibility_users = $config->get('visibility.user_account_mode')) != 0 && _piwik_visibility_roles($account)) { - $account_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id()); - - $form['piwik'] = [ - '#type' => 'details', - '#title' => t('Piwik settings'), - '#weight' => 3, - '#open' => TRUE, - ]; - - switch ($visibility_users) { - case 1: - $description = t('Users are tracked by default, but you are able to opt out.'); - break; - - case 2: - $description = t('Users are not tracked by default, but you are able to opt in.'); - break; - } - - // Disable tracking for visitors who have opted out from tracking via DNT - // (Do-Not-Track) header. - $disabled = FALSE; - if ($config->get('privacy.donottrack') && !empty($_SERVER['HTTP_DNT'])) { - $disabled = TRUE; - - // Override settings value. - $account_data_piwik['users'] = FALSE; - - $description .= ''; - $description .= ' ' . t('You have opted out from tracking via browser privacy settings.'); - $description .= ''; - } - - $form['piwik']['user_account_users'] = [ - '#type' => 'checkbox', - '#title' => t('Enable user tracking'), - '#description' => $description, - '#default_value' => isset($account_data_piwik['user_account_users']) ? $account_data_piwik['user_account_users'] : ($visibility_users == 1), - '#disabled' => $disabled, - ]; - - // hook_user_update() is missing in D8, add custom submit handler. - $form['actions']['submit']['#submit'][] = 'piwik_user_profile_form_submit'; - } -} - -/** - * Submit callback for user profile form to save the Piwik setting. - */ -function piwik_user_profile_form_submit($form, FormStateInterface $form_state) { - $account = $form_state->getFormObject()->getEntity(); - if ($account->id() && $form_state->hasValue('user_account_users')) { - \Drupal::service('user.data')->set('piwik', $account->id(), 'user_account_users', (int) $form_state->getValue('user_account_users')); - } -} - -/** - * Implements hook_cron(). - */ -function piwik_cron() { - $config = \Drupal::config('piwik.settings'); - - // Regenerate the piwik.js every day. - if (REQUEST_TIME - \Drupal::state()->get('piwik.last_cache') >= 86400 && $config->get('cache')) { - _piwik_cache($config->get('url_http') . 'piwik.js', TRUE); - \Drupal::state()->set('piwik.last_cache', REQUEST_TIME); - } -} - -/** - * Implements hook_preprocess_item_list__search_results(). - * - * Collects and adds the number of search results to the head. - */ -function piwik_preprocess_item_list__search_results(&$variables) { - $config = \Drupal::config('piwik.settings'); - - // Only run on search results list. - if ($config->get('track.site_search')) { - // There is no search result $variable available that hold the number of - // items found. The variable $variables['items'] has the current page items - // only. But the pager item mumber can tell the number of search results. - global $pager_total_items; - - $variables['#attached']['html_head'][] = [ - [ - '#tag' => 'script', - '#value' => 'window.piwik_search_results = ' . intval($pager_total_items[0]) . ';', - '#weight' => JS_LIBRARY - 1, - ], - 'piwik_search_script', - ]; - } -} - -/** - * Download/Synchronize/Cache tracking code file locally. - * - * @param string $location - * The full URL to the external javascript file. - * @param bool $synchronize - * Synchronize to local cache if remote file has changed. - * - * @return mixed - * The path to the local javascript file on success, boolean FALSE on failure. - */ -function _piwik_cache($location, $synchronize = FALSE) { - $path = 'public://piwik'; - $file_destination = $path . '/' . basename($location); - - if (!file_exists($file_destination) || $synchronize) { - // Download the latest tracking code. - try { - $data = \Drupal::httpClient() - ->get($location) - ->getBody(TRUE); - - if (file_exists($file_destination)) { - // Synchronize tracking code and and replace local file if outdated. - $data_hash_local = Crypt::hashBase64(file_get_contents($file_destination)); - $data_hash_remote = Crypt::hashBase64($data); - // Check that the files directory is writable. - if ($data_hash_local != $data_hash_remote && file_prepare_directory($path)) { - // Save updated tracking code file to disk. - file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE); - // Based on Drupal Core class AssetDumper. - if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) { - file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE); - } - \Drupal::logger('piwik')->info('Locally cached tracking code file has been updated.'); - - // Change query-strings on css/js files to enforce reload for all - // users. - _drupal_flush_css_js(); - } - } - else { - // Check that the files directory is writable. - if (file_prepare_directory($path, FILE_CREATE_DIRECTORY)) { - // There is no need to flush JS here as core refreshes JS caches - // automatically, if new files are added. - file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE); - // Based on Drupal Core class AssetDumper. - if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) { - file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE); - } - \Drupal::logger('piwik')->info('Locally cached tracking code file has been saved.'); - - // Return the local JS file path. - return file_url_transform_relative(file_create_url($file_destination)); - } - } - } - catch (RequestException $exception) { - watchdog_exception('piwik', $exception); - } - } - else { - // Return the local JS file path. - return file_url_transform_relative(file_create_url($file_destination)); - } -} - -/** - * Delete cached files and directory. - */ -function piwik_clear_js_cache() { - $path = 'public://piwik'; - if (file_prepare_directory($path)) { - file_scan_directory($path, '/.*/', ['callback' => 'file_unmanaged_delete']); - \Drupal::service('file_system')->rmdir($path); - - // Change query-strings on css/js files to enforce reload for all users. - _drupal_flush_css_js(); - - \Drupal::logger('piwik')->info('Local cache has been purged.'); - } -} - -/** - * Tracking visibility check for an user object. - * - * @param object $account - * A user object containing an array of roles to check. - * - * @return bool - * TRUE if the current user is being tracked by Piwik, otherwise FALSE. - */ -function _piwik_visibility_user($account) { - $config = \Drupal::config('piwik.settings'); - $enabled = FALSE; - - // Is current user a member of a role that should be tracked? - if (_piwik_visibility_roles($account)) { - - // Use the user's block visibility setting, if necessary. - if (($visibility_user_account_mode = $config->get('visibility.user_account_mode')) != 0) { - $user_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id()); - if ($account->id() && isset($user_data_piwik['user_account_users'])) { - $enabled = $user_data_piwik['user_account_users']; - } - else { - $enabled = ($visibility_user_account_mode == 1); - } - } - else { - $enabled = TRUE; - } - - } - - return $enabled; -} - -/** - * Tracking visibility check for user roles. - * - * Based on visibility setting this function returns TRUE if Piwik code should - * be added for the current role and otherwise FALSE. - * - * @param object $account - * A user object containing an array of roles to check. - * - * @return bool - * TRUE if JS code should be added for the current role and otherwise FALSE. - */ -function _piwik_visibility_roles($account) { - $config = \Drupal::config('piwik.settings'); - $enabled = $visibility_user_role_mode = $config->get('visibility.user_role_mode'); - $user_role_roles = $config->get('visibility.user_role_roles'); - - if (count($user_role_roles) > 0) { - // One or more roles are selected. - foreach (array_values($account->getRoles()) as $user_role) { - // Is the current user a member of one of these roles? - if (in_array($user_role, $user_role_roles)) { - // Current user is a member of a role that should be tracked/excluded - // from tracking. - $enabled = !$visibility_user_role_mode; - break; - } - } - } - else { - // No role is selected for tracking, therefore all roles should be tracked. - $enabled = TRUE; - } - - return $enabled; -} - -/** - * Tracking visibility check for pages. - * - * Based on visibility setting this function returns TRUE if JS code should - * be added to the current page and otherwise FALSE. - */ -function _piwik_visibility_pages() { - static $page_match; - - // Cache visibility result if function is called more than once. - if (!isset($page_match)) { - $config = \Drupal::config('piwik.settings'); - $visibility_request_path_mode = $config->get('visibility.request_path_mode'); - $visibility_request_path_pages = $config->get('visibility.request_path_pages'); - - // Match path if necessary. - if (!empty($visibility_request_path_pages)) { - // Convert path to lowercase. This allows comparison of the same path - // with different case. Ex: /Page, /page, /PAGE. - $pages = Unicode::strtolower($visibility_request_path_pages); - if ($visibility_request_path_mode < 2) { - // Compare the lowercase path alias (if any) and internal path. - $path = \Drupal::service('path.current')->getPath(); - $path_alias = Unicode::strtolower(\Drupal::service('path.alias_manager')->getAliasByPath($path)); - $page_match = \Drupal::service('path.matcher')->matchPath($path_alias, $pages) || (($path != $path_alias) && \Drupal::service('path.matcher')->matchPath($path, $pages)); - // When $visibility_request_path_mode has a value of 0, the tracking - // code is displayed on all pages except those listed in $pages. When - // set to 1, it is displayed only on those pages listed in $pages. - $page_match = !($visibility_request_path_mode xor $page_match); - } - elseif (\Drupal::moduleHandler()->moduleExists('php')) { - $page_match = php_eval($visibility_request_path_pages); - } - else { - $page_match = FALSE; - } - } - else { - $page_match = TRUE; - } - - } - return $page_match; -} - -/** - * Get the page titles trail for the current page. - * - * Based on menu_get_active_breadcrumb(). - * - * @return array - * All page titles, including current page. - */ -function _piwik_get_hierarchy_titles() { - $titles = []; - $path = Url::fromRoute('')->toString(); - $config = \Drupal::config('system.site'); - $piwik_conf = \Drupal::config('piwik.settings'); - - // No breadcrumb for the front page. - if (($path === Url::fromUserInput($config->get('page.front'))->toString())) { - return $titles; - } - - // Load up the menu tree. - // TODO: Check this is a sane approach. - $menu_tree = \Drupal::menuTree(); - $menu_name = \Drupal::config('system.menu.main')->get('id'); - - // Build the typical default set of menu tree parameters. - $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name); - - // Load the tree based on this set of parameters. - $tree = $menu_tree->load($menu_name, $parameters); - - // Transform the tree using the manipulators. - $manipulators = [ - // Only show links that are accessible for the current user. - ['callable' => 'menu.default_tree_manipulators:checkAccess'], - // Use the default sorting of menu links. - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - // Fatten the menu. - ['callable' => 'menu.default_tree_manipulators:flatten'], - ]; - $tree = $menu_tree->transform($tree, $manipulators); - - if (!empty($tree)) { - foreach ($tree as $menu_item) { - // If the item is in the active trail and we don't have a front page link - // when we have set to exclude home from the breadcrumbs then add the - // title. - if ($menu_item->inActiveTrail && !($piwik_conf->get('page_title_hierarchy_exclude_home') && $menu_item->link->getRouteName() == '')) { - $titles[] = $menu_item->link->getTitle(); - } - } - } - - return $titles; -} diff --git a/sites/all/modules/contrib/admin/piwik/piwik.permissions.yml b/sites/all/modules/contrib/admin/piwik/piwik.permissions.yml deleted file mode 100644 index 50cefde64..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.permissions.yml +++ /dev/null @@ -1,14 +0,0 @@ -administer piwik: - title: 'Administer Piwik' - description: 'Perform maintenance tasks for Piwik.' -opt-in or out of piwik tracking: - title: 'Opt-in or out of tracking' - description: 'Allow users to decide if tracking code will be added to pages or not.' -use PHP for piwik tracking visibility: - title: 'Use PHP for tracking visibility' - description: 'Enter PHP code in the field for tracking visibility settings.' - restrict access: true -add JS snippets for piwik: - title: 'Add JavaScript snippets' - description: 'Enter JavaScript code snippets for advanced Piwik functionality.' - restrict access: true diff --git a/sites/all/modules/contrib/admin/piwik/piwik.routing.yml b/sites/all/modules/contrib/admin/piwik/piwik.routing.yml deleted file mode 100644 index a3c98a06a..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -piwik.admin_settings_form: - path: '/admin/config/system/piwik' - defaults: - _form: '\Drupal\piwik\Form\PiwikAdminSettingsForm' - _title: 'Piwik' - requirements: - _permission: 'administer piwik' diff --git a/sites/all/modules/contrib/admin/piwik/piwik.tokens.inc b/sites/all/modules/contrib/admin/piwik/piwik.tokens.inc deleted file mode 100644 index be6fcad81..000000000 --- a/sites/all/modules/contrib/admin/piwik/piwik.tokens.inc +++ /dev/null @@ -1,60 +0,0 @@ - t('User role names'), - 'description' => t('The role names the user account is a member of as comma separated list.'), - 'needs-data' => 'user', - ]; - $user['piwik-role-ids'] = [ - 'name' => t('User role ids'), - 'description' => t('The role ids the user account is a member of as comma separated list.'), - 'needs-data' => 'user', - ]; - - return [ - 'tokens' => ['user' => $user], - ]; -} - -/** - * Implements hook_tokens(). - */ -function piwik_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { - $sanitize = !empty($options['sanitize']); - $replacements = []; - - if ($type == 'user' && !empty($data['user'])) { - $account = $data['user']; - - foreach ($tokens as $name => $original) { - switch ($name) { - // Basic user account information. - case 'piwik-role-names': - $names = implode(',', $account->getRoles()); - $replacements[$original] = $sanitize ? Html::escape($names) : $names; - $bubbleable_metadata->addCacheableDependency($account); - break; - - case 'piwik-role-ids': - $ids = implode(',', array_keys($account->getRoles())); - $replacements[$original] = $sanitize ? Html::escape($ids) : $ids; - $bubbleable_metadata->addCacheableDependency($account); - break; - } - } - } - - return $replacements; -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php b/sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php deleted file mode 100644 index 72f21947b..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php +++ /dev/null @@ -1,43 +0,0 @@ -string = (string) $string; - } - - /** - * {@inheritdoc} - */ - public function __toString() { - return $this->string; - } - - /** - * {@inheritdoc} - */ - public function jsonSerialize() { - return $this->__toString(); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php b/sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php deleted file mode 100644 index 68e4d3e13..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php +++ /dev/null @@ -1,717 +0,0 @@ -config('piwik.settings'); - - $form['general'] = [ - '#type' => 'details', - '#title' => $this->t('General settings'), - '#open' => TRUE, - ]; - - $form['general']['piwik_site_id'] = [ - '#default_value' => $config->get('site_id'), - '#description' => $this->t('The user account number is unique to the websites domain. Click the Settings link in your Piwik account, then the Websites tab and enter the appropriate site ID into this field.'), - '#maxlength' => 20, - '#required' => TRUE, - '#size' => 15, - '#title' => $this->t('Piwik site ID'), - '#type' => 'textfield', - ]; - $form['general']['piwik_url_http'] = [ - '#default_value' => $config->get('url_http'), - '#description' => $this->t('The URL to your Piwik base directory. Example: "http://www.example.com/piwik/".'), - '#maxlength' => 255, - '#required' => TRUE, - '#size' => 80, - '#title' => $this->t('Piwik HTTP URL'), - '#type' => 'textfield', - ]; - $form['general']['piwik_url_https'] = [ - '#default_value' => $config->get('url_https'), - '#description' => $this->t('The URL to your Piwik base directory with SSL certificate installed. Required if you track a SSL enabled website. Example: "https://www.example.com/piwik/".'), - '#maxlength' => 255, - '#size' => 80, - '#title' => $this->t('Piwik HTTPS URL'), - '#type' => 'textfield', - ]; - // Required for automated form save testing only. - $form['general']['piwik_url_skiperror'] = [ - '#type' => 'hidden', - '#default_value' => FALSE, - ]; - - // Visibility settings. - $form['tracking_scope'] = [ - '#type' => 'vertical_tabs', - '#title' => $this->t('Tracking scope'), - '#attached' => [ - 'library' => [ - 'piwik/piwik.admin', - ], - ], - ]; - - $form['tracking']['domain_tracking'] = [ - '#type' => 'details', - '#title' => $this->t('Domains'), - '#group' => 'tracking_scope', - ]; - - global $cookie_domain; - $multiple_sub_domains = []; - foreach (['www', 'app', 'shop'] as $subdomain) { - if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { - $multiple_sub_domains[] = $subdomain . $cookie_domain; - } - // IP addresses or localhost. - else { - $multiple_sub_domains[] = $subdomain . '.example.com'; - } - } - - $form['tracking']['domain_tracking']['piwik_domain_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('What are you tracking?'), - '#options' => [ - 0 => $this->t('A single domain (default)'), - 1 => $this->t('One domain with multiple subdomains'), - ], - 0 => [ - '#description' => $this->t('Domain: @domain', ['@domain' => $_SERVER['HTTP_HOST']]), - ], - 1 => [ - '#description' => $this->t('Examples: @domains', ['@domains' => implode(', ', $multiple_sub_domains)]), - ], - '#default_value' => $config->get('domain_mode'), - ]; - - // Page specific visibility configurations. - $account = \Drupal::currentUser(); - $php_access = $account->hasPermission('use PHP for piwik tracking visibility'); - $visibility_request_path_pages = $config->get('visibility.request_path_pages'); - - $form['tracking']['page_visibility_settings'] = [ - '#type' => 'details', - '#title' => $this->t('Pages'), - '#group' => 'tracking_scope', - ]; - - if ($config->get('visibility.request_path_mode') == 2 && !$php_access) { - // No permission to change PHP snippets, but keep existing settings. - $form['tracking']['page_visibility_settings'] = []; - $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_mode'] = ['#type' => 'value', '#value' => 2]; - $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_pages'] = ['#type' => 'value', '#value' => $visibility_request_path_pages]; - } - else { - $options = [ - t('Every page except the listed pages'), - t('The listed pages only'), - ]; - $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", ['%blog' => '/blog', '%blog-wildcard' => '/blog/*', '%front' => '']); - - if (\Drupal::moduleHandler()->moduleExists('php') && $php_access) { - $options[] = t('Pages on which this PHP code returns TRUE (experts only)'); - $title = t('Pages or PHP code'); - $description .= ' ' . t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', ['%php' => '']); - } - else { - $title = t('Pages'); - } - $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('Add tracking to specific pages'), - '#options' => $options, - '#default_value' => $config->get('visibility.request_path_mode'), - ]; - $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_pages'] = [ - '#type' => 'textarea', - '#title' => $title, - '#title_display' => 'invisible', - '#default_value' => !empty($visibility_request_path_pages) ? $visibility_request_path_pages : '', - '#description' => $description, - '#rows' => 10, - ]; - } - - // Render the role overview. - $visibility_user_role_roles = $config->get('visibility.user_role_roles'); - - $form['tracking']['role_visibility_settings'] = [ - '#type' => 'details', - '#title' => $this->t('Roles'), - '#group' => 'tracking_scope', - ]; - - $form['tracking']['role_visibility_settings']['piwik_visibility_user_role_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('Add tracking for specific roles'), - '#options' => [ - t('Add to the selected roles only'), - t('Add to every role except the selected ones'), - ], - '#default_value' => $config->get('visibility.user_role_mode'), - ]; - $form['tracking']['role_visibility_settings']['piwik_visibility_user_role_roles'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Roles'), - '#default_value' => !empty($visibility_user_role_roles) ? $visibility_user_role_roles : [], - '#options' => array_map('\Drupal\Component\Utility\Html::escape', user_role_names()), - '#description' => $this->t('If none of the roles are selected, all users will be tracked. If a user has any of the roles checked, that user will be tracked (or excluded, depending on the setting above).'), - ]; - - // Standard tracking configurations. - $visibility_user_account_mode = $config->get('visibility.user_account_mode'); - - $form['tracking']['user_visibility_settings'] = [ - '#type' => 'details', - '#title' => $this->t('Users'), - '#group' => 'tracking_scope', - ]; - $t_permission = ['%permission' => $this->t('opt-in or out of tracking')]; - $form['tracking']['user_visibility_settings']['piwik_visibility_user_account_mode'] = [ - '#type' => 'radios', - '#title' => $this->t('Allow users to customize tracking on their account page'), - '#options' => [ - t('No customization allowed'), - t('Tracking on by default, users with %permission permission can opt out', $t_permission), - t('Tracking off by default, users with %permission permission can opt in', $t_permission), - ], - '#default_value' => !empty($visibility_user_account_mode) ? $visibility_user_account_mode : 0, - ]; - $form['tracking']['user_visibility_settings']['piwik_trackuserid'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track User ID'), - '#default_value' => $config->get('track.userid'), - '#description' => $this->t('User ID enables the analysis of groups of sessions, across devices, using a unique, persistent, and non-personally identifiable ID string representing a user. Learn more about the benefits of using User ID.', [':url' => 'http://piwik.org/docs/user-id/']), - ]; - - // Link specific configurations. - $form['tracking']['linktracking'] = [ - '#type' => 'details', - '#title' => $this->t('Links and downloads'), - '#group' => 'tracking_scope', - ]; - $form['tracking']['linktracking']['piwik_trackmailto'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track clicks on mailto links'), - '#default_value' => $config->get('track.mailto'), - ]; - $form['tracking']['linktracking']['piwik_trackfiles'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track clicks on outbound links and downloads (clicks on file links) for the following extensions'), - '#default_value' => $config->get('track.files'), - ]; - $form['tracking']['linktracking']['piwik_trackfiles_extensions'] = [ - '#title' => $this->t('List of download file extensions'), - '#title_display' => 'invisible', - '#type' => 'textfield', - '#default_value' => $config->get('track.files_extensions'), - '#description' => $this->t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: @extensions', ['@extensions' => PIWIK_TRACKFILES_EXTENSIONS]), - '#maxlength' => 500, - '#states' => [ - 'enabled' => [ - ':input[name="piwik_trackfiles"]' => ['checked' => TRUE], - ], - // Note: Form required marker is not visible as title is invisible. - 'required' => [ - ':input[name="piwik_trackfiles"]' => ['checked' => TRUE], - ], - ], - ]; - - $colorbox_dependencies = '
'; - $colorbox_dependencies .= t('Requires: @module-list', ['@module-list' => (\Drupal::moduleHandler()->moduleExists('colorbox') ? t('@module (enabled)', ['@module' => 'Colorbox']) : t('@module (disabled)', ['@module' => 'Colorbox']))]); - $colorbox_dependencies .= '
'; - - $form['tracking']['linktracking']['piwik_trackcolorbox'] = [ - '#type' => 'checkbox', - '#title' => t('Track content in colorbox modal dialogs'), - '#description' => t('Enable to track the content shown in colorbox modal windows.') . $colorbox_dependencies, - '#default_value' => $config->get('track.colorbox'), - '#disabled' => (\Drupal::moduleHandler()->moduleExists('colorbox') ? FALSE : TRUE), - ]; - - // Message specific configurations. - $form['tracking']['messagetracking'] = [ - '#type' => 'details', - '#title' => $this->t('Messages'), - '#group' => 'tracking_scope', - ]; - $track_messages = $config->get('track.messages'); - $form['tracking']['messagetracking']['piwik_trackmessages'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Track messages of type'), - '#default_value' => !empty($track_messages) ? $track_messages : [], - '#description' => $this->t('This will track the selected message types shown to users. Tracking of form validation errors may help you identifying usability issues in your site. Every message is tracked as one individual event. Messages from excluded pages cannot be tracked.'), - '#options' => [ - 'status' => $this->t('Status message'), - 'warning' => $this->t('Warning message'), - 'error' => $this->t('Error message'), - ], - ]; - - $form['tracking']['search'] = [ - '#type' => 'details', - '#title' => $this->t('Search'), - '#group' => 'tracking_scope', - ]; - - $site_search_dependencies = '
'; - $site_search_dependencies .= t('Requires: @module-list', ['@module-list' => (\Drupal::moduleHandler()->moduleExists('search') ? t('@module (enabled)', ['@module' => 'Search']) : t('@module (disabled)', ['@module' => 'Search']))]); - $site_search_dependencies .= '
'; - - $form['tracking']['search']['piwik_site_search'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track internal search'), - '#description' => $this->t('If checked, internal search keywords are tracked.') . $site_search_dependencies, - '#default_value' => $config->get('track.site_search'), - '#disabled' => (\Drupal::moduleHandler()->moduleExists('search') ? FALSE : TRUE), - ]; - - // Privacy specific configurations. - $form['tracking']['privacy'] = [ - '#type' => 'details', - '#title' => $this->t('Privacy'), - '#group' => 'tracking_scope', - ]; - $form['tracking']['privacy']['piwik_privacy_donottrack'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Universal web tracking opt-out'), - '#description' => $this->t('If enabled and your Piwik server receives the Do-Not-Track header from the client browser, the Piwik server will not track the user. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision.'), - '#default_value' => $config->get('privacy.donottrack'), - ]; - - // Piwik page title tree view settings. - $form['page_title_hierarchy'] = [ - '#type' => 'details', - '#title' => $this->t('Page titles hierarchy'), - '#description' => $this->t('This functionality enables a dynamically expandable tree view of your site page titles in your Piwik statistics. See in Piwik statistics under Actions > Page titles.'), - '#group' => 'page_title_hierarchy', - ]; - $form['page_title_hierarchy']['piwik_page_title_hierarchy'] = [ - '#type' => 'checkbox', - '#title' => $this->t("Show page titles as hierarchy like breadcrumbs"), - '#description' => $this->t('By default Piwik tracks the current page title and shows you a flat list of the most popular titles. This enables a breadcrumbs like tree view.'), - '#default_value' => $config->get('page_title_hierarchy'), - ]; - $form['page_title_hierarchy']['piwik_page_title_hierarchy_exclude_home'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Hide home page from hierarchy'), - '#description' => $this->t('If enabled, the "Home" item will be removed from the hierarchy to flatten the structure in the Piwik statistics. Hits to the home page will still be counted, but for other pages the hierarchy will start at level Home+1.'), - '#default_value' => $config->get('page_title_hierarchy_exclude_home'), - ]; - - // Custom variables. - $form['piwik_custom_var'] = [ - '#description' => $this->t('You can add Piwiks Custom Variables here. These will be added to every page that Piwik tracking code appears on. Custom variable names and values are limited to 200 characters in length. Keep the names and values as short as possible and expect long values to get trimmed. You may use tokens in custom variable names and values. Global and user tokens are always available; on node pages, node tokens are also available.', [':custom_var_documentation' => 'http://piwik.org/docs/custom-variables/']), - '#title' => $this->t('Custom variables'), - '#tree' => TRUE, - '#type' => 'details', - ]; - - $form['piwik_custom_var']['slots'] = [ - '#type' => 'table', - '#header' => [ - ['data' => $this->t('Slot')], - ['data' => $this->t('Name')], - ['data' => $this->t('Value')], - ['data' => $this->t('Scope')], - ], - ]; - - $piwik_custom_vars = $config->get('custom.variable'); - - // Piwik supports up to 5 custom variables. - for ($i = 1; $i < 6; $i++) { - $form['piwik_custom_var']['slots'][$i]['slot'] = [ - '#default_value' => $i, - '#description' => $this->t('Slot number'), - '#disabled' => TRUE, - '#size' => 1, - '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'textfield', - ]; - $form['piwik_custom_var']['slots'][$i]['name'] = [ - '#default_value' => isset($piwik_custom_vars[$i]['name']) ? $piwik_custom_vars[$i]['name'] : '', - '#description' => $this->t('The custom variable name.'), - '#maxlength' => 100, - '#size' => 20, - '#title' => $this->t('Custom variable name #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'textfield', - ]; - $form['piwik_custom_var']['slots'][$i]['value'] = [ - '#default_value' => isset($piwik_custom_vars[$i]['value']) ? $piwik_custom_vars[$i]['value'] : '', - '#description' => $this->t('The custom variable value.'), - '#maxlength' => 255, - '#title' => $this->t('Custom variable value #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'textfield', - '#element_validate' => [[get_class($this), 'tokenElementValidate']], - '#token_types' => ['node'], - ]; - if (\Drupal::moduleHandler()->moduleExists('token')) { - $form['piwik_custom_var']['slots'][$i]['value']['#element_validate'][] = 'token_element_validate'; - } - $form['piwik_custom_var']['slots'][$i]['scope'] = [ - '#default_value' => isset($piwik_custom_vars[$i]['scope']) ? $piwik_custom_vars[$i]['scope'] : '', - '#description' => $this->t('The scope for the custom variable.'), - '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]), - '#title_display' => 'invisible', - '#type' => 'select', - '#options' => [ - 'visit' => $this->t('Visit'), - 'page' => $this->t('Page'), - ], - ]; - } - - $form['piwik_custom_var']['piwik_custom_var_description'] = [ - '#type' => 'item', - '#description' => $this->t("You can supplement Piwiks' basic IP address tracking of visitors by segmenting users based on custom variables. Make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties' websites) with any personally identifying information from any source as part of your use (or such third parties' use) of the Piwik' service."), - ]; - if (\Drupal::moduleHandler()->moduleExists('token')) { - $form['piwik_custom_var']['piwik_custom_var_token_tree'] = [ - '#theme' => 'token_tree_link', - '#token_types' => ['node'], - ]; - } - - // Advanced feature configurations. - $form['advanced'] = [ - '#type' => 'details', - '#title' => $this->t('Advanced settings'), - '#open' => FALSE, - ]; - - $form['advanced']['piwik_cache'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Locally cache tracking code file'), - '#description' => $this->t('If checked, the tracking code file is retrieved from your Piwik site and cached locally. It is updated daily to ensure updates to tracking code are reflected in the local copy.'), - '#default_value' => $config->get('cache'), - ]; - - // Allow for tracking of the originating node when viewing translation sets. - if (\Drupal::moduleHandler()->moduleExists('content_translation')) { - $form['advanced']['piwik_translation_set'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Track translation sets as one unit'), - '#description' => $this->t('When a node is part of a translation set, record statistics for the originating node instead. This allows for a translation set to be treated as a single unit.'), - '#default_value' => $config->get('translation_set'), - ]; - } - - $user_access_add_js_snippets = !$this->currentUser()->hasPermission('add JS snippets for piwik'); - $user_access_add_js_snippets_permission_warning = $user_access_add_js_snippets ? ' ' . $this->t('This field has been disabled because you do not have sufficient permissions to edit it.') . '' : ''; - $form['advanced']['codesnippet'] = [ - '#type' => 'details', - '#title' => $this->t('Custom JavaScript code'), - '#open' => TRUE, - '#description' => $this->t('You can add custom Piwik code snippets here. These will be added to every page that Piwik appears on. Do not include the <script> tags, and always end your code with a semicolon (;).', [':snippets' => 'http://piwik.org/docs/javascript-tracking/']), - ]; - $form['advanced']['codesnippet']['piwik_codesnippet_before'] = [ - '#type' => 'textarea', - '#title' => $this->t('Code snippet (before)'), - '#default_value' => $config->get('codesnippet.before'), - '#disabled' => $user_access_add_js_snippets, - '#rows' => 5, - '#description' => $this->t('Code in this textarea will be added before _paq.push(["trackPageView"]).') . $user_access_add_js_snippets_permission_warning, - ]; - $form['advanced']['codesnippet']['piwik_codesnippet_after'] = [ - '#type' => 'textarea', - '#title' => $this->t('Code snippet (after)'), - '#default_value' => $config->get('codesnippet.after'), - '#disabled' => $user_access_add_js_snippets, - '#rows' => 5, - '#description' => $this->t('Code in this textarea will be added after _paq.push(["trackPageView"]). This is useful if you\'d like to track a site in two accounts.') . $user_access_add_js_snippets_permission_warning, - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - // Custom variables validation. - foreach ($form_state->getValue(['piwik_custom_var', 'slots']) as $custom_var) { - $form_state->setValue(['piwik_custom_var', 'slots', $custom_var['slot'], 'name'], trim($custom_var['name'])); - $form_state->setValue(['piwik_custom_var', 'slots', $custom_var['slot'], 'value'], trim($custom_var['value'])); - - // Validate empty names/values. - if (empty($custom_var['name']) && !empty($custom_var['value'])) { - $form_state->setErrorByName("piwik_custom_var][slots][" . $custom_var['slot'] . "][name", t('The custom variable @slot-number requires a Name if a Value has been provided.', ['@slot-number' => $custom_var['slot']])); - } - elseif (!empty($custom_var['name']) && empty($custom_var['value'])) { - $form_state->setErrorByName("piwik_custom_var][slots][" . $custom_var['slot'] . "][value", t('The custom variable @slot-number requires a Value if a Name has been provided.', ['@slot-number' => $custom_var['slot']])); - } - } - $form_state->setValue('piwik_custom_var', $form_state->getValue(['piwik_custom_var', 'slots'])); - - // Trim some text area values. - $form_state->setValue('piwik_site_id', trim($form_state->getValue('piwik_site_id'))); - $form_state->setValue('piwik_visibility_request_path_pages', trim($form_state->getValue('piwik_visibility_request_path_pages'))); - $form_state->setValue('piwik_codesnippet_before', trim($form_state->getValue('piwik_codesnippet_before'))); - $form_state->setValue('piwik_codesnippet_after', trim($form_state->getValue('piwik_codesnippet_after'))); - $form_state->setValue('piwik_visibility_user_role_roles', array_filter($form_state->getValue('piwik_visibility_user_role_roles'))); - $form_state->setValue('piwik_trackmessages', array_filter($form_state->getValue('piwik_trackmessages'))); - - if (!preg_match('/^\d{1,}$/', $form_state->getValue('piwik_site_id'))) { - $form_state->setErrorByName('piwik_site_id', t('A valid Piwik site ID is an integer only.')); - } - - $url = $form_state->getValue('piwik_url_http') . 'piwik.php'; - try { - $result = \Drupal::httpClient()->get($url); - if ($result->getStatusCode() != 200 && $form_state->getValue('piwik_url_skiperror') == FALSE) { - $form_state->setErrorByName('piwik_url_http', t('The validation of "@url" failed with error "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $result->getReasonPhrase(), - '@code' => $result->getStatusCode(), - ])); - } - } - catch (RequestException $exception) { - $form_state->setErrorByName('piwik_url_http', t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $exception->getMessage(), - '@code' => $exception->getCode(), - ])); - } - - $piwik_url_https = $form_state->getValue('piwik_url_https'); - if (!empty($piwik_url_https)) { - $url = $piwik_url_https . 'piwik.php'; - try { - $result = \Drupal::httpClient()->get($url); - if ($result->getStatusCode() != 200 && $form_state->getValue('piwik_url_skiperror') == FALSE) { - $form_state->setErrorByName('piwik_url_https', t('The validation of "@url" failed with error "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $result->getReasonPhrase(), - '@code' => $result->getStatusCode(), - ])); - } - } - catch (RequestException $exception) { - $form_state->setErrorByName('piwik_url_https', t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [ - '@url' => UrlHelper::filterBadProtocol($url), - '@error' => $exception->getMessage(), - '@code' => $exception->getCode(), - ])); - } - } - - // Verify that every path is prefixed with a slash, but don't check PHP - // code snippets. - if ($form_state->getValue('piwik_visibility_request_path_mode') != 2) { - $pages = preg_split('/(\r\n?|\n)/', $form_state->getValue('piwik_visibility_request_path_pages')); - foreach ($pages as $page) { - if (strpos($page, '/') !== 0 && $page !== '') { - $form_state->setErrorByName('piwik_visibility_request_path_pages', t('Path "@page" not prefixed with slash.', ['@page' => $page])); - // Drupal forms show one error only. - break; - } - } - } - - // Clear obsolete local cache if cache has been disabled. - if ($form_state->isValueEmpty('piwik_cache') && $form['advanced']['piwik_cache']['#default_value']) { - piwik_clear_js_cache(); - } - - // This is for the Newbie's who cannot read a text area description. - if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('piwik_codesnippet_before'))) { - $form_state->setErrorByName('piwik_codesnippet_before', t('Do not include the <script> tags in the javascript code snippets.')); - } - if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('piwik_codesnippet_after'))) { - $form_state->setErrorByName('piwik_codesnippet_after', t('Do not include the <script> tags in the javascript code snippets.')); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('piwik.settings'); - $config - ->set('site_id', $form_state->getValue('piwik_site_id')) - ->set('url_http', $form_state->getValue('piwik_url_http')) - ->set('url_https', $form_state->getValue('piwik_url_https')) - ->set('codesnippet.before', $form_state->getValue('piwik_codesnippet_before')) - ->set('codesnippet.after', $form_state->getValue('piwik_codesnippet_after')) - ->set('custom.variable', $form_state->getValue('piwik_custom_var')) - ->set('domain_mode', $form_state->getValue('piwik_domain_mode')) - ->set('track.files', $form_state->getValue('piwik_trackfiles')) - ->set('track.files_extensions', $form_state->getValue('piwik_trackfiles_extensions')) - ->set('track.colorbox', $form_state->getValue('piwik_trackcolorbox')) - ->set('track.userid', $form_state->getValue('piwik_trackuserid')) - ->set('track.mailto', $form_state->getValue('piwik_trackmailto')) - ->set('track.messages', $form_state->getValue('piwik_trackmessages')) - ->set('track.site_search', $form_state->getValue('piwik_site_search')) - ->set('privacy.donottrack', $form_state->getValue('piwik_privacy_donottrack')) - ->set('cache', $form_state->getValue('piwik_cache')) - ->set('visibility.request_path_mode', $form_state->getValue('piwik_visibility_request_path_mode')) - ->set('visibility.request_path_pages', $form_state->getValue('piwik_visibility_request_path_pages')) - ->set('visibility.user_account_mode', $form_state->getValue('piwik_visibility_user_account_mode')) - ->set('visibility.user_role_mode', $form_state->getValue('piwik_visibility_user_role_mode')) - ->set('visibility.user_role_roles', $form_state->getValue('piwik_visibility_user_role_roles')) - ->save(); - - if ($form_state->hasValue('piwik_translation_set')) { - $config->set('translation_set', $form_state->getValue('piwik_translation_set'))->save(); - } - - parent::submitForm($form, $form_state); - } - - /** - * Validate a form element that should have tokens in it. - * - * For example: - * @code - * $form['my_node_text_element'] = [ - * '#type' => 'textfield', - * '#title' => $this->t('Some text to token-ize that has a node context.'), - * '#default_value' => 'The title of this node is [node:title].', - * '#element_validate' => [[get_class($this), 'tokenElementValidate']], - * ]; - * @endcode - */ - public static function tokenElementValidate(&$element, FormStateInterface $form_state) { - $value = isset($element['#value']) ? $element['#value'] : $element['#default_value']; - - if (!Unicode::strlen($value)) { - // Empty value needs no further validation since the element should depend - // on using the '#required' FAPI property. - return $element; - } - - $tokens = \Drupal::token()->scan($value); - $invalid_tokens = static::getForbiddenTokens($tokens); - if ($invalid_tokens) { - $form_state->setError($element, t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => $element['#title'], '@invalid-tokens' => implode(', ', $invalid_tokens)])); - } - - return $element; - } - - /** - * Get an array of all forbidden tokens. - * - * @param array $value - * An array of token values. - * - * @return array - * A unique array of invalid tokens. - */ - protected static function getForbiddenTokens(array $value) { - $invalid_tokens = []; - $value_tokens = is_string($value) ? \Drupal::token()->scan($value) : $value; - - foreach ($value_tokens as $tokens) { - if (array_filter($tokens, 'static::containsForbiddenToken')) { - $invalid_tokens = array_merge($invalid_tokens, array_values($tokens)); - } - } - - array_unique($invalid_tokens); - return $invalid_tokens; - } - - /** - * Validate if string contains forbidden tokens not allowed by privacy rules. - * - * @param string $token_string - * A string with one or more tokens to be validated. - * - * @return bool - * TRUE if blacklisted token has been found, otherwise FALSE. - */ - protected static function containsForbiddenToken($token_string) { - // List of strings in tokens with personal identifying information not - // allowed for privacy reasons. See section 8.1 of the Google Analytics - // terms of use for more detailed information. - // - // This list can never ever be complete. For this reason it tries to use a - // regex and may kill a few other valid tokens, but it's the only way to - // protect users as much as possible from admins with illegal ideas. - // - // User tokens are not prefixed with colon to catch 'current-user' and - // 'user'. - // - // TODO: If someone have better ideas, share them, please! - $token_blacklist = [ - ':account-name]', - ':author]', - ':author:edit-url]', - ':author:url]', - ':author:path]', - ':current-user]', - ':current-user:original]', - ':display-name]', - ':fid]', - ':mail]', - ':name]', - ':uid]', - ':one-time-login-url]', - ':owner]', - ':owner:cancel-url]', - ':owner:edit-url]', - ':owner:url]', - ':owner:path]', - 'user:cancel-url]', - 'user:edit-url]', - 'user:url]', - 'user:path]', - 'user:picture]', - // addressfield_tokens.module - ':first-name]', - ':last-name]', - ':name-line]', - ':mc-address]', - ':thoroughfare]', - ':premise]', - // realname.module - ':name-raw]', - // token.module - ':ip-address]', - ]; - - return preg_match('/' . implode('|', array_map('preg_quote', $token_blacklist)) . '/i', $token_string); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php b/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php deleted file mode 100644 index ebb575d2b..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php +++ /dev/null @@ -1,27 +0,0 @@ -configuration['module']][$this->configuration['key']])) { - throw new MigrateSkipRowException(); - } - return $value[$this->configuration['module']][$this->configuration['key']]; - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php b/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php deleted file mode 100644 index f4e0ee5ed..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php +++ /dev/null @@ -1,113 +0,0 @@ -moduleHandler = $module_handler; - $this->migrationPlugin = $migration_plugin; - - if (isset($configuration['skip_php'])) { - $this->skipPHP = $configuration['skip_php']; - } - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - $migration_configuration = [ - 'migration' => [ - 'd6_user_role', - 'd7_user_role', - ], - ]; - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration) - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - list($old_visibility, $pages) = $value; - - $request_path_pages = ''; - - if ($pages) { - // 2 == BLOCK_VISIBILITY_PHP in Drupal 6 and 7. - if ($old_visibility == 2) { - // If the PHP module is present, migrate the visibility code unaltered. - if ($this->moduleHandler->moduleExists('php')) { - $request_path_pages = $pages; - } - // Skip the row if we're configured to. If not, we don't need to do - // anything else -- the block will simply have no PHP or request_path - // visibility configuration. - elseif ($this->skipPHP) { - throw new MigrateSkipRowException(); - } - } - else { - $paths = preg_split("(\r\n?|\n)", $pages); - foreach ($paths as $key => $path) { - $paths[$key] = $path === '' ? $path : '/' . ltrim($path, '/'); - } - $request_path_pages = implode("\n", $paths); - } - } - - return $request_path_pages; - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php b/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php deleted file mode 100644 index 41afededc..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php +++ /dev/null @@ -1,87 +0,0 @@ -moduleHandler = $module_handler; - $this->migrationPlugin = $migration_plugin; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - $migration_configuration = [ - 'migration' => [ - 'd6_user_role', - 'd7_user_role', - ], - ]; - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration) - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - list($roles) = $value; - - // Remove role IDs disabled in D6/D7. - $roles = array_filter($roles); - - $user_role_roles = []; - - if ($roles) { - foreach ($roles as $key => $role_id) { - $roles[$key] = $this->migrationPlugin->transform($role_id, $migrate_executable, $row, $destination_property); - } - $user_role_roles = array_combine($roles, $roles); - } - - return $user_role_roles; - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php deleted file mode 100644 index 331761635..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php +++ /dev/null @@ -1,221 +0,0 @@ -noSnippetUser = $this->drupalCreateUser($permissions); - $permissions[] = 'add JS snippets for piwik'; - $this->admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if configuration is possible. - */ - public function testPiwikConfiguration() { - // Check for setting page's presence. - $this->drupalGet('admin/config/system/piwik'); - $this->assertRaw(t('Piwik site ID'), '[testPiwikConfiguration]: Settings page displayed.'); - - // Check for account code validation. - $edit['piwik_site_id'] = $this->randomMachineName(2); - $edit['piwik_url_http'] = 'http://www.example.com/piwik/'; - $this->drupalPostForm('admin/config/system/piwik', $edit, 'Save configuration'); - $this->assertRaw(t('A valid Piwik site ID is an integer only.'), '[testPiwikConfiguration]: Invalid Piwik site ID number validated.'); - - // Verify that invalid URLs throw a form error. - $edit = []; - $edit['piwik_site_id'] = 1; - $edit['piwik_url_http'] = 'http://www.example.com/piwik/'; - $edit['piwik_url_https'] = 'https://www.example.com/piwik/'; - $this->drupalPostForm('admin/config/system/piwik', $edit, t('Save configuration')); - $this->assertRaw('The validation of "http://www.example.com/piwik/piwik.php" failed with an exception', '[testPiwikConfiguration]: HTTP URL exception shown.'); - $this->assertRaw('The validation of "https://www.example.com/piwik/piwik.php" failed with an exception', '[testPiwikConfiguration]: HTTPS URL exception shown.'); - - // User should have access to code snippets. - $this->assertFieldByName('piwik_codesnippet_before'); - $this->assertFieldByName('piwik_codesnippet_after'); - $this->assertNoFieldByXPath("//textarea[@name='piwik_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is enabled.'); - $this->assertNoFieldByXPath("//textarea[@name='piwik_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is enabled.'); - - // Login as user without JS permissions. - $this->drupalLogin($this->noSnippetUser); - $this->drupalGet('admin/config/system/piwik'); - - // User should *not* have access to snippets, but create fields. - $this->assertFieldByName('piwik_codesnippet_before'); - $this->assertFieldByName('piwik_codesnippet_after'); - $this->assertFieldByXPath("//textarea[@name='piwik_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is disabled.'); - $this->assertFieldByXPath("//textarea[@name='piwik_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is disabled.'); - } - - /** - * Tests if page visibility works. - */ - public function testPiwikPageVisibility() { - $site_id = '1'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Show tracking on "every page except the listed pages". - $this->config('piwik.settings')->set('visibility.request_path_mode', 0)->save(); - // Disable tracking one "admin*" pages only. - $this->config('piwik.settings')->set('visibility.request_path_pages', "/admin\n/admin/*")->save(); - // Enable tracking only for authenticated users only. - $this->config('piwik.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed for authenticated users.'); - - // Test whether tracking code is not included on pages to omit. - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is not displayed on admin page.'); - $this->drupalGet('admin/config/system/piwik'); - // Checking for tracking URI here, as $site_id is displayed in the form. - $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is not displayed on admin subpage.'); - - // Test whether tracking code display is properly flipped. - $this->config('piwik.settings')->set('visibility.request_path_mode', 1)->save(); - $this->drupalGet('admin'); - $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed on admin page.'); - $this->drupalGet('admin/config/system/piwik'); - // Checking for tracking URI here, as $site_id is displayed in the form. - $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed on admin subpage.'); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is NOT displayed on front page.'); - - // Test whether tracking code is not display for anonymous. - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is NOT displayed for anonymous.'); - - // Switch back to every page except the listed pages. - $this->config('piwik.settings')->set('visibility.request_path_mode', 0)->save(); - // Enable tracking code for all user roles. - $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save(); - - // Test whether 403 forbidden tracking code is shown if user has no access. - $this->drupalGet('admin'); - $this->assertRaw('"403/URL = "', '[testPiwikPageVisibility]: 403 Forbidden tracking code shown if user has no access.'); - - // Test whether 404 not found tracking code is shown on non-existent pages. - $this->drupalGet($this->randomMachineName(64)); - $this->assertRaw('"404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.'); - } - - /** - * Tests if tracking code is properly added to the page. - */ - public function testPiwikTrackingCode() { - $site_id = '2'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Show tracking code on every page except the listed pages. - $this->config('piwik.settings')->set('visibility.request_path_mode', 0)->save(); - // Enable tracking code for all user roles. - $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save(); - - /* Sample JS code as added to page: - - */ - - // Test whether tracking code uses latest JS. - $this->config('piwik.settings')->set('cache', 0)->save(); - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikTrackingCode]: Latest tracking code used.'); - - // Test if tracking of User ID is enabled. - $this->config('piwik.settings')->set('track.userid', 1)->save(); - $this->drupalGet(''); - $this->assertRaw('_paq.push(["setUserId", ', '[testPiwikTrackingCode]: Tracking code for User ID is enabled.'); - - // Test if tracking of User ID is disabled. - $this->config('piwik.settings')->set('track.userid', 0)->save(); - $this->drupalGet(''); - $this->assertNoRaw('_paq.push(["setUserId", ', '[testPiwikTrackingCode]: Tracking code for User ID is disabled.'); - - // Test whether single domain tracking is active. - $this->drupalGet(''); - $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: Single domain tracking is active.'); - - // Enable "One domain with multiple subdomains". - $this->config('piwik.settings')->set('domain_mode', 1)->save(); - $this->drupalGet(''); - - // Test may run on localhost, an ipaddress or real domain name. - // TODO: Workaround to run tests successfully. This feature cannot tested - // reliable. - global $cookie_domain; - if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) { - $this->assertRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: One domain with multiple subdomains is active on real host.'); - } - else { - // Special cases, Localhost and IP addresses don't show 'setCookieDomain'. - $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: One domain with multiple subdomains may be active on localhost (test result is not reliable).'); - } - - // Test whether the BEFORE and AFTER code is added to the tracker. - $this->config('piwik.settings')->set('codesnippet.before', '_paq.push(["setLinkTrackingTimer", 250]);')->save(); - $this->config('piwik.settings')->set('codesnippet.after', '_paq.push(["t2.setSiteId", 2]);if(1 == 1 && 2 < 3 && 2 > 1){console.log("Piwik: Custom condition works.");}_gaq.push(["t2.trackPageView"]);')->save(); - $this->drupalGet(''); - $this->assertRaw('setLinkTrackingTimer', '[testPiwikTrackingCode]: Before codesnippet has been found with "setLinkTrackingTimer" set.'); - $this->assertRaw('t2.trackPageView', '[testPiwikTrackingCode]: After codesnippet with "t2" tracker has been found.'); - $this->assertRaw('if(1 == 1 && 2 < 3 && 2 > 1){console.log("Piwik: Custom condition works.");}', '[testPiwikTrackingCode]: JavaScript code is not HTML escaped.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php deleted file mode 100644 index b55890c91..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php +++ /dev/null @@ -1,59 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if user password page urls are overridden. - */ - public function testPiwikUserPasswordPage() { - $base_path = base_path(); - $site_id = '1'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - $this->drupalGet('user/password', ['query' => ['name' => 'foo']]); - $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);'); - - $this->drupalGet('user/password', ['query' => ['name' => 'foo@example.com']]); - $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);'); - - $this->drupalGet('user/password'); - $this->assertNoRaw('_paq.push(["setCustomUrl", "', '[testPiwikCustomUrls]: Custom url not set.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php deleted file mode 100644 index a06d2bcc8..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php +++ /dev/null @@ -1,133 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if custom variables are properly added to the page. - */ - public function testPiwikCustomVariables() { - $site_id = '3'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Basic test if the feature works. - $custom_vars = [ - 1 => [ - 'slot' => 1, - 'name' => 'Foo 1', - 'value' => 'Bar 1', - 'scope' => 'visit', - ], - 2 => [ - 'slot' => 2, - 'name' => 'Foo 2', - 'value' => 'Bar 2', - 'scope' => 'page', - ], - 3 => [ - 'slot' => 3, - 'name' => 'Foo 3', - 'value' => 'Bar 3', - 'scope' => 'page', - ], - 4 => [ - 'slot' => 4, - 'name' => 'Foo 4', - 'value' => 'Bar 4', - 'scope' => 'visit', - ], - 5 => [ - 'slot' => 5, - 'name' => 'Foo 5', - 'value' => 'Bar 5', - 'scope' => 'visit', - ], - ]; - $this->config('piwik.settings')->set('custom.variable', $custom_vars)->save(); - $this->drupalGet(''); - - foreach ($custom_vars as $slot) { - $this->assertRaw('_paq.push(["setCustomVariable", ' . Json::encode($slot['slot']) . ', ' . Json::encode($slot['name']) . ', ' . Json::encode($slot['value']) . ', ' . Json::encode($slot['scope']) . ']);', '[testPiwikCustomVariables]: setCustomVariable ' . $slot['slot'] . ' is shown.'); - } - - // Test whether tokens are replaced in custom variable names. - $site_slogan = $this->randomMachineName(16); - $this->config('system.site')->set('slogan', $site_slogan)->save(); - - $custom_vars = [ - 1 => [ - 'slot' => 1, - 'name' => 'Name: [site:slogan]', - 'value' => 'Value: [site:slogan]', - 'scope' => 'visit', - ], - 2 => [ - 'slot' => 2, - 'name' => '', - 'value' => $this->randomMachineName(16), - 'scope' => 'page', - ], - 3 => [ - 'slot' => 3, - 'name' => $this->randomMachineName(16), - 'value' => '', - 'scope' => 'visit', - ], - 4 => [ - 'slot' => 4, - 'name' => '', - 'value' => '', - 'scope' => 'page', - ], - 5 => [ - 'slot' => 5, - 'name' => '', - 'value' => '', - 'scope' => 'visit', - ], - ]; - $this->config('piwik.settings')->set('custom.variable', $custom_vars)->save(); - $this->verbose('
' . print_r($custom_vars, TRUE) . '
'); - - $this->drupalGet(''); - $this->assertRaw('_paq.push(["setCustomVariable", 1, ' . Json::encode("Name: $site_slogan") . ', ' . Json::encode("Value: $site_slogan") . ', "visit"]', '[testPiwikCustomVariables]: Tokens have been replaced in custom variable.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 2,', '[testPiwikCustomVariables]: Value with empty name is not shown.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 3,', '[testPiwikCustomVariables]: Name with empty value is not shown.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 4,', '[testPiwikCustomVariables]: Empty name and value is not shown.'); - $this->assertNoRaw('_paq.push(["setCustomVariable", 5,', '[testPiwikCustomVariables]: Empty name and value is not shown.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php deleted file mode 100644 index 176fa53cb..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php +++ /dev/null @@ -1,107 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions_admin_user); - - // Administrator who cannot configure tracking visibility with PHP. - $permissions_delegated_admin_user = [ - 'access administration pages', - 'administer piwik', - ]; - $this->delegated_admin_user = $this->drupalCreateUser($permissions_delegated_admin_user); - } - - /** - * Tests if PHP module integration works. - */ - public function testPiwikPhpFilter() { - $site_id = '1'; - $this->drupalLogin($this->admin_user); - - $edit = []; - $edit['piwik_site_id'] = $site_id; - $edit['piwik_url_http'] = 'http://www.example.com/piwik/'; - $edit['piwik_url_https'] = 'https://www.example.com/piwik/'; - // Skip url check errors in automated tests. - $edit['piwik_url_skiperror'] = TRUE; - $edit['piwik_visibility_request_path_mode'] = 2; - $edit['piwik_visibility_request_path_pages'] = ''; - $this->drupalPostForm('admin/config/system/piwik', $edit, t('Save configuration')); - - // Compare saved setting with posted setting. - $piwik_visibility_request_path_pages = \Drupal::config('piwik.settings')->get('visibility.request_path_pages'); - $this->assertEqual('', $piwik_visibility_request_path_pages, '[testPiwikPhpFilter]: PHP code snippet is intact.'); - - // Check tracking code visibility. - $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save(); - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is displayed on frontpage page.'); - $this->drupalGet('admin'); - $this->assertRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is displayed on admin page.'); - - $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save(); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is not displayed on frontpage page.'); - - // Test administration form. - $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save(); - $this->drupalGet('admin/config/system/piwik'); - $this->assertRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testPiwikPhpFilter]: Permission to administer PHP for tracking visibility.'); - $this->assertRaw(Html::escape(''), '[testPiwikPhpFilter]: PHP code snippted is displayed.'); - - // Login the delegated user and check if fields are visible. - $this->drupalLogin($this->delegated_admin_user); - $this->drupalGet('admin/config/system/piwik'); - $this->assertNoRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testPiwikPhpFilter]: No permission to administer PHP for tracking visibility.'); - $this->assertRaw(Html::escape(''), '[testPiwikPhpFilter]: No permission to view PHP code snippted.'); - - // Set a different value and verify that this is still the same after the - // post. - $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save(); - - $edit = []; - $edit['piwik_site_id'] = $site_id; - $edit['piwik_url_http'] = 'http://www.example.com/piwik/'; - $edit['piwik_url_https'] = 'https://www.example.com/piwik/'; - // Required for testing only. - $edit['piwik_url_skiperror'] = TRUE; - $this->drupalPostForm('admin/config/system/piwik', $edit, t('Save configuration')); - - // Compare saved setting with posted setting. - $piwik_visibility_request_path_mode = $this->config('piwik.settings')->get('visibility.request_path_mode'); - $piwik_visibility_request_path_pages = $this->config('piwik.settings')->get('visibility.request_path_pages'); - $this->assertEqual(2, $piwik_visibility_request_path_mode, '[testPiwikPhpFilter]: Pages on which this PHP code returns TRUE is selected.'); - $this->assertEqual('', $piwik_visibility_request_path_pages, '[testPiwikPhpFilter]: PHP code snippet is intact.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php deleted file mode 100644 index 2d8831753..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php +++ /dev/null @@ -1,107 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if roles based tracking works. - */ - public function testPiwikRolesTracking() { - $site_id = '1'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Test if the default settings are working as expected. - // Add to the selected roles only. - $this->config('piwik.settings')->set('visibility.user_role_mode', 0)->save(); - // Enable tracking for all users. - $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for anonymous users on frontpage with default settings.'); - $this->drupalGet('admin'); - $this->assertRaw('"403/URL = "', '[testPiwikRoleVisibility]: 403 Forbidden tracking code is displayed for anonymous users in admin section with default settings.'); - - $this->drupalLogin($this->admin_user); - - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for authenticated users on frontpage with default settings.'); - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed for authenticated users in admin section with default settings.'); - - // Test if the non-default settings are working as expected. - // Enable tracking only for authenticated users. - $this->config('piwik.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save(); - - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for authenticated users only on frontpage.'); - - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed for anonymous users on frontpage.'); - - // Add to every role except the selected ones. - $this->config('piwik.settings')->set('visibility.user_role_mode', 1)->save(); - // Enable tracking for all users. - $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and displayed for anonymous users.'); - $this->drupalGet('admin'); - $this->assertRaw('"403/URL = "', '[testPiwikRoleVisibility]: 403 Forbidden tracking code is shown for anonymous users if every role except the selected ones is selected.'); - - $this->drupalLogin($this->admin_user); - - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and displayed on frontpage for authenticated users.'); - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and NOT displayed in admin section for authenticated users.'); - - // Disable tracking for authenticated users. - $this->config('piwik.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save(); - - $this->drupalGet(''); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed on frontpage for excluded authenticated users.'); - $this->drupalGet('admin'); - $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed in admin section for excluded authenticated users.'); - - $this->drupalLogout(); - $this->drupalGet(''); - $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed on frontpage for included anonymous users.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php deleted file mode 100644 index ded686118..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php +++ /dev/null @@ -1,98 +0,0 @@ -drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - - $permissions = [ - 'access administration pages', - 'administer piwik', - 'search content', - 'create page content', - 'edit own page content', - ]; - - // User to set up piwik. - $this->admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if search tracking is properly added to the page. - */ - public function testPiwikSearchTracking() { - $site_id = '1'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Check tracking code visibility. - $this->drupalGet(''); - $this->assertRaw($site_id, '[testPiwikSearch]: Tracking code is displayed for authenticated users.'); - - $this->drupalGet('search/node'); - $this->assertNoRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search tracker not added to page.'); - - // Enable site search support. - $this->config('piwik.settings')->set('track.site_search', 1)->save(); - - // Search for random string. - $search = []; - $search['keys'] = $this->randomMachineName(8); - - // Create a node to search for. - // Create a node. - $edit = []; - $edit['title[0][value]'] = 'This is a test title'; - $edit['body[0][value]'] = 'This test content contains ' . $search['keys'] . ' string.'; - - // Fire a search, it's expected to get 0 results. - $this->drupalPostForm('search/node', $search, t('Search')); - $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search results tracker is displayed.'); - $this->assertRaw('window.piwik_search_results = 0;', '[testPiwikSearch]: Search yielded no results.'); - - // Save the node. - $this->drupalPostForm('node/add/page', $edit, t('Save')); - $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.'); - - // Index the node or it cannot found. - $this->cronRun(); - - $this->drupalPostForm('search/node', $search, t('Search')); - $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search results tracker is displayed.'); - $this->assertRaw('window.piwik_search_results = 1;', '[testPiwikSearch]: One search result found.'); - - $this->drupalPostForm('node/add/page', $edit, t('Save')); - $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.'); - - // Index the node or it cannot found. - $this->cronRun(); - - $this->drupalPostForm('search/node', $search, t('Search')); - $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search results tracker is displayed.'); - $this->assertRaw('window.piwik_search_results = 2;', '[testPiwikSearch]: Two search results found.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php deleted file mode 100644 index 9e963465a..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php +++ /dev/null @@ -1,69 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - } - - /** - * Tests if status messages tracking is properly added to the page. - */ - public function testPiwikStatusMessages() { - $site_id = '1'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Enable logging of errors only. - $this->config('piwik.settings')->set('track.messages', ['error' => 'error'])->save(); - - $this->drupalPostForm('user/login', [], t('Log in')); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Username field is required."]);', '[testPiwikStatusMessages]: trackEvent "Username field is required." is shown.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Password field is required."]);', '[testPiwikStatusMessages]: trackEvent "Password field is required." is shown.'); - - // Testing this drupal_set_message() requires an extra test module. - $this->drupalGet('piwik-test/drupal-set-message'); - $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testPiwikStatusMessages]: Example status message is not enabled for tracking.'); - $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testPiwikStatusMessages]: Example warning message is not enabled for tracking.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testPiwikStatusMessages]: Example error message is shown.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testPiwikStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.'); - - // Enable logging of status, warnings and errors. - $this->config('piwik.settings')->set('track.messages', ['status' => 'status', 'warning' => 'warning', 'error' => 'error'])->save(); - - $this->drupalGet('piwik-test/drupal-set-message'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testPiwikStatusMessages]: Example status message is enabled for tracking.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testPiwikStatusMessages]: Example warning message is enabled for tracking.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testPiwikStatusMessages]: Example error message is shown.'); - $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testPiwikStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php deleted file mode 100644 index d9d878bf2..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php +++ /dev/null @@ -1,78 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if the module cleans up the disk on uninstall. - */ - public function testPiwikUninstall() { - $cache_path = 'public://piwik'; - $site_id = '1'; - $this->config('piwik.settings')->set('site_id', $site_id)->save(); - $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save(); - $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save(); - - // Enable local caching of piwik.js. - $this->config('piwik.settings')->set('cache', 1)->save(); - - // Load front page to get the piwik.js downloaded into local cache. But - // loading the piwik.js is not possible as "url_http" is a test dummy only. - // Create a dummy file to complete the rest of the tests. - file_prepare_directory($cache_path, FILE_CREATE_DIRECTORY); - $data = $this->randomMachineName(128); - $file_destination = $cache_path . '/piwik.js'; - file_unmanaged_save_data($data, $file_destination); - file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE); - - // Test if the directory and piwik.js exists. - $this->assertTrue(file_prepare_directory($cache_path), 'Cache directory "public://piwik" has been found.'); - $this->assertTrue(file_exists($cache_path . '/piwik.js'), 'Cached piwik.js tracking file has been found.'); - $this->assertTrue(file_exists($cache_path . '/piwik.js.gz'), 'Cached piwik.js.gz tracking file has been found.'); - - // Uninstall the module. - $edit = []; - $edit['uninstall[piwik]'] = TRUE; - $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall')); - $this->assertNoText(\Drupal::translation()->translate('Configuration deletions'), 'No configuration deletions listed on the module install confirmation page.'); - $this->drupalPostForm(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); - - // Test if the directory and all files have been removed. - $this->assertFalse(file_scan_directory($cache_path, '/.*/'), 'Cached JavaScript files have been removed.'); - $this->assertFalse(file_prepare_directory($cache_path), 'Cache directory "public://piwik" has been removed.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php deleted file mode 100644 index 7b79f482a..000000000 --- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php +++ /dev/null @@ -1,71 +0,0 @@ -admin_user = $this->drupalCreateUser($permissions); - $this->drupalLogin($this->admin_user); - } - - /** - * Tests if "allow users to customize tracking on their account page" works. - */ - public function testPiwikUserFields() { - $ua_code = 'UA-123456-1'; - $this->config('piwik.settings')->set('account', $ua_code)->save(); - - // Check if the pseudo field is shown on account forms. - $this->drupalGet('admin/config/people/accounts/form-display'); - $this->assertResponse(200); - $this->assertRaw(t('Piwik settings'), '[testPiwikUserFields]: Piwik settings field exists on Manage form display.'); - - // No customization allowed. - $this->config('piwik.settings')->set('visibility.user_account_mode', 0)->save(); - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - $this->assertResponse(200); - $this->assertNoRaw(t('Piwik settings'), '[testPiwikUserFields]: Piwik settings field does not exist on user edit page.'); - - // Tracking on by default, users with opt-in or out of tracking permission - // can opt out. - $this->config('piwik.settings')->set('visibility.user_account_mode', 1)->save(); - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - $this->assertResponse(200); - $this->assertRaw(t('Users are tracked by default, but you are able to opt out.'), '[testPiwikUserFields]: Piwik settings field exists on on user edit page'); - - // Tracking off by default, users with opt-in or out of tracking permission - // can opt in. - $this->config('piwik.settings')->set('visibility.user_account_mode', 2)->save(); - $this->drupalGet('user/' . $this->admin_user->id() . '/edit'); - $this->assertResponse(200); - $this->assertRaw(t('Users are not tracked by default, but you are able to opt in.'), '[testPiwikUserFields]: Piwik settings field exists on on user edit page.'); - } - -} diff --git a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml b/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml deleted file mode 100644 index 74c1d837e..000000000 --- a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Piwik test' -type: module -description: 'Support module for Piwik testing.' -package: Testing -# core: 8.x - -# Information added by Drupal.org packaging script on 2018-06-08 -version: '8.x-1.4' -core: '8.x' -project: 'piwik' -datestamp: 1528483684 diff --git a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml b/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml deleted file mode 100644 index 08ab3af8b..000000000 --- a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -piwik_test.drupal_set_message: - path: '/piwik-test/drupal-set-message' - defaults: - _title: 'Set messages with drupal_set_message()' - _controller: '\Drupal\piwik_test\Controller\PiwikTestController::drupalSetMessageTest' - requirements: - _access: 'TRUE' diff --git a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php b/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php deleted file mode 100644 index 5c65b7bd7..000000000 --- a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php +++ /dev/null @@ -1,28 +0,0 @@ -message with html tags and link.', 'error'); - - return []; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/LICENSE.txt b/sites/all/modules/contrib/admin/redirect/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/redirect/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/redirect/README.txt b/sites/all/modules/contrib/admin/redirect/README.txt deleted file mode 100644 index 5ae8276ab..000000000 --- a/sites/all/modules/contrib/admin/redirect/README.txt +++ /dev/null @@ -1,61 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Requirements - * Installation - * Configuration - * Maintainers - - -INTRODUCTION ------------- - -The Redirect module provides a unified redirection API (also replaces -path_redirect and globalredirect). - - - * For a full description of the module visit: - https://www.drupal.org/project/redirect - - * To submit bug reports and feature suggestions, or to track changes visit: - https://www.drupal.org/project/issues/redirect - - -REQUIREMENTS ------------- - -This module requires no modules outside of Drupal core. - - -INSTALLATION ------------- - - * Install the Redirect 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. Navigate to Administration > Configuration > Search and Metadata > URL - redirects for configuration. - 3. Select "Add redirect" and in the "Path" field add the old path. - 4. In the "To" field, start typing the title of a piece of content to select - it. You can also enter an internal path such as /node/add or an external - URL such as http://example.com. Enter to link to the front page. - 5. Select the Redirect status: 300 Multiple Choices, 301 Moved Permanently, - 302 Found, 303 See Other, 304 Not Modified, 305 Use Proxy, or 307 - Temporary Redirect. Save. - 6. Once a redirect has been added, it will be listed in the URL Redirects - vertical tab group on the content's edit page. - - -MAINTAINERS ------------ - -Supporting organization for 8.x-1.x port: - - * MD Systems - https://www.drupal.org/md-systems diff --git a/sites/all/modules/contrib/admin/redirect/composer.json b/sites/all/modules/contrib/admin/redirect/composer.json deleted file mode 100644 index b4f147895..000000000 --- a/sites/all/modules/contrib/admin/redirect/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "drupal/redirect", - "description": "Allows users to redirect from old URLs to new URLs.", - "type": "drupal-module", - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": { - "drupal/core": "~8" - } -} diff --git a/sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml b/sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml deleted file mode 100644 index 70a96888d..000000000 --- a/sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml +++ /dev/null @@ -1,7 +0,0 @@ -auto_redirect: true -default_status_code: 301 -passthrough_querystring: true -warning: false -ignore_admin_path: false -access_check: false -route_normalizer_enabled: true diff --git a/sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml b/sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml deleted file mode 100644 index 4b23fc81b..000000000 --- a/sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml +++ /dev/null @@ -1,13 +0,0 @@ -langcode: en -status: true -dependencies: - enforced: - module: - - redirect - module: - - redirect -id: redirect_delete_action -label: 'Delete redirect' -type: redirect -plugin: redirect_delete_action -configuration: { } diff --git a/sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml b/sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml deleted file mode 100644 index 6a1c65f55..000000000 --- a/sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml +++ /dev/null @@ -1,597 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - link - - redirect - - user -id: redirect -label: Redirect -module: views -description: 'List of redirects' -tag: '' -base_table: redirect -base_field: rid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'administer redirects' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: null - tags: - previous: '‹ previous' - next: 'next ›' - first: '« first' - last: 'last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - redirect_source__path: redirect_source__path - redirect_redirect__uri: redirect_redirect__uri - status_code: status_code - language: language - created: created - operations: operations - info: - redirect_source__path: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - redirect_redirect__uri: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - status_code: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - language: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - created: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - operations: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: created - empty_table: false - row: - type: fields - fields: - redirect_bulk_form: - id: redirect_bulk_form - table: redirect - field: redirect_bulk_form - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - action_title: 'With selection' - include_exclude: exclude - selected_actions: { } - entity_type: redirect - plugin_id: redirect_bulk_form - redirect_source__path: - id: redirect_source__path - table: redirect - field: redirect_source__path - relationship: none - group_type: group - admin_label: '' - label: From - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: path - type: redirect_source - settings: { } - group_column: '' - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: redirect - entity_field: redirect_source - plugin_id: field - redirect_redirect__uri: - id: redirect_redirect__uri - table: redirect - field: redirect_redirect__uri - entity_type: redirect - entity_field: redirect_redirect - plugin_id: field - status_code: - id: status_code - table: redirect - field: status_code - entity_type: redirect - entity_field: status_code - plugin_id: field - language: - id: language - table: redirect - field: language - entity_type: redirect - entity_field: language - plugin_id: field - created: - id: created - table: redirect - field: created - relationship: none - group_type: group - admin_label: '' - label: Created - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' - entity_type: redirect - entity_field: created - plugin_id: date - operations: - id: operations - table: redirect - field: operations - entity_type: redirect - plugin_id: entity_operations - filters: - redirect_source__path: - id: redirect_source__path - table: redirect - field: redirect_source__path - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: redirect_source__path_op - label: From - description: '' - use_operator: false - operator: redirect_source__path_op - identifier: redirect_source__path - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: redirect - entity_field: redirect_source - plugin_id: string - redirect_redirect__uri: - id: redirect_redirect__uri - table: redirect - field: redirect_redirect__uri - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: redirect_redirect__uri_op - label: To - description: '' - use_operator: false - operator: redirect_redirect__uri_op - identifier: redirect_redirect__uri - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: redirect - entity_field: redirect_redirect - plugin_id: string - status_code: - id: status_code - table: redirect - field: status_code - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '' - group: 1 - exposed: true - expose: - operator_id: status_code_op - label: 'Status code' - description: '' - use_operator: false - operator: status_code_op - identifier: status_code - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: true - group_info: - label: 'Status code' - description: '' - identifier: status_code - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: '300 Multiple Choices' - operator: '=' - value: - value: '300' - min: '' - max: '' - 2: - title: '301 Moved Permanently' - operator: '=' - value: - value: '301' - min: '' - max: '' - 3: - title: '302 Found' - operator: '=' - value: - value: '302' - min: '' - max: '' - 4: - title: '303 See Other' - operator: '=' - value: - value: '303' - min: '' - max: '' - 5: - title: '304 Not Modified' - operator: '=' - value: - value: '304' - min: '' - max: '' - 6: - title: '305 Use Proxy' - operator: '=' - value: - value: '305' - min: '' - max: '' - 7: - title: '307 Temporary Redirect' - operator: '=' - value: - value: '307' - min: '' - max: '' - entity_type: redirect - entity_field: status_code - plugin_id: numeric - language: - id: language - table: redirect - field: language - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: language_op - label: 'Original language' - description: '' - use_operator: false - operator: language_op - identifier: language - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: redirect - entity_field: language - plugin_id: language - sorts: { } - title: Redirect - header: { } - footer: { } - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: 'There is no redirect yet.' - plugin_id: text_custom - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - cacheable: false - max-age: 0 - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: admin/config/search/redirect - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - cacheable: false - max-age: 0 - tags: { } diff --git a/sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml b/sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml deleted file mode 100644 index e6dfad3fd..000000000 --- a/sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - redirect -id: redirect.redirect -target_entity_type_id: redirect -target_bundle: redirect -default_langcode: und -language_alterable: true diff --git a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml b/sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml deleted file mode 100644 index bd9ccd5d6..000000000 --- a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Schema for the configuration files of the Redirect module. - -redirect.settings: - type: config_entity - label: 'Redirect settings' - mapping: - auto_redirect: - type: boolean - label: 'Automatically create redirects when URL aliases are changed.' - default_status_code: - type: integer - label: 'Default redirect status' - passthrough_querystring: - type: boolean - label: 'Retain query string through redirect.' - warning: - type: boolean - label: 'Display a warning message to users when they are redirected.' - ignore_admin_path: - type: boolean - label: 'Allow redirections on admin paths.' - access_check: - type: boolean - label: 'Menu Access Checking' - route_normalizer_enabled: - type: boolean - label: 'Enforce clean and canonical URLs.' - -action.configuration.redirect_delete_action: - type: action_configuration_default - label: 'Delete redirect configuration' diff --git a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml b/sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml deleted file mode 100644 index 59a565ce4..000000000 --- a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Schema for the views plugins of the Redirect module. - -views.field.redirect_type: - type: views.field.redirect - label: 'Redirect type' - mapping: - machine_name: - type: string - label: 'Output machine name' - -# Schema for the formatter of Redirect Source -field.formatter.settings.redirect_source: - type: mapping - label: 'Redirect Source formatter' - mapping: { } - -views.field.redirect_bulk_form: - type: views_field_bulk_form - label: 'Redirect bulk form' diff --git a/sites/all/modules/contrib/admin/redirect/css/redirect.admin.css b/sites/all/modules/contrib/admin/redirect/css/redirect.admin.css deleted file mode 100644 index f613931ed..000000000 --- a/sites/all/modules/contrib/admin/redirect/css/redirect.admin.css +++ /dev/null @@ -1,14 +0,0 @@ -.redirect-table { - table-layout: fixed; -} - -.redirect-table__operations { - width: 30%; -} - -.redirect-table__path { - width: 70%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} diff --git a/sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml b/sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml deleted file mode 100644 index 1f3ddef96..000000000 --- a/sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml +++ /dev/null @@ -1,21 +0,0 @@ -id: d6_path_redirect -label: Path Redirect -migration_tags: - - Drupal 6 -source: - plugin: d6_path_redirect -process: - rid: rid - redirect_source: source - redirect_redirect: - plugin: d6_path_redirect - source: - - redirect - - query - language: - plugin: default_value - source: language - default_value: und - status_code: type -destination: - plugin: entity:redirect \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml b/sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml deleted file mode 100644 index 3ee9a287d..000000000 --- a/sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml +++ /dev/null @@ -1,25 +0,0 @@ -id: d7_path_redirect -label: Path Redirect -migration_tags: - - Drupal 7 -source: - plugin: d7_path_redirect -process: - rid: rid - uid: uid - redirect_source/path: source - redirect_source/query: - plugin: d7_redirect_source_query - source: source_options - redirect_redirect/uri: - plugin: d7_path_redirect - source: - - redirect - - redirect_options - language: - plugin: default_value - source: language - default_value: und - status_code: status_code -destination: - plugin: entity:redirect diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml deleted file mode 100644 index 030db9f0a..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml +++ /dev/null @@ -1,3 +0,0 @@ -row_limit: 10000 -pages: '' -suppress_404: FALSE diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml deleted file mode 100644 index 75777dee4..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml +++ /dev/null @@ -1,523 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - redirect_404 - - user -id: redirect_404 -label: 'Redirect 404' -module: views -description: '' -tag: '' -base_table: redirect_404 -base_field: '' -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'administer redirects' - cache: - type: none - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - path: path - count: count - timestamp: timestamp - info: - path: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' - count: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' - timestamp: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' - default: count - empty_table: false - row: - type: fields - fields: - path: - table: redirect_404 - field: path - id: path - entity_type: null - entity_field: null - plugin_id: standard - relationship: none - group_type: group - admin_label: '' - label: Path - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - count: - id: count - table: redirect_404 - field: count - relationship: none - group_type: group - admin_label: '' - label: Count - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - format: unserialized - key: '' - plugin_id: serialized - timestamp: - id: timestamp - table: redirect_404 - field: timestamp - relationship: none - group_type: group - admin_label: '' - label: 'Last accessed' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: short - custom_date_format: '' - timezone: '' - plugin_id: date - langcode: - id: langcode - table: redirect_404 - field: langcode - relationship: none - group_type: group - admin_label: '' - label: Language - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - redirect_404_operations: - id: redirect_404_operations - table: redirect_404 - field: redirect_404_operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: redirect_404_operations - filters: - path: - id: path - table: redirect_404 - field: path - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: path_op - label: Path - description: '' - use_operator: false - operator: path_op - identifier: path - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - langcode: - id: langcode - table: redirect_404 - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: Language - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: in_operator - resolved: - id: resolved - table: redirect_404 - field: resolved - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '0' - group: 1 - exposed: false - expose: - operator_id: '' - label: Resolved - description: '' - use_operator: false - operator: resolved_op - identifier: resolved - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: boolean - sorts: { } - title: 'Fix 404 pages' - header: { } - footer: { } - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: 'There are no 404 errors to fix.' - plugin_id: text_custom - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: admin/config/search/redirect/404 - display_description: 'Lists 404 error paths with no redirect assigned yet.' - enabled: true - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml deleted file mode 100644 index 3aaeb9d14..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Schema for the configuration files of the redirect_404 module. - -redirect_404.settings: - type: config_object - label: '404 error database logging settings.' - mapping: - row_limit: - type: integer - label: '404 error database logs to keep.' - pages: - type: string - suppress_404: - type: boolean - label: "Whether to log 'page not found' messages to the standard log or not." diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml deleted file mode 100644 index 5798b983e..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -views.field.redirect_404_operations: - type: views_field - label: 'Redirect 404 operations' - mapping: - text: - type: label - label: 'Redirect 404 operations' diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml deleted file mode 100644 index 1fbcea416..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Redirect 404' -type: module -description: 'Logs 404 errors and allows users to create redirects for often requested but missing pages.' -# core: 8.x - -dependencies: - - redirect - - views - -# Information added by Drupal.org packaging script on 2018-10-16 -version: '8.x-1.3' -core: '8.x' -project: 'redirect' -datestamp: 1539682690 diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install deleted file mode 100644 index 09190e7cf..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install +++ /dev/null @@ -1,62 +0,0 @@ - 'Stores 404 requests.', - 'fields' => [ - 'path' => [ - 'description' => 'The path of the request.', - 'type' => 'varchar', - 'length' => SqlRedirectNotFoundStorage::MAX_PATH_LENGTH, - 'not null' => TRUE, - ], - 'langcode' => [ - 'description' => 'The language of this request.', - 'type' => 'varchar_ascii', - 'length' => 12, - 'not null' => TRUE, - 'default' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - 'count' => [ - 'description' => 'The number of requests with that path and language.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ], - 'timestamp' => [ - 'description' => 'The timestamp of the last request with that path and language.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ], - 'resolved' => [ - 'description' => 'Boolean indicating whether or not this path has a redirect assigned.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ], - ], - 'primary key' => ['path', 'langcode'], - ]; - return $schema; -} - -/** - * Remove relevancy field from the redirect_404 table. - */ -function redirect_404_update_8101() { - \Drupal::database()->schema()->dropField('redirect_404', 'relevancy'); -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml deleted file mode 100644 index 24c721adb..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -redirect_404.goto_fix_404: - route_name: redirect_404.fix_404 - title: 'Fix 404 pages with URL redirects' - appears_on: - - 'dblog.page_not_found' diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml deleted file mode 100644 index 28622669f..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -redirect_404.fix_404: - title: 'Fix 404 pages' - parent: redirect.list - route_name: redirect_404.fix_404 - description: 'Add redirects for 404 pages.' - menu_name: admin diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml deleted file mode 100644 index 955161a11..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml +++ /dev/null @@ -1,5 +0,0 @@ -redirect_404.fix_404: - route_name: redirect_404.fix_404 - base_route: redirect.list - title: Fix 404 pages - weight: 30 diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module deleted file mode 100644 index b90d166e1..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module +++ /dev/null @@ -1,96 +0,0 @@ -purgeOldRequests(); -} - -/** - * Implements hook_form_FORM_ID_alter() for system_logging_settings(). - */ -function redirect_404_form_redirect_settings_form_alter(&$form, FormStateInterface $form_state, $form_id) { - $config = \Drupal::configFactory()->getEditable('redirect_404.settings'); - - $row_limits = [100, 1000, 10000, 100000, 1000000]; - $form['row_limit'] = [ - '#type' => 'select', - '#title' => t('404 error database logs to keep'), - '#default_value' => $config->get('row_limit'), - '#options' => [0 => t('All')] + array_combine($row_limits, $row_limits), - '#description' => t('The maximum number of 404 error logs to keep in the database log. Requires a cron maintenance task.', [':cron' => Url::fromRoute('system.status')->toString()]) - ]; - - $ignored_pages = $config->get('pages'); - // Add a new path to be ignored, if there is an ignore argument in the query. - if ($path_to_ignore = \Drupal::request()->query->get('ignore')) { - $ignored_pages .= "\n" . $path_to_ignore; - } - - $form['ignore_pages'] = [ - '#type' => 'textarea', - '#title' => t('Pages to ignore'), - '#default_value' => $ignored_pages, - '#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. An example path is %user-wildcard for every user page. %front is the front page.", [ - '%user-wildcard' => '/user/*', - '%front' => '', - ]), - ]; - - $form['suppress_404'] = [ - '#type' => 'checkbox', - '#title' => t("Suppress 'page not found' log messages"), - '#default_value' => $config->get('suppress_404'), - '#description' => t("Prevents logging 'page not found' events. Can be safely enabled when redirect_404 module is used, which stores them separately, nothing else relies on those messages."), - ]; - - $form['#submit'][] = 'redirect_404_logging_settings_submit'; -} - -/** - * Form submission handler for system_logging_settings(). - * - * @see redirect_404_form_redirect_settings_form_alter() - */ -function redirect_404_logging_settings_submit($form, FormStateInterface $form_state) { - // Make sure to store the 'pages to ignore' with the leading slash. - $ignore_pages = explode(PHP_EOL, $form_state->getValue('ignore_pages')); - $pages = ''; - foreach ($ignore_pages as $page) { - if (!empty($page)) { - $pages .= '/' . ltrim($page, '/') . "\n"; - } - } - - \Drupal::configFactory() - ->getEditable('redirect_404.settings') - ->set('row_limit', $form_state->getValue('row_limit')) - ->set('pages', $pages) - ->set('suppress_404', $form_state->getValue('suppress_404')) - ->save(); -} - -/** - * Implements hook_ENTITY_TYPE_presave() for redirect entities. - */ -function redirect_404_redirect_presave(Redirect $redirect) { - $path = $redirect->getSourcePathWithQuery(); - $langcode = $redirect->get('language')->value; - - // Mark a potentially existing log entry for this path as resolved. - \Drupal::service('redirect.not_found_storage')->resolveLogRequest($path, $langcode); -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml deleted file mode 100644 index 15146cba9..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml +++ /dev/null @@ -1,15 +0,0 @@ -redirect_404.fix_404: - path: '/admin/config/search/redirect/404' - defaults: - _title: 'Fix 404 pages' - _form: '\Drupal\redirect_404\Form\RedirectFix404Form' - requirements: - _permission: 'administer redirects' - -redirect_404.ignore_404: - path: '/admin/config/search/redirect/404/ignore' - defaults: - _controller: '\Drupal\redirect_404\Controller\Fix404IgnoreController::ignorePath' - requirements: - _permission: 'administer redirect settings' - _csrf_token: 'TRUE' diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml deleted file mode 100644 index 8221015ab..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - redirect.404_subscriber: - class: Drupal\redirect_404\EventSubscriber\Redirect404Subscriber - arguments: ['@path.current', '@path.matcher', '@request_stack', '@language_manager', '@redirect.not_found_storage', '@config.factory'] - tags: - - { name: event_subscriber } - redirect.not_found_storage: - class: Drupal\redirect_404\SqlRedirectNotFoundStorage - arguments: ['@database', '@config.factory'] - tags: - - { name: backend_overridable } - logger.redirect_404: - public: false - class: \Drupal\redirect_404\Render\Redirect404LogSuppressor - decorates: logger.factory - arguments: ['@logger.redirect_404.inner', '@config.factory'] diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc deleted file mode 100644 index bc18f93e1..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc +++ /dev/null @@ -1,99 +0,0 @@ - '', - 'title' => t('Fix 404 pages'), - 'help' => t('Overview for 404 error paths with no redirect assigned yet.'), - ]; - - $data['redirect_404']['path'] = [ - 'title' => t('Path'), - 'help' => t('The path of the request.'), - 'field' => [ - 'id' => 'standard', - ], - 'filter' => [ - 'id' => 'string', - ], - ]; - - $data['redirect_404']['langcode'] = [ - 'title' => t('Language'), - 'help' => t('The language of this request.'), - 'field' => [ - 'id' => 'redirect_404_langcode', - ], - 'filter' => [ - 'id' => 'language', - ], - ]; - - $data['redirect_404']['count'] = [ - 'title' => t('Count'), - 'help' => t('The number of requests with that path and language.'), - 'field' => [ - 'id' => 'numeric', - 'click sortable' => TRUE, - ], - 'filter' => [ - 'id' => 'numeric', - ], - ]; - - $data['redirect_404']['timestamp'] = [ - 'title' => t('Timestamp'), - 'help' => t('The timestamp of the last request with that path and language.'), - 'field' => [ - 'id' => 'date', - 'click sortable' => TRUE, - ], - 'filter' => [ - 'id' => 'date', - ], - ]; - - $data['redirect_404']['resolved'] = [ - 'title' => t('Resolved'), - 'help' => t('Whether or not this path has a redirect assigned.'), - 'field' => [ - 'id' => 'boolean', - ], - 'filter' => [ - 'id' => 'boolean', - 'label' => t('Resolved'), - 'use_equal' => TRUE, - ], - ]; - - $data['redirect_404']['redirect_404_operations'] = [ - 'title' => t('Operations'), - 'help' => t('Provide operation buttons to handle the 404 path.'), - 'field' => [ - 'id' => 'redirect_404_operations', - 'additional fields' => ['path', 'langcode'], - 'real field' => 'path', - ], - ]; - - return $data; -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php deleted file mode 100644 index a00331188..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php +++ /dev/null @@ -1,85 +0,0 @@ -configuration = $config_factory; - $this->redirectStorage = $redirect_storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('redirect.not_found_storage') - ); - } - - /** - * Adds path into the ignored list. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The HttpRequest object representing the current request. - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse - */ - public function ignorePath(Request $request) { - $ignored_paths = $this->config('redirect_404.settings')->get('pages'); - $path = $request->query->get('path'); - $langcode = $request->query->get('langcode'); - - if (empty($ignored_paths) || !strpos($path, $ignored_paths)) { - $this->redirectStorage->resolveLogRequest($path, $langcode); - - drupal_set_message($this->t('Resolved the path %path in the database. Please check the ignored list and save the settings.', [ - '%path' => $path, - ])); - } - - $options = [ - 'query' => [ - 'ignore' => $path, - 'destination' => Url::fromRoute('redirect_404.fix_404')->getInternalPath(), - ], - ]; - - return $this->redirect('redirect.settings', [], $options); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php deleted file mode 100644 index f7cd1416a..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php +++ /dev/null @@ -1,129 +0,0 @@ -currentPath = $current_path; - $this->pathMatcher = $path_matcher; - $this->requestStack = $request_stack; - $this->languageManager = $language_manager; - $this->redirectStorage = $redirect_storage; - $this->config = $config->get('redirect_404.settings'); - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events[KernelEvents::EXCEPTION][] = 'onKernelException'; - return $events; - } - - /** - * Logs an exception of 404 Redirect errors. - * - * @param GetResponseForExceptionEvent $event - * Is given by the event dispatcher. - */ - public function onKernelException(GetResponseForExceptionEvent $event) { - // Only log page not found (404) errors. - if ($event->getException() instanceof NotFoundHttpException) { - $path = $this->currentPath->getPath(); - - // Ignore paths specified in the redirect settings. - if ($pages = mb_strtolower($this->config->get('pages'))) { - // Do not trim a trailing slash if that is the complete path. - $path_to_match = $path === '/' ? $path : rtrim($path, '/'); - - if ($this->pathMatcher->matchPath(mb_strtolower($path_to_match), $pages)) { - return; - } - } - - // Allow to store paths with arguments. - if ($query_string = $this->requestStack->getCurrentRequest()->getQueryString()) { - $query_string = '?' . $query_string; - } - $path .= $query_string; - $langcode = $this->languageManager->getCurrentLanguage()->getId(); - - // Write record. - $this->redirectStorage->logRequest($path, $langcode); - } - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php deleted file mode 100644 index 7e01d1af5..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php +++ /dev/null @@ -1,193 +0,0 @@ -languageManager = $language_manager; - $this->redirectStorage = $redirect_storage; - $this->dateFormatter = $date_formatter; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('language_manager'), - $container->get('redirect.not_found_storage'), - $container->get('date.formatter'), - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'redirect_fix_404_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $destination = $this->getDestinationArray(); - - $search = $this->getRequest()->get('search'); - $form['#attributes'] = ['class' => ['search-form']]; - - $form['basic'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Filter 404s'), - '#attributes' => ['class' => ['container-inline']], - ]; - $form['basic']['filter'] = [ - '#type' => 'textfield', - '#title' => '', - '#default_value' => $search, - '#maxlength' => 128, - '#size' => 25, - ]; - $form['basic']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Filter'), - '#action' => 'filter', - ]; - if ($search) { - $form['basic']['reset'] = [ - '#type' => 'submit', - '#value' => $this->t('Reset'), - '#action' => 'reset', - ]; - } - - $languages = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL); - $multilingual = $this->languageManager->isMultilingual(); - - $header = [ - ['data' => $this->t('Path'), 'field' => 'source'], - ['data' => $this->t('Count'), 'field' => 'count', 'sort' => 'desc'], - ['data' => $this->t('Last accessed'), 'field' => 'timestamp'], - ]; - if ($multilingual) { - $header[] = ['data' => $this->t('Language'), 'field' => 'language']; - } - $header[] = ['data' => $this->t('Operations')]; - - $rows = []; - $results = $this->redirectStorage->listRequests($header, $search); - foreach ($results as $result) { - $path = ltrim($result->path, '/'); - - $row = []; - $row['source'] = $path; - $row['count'] = $result->count; - $row['timestamp'] = $this->dateFormatter->format($result->timestamp, 'short'); - if ($multilingual) { - if (isset($languages[$result->langcode])) { - $row['language'] = $languages[$result->langcode]->getName(); - } - else { - $row['language'] = $this->t('Undefined @langcode', ['@langcode' => $result->langcode]); - } - } - - $operations = []; - if ($this->entityTypeManager->getAccessControlHandler('redirect')->createAccess()) { - $operations['add'] = [ - 'title' => $this->t('Add redirect'), - 'url' => Url::fromRoute('redirect.add', [], ['query' => ['source' => $path, 'language' => $result->langcode] + $destination]), - ]; - } - $row['operations'] = [ - 'data' => [ - '#type' => 'operations', - '#links' => $operations, - ], - ]; - - $rows[] = $row; - } - - $form['redirect_404_table'] = [ - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('There are no 404 errors to fix.'), - ]; - $form['redirect_404_pager'] = ['#type' => 'pager']; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - if ($form_state->getTriggeringElement()['#action'] == 'filter') { - $form_state->setRedirect('redirect_404.fix_404', [], ['query' => ['search' => trim($form_state->getValue('filter'))]]); - } - else { - $form_state->setRedirect('redirect_404.fix_404'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php deleted file mode 100644 index 4fc03d334..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php +++ /dev/null @@ -1,63 +0,0 @@ -languageManager = $language_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('language_manager') - ); - } - - /** - * {@inheritdoc} - */ - public function access(AccountInterface $account) { - return $this->languageManager->isMultilingual(); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php deleted file mode 100644 index b1c0e6da5..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php +++ /dev/null @@ -1,123 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - $this->currentUser = $current_user; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('renderer'), - $container->get('current_user') - ); - } - - /** - * {@inheritdoc} - */ - public function clickSortable() { - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function render(ResultRow $values) { - $links = []; - - $query = [ - 'query' => [ - 'source' => ltrim($this->getValue($values, 'path'), '/'), - 'language' => $this->getValue($values, 'langcode'), - 'destination' => $this->view->getPath(), - ], - ]; - $links['add'] = [ - 'title' => $this->t('Add redirect'), - 'url' => Url::fromRoute('redirect.add', [], $query), - ]; - - if ($this->currentUser->hasPermission('administer redirect settings')) { - $links['ignore'] = [ - 'title' => $this->t('Ignore'), - 'url' => Url::fromRoute('redirect_404.ignore_404', [ - 'path' => $this->getValue($values, 'path'), - 'langcode' => $this->getValue($values, 'langcode'), - ]), - ]; - } - - $operations['data'] = [ - '#type' => 'operations', - '#links' => $links, - ]; - - return $this->renderer->render($operations); - } - - /** - * {@inheritdoc} - */ - public function access(AccountInterface $account) { - return $this->entityTypeManager->getAccessControlHandler('redirect')->createAccess(); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php deleted file mode 100644 index 27bc56de5..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php +++ /dev/null @@ -1,53 +0,0 @@ -loggerChannelFactory = $logger_channel_factory; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function get($channel) { - if ($channel == 'page not found' && $this->configFactory->get('redirect_404.settings')->get('suppress_404')) { - // Do not log if a 404 error is detected and the suppress_404 is enabled. - return new NullLogger(); - } - - // Call LoggerChannelFactory to let the default logger workflow proceed. - return $this->loggerChannelFactory->get($channel); - } - - /** - * {@inheritdoc} - */ - public function addLogger(LoggerInterface $logger, $priority = 0) { - $this->loggerChannelFactory->addLogger($logger, $priority); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php deleted file mode 100644 index 98003ebae..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php +++ /dev/null @@ -1,162 +0,0 @@ -database = $database; - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function logRequest($path, $langcode) { - if (mb_strlen($path) > static::MAX_PATH_LENGTH) { - // Don't attempt to log paths that would result in an exception. There is - // no point in logging truncated paths, as they cannot be used to build a - // new redirect. - return; - } - // Ignore invalid UTF-8, which can't be logged. - if (!Unicode::validateUtf8($path)) { - return; - } - - // If the request is not new, update its count and timestamp. - $this->database->merge('redirect_404') - ->key('path', $path) - ->key('langcode', $langcode) - ->expression('count', 'count + 1') - ->fields([ - 'timestamp' => REQUEST_TIME, - 'count' => 1, - 'resolved' => 0, - ]) - ->execute(); - } - - /** - * {@inheritdoc} - */ - public function resolveLogRequest($path, $langcode) { - $this->database->update('redirect_404') - ->fields(['resolved' => 1]) - ->condition('path', $path) - ->condition('langcode', $langcode) - ->execute(); - } - - /** - * {@inheritdoc} - */ - public function purgeOldRequests() { - $row_limit = $this->configFactory->get('redirect_404.settings')->get('row_limit'); - - // In admin form 0 used as value for 'All' label. - if ($row_limit == 0) { - return; - } - - $query = $this->database->select('redirect_404', 'r404'); - $query->fields('r404', ['timestamp']); - // On databases known to support log(), use it to calculate a logarithmic - // scale of the count, to delete records with count of 1-9 first, then - // 10-99 and so on. - if ($this->database->driver() == 'mysql' || $this->database->driver() == 'pgsql') { - $query->addExpression('floor(log(10, count))', 'count_log'); - $query->orderBy('count_log', 'DESC'); - } - $query->orderBy('timestamp', 'DESC'); - $cutoff = $query - ->range($row_limit, 1) - ->execute() - ->fetchAssoc(); - - if (!empty($cutoff)) { - // Delete records having older timestamp and less visits (on a logarithmic - // scale) than cutoff. - $delete_query = $this->database->delete('redirect_404'); - - if ($this->database->driver() == 'mysql' || $this->database->driver() == 'pgsql') { - // Delete rows with same count_log AND older timestamp than cutoff. - $and_condition = $delete_query->andConditionGroup() - ->where('floor(log(10, count)) = :count_log2', [':count_log2' => $cutoff['count_log']]) - ->condition('timestamp', $cutoff['timestamp'], '<='); - - // And delete all the rows with count_log less than the cutoff. - $condition = $delete_query->orConditionGroup() - ->where('floor(log(10, count)) < :count_log1', [':count_log1' => $cutoff['count_log']]) - ->condition($and_condition); - $delete_query->condition($condition); - } - else { - $delete_query->condition('timestamp', $cutoff['timestamp'], '<='); - } - $delete_query->execute(); - } - } - - /** - * {@inheritdoc} - */ - public function listRequests(array $header = [], $search = NULL) { - $query = $this->database - ->select('redirect_404', 'r404') - ->extend('Drupal\Core\Database\Query\TableSortExtender') - ->orderByHeader($header) - ->extend('Drupal\Core\Database\Query\PagerSelectExtender') - ->limit(25) - ->fields('r404'); - - if ($search) { - // Replace wildcards with PDO wildcards. - // @todo Find a way to write a nicer pattern. - $wildcard = '%' . trim(preg_replace('!\*+!', '%', $this->database->escapeLike($search)), '%') . '%'; - $query->condition('path', $wildcard, 'LIKE'); - } - $results = $query->condition('resolved', 0, '=')->execute()->fetchAll(); - - return $results; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php deleted file mode 100644 index 89a14d2dc..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php +++ /dev/null @@ -1,203 +0,0 @@ -save(); - $language = ConfigurableLanguage::createFromLangcode('es'); - $language->save(); - $language = ConfigurableLanguage::createFromLangcode('fr'); - $language->save(); - } - - /** - * Tests the fix 404 pages workflow with language and content translation. - */ - public function testFix404RedirectList() { - // Visit a non existing page to have the 404 redirect_error entry. - $this->drupalGet('fr/testing'); - - $redirect = \Drupal::database()->select('redirect_404') - ->fields('redirect_404') - ->condition('path', '/testing') - ->execute() - ->fetchAll(); - if (count($redirect) == 0) { - $this->fail('No record was added'); - } - - // Go to the "fix 404" page and check the listing. - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('testing'); - $this->assertLanguageInTableBody('French'); - // Check the Language view filter uses the default language filter. - $this->assertOption('edit-langcode', 'All'); - $this->assertOption('edit-langcode', 'en'); - $this->assertOption('edit-langcode', 'de'); - $this->assertOption('edit-langcode', 'es'); - $this->assertOption('edit-langcode', 'fr'); - $this->assertOption('edit-langcode', LanguageInterface::LANGCODE_NOT_SPECIFIED); - $this->clickLink(t('Add redirect')); - - // Check if we generate correct Add redirect url and if the form is - // pre-filled. - $destination = Url::fromRoute('redirect_404.fix_404')->getInternalPath(); - $expected_query = [ - 'destination' => $destination, - 'language' => 'fr', - 'source' => 'testing', - ]; - $parsed_url = UrlHelper::parse($this->getUrl()); - $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']); - $this->assertEqual($expected_query, $parsed_url['query']); - $this->assertFieldByName('redirect_source[0][path]', 'testing'); - $this->assertOptionSelected('edit-language-0-value', 'fr'); - // Save the redirect. - $edit = ['redirect_redirect[0][uri]' => '/node']; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertUrl('admin/config/search/redirect/404'); - $this->assertText('There are no 404 errors to fix.'); - // Check if the redirect works as expected. - $this->assertRedirect('fr/testing', 'fr/node', 'HTTP/1.1 301 Moved Permanently'); - - // Test removing a redirect assignment, visit again the non existing page. - $this->drupalGet('admin/config/search/redirect'); - $this->assertText('testing'); - $this->assertLanguageInTableBody('French'); - $this->clickLink('Delete', 0); - $this->drupalPostForm(NULL, [], 'Delete'); - $this->assertUrl('admin/config/search/redirect'); - $this->assertText('There is no redirect yet.'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('There are no 404 errors to fix.'); - // Should be listed again in the 404 overview. - $this->drupalGet('fr/testing'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertLanguageInTableBody('French'); - // Check the error path visit count. - $this->assertFieldByXPath('//table/tbody/tr/td[2]', 2); - $this->clickLink('Add redirect'); - // Save the redirect with a different langcode. - $this->assertFieldByName('redirect_source[0][path]', 'testing'); - $this->assertOptionSelected('edit-language-0-value', 'fr'); - $edit['language[0][value]'] = 'es'; - $this->drupalPostForm(NULL, $edit, 'Save'); - $this->assertUrl('admin/config/search/redirect/404'); - // Should still be listed, redirecting to another language does not resolve - // the path. - $this->assertLanguageInTableBody('French'); - $this->drupalGet('admin/config/search/redirect'); - $this->assertLanguageInTableBody('Spanish'); - // Check if the redirect works as expected. - $this->assertRedirect('es/testing', 'es/node', 'HTTP/1.1 301 Moved Permanently'); - - // Visit multiple non existing pages to test the Redirect 404 View. - $this->drupalGet('testing1'); - $this->drupalGet('de/testing2'); - $this->drupalGet('de/testing2?test=1'); - $this->drupalGet('de/testing2?test=2'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertLanguageInTableBody('French'); - $this->assertLanguageInTableBody('English'); - $this->assertLanguageInTableBody('German'); - $this->assertText('testing1'); - $this->assertText('testing2'); - $this->assertText('testing2?test=1'); - $this->assertText('testing2?test=2'); - - // Test the Language view filter. - $this->drupalGet('admin/config/search/redirect/404', ['query' => ['langcode' => 'de']]); - $this->assertText('English'); - $this->assertNoLanguageInTableBody('English'); - $this->assertLanguageInTableBody('German'); - $this->assertNoText('testing1'); - $this->assertText('testing2'); - $this->assertText('testing2?test=1'); - $this->assertText('testing2?test=2'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertLanguageInTableBody('English'); - $this->assertLanguageInTableBody('German'); - $this->assertText('testing1'); - $this->assertText('testing2'); - $this->assertText('testing2?test=1'); - $this->assertText('testing2?test=2'); - $this->drupalGet('admin/config/search/redirect/404', ['query' => ['langcode' => 'en']]); - $this->assertLanguageInTableBody('English'); - $this->assertNoLanguageInTableBody('German'); - $this->assertText('testing1'); - $this->assertNoText('testing2'); - $this->assertNoText('testing2?test=1'); - $this->assertNoText('testing2?test=2'); - - // Assign a redirect to 'testing1'. - $this->clickLink('Add redirect'); - $expected_query = [ - 'destination' => $destination, - 'language' => 'en', - 'source' => 'testing1', - ]; - $parsed_url = UrlHelper::parse($this->getUrl()); - $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']); - $this->assertEqual($expected_query, $parsed_url['query']); - $this->assertFieldByName('redirect_source[0][path]', 'testing1'); - $this->assertOptionSelected('edit-language-0-value', 'en'); - $edit = ['redirect_redirect[0][uri]' => '/node']; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertUrl('admin/config/search/redirect/404'); - $this->assertNoLanguageInTableBody('English'); - $this->assertLanguageInTableBody('German'); - $this->drupalGet('admin/config/search/redirect'); - $this->assertLanguageInTableBody('Spanish'); - $this->assertLanguageInTableBody('English'); - // Check if the redirect works as expected. - $this->assertRedirect('/testing1', '/node', 'HTTP/1.1 301 Moved Permanently'); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php deleted file mode 100644 index 088cbba47..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php +++ /dev/null @@ -1,186 +0,0 @@ -drupalGet('non-existing0'); - - // Go to the "fix 404" page and check the listing. - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('non-existing0'); - $this->clickLink(t('Add redirect')); - - // Check if we generate correct Add redirect url and if the form is - // pre-filled. - $destination = Url::fromRoute('redirect_404.fix_404')->getInternalPath(); - $expected_query = [ - 'destination' => $destination, - 'language' => 'en', - 'source' => 'non-existing0', - ]; - $parsed_url = UrlHelper::parse($this->getUrl()); - $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']); - $this->assertEqual($expected_query, $parsed_url['query']); - $this->assertFieldByName('redirect_source[0][path]', 'non-existing0'); - // Save the redirect. - $edit = ['redirect_redirect[0][uri]' => '/node']; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertUrl('admin/config/search/redirect/404'); - $this->assertText('There are no 404 errors to fix.'); - // Check if the redirect works as expected. - $this->drupalGet('non-existing0'); - $this->assertUrl('node'); - - // Test removing a redirect assignment, visit again the non existing page. - $this->drupalGet('admin/config/search/redirect'); - $this->assertText('non-existing0'); - $this->clickLink('Delete', 0); - $this->drupalPostForm(NULL, [], 'Delete'); - $this->assertUrl('admin/config/search/redirect'); - $this->assertText('There is no redirect yet.'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('There are no 404 errors to fix.'); - // Should be listed again in the 404 overview. - $this->drupalGet('non-existing0'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('non-existing0'); - - // Visit multiple non existing pages to test the Redirect 404 View. - $this->drupalGet('non-existing0?test=1'); - $this->drupalGet('non-existing0?test=2'); - $this->drupalGet('non-existing1'); - $this->drupalGet('non-existing2'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('non-existing0?test=1'); - $this->assertText('non-existing0?test=2'); - $this->assertText('non-existing0'); - $this->assertText('non-existing1'); - $this->assertText('non-existing2'); - - // Test the Path view filter. - $this->drupalGet('admin/config/search/redirect/404', ['query' => ['path' => 'test=']]); - $this->assertText('non-existing0?test=1'); - $this->assertText('non-existing0?test=2'); - $this->assertNoText('non-existing1'); - $this->assertNoText('non-existing2'); - $this->drupalGet('admin/config/search/redirect/404', ['query' => ['path' => 'existing1']]); - $this->assertNoText('non-existing0?test=1'); - $this->assertNoText('non-existing0?test=2'); - $this->assertNoText('non-existing0'); - $this->assertText('non-existing1'); - $this->assertNoText('non-existing2'); - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('non-existing0?test=1'); - $this->assertText('non-existing0?test=2'); - $this->assertText('non-existing0'); - $this->assertText('non-existing1'); - $this->assertText('non-existing2'); - $this->drupalGet('admin/config/search/redirect/404', ['query' => ['path' => 'g2']]); - $this->assertNoText('non-existing0?test=1'); - $this->assertNoText('non-existing0?test=2'); - $this->assertNoText('non-existing0'); - $this->assertNoText('non-existing1'); - $this->assertText('non-existing2'); - - // Assign a redirect to 'non-existing2'. - $this->clickLink('Add redirect'); - $expected_query = [ - 'source' => 'non-existing2', - 'language' => 'en', - 'destination' => $destination, - ]; - $parsed_url = UrlHelper::parse($this->getUrl()); - $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']); - $this->assertEqual($expected_query, $parsed_url['query']); - $this->assertFieldByName('redirect_source[0][path]', 'non-existing2'); - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertUrl('admin/config/search/redirect/404'); - $this->assertText('non-existing0?test=1'); - $this->assertText('non-existing0?test=2'); - $this->assertText('non-existing0'); - $this->assertText('non-existing1'); - $this->assertNoText('non-existing2'); - // Check if the redirect works as expected. - $this->drupalGet('admin/config/search/redirect'); - $this->assertText('non-existing2'); - } - - /** - * Tests the redirect ignore pages. - */ - public function testIgnorePages() { - // Create two nodes. - $node1 = $this->drupalCreateNode(['type' => 'page']); - $node2 = $this->drupalCreateNode(['type' => 'page']); - - // Set some pages to be ignored just for the test. - $node_to_ignore = '/node/' . $node1->id() . '/test'; - $terms_to_ignore = '/term/*'; - $pages = $node_to_ignore . "\r\n" . $terms_to_ignore; - \Drupal::configFactory() - ->getEditable('redirect_404.settings') - ->set('pages', $pages) - ->save(); - - // Visit ignored or non existing pages. - $this->drupalGet('node/' . $node1->id() . '/test'); - $this->drupalGet('term/foo'); - $this->drupalGet('term/1'); - // Go to the "fix 404" page and check there are no 404 entries. - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertNoText('node/' . $node1->id() . '/test'); - $this->assertNoText('term/foo'); - $this->assertNoText('term/1'); - - // Visit non existing but 'unignored' page. - $this->drupalGet('node/' . $node2->id() . '/test'); - // Go to the "fix 404" page and check there is a 404 entry. - $this->drupalGet('admin/config/search/redirect/404'); - $this->assertText('node/' . $node2->id() . '/test'); - - // Add this 404 entry to the 'ignore path' list, assert it works properly. - $path_to_ignore = '/node/' . $node2->id() . '/test'; - $destination = '&destination=admin/config/search/redirect/404'; - $this->clickLink('Ignore'); - $this->assertUrl('admin/config/search/redirect/settings?ignore=' . $path_to_ignore . $destination); - $this->assertText('Resolved the path ' . $path_to_ignore . ' in the database. Please check the ignored list and save the settings.'); - $xpath = $this->xpath('//*[@id="edit-ignore-pages"]')[0]->asXML(); - $this->assertTrue(strpos($xpath, $node_to_ignore), $node_to_ignore . " in 'Path to ignore' found"); - $this->assertTrue(strpos($xpath, $terms_to_ignore), $terms_to_ignore . " in 'Path to ignore' found"); - $this->assertTrue(strpos($xpath, $path_to_ignore), $path_to_ignore . " in 'Path to ignore' found"); - - // Save the path with wildcard, but omitting the leading slash. - $nodes_to_ignore = 'node/*'; - $edit = ['ignore_pages' => $nodes_to_ignore . "\r\n" . $terms_to_ignore]; - $this->drupalPostForm(NULL, $edit, 'Save configuration'); - // Should redirect to 'Fix 404'. Check the 404 entry is not shown anymore. - $this->assertUrl('admin/config/search/redirect/404'); - $this->assertText('Configuration was saved.'); - $this->assertNoText('node/' . $node2->id() . '/test'); - $this->assertText('There are no 404 errors to fix.'); - - // Go back to the settings to check the 'Path to ignore' configurations. - $this->drupalGet('admin/config/search/redirect/settings'); - $xpath = $this->xpath('//*[@id="edit-ignore-pages"]')[0]->asXML(); - // Check that the new page to ignore has been saved with leading slash. - $this->assertTrue(strpos($xpath, '/' . $nodes_to_ignore), '/' . $nodes_to_ignore . " in 'Path to ignore' found"); - $this->assertTrue(strpos($xpath, $terms_to_ignore), $terms_to_ignore . " in 'Path to ignore' found"); - $this->assertFalse(strpos($xpath, $node_to_ignore), $node_to_ignore . " in 'Path to ignore' found"); - $this->assertFalse(strpos($xpath, $path_to_ignore), $path_to_ignore . " in 'Path to ignore' found"); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php deleted file mode 100644 index ef021b553..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php +++ /dev/null @@ -1,80 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'administer redirect settings', - 'administer redirects', - ]); - $this->webUser = $this->drupalCreateUser([]); - } - - /** - * Tests the suppress_404 service. - */ - public function testSuppress404Events() { - // Cause a page not found and an access denied event. - $this->drupalGet('page-not-found'); - $this->assertResponse(404); - $this->drupalLogin($this->webUser); - $this->drupalGet('admin/reports/dblog'); - $this->assertResponse(403); - - // Assert the events are logged in the dblog reports. - $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1); - $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 1); - - // Login as admin and enable suppress_404 to avoid logging the 404 event. - $this->drupalLogin($this->adminUser); - $edit = ['suppress_404' => TRUE]; - $this->drupalPostForm('admin/config/search/redirect/settings', $edit, 'Save configuration'); - - // Cause again a page not found and an access denied event. - $this->drupalGet('page-not-found'); - $this->assertResponse(404); - $this->drupalLogin($this->webUser); - $this->drupalGet('admin/reports/dblog'); - $this->assertResponse(403); - - // Assert only the new access denied event is logged now. - $this->drupalLogin($this->adminUser); - $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1); - $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 2); - - } -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php deleted file mode 100644 index 2842aeb14..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php +++ /dev/null @@ -1,144 +0,0 @@ -adminUser = $this->drupalCreateUser($this->adminPermissions); - $this->drupalLogin($this->adminUser); - - $this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']); - } - - /** - * Passes if the language of the 404 path IS found on the loaded page. - * - * Because assertText() checks also in the Language select options, this - * specific assertion in the redirect 404 table body is needed. - * - * @param string $language - * The language to assert in the redirect 404 table body. - * @param string $body - * (optional) The table body xpath where to assert the language. Defaults - * to '//table/tbody'. - * @param string $message - * (optional) A message to display with the assertion. Do not translate - * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed - * variables in the message text, not t(). If left blank, a default message - * will be displayed. - * - * @return bool - * TRUE on pass, FALSE on fail. - */ - protected function assertLanguageInTableBody($language, $body = '//table/tbody', $message = '') { - return $this->assertLanguageInTableBodyHelper($language, $body, $message, FALSE); - } - - /** - * Passes if the language of the 404 path is NOT found on the loaded page. - * - * Because assertText() checks also in the Language select options, this - * specific assertion in the redirect 404 table body is needed. - * - * @param string $language - * The language to assert in the redirect 404 table body. - * @param string $body - * (optional) The table body xpath where to assert the language. Defaults - * to '//table/tbody'. - * @param string $message - * (optional) A message to display with the assertion. Do not translate - * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed - * variables in the message text, not t(). If left blank, a default message - * will be displayed. - * - * @return bool - * TRUE on pass, FALSE on fail. - */ - protected function assertNoLanguageInTableBody($language, $body = '//table/tbody', $message = '') { - return $this->assertLanguageInTableBodyHelper($language, $body, $message, TRUE); - } - - /** - * Helper for assertLanguageInTableBody and assertNoLanguageInTableBody. - * - * @param array $language - * The language to assert in the redirect 404 table body. - * @param string $body - * (optional) The table body xpath where to assert the language. Defaults - * to '//table/tbody'. - * @param string $message - * (optional) A message to display with the assertion. Do not translate - * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed - * variables in the message text, not t(). If left blank, a default message - * will be displayed. - * @param bool $not_exists - * (optional) TRUE if this language should not exist, FALSE if it should. - * Defaults to TRUE. - * - * @return bool - * TRUE on pass, FALSE on fail. - */ - protected function assertLanguageInTableBodyHelper($language, $body = '//table/tbody', $message = '', $not_exists = TRUE) { - if (!$message) { - if (!$not_exists) { - $message = new FormattableMarkup('Language "@language" found in 404 table.', ['@language' => $language]); - } - else { - $message = new FormattableMarkup('Language "@language" not found in 404 table.', ['@language' => $language]); - } - } - - if ($not_exists) { - return $this->assertFalse(strpos($this->xpath($body)[0]->asXML(), $language), $message); - } - else { - return $this->assertTrue(strpos($this->xpath($body)[0]->asXML(), $language), $message); - } - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php deleted file mode 100644 index 6ed6d6774..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php +++ /dev/null @@ -1,192 +0,0 @@ -installSchema('redirect_404', 'redirect_404'); - - // Insert some records in the test table with a given count and timestamp. - $this->insert404Row('/test1', 12, strtotime('now')); - $this->insert404Row('/test2', 5, strtotime('-1 hour')); - $this->insert404Row('/test3', 315, strtotime('-1 week')); - $this->insert404Row('/test4', 300, strtotime('-1 month')); - $this->insert404Row('/test5', 1557, strtotime('-1 week')); - $this->insert404Row('/test6', 1, strtotime('-1 day')); - } - - /** - * Tests adding and deleting rows from redirect_404 table. - */ - function testRedirect404CronJob() { - // Set the limit to 3 just for the test. - \Drupal::configFactory() - ->getEditable('redirect_404.settings') - ->set('row_limit', 3) - ->save(); - - // Check that there are 6 rows in the redirect_404 table. - $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField(); - $this->assertEquals(6, $result); - - // Run cron to drop 3 rows from the redirect_404 test table. - redirect_404_cron(); - - $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField(); - $this->assertEquals(3, $result); - - // Check there are only 3 rows with more count in the redirect_404 table. - if (\Drupal::database()->driver() == 'mysql' || \Drupal::database()->driver() == 'pgsql') { - $this->assertNo404Row('/test1'); - $this->assertNo404Row('/test2'); - $this->assert404Row('/test3'); - $this->assert404Row('/test4'); - $this->assert404Row('/test5'); - $this->assertNo404Row('/test6'); - } - else { - // In SQLite is the opposite: the 3 rows kept are the newest ones. - $this->assert404Row('/test1'); - $this->assert404Row('/test2'); - $this->assertNo404Row('/test3'); - $this->assertNo404Row('/test4'); - $this->assertNo404Row('/test5'); - $this->assert404Row('/test6'); - } - } - - /** - * Tests adding rows and deleting one row from redirect_404 table. - */ - function testRedirect404CronJobKeepAllButOne() { - // Set the limit to 5 just for the test. - \Drupal::configFactory() - ->getEditable('redirect_404.settings') - ->set('row_limit', 5) - ->save(); - - // Check that there are 6 rows in the redirect_404 table. - $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField(); - $this->assertEquals(6, $result); - - // Run cron to drop just 1 row from the redirect_404 test table. - redirect_404_cron(); - - $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField(); - $this->assertEquals(5, $result); - - // Check only the row with least count has been removed from the table. - if (\Drupal::database()->driver() == 'mysql' || \Drupal::database()->driver() == 'pgsql') { - $this->assert404Row('/test1'); - $this->assert404Row('/test2'); - $this->assert404Row('/test3'); - $this->assert404Row('/test4'); - $this->assert404Row('/test5'); - $this->assertNo404Row('/test6'); - } - else { - // In SQlite, only the oldest row is deleted. - $this->assert404Row('/test1'); - $this->assert404Row('/test2'); - $this->assert404Row('/test3'); - $this->assertNo404Row('/test4'); - $this->assert404Row('/test5'); - $this->assert404Row('/test6'); - } - } - - /** - * Inserts a 404 request log in the redirect_404 test table. - * - * @param string $path - * The path of the request. - * @param int $count - * (optional) The visits count of the request. - * @param int $timestamp - * (optional) The timestamp of the last visited request. - * @param string $langcode - * (optional) The langcode of the request. - */ - protected function insert404Row($path, $count = 1, $timestamp = 0, $langcode = 'en') { - db_insert('redirect_404') - ->fields([ - 'path' => $path, - 'langcode' => $langcode, - 'count' => $count, - 'timestamp' => $timestamp, - 'resolved' => 0, - ]) - ->execute(); - } - - /** - * Passes if the row with the given parameters is in the redirect_404 table. - * - * @param string $path - * The path of the request. - * @param string $langcode - * (optional) The langcode of the request. - */ - protected function assert404Row($path, $langcode = 'en') { - $this->assert404RowHelper($path, $langcode, FALSE); - } - - /** - * Passes if the row with the given parameters is NOT in the redirect_404 table. - * - * @param string $path - * The path of the request. - * @param string $langcode - * (optional) The langcode of the request. - */ - protected function assertNo404Row($path, $langcode = 'en') { - $this->assert404RowHelper($path, $langcode, TRUE); - } - - /** - * Passes if the row with the given parameters is in the redirect_404 table. - * - * @param string $path - * The path of the request. - * @param string $langcode - * (optional) The langcode of the request. - * @param bool $not_exists - * (optional) TRUE if this 404 row should not exist in the redirect_404 - * table, FALSE if it should. Defaults to TRUE. - */ - protected function assert404RowHelper($path, $langcode = 'en', $not_exists = TRUE) { - $result = db_select('redirect_404', 'r404') - ->fields('r404', ['path']) - ->condition('path', $path) - ->condition('langcode', $langcode) - ->condition('resolved', 0) - ->execute() - ->fetchField(); - - if ($not_exists) { - $this->assertNotEquals($path, $result); - } - else { - $this->assertEquals($path, $result); - } - } -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php deleted file mode 100644 index 42e0224e5..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php +++ /dev/null @@ -1,78 +0,0 @@ -database = $this->getMockBuilder(Connection::class) - ->disableOriginalConstructor() - ->getMock(); - } - - /** - * Tests that long paths aren't stored in the database. - */ - public function testLongPath() { - $this->database->expects($this->never()) - ->method('merge'); - $storage = new SqlRedirectNotFoundStorage($this->database, $this->getConfigFactoryStub()); - $storage->logRequest($this->randomMachineName(SqlRedirectNotFoundStorage::MAX_PATH_LENGTH + 1), LanguageInterface::LANGCODE_DEFAULT); - } - - /** - * Tests that invalid UTF-8 paths are not stored in the database. - */ - public function testInvalidUtf8Path() { - $this->database->expects($this->never()) - ->method('merge'); - $storage = new SqlRedirectNotFoundStorage($this->database, $this->getConfigFactoryStub()); - $storage->logRequest("Caf\xc3", LanguageInterface::LANGCODE_DEFAULT); - } - - /** - * Tests that all logs are kept if row limit config is "All". - */ - public function testPurgeOldRequests() { - $this->configFactory = $this->getConfigFactoryStub( - [ - 'redirect_404.settings' => [ - 'row_limit' => 0, - ], - ] - ); - $storage = new SqlRedirectNotFoundStorage($this->database, $this->configFactory); - $storage->purgeOldRequests(); - $this->database->expects($this->never()) - ->method('select'); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml deleted file mode 100644 index 05c0310cc..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml +++ /dev/null @@ -1 +0,0 @@ -domain_redirects: { } diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml deleted file mode 100644 index 5e29a4c57..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml +++ /dev/null @@ -1,18 +0,0 @@ -redirect_domain.domains: - type: config_object - label: 'Redirect domains' - mapping: - domain_redirects: - type: sequence - label: 'Domain redirects' - sequence: - type: sequence - sequence: - type: mapping - mapping: - sub_path: - type: string - label: 'Sub path' - destination: - type: string - label: 'Destination' diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml deleted file mode 100644 index aeb66d453..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Redirect Domain' -type: module -description: 'Allows users to redirect between domains.' -# core: 8.x - -dependencies: - - redirect - -# Information added by Drupal.org packaging script on 2018-10-16 -version: '8.x-1.3' -core: '8.x' -project: 'redirect' -datestamp: 1539682690 diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml deleted file mode 100644 index 1dcee94c0..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml +++ /dev/null @@ -1,5 +0,0 @@ -redirect_domain.domain_list: - title: 'Domain redirects' - base_route: redirect.list - route_name: redirect_domain.domain_list - weight: 60 diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module deleted file mode 100644 index f60b329bf..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module +++ /dev/null @@ -1,33 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The Redirect domain module allows users to redirect between domains.') . '

'; - $output .= '

' . t('Uses') . '

'; - $output .= '
' . t('Manage domain redirects') . '
'; - $output .= '
' . t('The domain redirect is accessed through Domain Redirects. The user can add the domain redirects through the domain redirect table which consists of the domain from which it needs to be redirected, the sub path and the complete url destination to which it needs to be redirected. The module also supports the usage of a wildcard redirecting, thus many requests can be handled with one instance of domain redirect.', [':domainlist' => Url::fromRoute('redirect_domain.domain_list')->toString()]) . '
'; - return $output; - case 'redirect_domain.domain_list': - $output = '

' . t('The domain redirect table consists of the domain from which it needs to be redirected, the sub path and the complete url destination to which it needs to be redirected.') . '

'; - $output .= '
' . t('Example Configuration') . '
'; - $output .= '
    '; - $output .= '
  • example.com/redirect => redirected.com/example-path
  • '; - $output .= '
  • foo.com/* => bar.com
  • '; - $output .= '
'; - $output .= '
' . t('Example Redirects') . '
'; - $output .= '
    '; - $output .= '
  • ' . t('Request: example.com/redirect => Response: redirected.com/example-path') . '
  • '; - $output .= '
  • ' . t('Request: foo.com/any-path => Response: bar.com') . '
  • '; - $output .= '
'; - return $output; - } -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml deleted file mode 100644 index ad38a0716..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -redirect_domain.domain_list: - path: '/admin/config/search/redirect/domain' - defaults: - _title: 'Domain redirects' - _form: '\Drupal\redirect_domain\Form\RedirectDomainForm' - requirements: - _permission: 'administer redirects' diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml deleted file mode 100644 index 94503c617..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - redirect_domain.request_subscriber: - class: Drupal\redirect_domain\EventSubscriber\DomainRedirectRequestSubscriber - arguments: ['@config.factory', '@redirect.checker', '@path.matcher'] - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php deleted file mode 100644 index bc949b81f..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php +++ /dev/null @@ -1,133 +0,0 @@ -domainConfig = $config_factory->get('redirect_domain.domains'); - $this->redirectConfig = $config_factory->get('redirect.settings'); - $this->redirectChecker = $redirect_checker; - $this->pathMatcher = $path_matcher; - } - - /** - * Handles the domain redirect if any found. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The event to process. - */ - public function onKernelRequestCheckDomainRedirect(GetResponseEvent $event) { - $request = clone $event->getRequest(); - - if (!$this->redirectChecker->canRedirect($request)) { - return; - } - - // Redirect between domains configuration. - $domains = $this->domainConfig->get('domain_redirects'); - if (!empty($domains)) { - $host = $request->getHost(); - $path = $request->getPathInfo(); - $protocol = $request->getScheme() . '://'; - $destination = NULL; - - // Checks if there is a redirect domain in the configuration. - if (isset($domains[str_replace('.', ':', $host)])) { - foreach ($domains[str_replace('.', ':', $host)] as $item) { - if ($this->pathMatcher->matchPath($path, $item['sub_path'])) { - $destination = $item['destination']; - break; - } - } - if ($destination) { - // Use the default status code from Redirect. - $response = new TrustedRedirectResponse( - $protocol . $destination, - $this->redirectConfig->get('default_status_code') - ); - $event->setResponse($response); - return; - } - } - } - } - - /** - * Prior to set the response it check if we can redirect. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The event object. - * @param \Drupal\Core\Url $url - * The Url where we want to redirect. - */ - protected function setResponse(GetResponseEvent $event, Url $url) { - $request = $event->getRequest(); - - parse_str($request->getQueryString(), $query); - $url->setOption('query', $query); - $url->setAbsolute(TRUE); - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - // This needs to run before RouterListener::onKernelRequest(), which has - // a priority of 32 and - // RedirectRequestSubscriber::onKernelRequestCheckRedirect(), which has - // a priority of 33. Otherwise, that aborts the request if no matching - // route is found. - $events[KernelEvents::REQUEST][] = ['onKernelRequestCheckDomainRedirect', 34]; - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php deleted file mode 100644 index 1bf5b9a87..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php +++ /dev/null @@ -1,165 +0,0 @@ -has('maximum_domains')) { - $form_state->set('maximum_domains', 1); - } - - $form['redirects'] = [ - '#type' => 'table', - '#tree' => TRUE, - '#header' => [ - $this->t('From domain'), - $this->t('Sub path'), - $this->t('Destination') - ], - '#prefix' => '
', - '#suffix' => '
', - ]; - - $rows = []; - // Obtain domain redirects from configuration. - if ($domain_redirects = $this->config('redirect_domain.domains')->get('domain_redirects')) { - foreach ($domain_redirects as $key => $value) { - foreach ($value as $item) { - $form['redirects'][] = [ - 'from' => [ - '#type' => 'textfield', - '#value' => str_replace(':','.',$key), - ], - 'sub_path' => [ - '#type' => 'textfield', - '#value' => $item['sub_path'], - ], - 'destination' => [ - '#type' => 'textfield', - '#value' => $item['destination'], - ], - ]; - } - } - } - - // Fields for the new domain redirects. - for ($i = 0; $i < $form_state->get('maximum_domains'); $i++) { - $form['redirects'][] = [ - 'from' => [ - '#type' => 'textfield', - ], - 'sub_path' => [ - '#type' => 'textfield', - '#value' => '/', - ], - 'destination' => [ - '#type' => 'textfield', - ], - ]; - } - - $form['add'] = [ - '#type' => 'submit', - '#value' => $this->t('Add another'), - '#submit' => ['::addAnotherSubmit'], - '#ajax' => [ - 'callback' => '::ajaxAddAnother', - 'wrapper' => 'redirect-domain-wrapper', - ], - ]; - $form['submit'] = [ - '#type' => 'submit', - '#button_type' => 'primary', - '#value' => $this->t('Save'), - ]; - return $form; - } - - /** - * Ajax callback for adding another domain redirect. - * - * @param array $form - * The form structure. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * - * @return array - * The new domain redirect form part. - */ - public function ajaxAddAnother(array $form, FormStateInterface $form_state) { - return $form['redirects']; - } - - /** - * Submit callback for adding a new domain field. - */ - public function addAnotherSubmit(array $form, FormStateInterface $form_state) { - $form_state->set('maximum_domains', $form_state->get('maximum_domains') + 1); - $form_state->setRebuild(TRUE); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - if ($redirects = $form_state->getValue('redirects')) { - foreach ($redirects as $redirect) { - if (strpos($redirect['from'], '://') !== FALSE) { - $form_state->setErrorByName('redirects', $this->t('No protocol should be included in the redirect domain.')); - } - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $domain_redirects = []; - $domain_config = $this->config('redirect_domain.domains'); - - if ($redirects = $form_state->getValue('redirects')) { - foreach ($redirects as $redirect) { - if (!empty($redirect['from']) && !empty($redirect['destination'])) { - // Replace '.' with ':' for an eligible key. - $redirect['from'] = str_replace('.', ':', $redirect['from']); - $domain_redirects[$redirect['from']][] = [ - 'sub_path' => '/' . ltrim($redirect['sub_path'], '/'), - 'destination' => $redirect['destination'] - ]; - } - } - } - $domain_config->set('domain_redirects', $domain_redirects); - $domain_config->save(); - drupal_set_message($this->t('The domain redirects have been saved.')); - } -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php deleted file mode 100644 index d50791f37..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php +++ /dev/null @@ -1,64 +0,0 @@ -drupalCreateUser([ - 'administer site configuration', - 'access administration pages', - 'administer redirects' - ]); - $this->drupalLogin($user); - $this->drupalGet('/admin/config/search/redirect/domain'); - - // Assert that there are 2 domain redirect fields. - $this->assertFieldByName('redirects[0][from]'); - $this->assertFieldByName('redirects[0][sub_path]'); - $this->assertFieldByName('redirects[0][destination]'); - - // Add another field for new domain redirect. - $this->drupalPostAjaxForm(NULL, [], ['op' => t('Add another')]); - - // Add two new domain redirects. - $edit = [ - 'redirects[0][from]' => 'foo.example.org', - 'redirects[0][sub_path]' => '//sub-path', - 'redirects[0][destination]' => 'www.example.org/foo', - 'redirects[1][from]' => 'bar.example.org', - 'redirects[1][sub_path]' => '', - 'redirects[1][destination]' => 'www.example.org/bar', - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - - // Check the new domain redirects. - $this->assertFieldByName('redirects[0][from]', 'foo.example.org'); - $this->assertFieldByName('redirects[0][destination]', 'www.example.org/foo'); - $this->assertFieldByName('redirects[1][from]', 'bar.example.org'); - $this->assertFieldByName('redirects[1][destination]', 'www.example.org/bar'); - - // Ensure that the sub paths are correct. - $this->assertFieldByName('redirects[0][sub_path]', '/sub-path'); - $this->assertFieldByName('redirects[1][sub_path]', '/'); - } -} diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php deleted file mode 100644 index 89453ab9d..000000000 --- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php +++ /dev/null @@ -1,144 +0,0 @@ - [ - 'domain_redirects' => [ - 'foo:com' => [ - [ - 'sub_path' => '/fixedredirect', - 'destination' => 'bar.com/fixedredirect', - ], - [ - 'sub_path' => '/*', - 'destination' => 'bar.com/example', - ], - ], - 'example:com' => [ - [ - 'sub_path' => '/foo/*/bar', - 'destination' => 'example.com/bar/foo', - ], - ], - 'simpleexample:com' => [ - [ - 'sub_path' => '/redirect', - 'destination' => 'redirected.com/redirect', - ], - ], - ], - ], - 'redirect.settings' => [ - 'default_status_code' => 301, - ], - 'system.site' => [ - 'page.front' => '/', - ], - ]; - - // Create a mock redirect checker. - $checker = $this->getMockBuilder(RedirectChecker::class) - ->disableOriginalConstructor() - ->getMock(); - $checker->expects($this->any()) - ->method('canRedirect') - ->will($this->returnValue(TRUE)); - - // Set up the configuration for the requested domain. - $config_factory = $this->getConfigFactoryStub($data); - - // Create a mock path matcher. - $route_match = $this->getMock(RouteMatchInterface::class); - $path_matcher = new PathMatcher($config_factory, $route_match); - - $subscriber = new DomainRedirectRequestSubscriber( - $config_factory, - $checker, - $path_matcher - ); - - // Make a request to the urls from the data provider and get the response. - $event = $this->getGetResponseEventStub($request_url, http_build_query([])); - - // Run the main redirect method. - $subscriber->onKernelRequestCheckDomainRedirect($event); - - // Assert the expected response from the data provider. - if ($response_url) { - $this->assertTrue($event->getResponse() instanceof RedirectResponse); - $response = $event->getResponse(); - // Make sure that the response is properly redirected. - $this->assertEquals($response_url, $response->getTargetUrl()); - $this->assertEquals( - $config_factory->get('redirect.settings')->get('default_status_code'), - $response->getStatusCode() - ); - } - else { - $this->assertNull($event->getResponse()); - } - } - - /** - * Gets response event object. - * - * @param $path_info - * The path info. - * @param $query_string - * The query string in the url. - * - * @return GetResponseEvent - * The response for the request. - */ - protected function getGetResponseEventStub($path_info, $query_string) { - $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], ['SCRIPT_NAME' => 'index.php']); - - $http_kernel = $this->getMockBuilder(HttpKernelInterface::class) - ->getMock(); - return new GetResponseEvent($http_kernel, $request, 'test'); - } - - /** - * Data provider for the domain redirects. - * - * @return array - * An array of requests and expected responses for the redirect domains. - */ - public function providerDomains() { - $datasets = []; - $datasets[] = ['http://foo.com/example', 'http://bar.com/example']; - $datasets[] = ['http://example.com/foo/test/bar', 'http://example.com/bar/foo']; - $datasets[] = ['http://simpleexample.com/redirect', 'http://redirected.com/redirect']; - $datasets[] = ['http://nonexisting.com', NULL]; - $datasets[] = ['http://simpleexample.com/wrongpath', NULL]; - $datasets[] = ['http://foo.com/fixedredirect', 'http://bar.com/fixedredirect']; - return $datasets; - } -} diff --git a/sites/all/modules/contrib/admin/redirect/redirect.api.php b/sites/all/modules/contrib/admin/redirect/redirect.api.php deleted file mode 100644 index 9ec1bdff7..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.api.php +++ /dev/null @@ -1,142 +0,0 @@ - $redirect) { - if ($redirect->source !== $source) { - // If the redirects to do not exactly match $source (e.g. case - // insensitive matches), then remove them from the results. - unset($redirects[$rid]); - } - } -} - -/** - * Act on a redirect object about to be shown on the add/edit form. - * - * This hook is invoked from redirect_create(). - * - * @param $redirect - * The redirect that is about to be shown on the add/edit form. - * - * @ingroup redirect_api_hooks - */ -function hook_redirect_prepare($redirect) { - -} - -/** - * Act on a redirect being redirected. - * - * This hook is invoked from redirect_redirect() before the redirect callback - * is invoked. - * - * @param $redirect - * The redirect that is being used for the redirect. - * - * @see redirect_redirect() - * @see drupal_page_is_cacheable() - * @ingroup redirect_api_hooks - */ -function hook_redirect_alter($redirect) { -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/sites/all/modules/contrib/admin/redirect/redirect.drush.inc b/sites/all/modules/contrib/admin/redirect/redirect.drush.inc deleted file mode 100644 index ffe98ce05..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.drush.inc +++ /dev/null @@ -1,72 +0,0 @@ - 'Create redirects.', - 'drupal dependencies' => array('devel_generate'), - 'arguments' => array( - 'count' => 'Number of redirects to generate.', - ), - 'options' => array( - 'delete' => 'Delete all redirects before generating new ones.', - ), - ); - - return $items; -} - -/** - * Command callback. Generate a number of redirects. - */ -function drush_redirect_generate_redirects($count = NULL) { - if (drush_generate_is_number($count) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', t('Invalid number of redirects.')); - } - module_load_include('inc', 'redirect', 'redirect.generate'); - drush_generate_include_devel(); - redirect_run_unprogressive_batch('redirect_generate_redirects_batch_info', $count, drush_get_option('delete')); -} - -/** - * Perform an unprogressive batch process for CLI. - */ -function redirect_run_unprogressive_batch() { - $batch = batch_get(); - if (!empty($batch)) { - // If there is already something in the batch, don't run. - return FALSE; - } - - $args = func_get_args(); - $batch_callback = array_shift($args); - - if (!lock_acquire($batch_callback)) { - return FALSE; - } - - // Attempt to increase the execution time. - drupal_set_time_limit(240); - - // Build the batch array. - $batch = call_user_func_array($batch_callback, $args); - batch_set($batch); - - // We need to manually set the progressive variable again. - // @todo Remove when http://drupal.org/node/638712 is fixed. - $batch =& batch_get(); - $batch['progressive'] = FALSE; - - // Run the batch process. - batch_process(); - - lock_release($batch_callback); - return TRUE; -} diff --git a/sites/all/modules/contrib/admin/redirect/redirect.generate.inc b/sites/all/modules/contrib/admin/redirect/redirect.generate.inc deleted file mode 100644 index 6120ae19b..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.generate.inc +++ /dev/null @@ -1,194 +0,0 @@ - 'textfield', - '#title' => t('How many URL redirects would you like to generate?'), - '#default_value' => 50, - '#size' => 4, - ); - $form['delete'] = array( - '#type' => 'checkbox', - '#title' => t('Delete all URL redirects before generating new URL redirects.'), - '#default_value' => FALSE, - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Generate'), - ); - - return $form; -} - -function redirect_generate_form_submit(&$form, &$form_state) { - // Run the batch. - $batch = redirect_generate_redirects_batch_info($form_state['values']['count'], $form_state['values']['delete']); - batch_set($batch); -} - -function redirect_generate_redirects_batch_info($count, $delete = FALSE) { - if ($delete) { - $operations[] = array('redirect_generate_batch_delete', array()); - } - - $operations[] = array('redirect_generate_batch_generate', array($count)); - - return array( - 'operations' => $operations, - 'finished' => 'redirect_generate_batch_finished', - 'file' => drupal_get_path('module', 'redirect') . '/redirect.generate.inc', - ); -} - -function redirect_generate_batch_delete(array &$context) { - if (empty($context['sandbox'])) { - $context['sandbox'] = array(); - $context['sandbox']['progress'] = 0; - $context['sandbox']['current_rid'] = 0; - $context['sandbox']['max'] = db_query('SELECT COUNT(DISTINCT rid) FROM {redirect}')->fetchField(); - } - - $limit = 20; - $rids = db_query_range("SELECT rid FROM {redirect} WHERE rid > :rid ORDER BY rid", 0, $limit, array(':rid' => $context['sandbox']['current_rid']))->fetchCol(); - foreach (redirect_repository()->loadMultiple($rids) as $redirect) { - $redirect->delete(); - } - - // Update our progress information. - $context['sandbox']['progress'] += count($rids); - $context['sandbox']['current_rid'] = end($rids); - $context['message'] = t('Deleted URL redirect @rid.', array('@rid' => end($rids))); - - // Inform the batch engine that we are not finished, - // and provide an estimation of the completion level we reached. - if ($context['sandbox']['progress'] != $context['sandbox']['max']) { - $context['finished'] = ($context['sandbox']['progress'] >= $context['sandbox']['max']); - } -} - -function redirect_generate_batch_generate($num, array &$context) { - if (empty($context['sandbox'])) { - $context['sandbox'] = array(); - $context['sandbox']['progress'] = 0; - $context['sandbox']['max'] = $num; - $query = \Drupal::database()->select('node', 'n'); - $query->addField('n', 'nid'); - $query->condition('n.status', NODE_PUBLISHED); - $query->addTag('node_access'); - $context['sandbox']['nids'] = $query->execute()->fetchAllKeyed(0, 0); - } - - module_load_include('inc', 'devel_generate'); - - $limit = 20; - $types = array_keys(redirect_status_code_options()); - $languages = \Drupal::moduleHandler()->moduleExists('locale') ? array_keys(\Drupal::languageManager()->getLanguages()) : array(); - - for ($i = 0; $i < min($limit, $context['sandbox']['max'] - $context['sandbox']['progress']); $i++) { - $rand = mt_rand(0, 100); - - $redirect = Redirect::create(); - - $source = _redirect_generate_url(); - $source_options = array(); - $redirect_options = array(); - - if ($context['sandbox']['nids'] && $rand >= 40) { - $redirect_target = 'node/' . array_rand($context['sandbox']['nids']); - } - else { - $redirect_target = _redirect_generate_url(TRUE); - if ($rand <= 20) { - $redirect_options['query'] = _redirect_generate_querystring(); - } - if ($rand <= 5) { - $redirect_options['fragment'] = DevelGenerateBase::generateWord(mt_rand(4, 8)); - } - } - - if ($rand <= 20) { - $redirect->setStatusCode($types[array_rand($types)]); - } - - if ($languages && $rand <= 20) { - $redirect->setLanguage($languages[array_rand($languages)]); - } - - $query = array(); - if ($rand <= 30) { - $query = _redirect_generate_querystring(); - } - - $redirect->setSource($source, $query); - $redirect->setRedirect($redirect_target); - - $redirect->save(); - - if (mt_rand(0, 1)) { - $query = \Drupal::database(); - $query->update('redirect') - ->fields(array( - 'count' => mt_rand(1, 500), - 'access' => mt_rand(REQUEST_TIME - 31536000, REQUEST_TIME), - )) - ->condition('rid', $redirect->id()) - ->execute(); - } - - $context['results'][] = $redirect->id(); - } - - // Update our progress information. - $context['sandbox']['progress'] += $limit; - //$context['message'] = t('Deleted URL redirect @rid.', array('@rid' => end($rids))); - - // Inform the batch engine that we are not finished, - // and provide an estimation of the completion level we reached. - if ($context['sandbox']['progress'] != $context['sandbox']['max']) { - $context['finished'] = ($context['sandbox']['progress'] >= $context['sandbox']['max']); - } -} - -function redirect_generate_batch_finished($success, $results, $operations) { - if ($success) { - drupal_set_message(\Drupal::translation()->formatPlural(count($results), 'One URL redirect created.', '@count URL redirects created.')); - } - else { - // An error occurred. - // $operations contains the operations that remained unprocessed. - $error_operation = reset($operations); - drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array('@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE)))); - } -} - -function _redirect_generate_url($external = FALSE, $max_levels = 2) { - $url = array(); - if ($external) { - $tlds = array('com', 'net', 'org'); - $url[] = 'http://www.example.'. $tlds[array_rand($tlds)]; - } - $max_levels = mt_rand($external ? 0 : 1, $max_levels); - for ($i = 1; $i <= $max_levels; $i++) { - $url[] = DevelGenerateBase::generateWord(mt_rand(6 / $i, 8)); - } - return implode('/', $url); -} - -function _redirect_generate_querystring() { - $query = array(DevelGenerateBase::generateWord(mt_rand(1, 3)) => DevelGenerateBase::generateWord(mt_rand(2, 4))); - return $query; -} diff --git a/sites/all/modules/contrib/admin/redirect/redirect.info.yml b/sites/all/modules/contrib/admin/redirect/redirect.info.yml deleted file mode 100644 index a1e6eb15d..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Redirect -type: module -description: Allows users to redirect from old URLs to new URLs. -# core: 8.x -configure: redirect.settings - -dependencies: - - drupal:link - - drupal:views - -# Information added by Drupal.org packaging script on 2018-10-16 -version: '8.x-1.3' -core: '8.x' -project: 'redirect' -datestamp: 1539682690 diff --git a/sites/all/modules/contrib/admin/redirect/redirect.install b/sites/all/modules/contrib/admin/redirect/redirect.install deleted file mode 100644 index 31a8ee693..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.install +++ /dev/null @@ -1,224 +0,0 @@ -fetchField(); - } - - $result = \Drupal::database()->select('redirect', 'r') - ->fields('r', ['rid', 'redirect_source__path', 'redirect_source__query', 'language', 'hash']) - ->condition('rid', $sandbox['current_rid'], '>') - ->range(0, 100) - ->orderBy('rid', 'ASC') - ->execute(); - - foreach ($result as $row) { - $query = !empty($row->redirect_source__query) ? unserialize($row->redirect_source__query): []; - $new_hash = Redirect::generateHash($row->redirect_source__path, (array) $query, $row->language); - if ($row->hash != $new_hash) { - // Do a direct query to speed things up. - $query = \Drupal::database(); - $query->update('redirect') - ->fields(['hash' => $new_hash]) - ->condition('rid', $row->rid) - ->execute(); - } - $sandbox['progress']++; - $sandbox['current_rid'] = $row->rid; - } - // Reset caches. - $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); -} - - -/** - * Update the {redirect} table. - */ -function redirect_update_8101() { - // Get the current schema, change the length. - $key_value_store_schema = \Drupal::keyValue('entity.storage_schema.sql'); - $schema = $key_value_store_schema->get('redirect.field_schema_data.hash'); - $schema['redirect']['fields']['hash']['length'] = 64; - - // Set the max_length of the hash column to 64 characters. - Database::getConnection() - ->schema() - ->changeField('redirect', 'hash', 'hash', $schema['redirect']['fields']['hash']); - - // Update the last installed field definition and field schema. - /** @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value_store */ - \Drupal::entityManager()->clearCachedFieldDefinitions(); - $key_value_store_definition = \Drupal::keyValue('entity.definitions.installed'); - $storage_definitions = $key_value_store_definition->get('redirect.field_storage_definitions'); - $storage_definitions['hash'] = $storage_definition = \Drupal::entityManager() - ->getFieldStorageDefinitions('redirect')['hash']; - $key_value_store_definition->set('redirect.field_storage_definitions', $storage_definitions); - - // Update the stored schema. - $key_value_store_schema->set('redirect.field_schema_data.hash', $schema); -} - -/** - * Update settings based on existing settings and Globalredirect settings. - */ -function redirect_update_8102() { - // Load default configuration. - $redirect_settings = \Drupal::config('redirect.settings'); - $globalredirect_settings = \Drupal::config('globalredirect.settings'); - $config_factory = \Drupal::configFactory(); - $redirect = $config_factory->getEditable('redirect.settings'); - $nonclean_to_clean = $redirect_settings->get('global_clean'); - $admin_path = $redirect_settings->get('global_admin_paths'); - $frontpage_redirect = $redirect_settings->get('global_home'); - $deslash = $redirect_settings->get('global_deslash'); - - $message = NULL; - - // If Globalredirect configuration exists, use those settings. - if ((!$globalredirect_settings->isNew())) { - $access_check = $globalredirect_settings->get('access_check'); - $normalize_aliases = $globalredirect_settings->get('normalize_aliases'); - $content_location_header = $globalredirect_settings->get('content_location_header'); - $term_path_handler = $globalredirect_settings->get('term_path_handler'); - $deslash = $globalredirect_settings->get('deslash'); - $frontpage_redirect = $globalredirect_settings->get('frontpage_redirect'); - $nonclean_to_clean = $globalredirect_settings->get('nonclean_to_clean'); - - $redirect->set('access_check', $access_check); - $redirect->set('normalize_aliases', $normalize_aliases); - $redirect->set('content_location_header', $content_location_header); - $redirect->set('term_path_handler', $term_path_handler); - - $message = 'The Globalredirect module functionality has been merged into redirect, it should be uninstalled now.'; - } - else { - $redirect->set('access_check', FALSE); - $redirect->set('normalize_aliases', TRUE); - $redirect->set('content_location_header', FALSE); - $redirect->set('term_path_handler', TRUE); - } - - // Update new redirect settings names. - $redirect->set('nonclean_to_clean', $nonclean_to_clean); - $redirect->set('admin_path', $admin_path); - $redirect->set('frontpage_redirect', $frontpage_redirect); - $redirect->set('deslash', $deslash); - - // Remove old names of redirect settings. - $redirect->clear('global_clean'); - $redirect->clear('global_admin_paths'); - $redirect->clear('global_home'); - $redirect->clear('global_deslash'); - - $redirect->save(); - - return $message; -} - -/** - * Creates the new default redirect view. - */ -function redirect_update_8103() { - $message = NULL; - - // Only create if the redirect view doesn't exist and views is enabled. - if (!View::load('redirect') && \Drupal::moduleHandler()->moduleExists('views')) { - $config_path = drupal_get_path('module', 'redirect') . '/config/install/views.view.redirect.yml'; - $data = Yaml::parse($config_path); - \Drupal::configFactory()->getEditable('views.view.redirect')->setData($data)->save(TRUE); - $message = 'The new redirect view has been created.'; - } - else { - $message = 'Not creating a redirect view since it already exists.'; - } - return $message; -} - -/** - * Save the bulk delete action to config. - */ -function redirect_update_8104() { - if (!Action::load('redirect_delete_action')) { - $entity_type_manager = \Drupal::entityTypeManager(); - $module_handler = \Drupal::moduleHandler(); - - // Save the bulk delete action to config. - $config_install_path = $module_handler->getModule('redirect')->getPath() . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; - $storage = new FileStorage($config_install_path); - $entity_type_manager - ->getStorage('action') - ->create($storage->read('system.action.redirect_delete_action')) - ->trustData() - ->save(); - } -} - -/** - * Ensure to use the redirect_404 submodule. - */ -function redirect_update_8105() { - \Drupal::service('module_installer')->install(['redirect_404']); -} - -/** - * Removes unnecessary settings from storage. - */ -function redirect_update_8106() { - $config = \Drupal::configFactory()->getEditable('redirect.settings'); - $config->set('route_normalizer_enabled', $config->get('normalize_aliases')); - $config->clear('term_path_handler'); - $config->clear('normalize_aliases'); - $config->clear('deslash'); - $config->clear('frontpage_redirect'); - $config->clear('nonclean_to_clean'); - $config->save(); -} - -/** - * Update permissions. - * - * When splitting the permission for settings from the permission to view - * the list of redirects, maintain the current permissions for sites which - * already have this module installed. - */ -function redirect_update_8107() { - if ($roles = Role::loadMultiple()) { - foreach ($roles as $role) { - if ($role->hasPermission('administer redirects')) { - $role->grantPermission('administer redirect settings'); - $role->save(); - } - } - } -} - -/** - * Removes unnecessary settings. - */ -function redirect_update_8108() { - $config = \Drupal::configFactory()->getEditable('redirect.settings'); - $config->clear('canonical'); - $config->clear('content_location_header'); - $config->save(); -} diff --git a/sites/all/modules/contrib/admin/redirect/redirect.libraries.yml b/sites/all/modules/contrib/admin/redirect/redirect.libraries.yml deleted file mode 100644 index 987487264..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.libraries.yml +++ /dev/null @@ -1,5 +0,0 @@ -drupal.redirect.admin: - version: VERSION - css: - component: - css/redirect.admin.css: {} diff --git a/sites/all/modules/contrib/admin/redirect/redirect.links.action.yml b/sites/all/modules/contrib/admin/redirect/redirect.links.action.yml deleted file mode 100644 index 3952ca594..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -redirect.add: - route_name: redirect.add - title: 'Add redirect' - appears_on: - - 'redirect.list' diff --git a/sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml b/sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml deleted file mode 100644 index b034d47fd..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml +++ /dev/null @@ -1,26 +0,0 @@ -redirect.list: - title: 'URL redirects' - parent: system.admin_config_search - description: 'Redirect users from one URL to another.' - route_name: redirect.list - menu_name: admin - -redirect.add: - title: 'Add redirect' - parent: redirect.list - route_name: redirect.add - menu_name: admin - -redirect.settings: - title: 'Settings' - parent: redirect.list - route_name: redirect.settings - description: 'Configure behavior for URL redirects.' - menu_name: admin - -#redirect.devel_generate: -# title: 'Generate redirects' -# parent: dblog.page_not_found -# route_name: redirect.devel_generate -# description: 'Generate a given number of redirects. Optionally delete current redirects.' -# menu_name: admin diff --git a/sites/all/modules/contrib/admin/redirect/redirect.links.task.yml b/sites/all/modules/contrib/admin/redirect/redirect.links.task.yml deleted file mode 100644 index 4216cbc30..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.links.task.yml +++ /dev/null @@ -1,10 +0,0 @@ -redirect.list: - route_name: redirect.list - base_route: redirect.list - title: URL Redirects - -redirect.settings: - route_name: redirect.settings - base_route: redirect.list - title: Settings - weight: 50 diff --git a/sites/all/modules/contrib/admin/redirect/redirect.module b/sites/all/modules/contrib/admin/redirect/redirect.module deleted file mode 100644 index bf4d4f902..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.module +++ /dev/null @@ -1,504 +0,0 @@ - 'redirect')); -} - -/** - * Implements hook_help(). - */ -function redirect_help($route_name, RouteMatchInterface $route_match) { - $output = ''; - switch ($route_name) { - case 'help.page.redirect': - $output = '

' . t('About') . '

'; - $output .= '

' . t('The Redirect module allows users to redirect from old URLs to new URLs. For more information, see the online documentation for Redirect.', [':online' => 'https://www.drupal.org/documentation/modules/path-redirect']) . '

'; - $output .= '
'; - $output .= '

' . t('Uses') . '

'; - $output .= '
' . t('Redirect is accessed from three tabs that help you manage URL Redirects.', [':list' => Url::fromRoute('redirect.list')->toString()]) . '
'; - $output .= '
' . t('Manage URL Redirects') . '
'; - $output .= '
' . t('The "URL Redirects" page is used to setup and manage URL Redirects. New redirects are created here using the Add redirect button which presents a form to simplify the creation of redirects . The URL redirects page provides a list of all redirects on the site and allows you to edit them.', [':redirect' => Url::fromRoute('redirect.list')->toString(), ':add_form' => Url::fromRoute('redirect.add')->toString()]) . '
'; - if (\Drupal::moduleHandler()->moduleExists('redirect_404')) { - $output .= '
' . t('Fix 404 pages') . '
'; - $output .= '
' . t('"Fix 404 pages" lists all paths that have resulted in 404 errors and do not yet have any redirects assigned to them. This 404 (or Not Found) error message is an HTTP standard response code indicating that the client was able to communicate with a given server, but the server could not find what was requested.', [':fix_404' => Url::fromRoute('redirect_404.fix_404')->toString()]) . '
'; - } - elseif (!\Drupal::moduleHandler()->moduleExists('redirect_404') && \Drupal::currentUser()->hasPermission('administer modules')) { - $output .= '
' . t('Fix 404 pages') . '
'; - $output .= '
' . t('404 (or Not Found) error message is an HTTP standard response code indicating that the client was able to communicate with a given server, but the server could not find what was requested. Please install the Redirect 404 submodule to be able to log all paths that have resulted in 404 errors.', [':extend' => Url::fromRoute('system.modules_list')->toString()]) . '
'; - } - $output .= '
' . t('Configure Global Redirects') . '
'; - $output .= '
' . t('The "Settings" page presents you with a number of means to adjust redirect settings.', [':settings' => Url::fromRoute('redirect.settings')->toString()]) . '
'; - $output .= '
'; - return $output; - break; - } -} - -/** - * Implements hook_entity_delete(). - * - * Will delete redirects based on the entity URL. - */ -function redirect_entity_delete(EntityInterface $entity) { - try { - if ($entity->getEntityType()->hasLinkTemplate('canonical') && $entity->toUrl('canonical')->isRouted()) { - redirect_delete_by_path('internal:/' . $entity->toUrl('canonical')->getInternalPath()); - redirect_delete_by_path('entity:' . $entity->getEntityTypeId() . '/' . $entity->id()); - } - } - catch (RouteNotFoundException $e) { - // This can happen if a module incorrectly defines a link template, ignore - // such errors. - } -} - -/** - * Implements hook_path_update(). - * - * Will create redirect from the old path alias to the new one. - */ -function redirect_path_update(array $path) { - if (!\Drupal::config('redirect.settings')->get('auto_redirect')) { - return; - } - $original_path = $path['original']; - - // Delete all redirects having the same source as this alias. - redirect_delete_by_path($path['alias'], $path['langcode'], FALSE); - if ($original_path['alias'] != $path['alias']) { - if (!redirect_repository()->findMatchingRedirect($original_path['alias'], array(), $original_path['langcode'])) { - $redirect = Redirect::create(); - $redirect->setSource($original_path['alias']); - $redirect->setRedirect($path['source']); - $redirect->setLanguage($original_path['langcode']); - $redirect->setStatusCode(\Drupal::config('redirect.settings')->get('default_status_code')); - $redirect->save(); - } - } -} - -/** - * Implements hook_path_insert(). - */ -function redirect_path_insert(array $path) { - // Delete all redirects having the same source as this alias. - redirect_delete_by_path($path['alias'], $path['langcode'], FALSE); -} - -/** - * Implements hook_path_delete(). - */ -function redirect_path_delete($path) { - if (!\Drupal::config('redirect.settings')->get('auto_redirect')) { - return; - } - elseif (isset($path['redirect']) && !$path['redirect']) { - return; - } - elseif (empty($path)) { - // @todo Remove this condition and allow $path to use an array type hint - // when http://drupal.org/node/1025904 is fixed. - return; - } - - // Redirect from a deleted alias to the system path. - //if (!redirect_load_by_source($path['alias'], $path['language'])) { - // $redirect = new stdClass(); - // redirect_create($redirect); - // $redirect->source = $path['alias']; - // $redirect->redirect = $path['source']; - // $redirect->language = $path['language']; - // redirect_save($redirect); - //} -} - -/** - * Implements hook_page_build(). - * - * Adds an action on 404 pages to create a redirect. - * - * @todo hook_page_build() can no longer be used for this. Find a different way. - */ -function redirect_page_build(&$page) { - if (redirect_is_current_page_404() && \Drupal::currentUser()->hasPermission('administer redirects')) { - if (!isset($page['content']['system_main']['actions'])) { - $page['content']['system_main']['actions'] = array( - '#theme' => 'links', - '#links' => array(), - '#attributes' => array('class' => array('action-links')), - '#weight' => -100, - ); - } - // We cannot simply use current_path() because if a 404 path is set, then - // that value overrides whatever is in $_GET['q']. The - // drupal_deliver_html_page() function thankfully puts the original current - // path into $_GET['destination']. - $destination = drupal_get_destination(); - $page['content']['system_main']['actions']['#links']['add_redirect'] = array( - 'title' => t('Add URL redirect from this page to another location'), - 'href' => 'admin/config/search/redirect/add', - 'query' => array('source' => $destination['destination']) + drupal_get_destination(), - ); - } -} - -/** - * Gets the redirect repository service. - * - * @return \Drupal\redirect\RedirectRepository - * The repository service. - */ -function redirect_repository() { - return \Drupal::service('redirect.repository'); -} - -/** - * Delete any redirects associated with a path or any of its sub-paths. - * - * Given a source like 'node/1' this function will delete any redirects that - * have that specific source or any sources that match 'node/1/%'. - * - * @param string $path - * An string with an internal Drupal path. - * @param string $langcode - * (optional) If specified, limits deletion to redirects for the given - * language. Defaults to all languages. - * @param bool $match_subpaths_and_redirect - * (optional) Whether redirects with a destination to the given path and - * sub-paths should also be deleted. - * - * @ingroup redirect_api - */ -function redirect_delete_by_path($path, $langcode = NULL, $match_subpaths_and_redirect = TRUE) { - $path = ltrim($path, '/'); - $database = \Drupal::database(); - $query = $database->select('redirect'); - $query->addField('redirect', 'rid'); - $query_or = db_or(); - $query_or->condition('redirect_source__path', $database->escapeLike($path), 'LIKE'); - if ($match_subpaths_and_redirect) { - $query_or->condition('redirect_source__path', $database->escapeLike($path . '/') . '%', 'LIKE'); - $query_or->condition('redirect_redirect__uri', $database->escapeLike($path), 'LIKE'); - $query_or->condition('redirect_redirect__uri', $database->escapeLike($path . '/') . '%', 'LIKE'); - } - - if ($langcode) { - $query->condition('language', $langcode); - } - - $query->condition($query_or); - $rids = $query->execute()->fetchCol(); - - if ($rids) { - foreach (redirect_repository()->loadMultiple($rids) as $redirect) { - $redirect->delete(); - } - } -} - -/** - * Sort an array recusively. - * - * @param $array - * The array to sort, by reference. - * @param $callback - * The sorting callback to use (e.g. 'sort', 'ksort', 'asort'). - * - * @return - * TRUE on success or FALSE on failure. - */ -function redirect_sort_recursive(&$array, $callback = 'sort') { - $result = $callback($array); - foreach ($array as $key => $value) { - if (is_array($value)) { - $result &= redirect_sort_recursive($array[$key], $callback); - } - } - return $result; -} - -/** - * Build the URL of a redirect for display purposes only. - */ -function redirect_url($path, array $options = array(), $clean_url = NULL) { - // @todo - deal with removal of clean_url config. See - // https://drupal.org/node/1659580 - if (!isset($clean_url)) { - //$clean_url = variable_get('clean_url', 0); - } - - if ($path == '') { - $path = ''; - } - - if (!isset($options['alter']) || !empty($options['alter'])) { - \Drupal::moduleHandler()->alter('redirect_url', $path, $options); - } - - // The base_url might be rewritten from the language rewrite in domain mode. - if (!isset($options['base_url'])) { - // @todo - is this correct? See https://drupal.org/node/1798832. - if (isset($options['https']) && Settings::get('mixed_mode_sessions', FALSE)) { - if ($options['https'] === TRUE) { - $options['base_url'] = $GLOBALS['base_secure_url']; - $options['absolute'] = TRUE; - } - elseif ($options['https'] === FALSE) { - $options['base_url'] = $GLOBALS['base_insecure_url']; - $options['absolute'] = TRUE; - } - } - else { - $options['base_url'] = $GLOBALS['base_url']; - } - } - - if (empty($options['absolute']) || url_is_external($path)) { - $url = $path; - } - else { - $url = $options['base_url'] . base_path() . $path; - } - - if (isset($options['query'])) { - $url .= $clean_url ? '?' : '&'; - $url .= UrlHelper::buildQuery($options['query']); - } - if (isset($options['fragment'])) { - $url .= '#' . $options['fragment']; - } - - return $url; -} - -function redirect_status_code_options($code = NULL) { - $codes = array( - 300 => t('300 Multiple Choices'), - 301 => t('301 Moved Permanently'), - 302 => t('302 Found'), - 303 => t('303 See Other'), - 304 => t('304 Not Modified'), - 305 => t('305 Use Proxy'), - 307 => t('307 Temporary Redirect'), - ); - return isset($codes[$code]) ? $codes[$code] : $codes; -} - -/** - * Returns if the current page request is a page not found (404 status error). - * - * Why the fuck do we have to do this? Why is there not an easier way??? - * - * @return - * TRUE if the current page is a 404, or FALSE otherwise. - */ -function redirect_is_current_page_404() { - return drupal_get_http_header('Status') == '404 Not Found'; -} - -/** - * uasort callback; Compare redirects based on language neutrality and rids. - */ -function _redirect_uasort($a, $b) { - $a_weight = isset($a->weight) ? $a->weight : 0; - $b_weight = isset($b->weight) ? $b->weight : 0; - if ($a_weight != $b_weight) { - // First sort by weight (case sensitivity). - return $a_weight > $b_weight; - } - elseif ($a->language != $b->language) { - // Then sort by language specific over language neutral. - return $a->language == Language::LANGCODE_NOT_SPECIFIED; - } - elseif (!empty($a->source_options['query']) != !empty($b->source_options['query'])) { - // Then sort by redirects that do not have query strings over ones that do. - return empty($a->source_options['query']); - } - else { - // Lastly sort by the highest redirect ID. - return $a->rid < $b->rid; - } -} - -/** - * Implements hook_form_FORM_ID_alter() on behalf of locale.module. - */ -function locale_form_redirect_edit_form_alter(array &$form, FormStateInterface $form_state) { - $form['language'] = array( - '#type' => 'select', - '#title' => t('Language'), - '#options' => array(Language::LANGCODE_NOT_SPECIFIED => t('All languages')) + \Drupal::languageManager()->getLanguages(), - '#default_value' => $form['language']['#value'], - '#description' => t('A redirect set for a specific language will always be used when requesting this page in that language, and takes precedence over redirects set for All languages.'), - ); -} - -/** - * Fetch an array of redirect bulk operations. - * - * @see hook_redirect_operations() - * @see hook_redirect_operations_alter() - */ -function redirect_get_redirect_operations() { - $operations = &drupal_static(__FUNCTION__); - - if (!isset($operations)) { - $operations = \Drupal::moduleHandler()->invokeAll('redirect_operations'); - \Drupal::moduleHandler()->alter('redirect_operations', $operations); - } - - return $operations; -} - -/** - * Implements hook_redirect_operations(). - */ -function redirect_redirect_operations() { - $operations['delete'] = array( - 'action' => t('Delete'), - 'action_past' => t('Deleted'), - 'callback' => 'redirect_delete_multiple', - 'confirm' => TRUE, - ); - return $operations; -} - -/** - * Ajax callback for the redirect link widget. - */ -function redirect_source_link_get_status_messages(array $form, FormStateInterface $form_state) { - return $form['redirect_source']['widget'][0]['status_box']; -} - -/** - * Implements hook_entity_extra_field_info(). - */ -function redirect_entity_extra_field_info() { - $extra = []; - - if (\Drupal::service('module_handler')->moduleExists('node')) { - $node_types = \Drupal::entityTypeManager() - ->getStorage('node_type') - ->loadMultiple(); - - foreach ($node_types as $node_type) { - $extra['node'][$node_type->id()]['form']['url_redirects'] = [ - 'label' => t('URL redirects'), - 'description' => t('Redirect module form elements'), - 'weight' => 50, - ]; - } - } - - return $extra; -} - -/** - * Implements hook_form_node_form_alter(). - */ -function redirect_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) { - /** @var \Drupal\node\NodeInterface $node */ - $node = $form_state->getFormObject()->getEntity(); - if (!$node->isNew() && \Drupal::currentUser()->hasPermission('administer redirects')) { - - $nid = $node->id(); - - // Find redirects to this node. - $redirects = \Drupal::service('redirect.repository') - ->findByDestinationUri(["internal:/node/$nid", "entity:node/$nid"]); - - // Assemble the rows for the table. - $rows = []; - /** @var \Drupal\Core\Entity\EntityListBuilder $list_builder */ - $list_builder = \Drupal::service('entity.manager')->getListBuilder('redirect'); - /** @var \Drupal\redirect\Entity\Redirect[] $redirects */ - foreach ($redirects as $redirect) { - $row = []; - $path = $redirect->getSourcePathWithQuery(); - $row['path'] = [ - 'class' => ['redirect-table__path'], - 'data' => ['#plain_text' => $path], - 'title' => $path, - ]; - $row['operations'] = [ - 'data' => [ - '#type' => 'operations', - '#links' => $list_builder->getOperations($redirect), - ], - ]; - $rows[] = $row; - } - - // Add the list to the vertical tabs section of the form. - $header = [ - ['class' => ['redirect-table__path'], 'data' => t('From')], - ['class' => ['redirect-table__operations'], 'data' => t('Operations')], - ]; - $form['url_redirects'] = [ - '#type' => 'details', - '#title' => t('URL redirects'), - '#group' => 'advanced', - '#open' => FALSE, - 'table' => [ - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => t('No URL redirects available.'), - '#attributes' => ['class' => ['redirect-table']], - ], - '#attached' => [ - 'library' => [ - 'redirect/drupal.redirect.admin', - ], - ], - ]; - - if (!empty($rows)) { - $form['url_redirects']['warning'] = [ - '#markup' => t('Note: links open in the current window.'), - '#prefix' => '

', - '#suffix' => '

', - ]; - } - } -} diff --git a/sites/all/modules/contrib/admin/redirect/redirect.permissions.yml b/sites/all/modules/contrib/admin/redirect/redirect.permissions.yml deleted file mode 100644 index 8596ee1ca..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -administer redirects: - title: 'Administer individual URL redirections' -administer redirect settings: - title: 'Administer global URL redirection settings' diff --git a/sites/all/modules/contrib/admin/redirect/redirect.routing.yml b/sites/all/modules/contrib/admin/redirect/redirect.routing.yml deleted file mode 100644 index 4195cbb59..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.routing.yml +++ /dev/null @@ -1,58 +0,0 @@ -redirect.list: - path: '/admin/config/search/redirect' - defaults: - _entity_list: 'redirect' - _title: 'URL redirects' - requirements: - _permission: 'administer redirects' - -entity.redirect.canonical: - path: '/admin/config/search/redirect/edit/{redirect}' - defaults: - _entity_form: 'redirect.edit' - _title: 'Edit URL redirect' - requirements: - _entity_access: 'redirect.update' - -redirect.add: - path: '/admin/config/search/redirect/add' - defaults: - _entity_form: 'redirect.default' - _title: 'Add URL redirect' - requirements: - _entity_create_access: 'redirect' - -entity.redirect.edit_form: - path: '/admin/config/search/redirect/edit/{redirect}' - defaults: - _entity_form: 'redirect.edit' - _title: 'Edit URL redirect' - requirements: - _entity_access: 'redirect.update' - -entity.redirect.delete_form: - path: '/admin/config/search/redirect/delete/{redirect}' - defaults: - _entity_form: 'redirect.delete' - _title: 'Delete URL redirect' - requirements: - _entity_access: 'redirect.delete' - -entity.redirect.multiple_delete_confirm: - path: '/admin/config/search/redirect/delete' - defaults: - _form: '\Drupal\redirect\Form\RedirectDeleteMultipleForm' - requirements: - _permission: 'administer redirects' - -redirect.settings: - path: '/admin/config/search/redirect/settings' - defaults: - _form: '\Drupal\redirect\Form\RedirectSettingsForm' - _title: 'Settings' - requirements: - _permission: 'administer redirect settings' - -#redirect.devel_generate: -# requirements: -# _module_dependencies: 'devel' diff --git a/sites/all/modules/contrib/admin/redirect/redirect.services.yml b/sites/all/modules/contrib/admin/redirect/redirect.services.yml deleted file mode 100644 index 743bd9392..000000000 --- a/sites/all/modules/contrib/admin/redirect/redirect.services.yml +++ /dev/null @@ -1,30 +0,0 @@ -parameters: - route_normalizer_enabled: true -services: - redirect.repository: - class: Drupal\redirect\RedirectRepository - arguments: ['@entity.manager', '@database', '@config.factory'] - tags: - - { name: backend_overridable } - redirect.checker: - class: Drupal\redirect\RedirectChecker - arguments: ['@config.factory', '@state', '@access_manager', '@current_user', '@router.route_provider'] - redirect.request_subscriber: - class: Drupal\redirect\EventSubscriber\RedirectRequestSubscriber - arguments: ['@redirect.repository', '@language_manager', '@config.factory', '@path.alias_manager', '@module_handler', '@entity.manager', '@redirect.checker', '@router.request_context', '@path_processor_manager'] - tags: - - { name: event_subscriber } - redirect.settings_cache_tag: - class: Drupal\redirect\EventSubscriber\RedirectSettingsCacheTag - arguments: ['@cache_tags.invalidator'] - tags: - - { name: event_subscriber } - redirect.route_normalizer_request_subscriber: - class: Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber - arguments: ['@url_generator', '@path.matcher', '@config.factory', '@redirect.checker'] - tags: - - { name: event_subscriber } - redirect.route_subscriber: - class: Drupal\redirect\Routing\RouteSubscriber - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php b/sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php deleted file mode 100644 index cb5d4c56d..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php +++ /dev/null @@ -1,347 +0,0 @@ - mb_strtolower($source_path), - 'language' => $language, - ); - - if (!empty($source_query)) { - $hash['source_query'] = $source_query; - } - redirect_sort_recursive($hash, 'ksort'); - return Crypt::hashBase64(serialize($hash)); - } - - /** - * {@inheritdoc} - */ - public static function preCreate(EntityStorageInterface $storage_controller, array &$values) { - $values += array( - 'type' => 'redirect', - ); - } - - /** - * {@inheritdoc} - */ - public function preSave(EntityStorageInterface $storage_controller) { - // Get the language code directly from the field as language() might not - // be up to date if the language was just changed. - $this->set('hash', Redirect::generateHash($this->redirect_source->path, (array) $this->redirect_source->query, $this->get('language')->value)); - } - - /** - * Sets the redirect language. - * - * @param string $language - * Language code. - */ - public function setLanguage($language) { - $this->set('language', $language); - } - - /** - * Sets the redirect status code. - * - * @param int $status_code - * The redirect status code. - */ - public function setStatusCode($status_code) { - $this->set('status_code', $status_code); - } - - /** - * Gets the redirect status code. - * - * @return int - * The redirect status code. - */ - public function getStatusCode() { - return $this->get('status_code')->value; - } - - /** - * Sets the redirect created datetime. - * - * @param int $datetime - * The redirect created datetime. - */ - public function setCreated($datetime) { - $this->set('created', $datetime); - } - - /** - * Gets the redirect created datetime. - * - * @return int - * The redirect created datetime. - */ - public function getCreated() { - return $this->get('created')->value; - } - - /** - * Sets the source URL data. - * - * @param string $path - * The base url of the source. - * @param array $query - * Query arguments. - */ - public function setSource($path, array $query = array()) { - $this->redirect_source->set(0, ['path' => ltrim($path, '/'), 'query' => $query]); - } - - /** - * Gets the source URL data. - * - * @return array - */ - public function getSource() { - return $this->get('redirect_source')->get(0)->getValue(); - } - - /** - * Gets the source base URL. - * - * @return string - */ - public function getSourceUrl() { - return $this->get('redirect_source')->get(0)->getUrl()->toString(); - } - - /** - * Gets the source URL path with its query. - * - * @return string - * The source URL path, eventually with its query. - */ - public function getSourcePathWithQuery() { - $path = '/' . $this->get('redirect_source')->path; - if ($this->get('redirect_source')->query) { - $path .= '?' . UrlHelper::buildQuery($this->get('redirect_source')->query); - } - return $path; - } - - /** - * Gets the redirect URL data. - * - * @return array - * The redirect URL data. - */ - public function getRedirect() { - return $this->get('redirect_redirect')->get(0)->getValue(); - } - - /** - * Sets the redirect destination URL data. - * - * @param string $url - * The base url of the redirect destination. - * @param array $query - * Query arguments. - * @param array $options - * The source url options. - */ - public function setRedirect($url, array $query = array(), array $options = array()) { - $uri = $url . ($query ? '?' . UrlHelper::buildQuery($query) : ''); - $external = UrlHelper::isValid($url, TRUE); - $uri = ($external ? $url : 'internal:/' . ltrim($uri, '/')); - $this->redirect_redirect->set(0, ['uri' => $uri, 'options' => $options]); - } - - /** - * Gets the redirect URL. - * - * @return \Drupal\Core\Url - * The redirect URL. - */ - public function getRedirectUrl() { - return $this->get('redirect_redirect')->get(0)->getUrl(); - } - - /** - * Gets the redirect URL options. - * - * @return array - * The redirect URL options. - */ - public function getRedirectOptions() { - return $this->get('redirect_redirect')->options; - } - - /** - * Gets a specific redirect URL option. - * - * @param string $key - * Option key. - * @param mixed $default - * Default value used in case option does not exist. - * - * @return mixed - * The option value. - */ - public function getRedirectOption($key, $default = NULL) { - $options = $this->getRedirectOptions(); - return isset($options[$key]) ? $options[$key] : $default; - } - - /** - * Gets the current redirect entity hash. - * - * @return string - * The hash. - */ - public function getHash() { - return $this->get('hash')->value; - } - - /** - * {@inheritdoc} - */ - public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { - $fields['rid'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Redirect ID')) - ->setDescription(t('The redirect ID.')) - ->setReadOnly(TRUE); - - $fields['uuid'] = BaseFieldDefinition::create('uuid') - ->setLabel(t('UUID')) - ->setDescription(t('The record UUID.')) - ->setReadOnly(TRUE); - - $fields['hash'] = BaseFieldDefinition::create('string') - ->setLabel(t('Hash')) - ->setSetting('max_length', 64) - ->setDescription(t('The redirect hash.')); - - $fields['type'] = BaseFieldDefinition::create('string') - ->setLabel(t('Type')) - ->setDescription(t('The redirect type.')); - - $fields['uid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('User ID')) - ->setDescription(t('The user ID of the node author.')) - ->setDefaultValueCallback('\Drupal\redirect\Entity\Redirect::getCurrentUserId') - ->setSettings(array( - 'target_type' => 'user', - )); - - $fields['redirect_source'] = BaseFieldDefinition::create('redirect_source') - ->setLabel(t('From')) - ->setDescription(t("Enter an internal Drupal path or path alias to redirect (e.g. %example1 or %example2). Fragment anchors (e.g. %anchor) are not allowed.", array('%example1' => 'node/123', '%example2' => 'taxonomy/term/123', '%anchor' => '#anchor'))) - ->setRequired(TRUE) - ->setTranslatable(FALSE) - ->setDisplayOptions('form', array( - 'type' => 'redirect_link', - 'weight' => -5, - )) - ->setDisplayConfigurable('form', TRUE); - - $fields['redirect_redirect'] = BaseFieldDefinition::create('link') - ->setLabel(t('To')) - ->setRequired(TRUE) - ->setTranslatable(FALSE) - ->setSettings(array( - 'link_type' => LinkItemInterface::LINK_GENERIC, - 'title' => DRUPAL_DISABLED - )) - ->setDisplayOptions('form', array( - 'type' => 'link', - 'weight' => -4, - )) - ->setDisplayConfigurable('form', TRUE); - - $fields['language'] = BaseFieldDefinition::create('language') - ->setLabel(t('Language')) - ->setDescription(t('The redirect language.')) - ->setDisplayOptions('form', array( - 'type' => 'language_select', - 'weight' => 2, - )); - - $fields['status_code'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Status code')) - ->setDescription(t('The redirect status code.')) - ->setDefaultValue(0); - - $fields['created'] = BaseFieldDefinition::create('created') - ->setLabel(t('Created')) - ->setDescription(t('The date when the redirect was created.')); - return $fields; - } - - /** - * Default value callback for 'uid' base field definition. - * - * @see ::baseFieldDefinitions() - * - * @return array - * An array of default values. - */ - public static function getCurrentUserId() { - return array(\Drupal::currentUser()->id()); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php b/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php deleted file mode 100644 index 87095deff..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php +++ /dev/null @@ -1,211 +0,0 @@ -redirectRepository = $redirect_repository; - $this->languageManager = $language_manager; - $this->config = $config->get('redirect.settings'); - $this->aliasManager = $alias_manager; - $this->moduleHandler = $module_handler; - $this->entityManager = $entity_manager; - $this->checker = $checker; - $this->context = $context; - $this->pathProcessor = $path_processor; - } - - /** - * Handles the redirect if any found. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The event to process. - */ - public function onKernelRequestCheckRedirect(GetResponseEvent $event) { - // Get a clone of the request. During inbound processing the request - // can be altered. Allowing this here can lead to unexpected behavior. - // For example the path_processor.files inbound processor provided by - // the system module alters both the path and the request; only the - // changes to the request will be propagated, while the change to the - // path will be lost. - $request = clone $event->getRequest(); - - if (!$this->checker->canRedirect($request)) { - return; - } - - // Get URL info and process it to be used for hash generation. - parse_str($request->getQueryString(), $request_query); - - if (strpos($request->getPathInfo(), '/system/files/') === 0 && !$request->query->has('file')) { - // Private files paths are split by the inbound path processor and the - // relative file path is moved to the 'file' query string parameter. This - // is because the route system does not allow an arbitrary amount of - // parameters. We preserve the path as is returned by the request object. - // @see \Drupal\system\PathProcessor\PathProcessorFiles::processInbound() - $path = $request->getPathInfo(); - } - else { - // Do the inbound processing so that for example language prefixes are - // removed. - $path = $this->pathProcessor->processInbound($request->getPathInfo(), $request); - } - $path = trim($path, '/'); - - $this->context->fromRequest($request); - - try { - $redirect = $this->redirectRepository->findMatchingRedirect($path, $request_query, $this->languageManager->getCurrentLanguage()->getId()); - } - catch (RedirectLoopException $e) { - \Drupal::logger('redirect')->warning($e->getMessage()); - $response = new Response(); - $response->setStatusCode(503); - $response->setContent('Service unavailable'); - $event->setResponse($response); - return; - } - - if (!empty($redirect)) { - - // Handle internal path. - $url = $redirect->getRedirectUrl(); - if ($this->config->get('passthrough_querystring')) { - $url->setOption('query', (array) $url->getOption('query') + $request_query); - } - $headers = [ - 'X-Redirect-ID' => $redirect->id(), - ]; - $response = new TrustedRedirectResponse($url->setAbsolute()->toString(), $redirect->getStatusCode(), $headers); - $response->addCacheableDependency($redirect); - $event->setResponse($response); - } - } - - /** - * Prior to set the response it check if we can redirect. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The event object. - * @param \Drupal\Core\Url $url - * The Url where we want to redirect. - */ - protected function setResponse(GetResponseEvent $event, Url $url) { - $request = $event->getRequest(); - $this->context->fromRequest($request); - - parse_str($request->getQueryString(), $query); - $url->setOption('query', $query); - $url->setAbsolute(TRUE); - - // We can only check access for routed URLs. - if (!$url->isRouted() || $this->checker->canRedirect($request, $url->getRouteName())) { - // Add the 'rendered' cache tag, so that we can invalidate all responses - // when settings are changed. - $response = new TrustedRedirectResponse($url->toString(), 301); - $response->addCacheableDependency(CacheableMetadata::createFromRenderArray([])->addCacheTags(['rendered'])); - $event->setResponse($response); - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - // This needs to run before RouterListener::onKernelRequest(), which has - // a priority of 32. Otherwise, that aborts the request if no matching - // route is found. - $events[KernelEvents::REQUEST][] = array('onKernelRequestCheckRedirect', 33); - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php b/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php deleted file mode 100644 index 7dfb063b3..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php +++ /dev/null @@ -1,54 +0,0 @@ -cacheTagsInvalidator = $cache_tags_invalidator; - } - - /** - * Invalidate the 'rendered' cache tag whenever the settings are modified. - * - * @param \Drupal\Core\Config\ConfigCrudEvent $event - * The Event to process. - */ - public function onSave(ConfigCrudEvent $event) { - // Changing the Redirect settings means that any cached page might - // result in a different response, so we need to invalidate them all. - if ($event->getConfig()->getName() === 'redirect.settings') { - $this->cacheTagsInvalidator->invalidateTags(['rendered']); - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events[ConfigEvents::SAVE][] = ['onSave']; - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php b/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php deleted file mode 100644 index 800e022a5..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php +++ /dev/null @@ -1,143 +0,0 @@ -urlGenerator = $url_generator; - $this->pathMatcher = $path_matcher; - $this->redirectChecker = $redirect_checker; - $this->config = $config->get('redirect.settings'); - } - - /** - * Performs a redirect if the URL changes in routing. - * - * The redirect happens if a URL constructed from the current route is - * different from the requested one. Examples: - * - Language negotiation system detected a language to use, and that language - * has a path prefix: perform a redirect to the language prefixed URL. - * - A route that's set as the front page is requested: redirect to the front - * page. - * - Requested path has an alias: redirect to alias. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The Event to process. - */ - public function onKernelRequestRedirect(GetResponseEvent $event) { - - if (!$this->config->get('route_normalizer_enabled') || !$event->isMasterRequest()) { - return; - } - - $request = $event->getRequest(); - if ($request->attributes->get('_disable_route_normalizer')) { - return; - } - - if ($this->redirectChecker->canRedirect($request)) { - // The "" placeholder can be used for all routes except the front - // page because it's not a real route. - $route_name = $this->pathMatcher->isFrontPage() ? '' : ''; - - // Don't pass in the query here using $request->query->all() - // since that can potentially modify the query parameters. - $options = ['absolute' => TRUE]; - $redirect_uri = $this->urlGenerator->generateFromRoute($route_name, [], $options); - - // Strip off query parameters added by the route such as a CSRF token. - if (strpos($redirect_uri, '?') !== FALSE) { - $redirect_uri = strtok($redirect_uri, '?'); - } - - // Append back the request query string from $_SERVER. - $query_string = $request->server->get('QUERY_STRING'); - if ($query_string) { - $redirect_uri .= '?' . $query_string; - } - - // Remove /index.php from redirect uri the hard way. - if (!RequestHelper::isCleanUrl($request)) { - // This needs to be fixed differently. - $redirect_uri = str_replace('/index.php', '', $redirect_uri); - } - - $original_uri = $request->getSchemeAndHttpHost() . $request->getRequestUri(); - $original_uri = urldecode($original_uri); - $redirect_uri = urldecode($redirect_uri); - if ($redirect_uri != $original_uri) { - $response = new TrustedRedirectResponse($redirect_uri, $this->config->get('default_status_code')); - $response->headers->set('X-Drupal-Route-Normalizer', 1); - $event->setResponse($response); - } - } - } - - /** - * {@inheritdoc} - */ - static function getSubscribedEvents() { - $events[KernelEvents::REQUEST][] = array('onKernelRequestRedirect', 30); - return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php b/sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php deleted file mode 100644 index f2793f3e8..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php +++ /dev/null @@ -1,24 +0,0 @@ - $path, '%rid' => $rid])); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php deleted file mode 100644 index eeee993d9..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php +++ /dev/null @@ -1,41 +0,0 @@ -t('Are you sure you want to delete the URL redirect from %source to %redirect?', array('%source' => $this->entity->getSourceUrl(), '%redirect' => $this->entity->getRedirectUrl()->toString())); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('redirect.list'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - drupal_set_message($this->t('The redirect %redirect has been deleted.', array('%redirect' => $this->entity->getRedirectUrl()->toString()))); - $form_state->setRedirect('redirect.list'); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php deleted file mode 100644 index 79c79467c..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php +++ /dev/null @@ -1,140 +0,0 @@ -privateTempStoreFactory = $temp_store_factory; - $this->redirectStorage = $entity_type_manager->getStorage('redirect'); - $this->currentUser = $account; - $this->setStringTranslation($string_translation); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('user.private_tempstore'), - $container->get('entity_type.manager'), - $container->get('current_user'), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'redirect_multiple_delete_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->formatPlural(count($this->redirects), 'Are you sure you want to delete this redirect?', 'Are you sure you want to delete these redirects?'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('redirect.list'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $this->redirects = $this->privateTempStoreFactory->get('redirect_multiple_delete_confirm')->get($this->currentUser->id()); - if (empty($this->redirects)) { - return new RedirectResponse($this->getCancelUrl()->setAbsolute()->toString()); - } - - $form['redirects'] = [ - '#theme' => 'item_list', - '#items' => array_map(function ($redirect) { - return $redirect->label(); - }, $this->redirects), - ]; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - if ($form_state->getValue('confirm') && !empty($this->redirects)) { - $this->redirectStorage->delete($this->redirects); - $this->privateTempStoreFactory->get('redirect_multiple_delete_confirm')->delete($this->currentUser->id()); - $count = count($this->redirects); - $this->logger('redirect')->notice('Deleted @count redirects.', ['@count' => $count]); - drupal_set_message($this->stringTranslation->formatPlural($count, 'Deleted 1 redirect.', 'Deleted @count redirects.')); - } - $form_state->setRedirect('redirect.list'); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php deleted file mode 100644 index 702e99158..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php +++ /dev/null @@ -1,152 +0,0 @@ -entity; - - if ($redirect->isNew()) { - - // To pass in the query set parameters into GET as follows: - // source_query[key1]=value1&source_query[key2]=value2 - $source_query = array(); - if ($this->getRequest()->get('source_query')) { - $source_query = $this->getRequest()->get('source_query'); - } - - $redirect_options = array(); - $redirect_query = array(); - if ($this->getRequest()->get('redirect_options')) { - $redirect_options = $this->getRequest()->get('redirect_options'); - if (isset($redirect_options['query'])) { - $redirect_query = $redirect_options['query']; - unset($redirect_options['query']); - } - } - - $source_url = urldecode($this->getRequest()->get('source')); - if (!empty($source_url)) { - $redirect->setSource($source_url, $source_query); - } - - $redirect_url = urldecode($this->getRequest()->get('redirect')); - if (!empty($redirect_url)) { - try { - $redirect->setRedirect($redirect_url, $redirect_query, $redirect_options); - } - catch (MatchingRouteNotFoundException $e) { - drupal_set_message($this->t('Invalid redirect URL %url provided.', array('%url' => $redirect_url)), 'warning'); - } - } - - $redirect->setLanguage($this->getRequest()->get('language') ? $this->getRequest()->get('language') : Language::LANGCODE_NOT_SPECIFIED); - } - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - /** @var \Drupal\redirect\Entity\Redirect $redirect */ - $redirect = $this->entity; - - // Only add the configured languages and a single key for all languages. - if (isset($form['language']['widget'][0]['value'])) { - foreach (\Drupal::languageManager()->getLanguages(LanguageInterface::STATE_CONFIGURABLE) as $langcode => $language) { - $form['language']['widget'][0]['value']['#options'][$langcode] = $language->getName(); - } - $form['language']['widget'][0]['value']['#options'][LanguageInterface::LANGCODE_NOT_SPECIFIED] = $this->t('- All languages -'); - } - - $default_code = $redirect->getStatusCode() ? $redirect->getStatusCode() : \Drupal::config('redirect.settings')->get('default_status_code'); - - $form['status_code'] = array( - '#type' => 'select', - '#title' => $this->t('Redirect status'), - '#description' => $this->t('You can find more information about HTTP redirect status codes at @status-codes.', array('@status-codes' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection')), - '#default_value' => $default_code, - '#options' => redirect_status_code_options(), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - $source = $form_state->getValue(array('redirect_source', 0)); - $redirect = $form_state->getValue(array('redirect_redirect', 0)); - - if ($source['path'] == '') { - $form_state->setErrorByName('redirect_source', $this->t('It is not allowed to create a redirect from the front page.')); - } - if (strpos($source['path'], '#') !== FALSE) { - $form_state->setErrorByName('redirect_source', $this->t('The anchor fragments are not allowed.')); - } - if (strpos($source['path'], '/') === 0) { - $form_state->setErrorByName('redirect_source', $this->t('The url to redirect from should not start with a forward slash (/).')); - } - - try { - $source_url = Url::fromUri('internal:/' . $source['path']); - $redirect_url = Url::fromUri($redirect['uri']); - - // It is relevant to do this comparison only in case the source path has - // a valid route. Otherwise the validation will fail on the redirect path - // being an invalid route. - if ($source_url->toString() == $redirect_url->toString()) { - $form_state->setErrorByName('redirect_redirect', $this->t('You are attempting to redirect the page to itself. This will result in an infinite loop.')); - } - } - catch (\InvalidArgumentException $e) { - // Do nothing, we want to only compare the resulting URLs. - } - - $parsed_url = UrlHelper::parse(trim($source['path'])); - $path = isset($parsed_url['path']) ? $parsed_url['path'] : NULL; - $query = isset($parsed_url['query']) ? $parsed_url['query'] : NULL; - $hash = Redirect::generateHash($path, $query, $form_state->getValue('language')[0]['value']); - - // Search for duplicate. - $redirects = \Drupal::entityManager() - ->getStorage('redirect') - ->loadByProperties(array('hash' => $hash)); - - if (!empty($redirects)) { - $redirect = array_shift($redirects); - if ($this->entity->isNew() || $redirect->id() != $this->entity->id()) { - $form_state->setErrorByName('redirect_source', $this->t('The source path %source is already being redirected. Do you want to edit the existing redirect?', - array( - '%source' => $source['path'], - '@edit-page' => $redirect->url('edit-form')))); - } - } - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $this->entity->save(); - drupal_set_message($this->t('The redirect has been saved.')); - $form_state->setRedirect('redirect.list'); - } -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php deleted file mode 100644 index 029973dcc..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php +++ /dev/null @@ -1,93 +0,0 @@ -config('redirect.settings'); - $form['redirect_auto_redirect'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Automatically create redirects when URL aliases are changed.'), - '#default_value' => $config->get('auto_redirect'), - '#disabled' => !\Drupal::moduleHandler()->moduleExists('path'), - ); - $form['redirect_passthrough_querystring'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Retain query string through redirect.'), - '#default_value' => $config->get('passthrough_querystring'), - '#description' => $this->t('For example, given a redirect from %source to %redirect, if a user visits %sourcequery they would be redirected to %redirectquery. The query strings in the redirection will always take precedence over the current query string.', array('%source' => 'source-path', '%redirect' => 'node?a=apples', '%sourcequery' => 'source-path?a=alligators&b=bananas', '%redirectquery' => 'node?a=apples&b=bananas')), - ); - $form['redirect_warning'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Display a warning message to users when they are redirected.'), - '#default_value' => $config->get('warning'), - '#access' => FALSE, - ); - $form['redirect_default_status_code'] = array( - '#type' => 'select', - '#title' => $this->t('Default redirect status'), - '#description' => $this->t('You can find more information about HTTP redirect status codes at @status-codes.', array('@status-codes' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection')), - '#options' => redirect_status_code_options(), - '#default_value' => $config->get('default_status_code'), - ); - $form['globals'] = array( - '#type' => 'fieldset', - '#title' => $this->t('Global redirects'), - '#description' => $this->t('(formerly Global Redirect features)'), - ); - $form['globals']['redirect_route_normalizer_enabled'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Enforce clean and canonical URLs.'), - '#description' => $this->t('Enabling this will automatically redirect to the canonical URL of any page. That includes redirecting to an alias if existing, removing trailing slashes, ensure the language prefix is set and similar clean-up.'), - '#default_value' => $config->get('route_normalizer_enabled'), - ); - $form['globals']['redirect_ignore_admin_path'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Ignore redirections on admin paths.'), - '#default_value' => $config->get('ignore_admin_path'), - ); - $form['globals']['redirect_access_check'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Check access to the redirected page'), - '#description' => $this->t('This helps to stop redirection on protected pages and avoids giving away secret URL\'s. By default this feature is disabled to avoid any unexpected behavior'), - '#default_value' => $config->get('access_check'), - ); - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('redirect.settings'); - foreach ($form_state->getValues() as $key => $value) { - if (strpos($key, 'redirect_') !== FALSE) { - $config->set(str_replace('redirect_', '', $key), $value); - } - } - $config->save(); - drupal_set_message($this->t('Configuration was saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php deleted file mode 100644 index 8b7f57972..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php +++ /dev/null @@ -1,92 +0,0 @@ -currentUser = $current_user; - $this->privateTempStore = $temp_store_factory->get('redirect_multiple_delete_confirm'); - - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('user.private_tempstore'), - $container->get('current_user') - ); - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $entities) { - $this->privateTempStore->set($this->currentUser->id(), $entities); - } - - /** - * {@inheritdoc} - */ - public function execute($object = NULL) { - $this->executeMultiple([$object]); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - return $object->access('delete', $account, $return_as_object); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php deleted file mode 100644 index 7ef400de2..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php +++ /dev/null @@ -1,36 +0,0 @@ - $item) { - $elements[$delta] = array( - '#markup' => urldecode($item->getUrl()->toString()), - ); - } - - return $elements; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php deleted file mode 100644 index 53a0efc66..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php +++ /dev/null @@ -1,112 +0,0 @@ -setLabel(t('Path')); - - $properties['query'] = MapDataDefinition::create() - ->setLabel(t('Query')); - - return $properties; - } - - /** - * {@inheritdoc} - */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { - return array( - 'columns' => array( - 'path' => array( - 'description' => 'The source path', - 'type' => 'varchar', - 'length' => 2048, - ), - 'query' => array( - 'description' => 'Serialized array of path queries', - 'type' => 'blob', - 'size' => 'big', - 'serialize' => TRUE, - ), - ), - 'indexes' => array( - 'path' => array(array('path', 50)), - ), - ); - } - - /** - * {@inheritdoc} - */ - public static function generateSampleValue(FieldDefinitionInterface $field_definition) { - // Set random length for the path. - $domain_length = mt_rand(7, 15); - $random = new Random(); - - $values['path'] = 'http://www.' . $random->word($domain_length); - - return $values; - } - - /** - * {@inheritdoc} - */ - public function isEmpty() { - return $this->path === NULL || $this->path === ''; - } - - /** - * {@inheritdoc} - */ - public static function mainPropertyName() { - return 'path'; - } - - /** - * {@inheritdoc} - */ - public function setValue($values, $notify = TRUE) { - // Unserialize the values. - // @todo The storage controller should take care of this, see - // SqlContentEntityStorage::loadFieldItems, see - // https://www.drupal.org/node/2414835 - if (isset($values['query']) && is_string($values['query'])) { - $values['query'] = unserialize($values['query']); - } - parent::setValue($values, $notify); - } - - /** - * {@inheritdoc} - */ - public function getUrl() { - return Url::fromUri('base:' . $this->path, ['query' => $this->query]); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php deleted file mode 100644 index 0a4341116..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php +++ /dev/null @@ -1,117 +0,0 @@ -path; - if ($items[$delta]->query) { - $default_url_value .= '?' . http_build_query($items[$delta]->query); - } - $element['path'] = array( - '#type' => 'textfield', - '#title' => $this->t('Path'), - '#placeholder' => $this->getSetting('placeholder_url'), - '#default_value' => $default_url_value, - '#maxlength' => 2048, - '#required' => $element['#required'], - '#field_prefix' => Url::fromRoute('', array(), array('absolute' => TRUE))->toString(), - '#attributes' => array('data-disable-refocus' => 'true'), - ); - - // If creating new URL add checks. - if ($items->getEntity()->isNew()) { - $element['status_box'] = array( - '#prefix' => '', - ); - - $source_path = $form_state->getValue(array('redirect_source', 0, 'path')); - if ($source_path) { - $source_path = trim($source_path); - - // Warning about creating a redirect from a valid path. - // @todo - Hmm... exception driven logic. Find a better way how to - // determine if we have a valid path. - try { - \Drupal::service('router')->match('/' . $form_state->getValue(array('redirect_source', 0, 'path'))); - $element['status_box'][]['#markup'] = '
' . $this->t('The source path %path is likely a valid path. It is preferred to create URL aliases for existing paths rather than redirects.', - array('%path' => $source_path, '@url-alias' => Url::fromRoute('path.admin_add')->toString())) . '
'; - } - catch (ResourceNotFoundException $e) { - // Do nothing, expected behaviour. - } - - // Warning about the path being already redirected. - $parsed_url = UrlHelper::parse($source_path); - $path = isset($parsed_url['path']) ? $parsed_url['path'] : NULL; - if (!empty($path)) { - /** @var \Drupal\redirect\RedirectRepository $repository */ - $repository = \Drupal::service('redirect.repository'); - $redirects = $repository->findBySourcePath($path); - if (!empty($redirects)) { - $redirect = array_shift($redirects); - $element['status_box'][]['#markup'] = '
' . $this->t('The base source path %source is already being redirected. Do you want to edit the existing redirect?', array('%source' => $source_path, '@edit-page' => $redirect->url('edit-form'))) . '
'; - } - } - } - - $element['path']['#ajax'] = array( - 'callback' => 'redirect_source_link_get_status_messages', - 'wrapper' => 'redirect-link-status', - ); - } - - return $element; - } - - /** - * {@inheritdoc} - */ - public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { - $values = parent::massageFormValues($values, $form, $form_state); - // It is likely that the url provided for this field is not existing and - // so the logic in the parent method did not set any defaults. Just run - // through all url values and add defaults. - foreach ($values as &$value) { - if (!empty($value['path'])) { - // In case we have query process the url. - if (strpos($value['path'], '?') !== FALSE) { - $url = UrlHelper::parse($value['path']); - $value['path'] = $url['path']; - $value['query'] = $url['query']; - } - } - } - return $values; - } -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php deleted file mode 100644 index 5d354a07d..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php +++ /dev/null @@ -1,92 +0,0 @@ -context = $context; - } - - /** - * {@inheritdoc} - */ - public function validatedBy() { - return get_class($this); - } - - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) { - if (isset($value)) { - $url_is_valid = TRUE; - /** @var $link_item \Drupal\link\LinkItemInterface */ - $link_item = $value; - $link_type = $link_item->getFieldDefinition()->getSetting('link_type'); - $url_string = $link_item->url; - // Validate the url property. - if ($url_string !== '') { - try { - // @todo This shouldn't be needed, but massageFormValues() may not - // run. - $parsed_url = UrlHelper::parse($url_string); - - if (!empty($parsed_url['path'])) { - $url = Url::fromUri('internal:' . $parsed_url['path']); - - if ($url->isExternal() && !UrlHelper::isValid($url_string, TRUE)) { - $url_is_valid = FALSE; - } - elseif ($url->isExternal() && !($link_type & LinkItemInterface::LINK_EXTERNAL)) { - $url_is_valid = FALSE; - } - } - } - catch (NotFoundHttpException $e) { - $url_is_valid = FALSE; - } - catch (ResourceNotFoundException $e) { - // User is creating a redirect from non existing path. This is not an - // error state. - $url_is_valid = TRUE; - } - catch (ParamNotConvertedException $e) { - $url_is_valid = FALSE; - } - } - if (!$url_is_valid) { - $this->context->addViolation($this->message, array('%url' => $url_string)); - } - } - } -} - diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php deleted file mode 100644 index ecff15446..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php +++ /dev/null @@ -1,42 +0,0 @@ -select('path_redirect', 'p') - ->fields('p', array( - 'rid', - 'source', - 'redirect', - 'query', - 'fragment', - 'language', - 'type', - 'last_used', - )); - - return $query; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = array( - 'rid' => $this->t('Redirect ID'), - 'source' => $this->t('Source'), - 'redirect' => $this->t('Redirect'), - 'query' => $this->t('Query'), - 'fragment' => $this->t('Fragment'), - 'language' => $this->t('Language'), - 'type' => $this->t('Type'), - 'last_used' => $this->t('Last Used'), - ); - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - $ids['rid']['type'] = 'integer'; - return $ids; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php deleted file mode 100644 index c9ec720d6..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php +++ /dev/null @@ -1,81 +0,0 @@ -select('redirect', 'p')->fields('p'); - - return $query; - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - static $default_status_code; - if (!isset($default_status_code)) { - $default_status_code = unserialize($this->getDatabase() - ->select('variable', 'v') - ->fields('v', ['value']) - ->condition('name', 'redirect_default_status_code') - ->execute() - ->fetchField()); - } - $current_status_code = $row->getSourceProperty('status_code'); - $status_code = $current_status_code != 0 ? $current_status_code : $default_status_code; - $row->setSourceProperty('status_code', $status_code); - return parent::prepareRow($row); - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'rid' => $this->t('Redirect ID'), - 'hash' => $this->t('Hash'), - 'type' => $this->t('Type'), - 'uid' => $this->t('UID'), - 'source' => $this->t('Source'), - 'source_options' => $this->t('Source Options'), - 'redirect' => $this->t('Redirect'), - 'redirect_options' => $this->t('Redirect Options'), - 'language' => $this->t('Language'), - 'status_code' => $this->t('Status Code'), - 'count' => $this->t('Count'), - 'access' => $this->t('Access'), - ]; - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - $ids['rid']['type'] = 'integer'; - return $ids; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php b/sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php deleted file mode 100644 index 02da7ad2e..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php +++ /dev/null @@ -1,98 +0,0 @@ -config = $config->get('redirect.settings'); - $this->accessManager = $access_manager; - $this->state = $state; - $this->account = $account; - $this->routeProvider = $route_provider; - } - - /** - * Determines if redirect may be performed. - * - * @param Request $request - * The current request object. - * @param string $route_name - * The current route name. - * - * @return bool - * TRUE if redirect may be performed. - */ - public function canRedirect(Request $request, $route_name = NULL) { - $can_redirect = TRUE; - if (isset($route_name)) { - $route = $this->routeProvider->getRouteByName($route_name); - if ($this->config->get('access_check')) { - // Do not redirect if is a protected page. - $can_redirect = $this->accessManager->checkNamedRoute($route_name, [], $this->account); - } - } - else { - $route = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT); - } - - if (!preg_match('/index\.php$/', $request->getScriptName())) { - // Do not redirect if the root script is not /index.php. - $can_redirect = FALSE; - } - elseif (!($request->isMethod('GET') || $request->isMethod('HEAD'))) { - // Do not redirect if this is other than GET request. - $can_redirect = FALSE; - } - elseif ($this->state->get('system.maintenance_mode') || defined('MAINTENANCE_MODE')) { - // Do not redirect in offline or maintenance mode. - $can_redirect = FALSE; - } - elseif ($request->query->has('destination')) { - $can_redirect = FALSE; - } - elseif ($this->config->get('ignore_admin_path') && isset($route)) { - // Do not redirect on admin paths. - $can_redirect &= !(bool) $route->getOption('_admin_route'); - } - - return $can_redirect; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php b/sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php deleted file mode 100644 index 236c927f6..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php +++ /dev/null @@ -1,180 +0,0 @@ -manager = $manager; - $this->connection = $connection; - $this->config = $config_factory->get('redirect.settings'); - } - - /** - * Gets a redirect for given path, query and language. - * - * @param string $source_path - * The redirect source path. - * @param array $query - * The redirect source path query. - * @param $language - * The language for which is the redirect. - * - * @return \Drupal\redirect\Entity\Redirect - * The matched redirect entity. - * - * @throws \Drupal\redirect\Exception\RedirectLoopException - */ - public function findMatchingRedirect($source_path, array $query = [], $language = Language::LANGCODE_NOT_SPECIFIED) { - $source_path = ltrim($source_path, '/'); - $hashes = [Redirect::generateHash($source_path, $query, $language)]; - if ($language != Language::LANGCODE_NOT_SPECIFIED) { - $hashes[] = Redirect::generateHash($source_path, $query, Language::LANGCODE_NOT_SPECIFIED); - } - - // Add a hash without the query string if using passthrough querystrings. - if (!empty($query) && $this->config->get('passthrough_querystring')) { - $hashes[] = Redirect::generateHash($source_path, [], $language); - if ($language != Language::LANGCODE_NOT_SPECIFIED) { - $hashes[] = Redirect::generateHash($source_path, [], Language::LANGCODE_NOT_SPECIFIED); - } - } - - // Load redirects by hash. A direct query is used to improve performance. - $rid = $this->connection->query('SELECT rid FROM {redirect} WHERE hash IN (:hashes[]) ORDER BY LENGTH(redirect_source__query) DESC', [':hashes[]' => $hashes])->fetchField(); - - if (!empty($rid)) { - // Check if this is a loop. - if (in_array($rid, $this->foundRedirects)) { - throw new RedirectLoopException('/' . $source_path, $rid); - } - $this->foundRedirects[] = $rid; - - $redirect = $this->load($rid); - - // Find chained redirects. - if ($recursive = $this->findByRedirect($redirect, $language)) { - // Reset found redirects. - $this->foundRedirects = []; - return $recursive; - } - - return $redirect; - } - - return NULL; - } - - /** - * Helper function to find recursive redirects. - * - * @param \Drupal\redirect\Entity\Redirect - * The redirect object. - * @param string $language - * The language to use. - */ - protected function findByRedirect(Redirect $redirect, $language) { - $uri = $redirect->getRedirectUrl(); - $base_url = \Drupal::request()->getBaseUrl(); - $generated_url = $uri->toString(TRUE); - $path = ltrim(substr($generated_url->getGeneratedUrl(), strlen($base_url)), '/'); - $query = $uri->getOption('query') ?: []; - $return_value = $this->findMatchingRedirect($path, $query, $language); - return $return_value ? $return_value->addCacheableDependency($generated_url) : $return_value; - } - - /** - * Finds redirects based on the source path. - * - * @param string $source_path - * The redirect source path (without the query). - * - * @return \Drupal\redirect\Entity\Redirect[] - * Array of redirect entities. - */ - public function findBySourcePath($source_path) { - $ids = $this->manager->getStorage('redirect')->getQuery() - ->condition('redirect_source.path', $source_path, 'LIKE') - ->execute(); - return $this->manager->getStorage('redirect')->loadMultiple($ids); - } - - /** - * Finds redirects based on the destination URI. - * - * @param string[] $destination_uri - * List of destination URIs, for example ['internal:/node/123']. - * - * @return \Drupal\redirect\Entity\Redirect[] - * Array of redirect entities. - */ - public function findByDestinationUri(array $destination_uri) { - $storage = $this->manager->getStorage('redirect'); - $ids = $storage->getQuery() - ->condition('redirect_redirect.uri', $destination_uri, 'IN') - ->execute(); - return $storage->loadMultiple($ids); - } - - /** - * Load redirect entity by id. - * - * @param int $redirect_id - * The redirect id. - * - * @return \Drupal\redirect\Entity\Redirect - */ - public function load($redirect_id) { - return $this->manager->getStorage('redirect')->load($redirect_id); - } - - /** - * Loads multiple redirect entities. - * - * @param array $redirect_ids - * Redirect ids to load. - * - * @return \Drupal\redirect\Entity\Redirect[] - * List of redirect entities. - */ - public function loadMultiple(array $redirect_ids = NULL) { - return $this->manager->getStorage('redirect')->loadMultiple($redirect_ids); - } -} diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php b/sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php deleted file mode 100644 index e034362f1..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php +++ /dev/null @@ -1,31 +0,0 @@ - ['hash'], - ]; - $schema['redirect']['indexes'] += [ - // Limit length to 191. - 'source_language' => [['redirect_source__path', 191], 'language'], - ]; - - return $schema; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php b/sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php deleted file mode 100644 index 7e33ea51f..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php +++ /dev/null @@ -1,25 +0,0 @@ -get('image.style_public')) { - $route->setDefault('_disable_route_normalizer', TRUE); - } - if ($route = $collection->get('image.style_private')) { - $route->setDefault('_disable_route_normalizer', TRUE); - } - if ($route = $collection->get('system.files')) { - $route->setDefault('_disable_route_normalizer', TRUE); - } - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php b/sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php deleted file mode 100644 index ae9368886..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php +++ /dev/null @@ -1,53 +0,0 @@ -drupalHead($path); - $headers = $this->drupalGetHeaders(TRUE); - - $ending_url = isset($headers[0]['location']) ? $headers[0]['location'] : NULL; - $message = SafeMarkup::format('Testing redirect from %from to %to. Ending url: %url', [ - '%from' => $path, - '%to' => $expected_ending_url, - '%url' => $ending_url, - ]); - - if ($expected_ending_url == '') { - $expected_ending_url = Url::fromUri('base:')->setAbsolute()->toString(); - } - elseif (!empty($expected_ending_url)) { - // Check for absolute/external urls. - if (!parse_url($expected_ending_url, PHP_URL_SCHEME)) { - $expected_ending_url = Url::fromUri('base:' . $expected_ending_url)->setAbsolute()->toString(); - } - } - else { - $expected_ending_url = NULL; - } - - $this->assertEqual($expected_ending_url, $ending_url, $message); - - $this->assertEqual($headers[0][':status'], $expected_ending_status); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php b/sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php deleted file mode 100644 index 75e1f9987..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php +++ /dev/null @@ -1,296 +0,0 @@ -config = $this->config('redirect.settings'); - - $this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']); - $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); - - // Create a users for testing the access. - $this->normalUser = $this->drupalCreateUser([ - 'access content', - 'create page content', - 'create url aliases', - 'access administration pages', - ]); - $this->adminUser = $this->drupalCreateUser([ - 'administer site configuration', - 'access administration pages', - 'administer languages', - 'administer content types', - 'administer content translation', - 'create page content', - 'edit own page content', - 'create content translations', - ]); - - // Save the node. - $this->node = $this->drupalCreateNode([ - 'type' => 'page', - 'title' => 'Test Page Node', - 'path' => ['alias' => '/test-node'], - 'language' => Language::LANGCODE_NOT_SPECIFIED, - ]); - - // Create an alias for the create story path - this is used in the - // "redirect with permissions testing" test. - \Drupal::service('path.alias_storage')->save('/admin/config/system/site-information', '/site-info'); - - // Create a taxonomy term for the forum. - $term = entity_create('taxonomy_term', [ - 'name' => 'Test Forum Term', - 'vid' => 'forums', - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - ]); - $term->save(); - $this->forumTerm = $term; - - // Create another taxonomy vocabulary with a term. - $vocab = entity_create('taxonomy_vocabulary', [ - 'name' => 'test vocab', - 'vid' => 'test-vocab', - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - ]); - $vocab->save(); - $term = entity_create('taxonomy_term', [ - 'name' => 'Test Term', - 'vid' => $vocab->id(), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - 'path' => ['alias' => '/test-term'], - ]); - $term->save(); - - $this->term = $term; - } - - /** - * Will test the redirects. - */ - public function testRedirects() { - - // First test that the good stuff can be switched off. - $this->config->set('route_normalizer_enabled', FALSE)->save(); - $this->assertRedirect('index.php/node/' . $this->node->id(), NULL, 'HTTP/1.1 200 OK'); - $this->assertRedirect('index.php/test-node', NULL, 'HTTP/1.1 200 OK'); - $this->assertRedirect('test-node/', NULL, 'HTTP/1.1 200 OK'); - $this->assertRedirect('Test-node/', NULL, 'HTTP/1.1 200 OK'); - - $this->config->set('route_normalizer_enabled', TRUE)->save(); - - // Test alias normalization. - $this->assertRedirect('node/' . $this->node->id(), 'test-node'); - $this->assertRedirect('Test-node', 'test-node'); - - // Test redirects for non-clean urls. - $this->assertRedirect('index.php/node/' . $this->node->id(), 'test-node'); - $this->assertRedirect('index.php/test-node', 'test-node'); - - // Test deslashing. - $this->assertRedirect('test-node/', 'test-node'); - - // Test front page redirects. - $this->config('system.site')->set('page.front', '/node')->save(); - $this->assertRedirect('node', ''); - - // Test front page redirects with an alias. - \Drupal::service('path.alias_storage')->save('/node', '/node-alias'); - $this->assertRedirect('node-alias', ''); - - // Test post request. - $this->drupalPost('Test-node', 'application/json', array()); - // Does not do a redirect, stays in the same path. - $this->assertEqual(basename($this->getUrl()), 'Test-node'); - - // Test the access checking. - $this->config->set('access_check', TRUE)->save(); - $this->assertRedirect('admin/config/system/site-information', NULL, 'HTTP/1.1 403 Forbidden'); - - $this->config->set('access_check', FALSE)->save(); - // @todo - here it seems that the access check runs prior to our redirecting - // check why so and enable the test. - //$this->assertRedirect('admin/config/system/site-information', 'site-info'); - - // Test original query string is preserved with alias normalization. - $this->assertRedirect('Test-node?&foo&.bar=baz', 'test-node?&foo&.bar=baz'); - - // Test alias normalization with trailing ?. - $this->assertRedirect('test-node?', 'test-node'); - $this->assertRedirect('Test-node?', 'test-node'); - - // Test alias normalization still works without trailing ?. - $this->assertRedirect('test-node', NULL, 'HTTP/1.1 200 OK'); - $this->assertRedirect('Test-node', 'test-node'); - - // Login as user with admin privileges. - $this->drupalLogin($this->adminUser); - - // Test ignoring admin paths. - $this->config->set('ignore_admin_path', FALSE)->save(); - $this->assertRedirect('admin/config/system/site-information', 'site-info'); - - // Test alias normalization again with ignore_admin_path false. - $this->assertRedirect('Test-node', 'test-node'); - - $this->config->set('ignore_admin_path', TRUE)->save(); - $this->assertRedirect('admin/config/system/site-information', NULL, 'HTTP/1.1 200 OK'); - - // Test alias normalization again with ignore_admin_path true. - $this->assertRedirect('Test-node', 'test-node'); - } - - /** - * Test that redirects work properly with content_translation enabled. - */ - public function testLanguageRedirects() { - $this->drupalLogin($this->adminUser); - - // Add a new language. - ConfigurableLanguage::createFromLangcode('es') - ->save(); - - // Enable URL language detection and selection. - $edit = ['language_interface[enabled][language-url]' => '1']; - $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings')); - - // Set page content type to use multilingual support. - $edit = [ - 'language_configuration[language_alterable]' => TRUE, - 'language_configuration[content_translation]' => TRUE, - ]; - $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type')); - $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Page')), 'Basic page content type has been updated.'); - - $spanish_node = $this->drupalCreateNode([ - 'type' => 'page', - 'title' => 'Spanish Test Page Node', - 'path' => ['alias' => '/spanish-test-node'], - 'langcode' => 'es', - ]); - - // Test multilingual redirect. - $this->assertRedirect('es/node/' . $spanish_node->id(), 'es/spanish-test-node'); - } - - /** - * Asserts the redirect from $path to the $expected_ending_url. - * - * @param string $path - * The request path. - * @param $expected_ending_url - * The path where we expect it to redirect. If NULL value provided, no - * redirect is expected. - * @param string $expected_ending_status - * The status we expect to get with the first request. - */ - public function assertRedirect($path, $expected_ending_url, $expected_ending_status = 'HTTP/1.1 301 Moved Permanently') { - $this->drupalHead($GLOBALS['base_url'] . '/' . $path); - $headers = $this->drupalGetHeaders(TRUE); - - $ending_url = isset($headers[0]['location']) ? $headers[0]['location'] : NULL; - $message = SafeMarkup::format('Testing redirect from %from to %to. Ending url: %url', array( - '%from' => $path, - '%to' => $expected_ending_url, - '%url' => $ending_url, - )); - - - if ($expected_ending_url == '') { - $expected_ending_url = $GLOBALS['base_url'] . '/'; - } - elseif (!empty($expected_ending_url)) { - $expected_ending_url = $GLOBALS['base_url'] . '/' . $expected_ending_url; - } - else { - $expected_ending_url = NULL; - } - - $this->assertEqual($expected_ending_url, $ending_url); - - $this->assertEqual($headers[0][':status'], $expected_ending_status); - } - - /** - * @inheritdoc} - */ - protected function drupalHead($path, array $options = [], array $headers = []) { - // Always just use getAbsolutePath() so that generating the link does not - // alter special requests. - $url = $this->getAbsoluteUrl($path); - $out = $this->curlExec([CURLOPT_NOBODY => TRUE, CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $headers]); - // Ensure that any changes to variables in the other thread are picked up. - $this->refreshVariables(); - - if ($this->dumpHeaders) { - $this->verbose('GET request to: ' . $path . - '
Ending URL: ' . $this->getUrl() . - '
Headers:
' . Html::escape(var_export(array_map('trim', $this->headers), TRUE)) . '
'); - } - - return $out; - } -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php b/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php deleted file mode 100644 index 6d9a72791..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php +++ /dev/null @@ -1,125 +0,0 @@ -save(); - $language = ConfigurableLanguage::createFromLangcode('es'); - $language->save(); - } - - /** - * Test multilingual scenarios. - */ - public function testLanguageSpecificRedirects() { - $this->drupalLogin($this->adminUser); - - $this->drupalGet('admin/config/search/redirect/add'); - $this->assertOption('edit-language-0-value', 'en'); - $this->assertOption('edit-language-0-value', 'de'); - $this->assertOption('edit-language-0-value', 'es'); - $this->assertOption('edit-language-0-value', 'und'); - $this->assertNoOption('edit-language-0-value', 'zxx'); - $this->assertOptionByText('edit-language-0-value', 'English'); - $this->assertOptionByText('edit-language-0-value', 'German'); - $this->assertOptionByText('edit-language-0-value', 'Spanish'); - $this->assertOptionByText('edit-language-0-value', '- All languages -'); - - // Add a redirect for english. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'langpath', - 'redirect_redirect[0][uri]' => '/user', - 'language[0][value]' => 'en', - ), t('Save')); - - // Add a redirect for germany. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'langpath', - 'redirect_redirect[0][uri]' => '', - 'language[0][value]' => 'de', - ), t('Save')); - - // Check redirect for english. - $this->assertRedirect('langpath', '/user', 'HTTP/1.1 301 Moved Permanently'); - - // Check redirect for germany. - $this->assertRedirect('de/langpath', '/de', 'HTTP/1.1 301 Moved Permanently'); - - // Check no redirect for spanish. - $this->assertRedirect('es/langpath', NULL, 'HTTP/1.1 404 Not Found'); - } - - /** - * Test non-language specific redirect. - */ - public function testUndefinedLangugageRedirects() { - $this->drupalLogin($this->adminUser); - - // Add a redirect for english. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'langpath', - 'redirect_redirect[0][uri]' => '/user', - 'language[0][value]' => 'und', - ), t('Save')); - - // Check redirect for english. - $this->assertRedirect('langpath', '/user', 'HTTP/1.1 301 Moved Permanently'); - - // Check redirect for spanish. - $this->assertRedirect('es/langpath', '/es/user', 'HTTP/1.1 301 Moved Permanently'); - } - - /** - * Test editing the redirect language. - */ - public function testEditRedirectLanguage() { - $this->drupalLogin($this->adminUser); - - // Add a redirect for english. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'langpath', - 'redirect_redirect[0][uri]' => '/user', - 'language[0][value]' => 'en', - ), t('Save')); - - // Check redirect for english. - $this->assertRedirect('langpath', '/user', 'HTTP/1.1 301 Moved Permanently'); - - // Check that redirect for Germany is not working. - $this->assertRedirect('de/langpath', NULL, 'HTTP/1.1 404 Not Found'); - - // Edit the redirect and change the language. - $this->drupalGet('admin/config/search/redirect'); - $this->clickLink('Edit'); - $this->drupalPostForm(NULL, ['language[0][value]' => 'de'], t('Save')); - - // Check redirect for english is NOT working now. - $this->assertRedirect('langpath', NULL, 'HTTP/1.1 404 Not Found'); - - // Check that redirect for Germany is now working. - $this->assertRedirect('de/langpath', '/de/user', 'HTTP/1.1 301 Moved Permanently'); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php b/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php deleted file mode 100644 index 67b066614..000000000 --- a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php +++ /dev/null @@ -1,436 +0,0 @@ -drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); - $this->adminUser = $this->drupalCreateUser(array( - 'administer redirects', - 'administer redirect settings', - 'access content', - 'bypass node access', - 'create url aliases', - 'administer taxonomy', - 'administer url aliases', - )); - - $this->repository = \Drupal::service('redirect.repository'); - - $this->storage = $this->container->get('entity.manager')->getStorage('redirect'); - } - - /** - * Test the redirect UI. - */ - public function testRedirectUI() { - $this->drupalLogin($this->adminUser); - - // Test populating the redirect form with predefined values. - $this->drupalGet('admin/config/search/redirect/add', array('query' => array( - 'source' => 'non-existing', - 'source_query' => array('key' => 'val', 'key1' => 'val1'), - 'redirect' => 'node', - 'redirect_options' => array('query' => array('key' => 'val', 'key1' => 'val1')), - ))); - $this->assertFieldByName('redirect_source[0][path]', 'non-existing?key=val&key1=val1'); - $this->assertFieldByName('redirect_redirect[0][uri]', '/node?key=val&key1=val1'); - - // Test creating a new redirect via UI. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'non-existing', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - - // Try to find the redirect we just created. - $redirect = $this->repository->findMatchingRedirect('non-existing'); - $this->assertEqual($redirect->getSourceUrl(), Url::fromUri('base:non-existing')->toString()); - $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:node')->toString()); - - // After adding the redirect we should end up in the list. Check if the - // redirect is listed. - $this->assertUrl('admin/config/search/redirect'); - $this->assertText('non-existing'); - $this->assertLink(Url::fromUri('base:node')->toString()); - $this->assertText(t('Not specified')); - - // Test the edit form and update action. - $this->clickLink(t('Edit')); - $this->assertFieldByName('redirect_source[0][path]', 'non-existing'); - $this->assertFieldByName('redirect_redirect[0][uri]', '/node'); - $this->assertFieldByName('status_code', $redirect->getStatusCode()); - - // Append a query string to see if we handle query data properly. - $this->drupalPostForm(NULL, array( - 'redirect_source[0][path]' => 'non-existing?key=value', - ), t('Save')); - - // Check the location after update and check if the value has been updated - // in the list. - $this->assertUrl('admin/config/search/redirect'); - $this->assertText('non-existing?key=value'); - - // The path field should not contain the query string and therefore we - // should be able to load the redirect using only the url part without - // query. - $this->storage->resetCache(); - $redirects = $this->repository->findBySourcePath('non-existing'); - $redirect = array_shift($redirects); - $this->assertEqual($redirect->getSourceUrl(), Url::fromUri('base:non-existing', ['query' => ['key' => 'value']])->toString()); - - // Test the source url hints. - // The hint about an existing base path. - $this->drupalPostAjaxForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'non-existing?key=value', - ), 'redirect_source[0][path]'); - $this->assertRaw(t('The base source path %source is already being redirected. Do you want to edit the existing redirect?', - array('%source' => 'non-existing?key=value', '@edit-page' => $redirect->url('edit-form')))); - - // The hint about a valid path. - $this->drupalPostAjaxForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'node', - ), 'redirect_source[0][path]'); - $this->assertRaw(t('The source path %path is likely a valid path. It is preferred to create URL aliases for existing paths rather than redirects.', - array('%path' => 'node', '@url-alias' => Url::fromRoute('path.admin_add')->toString()))); - - // Test validation. - // Duplicate redirect. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'non-existing?key=value', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - $this->assertRaw(t('The source path %source is already being redirected. Do you want to edit the existing redirect?', - array('%source' => 'non-existing?key=value', '@edit-page' => $redirect->url('edit-form')))); - - // Redirecting to itself. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'node', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - $this->assertRaw(t('You are attempting to redirect the page to itself. This will result in an infinite loop.')); - - // Redirecting the front page. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => '', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - $this->assertRaw(t('It is not allowed to create a redirect from the front page.')); - - // Redirecting a url with fragment. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'page-to-redirect#content', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - $this->assertRaw(t('The anchor fragments are not allowed.')); - - // Adding path that starts with / - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => '/page-to-redirect', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - $this->assertRaw(t('The url to redirect from should not start with a forward slash (/).')); - - // Test filters. - // Add a new redirect. - $this->drupalPostForm('admin/config/search/redirect/add', array( - 'redirect_source[0][path]' => 'test27', - 'redirect_redirect[0][uri]' => '/node', - ), t('Save')); - - // Filter with non existing value. - $this->drupalGet('admin/config/search/redirect', array( - 'query' => array( - 'status_code' => '3', - ), - )); - - $rows = $this->xpath('//tbody/tr'); - // Check if the list has no rows. - $this->assertTrue(count($rows) == 0); - - // Filter with existing values. - $this->drupalGet('admin/config/search/redirect', array( - 'query' => array( - 'redirect_source__path' => 'test', - 'status_code' => '2', - ), - )); - - $rows = $this->xpath('//tbody/tr'); - // Check if the list has 1 row. - $this->assertTrue(count($rows) == 1); - - $this->drupalGet('admin/config/search/redirect', array( - 'query' => array( - 'redirect_redirect__uri' => 'nod', - ), - )); - - $rows = $this->xpath('//tbody/tr'); - // Check if the list has 2 rows. - $this->assertTrue(count($rows) == 2); - - // Test the plural form of the bulk delete action. - $this->drupalGet('admin/config/search/redirect'); - $edit = [ - 'redirect_bulk_form[0]' => TRUE, - 'redirect_bulk_form[1]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - $this->assertText('Are you sure you want to delete these redirects?'); - $this->clickLink('Cancel'); - - // Test the delete action. - $this->clickLink(t('Delete')); - $this->assertRaw(t('Are you sure you want to delete the URL redirect from %source to %redirect?', - array('%source' => Url::fromUri('base:non-existing', ['query' => ['key' => 'value']])->toString(), '%redirect' => Url::fromUri('base:node')->toString()))); - $this->drupalPostForm(NULL, array(), t('Delete')); - $this->assertUrl('admin/config/search/redirect'); - - // Test the bulk delete action. - $this->drupalPostForm(NULL, ['redirect_bulk_form[0]' => TRUE], t('Apply to selected items')); - $this->assertText('Are you sure you want to delete this redirect?'); - $this->assertText('test27'); - $this->drupalPostForm(NULL, [], t('Delete')); - - $this->assertText(t('There is no redirect yet.')); - } - - /** - * Tests redirects being automatically created upon path alias change. - */ - public function testAutomaticRedirects() { - $this->drupalLogin($this->adminUser); - - // Create a node and update its path alias which should result in a redirect - // being automatically created from the old alias to the new one. - $node = $this->drupalCreateNode(array( - 'type' => 'article', - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - 'path' => array('alias' => '/node_test_alias'), - )); - $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertText(t('No URL redirects available.')); - $this->drupalPostForm('node/' . $node->id() . '/edit', array('path[0][alias]' => '/node_test_alias_updated'), t('Save')); - - $redirect = $this->repository->findMatchingRedirect('node_test_alias', array(), Language::LANGCODE_NOT_SPECIFIED); - $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:node_test_alias_updated')->toString()); - // Test if the automatically created redirect works. - $this->assertRedirect('node_test_alias', 'node_test_alias_updated'); - - // Test that changing the path back deletes the first redirect, creates - // a new one and does not result in a loop. - $this->drupalPostForm('node/' . $node->id() . '/edit', array('path[0][alias]' => '/node_test_alias'), t('Save')); - $redirect = $this->repository->findMatchingRedirect('node_test_alias', array(), Language::LANGCODE_NOT_SPECIFIED); - $this->assertTrue(empty($redirect)); - - \Drupal::service('path.alias_manager')->cacheClear(); - $redirect = $this->repository->findMatchingRedirect('node_test_alias_updated', array(), Language::LANGCODE_NOT_SPECIFIED); - - $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertText($redirect->getSourcePathWithQuery()); - $this->assertLinkByHref(Url::fromRoute('entity.redirect.edit_form', ['redirect' => $redirect->id()])->toString()); - $this->assertLinkByHref(Url::fromRoute('entity.redirect.delete_form', ['redirect' => $redirect->id()])->toString()); - - $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:node_test_alias')->toString()); - // Test if the automatically created redirect works. - $this->assertRedirect('node_test_alias_updated', 'node_test_alias'); - - // Test that the redirect will be deleted upon node deletion. - $this->drupalPostForm('node/' . $node->id() . '/delete', array(), t('Delete')); - $redirect = $this->repository->findMatchingRedirect('node_test_alias_updated', array(), Language::LANGCODE_NOT_SPECIFIED); - $this->assertTrue(empty($redirect)); - - // Create a term and update its path alias and check if we have a redirect - // from the previous path alias to the new one. - $term = $this->createTerm($this->createVocabulary()); - $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', array('path[0][alias]' => '/term_test_alias_updated'), t('Save')); - $redirect = $this->repository->findMatchingRedirect('term_test_alias'); - $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:term_test_alias_updated')->toString()); - // Test if the automatically created redirect works. - $this->assertRedirect('term_test_alias', 'term_test_alias_updated'); - - // Test the path alias update via the admin path form. - $this->drupalPostForm('admin/config/search/path/add', array( - 'source' => '/node', - 'alias' => '/aaa_path_alias', - ), t('Save')); - // Note that here we rely on fact that we land on the path alias list page - // and the default sort is by the alias, which implies that the first edit - // link leads to the edit page of the aaa_path_alias. - $this->clickLink(t('Edit')); - $this->drupalPostForm(NULL, array('alias' => '/aaa_path_alias_updated'), t('Save')); - $redirect = $this->repository->findMatchingRedirect('aaa_path_alias', array(), 'en'); - $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:aaa_path_alias_updated')->toString()); - // Test if the automatically created redirect works. - $this->assertRedirect('aaa_path_alias', 'aaa_path_alias_updated'); - - // Test the automatically created redirect shows up in the form correctly. - $this->drupalGet('admin/config/search/redirect/edit/' . $redirect->id()); - $this->assertFieldByName('redirect_source[0][path]', 'aaa_path_alias'); - $this->assertFieldByName('redirect_redirect[0][uri]', '/node'); - } - - /** - * Test the redirect loop protection and logging. - */ - function testRedirectLoop() { - // Redirect loop redirection only works when page caching is disabled. - \Drupal::service('module_installer')->uninstall(['page_cache']); - - /** @var \Drupal\redirect\Entity\Redirect $redirect1 */ - $redirect1 = $this->storage->create(); - $redirect1->setSource('node'); - $redirect1->setRedirect('admin'); - $redirect1->setStatusCode(301); - $redirect1->save(); - - /** @var \Drupal\redirect\Entity\Redirect $redirect2 */ - $redirect2 = $this->storage->create(); - $redirect2->setSource('admin'); - $redirect2->setRedirect('node'); - $redirect2->setStatusCode(301); - $redirect2->save(); - - $this->maximumRedirects = 10; - $this->drupalGet('node'); - $this->assertText('Service unavailable'); - $this->assertResponse(503); - - $log = db_select('watchdog')->fields('watchdog')->condition('type', 'redirect')->execute()->fetchAll(); - if (count($log) == 0) { - $this->fail('Redirect loop has not been logged'); - } - else { - $log = reset($log); - $this->assertEqual($log->severity, RfcLogLevel::WARNING); - $this->assertEqual(SafeMarkup::format($log->message, unserialize($log->variables)), - SafeMarkup::format('Redirect loop identified at %path for redirect %id', array('%path' => '/node', '%id' => $redirect1->id()))); - } - } - - /** - * Returns a new vocabulary with random properties. - */ - function createVocabulary() { - // Create a vocabulary. - $vocabulary = entity_create('taxonomy_vocabulary', array( - 'name' => $this->randomMachineName(), - 'description' => $this->randomMachineName(), - 'vid' => mb_strtolower($this->randomMachineName()), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - 'weight' => mt_rand(0, 10), - )); - $vocabulary->save(); - return $vocabulary; - } - - /** - * Returns a new term with random properties in vocabulary $vid. - */ - function createTerm($vocabulary) { - $filter_formats = filter_formats(); - $format = array_pop($filter_formats); - $term = entity_create('taxonomy_term', array( - 'name' => $this->randomMachineName(), - 'description' => array( - 'value' => $this->randomMachineName(), - // Use the first available text format. - 'format' => $format->id(), - ), - 'vid' => $vocabulary->id(), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - 'path' => array('alias' => '/term_test_alias'), - )); - $term->save(); - return $term; - } - - /** - * Test cache tags. - * - * @todo Not sure this belongs in a UI test, but a full web test is needed. - */ - public function testCacheTags() { - /** @var \Drupal\redirect\Entity\Redirect $redirect1 */ - $redirect1 = $this->storage->create(); - $redirect1->setSource('test-redirect'); - $redirect1->setRedirect('node'); - $redirect1->setStatusCode(301); - $redirect1->save(); - - $this->assertRedirect('test-redirect', 'node'); - $headers = $this->drupalGetHeaders(TRUE); - // Note, self::assertCacheTag() cannot be used here since it only looks at - // the final set of headers. - $expected = 'http_response ' . implode(' ', $redirect1->getCacheTags()); - $this->assertEqual($expected, $headers[0]['x-drupal-cache-tags'], 'Redirect cache tags properly set.'); - - // First request should be a cache MISS. - $this->assertEqual($headers[0]['x-drupal-cache'], 'MISS', 'First request to the redirect was not cached.'); - - // Second request should be cached. - $this->assertRedirect('test-redirect', 'node'); - $headers = $this->drupalGetHeaders(TRUE); - $this->assertEqual($headers[0]['x-drupal-cache'], 'HIT', 'The second request to the redirect was cached.'); - - // Ensure that the redirect has been cleared from cache when deleted. - $redirect1->delete(); - $this->drupalGet('test-redirect'); - $this->assertResponse(404, 'Deleted redirect properly clears the internal page cache.'); - } - - /** - * Test external destinations. - */ - public function testExternal() { - $redirect = $this->storage->create(); - $redirect->setSource('a-path'); - // @todo Redirect::setRedirect() assumes that all redirects are internal. - $redirect->redirect_redirect->set(0, ['uri' => 'https://www.example.org']); - $redirect->setStatusCode(301); - $redirect->save(); - $this->assertRedirect('a-path', 'https://www.example.org'); - $this->drupalLogin($this->adminUser); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php b/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php deleted file mode 100644 index e6f9c4758..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php +++ /dev/null @@ -1,186 +0,0 @@ -schema()->createTable('path_redirect', array( - 'fields' => array( - 'rid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'source' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'redirect' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'query' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ), - 'fragment' => array( - 'type' => 'varchar', - 'length' => 50, - 'not null' => FALSE, - ), - 'language' => array( - 'type' => 'varchar', - 'length' => 12, - 'not null' => TRUE, - 'default' => '', - ), - 'type' => array( - 'type' => 'int', - 'size' => 'small', - 'not null' => TRUE, - ), - 'last_used' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'primary key' => array('rid'), - 'unique keys' => array('source_language' => array('source', 'language')), - 'mysql_character_set' => 'utf8', -)); - - -$connection->insert('path_redirect') - ->fields(array( - 'rid', - 'source', - 'redirect', - 'query', - 'fragment', - 'language', - 'type', - 'last_used', - )) - ->values(array( - 'rid' => 5, - 'source' => 'test/source/url', - 'redirect' => 'test/redirect/url', - 'query' => NULL, - 'fragment' => NULL, - 'language' => '', - 'type' => 301, - 'last_used' => 1449497138, - )) - ->values(array( - 'rid' => 7, - 'source' => 'test/source/url2', - 'redirect' => 'http://test/external/redirect/url', - 'query' => 'foo=bar&biz=buz', - 'fragment' => NULL, - 'language' => 'en', - 'type' => 302, - 'last_used' => 1449497139, - )) - ->execute(); - -$connection->schema()->createTable('system', array( - 'fields' => array( - 'filename' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'name' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'owner' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'throttle' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'bootstrap' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'schema_version' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '-1', - ), - 'weight' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'info' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'normal', - ), - ), - 'primary key' => array( - 'filename', - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('system') - ->fields(array( - 'filename', - 'name', - 'type', - 'owner', - 'status', - 'bootstrap', - 'schema_version', - 'weight', - 'info', - )) - ->values(array( - 'filename' => 'modules/contrib/path_redirect/path_redirect.module', - 'name' => 'path_redirect', - 'type' => 'module', - 'owner' => '', - 'status' => '1', - 'bootstrap' => '0', - 'schema_version' => '7000', - 'weight' => '0', - 'info' => 'a:10:{s:4:"name";s:13:"Path Redirect";s:11:"description";s:51:"Allows users to redirect from old URLs to new URLs.";s:7:"package";s:5:"Other";s:7:"version";s:3:"6.0";s:4:"core";s:3:"6.x";s:7:"project";s:13:"path_redirect";s:9:"datestamp";s:10:"1347989995";s:12:"dependencies";a:0:{}s:10:"dependents";a:0:{}s:3:"php";s:5:"4.3.5";}', - )) - ->execute(); diff --git a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php b/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php deleted file mode 100644 index 205107617..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php +++ /dev/null @@ -1,240 +0,0 @@ -schema()->createTable('redirect', array( - 'fields' => array( - 'rid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - ), - 'hash' => array( - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ), - 'type' => array( - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ), - 'uid' => array( - 'type' => 'int', - 'not null' => TRUE, - ), - 'source' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'source_options' => array( - 'type' => 'text', - 'not null' => TRUE, - ), - 'redirect' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'redirect_options' => array( - 'type' => 'text', - 'not null' => TRUE, - ), - 'language' => array( - 'type' => 'varchar', - 'length' => 12, - 'not null' => TRUE, - 'default' => '', - ), - 'status_code' => array( - 'type' => 'int', - 'size' => 'small', - 'not null' => TRUE, - ), - 'count' => array( - 'type' => 'int', - 'not null' => TRUE, - ), - 'access' => array( - 'type' => 'int', - 'not null' => TRUE, - ), - ), - 'primary key' => array('rid'), - 'unique keys' => array( - 'source_language' => array('source', 'language'), - 'expires' => array('type', 'access') - ), - 'mysql_character_set' => 'utf8', -)); - - -$connection->insert('redirect') - ->fields(array( - 'rid', - 'hash', - 'type', - 'uid', - 'source', - 'source_options', - 'redirect', - 'redirect_options', - 'language', - 'status_code', - 'count', - 'access', - )) - ->values(array( - 'rid' => 5, - 'hash' => 'MwmDbnA65ag646gtEdLqmAqTbF0qQerse63RkQmJK_Y', - 'type' => 'redirect', - 'uid' => 5, - 'source' => 'test/source/url', - 'source_options' => '', - 'redirect' => 'test/redirect/url', - 'redirect_options' => '', - 'language' => 'und', - 'status_code' => 301, - 'count' => 2518, - 'access' => 1449497138, - )) - ->values(array( - 'rid' => 7, - 'hash' => 'GvD5bBB71W8qBvp9I9hHmbSoqZfTvUz0mIkEWjlP8M4', - 'type' => 'redirect', - 'uid' => 6, - 'source' => 'test/source/url2', - 'source_options' => '', - 'redirect' => 'http://test/external/redirect/url', - 'redirect_options' => 'a:2:{s:5:"query";a:2:{s:3:"foo";s:3:"bar";s:3:"biz";s:3:"buz";}s:8:"fragment";s:10:"fragment-1";}', - 'language' => 'und', - 'status_code' => 0, - 'count' => 419, - 'access' => 1449497139, - )) - ->execute(); - -$connection->schema()->createTable('variable', array( - 'fields' => array( - 'name' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'value' => array( - 'type' => 'blob', - 'not null' => TRUE, - 'size' => 'normal', - ), - ), - 'primary key' => array( - 'name', - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('variable') -->fields(array( - 'name', - 'value', -)) -->values(array( - 'name' => 'redirect_default_status_code', - 'value' => 's:3:"307";', -)) -->execute(); - -$connection->schema()->createTable('system', array( - 'fields' => array( - 'filename' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'name' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '12', - 'default' => '', - ), - 'owner' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'bootstrap' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'schema_version' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '-1', - ), - 'weight' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'info' => array( - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'normal', - ), - ), - 'primary key' => array( - 'filename', - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('system') -->fields(array( - 'filename', - 'name', - 'type', - 'owner', - 'status', - 'bootstrap', - 'schema_version', - 'weight', - 'info', -)) -->values(array( - 'filename' => 'modules/contrib/redirect/redirect.module', - 'name' => 'redirect', - 'type' => 'module', - 'owner' => '', - 'status' => '1', - 'bootstrap' => '0', - 'schema_version' => '7000', - 'weight' => '0', - 'info' => 'a:13:{s:4:"name";s:8:"Redirect";s:11:"description";s:51:"Allows users to redirect from old URLs to new URLs.";s:4:"core";s:3:"7.x";s:5:"files";a:11:{i:0;s:15:"redirect.module";i:1;s:18:"redirect.admin.inc";i:2;s:16:"redirect.install";i:3;s:13:"redirect.test";i:4;s:24:"views/redirect.views.inc";i:5;s:47:"views/redirect_handler_filter_redirect_type.inc";i:6;s:48:"views/redirect_handler_field_redirect_source.inc";i:7;s:50:"views/redirect_handler_field_redirect_redirect.inc";i:8;s:52:"views/redirect_handler_field_redirect_operations.inc";i:9;s:51:"views/redirect_handler_field_redirect_link_edit.inc";i:10;s:53:"views/redirect_handler_field_redirect_link_delete.inc";}s:9:"configure";s:37:"admin/config/search/redirect/settings";s:7:"version";s:11:"7.x-1.0-rc1";s:7:"project";s:8:"redirect";s:9:"datestamp";s:10:"1347989995";s:5:"mtime";i:1347989995;s:12:"dependencies";a:0:{}s:7:"package";s:5:"Other";s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}', -)) -->execute(); diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php deleted file mode 100644 index 9383adcd1..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php +++ /dev/null @@ -1,50 +0,0 @@ -installSchema('system', array('router')); - $this->installEntitySchema('redirect'); - $this->loadFixture( __DIR__ . '/../../../../../tests/fixtures/drupal6.php'); - - $this->executeMigrations(['d6_path_redirect']); - } - - /** - * Tests the Drupal 6 path redirect to Drupal 8 migration. - */ - public function testPathRedirect() { - - /** @var Redirect $redirect */ - $redirect = Redirect::load(5); - $this->assertSame($this->getMigration('d6_path_redirect') - ->getIdMap() - ->lookupDestinationID(array(5)), array($redirect->id())); - $this->assertSame("/test/source/url", $redirect->getSourceUrl()); - $this->assertSame("base:test/redirect/url", $redirect->getRedirectUrl()->toUriString()); - - $redirect = Redirect::load(7); - $this->assertSame("/test/source/url2", $redirect->getSourceUrl()); - $this->assertSame("http://test/external/redirect/url?foo=bar&biz=buz", $redirect->getRedirectUrl()->toUriString()); - } -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php deleted file mode 100644 index 469e5ccd5..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php +++ /dev/null @@ -1,68 +0,0 @@ -installEntitySchema('redirect'); - $this->loadFixture(__DIR__ . '/../../../../fixtures/drupal7.php'); - - $this->executeMigration('d7_path_redirect'); - } - - /** - * Asserts various aspects of a redirect entity. - * - * @param int $id - * The entity ID in the form ENTITY_TYPE.BUNDLE.FIELD_NAME. - * @param string $source_url - * The expected source url. - * @param string $redirect_url - * The expected redirect url. - * @param string $status_code - * The expected status code. - */ - protected function assertEntity($id, $source_url, $redirect_url, $status_code) { - /** @var Redirect $redirect */ - $redirect = Redirect::load($id); - $this->assertSame($this->getMigration('d7_path_redirect') - ->getIdMap() - ->lookupDestinationID([$id]), [$redirect->id()]); - $this->assertSame($source_url, $redirect->getSourceUrl()); - $this->assertSame($redirect_url, $redirect->getRedirectUrl() - ->toUriString()); - $this->assertSame($status_code, $redirect->getStatusCode()); - } - - /** - * Tests the Drupal 7 path redirect to Drupal 8 migration. - */ - public function testPathRedirect() { - $this->assertEntity(5, '/test/source/url', 'base:test/redirect/url', '301'); - $this->assertEntity(7, '/test/source/url2', 'http://test/external/redirect/url?foo=bar&biz=buz#fragment-1', '307'); - } -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php deleted file mode 100644 index 6d982f7c1..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php +++ /dev/null @@ -1,305 +0,0 @@ -installEntitySchema('redirect'); - $this->installEntitySchema('user'); - $this->installSchema('system', ['router']); - $this->installConfig(array('redirect')); - - $language = ConfigurableLanguage::createFromLangcode('de'); - $language->save(); - - $this->controller = $this->container->get('entity.manager')->getStorage('redirect'); - } - - /** - * Test redirect entity logic. - */ - public function testRedirectEntity() { - // Create a redirect and test if hash has been generated correctly. - /** @var \Drupal\redirect\Entity\Redirect $redirect */ - $redirect = $this->controller->create(); - $redirect->setSource('some-url', array('key' => 'val')); - $redirect->setRedirect('node'); - - $redirect->save(); - $this->assertEquals(Redirect::generateHash('some-url', array('key' => 'val'), Language::LANGCODE_NOT_SPECIFIED), $redirect->getHash()); - // Update the redirect source query and check if hash has been updated as - // expected. - $redirect->setSource('some-url', array('key1' => 'val1')); - $redirect->save(); - $this->assertEqual(Redirect::generateHash('some-url', array('key1' => 'val1'), Language::LANGCODE_NOT_SPECIFIED), $redirect->getHash()); - // Update the redirect source path and check if hash has been updated as - // expected. - $redirect->setSource('another-url', array('key1' => 'val1')); - $redirect->save(); - $this->assertEqual(Redirect::generateHash('another-url', array('key1' => 'val1'), Language::LANGCODE_NOT_SPECIFIED), $redirect->getHash()); - // Update the redirect language and check if hash has been updated as - // expected. - $redirect->setLanguage('de'); - $redirect->save(); - $this->assertEqual(Redirect::generateHash('another-url', array('key1' => 'val1'), 'de'), $redirect->getHash()); - // Create a few more redirects to test the select. - for ($i = 0; $i < 5; $i++) { - $redirect = $this->controller->create(); - $redirect->setSource($this->randomMachineName()); - $redirect->save(); - } - /** @var \Drupal\redirect\RedirectRepository $repository */ - $repository = \Drupal::service('redirect.repository'); - $redirect = $repository->findMatchingRedirect('another-url', array('key1' => 'val1'), 'de'); - if (!empty($redirect)) { - $this->assertEqual($redirect->getSourceUrl(), '/another-url?key1=val1'); - } - else { - $this->fail(t('Failed to find matching redirect.')); - } - - // Load the redirect based on url. - $redirects = $repository->findBySourcePath('another-url'); - $redirect = array_shift($redirects); - if (!empty($redirect)) { - $this->assertEqual($redirect->getSourceUrl(), '/another-url?key1=val1'); - } - else { - $this->fail(t('Failed to find redirect by source path.')); - } - - // Test passthrough_querystring. - $redirect = $this->controller->create(); - $redirect->setSource('a-different-url'); - $redirect->setRedirect('node'); - $redirect->save(); - $redirect = $repository->findMatchingRedirect('a-different-url', ['key1' => 'val1'], 'de'); - if (!empty($redirect)) { - $this->assertEqual($redirect->getSourceUrl(), '/a-different-url'); - } - else { - $this->fail('Failed to find redirect by source path with query string.'); - } - - // Add another redirect to the same path, with a query. This should always - // be found before the source without a query set. - /** @var \Drupal\redirect\Entity\Redirect $new_redirect */ - $new_redirect = $this->controller->create(); - $new_redirect->setSource('a-different-url', ['foo' => 'bar']); - $new_redirect->setRedirect('node'); - $new_redirect->save(); - $found = $repository->findMatchingRedirect('a-different-url', ['foo' => 'bar'], 'de'); - if (!empty($found)) { - $this->assertEqual($found->getSourceUrl(), '/a-different-url?foo=bar'); - } - else { - $this->fail('Failed to find a redirect by source path with query string.'); - } - - // Add a redirect to an external URL. - $external_redirect = $this->controller->create(); - $external_redirect->setSource('google'); - $external_redirect->setRedirect('https://google.com'); - $external_redirect->save(); - $found = $repository->findMatchingRedirect('google'); - if (!empty($found)) { - $this->assertEqual($found->getRedirectUrl()->toString(), 'https://google.com'); - } - else { - $this->fail('Failed to find a redirect for google.'); - } - - // Hashes should be case-insensitive since the source paths are. - /** @var \Drupal\redirect\Entity\Redirect $redirect */ - $redirect = $this->controller->create(); - $redirect->setSource('Case-Sensitive-Path'); - $redirect->setRedirect('node'); - $redirect->save(); - $found = $repository->findBySourcePath('case-sensitive-path'); - if (!empty($found)) { - $found = reset($found); - $this->assertEqual($found->getSourceUrl(), '/Case-Sensitive-Path'); - } - else { - $this->fail('findBySourcePath is case sensitive'); - } - $found = $repository->findMatchingRedirect('case-sensitive-path'); - if (!empty($found)) { - $this->assertEqual($found->getSourceUrl(), '/Case-Sensitive-Path'); - } - else { - $this->fail('findMatchingRedirect is case sensitive.'); - } - } - - /** - * Test slash is removed from source path in findMatchingRedirect. - */ - public function testDuplicateRedirectEntry() { - $redirect = $this->controller->create(); - $redirect->setSource('/foo/foo', []); - $redirect->setRedirect('foo'); - $redirect->save(); - - $redirect_repository = \Drupal::service('redirect.repository'); - $matched_redirect = $redirect_repository->findMatchingRedirect('/foo/foo', [], 'en-AU'); - $this->assertNotNull($matched_redirect); - - $null_redirect = $redirect_repository->findMatchingRedirect('/foo/foo-bar', [], 'en-AU'); - $this->assertNull($null_redirect); - } - - /** - * Test redirect_sort_recursive(). - */ - public function testSortRecursive() { - $test_cases = array( - array( - 'input' => array('b' => 'aa', 'c' => array('c2' => 'aa', 'c1' => 'aa'), 'a' => 'aa'), - 'expected' => array('a' => 'aa', 'b' => 'aa', 'c' => array('c1' => 'aa', 'c2' => 'aa')), - 'callback' => 'ksort', - ), - ); - foreach ($test_cases as $index => $test_case) { - $output = $test_case['input']; - redirect_sort_recursive($output, $test_case['callback']); - $this->assertIdentical($output, $test_case['expected']); - } - } - - /** - * Test loop detection. - */ - public function testLoopDetection() { - // Add a chained redirect that isn't a loop. - /** @var \Drupal\redirect\Entity\Redirect $one */ - $one = $this->controller->create(); - $one->setSource('my-path'); - $one->setRedirect('node'); - $one->save(); - /** @var \Drupal\redirect\Entity\Redirect $two */ - $two = $this->controller->create(); - $two->setSource('second-path'); - $two->setRedirect('my-path'); - $two->save(); - /** @var \Drupal\redirect\Entity\Redirect $three */ - $three = $this->controller->create(); - $three->setSource('third-path'); - $three->setRedirect('second-path'); - $three->save(); - - /** @var \Drupal\redirect\RedirectRepository $repository */ - $repository = \Drupal::service('redirect.repository'); - $found = $repository->findMatchingRedirect('third-path'); - if (!empty($found)) { - $this->assertEqual($found->getRedirectUrl()->toString(), '/node', 'Chained redirects properly resolved in findMatchingRedirect.'); - } - else { - $this->fail('Failed to resolve a chained redirect.'); - } - - // Create a loop. - $one->setRedirect('third-path'); - $one->save(); - try { - $repository->findMatchingRedirect('third-path'); - $this->fail('Failed to detect a redirect loop.'); - } - catch (RedirectLoopException $e) { - $this->pass('Properly detected a redirect loop.'); - } - } - - /** - * Test redirect_parse_url(). - */ - public function testParseURL() { - //$test_cases = array( - // array( - // 'input' => array('b' => 'aa', 'c' => array('c2' => 'aa', 'c1' => 'aa'), 'a' => 'aa'), - // 'expected' => array('a' => 'aa', 'b' => 'aa', 'c' => array('c1' => 'aa', 'c2' => 'aa')), - // ), - //); - //foreach ($test_cases as $index => $test_case) { - // $output = redirect_parse_url($test_case['input']); - // $this->assertIdentical($output, $test_case['expected']); - //} - } - - /** - * Test multilingual redirects. - */ - public function testMultilanguageCases() { - // Add a redirect for english. - /** @var \Drupal\redirect\Entity\Redirect $en_redirect */ - $en_redirect = $this->controller->create(); - $en_redirect->setSource('langpath'); - $en_redirect->setRedirect('/about'); - $en_redirect->setLanguage('en'); - $en_redirect->save(); - - // Add a redirect for germany. - /** @var \Drupal\redirect\Entity\Redirect $en_redirect */ - $en_redirect = $this->controller->create(); - $en_redirect->setSource('langpath'); - $en_redirect->setRedirect('node'); - $en_redirect->setLanguage('de'); - $en_redirect->save(); - - // Check redirect for english. - /** @var \Drupal\redirect\RedirectRepository $repository */ - $repository = \Drupal::service('redirect.repository'); - - $found = $repository->findBySourcePath('langpath'); - if (!empty($found)) { - $this->assertEqual($found[1]->getRedirectUrl()->toString(), '/about', 'Multilingual redirect resolved properly.'); - $this->assertEqual($found[1]->get('language')[0]->value, 'en', 'Multilingual redirect resolved properly.'); - } - else { - $this->fail('Failed to resolve the multilingual redirect.'); - } - - // Check redirect for germany. - \Drupal::configFactory()->getEditable('system.site')->set('default_langcode', 'de')->save(); - /** @var \Drupal\redirect\RedirectRepository $repository */ - $repository = \Drupal::service('redirect.repository'); - $found = $repository->findBySourcePath('langpath'); - if (!empty($found)) { - $this->assertEqual($found[2]->getRedirectUrl()->toString(), '/node', 'Multilingual redirect resolved properly.'); - $this->assertEqual($found[2]->get('language')[0]->value, 'de', 'Multilingual redirect resolved properly.'); - } - else { - $this->fail('Failed to resolve the multilingual redirect.'); - } - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php deleted file mode 100644 index 8a5c593e6..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php +++ /dev/null @@ -1,54 +0,0 @@ - 'test', - 'source' => [ - 'plugin' => 'd7_path_redirect', - ], - ]; - - protected $expectedResults = [ - [ - 'rid' => 5, - 'hash' => 'MwmDbnA65ag646gtEdLqmAqTbF0qQerse63RkQmJK_Y', - 'type' => 'redirect', - 'uid' => 5, - 'source' => 'test/source/url', - 'source_options' => '', - 'redirect' => 'test/redirect/url', - 'redirect_options' => '', - 'language' => 'und', - 'status_code' => 301, - 'count' => 2518, - 'access' => 1449497138, - ], - ]; - - /** - * {@inheritdoc} - */ - protected function setUp() { - $this->databaseContents['variable'] = [ - [ - 'name' => 'redirect_default_status_code', - 'value' => 's:3:"307";', - ] - ]; - $this->databaseContents['redirect'] = $this->expectedResults; - parent::setUp(); - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php deleted file mode 100644 index 35f823323..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php +++ /dev/null @@ -1,155 +0,0 @@ - array('ignore_admin_path' => FALSE, 'access_check' => TRUE)); - - $state = $this->getMockBuilder('Drupal\Core\State\StateInterface') - ->getMock(); - $state->expects($this->any()) - ->method('get') - ->with('system.maintenance_mode') - ->will($this->returnValue(FALSE)); - $access = $this->getMockBuilder('Drupal\Core\Access\AccessManager') - ->disableOriginalConstructor() - ->getMock(); - $account = $this->getMockBuilder('Drupal\Core\Session\AccountInterface') - ->getMock(); - $route_provider = $this->getMockBuilder('Drupal\Core\Routing\RouteProviderInterface') - ->getMock(); - - $route = new Route('/example'); - $route_provider->expects($this->any()) - ->method('getRouteByName') - ->willReturn($route); - - $access->expects($this->any()) - ->method('checkNamedRoute') - ->willReturnMap([ - ['denied_route', [], $account, FALSE, FALSE], - ['allowed_route', [], $account, FALSE, TRUE], - ]); - - $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state, $access, $account, $route_provider); - - // All fine - we can redirect. - $request = $this->getRequestStub('index.php', 'GET'); - $this->assertTrue($checker->canRedirect($request), 'Can redirect'); - - // The script name is not index.php. - $request = $this->getRequestStub('statistics.php', 'GET'); - $this->assertFalse($checker->canRedirect($request), 'Cannot redirect script name not index.php'); - - // The request method is not GET. - $request = $this->getRequestStub('index.php', 'POST'); - $this->assertFalse($checker->canRedirect($request), 'Cannot redirect other than GET method'); - - - // Route access check, deny access. - $request = $this->getRequestStub('index.php', 'GET'); - $this->assertFalse($checker->canRedirect($request, 'denied_route'), 'Can not redirect'); - - // Route access check, allow access. - $request = $this->getRequestStub('index.php', 'GET'); - $this->assertTrue($checker->canRedirect($request, 'allowed_route'), 'Can redirect'); - - // Check destination parameter. - $request = $this->getRequestStub('index.php', 'GET', [], ['destination' => 'paradise']); - $this->assertFalse($checker->canRedirect($request), 'Cannot redirect'); - - // Maintenance mode is on. - $state = $this->getMockBuilder('Drupal\Core\State\StateInterface') - ->getMock(); - $state->expects($this->any()) - ->method('get') - ->with('system.maintenance_mode') - ->will($this->returnValue(TRUE)); - - $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state, $access, $account, $route_provider); - - $request = $this->getRequestStub('index.php', 'GET'); - $this->assertFalse($checker->canRedirect($request), 'Cannot redirect if maintenance mode is on'); - - // We are at a admin path. - $state = $this->getMockBuilder('Drupal\Core\State\StateInterface') - ->getMock(); - $state->expects($this->any()) - ->method('get') - ->with('system.maintenance_mode') - ->will($this->returnValue(FALSE)); - -// $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state); -// -// $route = $this->getMockBuilder('Symfony\Component\Routing\Route') -// ->disableOriginalConstructor() -// ->getMock(); -// $route->expects($this->any()) -// ->method('getOption') -// ->with('_admin_route') -// ->will($this->returnValue('system.admin_config_search')); -// -// $request = $this->getRequestStub('index.php', 'GET', -// array(RouteObjectInterface::ROUTE_OBJECT => $route)); -// $this->assertFalse($checker->canRedirect($request), 'Cannot redirect if we are requesting a admin path'); -// -// // We are at admin path with ignore_admin_path set to TRUE. -// $config['redirect.settings']['ignore_admin_path'] = TRUE; -// $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state); -// -// $request = $this->getRequestStub('index.php', 'GET', -// array(RouteObjectInterface::ROUTE_OBJECT => $route)); -// $this->assertTrue($checker->canRedirect($request), 'Can redirect a admin with ignore_admin_path set to TRUE'); - } - - /** - * Gets request mock object. - * - * @param string $script_name - * The result of the getScriptName() method. - * @param string $method - * The request method. - * @param array $attributes - * Attributes to be passed into request->attributes. - * @param array $query - * Query paramter to be passed into request->query. - * - * @return PHPUnit_Framework_MockObject_MockObject - * Mocked request object. - */ - protected function getRequestStub($script_name, $method, array $attributes = [], array $query = []) { - $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request') - ->disableOriginalConstructor() - ->getMock(); - $request->expects($this->any()) - ->method('getScriptName') - ->will($this->returnValue($script_name)); - $request->expects($this->any()) - ->method('isMethod') - ->with($this->anything()) - ->will($this->returnValue($method == 'GET')); - $request->query = new ParameterBag($query); - $request->attributes = new ParameterBag($attributes); - - return $request; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php deleted file mode 100644 index e664e95ba..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php +++ /dev/null @@ -1,301 +0,0 @@ -getMockBuilder('Drupal\Core\Url') - ->disableOriginalConstructor() - ->getMock(); - - $url->expects($this->once()) - ->method('setAbsolute') - ->with(TRUE) - ->willReturn($url); - - $url->expects($this->once()) - ->method('getOption') - ->with('query') - ->willReturn($redirect_query); - - $url->expects($this->once()) - ->method('setOption') - ->with('query', $final_query); - - $url->expects($this->once()) - ->method('toString') - ->willReturn($redirect_uri); - - $redirect = $this->getRedirectStub($url); - $event = $this->callOnKernelRequestCheckRedirect($redirect, $request_uri, $request_query, TRUE); - - $this->assertTrue($event->getResponse() instanceof RedirectResponse); - $response = $event->getResponse(); - $this->assertEquals('/test-path', $response->getTargetUrl()); - $this->assertEquals(301, $response->getStatusCode()); - $this->assertEquals(1, $response->headers->get('X-Redirect-ID')); - } - - /** - * @covers ::onKernelRequestCheckRedirect - * @dataProvider getRedirectData - */ - public function testRedirectLogicWithoutQueryRetaining($request_uri, $request_query, $redirect_uri) { - - $url = $this->getMockBuilder('Drupal\Core\Url') - ->disableOriginalConstructor() - ->getMock(); - - $url->expects($this->once()) - ->method('setAbsolute') - ->with(TRUE) - ->willReturn($url); - - // No query retaining, so getOption should not be called. - $url->expects($this->never()) - ->method('getOption'); - $url->expects($this->never()) - ->method('setOption'); - - $url->expects($this->once()) - ->method('toString') - ->willReturn($redirect_uri); - - $redirect = $this->getRedirectStub($url); - $event = $this->callOnKernelRequestCheckRedirect($redirect, $request_uri, $request_query, FALSE); - - $this->assertTrue($event->getResponse() instanceof RedirectResponse); - $response = $event->getResponse(); - $this->assertEquals($redirect_uri, $response->getTargetUrl()); - $this->assertEquals(301, $response->getStatusCode()); - $this->assertEquals(1, $response->headers->get('X-Redirect-ID')); - } - - /** - * Data provider for both tests. - */ - public function getRedirectData() { - return [ - ['non-existing', ['key' => 'val'], '/test-path', ['dummy' => 'value']], - ['non-existing/', ['key' => 'val'], '/test-path', ['dummy' => 'value']], - ['system/files/file.txt', [], '/test-path', []], - ]; - } - - /** - * Instantiates the subscriber and runs onKernelRequestCheckRedirect() - * - * @param $redirect - * The redirect entity. - * @param $request_uri - * The URI of the request. - * @param array $request_query - * The query that is supposed to come via request. - * @param bool $retain_query - * Flag if to retain the query through the redirect. - * - * @return \Symfony\Component\HttpKernel\Event\GetResponseEvent - * THe response event. - */ - protected function callOnKernelRequestCheckRedirect($redirect, $request_uri, $request_query, $retain_query) { - - $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query)); - $request = $event->getRequest(); - - $checker = $this->getMockBuilder('Drupal\redirect\RedirectChecker') - ->disableOriginalConstructor() - ->getMock(); - $checker->expects($this->any()) - ->method('canRedirect') - ->will($this->returnValue(TRUE)); - - $context = $this->getMock('Symfony\Component\Routing\RequestContext'); - - $inbound_path_processor = $this->getMockBuilder('Drupal\Core\PathProcessor\InboundPathProcessorInterface') - ->disableOriginalConstructor() - ->getMock(); - $inbound_path_processor->expects($this->any()) - ->method('processInbound') - ->with($request->getPathInfo(), $request) - ->willReturnCallback(function ($path, Request $request) { - if (strpos($path, '/system/files/') === 0 && !$request->query->has('file')) { - // Private files paths are split by the inbound path processor and the - // relative file path is moved to the 'file' query string parameter. - // This is because the route system does not allow an arbitrary amount - // of parameters. - // @see \Drupal\system\PathProcessor\PathProcessorFiles::processInbound() - $path = '/system/files'; - } - return $path; - }); - - $alias_manager = $this->getMockBuilder('Drupal\Core\Path\AliasManager') - ->disableOriginalConstructor() - ->getMock(); - $module_handler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface') - ->getMock(); - $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManagerInterface') - ->getMock(); - - $subscriber = new RedirectRequestSubscriber( - $this->getRedirectRepositoryStub('findMatchingRedirect', $redirect), - $this->getLanguageManagerStub(), - $this->getConfigFactoryStub(array('redirect.settings' => array('passthrough_querystring' => $retain_query))), - $alias_manager, - $module_handler, - $entity_manager, - $checker, - $context, - $inbound_path_processor - ); - - // Run the main redirect method. - $subscriber->onKernelRequestCheckRedirect($event); - return $event; - } - - /** - * Gets the redirect repository mock object. - * - * @param $method - * Method to mock - either load() or findMatchingRedirect(). - * @param $redirect - * The redirect object to be returned. - * - * @return PHPUnit_Framework_MockObject_MockObject - * The redirect repository. - */ - protected function getRedirectRepositoryStub($method, $redirect) { - $repository = $this->getMockBuilder('Drupal\redirect\RedirectRepository') - ->disableOriginalConstructor() - ->getMock(); - - if ($method === 'findMatchingRedirect') { - $repository->expects($this->any()) - ->method($method) - ->willReturnCallback(function ($source_path) use ($redirect) { - // No redirect with source path 'system/files' exists. The stored - // redirect has 'system/files/file.txt' as source path. - return $source_path === 'system/files' ? NULL : $redirect; - }); - } - else { - $repository->expects($this->any()) - ->method($method) - ->will($this->returnValue($redirect)); - } - - return $repository; - } - - /** - * Gets the redirect mock object. - * - * @param $url - * Url to be returned from getRedirectUrl - * @param int $status_code - * The redirect status code. - * - * @return PHPUnit_Framework_MockObject_MockObject - * The mocked redirect object. - */ - protected function getRedirectStub($url, $status_code = 301) { - $redirect = $this->getMockBuilder('Drupal\redirect\Entity\Redirect') - ->disableOriginalConstructor() - ->getMock(); - $redirect->expects($this->once()) - ->method('getRedirectUrl') - ->will($this->returnValue($url)); - $redirect->expects($this->any()) - ->method('getStatusCode') - ->will($this->returnValue($status_code)); - $redirect->expects($this->any()) - ->method('id') - ->willReturn(1); - $redirect->expects($this->once()) - ->method('getCacheTags') - ->willReturn(['redirect:1']); - - return $redirect; - } - - /** - * Gets post response event. - * - * @param array $headers - * Headers to be set into the response. - * - * @return \Symfony\Component\HttpKernel\Event\PostResponseEvent - * The post response event object. - */ - protected function getPostResponseEvent($headers = array()) { - $http_kernel = $this->getMockBuilder('\Symfony\Component\HttpKernel\HttpKernelInterface') - ->getMock(); - $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request') - ->disableOriginalConstructor() - ->getMock(); - - $response = new Response('', 301, $headers); - - return new PostResponseEvent($http_kernel, $request, $response); - } - - /** - * Gets response event object. - * - * @param $path_info - * @param $query_string - * - * @return GetResponseEvent - */ - protected function getGetResponseEventStub($path_info, $query_string) { - $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], ['SCRIPT_NAME' => 'index.php']); - - $http_kernel = $this->getMockBuilder('\Symfony\Component\HttpKernel\HttpKernelInterface') - ->getMock(); - return new GetResponseEvent($http_kernel, $request, 'test'); - } - - /** - * Gets the language manager mock object. - * - * @return \Drupal\language\ConfigurableLanguageManagerInterface|PHPUnit_Framework_MockObject_MockObject - */ - protected function getLanguageManagerStub() { - $language_manager = $this->getMockBuilder('Drupal\language\ConfigurableLanguageManagerInterface') - ->getMock(); - $language_manager->expects($this->any()) - ->method('getCurrentLanguage') - ->will($this->returnValue(new Language(array('id' => 'en')))); - - return $language_manager; - } - -} diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php deleted file mode 100644 index 87d3c3135..000000000 --- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php +++ /dev/null @@ -1,225 +0,0 @@ -getMock('\Drupal\Core\PageCache\ResponsePolicy\KillSwitch'); - $kill_switch->expects($this->any()) - ->method('trigger') - ->withAnyParameters() - ->will($this->returnValue(NULL)); - $container = new ContainerBuilder(); - $container->set('page_cache_kill_switch', $kill_switch); - \Drupal::setContainer($container); - } - - /** - * @covers ::onKernelRequestRedirect - */ - public function testSkipIfFlagNotEnabled() { - $request_uri = 'https://example.com/route-to-normalize'; - $request_query = []; - - $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query)); - // We set 'route_normalizer_enabled' config to FALSE and expect to leave onKernelRequestRedirect at the beginning, - // i.e. $this->redirectChecker->canRedirect($request) should never be called. - $subscriber = $this->getSubscriber($request_uri, FALSE, FALSE); - $subscriber->onKernelRequestRedirect($event); - } - - /** - * @covers ::onKernelRequestRedirect - */ - public function testSkipIfSubRequest() { - $request_uri = 'https://example.com/route-to-normalize'; - $request_query = []; - - $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query), HttpKernelInterface::SUB_REQUEST); - // We are using SUB_REQUEST as the request type and expect to leave onKernelRequestRedirect at the beginning, - // i.e. $this->redirectChecker->canRedirect($request) should never be called. - $subscriber = $this->getSubscriber($request_uri, TRUE, FALSE); - $subscriber->onKernelRequestRedirect($event); - } - - /** - * @covers ::onKernelRequestRedirect - */ - public function testSkipIfRequestAttribute() { - $request_uri = 'https://example.com/route-to-normalize'; - $request_query = []; - - $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query), HttpKernelInterface::MASTER_REQUEST, TRUE); - // We set '_disable_route_normalizer' as a request attribute and expect to leave onKernelRequestRedirect at the beginning, - // i.e. $this->redirectChecker->canRedirect($request) should never be called. - $subscriber = $this->getSubscriber($request_uri, TRUE, FALSE); - $subscriber->onKernelRequestRedirect($event); - } - - /** - * @covers ::onKernelRequestRedirect - * @dataProvider getTestUrls - */ - public function testOnKernelRequestRedirect($request_uri, $request_query, $expected, $expect_normalization) { - $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query)); - $subscriber = $this->getSubscriber($request_uri); - $subscriber->onKernelRequestRedirect($event); - - if ($expect_normalization) { - $response = $event->getResponse(); - $this->assertEquals($expected, $response->getTargetUrl()); - } - } - - /** - * Data provider for testOnKernelRequestRedirect(). - */ - public function getTestUrls() { - return [ - ['https://example.com/route-to-normalize', [], 'https://example.com/route-to-normalize', FALSE], - ['https://example.com/route-to-normalize', ['key' => 'value'], 'https://example.com/route-to-normalize?key=value', FALSE], - ['https://example.com/index.php/', ['q' => 'node/1'], 'https://example.com/?q=node/1', TRUE], - ]; - } - - /** - * Create a RouteNormalizerRequestSubscriber object. - * - * @param string $request_uri - * The return value for the generateFromRoute method. - * @param bool $enabled - * Flag indicating if the normalizer shoud be enabled. - * @param bool $call_expected - * If true, canRedirect() and other methods should be called once. - * - * @return \Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber - */ - protected function getSubscriber($request_uri, $enabled = TRUE, $call_expected = TRUE) { - return new RouteNormalizerRequestSubscriber( - $this->getUrlGeneratorStub($request_uri, $call_expected), - $this->getPathMatcherStub($call_expected), - $this->getConfigFactoryStub([ - 'redirect.settings' => [ - 'route_normalizer_enabled' => $enabled, - 'default_status_code' => 301, - ], - ]), - $this->getRedirectCheckerStub($call_expected) - ); - } - - /** - * Gets the UrlGenerator mock object. - * - * @param string $request_uri - * The return value for the generateFromRoute method. - * @param bool $call_expected - * If true, we expect generateFromRoute() to be called once. - * - * @return \Drupal\Core\Routing\UrlGeneratorInterface|PHPUnit_Framework_MockObject_MockObject - */ - protected function getUrlGeneratorStub($request_uri, $call_expected = TRUE) { - $url_generator = $this->getMockBuilder('\Drupal\Core\Routing\UrlGeneratorInterface') - ->getMock(); - - $options = ['absolute' => TRUE]; - - $expectation = $call_expected ? $this->once() : $this->never(); - - $url_generator->expects($expectation) - ->method('generateFromRoute') - ->with('', [], $options) - ->willReturn($request_uri); - return $url_generator; - } - - /** - * Gets the PathMatcher mock object. - * - * @param bool $call_expected - * If true, we expect isFrontPage() to be called once. - * - * @return \Drupal\Core\Path\PathMatcherInterface|PHPUnit_Framework_MockObject_MockObject - */ - protected function getPathMatcherStub($call_expected = TRUE) { - $path_matcher = $this->getMockBuilder('\Drupal\Core\Path\PathMatcherInterface') - ->getMock(); - - $expectation = $call_expected ? $this->once() : $this->never(); - - $path_matcher->expects($expectation) - ->method('isFrontPage') - ->withAnyParameters() - ->willReturn(FALSE); - return $path_matcher; - } - - /** - * Gets the RedirectChecker mock object. - * - * @param bool $call_expected - * If true, we expect canRedirect() to be called once. - * - * @return \Drupal\redirect\RedirectChecker|PHPUnit_Framework_MockObject_MockObject - */ - protected function getRedirectCheckerStub($call_expected = TRUE) { - $redirect_checker = $this->getMockBuilder('\Drupal\redirect\RedirectChecker') - ->disableOriginalConstructor() - ->getMock(); - - $expectation = $call_expected ? $this->once() : $this->never(); - - $redirect_checker->expects($expectation) - ->method('canRedirect') - ->withAnyParameters() - ->willReturn(TRUE); - return $redirect_checker; - } - - /** - * Returns a GET response event object. - * - * @param string $path_info - * The path of the request. - * @param array $query_string - * The query string of the request. - * @param int $request_type - * The request type of the request. - * @param bool $set_request_attribute - * If true, the request attribute '_disable_route_normalizer' will be set. - * - * @return \Symfony\Component\HttpKernel\Event\GetResponseEvent - */ - protected function getGetResponseEventStub($path_info, $query_string, $request_type = HttpKernelInterface::MASTER_REQUEST, $set_request_attribute = FALSE) { - $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], ['SCRIPT_NAME' => 'index.php', 'SCRIPT_FILENAME' => 'index.php']); - - if ($set_request_attribute === TRUE) { - $request->attributes->add(['_disable_route_normalizer' => TRUE]); - } - - $http_kernel = $this->getMockBuilder('\Symfony\Component\HttpKernel\HttpKernelInterface') - ->getMock(); - return new GetResponseEvent($http_kernel, $request, $request_type); - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt b/sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/simple_sitemap/README.md b/sites/all/modules/contrib/admin/simple_sitemap/README.md deleted file mode 100644 index 5d10a8644..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/README.md +++ /dev/null @@ -1,249 +0,0 @@ -## CONTENTS OF THIS FILE ## - - * Introduction - * Installation - * Configuration - * Usage - * Extending the module - * How Can You Contribute? - * Maintainers - -## INTRODUCTION ## - -Author and maintainer: Pawel Ginalski (gbyte.co) - * Drupal: https://www.drupal.org/u/gbyte.co - * Personal: https://gbyte.co/ - -The module generates multilingual XML sitemaps which adhere to Google's new -hreflang standard. Out of the box the sitemaps index most of Drupal's -content entity types including: - - * nodes - * taxonomy terms - * menu links - * users - * ... - -Contributed entity types like commerce products or media entities can be indexed -as well. On top of that custom links can be added to the sitemap. - -To learn about XML sitemaps, see https://en.wikipedia.org/wiki/Sitemaps. - -The module also provides an API allowing to create any type of sitemap (not -necessary an XML one) holding links to a local or remote source. - -## INSTALLATION ## - -See https://www.drupal.org/documentation/install/modules-themes/modules-8 -for instructions on how to install or update Drupal modules. - -## CONFIGURATION ## - -### PERMISSIONS ### - -The module permission 'administer sitemap settings' can be configured under -/admin/people/permissions. - -### ENTITIES ### - -Initially only the home page is indexed in the sitemap. To include content into -the sitemap, visit /admin/config/search/simplesitemap/entities to enable support -for entity types of your choosing. Entity types which feature bundles can then -be configured on a per-bundle basis, e.g. - - * /admin/structure/types/manage/[content type] for nodes - * /admin/structure/taxonomy/manage/[taxonomy vocabulary] for taxonomy terms - * /admin/structure/menu/manage/[menu] for menu items - * ... - -When including an entity type or bundle into the sitemap, the priority setting -can be set which will set the 'priority' parameter for all entities of that -type. Same goes for the 'changefreq' setting. All Images referenced by the -entities can be indexed as well. See https://en.wikipedia.org/wiki/Sitemaps to -learn more about these parameters. - -Inclusion settings of bundles can be overridden on a per-entity -basis. Just head over to a bundle instance edit form (e.g. node/1/edit) to -override its sitemap settings. - -If you wish for the sitemap to reflect the new configuration instantly, check -'Regenerate sitemaps after clicking save'. This setting only appears if a change -in the settings has been detected. - -As the sitemap is accessible to anonymous users, bear in mind that only links -will be included which are accessible to anonymous users. There are no access -checks for links added through the module's hooks (see below). - -### CUSTOM LINKS ### - -To include custom links into the sitemap, visit -/admin/config/search/simplesitemap/custom. - -### SETTINGS ### - -The settings page can be found under admin/config/search/simplesitemap. -Here the module can be configured and the sitemaps can be manually regenerated. - -#### VARIANTS #### - -It is possible to have several sitemap instances of different sitemap types with -specific links accessible under certain URLs. These sitemap variants can be -configured under admin/config/search/simplesitemap/variants. - -## USAGE ## - -The sitemaps are accessible to the whole world under [variant name]/sitemap.xml. -In addition to that, the default sitemap is accessible under /sitemap.xml. - -If the cron generation is turned on, the sitemaps will be regenerated according -to the 'Sitemap generation interval' setting. - -A manual generation is possible on admin/config/search/simplesitemap. This is -also the place that shows the overall and variant specific generation status. - -The sitemap can be also generated via drush: Use the command -'drush simple-sitemap:generate' ('ssg'), or 'drush simple-sitemap:rebuild-queue' -('ssr'). - -Generation of hundreds of thousands of links can take time. Each variant gets -published as soon as all of its links have been generated. The previous version -of the sitemap variant is accessible during the generation process. - -## EXTENDING THE MODULE ## - -### API ### - -There are API methods for altering stored inclusion settings, status queries and -programmatic sitemap generation. These include: - - * getSetting - * saveSetting - * setVariants - * getSitemap - * removeSitemap - * generateSitemap - * rebuildQueue - * enableEntityType - * disableEntityType - * setBundleSettings - * getBundleSettings - * removeBundleSettings - * supplementDefaultSettings - * setEntityInstanceSettings - * getEntityInstanceSettings - * removeEntityInstanceSettings - * bundleIsIndexed - * entityTypeIsEnabled - * addCustomLink - * getCustomLinks - * removeCustomLinks - * getSitemapManager - * getSitemapVariants - * addSitemapVariant - * removeSitemapVariants - * getQueueWorker - * deleteQueue - * rebuildQueue - * getInitialElementCount - * getQueuedElementCount - * getStashedResultCount - * getProcessedElementCount - * generationInProgress - - -These service methods can be chained like so: - -```php -$generator = \Drupal::service('simple_sitemap.generator'); - -$generator - ->getSitemapManager() - ->addSitemapVariant('test'); - -$generator - ->saveSetting('remove_duplicates', TRUE) - ->enableEntityType('node') - ->setVariants(['default', 'test']) - ->setBundleSettings('node', 'page', ['index' => TRUE, 'priority' = 0.5]) - ->removeCustomLinks() - ->addCustomLink('/some/view/page', ['priority' = 0.5]) - ->generateSitemap(); -``` - -See https://gbyte.co/projects/simple-xml-sitemap and code documentation in -Drupal\simple_sitemap\Simplesitemap for further details. - -### API HOOKS ### - -It is possible to hook into link generation by implementing -`hook_simple_sitemap_links_alter(&$links){}` in a custom module and altering the -link array shortly before it is transformed to XML. - -Adding arbitrary links is possible through the use of -`hook_simple_sitemap_arbitrary_links_alter(&$arbitrary_links){}`. There are no -checks performed on these links (i.e. if they are internal/valid/accessible) -and parameters like priority/lastmod/changefreq have to be added manually. - -Altering sitemap attributes and sitemap index attributes is possible through the -use of `hook_simple_sitemap_attributes_alter(&$attributes){}` and -`hook_simple_sitemap_index_attributes_alter(&$index_attributes){}`. - -Altering URL generators is possible through -the use of `hook_simple_sitemap_url_generators_alter(&$generators){}`. - -Altering sitemap generators is possible through -the use of `hook_simple_sitemap_sitemap_generators_alter(&$generators){}`. - -Altering sitemap types is possible through -the use of `hook_simple_sitemap_sitemap_types_alter(&$generators){}`. - -### WRITING PLUGINS ### - -There are three types of plugins that allow to create any type of sitemap. See -the generator plugins included in this module and check the API docs -(https://www.drupal.org/docs/8/api/plugin-api/plugin-api-overview) to learn how -to implement plugins. - -#### SITEMAP TYPE PLUGINS #### - -This plugin defines a sitemap type. A sitemap type consists of a sitemap -generator and several URL generators. This plugin is very simple, as it -only requires some class annotation to define which sitemap/URL plugins to use. - -#### SITEMAP GENERATOR PLUGINS #### - -This plugin defines how a sitemap type is supposed to look. It handles all -aspects of the sitemap except its links/URLs. - -#### URL GENERATOR PLUGINS #### - -This plugin defines a way of generating URLs for one or more sitemap types. - -Note: -Overwriting the default EntityUrlGenerator for a single entity type is possible -through the flag "overrides_entity_type" = "[entity_type_to_be_overwritten]" in -the settings array of the new generator plugin's annotation. See how the -EntityUrlGenerator is overwritten by the EntityMenuLinkContentUrlGenerator to -facilitate a different logic for menu links. - -See https://gbyte.co/projects/simple-xml-sitemap for further details. - -## HOW CAN YOU CONTRIBUTE? ## - - * Report any bugs, feature or support requests in the issue tracker; if - possible help out by submitting patches. - http://drupal.org/project/issues/simple_sitemap - - * Do you know a non-English language? Help translating the module. - https://localize.drupal.org/translate/projects/simple_sitemap - - * If you would like to say thanks and support the development of this module, a - donation will be much appreciated. - https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5AFYRSBLGSC3W - - * Feel free to contact me for paid support: https://gbyte.co/contact - -## MAINTAINERS ## - -Current maintainers: - * Pawel Ginalski (gbyte.co) - https://www.drupal.org/u/gbyte.co diff --git a/sites/all/modules/contrib/admin/simple_sitemap/composer.json b/sites/all/modules/contrib/admin/simple_sitemap/composer.json deleted file mode 100644 index f8c19b934..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "drupal/simple_sitemap", - "description": "Creates a standard conform hreflang XML sitemap of the site content and provides a framework for developing other sitemap types.", - "type": "drupal-module", - "homepage": "https://drupal.org/project/simple_sitemap", - "authors": [ - { - "name": "Pawel Ginalski (gbyte.co)", - "email": "contact@gbyte.co", - "homepage": "https://www.drupal.org/u/gbyte.co", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://drupal.org/project/issues/simple_sitemap", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "https://cgit.drupalcode.org/simple_sitemap" - }, - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": { - "ext-xmlwriter": "*" - }, - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} - diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml deleted file mode 100644 index b74e96a0f..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml +++ /dev/null @@ -1,5 +0,0 @@ -links: - - - path: '/' - priority: '1.0' - changefreq: 'daily' diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml deleted file mode 100644 index 1d4c8e0bb..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml +++ /dev/null @@ -1,14 +0,0 @@ -max_links: 2000 -cron_generate: true -cron_generate_interval: 0 -generate_duration: 10000 -remove_duplicates: true -skip_untranslated: true -base_url: '' -default_variant: 'default' -custom_links_include_images: false -excluded_languages: [] -enabled_entity_types: - - 'node' - - 'taxonomy_term' - - 'menu_link_content' diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml deleted file mode 100644 index fd7847d28..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml +++ /dev/null @@ -1,4 +0,0 @@ -variants: - default: - label: 'Default' - weight: 0 diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml deleted file mode 100644 index 9fd771245..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml +++ /dev/null @@ -1,94 +0,0 @@ -simple_sitemap.settings: - type: config_object - mapping: - max_links: - label: 'Max links' - type: integer - cron_generate: - label: 'Cron generation' - type: boolean - cron_generate_interval: - label: 'Cron generation interval' - type: integer - generate_duration: - label: 'Generation duration' - type: integer - remove_duplicates: - label: 'Remove duplicates' - type: boolean - skip_untranslated: - label: 'Skip untranslated' - type: boolean - base_url: - label: 'Base URL' - type: string - default_variant: - label: 'Default variant' - type: string - custom_links_include_images: - label: 'Include images of custom links' - type: boolean - excluded_languages: - label: 'Excluded languages' - type: sequence - sequence: - type: string - enabled_entity_types: - label: 'Enabled entity types' - type: sequence - sequence: - type: string - -simple_sitemap.bundle_settings.*.*.*: - label: 'Entity bundle settings' - type: config_object - mapping: - index: - label: 'Index' - type: boolean - priority: - label: 'Priority' - type: string - changefreq: - label: 'Change frequency' - type: string - include_images: - label: 'Include images' - type: boolean - -simple_sitemap.custom_links.*: - label: 'Custom links' - type: config_object - mapping: - links: - label: 'Custom links' - type: sequence - sequence: - type: mapping - mapping: - path: - label: 'Path' - type: string - priority: - label: 'Priority' - type: string - changefreq: - label: 'Change frequency' - type: string - -simple_sitemap.variants.*: - label: 'Sitemap variants' - type: config_object - mapping: - variants: - label: 'Sitemap variants' - type: sequence - sequence: - type: mapping - mapping: - label: - label: 'Variant label' - type: string - weight: - label: 'Weight' - type: integer diff --git a/sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml b/sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml deleted file mode 100644 index d2c7a6946..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - simple_sitemap.commands: - class: \Drupal\simple_sitemap\Commands\SimplesitemapCommands - arguments: - - '@simple_sitemap.generator' - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js b/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js deleted file mode 100644 index 1963294aa..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @file - * Attaches simple_sitemap behaviors to the entity form. - */ -(function($) { - - "use strict"; - - Drupal.behaviors.simple_sitemapFieldsetSummaries = { - attach: function(context) { - $(context).find('#edit-simple-sitemap').drupalSetSummary(function(context) { - var vals = []; - if ($(context).find('#edit-simple-sitemap-index-content-1').is(':checked')) { - vals.push(Drupal.t('Included in sitemap')); - vals.push(Drupal.t('Variant') + ': ' + $('#edit-simple-sitemap-variant option:selected', context).text()); - vals.push(Drupal.t('Priority') + ': ' + $('#edit-simple-sitemap-priority option:selected', context).text()); - vals.push(Drupal.t('Change frequency') + ': ' + $('#edit-simple-sitemap-changefreq option:selected', context).text()); - vals.push(Drupal.t('Include images') + ': ' + $('#edit-simple-sitemap-include-images option:selected', context).text()); - } - else { - vals.push(Drupal.t('Excluded from sitemap')); - } - return vals.join('
'); - }); - } - }; -})(jQuery); diff --git a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js b/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js deleted file mode 100644 index d4f24fa4b..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @file - * Attaches simple_sitemap behaviors to the entity form. - */ -(function($) { - - "use strict"; - - Drupal.behaviors.simple_sitemapForm = { - attach: function(context) { - - // On load: Hide the 'Regenerate sitemap' field to only display it if settings have changed. - $('.form-item-simple-sitemap-regenerate-now').hide(); - - // Show 'Regenerate sitemap' field if settings have changed. - $("#edit-simple-sitemap-index-content" - + ", #edit-simple-sitemap-variant" - + ", #edit-simple-sitemap-priority" - + ", #edit-simple-sitemap-changefreq" - + ", #edit-simple-sitemap-include-images" - ).change(function() { - $('.form-item-simple-sitemap-regenerate-now').show(); - }); - } - }; -})(jQuery); diff --git a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js b/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js deleted file mode 100644 index abfe5fb1f..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file - * Attaches simple_sitemap behaviors to the sitemap entities form. - */ -(function($) { - - "use strict"; - - Drupal.behaviors.simple_sitemapSitemapEntities = { - attach: function(context, settings) { - var allEntities = settings.simple_sitemap.all_entities; - var atomicEntities = settings.simple_sitemap.atomic_entities; - - // Hide the 'Regenerate sitemap' field to only display it if settings have changed. - $('.form-item-simple-sitemap-regenerate-now').hide(); - - $.each(allEntities, function(index, value) { - - // On load: hide all warning messages. - $('#warning-' + value).hide(); - - // On change: Show or hide warning message dependent on 'enabled' checkbox. - var enabledId = '#edit-' + value + '-enabled'; - $(enabledId).change(function() { - if ($(enabledId).is(':checked')) { - $('#warning-' + value).hide(); - $('#indexed-bundles-' + value).show(); - } - else { - $('#warning-' + value).show(); - $('#indexed-bundles-' + value).hide(); - } - - // Show 'Regenerate sitemap' field if 'enabled' setting has changed. - $('.form-item-simple-sitemap-regenerate-now').show(); - }); - }); - - // todo - // Show 'Regenerate sitemap' field if settings have changed. - // $.each(atomicEntities, function(index, value) { - // var variant = '.form-item-' + value + '-simple-sitemap-variant'; - // var priorityId = '.form-item-' + value + '-simple-sitemap-priority'; - // var changefreqId = '.form-item-' + value + '-simple-sitemap-changefreq'; - // var includeImagesId = '.form-item-' + value + '-simple-sitemap-include-images'; - // - // $(variant, priorityId, changefreqId, includeImagesId).change(function() { - // $('.form-item-simple-sitemap-regenerate-now').show(); - // }); - // }); - } - }; -})(jQuery); diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php deleted file mode 100644 index 55936bf83..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php +++ /dev/null @@ -1,142 +0,0 @@ - $link) { - if ($link['path'] === 'node/1') { - - // Remove 'loc' URL if it points to a german site. - if ($link['langcode'] === 'de') { - unset($links[$key]); - } - - // If this 'loc' URL points to a non-german site, make sure to remove - // its german alternate URL. - else { - if ($link['alternate_urls']['de']) { - unset($links[$key]['alternate_urls']['de']); - } - } - } - } -} - -/** - * Add arbitrary links to the sitemap. - * - * @param array &$arbitrary_links - * @param string|null $sitemap_variant - */ -function hook_simple_sitemap_arbitrary_links_alter(array &$arbitrary_links, $sitemap_variant) { - - // Add an arbitrary link to all sitemap variants. - $arbitrary_links[] = [ - 'url' => 'http://some-arbitrary-link/', - 'priority' => '0.5', - - // An ISO8601 formatted date. - 'lastmod' => '2012-10-12T17:40:30+02:00', - - 'changefreq' => 'weekly', - 'images' => [ - ['path' => 'http://path-to-image.png'] - ], - - // Add alternate URLs for every language of a multilingual site. - // Not necessary for monolingual sites. - 'alternate_urls' => [ - 'en' => 'http://this-is-your-life.net/de/tyler', - 'de' => 'http://this-is-your-life.net/en/tyler', - ] - ]; - - // Add an arbitrary link to the 'fight_club' sitemap variant only. - switch ($sitemap_variant) { - case 'fight_club': - $arbitrary_links[] = [ - 'url' => 'http://this-is-your-life.net/tyler', - ]; - break; - } -} - -/** - * Alters the sitemap attributes shortly before XML document generation. - * Attributes can be added, changed and removed. - * - * @param array &$attributes - * @param string|null $sitemap_variant - */ -function hook_simple_sitemap_attributes_alter(array &$attributes, $sitemap_variant) { - - // Remove the xhtml attribute e.g. if no xhtml sitemap elements are present. - unset($attributes['xmlns:xhtml']); -} - -/** - * Alters attributes of the sitemap index shortly before XML document generation. - * Attributes can be added, changed and removed. - * - * @param array &$index_attributes - * @param string|null $sitemap_variant - */ -function hook_simple_sitemap_index_attributes_alter(array &$index_attributes, $sitemap_variant) { - - // Add some attribute to the sitemap index. - $index_attributes['name'] = 'value'; -} - -/** - * Alter properties of and remove URL generator plugins. - * - * @param array $url_generators - */ -function hook_simple_sitemap_url_generators_alter(array &$url_generators) { - - // Remove the entity generator. - unset($url_generators['entity']); -} - -/** - * Alter properties of and remove sitemap generator plugins. - * - * @param array $sitemap_generators - */ -function hook_simple_sitemap_sitemap_generators_alter(array &$sitemap_generators) { - - // Remove the default generator. - unset($sitemap_generators['default']); -} - -/** - * Alter properties of and remove sitemap type plugins. - * - * @param array $sitemap_types - */ -function hook_simple_sitemap_sitemap_types_alter(array &$sitemap_types) { - -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc deleted file mode 100644 index 72a6d3bf5..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc +++ /dev/null @@ -1,45 +0,0 @@ - 'Regenerate the XML sitemaps according to the module settings.', - 'callback' => 'drush_simple_sitemap_generate', - 'drupal dependencies' => ['simple_sitemap'], - 'aliases' => ['ssg'], - ]; - - $items['simple-sitemap-rebuild-queue'] = [ - 'description' => 'Rebuild the sitemap queue for all sitemap variants.', - 'callback' => 'drush_simple_sitemap_rebuild_queue', - 'drupal dependencies' => ['simple_sitemap'], - 'aliases' => ['ssr'], - ]; - - return $items; -} - -/** - * Callback function for hook_drush_command(). - * - * Regenerate the XML sitemaps according to the module settings. - */ -function drush_simple_sitemap_generate() { - \Drupal::service('simple_sitemap.generator')->generateSitemap('drush'); -} - -/** - * Callback function for hook_drush_command(). - * - * Rebuild the sitemap queue for all sitemap variants. - */ -function drush_simple_sitemap_rebuild_queue() { - \Drupal::service('simple_sitemap.generator')->rebuildQueue(); -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml deleted file mode 100644 index 262e0bcfb..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: 'Simple XML Sitemap' -type: module -description: 'Creates a standard conform hreflang XML sitemap of the site content and provides a framework for developing other sitemap types.' -configure: simple_sitemap.settings -package: SEO -# core: 8.x - -# Information added by Drupal.org packaging script on 2018-12-07 -version: '8.x-3.0' -core: '8.x' -project: 'simple_sitemap' -datestamp: 1544174900 diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install deleted file mode 100644 index 33e1c1393..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install +++ /dev/null @@ -1,678 +0,0 @@ - t('Simple XML sitemap PHP extensions'), - 'value' => t('Missing PHP xmlwriter extension'), - 'description' => t('In order to be able to generate sitemaps, the Simple XML sitemap module requires the xmlwriter PHP extension to be enabled.'), - 'severity' => REQUIREMENT_ERROR, - ]; - } - - switch ($phase) { - - case 'runtime': - - // todo Implement for 3.x -// /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ -// $generator = \Drupal::service('simple_sitemap.generator'); -// $generated_ago = $generator->getGeneratedAgo(); -// $cron_generation = $generator->getSetting('cron_generate'); -// -// if (!$generated_ago) { -// $value = t('Not available'); -// $description = t($cron_generation -// ? 'Run cron, or generate the sitemap manually.' -// : 'Generation on cron run is disabled. Generate the sitemap manually.', [ -// '@generate' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap' -// ] -// ); -// $severity = REQUIREMENT_WARNING; -// } -// else { -// $value = t('XML sitemaps are available'); -// $description = t('The last generation finished @ago ago.' -// . ' ' . ($cron_generation -// ? 'Run cron, or regenerate the sitemaps manually.' -// : 'Generation on cron run is disabled. Regenerate the sitemaps manually.'), [ -// '@ago' => $generated_ago, -// '@generate' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap' -// ] -// ); -// $severity = REQUIREMENT_INFO; -// } -// -// $requirements['simple_sitemap_generated'] = [ -// 'title' => 'Simple XML sitemap', -// 'value' => $value, -// 'description' => $description, -// 'severity' => $severity, -// ]; - break; - } - return $requirements; -} - -/** - * Implements hook_uninstall(). - */ -function simple_sitemap_uninstall() { - \Drupal::service('state')->deleteMultiple([ - 'simple_sitemap.last_cron_generate', - 'simple_sitemap.queue_items_initial_amount', - 'simple_sitemap.queue_stashed_results', - ]); - - \Drupal::service('queue') - ->get('simple_sitemap_elements') - ->deleteQueue(); -} - -/** - * Implements hook_schema(). - */ -function simple_sitemap_schema() { - $schema['simple_sitemap'] = [ - 'description' => 'Holds XML sitemaps as strings for quick retrieval.', - 'fields' => [ - 'id' => [ - 'description' => 'Sitemap chunk unique identifier.', - 'type' => 'int', - 'size' => 'small', - 'not null' => TRUE, - 'unsigned' => TRUE, - ], - 'type' => [ - 'description' => 'Type of sitemap this chunk belongs to.', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - 'default' => '', - ], - 'delta' => [ - 'description' => 'Delta of the chunk within the type scope.', - 'type' => 'int', - 'size' => 'small', - 'not null' => TRUE, - 'unsigned' => TRUE, - ], - 'sitemap_string' => [ - 'description' => 'XML sitemap chunk string.', - 'type' => 'text', - 'size' => 'big', - 'not null' => TRUE, - ], - 'sitemap_created' => [ - 'description' => 'Timestamp of sitemap chunk generation.', - 'type' => 'int', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'default' => 0, - ], - 'status' => [ - 'description' => "Flag indicating the publishing status of the chunk.", - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'default' => 0, - ], - ], - 'primary key' => ['id'], - ]; - - $schema['simple_sitemap_entity_overrides'] = [ - 'description' => 'Holds sitemap settings overridden by entities.', - 'fields' => [ - 'id' => [ - 'description' => 'Override unique identifier.', - 'type' => 'serial', - 'not null' => TRUE, - 'unsigned' => TRUE, - ], - 'type' => [ - 'description' => 'Type of sitemap this override belongs to.', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - ], - 'entity_type' => [ - 'description' => 'Entity type of the overriding entity.', - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - ], - 'entity_id' => [ - 'description' => 'ID of the overriding entity.', - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - ], - 'inclusion_settings' => [ - 'description' => 'Setting for the overriding entity.', - 'type' => 'blob', - ], - ], - 'primary key' => ['id'], - ]; - return $schema; -} - -function _simple_sitemap_update_8216_get_default_variant() { - $config_factory = \Drupal::service('config.factory'); - $default_variant = $config_factory->get('simple_sitemap.settings')->get('default_variant'); - if (empty($default_variant)) { - $default_variant = 'default'; - $config_factory->getEditable('simple_sitemap.settings') - ->set('default_variant', $default_variant) - ->save(); - } - - /** @var \Drupal\simple_sitemap\SimplesitemapManager $manager */ - $manager = \Drupal::service('simple_sitemap.manager'); - $variants = $manager->getSitemapVariants(); - if (!isset($variants[$default_variant])) { - $manager->addSitemapVariant($default_variant); - } - - return $default_variant; -} - -/** - * Changing the data structure of the module's configuration. - */ -function simple_sitemap_update_8201() { - $entity_types = \Drupal::config('simple_sitemap.settings')->get('entity_types'); - $entity_types = is_array($entity_types) ? $entity_types : []; - $naming_changes = [ - 'node_type' => 'node', - 'taxonomy_vocabulary' => 'taxonomy_term', - 'menu' => 'menu_link_content', - 'commerce_product_type' => 'commerce_product', - 'media_bundle' => 'media', - ]; - foreach ($entity_types as $entity_type_name => $settings) { - if (isset($naming_changes[$entity_type_name])) { - $entity_types[$naming_changes[$entity_type_name]] = $entity_types[$entity_type_name]; - unset($entity_types[$entity_type_name]); - } - } - \Drupal::service('config.factory')->getEditable('simple_sitemap.settings') - ->set('entity_types', $entity_types)->save(); -} - -/** - * Moving entity overrides from configuration to database table. - */ -function simple_sitemap_update_8202() { - $database = \Drupal::database(); - - // Create database table. - if (!$database->schema()->tableExists('simple_sitemap_entity_overrides')) { - $database->schema()->createTable('simple_sitemap_entity_overrides', [ - 'description' => 'Holds sitemap settings overridden by entities.', - 'fields' => [ - 'id' => [ - 'description' => 'Override unique identifier.', - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'entity_type' => [ - 'description' => 'Entity type of the overriding entity.', - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - ], - 'entity_id' => [ - 'description' => 'ID of the overriding entity.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'inclusion_settings' => [ - 'description' => 'Setting for the overriding entity.', - 'type' => 'blob', - ], - ], - 'primary key' => ['id'], - ]); - } - - // Populate database table with config values. - $entity_types = \Drupal::config('simple_sitemap.settings')->get('entity_types'); - $entity_types = is_array($entity_types) ? $entity_types : []; - - foreach ($entity_types as $entity_type_name => &$entity_type) { - if (is_array($entity_type)) { - foreach ($entity_type as $bundle_name => &$bundle) { - if (isset($bundle['entities'])) { - foreach ($bundle['entities'] as $entity_id => $entity_settings) { - $database->insert('simple_sitemap_entity_overrides') - ->fields([ - 'entity_type' => $entity_type_name, - 'entity_id' => $entity_id, - 'inclusion_settings' => serialize($entity_settings), - ]) - ->execute(); - } - // Remove entity overrides from configuration. - unset($bundle['entities']); - } - } - } - } - - \Drupal::service('config.factory')->getEditable('simple_sitemap.settings') - ->set('entity_types', $entity_types)->save(); -} - -/** - * Splitting simple_sitemap.settings configuration into simple_sitemap.settings, - * simple_sitemap.entity_types and simple_sitemap.custom. - */ -function simple_sitemap_update_8203() { - $old_config = $config = \Drupal::config('simple_sitemap.settings'); - foreach (['entity_types', 'custom'] as $config_name) { - if (!$config = $old_config->get($config_name)) { - continue; - } - \Drupal::service('config.factory')->getEditable("simple_sitemap.$config_name") - ->setData($config)->save(); - } - $settings = $old_config->get('settings'); - \Drupal::service('config.factory')->getEditable("simple_sitemap.settings") - ->setData($settings)->save(); -} - -/** - * Removing entity type settings for entity types which do not have the canonical - * link template. - */ -function simple_sitemap_update_8204() { - $sitemap_entity_types = \Drupal::service('entity_type.manager')->getDefinitions(); - $entity_types = \Drupal::config('simple_sitemap.entity_types')->get(); - unset($entity_types['_core']); - foreach ($entity_types as $entity_type_id => $entity_type) { - if (!isset($sitemap_entity_types[$entity_type_id]) - || !$sitemap_entity_types[$entity_type_id]->hasLinkTemplate('canonical')) { - - // Delete entity overrides. - \Drupal::database()->delete('simple_sitemap_entity_overrides') - ->condition('entity_type', $entity_type_id) - ->execute(); - - // Delete entity type settings. - unset($entity_types[$entity_type_id]); - } - } - \Drupal::service('config.factory')->getEditable("simple_sitemap.entity_types") - ->setData($entity_types)->save(); -} - -/** - * Splitting simple_sitemap.entity_types into individual configuration objects - * for each bundle. - */ -function simple_sitemap_update_8205() { - $entity_types = \Drupal::config('simple_sitemap.entity_types')->get(); - unset($entity_types['_core']); - $enabled_entity_types = []; - foreach ($entity_types as $entity_type_id => $bundles) { - $enabled_entity_types[] = $entity_type_id; - foreach ($bundles as $bundle_name => $bundle_settings) { - \Drupal::service('config.factory') - ->getEditable("simple_sitemap.bundle_settings.$entity_type_id.$bundle_name") - ->setData($bundle_settings)->save(); - } - } - - // Add enabled entity type settings. - \Drupal::service('config.factory') - ->getEditable('simple_sitemap.settings') - ->set('enabled_entity_types', $enabled_entity_types) - ->save(); - - // Remove old configuration object. - \Drupal::service('config.factory') - ->getEditable('simple_sitemap.entity_types') - ->delete(); -} - -/** - * Placing custom links in a subkey of simple_sitemap.custom configuration. - */ -function simple_sitemap_update_8206() { - $custom_links = \Drupal::config('simple_sitemap.custom')->get(); - foreach ($custom_links as $i => $custom_link) { - if (!isset($custom_link['path'])) { - unset($custom_links[$i]); - } - } - \Drupal::service('config.factory')->getEditable('simple_sitemap.custom') - ->setData(['links' => $custom_links])->save(); -} - -/** - * Updating entity_id field of simple_sitemap_entity_overrides table to varchar(32). - */ -function simple_sitemap_update_8207() { - \Drupal::database()->schema()->changeField( - 'simple_sitemap_entity_overrides', - 'entity_id', - 'entity_id', [ - 'description' => 'ID of the overriding entity.', - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - ] - ); -} - -/** - * Adding changefreq setting to all existing bundle and entity instance settings. - */ -function simple_sitemap_update_8208() { - - // Update existing bundle settings. - $config_factory = \Drupal::service('config.factory'); - $entity_types = $config_factory->listAll('simple_sitemap.bundle_settings.'); - - foreach ($entity_types as $entity_type) { - $config = $config_factory->get($entity_type)->get(); - if (!isset($config['changefreq'])) { - $config_factory->getEditable($entity_type) - ->setData($config + ['changefreq' => '']) - ->save(); - } - } - - // Update existing entity override data. - $results = \Drupal::database()->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['id', 'inclusion_settings']) - ->execute()->fetchAll(\PDO::FETCH_OBJ); - - foreach ($results as $row) { - $settings = unserialize($row->inclusion_settings); - if (!isset($settings['changefreq'])) { - \Drupal::database()->update('simple_sitemap_entity_overrides') - ->fields(['inclusion_settings' => serialize($settings + ['changefreq' => '']),]) - ->condition('id', $row->id) - ->execute(); - } - } - - return t('You may now want to configure the new changefreq setting for the XML sitemap entities and custom links.'); -} - -/** - * Adding image inclusion setting to all existing bundle and entity instance settings. - */ -function simple_sitemap_update_8209() { - - // Update existing bundle settings. - $config_factory = \Drupal::service('config.factory'); - $all_bundle_settings = $config_factory->listAll('simple_sitemap.bundle_settings.'); - - foreach ($all_bundle_settings as $bundle_settings) { - $config = $config_factory->get($bundle_settings)->get(); - if (!isset($config['include_images'])) { - $config_factory->getEditable($bundle_settings) - ->setData($config + ['include_images' => 0]) - ->save(); - } - } - - // Update existing entity override data. - $results = \Drupal::database()->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['id', 'inclusion_settings']) - ->execute()->fetchAll(\PDO::FETCH_OBJ); - - foreach ($results as $row) { - $settings = unserialize($row->inclusion_settings); - if (!isset($settings['include_images'])) { - \Drupal::database()->update('simple_sitemap_entity_overrides') - ->fields(['inclusion_settings' => serialize($settings + ['include_images' => 0]),]) - ->condition('id', $row->id) - ->execute(); - } - } - - return t('You may now want to configure your XML sitemap entities to include images.'); -} - -/** - * Adding 'type' and 'delta' fields to simple_sitemap table. - */ -function simple_sitemap_update_8210() { - - $database = \Drupal::database(); - $database->truncate('simple_sitemap')->execute(); - - if (!$database->schema()->fieldExists('simple_sitemap', 'type')) { - $database->schema()->addField( - 'simple_sitemap', - 'type', [ - 'description' => 'Type of sitemap this chunk belongs to.', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - 'default' => '', - ] - ); - } - if (!$database->schema()->fieldExists('simple_sitemap', 'delta')) { - $database->schema()->addField( - 'simple_sitemap', - 'delta', [ - 'description' => 'Delta of the chunk within the type scope.', - 'type' => 'int', - 'size' => 'small', - 'not null' => TRUE, - 'unsigned' => TRUE, - ] - ); - } -} - -/** - * Adding simple_sitemap.variants and simple_sitemap.types to configuration. - */ -function simple_sitemap_update_8211() { - $config_factory = \Drupal::service('config.factory'); - - // Add simple_sitemap.types. - $config_factory - ->getEditable('simple_sitemap.types.default_hreflang') - ->setData([ - 'label' => 'Default hreflang', - 'description' => 'The default hreflang sitemap type.', - 'sitemap_generator' => 'default', - 'url_generators' => [ - 'custom', - 'entity', - 'entity_menu_link_content', - 'arbitrary', - ], - ])->save(); - - // Add simple_sitemap.variants. - $config_factory - ->getEditable('simple_sitemap.variants') - ->set('variants', [ - 'default' => [ - 'label' => 'Default', - 'type' => 'default_hreflang', - ] - ])->save(); -} - -/** - * Changing storage data type of 'index' and 'include_images' from integer to boolean. - */ -function simple_sitemap_update_8212() { - - // Update existing bundle settings. - $config_factory = \Drupal::service('config.factory'); - $all_bundle_settings = $config_factory->listAll('simple_sitemap.bundle_settings.'); - - foreach ($all_bundle_settings as $bundle_settings) { - $config = $config_factory->get($bundle_settings)->get(); - - $config['include_images'] = isset($config['include_images']) - ? (bool) $config['include_images'] - : FALSE; - - $config['index'] = isset($config['index']) - ? (bool) $config['index'] - : FALSE; - - $config_factory->getEditable($bundle_settings)->setData($config)->save(); - } - - // Update existing entity override data. - $results = \Drupal::database()->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['id', 'inclusion_settings']) - ->execute()->fetchAll(\PDO::FETCH_OBJ); - - foreach ($results as $row) { - $settings = unserialize($row->inclusion_settings); - - if (isset($settings['index'])) { - $settings['index'] = (bool) $settings['index']; - } - - if (isset($settings['include_images'])) { - $settings['include_images'] = (bool) $settings['include_images']; - } - - \Drupal::database()->update('simple_sitemap_entity_overrides') - ->fields(['inclusion_settings' => serialize($settings)]) - ->condition('id', $row->id) - ->execute(); - } -} - -/** - * Altering the configuration storage of variants. - */ -function simple_sitemap_update_8213() { - $config_factory = \Drupal::service('config.factory'); - $new_variants = []; - foreach ($config_factory->get('simple_sitemap.variants')->get('variants') as $variant_name => $variant_definition) { - $new_variants[$variant_definition['type']][$variant_name] = ['label' => $variant_definition['label']]; - } - - // Create new configuration objects. - foreach ($new_variants as $type => $variants) { - $config_factory - ->getEditable('simple_sitemap.variants.' . $type) - ->set('variants', $variants) - ->save(); - } - - // Remove old configuration object. - $config_factory->getEditable('simple_sitemap.variants')->delete(); -} - -/** - * Removing sitemap types from configuration as they are to be stored as plugins in code. - */ -function simple_sitemap_update_8214() { - $config_factory = \Drupal::service('config.factory'); - $sitemap_types = $config_factory->listAll('simple_sitemap.types.'); - - // Remove sitemap type configuration objects. - foreach ($sitemap_types as $type) { - $config_factory->getEditable($type)->delete(); - } -} - -/** - * Adding 'status' field to simple_sitemap table and weight to variants. - */ -function simple_sitemap_update_8215() { - $database = \Drupal::database(); - $database->truncate('simple_sitemap')->execute(); - - if (!$database->schema()->fieldExists('simple_sitemap', 'status')) { - $database->schema()->addField( - 'simple_sitemap', - 'status', [ - 'description' => "Flag indicating the publishing status of the chunk.", - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'default' => 0, - ] - ); - } - - $config_factory = \Drupal::service('config.factory'); - foreach ($config_factory->listAll('simple_sitemap.variants.') as $type) { - $type = $config_factory->getEditable($type); - $variants = $type->get('variants'); - foreach($variants as $i => $variant) { - $variants[$i]['weight'] = 0; - } - $type->set('variants', $variants)->save(); - } -} - -/** - * Adding per-variant bundle and entity override configuration. - */ -function simple_sitemap_update_8216() { - $config_factory = \Drupal::service('config.factory'); - foreach ($config_factory->listAll('simple_sitemap.bundle_settings.') as $bundle_config_name) { - $config = $config_factory->getEditable($bundle_config_name); - $config_name_parts = explode('.', $bundle_config_name); - $config_factory->getEditable($config_name_parts[0] . '.' . $config_name_parts[1] - . '.' . _simple_sitemap_update_8216_get_default_variant() . '.' . $config_name_parts[2] . '.' . $config_name_parts[3]) - ->setData($config->get())->save(); - - $config->delete(); - } - - $database = \Drupal::database(); - if (!$database->schema()->fieldExists('simple_sitemap_entity_overrides', 'type')) { - $database->schema()->addField( - 'simple_sitemap_entity_overrides', - 'type', [ - 'description' => 'Type of sitemap this override belongs to.', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - 'initial' => 'default', - ] - ); - } -} - -/** - * Adding per-variant custom link configuration. - */ -function simple_sitemap_update_8217() { - $config_factory = \Drupal::service('config.factory'); - $old_config = $config_factory->getEditable('simple_sitemap.custom'); - $config_factory->getEditable('simple_sitemap.custom_links.' . _simple_sitemap_update_8216_get_default_variant()) - ->setData($old_config->get())->save(); - $old_config->delete(); - - return t('The XML sitemaps need to be regenerated.'); -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml deleted file mode 100644 index 72b955aeb..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml +++ /dev/null @@ -1,19 +0,0 @@ -fieldsetSummaries: - version: VERSION - js: - js/simple_sitemap.fieldsetSummaries.js: {} - dependencies: - - core/jquery -form: - version: VERSION - js: - js/simple_sitemap.form.js: {} - dependencies: - - core/jquery -sitemapEntities: - version: VERSION - js: - js/simple_sitemap.sitemapEntities.js: {} - dependencies: - - core/jquery - - core/drupalSettings diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml deleted file mode 100644 index 02ea6faf7..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -simple_sitemap.settings: - title: 'Simple XML sitemap' - description: 'Configure and generate the XML sitemap, add custom links to it.' - parent: system.admin_config_search - route_name: simple_sitemap.settings diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml deleted file mode 100644 index c0e163e9a..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml +++ /dev/null @@ -1,25 +0,0 @@ -simple_sitemap.settings: - route_name: simple_sitemap.settings - title: 'Settings' - base_route: simple_sitemap.settings - weight: -1 - -simple_sitemap.settings_entities: - route_name: simple_sitemap.settings_entities - title: 'Sitemap entities' - base_route: simple_sitemap.settings - weight: 0 - -simple_sitemap.variants: - route_name: simple_sitemap.settings_variants - title: 'Sitemap variants' - base_route: simple_sitemap.settings - weight: 1 - -simple_sitemap.settings_custom: - route_name: simple_sitemap.settings_custom - title: 'Custom links' - base_route: simple_sitemap.settings - weight: 2 - - diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module deleted file mode 100644 index 504f8352d..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module +++ /dev/null @@ -1,236 +0,0 @@ -processForm($form_state)) { - return; - } - - $form['simple_sitemap'] = [ - '#type' => 'details', - '#group' => isset($form['additional_settings']) ? 'additional_settings' : 'advanced', - '#title' => t('Simple XML sitemap'), - '#description' => $f->getEntityCategory() === 'instance' ? t('Settings for this entity can be overridden here.') : '', - '#weight' => 10, - ]; - - // Attach some js magic to forms. - if ($f->getEntityCategory() !== 'instance') { - $form['#attached']['library'][] = 'simple_sitemap/form'; - } - - // Only attach fieldset summary js to 'additional settings' vertical tabs. - if (isset($form['additional_settings'])) { - $form['#attached']['library'][] = 'simple_sitemap/fieldsetSummaries'; - } - - $f->displayEntitySettings($form['simple_sitemap']) - // todo: do not show setting when creating new bundle. - ->displayRegenerateNow($form['simple_sitemap']); - - // Add submission handler. - if (isset($form['actions']['submit']['#submit'])) { - foreach (array_keys($form['actions']) as $action) { - if ($action !== 'preview' - && isset($form['actions'][$action]['#type']) - && $form['actions'][$action]['#type'] === 'submit') { - $form['actions'][$action]['#submit'][] = 'simple_sitemap_entity_form_submit'; - } - } - } - // Fix for account page rendering other submit handlers not usable. - else { - $form['#submit'][] = 'simple_sitemap_entity_form_submit'; - } -} - -/** - * Form submission handler called in hook_form_alter. - * - * @param $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - */ -function simple_sitemap_entity_form_submit($form, FormStateInterface &$form_state) { - - /** @var Drupal\simple_sitemap\Form\FormHelper $f */ - $f = \Drupal::service('simple_sitemap.form_helper'); - if (!$f->processForm($form_state)) { - return; - } - - $values = $form_state->getValues(); - - // Fix for values appearing in a sub array on a commerce product entity. - $values = isset($values['simple_sitemap']) ? $values['simple_sitemap'] : $values; - - // Only make changes in DB if sitemap settings actually changed. - if ($f->valuesChanged($form, $values)) { - - /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ - $generator = \Drupal::service('simple_sitemap.generator'); - - $settings = [ - 'index' => (bool) $values['simple_sitemap_index_content'], - 'priority' => $values['simple_sitemap_priority'], - 'changefreq' => $values['simple_sitemap_changefreq'], - 'include_images' => (bool) $values['simple_sitemap_include_images'], - ]; - - // Deleting bundle settings for old bundle. - // See SimplesitemapEntitiesForm::submitForm(). - // todo: This will not be necessary if "multiple variants pro bundle" is implemented. - if (isset($form['simple_sitemap']['simple_sitemap_variant']['#default_value'])) { - $old_variant = $form['simple_sitemap']['simple_sitemap_variant']['#default_value']; - if ($old_variant !== $values['simple_sitemap_variant']) { - $generator->setVariants($old_variant)->removeBundleSettings($f->getEntityTypeId(), $f->getBundleName()); - } - } - - switch ($f->getEntityCategory()) { - - case 'bundle': - $generator->setVariants($values['simple_sitemap_variant']) - ->setBundleSettings($f->getEntityTypeId(), - !empty($f->getBundleName()) ? $f->getBundleName() : $f->getFormEntityId(), - $settings - ); - break; - - case 'instance': - $generator->setVariants($values['simple_sitemap_variant']) - ->setEntityInstanceSettings($f->getEntityTypeId(), - !empty($f->getInstanceId()) ? $f->getInstanceId() : $f->getFormEntityId(), - $settings - ); - break; - } - - // Regenerate sitemaps according to user setting. - if ($values['simple_sitemap_regenerate_now']) { - $generator->rebuildQueue()->generateSitemap(); - } - } -} - -/** - * Implements hook_cron(). - */ -function simple_sitemap_cron() { - - /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ - $generator = \Drupal::service('simple_sitemap.generator'); - - if ($generator->getSetting('cron_generate')) { - $interval = (int) $generator->getSetting('cron_generate_interval', 0) * 60 * 60; - $request_time = \Drupal::service('datetime.time')->getRequestTime(); - $generation_in_progress = $generator->getQueueWorker()->generationInProgress(); - $state = \Drupal::state(); - - if ($interval === 0 - || $generation_in_progress - || (($state->get('simple_sitemap.last_cron_generate', 0) + $interval) <= $request_time)) { - - if (!$generation_in_progress) { - $state->set('simple_sitemap.last_cron_generate', $request_time); - } - - $generator->generateSitemap('cron'); - } - } -} - -/** - * Implements hook_ENTITY_TYPE_delete(). - * - * When a language is removed from the system remove it also from settings. - */ -function simple_sitemap_configurable_language_delete(ConfigurableLanguageInterface $language) { - - /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ - $generator = \Drupal::service('simple_sitemap.generator'); - - $excluded_languages = $generator->getSetting('excluded_languages'); - if (isset($excluded_languages[$language->id()])) { - unset($excluded_languages[$language->id()]); - $generator->saveSetting('excluded_languages', $excluded_languages); - } -} - -/** - * Implements hook_entity_delete(). - * - * Removes settings of the removed entity. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - */ -function simple_sitemap_entity_delete(EntityInterface $entity) { - - /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ - $generator = \Drupal::service('simple_sitemap.generator'); - $generator->setVariants(TRUE)->removeEntityInstanceSettings( - $entity->getEntityTypeId(), $entity->id() - ); -} - -/** - * Implements hook_entity_bundle_delete(). - * - * Removes settings of the removed bundle. - * - * @param string $entity_type_id - * @param string $bundle - */ -function simple_sitemap_entity_bundle_delete($entity_type_id, $bundle) { - - /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ - $generator = \Drupal::service('simple_sitemap.generator'); - $generator->setVariants(TRUE)->removeBundleSettings($entity_type_id, $bundle); -} - -/** - * Implements hook_menu_delete(). - * - * Removes settings for the removed menu. - * - * @param \Drupal\system\MenuInterface $menu - */ -function simple_sitemap_menu_delete(MenuInterface $menu) { - - /** @var \Drupal\simple_sitemap\Simplesitemap $generator */ - $generator = \Drupal::service('simple_sitemap.generator'); - $generator->setVariants(TRUE)->removeBundleSettings('menu_link_content', $menu->id()); -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml deleted file mode 100644 index 035e3ce21..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -administer sitemap settings: - title: 'Administer sitemap settings' - description: 'Administer Simple XML sitemap settings, alter inclusion settings of content and generate the sitemap on demand.' - restrict access: false diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml deleted file mode 100644 index eaa9fbd26..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml +++ /dev/null @@ -1,51 +0,0 @@ -simple_sitemap.sitemap_default: - path: '/sitemap.xml' - defaults: - _controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap' - _disable_route_normalizer: 'TRUE' - requirements: - _access: 'TRUE' - -# The actual path to a variant is '/{variant}/sitemap.xml'. Because Drupal 8 -# cannot handle a parameter as first route argument, -# Drupal\simple_sitemap\PathProcessor\PathProcessorSitemapVariant::processInbound() -# is being used to catch the request and redirect to the following route. -simple_sitemap.sitemap_variant: - path: '/sitemaps/{variant}/sitemap.xml' - defaults: - _controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap' - _disable_route_normalizer: 'TRUE' - requirements: - _access: 'TRUE' - -simple_sitemap.settings: - path: '/admin/config/search/simplesitemap' - defaults: - _form: '\Drupal\simple_sitemap\Form\SimplesitemapSettingsForm' - _title: 'Simple XML Sitemap Settings' - requirements: - _permission: 'administer sitemap settings' - -simple_sitemap.settings_entities: - path: '/admin/config/search/simplesitemap/entities' - defaults: - _form: '\Drupal\simple_sitemap\Form\SimplesitemapEntitiesForm' - _title: 'Simple XML Sitemap Settings' - requirements: - _permission: 'administer sitemap settings' - -simple_sitemap.settings_custom: - path: '/admin/config/search/simplesitemap/custom' - defaults: - _form: '\Drupal\simple_sitemap\Form\SimplesitemapCustomLinksForm' - _title: 'Simple XML Sitemap Settings' - requirements: - _permission: 'administer sitemap settings' - -simple_sitemap.settings_variants: - path: '/admin/config/search/simplesitemap/variants' - defaults: - _form: '\Drupal\simple_sitemap\Form\SimplesitemapVariantsForm' - _title: 'Simple XML Sitemap Settings' - requirements: - _permission: 'administer sitemap settings' diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml deleted file mode 100644 index 3a784281d..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml +++ /dev/null @@ -1,100 +0,0 @@ -services: - simple_sitemap.generator: - class: Drupal\simple_sitemap\Simplesitemap - public: true - arguments: - - '@simple_sitemap.entity_helper' - - '@simple_sitemap.settings' - - '@simple_sitemap.manager' - - '@config.factory' - - '@database' - - '@entity_type.manager' - - '@entity_type.bundle.info' - - '@path.validator' - - '@date.formatter' - - '@datetime.time' - - '@simple_sitemap.queue_worker' - - simple_sitemap.manager: - class: Drupal\simple_sitemap\SimplesitemapManager - public: true - arguments: - - '@config.factory' - - '@database' - - '@plugin.manager.simple_sitemap.sitemap_type' - - '@plugin.manager.simple_sitemap.url_generator' - - '@plugin.manager.simple_sitemap.sitemap_generator' - - '@simple_sitemap.settings' - - simple_sitemap.settings: - class: Drupal\simple_sitemap\SimplesitemapSettings - public: false - arguments: - - '@config.factory' - - simple_sitemap.queue_worker: - class: Drupal\simple_sitemap\Queue\QueueWorker - public: true - arguments: - - '@simple_sitemap.settings' - - '@simple_sitemap.manager' - - '@state' - - '@simple_sitemap.queue' - - '@simple_sitemap.logger' - - simple_sitemap.queue: - class: Drupal\simple_sitemap\Queue\SimplesitemapQueue - public: false - arguments: - - 'simple_sitemap_elements' - - '@database' - - simple_sitemap.sitemap_writer: - class: Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapWriter - public: true - - simple_sitemap.entity_helper: - class: Drupal\simple_sitemap\EntityHelper - public: true - arguments: - - '@entity_type.manager' - - '@database' - - simple_sitemap.form_helper: - class: Drupal\simple_sitemap\Form\FormHelper - public: true - arguments: - - '@simple_sitemap.generator' - - '@simple_sitemap.entity_helper' - - '@current_user' - - simple_sitemap.logger: - class: Drupal\simple_sitemap\Logger - public: true - arguments: - - '@logger.channel.simple_sitemap' - - '@messenger' - - '@current_user' - - simple_sitemap.path_processor_variant: - class: Drupal\simple_sitemap\PathProcessor\PathProcessorSitemapVariant - tags: - - { name: path_processor_inbound, priority: 300 } - - logger.channel.simple_sitemap: - parent: logger.channel_base - public: false - arguments: - - simple_sitemap - - plugin.manager.simple_sitemap.url_generator: - class: Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorManager - parent: default_plugin_manager - - plugin.manager.simple_sitemap.sitemap_generator: - class: Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapGeneratorManager - parent: default_plugin_manager - - plugin.manager.simple_sitemap.sitemap_type: - class: Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapType\SitemapTypeManager - parent: default_plugin_manager diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php deleted file mode 100644 index 1b71536f4..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php +++ /dev/null @@ -1,50 +0,0 @@ -generator = $generator; - } - - /** - * Regenerate the XML sitemaps according to the module settings. - * - * @command simple-sitemap:generate - * - * @usage drush simple-sitemap:generate - * Regenerate the XML sitemaps according to the module settings. - * - * @validate-module-enabled simple_sitemap - * - * @aliases ssg, simple-sitemap-generate - */ - public function generate() { - $this->generator->generateSitemap('drush'); - } - - /** - * Rebuild the sitemap queue for all sitemap variants. - * - * @command simple-sitemap:rebuild-queue - * - * @usage drush simple-sitemap:rebuild-queue - * Rebuild the sitemap queue for all sitemap variants. - * - * @validate-module-enabled simple_sitemap - * - * @aliases ssr, simple-sitemap-rebuild-queue - */ - public function rebuildQueue() { - $this->generator->rebuildQueue(); - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php deleted file mode 100644 index b8c637e85..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php +++ /dev/null @@ -1,70 +0,0 @@ -generator = $generator; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('simple_sitemap.generator') - ); - } - - /** - * Returns the whole sitemap variant, its requested chunk, - * or its sitemap index file. - * Caches the response in case of expected output, prevents caching otherwise. - * - * @param string $variant - * Optional name of sitemap variant. - * @see \hook_simple_sitemap_variants_alter() - * @see SimplesitemapManager::getSitemapVariants() - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. - * - * @throws NotFoundHttpException - * - * @return object - * Returns an XML response. - */ - public function getSitemap(Request $request, $variant = NULL) { - $output = $this->generator->setVariants($variant)->getSitemap($request->query->getInt('page')); - if (!$output) { - throw new NotFoundHttpException(); - } - - return new Response($output, Response::HTTP_OK, [ - 'content-type' => 'application/xml', - 'X-Robots-Tag' => 'noindex', // Tell search engines not to index the sitemap itself. - ]); - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php b/sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php deleted file mode 100644 index d49bdb9bd..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php +++ /dev/null @@ -1,164 +0,0 @@ -entityTypeManager = $entityTypeManager; - $this->db = $database; - } - - /** - * Gets an entity's bundle name. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * @return string - */ - public function getEntityInstanceBundleName(EntityInterface $entity) { - return $entity->getEntityTypeId() === 'menu_link_content' - // Menu fix. - ? $entity->getMenuName() : $entity->bundle(); - } - - /** - * Gets the entity type id for a bundle. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * @return null|string - */ - public function getBundleEntityTypeId(EntityInterface $entity) { - return $entity->getEntityTypeId() === 'menu' - // Menu fix. - ? 'menu_link_content' : $entity->getEntityType()->getBundleOf(); - } - - /** - * Returns objects of entity types that can be indexed. - * - * @return array - * Objects of entity types that can be indexed by the sitemap. - */ - public function getSupportedEntityTypes() { - - /** @var \Drupal\Core\Entity\ContentEntityTypeInterface[] $entity_types */ - $entity_types = $this->entityTypeManager->getDefinitions(); - foreach ($entity_types as $entity_type_id => $entity_type) { - if (!$entity_type instanceof ContentEntityTypeInterface - || !method_exists($entity_type, 'getBundleEntityType') - || !$entity_type->hasLinkTemplate('canonical')) { - unset($entity_types[$entity_type_id]); - } - } - return $entity_types; - } - - /** - * Checks whether an entity type does not provide bundles. - * - * @param string $entity_type_id - * @return bool - */ - public function entityTypeIsAtomic($entity_type_id) { - - // Menu fix. - if ($entity_type_id === 'menu_link_content') { - return FALSE; - } - - $entity_types = $this->entityTypeManager->getDefinitions(); - - if (!isset($entity_types[$entity_type_id])) { - // todo: Throw exception. - } - - return empty($entity_types[$entity_type_id]->getBundleEntityType()) ? TRUE : FALSE; - } - - /** - * @param \Drupal\Core\Url $url_object - * @return \Drupal\Core\Entity\EntityInterface|null - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - public function getEntityFromUrlObject(Url $url_object) { - return $url_object->isRouted() - && !empty($route_parameters = $url_object->getRouteParameters()) - && $this->entityTypeManager->getDefinition($entity_type_id = key($route_parameters), FALSE) - ? $this->entityTypeManager->getStorage($entity_type_id) - ->load($route_parameters[$entity_type_id]) - : NULL; - } - - /** - * @param string $entity_type_id - * @param string|null $bundle_name - * @return array|int - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - public function getEntityInstanceIds($entity_type_id, $bundle_name = NULL) { - $sitemap_entity_types = $this->getSupportedEntityTypes(); - if (!isset($sitemap_entity_types[$entity_type_id])) { - return []; - } - - $entity_query = $this->entityTypeManager->getStorage($entity_type_id)->getQuery(); - if (!$this->entityTypeIsAtomic($entity_type_id) && NULL !== $bundle_name) { - $keys = $sitemap_entity_types[$entity_type_id]->getKeys(); - - // Menu fix. - $keys['bundle'] = $entity_type_id === 'menu_link_content' ? 'menu_name' : $keys['bundle']; - - $entity_query->condition($keys['bundle'], $bundle_name); - } - - return $entity_query->execute(); - } - - /** - * @param string $entity_type_name - * @param string $entity_id - * @return array - */ - public function getEntityImageUrls($entity_type_name, $entity_id) { - $query = $this->db->select('file_managed', 'fm'); - $query->fields('fm', ['uri']); - $query->join('file_usage', 'fu', 'fu.fid = fm.fid'); - $query->condition('fm.filemime', 'image/%', 'LIKE'); - $query->condition('fu.type', $entity_type_name); - $query->condition('fu.id', $entity_id); - - foreach ($query->execute() as $row) { - $imageUris[] = file_create_url($row->uri); - } - - return !empty($imageUris) ? $imageUris : []; - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php deleted file mode 100644 index d11b7f810..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php +++ /dev/null @@ -1,539 +0,0 @@ -generator = $generator; - $this->entityHelper = $entityHelper; - $this->currentUser = $current_user; - } - - /** - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @return bool - */ - public function processForm(FormStateInterface $form_state) { - $this->formState = $form_state; - $this->cleanUpFormInfo(); - $this->getEntityDataFromFormEntity(); - $this->negotiateVariant(); - return $this->supports(); - } - - /** - * @param string $entity_category - * @return $this - */ - public function setEntityCategory($entity_category) { - $this->entityCategory = $entity_category; - return $this; - } - - /** - * @return null|string - */ - public function getEntityCategory() { - return $this->entityCategory; - } - - /** - * @param string $entity_type_id - * @return $this - */ - public function setEntityTypeId($entity_type_id) { - $this->entityTypeId = $entity_type_id; - return $this; - } - - /** - * @return string - */ - public function getEntityTypeId() { - return $this->entityTypeId; - } - - /** - * @param string $bundle_name - * @return $this - */ - public function setBundleName($bundle_name) { - $this->bundleName = $bundle_name; - return $this; - } - - /** - * @return string - */ - public function getBundleName() { - return $this->bundleName; - } - - /** - * @param string $instance_id - * @return $this - */ - public function setInstanceId($instance_id) { - $this->instanceId = $instance_id; - return $this; - } - - /** - * @return string - */ - public function getInstanceId() { - return $this->instanceId; - } - - /** - * @return bool - */ - protected function supports() { - - // Do not alter the form if user lacks certain permissions. - if (!$this->currentUser->hasPermission('administer sitemap settings')) { - return FALSE; - } - - // Do not alter the form if it is irrelevant to sitemap generation. - elseif (empty($this->getEntityCategory())) { - return FALSE; - } - - // Do not alter the form if entity is not enabled in sitemap settings. - elseif (!$this->generator->entityTypeIsEnabled($this->getEntityTypeId())) { - return FALSE; - } - - // Do not alter the form, if sitemap is disabled for the entity type of this - // entity instance. - elseif ($this->getEntityCategory() === 'instance') { - if (NULL === $this->variant || !$this->generator - ->setVariants($this->variant) - ->bundleIsIndexed($this->getEntityTypeId(), $this->getBundleName())) { - return FALSE; - } - } - - return TRUE; - } - - /** - * @param array $form_fragment - */ - public function displayRegenerateNow(&$form_fragment) { - $form_fragment['simple_sitemap_regenerate_now'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Regenerate sitemap after hitting Save'), - '#description' => $this->t('This setting will regenerate all sitemaps including the above changes.'), - '#default_value' => FALSE, - ]; - if ($this->generator->getSetting('cron_generate')) { - $form_fragment['simple_sitemap_regenerate_now']['#description'] .= '
' . $this->t('Otherwise the sitemap will be regenerated during a future cron run.'); - } - } - - protected function negotiateVariant() { - $all_bundle_settings = $this->generator->setVariants(TRUE) - ->getBundleSettings($this->getEntityTypeId(), $this->getBundleName(), FALSE, TRUE); - $this->bundleSettings = NULL !== ($variant = key($all_bundle_settings)) - ? $all_bundle_settings[$variant] - : []; - $this->variant = $variant; - } - - /** - * @param array $form_fragment - * @param bool $multiple - * @return $this - */ - public function displayEntitySettings(&$form_fragment, $multiple = FALSE) { - $prefix = $multiple ? $this->getEntityTypeId() . '_' : ''; - - $settings = $this->getEntityCategory() === 'instance' && NULL !== $this->variant && NULL !== $this->getInstanceId() - ? $this->generator->setVariants($this->variant)->getEntityInstanceSettings($this->getEntityTypeId(), $this->getInstanceId()) - : $this->bundleSettings; - Simplesitemap::supplementDefaultSettings('entity', $settings); - - $bundle_name = !empty($this->getBundleName()) ? $this->getBundleName() : $this->t('undefined'); - - // Index - if (!$multiple) { - $form_fragment[$prefix . 'simple_sitemap_index_content'] = [ - '#type' => 'radios', - '#default_value' => (int) $settings['index'], - '#options' => [ - 0 => $this->getEntityCategory() === 'instance' - ? $this->t('Do not index this @bundle entity', ['@bundle' => $bundle_name]) - : $this->t('Do not index entities of this type'), - 1 => $this->getEntityCategory() === 'instance' - ? $this->t('Index this @bundle entity', ['@bundle' => $bundle_name]) - : $this->t('Index entities of this type'), - ], - ]; - - if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['index'])) { - $form_fragment[$prefix . 'simple_sitemap_index_content']['#options'][(int) $this->bundleSettings['index']] .= ' (' . $this->t('default') . ')'; - } - } - - // Variant - $form_fragment[$prefix . 'simple_sitemap_variant'] = [ - '#type' => 'select', - '#title' => $this->t('Sitemap variant'), - '#description' => $this->t('The sitemap variant entities of this type are to be indexed in.'), - '#options' => array_map( - function($variant) { return $this->t($variant['label']); }, - $this->generator->getSitemapManager()->getSitemapVariants(NULL, FALSE) - ), - '#default_value' => $this->variant, - '#states' => [ - 'visible' => !$multiple - ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]] - : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]], - 'required' => !$multiple // todo Should implement server side validation on top of this. - ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]] - : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]], - ], - '#disabled' => $this->getEntityCategory() === 'instance' - ]; - - // Priority - $form_fragment[$prefix . 'simple_sitemap_priority'] = [ - '#type' => 'select', - '#title' => $this->t('Priority'), - '#description' => $this->getEntityCategory() === 'instance' - ? $this->t('The priority this @bundle entity will have in the eyes of search engine bots.', ['@bundle' => $bundle_name]) - : $this->t('The priority entities of this type will have in the eyes of search engine bots.'), - '#default_value' => $settings['priority'], - '#options' => $this->getPrioritySelectValues(), - '#states' => [ - 'visible' => !$multiple - ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]] - : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]], - ], - ]; - - if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['priority'])) { - $form_fragment[$prefix . 'simple_sitemap_priority']['#options'][$this->formatPriority($this->bundleSettings['priority'])] .= ' (' . $this->t('default') . ')'; - } - - // Changefreq - $form_fragment[$prefix . 'simple_sitemap_changefreq'] = [ - '#type' => 'select', - '#title' => $this->t('Change frequency'), - '#description' => $this->getEntityCategory() === 'instance' - ? $this->t('The frequency with which this @bundle entity changes. Search engine bots may take this as an indication of how often to index it.', ['@bundle' => $bundle_name]) - : $this->t('The frequency with which entities of this type change. Search engine bots may take this as an indication of how often to index them.'), - '#default_value' => $settings['changefreq'], - '#options' => $this->getChangefreqSelectValues(), - '#states' => [ - 'visible' => !$multiple - ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]] - : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]], - ], - ]; - - if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['changefreq'])) { - $form_fragment[$prefix . 'simple_sitemap_changefreq']['#options'][$this->bundleSettings['changefreq']] .= ' (' . $this->t('default') . ')'; - } - - // Images - $form_fragment[$prefix . 'simple_sitemap_include_images'] = [ - '#type' => 'select', - '#title' => $this->t('Include images'), - '#description' => $this->getEntityCategory() === 'instance' - ? $this->t('Determines if images referenced by this @bundle entity should be included in the sitemap.', ['@bundle' => $bundle_name]) - : $this->t('Determines if images referenced by entities of this type should be included in the sitemap.'), - '#default_value' => (int) $settings['include_images'], - '#options' => [0 => $this->t('No'), 1 => $this->t('Yes')], - '#states' => [ - 'visible' => !$multiple - ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]] - : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]], - ], - ]; - - if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['include_images'])) { - $form_fragment[$prefix . 'simple_sitemap_include_images']['#options'][(int) $this->bundleSettings['include_images']] .= ' (' . $this->t('default') . ')'; - } - - return $this; - } - - /** - * Checks if this particular form is a bundle form, or a bundle instance form - * and gathers sitemap settings from the database. - * - * @return bool - * TRUE if this is a bundle or bundle instance form, FALSE otherwise. - */ - protected function getEntityDataFromFormEntity() { - if (!$form_entity = $this->getFormEntity()) { - return FALSE; - } - - $entity_type_id = $form_entity->getEntityTypeId(); - $sitemap_entity_types = $this->entityHelper->getSupportedEntityTypes(); - if (isset($sitemap_entity_types[$entity_type_id])) { - $this->setEntityCategory('instance'); - } - else { - /** @var \Drupal\Core\Entity\EntityType $sitemap_entity_type */ - foreach ($sitemap_entity_types as $sitemap_entity_type) { - if ($sitemap_entity_type->getBundleEntityType() === $entity_type_id) { - $this->setEntityCategory('bundle'); - break; - } - } - } - - // Menu fix. - $this->setEntityCategory(NULL === $this->getEntityCategory() && $entity_type_id === 'menu' ? 'bundle' : $this->getEntityCategory()); - - switch ($this->getEntityCategory()) { - case 'bundle': - $this->setEntityTypeId($this->entityHelper->getBundleEntityTypeId($form_entity)); - $this->setBundleName($form_entity->id()); - $this->setInstanceId(NULL); - break; - - case 'instance': - $this->setEntityTypeId($entity_type_id); - $this->setBundleName($this->entityHelper->getEntityInstanceBundleName($form_entity)); - // New menu link's id is '' instead of NULL, hence checking for empty. - $this->setInstanceId(!empty($form_entity->id()) ? $form_entity->id() : NULL); - break; - - default: - return FALSE; - } - return TRUE; - } - - /** - * Gets the object entity of the form if available. - * - * @return \Drupal\Core\Entity\Entity|false - * Entity or FALSE if non-existent or if form operation is - * 'delete'. - */ - protected function getFormEntity() { - $form_object = $this->formState->getFormObject(); - if (NULL !== $form_object - && method_exists($form_object, 'getOperation') - && method_exists($form_object, 'getEntity') - && in_array($form_object->getOperation(), self::$allowedFormOperations)) { - return $form_object->getEntity(); - } - return FALSE; - } - - /** - * Removes gathered form information from service object. - * - * Needed because this service may contain form info from the previous - * operation when revived from the container. - */ - protected function cleanUpFormInfo() { - $this->entityCategory = NULL; - $this->entityTypeId = NULL; - $this->bundleName = NULL; - $this->instanceId = NULL; - $this->variant = NULL; - $this->bundleSettings = NULL; - } - - /** - * Gets new entity Id after entity creation. - * To be used in an entity form submit. - * - * @return int - * Entity ID. - */ - public function getFormEntityId() { - return $this->formState->getFormObject()->getEntity()->id(); - } - - /** - * Checks if simple_sitemap values have been changed after submitting the form. - * To be used in an entity form submit. - * - * @param $form - * @param array $values - * - * @return bool - * TRUE if simple_sitemap form values have been altered by the user. - */ - public function valuesChanged($form, array $values) { - foreach (self::$valuesToCheck as $field_name) { - if (!isset($form['simple_sitemap'][$field_name]['#default_value']) - || (isset($values[$field_name]) && $values[$field_name] != $form['simple_sitemap'][$field_name]['#default_value'])) { - return TRUE; - } - } - return FALSE; - } - - /** - * Gets the values needed to display the priority dropdown setting. - * - * @return array - * Select options. - */ - public function getPrioritySelectValues() { - $options = []; - foreach (range(0, self::PRIORITY_HIGHEST) as $value) { - $value = $this->formatPriority($value / self::PRIORITY_DIVIDER); - $options[$value] = $value; - } - return $options; - } - - /** - * Gets the values needed to display the changefreq dropdown setting. - * - * @return array - * Select options. - */ - public function getChangefreqSelectValues() { - $options = ['' => $this->t('- Not specified -')]; - foreach (self::$changefreqValues as $setting) { - $options[$setting] = $this->t($setting); - } - return $options; - } - - /** - * @return array - */ - public static function getChangefreqOptions() { - return self::$changefreqValues; - } - - /** - * @param string $priority - * @return string - */ - public function formatPriority($priority) { - return number_format((float) $priority, 1, '.', ''); - } - - /** - * @param string|int $priority - * @return bool - */ - public static function isValidPriority($priority) { - return is_numeric($priority) && $priority >= 0 && $priority <= 1; - } - - /** - * @param string $changefreq - * @return bool - */ - public static function isValidChangefreq($changefreq) { - return in_array($changefreq, self::$changefreqValues); - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php deleted file mode 100644 index 1b2e40938..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php +++ /dev/null @@ -1,227 +0,0 @@ -pathValidator = $path_validator; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.form_helper'), - $container->get('path.validator') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'simple_sitemap_custom_links_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $form['simple_sitemap_custom'] = [ - '#title' => $this->t('Custom links'), - '#type' => 'fieldset', - '#markup' => '
' . $this->t('Add custom internal drupal paths to the XML sitemap.') . '
', - '#prefix' => $this->getDonationText(), - ]; - - $form['simple_sitemap_custom']['custom_links'] = [ - '#type' => 'textarea', - '#title' => $this->t('Relative Drupal paths'), - '#default_value' => $this->customLinksToString($this->generator->setVariants(TRUE)->getCustomLinks(NULL, FALSE)), - '#description' => $this->t("Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a '/'.
Optionally link priority (0.0 - 1.0) can be added by appending it after a space.
Optionally link change frequency (always / hourly / daily / weekly / monthly / yearly / never) can be added by appending it after a space.

Examples:
/ 1.0 daily -> home page with the highest priority and daily change frequency
/contact -> contact page with the default priority and no change frequency information"), - ]; - - $form['simple_sitemap_custom']['variants'] = [ - '#type' => 'select', - '#multiple' => TRUE, - '#title' => $this->t('Sitemap variants'), - '#description' => $this->t('The sitemap variants to include the above links in.
Variants can be configured here.', ['@url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/variants']), - '#options' => array_map( - function($variant) { return $this->t($variant['label']); }, - $this->generator->getSitemapManager()->getSitemapVariants(NULL, FALSE) - ), - '#default_value' => array_keys(array_filter( - $this->generator->setVariants(TRUE)->getCustomLinks(NULL, FALSE, TRUE), - function($e) { return !empty($e);}) - ), - ]; - - $form['simple_sitemap_custom']['include_images'] = [ - '#type' => 'select', - '#title' => $this->t('Include images'), - '#description' => $this->t('If a custom link points to an entity, include its referenced images in the sitemap.'), - '#default_value' => $this->generator->getSetting('custom_links_include_images', FALSE), - '#options' => [0 => $this->t('No'), 1 => $this->t('Yes')], - ]; - - $this->formHelper->displayRegenerateNow($form['simple_sitemap_custom']); - - return parent::buildForm($form, $form_state); - } - - protected function negotiateVariant() { - - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - if (!empty($form_state->getValue('custom_links')) && empty($form_state->getValue('variants'))) { - $form_state->setErrorByName('variants', $this->t('Custom links must be assigned to at least one sitemap variant.')); - } - - foreach ($this->stringToCustomLinks($form_state->getValue('custom_links')) as $i => $link_config) { - $placeholders = [ - '@line' => ++$i, - '@path' => $link_config['path'], - '@priority' => isset($link_config['priority']) ? $link_config['priority'] : '', - '@changefreq' => isset($link_config['changefreq']) ? $link_config['changefreq'] : '', - '@changefreq_options' => implode(', ', FormHelper::getChangefreqOptions()), - ]; - - // Checking if internal path exists. - if (!(bool) $this->pathValidator->getUrlIfValidWithoutAccessCheck($link_config['path']) - // Path validator does not see a double slash as an error. Catching this to prevent breaking path generation. - || strpos($link_config['path'], '//') !== FALSE) { - $form_state->setErrorByName('', $this->t('Line @line: The path @path does not exist.', $placeholders)); - } - - // Making sure the paths start with a slash. - if ($link_config['path'][0] !== '/') { - $form_state->setErrorByName('', $this->t("Line @line: The path @path needs to start with a '/'.", $placeholders)); - } - - // Making sure the priority is formatted correctly. - if (isset($link_config['priority']) && !FormHelper::isValidPriority($link_config['priority'])) { - $form_state->setErrorByName('', $this->t('Line @line: The priority setting @priority for path @path is incorrect. Set the priority from 0.0 to 1.0.', $placeholders)); - } - - // Making sure changefreq is formatted correctly. - if (isset($link_config['changefreq']) && !FormHelper::isValidChangefreq($link_config['changefreq'])) { - $form_state->setErrorByName('', $this->t('Line @line: The changefreq setting @changefreq for path @path is incorrect. The following are the correct values: @changefreq_options.', $placeholders)); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->generator->setVariants(TRUE)->removeCustomLinks(); - if (!empty($variants = $form_state->getValue('variants')) && !empty($links = $form_state->getValue('custom_links'))) { - $this->generator->setVariants(array_values($variants)); - foreach ($this->stringToCustomLinks($links) as $link_config) { - $this->generator->addCustomLink($link_config['path'], $link_config); - } - } - - $this->generator->saveSetting('custom_links_include_images', (bool) $form_state->getValue('include_images')); - parent::submitForm($form, $form_state); - - // Regenerate sitemaps according to user setting. - if ($form_state->getValue('simple_sitemap_regenerate_now')) { - $this->generator->rebuildQueue()->generateSitemap(); - } - } - - /** - * @param $custom_links_string - * @return array - */ - protected function stringToCustomLinks($custom_links_string) { - - // Unify newline characters and explode into array. - $custom_links_string_lines = explode("\n", str_replace("\r\n", "\n", $custom_links_string)); - - // Remove empty values and whitespaces from array. - $custom_links_string_lines = array_filter(array_map('trim', $custom_links_string_lines)); - - $custom_links = []; - foreach ($custom_links_string_lines as $i => &$line) { - $link_settings = explode(' ', $line); - $custom_links[$i]['path'] = $link_settings[0]; - - // If two arguments are provided for a link, assume the first to be - // priority, the second to be changefreq. - if (!empty($link_settings[1]) && !empty($link_settings[2])) { - $custom_links[$i]['priority'] = $link_settings[1]; - $custom_links[$i]['changefreq'] = $link_settings[2]; - } - else { - // If one argument is provided for a link, guess if it is priority or - // changefreq. - if (!empty($link_settings[1])) { - if (is_numeric($link_settings[1])) { - $custom_links[$i]['priority'] = $link_settings[1]; - } - else { - $custom_links[$i]['changefreq'] = $link_settings[1]; - } - } - } - } - return $custom_links; - } - - /** - * @param array $links - * @return string - */ - protected function customLinksToString(array $links) { - $setting_string = ''; - foreach ($links as $custom_link) { - $setting_string .= $custom_link['path']; - $setting_string .= isset($custom_link['priority']) - ? ' ' . $this->formHelper->formatPriority($custom_link['priority']) - : ''; - $setting_string .= isset($custom_link['changefreq']) - ? ' ' . $custom_link['changefreq'] - : ''; - $setting_string .= "\r\n"; - } - return $setting_string; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php deleted file mode 100644 index 190503c34..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php +++ /dev/null @@ -1,192 +0,0 @@ -entityHelper = $entity_helper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.form_helper'), - $container->get('simple_sitemap.entity_helper') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'simple_sitemap_entities_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $form['simple_sitemap_entities']['#prefix'] = $this->getDonationText(); - - $form['simple_sitemap_entities']['entities'] = [ - '#title' => $this->t('Sitemap entities'), - '#type' => 'fieldset', - '#markup' => '
' . $this->t('Simple XML sitemap settings will be added only to entity forms of entity types enabled here. For all entity types featuring bundles (e.g. node) sitemap settings have to be set on their bundle pages (e.g. page).') . '
', - ]; - - $form['#attached']['library'][] = 'simple_sitemap/sitemapEntities'; - $form['#attached']['drupalSettings']['simple_sitemap'] = ['all_entities' => [], 'atomic_entities' => []]; - - $entity_type_labels = []; - foreach ($this->entityHelper->getSupportedEntityTypes() as $entity_type_id => $entity_type) { - $entity_type_labels[$entity_type_id] = $entity_type->getLabel() ? : $entity_type_id; - } - asort($entity_type_labels); - - $this->formHelper->processForm($form_state); - - $bundle_settings = $this->generator->getBundleSettings(); - - foreach ($entity_type_labels as $entity_type_id => $entity_type_label) { -; - $enabled_entity_type = $this->generator->entityTypeIsEnabled($entity_type_id); - $atomic_entity_type = $this->entityHelper->entityTypeIsAtomic($entity_type_id); - $css_entity_type_id = str_replace('_', '-', $entity_type_id); - - $form['simple_sitemap_entities']['entities'][$entity_type_id] = [ - '#type' => 'details', - '#title' => $entity_type_label, - '#open' => $enabled_entity_type, - ]; - - $form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enable @entity_type_label (@entity_type_id) support', ['@entity_type_label' => strtolower($entity_type_label), '@entity_type_id' => $entity_type_id]), - '#description' => $atomic_entity_type - ? $this->t('Sitemap settings for the entity type @entity_type_label can be set below and overridden on its entity pages.', ['@entity_type_label' => strtolower($entity_type_label)]) - : $this->t('Sitemap settings for the entity type @entity_type_label can be set on its bundle pages and overridden on its entity pages.', ['@entity_type_label' => strtolower($entity_type_label)]), - '#default_value' => $enabled_entity_type, - ]; - - if ($form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled']['#default_value']) { - - $bundle_info = ''; - $indexed_bundles = isset($bundle_settings[$entity_type_id]) - ? implode(array_keys(array_filter($bundle_settings[$entity_type_id], function ($val) {return $val['index'];})), ', ') - : ''; - - if (!$atomic_entity_type) { - $bundle_info .= '
' - . (!empty($indexed_bundles) - ? $this->t("@entity_type_label bundles set to be indexed:", ['@entity_type_label' => ucfirst(strtolower($entity_type_label))]) . ' ' . '' . $indexed_bundles . '' - : $this->t('No @entity_type_label bundles are set to be indexed yet.', ['@entity_type_label' => strtolower($entity_type_label)])) - . '
'; - } - - if (!empty($indexed_bundles)) { - $bundle_info .= '
' - . ($atomic_entity_type - ? $this->t("Warning: This entity type's sitemap settings including per-entity overrides will be deleted after hitting Save.") - : $this->t("Warning: The sitemap settings for @bundles and any per-entity overrides will be deleted after hitting Save.", - ['@bundles' => $indexed_bundles])) - . '
'; - } - - $form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled']['#suffix'] = $bundle_info; - } - - $form['#attached']['drupalSettings']['simple_sitemap']['all_entities'][] = $css_entity_type_id; - - if ($atomic_entity_type) { - $this->formHelper->setEntityCategory('bundle') - ->setEntityTypeId($entity_type_id) - ->setBundleName($entity_type_id) - ->displayEntitySettings($form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_settings'], TRUE); - $form['#attached']['drupalSettings']['simple_sitemap']['atomic_entities'][] = $css_entity_type_id; - } - } - - $this->formHelper->displayRegenerateNow($form['simple_sitemap_entities']['entities']); - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - foreach ($values as $field_name => $value) { - if (substr($field_name, -strlen('_enabled')) === '_enabled') { - $entity_type_id = substr($field_name, 0, -8); - if ($value) { - $this->generator->enableEntityType($entity_type_id); - if ($this->entityHelper->entityTypeIsAtomic($entity_type_id)) { - - // Deleting bundle settings for old bundle. - // See simple_sitemap.module::simple_sitemap_entity_form_submit(). - // todo: This will not be necessary if "multiple variants pro bundle" is implemented. - if (isset($form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_settings'][$entity_type_id . '_simple_sitemap_variant']['#default_value'])) { - $old_variant = $form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_settings'][$entity_type_id . '_simple_sitemap_variant']['#default_value']; - if ($old_variant !== $values[$entity_type_id . '_simple_sitemap_variant']) { - $this->generator->setVariants($old_variant)->removeBundleSettings($entity_type_id); - } - } - - $this->generator - ->setVariants($values[$entity_type_id . '_simple_sitemap_variant']) - ->setBundleSettings($entity_type_id, $entity_type_id, [ - 'index' => TRUE, - 'priority' => $values[$entity_type_id . '_simple_sitemap_priority'], - 'changefreq' => $values[$entity_type_id . '_simple_sitemap_changefreq'], - 'include_images' => (bool) $values[$entity_type_id . '_simple_sitemap_include_images'], - ]); - } - } - else { - $this->generator->disableEntityType($entity_type_id); - } - } - } - parent::submitForm($form, $form_state); - - // Regenerate sitemaps according to user setting. - if ($form_state->getValue('simple_sitemap_regenerate_now')) { - $this->generator->generateSitemap(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapFormBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapFormBase.php deleted file mode 100644 index e796a7230..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapFormBase.php +++ /dev/null @@ -1,62 +0,0 @@ -generator = $generator; - $this->formHelper = $form_helper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.form_helper') - ); - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['simple_sitemap.settings']; - } - - /** - * - */ - protected function getDonationText() { - return '
' . $this->t('If you would like to say thanks and support the development of this module, a donation will be much appreciated.', ['@url' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5AFYRSBLGSC3W']) . '
'; - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapSettingsForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapSettingsForm.php deleted file mode 100644 index 92835b3e5..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapSettingsForm.php +++ /dev/null @@ -1,409 +0,0 @@ -languageManager = $language_manager; - $this->db = $database; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.form_helper'), - $container->get('language_manager'), - $container->get('database') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'simple_sitemap_settings_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $form['simple_sitemap_settings']['#prefix'] = $this->getDonationText(); - - $form['simple_sitemap_settings']['status'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Sitemap status'), - '#markup' => '
' . $this->t('Sitemaps can be regenerated on demand here.') . '
', - '#description' => $this->t('Variants can be configured here.', ['@url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/variants']), - ]; - - $form['simple_sitemap_settings']['status']['actions'] = [ - '#prefix' => '
', - '#suffix' => '
', - ]; - - $form['simple_sitemap_settings']['status']['actions']['regenerate_submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Generate from queue'), - '#submit' => ['::generateSitemap'], - '#validate' => [], - ]; - -// $form['simple_sitemap_settings']['status']['actions']['regenerate_backend_submit'] = [ -// '#type' => 'submit', -// '#value' => $this->t('Generate from queue (background)'), -// '#submit' => ['::generateSitemapBackend'], -// '#validate' => [], -// ]; - - $form['simple_sitemap_settings']['status']['actions']['rebuild_queue_submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Rebuild queue'), - '#submit' => ['::rebuildQueue'], - '#validate' => [], - ]; - - $form['simple_sitemap_settings']['status']['progress'] = [ - '#prefix' => '
', - '#suffix' => '
', - ]; - - $form['simple_sitemap_settings']['status']['progress']['title']['#markup'] = $this->t('Progress of sitemap regeneration'); - - $queue_worker = $this->generator->getQueueWorker(); - $total_count = $queue_worker->getInitialElementCount(); - if (!empty($total_count)) { - $indexed_count = $queue_worker->getProcessedElementCount(); - $percent = round(100 * $indexed_count / $total_count); - - // With all results processed, there still may be some stashed results to be indexed. - $percent = $percent === 100 && $queue_worker->generationInProgress() ? 99 : $percent; - - $index_progress = [ - '#theme' => 'progress_bar', - '#percent' => $percent, - '#message' => t('@indexed out of @total items have been processed.', ['@indexed' => $indexed_count, '@total' => $total_count]), - ]; - $form['simple_sitemap_settings']['status']['progress']['bar']['#markup'] = render($index_progress); - } - else { - $form['simple_sitemap_settings']['status']['progress']['bar']['#markup'] = '
' . $this->t('There are no items to be indexed.') . '
'; - } - - $sitemap_manager = $this->generator->getSitemapManager(); - $sitemap_statuses = $this->fetchSitemapInstanceStatuses(); - - foreach ($sitemap_manager->getSitemapTypes() as $type_name => $type_definition) { - if (!empty($variants = $sitemap_manager->getSitemapVariants($type_name, FALSE))) { - $form['simple_sitemap_settings']['status']['types'][$type_name] = [ - '#type' => 'details', - '#title' => '' . $type_definition['label'] . ' ' . $this->t('sitemaps'), - '#open' => !empty($variants) && count($variants) <= 5, - '#description' => !empty($type_definition['description']) ? '
' . $type_definition['description'] . '
' : '', - ]; - $form['simple_sitemap_settings']['status']['types'][$type_name]['table'] = [ - '#type' => 'table', - '#header' => [$this->t('Variant'), $this->t('Status'), /*$this->t('Actions')*/], - '#attributes' => ['class' => ['form-item', 'clearfix']], - ]; - foreach ($variants as $variant_name => $variant_definition) { - $row = []; - $row['name']['data']['#markup'] = '' . $variant_definition['label'] . ''; - if (!isset($sitemap_statuses[$variant_name])) { - $row['status'] = $this->t('pending'); - } - else { - $url = $GLOBALS['base_url'] . '/' . $variant_name . '/sitemap.xml'; - switch ($sitemap_statuses[$variant_name]) { - case 0: - $row['status'] = $this->t('generating'); - break; - case 1: - $row['status']['data']['#markup'] = $this->t('published', ['@url' => $url]); - break; - case 2: - $row['status'] = $this->t('published, regenerating', ['@url' => $url]); - break; - } - } - -// $row['actions'] = ''; - $form['simple_sitemap_settings']['status']['types'][$type_name]['table']['#rows'][$variant_name] = $row; - unset($sitemap_statuses[$variant_name]); - } - } - } - if (empty($form['simple_sitemap_settings']['status']['types'])) { - $form['simple_sitemap_settings']['status']['types']['#markup'] = $this->t('No variants have been defined'); - } - -/* if (!empty($sitemap_statuses)) { - $form['simple_sitemap_settings']['status']['types']['&orphans'] = [ - '#type' => 'details', - '#title' => $this->t('Orphans'), - '#open' => TRUE, - ]; - - $form['simple_sitemap_settings']['status']['types']['&orphans']['table'] = [ - '#type' => 'table', - '#header' => [$this->t('Variant'), $this->t('Status'), $this->t('Actions')], - ]; - foreach ($sitemap_statuses as $orphan_name => $orphan_info) { - $form['simple_sitemap_settings']['status']['types']['&orphans']['table']['#rows'][$orphan_name] = [ - 'name' => $orphan_name, - 'status' => $this->t('orphaned'), - 'actions' => '', - ]; - } - }*/ - - $form['simple_sitemap_settings']['settings'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Settings'), - ]; - - $form['simple_sitemap_settings']['settings']['cron_generate'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Regenerate the sitemaps during cron runs'), - '#description' => $this->t('Uncheck this if you intend to only regenerate the sitemaps manually or via drush.'), - '#default_value' => $this->generator->getSetting('cron_generate', TRUE), - ]; - - $form['simple_sitemap_settings']['settings']['cron_generate_interval'] = [ - '#type' => 'select', - '#title' => $this->t('Sitemap generation interval'), - '#description' => $this->t('The sitemap will be generated according to this interval.'), - '#default_value' => $this->generator->getSetting('cron_generate_interval', 0), - '#options' => [ - 0 => $this->t('On every cron run'), - 1 => $this->t('Once an hour'), - 3 => $this->t('Once every @hours hours', ['@hours' => 3]), - 6 => $this->t('Once every @hours hours', ['@hours' => 6]), - 12 => $this->t('Once every @hours hours', ['@hours' => 12]), - 24 => $this->t('Once a day'), - 48 => $this->t('Once every @days days', ['@days' => 48/24]), - 72 => $this->t('Once every @days days', ['@days' => 72/24]), - 96 => $this->t('Once every @days days', ['@days' => 96/24]), - 120 => $this->t('Once every @days days', ['@days' => 120/24]), - 144 => $this->t('Once every @days days', ['@days' => 144/24]), - 168 => $this->t('Once a week'), - ], - '#states' => [ - 'visible' => [ - ':input[name="cron_generate"]' => ['checked' => TRUE], - ], - ], - ]; - - $form['simple_sitemap_settings']['settings']['languages'] = [ - '#type' => 'details', - '#title' => $this->t('Language settings'), - '#open' => FALSE, - ]; - - $language_options = []; - foreach ($this->languageManager->getLanguages() as $language) { - if (!$language->isDefault()) { - $language_options[$language->getId()] = $language->getName(); - } - } - - $form['simple_sitemap_settings']['settings']['languages']['skip_untranslated'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Skip non-existent translations'), - '#description' => $this->t('If checked, entity links are generated exclusively for languages the entity has been translated to as long as the language is not excluded below.
Otherwise entity links are generated for every language installed on the site apart from languages excluded below.
Bear in mind that non-entity paths like homepage will always be generated for every non-excluded language.'), - '#default_value' => $this->generator->getSetting('skip_untranslated', FALSE), - ]; - - $form['simple_sitemap_settings']['settings']['languages']['excluded_languages'] = [ - '#title' => $this->t('Exclude languages'), - '#type' => 'checkboxes', - '#options' => $language_options, - '#description' => !empty($language_options) - ? $this->t('There will be no links generated for languages checked here.') - : $this->t('There are no languages other than the default language available.', ['@url' => $GLOBALS['base_url'] . '/admin/config/regional/language']), - '#default_value' => $this->generator->getSetting('excluded_languages', []), - ]; - - $form['simple_sitemap_settings']['advanced'] = [ - '#type' => 'details', - '#title' => $this->t('Advanced settings'), - '#open' => TRUE, - ]; - - $variants = $this->generator->getSitemapManager()->getSitemapVariants(NULL, FALSE); - $default_variant = $this->generator->getSetting('default_variant'); - $form['simple_sitemap_settings']['advanced']['default_variant'] = [ - '#type' => 'select', - '#title' => $this->t('Default sitemap variant'), - '#description' => $this->t('This sitemap variant will be available under /sitemap.xml in addition to its default path /variant-name/sitemap.xml.
Variants can be configured here.', ['@url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/variants']), - '#default_value' => isset($variants[$default_variant]) ? $default_variant : '', - '#options' => ['' => $this->t('- None -')] + array_map(function($variant) { return $this->t($variant['label']); }, $variants), - ]; - - $form['simple_sitemap_settings']['advanced']['base_url'] = [ - '#type' => 'textfield', - '#title' => $this->t('Default base URL'), - '#default_value' => $this->generator->getSetting('base_url', ''), - '#size' => 30, - '#description' => $this->t('On some hosting providers it is impossible to pass parameters to cron to tell Drupal which URL to bootstrap with. In this case the base URL of sitemap links can be overridden here.
Example: @url', ['@url' => $GLOBALS['base_url']]), - ]; - - $form['simple_sitemap_settings']['advanced']['remove_duplicates'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Exclude duplicate links'), - '#description' => $this->t('Prevent per-sitemap variant duplicate links.
Uncheck this to significantly speed up the sitemap generation process on a huge site (more than 20 000 indexed entities).'), - '#default_value' => $this->generator->getSetting('remove_duplicates', TRUE), - ]; - - $form['simple_sitemap_settings']['advanced']['max_links'] = [ - '#type' => 'number', - '#title' => $this->t('Maximum links in a sitemap'), - '#min' => 1, - '#description' => $this->t('The maximum number of links one sitemap can hold. If more links are generated than set here, a sitemap index will be created and the links split into several sub-sitemaps.
50 000 links is the maximum Google will parse per sitemap, but an equally important consideration is generation performance: Splitting sitemaps into chunks greatly increases it.
If left blank, all links will be shown on a single sitemap.'), - '#default_value' => $this->generator->getSetting('max_links'), - ]; - - $form['simple_sitemap_settings']['advanced']['generate_duration'] = [ - '#type' => 'number', - '#title' => $this->t('Sitemap generation max duration'), - '#min' => 1, - '#description' => $this->t('The maximum duration in seconds the generation task can run during a single cron run or during one batch process iteration.
The higher the number, the quicker the generation process, but higher the risk of PHP timeout errors.'), - '#default_value' => $this->generator->getSetting('generate_duration', 10000) / 1000, - '#required' => TRUE, - ]; - - $this->formHelper->displayRegenerateNow($form['simple_sitemap_settings']); - - return parent::buildForm($form, $form_state); - } - - /** - * @return array - * Array of sitemap statuses keyed by variant name. - * Status values: - * 0: Instance is unpublished - * 1: Instance is published - * 2: Instance is published but is being regenerated - */ - protected function fetchSitemapInstanceStatuses() { - $results = $this->db - ->query('SELECT type, status FROM {simple_sitemap} GROUP BY type, status') - ->fetchAll(); - - $instances = []; - foreach ($results as $i => $result) { - $instances[$result->type] = isset($instances[$result->type]) - ? $result->status + 1 - : (int) $result->status; - } - - return $instances; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $base_url = $form_state->getValue('base_url'); - $form_state->setValue('base_url', rtrim($base_url, '/')); - if ($base_url !== '' && !UrlHelper::isValid($base_url, TRUE)) { - $form_state->setErrorByName('base_url', t('The base URL is invalid.')); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - foreach (['max_links', - 'cron_generate', - 'cron_generate_interval', - 'remove_duplicates', - 'skip_untranslated', - 'base_url', - 'default_variant'] as $setting_name) { - $this->generator->saveSetting($setting_name, $form_state->getValue($setting_name)); - } - $this->generator->saveSetting('excluded_languages', array_filter($form_state->getValue('excluded_languages'))); - $this->generator->saveSetting('generate_duration', $form_state->getValue('generate_duration') * 1000); - - parent::submitForm($form, $form_state); - - // Regenerate sitemaps according to user setting. - if ($form_state->getValue('simple_sitemap_regenerate_now')) { - $this->generator->rebuildQueue()->generateSitemap(); - } - } - - /** - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function generateSitemap(array &$form, FormStateInterface $form_state) { - $this->generator->generateSitemap(); - } - - /** - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function generateSitemapBackend (array &$form, FormStateInterface $form_state) { - $this->generator->generateSitemap('backend'); - } - - - /** - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function rebuildQueue(array &$form, FormStateInterface $form_state) { - $this->generator->rebuildQueue(); - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php deleted file mode 100644 index d1e1ac533..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php +++ /dev/null @@ -1,147 +0,0 @@ - $this->t('Sitemap variants'), - '#type' => 'fieldset', - '#markup' => '
' . $this->t('Define sitemap variants. A sitemap variant is a sitemap instance of a certain type (specific sitemap generator and URL generators) accessible under a certain URL.
Each variant can have its own entity bundle settings (to be defined on bundle edit pages).') . '
', - '#prefix' => $this->getDonationText(), - ]; - - $form['simple_sitemap_variants']['variants'] = [ - '#type' => 'textarea', - '#title' => $this->t('Variants'), - '#default_value' => $this->variantsToString($this->generator->getSitemapManager()->getSitemapVariants(NULL, TRUE)), - '#description' => $this->t("Please specify sitemap variants, one per line. Caution: Removing variants here will delete their bundle settings, custom links and corresponding sitemap instances.

A variant definition consists of the variant name (used as the variant's path), the sitemap type it belongs to (optional) and the variant label (optional). These three values have to be separated by the | pipe | symbol.

Examples:
default | default_hreflang | Default -> variant of the default_hreflang sitemap type and Default as label; accessible under /default/sitemap.xml
test -> variant of the @default_sitemap_type sitemap type and test as label; accessible under /test/sitemap.xml

Available sitemap types:", ['@default_sitemap_type' => SimplesitemapManager::DEFAULT_SITEMAP_TYPE]), - ]; - - foreach ($this->generator->getSitemapManager()->getSitemapTypes() as $sitemap_type => $definition) { - $form['simple_sitemap_variants']['variants']['#description'] .= '
' . '' . $sitemap_type . '' . (!empty($definition['description']) ? (': ' . $definition['description']) : ''); - } - - $this->formHelper->displayRegenerateNow($form['simple_sitemap_custom']); - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - * - * @todo Show multiple errors at once. - * @todo Allow numeric variant names, but bear in mind that they are stored as integer array keys due to how php arrays work. - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $line = 0; - $sitemap_types = $this->generator->getSitemapManager()->getSitemapTypes(); - foreach ($this->stringToVariants($form_state->getValue('variants')) as $variant_name => $variant_definition) { - $placeholders = [ - '@line' => ++$line, - '@name' => $variant_name, - '@type' => isset($variant_definition['type']) ? $variant_definition['type'] : '', - '@label' => isset($variant_definition['label']) ? $variant_definition['label'] : '', - ]; - - if (trim($variant_name) === '') { - $form_state->setErrorByName('', $this->t("Line @line: The variant name cannot be empty.", $placeholders)); - } - - if (!preg_match('/^[\w-_]+$/', $variant_name)) { - $form_state->setErrorByName('', $this->t("Line @line: The variant name @name can only include alphanumeric characters, dashes and underscores.", $placeholders)); - } - - if (is_numeric($variant_name)) { - $form_state->setErrorByName('', $this->t("Line @line: The variant name cannot be numeric.", $placeholders)); - } - - if (!isset($sitemap_types[$variant_definition['type']])) { - $form_state->setErrorByName('', $this->t("Line @line: The variant @name is of a sitemap type @type that does not exist.", $placeholders)); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $manager = $this->generator->getSitemapManager(); - $new_variants = $this->stringToVariants($form_state->getValue('variants')); - $remove_variants = array_values(array_diff( - array_keys($manager->getSitemapVariants(NULL, FALSE)), - array_keys($new_variants) - )); - $manager->removeSitemapVariants($remove_variants); - $weight = 0; - foreach ($new_variants as $variant_name => $variant_definition) { - $manager->addSitemapVariant($variant_name, $variant_definition + ['weight' => $weight]); - $weight++; - } - - parent::submitForm($form, $form_state); - - // Regenerate sitemaps according to user setting. - if ($form_state->getValue('simple_sitemap_regenerate_now')) { - $this->generator->setVariants(TRUE) - ->rebuildQueue() - ->generateSitemap(); - } - } - - /** - * @param $variant_string - * @return array - */ - protected function stringToVariants($variant_string) { - - // Unify newline characters and explode into array. - $variants_string_lines = explode("\n", str_replace("\r\n", "\n", $variant_string)); - - // Remove empty values and whitespaces from array. - $variants_string_lines = array_filter(array_map('trim', $variants_string_lines)); - - $variants = []; - foreach ($variants_string_lines as $i => &$line) { - $variant_settings = explode('|', $line); - $name = strtolower(trim($variant_settings[0])); - $variants[$name]['type'] = !empty($variant_settings[1]) ? trim($variant_settings[1]) : SimplesitemapManager::DEFAULT_SITEMAP_TYPE; - $variants[$name]['label'] = !empty($variant_settings[2]) ? trim($variant_settings[2]) : $name; - } - return $variants; - } - - /** - * @param array $variants - * @return string - */ - protected function variantsToString(array $variants) { - $variants_string = ''; - foreach ($variants as $variant_name => $variant_definition) { - $variants_string .= $variant_name - . ' | ' . $variant_definition['type'] - . ' | ' . $variant_definition['label'] - . "\r\n"; - } - return $variants_string; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php deleted file mode 100644 index 42c6daa9f..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php +++ /dev/null @@ -1,100 +0,0 @@ -logger = $logger; - $this->messenger = $messenger; - $this->currentUser = $current_user; - } - - /** - * @param $message - * @param array $substitutions - * @return $this - */ - public function m($message, $substitutions = []) { - $this->message = $message; - $this->substitutions = $substitutions; - return $this; - } - - /** - * @param string $logSeverityLevel - * @return $this - */ - public function log($logSeverityLevel = self::LOG_SEVERITY_LEVEL_DEFAULT) { - $this->logger->$logSeverityLevel(strtr($this->message, $this->substitutions)); - return $this; - } - - /** - * @param string $displayMessageType - * @param string $permission - * @return $this - */ - public function display($displayMessageType = self::DISPLAY_MESSAGE_TYPE_DEFAULT, $permission = '') { - if (empty($permission) || $this->currentUser->hasPermission($permission)) { - $this->messenger->addMessage($this->t($this->message, $this->substitutions), $displayMessageType); - } - return $this; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php b/sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php deleted file mode 100644 index f0999cccc..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php +++ /dev/null @@ -1,25 +0,0 @@ - self::XMLNS, - 'xmlns:xhtml' => self::XMLNS_XHTML, - 'xmlns:image' => self::XMLNS_IMAGE, - ]; - - /** - * DefaultSitemapGenerator constructor. - * @param array $configuration - * @param string $plugin_id - * @param mixed $plugin_definition - * @param \Drupal\Core\Database\Connection $database - * @param \Drupal\Core\Extension\ModuleHandler $module_handler - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * @param \Drupal\Component\Datetime\Time $time - * @param \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapWriter $sitemapWriter - */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - Connection $database, - ModuleHandler $module_handler, - LanguageManagerInterface $language_manager, - Time $time, - SitemapWriter $sitemapWriter - ) { - parent::__construct( - $configuration, - $plugin_id, - $plugin_definition, - $database, - $module_handler, - $language_manager, - $time, - $sitemapWriter - ); - } - - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('database'), - $container->get('module_handler'), - $container->get('language_manager'), - $container->get('datetime.time'), - $container->get('simple_sitemap.sitemap_writer') - ); - } - - /** - * Generates and returns a sitemap chunk. - * - * @param array $links - * All links with their multilingual versions and settings. - * - * @return string - * Sitemap chunk - */ - protected function getXml(array $links) { - $this->writer->openMemory(); - $this->writer->setIndent(TRUE); - $this->writer->startDocument(self::XML_VERSION, self::ENCODING); - $this->writer->writeComment(self::GENERATED_BY); - $this->writer->startElement('urlset'); - - // Add attributes to document. - $attributes = self::$attributes; - if (!$this->isHreflangSitemap()) { - unset($attributes['xmlns:xhtml']); - } - $sitemap_variant = $this->sitemapVariant; - $this->moduleHandler->alter('simple_sitemap_attributes', $attributes, $sitemap_variant); - foreach ($attributes as $name => $value) { - $this->writer->writeAttribute($name, $value); - } - - // Add URLs to document. - $sitemap_variant = $this->sitemapVariant; - $this->moduleHandler->alter('simple_sitemap_links', $links, $sitemap_variant); - foreach ($links as $link) { - - // Add each translation variant URL as location to the sitemap. - $this->writer->startElement('url'); - $this->writer->writeElement('loc', $link['url']); - - // If more than one language is enabled, add all translation variant URLs - // as alternate links to this location turning the sitemap into a hreflang - // sitemap. - if (isset($link['alternate_urls']) && $this->isHreflangSitemap()) { - foreach ($link['alternate_urls'] as $language_id => $alternate_url) { - $this->writer->startElement('xhtml:link'); - $this->writer->writeAttribute('rel', 'alternate'); - $this->writer->writeAttribute('hreflang', $language_id); - $this->writer->writeAttribute('href', $alternate_url); - $this->writer->endElement(); - } - } - - // Add lastmod if any. - if (isset($link['lastmod'])) { - $this->writer->writeElement('lastmod', $link['lastmod']); - } - - // Add changefreq if any. - if (isset($link['changefreq'])) { - $this->writer->writeElement('changefreq', $link['changefreq']); - } - - // Add priority if any. - if (isset($link['priority'])) { - $this->writer->writeElement('priority', $link['priority']); - } - - // Add images if any. - if (!empty($link['images'])) { - foreach ($link['images'] as $image) { - $this->writer->startElement('image:image'); - $this->writer->writeElement('image:loc', $image['path']); - $this->writer->endElement(); - } - } - - $this->writer->endElement(); - } - $this->writer->endElement(); - $this->writer->endDocument(); - - return $this->writer->outputMemory(); - } - - /** - * @return bool - */ - protected function isHreflangSitemap() { - if (NULL === $this->isHreflangSitemap) { - $this->isHreflangSitemap = count( - array_diff_key($this->languageManager->getLanguages(), - $this->settings['excluded_languages']) - ) > 1; - } - return $this->isHreflangSitemap; - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php deleted file mode 100644 index 952453465..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php +++ /dev/null @@ -1,303 +0,0 @@ - self::XMLNS, - ]; - - /** - * SitemapGeneratorBase constructor. - * @param array $configuration - * @param string $plugin_id - * @param mixed $plugin_definition - * @param \Drupal\Core\Database\Connection $database - * @param \Drupal\Core\Extension\ModuleHandler $module_handler - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * @param \Drupal\Component\Datetime\Time $time - * @param \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapWriter $sitemap_writer - */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - Connection $database, - ModuleHandler $module_handler, - LanguageManagerInterface $language_manager, - Time $time, - SitemapWriter $sitemap_writer - ) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->db = $database; - $this->moduleHandler = $module_handler; - $this->languageManager = $language_manager; - $this->time = $time; - $this->writer = $sitemap_writer; - $this->sitemapVariant = $this->settings['default_variant']; - } - - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('database'), - $container->get('module_handler'), - $container->get('language_manager'), - $container->get('datetime.time'), - $container->get('simple_sitemap.sitemap_writer') - ); - } - - /** - * @param string $sitemap_variant - * @return $this - */ - public function setSitemapVariant($sitemap_variant) { - $this->sitemapVariant = $sitemap_variant; - return $this; - } - - /** - * @return bool - */ - protected function isDefaultVariant() { - return $this->sitemapVariant === $this->settings['default_variant']; - } - - /** - * @param array $links - * @return string - */ - abstract protected function getXml(array $links); - - protected function getChunkInfo() { - return $this->db->select('simple_sitemap', 's') - ->fields('s', ['delta', 'sitemap_created', 'type']) - ->condition('s.type', $this->sitemapVariant) - ->condition('s.delta', self::INDEX_DELTA, '<>') - ->condition('s.status', 0) - ->execute() - ->fetchAllAssoc('delta'); - } - - /** - * @param array $chunk_info - * @return string - */ - protected function getIndexXml(array $chunk_info) { - $this->writer->openMemory(); - $this->writer->setIndent(TRUE); - $this->writer->startDocument(self::XML_VERSION, self::ENCODING); - $this->writer->writeComment(self::GENERATED_BY); - $this->writer->startElement('sitemapindex'); - - // Add attributes to document. - $attributes = self::$indexAttributes; - $sitemap_variant = $this->sitemapVariant; - $this->moduleHandler->alter('simple_sitemap_index_attributes', $attributes, $sitemap_variant); - foreach ($attributes as $name => $value) { - $this->writer->writeAttribute($name, $value); - } - - // Add sitemap chunk locations to document. - foreach ($chunk_info as $chunk_data) { - $this->writer->startElement('sitemap'); - $this->writer->writeElement('loc', $this->getCustomBaseUrl() - . '/' . (!$this->isDefaultVariant() ? ($chunk_data->type . '/') : '') . 'sitemap.xml?page=' . $chunk_data->delta); - $this->writer->writeElement('lastmod', date_iso8601($chunk_data->sitemap_created)); - $this->writer->endElement(); - } - - $this->writer->endElement(); - $this->writer->endDocument(); - - return $this->writer->outputMemory(); - } - - /** - * @param string $mode - * @return $this - */ - public function remove($mode = 'all') { - self::purgeSitemapVariants($this->sitemapVariant, $mode); - - return $this; - } - - public static function purgeSitemapVariants($variants = NULL, $mode = 'all') { - if (NULL === $variants || !empty((array) $variants)) { - $delete_query = \Drupal::database()->delete('simple_sitemap'); - - switch($mode) { - case 'published': - $delete_query->condition('status', 1); - break; - - case 'unpublished': - $delete_query->condition('status', 0); - break; - - case 'all': - break; - - default: - //todo: throw error - } - - if (NULL !== $variants) { - $delete_query->condition('type', (array) $variants, 'IN'); - } - - $delete_query->execute(); - } - } - - /** - * @param array $links - * @return $this - * @throws \Exception - */ - public function generate(array $links) { - $highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField(); - $highest_delta = $this->db->query('SELECT MAX(delta) FROM {simple_sitemap} WHERE type = :type AND status = :status', [':type' => $this->sitemapVariant, ':status' => 0]) - ->fetchField(); - - $this->db->insert('simple_sitemap')->fields([ - 'id' => NULL === $highest_id ? 0 : $highest_id + 1, - 'delta' => NULL === $highest_delta ? self::FIRST_CHUNK_DELTA : $highest_delta + 1, - 'type' => $this->sitemapVariant, - 'sitemap_string' => $this->getXml($links), - 'sitemap_created' => $this->time->getRequestTime(), - 'status' => 0, - ])->execute(); - - return $this; - } - - /** - * @return $this - * @throws \Exception - */ - public function generateIndex() { - if (!empty($chunk_info = $this->getChunkInfo()) && count($chunk_info) > 1) { - $index_xml = $this->getIndexXml($chunk_info); - $highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField(); - $this->db->merge('simple_sitemap') - ->keys([ - 'delta' => self::INDEX_DELTA, - 'type' => $this->sitemapVariant, - 'status' => 0 - ]) - ->insertFields([ - 'id' => NULL === $highest_id ? 0 : $highest_id + 1, - 'delta' => self::INDEX_DELTA, - 'type' => $this->sitemapVariant, - 'sitemap_string' => $index_xml, - 'sitemap_created' => $this->time->getRequestTime(), - 'status' => 0, - ]) - ->updateFields([ - 'sitemap_string' => $index_xml, - 'sitemap_created' => $this->time->getRequestTime(), - ]) - ->execute(); - } - - return $this; - } - - /** - * @return $this - */ - public function publish() { - $unpublished_chunk = $this->db->query('SELECT MAX(id) FROM {simple_sitemap} WHERE type = :type AND status = :status', [':type' => $this->sitemapVariant, ':status' => 0]) - ->fetchField(); - - // Only allow publishing a sitemap variant if there is an unpublished - // sitemap variant, as publishing involves deleting the currently published - // variant. - if (FALSE !== $unpublished_chunk) { - $this->remove('published'); - $this->db->query('UPDATE {simple_sitemap} SET status = :status WHERE type = :type', [':type' => $this->sitemapVariant, ':status' => 1]); - } - - return $this; - } - - /** - * @param array $settings - * @return $this - */ - public function setSettings(array $settings) { - $this->settings = $settings; - return $this; - } - - /** - * @return string - */ - protected function getCustomBaseUrl() { - $customBaseUrl = $this->settings['base_url']; - return !empty($customBaseUrl) ? $customBaseUrl : $GLOBALS['base_url']; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php deleted file mode 100644 index a44095a33..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -alterInfo('simple_sitemap_sitemap_generators'); - $this->setCacheBackend($cache_backend, 'simple_sitemap:sitemap_generator'); - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php deleted file mode 100644 index 7085162b6..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php +++ /dev/null @@ -1,13 +0,0 @@ -alterInfo('simple_sitemap_sitemap_types'); - $this->setCacheBackend($cache_backend, 'simple_sitemap:sitemap_type'); - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php deleted file mode 100644 index 5e30fde3e..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php +++ /dev/null @@ -1,82 +0,0 @@ -moduleHandler = $module_handler; - } - - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.logger'), - $container->get('module_handler') - ); - } - - /** - * @inheritdoc - */ - public function getDataSets() { - $arbitrary_links = []; - $sitemap_variant = $this->sitemapVariant; - $this->moduleHandler->alter('simple_sitemap_arbitrary_links', $arbitrary_links, $sitemap_variant); - return array_values($arbitrary_links); - } - - /** - * @inheritdoc - */ - protected function processDataSet($data_set) { - return $data_set; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php deleted file mode 100644 index 98d90a737..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php +++ /dev/null @@ -1,143 +0,0 @@ -here.'; - - - /** - * @var \Drupal\Core\Path\PathValidator - */ - protected $pathValidator; - - /** - * @var bool - */ - protected $includeImages; - - /** - * CustomUrlGenerator constructor. - * @param array $configuration - * @param $plugin_id - * @param $plugin_definition - * @param \Drupal\simple_sitemap\Simplesitemap $generator - * @param \Drupal\simple_sitemap\Logger $logger - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * @param \Drupal\simple_sitemap\EntityHelper $entityHelper - * @param \Drupal\Core\Path\PathValidator $path_validator - */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - Simplesitemap $generator, - Logger $logger, - LanguageManagerInterface $language_manager, - EntityTypeManagerInterface $entity_type_manager, - EntityHelper $entityHelper, - PathValidator $path_validator) { - parent::__construct( - $configuration, - $plugin_id, - $plugin_definition, - $generator, - $logger, - $language_manager, - $entity_type_manager, - $entityHelper - ); - $this->pathValidator = $path_validator; - } - - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.logger'), - $container->get('language_manager'), - $container->get('entity_type.manager'), - $container->get('simple_sitemap.entity_helper'), - $container->get('path.validator') - ); - } - - /** - * @inheritdoc - */ - public function getDataSets() { - $this->includeImages = $this->generator->getSetting('custom_links_include_images', FALSE); - return array_values($this->generator->setVariants($this->sitemapVariant)->getCustomLinks()); - } - - /** - * @inheritdoc - */ - protected function processDataSet($data_set) { - if (!(bool) $this->pathValidator->getUrlIfValidWithoutAccessCheck($data_set['path'])) { - $this->logger->m(self::PATH_DOES_NOT_EXIST_MESSAGE, - ['@path' => $data_set['path'], '@custom_paths_url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/custom']) - ->display('warning', 'administer sitemap settings') - ->log('warning'); - return FALSE; - } - - $url_object = Url::fromUserInput($data_set['path'], ['absolute' => TRUE]); - $path = $url_object->getInternalPath(); - - $entity = $this->entityHelper->getEntityFromUrlObject($url_object); - - $path_data = [ - 'url' => $url_object, - 'lastmod' => method_exists($entity, 'getChangedTime') - ? date_iso8601($entity->getChangedTime()) : NULL, - 'priority' => isset($data_set['priority']) ? $data_set['priority'] : NULL, - 'changefreq' => !empty($data_set['changefreq']) ? $data_set['changefreq'] : NULL, - 'images' => $this->includeImages && method_exists($entity, 'getEntityTypeId') - ? $this->getImages($entity->getEntityTypeId(), $entity->id()) - : [], - 'meta' => [ - 'path' => $path, - ] - ]; - - // Additional info useful in hooks. - if (NULL !== $entity) { - $path_data['meta']['entity_info'] = [ - 'entity_type' => $entity->getEntityTypeId(), - 'id' => $entity->id(), - ]; - } - - return $path_data; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php deleted file mode 100644 index ab3ddd3d1..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php +++ /dev/null @@ -1,198 +0,0 @@ -menuLinkTree = $menu_link_tree; - } - - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.logger'), - $container->get('language_manager'), - $container->get('entity_type.manager'), - $container->get('simple_sitemap.entity_helper'), - $container->get('menu.link_tree') - ); - } - - /** - * @inheritdoc - */ - public function getDataSets() { - $data_sets = []; - $bundle_settings = $this->generator - ->setVariants($this->sitemapVariant) - ->getBundleSettings(); - if (!empty($bundle_settings['menu_link_content'])) { - foreach ($bundle_settings['menu_link_content'] as $bundle_name => $bundle_settings) { - if (!empty($bundle_settings['index'])) { - - // Retrieve the expanded tree. - $tree = $this->menuLinkTree->load($bundle_name, new MenuTreeParameters()); - $tree = $this->menuLinkTree->transform($tree, [ - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - ['callable' => 'menu.default_tree_manipulators:flatten'], - ]); - - foreach ($tree as $i => $item) { - $data_sets[] = $item->link; - } - } - } - } - - return $data_sets; - } - - /** - * @inheritdoc - * - * @todo Check if menu link has not been deleted after the queue has been built. - */ - protected function processDataSet($data_set) { - - /** @var MenuLinkBase $data_set */ - if (!$data_set->isEnabled()) { - return FALSE; - } - - $url_object = $data_set->getUrlObject(); - - // Do not include external paths. - if ($url_object->isExternal()) { - return FALSE; - } - - // If not a menu_link_content link, use bundle settings. - $meta_data = $data_set->getMetaData(); - if (empty($meta_data['entity_id'])) { - $entity_settings = $this->generator - ->setVariants($this->sitemapVariant) - ->getBundleSettings('menu_link_content', $data_set->getMenuName()); - } - - // If menu link is of entity type menu_link_content, take under account its entity override. - else { - $entity_settings = $this->generator->getEntityInstanceSettings('menu_link_content', $meta_data['entity_id']); - - if (empty($entity_settings['index'])) { - return FALSE; - } - } - - // There can be internal paths that are not rooted, like 'base:/path'. - if ($url_object->isRouted()) { - $path = $url_object->getInternalPath(); - } - else { // Handle base scheme. - if (strpos($uri = $url_object->toUriString(), 'base:/') === 0 ) { - $path = $uri[6] === '/' ? substr($uri, 7) : substr($uri, 6); - } - else { // Handle unforeseen schemes. - $path = $uri; - } - } - - $url_object->setOption('absolute', TRUE); - - $entity = $this->entityHelper->getEntityFromUrlObject($url_object); - - $path_data = [ - 'url' => $url_object, - 'lastmod' => !empty($entity) && method_exists($entity, 'getChangedTime') - ? date_iso8601($entity->getChangedTime()) - : NULL, - 'priority' => isset($entity_settings['priority']) ? $entity_settings['priority'] : NULL, - 'changefreq' => !empty($entity_settings['changefreq']) ? $entity_settings['changefreq'] : NULL, - 'images' => !empty($entity_settings['include_images']) && !empty($entity) - ? $this->getImages($entity->getEntityTypeId(), $entity->id()) - : [], - - // Additional info useful in hooks. - 'meta' => [ - 'path' => $path, - ] - ]; - if (!empty($entity)) { - $path_data['meta']['entity_info'] = [ - 'entity_type' => $entity->getEntityTypeId(), - 'id' => $entity->id(), - ]; - } - - return $path_data; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php deleted file mode 100644 index 7f3d52838..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php +++ /dev/null @@ -1,181 +0,0 @@ -urlGeneratorManager = $url_generator_manager; - } - - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.logger'), - $container->get('language_manager'), - $container->get('entity_type.manager'), - $container->get('simple_sitemap.entity_helper'), - $container->get('plugin.manager.simple_sitemap.url_generator') - ); - } - - /** - * @inheritdoc - */ - public function getDataSets() { - $data_sets = []; - $sitemap_entity_types = $this->entityHelper->getSupportedEntityTypes(); - - foreach ($this->generator->setVariants($this->sitemapVariant)->getBundleSettings() as $entity_type_name => $bundles) { - if (isset($sitemap_entity_types[$entity_type_name])) { - - // Skip this entity type if another plugin is written to override its generation. - foreach ($this->urlGeneratorManager->getDefinitions() as $plugin) { - if (isset($plugin['settings']['overrides_entity_type']) - && $plugin['settings']['overrides_entity_type'] === $entity_type_name) { - continue 2; - } - } - - $entityTypeStorage = $this->entityTypeManager->getStorage($entity_type_name); - $keys = $sitemap_entity_types[$entity_type_name]->getKeys(); - - foreach ($bundles as $bundle_name => $bundle_settings) { - if (!empty($bundle_settings['index'])) { - $query = $entityTypeStorage->getQuery(); - - if (empty($keys['id'])) { - $query->sort($keys['id'], 'ASC'); - } - if (!empty($keys['bundle'])) { - $query->condition($keys['bundle'], $bundle_name); - } - if (!empty($keys['status'])) { - $query->condition($keys['status'], 1); - } - - foreach ($query->execute() as $entity_id) { - $data_sets[] = [ - 'entity_type' => $entity_type_name, - 'id' => $entity_id, - ]; - } - } - } - } - } - - return $data_sets; - } - - /** - * @inheritdoc - */ - protected function processDataSet($data_set) { - if (empty($entity = $this->entityTypeManager->getStorage($data_set['entity_type'])->load($data_set['id']))) { - return FALSE; - } - - $entity_id = $entity->id(); - $entity_type_name = $entity->getEntityTypeId(); - - $entity_settings = $this->generator - ->setVariants($this->sitemapVariant) - ->getEntityInstanceSettings($entity_type_name, $entity_id); - - if (empty($entity_settings['index'])) { - return FALSE; - } - - $url_object = $entity->toUrl(); - - // Do not include external paths. - if (!$url_object->isRouted()) { - return FALSE; - } - - $path = $url_object->getInternalPath(); - - $url_object->setOption('absolute', TRUE); - - return [ - 'url' => $url_object, - 'lastmod' => method_exists($entity, 'getChangedTime') ? date_iso8601($entity->getChangedTime()) : NULL, - 'priority' => isset($entity_settings['priority']) ? $entity_settings['priority'] : NULL, - 'changefreq' => !empty($entity_settings['changefreq']) ? $entity_settings['changefreq'] : NULL, - 'images' => !empty($entity_settings['include_images']) - ? $this->getImages($entity_type_name, $entity_id) - : [], - - // Additional info useful in hooks. - 'meta' => [ - 'path' => $path, - 'entity_info' => [ - 'entity_type' => $entity_type_name, - 'id' => $entity_id, - ], - ] - ]; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php deleted file mode 100644 index 693cbfbf6..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php +++ /dev/null @@ -1,218 +0,0 @@ -languages = $language_manager->getLanguages(); - $this->defaultLanguageId = $language_manager->getDefaultLanguage()->getId(); - $this->entityTypeManager = $entity_type_manager; - $this->anonUser = new AnonymousUserSession(); - $this->entityHelper = $entityHelper; - } - - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.logger'), - $container->get('language_manager'), - $container->get('entity_type.manager'), - $container->get('simple_sitemap.entity_helper') - ); - } - - /** - * @param array $path_data - * @param \Drupal\Core\Url $url_object - * @return array - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - protected function getUrlVariants(array $path_data, Url $url_object) { - $url_variants = []; - - if (!$url_object->isRouted()) { - // Not a routed URL, including only default variant. - $alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object); - } - elseif ($this->settings['skip_untranslated'] - && ($entity = $this->entityHelper->getEntityFromUrlObject($url_object)) instanceof ContentEntityBase) { - - /** @var ContentEntityBase $entity */ - $translation_languages = $entity->getTranslationLanguages(); - if (isset($translation_languages[Language::LANGCODE_NOT_SPECIFIED]) - || isset($translation_languages[Language::LANGCODE_NOT_APPLICABLE])) { - - // Content entity's language is unknown, including only default variant. - $alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object); - } - else { - // Including only translated variants of content entity. - $alternate_urls = $this->getAlternateUrlsForTranslatedLanguages($entity, $url_object); - } - } - else { - // Not a content entity or including all untranslated variants. - $alternate_urls = $this->getAlternateUrlsForAllLanguages($url_object); - } - - foreach ($alternate_urls as $langcode => $url) { - $url_variants[] = $path_data + [ - 'langcode' => $langcode, - 'url' => $url, - 'alternate_urls' => $alternate_urls - ]; - } - - return $url_variants; - } - - /** - * @param \Drupal\Core\Url $url_object - * @return array - */ - protected function getAlternateUrlsForDefaultLanguage(Url $url_object) { - $alternate_urls = []; - if ($url_object->access($this->anonUser)) { - $alternate_urls[$this->defaultLanguageId] = $this->replaceBaseUrlWithCustom($url_object - ->setOption('language', $this->languages[$this->defaultLanguageId])->toString() - ); - } - return $alternate_urls; - } - - /** - * @param \Drupal\Core\Entity\ContentEntityBase $entity - * @param \Drupal\Core\Url $url_object - * @return array - */ - protected function getAlternateUrlsForTranslatedLanguages(ContentEntityBase $entity, Url $url_object) { - $alternate_urls = []; - - /** @var Language $language */ - foreach ($entity->getTranslationLanguages() as $language) { - if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) { - if ($entity->getTranslation($language->getId())->access('view', $this->anonUser)) { - $alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object - ->setOption('language', $language)->toString() - ); - } - } - } - return $alternate_urls; - } - - /** - * @param \Drupal\Core\Url $url_object - * @return array - */ - protected function getAlternateUrlsForAllLanguages(Url $url_object) { - $alternate_urls = []; - if ($url_object->access($this->anonUser)) { - foreach ($this->languages as $language) { - if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) { - $alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object - ->setOption('language', $language)->toString() - ); - } - } - } - return $alternate_urls; - } - - /** - * @param mixed $data_set - * @return array - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - public function generate($data_set) { - $path_data = $this->processDataSet($data_set); - if (isset($path_data['url']) && $path_data['url'] instanceof Url) { - $url_object = $path_data['url']; - unset($path_data['url']); - return $this->getUrlVariants($path_data, $url_object); - } - else { - return FALSE !== $path_data ? [$path_data] : []; - } - } - - /** - * @param string $entity_type_name - * @param string $entity_id - * @return array - */ - protected function getImages($entity_type_name, $entity_id) { - $images = []; - foreach ($this->entityHelper->getEntityImageUrls($entity_type_name, $entity_id) as $url) { - $images[]['path'] = $this->replaceBaseUrlWithCustom($url); - } - return $images; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php deleted file mode 100644 index 16255ecc8..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php +++ /dev/null @@ -1,113 +0,0 @@ -generator = $generator; - $this->logger = $logger; - } - - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('simple_sitemap.generator'), - $container->get('simple_sitemap.logger') - ); - } - - /** - * @param array $settings - * @return $this - */ - public function setSettings(array $settings) { - $this->settings = $settings; - return $this; - } - - /** - * @param string $sitemap_variant - * @return $this - */ - public function setSitemapVariant($sitemap_variant) { - $this->sitemapVariant = $sitemap_variant; - return $this; - } - - /** - * @param string $url - * @return string - */ - protected function replaceBaseUrlWithCustom($url) { - return !empty($this->settings['base_url']) - ? str_replace($GLOBALS['base_url'], $this->settings['base_url'], $url) - : $url; - } - - /** - * @return mixed - */ - abstract public function getDataSets(); - - /** - * @param $data_set - * @return mixed - */ - abstract protected function processDataSet($data_set); - - /** - * @param $data_set - * @return array - */ - public function generate($data_set) { - $path_data = $this->processDataSet($data_set); - return FALSE !== $path_data ? [$path_data] : []; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php deleted file mode 100644 index 97a612719..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -alterInfo('simple_sitemap_url_generators'); - $this->setCacheBackend($cache_backend, 'simple_sitemap:url_generator'); - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php deleted file mode 100644 index 4bb5dad5f..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php +++ /dev/null @@ -1,102 +0,0 @@ -batch = [ - 'title' => $this->t('Generating XML sitemaps'), - 'init_message' => $this->t('Initializing...'), - 'error_message' => $this->t(self::$batchErrorMessage), - 'progress_message' => $this->t('Processing items from queue. Each sitemap variant is published as soon as its items have been processed.'), - 'operations' => [[ __CLASS__ . '::' . 'doBatchGenerateSitemap', []]], - 'finished' => [__CLASS__, 'finishGeneration'], - ]; - - switch ($from) { - - case 'form': - // Start batch process. - batch_set($this->batch); - return TRUE; - - case 'drush': - // Start drush batch process. - batch_set($this->batch); - - // See https://www.drupal.org/node/638712 - $this->batch =& batch_get(); - $this->batch['progressive'] = FALSE; - - drush_backend_batch_process(); - return TRUE; - } - return FALSE; - } - - /** - * @param $context - * @throws \Drupal\Component\Plugin\Exception\PluginException - * - * @todo Make sure batch does not run at the same time as cron. - * @todo Variants into generateSitemap(). - */ - public static function doBatchGenerateSitemap(&$context) { - - /** @var \Drupal\simple_sitemap\Queue\QueueWorker $queue_worker */ - $queue_worker = \Drupal::service('simple_sitemap.queue_worker'); - - $queue_worker->generateSitemap(); - $processed_element_count = $queue_worker->getProcessedElementCount(); - $original_element_count = $queue_worker->getInitialElementCount(); - - $context['message'] = t('@indexed out of @total total items have been processed.', [ - '@indexed' => $processed_element_count, '@total' => $original_element_count]); - $context['finished'] = $original_element_count > 0 ? ($processed_element_count / $original_element_count) : 1; - } - - /** - * Callback function called by the batch API when all operations are finished. - * - * @param bool $success - * @param array $results - * @param array $operations - * - * @return bool - * - * @see https://api.drupal.org/api/drupal/core!includes!form.inc/group/batch/8 - */ - public static function finishGeneration($success, $results, $operations) { - if ($success) { - \Drupal::service('simple_sitemap.logger') - ->m('The XML sitemaps have been regenerated.') - ->log('info'); - } - else { - \Drupal::service('simple_sitemap.logger') - ->m(self::$batchErrorMessage) - ->display('error', 'administer sitemap settings') - ->log('error'); - } - - return $success; - } -} - diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php deleted file mode 100644 index ee7c59cf9..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php +++ /dev/null @@ -1,388 +0,0 @@ -settings = $settings; - $this->manager = $manager; - $this->state = $state; - $this->queue = $element_queue; - $this->logger = $logger; - } - - /** - * @return $this - */ - public function deleteQueue() { - $this->queue->deleteQueue(); - SitemapGeneratorBase::purgeSitemapVariants(NULL, 'unpublished'); - $this->variantProcessedNow = NULL; - $this->generatorProcessedNow = NULL; - $this->results = []; - $this->processedPaths = []; - $this->state->set('simple_sitemap.queue_items_initial_amount', 0); - $this->state->delete('simple_sitemap.queue_stashed_results'); - $this->elementsTotal = NULL; - $this->elementsRemaining = NULL; - - return $this; - } - - /** - * @param array|null $variants - * @return $this - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function rebuildQueue($variants = NULL) { - $all_data_sets = []; - $sitemap_variants = $this->manager->getSitemapVariants(); - - $type_definitions = $this->manager->getSitemapTypes(); - $this->deleteQueue(); - - foreach ($sitemap_variants as $variant_name => $variant_definition) { - - // Skipping unwanted sitemap variants. - if (NULL !== $variants && !in_array($variant_name, (array) $variants)) { - continue; - } - - $type = $variant_definition['type']; - - // Adding generate_sitemap operations for all data sets. - foreach ($type_definitions[$type]['urlGenerators'] as $url_generator_id) { - - $data_sets = $this->manager->getUrlGenerator($url_generator_id) - ->setSitemapVariant($variant_name) - ->getDataSets(); - - if (!empty($data_sets)) { - $sitemap_variants[$variant_name]['data'] = TRUE; - foreach ($data_sets as $data_set) { - $all_data_sets[] = [ - 'data' => $data_set, - 'sitemap_variant' => $variant_name, - 'url_generator' => $url_generator_id, - 'sitemap_generator' => $type_definitions[$type]['sitemapGenerator'], - ]; - - if (count($all_data_sets) === self::REBUILD_QUEUE_CHUNK_ITEM_SIZE) { - $this->queueElements($all_data_sets); - $all_data_sets = []; - } - } - } - } - } - - if (!empty($all_data_sets)) { - $this->queueElements($all_data_sets); - } - $this->getQueuedElementCount(TRUE); - - // todo: May not be clean to remove sitemap variants data when queuing elements. - // todo: Add test. - // Remove all sitemap variant instances where no results have been queued. - $this->manager->removeSitemap(array_keys(array_filter($sitemap_variants, function($e) { return empty($e['data']); }))); - - return $this; - } - - protected function queueElements($elements) { - $this->queue->createItems($elements); - $this->state->set('simple_sitemap.queue_items_initial_amount', ($this->state->get('simple_sitemap.queue_items_initial_amount') + count($elements))); - } - - /** - * @param string $from - * @return $this - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function generateSitemap($from = 'form') { - - $this->generatorSettings = [ - 'base_url' => $this->settings->getSetting('base_url', ''), - 'default_variant' => $this->settings->getSetting('default_variant', NULL), - 'skip_untranslated' => $this->settings->getSetting('skip_untranslated', FALSE), - 'remove_duplicates' => $this->settings->getSetting('remove_duplicates', TRUE), - 'excluded_languages' => $this->settings->getSetting('excluded_languages', []), - ]; - $this->maxLinks = $this->settings->getSetting('max_links'); - $max_execution_time = $this->settings->getSetting('generate_duration', 10000); - Timer::start('simple_sitemap_generator'); - - $this->unstashResults(); - - if (!$this->generationInProgress()) { - $this->rebuildQueue(); - } - - while ($element = $this->queue->claimItem()) { - - if (!empty($max_execution_time) && Timer::read('simple_sitemap_generator') >= $max_execution_time) { - break; - } - - try { - if ($element->data['sitemap_variant'] !== $this->variantProcessedNow) { - - if (NULL !== $this->variantProcessedNow) { - $this->generateVariantChunksFromResults(TRUE); - $this->publishCurrentVariant(); - } - - $this->variantProcessedNow = $element->data['sitemap_variant']; - $this->generatorProcessedNow = $element->data['sitemap_generator']; - $this->processedPaths = []; - } - - $this->generateResultsFromElement($element); - - if (!empty($this->maxLinks) && count($this->results) >= $this->maxLinks) { - $this->generateVariantChunksFromResults(); - } - } - catch (\Exception $e) { - watchdog_exception('simple_sitemap', $e); - } - - $this->queue->deleteItem($element); //todo May want to use deleteItems() instead. - $this->elementsRemaining--; - } - - if ($this->getQueuedElementCount() === 0) { - $this->generateVariantChunksFromResults(TRUE); - $this->publishCurrentVariant(); - } - else { - $this->stashResults(); - } - - return $this; - } - - /** - * @param $element - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - protected function generateResultsFromElement($element) { - $results = $this->manager->getUrlGenerator($element->data['url_generator']) - ->setSitemapVariant($this->variantProcessedNow) - ->setSettings($this->generatorSettings) - ->generate($element->data['data']); - - $this->removeDuplicates($results); - $this->results = array_merge($this->results, $results); - } - - /** - * @param array $results - */ - protected function removeDuplicates(&$results) { - if ($this->generatorSettings['remove_duplicates'] && !empty($results)) { - $result = $results[key($results)]; - if (!empty($result['meta']['path'])) { - if (in_array($result['meta']['path'], $this->processedPaths)) { - $results = []; - } - else { - $this->processedPaths[] = $result['meta']['path']; - } - } - } - } - - /** - * @param bool $complete - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - protected function generateVariantChunksFromResults($complete = FALSE) { - if (!empty($this->results)) { - $generator = $this->manager->getSitemapGenerator($this->generatorProcessedNow) - ->setSitemapVariant($this->variantProcessedNow) - ->setSettings($this->generatorSettings); - - if (empty($this->maxLinks) || $complete) { - $generator->generate($this->results); - $this->results = []; - } - else { - foreach (array_chunk($this->results, $this->maxLinks, TRUE) as $chunk_links) { - if (count($chunk_links) === $this->maxLinks || $complete) { - $generator->generate($chunk_links); - $this->results = array_diff_key($this->results, $chunk_links); - } - } - } - }; - } - - protected function publishCurrentVariant() { - if ($this->variantProcessedNow !== NULL) { - $this->manager->getSitemapGenerator($this->generatorProcessedNow) - ->setSitemapVariant($this->variantProcessedNow) - ->setSettings($this->generatorSettings) - ->generateIndex() - ->publish(); - } - } - - protected function stashResults() { - $this->state->set('simple_sitemap.queue_stashed_results', [ - 'variant' => $this->variantProcessedNow, - 'generator' => $this->generatorProcessedNow, - 'results' => $this->results, - 'processed_paths' => $this->processedPaths, - ]); - $this->results = []; - $this->processedPaths = []; - $this->generatorProcessedNow = NULL; - $this->variantProcessedNow = NULL; - } - - protected function unstashResults() { - if (NULL !== $results = $this->state->get('simple_sitemap.queue_stashed_results')) { - $this->state->delete('simple_sitemap.queue_stashed_results'); - $this->results = !empty($results['results']) ? $results['results'] : []; - $this->processedPaths = !empty($results['processed_paths']) ? $results['processed_paths'] : []; - $this->variantProcessedNow = $results['variant']; - $this->generatorProcessedNow = $results['generator']; - } - } - - public function getInitialElementCount() { - if (NULL === $this->elementsTotal) { - $this->elementsTotal = (int) $this->state->get('simple_sitemap.queue_items_initial_amount', 0); - } - - return $this->elementsTotal; - } - - /** - * @param bool $force_recount - * @return int - */ - public function getQueuedElementCount($force_recount = FALSE) { - if ($force_recount || NULL === $this->elementsRemaining) { - $this->elementsRemaining = $this->queue->numberOfItems(); - } - - return $this->elementsRemaining; - } - - /** - * @return int - */ - public function getStashedResultCount() { - return count($this->state->get('simple_sitemap.queue_stashed_results', ['results' => []])['results']); - } - - /** - * @return int - */ - public function getProcessedElementCount() { - $initial = $this->getInitialElementCount(); - $remaining = $this->getQueuedElementCount(); - - return $initial > $remaining ? ($initial - $remaining) : 0; - } - - /** - * @return bool - */ - public function generationInProgress() { - return 0 < ($this->getQueuedElementCount() + $this->getStashedResultCount()); - } -} - diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php deleted file mode 100644 index 7aab35f59..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php +++ /dev/null @@ -1,82 +0,0 @@ -connection->queryRange('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, [':name' => $this->name])->fetchObject(); - if ($item) { - $item->data = unserialize($item->data); - return $item; - } - } - catch (\Exception $e) { - $this->catchException($e); - } - - return FALSE; - } - - public function createItems($data_sets) { - $try_again = FALSE; - try { - $id = $this->doCreateItems($data_sets); - } - catch (\Exception $e) { - // If there was an exception, try to create the table. - if (!$try_again = $this->ensureTableExists()) { - // If the exception happened for other reason than the missing table, - // propagate the exception. - throw $e; - } - } - // Now that the table has been created, try again if necessary. - if ($try_again) { - $id = $this->doCreateItems($data_sets); - } - - return $id; - } - - protected function doCreateItems($data_sets) { - $query = $this->connection->insert(static::TABLE_NAME) - ->fields(['name', 'data', 'created']); - - foreach ($data_sets as $i => $data) { - $query->values([ - $this->name, - serialize($data), - time(), - ]); - } - - return $query->execute(); - } - - public function deleteItems($item_ids) { - try { - $this->connection->delete(static::TABLE_NAME) - ->condition('item_id', $item_ids, 'IN') - ->execute(); - } - catch (\Exception $e) { - $this->catchException($e); - } - } - -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php deleted file mode 100644 index b96c0f0f9..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php +++ /dev/null @@ -1,948 +0,0 @@ - ['index', 'priority', 'changefreq', 'include_images'], - 'custom' => ['priority', 'changefreq'], - ]; - - /** - * @var array - */ - protected static $linkSettingDefaults = [ - 'index' => FALSE, - 'priority' => '0.5', - 'changefreq' => '', - 'include_images' => FALSE, - ]; - - /** - * Simplesitemap constructor. - * @param \Drupal\simple_sitemap\EntityHelper $entity_helper - * @param \Drupal\simple_sitemap\SimplesitemapSettings $settings - * @param \Drupal\simple_sitemap\SimplesitemapManager $manager - * @param \Drupal\Core\Config\ConfigFactory $config_factory - * @param \Drupal\Core\Database\Connection $database - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info - * @param \Drupal\Core\Path\PathValidator $path_validator - * @param \Drupal\Core\Datetime\DateFormatter $date_formatter - * @param \Drupal\Component\Datetime\Time $time - * @param \Drupal\simple_sitemap\Queue\QueueWorker $queue_worker - */ - public function __construct( - EntityHelper $entity_helper, - SimplesitemapSettings $settings, - SimplesitemapManager $manager, - ConfigFactory $config_factory, - Connection $database, - EntityTypeManagerInterface $entity_type_manager, - EntityTypeBundleInfoInterface $entity_type_bundle_info, - PathValidator $path_validator, - DateFormatter $date_formatter, - Time $time, - QueueWorker $queue_worker - ) { - $this->entityHelper = $entity_helper; - $this->settings = $settings; - $this->manager = $manager; - $this->configFactory = $config_factory; - $this->db = $database; - $this->entityTypeManager = $entity_type_manager; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - $this->pathValidator = $path_validator; - $this->dateFormatter = $date_formatter; - $this->time = $time; - $this->queueWorker = $queue_worker; - } - - /** - * Returns a specific sitemap setting or a default value if setting does not - * exist. - * - * @param string $name - * Name of the setting, like 'max_links'. - * - * @param mixed $default - * Value to be returned if the setting does not exist in the configuration. - * - * @return mixed - * The current setting from configuration or a default value. - */ - public function getSetting($name, $default = FALSE) { - return $this->settings->getSetting($name, $default); - } - - /** - * Stores a specific sitemap setting in configuration. - * - * @param string $name - * Setting name, like 'max_links'. - * - * @param mixed $setting - * The setting to be saved. - * - * @return $this - */ - public function saveSetting($name, $setting) { - $this->settings->saveSetting($name, $setting); - return $this; - } - - /** - * @return \Drupal\simple_sitemap\Queue\QueueWorker - */ - public function getQueueWorker() { - return $this->queueWorker; - } - - /** - * @return \Drupal\simple_sitemap\SimplesitemapManager - */ - public function getSitemapManager() { - return $this->manager; - } - - /** - * @param array|string|true|null $variants - * array: Array of variants to be set. - * string: A particular variant to be set. - * null: Default variant will be set. - * true: All existing variants will be set. - * - * @return $this - */ - public function setVariants($variants = NULL) { - if (NULL === $variants) { - $this->variants = FALSE !== ($default_variant = $this->getSetting('default_variant')) ? [$default_variant] : []; - } - elseif ($variants === TRUE) { - $this->variants = array_keys( - $this->manager->getSitemapVariants(NULL, FALSE)); - } - else { - $this->variants = (array) $variants; - } - - return $this; - } - - /** - * Gets the currently set variants, the default variant, or all variants. - * - * @param bool $default_get_all - * If true and no variants are set, all variants are returned. If false and - * no variants are set, only the default variant is returned. - * - * @return array - */ - protected function getVariants($default_get_all = TRUE) { - if (NULL === $this->variants) { - $this->setVariants($default_get_all ? TRUE : NULL); - } - - return $this->variants; - } - - /** - * Returns the whole sitemap, a requested sitemap chunk, - * or the sitemap index file. - * - * @param int $delta - * - * @return string|false - * If no sitemap delta is provided, either a sitemap index is returned, or the - * whole sitemap variant, if the amount of links does not exceed the max - * links setting. If a sitemap delta is provided, a sitemap chunk is returned. - * Returns false if the sitemap is not retrievable from the database. - */ - public function getSitemap($delta = NULL) { - $chunk_info = $this->fetchSitemapVariantInfo(); - - if (empty($delta) || !isset($chunk_info[$delta])) { - - if (isset($chunk_info[SitemapGeneratorBase::INDEX_DELTA])) { - // Return sitemap index if one exists. - return $this->fetchSitemapChunk($chunk_info[SitemapGeneratorBase::INDEX_DELTA]->id) - ->sitemap_string; - } - else { - // Return sitemap chunk if there is only one chunk. - return isset($chunk_info[SitemapGeneratorBase::FIRST_CHUNK_DELTA]) - ? $this->fetchSitemapChunk($chunk_info[SitemapGeneratorBase::FIRST_CHUNK_DELTA]->id) - ->sitemap_string - : FALSE; - } - } - else { - // Return specific sitemap chunk. - return $this->fetchSitemapChunk($chunk_info[$delta]->id)->sitemap_string; - } - } - - /** - * Fetches info about all published sitemap variants and their chunks. - * - * @return array - * An array containing all published sitemap chunk IDs, deltas and creation - * timestamps keyed by the currently set variants, or in case of only one - * variant set the above keyed by sitemap delta. - */ - protected function fetchSitemapVariantInfo() { - $result = $this->db->select('simple_sitemap', 's') - ->fields('s', ['id', 'delta', 'sitemap_created', 'type']) - ->condition('s.status', 1) - ->condition('s.type', $this->getVariants(), 'IN') - ->execute(); - - return count($this->getVariants()) > 1 - ? $result->fetchAllAssoc('type') - : $result->fetchAllAssoc('delta'); - } - - /** - * Fetches a single sitemap chunk by ID. - * - * @param int $id - * The chunk ID. - * - * @return object - * A sitemap chunk object. - */ - protected function fetchSitemapChunk($id) { - return $this->db->query('SELECT * FROM {simple_sitemap} WHERE id = :id', - [':id' => $id])->fetchObject(); - } - - /** - * Removes sitemap instances for the currently set variants. - * - * @return $this - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function removeSitemap() { - $this->manager->removeSitemap($this->getVariants(FALSE)); - - return $this; - } - - /** - * Generates all sitemaps. - * - * @param string $from - * Can be 'form', 'drush', 'cron' and 'backend'. - * - * @return $this - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * - * @todo Respect $this->variants and generate for specific variants. - * @todo Implement lock functionality. - */ - public function generateSitemap($from = 'form') { - switch($from) { - case 'form': - case 'drush': - $this->queueWorker->batchGenerateSitemap($from); - break; - - case 'cron': - case 'backend': - $this->queueWorker->generateSitemap($from); - break; - } - - return $this; - } - - /** - * Rebuilds the queue for the currently set variants. - * - * @return $this - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function rebuildQueue() { - $this->queueWorker->rebuildQueue($this->getVariants()); - - return $this; - } - - /** - * Returns a 'time ago' string of last timestamp generation. - * - * @param string|null $variant - * - * @return string|array|false - * Formatted timestamp of last sitemap generation, otherwise FALSE. - */ -/* public function getGeneratedAgo() { - $chunks = $this->fetchSitemapVariantInfo(); - return isset($chunks[DefaultSitemapGenerator::FIRST_CHUNK_DELTA]->sitemap_created) - ? $this->dateFormatter - ->formatInterval($this->time->getRequestTime() - $chunks[DefaultSitemapGenerator::FIRST_CHUNK_DELTA] - ->sitemap_created) - : FALSE; - }*/ - - /** - * Enables sitemap support for an entity type. Enabled entity types show - * sitemap settings on their bundle setting forms. If an enabled entity type - * features bundles (e.g. 'node'), it needs to be set up with - * setBundleSettings() as well. - * - * @param string $entity_type_id - * Entity type id like 'node'. - * - * @return $this - */ - public function enableEntityType($entity_type_id) { - $enabled_entity_types = $this->getSetting('enabled_entity_types'); - if (!in_array($entity_type_id, $enabled_entity_types)) { - $enabled_entity_types[] = $entity_type_id; - $this->saveSetting('enabled_entity_types', $enabled_entity_types); - } - return $this; - } - - /** - * Disables sitemap support for an entity type. Disabling support for an - * entity type deletes its sitemap settings permanently and removes sitemap - * settings from entity forms. - * - * @param string $entity_type_id - * - * @return $this - */ - public function disableEntityType($entity_type_id) { - - // Updating settings. - $enabled_entity_types = $this->getSetting('enabled_entity_types'); - if (FALSE !== ($key = array_search($entity_type_id, $enabled_entity_types))) { - unset ($enabled_entity_types[$key]); - $this->saveSetting('enabled_entity_types', array_values($enabled_entity_types)); - } - - // Deleting inclusion settings. - $config_names = $this->configFactory->listAll('simple_sitemap.bundle_settings.'); - foreach ($config_names as $config_name) { - $config_name_parts = explode('.', $config_name); - if ($config_name_parts[3] === $entity_type_id) { - $this->configFactory->getEditable($config_name)->delete(); - } - } - - // Deleting entity overrides. - $this->setVariants(TRUE)->removeEntityInstanceSettings($entity_type_id); - - return $this; - } - - /** - * Sets settings for bundle or non-bundle entity types. This is done for the - * currently set variant. - * - * @param $entity_type_id - * @param null $bundle_name - * @param array $settings - * - * @return $this - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - * - * @todo: enableEntityType automatically - * @todo multiple variants - */ - public function setBundleSettings($entity_type_id, $bundle_name = NULL, $settings = ['index' => TRUE]) { - if (empty($variants = $this->getVariants(FALSE))) { - return $this; - } - - $bundle_name = NULL !== $bundle_name ? $bundle_name : $entity_type_id; - - if (!empty($old_settings = $this->getBundleSettings($entity_type_id, $bundle_name))) { - $settings = array_merge($old_settings, $settings); - } - self::supplementDefaultSettings('entity', $settings); - - if ($settings != $old_settings) { - - // Save new bundle settings to configuration. - $bundle_settings = $this->configFactory - ->getEditable("simple_sitemap.bundle_settings.$variants[0].$entity_type_id.$bundle_name"); - foreach ($settings as $setting_key => $setting) { - $bundle_settings->set($setting_key, $setting); - } - $bundle_settings->save(); - - // Delete entity overrides which are identical to new bundle settings. - $entity_ids = $this->entityHelper->getEntityInstanceIds($entity_type_id, $bundle_name); - $query = $this->db->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['id', 'inclusion_settings']) - ->condition('o.entity_type', $entity_type_id) - ->condition('o.type', $variants[0]); - if (!empty($entity_ids)) { - $query->condition('o.entity_id', $entity_ids, 'IN'); - } - - $delete_instances = []; - foreach ($query->execute()->fetchAll() as $result) { - $delete = TRUE; - $instance_settings = unserialize($result->inclusion_settings); - foreach ($instance_settings as $setting_key => $instance_setting) { - if ($instance_setting != $settings[$setting_key]) { - $delete = FALSE; - break; - } - } - if ($delete) { - $delete_instances[] = $result->id; - } - } - if (!empty($delete_instances)) { - $this->db->delete('simple_sitemap_entity_overrides') - ->condition('id', $delete_instances, 'IN') - ->execute(); - } - } - - return $this; - } - - /** - * Gets settings for bundle or non-bundle entity types. This is done for the - * currently set variants. - * - * @param string|null $entity_type_id - * Limit the result set to a specific entity type. - * - * @param string|null $bundle_name - * Limit the result set to a specific bundle name. - * - * @param bool $supplement_defaults - * Supplements the result set with default custom link settings. - * - * @param bool $multiple_variants - * If true, returns an array of results keyed by variant name, otherwise it - * returns the result set for the first variant only. - * - * @return array|false - * Array of settings or array of settings keyed by variant name. False if - * entity type does not exist. - */ - public function getBundleSettings($entity_type_id = NULL, $bundle_name = NULL, $supplement_defaults = TRUE, $multiple_variants = FALSE) { - - $all_bundle_settings = []; - - foreach ($variants = $this->getVariants(FALSE) as $variant) { - if (NULL !== $entity_type_id) { - $bundle_name = NULL !== $bundle_name ? $bundle_name : $entity_type_id; - - $bundle_settings = $this->configFactory - ->get("simple_sitemap.bundle_settings.$variant.$entity_type_id.$bundle_name") - ->get(); - - // If not found and entity type is enabled, return default bundle settings. - if (empty($bundle_settings) && $supplement_defaults) { - if ($this->entityTypeIsEnabled($entity_type_id) - && isset($this->entityTypeBundleInfo->getBundleInfo($entity_type_id)[$bundle_name])) { - self::supplementDefaultSettings('entity', $bundle_settings); - } - else { - $bundle_settings = NULL; - } - } - } - else { - $config_names = $this->configFactory->listAll("simple_sitemap.bundle_settings.$variant."); - $bundle_settings = []; - foreach ($config_names as $config_name) { - $config_name_parts = explode('.', $config_name); - $bundle_settings[$config_name_parts[3]][$config_name_parts[4]] = $this->configFactory->get($config_name)->get(); - } - - // Supplement default bundle settings for all bundles not found in simple_sitemap.bundle_settings.*.* configuration. - if ($supplement_defaults) { - foreach ($this->entityHelper->getSupportedEntityTypes() as $type_id => $type_definition) { - if ($this->entityTypeIsEnabled($type_id)) { - foreach($this->entityTypeBundleInfo->getBundleInfo($type_id) as $bundle => $bundle_definition) { - if (!isset($bundle_settings[$type_id][$bundle])) { - self::supplementDefaultSettings('entity', $bundle_settings[$type_id][$bundle]); - } - } - } - } - } - } - if ($multiple_variants) { - if (!empty($bundle_settings)) { - $all_bundle_settings[$variant] = $bundle_settings; - } - } - else { - return $bundle_settings; - } - } - - return $all_bundle_settings; - } - - /** - * Removes settings for bundle or a non-bundle entity types. This is done for - * the currently set variants. - * - * @param string|null $entity_type_id - * Limit the removal to a specific entity type. - * - * @param string|null $bundle_name - * Limit the removal to a specific bundle name. - * - * @return $this - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - public function removeBundleSettings($entity_type_id = NULL, $bundle_name = NULL) { - if (empty($variants = $this->getVariants(FALSE))) { - return $this; - } - - if (NULL !== $entity_type_id) { - $bundle_name = NULL !== $bundle_name ? $bundle_name : $entity_type_id; - - foreach ($variants as $variant) { - $this->configFactory - ->getEditable("simple_sitemap.bundle_settings.$variant.$entity_type_id.$bundle_name")->delete(); - } - - $this->removeEntityInstanceSettings($entity_type_id, ( - empty($ids) - ? NULL - : $this->entityHelper->getEntityInstanceIds($entity_type_id, $bundle_name) - )); - } - else { - foreach ($variants as $variant) { - $config_names = $this->configFactory->listAll("simple_sitemap.bundle_settings.$variant."); - foreach ($config_names as $config_name) { - $this->configFactory->getEditable($config_name)->delete(); - } - $this->removeEntityInstanceSettings(); - } - } - - return $this; - } - - /** - * Supplements all missing link setting with default values. - * - * @param string $type - * Can be 'entity' or 'custom'. - * - * @param array &$settings - * @param array $overrides - */ - public static function supplementDefaultSettings($type, &$settings, $overrides = []) { - foreach (self::$allowedLinkSettings[$type] as $allowed_link_setting) { - if (!isset($settings[$allowed_link_setting]) - && isset(self::$linkSettingDefaults[$allowed_link_setting])) { - $settings[$allowed_link_setting] = isset($overrides[$allowed_link_setting]) - ? $overrides[$allowed_link_setting] - : self::$linkSettingDefaults[$allowed_link_setting]; - } - } - } - - /** - * Overrides sitemap settings for a single entity for the currently set - * variants. - * - * @param string $entity_type_id - * @param string $id - * @param array $settings - * - * @return $this - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - public function setEntityInstanceSettings($entity_type_id, $id, $settings) { - if (empty($variants = $this->getVariants(FALSE))) { - return $this; - } - - $entity = $this->entityTypeManager->getStorage($entity_type_id)->load($id); - - $all_bundle_settings = $this->getBundleSettings( - $entity_type_id, $this->entityHelper->getEntityInstanceBundleName($entity), TRUE, TRUE - ); - - foreach ($all_bundle_settings as $variant => $bundle_settings) { - if (!empty($bundle_settings)) { - - // Check if overrides are different from bundle setting before saving. - $override = FALSE; - foreach ($settings as $key => $setting) { - if (!isset($bundle_settings[$key]) || $setting != $bundle_settings[$key]) { - $override = TRUE; - break; - } - } - - // Save overrides for this entity if something is different. - if ($override) { - $this->db->merge('simple_sitemap_entity_overrides') - ->keys([ - 'type' => $variant, - 'entity_type' => $entity_type_id, - 'entity_id' => $id]) - ->fields([ - 'type' => $variant, - 'entity_type' => $entity_type_id, - 'entity_id' => $id, - 'inclusion_settings' => serialize(array_merge($bundle_settings, $settings))]) - ->execute(); - } - // Else unset override. - else { - $this->removeEntityInstanceSettings($entity_type_id, $id); - } - } - } - - return $this; - } - - /** - * Gets sitemap settings for an entity instance which overrides bundle - * settings, or gets bundle settings, if they are not overridden. This is - * done for the currently set variant. - * - * @param string $entity_type_id - * @param string $id - * - * @return array|false - * Array of entity instance settings or the settings of its bundle. False if - * entity type does not exist. - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - * - * @todo multiple variants - */ - public function getEntityInstanceSettings($entity_type_id, $id) { - if (empty($variants = $this->getVariants(FALSE))) { - return FALSE; - } - - $results = $this->db->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['inclusion_settings']) - ->condition('o.type', $variants[0]) - ->condition('o.entity_type', $entity_type_id) - ->condition('o.entity_id', $id) - ->execute() - ->fetchField(); - - if (!empty($results)) { - return unserialize($results); - } - else { - $entity = $this->entityTypeManager->getStorage($entity_type_id) - ->load($id); - return $this->getBundleSettings( - $entity_type_id, - $this->entityHelper->getEntityInstanceBundleName($entity) - ); - } - } - - /** - * Removes sitemap settings for entities that override bundle settings. This - * is done for the currently set variants. - * - * @param string|null $entity_type_id - * Limits the removal to a certain entity type. - * - * @param string|null $entity_ids - * Limits the removal to entities with certain IDs. - * - * @return $this - */ - public function removeEntityInstanceSettings($entity_type_id = NULL, $entity_ids = NULL) { - if (empty($variants = $this->getVariants(FALSE))) { - return $this; - } - - $query = $this->db->delete('simple_sitemap_entity_overrides') - ->condition('type', $variants, 'IN'); - - if (NULL !== $entity_type_id) { - $query->condition('entity_type', $entity_type_id); - - if (NULL !== $entity_ids) { - $query->condition('entity_id', (array) $entity_ids, 'IN'); - } - } - - $query->execute(); - - return $this; - } - - /** - * Checks if an entity bundle (or a non-bundle entity type) is set to be - * indexed for the currently set variant. - * - * @param string $entity_type_id - * @param string|null $bundle_name - * - * @return bool - * - * @todo multiple variants? - */ - public function bundleIsIndexed($entity_type_id, $bundle_name = NULL) { - $settings = $this->getBundleSettings($entity_type_id, $bundle_name); - return !empty($settings['index']); - } - - /** - * Checks if an entity type is enabled in the sitemap settings. - * - * @param string $entity_type_id - * - * @return bool - */ - public function entityTypeIsEnabled($entity_type_id) { - return in_array($entity_type_id, $this->getSetting('enabled_entity_types', [])); - } - - /** - * Stores a custom path along with its settings to configuration for the - * currently set variants. - * - * @param string $path - * - * @param array $settings - * Settings that are not provided are supplemented by defaults. - * - * @return $this - * - * @todo Validate $settings and throw exceptions - */ - public function addCustomLink($path, $settings = []) { - if (empty($variants = $this->getVariants(FALSE))) { - return $this; - } - - if (!(bool) $this->pathValidator->getUrlIfValidWithoutAccessCheck($path)) { - // todo: log error. - return $this; - } - if ($path[0] !== '/') { - // todo: log error. - return $this; - } - - $variant_links = $this->getCustomLinks(NULL, FALSE, TRUE); - foreach ($variants as $variant) { - $links = []; - $link_key = 0; - if (isset($variant_links[$variant])) { - $links = $variant_links[$variant]; - $link_key = count($links); - foreach ($links as $key => $link) { - if ($link['path'] === $path) { - $link_key = $key; - break; - } - } - } - - $links[$link_key] = ['path' => $path] + $settings; - $this->configFactory->getEditable("simple_sitemap.custom_links.$variant") - ->set('links', $links)->save(); - } - - return $this; - } - - /** - * Gets custom link settings for the currently set variants. - * - * @param string|null $path - * Limits the result set by an internal path. - * - * @param bool $supplement_defaults - * Supplements the result set with default custom link settings. - * - * @param bool $multiple_variants - * If true, returns an array of results keyed by variant name, otherwise it - * returns the result set for the first variant only. - * - * @return array|mixed|null - */ - public function getCustomLinks($path = NULL, $supplement_defaults = TRUE, $multiple_variants = FALSE) { - $all_custom_links = []; - foreach ($variants = $this->getVariants(FALSE) as $variant) { - $custom_links = $this->configFactory - ->get("simple_sitemap.custom_links.$variant") - ->get('links'); - - $custom_links = !empty($custom_links) ? $custom_links : []; - - if (!empty($custom_links) && $path !== NULL) { - foreach ($custom_links as $key => $link) { - if ($link['path'] !== $path) { - unset($custom_links[$key]); - } - } - } - - if (!empty($custom_links) && $supplement_defaults) { - foreach ($custom_links as $i => $link_settings) { - self::supplementDefaultSettings('custom', $link_settings); - $custom_links[$i] = $link_settings; - } - } - - $custom_links = $path !== NULL && !empty($custom_links) - ? array_values($custom_links)[0] - : array_values($custom_links); - - - if (!empty($custom_links)) { - if ($multiple_variants) { - $all_custom_links[$variant] = $custom_links; - } - else { - return $custom_links; - } - } - } - - return $all_custom_links; - } - - /** - * Removes custom links from currently set variants. - * - * @param array|null $paths - * Limits the removal to certain paths. - * - * @return $this - */ - public function removeCustomLinks($paths = NULL) { - if (empty($variants = $this->getVariants(FALSE))) { - return $this; - } - - if (NULL === $paths) { - foreach ($variants as $variant) { - $this->configFactory - ->getEditable("simple_sitemap.custom_links.$variant")->delete(); - } - } - else { - $variant_links = $this->getCustomLinks(NULL, FALSE, TRUE); - foreach ($variant_links as $variant => $links) { - $custom_links = $links; - $save = FALSE; - foreach ((array) $paths as $path) { - foreach ($custom_links as $key => $link) { - if ($link['path'] === $path) { - unset($custom_links[$key]); - $save = TRUE; - break 2; - } - } - } - if ($save) { - $this->configFactory->getEditable("simple_sitemap.custom_links.$variant") - ->set('links', array_values($custom_links))->save(); - } - } - } - - return $this; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php b/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php deleted file mode 100644 index 6acc48200..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php +++ /dev/null @@ -1,316 +0,0 @@ -configFactory = $config_factory; - $this->db = $database; - $this->sitemapTypeManager = $sitemap_type_manager; - $this->urlGeneratorManager = $url_generator_manager; - $this->sitemapGeneratorManager = $sitemap_generator_manager; - $this->settings = $settings; - } - - /** - * @param string $sitemap_generator_id - * @return \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapGeneratorBase - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function getSitemapGenerator($sitemap_generator_id) { - if (!isset($this->sitemapGenerators[$sitemap_generator_id])) { - $this->sitemapGenerators[$sitemap_generator_id] - = $this->sitemapGeneratorManager->createInstance($sitemap_generator_id); - } - - return $this->sitemapGenerators[$sitemap_generator_id]; - } - - /** - * @param string $url_generator_id - * @return \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorBase - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function getUrlGenerator($url_generator_id) { - if (!isset($this->urlGenerators[$url_generator_id])) { - $this->urlGenerators[$url_generator_id] - = $this->urlGeneratorManager->createInstance($url_generator_id); - } - - return $this->urlGenerators[$url_generator_id]; - } - - /** - * @return \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapType\SitemapTypeBase[] - */ - public function getSitemapTypes() { - if (empty($this->sitemapTypes)) { - $this->sitemapTypes = $this->sitemapTypeManager->getDefinitions(); - } - - return $this->sitemapTypes; - } - - /** - * @param string|null $sitemap_type - * @param bool $attach_type_info - * @return array - */ - public function getSitemapVariants($sitemap_type = NULL, $attach_type_info = TRUE) { - if (NULL === $sitemap_type) { - $variants = []; - foreach ($this->configFactory->listAll('simple_sitemap.variants.') as $config_name) { - $config_name_parts = explode('.', $config_name); - $saved_variants = $this->configFactory->get($config_name)->get('variants'); - $saved_variants = $attach_type_info ? $this->attachSitemapTypeToVariants($saved_variants, $config_name_parts[2]) : $saved_variants; - $variants = array_merge($variants, (is_array($saved_variants) ? $saved_variants : [])); - } - } - else { - $variants = $this->configFactory->get("simple_sitemap.variants.$sitemap_type")->get('variants'); - $variants = is_array($variants) ? $variants : []; - $variants = $attach_type_info ? $this->attachSitemapTypeToVariants($variants, $sitemap_type) : $variants; - } - array_multisort(array_column($variants, "weight"), SORT_ASC, $variants); - return $variants; - } - - /** - * @param array $variants - * @param string $type - * @return array - */ - protected function attachSitemapTypeToVariants(array $variants, $type) { - return array_map(function($variant) use ($type) { return $variant + ['type' => $type]; }, $variants); - } - - /** - * @param array $variants - * @return array - */ - protected function detachSitemapTypeFromVariants(array $variants) { - return array_map(function($variant) { unset($variant['type']); return $variant; }, $variants); - } - - /** - * @param string $name - * @param array $definition - * @return $this - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function addSitemapVariant($name, $definition = []) { - $all_variants = $this->getSitemapVariants(); - if (isset($all_variants[$name])) { - $old_variant = $all_variants[$name]; - if (!empty($definition['type']) && $old_variant['type'] !== $definition['type']) { - $this->removeSitemapVariants($name); - unset($old_variant); - } - else { - unset($old_variant['type']); - } - } - - if (!isset($old_variant) && empty($definition['label'])) { - $definition['label'] = (string) $name; - } - - if (!isset($old_variant) && empty($definition['type'])) { - $definition['type'] = self::DEFAULT_SITEMAP_TYPE; - } - - if (isset($definition['weight'])) { - $definition['weight'] = (int) $definition['weight']; - } - elseif (!isset($old_variant)) { - $definition['weight'] = 0; - } - - if (isset($old_variant)) { - $definition = $definition + $old_variant; - } - - $variants = array_merge($this->getSitemapVariants($definition['type'], FALSE), [$name => ['label' => $definition['label'], 'weight' => $definition['weight']]]); - $this->configFactory->getEditable('simple_sitemap.variants.' . $definition['type']) - ->set('variants', $variants) - ->save(); - - return $this; - } - - /** - * @param null|array|string $variant_names - * Limit removal by specific variants. - * - * @return $this - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function removeSitemap($variant_names = NULL) { - if (NULL === $variant_names || !empty((array) $variant_names)) { - $saved_variants = $this->getSitemapVariants(); - $remove_variants = NULL === $variant_names - ? $saved_variants - : array_intersect_key($saved_variants, array_flip((array) $variant_names)); - - if (!empty($remove_variants)) { - $type_definitions = $this->getSitemapTypes(); - foreach ($remove_variants as $variant_name => $variant_definition) { - $this->getSitemapGenerator($type_definitions[$variant_definition['type']]['sitemapGenerator']) - ->setSitemapVariant($variant_name) - ->remove(); - } - } - } - - return $this; - } - - /** - * @param null|array|string $variant_names - * Limit removal by specific variants. - * - * @return $this - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function removeSitemapVariants($variant_names = NULL) { - if (NULL === $variant_names || !empty((array) $variant_names)) { - - // Remove sitemap instances. - $this->removeSitemap($variant_names); - - if (NULL === $variant_names) { - // Remove all variants and their bundle settings. - foreach(['variants', 'bundle_settings', 'custom_links'] as $config_name_part) { - foreach ($this->configFactory->listAll("simple_sitemap.$config_name_part.") as $config_name) { - $this->configFactory->getEditable($config_name)->delete(); - } - } - } - else { - // Remove bundle settings for specific variants. - foreach ((array) $variant_names as $variant_name) { - foreach ($this->configFactory->listAll("simple_sitemap.bundle_settings.$variant_name.") as $config_name) { - $this->configFactory->getEditable($config_name)->delete(); - } - } - - // Remove custom links for specific variants. - foreach ((array) $variant_names as $variant_name) { - foreach ($this->configFactory->listAll("simple_sitemap.custom_links.$variant_name") as $config_name) { - $this->configFactory->getEditable($config_name)->delete(); - } - } - - // Remove specific variants from configuration. - $remove_variants = []; - $variants = $this->getSitemapVariants(); - foreach ((array) $variant_names as $variant_name) { - if (isset($variants[$variant_name])) { - $remove_variants[$variants[$variant_name]['type']][$variant_name] = $variant_name; - } - } - foreach ($remove_variants as $type => $variants_per_type) { - $this->configFactory->getEditable("simple_sitemap.variants.$type") - ->set('variants', array_diff_key($this->getSitemapVariants($type, FALSE), $variants_per_type)) - ->save(); - } - } - - // Remove bundle setting overrides for entities. - $query = $this->db->delete('simple_sitemap_entity_overrides'); - if (NULL !== $variant_names) { - $query->condition('type', (array) $variant_names, 'IN'); - } - $query->execute(); - - - // Remove default variant setting. - if (NULL === $variant_names - || in_array($this->settings->getSetting('default_variant', ''), (array) $variant_names)) { - $this->settings->saveSetting('default_variant', ''); - } - } - - return $this; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php b/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php deleted file mode 100644 index 929f70350..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php +++ /dev/null @@ -1,68 +0,0 @@ -configFactory = $config_factory; - } - - /** - * Returns a specific sitemap setting or a default value if setting does not - * exist. - * - * @param string $name - * Name of the setting, like 'max_links'. - * - * @param mixed $default - * Value to be returned if the setting does not exist in the configuration. - * - * @return mixed - * The current setting from configuration or a default value. - */ - public function getSetting($name, $default = FALSE) { - $setting = $this->configFactory - ->get('simple_sitemap.settings') - ->get($name); - return NULL !== $setting ? $setting : $default; - } - - public function getSettings() { - return $this->configFactory - ->get('simple_sitemap.settings') - ->get(); - } - - /** - * Stores a specific sitemap setting in configuration. - * - * @param string $name - * Setting name, like 'max_links'. - * @param mixed $setting - * The setting to be saved. - * - * @return $this - */ - public function saveSetting($name, $setting) { - $this->configFactory->getEditable('simple_sitemap.settings') - ->set($name, $setting)->save(); - return $this; - } -} diff --git a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php b/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php deleted file mode 100644 index 819c903f9..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php +++ /dev/null @@ -1,566 +0,0 @@ -generator->generateSitemap('backend'); - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('urlset'); - $this->assertSession()->responseContains( - Url::fromRoute('')->setAbsolute()->toString() - ); - $this->assertSession()->responseContains('1.0'); - $this->assertSession()->responseContains('daily'); - } - - /** - * Test custom link. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testAddCustomLink() { - $this->generator->addCustomLink( - '/node/' . $this->node->id(), - ['priority' => 0.2, 'changefreq' => 'monthly'] - )->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.2'); - $this->assertSession()->responseContains('monthly'); - - $this->drupalLogin($this->privilegedUser); - - $this->drupalGet('admin/config/search/simplesitemap/custom'); - $this->assertSession()->pageTextContains( - '/node/' . $this->node->id() . ' 0.2 monthly' - ); - - $this->generator->addCustomLink( - '/node/' . $this->node->id(), - ['changefreq' => 'yearly'] - )->generateSitemap('backend'); - - $this->drupalGet('admin/config/search/simplesitemap/custom'); - $this->assertSession()->pageTextContains( - '/node/' . $this->node->id() . ' yearly' - ); - } - - /** - * Test default settings of custom links. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testAddCustomLinkDefaults() { - $this->generator->removeCustomLinks() - ->addCustomLink('/node/' . $this->node->id()) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.5'); - $this->assertSession()->responseNotContains('changefreq'); - } - - /** - * Test removing custom paths from the sitemap settings. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testRemoveCustomLinks() { - - // Test removing one custom path from the sitemap. - $this->generator->addCustomLink('/node/' . $this->node->id()) - ->removeCustomLinks('/node/' . $this->node->id()) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseNotContains('node/' . $this->node->id()); - - //todo Not working -// // Test removing all custom paths from the sitemap. -// $this->generator->removeCustomLinks() -// ->generateSitemap('backend'); -// -// $this->drupalGet($this->defaultSitemapUrl); -// $this->assertSession()->responseNotContains( -// Url::fromRoute('')->setAbsolute()->toString() -// ); - } - - /** - * Tests setting bundle settings. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - * - * @todo Add form tests - */ - public function testSetBundleSettings() { - $this->assertFalse($this->generator->bundleIsIndexed('node', 'page')); - - // Index new bundle. - $this->generator->removeCustomLinks() - ->setBundleSettings('node', 'page', [ - 'index' => TRUE, - 'priority' => 0.5, - 'changefreq' => 'hourly', - ]) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.5'); - $this->assertSession()->responseContains('hourly'); - - $this->assertTrue($this->generator->bundleIsIndexed('node', 'page')); - - // Only change bundle priority. - $this->generator->setBundleSettings('node', 'page', ['priority' => 0.9]) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseNotContains('0.5'); - $this->assertSession()->responseContains('0.9'); - - // Only change bundle changefreq. - $this->generator->setBundleSettings( - 'node', - 'page', - ['changefreq' => 'daily'] - )->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseNotContains('hourly'); - $this->assertSession()->responseContains('daily'); - - // Remove changefreq setting. - $this->generator->setBundleSettings('node', 'page', ['changefreq' => '']) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseNotContains('changefreq'); - $this->assertSession()->responseNotContains('daily'); - - // Index two bundles. - $this->drupalCreateContentType(['type' => 'blog']); - - $node3 = $this->createNode(['title' => 'Node3', 'type' => 'blog']); - $this->generator->setBundleSettings('node', 'page', ['index' => TRUE]) - ->setBundleSettings('node', 'blog', ['index' => TRUE]) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('node/' . $node3->id()); - - // todo Now working -// // Set bundle 'index' setting to false. -// $this->generator -// ->setBundleSettings('node', 'page', ['index' => FALSE]) -// ->setBundleSettings('node', 'blog', ['index' => FALSE]) -// ->generateSitemap('backend'); -// -// $this->drupalGet($this->defaultSitemapUrl); -// -// $this->assertSession()->responseNotContains('node/' . $this->node->id()); -// $this->assertSession()->responseNotContains('node/' . $node3->id()); - } - - /** - * Test default settings of bundles. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testSetBundleSettingsDefaults() { - $this->generator->setBundleSettings('node', 'page') - ->removeCustomLinks() - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.5'); - $this->assertSession()->responseNotContains('changefreq'); - } - - /** - * Test the lastmod parameter in different scenarios. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testLastmod() { - // Entity links should have 'lastmod'. - $this->generator->setBundleSettings('node', 'page') - ->removeCustomLinks() - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('lastmod'); - - // Entity custom links should have 'lastmod'. - $this->generator->setBundleSettings('node', 'page', ['index' => FALSE]) - ->addCustomLink('/node/' . $this->node->id()) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('lastmod'); - - // Non-entity custom links should not have 'lastmod'. - $this->generator->removeCustomLinks() - ->addCustomLink('/') - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseNotContains('lastmod'); - } - - /** - * Tests the duplicate setting. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function testRemoveDuplicatesSetting() { - $this->generator->setBundleSettings('node', 'page') - ->addCustomLink('/node/1') - ->saveSetting('remove_duplicates', TRUE) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertUniqueTextWorkaround('node/' . $this->node->id()); - - $this->generator->saveSetting('remove_duplicates', FALSE) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertNoUniqueTextWorkaround('node/' . $this->node->id()); - } - - /** - * Test max links setting and the sitemap index. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testMaxLinksSetting() { - $this->generator->setBundleSettings('node', 'page') - ->saveSetting('max_links', 1) - ->removeCustomLinks() - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('sitemap.xml?page=1'); - $this->assertSession()->responseContains('sitemap.xml?page=2'); - - $this->drupalGet('sitemap.xml', ['query' => ['page' => 1]]); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.5'); - $this->assertSession()->responseNotContains('node/' . $this->node2->id()); - - $this->drupalGet('sitemap.xml', ['query' => ['page' => 2]]); - $this->assertSession()->responseContains('node/' . $this->node2->id()); - $this->assertSession()->responseContains('0.5'); - $this->assertSession()->responseNotContains('node/' . $this->node->id()); - } - - /** - * @todo testGenerateDurationSetting - */ - - /** - * Test setting the base URL. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testBaseUrlSetting() { - $this->generator->setBundleSettings('node', 'page') - ->saveSetting('base_url', 'http://base_url_test') - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('http://base_url_test'); - - // Set base URL in the sitemap index. - $this->generator->saveSetting('max_links', 1) - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('http://base_url_test/sitemap.xml?page=1'); - } - - /** - * Test overriding of bundle settings for a single entity. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - * - * @todo: Use form testing instead of responseContains(). - */ - public function testSetEntityInstanceSettings() { - $this->generator->setBundleSettings('node', 'page') - ->removeCustomLinks() - ->setEntityInstanceSettings('node', $this->node->id(), ['priority' => 0.1, 'changefreq' => 'never']) - ->setEntityInstanceSettings('node', $this->node2->id(), ['index' => FALSE]) - ->generateSitemap('backend'); - - // Test sitemap result. - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.1'); - $this->assertSession()->responseContains('never'); - $this->assertSession()->responseNotContains('node/' . $this->node2->id()); - $this->assertSession()->responseNotContains('0.5'); - - $this->drupalLogin($this->privilegedUser); - - // Test UI changes. - $this->drupalGet('node/' . $this->node->id() . '/edit'); - $this->assertSession()->responseContains(''); - $this->assertSession()->responseContains(''); - - // Test database changes. - $result = $this->database->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['inclusion_settings']) - ->condition('o.entity_type', 'node') - ->condition('o.entity_id', $this->node->id()) - ->execute() - ->fetchField(); - $this->assertFalse(empty($result)); - - $this->generator->setBundleSettings('node', 'page', ['priority' => 0.1, 'changefreq' => 'never']) - ->generateSitemap('backend'); - - // Test sitemap result. - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - $this->assertSession()->responseContains('0.1'); - $this->assertSession()->responseContains('never'); - $this->assertSession()->responseNotContains('node/' . $this->node2->id()); - $this->assertSession()->responseNotContains('0.5'); - - // Test UI changes. - $this->drupalGet('node/' . $this->node->id() . '/edit'); - $this->assertSession()->responseContains(''); - $this->assertSession()->responseContains(''); - - // Test if entity override has been removed from database after its equal to - // its bundle settings. - $result = $this->database->select('simple_sitemap_entity_overrides', 'o') - ->fields('o', ['inclusion_settings']) - ->condition('o.entity_type', 'node') - ->condition('o.entity_id', $this->node->id()) - ->execute() - ->fetchField(); - $this->assertTrue(empty($result)); - } - - /** - * Test indexing an atomic entity (here: a user) - */ - public function testAtomicEntityIndexation() { - $user_id = $this->privilegedUser->id(); - $this->generator->setBundleSettings('user') - ->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseNotContains('user/' . $user_id); - - user_role_grant_permissions('anonymous', ['access user profiles']); - drupal_flush_all_caches(); //todo Not pretty. - - $this->generator->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('user/' . $user_id); - } - - /** - * @todo Test indexing menu. - */ - - /** - * @todo Test deleting a bundle. - */ - - /** - * Test disabling sitemap support for an entity type. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testDisableEntityType() { - $this->generator->setBundleSettings('node', 'page') - ->disableEntityType('node'); - - $this->drupalLogin($this->privilegedUser); - $this->drupalGet('admin/structure/types/manage/page'); - $this->assertSession()->pageTextNotContains('Simple XML sitemap'); - - $this->generator->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseNotContains('node/' . $this->node->id()); - - $this->assertFalse($this->generator->entityTypeIsEnabled('node')); - } - - /** - * Test enabling sitemap support for an entity type. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * @throws \Behat\Mink\Exception\ExpectationException - * - * @todo Test admin/config/search/simplesitemap/entities form. - */ - public function testEnableEntityType() { - $this->generator->disableEntityType('node') - ->enableEntityType('node') - ->setBundleSettings('node', 'page'); - - $this->drupalLogin($this->privilegedUser); - $this->drupalGet('admin/structure/types/manage/page'); - $this->assertSession()->pageTextContains('Simple XML sitemap'); - - $this->generator->generateSitemap('backend'); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - - $this->assertTrue($this->generator->entityTypeIsEnabled('node')); - } - - /** - * @todo testSitemapLanguages - */ - - /** - * Test adding and removing sitemap variants. - * - * @throws \Behat\Mink\Exception\ExpectationException - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function testSitemapVariants() { - - // Test adding a variant. - $this->generator->getSitemapManager()->addSitemapVariant('test'); - - $this->generator - ->setBundleSettings('node', 'page') - ->generateSitemap('backend'); - - $variants = $this->generator->getSitemapManager()->getSitemapVariants(); - $this->assertTrue(isset($variants['test'])); - - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - - // Test if generation affected the default variant only. - $this->drupalGet('test/sitemap.xml'); - $this->assertSession()->responseNotContains('node/' . $this->node->id()); - - $this->generator - ->setVariants('test') - ->setBundleSettings('node', 'page') - ->generateSitemap('backend'); - - // Test if bundle settings have been set for correct variant. - $this->drupalGet($this->defaultSitemapUrl); - $this->assertSession()->responseContains('node/' . $this->node->id()); - - $this->generator->getSitemapManager()->removeSitemapVariants('test'); - - $variants = $this->generator->getSitemapManager()->getSitemapVariants(); - $this->assertFalse(isset($variants['test'])); - - // Test if sitemap has been removed along with the variant. - $this->drupalGet('test/sitemap.xml'); - $this->assertSession()->statusCodeEquals(404); - } - - /** - * @todo Test removeSitemap(). - */ - - /** - * Test cases for ::testGenerationResume. - */ - public function generationResumeProvider() { - return [ - [1000, 500, 1], - [1000, 500, 3, ['de']], - [1000, 500, 5, ['de', 'es']], - [10, 10000, 10], - ]; - } - - /** - * @throws \Drupal\Component\Plugin\Exception\PluginException - * - * @dataProvider generationResumeProvider - */ - public function testGenerationResume($element_count, $generate_duration, $max_links, $langcodes = []) { - - $this->addLanguages($langcodes); - - $expected_sitemap_count = (int) ceil(($element_count * (count($langcodes) + 1)) / $max_links); - - $this->drupalCreateContentType(['type' => 'blog']); - for ($i = 1; $i <= $element_count; $i++) { - $this->createNode(['title' => 'node-' . $i, 'type' => 'blog']); - } - - $this->generator - ->removeCustomLinks() - ->saveSetting('generate_duration', $generate_duration) - ->saveSetting('max_links', $max_links) - ->saveSetting('skip_untranslated', FALSE) - ->setBundleSettings('node', 'blog'); - - $queue = $this->generator->getQueueWorker()->rebuildQueue(); - $generate_count = 0; - while ($queue->generationInProgress()) { - $generate_count++; - $this->generator->generateSitemap('backend'); - } - - // Test if sitemap generation has been resumed when time limit is very low. - $this->assertTrue($generate_duration > $element_count || $generate_count > 1, 'This assertion tests if the sitemap generation is split up into batches due to a low generation time limit setting. The failing of this assertion can mean that the sitemap was wrongfully generated in one go, but it can also mean that the assumed low time setting is still high enough for a one pass generation.'); - - // Test if correct number of sitemaps have been created. - $chunks = $this->database->query('SELECT id FROM {simple_sitemap} WHERE delta != 0 AND status = 1'); - $chunks->allowRowCount = TRUE; - $chunk_count = $chunks->rowCount(); - $this->assertTrue($chunk_count === $expected_sitemap_count); - - // Test if index has been created when necessary. - $index = $this->database->query('SELECT id FROM {simple_sitemap} WHERE delta = 0 AND status = 1') - ->fetchField(); - $this->assertTrue($chunk_count > 1 ? (FALSE !== $index) : !$index); - } - -} - diff --git a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php b/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php deleted file mode 100644 index 451eda83d..000000000 --- a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php +++ /dev/null @@ -1,123 +0,0 @@ -generator = $this->container->get('simple_sitemap.generator'); - $this->database = $this->container->get('database'); - - $this->drupalCreateContentType(['type' => 'page']); - $this->node = $this->createNode(['title' => 'Node', 'type' => 'page']); - $this->node2 = $this->createNode(['title' => 'Node2', 'type' => 'page']); - - // Create a user with all the permissions. - $permissions = array_keys($this->container->get('user.permissions')->getPermissions()); - $this->privilegedUser = $this->drupalCreateUser($permissions); - } - - /** - * Helper function to replace assertUniqueText. - * - * Also adapt the legacy trait method because it can't be applied to Non-HTML - * pages. - * - * @param string $text - * The text to look for. - * - * @See \Drupal\FunctionalTests\AssertLegacyTrait::assertUniqueText(). - */ - protected function assertUniqueTextWorkaround($text) { - $page_content = $this->getSession()->getPage()->getContent(); - $nr_found = substr_count($page_content, $text); - $this->assertSame(1, $nr_found); - } - - /** - * Helper function to replace assertNoUniqueText. - * - * Also adapt the legacy trait method because it can't be applied to Non-HTML - * pages. - * - * @param string $text - * The text to look for. - * - * @See \Drupal\FunctionalTests\AssertLegacyTrait::assertNoUniqueText(). - */ - protected function assertNoUniqueTextWorkaround($text) { - $page_text = $this->getSession()->getPage()->getContent(); - $nr_found = substr_count($page_text, $text); - $this->assertGreaterThan(1, $nr_found); - } - - protected function addLanguages($langcodes = 'de') { - foreach ((array) $langcodes as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode) - ->save(); - } - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt b/sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/toolbar_menu/README.txt b/sites/all/modules/contrib/admin/toolbar_menu/README.txt deleted file mode 100644 index d08fd4db7..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -README.txt -========== - -Add your favorite menu in the Drupal Toolbar - -Usage : - -- Manage your menus (Structure > Menu) -- Go to Config > Toolbar Menu > Toolbar Menu settings -- Pick all menus you want to appear in you toolbar -- Save the configuration -- Your selected menus must appears in the toolbar diff --git a/sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml b/sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml deleted file mode 100644 index b53f654e1..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml +++ /dev/null @@ -1,21 +0,0 @@ -toolbar_menu.toolbar_menu_element.*: - type: config_entity - label: 'Toolbar menu element config' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - uuid: - type: string - weight: - type: integer - label: 'Weight' - menu: - type: string - label: 'Menu' - rewrite_label: - type: boolean - label: 'Rewrite menu label with this label' diff --git a/sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css b/sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css deleted file mode 100644 index 7e064a992..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.toolbar-bar .toolbar-icon-toolbar-menu:before { - background-image: url(/core/misc/icons/bebebe/cog.svg); -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js b/sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js deleted file mode 100644 index a6b7ea269..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file - * Defines the behavior of the toolbar_menu module. - * - * Rewrite a piece of toolbar.js - * to render all toolbar element in collapsible menu. - */ - -(function ($, Drupal, drupalSettings) { - - 'use strict'; - - // Merge run-time settings with the defaults. - var options = $.extend( - { - breakpoints: { - 'toolbar.narrow': '', - 'toolbar.standard': '', - 'toolbar.wide': '' - } - }, - drupalSettings.toolbar, - // Merge strings on top of drupalSettings so that they are not mutable. - { - strings: { - horizontal: Drupal.t('Horizontal orientation'), - vertical: Drupal.t('Vertical orientation') - } - } - ); - - Drupal.behaviors.toolbar_menu = { - attach: function (context) { - // Process the administrative toolbar. - $(context).find('#toolbar-administration').once('toolbar-menu').each(function () { - // Establish the toolbar models and views. - var model = Drupal.toolbar.models.toolbarModel = new Drupal.toolbar.ToolbarModel({ - locked: JSON.parse(localStorage.getItem('Drupal.toolbar.trayVerticalLocked')) || false, - activeTab: document.getElementById(JSON.parse(localStorage.getItem('Drupal.toolbar.activeTabID'))) - }); - - // Render collapsible menus. - var menuModel = Drupal.toolbar.models.menuModel = new Drupal.toolbar.MenuModel(); - Drupal.toolbar.views.menuVisualView = new Drupal.toolbar.MenuVisualView({ - el: $(this).find('.toolbar-menu-administration'), - model: menuModel, - strings: options.strings - }); - - // Handle the resolution of Drupal.toolbar.setSubtrees. - // This is handled with a deferred so that the function may be invoked - // asynchronously. - Drupal.toolbar.setSubtrees.done(function (subtrees) { - menuModel.set('subtrees', subtrees); - var theme = drupalSettings.ajaxPageState.theme; - localStorage.setItem('Drupal.toolbar.subtrees.' + theme, JSON.stringify(subtrees)); - // Indicate on the toolbarModel that subtrees are now loaded. - model.set('areSubtreesLoaded', true); - }); - - }); - } - }; - -}(jQuery, Drupal, drupalSettings)); diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php b/sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php deleted file mode 100644 index beb6fdc38..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php +++ /dev/null @@ -1,113 +0,0 @@ -invalidateTags(['toolbar_menu']); - } - - /** - * Get the menu 'menu' property. - * - * @return mixed|null - * The menu property. - */ - public function menu() { - return $this->get('menu'); - } - - /** - * Get the full loaded menu entity. - * - * @return \Drupal\system\Entity\Menu|null|static - * Loaded menu. - */ - public function loadMenu() { - if ($this->menu()) { - return Menu::Load($this->menu()); - } - return NULL; - } - - /** - * Get the 'rewrite_label' property. - * - * @return mixed|null - * The rewrite_label property - */ - public function rewriteLabel() { - return $this->get('rewrite_label'); - } - - /** - * Get the 'weight' property. - * - * @return mixed|null - * The weight property - */ - public function weight() { - return $this->get('weight'); - } - - /** - * Get the displayed label. - * - * If rewrite_label property is set to TRUE, - * the label of this entity was returned. - * - * @return mixed|null|string - * Display label - */ - public function getDisplayLabel() { - if ($this->rewriteLabel() && $this->menu()) { - return $this->loadMenu()->label(); - } - return $this->label(); - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php b/sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php deleted file mode 100644 index 775942e97..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php +++ /dev/null @@ -1,80 +0,0 @@ - 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $this->entity->label(), - '#required' => TRUE, - ]; - - $form['id'] = [ - '#type' => 'machine_name', - '#title' => $this->t('ID'), - '#maxlength' => 255, - '#default_value' => $this->entity->id(), - '#required' => TRUE, - '#disabled' => !$this->entity->isNew(), - '#machine_name' => [ - 'exists' => 'Drupal\toolbar_menu\Entity\ToolbarMenuElement::load', - ], - ]; - - $existing_menu = []; - foreach ($this->entityTypeManager - ->getStorage('menu') - ->loadByProperties(['status' => TRUE]) as $menu) { - $existing_menu[$menu->id()] = $menu->label(); - } - - $form['menu'] = [ - '#type' => 'select', - '#title' => $this->t('Menu'), - '#options' => $existing_menu, - '#target_type' => 'menu', - '#validate_reference' => TRUE, - '#default_value' => $this->entity->menu(), - '#required' => TRUE, - ]; - - $form['rewrite_label'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Display the menu label in toolbar instead of this entity label'), - '#validate_reference' => TRUE, - '#default_value' => $this->entity->rewriteLabel(), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - parent::save($form, $form_state); - drupal_set_message($this->t('Toolbar menu element @label saved.', ['@label' => $this->entity->label()])); - $form_state->setRedirectUrl($this->entity->toUrl('collection')); - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php b/sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php deleted file mode 100644 index 2afc0be8a..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php +++ /dev/null @@ -1,90 +0,0 @@ -drupalGet('admin/config/user-interface/toolbar_menu/elements'); - $this->assertResponse(403, "Anonymous user is unauthorized to access settings page"); - - // Add a new custom menu. - $menu_name = 'test_menu'; - $menu_label = 'Test Menu'; - $toolbar_id = 'test_menu_in_toolbar'; - $toolbar_label = 'Test Menu in toolbar'; - - $values = [ - 'id' => $menu_name, - 'label' => $menu_label, - 'description' => 'Description text', - ]; - $menu = \Drupal::entityTypeManager()->getStorage('menu')->create($values); - $menu->save(); - - $adminUser = $this->drupalCreateUser([ - 'administer toolbar menu', - 'administer permissions', - 'access toolbar', - ]); - - // Can access pages if logged in and no crop types exist. - $this->drupalLogin($adminUser); - $this->drupalGet('admin/config/user-interface/toolbar_menu/elements'); - $this->assertResponse(200, "User with 'administer toolbar menu' role is authorized to access settings page"); - - // Create a new toolbar menu element. - $this->drupalGet('admin/config/user-interface/toolbar_menu/elements/add'); - $create_toolbar_element = [ - 'label' => $toolbar_label, - 'id' => $toolbar_id, - 'menu' => $menu_name, - 'rewrite_label' => FALSE, - ]; - $this->drupalPostForm('admin/config/user-interface/toolbar_menu/elements/add', $create_toolbar_element, t('Save')); - - // Enforce refresh caches. - drupal_flush_all_caches(); - - $rid = $this->createRole(["view $toolbar_id in toolbar"], 'aaaaaa', 'AAAAAAAA'); - $adminUser->addRole($rid); - $adminUser->save(); - - $this->checkPermissions(["view $toolbar_id in toolbar"]); - - $this->drupalGet('/admin/people/permissions'); - - $this->drupalGet(''); - $this->assertRaw($toolbar_label, 'Custom menu is viewed in toolbar'); - - $this->drupalGet('admin/config/user-interface/toolbar_menu/elements/' . $toolbar_id); - // Update an existing toolbar menu element. - $update_toolbar_element = [ - 'rewrite_label' => TRUE, - ]; - $this->drupalPostForm('admin/config/user-interface/toolbar_menu/elements/' . $toolbar_id, $update_toolbar_element, t('Save')); - - $this->drupalGet(''); - $this->assertRaw($menu_name, 'Custom menu is viewed in toolbar'); - - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php deleted file mode 100644 index dcd72e60e..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php +++ /dev/null @@ -1,41 +0,0 @@ -t('Label'); - $header['menu'] = $this->t('Menu'); - $header['rewrite_label'] = $this->t('Use menu label'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - /* @var \Drupal\toolbar_menu\Entity\ToolbarMenuElement $entity */ - $row['label'] = $entity->label(); - $row['menu']['#markup'] = $entity->loadMenu()->label(); - $row['rewrite_label']['#markup'] = $entity->rewriteLabel() ? $this->t('Yes') : $this->t('No'); - return $row + parent::buildRow($entity); - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php deleted file mode 100644 index 70342d2e4..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php +++ /dev/null @@ -1,110 +0,0 @@ -entityManager = $entity_manager; - $this->account = $account->getAccount(); - $this->toolbarMenuElements = $this->entityManager->getStorage('toolbar_menu_element')->loadMultiple(); - } - - /** - * Get toolbar menu elements. - * - * @return \Drupal\toolbar_menu\Entity\ToolbarMenuElement[] - * An array containing toolbar menu elements. - */ - public function getToolbarMenuElements() { - $elements = []; - foreach ($this->toolbarMenuElements as $key => $element) { - if ($this->account->hasPermission($this->getPermissionName($element))) { - $elements[$key] = $element; - } - }; - return $elements; - } - - /** - * Helper to clean an ID. - * - * @param string $id - * The ID to clean. - * - * @return string - * The cleaned ID. - */ - public function cleanId($id) { - return preg_replace('/[^\p{L}\p{N}]/u', '-', $id); - } - - /** - * Get the permission list. - * - * @return array - * The permission list. - */ - public function getPermissionList() { - $permissions = []; - foreach ($this->toolbarMenuElements as $element) { - $permissions[$this->getPermissionName($element)] = [ - 'title' => $this->t('View @label element in the toolbar', ['@label' => $element->label()]), - ]; - } - return $permissions; - } - - /** - * Get the formatted permission name. - * - * @param \Drupal\toolbar_menu\Entity\ToolbarMenuElement $element - * The name of the menu. - * - * @return string - * The name of the permission. - */ - protected function getPermissionName(ToolbarMenuElement $element) { - return 'view ' . $element->id() . ' in toolbar'; - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php deleted file mode 100644 index ae9bd9fd4..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php +++ /dev/null @@ -1,44 +0,0 @@ -toolbarMenuManager = $toolbar_menu_manager; - } - - /** - * Add icons on each toolbar menu items. - * - * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree - * The menu link tree to manipulate. - * - * @return \Drupal\Core\Menu\MenuLinkTreeElement[] - * The manipulated menu link tree. - */ - public function addIcons(array $tree) { - foreach ($tree as $element) { - $element->options['attributes']['class'][] = 'toolbar-icon'; - $element->options['attributes']['class'][] = 'toolbar-icon-link-toolbar-menu'; - $element->options['attributes']['class'][] = 'toolbar-icon-link-toolbar-menu-' . $this->toolbarMenuManager->cleanId($element->link->getPluginId()); - $element->options['attributes']['title'] = $element->link->getTitle(); - } - return $tree; - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php deleted file mode 100644 index 906272b70..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php +++ /dev/null @@ -1,49 +0,0 @@ -toolbarMenuManager = $toolbar_menu; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('toolbar_menu.manager') - ); - } - - /** - * Returns an array of toolbar_menu permissions. - * - * @return array - * The permission list. - */ - public function permissions() { - return $this->toolbarMenuManager->getPermissionList(); - } - -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml deleted file mode 100644 index f578cfdef..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Toolbar Menu -description: Add your favorite menu (Structure > Menu) in the Drupal Toolbar -# core: "8.x" -type: module -dependencies: - - drupal:toolbar -configure: toolbar_menu.settings - -# Information added by Drupal.org packaging script on 2017-05-19 -version: '8.x-2.1+0-dev' -core: '8.x' -project: 'toolbar_menu' -datestamp: 1495180394 diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install deleted file mode 100644 index ed1fbc134..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install +++ /dev/null @@ -1,44 +0,0 @@ -get('toolbar_menu.settings')->get('menus'); - - // Create 'toolbar_menu_element' entity type. - $entity_manager->clearCachedDefinitions(); - $toolbar_menu_entity_type = $entity_manager->getDefinition('toolbar_menu_element'); - if ($toolbar_menu_entity_type && $toolbar_menu_entity_type instanceof \Drupal\Core\Entity\EntityTypeInterface) { - \Drupal::entityDefinitionUpdateManager()->installEntityType($toolbar_menu_entity_type); - } - - // Load old configuration and create a toolbar_menu_element entity - // if is active. - foreach ($old_config as $menu_name => $menu_config) { - if ($menu_config['active'] == TRUE && !$entity_manager->getStorage('toolbar_menu_element')->load($menu_name)) { - $entity_manager->getStorage('toolbar_menu_element')->create([ - 'id' => $menu_name, - 'label' => $menu_name, - 'menu' => $menu_name, - 'weight' => $menu_config['weight'], - 'rewrite_label' => TRUE, - ])->save(); - } - } - - // Delete old and deprecated configuration. - $config_factory->getEditable('toolbar_menu.settings')->delete(); -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml deleted file mode 100644 index 848e2c4a0..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml +++ /dev/null @@ -1,7 +0,0 @@ -icons: - version: 1.3 - js: - js/toolbar_menu.js: {} - css: - base: - css/toolbar_menu.module.css: {} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml deleted file mode 100644 index b9843188e..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.toolbar_menu_element.add_form: - route_name: 'entity.toolbar_menu_element.add_form' - title: 'Add Toolbar menu element' - appears_on: - - entity.toolbar_menu_element.collection diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml deleted file mode 100644 index 7683e3267..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.toolbar_menu_element.collection: - description: 'Configure Toolbar Menu to add your own element in the toolbar' - title: 'Toolbar Menu' - route_name: entity.toolbar_menu_element.collection - parent: system.admin_config_ui diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml deleted file mode 100644 index a731cf9d3..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -toolbar_menu.settings: - title: 'Toolbar Menu Settings' - route_name: toolbar_menu.settings - base_route: toolbar_menu.settings.base diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module deleted file mode 100644 index 789c41b39..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module +++ /dev/null @@ -1,121 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('Add your favorite menu in the Drupal Toolbar'); - $output .= '

' . t('Usage') . '

'; - $output .= '
    '; - $output .= '
  • ' . t('Manage your menus (Structure > Menu)') . '
  • '; - $output .= '
  • ' . t('Go to Config > Toolbar Menu > Toolbar Menu settings') . '
  • '; - $output .= '
  • ' . t('Check all menus you want to appear in your toolbar') . '
  • '; - $output .= '
  • ' . t('Re-order the menu entries if you want') . '
  • '; - $output .= '
  • ' . t('Save the configuration') . '
  • '; - $output .= '
  • ' . t('Your selected menus must appears in the toolbar') . '
  • '; - $output .= '
'; - return $output; - } -} - -/** - * Implements hook_page_top(). - * - * Add a new cache tag for the toolbar cache. - */ -function toolbar_menu_page_top(array &$page_top) { - $page_top['toolbar']['#cache']['tags'][] = 'toolbar_menu'; -} - -/** - * Implements hook_toolbar(). - */ -function toolbar_menu_toolbar() { - $items = []; - - /** @var \Drupal\toolbar_menu\ToolbarMenuManager $toolbar_manager */ - $toolbar_manager = \Drupal::service('toolbar_menu.manager'); - foreach ($toolbar_manager->getToolbarMenuElements() as $element_id => $element) { - $items['toolbar_menu_' . $element_id] = [ - '#type' => 'toolbar_item', - 'tab' => [ - '#type' => 'link', - '#title' => $element->getDisplayLabel(), - '#url' => Url::fromRoute(''), - '#attributes' => [ - 'title' => $element->getDisplayLabel(), - 'class' => [ - 'toolbar-icon', - 'toolbar-icon-toolbar-menu', - 'toolbar-icon-toolbar-menu-' . $element_id, - ], - 'data-drupal-subtrees' => '', - ], - ], - 'tray' => [ - '#heading' => t('@menu_label actions', ['@menu_label' => $element->getDisplayLabel()]), - 'toolbar_menu_' . $element_id . '_links' => [ - '#type' => 'container', - '#id' => $element->loadMenu()->id(), - '#pre_render' => ['toolbar_menu_prerender_toolbar_tray'], - '#attributes' => [ - 'class' => ['toolbar-menu-administration'], - ], - ], - ], - '#weight' => $element->weight(), - '#attached' => [ - 'library' => [ - 'toolbar_menu/icons', - ], - ], - '#cache' => [ - 'tags' => array_merge($element->getCacheTags(), $element->loadMenu()->getCacheTags(), ['toolbar_menu']), - ], - ]; - } - return $items; -} - -/** - * Pre-render the toolbar_menu tray element. - * - * @param array $element - * The tray element to pre-render. - * - * @return array - * The pre-rendered tray element. - */ -function toolbar_menu_prerender_toolbar_tray(array $element) { - /** @var \Drupal\toolbar\Menu\ToolbarMenuLinkTree $menu_tree */ - $menu_tree = \Drupal::service('toolbar.menu_tree'); - - $parameters = new MenuTreeParameters(); - $parameters->excludeRoot()->onlyEnabledLinks(); - - $tree = $menu_tree->load($element['#id'], $parameters); - - $manipulators = [ - ['callable' => 'menu.default_tree_manipulators:checkAccess'], - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - ['callable' => 'toolbar_menu.menu_link_tree_manipulators:addIcons'], - ]; - $tree = $menu_tree->transform($tree, $manipulators); - - $element['toolbar_menu_' . $element['#id']] = $menu_tree->build($tree); - - return $element; -} diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml deleted file mode 100644 index ca6b4b590..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml +++ /dev/null @@ -1,5 +0,0 @@ -administer toolbar menu: - title: 'Administer toolbar menu' - -permission_callbacks: - - Drupal\toolbar_menu\ToolbarMenuPermissions::permissions diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml deleted file mode 100644 index 76f7a2e2f..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml +++ /dev/null @@ -1,16 +0,0 @@ -entity.toolbar_menu_element.collection: - path: 'admin/config/user-interface/toolbar_menu/elements' - defaults: - _entity_list: 'toolbar_menu_element' - _title: 'Toolbar menu elements' - requirements: - _permission: 'administer toolbar menu' - -entity.toolbar_menu_element.add_form: - path: 'admin/config/user-interface/toolbar_menu/elements/add' - defaults: - _entity_form: 'toolbar_menu_element.default' - _title: 'Add Toolbar menu element' - tempstore_id: 'toolbar_menu.element' - requirements: - _permission: 'administer toolbar menu' diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml deleted file mode 100644 index 118a25c22..000000000 --- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - toolbar_menu.manager: - class: Drupal\toolbar_menu\ToolbarMenuManager - arguments: ['@entity.manager', '@current_user'] - - toolbar_menu.menu_link_tree_manipulators: - class: Drupal\toolbar_menu\ToolbarMenuMenuLinkTreeManipulators - arguments: ['@toolbar_menu.manager'] diff --git a/sites/all/modules/contrib/admin/toolbar_themes/.gitignore b/sites/all/modules/contrib/admin/toolbar_themes/.gitignore deleted file mode 100644 index e5cf63215..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Git ignored. -/node_modules/ diff --git a/sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js b/sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js deleted file mode 100644 index 96cb3f64e..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Grunt tasks for Toolbar Themes. - * http://gruntjs.com/ - */ - -'use strict'; - -module.exports = function(grunt) { - - grunt.initConfig({ - - pkg: grunt.file.readJSON('package.json'), - - sass: { - styles: { - files: [{ - expand: true, - cwd: 'themes', - src: ['**/*.scss'], - dest: 'themes', - ext: '.css' - }], - options: { - precision: 5, - outputStyle: 'expanded', - sourceMap: true - } - } - }, - - grunticon: { - toolbar: { - files: [{ - expand: true, - cwd: 'themes/base/grunticons/original', - src: ['*.svg'], - dest: 'themes/base/grunticons/processed' - }], - options: { - enhanceSVG: true, - cssprefix: '.' - } - } - }, - - postcss: { - styles: { - src: 'themes/**/*.css', - options: { - map: { - inline: false - }, - processors: [ - require('autoprefixer')({browsers: 'last 4 versions'}) - ] - } - } - }, - - watch: { - styles: { - files: 'themes/**/*.scss', - tasks: ['sass:styles', 'postcss:styles'] - } - } - }); - - grunt.loadNpmTasks('grunt-postcss'); - grunt.loadNpmTasks('grunt-sass'); - grunt.loadNpmTasks('grunt-grunticon'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.registerTask('default', ['watch:styles']); -}; diff --git a/sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt b/sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/toolbar_themes/README.md b/sites/all/modules/contrib/admin/toolbar_themes/README.md deleted file mode 100644 index 1f184cbbd..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Toolbar Themes - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml b/sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml deleted file mode 100644 index 4671b2c1a..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Install settings. -default_theme: toolbar_admin_menu -icons: 0 -tabs: 0 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css b/sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css deleted file mode 100644 index 5e7409fe4..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css +++ /dev/null @@ -1,34 +0,0 @@ -/* Styles provided by the Toolbar Theme module . */ - -/*#toolbar-administration {display: none !important}*/ - -.toolbar-themes-form { - overflow-x: scroll; -} - -.toolbar-themes-form td { - vertical-align: top; -} - - -.toolbar-themes-form .toolbar-theme-screen-shot { - max-width: 540px; -} - -.toolbar-themes-form .toolbar-themes-meta, -.toolbar-themes-form .toolbar-themes-meta dt, -.toolbar-themes-form .toolbar-themes-meta dd { - margin: 0; -} - -.toolbar-themes-form .toolbar-themes-meta dt { - clear: left; - margin-right: 3px; - width: 5em; - font-weight: 600; -} - -.toolbar-themes-form .toolbar-themes-meta dt, -.toolbar-themes-form .toolbar-themes-meta dd { - float: left; -} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/js/base.js b/sites/all/modules/contrib/admin/toolbar_themes/js/base.js deleted file mode 100644 index 526a49db4..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/js/base.js +++ /dev/null @@ -1,47 +0,0 @@ -(function ($, drupalSettings) { - - 'use strict'; - - Drupal.behaviors.ToolbarThemes = { - attach: function () { - - // Remove titles, they obscure drop menu items. - $('#toolbar-bar a').removeAttr('title'); - - // Wrap menu link text. - $('#toolbar-bar .toolbar-menu a').wrapInner(''); - - if (drupalSettings.toolbar.icons == 1) { - // Remove toolbar tab-icon classes. - $("#toolbar-bar .toolbar-tab a").removeClass(function (index, css) { - return (css.match (/(^|\s)toolbar-ico\S+/g) || []).join(' '); - }); - - // Move icons into anchors so we can style active/hover states etc. - if (drupalSettings.toolbar.tabs == 1) { - $('#toolbar-bar .toolbar-tab__items-wrapper i.toolbar-icon').each(function () { - var t = $(this).prev(); - $(this).prependTo(t); - }); - } - - if ($('#toolbar-bar').hasClass('has-icons')) { - $('#toolbar-bar .toolbar-tray-horizontal i.toolbar-icon').each(function() { - var h = $(this).prev(); - $(this).prependTo(h); - }); - - $('#toolbar-bar .toolbar-tray-vertical i.toolbar-icon').each(function() { - if ($(this).parents('.toolbar-tab').find('.trigger').hasClass('is-active')) { - var v = $(this).siblings('.toolbar-box').find('a.toolbar-menu__link'); - } else { - var v = $(this).prev(); - } - $(this).prependTo(v); - }); - } - } - } - }; - -})(jQuery, drupalSettings); diff --git a/sites/all/modules/contrib/admin/toolbar_themes/package.json b/sites/all/modules/contrib/admin/toolbar_themes/package.json deleted file mode 100644 index 0a73a4776..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "toolbar_themes", - "version": "8.0.0", - "description": "Theme and style overrides for the Toolbar", - "author": "Jeff Burnz", - "email": "jmburnz@gmail.com", - "private": true, - "devDependencies": { - "autoprefixer": "7.1.6", - "grunt": "1.0.1", - "grunt-contrib-watch": "1.0.0", - "grunt-grunticon": "^2.3.2", - "grunt-postcss": "0.9.0", - "grunt-sass": "2.0.0" - }, - "engines": { - "node": "6.11.5", - "npm": "5.5.1" - }, - "repository": { - "type": "git", - "url": "http://cgit.drupalcode.org/toolbar_themes/" - }, - "bugs": { - "url": "https://www.drupal.org/project/issues/toolbar_themes" - }, - "keywords": [ - "drupal", - "theme", - "toolbar" - ], - "license": "GPL-2.0" -} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php b/sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php deleted file mode 100644 index 6dc5fca4b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php +++ /dev/null @@ -1,188 +0,0 @@ -config('toolbar_themes.settings'); - $admin_theme = $this->config('system.theme')->get('admin'); - - $form['settings'] = array( - '#type' => 'container', - '#tree' => TRUE, - '#title' => t('Toolbar Themes'), - ); - - $form['settings']['info'] = array( - '#type' => 'markup', - '#prefix' => '

', - '#suffix' => '

', - '#markup' => t('Select options to style the Toolbar.'), - ); - - // Table - $header = array( - 'theme' => t('Theme'), - 'screen_shot' => t('Screen Shots'), - 'meta' => t('Meta'), - ); - - $definitions = toolbar_themes_get_theme_definitions(); - $theme_handler = \Drupal::service('theme_handler'); - $options = array(); - - foreach ($definitions as $provider => $values) { - if ($theme_handler->themeExists($provider)) { - $provider_path = drupal_get_path('theme', $provider); - } - else { - $provider_path = drupal_get_path('module', $provider); - } - foreach ($values as $theme => $data) { - if (!isset($data['hidden']) || $data['hidden'] !== TRUE) { - // Label - $label[$theme] = ucfirst(t($data['label'])); - // Description - $description[$theme] = $data['description'] ? t($data['description']) : t('No description provided'); - // Dependencies - $dependency[$theme] = isset($data['libraries']['dependencies']) ? $data['libraries']['dependencies'][0] : NULL; - $screen_shot = []; - if ((isset($data['path']) && !empty($data['path'])) && (isset($data['screen_shot']) && !empty($data['screen_shot']))) { - $screen_shot[$theme] = array( - '#theme' => 'image', - '#uri' => $provider_path . '/' . $data['path'] . '/' . $data['screen_shot'], - '#alt' => $description[$theme], - '#attributes' => array('class' => array('toolbar-theme-screen-shot')), - ); - } - else { - $screen_shot[$theme] = array( - '#markup' => '' . t('No screen shot provided') . '', - ); - } - // Meta - $meta[$theme]['version'] = $data['version'] ? $data['version'] : NULL; - $meta[$theme]['meta'] = array( - '#markup' => '
' . t('Version') .'
' . $meta[$theme]['version'] .'
' . t('Provider') .'
' . $provider . '
', - ); - // Table options - $options[$theme] = array( - 'theme' => $label[$theme], - 'screen_shot' => \Drupal::service('renderer')->render($screen_shot[$theme]), - 'meta' => \Drupal::service('renderer')->render($meta[$theme]['meta']), - ); - // Radios default value is a key, not an array. - if ($config->get('default_theme') === $theme) { - $default = $theme; - } - } - } - } - - if (!empty($options)) { - $form['settings']['default_theme'] = array( - '#type' => 'tableselect', - '#title' => t('Select toolbar theme'), - '#header' => $header, - '#options' => $options, - '#multiple' => FALSE, - '#js_select' => FALSE, - '#default_value' => $default, - '#empty' => t('No toolbar themes found'), - ); - } - -// $form['settings']['font_size'] = array( -// '#type' => 'number', -// '#title' => t('Set font size'), -// '#max-length' => 2, -// '#step' => 1, -// '#default_value' => $config->get('font_size'), -// '#attributes' => array( -// 'min' => 10, -// 'max' => 99, -// 'step' => 1, -// 'class' => array('font-size'), -// ), -// '#field_suffix' => 'px', -// ); - - // Adminimal warnings etc. - if ($admin_theme == 'adminimal_theme') { - $form['settings']['font_disabled'] = array( - '#type' => 'markup', - '#prefix' => '
', - '#suffix' => '
', - '#markup' => t('For Adminmal the font size will only apply to the front end theme.'), - ); - } - - $form['settings']['tabs'] = array( - '#type' => 'checkbox', - '#title' => t('Show toolbar tabs'), - '#default_value' => $config->get('tabs'), - '#description' => t('Unchecked this will remove tabs except for the Manage tab which is replaced by an icon.'), - ); - - $form['settings']['icons'] = array( - '#type' => 'checkbox', - '#title' => t('Show icons'), - '#default_value' => $config->get('icons'), - '#description' => t('Unchecked this will remove icons from tab and menu items, while orientation toggle icons and sub-menu arrows remain.'), - ); - - $form['settings']['actions']['#type'] = 'actions'; - $form['settings']['actions']['submit'] = array( - '#type' => 'submit', - '#value' => $this->t('Submit'), - '#button_type' => 'primary', - ); - - return $form; - } - - /** - * {@inheritDoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) {} - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $config = \Drupal::service('config.factory')->getEditable('toolbar_themes.settings'); - foreach ($values['settings'] as $key => $setting) { - $config->set($key, $setting); - } - $config->save(); - parent::submitForm($form, $form_state); - drupal_flush_all_caches(); - } -} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig b/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig deleted file mode 100644 index 314bdadb2..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig +++ /dev/null @@ -1,93 +0,0 @@ -{# -/** - * Toolbar themes theme implementation to display a toolbar menu. - * - * Available variables: - * - menu_name: The machine name of the menu. - * - items: A nested list of menu items. Each menu item contains: - * - attributes: HTML attributes for the menu item. - * - below: The menu item child items. - * - title: The menu link title. - * - url: The menu link url, instance of \Drupal\Core\Url - * - localized_options: Menu link localized options. - * - is_expanded: TRUE if the link has visible children within the current - * menu tree. - * - is_collapsed: TRUE if the link has children within the current menu tree - * that are not currently visible. - * - in_active_trail: TRUE if the link is in the active trail. - * - show_icon: bool to show or hide icon markup. - * - * @ingroup themeable - */ -#} -{%- import _self as menus -%} -{# - We call a macro which calls itself to render the full tree. - @see http://twig.sensiolabs.org/doc/tags/macro.html -#} -{{- menus.menu_links(items, attributes, 0, menu_name) -}} - -{%- macro menu_links(items, attributes, menu_level, menu_name) -%} - {%- import _self as menus -%} - - {% if items %} - - {% endif %} -{%- endmacro -%} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig b/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig deleted file mode 100644 index c79c9c467..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig +++ /dev/null @@ -1,56 +0,0 @@ -{# -/** - * Toolbar themes implementation for the administrative toolbar. - * - * Available variables: - * - attributes: HTML attributes for the wrapper. - * - toolbar_attributes: HTML attributes to apply to the toolbar. - * - toolbar_heading: The heading or label for the toolbar. - * - tabs: List of tabs for the toolbar. - * - attributes: HTML attributes for the tab container. - * - link: Link or button for the menu tab. - * - icon_attributes: tab icon classes and attributes to style SVG grunticons. - * - trays: Toolbar tray list, each associated with a tab. Each tray in trays - * contains: - * - attributes: HTML attributes to apply to the tray. - * - label: The tray's label. - * - links: The tray menu links. - * - remainder: Any non-tray, non-tab elements left to be rendered. - * - show_icons: bool to show or hide icon markup. - * - * @see toobar_themes_preprocess_toolbar() - * - * @ingroup themeable - */ -#} - - {% - set classes = [ - 'toolbar-bar', - show_icons ? 'has-icons' : 'no-icons', - show_tabs ? 'has-tabs' : 'no-tabs', - ] - %} - -

{{ toolbar_heading }}

- {% for key, tab in tabs %} - {% set tray = trays[key] %} - - - {{- tab.link -}} - - {% spaceless %} - - {% if tray.label %} -

{{ tray.label }}

- {% endif %} - - - {% endspaceless %} - - {% endfor %} - - {{ remainder }} - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/_variables.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/_variables.scss deleted file mode 100644 index e0b187065..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/_variables.scss +++ /dev/null @@ -1,34 +0,0 @@ -// Admin theme SCSS variables. - -$font-family : "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", arial, sans-serif; -$font-size : .75rem; - -$tap-highlight : rgba(255, 255, 255, 0); - -$toolbar-bar-color : #e8e8e8; -$toolbar-bar-background : #454545; - -$drop-shadows : false; -$drop-shadow-color : rgba(0, 0, 0, 0.333); -$border-color : #323232; - -$tab-item-height : $font-size * 2; -$toolbar-item-padding : 0.3em 0.95em .2em; - -$tab-color : #d8d8d8; -$tab-active-color : #fff; - -$tray-color : #e8e8e8; -$tray-active : #fff; -$tray-background : #101010; - -$tray-vertical-background : $tray-background; -$tray-border-color : #696969; - -$drop-menu-border-color : $border-color; -$drop-menu-background : rgba(16, 16, 16, 0.95); -$sub-menu-indicator : $tray-border-color; - -$toggle-orientation-color : $tray-border-color; -$toggle-orientation-active : $tray-color; -$toggle-orientation-border-color : $toggle-orientation-color; diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css deleted file mode 100644 index 82cc167f9..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css +++ /dev/null @@ -1,47 +0,0 @@ -/** - * admin_menu_icons - */ -#toolbar-administration .toolbar-icon { - padding: 0 .25em 0 0; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon { - fill: #d8d8d8; - top: 0.1em; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon-menu { - width: 0.875em; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:active .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active .toolbar-icon, -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:hover .toolbar-icon, -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:active .toolbar-icon, -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button.is-active .toolbar-icon { - fill: #fff; -} - -@media only screen and (max-width: 24em) { - #toolbar-administration .toolbar-bar .home-toolbar-tab, - #toolbar-administration .toolbar-bar .tour-toolbar-tab, - #toolbar-administration .toolbar-bar .toolbar-tab__items-wrapper .toolbar-icon { - display: none; - } -} - -#toolbar-administration .toolbar-menu a { - fill: #e8e8e8; -} - -#toolbar-administration .toolbar-menu a:hover, #toolbar-administration .toolbar-menu a:focus, #toolbar-administration .toolbar-menu a:active, #toolbar-administration .toolbar-menu a.is-active { - fill: #fff; -} - -#toolbar-administration .toolbar-menu a.is-active[href="/"] { - fill: #e8e8e8; -} - -#toolbar-administration .toolbar-menu a:hover[href="/"], #toolbar-administration .toolbar-menu a:focus[href="/"], #toolbar-administration .toolbar-menu a:active[href="/"] { - fill: #fff; -} -/*# sourceMappingURL=admin_menu_icons.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css.map deleted file mode 100644 index 8d803bc2b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["admin_menu_icons.scss","_variables.scss","admin_menu_icons.css"],"names":[],"mappings":"AAAA;;GAEG;AAgBH;EAGI,qBAAoB;CACrB;;AAJH;EAYU,cCbiC;EDcjC,WAAU;CACX;;AAdT;EAiBU,eAAc;CACf;;AAlBT;;;;EA0Bc,WC1B0B;CD2B3B;;AAOX;EAlCF;;;IAwCM,cAAa;GACd;CE9BJ;;AFXD;EAgDM,cC9CqC;CDkEtC;;AApEL;EAsDQ,WCnDgC;CDoDjC;;AAvDP;EA0DQ,cCxDmC;CDyDpC;;AA3DP;EAiEU,WC9D8B;CD+D/B","file":"admin_menu_icons.css","sourcesContent":[null,null,"/**\n * admin_menu_icons\n */\n#toolbar-administration .toolbar-icon {\n padding: 0 .25em 0 0;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon {\n fill: #d8d8d8;\n top: 0.1em;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon-menu {\n width: 0.875em;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:active .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active .toolbar-icon,\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:hover .toolbar-icon,\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:active .toolbar-icon,\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button.is-active .toolbar-icon {\n fill: #fff;\n}\n\n@media only screen and (max-width: 24em) {\n #toolbar-administration .toolbar-bar .home-toolbar-tab,\n #toolbar-administration .toolbar-bar .tour-toolbar-tab,\n #toolbar-administration .toolbar-bar .toolbar-tab__items-wrapper .toolbar-icon {\n display: none;\n }\n}\n\n#toolbar-administration .toolbar-menu a {\n fill: #e8e8e8;\n}\n\n#toolbar-administration .toolbar-menu a:hover, #toolbar-administration .toolbar-menu a:focus, #toolbar-administration .toolbar-menu a:active, #toolbar-administration .toolbar-menu a.is-active {\n fill: #fff;\n}\n\n#toolbar-administration .toolbar-menu a.is-active[href=\"/\"] {\n fill: #e8e8e8;\n}\n\n#toolbar-administration .toolbar-menu a:hover[href=\"/\"], #toolbar-administration .toolbar-menu a:focus[href=\"/\"], #toolbar-administration .toolbar-menu a:active[href=\"/\"] {\n fill: #fff;\n}\n\n/*# sourceMappingURL=admin_menu_icons.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.scss deleted file mode 100644 index 9c3ff67a7..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_icons.scss +++ /dev/null @@ -1,91 +0,0 @@ -/** - * admin_menu_icons - */ - -// Import global variables. -@import "variables"; - - -// Most icons are embedded SVG. Icons are embedded using Grunticon. We are using -// the original SVG icons from Drupal core, however the width and height -// attribute have been replaced with a viewBox attribute so we can scale them -// properly with CSS. Embedded SVG has the advantage of being styled with CSS, -// and by using Grunticon JS loading we negate most of the bloat and overhead -// associated with embedding SVG files. For the buttons (orientation toggles & -// menu click handles), and for sub-menu indicators we use a custom font icon -// that is tiny and only includes four icons. We rotate and color these in CSS -// as required. - -#toolbar-administration { - - .toolbar-icon { - padding: 0 .25em 0 0; - } - - - // Top level icons. - .toolbar-bar { - .toolbar-tab { - .toolbar-tab__items-wrapper { - .toolbar-icon { - fill: $tab-color ; - top: 0.1em; - } - - .toolbar-icon-menu { - width: 0.875em; - } - - a, - button { - &:hover, - &:active, - &.is-active { - .toolbar-icon { - fill: $tab-active-color; - } - } - } - } - } - } - - @media only screen and (max-width: 24em) { - // Toolbar-themes module cannot hide the text, so instead we remove the - // icons and other redundant tabs in narrow screens. - .toolbar-bar .home-toolbar-tab, - .toolbar-bar .tour-toolbar-tab, - .toolbar-bar .toolbar-tab__items-wrapper .toolbar-icon { - display: none; - } - } - - - // Main menu icons. - .toolbar-menu { - a { - fill: $tray-color; - - &:hover, - &:focus, - &:active, - &.is-active { - fill: $tray-active; - } - - &.is-active[href="/"] { - fill: $tray-color; - } - - &:hover, - &:focus, - &:active { - &[href="/"] { - fill: $tray-active; - } - } - } - } -} - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css deleted file mode 100644 index 90280eb1c..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css +++ /dev/null @@ -1,345 +0,0 @@ -/** - * admin_menu_theme - * Theme styles for menus and other toolbar elements. SVG icons are styled in - * the [theme]_icons.scss file, while click handles, e.g. origination buttons - * are styled here. - */ -body .toolbar-no-tabs { - padding-top: 1.5rem !important; -} - -#toolbar-administration { - font-family: "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", arial, sans-serif; - font-weight: 400; - font-size: 0.75rem; - height: 3rem; - background-color: #454545; - -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -} - -.toolbar-vertical #toolbar-administration, -.toolbar-no-tabs #toolbar-administration, -#toolbar-administration .toolbar-tab, -#toolbar-administration .toolbar-tray { - height: 1.5rem; -} - -#toolbar-administration .toolbar-tray { - top: 1.5rem; -} - -#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus, -#toolbar-administration .toolbar-item a:hover, -#toolbar-administration .toolbar-item a:focus { - text-decoration: none; - outline: none; -} - -#toolbar-administration .toolbar-item { - padding: 0.3em 0.95em 0.2em; - display: block; -} - -#toolbar-administration .toolbar__link-label { - font-size: 1em; -} - -#toolbar-administration .toolbar-bar { - background-color: #454545; - color: #e8e8e8; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a { - color: #d8d8d8; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:focus, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active { - color: #fff; - background-image: -webkit-gradient(linear, left top, left bottom, from(#454545), to(#101010)); - background-image: -webkit-linear-gradient(#454545, #101010); - background-image: -o-linear-gradient(#454545, #101010); - background-image: linear-gradient(#454545, #101010); -} - -#toolbar-administration .toolbar-bar .tour-toolbar-tab.toolbar-tab { - float: none; -} - -#toolbar-administration .toolbar-bar .tour-toolbar-tab button.toolbar-item { - padding: 0.3em 0.95em 0.2em; -} - -#toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item { - color: #d8d8d8; -} - -#toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item:hover, #toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item:focus, #toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item.is-active { - color: #fff; - background: none; -} - -#toolbar-administration .toolbar-lining button:focus { - outline: none; -} - -#toolbar-administration .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; -} - -#toolbar-administration .toolbar-box a:focus { - outline: none; -} - -#toolbar-administration .toolbar-box a:hover:focus { - text-decoration: none; -} - -#toolbar-administration .toolbar-tray { - background-color: #101010; -} - -#toolbar-administration .toolbar-tray a { - color: #e8e8e8; - cursor: pointer; - padding: 0.3em 0.95em 0.2em; -} - -#toolbar-administration .toolbar-tray a:hover, #toolbar-administration .toolbar-tray a:active, #toolbar-administration .toolbar-tray a:focus, #toolbar-administration .toolbar-tray a.is-active { - color: #fff; -} - -#toolbar-administration .toolbar-tray a.is-active[href="/"] { - color: #e8e8e8; -} - -#toolbar-administration .toolbar-tray-horizontal a:focus { - outline: none; - background-color: #101010; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu { - background-color: rgba(16, 16, 16, 0.95); -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item { - border-top: 1px solid #101010; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item:first-child { - border-top-color: #101010; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-menu { - top: -1px; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a { - border-right: 1px solid; - border-color: #101010; - -webkit-border-image: -webkit-gradient(linear, left bottom, left top, from(#696969), to(#101010)) 1 100%; - -webkit-border-image: -webkit-linear-gradient(bottom, #696969, #101010) 1 100%; - -o-border-image: -o-linear-gradient(bottom, #696969, #101010) 1 100%; - border-image: -webkit-gradient(linear, left bottom, left top, from(#696969), to(#101010)) 1 100%; - border-image: linear-gradient(to top, #696969, #101010) 1 100%; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a, [dir="rtl"] -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a { - border-right: 0; - border-left: 1px solid; -} - -#toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:hover, #toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:focus { - background-color: #101010; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:after { - color: #696969; - right: 0.65em; - top: 0.5em; - display: block; - font-size: 0.9em; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:hover:after, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:focus:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:hover:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:focus:after { - color: #fff; -} - -#toolbar-administration .toolbar-tray-horizontal .edit-shortcuts { - float: none; - position: absolute; - right: 2.2em; - top: 0; -} - -#toolbar-administration .toolbar-tray-vertical { - background-color: #101010; - border-right: 1px solid #323232; - height: 100%; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical { - border-left: 1px solid #323232; - border-right: 0 none; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu { - display: none; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu { - display: block; - border-bottom-width: 0; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu .toolbar-menu { - border-bottom-width: 1px; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-handle + a { - margin-right: 3em; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical .toolbar-handle + a { - margin-left: 3em; - margin-right: 0; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item + .menu-item { - border-top: 1px solid #696969; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item:last-child { - border-bottom: 1px solid #696969; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item .menu-item { - border: 0 none; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:hover, -#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:focus { - background-color: #1d1d1d; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu.root { - border: 0; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu { - border-bottom: 1px solid; - border-top: 1px solid; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-1 > ul { - background-color: #383838; - border-bottom-color: #5c5c5c; - border-top-color: #5c5c5c; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-2 > ul { - background-color: #2c2c2c; - border-bottom-color: #505050; - border-top-color: #505050; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-3 > ul { - background-color: #1f1f1f; - border-bottom-color: #434343; - border-top-color: #434343; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-4 > ul { - background-color: #121212; - border-bottom-color: #363636; - border-top-color: #363636; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-5 > ul { - background-color: #050505; - border-bottom-color: #292929; - border-top-color: #292929; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-6 > ul { - background-color: black; - border-bottom-color: #1d1d1d; - border-top-color: #1d1d1d; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-7 > ul { - background-color: black; - border-bottom-color: #101010; - border-top-color: #101010; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-8 > ul { - background-color: black; - border-bottom-color: #030303; - border-top-color: #030303; -} - -#toolbar-administration .menu-item:last-child > .toolbar-menu { - border-bottom: 0; -} - -#toolbar-administration .toolbar-icon.toolbar-handle:before { - color: #696969; -} - -#toolbar-administration .toolbar-icon.toolbar-handle.open:before { - color: #fff; -} - -#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before { - color: #696969; -} - -#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus:before { - color: #e8e8e8; - background-color: transparent; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 1px solid #696969; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 0 none; - border-right: 1px solid #696969; -} - -#toolbar-administration .toolbar-toggle-orientation [value="horizontal"]:after { - right: 0.95em; -} - -.adminimal #toolbar-bar { - font: normal 83.1%/1.538 "Open Sans", sans-serif !important; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-themes { - padding-top: 4.75em !important; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal #toolbar-administration { - background-color: #333; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-has-tabs #toolbar-administration { - min-height: 4em; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs #toolbar-administration { - min-height: 2em; -} - -.adminimal.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, .adminimal.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs, .adminimal.toolbar-fixed.toolbar-vertical.toolbar-no-tabs, .adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs { - padding-top: 2.3em !important; -} -/*# sourceMappingURL=admin_menu_theme.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css.map deleted file mode 100644 index 630c19446..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["admin_menu_theme.scss","_variables.scss","admin_menu_theme.css"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;EAEI,+BAAwC;CACzC;;AAGH;EACE,qGCfyH;EDgBzH,iBAAgB;EAChB,mBChBwC;EDiBxC,aAA4B;EAC5B,0BCbyC;EDczC,oDCjBwD;CDwYzD;;AArXC;;;;EAIE,eCd8C;CDe/C;;AAbH;EAgBI,YClB8C;CDmB/C;;AAjBH;;;EAwBQ,sBAAqB;EACrB,cAAa;CACd;;AA1BP;EA+BI,4BChCiD;EDiCjD,eAAc;CACf;;AAjCH;EAoCI,eAAc;CACf;;AArCH;EA0CI,0BClDuC;EDmDvC,eCpDuC;CDyGxC;;AAhGH;EA+DM,eC9DqC;CDsEtC;;AAvEL;EAoEQ,YClEgC;EDmEhC,8FAA4E;EAA5E,4DAA4E;EAA5E,uDAA4E;EAA5E,oDAA4E;CAC7E;;AAtEP;EA4EQ,YAAW;CACZ;;AA7EP;EAgFQ,4BCjF6C;CDkF9C;;AAjFP;EAsFM,eCrFqC;CD6FtC;;AA9FL;EA2FQ,YCzFgC;ED0FhC,iBAAgB;CACjB;;AA7FP;EAqGI,cAAa;CACd;;AAtGH;EA2GI,iBAAgB;EAChB,UAAS;EACT,WAAU;CACX;;AA9GH;EAqHM,cAAa;CACd;;AAtHL;EAyHM,sBAAqB;CACtB;;AA1HL;EAgII,0BC1HuC;CD4IxC;;AAlJH;EAmIM,eC/HqC;EDgIrC,gBAAe;EACf,4BCtI+C;CDkJhD;;AAjJL;EA2IQ,YCtIgC;CDuIjC;;AA5IP;EA+IQ,eC3ImC;CD4IpC;;AAhJP;EAgKM,cAAa;EACb,0BC3JqC;CD4JtC;;AAlKL;EAuKQ,yCC3JkD;CDmLnD;;AA/LP;EA8KU,8BCxKiC;CD6KlC;;AAnLT;EAiLY,0BC3K+B;CD4KhC;;AAlLX;EA6LU,UAAS;CACV;;AA9LT;;EAmMQ,wBAAuB;EACvB,sBC9LmC;ED+LnC,yGAAkF;EAAlF,+EAAkF;OAAlF,qEAAkF;UAAlF,iGAAkF;UAAlF,+DAAkF;CAMnF;;AE9EP;;EF2EU,gBAAe;EACf,uBAAsB;CACvB;;AA1MT;EAkNU,0BC5MiC;CD6MlC;;AAnNT;;EA4NU,eCnNiC;EDoNjC,cAAa;EACb,WAAU;EACV,eAAc;EACd,iBAAgB;CACjB;;AAjOT;;;EAsOY,YCjO4B;CDkO7B;;AAvOX;EA6OM,YAAW;EACX,mBAAkB;EAClB,aAAY;EACZ,OAAM;CACP;;AAjPL;EAuPI,0BCjPuC;EDkPvC,gCC5PuC;ED6PvC,aAAY;CA8Eb;;AEpKH;EF8FM,+BCrQqC;EDsQrC,qBAAoB;CAKrB;;AAvQL;EA0QM,cAAa;CACd;;AA3QL;EA8QM,eAAc;EACd,uBAAsB;CAKvB;;AApRL;EAkRQ,yBAAwB;CACzB;;AAnRP;EAuRM,kBAAiB;CAMlB;;AEpGL;EFiGQ,iBAAgB;EAChB,gBAAe;CAChB;;AA5RP;EAiSQ,8BCxRmC;CDyRpC;;AAlSP;EAqSQ,iCC5RmC;CD6RpC;;AAtSP;EAySQ,eAAc;CACf;;AA1SP;;EA8SQ,0BAA+C;CAChD;;AA/SP;EAoTQ,UAAS;CACV;;AArTP;EAwTQ,yBAAwB;EACxB,sBAAqB;CACtB;;AA1TP;EAkUQ,0BAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,0BAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,0BAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,0BAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,0BAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,wBAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,wBAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EAkUQ,wBAA6D;EAC7D,6BAAuD;EACvD,0BAAuD;CACxD;;AArUP;EA0UI,iBAAgB;CACjB;;AA3UH;EAiVM,eCxUqC;CDyUtC;;AAlVL;EAsVQ,YCjVgC;CDkVjC;;AAvVP;EA8VM,eCrVqC;CDsVtC;;AA/VL;EAqWM,eCjWqC;EDkWrC,8BAA6B;CAC9B;;AAvWL;EAkXI,+BCzWuC;CD+WxC;;AEvFH;EFoFM,oBAAmB;EACnB,gCC7WqC;CD8WtC;;AAvXL;EA2XI,cAAa;CACd;;AAKH;EAGI,4DAA2D;CAC5D;;AAJH;EAUU,+BAA8B;CAC/B;;AAXT;EAcU,uBAAsB;CACvB;;AAfT;EAkBU,gBAAe;CAChB;;AAnBT;EAsBU,gBAAe;CAChB;;AAvBT;EAgCI,8BAA6B;CAC9B","file":"admin_menu_theme.css","sourcesContent":[null,null,"/**\n * admin_menu_theme\n * Theme styles for menus and other toolbar elements. SVG icons are styled in\n * the [theme]_icons.scss file, while click handles, e.g. origination buttons\n * are styled here.\n */\nbody .toolbar-no-tabs {\n padding-top: 1.5rem !important;\n}\n\n#toolbar-administration {\n font-family: \"Lucida Grande\", \"Lucida Sans Unicode\", \"DejaVu Sans\", \"Lucida Sans\", arial, sans-serif;\n font-weight: 400;\n font-size: 0.75rem;\n height: 3rem;\n background-color: #454545;\n -webkit-tap-highlight-color: rgba(255, 255, 255, 0);\n}\n\n.toolbar-vertical #toolbar-administration,\n.toolbar-no-tabs #toolbar-administration,\n#toolbar-administration .toolbar-tab,\n#toolbar-administration .toolbar-tray {\n height: 1.5rem;\n}\n\n#toolbar-administration .toolbar-tray {\n top: 1.5rem;\n}\n\n#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus,\n#toolbar-administration .toolbar-item a:hover,\n#toolbar-administration .toolbar-item a:focus {\n text-decoration: none;\n outline: none;\n}\n\n#toolbar-administration .toolbar-item {\n padding: 0.3em 0.95em 0.2em;\n display: block;\n}\n\n#toolbar-administration .toolbar__link-label {\n font-size: 1em;\n}\n\n#toolbar-administration .toolbar-bar {\n background-color: #454545;\n color: #e8e8e8;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a {\n color: #d8d8d8;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:focus, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active {\n color: #fff;\n background-image: linear-gradient(#454545, #101010);\n}\n\n#toolbar-administration .toolbar-bar .tour-toolbar-tab.toolbar-tab {\n float: none;\n}\n\n#toolbar-administration .toolbar-bar .tour-toolbar-tab button.toolbar-item {\n padding: 0.3em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item {\n color: #d8d8d8;\n}\n\n#toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item:hover, #toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item:focus, #toolbar-administration .toolbar-bar .contextual-toolbar-tab button.toolbar-item.is-active {\n color: #fff;\n background: none;\n}\n\n#toolbar-administration .toolbar-lining button:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-menu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n#toolbar-administration .toolbar-box a:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-box a:hover:focus {\n text-decoration: none;\n}\n\n#toolbar-administration .toolbar-tray {\n background-color: #101010;\n}\n\n#toolbar-administration .toolbar-tray a {\n color: #e8e8e8;\n cursor: pointer;\n padding: 0.3em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar-tray a:hover, #toolbar-administration .toolbar-tray a:active, #toolbar-administration .toolbar-tray a:focus, #toolbar-administration .toolbar-tray a.is-active {\n color: #fff;\n}\n\n#toolbar-administration .toolbar-tray a.is-active[href=\"/\"] {\n color: #e8e8e8;\n}\n\n#toolbar-administration .toolbar-tray-horizontal a:focus {\n outline: none;\n background-color: #101010;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu {\n background-color: rgba(16, 16, 16, 0.95);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item {\n border-top: 1px solid #101010;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item:first-child {\n border-top-color: #101010;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-menu {\n top: -1px;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a {\n border-right: 1px solid;\n border-color: #101010;\n border-image: linear-gradient(to top, #696969, #101010) 1 100%;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a, [dir=\"rtl\"]\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a {\n border-right: 0;\n border-left: 1px solid;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:hover, #toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:focus {\n background-color: #101010;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:after {\n color: #696969;\n right: 0.65em;\n top: 0.5em;\n display: block;\n font-size: 0.9em;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:hover:after, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:focus:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:hover:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:focus:after {\n color: #fff;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .edit-shortcuts {\n float: none;\n position: absolute;\n right: 2.2em;\n top: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical {\n background-color: #101010;\n border-right: 1px solid #323232;\n height: 100%;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical {\n border-left: 1px solid #323232;\n border-right: 0 none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu {\n display: none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu {\n display: block;\n border-bottom-width: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu .toolbar-menu {\n border-bottom-width: 1px;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-handle + a {\n margin-right: 3em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical .toolbar-handle + a {\n margin-left: 3em;\n margin-right: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item + .menu-item {\n border-top: 1px solid #696969;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item:last-child {\n border-bottom: 1px solid #696969;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item .menu-item {\n border: 0 none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:hover,\n#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:focus {\n background-color: #1d1d1d;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu.root {\n border: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu {\n border-bottom: 1px solid;\n border-top: 1px solid;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-1 > ul {\n background-color: #383838;\n border-bottom-color: #5c5c5c;\n border-top-color: #5c5c5c;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-2 > ul {\n background-color: #2c2c2c;\n border-bottom-color: #505050;\n border-top-color: #505050;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-3 > ul {\n background-color: #1f1f1f;\n border-bottom-color: #434343;\n border-top-color: #434343;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-4 > ul {\n background-color: #121212;\n border-bottom-color: #363636;\n border-top-color: #363636;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-5 > ul {\n background-color: #050505;\n border-bottom-color: #292929;\n border-top-color: #292929;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-6 > ul {\n background-color: black;\n border-bottom-color: #1d1d1d;\n border-top-color: #1d1d1d;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-7 > ul {\n background-color: black;\n border-bottom-color: #101010;\n border-top-color: #101010;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-8 > ul {\n background-color: black;\n border-bottom-color: #030303;\n border-top-color: #030303;\n}\n\n#toolbar-administration .menu-item:last-child > .toolbar-menu {\n border-bottom: 0;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle:before {\n color: #696969;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle.open:before {\n color: #fff;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before {\n color: #696969;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus:before {\n color: #e8e8e8;\n background-color: transparent;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation {\n border-left: 1px solid #696969;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation {\n border-left: 0 none;\n border-right: 1px solid #696969;\n}\n\n#toolbar-administration .toolbar-toggle-orientation [value=\"horizontal\"]:after {\n right: 0.95em;\n}\n\n.adminimal #toolbar-bar {\n font: normal 83.1%/1.538 \"Open Sans\", sans-serif !important;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-themes {\n padding-top: 4.75em !important;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal #toolbar-administration {\n background-color: #333;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-has-tabs #toolbar-administration {\n min-height: 4em;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs #toolbar-administration {\n min-height: 2em;\n}\n\n.adminimal.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, .adminimal.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs, .adminimal.toolbar-fixed.toolbar-vertical.toolbar-no-tabs, .adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs {\n padding-top: 2.3em !important;\n}\n\n/*# sourceMappingURL=admin_menu_theme.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.scss deleted file mode 100644 index d17f99fb9..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/admin_menu_theme.scss +++ /dev/null @@ -1,437 +0,0 @@ -/** - * admin_menu_theme - * Theme styles for menus and other toolbar elements. SVG icons are styled in - * the [theme]_icons.scss file, while click handles, e.g. origination buttons - * are styled here. - */ - -// Import global variables. -@import "variables"; - -body { - .toolbar-no-tabs { - padding-top: $tab-item-height !important; - } -} - -#toolbar-administration { - font-family: $font-family; - font-weight: 400; - font-size: $font-size; - height: $tab-item-height * 2; - background-color: $toolbar-bar-background; - -webkit-tap-highlight-color: $tap-highlight; - - .toolbar-vertical &, - .toolbar-no-tabs &, - .toolbar-tab, - .toolbar-tray { - height: $tab-item-height; - } - - .toolbar-tray { - top: $tab-item-height; - } - - .toolbar-tab, - .toolbar-item { - a { - &:hover, - &:focus { - text-decoration: none; - outline: none; - } - } - } - - .toolbar-item { - padding: $toolbar-item-padding; - display: block; - } - - .toolbar__link-label { - font-size: 1em; - } - - - // Toolbar bar. - .toolbar-bar { - background-color: $toolbar-bar-background; - color: $toolbar-bar-color; - - @if $drop-shadows == true { - box-shadow: -1px 0 3px 1px $drop-shadow-color; - - [dir="rtl"] & { - box-shadow: 1px 0 3px 1px $drop-shadow-color; - } - } - - .toolbar-item { - &:hover, - &:focus, - &:active, - &.is-active { - - } - } - - .toolbar-tab .toolbar-tab__items-wrapper a { - color: $tab-color; - - &:hover, - &:focus, - &.is-active { - color: $tab-active-color; - background-image: linear-gradient($toolbar-bar-background, $tray-background); - } - } - - // Tour is a button. - .tour-toolbar-tab { - &.toolbar-tab { - float: none; // Override tour module CSS. - } - - button.toolbar-item { - padding: $toolbar-item-padding; - } - } - - // Edit button - .contextual-toolbar-tab button.toolbar-item { - color: $tab-color; - - &:hover, - &:focus, - &.is-active { - color: $tab-active-color; - background: none; - } - } - - } - - - // Button reset. - .toolbar-lining button:focus { - outline: none; - } - - - // Menu reset. - .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; - } - - - // Wrapper around list item items, injected when tray is vertical (and - // persists even if toggled back to vertical). - .toolbar-box a { - &:focus { - outline: none; - } - - &:hover:focus { - text-decoration: none; - } - } - - - // Toolbar tray. - .toolbar-tray { - background-color: $tray-background; - - a { - color: $tray-color; - cursor: pointer; - padding: $toolbar-item-padding; - - &:hover, - &:active, - &:focus, - &.is-active { - color: $tray-active; - } - - &.is-active[href="/"] { - color: $tray-color; - } - } - } - - - // Horizontal tray. - .toolbar-tray-horizontal { - @if $drop-shadows == true { - box-shadow: -2px 1px 3px 1px $drop-shadow-color; - - [dir="rtl"] & { - box-shadow: 2px 1px 3px 1px $drop-shadow-color; - } - } - - a:focus { - outline: none; - background-color: $tray-background; - } - - // Admin Toolbar Module drop menus. - .toolbar-menu-administration { - .toolbar-menu .toolbar-menu { - background-color: $drop-menu-background ; - - @if $drop-shadows == true { - box-shadow: 0 2px 1px 1px $drop-shadow-color; - } - - .menu-item { - border-top: 1px solid $tray-background; - - &:first-child { - border-top-color: $tray-background; - } - } - - // Sub-sub menus - .toolbar-menu { - @if $drop-shadows == true { - box-shadow: 2px 2px 2px 0 $drop-shadow-color; - } - } - - > .menu-item--expanded > .toolbar-menu { - top: -1px; - } - } - - > .toolbar-menu > .menu-item > a, - > .toolbar-menu > .menu-item > .toolbar-box a { - border-right: 1px solid; - border-color: $tray-background; - border-image: linear-gradient(to top, $tray-border-color, $tray-background) 1 100%; - - [dir="rtl"] & { - border-right: 0; - border-left: 1px solid; - } - } - } - - .menu-item { - .menu-item { - &:hover, - &:focus { - background-color: $tray-background; - } - } - } - - // Sub-menu indicator in drop menus. - .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - > .menu-item--expanded > a, - > .menu-item--expanded .toolbar-box > a { - &:after { - color: $sub-menu-indicator; - right: 0.65em; - top: 0.5em; - display: block; - font-size: 0.9em; - } - - &:hover, - &:focus { - &:after { - color: $tray-active; - } - } - } - } - - .edit-shortcuts { - float: none; // Override shortcut module CSS. - position: absolute; - right: 2.2em; - top: 0; - } - } - - - // Vertical tray. - .toolbar-tray-vertical { - background-color: $tray-vertical-background; - border-right: 1px solid $border-color; - height: 100%; - - @if $drop-shadows == true { - box-shadow: -1px 0 5px 2px $drop-shadow-color; - } - - - [dir="rtl"] & { - border-left: 1px solid $border-color; - border-right: 0 none; - - @if $drop-shadows == true { - box-shadow: 1px 0 5px 2px $drop-shadow-color; - } - } - - .toolbar-menu .toolbar-menu { - display: none; - } - - .menu-item--expanded.open > .toolbar-menu { - display: block; - border-bottom-width: 0; - - .toolbar-menu { - border-bottom-width: 1px; - } - } - - .toolbar-handle + a { - margin-right: 3em; - - [dir="rtl"] & { - margin-left: 3em; - margin-right: 0; - } - } - - .menu-item { - + .menu-item { - border-top: 1px solid $tray-border-color; - } - - &:last-child { - border-bottom: 1px solid $tray-border-color; - } - - .menu-item { - border: 0 none; - } - - .toolbar-box:hover, - .toolbar-box:focus { - background-color: lighten($tray-background, 5%); - } - } - - .toolbar-menu { - &.root { - border: 0; - } - - .toolbar-menu { - border-bottom: 1px solid; - border-top: 1px solid; - } - } - - // Loop to generate nested selectors and styles. - $self: '.toolbar-menu'; - @for $i from 1 through 8 { - $self: if($i == 1, "ul", nest($self, "ul")) !global; - #{$self} > .level-#{$i} > ul { - background-color: darken($toolbar-bar-background , 5 * $i); - border-bottom-color: darken($tray-border-color, 5 * $i); - border-top-color: darken($tray-border-color, 5 * $i); - } - } - } - - .menu-item:last-child > .toolbar-menu { - border-bottom: 0; - } - - - // Click handles. - .toolbar-icon.toolbar-handle { - &:before { - color: $tray-border-color; - } - - &.open { - &:before { - color: $tray-active; - } - } - } - - .toolbar-toggle-orientation button.toolbar-icon { - &:after, - &:before { - color: $toggle-orientation-color; - } - - &:hover, - &:focus, - &:hover:after, - &:focus:before { - color: $toggle-orientation-active; - background-color: transparent; - } - } - - - // Orientation toggles and handles - .toolbar-toggle-orientation { - button {} - > .toolbar-lining {} - } - - .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 1px solid $toggle-orientation-border-color; - - [dir="rtl"] & { - border-left: 0 none; - border-right: 1px solid $toggle-orientation-border-color; - } - } - - .toolbar-toggle-orientation [value="horizontal"]:after { - right: 0.95em; - } -} - - -// Support for the Adminimal admin theme. -.adminimal { - - #toolbar-bar { - font: normal 83.1%/1.538 "Open Sans", sans-serif !important; - } - - &.toolbar-tray-open { - &.toolbar-fixed { - &.toolbar-horizontal { - &.toolbar-themes { - padding-top: 4.75em !important; - } - - #toolbar-administration { - background-color: #333; - } - - &.toolbar-has-tabs #toolbar-administration { - min-height: 4em; - } - - &.toolbar-no-tabs #toolbar-administration { - min-height: 2em; - } - } - } - } - - &.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, - &.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs, - &.toolbar-fixed.toolbar-vertical.toolbar-no-tabs, - &.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs { - padding-top: 2.3em !important; - } -} - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/screenshot.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/admin_menu/screenshot.png deleted file mode 100644 index f113d351e821a7b456c6a58ea1b164d42b10340d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5148 zcmV+%6yxiOP)%WSw?9^L{Lyr+u6jj%;MX| zuh+qw%*@P(hKaw_+W7zfmzS6B+qTc-=*+T^MMY}H=<1zP+bSxZ|Lw(> zeV27OTFukp=;-Kve0?%9GM!owMi3C%=;#nyn>aW)gpr-UoNwsgzcw~D5Jg&PYH8u< z=zKvCacynr=-Rj0=3PM*5Ilbn5L&(A>A%3g5IB^^onfA8LohHf5D;PC%e6E#G!qjO z;ppMcpJ6L2D`F53adma*=;8nW{}2#HK|w(fMxFov_Yh&C6%`dY5D+{(JVubh>Cmo` zk&#AOVZhqwk~k1zbc@Hw!`s~3dY-_kn1i)?G?c2o7Z(>05I96cL|PCKq@<(7riRTHYVQY@8x%11cI4&&_T@NccE(w zoz|_qp^x9A9r&GFf?vI#{V`=SO$RW<{M{FGS<5P@kFb0QKeVOWn|`iy7vc43XnYTv z+$%J=^MUXx@M+=-<1bs+ZLKpy6;hpQrM~>dTci->(z3=_r z_ueJB?`9h;yjmP9hCMTFD_twnOb%mXV`+_++W{|VJ}iw}06cMB9A9#XSS0eZS@M!W zVkcx!0+guUnVSw=S|Fyb|{? z_V?6W5-kYU1~H1|V>Xn~T$&Py5^Vr2L4os?qT{&swBdUq zSWu9*!&VDU`q_#IA!V@-&_R%qAmsiX#5PEm%&$yW8qmfuEP5XqUrY?vu|#bh_I}Hq zLj|ecultIYh+-@4FD-9Dly=}MN<>@MYF7`b7jR$;0%zNvi`atiwR9_G5$uW}ZHKKEPUUiQn5FQ!!9e_& z5@^3F$Viaqu>EoYVs`#AT{6EiU4=-ly=^IryGwlrVrt_)Mpu&4$bZKPnb#AFv+1TD7svFf;BX??GlUR>V44iLBl9A}6hjHEY3PzG#cWLSBemXH>grZ4v@qYJoN< zYL+cJNs{Y+K4Axj!Djjuq*H82u{6vl`8-P$8ajC0FOP}s?N16wO7Onn$KN6fq_Q+1 zf(g=g*lJXq7}9V8N0o>=B^d)GTU^T0wz5&WLPmaNx?Gs9^isC68Ygec0bNM}^wBZG z$2V{`ERObZl3e2u9uVB5k0UaJ=nE(goiuy>|2FyJwu(6D9}+oFano85>9B1a0+z~g z!#okBURiHTJeC~K8{)`{L#~rK@D^dI)dq#k4}q*c^NntkIGhGC*+O7qhQMw1{>yyw zAB0=C024ubYZ@kqQeqH?q#w9PYS&58h6#vW*+)Yj5Wxg#J8Z!SZ5KGjlO!WRNF2n| z&R?c0Df4SemqU1$Oya;^S~mdt8zc^kqkWttAAPe)a+5v|LRZQp4(ebJ4SUx3Vp}=* zP+GOhq2)2Vfs-6_zbwSTZu{Y`-LyV85=m8%DhD~p(b76Vlj0yqdvP#VB=4Zg(TFk+ z;k#3SNoq*x#PYI*z(kd@+Mnh<3Z7oOb{cy0`AS1qa(o8Y_%yB`QP_8~=sq2%(>tB| zhQv`8;-FxHv@Nz2N19F>^d!j`AlV9?EP2e%U#2T$%I~^3$UDxS)3)M7awLu*5xUaP z-BKJDNBcOmtuV<=`Z$o=Fz-RCqT`WapPLV)kEB%*#}prZFbj7_3N5=2v^Jz@m%D$a zL$NHS*DPO+uzmAye>}}rv?pH-MrI`G%Ib$H2WEaktoO>0ZGslj%+OJTvY#}ggzH@f(89Oi+7I-#N2xp5(DMQDg(ap2aqedf5|6abj ztToL-S;rYxJcl#dbvdshm>_L~O+3%qR?7WKIIA{JKQPEhkYzl2wL)y8bPdS- zTE)=}HKze$xH^w#K!_s|4Sd!IJ(N&-d&J^s7e{spZqmmAzO#MMMO3MSy&>&pPTJhL z^~NgVV4FD5X}!Y>&~lXMsZssTWbd0FI%@&Vlj_U>eGCZFZnh0zf;~2ED|vMg@TNM7 z3xJOLp;jpC;$RhkBbZ{^1GFGD%N7D-D#di$P@*M=whUcGjq8;734rNKtW+SdDFq@w zLQKcmikKXWIn8T0D}o8qHrPg?cJ4y`rLmm8iw*`E1Ee!UnC=bJW#m_;%O%9Y{3jya ze4cFrIHd@2==WYNNC~B9v!i{Sk`RaBCVd>h0q!uON*({PWA>^I!%!4HOIs}>Q`eFQ z@LGyHb@AT5hlh|UL&0>;RNSFj0^RDdMum1LWaugv`tv?Tj>C;iB7w0`ApW!%$@kpD z<$#Q_+~BBQn_wF`E1_W=4T{6y90t{`i~wN41c-zSAc-G9EZ%miC@FPu!K3xN?~OPY z^>)2Os5shXiTJ%Nsi0wl#C2rZy41VwU^&;gbT=m`)6z`~l% zJTr34hXo|P2AIY;7zfF$0Tz%98ejp*q5&3=R2pCbNv#1dF+x-HUg3bGy}0h=+Hdfb zc#pdxS$i~uX!OqD&6IGLXp5;c0miBo zH0W@GjyYQiX=NR20pd>v2<)c{kph$Q0{LkzOw__*vUCIl4Fz_P9$f+=^Z(g%@8xo* z5NlyS<|FqW-zV}O@P6)j?*j2`IBYSSeyb2k7Z2zZXXTC0122*V$T~?L0e~ES7yaKF z2N15-@j#(GI)k#9Nwf^9kG_h)DvS0-^<2~41F z%;9zD;;B2_tJ>VN3K5B=9@bA7E7$*JtTEG)gUoduBcY_WC z&}INRci;mO;baAbVZ?+20u}V+h_DJE6q*%Fm&zC(X0hlP{WE) zki}6Ej0seeeqQfGAHbMg8)}9Di~_30TM$avi7uXK&3?iYDR5eK6SNdkGZ3XqfN^Dn|99PC< z`l+;1B2|Pbkv{84R}P1Pew#t75RsCN&@<_&RHiWhBK0sL{YgbToscFU8=-$1sdJr* zF3^RR1x^-irbV-5#OMYO8~!k@&bSi9nBm7}&D;xk*Kf&zF-ksDCJj4dZd=amN?Q)G zgmjsSmK-Xa*GjeM9$gok^J27pjSh72^jzSGA2#GcJk^`}K`Qt3GR90fzNVs`{w^N$ zJZgljA5xax)8GYw<77>{17t-IO(RSxWRk*+vKZtCqUOlq=TER#cK;gyH`+lKqkIBW zjvS&c6f8NkapkE}&;zScH1{b8qR;SOB}W&}kwgBqP2MU*q~CsK?38p^XI~t}xg1AM zIw?|0lN`^FE`e^Uz^S5x787P$a!~WYHN`E*%NgD|X4`Tg&ete*F!@slAmIpi!k zX8&WC?o}cNqA&~(FIY-0M=Wdxt28MUY_$|@1A$zCO~}GxmBLC+VU-J*BBjehu1F!w zhJ_=$8qy5s85rjLFx7|7;KG@jI+S$?7h$e8MF@}W=TDhe_0cjj7&Ab!k%>s&G@eN4 z%F9EMUju#bfvGE9@8gDQEDy%`bIM1;Q)VKL+O!~f6K)BDYfHX#ibj)jInX_5ltK9AM0w>6Lg<6hT5 z3XEF?DKOvd-7${aFc1aM0aHv4AOk$)XT_EsyA-+vn;=k0q)3w#Jb_LWEE6w{r5k&O zJB@#(>Qj(E3|q~k5oHC|zSq8fKFy@jKHm*`ZR_Qy**6-YrS`q{_48>ajrM5oT9_N!O&UDEk_vHUo$b zKo(fCV;t~$y6i{-(kgGZ0_6;=1=^8}Mv5lwNkqU!N2#43J8FMIr~*rNj00XxmmO)_ z))c+jZy&Z1$<-AC?R*;k$31J(&W)84z-mhEZ8DJhNXA#k6PD~4M+hOR>9QlttGwBQ z5{bxPmI}1>rTxMTz$+=Wx5?L=+>jr)WPjcrheVg1dmS7RbHC8=W@n!?9w_ilU!a{&>mOnT zasfYS(vHRv55VgvwYRC`H%EQklKpXa91>l2?oCMj2Wh|1@MhlfPI>`2Rq>jl~nLZcMIE;ecBb(E%|)ZTr4F0*7u z^mSQxeSPkhdb2GW2()68b|f|xrFN;!X`;)@>#YS^dEEYtcBA+VwdN zdd=(Qr`b2Y#_<}5X}%itTGq=?vu}Kj<24TZRD)iFdV|x .toolbar-menu .toolbar-menu > .menu-item--expanded a:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-box > a:after { - font-family: 'libricons', sans-serif; - font-size: 0.9em; - content: '\E012'; - position: absolute; - right: 0.3em; - top: 0.5em; - display: block; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded a:after, [dir="rtl"] -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-box > a:after { - left: 0.3em; - right: auto; - content: '\E010'; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .toolbar-menu a:after { - display: none; -} -/*# sourceMappingURL=base_handles.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.css.map deleted file mode 100644 index 6e4c1d71b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["base_handles.scss","base_handles.css"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;EACE,yBAAwB;EACxB,6IAEkD;EAClD,oBAAmB;EACnB,mBAAkB;CCFnB;;ADKD;;EAGI,yBAAwB;CACzB;;AAJH;EAYQ,mBAAkB;EAClB,qBAAoB;EACpB,aAAY;EACZ,YAAW;EACX,iBAAgB;EAChB,WAAU;CAYX;;AA7BP;EAoBU,qCAAoC;EACpC,eAAc;EACd,iBAAgB;EAChB,mBAAkB;EAClB,aAAY;EACZ,WAAU;EACV,iBAAgB;EAChB,8BAA6B;CAC9B;;AA5BT;EA0CI,mBAAkB;EAClB,qBAAoB;EACpB,aAAY;EACZ,YAAW;EACX,iBAAgB;CASjB;;AAvDH;EAkDM,qCAAoC;EACpC,eAAc;EACd,mBAAkB;EAClB,8BAA6B;CAC9B;;AAtDL;EA4DM,iBAAgB;EAChB,uBAAsB;EACtB,aAAY;EACZ,WAAU;CAOX;;AC1BL;EDsBQ,WAAU;EACV,cAAa;EACb,iBAAgB;CACjB;;AArEP;EA2EM,YAAW;EACX,aAAY;EACZ,iBAAgB;EAChB,mBAAkB;CACnB;;AA/EL;EAoFI,8BAA6B;EAC7B,mBAAkB;EAClB,qBAAoB;EACpB,aAAY;EACZ,gBAAe;EACf,eAAc;EACd,WAAU;EACV,SAAQ;EACR,OAAM;EACN,WAAU;CA2BX;;AClDH;ED0BM,QAAO;EACP,WAAU;EACV,YAAW;CACZ;;AAnGL;EAuGM,qCAAoC;EACpC,eAAc;EACd,mBAAkB;EAClB,8BAA6B;CAC9B;;AA3GL;EA8GM,iBAAgB;EAChB,YAAW;EACX,WAAU;CACX;;AAjHL;EAqHQ,kCAAyB;MAAzB,8BAAyB;UAAzB,0BAAyB;CAC1B;;AAtHP;;EAkIU,qCAAoC;EACpC,iBAAgB;EAChB,iBAAgB;EAChB,mBAAkB;EAClB,aAAY;EACZ,WAAU;EACV,eAAc;CAOf;;ACvCT;;EDmCY,YAAW;EACX,YAAW;EACX,iBAAgB;CACjB;;AA9IX;EAoJU,cAAa;CACd","file":"base_handles.css","sourcesContent":[null,"/**\n * base_handles\n *\n * Font icons for orientation toggles, menu click handles & sub-menu indicators.\n * We're using Libricons because they're the same icons included in Drupal 8\n * core and used by the Toolbar, however core insists on background-image SVG\n * which makes these impossible to style with CSS. We do not use embedded SVG\n * for these icons (like all the other Grunticon embedded SVG icons) because\n * we need to use text-indent to hide the labels.\n *\n * There are no colors in this file - those should be provided by sub-themes in\n * the themes \"icons\" library.\n */\n@font-face {\n font-family: \"libricons\";\n src: url(\"fonts/libricons.woff2\") format(\"woff2\"), url(\"fonts/libricons.woff\") format(\"woff\"), url(\"fonts/libricons.ttf\") format(\"truetype\");\n font-weight: normal;\n font-style: normal;\n}\n\n#toolbar-administration button,\n#toolbar-administration input[type=\"button\"] {\n -webkit-appearance: none;\n}\n\n#toolbar-administration .toolbar-bar.no-tabs .toolbar-tab__items-wrapper a {\n position: relative;\n text-indent: -9999px;\n width: 2.5em;\n height: 2em;\n overflow: hidden;\n padding: 0;\n}\n\n#toolbar-administration .toolbar-bar.no-tabs .toolbar-tab__items-wrapper a:before {\n font-family: 'libricons', sans-serif;\n text-indent: 0;\n content: \"\\E03F\";\n position: absolute;\n left: 0.85em;\n top: 0.4em;\n font-size: 0.9em;\n background-color: transparent;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon {\n position: relative;\n text-indent: -9999px;\n width: 2.2em;\n height: 2em;\n overflow: hidden;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before {\n font-family: 'libricons', sans-serif;\n text-indent: 0;\n position: absolute;\n background-color: transparent;\n}\n\n#toolbar-administration .toolbar-toggle-orientation [value=\"vertical\"]:before {\n content: '\\E021';\n vertical-align: middle;\n left: 0.65em;\n top: 0.6em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-toggle-orientation [value=\"vertical\"]:before {\n left: auto;\n right: 0.65em;\n content: '\\E023';\n}\n\n#toolbar-administration .toolbar-toggle-orientation [value=\"horizontal\"]:after {\n top: 0.25em;\n right: 0.9em;\n content: '\\E024';\n margin-top: 0.15em;\n}\n\n#toolbar-administration button.toolbar-handle {\n background-color: transparent;\n position: absolute;\n text-indent: -9999px;\n width: 2.2em;\n height: 2.334em;\n display: block;\n padding: 0;\n right: 0;\n top: 0;\n z-index: 1;\n}\n\n[dir=\"rtl\"] #toolbar-administration button.toolbar-handle {\n left: 0;\n padding: 0;\n right: auto;\n}\n\n#toolbar-administration button.toolbar-handle:after, #toolbar-administration button.toolbar-handle:before {\n font-family: 'libricons', sans-serif;\n text-indent: 0;\n position: absolute;\n background-color: transparent;\n}\n\n#toolbar-administration button.toolbar-handle:before {\n content: '\\E009';\n top: 0.55em;\n right: 1em;\n}\n\n#toolbar-administration button.toolbar-handle.open:before {\n transform: rotate(180deg);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded a:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-box > a:after {\n font-family: 'libricons', sans-serif;\n font-size: 0.9em;\n content: '\\E012';\n position: absolute;\n right: 0.3em;\n top: 0.5em;\n display: block;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded a:after, [dir=\"rtl\"]\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-box > a:after {\n left: 0.3em;\n right: auto;\n content: '\\E010';\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .toolbar-menu a:after {\n display: none;\n}\n\n/*# sourceMappingURL=base_handles.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.scss deleted file mode 100644 index 91acf0fd1..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_handles.scss +++ /dev/null @@ -1,179 +0,0 @@ -/** - * base_handles - * - * Font icons for orientation toggles, menu click handles & sub-menu indicators. - * We're using Libricons because they're the same icons included in Drupal 8 - * core and used by the Toolbar, however core insists on background-image SVG - * which makes these impossible to style with CSS. We do not use embedded SVG - * for these icons (like all the other Grunticon embedded SVG icons) because - * we need to use text-indent to hide the labels. - * - * There are no colors in this file - those should be provided by sub-themes in - * the themes "icons" library. - */ - -@font-face { - font-family: "libricons"; - src: url('fonts/libricons.woff2') format('woff2'), - url('fonts/libricons.woff') format('woff'), - url('fonts/libricons.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} - -#toolbar-administration { - button, - input[type="button"] { - -webkit-appearance: none; - } - - // Tabs can be hidden in the settings, however we have to show the Manage tab - // in orientation vertical otherwise the user will not be able to collapse - // the menu. - .toolbar-bar.no-tabs { - .toolbar-tab__items-wrapper { - a { - position: relative; - text-indent: -9999px; - width: 2.5em; - height: 2em; - overflow: hidden; - padding: 0; - - &:before { - font-family: 'libricons', sans-serif; - text-indent: 0; - content: "\E03F"; - position: absolute; - left: 0.85em; - top: 0.4em; - font-size: 0.9em; - background-color: transparent; - } - } - } - } - - .toolbar-vertical.toolbar-no-tabs { - .toolbar-tab__items-wrapper, - .toolbar-tab__items-wrapper a { - //display: block; - } - } - - // Orientation toggle & Handle. - .toolbar-toggle-orientation button.toolbar-icon { - position: relative; - text-indent: -9999px; - width: 2.2em; - height: 2em; - overflow: hidden; - - &:after, - &:before { - font-family: 'libricons', sans-serif; - text-indent: 0; - position: absolute; - background-color: transparent; - } - } - - // Orientation toggles. - .toolbar-toggle-orientation [value="vertical"] { - &:before { - content: '\E021'; - vertical-align: middle; - left: 0.65em; - top: 0.6em; - - [dir="rtl"] & { - left: auto; - right: 0.65em; - content: '\E023'; - } - } - } - - .toolbar-toggle-orientation [value="horizontal"] { - &:after { - top: 0.25em; - right: 0.9em; - content: '\E024'; - margin-top: 0.15em; // Touch target separation. - } - } - - // Click handles. - button.toolbar-handle { - background-color: transparent; - position: absolute; - text-indent: -9999px; - width: 2.2em; - height: 2.334em; - display: block; - padding: 0; - right: 0; - top: 0; - z-index: 1; - - [dir="rtl"] & { - left: 0; - padding: 0; - right: auto; - } - - &:after, - &:before { - font-family: 'libricons', sans-serif; - text-indent: 0; - position: absolute; - background-color: transparent; - } - - &:before { - content: '\E009'; - top: 0.55em; - right: 1em; - } - - &.open { - &:before { - transform: rotate(180deg); - } - } - } - - // Sub-menu indicators in drop menus. - .toolbar-tray-horizontal { - .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - - > .menu-item--expanded a, - > .menu-item--expanded > .toolbar-box > a { - - &:after { - font-family: 'libricons', sans-serif; - font-size: 0.9em; - content: '\E012'; - position: absolute; - right: 0.3em; - top: 0.5em; - display: block; - - [dir="rtl"] & { - left: 0.3em; - right: auto; - content: '\E010'; - } - } - } - - .toolbar-menu a { - &:after { - display: none; - } - } - } - } -} - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css deleted file mode 100644 index 7ce07edf4..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css +++ /dev/null @@ -1,75 +0,0 @@ -/** - * base_icons - * - * Base styles for toolbar icons. - * - * Most icons are embedded SVG. Icons are embedded using Grunticon. We are using - * the original SVG icons from Drupal core, however the width and height - * attribute have been replaced with a viewBox attribute so we can scale them - * properly with CSS. Embedded SVG has the advantage of being styled with CSS, - * and by using Grunticon JS loading we negate most of the bloat and overhead - * associated with embedding SVG files. - * - * For the buttons (orientation toggles & menu click handles) please see - * base_handles.scss and your themes main theme.scss file. These are styled - * separably because this file will not load if the Show Icons setting is false. - * - * There are no colors in this file - those should be provided by sub-themes. - */ -#toolbar-administration .toolbar-icon:before, #toolbar-administration .toolbar-icon:after { - background-image: none; -} - -#toolbar-administration i.toolbar-icon { - display: inline-block; - width: 1em; - height: 1em; - padding: 0; - margin-right: 0.5em; - position: relative; - top: 0.1em; -} - -#toolbar-administration .toolbar-menu ul .toolbar-icon { - padding-left: 1.3333em; -} - -[dir="rtl"] #toolbar-administration .toolbar-menu ul .toolbar-icon { - padding-left: 0; - padding-right: 1.3333em; -} - -@media only screen and (max-width: 16.5em) { - #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-item { - margin-left: 0; - margin-right: 0; - padding-left: 0; - padding-right: 0; - width: 4em; - } - #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-item > .toolbar__link-label { - text-indent: -9999px; - } -} - -@media only screen and (min-width: 36em) { - #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-icon { - background-position: left center; - padding-left: 2.75em; - padding-right: 1.3333em; - text-indent: 0; - width: auto; - } - [dir="rtl"] #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-icon { - background-position: right center; - padding-left: 1.3333em; - padding-right: 2.75em; - } -} - -#toolbar-administration .toolbar-tab a .toolbar-box a:focus, -#toolbar-administration .toolbar-lining button .toolbar-box a:focus, -#toolbar-administration .toolbar-tray-horizontal a .toolbar-box a:focus { - outline: none; -} -/*# sourceMappingURL=base_icons.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css.map deleted file mode 100644 index 89f24af8e..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["base_icons.scss","base_icons.css"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;EAKM,uBAAsB;CACvB;;AANL;EAUI,sBAAqB;EACrB,WAAU;EACV,YAAW;EACX,WAAU;EACV,oBAAmB;EACnB,mBAAkB;EAClB,WAAU;CACX;;AAjBH;EAoBI,uBAAsB;CAMvB;;ACTH;EDMM,gBAAe;EACf,wBAAuB;CACxB;;AAIH;EA7BF;IA+BQ,eAAc;IACd,gBAAe;IACf,gBAAe;IACf,iBAAgB;IAChB,WAAU;GAKb;EAxCL;IAsCQ,qBAAoB;GACrB;CCNN;;ADWC;EA5CF;IA8CM,iCAAgC;IAChC,qBAAoB;IACpB,wBAAuB;IACvB,eAAc;IACd,YAAW;GAOZ;ECdH;IDUM,kCAAiC;IACjC,uBAAsB;IACtB,sBAAqB;GACtB;CCRN;;ADhDD;;;EAkEQ,cAAa;CACd","file":"base_icons.css","sourcesContent":[null,"/**\n * base_icons\n *\n * Base styles for toolbar icons.\n *\n * Most icons are embedded SVG. Icons are embedded using Grunticon. We are using\n * the original SVG icons from Drupal core, however the width and height\n * attribute have been replaced with a viewBox attribute so we can scale them\n * properly with CSS. Embedded SVG has the advantage of being styled with CSS,\n * and by using Grunticon JS loading we negate most of the bloat and overhead\n * associated with embedding SVG files.\n *\n * For the buttons (orientation toggles & menu click handles) please see\n * base_handles.scss and your themes main theme.scss file. These are styled\n * separably because this file will not load if the Show Icons setting is false.\n *\n * There are no colors in this file - those should be provided by sub-themes.\n */\n#toolbar-administration .toolbar-icon:before, #toolbar-administration .toolbar-icon:after {\n background-image: none;\n}\n\n#toolbar-administration i.toolbar-icon {\n display: inline-block;\n width: 1em;\n height: 1em;\n padding: 0;\n margin-right: 0.5em;\n position: relative;\n top: 0.1em;\n}\n\n#toolbar-administration .toolbar-menu ul .toolbar-icon {\n padding-left: 1.3333em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-menu ul .toolbar-icon {\n padding-left: 0;\n padding-right: 1.3333em;\n}\n\n@media only screen and (max-width: 16.5em) {\n #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-item {\n margin-left: 0;\n margin-right: 0;\n padding-left: 0;\n padding-right: 0;\n width: 4em;\n }\n #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-item > .toolbar__link-label {\n text-indent: -9999px;\n }\n}\n\n@media only screen and (min-width: 36em) {\n #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-icon {\n background-position: left center;\n padding-left: 2.75em;\n padding-right: 1.3333em;\n text-indent: 0;\n width: auto;\n }\n [dir=\"rtl\"] #toolbar-administration .toolbar-bar .toolbar-tab > .toolbar-icon {\n background-position: right center;\n padding-left: 1.3333em;\n padding-right: 2.75em;\n }\n}\n\n#toolbar-administration .toolbar-tab a .toolbar-box a:focus,\n#toolbar-administration .toolbar-lining button .toolbar-box a:focus,\n#toolbar-administration .toolbar-tray-horizontal a .toolbar-box a:focus {\n outline: none;\n}\n\n/*# sourceMappingURL=base_icons.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.scss deleted file mode 100644 index 69642369f..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_icons.scss +++ /dev/null @@ -1,93 +0,0 @@ -/** - * base_icons - * - * Base styles for toolbar icons. - * - * Most icons are embedded SVG. Icons are embedded using Grunticon. We are using - * the original SVG icons from Drupal core, however the width and height - * attribute have been replaced with a viewBox attribute so we can scale them - * properly with CSS. Embedded SVG has the advantage of being styled with CSS, - * and by using Grunticon JS loading we negate most of the bloat and overhead - * associated with embedding SVG files. - * - * For the buttons (orientation toggles & menu click handles) please see - * base_handles.scss and your themes main theme.scss file. These are styled - * separably because this file will not load if the Show Icons setting is false. - * - * There are no colors in this file - those should be provided by sub-themes. - */ - -#toolbar-administration { - - .toolbar-icon { - &:before, - &:after { - background-image: none; - } - } - - i.toolbar-icon { - display: inline-block; - width: 1em; - height: 1em; - padding: 0; - margin-right: 0.5em; - position: relative; - top: 0.1em; - } - - .toolbar-menu ul .toolbar-icon { - padding-left: 1.3333em; - - [dir="rtl"] & { - padding-left: 0; - padding-right: 1.3333em; - } - } - - - @media only screen and (max-width: 16.5em) { - .toolbar-bar .toolbar-tab > .toolbar-item { - margin-left: 0; - margin-right: 0; - padding-left: 0; - padding-right: 0; - width: 4em; - - > .toolbar__link-label { - text-indent: -9999px; - } - } - } - - - @media only screen and (min-width: 36em) { - .toolbar-bar .toolbar-tab > .toolbar-icon { - background-position: left center; - padding-left: 2.75em; - padding-right: 1.3333em; - text-indent: 0; - width: auto; - - [dir="rtl"] & { - background-position: right center; - padding-left: 1.3333em; - padding-right: 2.75em; - } - } - } - - // Accessibility/focus. - .toolbar-tab a, - .toolbar-lining button, - .toolbar-tray-horizontal a { - .toolbar-box a { - &:focus { - outline: none; - } - } - } -} - - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css deleted file mode 100644 index 0627ac754..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css +++ /dev/null @@ -1,299 +0,0 @@ -/** - * base_module - * - * This is almost a direct copy of Toolbar modules toolbar.module.css. There are - * minor adjustments and additions such as the line-height, font size and some - * use of Flex over floats etc, & support for new markup elements. - * - * Major styles such as the layout and orientation change assumptions are not - * modified, these are tied to the JS in core and difficult to move away from. - */ -.toolbar-loading #toolbar-administration { - overflow: hidden; -} - -.toolbar-loading #toolbar-administration .toolbar-bar { - opacity: 0; -} - -#toolbar-administration { - font-size: medium; - line-height: 1.5; - margin: 0; - padding: 0; - vertical-align: baseline; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -#toolbar-administration * { - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -.toolbar .toolbar-bar .home-toolbar-tab { - display: none; -} - -.path-admin .toolbar-bar .home-toolbar-tab { - display: block; -} - -@media print { - #toolbar-administration { - display: none; - } -} - -.toolbar li { - list-style: none none; -} - -.toolbar .item-list { - list-style: none none; -} - -.toolbar .item-list li { - list-style: none none; -} - -.toolbar .menu-item, -.toolbar .menu-item--expanded { - list-style: none none; -} - -.toolbar .menu-item { - padding-top: 0; -} - -.toolbar .toolbar-bar .toolbar-tab, -.toolbar .menu-item { - display: block; -} - -.toolbar .toolbar-bar .toolbar-tab.hidden { - display: none; -} - -.toolbar .toolbar-bar, -.toolbar .toolbar-tray { - position: relative; - z-index: 1250; -} - -.toolbar .toolbar-tab__items-wrapper { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - justify-content: flex-start; - z-index: 1500; - position: relative; -} - -.toolbar .home-toolbar-tab div { - display: none; -} - -.toolbar .toolbar-icon-admin-toolbar-tools-help { - text-indent: 0; -} - -.toolbar .toolbar-bar .contextual-toolbar-tab { - float: none !important; - position: absolute; - right: 0; - top: 0; - padding: 0 0.25em 0; -} - -[dir="rtl"] .toolbar .toolbar-bar .contextual-toolbar-tab { - right: auto; - left: 0; - padding-left: 0; - padding-right: 0.35em; -} - -.toolbar .toolbar-bar .contextual-toolbar-tab button { - outline: none !important; - color: inherit; - height: auto; - font-size: inherit; -} - -body.toolbar-fixed .toolbar-oriented { - position: absolute; - left: 0; - right: 0; - top: 0; - width: 100%; -} - -.toolbar-oriented .toolbar-bar, -.toolbar-oriented .toolbar-tray { - left: 0; - position: absolute; - right: 0; -} - -.toolbar-oriented .toolbar-bar { - z-index: 502; -} - -body.toolbar-fixed .toolbar-oriented .toolbar-bar { - position: fixed; -} - -body.toolbar-tray-open.toolbar-fixed.toolbar-vertical .toolbar-oriented { - bottom: 0; - width: 15rem; -} - -.toolbar .toolbar-bar, -.toolbar .toolbar-tray-horizontal ul { - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} - -#toolbar-administration .no-tabs .toolbar-tray-horizontal { - left: 2.5em; - top: 0; - border-top: 0; - -webkit-box-shadow: none; - box-shadow: none; - margin-top: 0 !important; -} - -@media (min-width: 16.5em) { - .toolbar .toolbar-bar, - .toolbar .toolbar-tray-horizontal ul { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - } -} - -.toolbar-oriented .toolbar-bar, -.toolbar-oriented .toolbar-tray-horizontal { - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} - -.toolbar .toolbar-tray { - z-index: 501; - display: none; -} - -.toolbar-oriented .toolbar-tray-vertical { - left: -100%; - position: absolute; - width: 15rem; -} - -[dir="rtl"] .toolbar-oriented .toolbar-tray-vertical { - left: auto; - right: -100%; -} - -.toolbar .toolbar-tray-vertical > .toolbar-lining { - min-height: 100%; -} - -.toolbar .toolbar-tray-vertical > .toolbar-lining:before { - width: 100%; -} - -.toolbar-oriented .toolbar-tray-vertical > .toolbar-lining:before { - bottom: 0; - content: ''; - display: block; - left: 0; - position: fixed; - top: 0; - width: 14rem; - z-index: -1; -} - -[dir="rtl"] .toolbar-oriented .toolbar-tray-vertical > .toolbar-lining:before { - left: auto; - right: 0; -} - -.toolbar .toolbar-bar .toolbar-tab > .toolbar-icon { - position: relative; - z-index: 502; -} - -.toolbar-oriented .toolbar-tray-horizontal .menu-item ul { - display: none; -} - -body.toolbar-fixed .toolbar .toolbar-tray-horizontal { - position: fixed; -} - -.toolbar .toolbar-tray-vertical.is-active, -body.toolbar-fixed .toolbar .toolbar-tray-vertical { - height: 100%; - overflow-x: hidden; - overflow-y: auto; - position: fixed; -} - -.toolbar .toolbar-tray.is-active { - display: block; -} - -.toolbar-oriented .toolbar-tray-vertical.is-active { - left: 0; -} - -[dir="rtl"] .toolbar-oriented .toolbar-tray-vertical.is-active { - left: auto; - right: 0; -} - -body.toolbar-tray-open.toolbar-vertical.toolbar-fixed { - margin-left: 15rem; -} - -[dir="rtl"] body.toolbar-tray-open.toolbar-vertical.toolbar-fixed { - margin-left: auto; - margin-right: 15rem; -} - -@media print { - body.toolbar-tray-open.toolbar-vertical.toolbar-fixed { - margin-left: 0; - } - [dir="rtl"] body.toolbar-tray-open.toolbar-vertical.toolbar-fixed { - margin-right: 0; - } -} - -.toolbar .toolbar-tray .toolbar-toggle-orientation { - display: none; -} - -.toolbar-oriented .toolbar-tray .toolbar-toggle-orientation { - display: block; -} - -.toolbar-oriented .toolbar-tray-horizontal .toolbar-toggle-orientation { - bottom: 0; - position: absolute; - right: 0; - top: auto; -} - -[dir="rtl"] .toolbar-oriented .toolbar-tray-horizontal .toolbar-toggle-orientation { - left: 0; - right: auto; -} -/*# sourceMappingURL=base_module.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css.map deleted file mode 100644 index ecd4e2d12..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["base_module.scss","base_module.css"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;EAEI,iBAAgB;CAKjB;;AAPH;EAKM,WAAU;CACX;;AAIL;EACE,kBAAiB;EACjB,iBAAgB;EAChB,UAAS;EACT,WAAU;EACV,yBAAwB;EACxB,+BAAsB;UAAtB,uBAAsB;CAKvB;;AAXD;EASI,+BAAsB;UAAtB,uBAAsB;CACvB;;AAIH;EACE,cAAa;CACd;;AACD;EACE,eAAc;CACf;;AAED;EACE;IACE,cAAa;GACd;CCJF;;ADQD;EAEI,sBAAqB;CACtB;;AAHH;EAMI,sBAAqB;CAKtB;;AAXH;EASM,sBAAqB;CACtB;;AAVL;;EAeI,sBAAqB;CACtB;;AAhBH;EAmBI,eAAc;CACf;;AApBH;;EAwBI,eAAc;CACf;;AAzBH;EA4BI,cAAa;CACd;;AA7BH;;EAiCI,mBAAkB;EAClB,cAAa;CACd;;AAnCH;EA6CI,qBAAa;EAAb,qBAAa;EAAb,cAAa;EACb,0BAAmB;MAAnB,uBAAmB;UAAnB,oBAAmB;EACnB,wBAA2B;MAA3B,qBAA2B;UAA3B,4BAA2B;EAE3B,cAAa;EACb,mBAAkB;CACnB;;AAnDH;EAuDM,cAAa;CACd;;AAxDL;EA4DI,eAAc;CACf;;AA7DH;EAgEI,uBAAsB;EACtB,mBAAkB;EAClB,SAAQ;EACR,OAAM;EACN,oBAAmB;CAepB;;AC7BH;EDiBM,YAAW;EACX,QAAO;EACP,gBAAe;EACf,sBAAqB;CACtB;;AA3EL;EA8EM,yBAAwB;EACxB,eAAc;EACd,aAAY;EACZ,mBAAkB;CACnB;;AAaL;EACE,mBAAkB;EAClB,QAAO;EACP,SAAQ;EACR,OAAM;EACN,YAAW;CACZ;;AAED;;EAGI,QAAO;EACP,mBAAkB;EAClB,SAAQ;CAET;;AAPH;EAUI,aAAY;CACb;;AASH;EAEI,gBAAe;CAChB;;AAHH;EAMI,UAAS;EACT,aAAY;CACb;;AAYH;;EAGI,qBAAa;EAAb,qBAAa;EAAb,cAAa;CACd;;AAyBH;EACE,YAAW;EACX,OAAM;EACN,cAAa;EACb,yBAAgB;UAAhB,iBAAgB;EAChB,yBAAwB;CACzB;;AAOD;EACE;;IAGI,qBAAa;IAAb,qBAAa;IAAb,cAAa;GAGd;CC9EJ;;ADsFD;;EAGI,qBAAa;EAAb,qBAAa;EAAb,cAAa;CAGd;;AAMH;EAEI,aAAY;EACZ,cAAa;CACd;;AAGH;EACE,YAAW;EACX,mBAAkB;EAClB,aAAY;CACb;;AC3FD;ED8FE,WAAU;EACV,aAAY;CACb;;AAED;EACE,iBAAgB;CAKjB;;AAND;EAII,YAAW;CACZ;;AAGH;EACE,UAAS;EACT,YAAW;EACX,eAAc;EACd,QAAO;EACP,gBAAe;EACf,OAAM;EACN,aAAY;EACZ,YAAW;CAMZ;;AChGD;ED6FI,WAAU;EACV,SAAQ;CACT;;AAMH;EACE,mBAAkB;EAClB,aAAY;CACb;;AAKD;EACE,cAAa;CACd;;AAOD;EACE,gBAAe;CAChB;;AAOD;;EAEE,aAAY;EACZ,mBAAkB;EAClB,iBAAgB;EAChB,gBAAe;CAChB;;AAED;EACE,eAAc;CACf;;AAKD;EACE,QAAO;CAMR;;ACnHD;EDgHI,WAAU;EACV,SAAQ;CACT;;AAOH;EACE,mBAAkB;CAMnB;;ACvHD;EDoHI,kBAAiB;EACjB,oBAAmB;CACpB;;AAGH;EACE;IACE,eAAc;GAKf;ECvHD;IDqHI,gBAAe;GAChB;CCnHJ;;AD6HD;EACE,cAAa;CACd;;AAMD;EAEI,eAAc;CACf;;AAHH;EAMI,UAAS;EACT,mBAAkB;EAClB,SAAQ;EACR,UAAS;CAMV;;ACnIH;EDgIM,QAAO;EACP,YAAW;CACZ","file":"base_module.css","sourcesContent":[null,"/**\n * base_module\n *\n * This is almost a direct copy of Toolbar modules toolbar.module.css. There are\n * minor adjustments and additions such as the line-height, font size and some\n * use of Flex over floats etc, & support for new markup elements.\n *\n * Major styles such as the layout and orientation change assumptions are not\n * modified, these are tied to the JS in core and difficult to move away from.\n */\n.toolbar-loading #toolbar-administration {\n overflow: hidden;\n}\n\n.toolbar-loading #toolbar-administration .toolbar-bar {\n opacity: 0;\n}\n\n#toolbar-administration {\n font-size: medium;\n line-height: 1.5;\n margin: 0;\n padding: 0;\n vertical-align: baseline;\n box-sizing: border-box;\n}\n\n#toolbar-administration * {\n box-sizing: border-box;\n}\n\n.toolbar .toolbar-bar .home-toolbar-tab {\n display: none;\n}\n\n.path-admin .toolbar-bar .home-toolbar-tab {\n display: block;\n}\n\n@media print {\n #toolbar-administration {\n display: none;\n }\n}\n\n.toolbar li {\n list-style: none none;\n}\n\n.toolbar .item-list {\n list-style: none none;\n}\n\n.toolbar .item-list li {\n list-style: none none;\n}\n\n.toolbar .menu-item,\n.toolbar .menu-item--expanded {\n list-style: none none;\n}\n\n.toolbar .menu-item {\n padding-top: 0;\n}\n\n.toolbar .toolbar-bar .toolbar-tab,\n.toolbar .menu-item {\n display: block;\n}\n\n.toolbar .toolbar-bar .toolbar-tab.hidden {\n display: none;\n}\n\n.toolbar .toolbar-bar,\n.toolbar .toolbar-tray {\n position: relative;\n z-index: 1250;\n}\n\n.toolbar .toolbar-tab__items-wrapper {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n z-index: 1500;\n position: relative;\n}\n\n.toolbar .home-toolbar-tab div {\n display: none;\n}\n\n.toolbar .toolbar-icon-admin-toolbar-tools-help {\n text-indent: 0;\n}\n\n.toolbar .toolbar-bar .contextual-toolbar-tab {\n float: none !important;\n position: absolute;\n right: 0;\n top: 0;\n padding: 0 0.25em 0;\n}\n\n[dir=\"rtl\"] .toolbar .toolbar-bar .contextual-toolbar-tab {\n right: auto;\n left: 0;\n padding-left: 0;\n padding-right: 0.35em;\n}\n\n.toolbar .toolbar-bar .contextual-toolbar-tab button {\n outline: none !important;\n color: inherit;\n height: auto;\n font-size: inherit;\n}\n\nbody.toolbar-fixed .toolbar-oriented {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n width: 100%;\n}\n\n.toolbar-oriented .toolbar-bar,\n.toolbar-oriented .toolbar-tray {\n left: 0;\n position: absolute;\n right: 0;\n}\n\n.toolbar-oriented .toolbar-bar {\n z-index: 502;\n}\n\nbody.toolbar-fixed .toolbar-oriented .toolbar-bar {\n position: fixed;\n}\n\nbody.toolbar-tray-open.toolbar-fixed.toolbar-vertical .toolbar-oriented {\n bottom: 0;\n width: 15rem;\n}\n\n.toolbar .toolbar-bar,\n.toolbar .toolbar-tray-horizontal ul {\n display: flex;\n}\n\n#toolbar-administration .no-tabs .toolbar-tray-horizontal {\n left: 2.5em;\n top: 0;\n border-top: 0;\n box-shadow: none;\n margin-top: 0 !important;\n}\n\n@media (min-width: 16.5em) {\n .toolbar .toolbar-bar,\n .toolbar .toolbar-tray-horizontal ul {\n display: flex;\n }\n}\n\n.toolbar-oriented .toolbar-bar,\n.toolbar-oriented .toolbar-tray-horizontal {\n display: flex;\n}\n\n.toolbar .toolbar-tray {\n z-index: 501;\n display: none;\n}\n\n.toolbar-oriented .toolbar-tray-vertical {\n left: -100%;\n position: absolute;\n width: 15rem;\n}\n\n[dir=\"rtl\"] .toolbar-oriented .toolbar-tray-vertical {\n left: auto;\n right: -100%;\n}\n\n.toolbar .toolbar-tray-vertical > .toolbar-lining {\n min-height: 100%;\n}\n\n.toolbar .toolbar-tray-vertical > .toolbar-lining:before {\n width: 100%;\n}\n\n.toolbar-oriented .toolbar-tray-vertical > .toolbar-lining:before {\n bottom: 0;\n content: '';\n display: block;\n left: 0;\n position: fixed;\n top: 0;\n width: 14rem;\n z-index: -1;\n}\n\n[dir=\"rtl\"] .toolbar-oriented .toolbar-tray-vertical > .toolbar-lining:before {\n left: auto;\n right: 0;\n}\n\n.toolbar .toolbar-bar .toolbar-tab > .toolbar-icon {\n position: relative;\n z-index: 502;\n}\n\n.toolbar-oriented .toolbar-tray-horizontal .menu-item ul {\n display: none;\n}\n\nbody.toolbar-fixed .toolbar .toolbar-tray-horizontal {\n position: fixed;\n}\n\n.toolbar .toolbar-tray-vertical.is-active,\nbody.toolbar-fixed .toolbar .toolbar-tray-vertical {\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n position: fixed;\n}\n\n.toolbar .toolbar-tray.is-active {\n display: block;\n}\n\n.toolbar-oriented .toolbar-tray-vertical.is-active {\n left: 0;\n}\n\n[dir=\"rtl\"] .toolbar-oriented .toolbar-tray-vertical.is-active {\n left: auto;\n right: 0;\n}\n\nbody.toolbar-tray-open.toolbar-vertical.toolbar-fixed {\n margin-left: 15rem;\n}\n\n[dir=\"rtl\"] body.toolbar-tray-open.toolbar-vertical.toolbar-fixed {\n margin-left: auto;\n margin-right: 15rem;\n}\n\n@media print {\n body.toolbar-tray-open.toolbar-vertical.toolbar-fixed {\n margin-left: 0;\n }\n [dir=\"rtl\"] body.toolbar-tray-open.toolbar-vertical.toolbar-fixed {\n margin-right: 0;\n }\n}\n\n.toolbar .toolbar-tray .toolbar-toggle-orientation {\n display: none;\n}\n\n.toolbar-oriented .toolbar-tray .toolbar-toggle-orientation {\n display: block;\n}\n\n.toolbar-oriented .toolbar-tray-horizontal .toolbar-toggle-orientation {\n bottom: 0;\n position: absolute;\n right: 0;\n top: auto;\n}\n\n[dir=\"rtl\"] .toolbar-oriented .toolbar-tray-horizontal .toolbar-toggle-orientation {\n left: 0;\n right: auto;\n}\n\n/*# sourceMappingURL=base_module.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.scss deleted file mode 100644 index 2821729ed..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_module.scss +++ /dev/null @@ -1,430 +0,0 @@ -/** - * base_module - * - * This is almost a direct copy of Toolbar modules toolbar.module.css. There are - * minor adjustments and additions such as the line-height, font size and some - * use of Flex over floats etc, & support for new markup elements. - * - * Major styles such as the layout and orientation change assumptions are not - * modified, these are tied to the JS in core and difficult to move away from. - */ - - -// Delay visibility until all rerendering has completed. -.toolbar-loading { - #toolbar-administration { - overflow: hidden; - - .toolbar-bar { - opacity: 0; - } - } -} - -#toolbar-administration { - font-size: medium; - line-height: 1.5; - margin: 0; - padding: 0; - vertical-align: baseline; - box-sizing: border-box; - - * { - box-sizing: border-box; - } -} - -// Toolbar home button toggle. -.toolbar .toolbar-bar .home-toolbar-tab { - display: none; -} -.path-admin .toolbar-bar .home-toolbar-tab { - display: block; -} - -@media print { - #toolbar-administration { - display: none; - } -} - -// Very specific overrides for Drupal system CSS. -.toolbar { - li { - list-style: none none; - } - - .item-list { - list-style: none none; - - li { - list-style: none none; - } - } - - .menu-item, - .menu-item--expanded { - list-style: none none; - } - - .menu-item { - padding-top: 0; - } - - .toolbar-bar .toolbar-tab, - .menu-item { - display: block; - } - - .toolbar-bar .toolbar-tab.hidden { - display: none; - } - - .toolbar-bar, - .toolbar-tray { - position: relative; - z-index: 1250; - } - - // Fallback CSS in case something fails. - .no-tabs .toolbar-tab__items-wrapper { - //display: none; - } - - // Use a new wrapper around toolbar-tab items, use flex to position items. We - // need the big z-index for when orientation is vertical. - .toolbar-tab__items-wrapper { - display: flex; - align-items: center; - justify-content: flex-start; - //min-height: 1.8em; - z-index: 1500; - position: relative; - } - - .home-toolbar-tab { - div { - display: none; - } - } - - .toolbar-icon-admin-toolbar-tools-help { - text-indent: 0; - } - - .toolbar-bar .contextual-toolbar-tab { - float: none !important; // override contextual links css. - position: absolute; - right: 0; - top: 0; - padding: 0 0.25em 0; - - [dir="rtl"] & { - right: auto; - left: 0; - padding-left: 0; - padding-right: 0.35em; - } - - button { - outline: none !important; - color: inherit; - height: auto; - font-size: inherit; - } - } - -} - - -// Administration menu. - -// Position the admin toolbar absolutely when the configured standard breakpoint -// is active. The toolbar container, that contains the bar and the trays, is -// position absolutely so that it scrolls with the page. Otherwise, on smaller -// screens, the components of the admin toolbar are positioned statically. - -body.toolbar-fixed .toolbar-oriented { - position: absolute; - left: 0; - right: 0; - top: 0; - width: 100%; -} - -.toolbar-oriented { - .toolbar-bar, - .toolbar-tray { - left: 0; - position: absolute; - right: 0; - //top: 0; - } - - .toolbar-bar { - z-index: 502; - } -} - - -// Layer the bar just above the trays and above contextual link triggers. - -// Position the admin toolbar fixed when the configured standard breakpoint is -// active. - -body { - &.toolbar-fixed .toolbar-oriented .toolbar-bar { - position: fixed; - } - - &.toolbar-tray-open.toolbar-fixed.toolbar-vertical .toolbar-oriented { - bottom: 0; - width: 15rem; - } -} - - -// When the configured narrow breakpoint is active, the toolbar is sized to wrap -// around the trays in order to provide a context for scrolling tray content -// that is taller than the viewport. - -// Present the admin toolbar tabs horizontally as a default on user agents that -// do not understand media queries or on user agents where JavaScript is -// disabled. - -.toolbar { - .toolbar-bar, - .toolbar-tray-horizontal ul { - display: flex; - } - - .toolbar-tab > a, - .toolbar-tray-horizontal ul a {} -} - - -// Present the admin toolbar tabs vertically by default on user agents that -// that understand media queries. This will be the small screen default. - -@media only screen { - .toolbar { - .toolbar-bar - .toolbar-tray-horizontal { - [dir="rtl"] & {} - } - } -} - - -// Tabs can be hidden in the settings, however we have to show the Manage tab -// in orientation vertical otherwise the user will not be able to collapse the -// menu. Here we move the tray to lie adjacent to the manage button, rather than -// below, making one inline menu. - -#toolbar-administration .no-tabs .toolbar-tray-horizontal { - left: 2.5em; - top: 0; - border-top: 0; - box-shadow: none; - margin-top: 0 !important; -} - - -// This min-width media query is meant to provide basic horizontal layout to -// the main menu tabs when JavaScript is disabled on user agents that understand -// media queries. - -@media (min-width: 16.5em) { - .toolbar { - .toolbar-bar, - .toolbar-tray-horizontal ul { - display: flex; - - [dir="rtl"] & {} - } - } -} - - -// Present the admin toolbar tabs horizontally when the configured narrow -// breakpoint is active. - -.toolbar-oriented { - .toolbar-bar, - .toolbar-tray-horizontal { - display: flex; - - [dir="rtl"] & {} - } -} - - -// Toolbar tray. - -.toolbar { - .toolbar-tray { - z-index: 501; - display: none; - } -} - -.toolbar-oriented .toolbar-tray-vertical { - left: -100%; - position: absolute; - width: 15rem; -} - -[dir="rtl"] .toolbar-oriented .toolbar-tray-vertical { - left: auto; - right: -100%; -} - -.toolbar .toolbar-tray-vertical > .toolbar-lining { - min-height: 100%; - - &:before { - width: 100%; - } -} - -.toolbar-oriented .toolbar-tray-vertical > .toolbar-lining:before { - bottom: 0; - content: ''; - display: block; - left: 0; - position: fixed; - top: 0; - width: 14rem; - z-index: -1; - - [dir="rtl"] & { - left: auto; - right: 0; - } -} - - -// Layer the links just above the toolbar-tray. - -.toolbar .toolbar-bar .toolbar-tab > .toolbar-icon { - position: relative; - z-index: 502; -} - - -// Hide secondary menus when the tray is horizontal. - -.toolbar-oriented .toolbar-tray-horizontal .menu-item ul { - display: none; -} - - -// When the configured standard breakpoint is active and the tray is in a -// horizontal position, the tray is fixed to the top of the viewport and does -// not scroll with the page contents. - -body.toolbar-fixed .toolbar .toolbar-tray-horizontal { - position: fixed; -} - - -// When the configured standard breakpoint is active and the tray is in a -// vertical position, the tray does not scroll with the page. The contents of -// the tray scroll within the confines of the viewport. - -.toolbar .toolbar-tray-vertical.is-active, -body.toolbar-fixed .toolbar .toolbar-tray-vertical { - height: 100%; - overflow-x: hidden; - overflow-y: auto; - position: fixed; -} - -.toolbar .toolbar-tray.is-active { - display: block; -} - - -// Bring the tray into the viewport. By default it is just off-screen. - -.toolbar-oriented .toolbar-tray-vertical.is-active { - left: 0; - - [dir="rtl"] & { - left: auto; - right: 0; - } -} - - -// When the configured standard breakpoint is active, the tray appears to push -// the page content away from the edge of the viewport. - -body.toolbar-tray-open.toolbar-vertical.toolbar-fixed { - margin-left: 15rem; - - [dir="rtl"] & { - margin-left: auto; - margin-right: 15rem; - } -} - -@media print { - body.toolbar-tray-open.toolbar-vertical.toolbar-fixed { - margin-left: 0; - - [dir="rtl"] & { - margin-right: 0; - } - } -} - - -// ToolBar tray orientation toggle. - -// Hide the orientation toggle when the configured narrow breakpoint is not -// active. - -.toolbar .toolbar-tray .toolbar-toggle-orientation { - display: none; -} - - -// Show the orientation toggle when the configured narrow breakpoint is -// active. - -.toolbar-oriented { - .toolbar-tray .toolbar-toggle-orientation { - display: block; - } - - .toolbar-tray-horizontal .toolbar-toggle-orientation { - bottom: 0; - position: absolute; - right: 0; - top: auto; - - [dir="rtl"] & { - left: 0; - right: auto; - } - } -} - -// .toolbar-loading is required by Toolbar JavaScript to pre-render markup -// style to avoid extra reflow & flicker. -//@media (min-width: 61em) { -// .toolbar-loading.toolbar-horizontal .toolbar .toolbar-bar .toolbar-tab:last-child .toolbar-tray { -// position: relative; -// display: block; -// z-index: -999; -// visibility: hidden; -// width: 1px; -// } -// .toolbar-loading.toolbar-horizontal .toolbar .toolbar-bar .toolbar-tab:last-child .toolbar-tray .toolbar-lining { -// width: 999em; -// } -// .toolbar-loading.toolbar-horizontal .toolbar .toolbar-bar .home-toolbar-tab .toolbar-tab .toolbar-tray { -// display: block; -// } -//} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css deleted file mode 100644 index de85eb4cc..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css +++ /dev/null @@ -1,224 +0,0 @@ -/** - * base_theme - * - * Base theme styles for menus and other toolbar elements (not icons). There are - * no colors in this file - those should be provided by sub-themes. - */ -.shortcut-action__message { - display: none !important; -} - -#toolbar-administration { - width: 100%; - -webkit-touch-callout: none; -} - -#toolbar-administration .toolbar-bar { - width: 100%; -} - -#toolbar-administration a { - cursor: pointer; -} - -#toolbar-administration button { - border: 0; - -webkit-box-shadow: none; - box-shadow: none; - border-radius: 0; - background: transparent; - color: inherit; - font-size: inherit; - font-family: inherit; - opacity: 1; - line-height: normal; -} - -#toolbar-administration button:hover, #toolbar-administration button:focus { - background: transparent; -} - -#toolbar-administration .toolbar-item { - cursor: pointer; -} - -#toolbar-administration .toolbar-tab:empty, -#toolbar-administration .toolbar-item:empty { - display: none; -} - -#toolbar-administration .toolbar-toggle-orientation { - padding: 0; - height: 100%; - background-color: inherit; -} - -#toolbar-administration .toolbar-toggle-orientation button { - cursor: pointer; - display: inline-block; -} - -#toolbar-administration .toolbar-toggle-orientation > .toolbar-lining { - float: right; -} - -[dir="rtl"] #toolbar-administration .toolbar-toggle-orientation > .toolbar-lining { - float: left; -} - -#toolbar-administration .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; - background-color: inherit; -} - -#toolbar-administration .toolbar-box { - position: relative; - width: auto; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu .toolbar-handle { - display: none; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu ul { - visibility: hidden; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu a { - display: block; - padding-right: 4em; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical .toolbar-menu a { - padding-left: 4em; - padding-right: 0; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul { - display: none; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul ul a { - padding-left: 2em; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical .toolbar-menu ul ul a { - padding-left: 0; - padding-right: 2em; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-icon.toolbar-handle:before { - background-image: none; -} - -#toolbar-administration .toolbar-tray-vertical li.open > ul { - display: block; -} - -#toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul a { - padding-left: 2.2em; -} - -[dir="rtl"] #toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul a { - padding-left: 0; - padding-right: 2.2em; -} - -#toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul ul a { - padding-left: 3em; -} - -[dir="rtl"] #toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul ul a { - padding-left: 0; - padding-right: 3em; -} - -#toolbar-administration .toolbar-handle:hover { - cursor: pointer; -} - -@media screen and (max-width: 319px) { - #toolbar-administration .toolbar-tray-vertical.is-active { - width: 100%; - } -} - -#toolbar-administration .toolbar-tray-horizontal { - border-bottom: 0; -} - -#toolbar-administration .toolbar-tray-horizontal .menu-item { - border: 0; - position: relative; -} - -#toolbar-administration .toolbar-tray-horizontal a { - position: relative; - display: block; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu { - position: relative; - max-height: 1000px; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - -webkit-transition: 125ms ease-in-out 100ms; - -o-transition: 125ms ease-in-out 100ms; - transition: 125ms ease-in-out 100ms; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .toolbar-menu { - -webkit-transition-delay: 25ms; - -o-transition-delay: 25ms; - transition-delay: 25ms; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item { - width: auto; - display: block; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item a:hover, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item a:focus { - text-decoration: none; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item--expanded:hover > .toolbar-menu, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item--expanded:focus > .toolbar-menu { - visibility: visible; - opacity: 1; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - position: absolute; - visibility: hidden; - opacity: 0; - margin: 0; - padding: 0; - max-height: 1000px; - width: 14em; - display: block; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu:hover, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu:focus { - visibility: visible; - opacity: 1; - display: block; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .menu-item { - text-align: left; - width: 14em; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item--expanded > .toolbar-menu { - left: 0; - top: auto; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item--expanded > .toolbar-menu .toolbar-menu { - left: 100%; - top: 0; -} -/*# sourceMappingURL=base_theme.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css.map deleted file mode 100644 index cb7f40fc5..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["base_theme.scss","base_theme.css"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;EACE,yBAAwB;CACzB;;AAED;EACE,YAAW;EACX,4BAA2B;CAgQ5B;;AAlQD;EAKI,YAAW;CACZ;;AANH;EASI,gBAAe;CAChB;;AAVH;EAeI,UAAS;EACT,yBAAgB;UAAhB,iBAAgB;EAChB,iBAAgB;EAChB,wBAAuB;EACvB,eAAc;EACd,mBAAkB;EAClB,qBAAoB;EACpB,WAAU;EACV,oBAAmB;CAMpB;;AA7BH;EA2BM,wBAAuB;CACxB;;AA5BL;EAgCI,gBAAe;CAIhB;;AApCH;;EAyCO,cAAa;CACf;;AA1CL;EAoDI,WAAU;EACV,aAAY;EACZ,0BAAyB;CAc1B;;AApEH;EAyDM,gBAAe;EACf,sBAAqB;CACtB;;AA3DL;EA8DM,aAAY;CAKb;;AClBL;EDgBQ,YAAW;CACZ;;AAlEP;EAyEI,iBAAgB;EAChB,UAAS;EACT,WAAU;EACV,0BAAyB;CAC1B;;AA7EH;EAgFI,mBAAkB;EAClB,YAAW;CACZ;;AAlFH;EAsFM,cAAa;CACd;;AAvFL;EA0FM,mBAAkB;CACnB;;AA3FL;EAiGQ,eAAc;EACd,mBAAkB;CAMnB;;AC1BP;EDuBU,kBAAiB;EACjB,iBAAgB;CACjB;;AAvGT;EA2GQ,cAAa;CACd;;AA5GP;EA+GQ,kBAAiB;CAMlB;;AC1BP;EDuBU,gBAAe;EACf,mBAAkB;CACnB;;AApHT;EAwHQ,uBAAsB;CACvB;;AAzHP;EA6HM,eAAc;CACf;;AA9HL;EAoIQ,oBAAmB;CAMpB;;AC9BP;ED2BU,gBAAe;EACf,qBAAoB;CACrB;;AAzIT;EA6IQ,kBAAiB;CAMlB;;AC9BP;ED2BU,gBAAe;EACf,mBAAkB;CACnB;;AAlJT;EAoKI,gBAAe;CAChB;;AAED;EAvKF;IAyKM,YAAW;GACZ;CCxCJ;;ADlID;EA+KI,iBAAgB;CAkFjB;;AAjQH;EAkLM,UAAS;EACT,mBAAkB;CACnB;;AApLL;EAuLM,mBAAkB;EAClB,eAAc;CACf;;AAzLL;EA4LM,mBAAkB;EAClB,mBAAkB;CA+BnB;;AA5NL;EAgMS,4CAAmC;EAAnC,uCAAmC;EAAnC,oCAAmC;CAKrC;;AArMP;EAmMU,+BAAsB;OAAtB,0BAAsB;UAAtB,uBAAsB;CACvB;;AApMT;EAwMQ,YAAW;EACX,eAAc;CAQf;;AAjNP;EA8MY,sBAAqB;CACtB;;AA/MX;EAuNY,oBAAmB;EACnB,WAAU;CACX;;AAzNX;EA+NM,mBAAkB;EAClB,mBAAkB;EAClB,WAAU;EACV,UAAS;EACT,WAAU;EACV,mBAAkB;EAClB,YAAW;EACX,eAAc;CAef;;AArPL;EA4OQ,oBAAmB;EACnB,WAAU;EACV,eAAc;CACf;;AA/OP;EAkPQ,iBAAgB;EAChB,YAAW;CACZ;;AApPP;EAyPM,QAAO;EACP,UAAS;CAMV;;AAhQL;EA6PQ,WAAU;EACV,OAAM;CACP","file":"base_theme.css","sourcesContent":[null,"/**\n * base_theme\n *\n * Base theme styles for menus and other toolbar elements (not icons). There are\n * no colors in this file - those should be provided by sub-themes.\n */\n.shortcut-action__message {\n display: none !important;\n}\n\n#toolbar-administration {\n width: 100%;\n -webkit-touch-callout: none;\n}\n\n#toolbar-administration .toolbar-bar {\n width: 100%;\n}\n\n#toolbar-administration a {\n cursor: pointer;\n}\n\n#toolbar-administration button {\n border: 0;\n box-shadow: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n opacity: 1;\n line-height: normal;\n}\n\n#toolbar-administration button:hover, #toolbar-administration button:focus {\n background: transparent;\n}\n\n#toolbar-administration .toolbar-item {\n cursor: pointer;\n}\n\n#toolbar-administration .toolbar-tab:empty,\n#toolbar-administration .toolbar-item:empty {\n display: none;\n}\n\n#toolbar-administration .toolbar-toggle-orientation {\n padding: 0;\n height: 100%;\n background-color: inherit;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button {\n cursor: pointer;\n display: inline-block;\n}\n\n#toolbar-administration .toolbar-toggle-orientation > .toolbar-lining {\n float: right;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-toggle-orientation > .toolbar-lining {\n float: left;\n}\n\n#toolbar-administration .toolbar-menu {\n list-style: none;\n margin: 0;\n padding: 0;\n background-color: inherit;\n}\n\n#toolbar-administration .toolbar-box {\n position: relative;\n width: auto;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu .toolbar-handle {\n display: none;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu ul {\n visibility: hidden;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu a {\n display: block;\n padding-right: 4em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical .toolbar-menu a {\n padding-left: 4em;\n padding-right: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul {\n display: none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul ul a {\n padding-left: 2em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical .toolbar-menu ul ul a {\n padding-left: 0;\n padding-right: 2em;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-icon.toolbar-handle:before {\n background-image: none;\n}\n\n#toolbar-administration .toolbar-tray-vertical li.open > ul {\n display: block;\n}\n\n#toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul a {\n padding-left: 2.2em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul a {\n padding-left: 0;\n padding-right: 2.2em;\n}\n\n#toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul ul a {\n padding-left: 3em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .has-icons .toolbar-tray-vertical .toolbar-menu ul ul a {\n padding-left: 0;\n padding-right: 3em;\n}\n\n#toolbar-administration .toolbar-handle:hover {\n cursor: pointer;\n}\n\n@media screen and (max-width: 319px) {\n #toolbar-administration .toolbar-tray-vertical.is-active {\n width: 100%;\n }\n}\n\n#toolbar-administration .toolbar-tray-horizontal {\n border-bottom: 0;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .menu-item {\n border: 0;\n position: relative;\n}\n\n#toolbar-administration .toolbar-tray-horizontal a {\n position: relative;\n display: block;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu {\n position: relative;\n max-height: 1000px;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu {\n transition: 125ms ease-in-out 100ms;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .toolbar-menu {\n transition-delay: 25ms;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item {\n width: auto;\n display: block;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item a:hover, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item a:focus {\n text-decoration: none;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item--expanded:hover > .toolbar-menu, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .menu-item--expanded:focus > .toolbar-menu {\n visibility: visible;\n opacity: 1;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu {\n position: absolute;\n visibility: hidden;\n opacity: 0;\n margin: 0;\n padding: 0;\n max-height: 1000px;\n width: 14em;\n display: block;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu:hover, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu:focus {\n visibility: visible;\n opacity: 1;\n display: block;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .menu-item {\n text-align: left;\n width: 14em;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item--expanded > .toolbar-menu {\n left: 0;\n top: auto;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item--expanded > .toolbar-menu .toolbar-menu {\n left: 100%;\n top: 0;\n}\n\n/*# sourceMappingURL=base_theme.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.scss deleted file mode 100644 index ddbf7bb29..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/base_theme.scss +++ /dev/null @@ -1,274 +0,0 @@ -/** - * base_theme - * - * Base theme styles for menus and other toolbar elements (not icons). There are - * no colors in this file - those should be provided by sub-themes. - */ - - -// Remove very annoying message that causes re-flow and re-paint every dam time -// you move the cursor anywhere near it. -.shortcut-action__message { - display: none !important; -} - -#toolbar-administration { - width: 100%; - -webkit-touch-callout: none; - - .toolbar-bar { - width: 100%; - } - - a { - cursor: pointer; - } - - // Themes and resets like normalize can wreak havoc on buttons, so we need to - // set a lot of strong overrides ourselves. - button { - border: 0; - box-shadow: none; - border-radius: 0; - background: transparent; - color: inherit; - font-size: inherit; - font-family: inherit; - opacity: 1; - line-height: normal; - - &:hover, - &:focus { - background: transparent; - } - } - - .toolbar-item { - cursor: pointer; - - &:hover, - &:focus {} - } - - .toolbar-tab, - .toolbar-item { - &:empty { - display: none; - } - } - - .toolbar-tray { - //width: 100%; - } - - - // Orientation toggle. - .toolbar-toggle-orientation { - padding: 0; - height: 100%; - background-color: inherit; - - button { - cursor: pointer; - display: inline-block; - } - - > .toolbar-lining { - float: right; - - [dir="rtl"] & { - float: left; - } - } - } - - - // Menus - .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; - background-color: inherit; - } - - .toolbar-box { - position: relative; - width: auto; - } - - .toolbar-tray-horizontal .toolbar-menu { - .toolbar-handle { - display: none; - } - - ul { - visibility: hidden; - } - } - - .toolbar-tray-vertical { - .toolbar-menu { - a { - display: block; - padding-right: 4em; - - [dir="rtl"] & { - padding-left: 4em; - padding-right: 0; - } - } - - ul { - display: none; - } - - ul ul a { - padding-left: 2em; - - [dir="rtl"] & { - padding-left: 0; - padding-right: 2em; - } - } - - .toolbar-icon.toolbar-handle:before { - background-image: none; - } - } - - li.open > ul { - display: block; - } - } - - .has-icons .toolbar-tray-vertical { - .toolbar-menu { - ul a { - padding-left: 2.2em; - - [dir="rtl"] & { - padding-left: 0; - padding-right: 2.2em; - } - } - - ul ul a { - padding-left: 3em; - - [dir="rtl"] & { - padding-left: 0; - padding-right: 3em; - } - } - } - } - - .toolbar-menu .toolbar-menu .toolbar-menu .toolbar-menu { - [dir="rtl"] & {} - } - - .level-2 > ul {} - .level-3 > ul {} - .level-4 > ul {} - .level-5 > ul {} - .level-6 > ul {} - .level-7 > ul {} - .level-8 > ul {} - - .toolbar-handle:hover { - cursor: pointer; - } - - @media screen and (max-width: 319px) { - .toolbar-tray-vertical.is-active { - width: 100%; - } - } - - // Drop menus - .toolbar-tray-horizontal { - border-bottom: 0; - - .menu-item { - border: 0; - position: relative; - } - - a { - position: relative; - display: block; - } - - .toolbar-menu-administration > .toolbar-menu { - position: relative; - max-height: 1000px; - - .toolbar-menu { - transition: 125ms ease-in-out 100ms; - - .toolbar-menu { - transition-delay: 25ms; - } - } - - .menu-item { - width: auto; - display: block; - - a { - &:hover, - &:focus { - text-decoration: none; - } - } - } - - .menu-item--expanded { - &:hover, - &:focus { - > .toolbar-menu { - visibility: visible; - opacity: 1; - } - } - } - } - - .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - position: absolute; - visibility: hidden; - opacity: 0; - margin: 0; - padding: 0; - max-height: 1000px; - width: 14em; - display: block; - - a {} - - &:hover, - &:focus { - visibility: visible; - opacity: 1; - display: block; - } - - .menu-item { - text-align: left; - width: 14em; - } - } - - // Menu level 2 and below. - .toolbar-menu-administration > .toolbar-menu > .menu-item--expanded > .toolbar-menu { - left: 0; - top: auto; - - .toolbar-menu { - left: 100%; - top: 0; - } - } - } -} - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.md b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.md deleted file mode 100755 index 26b5c1040..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.md +++ /dev/null @@ -1,70 +0,0 @@ -# Libricons - -Libricons are licenced under the MIT License (MIT). -https://github.com/ry5n/libricons - -## Char guide -.icon-9937-key:before { content: "\E001"; } -.icon-9938-chevron-disc-left:before { content: "\E002"; } -.icon-9939-chevron-disc-down:before { content: "\E003"; } -.icon-9940-chevron-disc-right:before { content: "\E004"; } -.icon-9941-chevron-disc-up:before { content: "\E005"; } -.icon-9942-chevron-double-left:before { content: "\E006"; } -.icon-9943-chevron-double-right:before { content: "\E007"; } -.icon-9944-chevron-left:before { content: "\E008"; } -.icon-9945-chevron-down:before { content: "\E009"; } -.icon-9946-chevron-right:before { content: "\E00A"; } -.icon-9947-chevron-up:before { content: "\E00B"; } -.icon-9948-caret-left:before { content: "\E00C"; } -.icon-9949-caret-down:before { content: "\E00D"; } -.icon-9950-caret-right:before { content: "\E00E"; } -.icon-9951-caret-up:before { content: "\E00F"; } -.icon-9952-twistie-left:before { content: "\E010"; } -.icon-9953-twistie-down:before { content: "\E011"; } -.icon-9954-twistie-right:before { content: "\E012"; } -.icon-9955-twistie-up:before { content: "\E013"; } -.icon-9956-pin:before { content: "\E014"; } -.icon-9957-comments-starred:before { content: "\E015"; } -.icon-9958-comments:before { content: "\E016"; } -.icon-9959-comment-pinned:before { content: "\E017"; } -.icon-9960-comment-locked:before { content: "\E018"; } -.icon-9961-comment-starred:before { content: "\E019"; } -.icon-9962-comment:before { content: "\E01A"; } -.icon-9963-picture:before { content: "\E01B"; } -.icon-9964-file:before { content: "\E01C"; } -.icon-9965-eye:before { content: "\E01D"; } -.icon-9965-lock-open:before { content: "\E01E"; } -.icon-9966-lock:before { content: "\E01F"; } -.icon-9967-loupe:before { content: "\E020"; } -.icon-9968-push-left:before { content: "\E021"; } -.icon-9969-push-down:before { content: "\E022"; } -.icon-9970-push-right:before { content: "\E023"; } -.icon-9971-push-up:before { content: "\E024"; } -.icon-9972-questionmark-disc:before { content: "\E025"; } -.icon-9973-piechart:before { content: "\E026"; } -.icon-9974-barchart:before { content: "\E027"; } -.icon-9975-wrench:before { content: "\E028"; } -.icon-9976-puzzlepiece:before { content: "\E029"; } -.icon-9977-paintbrush:before { content: "\E02A"; } -.icon-9978-orgchart:before { content: "\E02B"; } -.icon-9979-capital-sans:before { content: "\E02C"; } -.icon-9980-capital-serif:before { content: "\E02D"; } -.icon-9981-link:before { content: "\E02E"; } -.icon-9982-cog:before { content: "\E02F"; } -.icon-9983-move-v:before { content: "\E030"; } -.icon-9984-move-h:before { content: "\E031"; } -.icon-9985-move:before { content: "\E032"; } -.icon-9986-minus:before { content: "\E033"; } -.icon-9987-plus:before { content: "\E034"; } -.icon-9988-ex:before { content: "\E035"; } -.icon-9989-ex-disc:before { content: "\E036"; } -.icon-9990-warning:before { content: "\E037"; } -.icon-9991-check:before { content: "\E038"; } -.icon-9992-pencil:before { content: "\E039"; } -.icon-9993-people:before { content: "\E03A"; } -.icon-9994-person:before { content: "\E03B"; } -.icon-9995-star-empty:before { content: "\E03C"; } -.icon-9996-star:before { content: "\E03D"; } -.icon-9997-hamburger-list:before { content: "\E03E"; } -.icon-9998-hamburger:before { content: "\E03F"; } -.icon-9999-house:before { content: "\E040"; } diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.ttf b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.ttf deleted file mode 100755 index 1b80ebfd5f0944ec0b2d1234881a6e34da95e6e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12956 zcmd^ld6Znmd2iLd-S_sr-S_t1J=4?sI*Yn{G~LrZBWV^bAcQoMkgUaE1EZN9X<#;H zLB^3BKf_~jY`~6q5KL?z{ILBV&M_G0oIK#X;5Z3M4pDMq192ceeMn4;X?6!Rei#?SM z+x`^!Q^+44n;xCJ_~+-|CPes0LM(3_pSok>_@i%LAjCFINa}?Xwb5~#_Rw!ow+^VB z0K!(VbRqpbAbnzb@gwi-y!dPM_g#QxYIbbYUh=*{h|J3GnjZbg9KDX5L0Jp(@tM)- z+SA3m(u8b4R!GjxE-dE9&V8AX0&td-1hk89q3C+?M;99x8{&@`X5DA2fdTgAU;W_q zo19zD6T8uZ{KF@{dXm*-Z?s(&e`IM#)OCJoOUs%PIyHHG6gXawqKuVNV5rd}r<02RL?0wpViWcWOahG9_O!>S7ER)m*yrEIxE#!+v9Sg(Phc80Mb;_Q|bG-?uYeA0^k)cBc?d-%sG@=tH zaS=E15HIl&KM9Z^X(6p7MA}H0L`amxNSq`{lB7tQWJs3eNIU5uoumun=ShJSNjKR@ zdPs?sNiV68D(NHrWE0s;wvYibNQTHT$lz88g8o1LI2iAu%ap({(-8+lYw(vk^HTPP z))_!&qz?TtV0x^>A{a2ss6(O*pixqnIS}@S&oY3PNnPOpeUmyYg#ojex}5`TfYd=1 z16Tv8YaCz~q^@&-g^;?F18jxVK|cdn4XL|1zRt}8DN^@wfOV0&p9AcS z)B_w~aikvP0NW#V%$y8hg{0of0rp7hAr7!iQg7n`8zuEH2UshqM>xQ4Nj=H|7EJ0f z4zOiXk8^-klX`*!?3>h+9AN3Bp5g$TC-pQ3SU;&}IKU4`J<9whUg7|sB=s@}cqgg%a)6(bdW8c#mei{p;Jc*W#{phU>irzx&!oPI13a75H*!e3cCGCbwr6esu5>DoDrZ%X zx<`H99=G3b|Em3*W5)4{X3=`IyS2x)H}nnq-TDjqkDV>fbFLZJ|8`w)f6V>o?mAyD z#czmD!kVCCTA(sb`Ahy_36D}x4obm5FiHo7tSBY3bWfAABuhSw73ir}s+Dpso6CA-DVd|$a+OwkVl?1$Qpv~O^!&+*@lBgIZyKNY z>BQKkEn7B?O@s%PkkYuQD3l^Gs3?yp%EPMoKR0h0JN}d7W30BBSiWsQRVh(J3LfeJ zYCo*B0YdMOCdz3V;xzS`Z$?vdlogu32zo;5#r30rw#!k~SX?0<mb z6KE-$@1Ecl|hSRaP0ARpF>wSIpzL3f}f37xUGp~EZD^u+$XF>DXE8th`{q-h&UPD`kmO!H+Ax2}a zdIkIl9|WW^5-%a|66`8@AnCH?U4mz>NZCVp(V!3Uis5HWcWeDmroS+xa;cyM`zr5r zKhk(GX|na!=vN#UUSz8q*M#BAjBD06^PeF7J_NZUyfxHaVZfDsttP$e?Y=3|D*g2e zy=!GezrRW^2;U0vK7`TJZ#r> zd*eA({fSN1=y^@H{ZbCF5XO|9MR=OE@n$QfL{C7*G@SeC+M2?{s?(`9p0lG;Q;(0E z<49SIQwdrFKA9e1)#z1r`xVD|+!#j+V4O-$%qHb^<1{-^nOaSId0O1NmLKMA!Xv7# ztBqS#^-G{q_&xB`_%mCOF~n_Q?|Oci9jvdp+C#IA@C$PslON1&GQEzCLmzsNaemHd zqX8+ENM_j@5)`inNy|$hi4KCK)h<@oqqndMB3|)UsyR7W#d2gUf5s~iq*#>jEl}f? zr8zl9&-;As=Q}#mtpTTIv%0J{%^7IT(Ai8f8f}fZx49#&(P&cG`fu00`6cmTzpsN; zURTB{qqRe^IwhN?2V0kC-n{PL_Ve8jF?O~|a*&(^RaGpKeq)tn%cYZ+uv8k~5?eJH zUDirfO696@wn#Ap7w8b9b){9wJ&pj{L!CDC0fsZ$imQj}uK#8Ny+i?ljO zzesm=F5$(EJOod54EOSI=a#~?2fDMo}}%X zj?V7x>kf|Ellg2R-5zcWXim+ixh2~@qAH)Nh^l56DyJp8RkYR;)MD4Hb8}W*wF>cZ zt0>$rL@U*8y~TWDLsu#u@ackNb9%#xysn4ZZrii(yzUa&0N#Y zAs$JRYu-!J!4*jl(q1D>Sq)t_Q*JP8#QQ!(H*nR);&lhVeek+&d@dE2S9i%a;S60P zidb+(6a{L^;=kl>8{WNjD3i@*hPFP;5|#G#0zlx+W3FkOHk4RgN?|(S09L~|fd%N) z?+XNV=%3rz3Om6PH~3sO<3@bu_Q7Yf!oLisGab249cl0G+<9ncXLtLNPqlZHdJY|# zaHNXu-Pz7aB%rx;pYE2G#`j`dBbk!hM+=Ar28R2p*E+nr^PSgpbX?P!-|e;UuJ#S@ z8r+gfm$PxdTa`rB=?;bx$@cTqs%wo49-m^&Z{kIK#B&w}QRCHQufatMcFyLxYHv2R zstmZqyR_j=nT$qY>yqE?Gv+!r7iU;#3#{CuCNEC8~OnW38 zaJrp-%`J*Q$#v~KbWLZ@n1$|9biMI|!f@d+noH%;oT`bcliG^;k^Rr^8z~gz{*F}8 zV~0Iz9)Bd>-nmf--Pn0eCw@2TO5<gf=3j28;=8!_*3UHwQrhuzH~gUdA@U7+xG zICWD|tE{eS>izh&SSp0uBb}X@>kW^M`CPI#cjJe8D=f4=ne8^1?ufJnbPt$ziI%@G z{8q3x{nla~f0y6ViR=c8m;2<^8>2@$ydJ5$uzTd_hxd=xi(ddHHa^r##4m9mIrB1l=^g< z^I@?Wq4< zDi+J79Sb{lEZn=Wefz@yidBXxG2Ut9zm@DyB>Iy(=C^O3-|;Pv*7!X`_Dc{rK70;fI&L*|{2r5+Ax(@d>aj}(Y20j# z{VSn(=k|qd+ZMLpxptU46O4ewokU>grQ+woQ<%j+8OoN1OC8PJNv$dmiWJW@eqHV^ z?mO_pfqlhpmbm%YVQPa>U!z`lX4k3TKfP<$sWYc`{WY~68oRk!=T8spFLsw<%j!-w zMF0BQQ>esho?hkqN!Xgg&YHX_H>{Xhw>6c_4$yMeJP4>DUD-@~*gN~!=ROD732(qy zHJpX0XKlI%mh1J3Q_D`TCVWHlT<~Z^uy?l6IIBw9pyu&v&uLy$&NJc<`FI(4cZ8`m zn=!nYIh8Rib1pcN#NI)1@A6*FEBwOKxRdn!k)v!uS`)fh#8&%72S{gx^A zw~V%?UYRc${FyGhnYyipqZ<7)hXrd`l6(PUXDE)a?jKuz!syN6^*W5+&MJyH1*bJ= zd5BZtb(mCeUN7a(i&dV5_yd&h&sWAVMQMmMcZ$ob@rP@r^}NFi89F3I{NZB;IgKTQ zKZ7-cNyZ0Tk?G8xvw5Zx$y4~i{RW)7CobEX?akytX=-TTJ2HksI!OI?V{8hPI)9naM zRcHH#jzBBsLB*zNcDE~(PKQc|dwLEximZbXS1^cU-&Os+1^waNmAZ4rT<8x{cOr_3 z&o?@OU z_QH2qS~$Sc#JEclzmB^aHs9r%Qv+hHpp)jzU=d7HeolBdZG7I9%?@qb(^Y&VbKf7h zS$d?SNXJ@+w|2YT)JN&DV#mm~p={Rm$bFeV=+5sk(v3fCal5;>4l~~QUh!WnVZ(m> zoKa>T#+;;Mg^g0?D8>et87{)3EX=3}hm}r>Z446-a~{?POOsF5v6m@ONq7p(w??R| zr&SD>9xsK3mXec3S|KA|;4HNWMuFJc@Z(DbF+um@uHyxz?pV!=>oV(Dr zE0iy^UfY&;=R$5xC~MwOJICfjyV?rw_K;V541=xoDYURY!5^P*pA>&gEbJVa$~hVo zarkPkr+$g;!`PC#vXU~6*?tTHVBS*6vH4l{ArL1gzfW^d{Hv|a<#wr`J!4U6+mm0> zQ;Oa0@H$#r?Oxrf{&UN=ZrXCwiM+#Vakc4GkyH9dPto6;dW7a)q&MiARSGyh`;f)q z@%c|KIny?UDw5MFsRC7h(<*G-)_VQ1tlHv^mBTK(T}?abe|uzAPi)_W4J$3fdHHPF zT+y+i;L5|ysZ(>U&*plW1xM+nxN3%TE|Cl? z()X=4>c`;+b9Oo^)XqYHtBa) zEBvlxgIJn1uIe}E&6~yjL}vF!nG#LWQZ*rZQ^E^hX#C*OM*Y!#+Wz2;e|cK?&T{^9 z^plPMW48IP;+JrafQU6Crc9NlM4srP{!%YCT|=}4^``uZ-XyIC#nv}l1dFU{?qJ(L zNj5|_UT@o3-C?&3y_~iNuBDS7X!PH-=cmFq6^GsBa4O5s>TccZ&`Vv^8gzX1c6~>= zL~V@*(+Q6oJ}o|h8x|I+vB3th;Wy7?VOh+|KtmaJgvcQf6Qi&^C-o+?MWMiEVK@x) zqL{!}z@ia(!?jRJr$Wq1rPiS2Q7m7N9Edo>G=dpavlOH8c+?ghIkY$WHM=G0^|%u0 zYdc4xUw0(^@pNjdEVZ>*ed^O@8@tP{7dpb>4m6?v!>UW6)*Vr&<*9Jg6+IZyeQnXU zZge&hwMEeH*EFf~mU1zfZoC$c{*kle#PM`$o8*?-LOY{QwDCj^M(x3HGMw+2o^Dqo z@unP}6aNJJ-C@YVI3>gpYmS|c7)N_@PQnd`8BPS@Z&e7#V7VH^2~eeKT^p*3e{8ir zp!$!tmv2k8d(xXyp7zvjz1bsv^#P;cgSqkoE9g(7V6l|@pkHnL-G*JAox6_g>gw7> zpGoy+Sd(%NO+Ib4ep>Y($r*iR`cs}?X37{CB)iCO^YN)$9{;W7{#0ZA@vNLwJ17(KZyccTT#jtnteBT#* z9r4{OIDUTx=io;%>3>&IUbfkenwVEmdQ?@vi=U!=LP1US6$O}(^0L|PsH(iG;HMtN zfj_Ix3YxyhV?f-cUjBa1xYEPr2fr%6P{rK18x(d6!G#Pr6qSNcu7Di zKGgVTa9}XdcqZr=E(y1lh8+#{^yyEp2AyvTkLKg?{PIM8B%dD&$2 zmbi`GH)K}tM40}X_ntC61DQ7d27~JYcQJ-`M;tN zv#H?5XZRfyA7odn2;qWMf;Z>Hm*;(3{2zYx!+!sA?N$2rs~5gw)$|8%7mv;R4fJOJ zGGX}T7Z4$I-wwTA#1bRECH?@ud=Gl9@{>Wn)#vG=Uf4ksK|r(JQiq0}x#lBrN~W4;pgIaG^i z!B2HGyGTaRMab@Ry6uX?Y1N#%-{sSt4mMLj_uQub2D-=UUu7p!2#nW%jo=Z|Zps@G z<*LMkO>JF9<}vJlQ$v~;La@r3D;Vu?RXYO_-EI*CS@5^uyhyg|X-}&!=yqxGnC5Z^ zeXX91W|yssqs1>uR1ocYB-l}Pb;JTL=s^&?jv{=wd@@vq6LY(2V>2_4gI>a! zMvDEX1kRjFAjVEgvY6mE9pajsj+_X4w0d*0H&<$-CGkaT(Aju`ZdW$OC zU)?FH!LZ}!KXZhGs<`tXRk`u4ftOzyc=p`niF3m5Yc3krTrREgudYy7`F7)bddMX| z{fBoJs_pmsf|%Id3EgTSG+V}>q66KsV2cZ!|ooiq2A zLu4PhiJi6ZWzSryvK{=$V`Uj+$L8jeW}LeGXUnH!?0`F#C=^6(`Nu3R`0%{&jsF~8 ze2aIISZT&mjr$7g5k{rPz3i3GH;Z`6VE+;s5Sm!O=)+75Zux0RIs2~s=Po?Mco0X} z^9pHUew8YEa+U67_bOdYpFIbk#Xr#$8Z5aJZUd_He8WC8NJG!j(9odxR>LvWxR3TV z{)(Q&|B3K%k-y{~k0%yhGc91xqL^tBDVLeHAl+)Ft+*denrR96yqQ+9Z>X4QJO0Hs zij|RCSZ^M(Xr=|MDtDV{5%@D^+Jf|#&9oK&Zu=86EdhVlOsnKDshep#$`Z)Pp?d|lvo=$kA6=}C$B*3+U%35v&*I`ld}4lf zI)3%+%wlb7YBoMMKYL4UY_V`+adB=_u{dGk3uCj>WQt6ZV`LuBF)~YL$O1V)YUDUs zLdhub?=F8g<}g~!qvfR0LmYQC1^hGZ-Su{&-i%Rq6cVhFaT3Saci_1|ZpWBCz%G&r z~R3#x2rrx{>zK5-rnSTA@|iNBij}x|wdF1DNK9=rG+% zw-H-^f2o?kwRT4UiN5^UiQ4V+vorbe$%V1}RBd9Bq5IdP$7fH@1pE8T-RsfwlgCdi z`hefK9=|l#0%XrBa(3z1RL$tT6$PbB3ygl;C@HU$FhUrncLl>}@BmX;!5Gb)Kvh>z zOLHs_rbg#$i^hN~4{nS+>%!IF-wQU3ywQOM1n4&qOLG{rwrTLnIOgTR>IaLESmEL^qj+$;H zSa12+x!Me?QOUEcic}S;r8%QcUw&?B;e;VS)})_j8SfBhwVP)R#xY`bBhN3*!E&lS z`P-Ii5Z>&}^yvJphE;*vDx<14c4BmXk>$$yW25s%&W>Df{^WdZX6yu1Q-#o$KKjwA z8mnDngH`i$qmwg>$L2v0YucBeoj-0gg<`5qvvZS+qf_~X(U}F9M<3IziK)#`PJqR} zjrpm`nOh-*J|?K+7_zUFpPs$FmcN~)%RGI8RqZv>kVao6KRr3Kw7`%cVQOhXMyfAg z`v^Gh>&M$*4VnJ#{K?VznaP>sXx49d!q~0ox4$P35sytyu{7AP&CX5LSh|e#{K6~~ zWq+?>5&7Em+~OS=s=s37q5S@8{>13?v8DOrwRw=gun0Z$_pRdCSpE4Evr7v#%rXBL DnfCm7 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.woff b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.woff deleted file mode 100755 index 347a60c13d3f909ed63f93475f617597a66ef248..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7036 zcmY*;WmH^EwCv#So`K+y;O>J3NN~4cgAESBg1g(`5L|-<_uw8Z_yh~?9^3|beD}Wh z#-hIyMU%Ne2<>UYefY$)}0b>==_^RE#a++5#pmQLzT06LT0sv&>ublQZC-TF`mpgkW z^VfZ3|J4os4_LfJn+~R)uXV|KUODwEXb{u^DUPNNmap3StB>QgK3yGWD8m;gS2qBF z0{@lUzn;&7-Tbh`Gus?&0S2#|C74f{g58`iF-+INVADWA0=Bsd#G6hHdlYH3F3<*- z1`-m92#BUfQU&~vr)y9sC@3{3WF*f94+-f5UMR%32RuAH(9<)}Gx|G_1i84igiA;a z?7QCcNH`p4HVp=pTOf}h0M`Fv8UkK(oXqYyY;yrnHuP&cRP20mTqlJ0iZyET;X9bH zsPXA`9+jRU1PsPNLN08#n9IW82|+5c=d?d6?W>j@Mm2Y{xtgu3FbN6EW1%#!KhO_5 z%RiRuhR};*Q;(STc}Iw6vA>z73GeEI6B*O=O;h>j7QxBv&5Ne#pc~=!1bV3OMoPoQ zBNj*NW+u?Fbt@O`t=DD-nX%Va4xadZAqVHw*2}cVKJN3l?d`iIBOs=|;PO)m=4~AX zZg*@6*+OCu6!j}x?bZg_tP*lFb(aw@#X@sX;9FOQjxscqGi+aOWySHJoYKVNp zQ>z=)iF>RJc0%$YTY&e7Bj0e>ss{Pt9xH-Pkl>^Xw>|#IH@vkbK~*6SWHdIJ{+`+2 z^)V7Cb-hmKo!Wd}N2!lD#CvbGwao*<9|3__H70q;4K2-lUiuS;YtIHWNE2qWx8YU@ zCjFE>Fbp0Gq@-Yr9fJnR6rV}`AT-eKEg(cdq0|1Q6WN=($)y(IzTvIgYd;cxN8IHzSpi{WHumE~TUz1M5ANz0NHrA9`+=ai>nFPA6kLcpB;aa%B$P5k1ggY;t738Jaxij5GfYHc4BSPmH&S3Z z>I7{_b!^dyO{zW-@Mu$JygBVG;WRBhid6c*hCZvP0HYx!Xn0Fj*u2dZ9qT{qidJv& zSZ!Y=m~hbheuyu43|alGBUCG9uhhO5UVn+i0}8&?5Ya}+uvfGYIwN1nVEoI&?i%Io z8@%U1i04hoWQvO^>h%m13ph<`y7I^_ynaXi%Nus!ifSR=AmcZ=*8MkC^=Oh%kjn>R z7xkbYL5?mJ+WM&@#umPbaHJURp$;OzNyPG7N{e^d`W+v>75|~Tp2E1@Qy*_e3FK+W$ zzs{E>0euBie~fStTs)kcQA107Ia>{gIuuAYGbF1|T2+d?v1hCzy~j8Kx8pcI8OOMp zicjRuoUSajGsT^$y}tmfKKxw2#hTMBT*w=WFchyu@XZwYU|%2S_8~oHGs*XD{e7+J z`Ya!}%m{uS2ZB^S>Qx3179m68mq#-eeC;UZNiH`_9W*`H?d|RqKe=2hK9JiFf)jiD z`tMvgU)Sw7A z$UeWs>ceLLo##6}nw*HGPgdk7TNDyUsTQF6yIiuCXHTq1^RX+3 zCiZ!r9>x^~e;)G`B#!=bICtVi#>-fg4U8G;OESUy?-nCrEpIT9G9)^3)Y64y0B48k z6@FK>@YMHA75Pvottm5SRW%W%YIrYte&wS~v6(xX-#kcS`)H0P;P9-*Gij>CYb*BF zro(b^r^#*Qr@igdFa8QwCfkgRFOuul3=c?&dQ5^UK6?M)`Zei(-Sf;|H>)G}LLD|l z;eT^{KuMx6dtl`;HQ?&-jQ8Y>1D`3U`_qmSiFc0ITIfLuhl%lG+Y{^G7M+S3!E`3p z>~!&PRHeijpOSa<^P~ZeZ}mEzm6@H$?-&A7k0{$q=PhC!Fs1@77)4zD*b+fn`_8l0If{hs}j1o~WXR z4jkoxj#x4QCRQJ8rzYGPJa#Y|!#+REZ;iZAI6xs=siOrPlEQplY(@fO_jNL2$GT6n z@`HDKyLS&%!03`3>C<(~#RqjS_j_cX21asdsM}b4N9xRR8nfVJ+SsxMZ3UXlH{AF5 z3b9a<^x0|9Adc+aNut*gNmg{vn2+4p&NK+rai-}D{j73Q+e8_;&x1&9(dw^vt93F7 z%ZjoyU* z!*N>NJmaIQ*+uluh!F~VkIop-%EP3=vRUh#@PjpCgpnw0pJ9j!A`AunmS^D5&zo;> zE*d&A|F=ALw`}N77?8%}^H!ADHGPI^o=MY&$C=Zkt^^b!w@40DLtW9+|6}ZdlacG< z_4P7YM$A!`oA=$SOIBwVa8>!foB()U5|I-TWR%z`8jM;LvNXIx5$ewVdo!5~DtmeV zu1h#+lJk`BbJe0wOqZ>5L;PO#uA4tAIMm6De$}dj&0kl%%`?TV1W)D?tE!dskxiXI zoNZ-tNmM~i*79qZL0efj{MsY^)2)FW zKYUGv^LhCIfzz>3ojod;hbLq`#bG;?QN+Yai)Cx;-jGF@P=i4#A?557UFu{!Sw-qY zT%1DFK3|_LR-C_Hwr1<&o#*$NGSx{{)yV))|CP4;02O}G@f5#aLDpwahAbYr%P1|O zvOouosK>IzQMpZj%Q9u{@FmiJxw+jT387>EJ{q}{L-0&eXa!~mE{LEU1rLPfD92qA zpjJm&i0MkN=OHx9Nq-w=ThbdAPqkx&wp zrb)(KSKZ+C5?;OB<>-I1bno7RSKkU!M*g&>GF{V&+VK{Uvx)q&J^dYVe1-d(8IOsO zy21Z%nT~)H{Gxe0mF2ym$CJu7O6e+%p{LpI88ayaf=ewbcFDiJ;@t1PBK}hEp!j_W zU_v^FrGC}KiZ>|)B75-8LpIqe7pol9Z#w;@FJP`z5WevinXh2kFwAz_G5hC>zgqOO zxKPDF9ziItu`nRF!sc#Qwwq}>UNHy@p&aR1B@j*#l)9uLnVg%%m%iq6rb_AW6?uxB zp+oOI3Q4GdHjAHblnq;4lfAdrk=-%ELXBOB@WcWr65~j-^_34V5!B(nxjVR_N zcUbPaHoPJaSYMGaN)CEp082G-wf+^A6jL0|)AJoD*`4LfQ$E3-+{&W0cF;d{FP`$P zCWcm%9hHVrPG(3?JeLd&@qc&FxU4njJ(>-f6WN*V2^UWrk`OkHF<*fkSyez-<*)jY z_K+&d;uLf66FP}4a4APs7Uazkua5D%d3$K|hlXk$aQahODBED?y>3Zlem~worV&YH zWJx;_^zmKd9;F@TyKQY%=m46%63vzPP|3I3okfY5@{2O&K5w>jk}sgrxj(^68NHbmt?{?BbNRAzk5MW5-o~cq90E;Km&ujC+0buZ0&uwR+BJm?ZtvSeVtPj8(Z&;(FJ9GAWa!f4?1V z0hQn3iHk!t!@|sub{3#~ayhG$lJil&d-^;rd9P+QDZ$uEV@+*sVwwF11=Ft%LtH6v z=(dDDyF>lhTheuqLJ_$$o+$H3Z6DKge!X(wM^wE|)OLOe#GkY7 zhb5i3{o(4UzcuC9p5E!= zn-An4c}J1BrD-Q*L^z60z2BH&7}G1-I59H5AzDU7rJ0`L8)5h&1=xfYkR{v?<8^Y& zYKO*CU!uSJdg1DlMkbrL3yg})JSOWBtZ$B%tM>aiGUS=^E!LBR^<~lYs=fb~_L8sd za~iq8G5oIctqBdeh+CG#-VVX!!&9Xs{e}mD_x;ka_B^mJGShZ|M4i~h|4Q)odN1lY z3)~<5h6qQ{;H$3Nf?8-B1x{{u(<&G9aB(7u-A~+`x{Y2D--}WANmpOGu}6o^~enBpy<(*YYxD%x{nH zZ&4mH24|l3RgMByxC6qdOI(oacAe*PX4t-BZUKmyln}R$xH=cryy-$di$FVsq zG_Dr{>Wn1?GD$`0;WDawi#wFbYaGAlqJ+izMZT-uUYv+OeuE}oI zTt`^qeEq}y0mmaczau?=UnLItZ%{nSBwbPGFxSGGDjrO zl0E{fz(x3!nLK-r89s1&5%BNc%*>#V`Xk10eo|=?C6%&wa)an@k_kSDf<3?3RhQH% z+2qPnx~TQ|4Kyx}OKOALBepEkr4>J(42=FDDhDY_JSbkfv=%F8Xkp$4vr$wa)-4tb zBDi(a)D3#@vt(pnKU!Z=xOgvk-R5-nqz=#SX#$u^C|Ttw`GXR&Pu4D_ep= z22QLco)USxbf0?rMis<7mrrRof1}g=vWm9%VXi*I%o#HO`|b|gn@%)?`NJC~?A935 zQ$p!>r7RtP9w3+NB@WNFIre28N0svFlo9XXs{X>>u?N3aZeXE;6N)YZVOt?kzpcyQ za&$;94#ecsv~q()2L6}Yu~f0&fr_`xt=}-FR%Is5U$P=yCC08sF zn)5PEm&OOIPG%We;SCbhW4!`G?^(O(j{hYe?#J@hA zFwoe<9efWi_0%5tFPCV2a_DX);i`N5a?-oAeI;`*-@S##7w9kcLMC=aoV(>U^H3@3 z*wT}?v%!44TZDM!c6Bdoiu6eW~0>_rp=@H&2$%sQ$==%KAnH+sUR zPZj5Z=1J{!=&6BGDIQE0&Sq-5Q7yjjoA|6{tvxd)rWqd~Y=;{_D!EL&j*F$xy zY1{9E|J{n&OXnE(1>*J**z;$y2j)Jng|X+exmbMW&A_?pS@GQIMs~7(4f|#uB7{gX zE1$}P>s*8zBq>DIhxD=k;``A>$o%0lxnz0VxScUrw1|p zQRU@3QZ5?_PN@7u8Inj>kUB!zf6pTC%vR3iiAsxiqU(jrYb=f`qZJWZjf*c8d2>O_ zs7hSd75r~Z!Q>HRAMP8<+ zIVR@=NJFHWsZc}m-cdTP)GyX#JC(dK+MX^s4w9ChIg+n>2F80tHc6LZLSQH~o2rTK zn4J9NFI$KL3wsdp=|GlK0|PC!-4c}eIU7@?St@(P zrW$vTkQq1^+ik$M9Q(KLP1%1yq3;X}498PB|NSPFj*hpgdouOPBV_qqoy)QJV~4IH zHui@)J9gQ-;ocORdOA$wq>LQOD;!_ws0Jet&2sizcBG5YNp|FB5Rp1jhy+jOhz$f3 zet5@M1h3NFr2thoT+XpxMD|2k&6`Wb!~O5EObp4+9$turjt6Z0UHD=Je$;SR1n{q&7$SL+b z^k*wQd(^EaBc+m_OnZUxsDE3B#ho>KX8pO%4he4Pq4xPPBKKeS88U6O)rfl(k6$e( zmI#c@QJpHKq&?m{>O!43{;Dlg=Oh3tr)59|D4Qoetpe<}xEGltXzY7n5rGwyy&$RU zK1Ka+9~KM-Y*wt1I1XI?^|f4w_+t>8{)9CaQp&x&+`e#L+L7YWq=y7yFkk{oUGTvF z&*MMR(}O?w`0&#G^774u7a*$^NDn9{MFaoW+kFjxdBw*U3HNP`^8OH$mlrhH3tqYy zU^`Ln`nAFQKOqJP2TUQnL9jq*L_|j9LNr8-L~KNyK-@<{M506zKvF}pMG8flKn_K| zLD56`jjD#4gu0AIjFyQufsTx>fF6wAhJJy;f{}?afk}v|gxP^bg9XJZ!#c!v#Gb=J z#^J#U$0@|w#AU+`$L+yA#v{i&#COE+!ha<2Cm0}D|G$0fFBbb?usHyMiDnm38a4a{ zERF=AyhYf3{Z5AjMU{RoVp*q$4~>LBB&E$D+~D9(5+S&4fnQgp_T%aep$mK9b2 ztYDnVAQCPM9JVmvB@AIOE&Fn!eKHLZ9I1+ItrKV$AW#v;s?)v9gcByZjkdvo>PdV$ z-Hm>G9-DCn@QC#MFlFP|9!BK2fm+k&@F2K>dvEkJ#>W@^cE39muD5028CVKVv#J{> z)SP4O1Z^jR=B@PX46I7DlE3(VRWz~%3U{iX%l{cVfwgLVpCh(4RVck&E*s74R5ASN zTAdj$SANIEjpAYvY3jwq^-kR!C5|2USmrAINwHx!bVu;AsSla<*UNU=?^JQ%Ii9Wk zw>alb{jFia(nj3(M=2B`!Hs7P$|8FLe5wCVYzQClMJ2RNp#&Ze%+wF_G1N>6X0I<9 zum3CA!zYUi|JPFqefwgCk5kiIHuussWb?r@a%7Tsju!_$%zujyG@mzC^Hc;28ekb9 zyPOw^QoTN$NLfEa*zL{H+86r8alb^;Q*I%9IOE-(1Mtq#YtB)f&T;?Io*__A%i{TAulIfo#3x`7-{9?9XYJY$^JCF#(cNwrvdWhlWSnW(Nl3*a?L)piH6p%T;DRH|1nh&iY2ME}6>E#QDrS$*MC z*HLKrxW4^HpH{!wMLe<0KBw(Qe>7uzwS2l(G`ZS&l>7#=q;s_s>UTcIk||vtv!Jwm zE4dPGn5r)IEt+M#XLqM4x zQzp^IfVY^?#eg%J1mikO1j^89WXE8kt7Klp3o5ajdBPY8-5l-8Ct%i}5NN6yWzn_w zvB+xMR##Z7QZFmC<#?Bhon5jsrdI6C-3Y0~PBpoFYvDF1lum48WB2Fa5kXl+LhAnj DVrN^C diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.woff2 b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/fonts/libricons.woff2 deleted file mode 100755 index 4b57356b25921590e31174e1f99bd5f6f196f52e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6048 zcmV;R7hmXiPew8T0RR9102iPD3jhEB05Y5a02faH0RR9100000000000000000000 z0000SLIzdeJ1ONme1%x68h<6+FDKnCjS}+lnqmJzVkih9s zFczl2fQ1!7YA_LG%tU8*G?6B9*)GR)Oc&c=!3JM89;WMa|2#MSuj$PxLn(RqZ@>TT znYs6g|Nk-dq|(e1jYT8r>Y^!7X(Z8fDkU+Xw^7LN+wlB0{|{aT>nhMVMurZjd+)x$_Bma9|7V5rEaBF+nE`znaP}Xj(y(s3(`D+3`10MNibxb5PLDaL7 z+<23#wZ76iYHcxHEOKJ4rLC+c?(H|7D#8p$Kc?2!REZ14{pHvTu}zlDBEwcq_VP0QB6u`CT?O)QHe2{bb6uc>cz z_uES8g$AHj7z)(x%Cer;PxiXxdtEY7s^wIr)N8fCV?k0%?eq$*6|f`p06PE=!aJy` zB4^}1JQ#(@oeB@gT>d?{jb3rAY6>xAfnhkn(e=mYBy`Nt01q8GdR9v%eJUZ{zjNz~ zmaw2w^pe(eL-Jwyo0`>H`9%JN7pvb-VSR$g>LUHp$(x6-+ZXBCKIk7VSIfZu7V$bD z9$f`ck-kcozW`;kz6z`}TCRLl-(5+>$7m$L#c;5?6RL zI3RJr;y}cKiUSh|E)GH*q&O&X(Bfdk!HRKvw!iCnaw;Ah4MkTcUn8n=SxOq>+N`!ZZ8DaYd*57K$Lkj@T(YU#&S*`GmW|rVwBFrk z7tH9meQFjvCNCXz4;rx(ar>n&fp=;{Fxe*Xfks zW2(YlOXJoX3M=XghmC^u&HJ=P8#l0_36jAj(S}XQQhCC4_Zx@sg(fB~+lp{&L1CvU zyDuQQzckCwBOx-mvnpZ6%`{q-f;J!rTxUp!{{?mT}8vS`X!-i$NIMWt&h8>&x*Qa z6$a+!Ic~F|%Y$h7u!Ay$v}n*Qp`ltu^!FgmI;$gfKq<*|(Yz#I(qg*&2gzN0XDRNn`WOH^;I#)zJwAJ-QWk(O!#>E8^i{`U zed~;B-pIh(<|{}}7$py>L>an~d+duQENFF&rW99oos+w%iuxYw94snWMroy2X zG6=T7?Cbq#D6mu#FYy^z{I&5Yl~JtDW_yAx3!qGMqFG=Bp`cqN7_~;9flj03rb@Bw z$E11>_K(*Ajc0oea=L-JlgtZB1&!W#Lp1su4~@PH9%%UwgD%>v4qlcpW~-dRX#p!xXm+f{;ga*p3ln#a*&6$t znBZ03oWm-_l~qP{OWe1~Fojp@%m3)-=gJEoQ1q;C15gz77wxO`$NCx7LdYxa6!^o2eTne9iUd&b@y?u+3Prv=(XZz`p@L z(VSssR~>s6TeRhj+D6i2q?c>NCsW7+I!U}YjeMSmueFFtr4^?}i!WA7k0;~%+EnS` zO#F2rx!JyJu&p@R8)=FA=K3*&dO;fP`QD|`5%9Vg01ZhU+{>d-akOPKnrccg6|3iqZ5UVE_fQ0#}lD<9#oh^2}eK6lCL zOS<7ae=zVs*`)2CZf|2Hl9`Bb*>C!Je-E3DV+|HNlAWo>)aV#zfOieio@~!OHv8=2 zfQEKGmca!v(VVCUtf_@Sp*hhO=S?>x?zjINshs-_A>iY3v7JzIa1+VZ~jsMp}$v$Nee`A)yjxyBV;r%pcmeeV8)2j!sOv(Y`T3d08c1dBS2~IkZCh! zZkVh4B#3<8Z3ha~J?Glmuxz;}o_C+b_3f5-%FSqPUF{*UAB6+Wxb$zL($eNV1oPDP zuDY#LKjU{g#R~xcpBE@w9Pve>>1Bz@Gpe%ixp4Kmqd-wQq^DfYF< zUIjEA8a=!g)@xd025$g5G^(Z1wk%b}w5n#RfGBz~y&&o3KhHKrL#M5tnnF=pZSJQV z6)ametK!C|+*)MWGK4(vWbF-8wvE~Kbp}0|wc+)!NHqMqV;a6)zQzf^dk4Sd zbRBbm^oy9Z68EI=gQ(wv?)+&{E~TZ!FEK!Pt=jNdOd^`F=_PCTL}n+@TvImV5dvNj z@4a?Qd}0X8D2kJP3U=6EOBx7M9p5RsHF7cX7AB?aFUVVis|YVUWw>|7-g_msH!+Ai zU+SjDM)$xRd1Cw-j!j#ly{lR(HKc@<7|I$Ec_n*amg)0< zhp;rbzr{BcSk1T|!rA%#H!f9y7u0E5Tnwv0wsx-AN)eJk4e*bT^GjQ1=K`qr7fB(u zT$`|}fi;)vnCc<+lv#TYS5JxBuU@jh`TKsvzo4MOXUgmo`;IA*OEZrGlm3pO3Aemy zH%oV)bC@?F%A(-HAO=5r-sxx|*QAhIL{$bJH~*(l&n~-mNc0i&ihmF1@AlEbR}v5q zALpMI?_cI>5?@P$g=KcLY_K4fCr8P3Gq4P9k}ZH1CL1`j{L<#lysUOU-#PeCB=Oh6 zi*mEvkZdYFA)KF)8#Rx?mj)FDD}BCHGCoIrt;2qZ5dPvHcE#DJt<8s(&**`BNcr#{ z{%o#vb+hPRm@7|+Cf7!jID_3Gfq>>-)c79e=7#NzXk#gr!H*K2_CJTfG=nEPH zCcsa$fA|{8^SCrp4>9u%yE6;iJC4z{h7-JoEz z72Nv0)$Mie$x*u3e*q`!CJskSmF9;e1q+42Ng)?xw)vSiod0N<7s@Y8qv3G3+P%fc zwNvO1ZYJ=`%Xuvoye_x!DyCg)`93Rv#pUA79r5pK~SyK!5iA@OQ3TAy(YGu4^62Crp5Uz(lxzrhmZh<4}$k&>t1&(Zl|h@vPQ% z78>2GJ*@NY)|xW5g3VA03UHU-ZZUzw->O>**LYOg9F^s%+HdXd`8{D;=b(>^tH}L> z{&d~G(>B&AnKpivL4F(i#)mL{N~fVs&3Fop&ZSh+!qUWHvb3)K1_w(S>X=PTu#l$tFYsndhS}cyz)_9H3q`%OT3aeVdo2b2 zqlJaaF&5tVKepgNvz3I>|b?M&CKO=C@sAZT5 zf=-$6);N#h*b#_!C=PWoIU&I8ndq3<(_gX^;~}BN!1#4lxk2OO({=4-R^{F)v+2zn zHngX0v!iOl732XQE_<{lYws6m>fm!^EqM+ZoUhnUdAP|{U+Bn9eog9J>uVsad1Uwq znH;@%`)!+rj{nZdE!leM1C``RyBm1_Xis!(?||n@!3=H!eGx778cy;n@fYy=5I9Y} z(2VQcNZWtlcCv2tEJ(hid$d~@HEM9>r`dHkD2Mp2X#!Wno;`cR9f*razcIAAUIBbp z!~VVJ$aV`{Wi$^KyNHmsTV)y-v+baRcF+4Gbh|(AdEhjJIu?g&P<rs=!C|vDZiYe{p~z6qZ>BTon2fVL!$+E- z*d#PDi0ALmOIJ5uK)Mq!CVS)ggIV9EGe`HqXDFL|9x^Jh^*(z2t`7nm>^r<_-sc;5DSGx1X<(yttErT#3p+EdcY99 zPHZo}_cVupR=48+q?OWs?yaW7D;bsRp5w0+ZSkt5Ifz1dc-U;C4jo2q+lJVU1~Dmx zrKR-QNKTGkpA94$*<^fk)6;zGW<6vH?mTV^S-BE)`JC#^K3B`gQN!uDi2qyGw`V}b zU+o^gc=6EgYYu7a#tK$gW*zusmq;Lq%I=x}*Vr=j>~=oi-+CO5dKxjv&p-2Qu&e4n z^LuMp5Qv)b5mUFwomKJYK4{4|=;6zk4@uvaKpxs-KAw|>C8??=;p>NOtsf;ZSGIGh zHrCc*a4C#&0wYK3D&iaxw?C-oInu-jYV?=bG1f6FPZAFl0N;VI3H@e-0Aq}&XJwRo#gG*-^jl&X_v&_o((;28faSQdaC#R zLd*ipd+=+H&GC_)qdR+?Ss(BLGMj1R3+%WF81gomS8aT z_fWCuy_dB&8nfGMEY*vbL2q?!F}ueHzKi8sTRaf=d}-?R;yuvE5Ucr+h@O8!ojun> z-964gC+Ftgt~KY*Rn(T6q^wd+c(EK>s_MBH(uFTV9OG}}uckZioYC_gG>o@G!aGev zT|D{s`0jsf>-vTMA3FON7>%lXrE^as)^OhK_b3(}GIBpa0XE10=uDOX|3O+Gfot7XPryQ(YXMHM zUZHFd53LM`(KWCF9-|w;0#HYHKp=?NP8X0s0e}F;)Ki@ZRxsKG*nq!ALx2ccsj1O3 z+6>r(lYo^OcSl&#*;b76P?Ij0yG{RR_9sY^6;;y>)3P1c^NA!fg-W9{m@GDj%i{}#BC$j&lPi=e zwMMJc8;mBi#cH!VoG!PArnuU|MUZ@jU)UmwrlHDOWVrYB2H#^8CA;jmsd{4kr4 zkkUB$?aO3T*Yfy2ku8(jWjKbX+{wD|L9f~d*W;N7CVIoyv@KymFWPp#mJzGb!l-Zu zJTk~f7PuvPl)8#8`v1Z-xGc;Y4L^>3Sy;JwxY~Y|1 z*Y6z31W+1|Uc!nG@%nJXTS<*4(H4$N7BtH?8SYd}CUDG}g^Rda4lCc!)eZ;-`}Xu5 zxDxeZJ24d8QJHu&ksJgnt$l7u!vZJDTj~R(WYDOnNjnyp$8bjt=Hk1fGnNQ9oBcJ; aICoV?Xp_lK!4o)HUd@)oDb=uA0RR9bU+2XD diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/icon_load.js b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/icon_load.js deleted file mode 100644 index 812f63fd7..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/icon_load.js +++ /dev/null @@ -1,18 +0,0 @@ -(function (drupalSettings) { - - 'use strict'; - - Drupal.behaviors.ToolbarThemesGruniticonLoad = { - attach: function () { - var path = drupalSettings.toolbar.path; - grunticon([ - path + "/themes/base/grunticons/processed/icons.data.svg.css", - path + "/themes/base/grunticons/processed/icons.data.png.css", - path + "/themes/base/grunticons/processed/icons.fallback.css" - ], - grunticon.svgLoadedCallback - ); - } - }; - -})(drupalSettings); diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-admin-toolbar-tools-help.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-admin-toolbar-tools-help.svg deleted file mode 100644 index ee7a32d0b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-admin-toolbar-tools-help.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-edit.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-edit.svg deleted file mode 100644 index f2cf02498..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-edit.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-entity-user-collection.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-entity-user-collection.svg deleted file mode 100644 index 02d254a6c..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-entity-user-collection.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-escape-admin.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-escape-admin.svg deleted file mode 100644 index 8662d07cb..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-escape-admin.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help-main.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help-main.svg deleted file mode 100644 index 10e5f0a8c..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help-main.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help.svg deleted file mode 100644 index 632fb8e0d..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-help.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-home.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-home.svg deleted file mode 100644 index a9b3aef8a..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-home.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-link-toolbar-menu.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-link-toolbar-menu.svg deleted file mode 100644 index 2862a6eb5..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-link-toolbar-menu.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-menu.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-menu.svg deleted file mode 100644 index 9fe834ef1..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-menu.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-shortcut.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-shortcut.svg deleted file mode 100644 index cc0fc4406..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-shortcut.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-config.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-config.svg deleted file mode 100644 index b5d838dd7..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-config.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-content.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-content.svg deleted file mode 100644 index 927ee522f..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-content.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-reports.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-reports.svg deleted file mode 100644 index 37b75e22c..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-reports.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-structure.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-structure.svg deleted file mode 100644 index 40d08f92b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-admin-structure.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-modules-list.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-modules-list.svg deleted file mode 100644 index a82210400..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-modules-list.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-themes-page.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-themes-page.svg deleted file mode 100644 index 1633cff73..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-system-themes-page.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-toolbar-menu.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-toolbar-menu.svg deleted file mode 100644 index c34d9bf86..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-toolbar-menu.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-user.svg b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-user.svg deleted file mode 100644 index 9a908da74..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/original/toolbar-icon-user.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/grunticon.loader.js b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/grunticon.loader.js deleted file mode 100644 index 83b8ae74b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/grunticon.loader.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! grunt-grunticon Stylesheet Loader - v2.1.6 | https://github.com/filamentgroup/grunticon | (c) 2015 Scott Jehl, Filament Group, Inc. | MIT license. */ - -!function(){function e(e,n,t){"use strict";var o=window.document.createElement("link"),r=n||window.document.getElementsByTagName("script")[0],a=window.document.styleSheets;return o.rel="stylesheet",o.href=e,o.media="only x",r.parentNode.insertBefore(o,r),o.onloadcssdefined=function(e){for(var n,t=0;t!O}Mg*&)kWX*Wg?*5HH&7NJYYl~CbbJz0igLlVSaRa&@hU}Ph>5t|X%`O@wV~AZ zzN;3c$9H-MJXA}aO9zJBEbEYvRY*jx#f=-DY7?jGKAk(YOX|4-ujn!QTQRU%f2njK zXez%*r<>RDeyp;va$qPnGz&$@{{Q_~b>NsJ@yjZ{l4UEz>oRuJ=FlxN`d9U4ErMvW z<{Y9VjCIh18eT+4CP69jNthPx*x%D!h26vikrF<)%d3$_i^t0Nh{kJ?U0J*4PS??* z{XceCG{1b<5nHwNA4gN>E*xaqOM=%S>vy)}bi ze}PCH{G0mqg3BeKD|`+6M=aj8DBi5J5Dx{1i!gOF_@6gtEQF63p?$!G6UP~DmOnR~_kbe& z*&9lDk$yDEG0Ti76^{&!bpt0_lRGL=0l|ER54iL&uI1OLo@jg+aWQ>=c7>Ki&Aq5? z%qA$9+>y+BKneEpb|k3%K(Ks3j$(-xy2$}XW#PZy-es`6P;yZN@I;XAC;#KKauGT- z2Hak7)asq8Y&=V6(qCfH`&Qz~auj&h;Y zz5^lR``9g3j_FS_(->S$uwqAAz0(nf<(5*Bq%O0S5;#SEP{3VS&tw( zY+1JGs$W_hP3hS?|8g&I+L-N~(3Wv%L77 zSrs4DyjTCdo-$^2Js$SfM1d?C3>t%WE5{E%3u%QgUvJ}mxRDpRNVX_~?-aB!6@lHZ zw3rLlSUl)^YVnBEp*+Yx*@bzJWtME*wvX75H)jhtMvSMO;45GeSfN#Xg~iYW$7r{@YD=e0E_<1TE9#B5}Be=~A zYME#Am#+TVsFmRr%_uNBj|g<~T>(bxNkqofiq~k9g;bq2!EWHOOazv?(A3^C%eYjZ z_fEH=i=o2XIm<;>SVUaanpHOsvW6-4vt&5Ltvh(bFxyYV{5*JGO5aO&#+dY2zC$due=>6;y7@sOUstQu}^-Sl8WfeQ1|d zjfE-bjeuFUao%o9fGK?&KekW@q~IjHb>Lpgm_O0jarMQLDjLRA`$}kxRLkdgY8ZqD z*}xRucD^JmkX)#M*DFktU{ZaNAkE{VQMlo3VX7_1fg9ms(}ZRVCa| zhzQizdCyvXJ_cVql*83ytEC1ZKjjmQ|9-=eMF~GWtc-=-#V~j=pjSck1)$dh{&NTn zcF*e$1|KA^^Hh+g%e=;@6qUcKjq0&TTha##p>Z8L3iJZJwCjRdex#LiFLH7jnvXWE zxyWl%(yfac&C6MHfsP!9UaP)`LCBBNU`cQa7N*DygXJVd8{lA0XA3C@rY{4rUWo{J zi(#-2-H{)c=98T2w}ZK$Yg0-kAG%r=4rkrx9A-za7dryI|2&-mqa>QfCc!ZR+V_|& z?X8L0KE57M&&O)+T9;1Nhl1Oa3VNRoaMquu6d&!e5Qx-SWX~w5aqT$jtm>pkced9t z_;pG*->EyY4pub>d0`xH_DBAIz?yvCHe|18kq0H@YOo3p_GHRL{BS5iA3T_47Ntj% zf>!%$y`DW@4HACWknQ=KKkk2T1fNcqs;wxyiv?di3vcXw+3LZ0V>S@5e~~WT8LHf^ z$Bmxd)Mb087QRo5tI51Z6R1e#rF&l=0I3|PF+1z8)i_)DQknEaIRX;wi0$#YE(xnK zb8^g3Ovs@>Jl|gQ5#FYmoQK1C+D_b47$nFHx;BR`YCB_NqKJwc{@<2oE?QCJ7?0m( zSFMPR8<5;pD@={iG@iICLe4>xhD-BQ3%)HS)>zxo?vbXMDPo7xu%_c$mUQ1^Gc>O- z84Tt^gIeXD%bfF?N!tB$iVd=MH~)f{WZ%!YoI%Lt;jc00K;Qb{wUw>b*=vgNv-aH2 z8rrUTxD+L)gcm!%YN<*U(xfZ2+l=e)lXwnZ{)&4!t7@L1d*3H2N=d#u8S?fQb?l3^ z(tnAKi^czF2v%CIy+Fr>>hTjTw{B@DUZT*&-+nX6YdtBO-m4LMOl*caDYWlom{P(~*n=Y-0HCyKZ7vSyY&#)mt$Al? zIDbV#h$UH4R$uvEsg_ngC=BR1J+zxhS1L*I z7|&@A<0LpwFVB==s~o*Lii%z-Ei<(xt>#ZxFKq1ahexQYpTXGq+sy$;E#P0NK0OH$ zv8w7%+=_=i4{4%zGWXyfy3e>p9ucH81!5mds;TF!$G_gmqi8noxRxE2Gd z&v3$cderJXdfecOxzWplfYy_;b`0huI9y=q*RZ3vbGLSJ+g#L_P3bZ}qmHcfbb%%5Wye!>L;$2%%sqAnU(CdYa8(cQu(9^2Fo7?IsX3I#QELSfp z|YdkO5)&w7TsxjxH7OKsZ%*#6RP-~JXZ)*Ap2erX zF<6p)J400Lf4$M9wsSr|R53=Gn{#)RLX6|vE9kJ!%y6>hIP%! zsy>OA?%{@}Ef12;yYAjQpjT^ZLy7rxJokPGFk|0#5)~&)=bPqsq`wD~fp9pfDvywo zqP=h}aMc6{DYp$+tGz6cwc(Rue&@)C7F#x@iVw=LX&xOn`!fo2tM0ZO3%9kr^jyH? zCV=FMru{n@e!kx-h~Y4KVt;{KX9cru$OTzMRQ!0iwP~)U%Vrn|CXB^g>`*Ex{kjIP zE#RVlCJg+>DCA5%NuNBCMlb72)*rzx6>+X zVS?MGY$XoaF&?5bLw`!yGK1`>V`WC4;K5QIet&tnRbKYMl5kcp5^U`h=g0$&oO2wX zq-iWHJ71y~I?)Q5?e40;*fBQHnM)hE04Yg)^p(6nXxdbTsq&P3t``yc10#pA_zYOe zO_irlJP{UVyvG6I3Y6GK@^E3M%2DSjQPsNSB$+boT+i~%kL($+i+pIj;sWwJU)|NR z05{~=i(#J(xy$+eHkGMkW!KV_oHX-ryWb-p=ek`gRZjRipqhur5E0wc`4l&g((5Wq zvej40vCDxm2l8SC+<)sYDsS=-X^6+So`W8JfVa^MItAB#xuDt#i_g+nfznB9p zejf~h#a$aL5Ja8$xO}*<1+qF18h>3sfEg8|PGT}IXjhNjq_d(g0Odm6nml7)2)5Zg z_jh0sKG6K7IKaYG%=J5K*R_3npQ#N@=|1aH3C?}(!bVg|?a@a5>ti1GEu zj!kyNocDU7U#*o0#bunEEr}0n zkil38N7+s^%~)y&#<;YM#YhC|&uZIogRjX}?6YIYYI?fTyI5xR^=PNC2FI<>SM1QV zPcWX!&o(S>Zcp#6)%=tGMYu6&7ut~GwCyB)=$!GH5pgAgZ-UeTp+bAuPg z4WftH1MqUw3(Mh}ni+7-^Q+T7KxLljdv`BaxEA!_V2`Javw4kKL-(r+sHCYw5BPH$ zv1|?knUGVh=b(A0UCiN!YWV@#nj<%G&=jDsrRoH?TXU06wCGH%?Uj+sa$A~q(P2;S;UEoTaF#vnV7 z0l6)=$@tQ#J{s44I&eR1?XS@w3xR`SyO>qALt*!(C&?VCUaMlS4CIccN~O{@BeA8< zqm4%}|EeqJP6Un{G=9$>v1?v#)l68ZZ7Ois(oFiUUz?XYNefB{dMf3h_Eo4XmFEMg z42@6+^65c;{>!rZt^mB@Z=eEc%#ErOCyh!eO^FCAbQ{v!N}3E?7T&gSnq^nFZO8corDtKM+*rHJaLeX~v`+22Sj zzF_b)bnyU#D2rccC%Xbc^*I+yc_G3KBe z8+2$_*pJ+y%z64p^XHB3kITi*-LpH|wlVK$JRg~_v1Wv@!Io&S+5XGjzJXsougq=Q z+DgYBnoYoSH8W>1=KMPse!rEC8Tb`r7|vgYPBwB__>SNFgUIE4Z$zmL_(17c*b~ZD z!SR4{&4$>2UcLG>_JK`AP7cYDK;QPb*Udu66wS=E7|ug)MU)DR%3yBvInmF@+-=v% z3fVGg5XQb>pT&>uD}uWt`$=Yte(aSBRPH6YS$4lzZ?f*gN7&b&joC*TK5_uPg3zI3 zsfecsO`*(gp+$$diT5tg7qSvsY?7xh@(VLO{zBJ5l>oPpxp**Ke31z7wtwH3y;wC2 zzseN__BZK{BBwoax6L}o_OZ=QTXN@E^;*42r#!Xp>+qkE)sR3z>MIkl?7;zGQ<;o*f8d~%HlDH+~bNlr4sJ1*qvmiM#D84srSPdIQ*(F*a_bI$?b z&QQgA@TcY0q;-qsC9Or>@IZhpe%9bOlfvA93!^m6QSmE32ms%gekW6-MivS^Pnnoj zW=BW#+(uyATN}Yr*03j`F=7};XM*D&%n7onDs&f62F9-D$_b-@TF6qf^;;$}Y(n?-+Xe7CLLIOCh&4;X@?em7MK@uzM=l%iB7F-vML_ zh$DZGf@^?LxJ({y4V^_M3Gt5m0yEL6%`Inb^XZJGu8}aq?2l6XU}cbE$cuj{bZ9i7 zG>np9j06#I17#iChjz@?=r=ozNhME9>i(tmjr8kt#~d6m?7qBcZp+@?Y-OW_!~Zp`8#j zFmQUb2v}|xV2|FriE`kCb1pT@zp+Pb$OJp$oqD_-Ht+Y&K<`o8k{K8z0s8$=%>kb3 zlAx}$Lm_0;Y;DMn{pC7%)Ou5(b_QCYs-m7`E_mHK+qO&=Sk3o&&_Y$^OG)eL^;Ov} z@7x)ROKi9J6>+9vTu?4U)C8J%V8n3?+{?`qOuC)K+!GXEj0lAb%+}(21@T`oV*=gH zxJ-QeH&c#G-M@uaZV-8>w=VF-CggwL$BXAE`|2zSey#G?nYCXuWh>bbUc9Yk$X2bx z6O%$i{s@l3>K?ZYVzWbn5M^0WItH7MJ=f8YSIu@V`#D{@)+TU6SwlHP@Hd6)1;0ZD z8gOK@emdp7U(1;X?#TAGKP+|17@{N6uchs?GwUGhEJc>!Bd-o9v3n}65NDz^;`9u* zKSrFV5&ny4yq?Y|AtGPoOw-aPP@IeG$=4Vw6`4^rC(9B35gWBTDpo4lWPeKWpEdre zoOXY+@WWby-_*mOUvY!j;WP1#DK0YWzV5}J(V}|&QBJfYx@(alWd^f%0@mEjgAQ!$ zR%UQ1ZMmM?ardL7L)wUW8QTjCn{tc3>n0E#f_%+zKKI|2(nQFX3~_97dZ>IC{r^?U fvr+xcyWnw`;L489R|$aX4a}aVgQB@{6mUx>Kv+S38wD zZHsxx)=hMxvw88Fh-G4o1?AWv57jQ!*zKkL@wjAr>8T4XWc~9((bj(5ugl~q|D|^Z z3sZlX((imRiY^MVBlJ7;zR?(&wvS(uz)&Li(c#L$&RMr8)$16ZVct5hJyb2$iyq{r zx&foGg-VAWakSgpPmE;MAb)+B#>e9LB#2ac5xv2&N$ld@ty7eWi}-@eN$AWldUC}e zxClC*d&oj2Jcc1nPe?ID#rRXy{!F%$1&d?_sjwD>un83<_*4Qf_CnDdC zVY&xYrk~rU$`$S(F&#-kXXwR#xw>-^yKKRSU9RAIz-IX>{|)oS9QK;b1TK*MFvZ}+ zQKYToeTG+!EGU_3=9F{LB)rQ`fNZNYl5p~;Kti$Wpr_L@C#?)_fQ{JUW)4zV#q)X) zRwCYF)6ni2SG?I-P=c zQ!8}g;l0_QWcn-z`KyJUpg?#SB9Amhi|q@9x#n5x?t?kl&YQh$gNczyb^(&p@&`tp zs#RO)-34g1^4uVu8J0<36toZBrZ<3PXYsgi(afcFhqg=dAR)@p##%s@d;yz!4@=T@ z*_XX_^%Uy!)nst^hn#R14rUyi$xF=Zn~+wn_k?xh`0uewj}EsyreRgi{*(+Js}A-wAOt?#6eLd=&9K0B+C#s*%mycAFpn(EJ`rv5q)%k@ zRfomr-KMY2!RkHr+h@f*#;}T9qF-6=7u)AA&%v&1u|zSnx0Sve?^I9wAWcKG+ZPZX zBJSTcFZtD@IS)cw0wQEc_+zYDgQKaHC(3M zQ^x0dZMs(dLTN1{0eqmBz1Ae={{xxO#J7PwltotTUzwWe`!%%=-Q7`{T3~M$?i3!B zYc4kHdua8gsC{`zo9+)j=*V8vlD=-C#6A*xN03+7pPGPZx+5I^7BzeDWT7<64;>~d zPNaM8}63c_0pzBU5!W!moh+bbPby;%&J4~EZ+Rt_)M9ipA?gn zY2|&j*a;EB=R;mkZ-Ny^HCL4sEXyz0uQaKlhpm2o!owrqc5p7)>k`BC=iX^`@?-={C)j`B(=A>NTU?%x*p=m|*str#l@P4y$e`Em#&Bk@ZT%@q zYG{z44k$5uO_mIKsB^zfmzPBjlwXcU1$J9cmWrj|k8K*FEOvfhe{Z6kN!!{e{%Nt( zmUcX^UJO3?nzgGkWp??S1-?^~wvO;C0<|uOEl%Eth)l;6W;Zy+O*xA84}qp{9w>K= zqBTLExAlWxF`%K+teJ}7p)SnJq9p5bZP%`tOf`HHh|xCqJi*(@P5iLeYAJuXHmK+)6!tfmSURuIw zQ7*Tg5vu8av}@yCp->xZ@;24+L=@-LRUVC)V|pG)nhum@UKi|%COCdXsI_KMem(3= zYZ}e)^)j<8=P)5UY!uV)dGQfKKO&O5`m4$D*$%N9fQ;8a%g?+=b!`U=#0)W_?ncmf zYT_1RuTfnU(^Zry;)SEYBuz^Q*|*Y zH)Os<=}U#AY*$QBr4%~tZ8dp!A&ZupsaPR9`4)vCI4=hl(e)lTI zwlZI2`Z+TRr~SC9De~5tbrVHZG0~~< zHTOl_eh#!9NlC-jfgdEWu$CI%DMH1bGj=6>teaLEw}!*L%nR)li1;gnvKPqy!)Fi}fda5>M z7sgK3lx1X8UrAZda!b z_-*?HS1LTolU%ztt-?V(ONX!d%!RZ?m|OA*mbC=Sa(ZA_Oj%FSe(aeXIB7OeU;}ix zh1{OJxD<;!u}WexhV-y%|^K|agief=o4;xO}C_N+xCZTXT$y(>HziID{OEdezEiz zoQo3U;2HpUZFFLuFQ6cR++DhB^F-_xw4Hg`laKyu_x)qBTLH3fN-4H&@fClR8+X_U zBHQj69-m_Gf4vIWwYp?e2 zd-mKfF-J@1Gb-!@^qkRYq3Udgck9n?8lc6V=6;M1sw8AN==XVx-k;*ODPyFP}9v$S6@e#2Nr=*KTt?P zvj|bS@ujqS?(ctuS{K_Io^rU9ZAu<2xQ;Y&>xr7bl1gOFs)mcW@B5w0PXzO96epS5 zG$*UQiR4oIbfz|ok8b34F6LZ*E?Bl}{;u6R=Q`wv;4SFGMLgzJlT*Ad#?$AV!iRl{+4EM~I0E2GK$-0f?D-k3LmDe#$S)w~2FjTGn(D@F0D`0K zwF*=knMsOzEb|SIJJShE>Dk^FSgL(RPo~3}3Bp*OR`(C#>&A_OpEc8|)nPw-@-A$p zFQcKZzfffu7^EXyG^2tc(O1M|7w&^hF93Y``iJ-Ow(BvWaouCBFu_Y9??2`&Ua+je zt8G{T8Wo=yj9&GZdrad|Aw8p@pJE#~gxts>2zF{g2-xXfJuwA9Q!bjbZX0D>Ho|*A z2jC$+A$D&IPh7*V2@yn<{`IRaQW0+>J_uMWd)GeOaF zcr18j7LUpG@RL)B)u1J-#L5D^8rgFNpmY;JXgm?S2o+z&W59#zri%P&(6lho3!ulH zJbf0He4cthBg}dfj@jJjvCdq=W91X-@$Z#qm zK=yjz^J3-A7^X}-J7sVOg(;ss0tgiv%A0y1(dP^lwf?`3K5ZdjV%Rt!DYFN#();26 zugg?0V~UI;z&Z@j ztOroLv@CvpD}5MyYeok;QdkS{XC(L+@8V%n{ModRA*BC0lPhblVRnoZPx;A7|F4@1 zKnS@#iiJ;^(`)_z>$e3sOVa+3IqcIr3^fFDk|)uWLXz=Mts!Et zk7#HA_WoJ%2HVo-8^EXdv)V@V#$q2!Bh=u{dJ{A z%{D4Jy&6_^R-uzeKvf*@8dLU<8Q|d(EkzyC;cJ-tnq*H%E)Vz z08uofe3XRqljnT_tAOA>r2)#p62n&}RoZW5N#HsYp?YDW^8KIr#FhbxWqPN37#ODU zjq)3(m>nQ%RT;4Wdb$|*PjLS z0?8edS=(2LHT$c9 z0|?Z)K|W6y<#h)M#LK~4z{e{t2)OY8*4*yMEL0p55}F-S;~JqwoON87i;y%1ew0 z;;Z1>OZoHoSVfatLxXH0fRrkRB{;2K+zFBXi$a7aAqXPra5Bpn`a2FFyjYw} zZT5jQ&&nd;XYd*sqp%@y_`$@a?}nd#E|S*9&I*$;7RjJ%9tuYjo1v$}0k>-CI3V{p z>y?utb)I+HoEf(wO`DPu=pi&O+@>d_wHcFh^V91J$*f4YQj@=aZbIf;rMmmkYXD~(kBke`p1KR5YhsFM5YBG()re{wd4M zRM;$TlCL-tfiV*d;yV=5EZ67fty>~la3_}R)M&rg1RB}m_GgSXjR#(S2*xV0e|a5K zl$d)HEqy_?E@GoNQr=5?g9(_>9e^B8Wa;y%hKvPcD~40MVjzjRy7XaZ_!F$JKd?&O z(rT7+8aR{lEds_e7jtfwiVLvb;q90w1D&y70}hluNWXnFI4+e1i5za7=q~)*R_CXg z(NM?0F}Grg)Y@+Mm=bZ;Z!u@@$5Wye*q6rb@1<5gJuCOs*$W!K*sNM`fEW5CP*pYQ z@{eI=ZZ!ST?)#SlTFIvzHq%d9_r`c6=Cf+PKDRjWM~oFF>enn@5IjOE>N}Q~Tx-;9 zdz^Kb70H9PDOoM4;8311I%6^vKApYHUoYG(&iLfR+|n2;JpZROhk*vAO&gh;Sg9Sa zSbnTlT5wN9Tq93>T-MpV2YaCG*XIj^Kiyljs7?htZxp+hR!WDuj+;4T21y?ZY0uU{ zjygmIE1fbc8!8P?wx7(ocONn_ZRBfWtwo4z;c&cr6G;(a{T2?gFZ*Lyp7tVz)y-$1 z!HDCqwX7uvrY_60@5-k=q?5%;LI| z9VtnBbeYYHzOz}ZY1(f-F71ujGCNSdc_B!PVtPBtY1vI}I%M~KR@v;tGQ0_wgr^kv zFtgfJ9Ez8o)jc5z#}fph=IHHPzfW)`j5i6c^o(Fm-|!<*3rrES})om~;MS}cA)eA@KM zP1K>#i$y2i!Z;VhI#UIL426xgsUH4rd4?)l({HtFvnTdLj1VlFMx);p37oJ?cw zc4uo(4;!Y$;pShESRC?i^!W<;c&j5-%CrPJY|3|ZfAlY?$#Q2zo&r6aX1SBlH$W^a zXU&jRzDN$od#ueg^l3YN38e04?ocp`-*hERKu4BQ+32pCeVrP0DL6)fHE3LW_MF@H zS)Pe;wd?dpjF~Y#yOTP^Pl#P%!s+m&$1YCrl?(mTq_NMcyD=EsLCfjybPmplo#(IU zp3^TW=+~WTm;HP>3@5*=T#Fc=@Pi;vu*|F?*r---QQo$6Zo=?QatM?_gf-a17R@Q zA&|kQ0fxUuIat7dZt1z+BJ#U;6q0d&PC=E+<}=jL=?6m~>o?o41TqdI`ET{&`;E7gLgdR}g86a8%OjthfGyfx{MxwWJn=k~>%HU3 z(65j%QKVqHD8+S26DUas&uHu4B62ZO!;v2QVV0O71sy**cV})X@WGo70mQWrZUtw2 zjnY6%HN}Mb-oPjPprg7Ukl()6(yt98%aLeZc1Ny&^Vw{Tkcd$WNL9gN4^@<)MFEUJ z>W0JpWi&%Yk+gpe(!Yg@gvt_<|9);m6wLU^u$M;2^^8KUxbEFLxyP=0(~ptpns!}^CE8k;`*7LYg%56}!G1(cn%Yg!x;xfEeHPtaRH!{dkRN6(m;y zw|)W(xGOnZ1hU3p%gezJ5?6btqwd0VB=^Z_K>fTxXmw^ z!TqaCqCac5m@Ztb4=yARu_H2`NbyaQSzJ~%Hiv9dWD+iMn?0JmDzOlid9l$-ZChte z2a64ARv_q7KrEqR+spG%Rw8poAmbl@wp3^!Y~pLoNxNg`)CfWZ-u4qHB$y$y>+tiZ zecwaAE8GDey2S30o=0eIXatkh;s-fifTbJ*=~%4szp<;SyZGrN2R4;8o(O^x;XH6C zXKO&aaO~G837w@%r_!T=YcMb9aiLv>)}4WrQI?gWgP+_tFOIqlDGn)i-YtzP0u#3O zI{!^^Y|o21+`Tc3A{%hPlWR_wXK3bxJhvAvdPZ>-i2=)iWMC5=_KN+$o=X4?iU12y z6Hg)-<1J--5r_w==#-^k^&nM2UbKMfJ$J_C(HT82SvQ{dWhW_up|H!=EY<0y(c%Gv zWWkzv36iiA^f+w4z&$wivzJ?4271hf9Bdoi}$?b6Ut%86OxJOoYmM2 zI%%}{5zCNQ%<*k(;30hYE{!%dI`kzEd?U9pxXH-1H~&qe6ze`R@K81>PQ`JqHMkJC PeFd4DT4NiG-R}NBRyG&5 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-edit.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-edit.png deleted file mode 100644 index 995a8531ef402d9253fbd38052f3c036d49b6e54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2637 zcmeHJTU1k58r}gG0a3$&Di<}75CS?1p;j~+LXe{&ia^m394?7~q7_jIVh}JvJ0|fG zBv>xWZK}d_aS5QSkjf>kREz=wDp9aPA)u&869fztn0@F=UuItBWgh0Nbyl*!{r}&8 z+5fi_X;1)r$s+qj0DvVNKQtHs+!gq)H8X|CXzkEX@WX_^m9xhTKB;Cg61X-$?zfK* zfQ2>o;=r|hTZoNuP@g@5{Lx=_mBk-e)uJmRJoE5#dXRn~hLCkA$iyqu`Y`Y5%`bgC zPpo`e%o(=mAXb#0>To@G$8jxf&EmMIba#@4{UL)WSyKMvq&BH&lsOYQ^~3zTX~l#= zbu8)YBNfI|nwibL(MB+X|M;xG`_+gsDC3jVmpPR?^+l9))^+Tq=2+QvDBetI#b$zOk$;{MlFmZIv^HEIR_v$OLb>Y6CZE$SshrKUWOvB#Yo zB@s7H^c3#U-=c)%FmYh0@tQVjSlXhS^;GXVnSo<{qj5Hz7$!hqof=<8G!xxRNt25c zo(sZzyt7ho4p)OsHy;WlW~v=)5dwlc6t9L0)^4Zf!LCB71l*woGfxI9aeFXR?}lHvC5MB8giv+9!vw!FG} zB%29>hNI+o`O9qWs729%7>#o>Nj;XsG*cZ)wN~oq?B~xeIlcx_>X~%IX#Cejo}#0t zsp?VAT-`?>)5(!r1VH<|4~+M|D@U?UaypX;-3AZGy%v4TuKaD9M}HA(W|uBMbL|(zl1obQL4gpY&;uE0Onuq`Sq`4|%uQ#Rd15kH zeyUwJ07`PL2#8&DQ{G4c?tNU5K=MF8(;Du+m}kR>P0sGUG2XC7G=6((GpYoG$Y@Lk)?ZI{ggdWcLy zoiogA0QW^Lv_=`ClI`%+CHRh3KX~jqaLv|(NG20i{o7?2O#A231=#e->IK+w^L<~m z**G-xwLl^f0E>OTjPHri?P0}gV%TMf40YRPRBVI12}fitdm$4`xvn{S6hR2ZFS7@# zyCG*#{6$@87-Vs+9TJo~!(6UfXUt(1`GSub7)SFBA-3&8oOOZ(bln?=%o+H_Ll??M z!44^$()a#<8b&yr&-1WZZpVf(i3%l9wH_Pd0%%%Qj17%{B1wIY6VIJ?TrnYCIZI^J zeDn#Gi8?X`mwZsq0M?uBjQeEr3aVownHX)AdD+VH2g{6V=>t=9vsDr{fn4KZ^wXQ> z8#c%bOWgjLfzB)mxTtq9pX@8hnXNQhnJf6%ch7yEX>=9In6q9eq-ddz`9I2VS*XGr z_DRZ~m*Rs07}J5UMFX9}KZ^gq3q1P&$&T@msaOMn1rO*SE3z1wL*8b)7^3s&&Aw)1 z+w+o-c>-_`$<(>Qap`;*c}_d-GSQoXNZ!}7=skwkqw7l6$7;ZvZQdl{i$%| zX?g!0_#zuh1ElmsL80)dVHY58Yn%lXk;r%-A7cHgZd<5J*P0R-hgH1+N*yfkqQl5l zRWi)XClT{mT!P7&7v#i-l6`i%uM3~6mcVV^Gh$%E<1TTo+HYa?svv~<+lPoxYx#EA zImh5_TAS876B zrV6H=9Gb6UWQTWGVo^kwdtXn#)i#EuPWsXVA;euw5Wg@$EX=%=6uxpn7h&`x1 zli1;6$~)#1!7W&xS+;cQ4R{}Y2Xi^kpXkEdK7F0dRN1*vm2~ypY^E7dcn(ZFyT~E# z(Em))IDF{DwU71OBG8JzY)lLH*OyTU6hpE+Hpgoz2&vHqat$T8j;B_dkZ*BSMyEm9- zQeaATR0vMDaNX?zh4U)=hHL&wuL%Xkd#C>Ib%jR#xsPAJx!$ZhRBzb{>Mk{PP9$ht slpEO9g3sCWVZAmsUdX@wmsR!EyzybyflzAKVmW5S*%p9SZsnc*7o~HE1^@s6 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-entity-user-collection.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-entity-user-collection.png deleted file mode 100644 index 5a032bfbaa4cde0eacd1ce5f7fb39c053e7e3fd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6653 zcmYjWdpy(s_uq^SF^iJhG`SU$OQGd5O)kmx!>PTFf62J3kO#gn`b(~FYZgH&Fpx=PbBa8JK!@P#gupn0@)+7dqE+&`C<@=c#)Zrp49lZuSK|%Rl-Bzwx1DisjOxJ-Fm$5n{;PDhYuldchaOhZ0~41|Y<>j!LQZkG>ET%6px zI(YKWf*^@RLeJSC>K6nM3S1(a0f*GM!vaeq_BmGZUm&q5um;No-US2`qOhDrQiqC- zecI^>nF>Cw87>gUy)L_Sb!z+WN^VZhOY14eDP0f!`r_FLu61dOQoRN2dQnb}{etzB zGoZ=(cwEbYK@SIBMLT)n)2{}2>Xw%Wo zxNCEYJ4*8*oxNK(+{R+O;A2$zS`6}%sbkT?yTm{a`W z$O-nysx@XYt0B&NGapqcE{<{xBTw~#cBvW}5PO}j>?JSet{IaSr{8K&CBtbWy~qgusG5lj*2&f zNbR>W;+_CmOV_qSgAmovn;$Z(t@VJTbJzRtJ1Nu5f|6Quh;Yj@27LG34m{H1kY=5w zW5@Vg4({CeJ{;j8G^I~PHKvC>@%=DK%QM*@K~Ji}XP5UlVEozyv&)ewu}#sWr`G5$ zmHq8pW+N#r;dXw?Q?48oiDa=Zvl%n^gnjzyqY0*lc4kOoMNn%Z`ST?;<=l&&<=+IO z)8I7`_ZhJ4@=l?lcbAV+lCee=1k|LpdnM9K^prcj%vWkjgL)@E0g`ANqh?N*G>u5? zE^?l*v_pVTiY2R3_mS4LtX&DfAnvUO@49Av0@f57su=j2Ov;;9PJYDf=`TGJ19Ef^ z2+AG3#D?;Jy2Vd|QDA0$P!5FWy*nCE2_<9v-aDi3Vg8{XsKjS?GX>?)-t;3J)U9Pw z2FZB}o|^a`20GUgiv=2s|r=e=kP zNN@lNi@XB=#Hht(NSaE(p{FYG`yL>&?;$-!m9>+PFYpQwVh*#6KtYb6pyz4XiFJRO zS}z3U1V4jjK7NL!5v#{>Z|e)NxaYcSpgZtX_>Wg*ngmc80W^6@u0qr4zk9KAq_vth zs<9t*>;*5Cb|V1{(f{<0<1XK>0^NTN$}Q}=eEY$F_s>9&R*;Z?#a_20iK4B}`GN1T zn&wzKXzp+&Y@fg25|zr^=(w>>mKc5j+czgO)dc)t8#29Sl#`EF6A*`)`+>=p@a&)z za0db8_@W7@1Hxd!jBbb$Bns^jhXIMHAmA1UL#o`hOoK{e9)($Q*Afuw=CR0uV;M3zCx)`3 zHlGWM5Cuhiv5FoekflkkKc&sTIo@if{umaX@|aQuEs z1qTv)6+tP$MiVW;5I5k^7*BUDRqGhFz642Ath61%lvPK&4kle6=o)sG0h62a?95!y zx9YBjgTHf&6&jN0y(td=JV`IJY@^+%CE$s+v3CLeaTHKpU(wX{?{S{(}6Vw*Ix(v(l} z`I#!QL)HucNqH!%Btdpj3RG#VgsX6i-zEu&k_+Jxbxczwr%E`@! z`LdJ+;)}3sVt-V86jy8w0h-n(_O2ob-(ue+y){a8x)zQ2%eN4`fxsI5b zo@bZs!S7@pN%gq;tel8yPVEM;aJPra^#Ak~Q(P#&%}7e4e|?i=|4-A6C5@7tGn|4s z#k*phd@|x8>7bE;aTQkNV#ayV^4K{=UTTf(WQKztaDON%rBy#B?+!7Ye8#}=@H}Ed z$n$6fZO6z!zkzkKB{uua*Uxi`2%p7~E!6O*w7Fh|$D5ZOWc^7QdGshRYj)87cz5(< zTvVV}&2OrDEs1dR)R2|H-A&y7n+^@KW`FvBwg%`eRVA8?FqM9Lu8QE_HHnJ3cTd@0 z;9v4x^%l8$RA%y)5UD%I=o&(x+i68f{0V1O_;HFulDQHUrhj%!MZ%$^XkTvi=$fn2 zhHH}LJTuYw15@b=|0Z8?r4wABhBT_Aoegpg!pXVbL(RGDVMULjrTwOE`XD@|&FsD#n+3(l zWSOK&qFk-kgpDb7dd4?3I2*WrGy)NvpuS_tTS9~tx^4oY0Y z!f`ktHW>D5@I>^YMToFD?4$)6<9*Q07+SanBiqJ2c!~88@cgrP_q=#oRfOD;;ICbuXn4+c@4V$P?>aX){lcfww?xH!{tV1V$50fiSxnr?r`6ly;i`$faz zI-Y@8|I_y0b@6R;^gX=#@#F?Tm4o8R;SXdWJ!^ttM_$YTUer6tt~a9g6tqp zi4Q}wD)E;++OZI|f6(`E(kn(S^z_gER2ovn8UYFY2XQz#>!(7eV3|~h17Z$1O@)l( z_EmuC5HOB=9c=I|C`kB)@Z>kJ5`3^n15TfVV6T62tGS^|&M;`xp9Jumm)5Vot=9Jt zt0$nl9y1*GlmlFcgVU6iKd zr$P0cEYlhua7nykSDC~eMfHO8?HbWO!7`O27I)N-qpllVj$lIrJ+^P8%a{L_7-qnx ze#E4L7H%iM*02PfQ~x^_FN3eN9Xr`-3Nm@4{1zAYy*L^#R(s>@OoJ6o()8qZV!d9t zlGg={x{AE2y}%$42q9x;vP+R~D#RpSN`Te3{L!Li1L#dd2Nsv-<=FGh>|C#R5kxyV zL<)>Th1eullIN)m+wcXEDY)(JBS0Ys6?Av{D8*@ZorUbsOA)ME!ZM&U0 z3$&Pw*^q=k{RdqFb7sIGabVia{?DB4ZRn^WxT>CySS|xwg>jrP*s(M((yYMTcqv#G zxM$a2GA8^KLX3eNDi#a5D*P_o1&n6qhnw~R6VCKH2L7_=Nj0Z@Pwu6B9enIC48I(z zFtoDYv@j7eU>`I0_VB850|8DEk|(v+6CeTwU*79t@;ysJi?BGl?rbawClPSib)m?3 z9r7~EFBJ=+)Pa<7-2V{p)b!6NybRSrUUsBFx^tkO({Q+4+HcXjL2O-=@VAG{mrDrh z&Qsz4`M5v-W|phB-}&+uJec}l;lg$Aff3$g_SfK}Hj*Y@I`wH-Zb};#XQ(^Ox2&1m z5)XG1dI}pg$(I*>_vT03Dq?x(x*13dh7HX_k+4aw{P?IpiKFKbwW7Z31?xK6oe-7SRxYPkKgu~4V-n*ZEA~T~B7<}XYp>5l?IcQlVU;x#bDal!WSuWjca6WBD=zEHdANe0hI==dm=kRw0% zveew^(HSRvq1wWO?dEHpiFSy&D`-!fThy=Qr}j~A&tAlw5*f%{KU|#RIPO-9d~*@z z=?N0^q8lC=WjtMr(4vS3OXc|2=d1g(`dh%h#922*viy4irYZnb{b6`VBCRO`i#1)f*atuf9?YCxv zsc!T1<-Dl+LweEZ2)1{s(^lrgi$%VrWzLRc&=p?aP{&p{RIw7jItGcfL?1GA$HW&9 zg(G-{nCyS-t23(&tOlm6NZ)>TF}`Uo+(k#~kNrjcgg=pC>!B zbL2g_mQ*&~-D>^kuXTAVcODD)mEGlbo$K}$ogUF*;aXffBz|{aK^3w-r3vU@fbFaS zErWw16pTBZUf45kw0+&TGE^~NK>TJ6FEP{x5zG1v)B;LW6vOiS*p*0hb_LS2iFiiW z*Y7vf{EqJ}$G`!(1#MsPR~uOy=Q_W)X4Wb44Ymwd-CUiQm%=@c!J3{Ig}mb%%W^ah ziGu%>ra~AKI#b-#I|?j7dzF))0BTg;0G8>L0QHUqQ+9mk z7`qhs&6cTlJE@hNE&agh(soKql+G&jYZaciz(lu?QKJA-@GR&#FI`G2wo9SiJSS}q zKE*}lWw?_C&vQ>#Us8UT)750Z{w~_5r~FA_JvG)xwHf~KK(Ga7xcUf?$ClCB`|iEG z#l{mX?SyPI{8Lu*f^63>*-r{o2tAJttrmZB0`;-|q3fM_r7vV~O?YSa(9GkER~A4N z2c^(VtKV};K&bvIFCrH_8v4DA@VKyZ-Dx(YmFt^K?a`y>d^MH`)H_jV7U4$j?|U=8Vd{E;z~roAh}-_%`rPIUVg z9gqVpF+>9r4N~iSDKeB3o@1+{Gi#mSGuP3{H@>iNUXDTDzeXW0_?9zN^`(3*%dy>q zFk9w6{9*cf;)$m3Dstn6*n?p>$#P{`(7i_)|GF2VOv%PZQ-fd>`DvrJZ~z;We>Q#f zMUR6s&#OxMUl5YhkMgwh{nb`;&oB2MW5AAI00To*H0H7bD`M;0%B#H2iC;Da7+Lii zW_kk_>>9Q}9&sg6w)(Zr^;j3!NE5L9rQ@`p@MZ(~p{TuPAW7n);<&cM^%R$5E?LlH zV+;4Qiark|g}<|ZTS70Hd30cSr5(=X`HuQp-w}GGUYjB?U9)Vvz(8WuEWpU8yu+_1 zxFQz#r1+%-!LHPzP*5{8j%Eex_y@7~c;;t}w)O4$v-2Wr) zYofz>ABF=ss}MN_?ch?ld#P)-I~oR@{csInR{ONU_Pp8okkm9RLMR7kUdC>Gx(T~e zF9NJLRHuhTB8u}zLbtl|ZEIkY!>>H@a%Mj5U)M__b0oi9rDf;5-;>MtmwSslAK%|= zVx32Xu0h)4tlFweRk{bu}-F&morGhF(;VqLmjq znlqXJZN9#eer9Teq^CXGYgMFjkE*N+VJYewNwmC%ukUP~iGgRUTg!KtKIG{I&7$HQ zqBmT`ZTpYAhx{hrTeedTSG$SM;u{Bf(r~u42Xg7m6yIuEF{3R)Y+buk-e8s%H} zokFgr6*3B2rNb1}L^T^#1z~PNF7&~f!<7VB7DN$(SJMo5p)%D62(PB)m^;VOkL@Kp zZ>k7uUNs!-XbhI!H0#^%I{|+xRQE}vG3pf57iLvlbkD_)<=^?b4Zmz3OH3i5ChgpA zMx72RcfJDkg_No_F7(4yjSZGtepZzOUzgRpNW>2?a6}o~lX0bnM-{kA$?@^@?JUN- z-JbVar*Qf*#;XQ*V@$;v0{P`bl|GSjPr@`SQrQ#OTM+ z0TTmai%TBk4Dc;%qmF2o2$#ki7`C|7uGXd%=oXB&y@Yt(r zzt6OTdj}-7&Dny0B(HPdfj+^m+~Yhg!r4_wF9N+B$fNbK4eh`_y;`gdGBQ=3l9}WQ zNYZ_x1@+=UoUstI3WJ<9Lw8ks=>f{T{a=)VGkc!U9Vc!JBdJOJP4cl14Qj;szWm?(aN%h=HW}d zQw8Gk{>aHE#QBHeZgX(2366aJjwh++y({{j5*agG!xw$?60`b5TNTW%Td=G31Xv+d z)J53Ps!t$uF4*K}W}{jE|EYlku?M}|tp#f4%)?aLu8L*_a8N5xs>kB&L2I4U*q}M@ zz!C3$ZPdK+G4Yzi>H#k={kJh*=J;OCfC;XDcWM(rXqTVU{*PFFs8O@9Ut&q`Ke^jh zpgl4xv{P)Es?`4WRRv9v7W9s@hUCjepb)@wF!swZ>-pg{U>JacgUG$kLQml>M0DBz zg2bRbqxtQwIw7AT*THiNdpDHVfbMARKp|jom|1v*hoVa<#hRicKYpmv;t5k;;`hLc tFaGf!zOf&G0d=&Cu#Sw1%J(}k*S3v6xrh(%!2fR`W@jvoYEOII_&=$J7ZCse diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-escape-admin.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-escape-admin.png deleted file mode 100644 index 6b73e08a10af013d31b6924bfc761102b344ea3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6120 zcma)AdpuMB|KG)^<`OH*{TjIo8*(cqn|mVnTkdiT?EYVJei?h_+~NVyDIrQDT; z$fZT@6?4fd@jLqdevilR&+i`FV~_JZ=e#cO*Zq}bX>P=EjQ1R2t3hNP^_|KBRHzyWC!P$wRKCtv+1@7-?3$ndd}en#to?V?+o-P68dp@j9V%lz zX88B?)@;~YFfL2-zx$4A8;roPFT9~skgzu@G4jO+tdZgJYiMRWr=98#TiGlQOdv{R z0%522BSLHgQyi5x&2QK>4r&4E!Gb{b z($1aO$tJ=X+rrF(?hygcmUqeC!=2i*ruEQ$cR66O|fn7z*1!(eE}cU}=Nrjxa$XNWTkeJ548; zq9Gx!s-ifKC+ZuzG-vEcN|0k1+eVz*r{pkk+~h}y#z`iak#fzijW<$3xn)TnXLXSm zD#CV!yNi@tGDelgL#2z);*P0deyQy7&mqm;>wEw!ot_a_zB86%UB3ApD(rg_vyG>#Q?l`FMAs_Q*{I_hFdXD2+kOJ`cAuKuC&^ARD=Wes zyehT}Oms;#Rc+#Bs>Z4%Ti?6QOmtGc(Z*|+NFLYXi_Bvh_B@rlhPRcd&S?fKip4!R z`)wGB&1laY!Wmo(Aqv-*XC|WN0TjKKV?t8^1ggQ$( z4nyR>evQZt8=3@;?At<`O^mb+7b|d>?V8b5g2W{b8T_0m4L5zRK{;+#XFme-H7*9n zra!%PdchM;n-3Lc4Pvi1q_Lu*isEryQ+cvK&wP)=+ULPzZ!-;F_9U>TF5iYh`%0bRAF^%@1m(kCW zt3%YQljPGBF@G2-wTqL;R@TD1A3eBeh+DfU0N6-S8z7K-8rJ!piE6KJiV02K#URU8 zr(gP~Lka8PDMO^VSviUthA#!+*#Oa@cazN@&r**2vDUJbz@~w>q!Rth%UNz2|agP3hZ*=Bfk%^^4VlmNPTLRT=|jO;Hg zb*oMBWUvYCe(i{KMRn%{NwZMTUF0L#)uK zM}(g1J+>D$bT*g&+ZkFgOPR&_%SsaDsqlv>W@LwPsL=;OkLt{3a4vWJW`1=3_r;Ox zr_hob>l_KC51pf2lh>w~WA7NNMIXvxi0pOw}_u3$f3N91gJw=z4>n ze_4T1&jYILT#wjN?F(Cxs){?<_1JXXKGOp}F`ZD!0yA<%{i}zmk8bbZV`dL*mpTE@ zi%npn7Y09;%X#@m(7ER<ikT?YSA-wExcd zr$!PpyKnnGH~ra+l&UHlR4z&6u~V4wp9eW}3Zk6@n!hkAWAE=Rj<_T8HMqc9qaqG6 zY9p}qz~l0oX~(*DL^=84YMgFs`pS<#%Mg{PI?o}t`2`snxxG54 zoub0EOPP$}vs}F|vH=-=p@)B4sCgm1MU}`i7wN$4R9LQVR<^ckKD6QQf7WMaI2Z z?O~}n&Vt;78WfF&=S9SC6!v&*5la&)7fJl{3LIbNyG58%UZ)C;wguHROIPE2D}FUo zdvd?<6dLUbs_9(Y$aNX|_i~cna@x?V#j`h}Zp9lYjqO6`xR|uRbkGaG_V2jX_yo^! z{h+C`7tyYjISekI)tP);iX-WjRhN$%d3-6`;@ncYh~)VaK$jRXe0p!GxpL-Pcf6G> z$|b7%?S;ZH+ns9CuLw~FTU2%9A#zmn>1txHLTy~9ECsLM7P!znX37x!@U$(3X@RZq zI;GLp|K;hZCh#QA{z{+&d0$X}?}f8NfG{J>@@jgOie@PMk%;s~q-7r9Jk*Mj+bo)F zt;!Ule(`Z<{Kutu;(@2NamOZb4q02-vzH}pS|nCDB1YJ59{tOHg%5V~JL(cZqy|Zv z-L70&XwI3sqIn9Eo}pNFG(dE$Lz#kyq>|!}25eb!YA>NqqoKm$`%frCe5~d*=fo7g zG~2}4!v+fiXk=MVseQMgutU+@C`%i-MYGo1Hm}c)z@FOqOs#$@gCCu1wwX;&R}_sv zlV-Jvm3M)I&eVE)i{q>CoKnS9u6uvn;=8u)w}h4A-%s+Fy=Zwk6auHbE}lTmienefx#A-Z56$xk-^kd zeqSi`P9wk@#d}|92FH3p%bV`+i7o0p#*>bC{e6PK)0|M};PxyhZ*!2_b;{tqMZj@hDli;@ed%ST&6tnCJO=^I&y1u4$nsI(vR_M) zBEV|Ss+gfDNgOJ7sz2%+38T&Y0B-djKAC?_9|;iGwnKYwHALMTmOF0qBfk3}MCN`i zo6FgW5Ojeak6H$JjU=0Au=k?C^pCNzV1F~|o2Is2bO1qFzb)w}||kr@|}#{*iHA&@_ub|;+^ zpDa8cQFn*(J>E|EB6IJLe1ibsCC$bMA)4v`;VDMX0eDj6|3CRo0;mWcAPh)uLRbJ4 zGWlPH9;QA`+nHS!|3~{+NB(xqDL;e%(=@B&?)K_Oo?G{~l?@Nk)xMrKy%Kl2O#+8c zd9fMbcd>Kx(>8q$b6n$2R}o32P=v^1T}lZ2QF{(x98ca2Sbv~661)WH69QOm;?OT9 z^US)XtSBe{WA9?NfyiR1P^)mU3yR`1v$ZNeA3T8zU?YU(XNDk(52mFyxdX&2HVwQE zEi9a>DC&XcF2p7|At()m@Q8?TaDG$L1je{Y`#)~y$m@I_I)R~gEQ_moJ?P7f6SHt(Pe7U=B`N>=>$g*W)Xc+%{P(1@XLe=87U?TCW~=l80nZDuUA z9PBm_$4yI>2sxY2#dZljQapNWm2tx0J8y<+KrIc?*Vn^Bioey`8Ubks6KzRYp zjh(Uw;<~0s=^cvHo}@>d;w{7i=A3PdC_8FB$9pCC1E7O`kk1P(ptxC-{MMN`AH5}7 zAYAdOcxQJ46S~y)m>`7Rs|YVt)jt#-xdxDqhs7;y!IovqTPfxrkC}%V_cy?WQzmI)xR0!0{G{^je=gKGh3f; zd~iqf^}+5%3HtK~SbX$OdS0t2CPA$ptE|YG#q9~+E4k$M&;@aNXTB>*ufYVjV)jJ| zD6m;u^PuCIraL;?Gvk4=`kaQRnDB^``MTL7{-!uoW`jw>;4Y% zV*7MO1qtf48dGzVNsKo-!lsay;ArHE#`=;`4CnFAIlAO=7B z#n0)9ko07dV`?dRYvRBVC9QRC}f(*vC0#%KrVz z<;dNf%1IZp2)|*xgRCaNHO9<3rL&N!>Fe=h#fOJXsRs&@k`6i(KrYv>1T%s9F}8C? zS3u6eN9&sAM$?3qzLQCG(|lMN+%IX@YO%QrGAO3=UGvxFY=&{ST;_`={=BJm>VO=H zauM&0_W`DdPp(PRW^K0O5|O7>h;Koz8H)N|lNn44^F>A~=y75An~&dgfMR_)?0gy{ zmv!;}O4RE^9n1!9JiF+CceG1z02lE%C&mRIVM_GR3{&oG|Cv@Thx?J5@Kb<`H@}dr^3wSW)BRf;x3!NEkh$OXHK)TWt^&u0v+aBa)3!BOq z;|?Cp66W={D4+uz6LGi^2~$A{vnr-4>LX+s#-2b9x?m$nF zuO}JT5jJS-RtSD$Bd~GIbF~(xd%`(U>KWfk%$6M5JwJ`Dq6T!HWTrB+q|%_my;Sy6q%n6{UMqlJCrzt%eY9?wKrXV`Yb6n zmDxC?5J4I?lZjCh-%mU{rUL0`{H=zjZQ%||%X&~P9iBiR?EUd%cd1&X!$m(Mgyuin zuf?)&EwDuVCo9jvxdq00fW0Yx8{3$o5 z3d=2mD|b9k{;HqDU+_0JgD;DJ&8xcqJgDPYD37Ds3F zZH@ghkX!IV#ySKevacP!T5^{lJtpidV-PI9->vdTx<%^h*0RtiwW@JGNWJ9#7nMIg zCo}^0?hR`c8m&8-o%=u@pUm0TSXs^<+%8>~3YA1>xY)zKUO60!HtK5^rD~EUv}<0s z*IOsP<%xd+j94oG#j4ztHO_`nHOI^nPX1do0ImLuY7wGPJ$C-&SNI#fD7!J9{R; zwCCUfryF&brdGyP{*_>V90?PsKM_9cR9TJq|JKj*g^eMd0=N#h4H86dWI`ra3m3SA_ucQS) z(>l1?QVV(?(RC`{dtrd8h~)_p4^d*kv-`Amvz{AelhX#-bRpWtd-`6Rz+$SL?19OW zddjuIF^5#hHhK>Gnj*RLIg*Z^Ln zF+_1glmRcwFVSY{5Srk@6|ipMBQjkc3Ut!*tNZ-vI@ED2jXlr8Uot2VrM{cZ-_wk> z!fR3m2#!gv$IYHivli*1BeG5e5yN|iZMv06l`+q`I!=k`h|73bKoz?qnwCg8R72|f z!@XkvU;y2QnnOLqNb!^5gVnQ|zX_DZDQtMskj?6dE^0HX1riU_u9z#rTFrlDE3)`i z5w=}6wLQ(*!PQcAf~xfXMBv#F$O@b(fwym5@C-iD$_=bYQFNcig(^?<@dZyUdKB3^ zRC~qw^gnF)b&xIS0QZag;fZ0^GAEAAX0LQ`y6`~BgOfu=?SwV_S`Y2#EVe(H17r3C zUY#ij6J!wt1&BC|(640jcUuqyupINV?~=*M0iymCXJFe4qV3B3hNR$ypx0KtPdBjJ zL8dYO{OayamI;&RN3U#Q(>%HT)~<0kAXbvS?sDu0snWZEg~|p05(5*teNVwkCVBXN;GzWzEirD8g$R zTUq9{j-617^!xU{|G;ma`9AZ^{hWKxJ?EbJoHOUfU9~WUbBc0;Kp;2tGvfi-p7WiQCH^A7i1Fvv)*I3{?hadX7KM2Id|K|aNvT}q$Adz{D(IuPUob@U9 zIw#xAnC&GahGEHMv00RQcKfM5A0Nc*J^jQtBFA^TsT;P%rPC3EA(5VKtBcTtgN~NLiA{>? z8Z<=~^Z&gm;cO%*y0ZtuPk8WHEwJjvkr?A$XI97L&=2ZlXTFv4guab!88jO{>Wa0- zUc^>(I)-g6m9j<+?NCo+7a!{7vq?byg7P4aa;&$$qbI5fC2P)XUNA51eSc1hd%1{6 zDM5?ub{^gcZw%O4G9+Y@4ZI{3Q;CF|_*?=KZ7$PbGF+)eU8fFE>#1tgu7WtS;Dml! z85kR8)#c!r{X~8x-xNcf7iD-b1hEh9OH;sNu@7t1t6)_MTXxvoam|UB98M4?cBd=N zJ<`#&gp;4k@DXTp7gKCBfZgDpM0?0DL8B6gGMHcW$gKc|1UAmLWP`Q+5^72TlU~Q_ z$L*)Eo$6!jDe8B+>aORBIN1eHaX*ls)^@7r)QTk)hTkrXG)qZK_QvyLct(va$pNn? zsNc~II+v|pu;GIs_Pl!Tj>J_n8k}poMDi5Z93c@LbWHD(W5vi6Rf_tAEx%ZHZ!(K& zj~D5-jJ3PBcVW5bDF$tIq8t&PUdLj(%W^-UcoA|7I;x)%iWOia1mAA$Qxnt7npHY} znJ;NNZrh!4YF0tBOmFYPmdJ}X9^;hHZ#0%MOH7V|c*+4jNDAZqlGDlTki~7`T9l+W ze+r$RMg2fEm{m|#dhN)b^C-v*_w~*8_K<98%GYnuJgG=pb*ZiY*5_E8>t*13 zyn4e9BbBO{{wZ{6>=^Vrzh0BWUdb|b5UtoIgBOa+w> z`U{DiGA`bjx&NW7<^`w$bk;O|u1vXX$(wqMuwM8W{rHWHcdBn9g0$hNg2FeiT&1}y zS&E$0n8P&u7=#@0BQt;M88b5NVQEjeF|Sp15wTQBW)>iTPP z6nvDpn-gQBK9=h2_{|2#8_>gMb7Yj;XayzklA#)79zlx!oye^}>>wR!Z@xd=}oC`j*Yg@Hc z9Y#}U{tj9w+}`tQc1qTdPcV61sfqVm?_ExdAmitkx0Lg zw?_LNcGF5`LU0@&%wH9laWoU43JX?MPqwNeq;=6g*+uT$pGqM6dS-y5WR;7n$(9{q z_}$$-AF}^J3v}-1Zc7uh#$ZYT4@{j?&9 zuDx2afx7fmCSRNClCveG7xJ3v_3~h4fvQ5~?@qk2u_w8_*Prsa4snjSpR2hPD!i}h zo?BES!Xs{yC0p35veYc*@VZv&#fm$`54o-FTN%K!bq#x^7@Cu;LN!J6-`#Cobktx# z3al>Mfd*wFiwCL~Q>GumbRZkuP;HVJ`lz?gKhx@18)o_T zh*vt-U73MaOTNW?4AxHztB{=ICg%yekZR`8sSH%hxS!d=H;&n$w@xb;utf%i*Ljq{ z#eBa*7Oe75tLIp0ts6ORoehP3EO_1(eeuhl@~mEixCgk(zq2~c>~4V5oQHcvCBtEK zBDp&%Qj3nG>B^0~73to@Y0*_!d#`QXoz?3VUnwU+Po;Mr#LY}REU}J9kdKxRx});6 z=wM@*Ro{d>Ic&TzsE+xQwbGMrt^``*{oQ0TCQd7RTGS^Z*=D5{s*q6GPpE$P)C&Gg zt}R04=MJ&5Y>QzefD_)fZ<;ADi841$rlrikuN=!Ait$Xuaay@Ub@i4(=%~D?H2A#>+S+0AcB(71QO)~COUXB2g^6#ZJyojA|IG6y zjv2T?%7A&wa~eq-s7G}Y*K%`tCXXQvx+Yl<6;Vc2^;-gseRNT(*KA@9X*B?_^x}@k zY(pY5lmmg{1I4$es9mLT-)5;y5 z80t9tPR^p4T6Cp(&YvFkfgLS$U(d|Zpm1%J?Jv-clxaVWxC`4lCqzmw|CQRVJoaO) zOOs(t>mMLro!cHPlOro^_IpIol=C{|rYN7*d~@K3dAQ@Z7Fngw%0`C8Rc2EAfbA)+ zU}uA#imwgBdlhJ%^6cHBN(FUAoa%Bgn`HvId+hlmf)M)0iN zzIs~pQ>?vK9{s^iZ(Q9M+BZf#@j}esji*6@D_t}8-2?xMIJFiv$V?Od&iu}(k-Kc3 zfH?O^g}U6`3cDl6c=l>$sUt-D5iu;)_nwWG`IrQCm0iLx+3#e$h+++S-IBI* zZ_Ib&(@KJJ-0!|z>tCkT|Ey(lP`PJ&?+GqnRMA2u?QegeIA8bDT#}2d>RKah z@1E910;N{k$H0Bv=mll@A%R?lWWoM^_XFp|I;NY?BGjeO&~;voT)aC1vAkV>uY(E7 z{16bbqmg320~%LG>GRtzZQd zRcG^NW$XTV)DN#?$X5h$)l2R9x6=mD{fA|&>Pe&Nx7&&%!_EM6v~=e)UF53>7iQb1 zN$J4e-scU2&)1#V+GFyU zu0Qa)+hg%H{m_B!)Zt4Hmrj+Bt`W4e;zM-)D0n?0a2FKpiHkj7MX2lfWUsg~$OM^} z3nC@0H+Gb(2+w?2bwsZ{us4R?zjFtNzp{QQkLQEiJGS%9>xBA3!xFk%^5#SNRb$wD zdKUS{cQuIEduCu9;uTFhVRx}-@``MQV|mXsFH$l{J!u%IRJ)}auwkjJm*PlC|BZt} zK*1mpZJfga&;lvWDgXIU^uf_dFG-oO2`nZz7_o1Ki#@gvDN3&3@sdDF-&0RY4q+il zKL<%9AXFY90gvGQsqBFK7cCUtY}JTS$K)*xHpk)l{1CzfxT~u~0fj#UVrm>C{H`ZB z^o_tESO(B}dMrru|^59);!# zOhjDeD@&O^Mq=}l99Y=5(_UDO!Z$#NOknPW1lBjbO|Lk_(EdIbJl;t&QmLKuKk7nc zenY%?ktCxWuB@#H$$^kxhJ~5%)_mMb>6N34DE$wbLKkjB-F?h(pu6jWj4A3aQ_|a! zK;NaKmLAFLM33YM4bnd@Q!Ub7hk(|eHf+A>|5u3%|2E<@{5!;tck4FeMD;b)w`wLx zu1>L?Rv=}0TTLBsLCub4m5`r5E(xM8nHy+*pbm8dVu3iLFS?^t_ToEed5ZV0j|3k|{y_cnz5ZZ|I$L1T@9 zcpAr?to|?ze&`B-Q%n$Nz3{#zZHI4&_1^MRTl^3JHwBQO^Y0Uw#1OKb?=8^t1jMkh z=`4#wTF`AZhDK7)q{GT8j-fp))qFqV@Y^u_KTRKrMS1P8@F#~EcYJ#_&_gOE!aRy% zez^xdi~m^IYuti9k3$UK)dr6-BB$YJA#)_d`5w4u;{&q7bK4W9kQpL?&Jj8wUyNXs zq!A1(Lv;RB`9Gtvh*#}D)ki!fK)o(IO!cLwQeKi>Kh)}VBYDDAP)0nhP)!|_5v!I4 z_id=iAdxH~!KSMpx>#s73bP<0u3a018;i-KA1(G+0 zQR038o_G0oqgfVg67hg%za+JrR|w@4TIe*2zhyh0BZk@2;R#no840bkIAKB;4S&sb zF7T=+{o^G$;?H>w05aCNoSqg}NNfIQbKx_OOv`}j%?HQ*&N!b-{9~1`tT^Bb$4G>Z z2$J+lh3u&b1C(q1=ez+T;#K9(YdHKP`Q-M1H9@2i;G-Y9Nj>2OHfobFfYC^J3iStd zarn|aSCQzpDB7i#1T9gD6hOYhe+NbNEGBa;Jpq19#HMPSu1yjYhc%`t_jYvqc4|@j zZie4nQ2P@jeVdzPnf>$Eg*3&2FXMRObC>Qy)&B$7u$OSL>Q}&L!0K@b(o>xhFRHZz z@uC1yKYEH6`3nA;t@7<+vg&_IY~2UQ&CMz({e(c)GrbM$i-TGPU@^4Ir$T5+)fW=9 z4(rR1#_lmCMbrHa{%DYRhInNl2>xyYP(}=LHxL8n!dRAyIuAKq;L#SaJ^1IPfNoTlNlu}{DX zwLZ1&}f6vnnIk8LnJE!BR=tnSAD|#NPT3J97=x>piiYQ2ePsOWA#9Ixj{uH z)P}*b(aos;u&^iL`5rImH!K;fyT>NQ%gad;t-23BKJTwXw+UpZu>=~}vAM&{e6@EKscQsmQtLYYYD@}xR-eOO9X;F}_25m?t1dTNmqJI3S{9f4p)x7fE5C4N_O zP)*49qIY52{%cGC3(}B&>(#Jyk!hNqRAkQS;4B@U3ubcPb1S%=K^DOI`9O3Hjy5ax zSoZyK?AwN+QHI6~AwqUR2P{c6V2q(exkEp1Mtp{xb^`vQS zp?z~4JH;*Xa;V0$P@wib5i|Fd!>Z$BSBCLkG@Ps_0c+<4R){+bNd&BbilKiW#(u33 zR!Sd8r=A*?T6xPx)4Po4Nq&*~f*#?I=b7a{iU4-|+LZ9P&=4&Uz`o^&i$zrvc4y8K zKK&W-XPXWf0SYl;Q_y$Qm?XtnFk=o_=RF&ri-ez~`+_qj_lExG41hu?GGgeQRSee| zvz5tYY5*YA$HuqnN^81-S=Z*@2ly9NOX${SY19I2KCdx{Bm((m`v|<2kkF2)2xSZA zai6&+DTbE#3wkieRYD#<4M9jwg%n}clfs=IHAtHkYC#%LqMq=Hp`9aH#DV{WeRK{g zPod#`5ixY6u4Sm>%?goN#8v&w+V5XNsP_sDnMGcbKdv`3XX}SAncZ1nf>_H%fvT;t z%b2g$75d>57j>GN3qaV1z?rHO5mzCf&L5+#H`MYYBP1N{Ygx@PLmTh}3 z!~Y`4i@prHY-UQ~;qOpga`Igc#?7_n?LX*ml3-O|4aUj+`XmVSUpDDYb|Stg&0GMf z&x5>K3BNA~R}*-NIULM&QHBJrh2KB$QFIrWU_R)tc7uKi(ydF$%H-6+99rbLOmSXe z0=V1hEuq<7rQR&UfZ+;7c`FNDi^^y{Tf)Pjl)3GlJXf?+kWMc(-`*&93y`QXTQdBj zI!CCDJCQHG8rh0Hvp2#Ge7xTI&w(z##5Sc2PoJ3Q}V zU1;^C>7j=$eQQp%ud-*2V96^!pnbt@)3g^OW)WgM&P8kDPlkjXevBG~!zY6sA08Xn_Bc)geS-BaQ^m4i$$Th5)0acfyL@>^T*k~&f*b| zC)2(hYmC{)yel=G;%XJdq*rrpSoOSBz3jss!45-#Xd}fp5rQyo0rYmKw*$cuEVQ zEs2aEf_1^b!98)?D|Q3riyp4YQL54jLl8@Tz0T`xluYUprc4lRHCDkXZXWtoGxTk3 zv$a3|Z0hvf8O+57HcGP2r9+@qY^RDQc4?Q%MhnBjk2gNv=NR^=*pRL;IM?2}bP5xp z0b1j5GC5>%SF2RQ2Qg?eDd*p)`9Ylhh6>!kGpuh!w)s=ZAD^*)lc_jtdAa|g?o9p5 zI)jZPvh}kR8;@-0Er^dy+JoC&m_dWN#=bU@)Sw8osU9_>_;ylR-0)ekYANZG8}iwZ0uI-KBvU`1{3zzik0*~URiRk`ttPm-u7wtd%kgo z42i1R?VqEH4M$11a4J1LoVU*Q7vw01HA4`}3&$^jWS#!$aEtJ)WXohRf*im1#8RJA zH>uwA%UC`#dAFZy>Y3~}eHq@g?(1}8dg9FsJvnBVa!?IgUY4_#*q=@tuJ18vL#7<4 z^lFtL_8^uZ7tJ1)7nct6K|By1hZ!$y{MVCdcnje9Bb9umZ0HkEit|6cF>eV~;Wx+L z@LMUyY|ETiAfV-E2s~gpkUfQG%&uLNdW9-MRa)6gN7v>WBUSuq_B|Gf?H~rHTk)(C zD1bHKokzSsx0?hXY2+nzF!3Yh5?UhNecG39w-S!^m#;?(W>Zj={6vSP&~ke0Q-ocpZyClDcqZ)(>i8k%UzN3s(=<_<8v zi^yWO)6U#Q9s)`U8wxhdIHC?<(NeYC@ zz(D#nS{GT}1){`O!dlX)p;(rRN;s8NNiK|bEd^?QwWx-*z2>*_o9U}`FEGVSH7F1!SL5}W#2TIp9c&Ou)>?=Y>`-5e--vbB zHy(?sytN0L9C!3fd`{rOoyxD&JRl2()`5S@?Em#gmQdMXspxD)>R8vd;*8A-^vzGg zp6H1u>G35wFg8O@ssTm}z1WN5a%7e;uyjUT>2)$KsbL{4n7h`y|g&+A_tm z5HUR~g%5FG$Y`y4BdpD}FcT_L363Y&LK2X1?F$Metc)F<6Nov+B<1o@naZD9Zz$u^ z4z>;|rK~4VKu{irHMfTe`ca&V5jg}yntS3`;Rt8S$pV|``~~#8TH5Z?EI*n1|+|dGK%EHluK%$V*==D-p^?naV68yNI8LPS`Y4N&P`J z0V|~0L;FACjS&T@LyO4tXf+jcTX6-k^J>R#)PS-h@vqV9U%H&sxZ(#Q1n-xr?J3;s z9C^k$(cYY%MH3h1TST!kjgs0g=Ak}RE%f1*nP-+_5#O)(<}32V2P>xK+Ft0Z5OT(j zW}+9j!L>5`W>1lJhHA1z*H0*Z$H%j5pmw?a?&_m4Ibh7>^e)Ddt4m1aL_FWoWKLjm zgJq~5mUM=z{0%=#9_m}Z-Jj}iacs&7A_?sUkcyp%A5Z{D(}9;G%jNhi$3fqs{f8ah z({s>#uP&`<4%erSEfl39pYd!Ys5-;a>_u}dl&_WzT+S(on3j0<90_}^E^{Q$CJMgV`Z zeWj;*KHN!?j;03^CcSLg%9gKWj3&Azh7vj#qYY$R8##rY89@Q42kKet#cw|iT!xAA zJcRyWt2tvVv7F^dRli;T&hi;%n;}i1WM}>|y@;_H@0GkEp2Rz>)wWJ*l1xLg zBnEDlYDPm_EfU%YL-Q8Y*QU-UsE|;@ar;&ajFdr9W<2|hXtB?BdC?cD&CXEz!BcN-l0Svy%DjeBN;j8dFfMM^W8X5lDmtEFYAc;sVoc3hz|o$)MIg2dj)|lC z+V98{Xewz%fJFa|pJ-`ytm)3*{ONKq8S7kOq$(i7cH+G4x^JX2^nOu z2+#Bil_2rPsy$eTq?}nqFuxrpcKSO-Nbi0f*@fFZ*?KK~Dy^9-);C6GoqLMtDe6ta zjTI3%(2MSAo>i`d`0K4dHUe`E;2=ZRt?!3j=9NZ`%X6klMkP;sYzcf+OmBPe7(>qK zo0dSVmkL0%F^k=s5A9%#4qP-L> z&=};oFe8b>m+IgA61iVw8@_Q)Moo@Bn&t%Ue9L@`L1c9=Q?JSI#HDM|H>pKHHm0DQ z`=D54TU~8c_(r6R^ttI#!kMM1z|(0%!tEU%I;o;ycWdUR-PXdH=ppxM=FT<7`fHhx z3i6zSzHUDo_JTzCMcATlK16OL_{7I0Q`)`D3!4sI)pF6GOxB;F&pKn8Z$YIw*7u`s zIYPIqv8Mk_Jj2Y=-N>Hf-&%_k6He{_RkU+Q;U*=o>W-L64)QyKOSwa#v9(lTAIm?9~_lWSExU$5J;RSj|Gd4Xlx_@_^sTy7`MfC zmG@9T)-1md8s|LQrrjBXG4^M+wlxoywLO(3l~(lb>c52kyTIHm4)-b6zquCv>^H1x z7xN{%qt3o`%3+=}=qavsGuyLbmQ@{{RO z$|{Fsv*cN^pM4d-bgOoaNTw6r15x|BJ1LNMi; zHvYWF{y|G^D3FCBoSwH8BJk1iDl|i?R&+U9mWTY}je|?)l_vdIWllnp7_Rl!O9GqUGkSXkMv)l4x$4S|^ zfAZeIy1)9Ot9A19fK-mWb$69%4J+I1Xy%SW2&{=UD_*5uEB&oN-1}LuR(VLg-1Y}V z_9u!&4rz0J@kGNPJW5!RxmGiBL8-g(M4q=8M~gZ0us(c0$$NkOjYKIUUasF9t@VpO zDEj3Cg=<2=6*ge=-v*O+YR_sQ=NNU2`7$`7B-${J2dRo^2Gc2iU6OSr3kt28`a}EKzVi7csq_N(E>R1>#DW*-zkU`y0WPzD6?tL?4gk5lS5KP!)dMe{1>h%{)?rGXkH zLf3G$P3wpvpFYT8K0B5wJ6nv(eqVKYdO-wu-pFt0pCH|Bj82Le{x}n@Z;b^ULvuGsgAk;4_N{?5D_~PKWVXt&k*_uLIyCL=I z4!Ve0b=iijW+AW(oOmYcg&!XS4>potXzA17D3U1B5yX&wnM%s4CUVU$(LcdaP z#BKX)jQxhYCthcx#&+KzS_=U!5xWtu*c*XvGtBU87X>`4UiJP8@tryBdznU~=deK` z=%rrnUbSgqiA{v!jz8VJs$QmLIWh9#2gcGpk6${uW5-42F9xVSmARW{GiSKwP%B(F z0M{UE_8_hO2!%Gjy;_hyKcmpPSO;E!hQns=OQhncsU+Q{s=h8n(K&tQW>rWP-)IlU zgTtrAzUh2rzHtkj2Umz<4^mbATK3~UnOKw4*hKxvJ;yCu>s52S_`~)tNep$9qwCaL zm3QV|-QMZ;P3N$Z5E=g>O0*$7J6LhF(~Wks`||gRvQJn$D=E0#H430WOJo0jv3--B zzQ;XIVu<4CM?{MHPLRC4`q%7!-k+YofF*QH9PK+4sp&~ZTj^|dUV|s~K3B7Cm)*mW z!KI|~^OajH>L*M2Hy@f7di2m6u-_-BF)1OB3r4^@I=OF;H;(%&m4wSToC}t?9q>5U zxJNs04^Ro-Vrcgz7*KUNpelqX43O@)&D`3wL%^CHMoLdFPizpkV+h!e?ocame{{NR z4{!#rH2WsWAjNZ$3NpNPuNa<3I{oDK4S>Ld<(<=4`QpqctV84nGe(KM12%KN&OBzB z-uBpVtO_w$nY;MQWaaj=+>eTM(Ug##F!{lcc2yzw##|HuqF}px{{G$>PQy*C_k%ks zV}D!>w4M~w{K$N%m&Fz@UgcGgxm(8V+ctOc$^9v+R7yym@rRE%Ek+RDDMm?OmOtjl z^Z(Eagq4MhztmIITUVAGYJ2@oq}}dC=_XD*{IE?A<`MbzKQ_|bzCBwk)0$`3&8k8k zGh33$y=ODG{ZrI&F_2{^3`f@thtD0rkS*pBQCz;c(}Su`r3aVv*BsAR<{GnU=Pqu5 zKWFr&G<~M}anE7ITg;_;w)ng&H*^)u^`}*Edbm5^>SYW6bNA|PsFNwdu@nKnlNFa zAl&=pMAbWm34n3b4`bYe^%=^n$pww%?v!4Z;R2^9`Mv%6Blpw4HQe=bHnBIU&L_V( z|4H-~A&=WPW+Mt>|3CZO2Gq#c%hgGG!v;e)?oKzXq*{1xPj8%3egU4O?jMD*mAw<; zrvX=^YfZzVrY0*uQZ6p>8Gx#{_=7>mQ+I{hiiaQK zKRtEld8-TTT-9Gkmd@ACTh`1S=+v(YA%+7R-S3%wlSll}?PRqbsmCmTbPYcuiJ`zg zJk4zRP=wLH%~2VCun`Tp{NLnj3=e$t(0q&Y`CTn=oo+5*??n(iOn!7Z8PR=~wbb#t z!R`||;&~RU^|5{B)La-lb(7mS8xV0&5)h~x5C~ou8s84QPal@rYoJpJ6>sxg(S zf6c+GLX2!;4$OYmaWSjy$99ea3yUFtS}Cvr3WfsM`*rj5`T$jk^aihf5&A_Smbqki zTw5FDq}y`O#S|_$tRbpGZlje6QN<4nuHph&)*=-5G=OXq95?>-$JVCSBIDR$h4^>AVhHodsYr%262}jGk-o z%-&XoY61S#(YoSJAWDT4XHS0xdxvHz3j9nFJZWmBX+Xt62 z4z2)o9R9+)Dvg@Xd@YX0|HXgei64j*dVMKVj1X4K#Y{;0EmzzvleDULo6^l~F#bzZ z?UMNRyPpOzVeEAh-(&1%0VzW#TvcA|o|)RSxODIRjqnl5fD5550k!NDr`tUY7)CL9 zb^wfrWJl_ISt9wqBqcAuK&G8+QTJU zHcjhW&T5o@O_()zI8hTIg8zxPyXU`sY)vlC=(^S)4C0*juu;?8_m2w}%&_c83Q5ev z+ZO)n4Tt}Xs7W9_GRf%Qi{wa{D5NIx*$Uz7@cxKwlm~=y@Et|cGk_DRo7_cViw}AcxO)HVja;t z5o}la590(CPFf>Ibw=g_PgbX(uCmTpT1e){cAz=+N$;{jQ9%Dbdro03h(lj$!I?y?p&$6#` zOJd>5ib9pf5!k3szwp5zwpDoDcR#u4iO7TusW|afc0w#hIKdhAEtyMtdkIyn{OHN- zK%72CN9EJZy2KVKBrFfrBIL9R5()$GgYzYlgOlLofbG}0`t@nw38v`DDXPT(;}Hx? zA8qo7jor>b4s>pSIUx^&lzUZ@p}~OR{%ow_eM5rhxzP zHN(ns4G5qgDOcz@joes1tsfy^t=zrGH(UObd1$`H+5>tE!BHH8<-oDHqRho{%%nKh z6~L}4Z33*W{W#eSgZ;QkU%d&yTrFc44<>gVDvY#Hu_6pt%!gGJ{(blj1p+N)G@9C0 zb{c^gh!Tml9^-39NasZtras`tJHHz=bw;7eH+)w#uRmSn=z0kzg6|y-asKARJ0{r~ z#RC}IO16r|IZB(#K3=7$ld*NAdJs^J)#05h0~TMR8nfu1J^|Y=YPI)3N?@gI3nL{Qu5yV z0wCn#I5*Ay{g)#Z-zk9^ke^&vNQiIe?$*9wYZC;3NZ1h25ijJF7&kkE*SZ*Cyrhsq zu7`=g;=?RCDzEWV!s}yF08M7ELdiU?^_6bBsXrThX}`|fn*f#w*^H+r1Hh&((0zXD z7IGB_;6j;m5^nF;tns+20k7xx3M~i;kT%YiW8&~e-N!ou>!K^}sXpGEj57{=vbQ?+ zJe#t+8NP2szyH<`1JK~eL@|Pjm)mr}3y8a2qHeyX7S!U@G@Y{}a$Vj0S|2X9HSsnf z5H#x5sbV_%R!9Xr3i0gB?_3x*b<0I{bU!wDC^nXESbpv*@4B{@{gppz5@I$J16}QJ z`GY`>S2mDXTdck+qG8;B*_wWNMew}|e!W{CUsq`En3zEbRexT*HLHU)!n3yzo#&_w z?)5&+Sfc&)lZg(yrpj2leu5$4%fg8FQ`I88l++3;XJiHOli_aPyfw+NsN-T-ih$d+ zHwRg9CPp!Bwh9_+9q+l2j^2I3e|Sl6yL$eWqv%4olVR}rRykCq;{nC2K<^Xc zFb3B!Wa^1Davpn&dx3*!_{0l;P8UJy#(Qb76h+a9#Lbj>X?xowR*{ zZ39b`nCk6y;k=^}ps-+j`wNvbAXZ?;%&_XKi2IO>3NQ&ZKwdgX)MHN|DMaVmisrmu zy^fQ&`~mt_{GxW}OLu+uk=kcxZ=4oGS~2+l9m@7ACce?r^b(ZTqdRL}7cwBC;F~LWaJ@P3n!n z+Wv(J3YU2`BMSd2b+^$cJAXBZFNK3DWd!N$bk`O4J8LQv2U35ns&GQyK^xqLM{4$3zaQ4powj6Wj%kxBDR$ z*J7hk$m6$D105&V0?ry8v+0#>$@^?Wl}q&G-QfX>csu+#8{jk@N4UnG(D`1ygzb=Z zkKU|u!&-g$4%fgTV*T_ty~yJO_7*v3|43gsAhbi=|J4a+c~x{> zYn@x`Bwmx@(7?Snw+|;j-TnO%S68@;t@z1?P4iaOs`C|TEMG-$WhZc~TjO1VE$Gdu z=;R1cn{C`Ct3WsL71apa=ZJ!72^E}Y7G)z2fg=;lrY1~_w*S^5`2haishCUY^bh#on@M%n!mE`pQB&um?R5yr=}#f z8>g9~mK?w~9r<27@lgAuw6}@;7pHkiLgE}hP!CTZDxS=+ripX=TPq<7AAsD=A6liJ zZYJhYWoR|ge0=8scss+$j44)H{>lXuCs^dD0v!5rHuj8MnEqK&jt9?B5sd0 zw?4mA+CZpEXp6U&!z`BEbMA8nv1@%l5Li(#tKZZPI=-$)=Tjo3zOjRlF7`m=pmN^J zid?|On}wP#E&paH^V|xDEz%hyWyjJ=sk(P#SR1l>n$oICJ)nx?S?5wH)^(`=E+!=FiabrjhrvXy?-B3G<0&RBx>GI(|DrI4v8N zTKPck&ri*f%=$0Mi>dE&Nb;)WoHd5Ny^8UCzKxj1_PyPJHlNf)`1zJNj wyslE$Q#2gK<-*xwchFxX@m&$tl>qti)AriQj_5PMr7w`BnGLGe1pD9r0hFy4nJ za0`PlBg3pY5PI%_Wh_W$w3f*<5o^t|f#e4Y`G_>z3T+Zf-HRNJG))(v(kb zO}Q1hExDF!N=u{fo6qli&hO9f&USX*kMq2~U$5sCf6mU5mrI-r1Oo9Q5oV4c5I7C^ zsUCm<$V&6vE8veU{0!3h0Pwka;4%()<_tr)hl4=eLVG_jD8Jw^2qe;qG&6OME?Aii zA$z;TcWtbh%9tW#_)BaLu%VtEKES}0IM=wC-T@sii8d{4%D(0NY(*yp;!u6ER`l|* zYu1leY}h3SszozvZk;!;gK##R2*}Fza5`W$<>Tx7Pxt8l(OsbY{rKt6pS<7n9_|3< zJMXxsf2Y2UiKfXT3IE%7P7JSR!qucf<~Zf2s-No5ng&U9eSZZ{^Z|WH-N_Q~ft6D8 zd5`F1-=%?R?KE${JpHYxW~sl%FQFem?@*gjTI+|`kCD;KYgbbLN-OKb`Lja7WHz0M zGm^Qz@ zo;Mn_=d@oK>9hpD^jBjhhgJ?SE;|lIYmv{QbjQYdScGAlI&f&}2}{Dg5Y8|GGGz2p zZ0~KFD55W(;B1|Q@u$Ui+EXLxP}%|}r&(K`koi=M7KfF<6?+o1iI`tdjY>%cWN-H+ z#-+jAkpn_OLyaOY?nLx8%KHbgo#&cBut-6V!!?%fv0rme%eTi$8cjR@x}bMQSP?X`iu7RK?ee$q6F^_0Yh;9?q$Puci$-aAkYnVqr1ir zKk9~H?T7wIJW$|7Om{MM$PbvD{X9xF*q4Fdew~xA_ESnPibyGXZ(}0`u`?y;k#m21 zZ(rnmJDV;IzAuAx%7uDzq2v+<)nojH!o;TP6{=q?(VRN%ofX#%*jpu#kogR6ZYjgl zc@5vM4vNYtXuUtM6g2y@)83-uZ7oOtn>8+Eas%i^5tFlf_^9?^!8=~-P^psO(6T3fS~C3sS|*HRBjf&Q4~#zc_PG^iP~Wz$2$MZ5Izo0Z_ch|r?06}+ zLt>je74&n&otBu^J}EnQS(L#uSTmC-;F+}D33KE-N)yGNWVn=ne+~_UEWxLxVISo< zb2)DoG9yF%^m;~^Ut%|I-nSi_CwK?{`m}h4q&8u(eP!(H;+bJd2?S+6-RMVnScI%2 zpA={c!qTJiNA|-UE1;Nfm>hFaxt|?nG-B88V;OkbcU3v9RQ7?pi1;5NjzaEIUbs&S zlKTF-Y%j!!_rC@j1x*{NQu&|1Q%OS~IkUa`%DW>Har@c9XrVB-2-*B1UJ_3dA}}!V zkQYvqtp;PPv_q?VIA-!a3bgL$+2q*B5|1|AB^PNWLVLyySRI~p&EjWk?^4ywp2V;d zo>EBuD#e@UGEOLY;hE%%_gW!6LpFm#^Kd?`Nfpc*BgDR8Rv3|BfmmzO)1s!mVx>eZ z^gEG+%GhawzLnjj!`jnqc2KybsNCFgQs>LXI?@E2YB|+mnX7=4b^NxT?b>g3!Ueq~ z=Iv*hEGechaXiwJadU7iBx16nxgeQ@Oo74$5;56nfmlE4=$pV7$w}`N8B9D>MQaR8 zyD-DoFZf-xt*w36aMaA|-38VgDjTWAdR1n(L{+v8o_Zag{yki2Do^1$`v!*}=aSpz z;Xol}V>df-muk~~*q&K}RY#s*yN+o}s@`vTG7LhbUdTC;I=6?STX-lvAj z+6&GPE1hd&Xt6VVwVoLs`(|srgZyy;VA3^##B+1`p2RL4A|mhijS*j~a@}O+ZRL-% zQ~PS(w$#9!j{kFHQ1p8#AL)pb)js=4duW_1Z-w(MYrHWIZ4=stxu)UZvPC=sC?gNr~}x$CDgZ!0t#a4Zk?SI4NvAU#$SOcO zfhsiLEXzs003ss9+U zR+l(`mgVl6663)){#@Q0KU@5qw)zBiu5g2kl-U2e(%U0Ojf#=ou#!&<$Jm>R%3cjQ zc*=@3=2919`HR?u05}SNMmKyE^~V0_qC~qJWGMhz^4#QNh_)9_r@f-fw>>+tU3+|i zW&hEm83m9NM`&tK?%S=bbCIH?OWNP*{OC)kISiPyty{_agk$;4MIQx7fLE1vQIGGi z4n-rQh?MBH*DC2p8X@+j!i#1ze76Yb>i{Z(l8dPb(vCiMRGU8$l$rf5>UsIM4n=}b zXdb$g1a`M!_4@>)jo_M)8gHKQ1#QOzBzS@W5$lIobSZCL`f`3|$Nm2;opY4h>YeZ&{fS6|;! zNaZ5D*?sP6f#zcD35UGyd<|mX2t?REa0C2%|IA>ppMfaUyTvSQ!T+loeOdqZ(Hyeg zb&;uf;f^`goW^@sg{P9sjsA#j1X|dp?DJ(#OihsyD|tyAVF&lwgc`&~o7*l1!E?x; zHV-nq2F$zXR6YB}?+GxxZ)$&dhLTzNEx#nj|4&G)Pz)Qf`&28)Q_|~BulAX3hZEZk zpHRh$Cj;B0a~ffVTG6+j80i!+3&)(h6a|f8ktxlacCQcWw>e>(Ekz$$*?RX=B>=(| zBSzDr96A7+H`RqbTbgvv8ZJQWE@6qhI8Hr~wQ_ytWI6rEbzPMNp0C+T`eJNBrR<$+ zofSKyzyXzn>Q-f#UJ=hBS8UxFye4z}_TC%%Ile-=TEhiTtKQKHbB+-BinHxh9JIHG z{@pV*LSrN6eMQTQ0%5?WZhQTStwHJ9qX``F$;uwvS?H+Qb~ zfyXM?5g(!kd{-u?MuSIJeAsw*6e0|&aQ8ScW+xq1Ob_qlX zJT0~!KWavu^DIf(Auyl24gJ-8j>o*jM@SSy9lBbfHSPN^969!WB-_<*#g1hc0+S#j zScfw+DPC8X@;9~9f;lWiOR$^T0*OLPov#)l=*!URrc+c9ulW$M`+hzCSzksk;AQZt zDt%y95zP)yzoDz-OvXCv%K$`KfYa)QcL&&KyJ3!3ix(l95qmGzc`HRt#uDI)GZ!u4 z2M~nH)LoYjm?OQgoPv^rrynnJetcC0|8i}jv!dFTjbU@s?(!v;5%p6OmMQt6bN?(U zvv;T9mHC%o8~QapN^s!zcPli;ju!;qipNbm*m_ei^V|FzwjV zEJOunV;BU0f$?94=Yzxks+gKm?rw~mjL@iwVz`on%F_x;*IPfD6Oc$YXVJGRqPO+#WYV7M4BSA;WL$lyW-=Bl6|G3cnQWGEADACn{I59U zN=o48#D~0{8GW1pB_*RO>+b_KnfLl-fYyCcijCN+-fIYZf9-)3T32aOHzxcw8$7MY zpzmB(BX-&xusefR`v2{={Sn0Q0PJ(OiWSW*kQj#fEQB`E?`nSJBq23odC>T$;cgzR zlFYGN^w;zCTHf)_VVpIe@)se8LdED_R9!Gru|4aeM?a@9N@irjJ^!j0oR8SGmCphN zS^s+vp7Rjz)BV)#kE@KDJf<{i4ymK0;Hkky&aS|<@DTRG+zZ{~u?+cFhE$T8$=QE- zg8vUm29U;mDY5?|uD~UHblxJI*o7Z8(7OnA7{8&k+o7N_>S+>Qh~wkDkq_M0AgvF2 zGf@{baz_n-s3f5lgRQkO*5{uXihE&TGiMm#fY-VLOqiNSWG|&;FF^XrxX(?G8K9&l z!_=+-0rY8dfW7MJp0%O6qR)JxLG;23qrFG(2_Y{`Z=>;s@l@W_7ryxozjLt%zec>a zW)z+;@0u4dhLs0GPYr%SKN+h0_k9WSm;GsG!KV^A|T4l@>seSHT-0$AZHQwkj_|^NRExruGar-57OycTj29 z@so3xe+~0=Rd@<2PLm{JftWs344-&Wx_dXFaXC_uvoIy?M99%>gO`~7P>u8;Nl*C3?E#b20r7AudO_TF=NzZfd~ ze4X66wj60SMC`HvZpzZ{o(QPI&%Qsn>CfK;iI%LxhnWmbKZT!k8{ZQf`teJ9USY8g zjB+QwoM9iIqX}Inb>XSZ)2EbkYz;jf|4N==r2s`9umLFYIH1Ujrx9_}zpaz#fS+$a zOz6$wkkAOh4Gt6J@5)tp_=!=2?{D=h#WjP{EHE56;{#URk$&Sfc$8Gkyy?wcs#0j{ z6bjrf=w$|O0xcx(T+Pow7C)L)rt;gOPbd8H>sBFN6cJ$WglkRQdAcFR@U(0p?KG<5WB^MA(0-H)YeT^ zvRmJP(|9XnDK(Pj2Aulnl?d?J*(}RlHQ0y!MhhNP`Ov7P_w==ui!IrmDygi-gQI05 zpvM|Oul25xmILIR;nGFOJ(^0Y`pvumFM%4FmKjNR7YcQ+34ChM+pR&X74bXf|M^R& z^fAhuuJ4*RJopVtYHn8AAjis#djEXk!MwZ=)Uq{rAAlK{K)V{YD)}FMDgity*>1 zzWRKkH4B>+jt-H7r=m9p9&BVjfI}usSRGm67CmKqis*DE;rz%jWbhlQjIW_UgR8Y- zoOgm_jW+KPY=MRD4;52cBU5Jl17;{G|E`w0;RAmy{vAB_fQ4RQ#26V;WnA1JP`Hka z&B0gi(94z$&TPw74Ij4rLK?AyP41Bf9`%3eVf*!yCEgfh-CdFo*vTr;4{|PtQEoAB zlke1)y|nF|cSzWcAFQ(CZR7@~W?+hP=V+z2&|4*mmcJ?7(Mz4!to%h8AOtx4IhUUA zdGJn;;V;DD8r<+@9qL?YBQrTM^G6LORURl5#sa8k|1{|JT*GRNPt@r{ie=+-45^_* z9{r|{)_-kSrWYI&Y%XNyJJg>Dgi6C!`%3JF;@WRDs0(^w6ve>p2Mff#5EqL$R@oDv zt#^J*)w`wac+CA#3==2oQu(j?LxK5}5qs0b3c?gyS7cBY&pb1fK(qr>xNZF2xLq&}X2kI+2GF_+)L9PbI!JdpM^){$_l*s87F#WR|KD&1A^6wXcV@zW7f z%ac`{n%T;RcG~yWBQFjn3OTeHATKn1?=1tydi4|XS^{hRj*_+VJN*mSr0!nltg%r+ zMpZ>ORScf!YI*X&AFBK@gTzsrAnt`5E+1dlO)VWW>D}U47p08=>j24ZSkSbWq!*65 zkTl=hj2|}f<~kzenKYbo5-bhgJxS$9dKBK3E?55@Ahbl(Ca6cMlJ7BlUgchG6p5A~ zG(^d)ThA!*`Zc9V@%+dRua;>60UMQ=+%C zgfkkidyX@NX#EIB>1D2)gdf74i@@eeF$80uK6OC`8L!Q)BYjvQ;g!Zt&#^GsQxZt= zTZV|_&hjVd#s|YXt&LWWxICH<_?LjOZ2ne5!4HvJdBR_mk!Q6b1t1_y+4lBqVS??k zW{z(}pg#XdPlR`0V1&>fIi=*v`v<_nU`zCuM0~LgF;fEj>$7?mNt`LffH2%T?du}x zJ2Z91+zKyVK5K!W5zfqvGj4#qIFM6yh$cOBXyp{+G9!Ahc{~btLMe`jEzX#7xxpJ| ziP8;Lm%yPLl)_Z2^Nw&VOL*A9UBSkncFWlM&-tTh60ptmOis(D?(*masB$0W7BB6> z7K54}&V>%5voeJxa8~N6!w7GVBX$>lO{+XBoq7UY1p~`Y1+9llXH*EEE<+ub=E2r) z(8ty*Nh(uwy?B0#%#)!4RVz3Sgi&R=_al7GS^ z))!5OC%S=C!KsA&H)Vc*3!PQq{92QCv{ll5slc>$Z2gK4CYi=9ocJ+y$K!uo2?J!u bJO4tdFIp}&@Gv02avOv+w==6d<9q8rhEEwE diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-menu.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-menu.png deleted file mode 100644 index 5518fd049b2e50faba3dfd9b09cddf73b34f6640..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3458 zcmb`JdoU6rkY}@6I=H#;C z$(!d2Li~ zxDWl0`17p!*49DwrPBC5X-hA*r{#?~|8c*k1zhM6v0r7E{Tw-#B6YM7UdHfR-Lt)evaCT37CN3ynGB zUfxu3-71Q%cYIuVsUU0j%l^`L^0u`(C&@|!9N8G6b%{g}*S|t-;T&3WNWm-RV|g-- zRm;4Gb3GmlE*$=6>1pMN0PIEE3XvP-R_syi`4e(Zz&k?BNlcE9S@0{$XJkX^&D(}I z@Yca8a55fGdKXni>+-D`C&$_dIRgnGUYz+ab#FhuZ!*_!ZMFVEB%c_O-N|3aI9YG& zGWZT#FOo<4us#o+cgh}BjBuzYcHQ72H%utLR|9m@+iA+sNd2&lGVi5brXY&$Ja~0P zBxm`t4qTxgHE&lPIDyCScD0OTK82fh=ohAvAeWj_u>OS|F=Av0;%vCSjpFSTpp%{t zLVeR$)J8zIw{uogD3G^mdpx6=sU>cXNl+C8c2!mcGM`%S1VKe@1jzPv7*n(bgfz)5 z;5eX{VPwey5Y(Z3A+> z=Ym|@+BrSucrGD5I*sdcHcM$hhDV=n8{#-+ov<=mMTP`Fj&VsYSHYBfJ`u|Jy?L?5 z_!CS>w6cXv7Hn~R>0-Z!1xaoDi!3i=>WzvPobn7kZFpX7-9rAJrxc4jPq^`1Y%N2;l+PjkXmz zKHvzaUJGY@Z4|W!gV9ph9W>IpEals>Hp3e;)F7scAj+u3KIm4afwVWZH>sx+MNgpq z`PQ7Wi8Hc}jcd}fPg@0zJBm!;N#$s0xGx8Ne(0lEqFhQMII#tn0*b(+atdqr1 z_wzJF&5i0VeE8TB2K8G|3Lk0lA++?*Rsv%6y89tc?n&WGso+R+QWlLb#WAky3}!w<`f1? zsT74@X5MNF<%#~x2Dq86I^2c|ku#u6Mk4%JbQU_4?vy>gQtZBcjY$4$Y3wlIN)F&k zICe(!vV0Y?I7;5n_<;>`z8A?pwyi*RbaOt-0WT!%W}wXM_bbJIh~6bG zG`%YEPTd{3rPR(Ky;mC-t0QfZF8w%Ns0mCF4xYmcQwEn7b?m&rn%@_7%w{j|(pbG6 zr%;93uso=@Z3Sf8C9D9*!fErA4aHqd0K}@X15DA}t`CKrClI`?|C%%=>J1Vc63k9e z<+T%5p}5?Ctb{FWXn25#TD+*w#}96)OUe%9elFs6)_?CcxP2$&@ec$zsGmxSVNRAvD?@9blDT+bAIVEJRU zvJH3}v20R|TMKtga_AmMB#c}NMbX6~tYnVKd>W9QUdnG)Y*_Sd#6=x7W%}3Df(pAgT*m zpxpwA^-D4CD=a4wBdoA!GzEw|_>C8m$q)h%*p)78;A%$OK01zHF1tJXO9ydJ<1Zhx zYT=9m*{}7T>B?r zpLnmO`9#y_vp6uqt+1qpYmE?-i2VR`I(6zh4XG;S%?4iNMC?lM*z8S@Fco5gzg`2%Y9pgQlcL0K{{VRL&U#^J6-EZ=~EqSOkz{ks|@LM!GW(&CtQ3(*GPXXam z8(xUrq$@B!M@?~D^x{?oWIFpNm*W3tmy(O_JT!45!TY;tMl!uKjpTYZ%U<7%k*7;0 z2z2wpei|=&sB~M#1Bolg`v8n~v~S?S32r@o;a#{(`Q*c5U!m@Enas8Nz?)+;6-C79 zD;ssvvd0u1%EDORvp#}V9#xK(#T5xSP@)uy>uU1a)*Ejn7KGbexkN*O>&h93L-XN6 z(34{6EHcIAb}cpWtf}ZsM5~<*xL{Q5j08FhFM(^tWZ41K4|F*VA8wg~ufPa!)ETR) zi4RNkoLieyG?VUPU;bxRls`4eKDVtExjp!W@^I($6BZf#n-`kvCN6`)j@_?)sfp&4 zV_SKRoQ{4W=ZigdapN9_g8PSO=vJij{xr{3tyEfHX)*8djEkx0z6W z8FA}5KUpU$HLTj?6{j@tWRyp`OXAC0=eN2TOxOq}irKjWGC Svymmf?BIU;ef)2|fA|mMdP4dD diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-shortcut.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-shortcut.png deleted file mode 100644 index b73d45fdb221b4c400412327c0b95e773c107706..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5646 zcma)ghg%cf6K)D2^xjJ-h8{tY5~>IR5|AKKiZm&r(mRHps7R9*1gY{9mJ&dU(v%jZ zDS`;nMaYLD2o_MJDB@l2{Ri$oyU*^AN6I{ZfLyC+uEh> zCKms-MmA0KLWzaBo!H&-6aUG#r?9};<@jJvO5gIPd&_-7uf{KR?>^pj{Tl zpc^Baaf=eCKsbIvbWi<*hE(woFQvPP=u8vZko6G%E1ES<=EBzhx1c~cvx9WdByWjj zOaV90gyGp8fPJerZRi>X5#_syMH9IHIM!;QDniX~4#^Sx-oQML{SwaRml~!47&nXV z0dJPQIB&~i1i${XOqF#F*)iy234KMCyE3M9p;emVn++Xdax6U2k~W!LW|#QgTkD%b z{D10%^$y3kuHc~N8B&EpFXS+J%=bwLHUv^q6zu+kebft9k1WPpc+@=`#_UxXN;DrhLpSB{9Rx%YD$ae-`w#rnZ>0yrimrNS!{wgaF@`}uV zs~SF~1i(H`#nqG8l*aSw+H-q2vUH#wXnl6V#NOHe-8VY@JHrwm>_ebAf8$NnkSHD! zZ$&ku=>m>|mrm$p1<%Cv(*WwITs#8h2EKcGlu2Z{_?6_Y4UZ1Ag!g!|b!Z(y<=e32 z3oN}8Q_F{+_cMqgkd}yYJ@^2%*YvMz3WWGS`dbJum*$SPihJl^J{l8_OXCPH!{(+c zootB}^wY3V_V;>aOX8&zv`Qft=2*|wlZ#I50gl$zc<%LK!QvL}YFf{~wKO-%1k< z1`E^Wc1$LHu0lI4lulBlDd8XzAn+a^r{VRcqxFYF4mxm3Ev0wgQ8?LQL5Flq>N&}A zMGIQ`wi!>Vvq9cR_pF|?uZKp}wAXG{qs z8y>mCE0-Ll>^%(#t>J9eZn-~i{p_p|%#QKAchT(;+;?urwRh1SIfA&KLc~e%#>%eK ze!gfYn>ZJ(JYPejRdmf58YyMfH3r`XbD)IU$(;VBh2k{9T3=1NJC7$_&8o;l{j<}Q zXH?!4q7#w@d0Q^%3pxyH(}Xw}rv>|ILZ` zDJYFkS^T6VIo7QI+mzhVNgICTG6bjxTM zQvry41UNJy%iHu2=|lM=ti&v$X^b3a%KRYvhvtYJdEE>82pb+$Cb)N&~Axh~;YYQ2=*tR3;Jdc7TUdTgOvt zTz5=_zK%K>{%$_DnSV566SgU3wrhS13zo6gBoQ9@L&b$(*p5|)d#cNP`SMTN-ZBHs zl0pUC?Anm|&{GwHpF6aHm)q49f_BkgsLI1G&EyN7ikod96kWxP5!gQ_^HHGv!?hcL zsg%Wmjcz-(y!w(!Eyc_!jag+k6|U))@%UX`)mL1R;gY(3&WNG4^QU#F1N(6u`ICu zD155ESj_*7vx<-}bg?Zudx^g^<;PWCoXx&B24z!V>gP|70;A{_JHv=^V-3d`BC21k>5WD?&bL zj;$mqwu;wFj4aSm)`INT@rFh>?*r^F-r_q~=8S2w@xVSeGo11M*^`#rx-TyCGQELH zS*hvV7VQ~GBHU1{6tBg}Rzi%aoz>IlCzNh+ZK9a9YdHBlWA(qrOe@y~TT*ZpNeQWf?t$q3boK68}f2e1GUyRqaeDBda3!8YxwG zypv*kq`BIq%BE$g&yEQsO4g?4yW|lGu~JwzvX*{MRo*O|+H!N&S4hWQg&sBr4K8Oa zLsvxjD4m4Pl)pMhjJMow={*-}=2&4R{XFKuK44@j^_r&To&{HepUxtpNiU7E?Ra5B zkai0tdAgv*cX4x3-X_YO7%3;*dMbXxDF~U#njl0co?7>M)ge~zAie0!$ zZfPtXWFkHe+@@|&#DQuq0&Gt+M5jqdKS!sTa?r!ij0JQt?lL9m0Qn!QD=gp+5eUS{ zdjC-gk@+0UznTVU#xwWDQi(uDT*mcxhirQszE0L8aUJM)mWC7}Fp81=5H1#CbV3a@ zq&1cYi`=t_kPo~H74Q9vZ`|+E!txS+T{Qpw^gwAmHG+x&bi*mZxgx~eyZ4r|Z`a?$ zDNP6yd3Hb9G09BivuMyO1enSglu*DZLO-O;Sut*gs~WA9CLjQ z7v>42FRD?$Lw?+WSNywv&6^Z86(gmjO42XTBq_St zB9<3yKwL@1?n3Rt7S|g>hAK+8@}} z9YqC1F5LHL%2ebkry|gU@=Slm4k#0!Wph0nbK?9>jBF^6;_*SOfj&RIZyI(r$9U1c z44$S?KmZpDkr|{J#~X>2AZXRS;hCyTx_|ZN}-IvU@RB;_-6MS z4#@1dxgGgr;8;Q9R$E`p1Zh(P&cpTE-0!g@!6<78?1unsbaEC)=Al?stSCLB0r8q; z8mCm=51UXw1}KQ#hZ2vP=l)|+mp{&n_LWpecP|-xi6spox01>nepvdp=TiMCpFsnl zx2d}jaH+w$T!H%b9-{;wRUGo#*Q9;V^f#I-l{a5BdFmk874Uw$OCQ8JsTp+8aA%lpk zojuNI1{AC&`4f;6Mv~OV?CCc#ks<0N;RYm8VKlzR3?utq%k=5mZNkPif?K3Q2x`+c zLVmpz0lZ6KGqiG^m=~3w)RuuC-fg*)1;}2_zRxW071O!1HCT3xuAK>Y;7{~Eap&Pc z4D+EfCr|9h703iKIULlx&4YVWap8}mq)7I`7aLW1PEh8~Jjvu{jDa~V@_+|@+M4Q3 zDF(&&cOjokTF93NVYKQz#s)t9gjG(El5o}^FctlZ%h0_fNvWfDQ%pbJ< z6Cq!lj6etXF(MfkCN%j;=XGF?{+Ec~xK=7unvxbG9-`tqCrv2C-rGhc zY_~%!dbSecI?oSJZ&0dJd&kA12P~NKXrJ$V9$;>lK9=Rg*~KqB)NtjAJL>}Ei(qMr zexR`L$+0pErSeY~O@?(O_l%noL3#jT#ukINh7;=JWq;LH($arxGAo1OHcn8^G|GNt zqtLx*a9p21a=K?PFS_{)_3qbm7?i|F=s3G_CISd>KajYqCM7fiBk5=)a1SSE-_S#n z8rXsMYhVe1E7e8r1x5(?-8ae(>lR2)t_?jK0Za3Qs@&^ytWE24N_s@O`zqbte#=$$ zZn&(E1T2Aj1dRBLVv5|!#=@m3MLxX1*;wzbbCHS=OADn3M~Z(uNUr^K!hwpB_4(oD zIAvJP@lgt2n9tdu$&Mr0xkjJ5{o(rPM%^coPl`PRG z>&vgila8dY@~2YiyLZd6sqXpW05_lrdTf9++k$xMt)l1Nw-a|Ek*#cuc>#v1$+;^!R2&#aS<5M&jV|_6|7i#a*?M7z$cO&hK;MN zax&on4NewqEn4ogk}H9$^zk)G&4QE)dy6z_>a$P1LgB?lytd9gb`5_B5y{rX0{^Ru zel5&^kyuwxPil=lfnkxP+epg(IH5*ak|25Z;s13GB(2w|nOqZ{OX;h~J=cwq-4Dk& z+er-$mmtuI?)_=YPwwe);t#u0gjbXojAi{rvb(bybOJrD_S={m|VoAhoqIsG5I}+U`@}-1vh}(f>W_R3x7Elhe7$3 zu>-AhclkN-3E(Wa=-tT^2OlxAerjW*BUrF!Eafk_F=_LVZu;=^pFQgr>PMgJV7Ep( z;{iyTK4?02u)Zx^Ozjx>NDg(_;9*X$p*26~6@i%UU#J(n1vmMbQ-GuGX-ELusItru zGv3m#w2)!p(J!W)pS?qxTd1S_3p|sc*H3l1b}2I37PgN~YvE}8eF_!_!`?d1>+)9s zE49Z*KUbH?<4rjJleho$#VGA>mF-zXc=pZ zFt#evNHxCQFwnQhT{J0ip3>UCB=%H@7c#W_cD7g#*3pR=dfQ6&l?gmfXSEbaG+QGb zAU{{$tPMaO2>K4pt$A-)xxR6V1E_XMB9@zb@{;0{Mh5to|sNaju~lf zDVPfWU{yN^ZWQ@jw2f`&5gNlgjOzC6dpXP7hs6$oOey^CzTNcqSS~EQgU?C0VCXHQ zlah-!lIt#5Z4mm>o03QiI3Jf2#gp-cB`$Ms$M^h#=DBn$iCNNeFiT*HFrye5@Jg|S z!_X=&wpC6i+g(3f$U|c}7#5h~Po0Ce`Q%0+dQ9RvTjfN+-Pci|x91(I|5XJOKgJ_E zM7`UIy#!gpZHOwd)>=IS$d<_;vTLgLu#ZT0vG;xDaW#vJwHVlC4K^kGRSq?uonn}O zY!zGL+jL;EFTZR5>;yk6(Z#Ot%S&`w`WCnU9?{DhHWY_PWAsIM)oUAY3BhC_YIac_G&+fFjwq# zNL3<`)AEPAwfYV9k8;o%UpxCRZQ6rL?C;)j6AeY$qH9e4-cn<2h>|58n)~7^>6Z?Z z;a6O(tbq(tJiK178s>D-#IMyXwf7A&gPXAg&s7U57O;UGia1#weAmC$Rk_@j(^7c) z*rBNmI)Pn^6kWFlVXpT7>$%zQlh>XGh<;vw9$QSwf}F1l7BC9d+&n|#)%d;pO)03c zhk(wIkU#E%ihr;xaUGgG^9D8l=qACadu^$EMojVRf-;@;k3eG1Zj9L;%ZZ1XgKr#c zpvGJQ=tILb1!6Ja66f_@NJsDT;_c|50e|bAv+jM?-X0#HJh|AdH zJW%ymead?w<6X{V#U10`gbTY=tI9N2q`zK>#oy!_kLv800=w0@Nv6sb3iEyBQW%~7`zHA;Aq9;Wq8p;qV4{PGnZYt+TN7jq<3k4 z0kP-CiYdDPrHzs*s^Cixia5#IA^bb~ErDhX1aRL^cy;mko^ywgm*yscwUZJI+40j4 zja?CsIzgc#qF*CXdVn0T1YffVtQ`XjZoR6}q|^!_b50 qL|zNxSs(CRojaSf&(H~tUpbwTq0 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-config.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-config.png deleted file mode 100644 index 17e3b8684f4a9be4cc7bedb5989c682eb22fd84f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4840 zcma)AdpuKr_&?hixeu|qthG(GB=-^)`5tU?`5L9%m6BW5g;$we#BZd|vP8{anuT`Rq9-`Cms{St&Is003mE6p#i0 zuyp9!CW(Yr#_xT44E>0mvZA_5LZ4Vke-@;#qf-u^0sv{H)e8pX=A!{X@gf!6;~JSi z-XBwbWM7wiD=qyCIyC9Eqjt)gjqKL3AWuW$g-XZ(II_0~%{f$1PuSlqKOGG2$O zmV=@OlSfq+I6M@Zeb-y;EdQgo9W6XX_-*mu=7*WQuW0tWxr4q@cg8b$b&wn`URC`r z!j9$zA?nn^n0P8dAAe`eCiZh3F|~#DqH-+Y$3Gk+BEg`(ab5Yb+5(QNDkN`z>cORS zQX&9kiv@GuFRuFCemh#+D#w3+B#OI>AgaBV#`$^}?CfQ6?`@|N4Do^e(&a(5Ssd35 z1kRgJ0?ttn5_L`=ANcEFb6h5GD~3IL5O2HVy)E??2gNjF_89*a({}WO)LZ+;QSZc- zgSs3tdG6zse$)e5i}rsxt@~rZ-#4b^>}XGdE(>jZCtJ<7P}i63!gIqK<2bJOplXY2 z^u;a_OOMys3@@tuaOB)_3kF{X`Arf_qm6BbM|SLhZeIZSGVt&akveBR+`2!)fg{$f z${zA~XG~QD%Bb^c7tfyLw$$CdPR=00HY=^P>@KZYXL7S3G-EL=a2DA5A*Taj|35TQ zT*p5Y8mZA?nf-{^gY-S9ZMK=ZzHfbG*23mFD*sg9Tl3OM^Tg}h3#39+$sofb1#6jm zo`a}XeoKmGJu5(wEz^AnnsHQX?OnJM!0ix-e|;Jjx3_O7a2qL@ODsrhlp`p9lx^|3 z#PW38FJ~?7%_DsV#K0GG+I8PX}wJ1?JiHsJI>>^^(a)Z`0<~%gWS7IwLgyCEv7kT zMMwpYUtKAHz(aFsp_&*nqdTz^e)4p}${Uu^y$iF7-l5|x$kFypmGm1<-Zs3PF4E+r ztGZko*7B=WpvAY)*vw32bwBm1}|}3(!S$EqLXfU+5~J+_rUxK@@sz=t#JOO zz5q1)qb9hl6wdA0J``5b?W9%k*z|tFN=eC`3!e)DR3j{B0a~A(6vfTrKO27&q`%*i ztvs%#g2(vQ_i?3K|*&zz|LYj6KmqMH@+d~Cy|?~>pX$g*tHLQRUWT$3?WoFo*y>_AXLwMjTL z$AvKrd)VK1>B~lgDtt6h8mc8e91ip8Vnr?n9YC&`K0nuZd>l0mU!_|DN_?9Yi~g_r-N7ln^z?8?+Y zIr*fHO#ijsTr6?bHW2kr)u}g;+;n($yfVYGLOdnO$5<_kh#W3y~|ckF=Tcz z$%mejXmaru*MkbA>;tMR2|sd$TScBCB>}l*(sp$0<43FtNf*m(xjM@hp6m>W$lqi7 z%tY<&ak!6LTR&80uPr2;JWLm^T`Ym2^`Lg;zw^z1F>Il0edjD1>YgWYX$xKJiz{m# z1IA_Z<(DN!#l<@YvV$WYp81{RK=WBPn|4weDnEg*Hl)iiQr*I${zHYtV@#l5#W20B>|q+$PKKER*c0%e(ay8Bwg`*U3J zBC9Nw^gO0p+x(I#YGH%uDeu@fO|#4HbT6m^Zg$H?4?LJY$ylr06KYl4qa{nFwLWxx zxd7E2qYK|@Ex$4RdJ7}+nPuDwG6_#(+sO#`MRw4BO{K1GnJjdA03*y+ek06hb+^!x zVa(Z+2S}Z90x#&e^4e;Q^SOkzd|kf{>X6{;$YBZI0C0Uvwv9Y4yrP={#O{g)_Km-X zm@2cDa}=E5@fzgwx5CXwkvRh?Sn#V|8|)`$%5gbz{}X-uR`)iD{Ua^FTK?KC3~GH@ zON?J=;29ALYUVwz4=*vKi;~iNT^CWp?*c!=y%&estcxzumcVb-g@i8~i76~8mwznZ zAOaBlG%Wa-brWYSCMMb?YWT8|hp_>zZ))MrAU-4NZRGLodiZDFIo9SIZ< zNO#wP!S2g0#F}MZ~fB%|IDfa7Nv1OTtk)2 zGLk10eJC@=0nj)jU49u0<|d(>`L8w7-5B+hNm=&dGuF*}L2{CUUxMF)yoAr`Du=-C zy)_bIA~n&ODc38D?W~(;WF#A8-oqPIeX_2fHN<~ikKmZwFGdcyoP*$p!ESY=|C>49 zhL;E^J{3Q(TN=`h=vt%EtTW&C4Pa1-hB%KH?0vaN`KoP^DuMbo;58Xx?GC^Kb~f*{ z7x>kXP^5?SKYj+_!%M8?@v@ItTh7CB2Eqkr1e(i>pYagazA33Td#g!#w6ji``*=D-k{SX%;jR`Oq6vi z%T^$OpJnfN#i=9E;ON?**|1tseMDzt9&-i%aFqT^bdZ;bMj0QnteZBW>sM)*s2or; zyKJOOD7uYFp9q0h!YgqPef;@vPw=8JsMIHn)06rlL%}It{bD6c(>6B))ghD-`r9LR zavX!lks8TiyIoh%sMHpQ{Tmz6$E}=U9 zm7$b#;ashL#UnnxD?&e>4jQHNj4|8%i$~ySGrTC1$L6m$T|5fj#UVO%)hQdeG5S;6 zMia{RCpz+aF{t+EjM=U`0$>3>S}?9nRehf=@sbw}t+z2|`;6$iqgam(hzVT(;W1#Q zsppNRpa~u?We&^NFuM%33eW1BWWMaO^yp&SY2?^0Q4>>MZ~l3k>accj$IT z=4}LX9^m4C9ksAtR%&fSRiLA52I*xh>zUp_k=Wm`N4s(`EptAl#dYh$SPLqsAZ<%8g>hWU89C$6tV=Y;YTdx zR>ny@`tEY#u(Sp>_$U8Mjv;p4Ipq31P&BnuZ$jkmmVIYhr89Ww%B}P5;S3(*W1GfJC!3(Co`-h0>fghdcxl4Ehs!U=EDktG^cU zU5Ix4510EPOJ2mEFm?2Bw52};7i3u7sjCD}5iWw7j)Y;zpnuhXzI6(qd(7fEv+k}w+^ls1_wj;47q%!-n}s3Y)md8pAOTZ(E|jX0!m zQOWb>QxBkj&p=OarDTsZx#Hxxfedod3M3~R|CvUhJPljqB*V(&hp}J2;;NA;T8+RmF`Bjepc*t2+3dEjtE!v` zy@>rU%pA_1`OFsj$4W(-L`zb?J|0k9IoZSMxz=o<%*ot9=2Q=#~k)W%O7S2=>ghq{pb_A9(jG`pkc=i%|Y#PwhPX|W)EuJ#5ZG{f?=O6_g@ z@6SCsvGV}O?kK3@vpMx)J;&9AV6akG^Qh5|wmwDpeoWJ0$39MwA6V->0J~z;+aVRH ztwe=h6}Uw9Wwd_~H%CLY|I|WYpB~VrcA}vN%2y0>ZrC;A>#{ej{I1p!Ds4RIlF+vA z-43c^w-P%%@~Ia!$ZHh!K>a{}?{O-pmKFqJ#eM{z;1a2)7PJSsQ+=LeOrMbOBqH_u zB2bmQuzBUi*mm=obYAk3gD+tkg+Akzz@6Sm_4@$UEof*aIQLjD1Zh*H?h&Q}2aEMy z^a2eJ^Fq^!sblt{-Gc=Eo?Q5E*|!yUCcQb`LOYQzbA_;5Ew5)z(7U}UkV=c$kJx}L z#P84u8(UP*B8DH95d9M9*l$vM1ye;lwI9sOAUd>O6G%|GGd&|QltQ3UvLWO29v`I< z+Z}efyw`#gg4+TV@BTO2x(n6mPnk>5bND12dZWU&DuT`p+FdQ48?^!!0k7SxS=u0G p?qJ#(xiQ3)$|3&$zPzGki&4Xoy9|wUDbTAbfNJdsR$BR<`(Mf4kpKVy diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-content.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-content.png deleted file mode 100644 index d4aabec221028f1de3823bb7b5dccac102881230..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2146 zcmeHJZBP@}8s1&@!Xj6*n^cKNVNF6%OC>XSt0EsOE`}8dNUfKTN`u7@ZW*BssC;Ha zgDg@TNfbnBO4WKhU=+}T#HazPWs8EvTSOGEK=^2>+!74+qqKKv|8=I*zxT&|XWn_= z=Q-!hdCz;EnR7~G74rG>JmvuaFrSJb;{X6W%()-p%rTFfN7}dmtHP))2xs|7D#Kyd z%!mXP0JsU}90ZP63jqLuDRTXm{nd{LLYW=AUcNE4>w>iGq+27iNoy)9cHW$RBmzHy zN8tU-4>E^dTePUCL8htsyw7z-f5KC>plFi}T(4bqvRH~mFI+f(`>M&E*>Asl$}eTC ztLooZ#;%SPbdNceEO#Casb1W*ud6CW3UYP)kv&({I)Is>D1DON@*4Z?jik{h+x4B4 zQDKi7eihi3m!Wqty!qAWkonB;K58=Ny*+mgNWJuYr_|HrKNPvf7;SGIQ21H{Ez8;0 z)6|2>{Zse0DOOm=ldEi%Y3hdL?*3M6jJ070FZyGU&pg7}p%w-^7j12x$wHlrYv!KC&ISAjd0k^#fLaz`+;`Pa*HU-B;lgk7sK`z5k z9K+_p@KbMWkc8n&6^yKk2K;?RQ6k*xV305Q=%Zz#wyhA9E*5!G1U<|kcYSc{OYZt0 zAvWj%K~dRqQu_{qWb#FAzqlfqaiTCj2>yeFLGUXwbp(d{ikY*=Xy7ux{3st)dXuTe z9OsTDEC#_Dirh*Pbb+A!D2gf_ESpBMSAti8|rGUg-1BIFMhN z7=4Vir9Zc$X7Z3cVStaWc^G5JH#?a1A4S`Hd&Qq&=&{jGDx|{p?8dr{sW)!`?R9ETqB4?h*BDe72&`U1o<5l2j0mA&T44c$!U{|)dNAq zW|ISmcLGz$A0;`_6PPTJOLq->6RqFF+RX(k+51U4y4)2x6=<++*C!?NG@D%!@#VE_ zx50AFfeOoMnOQ|$t+bV=huLeJR7%f(Ci0Yxa>Ij%xnBV1BsnYCw;G@QSnJvQjYJ)3 zpOEl;o`v6E`+XSkd}=qWoeDDE%D6du)`2Rz#C|oO?vv*Du~$qbneRc+#l0K!{u@cN z7`MjdFJ{xtQgv&_y63hH4B3L*mZi#We0KwLzQWhdxGgS7>+-ll*ChdaPvmr zoB*S^wLOokOaU<64(U8|A+ru-8fum>B|K?nez?>5)o?52nH6|yiG2$ zL-dnjw%6$qVcb1;zo)%*7rg+Np?9tbe%09$!%rdXEmMj0gP)Js^7WmZa)S2ZvzPR? zX_MS~bFyrIR{P5l>Z>PgP8|O0N@S~3p zs!8=3|8T>DmvlY}O?CGk1UvoFv-&5z>}xeR!~XE<+dHD?eiHx{t{~5aDU1FK1PSv$ diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-reports.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-admin-reports.png deleted file mode 100644 index 4d3bae6b036e0e07f569549dc054919e7852a713..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2104 zcmdUw{ZCV86vuBXofU$-IiRA#;C7u_fuRFxl@`a_l~)xZ@=`!5qC-R~0;NdBFvJ0s zTX`E52@EIdKqylfP+(!eos_O(0w@-O7upShQE{{aWtU`s!ICB8BqvYKIXSKUz}>=+^IaY z^gi1`ygIm4x!g`uD%#A-p56h6$*p8056p-ird_sxSN0+E@S!{C{sti!)fNftXOegwXi_pCMEWYf_RUvv|X2-UP&#+EHFQZxMtQ1DH^+w{%FSsB= z(%R$7nH6WZL42Bj)PN>;aZEY);U~c0M^Lc`x%XnfyAD zk9tb(J1}+_QqZ`0bwr|LF}>-rAbx8%3#NNJe2yLYo?0$9NXQcuu%fX8`%S&TWa_B{ z={2Qg*?iyx?T^l;jG$03eN{!iXJZ3YD0dP8@6rvW$p43*CKv8C!;wI>1f&QfXlbSX zY4*q{*cq4{^QV1R_CA`;MgQb17=y(vt<*$Ugyuq$a&-QBD$YE<&N?P@4^j>;O~?1z zLG=(uO{%76B9c!CJI$Q)QH#M)BSoxzAtjxP%+^@oO3s|aX_@dmWt7y>KkydRy2G!$ z9PrdW7~fQZW|ZotvSvR`cb(hh$A)lPHhcmTymbh2bK`D_CY5ZvCBuO5Z83AqBNKX* z%bVZnxi zBc_~=AtA&fb@Z5P0%3}m!zB_Y^MbU1F8%HIM-LKpYohZ;?Kp;1vpkTw>tRENMp1Ec z!fQN!j>E}_-a2eYTAM6;w{ljP{vrf7Yj_54hUMrzmEmYpkPL%+ln5e7N2N&px6irwZ_n+?v-j-G+N;g%wcc4X304*+T*ritfj}TGEXEKA z0)bP3TkZ%aKv}MzeG5F;1N5<1jsU-iBd+m4|0oe-7XShsKl%3tgPvxc0fA1Du!fhe zgk&vGgjeC+LOa)2yOMeI5l6S|kI3Z7+_6IQB#jdM&Rwk;87sMP!@Ine<0aF~UMmRY zQc8Qttea${q>ySbSNZR=eO=+|F@pPW$~Q)wyvD6!^Qw)3u zSBm$d4{Icud<#2>h7~$Y#fzS4S+Hk(HIEFz;#57r!tr8!LnFqlv?ZF1q3#eh8Y+T%YgRZ@%397-3uLnyCoN;^8$>y;4Sx~B;uK!sR%0jws<7q) zCJalh3s9=c+0G_U)PlE1gm#hGv2JCGYRBqQW{C;Kg|L{8JW7eAgeOdOspCtd_q`S} zkjc%TX>n`$q?PuPwAU%=$dPHCj@98f{GpZE9Mbb{_K|<2$Z@($V{F>>_YSawn5U3& z%wE5CiO;jLb8>|$S}2N2ta9{qqqrkA!n2`|&(mWtxXdNvhH}*%8AKx)wxsH;P-xtH zABNZu z8A;XxC&w?KFgR}OuvceM@$7)WV@YDjWw(pOD}hIT_`!JGrpGLYw9cX^zcrxoN_M>P zJdSII&{WYmkhPSFA@nvlyg;QnzCtcIPflb$_i3>?NXv%#fvW$<<*IM9(Vi-Cu49_!KO2ZK;GKo$3|KYEQ zEtGptsb##KM|34aw7!}Z(kLc~?ptiHWl@I5$CKI(uz)XJssrE~3{hDwV0?dq11SQp zwf~N`GFs-*I|jkoA~3a}4is(^hK&7n#4tnqu8FvfT|&D7kRY_a({uH|BvWfdTN(Le7gbld63F%1J7bY7!wUoE8zWUK1~|4 z>$WGI_2f*ECU<5RUOT}w#R}=nKD@Vg4{Ie zoApM&(2g`#(o1bt!vA-F#Awh3#s9?I7w!r0aqn#XNM2f3Tl); z&%sj3Uo8`+-l*fFtnKTO*tT!0e*^sL9CK6}JBaK*OZIRgMY5k(Pb+w~tu;;B2^!JV z&_;R|9k7QaZG)|9)gZp*f0L^*A1RcHL}?2YndylA+Af@>Rm!}@oSmFsloP;;>WbF|TxgSfoK+sgbn*mu#HrVrN>_|0 z1iEEglNl)I3u_3X7?FFeZS)0A1QFWHnFG#ROAI?#C1T4jXlm-LL)0QF6D5f{#0ynY zN&w41FvJ4tcq|K}S)HoVa+I~pPzS&{jV39`^$_B^{T8`HQOWzz{t`g^fo;1aZgv*d{?` zQU`Iac65j9Rz6nNecFeUNe0oCkjl>EGq@TEGcPo3QC6!Um;U2kV{&_=RBb)u-2F_iS_|9U&PF zQ|yysaDCh|EWbIf!^SSsf2_Y(m$t<#mkh}AK47y1lZD^~T-vd!%3^Q6iU)mWV~NoX zYGO?g`&wx~g>cvjl6Fq_)AUd19cAdY(rmUUwQ&{1dNd$j{fqxv)FfI{;hd+6wwT5_ zlwq)F^krYz8b^0b4Ar=kjb%0okf><^Nt!hq!(RWjs}gqZ)s~hHSZ6!cvQ~Md4^%ksVE|TIDDdK!=6<0g7a^_~D52z$2lw#eKPej$1NijI7Q=O&&FXODJpYUcyAnErM`A@y6uHy5VR`FCAU?0 z(rj;QxHRW8Ywntfi1FS%lwBmZrRL_0;dEQ6V~}Y~Zqxbql*NR@3aRstRX*R-Dp+3T zhv&sTV6)FRs9~6P>+S!u0zS|J7KqCru@u-q`}jQQvj)1Z9)Uu0*Bb*%&Q&1K{Vain zqTwt+a#WrK<|_OZ9rC;C?^1Tz5c=mwc6+=>d9b*%u>Y|p)d|R#bALRo(`JbT933+7;@;dQ02RmIs`xy0^XR^1N0+qdb~i(-+ZQC$b-TrTCC7 zxV-HwAx1~`ke#mn_R@l>bA6-mkc0;$GvQFQgekzvt|b-f1VbyN4#LkA_`IWcJ$!Xy z`{=r`6Ff+HmTkExRBXMavh*NhKnq@dV*4V{p_4g9uKI@4M&2;aO{+Je7GW$3Dw8(e z#y9n=aZ%gYBVG==BGEb*#57=B3{u1XS>hhY?!9Lk?jISY*ICR4!PZ-RN_1^qa;wK4 z|BRDv{A4~H!x&odN>j39A2-}HX1Yc~ZLO}i^Pw`gMb+`EMdkK?w>GeX9ZDLy&JLV1^4ohN<0!Hzhak4hOF4u%m?an_%#SLAI>_Aaaok0>sd zg^i`ZkFNQ3ZK7mDaiZzfoNxTT&oG`rNEeym39Bxy*?L6isc9?L#cB1t4>v5Ea=HKTt?MLJ zByz6Y$}*5yG&b5&tgZufa*tuSrlR=T)?JGZ&(u7;WFgT?vRi0?Y$|ngbZp5R;B{|H zsycM?v<CkH7J+^f$!>Nw3 zX%|s+FUU8bM4K*6C|NNF-%)@go@x${uzCYS>v+;J)46)7O`ztMk=m84r4glA~)^-=2n2vA& zIL`uLUu5=}GhU&3)sm^})|Y0@bOc&+kDcK{@L-0PuuyuCd08P)VLAFD2N15_l=Z4es-C>x5)ep9x5YGg7Hl-Cpo8OK|MJ<9bjeZsJv;FJWT58~=xSaj z&&9LhApwA{U4UB+0JhxrfI}GRu#rM=wK$;Jb$KWRz~!zTxO-n(pZm{)qfZ_JGgk{3 zpZ+=z(kV*-b`{)4(D^r0&Qa9|oE~LnkZ%X`pbHOcEdiCZ+Ur0&l%X5sNht&1n@DfiaC^HMeKU)A(>-+N{n{6M!%@2F~e}tDTzpoOF8`aRw$wb0pSIfF1 zV2k6LG4#n>?&u)kgNL7ZEsiq81M1a4*G=LuE9bg7vqs#2At3@Ds6nn910+&2)tfVh7C)t5+cdH}O}QNfj}U;@R+hey?cP6L8V`akvF zWJL-mGK&uay(#0z#?QbdidR#&Hb0g}O8pJt`Mzx0kjmI(U*J4UZhjI3)=)s9adRfn z`JuvZkyi49It=xEgWp|KtZ)4fV0k|-fJF<-RtRY~pi3x>P23W^V@uAyB|P;W?6X97 zqwN5YpEC^67!_5zylAxckq8Ntq0-zy#k*sN$v>sh?=;pF2E^Tg3istaPgew=EgY`D zuNm*(MEKp7a-tS&t7fZZ(EMO~(ycfEy5x3uUp7Xekt9esN&MivJX{s|WSdLcp!P@Z zA~U#i2yv1&^dOvTv`0n^(HbQPV1*j4z5etHg=rPs;l1&=V@t7dQk8gmX302|gbn1D z^nzD?%uBwK^eSPBBC*&PQ?ED-V_fLix>!PH>lJ&Q_;S)PLQHbeJEq>s+TA9{CuK5T zVnL|U?@`AqS?-TUTLGiB93cR-CaNV?ldlKrNiKvlvfkJiVJvU{_F2T6)XR^xJl@WM zHT4%4254#@1-3^yuvbioWhp)M{#IOvuT^{5r{SSGmG4S74sTV`vsxFa*LkNt-DHZ5 z45_)TTTiQ(+#HTuAlNGHg0}dkrk*c)(CnR?=3_dxNN0i^@mw~d0kS==hQ1Ew%y)si zS&PlRj~x8;%vr`EFE$MWjNGOGQT1*X;i z1vYMOK|`_Ts(BC?L|*!!Y2oVinV~M5&k5CmkxXSadzsY|!FOIM3quzfX&t_0_Mhry zKcb8DDv_UfXD1k?>wzY1Daa{~%~Fb!=bCb+IL7 ztMc9VKhPuS?T8%9y$Py1NP(~uQ_^I?scX=1J?f0`lE&;xi3j&gdotxS;|J~da=V6V zb*z8%-fUp_Rmx2ic$>ey={<0Qr9FGiuUNoLHc`p(^1krTux>u?%6Ge6nKj(A@hrZD zeS<1q;BfBbsPFAu_uq1y{h(IUeQs(BWD4YH8Ooc!!_xdr5U@(&u_$m*4n?_j4p{0* z%aHu`QvE}kss4R#k&@Vv9t(yaEvnwcDo56?|M%AK2M`jQIz%ro%f0z&_1)Hc9wyzZ ztLsxNUYe22?mpLK`)1plTy<(qy9i<B6Am${OK5zW4pT|AYI7dmeLU&gXUBpYvJH`}6+1pC{q0wK-<5KL2Y{T=vk4Fr-*hO^zv#_ZI3Y+{P?4EjzpI`GZLoERitM$YSk6e=-ob+xD9IL46 zv#)IUP@QPg;JCkmDxxZfC7BwT;Kby45=%@-!gufVx~3{z;mYW#1RQ&L{mu2kh}F+C zn-}IU{6@B|g{?hX(_cG%J{)w536T`yj^CvXs^*yQ}o%(XHbLaQgd{9=T~qF z+RrjlD7S3o2@~0=Y;SY~qzwNGO=T9{L0(df_HgnUNA?#kzfWbx=AZg)-MG5Z$!xl% z>3UI9txt`k3@;$ zeGwt+7N!go2b7tjQ?E_KC3T=s9RH_lc82vq17W;LZ<;ybYA#wW5qpf3!jqhUm7VHE zQEy!iax&GGCDJoh!z`|bN7CrX;BO^XwP5C#S}p=;M2spCZ)VEl$lG0X<050hQJuiE zG=3Fxt<>KGsKzAhvA|YyxV8b?u{S8?pIx*uJN;{@MELsl$Vrc?wk z^;QEE!IDLB9et(QN@Jwne^~I4meaV1^r7rNvIMQ_$NWWhdSklQ3;EQ#wj)G{o{v;Z z!OBwnS{Un>W*SCZ!k1;sPoWX2jESE2&Kh@jAJt!N;Cg{?)rwtPy9@PIDKckY$J45+ zABfO{ZhB;D+B8yoU&p(u5_=x=sxT)r{ey}W>)m`s1u^goGr%rzkT#%Dwdx*PCv7+BY3bq z8u4v3@Qz}+<7KFoF+rJeyo7G_(QirDM3iNef+?TfW^6qGC#$Px6}=8!B)6EJi0m#f zZbvH%WiiwAf#&<``0y+3(Y?ioC_qE1=1bq@FZkt&wnX5+lK z>x_6eCB0tc>(Ggno&l!r3kAx_T#TAx^o-$fBtoZt>Peb{--|DqJDnS|RVj%IUQ~lq zQKFuXh6+diQKjrXDifZ%?*5kPENGD)d*jZ!`%&*LhUR816Jf1hhA|MwKLArQBoh== z-s(&ZTQVA)f`WKFzI0yd<6^NyIUfHX>+rk<3iH zigb*LXco;V(vODl;`$Qu9x+$`@-RcE-Wo&|C9K}Y9_3kp(qqR+nk+XK(k$@k(UZiR z3MvErt%>U%dS)tR$I^Hrc#AOBD0h?i1FUiuQo)Pci1L@+X8bwih*9&5(NUmetc-MO z$CZYNNK-7SjIz||9&_#3@*$j)%zg^n9gqEF90lZhSMgnB{TwByYkkp$ZgejE{`k0w zGj}t6=q^4Y9G@gPuLsFiC1ool#DT}@XxQ`C&fP~BCYmcyJ)E)i>R+K^vJl^(^47jf z|`}Uszz-Sh&OF>pD};EWu^_&ce;y4%r#X%>b0w@Uzf$DN|S874>;bDEw z7!(A_xi*RH>^Ok|fJ9Zzrju1!(c`CTK7SLl>rSH!1)LF&OWT9Og>~YG7+sOqwR_E$ zC0KP9kExQcX&gJqie{+fz@zLcKPIP9WZ63&1f_r}z~=H|q&Z?|PZZ|-+n4kE`%rQ! z4o|_S^xI%Js%<+6YJlb!J+Bn|64I|N^K!g7Lma8&;2QE0s!?b#9gkx$Kj{msYq-{M zq(o2Rnt4X$iDc_t<7;Yx(z7`+{#YLIjKbq0TEdiH;d^IoS@tX=t;<53KV08%3A*sm zdS8fw0^kLfk&>GbXCC^*C9r%6?AobXA)TAFvf<+5xH}vKC+eqxo#I#8EJPjXj2 zF1v9cuCU1N-M>pL<}HDiTo1=|179E?)6c-NwQ&qhUxDk znjL*D@YVvpPgQqadm`Qy%A5|mB2=^AZU1a?T?xx*V^RdJ_>OFo6Xu8Gs1AM9CycXJ z-wdt1jCu-BL`z|9pbzIZ^o|%^ASHFi5Th$_BE;g18)e|Jyh}#&!?=!<_;n%9FZ}QC z&RYzc)fGQlYIOv!oR?s@2RbH9YF+H5w=^Q2N7*!<8)r^P*9tfAicHq(M{Ms8H?@qZ z(Hu!nK2`BqV~nKW7pM^^7Puw0Ggu9IfMwRY=f;xdt=>_Oz^#37)ta4MG?v`nxeTc= zeGtY0(ukTQ?AsIY6HEw2K1a9RqTOD&awko)YYJZH5#uJRg9*0J{TUb&w)}vcOGopq zA#&)a*D=S<@+fN|kR8-SFTUREka&z!!jf(I`-CthBSV548Qit}oKXbOUic8whuZfu_aAgHM|)+!Q!&(j7usgYesG6dh?Ww=Kk(Z% z?nbhZ|1EvP{YR4iUrG8uQrCMsmAp3~nHp0H_!Jq}zmkXRz6pg5cRRd2N>ZRC^(SKA zD#1}?#lwt7*Meub-0)oyP~U@+qimJW`Jdap)IIx2k&^V7fqh#FFJ;@3EU02-MR>OM z2C8;=Bk!Pu)!vm>F2b)4^t4?=7$UdP&3x;+fw;xKm7O2bjlWfWP)BjOz&BFf6@MYl zF^GrVvS)Yzr+{2DLwjb}-1UTGrvqXFsOF7Ee4-d$Za-NotP@*bxGYC~nr6|!11DG} z_k0PFOdPlb-UeU&9XuE+r6Z<;UBApZG`I1)BDx8A-7MbI#_AFYM-FZRJdiVpk#k+= ze+cIDw%w#<%1!;S;JoGve`pSQ|2jl=(L8e}@ZAdt4NmMcEX{5x-{8smN9*&K3z&S0 z)+il zt;6_Wa6oejXE77Ny3+~vW^YZ34~V|j~dzD zpuYa(B3vHLPR^yq1jQhAvZ6}yDm|9uChg737A_ae@^sx`^TuB#Dibqw3AZKBIW=~H z_wbEpSxL9cmzSn!Kd$QK(EdI*eAokNU`~|W@udmd%~t-~vmak`;giDXAHXx^0??l& z@u%!AAp4bF!YY$7%+r1JZlHsKrQQwVSVB*W z*cmy%53*O|MF z?FY+t!&Z9=9@;P_2Gc^62J8p*_MJ~R+IF6k2rqbcfF+Y{;H~KOJut-QPW_#L<<;az zF@JiOHI^Y``1CVhTu-QOI_)Mk{FEzXDYF8;H?wrQCiu_C)&*kDYV~btzE4>%t|wNY zDH3n&7+j&#BP+tSmOjNLJ&Nw^lB6Ag3EN z-N%B}AOGQess&ZFed7p`B($M(a>I`utk@8fymM<=Ds8XmR$p-+vHevL+jCVhdNb@o zA2-Y_apv5D=%!_4Cuu0YR39T!m%i8FcLv}UtSlLLYIXdA_py!g6Ph)1qw4P5=rYxi#`^RJCXF!d& z8rz$C0*13f5xgsu3@6fo+CVq(1{ux%I)9O03SRm8$+1IExOa70)obFG1MX-Jn=dym z)LA$_@|6l#U$kmDcsrgP21axml315ItLGbby=azyvg!JW9Tm9iX~@<*GBgylS>A!?leYX5>jUJOYjT~ktk{* z5TstHUa(hRm3WgGZF=d>x2NwBw?7=zvZ|%mM+GjguE@0{azw~?yTB##%-nGDcd+L1 zP8pK|^R^F~!^7VCk(Y-V_)6yzs1#qq)$3A=E}#CfdgTv=EoMH@`~ye+waQaXIGIq% zk|ImC8W+Wp73;tuH+8SrXRsrvygtYDQd_-)mCJ(BKIJY`VBP@HboC8V{ng5JiOLgj z=&IDZ1V<+5qkpdtU1RcPZn_fV`F(??jj*V^$f9GM1;&K>vn+T|?Tir#ejI>EDeQe< z|0mHaVu<@a?eZ9DD7Q>^E>vw+d>AHe-VfsI`xblQuKK}oSx;9b* zI_IqDxG1c{84>|g0M|Z}ggqL2|3CC8ZjL_iA_TetJC^KIxas@I5tuPwcys!8mCAAu z-hmzj${^pH!sHoW1lYPp&=4?Xp{VR%o1Z?RqI8HRfF)hSEdEgb1nz{r4e(5XNP74l zS;H$0=f!Vlp_(FNu{m!}&hCp5Da2#h@4{6*BlGtJL*0{=3jVqy-N&A@vqCvl45Jx4 z)NI=TU#R)8JPcP_^qcIcWi?1O)9Y>U?B$tv zpeT3-2;0|zFPcYjH1+*T#IrObF50vr&C{Yo{BXDu2~~=@WLRpbq$NdLLU8OrtzMw8 z*Y~vu=DUK1m~DqNYlkDqYULCADCr9S2VYIz9f9@4!yXhP*J=38BZ6XTZBl*8HTJ&% D-z%MN diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-themes-page.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-system-themes-page.png deleted file mode 100644 index 99f1f10b8a512bf75942c19b8bb0f0f4a9f1ec07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6064 zcma)Ai93{S)E~x@r7SIj7-T5B#Hca$^+{3FAiJ{5mbJ;)>J_CL9$Soft3kGiEFmUD z_Lqo^n9vAekbV0eecvDO%{9+8*L}`?&V7Er=f2N<<~+P&ZgQAggc}Bf9R^GdaWEK5 zBJ?O6;(#Rc)jyk{AGRQU0DlPj5D&S=Lu0N0Q=1?djOXaV!vf395`w`HIKWU3eY{*by;g~0mtv5HvkrH$oKTV?u|&ZyJr>SG6)5Gw^5Hz! zLnp6e*IDb>A6tWXxF)R8qpbC|Ac&8jp22~xP{*}7z+R(}2Ln$0@}6n2bIU!@FT?|!Q&f%->qS`m<=e}5dAX5yL+`zq_Z22x)92HxAHOmz%WH^8sDpxVFHFlE7U(XDQ; zp9=R;Ui@{5J@OInmIAV-6>S8$y7L3;xA*0Sz_oAA9WfndZf92G2_V-WVF7|A$#NM zHPT4RfUXh`G7hEwm4gaz**D@(Vy8OBT3-P%o?86|p?$Gf)n0G`lZ;yR5~Dj#@Z1qw zKDmQ)0JqA~0enlbb>>TEAq5hRhW?F}(Va0*UUA~ik-@S3bYnh4aQ2rarBl7Haehdh zCpzMRqXXbw;6-(4LCn-nU!V^fym^bN?8&4)Z$V7wO(C6szOb?dZCwx3LnjgfzXY=Q z?JFH_QSPI;h4iO4IfBBYtyFI6r#^TRrLcr!RDZ{R`Eu_zhr=DfTa|3ma3`;p(sTWA zO~ytOEpODKR`d)|QYnWfl?Mu!*^ih0GoTmwaLm4lH62DX=A-1IVOA_Xd=PNAO74K8 zOO3fPeIlJNBBSji!;*E{?I`A$ci4y-GCzzGPH+i}24o*<6%*Kc0SfBEic# z=&;I-0c!yCZe?605yRghF3t)rHWfC?Qs&hi#kKg~iZOYaMZaQ9`#tkuLxTI{FxoOP zW`7auyzchF6Flb2JyRPV{MOeF$&Ti1xJLKDvisBwSet{aC5E+^1RZ>6X(ln{AuO-we>4v-Du@=VF$dz9i99TTvWABiV9_a0CME9OZ@THYg7=0_Y^jKD%?I5$w z_aHvwxNIo!iFXWpcTJhOf`EmSmRF<;)Z|$kQ4PaYio0s0>?j51B9_xW$QzgIgTiShrAQ`kVE? zhD1I{EzRVr+v1_3*^;LUj-g3+HAvZf2%%0N`eos^QvjL-f^~#HS+)U}=2BE-05R7U zPpg&acXq42+>hrm&YNJXOo5aYTcjQlqND?ICl3!p2u<2ZlPquv->{i9>|He6{e;k5 zzMM!t<-}WpS|j1lZveyN`fRC(bL{HU9clGpS0ALW7gDQj?Lw=xo6L-;AYdy)HrdWJ z>5Wp|*@!a0j5~s9pBa5)3>KB_n_*uZbZhI(z`ZV4`o#kVap{b{3K^zEbMG`|Hcp|S z#|Qb{6RAbJ`dgxq53l12gs2JE+}pTGtHSDQkxhCdDe&9}88ijwxP#f|&}=B~ocv+Y zp~A?|;4GEVH_u@C#P_n6qgpcw)5f^5@=NwE|Df<7pAGI9Ij-B~_8bf8+|H?;YbIi zmU(lERT*Iz``~QqJHkZST+qc;gS3<{D0<)luKqO$m$1tHA44<$L6OSF0aUjZ1g$Dp zzWbF2-vga^Z*-XpWPoom^g*IY#HTkl)WdnNS8qw0iL@HhaesXbGWxDfNfe$07R>;4 zv_Q>22RsCSAn0P^3qR|*>{~(@Ry(1f&(K7uaNfqWoDzrxW0#dO0^UuNPIzF~3#Aqa zdVha$bayl3YDt9foL5BtM@^^+7@jtU5uc5AJEjhOf@%|&?T>4by`<8I5LaJHZP#rP+0Rr}26?s1W@2h0>!BFS^mDWu8;dDPg`Uw=xz~Ra0 zeaV9}f+p3QyKf9l9C6Nth^wRpQc3a3RlW(`QjKq^o4os(S)7k;I(i)sZ}h9~g#ih| zW+Mh?YX2H8Ut(FfxiQ3Ok>2S7sOrkQi{od)HgKAcS$ZV?*Y&dR#kcogAF-M8P;8Um zFTC*n5ny_GE#!dhn=7w-><;L$p^{DcwCvpS z*S7hNr?}ra+3b(^@Ii*GD0W2n@)h~X;XXWpFGx1ft7Orn>qdMpMHE+J;PT`rco!pN zt16mQD+g^y&kUaWit=x!>LFrFM%9XM2?L!~yixp?Is}2?+yi-q!2ij=Xs2xNj$Lvl zceqOpe*V#d7(+wp$Un+rvvi-s^0IMZLiwWAj6ReOG+1|{1IIbTVAqN=6Y-qsN1dX{ zqGXexOKg6W(e>uur51yb&%P~)A9<~eKCFN4&iW^>)NW($(9=t?H4mY~-D^y3#;@!# zg#|*IEL#whdC&&H&atjv`yTEpQ)YGiX!5Cu^o@I?lwoY9he&|NV54vQ+@6I>N$vyU)+=BQ8oy
    yJ_?OOX{o(=2K6K-!&g(_qnv?YI$L`v4^?ln>=*umMEqVQl#Y&Q*2^fGhw<# za9UxoKak2rq4B@ciAM9SPTqpNq^0b3WWB?C)Uogh?n}NSc-okw_C8d+D|Vcy&mAFi zXBq5p_Ay>aZ*oFj%sS_PUbgd2^V56H-YdTzg!MgsqT`XMeG=R%LoiWG;`U^d@cAQMr}lQgSP<`A5&2JzPMpxG zN0ZjRaox#=E(Dzn&SL8xRnz$}6!X-QxGUL2v;L|3ckP8SYn+}POha)0MioJgW~Daw zEM}9+$SwY7;Ou0y^3leewC-0KXcnY&gDfu?bkT;ZpgEL%p^fokuf$?y&DlJls=!sqxubeE0q)}!l0-; zEL~vy(1Y$qS0@1=f~>p6&lqu7wV_L;_UJZ?SnP%=U$@F;vFdJ+13A!QcjAfS3qdjJ z^3P*9-ik6^Cdj%;MD%u{smMqNg(evkLCs-XD+%V9Z4)YNEYS=@Hj9Pj+TPVsNhXS~ zoipuy`5M`vM}(irl&UCwMDh6wSCSs*+|%n%qd!_LZ9(k6+!XUFLPA-Wz-c4Mt+DHtRDph7@_Oj_959{!T2x%x=?kf+6sS96>Rpx!cqmWF@kX&d z{Wy_Ga}tO`Uh4Us8b&}FVdCqnxA#PQD|*~?`Zwu)MmpAh9d%f6R$_g=p%*4z9LTEp z$K3hIl97(bSb9h-YS4Ir7J*>Zk$i6P;^S}gT9l9jGl=2n?9*ce;&o_=PylT)Vb+-Y z?lfU&2i?ojG?}tT0jsIuVdJsX>X_8REJL`jMJ-hQ{tohxQ8_z_0lcF}>$b=E>fbjl zX|z}2gYdTv%{yz%K@nFuX2kOGWOhoNaC&K=pn5eslWi%sq1Y$czW}A)7enP;KAuX8 z9gvF(parEf580a&ua>GVc9#c&m`T{OHvjq=FPD!pWZhadgu{PD zJ;)0uEO6DuhwTl=ZU$pi-gf}5sz(lPIAqd?bHzE7BO)wMWftF*uY>55K9Al~Is>5E zUM}vKlRn_E=Dj=?q9(rK;Y>_T7HT@g)S5`R#1aw+rjyc$yz+_aaN5xb()%T(Kq%{Bv5KWn9`nX-nGcS`+4c%*IQH zYEdgsBWbU*i|pB_oRaP$&)4@0*Y|tGD}N2?BGO;8&dC9#WhVk82?>J)$`kIQ(5}SE zd0fNAT_uf+-em&x(ilX$_3LcbwbFniaUP=Kv>+uFuNt>BiZqS2CaM0@tdH|guq{G` z(ED^z-w&2|xMCQ5rv~MfBxrlZ$@-f;*^MCxw~geET5RR&f#oAy8)5{WuS2FMMHtI| z{SP1Y#n!ZEu>3~naZtn9)=L zI{YrsSEfG1u0hGiY@-@2`TUWP1HLZpWVCuZ^R6lG1oZb>+W*IvlcSRT9GuU6Z!>Ry z)F1-go-&}H{5fi^HJQ?AywJT9)J-R3{n<@Mr7|2SH;+0nFYRG@E}4KA-(i^7CU~;j zb8M)Qrnq+POBi$Y+Fu#<85TPk${@zspdX0sGwPk{9e>rc;w+r%#WC}1^a53BBl1>q zHLQpQVaR8Q+x~E*CV68#>+%>;JjXU2A9Fl9s<}C5ByFX=?s6kaaS%x{$a~3?)1F== zyFUd0tj@>jMxx060m*w-LuVxQ2|s-A$FTKYDBtne|NDQ zQGgN&8|Bty#Y1JEW>@VQ<)?>L-?Yi9KeIkQx3*-@BU3;dgLg?clpO};&rI_$1?X8K zU8RqRGG8)**&4WMV}>!JvTvFHr_;R*n7!@&_f|>CswEker<(t4MHXlyHn?ZreUiJx z;wMWm4{5IsaJdW!iy9O4?6B6LUvdCQ50*Z!r!$T3H??JpCgv9yoaE)|rs^@2rg$-2eDGqrC8KIL8;Zx_5;F<~!W4 zbvoMwaPT+&#${n(}(_AvNEgwYQM5YUW|&JHtJV=?|(?x>%Aj8 zR+o6YRIVZ>qP#eZ(nB`Cdymk^Iq#m>GqD#&SB`1F@v5lx1og{-7gfIV=Q}%qezQCf zE&2Q9^B5h$gOyq7pCRACP4U{5e{U%JaXOt_h?iCW@|vL~gCZ{u2Fpil!=++TZeJ=n4~M@`3>LNk z@l@O3IlX4bHz+YK1wiiKzc%nP?+2^N6!W=}`wu>h8jmbMmm9Sqcu}u8ma0YF68>rd zVoJT0+C{h{A4=@NdBu4mu8(e|uK46gk#_9^`eSbNK?b`w%ND+OFxl1`y4jIcj5 zBI=Po6X`C0^+iPosDdFK=SARq@M)E!cf$YZ-uunfCFR@lTJoDNWucbi8Sif)twf10 z!1P0VK`nm3`=tPVyTu9jsH;G^1nOYvIz;|gmi{H?tPuhS)_O|Q-6wbmu01WCTcBEs zl8$H1FQ-!=MKX93Vn*BY&T;92SE0Fed?HGy?_+g#KP*!yPe(|8I-VP_nQ%$P`%XfD zEvOmoVahie(s!)?oa!`ml)=nd)Wp6>e22aB%7ob&;JX@Y)@9;ZQpdOd#ffDGO(YNu z87yj6tY2aQHfDfvsW%%F)QZNG$C!!?9H)MyjCa-D-2TO4iX)2}?BwPa2Kwfy zC!;=0xlSa6A19m|x(9%u09|x~hxjcc=hjCQpiG9@8xxb1HIJ&6q(dFJYXF~!F=A8o zoc2KnZm$bNHE2O>srFaW(zYjj>%qWHEoNvxn(4c8{SR#RGsh{}d|LDe(`}E+_78pV z*HS0rDWgj8Ba#kVUI}(DIVAvxWv+?Fy3eU_)zT*@uVeZAPCE(i+GVy2u}LUJ+94+V zpvtsQim*fh5m2HrhiX|g@{BYPW5wZjx_|*VZiw=p2d+5)7e~JgHwozWr zv_z!ZV?W;ADcSxLiXbKPnfZtas#foDnpB4^4CrT$@hM0&01ArM6ZgM@c)J`_!&L=Y z3;106d4B-MkuNx|a-tjSOu~6603A1ZSMUDEEDOw+2Rgh&nFbT&w%cwNcrayLXhO-O z8?NoRcT5^^+mc|i4yu##qqT~jJwp``$%$wcg*t-0A?ATKIH1bOvYymZMQAvI$8vGb?x78<2i!e z>$@pw_;RuPuiEeMU@Q6%&huz|I7HdLw>Rnh94+6)C!Y5Be)*-iWSP%1{-X9>Hc#=q z`?cpY(?i8QZ>_oS$Xr`tOR>61N8z@{vJLqhc_KtZGZ#X=yQ^dE)4XWrnWA{jf*u2@?brx;ZL9!8ICog z>FFVmGibe4j|zSxCg0P?9+o$w*9~!`=Bs?m$eJK$;#tG01l|D`)0f`{>hHXOp#^$WnKO(17OzB2aosBCr>NssL6Ta>k1a&OKb=@wmCYEJrB!``*-og-dx?XpX z$TA#+B(9CM>5gT^rI5f?RSNk%YwkYG!wzVrpgb%!BX`5cp+^>KCmP9pF2njmE8*ez z*H-T&MCO177F_;QR;q`JDiwIELXKCWXa_lL!!c+9-xCkYPmBFa&5KzAf zDaz|_4Yo+)G9+O~d%Q8tgM?r9++AfT|W z#2Hw_!e}D_bvx9rgib;y=kq*ZAA>d>sT1MCU5LAxNM$~-6tiWTrY#Twc4VSP0H@BF zy1%52dwQmT(&zZQoAzH6l0m?%RDMr$4^fJG- z#qKvAhh=EhQC?~XoIv@Xu|g0Yj>~+@c}pB<2sfhH4{k!{OEAvB20-R*Dmp0dokzXm zXFiU*3STW;h%ap(ZpJ%5zqDC<@W{gA9KT+nml$15Ea(X|Dpg;Jo^LYuWlQ}k)QMo# z!+GaB*Kf}@gi$iKs~n=|GXcsCGAGm^naw7j@|;N-s?I}4=6+S5HCg-4aKRwkV`vCj zL*!b^*{NF=?4~2Mm6aQPl!DQs#UFU*XP7VQP#R6qET?N<wK%p)&{Q)1n#;8Kc z^s83?q@yfr*TKa>MLWh^!$&bD;5kYe5tB<@8WsE^!n;I>KfVs9^o@bk-ci{Px|-8; z@{OM;&1V=Y&OmmQVcc!U)(~j}<^nu90Gjgu3baFl$|+WA_y>_RFUh|8Us~qcR;1MY&~_#S}y!$G}~o KOnCtJ+rI!!=;Mw6 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-orientation.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-orientation.png deleted file mode 100644 index f6e3f14e5a6ebd757a9d0f862675fccf84f0e53b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2033 zcmeHHZBP?e6y3xSgApXs78HpX62L-9XjDSMiV!6$;ls)(2$CQu)S^YG5=ewlX-zB; z*p%-GepTs6Bb7l55)2f92*Lm(76f%5CR!vJ0uqA(x{H51{nwfP=$m=Fd(L_1-o1D3 zJaKqvkkzX7s{jD70$I#200318Zx0+6W~T1EXoFvvv;Z&y2QL9GK?GyV6joFk0N`zr zjRGoU_5iR_3Nm*_@MKeCAvG^fId)F>ZMQAvI$8vGb?x78<2i!e z>$@pw_;RuPuiEeMU@Q6%&huz|I7HdLw>Rnh94+6)C!Y5Be)*-iWSP%1{-X9>Hc#=q z`?cpY(?i8QZ>_oS$Xr`tOR>61N8z@{vJLqhc_KtZGZ#X=yQ^dE)4XWrnWA{jf*u2@?brx;ZL9!8ICog z>FFVmGibe4j|zSxCg0P?9+o$w*9~!`=Bs?m$eJK$;#tG01l|D`)0f`{>hHXOp#^$WnKO(17OzB2aosBCr>NssL6Ta>k1a&OKb=@wmCYEJrB!``*-og-dx?XpX z$TA#+B(9CM>5gT^rI5f?RSNk%YwkYG!wzVrpgb%!BX`5cp+^>KCmP9pF2njmE8*ez z*H-T&MCO177F_;QR;q`JDiwIELXKCWXa_lL!!c+9-xCkYPmBFa&5KzAf zDaz|_4Yo+)G9+O~d%Q8tgM?r9++AfT|W z#2Hw_!e}D_bvx9rgib;y=kq*ZAA>d>sT1MCU5LAxNM$~-6tiWTrY#Twc4VSP0H@BF zy1%52dwQmT(&zZQoAzH6l0m?%RDMr$4^fJG- z#qKvAhh=EhQC?~XoIv@Xu|g0Yj>~+@c}pB<2sfhH4{k!{OEAvB20-R*Dmp0dokzXm zXFiU*3STW;h%ap(ZpJ%5zqDC<@W{gA9KT+nml$15Ea(X|Dpg;Jo^LYuWlQ}k)QMo# z!+GaB*Kf}@gi$iKs~n=|GXcsCGAGm^naw7j@|;N-s?I}4=6+S5HCg-4aKRwkV`vCj zL*!b^*{NF=?4~2Mm6aQPl!DQs#UFU*XP7VQP#R6qET?N<wK%p)&{Q)1n#;8Kc z^s83?q@yfr*TKa>MLWh^!$&bD;5kYe5tB<@8WsE^!n;I>KfVs9^o@bk-ci{Px|-8; z@{OM;&1V=Y&OmmQVcc!U)(~j}<^nu90Gjgu3baFl$|+WA_y>_RFUh|8Us~qcR;1MY&~_#S}y!$G}~o KOnCtJ+rI!!=;Mw6 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-vertical.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/png/toolbar-icon-toggle-vertical.png deleted file mode 100644 index 699ab494f8cc21e5620c66c608c45b8c539150e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2403 zcmc&$3s)1@7M=;?%^;6tK#?MZAqM3L&DI)PO;; zflyF+>h1D{3h{|pu@HHf76ENldM#E6ibOyYjfh3LgZ_iAb=N&>oi+RH@9cBV`sVC! zpWJ9csNH0j$p8S@5n=pg008Dw-3R^`To*pO%&zzJlL4-2P(u zw@*hZk95#;aDliYqrEh%!}ZY!22yAFNA2jUL$M6!&VG$(b>P1nIr;%i9&X;KIk~wX zINNbL>HRw1h@k-Ux6RrLblqG=OM7#5w!UX^4HF1hxe}j8up-ko-Z}vJ{SX(+5DVQ2 z^Kl~rMAS9~K5q} zG-H_l;gjEB7g4aJC?h=BW8(sHjTEsZh`*6o6)&(!Y`mVo@l3fZ<8lc?Ys+iRg$>7y$j=6 z4v7bv#KjP_IhTIX3ytnCR?+8j&}c(3mT-;*9ty_Avff5E3`a)r;%!02fQo*Ajr!S{ z#HkR}!e#kr$cC#;dz&4Y&K>6vhEpUicCF>qos>a&1TL2LHqL}$TPoBJRP?CmXQ)tH zlXxct`Ibwy;WXNz6KqyZ>Dw%=C#XoTJ^r-aaBfn+(gubv)y>j(hxG4}YvQJrPhZ19 zQ%o}r1xdSYo*T0J_cbplO1${ka7!GwKO%LNvC^g#lSi6M3f#R1^=`1M$Wq=~S52gC zv%v9_Gtj)#hXT|?t!{+xbW`e0>OkuTzG7`q(+jV!zZA;wM$x=uBhs=!0e4iOnO=B3 z^#^b8p(}MK+yYAas*MPJ$9#R%Y&XLEGq%C_w5@#r6LK@Z)axv{8`3$}@y%60p$})A!ZZaG8)d|G9-=g_(zq9`z1PX|`0`y`?bA zUqAKU5*dbSLwH@c12kDxGQJvun)bfmeL{w-A?4)&CzDwIfLlia+aTpv0mXgoMx?Ff zVHN%LQas+<^my&+6@f?nX*!o&`mC|eU$#;)2*X)LYB{~2l>_sBFi$L|P!&B7$K$UV zC@h=QCbnL*B;25RGMUBUJaHmT=a5T}q;MA#nG3@aY?hw~DEYj}io-#D6jB@nCBp(f z@2HaW+rZUi9hX68i%7q?Ua%QbE^uHxBS}C1Ua*|Wd`eC7r0GN|`i`aeVJj19Zw=S~ zoz!G?4MSfKUc*L~tATV5W&TRo$9*!5w~6GlEO1bOKf7mV8dFw}+Jx6spJM@oQIx0X zo)uY7ts%Q21GN6&u{dE219(HNU~DDk-SZ^7C$NQj#+gvyCr73%eV1k~B$*E_^g!DRR5%?{);Sk;PtaQ@Z!j^&JJ2TAR> zY+bYTf()nr^<_uIzBhxYIL*2<9Rv}H{I4ojCzU0$*t+D3aPvVU5;$>>RN8JEB01b# zY4o7R^D9*;_Xn`bFms9}e~mRP3gf?x(lD^PpJibk_OT37;I?bv!H>ti58q8FqYaS+n))h!16bkwayFbR|B27~2uYIM#kTDG(`^ zxqdbno_c;b@_oO&#$du8sNX!3OoEhOSX>GU348V1tCFdZ^1Q{VfUXe*89j4~n9LKM z5&R0mobxe3f0g$1x(d_cEGjG^(mY~Bv{Q!h!^@tO-`Y-8yN-M49{s7nOMeL{sPr1$ zaHpSez!UXzLnL2A&qd;>mFcUm zDZG9r-Tr!Sv;`0g8Qjrm3*42vO7j0IL$A)C{!|jx8_v*yvIzXCq_9s`|xZGG4`FY3?*f$ETzdlLWR;sb}GqOK3RsDFq1ISVzk?dETKV`Vi*x6 zyFN^oF%nsZ8ClCR@2T(m{`FqJ>-Rm^b*^*H{XF;jJmE`s;4&Hb77Vd<2?c?KB>&uCP+Eo@2&ANAhp{*p znXxd2>&?9KynQJ+@?lB}%u>`u(A``MWq+EgT3%->?#*|x0)6)mx#Ru}@hIxanJ@oZ zXx%y~J{o==<~F&AFb_|tK}X$9O>zoGHB4q2P{ zp0kT^%zuBKINXXR+M*J`FNop9YErKGIGtCn;tbJ-ctED1$;d-@G_0YR6Glo5e8I2; zLs$-u6~@A_pt~Ouj%&(5tBB9(%g|LvmJ3VXtHazR9-%BQZZ}GzBN*Rk!p@6s+YIx! zf=Bj#`ynGvQH~bm<@S{{N-c#Z8wBZaKq!(uSA@IIse4cVL4=r=eMfRw$5+hJmta(Z zT@=N^INi2AO!mp6e9`)@h-bJInI|CiisVhy*8x2-txr$#(Z}eOfwM?U4JiQGPNa~0 z0*D%)ZHoh$7pUh8wq>=a`Dh~&uoc;?J zPEk5^=Z$p_$yVz)NXV8qzH$Tmc_W@_fx#Desyf{Xw2h4&ti}j_B zi5eS9b1A&@r$}G!>LgjL%=9BJ=Fz3K%~B)-?l%{yp+ z%Hp?un?QhHJAEIj(cU>$GCS^b-oU)$4KzeEME=0A@kz-WZg)dFM~f-+czQIwyzvYs zA87*)rMi1Qg^EI6|6?yT4sFV2$On5$z#uuYhzcdcss+^5HnaD_SKR}=KufzG@LL8^nk$}7KUhH)6jqBl^7 zFM*G9LP@>iY>@rRR2qqADn8pMz&>jIP-tYEe&7CPo$|f*Sb>#GBMCt#U?Y(AeynE@ z=(yq11m=Vxq)sF|K2RhiZ0iBzVce1mh&JdNhud8m`@!SpRA0Jlk+0ri3hOv%=vxy# z`axK2)`r;5_H4BiExuZGLuP0DE#J0;`0U3J*7Yq>rgZpzs`VGg(ab6?$Nu%|J(m0I z*b!{KIEPtUG~Z_^PN`V|Uz~{TE%z88S)pPUgWPV#dg9AY#^DMM!@&bw&gZ#s!(XEz zs^5GBLd19A0k1CY%DB%Pn2%;CJBv<^KlGSC;}zQPiT77 z7=>tX_j{2h{Q}>~2;ZE3!H*Xkm?yR?nFSnvys7MivYtYZ%HOOcTto$JJhNY~`n{`w9G;hzO@=uH;A=LB)?L-9sShu zdbmhgw#T?~{YcT%r((qy%C6A${7r0sQ$3@MJ^TU+%PnfxPgr-;c{$1MhrJyQUQ_wj z8WSI7>wly@5nhR$I_sM5qbP~@OLiZ}!-Y8AW_$g`RGGLE0Uk& z$ANRmB!iC4q;JF6d+zkkU(%JR;xuT3GNIgBA!j+E>ypZX_CATvwkz!}FPs>$g?k1_ zKdANI7>&}i)O)rCY6_}d^>Fm#>O`Cv<(Aw1Kz=PmzoD3lI&p+JMvEg$vD8=y`Z11b zbsuP{N+(1UFK{AXc9}Y{l!8l9m_@zI)}$gPo)F;TpBOg1+>jRms*TFci%L;10D8ii z$qRT@hp=6rJyp1|^z_V7^7ro%?A7{{4RK#iK{XKRKB96#i%5(Hw8vLZpD>KJT?j*H zAO=Xj6$pOo{OTB1q`|S&oB-9?XSWt)!;1i#w==sLGOYXyOaB z?897eYSux3K^^D<-Y=BQR)RZyKB z;ja^-?X{UZq`0}dU569%w;wX^Uzg&>u)+H%3fk>P3jcC#Gs;QdC;nmA;~xT2^JhS} zdeOIq9SW&GD`Y|p@lNg?5t3XPuje>1`3!zr52Mx~ztLed*%mfHy=daNE`nO(0Opz(f}churgUE;exDV=zAhbWh$F*7q`58} zv3_HB=%=B*tk-niKc0-ccP)pl#8K@xMx-<>khc}&Cy|(ZAt7Qkl{T(n^^TlXYeRh4 zU_}m_oxB!#8PMnFy6OQL#t^^-9s{}Ag1)_SypY;)K)4Qkgbn}|7eP#NkWCNZmW++y zi(sQA5!BCpS3v}CLWA9O7$RS(2hyIaqpIP)&1lO}P>%04OsPD@|HO+Rn3O-Q&GKWa zX((mB-v=Dahv^eci$nUd&yI4lLrGCk-dm-5d%W-gJj<*WGPs)byeyz%OmgMYty{vY zBC5?g@T>SlTW7Pim-VhxG(%aw$RD}GlTS2BtWu}yhp5(w=Qs$x{(8#b*qs-is#9N~ zgt*+sk*D@;HSe30>nM@X2yO0FmKV#D7^uFz{{5P9#H(N9fZ=QdhP>ec3x+~RL^rRn z3{S1MXW^cGMfnDX`#O$EQHn&GV=3Hn0=2&H_zL55%3xc~z9u2wPUH|8&n_Tie)?_6 z3cUU;6fwLvJP};`ZCvklzm_%yMnmvEG{0C>?-_X_%D?!bDOR}v_m!+My=O}{VNZa_ znn+RxM}rMDMRc|`W!n#WS{gWF-ZNBq*14a4OV@;-)G~tVwl}@DAGEMIs);hG-^Jt0 zO}YfSx%YIB(~5^k+byB>>_VQ3G!&8`}han@%BLp?F%XndT;annUyrqeEFu*8$+gmmD zktEj><})}uap`fH-Z!2}t2QmwrPZ#uc5w}=f?yPmX5LtW$0RIQ9c?bC)|I0h?-I73}zV;0zNCNskZ2H8Rk) zz<#2oO(8X?{X6!_8n52CyNyfMn4CWX;c;{>o5~hIU1K8QnvDa=e;KAn(3y;rFHG+Q^4xEU z`W8;+qmxO+^n*+b$X6vr4MndZzaKt5NA2>$KIb=86Ll)w!-vkLpPgP0LxvRL$d+zG z4P$5wY@4o6|1Pttt#F|HgxfQxHwX1ZZzq)=Rjp|Y>MH%@gdO>5LyMF0A+S+l-NAnB zHXoLjhq3b>#MTetrfcE7AVFW@vRI2#=IHz7i?VchgO$`YiiP2bB|Sem@2U5&;wjEf z)WCdLUx|@$Q6xdSX^+uL@{`OM_E38Z(_&YZ`r3X>Pee5*>XPVFt(mv^7XHL%)zkpQ zt89-;zmDD(={!)LpOM^H{1&omB;_7UsfkwLxyl6;n+$I`CHFvsFtlQ?(|NcwFv+I)A3C)&WAEialhFUW4z_HR44lE&DBoj}slfrAJ= z^72%ZX-fHKZs-_ z%e!SNk)3Evys{0!@Wab`Y6Dcm3(5h-r$e+?M9$>KGwKg%WUbPmkpm!71rxlhFmPnM zX#Jn_O%d0KjL$h5S)TxsMxW5;6N9TFEPE*II03$Q6bndwmNQur0~bPw$xR@0LP7xp zouWMm$j5<#0r_fh#P|N<%P*Mi=eLJ*!4NANR4OP7N4(=tY&Gme6AvTAR#j_00JL8+ z+yDIm2rJ`AXsT#^kuJ6M|Jcv?k1@j1-(=4P>)*o`|D}uH_QNWu#(deV`)jT@UB|IU z?|rj@YLw3ni6F$BS%4(}21hN}(jLt3=70brho$>t(Rg^#GrY>h)mpm%B3%j4egHLX zLwj%%+KM)ZT#W)0l3N+}5}oXIcdq!WIb8^ljQS8TDNaPnd_5*;xK`k_^bC-_{h9gph8X#?w zT#28FiP4iA1E{xG)k%TW&`=fjc5b@%H64OY^k|bDKEV3ND}bXapMGz<()p}O zlE*f8mxAh;{O6LED^m&&90r7^HCQ(}V)4JkxS_zG?Mg=6x?uIqy7uz(evn|Wz#1z1 z0`%&Bwt-8RGBkq!NfcZQqrw%V(r{vapNYk9l*M{-M?S{&gZ!DNy-r>**!n=|+AM<$0X_VYI{75;6G&XXrP#M1QAL1Fq!q z!(G*)gZnw0{g-v5+;e%W-x_lp^EwWWF=!I!kj<$3sg5u$TL%2M~t>XzOF z4z48;@lWOS)h|_LpI^ztM?vgqq(-VIB$;MK{&G!oi+Ag;i=&ro)6jL-QaE$ms&ilX zfjgHc@LRH^XNE|IzH{x*3eB~zv`v+&9i>uNRR7}_Tu%X?p<{FS?B9Y6zqLgI`>5`@ z7EC@m`Vj%wJr{0Dbx0{M@JF)s@#}As((csgirc;STk;f3E7`0_W*2;wjs)>`jLv6^ z4j75g{(H@9&rY)C*=o6w!I*R8X=BCs=qDdG)~k!t_(~P?qEHfT7neNc(#o~yePH~L zscY&k&Yd2(vHq#5kr^s$t#K#3qD-wpR*-`S9YKtkb&Oo47cbp>KVqRF)1wiH&B7mP})}48}O%pWvU%IfQY3;1ot-p;q{8cka-7J zffYQnLj3N1kb4~Pc&h!1h?K2+%_6NxAUO(SX?f{+CE&znvw&cq^W$2iZA=YV*COEb zAP}bqXM-JFi{eS(P1^asis^w05k=n`3A)ewWF(h zui&BFy&+9NGV(ws@8&7kqNUzwz>VfeqX0{F9#mi40DHE6ou@Ax5O1B`qxNN$NLDd9wiC;zP&pc1qt(x1cWo zxLpS3{ne%seK&96#KdhJeMRL>IY^9$9e{5D+u&1BM!7udgs(MGn1RJMdeVx|ifuFoeRoW*{nJgFTfu zbQ?kq&otQ#g%^a(LmgSM)DNYyM5`h0*IKYHeKBpR+xe0Xa%N$}aAiA?p}5_k-&ShJ zsMzh)Fa%y+GMn-F;z=rl|JoXX%KC5`*1FRPI?ep;YjG<#_p`(Da7;Nv74%C?$&$yG zXhZL+x>qFJL{4-I^z5nm+URv$f5LWH(mbA!BdOPL9{U~+aJTBht@Lj zv1<|Y2Uq6&DCe<>3zL)4AtDzXp_?{y7U(u;_WP_t7jmo_zAPS^J#{uL!s6JQZDR4p zx-T{DK5{>*GL1%kIvJ^wUpD7R-_vIr{o_RB-sRfn`hMCylG(TMhZhXtBL~i4E*+7J z6y(K)PtCy_9q@$0%;eZ$e3=T2b0T=~{h|oFz3K4&p_7aXHB?-r>}IC! znb8LQfU4hJ97LbX>AAsnwp|_1u}!_-#<$3iq4w_WZa zg;4#u>l5q8TBGRX4V4Pb`bjeozU)ga%UN+lE2d?#ZbRivzFT`gTaUu`eYrbzmHVf< z_^!ELqCJVxbnoTwO4ug!1O^`_)#WA`m9fG@d5oRfN;I!ERJSzq8Ae1t+K6_6DShqr zlPG@g-MTHrjioltgoeuQ#N~{<`!mN?cEfN9|5G9Y?1_P(1qcIfAE6OiHO8LhgkA1Q zf9kg7%sr5 zU!6?;;(x40C`b>^?qVdwzunaM!|rz^P_hkF3Q?!6PKft6y1V5cQS`FPNr$eD(0ixV zZT^w_GwaeoKy2uj#O<`Xm+)FIPOvN`0Rh*2xg8g7G&MF>Dfws4u$raWF{Fjx(2QSji(Qnmb~c8UBCL{8fsy zI$8Hi{OF#5>yI4ry){C>0Xw5rB;2O8B;`WH<$s4B>B3B>(~9I{+hSG2E*-X+#auG& zEJ2?%yS=R_O~I5!+Rt8QZ=($BU_4TM8qI<#Kdo>Txj z9~m-J8I^bbZyV!G_x}!7%Fd9D;xmDxc0YIgJu=wC2P8vk61QSVwsu)7BE1P2F z25473{Hc|vapf7}6knD?(I*DCPG&5AHy?Le;^EgDE=>4a4Hg?EM zkSY)<_zd3J%>UsoDNW=U{FIfI<$v3d(=g$Q3Xex=?Z@u_1auQYcGeD+JoC&m_dWN#=bU@)Sw8osU9_>_;ylR-0)ekYANZG8}iwZ0uI-KBvU`1{3zzik0*~URiRk`ttPm-u7wtd%kgo z42i1R?VqEH4M$11a4J1LoVU*Q7vw01HA4`}3&$^jWS#!$aEtJ)WXohRf*im1#8RJA zH>uwA%UC`#dAFZy>Y3~}eHq@g?(1}8dg9FsJvnBVa!?IgUY4_#*q=@tuJ18vL#7<4 z^lFtL_8^uZ7tJ1)7nct6K|By1hZ!$y{MVCdcnje9Bb9umZ0HkEit|6cF>eV~;Wx+L z@LMUyY|ETiAfV-E2s~gpkUfQG%&uLNdW9-MRa)6gN7v>WBUSuq_B|Gf?H~rHTk)(C zD1bHKokzSsx0?hXY2+nzF!3Yh5?UhNecG39w-S!^m#;?(W>Zj={6vSP&~ke0Q-ocpZyClDcqZ)(>i8k%UzN3s(=<_<8v zi^yWO)6U#Q9s)`U8wxhdIHC?<(NeYC@ zz(D#nS{GT}1){`O!dlX)p;(rRN;s8NNiK|bEd^?QwWx-*z2>*_o9U}`FEGVSH7F1!SL5}W#2TIp9c&Ou)>?=Y>`-5e--vbB zHy(?sytN0L9C!3fd`{rOoyxD&JRl2()`5S@?Em#gmQdMXspxD)>R8vd;*8A-^vzGg zp6H1u>G35wFg8O@ssTm}z1WN5a%7e;uyjUT>2)$KsbL{4n7h`y|g&+A_tm z5HUR~g%5FG$Y`y4BdpD}FcT_L363Y&LK2X1?F$Metc)F<6Nov+B<1o@naZD9Zz$u^ z4z>;|rK~4VKu{irHMfTe`ca&V5jg}yntS3`;Rt8S$pV|``~~#8TH5Z?EI*n1|+|dGK%EHluK%$V*==D-p^?naV68yNI8LPS`Y4N&P`J z0V|~0L;FACjS&T@LyO4tXf+jcTX6-k^J>R#)PS-h@vqV9U%H&sxZ(#Q1n-xr?J3;s z9C^k$(cYY%MH3h1TST!kjgs0g=Ak}RE%f1*nP-+_5#O)(<}32V2P>xK+Ft0Z5OT(j zW}+9j!L>5`W>1lJhHA1z*H0*Z$H%j5pmw?a?&_m4Ibh7>^e)Ddt4m1aL_FWoWKLjm zgJq~5mUM=z{0%=#9_m}Z-Jj}iacs&7A_?sUkcyp%A5Z{D(}9;G%jNhi$3fqs{f8ah z({s>#uP&`<4%erSEfl39pYd!Ys5-;a>_u}dl&_WzT+S(on3j0<90_}^E^{Q$CJMgV`Z zeWj;*KHN!?j;03^CcSLg%9gKWj3&Azh7vj#qYY$R8##rY89@Q42kKet#cw|iT!xAA zJcRyWt2tvVv7F^dRli;T&hi;%n;}i1WM}>|y@;_H@0GkEp2Rz>)wWJ*l1xLg zBnEDlYDPm_EfU%YL-Q8Y*QU-UsE|;@ar;&ajFdr9W<2|hXtB?BdC?cD&CXEz!BcN-l0Svy%DjeBN;j8dFfMM^W8X5lDmtEFYAc;sVoc3hz|o$)MIg2dj)|lC z+V98{Xewz%fJFa|pJ-`ytm)3*{ONKq8S7kOq$(i7cH+G4x^JX2^nOu z2+#Bil_2rPsy$eTq?}nqFuxrpcKSO-Nbi0f*@fFZ*?KK~Dy^9-);C6GoqLMtDe6ta zjTI3%(2MSAo>i`d`0K4dHUe`E;2=ZRt?!3j=9NZ`%X6klMkP;sYzcf+OmBPe7(>qK zo0dSVmkL0%F^k=s5A9%#4qP-L> z&=};oFe8b>m+IgA61iVw8@_Q)Moo@Bn&t%Ue9L@`L1c9=Q?JSI#HDM|H>pKHHm0DQ z`=D54TU~8c_(r6R^ttI#!kMM1z|(0%!tEU%I;o;ycWdUR-PXdH=ppxM=FT<7`fHhx z3i6zSzHUDo_JTzCMcATlK16OL_{7I0Q`)`D3!4sI)pF6GOxB;F&pKn8Z$YIw*7u`s zIYPIqv8Mk_Jj2Y=-N>Hf-&%_k6He{_RkU+Q;U*=o>W-L64)QyKOSwa#v9(lTAIm?9~_lWSExU$5J;RSj|Gd4Xlx_@_^sTy7`MfC zmG@9T)-1md8s|LQrrjBXG4^M+wlxoywLO(3l~(lb>c52kyTIHm4)-b6zquCv>^H1x z7xN{%qt3o`%3+=}=qavsGuyLbmQ@{{RO z$|{Fsv*cN^pM4d-bgOoaNTw6r15x|BJ1LNMi; zHvYWF{y|G^D3FCBoSwH8BJk1iDl|i?R&+U9mWTY}je|?)l_vdIWllnp7_Rl!O9GqUGkSXkMv)l4x$4S|^ zfAZeIy1)9Ot9A19fK-mWb$69%4J+I1Xy%SW2&{=UD_*5uEB&oN-1}LuR(VLg-1Y}V z_9u!&4rz0J@kGNPJW5!RxmGiBL8-g(M4q=8M~gZ0us(c0$$NkOjYKIUUasF9t@VpO zDEj3Cg=<2=6*ge=-v*O+YR_sQ=NNU2`7$`7B-${J2dRo^2Gc2iU6OSr3kt28`a}EKzVi7csq_N(E>R1>#DW*-zkU`y0WPzD6?tL?4gk5lS5KP!)dMe{1>h%{)?rGXkH zLf3G$P3wpvpFYT8K0B5wJ6nv(eqVKYdO-wu-pFt0pCH|Bj82Le{x}n@Z;b^ULvuGsgAk;4_N{?5D_~PKWVXt&k*_uLIyCL=I z4!Ve0b=iijW+AW(oOmYcg&!XS4>potXzA17D3U1B5yX&wnM%s4CUVU$(LcdaP z#BKX)jQxhYCthcx#&+KzS_=U!5xWtu*c*XvGtBU87X>`4UiJP8@tryBdznU~=deK` z=%rrnUbSgqiA{v!jz8VJs$QmLIWh9#2gcGpk6${uW5-42F9xVSmARW{GiSKwP%B(F z0M{UE_8_hO2!%Gjy;_hyKcmpPSO;E!hQns=OQhncsU+Q{s=h8n(K&tQW>rWP-)IlU zgTtrAzUh2rzHtkj2Umz<4^mbATK3~UnOKw4*hKxvJ;yCu>s52S_`~)tNep$9qwCaL zm3QV|-QMZ;P3N$Z5E=g>O0*$7J6LhF(~Wks`||gRvQJn$D=E0#H430WOJo0jv3--B zzQ;XIVu<4CM?{MHPLRC4`q%7!-k+YofF*QH9PK+4sp&~ZTj^|dUV|s~K3B7Cm)*mW z!KI|~^OajH>L*M2Hy@f7di2m6u-_-BF)1OB3r4^@I=OF;H;(%&m4wSToC}t?9q>5U zxJNs04^Ro-Vrcgz7*KUNpelqX43O@)&D`3wL%^CHMoLdFPizpkV+h!e?ocame{{NR z4{!#rH2WsWAjNZ$3NpNPuNa<3I{oDK4S>Ld<(<=4`QpqctV84nGe(KM12%KN&OBzB z-uBpVtO_w$nY;MQWaaj=+>eTM(Ug##F!{lcc2yzw##|HuqF}px{{G$>PQy*C_k%ks zV}D!>w4M~w{K$N%m&Fz@UgcGgxm(8V+ctOc$^9v+R7yym@rRE%Ek+RDDMm?OmOtjl z^Z(Eagq4MhztmIITUVAGYJ2@oq}}dC=_XD*{IE?A<`MbzKQ_|bzCBwk)0$`3&8k8k zGh33$y=ODG{ZrI&F_2{^3`f@thtD0rkS*pBQCz;c(}Su`r3aVv*BsAR<{GnU=Pqu5 zKWFr&G<~M}anE7ITg;_;w)ng&H*^)u^`}*Edbm5^>SYW6bNA|PsFNwdu@nKnlNFa zAl&=pMAbWm34n3b4`bYe^%=^n$pww%?v!4Z;R2^9`Mv%6Blpw4HQe=bHnBIU&L_V( z|4H-~A&=WPW+Mt>|3CZO2Gq#c%hgGG!v;e)?oKzXq*{1xPj8%3egU4O?jMD*mAw<; zrvX=^YfZzVrY0*uQZ6p>8Gx#{_=7>mQ+I{hiiaQK zKRtEld8-TTT-9Gkmd@ACTh`1S=+v(YA%+7R-S3%wlSll}?PRqbsmCmTbPYcuiJ`zg zJk4zRP=wLH%~2VCun`Tp{NLnj3=e$t(0q&Y`CTn=oo+5*??n(iOn!7Z8PR=~wbb#t z!R`||;&~RU^|5{B)La-lb(7mS8xV0&5)h~x5C~ou8s84QPal@rYoJpJ6>sxg(S zf6c+GLX2!;4$OYmaWSjy$99ea3yUFtS}Cvr3WfsM`*rj5`T$jk^aihf5&A_Smbqki zTw5FDq}y`O#S|_$tRbpGZlje6QN<4nuHph&)*=-5G=OXq95?>-$JVCSBIDR$h4^>AVhHodsYr%262}jGk-o z%-&XoY61S#(YoSJAWDT4XHS0xdxvHz3j9nFJZWmBX+Xt62 z4z2)o9R9+)Dvg@Xd@YX0|HXgei64j*dVMKVj1X4K#Y{;0EmzzvleDULo6^l~F#bzZ z?UMNRyPpOzVeEAh-(&1%0VzW#TvcA|o|)RSxODIRjqnl5fD5550k!NDr`tUY7)CL9 zb^wfrWJl_ISt9wqBqcAuK&G8+QTJU zHcjhW&T5o@O_()zI8hTIg8zxPyXU`sY)vlC=(^S)4C0*juu;?8_m2w}%&_c83Q5ev z+ZO)n4Tt}Xs7W9_GRf%Qi{wa{D5NIx*$Uz7@cxKwlm~=y@Et|cGk_DRo7_cViw}AcxO)HVja;t z5o}la590(CPFf>Ibw=g_PgbX(uCmTpT1e){cAz=+N$;{jQ9%Dbdro03h(lj$!I?y?p&$6#` zOJd>5ib9pf5!k3szwp5zwpDoDcR#u4iO7TusW|afc0w#hIKdhAEtyMtdkIyn{OHN- zK%72CN9EJZy2KVKBrFfrBIL9R5()$GgYzYlgOlLofbG}0`t@nw38v`DDXPT(;}Hx? zA8qo7jor>b4s>pSIUx^&lzUZ@p}~OR{%ow_eM5rhxzP zHN(ns4G5qgDOcz@joes1tsfy^t=zrGH(UObd1$`H+5>tE!BHH8<-oDHqRho{%%nKh z6~L}4Z33*W{W#eSgZ;QkU%d&yTrFc44<>gVDvY#Hu_6pt%!gGJ{(blj1p+N)G@9C0 zb{c^gh!Tml9^-39NasZtras`tJHHz=bw;7eH+)w#uRmSn=z0kzg6|y-asKARJ0{r~ z#RC}IO16r|IZB(#K3=7$ld*NAdJs^J)#05h0~TMR8nfu1J^|Y=YPI)3N?@gI3nL{Qu5yV z0wCn#I5*Ay{g)#Z-zk9^ke^&vNQiIe?$*9wYZC;3NZ1h25ijJF7&kkE*SZ*Cyrhsq zu7`=g;=?RCDzEWV!s}yF08M7ELdiU?^_6bBsXrThX}`|fn*f#w*^H+r1Hh&((0zXD z7IGB_;6j;m5^nF;tns+20k7xx3M~i;kT%YiW8&~e-N!ou>!K^}sXpGEj57{=vbQ?+ zJe#t+8NP2szyH<`1JK~eL@|Pjm)mr}3y8a2qHeyX7S!U@G@Y{}a$Vj0S|2X9HSsnf z5H#x5sbV_%R!9Xr3i0gB?_3x*b<0I{bU!wDC^nXESbpv*@4B{@{gppz5@I$J16}QJ z`GY`>S2mDXTdck+qG8;B*_wWNMew}|e!W{CUsq`En3zEbRexT*HLHU)!n3yzo#&_w z?)5&+Sfc&)lZg(yrpj2leu5$4%fg8FQ`I88l++3;XJiHOli_aPyfw+NsN-T-ih$d+ zHwRg9CPp!Bwh9_+9q+l2j^2I3e|Sl6yL$eWqv%4olVR}rRykCq;{nC2K<^Xc zFb3B!Wa^1Davpn&dx3*!_{0l;P8UJy#(Qb76h+a9#Lbj>X?xowR*{ zZ39b`nCk6y;k=^}ps-+j`wNvbAXZ?;%&_XKi2IO>3NQ&ZKwdgX)MHN|DMaVmisrmu zy^fQ&`~mt_{GxW}OLu+uk=kcxZ=4oGS~2+l9m@7ACce?r^b(ZTqdRL}7cwBC;F~LWaJ@P3n!n z+Wv(J3YU2`BMSd2b+^$cJAXBZFNK3DWd!N$bk`O4J8LQv2U35ns&GQyK^xqLM{4$3zaQ4powj6Wj%kxBDR$ z*J7hk$m6$D105&V0?ry8v+0#>$@^?Wl}q&G-QfX>csu+#8{jk@N4UnG(D`1ygzb=Z zkKU|u!&-g$4%fgTV*T_ty~yJO_7*v3|43gsAhbi=|J4a+c~x{> zYn@x`Bwmx@(7?Snw+|;j-TnO%S68@;t@z1?P4iaOs`C|TEMG-$WhZc~TjO1VE$Gdu z=;R1cn{C`Ct3WsL71apa=ZJ!72^E}Y7G)z2fg=;lrY1~_w*S^5`2haishCUY^bh#on@M%n!mE`pQB&um?R5yr=}#f z8>g9~mK?w~9r<27@lgAuw6}@;7pHkiLgE}hP!CTZDxS=+ripX=TPq<7AAsD=A6liJ zZYJhYWoR|ge0=8scss+$j44)H{>lXuCs^dD0v!5rHuj8MnEqK&jt9?B5sd0 zw?4mA+CZpEXp6U&!z`BEbMA8nv1@%l5Li(#tKZZPI=-$)=Tjo3zOjRlF7`m=pmN^J zid?|On}wP#E&paH^V|xDEz%hyWyjJ=sk(P#SR1l>n$oICJ)nx?S?5wH)^(`=E+!=FiabrjhrvXy?-B3G<0&RBx>GI(|DrI4v8N zTKPck&ri*f%=$0Mi>dE&Nb;)WoHd5Ny^8UCzKxj1_PyPJHlNf)`1zJNj wyslE$Q#2gK<-*xwchFxX@m&$tl>qti)AriQj_5PMr7w`BnGLGe1pD9r0hFyN=(T5C*Mu4K8C zBGYQSmKjSCH7QJF$(ES(J9BTZ*Z1Gwyyo+obI$WT=e*CeywCZ}RS$P3X-PFn2m~Tc zA`-|D2$TUHeFbO1nPoQ$z zJj34CsQOUuq4b->XT?cmq%yo%Y(qLWo#I^XT({|={A$0KH;H^}h@;Apq3wE+ODJ6w zFBfzdteFy-&b4X}AwCBZRF^EKX((Ev_;)CYd5$6#`k)>o|J0fH_U=X(ldYLZU)pt7fUpXSC|Z-kkubw)lnT9g==~01%>=gtzAfAO}^|t11{=x-vq0?$D64Zs+nXJb8`{S zyH3|G_dExU&`Qb*UlWS?@P@Rq*i&znVi~J1jdSB5K3r~A7F+U&EEG}tpSM)4Ix!%f|>9u!}IQg+eg*!4C-1NbNoPG_GE87x_4}D@0?TRa3uyzr$ zK7TR0FuFh|kr4@y*tAtd-_V&?G?@ox5#-k+gJFyum<)7hNpgsz0R#zEFG(&_O<1Cd ze?H}-`CEhJYCJ`P6#w`--Nx-B#iZp}q|}|NSV@=UY6fL0EIJY$Jz>sI;8|+29ylj4FH8M6XIpl zUGZpcgnQbo>^QbQ?-gR@21CL!2}n;X(clKUv!vURY5=B81pWKo@B?F8w4zO+O;;%T zcdAx9@B97G-4Gf*)#n?O*q0TJ(8^RS;62yheY?H()^5#Y^e^syFM|z4xnIGRaV`!; zjRIOpK+2R4|)#S-~d2AgnOF0zgh^X4Pv)0xL|-yx?u@CM9`gzzO^>5 zn1eUAd-UzODca<%I4`tv2B1ltwe2r|USoN-8fLZ+pEC6n=2@C>+{@ZM6MZYb8pz($ z(YJU7%3w{tv265-z14DCMvKxm@l0zIOmYsNMY7xzWIMO*sH1*l*_W;9%SMl_3Ltu; zS4!aj_MXAoduq5)uS7q%r-cPHpOm@R)4Cz6Dlt4A&6)z{=g^#mHm(MrFOaP;K@ny& zG%>cvn{IpT^2LTtRtq4KQ6Ut_Z}|w;xe?l@PMD{QAK}o>ZJg}^$0@RxV&Oi7M>QVt z$QW!`kW!9Q_XPaB!xfKcU>g)pfm}L&8rbF{Sl;h|(>|=Ep>Iur;!m}Zy?6CjGwsSs z`hU%iA}&-hVom_5*o`9G^T7_Qx6Iy$Z3L9H+41ZZ?`U&QakadxW^KKG&jdQxvcaa@ zlakwWyd>z5siV{imWxLv7o^mKc-$;6xBUlYgV`6}(R& zIsq0GS?&XCX79E5CAeT>)Mc~XXq(C=rLQOL`-Hx|*Mv_!IPby%&f*Qa{`vDD9-z1Q?*m1=B_x?tR2t(h($*$#Ht0H6i|5Lp0Wz6hac za-bcz3s2PxjQWLLnSM9j;Xh<2Xd%O|ei3318d;WT+^uq~?e{LoPm=VW2cDrh(BvfxswSnLb=&yAVVx(*{Xv3Gf})%m8kzv+d7F zBR;WQ2?HUrkO5#eXEq;RIMoz(GG!^eKnavwg)}FE-P-74D9Zlrv~|D%6dAAuX%wOG zAqcMXCwMbF3&CbHfs)#w0j3sd-9 zXmA8Dy0wV%PLKIlxKVcHTzLedp<)9Tq&)`dIn{d5XX>RLKbLb+fK{WvrX8d060s)W zskGO$zgYGm0aecyJY@7`m#0z%5Vf0gz{gf`k}l18_VMlg3j*v^r+9!;^)5Vpsue?z zua}O|a*H(2xf1^gaKD*E>>hl|+Sxtxb%1Yn0O+kf)W;wKCu2^;mB}d6*P=-j$nuvX z0Q_kHzC{_@19xF1m+e%iSV@uV?qB9=F+>& zQn0;uBeW3NA`Vi2uzkQsld1P9mgnE#zC8KnVxSI5%aQt+?ypfe7=8k(><43XkQkh<;I%26SYwmno;_OpHX=a$fbxfsqWb#IX6N#x8BDSjg zH7%rS(dOYg!z*xyLJMO8Z@uVDzL(C}kk9aQjmn?4FgIg*MYqbe+?p_%n-jDV$7iZ5ZR8a6JM=6!uq_o3csVpv+iS?}t%W_MudEY|><)H4%(8AOe(V(1Ytt%#iy z!0MlL`!^cbJvO5V%zgzFA;D=1iuNzmS9%7VWDgb;8OLtB zy;UFE%p0@`5D&DdmUxe1F~6fKC7eF=yu+r$oWK<-NvQ3eavkXR>T;nswx9@d?&;`W z+fq=fNloIc+ItAibTrpv9X`#n*VzKj)P_2se6#qT^EjFil!vrLe9^?PZ~Ng!y#xlZyZAb{^%`X960^n^oo2%f@J_;r(?hYK78~-W0mj7g!TwL=8je zngp}08uO3yjAfUG%kl=F@X$%21tV8S(^U=?BXO%-X)oA4o#gM`Y}*{d)6NOjRuH;Lpsi8)J2 zsR9RZmu)zJQ72Utn6pt6T-2Su_$R6FyO~~E>yQ}P7BhTdSK+}{SLU;8j3?uUjzX4z zVj9Sv430CbVe>FzBaT8l!IJ3%C~_M~`;F2nQkWWXJy>JaDFDGV5_19X7hNw5V!I=Q z73RMkY(30eYfz7b&g*?e6&&oo2A%wvK_F+YAfAxoYfmj*oOtn%GGCpehAU6^<&<;k zIbvT?HxH)&38{j*zuFP&5}!ZL@rO*){VNN?dhooSjAny^HsBV_LFE-A{F}}QSh=aUXS2mR7tjF8} zF+iT=GJLUJ#>Gn#a|fWM@VdZ{I))!P%j`qbe()wab*JY6G^0+PNZ34yAIKSdVd-<)CwoX*}^xHvYV&aUuUV0r##^lD- zgdC9Uq)sN+l_8ah&HwCZJ|)!PD+<@xdB^1+ZhEM=D%0dgR#zrkX-Fkp{`>74ZL>5Z z*FerU>gg=^Gv&|p8B>QLLhH{~gHDK(SzAZoLe%HH_UWg-MsO56eg(0y*-U23U%U1X zXCD<8D$Eo9P%Mvkq<*CSd~szn-ks~p&|LaHz1n*Jh0gpL-sod)OF_oL(ngh4E8ZOA zM)nXJHD>)|@XT6%D=msNVp=O^==HaN~08yG@7ZuvHMKQ8)wY&x2Ja@IE96t%jO_qg~Fa7};VID53s zgny2Qh>32;5Ko`mHiLJ+ir!j&+GhJGf1ONWJgTvM6eBgit!YrpxILaHO^-53@S5bb!?1*fHw+BPy{zYc7;CU1d29I{aBJrl#JRL ziGOlE(b11kJe0s!)0feWY0VnE_?^4Iq74>TI>gS0AD{!k^6uDso1Roog*VZkl*sXm zX$L^5d+DAc-4A(af+uGCU@g`x=O1vjaKG{7INN!h6)7s*3j-w1g^!_Dq?g-??>n0I z;)zN=*mh@rQh)fqGsV*F3w>!?Gt< zWGB*8Xy;kUgpTI@hoCk{Whbz%MLzXM`>L1sY-#oGR||~({FiKF+!6CR+YGVURJ2z4 zN(O8;11+aDiD}C%ffK`0z*_;KJsNpd>`#9o)5ybj*6!>mEx{U3WjnT?b!$I^ti85$ z?`k0{nHY90oUP9E&p?y!YQ$h$lE<||t0x$PIhCJ$uv^m5*zzp!Qs~hz;(mM=#AFOj z;PIOg`r0Lj_!A9qb6BT6FY*iFQH#EMqf(m|7m70;e#(V*+&Dt}g2C95OM>cOee%XO z9$U=vs;V69uiU8N)QPkXd!KTRK%6~KfsoR32Gp*<)h(3c%kd0_+M$dh$RP7we$l0o zbJ**mn+(pFm)l-uiEY71urDkQa8yAG8oyfRoMvtiyBsqRu+MHMOd+kJ_?(Y{?|=t# z_jlyH)vXN8rz+6Eos3vf-$_+ytG0xIqfl&E{HXnK{BCjYkAd#E`fvD1rFm7pI=dd{ z(pdB?ulFS-|XaB(|Hqa*KU%*Ke9+mpauI0+{u6_c9NY<2 Ib^#av4@^GL$N&HU diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/preview.html b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/preview.html deleted file mode 100644 index 1d6d7588d..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/grunticons/processed/preview.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - Icons Preview! - - - - - - - -

    CUSTOM PREVIEW - you can change this in the previewTemplate option

    -
    .toolbar-icon-admin-toolbar-tools-help:

    -
    .toolbar-icon-edit:

    -
    .toolbar-icon-entity-user-collection:

    -
    .toolbar-icon-escape-admin:

    -
    .toolbar-icon-help-main:

    -
    .toolbar-icon-help:

    -
    .toolbar-icon-home:

    -
    .toolbar-icon-link-toolbar-menu:

    -
    .toolbar-icon-menu:

    -
    .toolbar-icon-shortcut:

    -
    .toolbar-icon-system-admin-config:

    -
    .toolbar-icon-system-admin-content:

    -
    .toolbar-icon-system-admin-reports:

    -
    .toolbar-icon-system-admin-structure:

    -
    .toolbar-icon-system-modules-list:

    -
    .toolbar-icon-system-themes-page:

    -
    .toolbar-icon-toolbar-menu:

    -
    .toolbar-icon-user:

    - -

    Embedded SVG option

    -

    (The data-grunticon-embed attribute tells grunticon to inject SVG inline):

    - -
    icon-burger:

    - - - -
    icon-burger (styled variation):

    - - - - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-menu.html.twig b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-menu.html.twig deleted file mode 100644 index 2c6faafb3..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-menu.html.twig +++ /dev/null @@ -1,93 +0,0 @@ -{# -/** - * Toolbar themes theme implementation to display a toolbar menu. - * - * Available variables: - * - menu_name: The machine name of the menu. - * - items: A nested list of menu items. Each menu item contains: - * - attributes: HTML attributes for the menu item. - * - below: The menu item child items. - * - title: The menu link title. - * - url: The menu link url, instance of \Drupal\Core\Url - * - localized_options: Menu link localized options. - * - is_expanded: TRUE if the link has visible children within the current - * menu tree. - * - is_collapsed: TRUE if the link has children within the current menu tree - * that are not currently visible. - * - in_active_trail: TRUE if the link is in the active trail. - * - show_icon: bool to show or hide icon markup. - * - * @ingroup themeable - */ -#} -{%- import _self as menus -%} -{# - We call a macro which calls itself to render the full tree. - @see http://twig.sensiolabs.org/doc/tags/macro.html -#} -{{- menus.menu_links(items, attributes, 0, menu_name) -}} - -{%- macro menu_links(items, attributes, menu_level, menu_name) -%} - {%- import _self as menus -%} - - {% if items %} -
    - {% endif %} -{%- endmacro -%} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-toolbar.html.twig b/sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-toolbar.html.twig deleted file mode 100644 index a03231f48..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/base/templates/toolbar-themes--base-toolbar.html.twig +++ /dev/null @@ -1,61 +0,0 @@ -{# -/** - * Toolbar themes implementation for the administrative toolbar. - * - * Available variables: - * - attributes: HTML attributes for the wrapper. - * - toolbar_attributes: HTML attributes to apply to the toolbar. - * - toolbar_heading: The heading or label for the toolbar. - * - tabs: List of tabs for the toolbar. - * - attributes: HTML attributes for the tab container. - * - link: Link or button for the menu tab. - * - icon_attributes: tab icon classes and attributes to style SVG grunticons. - * - trays: Toolbar tray list, each associated with a tab. Each tray in trays - * contains: - * - attributes: HTML attributes to apply to the tray. - * - label: The tray's label. - * - links: The tray menu links. - * - remainder: Any non-tray, non-tab elements left to be rendered. - * - show_icons: bool to show or hide icon markup. - * - * @see toobar_themes_preprocess_toolbar() - * - * @ingroup themeable - */ -#} - - {% - set classes = [ - 'toolbar-bar', - show_icons ? 'has-icons' : 'no-icons', - show_tabs ? 'has-tabs' : 'no-tabs', - ] - %} - -

    {{ toolbar_heading }}

    - {% for key, tab in tabs %} - {% set tray = trays[key] %} - - - {{- tab.link -}} - {%- if show_icons and show_tabs -%} - {%- if tab.icon_attributes -%} -
    - {%- endif -%} - {%- endif -%} - - {% spaceless %} - - {% if tray.label %} -

    {{ tray.label }}

    - {% endif %} - - - {% endspaceless %} - - {% endfor %} - - {{ remainder }} - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/_variables.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/_variables.scss deleted file mode 100644 index 770f144ef..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/_variables.scss +++ /dev/null @@ -1,5 +0,0 @@ -// Toolbar mini SCSS variables. - -$font-size : 0.8125rem; -$tab-item-height : $font-size * 2; -$toolbar-item-padding : 0.3em 0.95em .2em; diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css deleted file mode 100644 index 315d45e6f..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css +++ /dev/null @@ -1,43 +0,0 @@ -/** - * mini_icons - */ -#toolbar-administration .toolbar-tab__items-wrapper .toolbar-icon { - fill: #bebebe; - top: .07em; -} - -#toolbar-administration .toolbar-tab__items-wrapper .toolbar-icon-menu { - width: 0.875em; -} - -#toolbar-administration .toolbar-tab__items-wrapper a:hover .toolbar-icon, #toolbar-administration .toolbar-tab__items-wrapper a:active .toolbar-icon, #toolbar-administration .toolbar-tab__items-wrapper a.is-active .toolbar-icon, -#toolbar-administration .toolbar-tab__items-wrapper button:hover .toolbar-icon, -#toolbar-administration .toolbar-tab__items-wrapper button:active .toolbar-icon, -#toolbar-administration .toolbar-tab__items-wrapper button.is-active .toolbar-icon { - fill: #ffffff; -} - -@media only screen and (max-width: 24em) { - #toolbar-administration .home-toolbar-tab, - #toolbar-administration .tour-toolbar-tab, - #toolbar-administration .toolbar-tab__items-wrapper .toolbar-icon { - display: none; - } -} - -#toolbar-administration .toolbar-menu a { - fill: #6f6f6f; -} - -#toolbar-administration .toolbar-menu a:hover, #toolbar-administration .toolbar-menu a:focus, #toolbar-administration .toolbar-menu a:active, #toolbar-administration .toolbar-menu a.is-active { - fill: #494949; -} - -#toolbar-administration .toolbar-menu a.is-active[href="/"] { - fill: #6f6f6f; -} - -#toolbar-administration .toolbar-menu a:hover[href="/"], #toolbar-administration .toolbar-menu a:focus[href="/"], #toolbar-administration .toolbar-menu a:active[href="/"] { - fill: #494949; -} -/*# sourceMappingURL=mini_icons.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css.map deleted file mode 100644 index 32f814b5e..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["mini_icons.scss","mini_icons.css"],"names":[],"mappings":"AAAA;;GAEG;AAYH;EAOM,cAAa;EACb,WAAU;CACX;;AATL;EAYM,eAAc;CACf;;AAbL;;;;EAqBU,cAAa;CACd;;AAKP;EA3BF;;;IAiCM,cAAa;GACd;CCvBJ;;ADXD;EAyCM,cAAa;CAoBd;;AA7DL;EA+CQ,cAAa;CACd;;AAhDP;EAmDQ,cAAa;CACd;;AApDP;EA0DU,cAAa;CACd","file":"mini_icons.css","sourcesContent":[null,"/**\n * mini_icons\n */\n#toolbar-administration .toolbar-tab__items-wrapper .toolbar-icon {\n fill: #bebebe;\n top: .07em;\n}\n\n#toolbar-administration .toolbar-tab__items-wrapper .toolbar-icon-menu {\n width: 0.875em;\n}\n\n#toolbar-administration .toolbar-tab__items-wrapper a:hover .toolbar-icon, #toolbar-administration .toolbar-tab__items-wrapper a:active .toolbar-icon, #toolbar-administration .toolbar-tab__items-wrapper a.is-active .toolbar-icon,\n#toolbar-administration .toolbar-tab__items-wrapper button:hover .toolbar-icon,\n#toolbar-administration .toolbar-tab__items-wrapper button:active .toolbar-icon,\n#toolbar-administration .toolbar-tab__items-wrapper button.is-active .toolbar-icon {\n fill: #ffffff;\n}\n\n@media only screen and (max-width: 24em) {\n #toolbar-administration .home-toolbar-tab,\n #toolbar-administration .tour-toolbar-tab,\n #toolbar-administration .toolbar-tab__items-wrapper .toolbar-icon {\n display: none;\n }\n}\n\n#toolbar-administration .toolbar-menu a {\n fill: #6f6f6f;\n}\n\n#toolbar-administration .toolbar-menu a:hover, #toolbar-administration .toolbar-menu a:focus, #toolbar-administration .toolbar-menu a:active, #toolbar-administration .toolbar-menu a.is-active {\n fill: #494949;\n}\n\n#toolbar-administration .toolbar-menu a.is-active[href=\"/\"] {\n fill: #6f6f6f;\n}\n\n#toolbar-administration .toolbar-menu a:hover[href=\"/\"], #toolbar-administration .toolbar-menu a:focus[href=\"/\"], #toolbar-administration .toolbar-menu a:active[href=\"/\"] {\n fill: #494949;\n}\n\n/*# sourceMappingURL=mini_icons.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.scss deleted file mode 100644 index 8c57b5a90..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_icons.scss +++ /dev/null @@ -1,80 +0,0 @@ -/** - * mini_icons - */ - -// Most icons are embedded SVG. Icons are embedded using Grunticon. We are using -// the original SVG icons from Drupal core, however the width and height -// attribute have been replaced with a viewBox attribute so we can scale them -// properly with CSS. Embedded SVG has the advantage of being styled with CSS, -// and by using Grunticon JS loading we negate most of the bloat and overhead -// associated with embedding SVG files. For the buttons (orientation toggles & -// menu click handles), and for sub-menu indicators we use a custom font icon -// that is tiny and only includes four icons. We rotate and color these in CSS -// as required. - -#toolbar-administration { - - i.toolbar-icon {} - - // Top level icons. - .toolbar-tab__items-wrapper { - .toolbar-icon { - fill: #bebebe; - top: .07em; - } - - .toolbar-icon-menu { - width: 0.875em; - } - - a, - button { - &:hover, - &:active, - &.is-active { - .toolbar-icon { - fill: #ffffff; - } - } - } - } - - @media only screen and (max-width: 24em) { - // Toolbar-themes module cannot hide the text, so instead we remove the - // icons and other redundant tabs in narrow screens. - .home-toolbar-tab, - .tour-toolbar-tab, - .toolbar-tab__items-wrapper .toolbar-icon { - display: none; - } - } - - - // Main menu icons. - .toolbar-menu { - a { - fill: #6f6f6f; - - &:hover, - &:focus, - &:active, - &.is-active { - fill: #494949; - } - - &.is-active[href="/"] { - fill: #6f6f6f; - } - - &:hover, - &:focus, - &:active { - &[href="/"] { - fill: #494949; - } - } - } - } -} - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css deleted file mode 100644 index 940e369df..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css +++ /dev/null @@ -1,373 +0,0 @@ -/** - * mini_theme - * Theme styles for menus and other toolbar elements. SVG icons are styled in - * the [theme]_icons.scss file, while click handles, e.g. origination buttons - * are styled here. - */ -#toolbar-administration { - font-family: "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", arial, sans-serif; - font-weight: 400; - font-size: 0.8125rem; - height: 3.25rem; - background-color: #0f0f0f; - -webkit-tap-highlight-color: transparent; -} - -#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus, -#toolbar-administration .toolbar-item a:hover, -#toolbar-administration .toolbar-item a:focus { - text-decoration: none; -} - -.toolbar-vertical #toolbar-administration, -.toolbar-no-tabs #toolbar-administration, -#toolbar-administration .toolbar-tab, -#toolbar-administration .toolbar-tray { - height: 1.625rem; -} - -#toolbar-administration .toolbar-tray { - top: 1.625rem; -} - -#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus, -#toolbar-administration .toolbar-item a:hover, -#toolbar-administration .toolbar-item a:focus { - text-decoration: none; - outline: none; -} - -#toolbar-administration .toolbar-item { - padding: 0.3em 0.95em 0.2em; -} - -#toolbar-administration .toolbar__link-label { - font-size: 1em; -} - -#toolbar-administration .toolbar-bar { - -webkit-box-shadow: -1px 0 3px 1px rgba(0, 0, 0, 0.3333); - box-shadow: -1px 0 3px 1px rgba(0, 0, 0, 0.3333); - background-color: #0f0f0f; - color: #dddddd; -} - -[dir="rtl"] #toolbar-administration .toolbar-bar { - -webkit-box-shadow: 1px 0 3px 1px rgba(0, 0, 0, 0.3333); - box-shadow: 1px 0 3px 1px rgba(0, 0, 0, 0.3333); -} - -#toolbar-administration .toolbar-bar .toolbar-item { - color: #d8d8d8; -} - -#toolbar-administration .toolbar-bar .toolbar-item:hover, #toolbar-administration .toolbar-bar .toolbar-item:focus, #toolbar-administration .toolbar-bar .toolbar-item:active, #toolbar-administration .toolbar-bar .toolbar-item.is-active { - color: #ffffff; -} - -#toolbar-administration .toolbar-bar .toolbar-tab a:hover, #toolbar-administration .toolbar-bar .toolbar-tab a:focus { - background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(255, 255, 255, 0.125)), color-stop(200%, transparent)); - background-image: -o-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); - background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); -} - -#toolbar-administration .toolbar-bar .toolbar-tab a.is-active { - background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(255, 255, 255, 0.25)), color-stop(200%, transparent)); - background-image: -o-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); - background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); -} - -#toolbar-administration .toolbar-bar .tour-toolbar-tab.toolbar-tab { - float: none; -} - -#toolbar-administration .toolbar-bar .tour-toolbar-tab button.toolbar-item { - padding: 0.3em 0.95em 0.2em; -} - -#toolbar-administration .toolbar-tray { - background-color: #ffffff; -} - -#toolbar-administration .toolbar-tray-vertical { - background-color: #f5f5f5; - border-right: 1px solid #aaaaaa; - -webkit-box-shadow: -1px 0 5px 2px rgba(0, 0, 0, 0.3333); - box-shadow: -1px 0 5px 2px rgba(0, 0, 0, 0.3333); -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical { - border-left: 1px solid #aaaaaa; - border-right: 0 none; - -webkit-box-shadow: 1px 0 5px 2px rgba(0, 0, 0, 0.3333); - box-shadow: 1px 0 5px 2px rgba(0, 0, 0, 0.3333); -} - -#toolbar-administration .toolbar-tray-horizontal { - border-bottom: 1px solid #aaaaaa; - -webkit-box-shadow: -2px 1px 3px 1px rgba(0, 0, 0, 0.3333); - box-shadow: -2px 1px 3px 1px rgba(0, 0, 0, 0.3333); -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-tray { - background-color: #f5f5f5; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal { - -webkit-box-shadow: 2px 1px 3px 1px rgba(0, 0, 0, 0.3333); - box-shadow: 2px 1px 3px 1px rgba(0, 0, 0, 0.3333); -} - -#toolbar-administration .toolbar-tray-horizontal .edit-shortcuts { - float: none; - position: absolute; - right: 2.2em; - top: 0; -} - -#toolbar-administration .no-tabs .toolbar-tray-horizontal { - border-top: 0; - -webkit-box-shadow: none; - box-shadow: none; -} - -#toolbar-administration .toolbar-tray a { - color: #6f6f6f; - cursor: pointer; - padding: 0.3em 0.95em 0.2em; -} - -#toolbar-administration .toolbar-tray a:hover, #toolbar-administration .toolbar-tray a:active, #toolbar-administration .toolbar-tray a:focus, #toolbar-administration .toolbar-tray a.is-active { - color: #494949; -} - -#toolbar-administration .toolbar-tray a.is-active[href="/"] { - color: #6f6f6f; -} - -#toolbar-administration .toolbar-toggle-orientation { - background-color: transparent; - padding: 0; - height: 100%; -} - -#toolbar-administration .toolbar-toggle-orientation button { - cursor: pointer; - display: inline-block; -} - -#toolbar-administration .toolbar-toggle-orientation > .toolbar-lining { - float: right; -} - -[dir="rtl"] #toolbar-administration .toolbar-toggle-orientation > .toolbar-lining { - float: left; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 1px solid #c9c9c9; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 0 none; - border-right: 1px solid #c9c9c9; -} - -#toolbar-administration .toolbar-tab a:focus { - outline: none; - text-decoration: none; -} - -#toolbar-administration .toolbar-lining button:focus { - outline: none; -} - -#toolbar-administration .toolbar-tray-horizontal a:focus { - outline: none; - background-color: #f5f5f5; -} - -#toolbar-administration .toolbar-box a:focus { - outline: none; -} - -#toolbar-administration .toolbar-box a:hover:focus { - text-decoration: none; -} - -#toolbar-administration .toolbar-icon.toolbar-handle { - width: 4em; -} - -#toolbar-administration .toolbar-icon.toolbar-handle:focus { - outline: none; -} - -#toolbar-administration .toolbar-icon.toolbar-handle:before { - color: #bebebe; -} - -#toolbar-administration .toolbar-icon.toolbar-handle.open:before { - color: #787878; -} - -#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before { - color: #bebebe; -} - -#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus:before { - color: #787878; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .menu-item--expanded > a:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .menu-item--expanded .toolbar-box > a:after { - color: #bebebe; -} - -#toolbar-administration .toolbar-menu { - background-color: #ffffff; -} - -#toolbar-administration .toolbar-menu, -#toolbar-administration [dir="rtl"] .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu { - -webkit-box-shadow: 0 2px 1px 1px rgba(0, 0, 0, 0.255); - box-shadow: 0 2px 1px 1px rgba(0, 0, 0, 0.255); -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item { - border-top: 1px solid #ffffff; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item:first-child { - border-top-color: #dddddd; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .toolbar-menu { - -webkit-box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.255); - box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.255); -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-menu { - top: -1px; -} - -#toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:hover, #toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:focus { - background-color: #f5f5f5; -} - -#toolbar-administration .toolbar-tray-vertical { - height: 100%; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul { - display: none; -} - -#toolbar-administration .toolbar-tray-vertical li.open > ul { - display: block; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-handle + a { - margin-right: 3em; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical .toolbar-handle + a { - margin-left: 3em; - margin-right: 0; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item + .menu-item { - border-top: 1px solid #dddddd; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item:last-child { - border-bottom: 1px solid #dddddd; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item .menu-item { - border: 0 none; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul ul { - border-bottom: 1px solid #dddddd; - border-top: 1px solid #dddddd; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item:last-child > ul { - border-bottom: 0; -} - -#toolbar-administration .toolbar-tray-vertical .level-2 > ul { - background-color: #fafafa; - border-bottom-color: #cccccc; - border-top-color: #e5e5e5; -} - -#toolbar-administration .toolbar-tray-vertical .level-3 > ul { - background-color: #f5f5f5; - border-bottom-color: #c5c5c5; - border-top-color: #dddddd; -} - -#toolbar-administration .toolbar-tray-vertical .level-4 > ul { - background-color: #eeeeee; - border-bottom-color: #bbbbbb; - border-top-color: #d5d5d5; -} - -#toolbar-administration .toolbar-tray-vertical .level-5 > ul { - background-color: #e5e5e5; - border-bottom-color: #b5b5b5; - border-top-color: #cccccc; -} - -#toolbar-administration .toolbar-tray-vertical .level-6 > ul { - background-color: #eeeeee; - border-bottom-color: #aaaaaa; - border-top-color: #c5c5c5; -} - -#toolbar-administration .toolbar-tray-vertical .level-7 > ul { - background-color: #fafafa; - border-bottom-color: #b5b5b5; - border-top-color: #cccccc; -} - -#toolbar-administration .toolbar-tray-vertical .level-8 > ul { - background-color: #dddddd; - border-bottom-color: #cccccc; - border-top-color: #dddddd; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-themes { - padding-top: 3rem !important; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal #toolbar-administration { - background-color: #333; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-has-tabs #toolbar-administration { - min-height: 4em; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs #toolbar-administration { - min-height: 2.5em; -} - -.adminimal.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, .adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs { - padding-top: 1.8em !important; -} - -.adminimal.toolbar-fixed.toolbar-vertical.toolbar-no-tabs { - padding-top: 0 !important; -} -/*# sourceMappingURL=mini_theme.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css.map deleted file mode 100644 index 8e8206fa3..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["mini_theme.scss","_variables.scss","mini_theme.css"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;EACE,qGAAoG;EACpG,iBAAgB;EAChB,qBCV2C;EDW3C,gBAA4B;EAC5B,0BAAyB;EACzB,yCAA6C;CA+Y9C;;AArZD;;;EAaQ,sBAAqB;CACtB;;AAIL;;;;EAIE,iBC5B8C;CD6B/C;;AAvBH;EA0BI,cChC8C;CDiC/C;;AA3BH;;;EAkCQ,sBAAqB;EACrB,cAAa;CACd;;AApCP;EAyCI,4BC9CiD;CD+ClD;;AA1CH;EA6CI,eAAc;CACf;;AA9CH;EAoDI,yDAAgD;UAAhD,iDAAgD;EAChD,0BAAyB;EACzB,eAAc;CAwCf;;AElDH;EFaM,wDAA+C;UAA/C,gDAA+C;CAChD;;AA1DL;EA6DM,eAAc;CAQf;;AArEL;EAmEQ,eAAc;CACf;;AApEP;EA0EQ,4FAA2F;EAC3F,8IAAmF;EAAnF,uFAAmF;EAAnF,oFAAmF;CACpF;;AA5EP;EA+EQ,2FAA0F;EAC1F,6IAAkF;EAAlF,sFAAkF;EAAlF,mFAAkF;CACnF;;AAjFP;EAuFQ,YAAW;CACZ;;AAxFP;EA2FQ,4BChG6C;CDiG9C;;AA5FP;EAmGI,0BAAyB;CAC1B;;AApGH;EAuGI,0BAAyB;EACzB,gCAA+B;EAC/B,yDAAgD;UAAhD,iDAAgD;CAOjD;;AE5BH;EFwBM,+BAA8B;EAC9B,qBAAoB;EACpB,wDAA+C;UAA/C,gDAA+C;CAChD;;AA/GL;EAmHI,iCAAgC;EAChC,2DAAkD;UAAlD,mDAAkD;CAgBnD;;AApIH;EAuHM,0BAAyB;CAC1B;;AErBL;EFwBM,0DAAiD;UAAjD,kDAAiD;CAClD;;AA5HL;EA+HM,YAAW;EACX,mBAAkB;EAClB,aAAY;EACZ,OAAM;CACP;;AAnIL;EAwII,cAAa;EACb,yBAAgB;UAAhB,iBAAgB;CACjB;;AA1IH;EA6II,eAAc;EACd,gBAAe;EACf,4BCpJiD;CDgKlD;;AA3JH;EAqJM,eAAc;CACf;;AAtJL;EAyJM,eAAc;CACf;;AA1JL;EA+JI,8BAA6B;EAC7B,WAAU;EACV,aAAY;CAcb;;AA/KH;EAoKM,gBAAe;EACf,sBAAqB;CACtB;;AAtKL;EAyKM,aAAY;CAKb;;AE9BL;EF4BQ,YAAW;CACZ;;AA7KP;EAkLI,+BAA8B;CAM/B;;AEhCH;EF6BM,oBAAmB;EACnB,gCAA+B;CAChC;;AAvLL;EA2LI,cAAa;EACb,sBAAqB;CACtB;;AA7LH;EAgMI,cAAa;CACd;;AAjMH;EAoMI,cAAa;EACb,0BAAyB;CAC1B;;AAtMH;EA0MM,cAAa;CACd;;AA3ML;EA8MM,sBAAqB;CACtB;;AA/ML;EAqNI,WAAU;CAKX;;AA1NH;EAwNM,cAAa;CACd;;AAzNL;EA8NM,eAAc;CACf;;AA/NL;EAmOQ,eAAc;CACf;;AApOP;EA2OM,eAAc;CACf;;AA5OL;EAgPM,eAAc;CACf;;AAjPL;;EA6PU,eAAc;CACf;;AA9PT;EAsQI,0BAAyB;CAC1B;;AAvQH;;EA2QI,iBAAgB;EAChB,UAAS;EACT,WAAU;CACX;;AA9QH;EAqRQ,uDAA8C;UAA9C,+CAA8C;CAkB/C;;AAvSP;EAwRU,8BAA6B;CAK9B;;AA7RT;EA2RY,0BAAyB;CAC1B;;AA5RX;EAiSU,uDAA8C;UAA9C,+CAA8C;CAC/C;;AAlST;EAqSU,UAAS;CACV;;AAtST;EA0TU,0BAAyB;CAC1B;;AA3TT;EAiUI,aAAY;CAmFb;;AApZH;EAoUM,cAAa;CACd;;AArUL;EAwUM,eAAc;CACf;;AAzUL;EA4UM,kBAAiB;CAMlB;;AE/EL;EF4EQ,iBAAgB;EAChB,gBAAe;CAChB;;AAjVP;EAsVQ,8BAA6B;CAC9B;;AAvVP;EA0VQ,iCAAgC;CACjC;;AA3VP;EA8VQ,eAAc;CACf;;AA/VP;EAmWM,iCAAgC;EAChC,8BAA6B;CAC9B;;AArWL;EAwWM,iBAAgB;CACjB;;AAzWL;EA4WM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AA/WL;EAkXM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AArXL;EAwXM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AA3XL;EA8XM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AAjYL;EAoYM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AAvYL;EA0YM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AA7YL;EAgZM,0BAAyB;EACzB,6BAA4B;EAC5B,0BAAyB;CAC1B;;AAML;EAKU,6BAA4B;CAC7B;;AANT;EASU,uBAAsB;CACvB;;AAVT;EAaU,gBAAe;CAChB;;AAdT;EAiBU,kBAAiB;CAClB;;AAlBT;EAyBI,8BAA6B;CAC9B;;AA1BH;EA6BI,0BAAyB;CAC1B","file":"mini_theme.css","sourcesContent":[null,null,"/**\n * mini_theme\n * Theme styles for menus and other toolbar elements. SVG icons are styled in\n * the [theme]_icons.scss file, while click handles, e.g. origination buttons\n * are styled here.\n */\n#toolbar-administration {\n font-family: \"Lucida Grande\", \"Lucida Sans Unicode\", \"DejaVu Sans\", \"Lucida Sans\", arial, sans-serif;\n font-weight: 400;\n font-size: 0.8125rem;\n height: 3.25rem;\n background-color: #0f0f0f;\n -webkit-tap-highlight-color: transparent;\n}\n\n#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus,\n#toolbar-administration .toolbar-item a:hover,\n#toolbar-administration .toolbar-item a:focus {\n text-decoration: none;\n}\n\n.toolbar-vertical #toolbar-administration,\n.toolbar-no-tabs #toolbar-administration,\n#toolbar-administration .toolbar-tab,\n#toolbar-administration .toolbar-tray {\n height: 1.625rem;\n}\n\n#toolbar-administration .toolbar-tray {\n top: 1.625rem;\n}\n\n#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus,\n#toolbar-administration .toolbar-item a:hover,\n#toolbar-administration .toolbar-item a:focus {\n text-decoration: none;\n outline: none;\n}\n\n#toolbar-administration .toolbar-item {\n padding: 0.3em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar__link-label {\n font-size: 1em;\n}\n\n#toolbar-administration .toolbar-bar {\n box-shadow: -1px 0 3px 1px rgba(0, 0, 0, 0.3333);\n background-color: #0f0f0f;\n color: #dddddd;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-bar {\n box-shadow: 1px 0 3px 1px rgba(0, 0, 0, 0.3333);\n}\n\n#toolbar-administration .toolbar-bar .toolbar-item {\n color: #d8d8d8;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-item:hover, #toolbar-administration .toolbar-bar .toolbar-item:focus, #toolbar-administration .toolbar-bar .toolbar-item:active, #toolbar-administration .toolbar-bar .toolbar-item.is-active {\n color: #ffffff;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab a:hover, #toolbar-administration .toolbar-bar .toolbar-tab a:focus {\n background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%);\n background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%);\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab a.is-active {\n background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);\n background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%);\n}\n\n#toolbar-administration .toolbar-bar .tour-toolbar-tab.toolbar-tab {\n float: none;\n}\n\n#toolbar-administration .toolbar-bar .tour-toolbar-tab button.toolbar-item {\n padding: 0.3em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar-tray {\n background-color: #ffffff;\n}\n\n#toolbar-administration .toolbar-tray-vertical {\n background-color: #f5f5f5;\n border-right: 1px solid #aaaaaa;\n box-shadow: -1px 0 5px 2px rgba(0, 0, 0, 0.3333);\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical {\n border-left: 1px solid #aaaaaa;\n border-right: 0 none;\n box-shadow: 1px 0 5px 2px rgba(0, 0, 0, 0.3333);\n}\n\n#toolbar-administration .toolbar-tray-horizontal {\n border-bottom: 1px solid #aaaaaa;\n box-shadow: -2px 1px 3px 1px rgba(0, 0, 0, 0.3333);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-tray {\n background-color: #f5f5f5;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal {\n box-shadow: 2px 1px 3px 1px rgba(0, 0, 0, 0.3333);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .edit-shortcuts {\n float: none;\n position: absolute;\n right: 2.2em;\n top: 0;\n}\n\n#toolbar-administration .no-tabs .toolbar-tray-horizontal {\n border-top: 0;\n box-shadow: none;\n}\n\n#toolbar-administration .toolbar-tray a {\n color: #6f6f6f;\n cursor: pointer;\n padding: 0.3em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar-tray a:hover, #toolbar-administration .toolbar-tray a:active, #toolbar-administration .toolbar-tray a:focus, #toolbar-administration .toolbar-tray a.is-active {\n color: #494949;\n}\n\n#toolbar-administration .toolbar-tray a.is-active[href=\"/\"] {\n color: #6f6f6f;\n}\n\n#toolbar-administration .toolbar-toggle-orientation {\n background-color: transparent;\n padding: 0;\n height: 100%;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button {\n cursor: pointer;\n display: inline-block;\n}\n\n#toolbar-administration .toolbar-toggle-orientation > .toolbar-lining {\n float: right;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-toggle-orientation > .toolbar-lining {\n float: left;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation {\n border-left: 1px solid #c9c9c9;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation {\n border-left: 0 none;\n border-right: 1px solid #c9c9c9;\n}\n\n#toolbar-administration .toolbar-tab a:focus {\n outline: none;\n text-decoration: none;\n}\n\n#toolbar-administration .toolbar-lining button:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-tray-horizontal a:focus {\n outline: none;\n background-color: #f5f5f5;\n}\n\n#toolbar-administration .toolbar-box a:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-box a:hover:focus {\n text-decoration: none;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle {\n width: 4em;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle:before {\n color: #bebebe;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle.open:before {\n color: #787878;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before {\n color: #bebebe;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus:before {\n color: #787878;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .menu-item--expanded > a:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu .menu-item--expanded .toolbar-box > a:after {\n color: #bebebe;\n}\n\n#toolbar-administration .toolbar-menu {\n background-color: #ffffff;\n}\n\n#toolbar-administration .toolbar-menu,\n#toolbar-administration [dir=\"rtl\"] .toolbar-menu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu {\n box-shadow: 0 2px 1px 1px rgba(0, 0, 0, 0.255);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item {\n border-top: 1px solid #ffffff;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item:first-child {\n border-top-color: #dddddd;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .toolbar-menu {\n box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.255);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-menu {\n top: -1px;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:hover, #toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:focus {\n background-color: #f5f5f5;\n}\n\n#toolbar-administration .toolbar-tray-vertical {\n height: 100%;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul {\n display: none;\n}\n\n#toolbar-administration .toolbar-tray-vertical li.open > ul {\n display: block;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-handle + a {\n margin-right: 3em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical .toolbar-handle + a {\n margin-left: 3em;\n margin-right: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item + .menu-item {\n border-top: 1px solid #dddddd;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item:last-child {\n border-bottom: 1px solid #dddddd;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item .menu-item {\n border: 0 none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu ul ul {\n border-bottom: 1px solid #dddddd;\n border-top: 1px solid #dddddd;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item:last-child > ul {\n border-bottom: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-2 > ul {\n background-color: #fafafa;\n border-bottom-color: #cccccc;\n border-top-color: #e5e5e5;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-3 > ul {\n background-color: #f5f5f5;\n border-bottom-color: #c5c5c5;\n border-top-color: #dddddd;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-4 > ul {\n background-color: #eeeeee;\n border-bottom-color: #bbbbbb;\n border-top-color: #d5d5d5;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-5 > ul {\n background-color: #e5e5e5;\n border-bottom-color: #b5b5b5;\n border-top-color: #cccccc;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-6 > ul {\n background-color: #eeeeee;\n border-bottom-color: #aaaaaa;\n border-top-color: #c5c5c5;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-7 > ul {\n background-color: #fafafa;\n border-bottom-color: #b5b5b5;\n border-top-color: #cccccc;\n}\n\n#toolbar-administration .toolbar-tray-vertical .level-8 > ul {\n background-color: #dddddd;\n border-bottom-color: #cccccc;\n border-top-color: #dddddd;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-themes {\n padding-top: 3rem !important;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal #toolbar-administration {\n background-color: #333;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-has-tabs #toolbar-administration {\n min-height: 4em;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs #toolbar-administration {\n min-height: 2.5em;\n}\n\n.adminimal.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, .adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs {\n padding-top: 1.8em !important;\n}\n\n.adminimal.toolbar-fixed.toolbar-vertical.toolbar-no-tabs {\n padding-top: 0 !important;\n}\n\n/*# sourceMappingURL=mini_theme.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.scss deleted file mode 100644 index 74fd2ae24..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/mini_theme.scss +++ /dev/null @@ -1,450 +0,0 @@ -/** - * mini_theme - * Theme styles for menus and other toolbar elements. SVG icons are styled in - * the [theme]_icons.scss file, while click handles, e.g. origination buttons - * are styled here. - */ -// Import global variables. -@import "variables"; - -#toolbar-administration { - font-family: "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", arial, sans-serif; - font-weight: 400; - font-size: $font-size ; - height: $tab-item-height * 2; - background-color: #0f0f0f; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - - .toolbar-tab, - .toolbar-item { - a { - &:hover, - &:focus { - text-decoration: none; - } - } - } - - .toolbar-vertical &, - .toolbar-no-tabs &, - .toolbar-tab, - .toolbar-tray { - height: $tab-item-height; - } - - .toolbar-tray { - top: $tab-item-height; - } - - .toolbar-tab, - .toolbar-item { - a { - &:hover, - &:focus { - text-decoration: none; - outline: none; - } - } - } - - .toolbar-item { - padding: $toolbar-item-padding; - } - - .toolbar__link-label { - font-size: 1em; - } - - - - // Toolbar bar. - .toolbar-bar { - box-shadow: -1px 0 3px 1px rgba(0, 0, 0, 0.3333); - background-color: #0f0f0f; - color: #dddddd; - - [dir="rtl"] & { - box-shadow: 1px 0 3px 1px rgba(0, 0, 0, 0.3333); - } - - .toolbar-item { - color: #d8d8d8; - - &:hover, - &:focus, - &:active, - &.is-active { - color: #ffffff; - } - } - - .toolbar-tab a { - &:hover, - &:focus { - background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); - background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); - } - - &.is-active { - background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); - background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); - } - } - - // Tour is a button. - .tour-toolbar-tab { - &.toolbar-tab { - float: none; // Override tour module CSS. - } - - button.toolbar-item { - padding: $toolbar-item-padding; - } - } - } - - - // Toolbar tray. - .toolbar-tray { - background-color: #ffffff; - } - - .toolbar-tray-vertical { - background-color: #f5f5f5; - border-right: 1px solid #aaaaaa; - box-shadow: -1px 0 5px 2px rgba(0, 0, 0, 0.3333); - - [dir="rtl"] & { - border-left: 1px solid #aaaaaa; - border-right: 0 none; - box-shadow: 1px 0 5px 2px rgba(0, 0, 0, 0.3333); - } - } - - .toolbar-tray-horizontal { - border-bottom: 1px solid #aaaaaa; - box-shadow: -2px 1px 3px 1px rgba(0, 0, 0, 0.3333); - - .toolbar-tray { - background-color: #f5f5f5; - } - - [dir="rtl"] & { - box-shadow: 2px 1px 3px 1px rgba(0, 0, 0, 0.3333); - } - - .edit-shortcuts { - float: none; // Override shortcut module CSS. - position: absolute; - right: 2.2em; - top: 0; - } - } - - // No tabs, hide the box shadow and border. - .no-tabs .toolbar-tray-horizontal { - border-top: 0; - box-shadow: none; - } - - .toolbar-tray a { - color: #6f6f6f; - cursor: pointer; - padding: $toolbar-item-padding; - - &:hover, - &:active, - &:focus, - &.is-active { - color: #494949; - } - - &.is-active[href="/"] { - color: #6f6f6f; - } - } - - // Orientation toggles and handles - .toolbar-toggle-orientation { - background-color: transparent; - padding: 0; - height: 100%; - - button { - cursor: pointer; - display: inline-block; - } - - > .toolbar-lining { - float: right; - - [dir="rtl"] & { - float: left; - } - } - } - - .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 1px solid #c9c9c9; - - [dir="rtl"] & { - border-left: 0 none; - border-right: 1px solid #c9c9c9; - } - } - - .toolbar-tab a:focus { - outline: none; - text-decoration: none; - } - - .toolbar-lining button:focus { - outline: none; - } - - .toolbar-tray-horizontal a:focus { - outline: none; - background-color: #f5f5f5; - } - - .toolbar-box a { - &:focus { - outline: none; - } - - &:hover:focus { - text-decoration: none; - } - } - - - // Handle. - .toolbar-icon.toolbar-handle { - width: 4em; - - &:focus { - outline: none; - } - } - - .toolbar-icon.toolbar-handle { - &:before { - color: #bebebe; - } - - &.open { - &:before { - color: #787878; - } - } - } - - .toolbar-toggle-orientation button.toolbar-icon { - &:after, - &:before { - color: #bebebe; - } - - &:hover:after, - &:focus:before { - color: #787878; - } - } - - // Vertical. - .toolbar-tray-vertical i.toolbar-icon {} - - // Sub-menu indicator in drop menus. - .toolbar-tray-horizontal { - .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - .menu-item--expanded > a, - .menu-item--expanded .toolbar-box > a { - &:after { - color: #bebebe; - } - } - } - } - - - // Menu styles. - .toolbar-menu { - background-color: #ffffff; - } - - .toolbar-menu, - [dir="rtl"] .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; - } - - .toolbar-tray-horizontal { - - // Sub menus (drop downs) - .toolbar-menu-administration { - .toolbar-menu .toolbar-menu { - box-shadow: 0 2px 1px 1px rgba(0, 0, 0, 0.255); - - .menu-item { - border-top: 1px solid #ffffff; - - &:first-child { - border-top-color: #dddddd; - } - } - - // Sub-sub menus - .toolbar-menu { - box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.255); - } - - > .menu-item--expanded > .toolbar-menu { - top: -1px; - } - } - } - - .menu-item { - + .menu-item { - [dir="rtl"] & {} - - &:last-child { - [dir="rtl"] & {} - } - } - - .menu-item { - &:last-child { - [dir="rtl"] & {} - } - - &:hover, - &:focus { - background-color: #f5f5f5; - } - } - } - } - - .toolbar-tray-vertical { - height: 100%; - - .toolbar-menu ul { - display: none; - } - - li.open > ul { - display: block; - } - - .toolbar-handle + a { - margin-right: 3em; - - [dir="rtl"] & { - margin-left: 3em; - margin-right: 0; - } - } - - .menu-item { - + .menu-item { - border-top: 1px solid #dddddd; - } - - &:last-child { - border-bottom: 1px solid #dddddd; - } - - .menu-item { - border: 0 none; - } - } - - .toolbar-menu ul ul { - border-bottom: 1px solid #dddddd; - border-top: 1px solid #dddddd; - } - - .menu-item:last-child > ul { - border-bottom: 0; - } - - .level-2 > ul { - background-color: #fafafa; - border-bottom-color: #cccccc; - border-top-color: #e5e5e5; - } - - .level-3 > ul { - background-color: #f5f5f5; - border-bottom-color: #c5c5c5; - border-top-color: #dddddd; - } - - .level-4 > ul { - background-color: #eeeeee; - border-bottom-color: #bbbbbb; - border-top-color: #d5d5d5; - } - - .level-5 > ul { - background-color: #e5e5e5; - border-bottom-color: #b5b5b5; - border-top-color: #cccccc; - } - - .level-6 > ul { - background-color: #eeeeee; - border-bottom-color: #aaaaaa; - border-top-color: #c5c5c5; - } - - .level-7 > ul { - background-color: #fafafa; - border-bottom-color: #b5b5b5; - border-top-color: #cccccc; - } - - .level-8 > ul { - background-color: #dddddd; - border-bottom-color: #cccccc; - border-top-color: #dddddd; - } - } -} - - -// Support for the Adminimal admin theme. -.adminimal { - &.toolbar-tray-open { - &.toolbar-fixed { - &.toolbar-horizontal { - &.toolbar-themes { - padding-top: 3rem !important; - } - - #toolbar-administration { - background-color: #333; - } - - &.toolbar-has-tabs #toolbar-administration { - min-height: 4em; - } - - &.toolbar-no-tabs #toolbar-administration { - min-height: 2.5em; - } - } - } - } - - &.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, - &.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs { - padding-top: 1.8em !important; - } - - &.toolbar-fixed.toolbar-vertical.toolbar-no-tabs { - padding-top: 0 !important; - } -} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/screenshot.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/mini/screenshot.png deleted file mode 100644 index 79dcd91b383723fefb03cb81e9fcc712ba38ec78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4782 zcmV;f5>f4mP)t=IXOB1|MxL5F+o8=zP`RVI5;;qH*arw+1S`TJUlu( zJCTx;)}?r$)ARPzpn-31)cgN$Z-M^$_VxMv+}zxi_?*u&;iQaprE_l&4<~Vcp4+^bd8gO0(Abv7?14T$)VPN|eY7GW9dC1rz^0M+-oDt_ zy!!n7|M1Rnb8^(yO;$9$*J=f|BV4-asPq(q6iynsH~(6mueQe9bH z&aHvtyoY)$4~M+sjY1FF#G)5ViNeg(LlhB&erJ=c#GJLzhCvSx8eFk_Izl@rC}pK^ zbbDSD4~}?_l)KxbU@t^_plOk^g|^R;RvQ{QLuNiXXNHoQnvZZo7%w|!%fO_iKR-ce za+#O3csppKc|<`EK|VgP|NsAQZ*Twq`tI%QMMXtNM@Qu4*dvwa&PBx*yw(Me?LEgr+IHUVS>t?chmO&rKP30iAjcGN&o-wcyD-SWoB=0m5Hv| z_tvI(Z*QE^@^5vTvvETI{pQr*?f?1SZ*!oonvMVV({+ukZ*Oz=_xJz*-mIdq&YWm? zpwj>4w!Pl1mySuyl z_Z0fNDTEMdLrZyc7667Fc6PW*%@IZz<8Uwz2jg%s4hQ3K{3)iirBr=-Xlbi$!bszA z=);o=$x>9D=(36t#uV+-ato5!)Filx$KWWf-r^^On#R8u&-z-=`DHzZUvPTg^cD`i zwmK3=B0L2f`ql*hN_4v8+R2*OimAHi!7xldSF==xZXSgCAeBS&yi zD8qw35mlaH>#DQv+^Li#ZC5INfhlZ+BSqC{`Wdl7*C7#}Pg=@%gFGzy6H(aMjug9d zuTe3!4;!-V%^K~s5V(VzMb%Kv55L(yk$I{5T~8te3+s)UGkB0WP9|pUr$TSXDID*F zSl>@mNfahLkiGHYE=pU9RvJ>flw}PS0tARJ!UC#Dh!1OsF{@8xH`#~P#K$=$5$IN= zTDs6|CH+MSQlpz@y9r65Wor=%8)VbJXV3h?TBdc#ZSOtzoHO5i^UcgD7+G_Mx8I+C za@_pqjBKUeTJng_NJ|JN5VsU))^8#Z+*A5Dd}%0O`jI6T%H<78cDime>tnNkCr(1w>4L zfC0aLx)q1k07ALR@Q-Jp3)97*@R0Bvg8+Rg>KB7nH}8lruxfGWjrchd+oA%G#Hcd| zAroNevfUb}LXY6Ggr3pSsXv=Z9wXQH-NEHXGPInci1pNX2+Yl#!01+4pb}pL>e8#H z7$)hD{3%LCO@?9SP(9Fz2?<9w3wQ*l&btYJ4?Q!Cq} zy1#j=`%rt*PKiV7MG!&o(PQ+`G(aI5;bB01re$vP8)G3w$m&|ayJI7Z{{&T684`a2m`hCTDsX=|RoR(xN4?FO=zY`)*i$Kn;+)x`RYA zofzjQi+<|f*-(5xJ4b148mC}5-ZyB8#IK^SfpsLoD#d}zywHq`v5;}HeMEu~2_l&+ z!&r?T$z=&WuHNjPh}_1G>D6Fm18e#VbE5|`UmmDlU9X{F5SWC&);ozWiYq7%@j@L5 zC=O*)i$i=w;s!*G_e=6vX;V)KS2G(M@gle-HeBQkcX$z~{0+wK$63-nU6i z!XJ|p64g^Ejw+0KcP>bA)IWEW)Er;fIdBK1LOqNfame`|WJb{}f>0x6&|(dgjD9b3 zmE}a7)x|*$<6B%DZ_#DZ>ZWVN2+abJw6Fmi3yzBAXtA#Dl6}X<#F2C|+}j1mVmi#G z$w`8GiscyBI|=fQ#LV&1tZ=LlNsRQ@<`9!NZ9|BXF?D23y=Wyhhjyo4w$nAoqJEsS6jzMUrnNvb z#dW3I9o3cM2x7%Byz#*|l5vJTp)Ed$-N0VvXG~V?X!_cQByjDgl_f|1-}&Kw@M*pN zFc(ME+|dHKbWDBov)8FvShzSMriqz1*WJo;bdquezDT^w=Aq?}`CZPEwrxY}`Puh} zv94*0?hq@g!xM7Kx#b-RuoZr-JiYJ~2}ni3hm&wDL5Kv0tlYAOtI;F46!b`OY$o+O zJ4Swl7akDez!GUAv16kI(&w_kN(Jc&F~VO<_RWmM*cio&N(E{CS@HMil58J-mA12= zi(`PUG7GTEy#?rD!V6LW1gmN<*?!zfJQ;wl02_pNEudKdYf3xdkhR_{%Nqk!8a;wbNl(ON zAapqS^-ycOpKK;Ue=NkY*#m{gaKs42=d!@czoG>u;jbm90Qz20amW|y$eOc?_SMOq zD(c{XeKj3O!MWI-x=l}?=Pu_&GNtTDg8gzkI0eFm{ZykzaH&j{OVIULngH+7mt7SD)kJ>k2#*zQq2$H? z?AWmhgisI!&^?6nPSjkm0jsi=`I(6pU|?V@29{xDNn!yGCW5&0Cf{gaVQ|KN6y9bH z6%?F|mXK zAu5MkVjt@3m>5oo?CjDZ4udch#_>;0O-++b)#9g?EZG6b62!#ZF2D&Yis1r?8ZJ^z zxD^$JJW0X>(R{xzY0{_v@am8WVjRRch;b0(I0gAZd&mV1>W~X+)j>iCI7~1m;5g(~ zg-r^#3#6AZkRG+K@V|Vaz+Iyogr@e0ep3Ynvkm{=#+Ky(DOm#HY?VHE=T|Jk|5aaD;qPpq2Mhf33 z2#qFvQ$>_hNlY9_;t&W^>hQE7qTCMhMFy z-%2h(s`LhVLN1qURuE=s2!Te2uO)SVA?#ImXO3=hXUwa1!hfGU7~l$uA}# zD2KJctwA6ffLl?T+215{f$k@Yaw*_&U%RNRK6B`5@uD*J z&D?Xxd(%qpxuXE&X%Y;YfWebF!rE&uufhr{FZGBODe!(YqRy*`aY%kjJzL>YTilaD zjHM{mi0!3ij&96?jrXcGWRA0lC&5#Hhr+fX_IUi*5)O*jlPcml$|dW5jO}09EI5M) zip~Q);9i}o=K{g+uKuWOaBgMo)bu82s94+dSTs0&X=JK)fHN>JZJhBET? zW)8gCh6!5gr$14vnOuMSGhAQss^aNetsY+uu)7y4T0Q=jrt&oGO_@NH88V`|$m5Tt zf+&8G!5&stG%Id+)iZLsuO)o*>R)Ygnym8W2xg&lEOT5quX7=9j@%z(!|vLx7XgmD zedUK{&b>Cw8EWy#CdYj+7QLagl;5ME0T|dC1;V`R;IAN7P+7?W-ANkw2Jt$RHd@yZ z!A|Y<*07tE0UG5MC8vgD!xem>|i< zc3=iEnYM>}N1p~J__5hW${VjTA7+e$&G95-g}#tj;hY8-;GFq>aD2j7jD zmHZe>clfHq-OL=>lFVV@a^{<2phw6DA1a$p=8@d5Tgt~|4wqRezui-gMT3*MnfEIP z3iAM%x1@D-Y&)vcQMppqi=DbTXps*t(H50Sh~S-&SByd`9QL2 zZ*w#*3mVIf#%TplhL?OS1L3){v)G@{9353+KlCB9TgCm1*k7tSEL;YovpS=Cz?};$ zota?+m5#ZoV^Q~}%cK@BPR>=W_P81*Sy^!zK!L~0q+H973#U`m_8giyI<><|Y!H~V zC4E@K(mwSO#Q7>JEg6*W`Vr+pC{Xk$M0o1;-#LPKo}E_m=8!USTHDX?eKfNw-_^_! zhyAdy@8>3tq)ys-;RIJ&^b1H&eD z(PNT>m7ve{XIvCH+68+Oav6kn{z58+r12EI3=g2q%&ro#I9@9D9pc0d<)2BVdG~{0 z!lu2J65;9MZLEXWf=yBk8v!L^arDHiwx!Bb^QZTS!(qYV=&N$1*avV}usCwyz+u7S z4dTdwHaIL;{3}MP1D0U|Mga{H2kS5aqX59(9iuu9Ltzxo0^F$;>QV`^#(OYm71}^h z=SrK9>M*~bxMOjAbWm~#qhWT7Mx zsds%xvX5h*mnG%NnbWl<`#1y+c~#(&2-(MxopbkfMx;dNTq(}ExLA$c-9tnILEn+& z-B!6z%aW1`XI0Ib9LC}PKHW%bPOv{oY``tO9 zs#%l&zE%!-b&xNJki$6E8Ic|@;@s;nsYZ^aCxzP79Z9Gn0dm1j$&$SaR7GpDk3&NL z<_OnC$UcsBM&!o!`XD_IvufnnBS`2BKn`|-e6SCx3r8FID@`vm52@z7si1dH1&%Kr!*^;Isxm=d)rKV?1-eg_o zNPfRHsXh*KB){L9v~gJfe;k&L!?JN$HV(_W{Tdq%FbYNi05+=L6k)(CV*mgE07*qo IM6N<$f>9h+xc~qF diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/_variables.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/_variables.scss deleted file mode 100644 index 67a09fadb..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/_variables.scss +++ /dev/null @@ -1,36 +0,0 @@ -// Seven SCSS variables. - -$font-family : "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", arial, sans-serif; -$font-size : 0.8125rem; - -$tap-highlight : rgba(0, 0, 0, 0); - -$toolbar-bar-color : #595959; -$toolbar-bar-background : #c9c9c2; -$toolbar-submenu-background-color : #fcfcfc; - -$drop-shadows : true; -$drop-shadow-color : rgba(168, 168, 168, 0.65); -$border-color : #e6e4df; - -$tab-item-height : $font-size * 2; -$toolbar-item-padding : 0.35em 0.95em .2em; - -$tab-color : #595959; -$tab-active-color : #1a1a1a; - -$tray-color : #1a1a1a; -$tray-active : #1a1a1a; -$tray-background : #ebebe6; - -$tray-vertical-background : $tray-background; -$tray-border-color : #e6e4df; - -$drop-menu-border-color : $border-color; -$drop-menu-background : #f5f5f2; -$sub-menu-indicator : #ccc; - -$toggle-orientation-color : #bfbfba; -$toggle-orientation-active : #1a1a1a; -$toggle-orientation-border-color : #bfbfba; - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/screenshot.png b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/screenshot.png deleted file mode 100644 index bb7649329b1166dc8bc01f3ba076cd8377f05136..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4933 zcmV-L6T0k)P)Hq)#=H%b-@a^vI>RDM??Cj_3>)-hK_wVoP{QUXz^YQ5C;^^k#PEJkAqf_L{ znP?gsmdW7CH{*1()tcB91T^@Uqmn7-C_p|Sk?;B~0c_wCW%yoVY?N|;p|8g-zPt+%S&^N(p! zx}bh>c5?Lb-x^kVplBLeg}{ARd-~$G8bOnmj$esE8n~fmi5eP#qtIbnF2mNjX^)Xe zK^j3pQyLmU8X6kw>*nd{`1tnZ>*n6x+V=PL`}_Oc!>H8M(i)Gw)GGj z&DZPY)bsqc(BIYM=GV!>(x-Im>&El*@5-7$)!W*eK^mdD!a*7u_Vx4i^zs@SbsC4Y zGqR*ww-^=Ug8fc+GccfGr8r16Z;@H6C)3fX9(5sJl$H~ajrC1so ziR<$3v345l(4wqp8o$D_czAgE`S{3^8X7@$tDUEIqrY|<8syEZR2oy9oSEa~=IH3? zSy^kG%HX5V=Ndto8X7uH_!nGWp9D7W_0+C>#)2393-D0)p^mLW$7DBo4Jq!yIu}#gB+?hn}~21BkxqM$a*<3|e0LcVU&?PQDHI=aEIhUNM=--|`HI}3NfC!bC zjvViNSN%_uR}}WQd9%#LeymBB5DL~s$WntPDP$xd-wT8Y8r?LDI^#ZaZp=%f1{&2e zrLmLIw_h+FfW>vtX;X1YrOTF7T1L0%WzKv}HoHjD;Q1)=vKHCe!fh0gF zr3;a{)=ghtMCE)nd;y9LKO6iEJ{S?63A41Y_H$Rajg}=i9ngc}LHlP=#IG-2Ct%dz z_eW1b-oyD&8oCUQj-^I!1-XFuoHT9;wzxGDx8Ula-rV#8RCqaNW=ROU-FE>KAaVt#^N zNgM~TcIc68`|li|K2mL;gA~Vom|b7_!8He6)2B*pB#tCJz1PaC?a01uA5kiAt~9_C z9)teZg=Ibz>T2bi{SOASF18B;esE-Z!^iLHMGqG-nA$Oq6CXKp#dv`+6lCn1jZRbRXY1hj0QS2z%4oftFwb z&V5;mi^cS)B!0JC>!?9U;^3JHw?ri!C{=&Do5UeIG~#$qemmuvIt?DU6d^X*}zWZ5Y;0X;UrqAJYF!o(1GIyty)Xc=M;n|Kcr987!Av70Y; zQzo9H;mY(wLFy2}X%fgY6U(@?BRIAwX6lr1^_2s6Io3UvE2W7Xb4|gJ5rSz4q12(O zQltp|kD?;yK1UQ?=|oDJPEOBJOJZzwTabwK*E;GDcE;cxtjrRXbYQ+d><9-?90##> zXr^wf5r_PP$T3&^eM}uIBifZ^7U`Vw!W( zVkQMw8yH8(3Ce3CR|P{xpmYgkU5XT;Rf@3BAv6-Jii3K&A0XtW5hRXUM=iow_=Dpv zg-SYLbUX*lIEh1a)Dy=lsFwewjyQbBh=n3)G*gHWI$AztMF%P;>9i4jIXA6`$~>BW zVv*yhFAfTy7_-Dd7yd;z=c`mXJQ9+!U?f?hxIWTq_~aiaSN?VhaqQg|Y`!YBEoKc- z-myTNP6~4PjM>JKZDfu1y_iYCttSqaBazXYgrOotX&I5Qx)fCj-7gNR97LRrf|^dz z8x4(MF;U{Ebv)=;;ffsPAojt_tP4RN#M+^MW~|SWbHM$q2BGu=vNWf9^C+RxtoNOu9Eu0DR4+aMK847fVz0#sg@%4Jj52EJ&?jBxFcbx2z28jgc?*;iX@?u zA|(#CYo1&Iw=oY-J3xwK4o23OF1v_CdarTRA|%l$a+Cwx?cZrB+$NB+Ln98^X4oy& zCZ!1*-`A}3c&Z)5wY>oVEOf8LFKy5eVBmg49EG-m?)9CV?wB5D_HedyS(8q53~sqLL15ZycaGK;n=c z|FUPrDhR_sv=mzt+#MW6EdD~jsiD+CqO)#J;-IengJZx!7k^5)mR@V?1q=y7`wn^~ zaPQt7Z)wxe=LIERuON>KL<=GbiOceW2i|JTi2YJQmRXGh9;$kzzEH@VfS2_WGaTay zHfmvF_+fvA&Zn7>75!0$JtT5sM<{9%BjTcsLK(QBRJS5r=*Obg=P78I#1%bJvBX9p zp%7G+1$=jhOl-{yNC+MDqTEx^Oz9yx;?G?JVkgD7WSBgjHk$DBMOW&LNQfUW_-}Iv zzRDo)w~ZhTH3XiPa4t zJFdoVrm&lkZnww z{prtU$Jj>AQAs9~_Yv>YQ~?>ABQC}!M7wvTITF6*-6R}}!V8&0VosCh>imxo>z_|S zp3K2HEtedk%4r;iun>iHVUW$KG2v90P%>%8p3-BIWR94FvBR$15Puvqm{nBfAe-Fp zOXV)ngO>iBUI$bxs9{l$cU+{&?)@r+$3+OwB0d(u{`o!Oa0u}@MEVhj&3(f_o2`mC zB2ugIHE1)^vd)pfoxHX%L*^JnTmaiFcY~C`pv{4C$ou?}5aKb)U#{YaA6CO)Yfg<_ zOktOjDIU3UA(xo^qO%lvbY_qRb47M!-;?gGiW*{ds~IlZ7(7_QnU(CA|))NRks}oS<=(Hwe41K%0kNyy>Up zIZubSj8Tw4HHTe@(i|v2L-?Ad2`Md`!_3X$^V7GdxH;rZJRi7;*Bw(NPHdk~sXwq9 z2ARebJAb-y?$@Wq=~Co9_7QuUDRxs*RkeTjW-?`N4&skeMg!_V8K@)Hk5M}3(9A)m zASuuC2D&-;+daYy7JvhY2Vi;U=pPaJIY&4&qnHE6e6#VeFee0gHRR^-tj`>VIkvh7 z6x^ygrZachc`MoB;WKOGXT=<eB-W+3f<|t!unK_8R zaJbQ>tQXOHN0SNpgArjExH;^?PSqR2?|&78r%-~r~~1#Egjl92Q`uTAf$1Wb{@z2 z)@}}inn?}IfPzKI6gx|?eO41qWyapUGI^cMVJdd1s{PTa495d_c`)N zbrwK1hjf)n$agwAsIm|km(4K>t6^YTNo{4Stzt4&mZ>({d)Qf`@jDuHK&RpY!c_qc z*QVEWLDB`1wl5DN4K^3Z&pR_5WAKx&jGr>qf!w)Tz2=Ck*l*5~A*RWNAVIPK3*L#tr$pO~l)N`?s-1q@77 z2WN%}7zGRfaZnvF4ihj67&vmN4fhWdFbV+d-7$*fFc1Y$2MbOs5(u3@APZlo@9=*c z6!>9o>;U?!BBYiB#m0!#v>2O%8rgxE z89Fa;B=MPGBTJ%l0fb)G?rS2Xmg9)n8IjCLALU5Mwrb?Iaaq^_Uf@VV6HmyJ`u=tk0Z^Q*Ni7GH zo*e0Q5t3RCLnAUEkRp$Tl^UtZGa^d!cO-#Ab|6K_IayM_uN45r$C}h~uR9*Y*j9=Zbm$b00000NkvXXu0mjf D^tgg? diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css deleted file mode 100644 index 53b8b3f57..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css +++ /dev/null @@ -1,46 +0,0 @@ -/** - * seven_icons - */ -#toolbar-administration .toolbar-icon { - padding: 0 .25em 0 0; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon { - fill: #595959; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon-menu { - width: 0.875em; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:active .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active .toolbar-icon, -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:hover .toolbar-icon, -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:active .toolbar-icon, -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button.is-active .toolbar-icon { - fill: #1a1a1a; -} - -@media only screen and (max-width: 24em) { - #toolbar-administration .toolbar-bar .home-toolbar-tab, - #toolbar-administration .toolbar-bar .tour-toolbar-tab, - #toolbar-administration .toolbar-bar .toolbar-tab__items-wrapper .toolbar-icon { - display: none; - } -} - -#toolbar-administration .toolbar-menu a { - fill: #1a1a1a; -} - -#toolbar-administration .toolbar-menu a:hover, #toolbar-administration .toolbar-menu a:focus, #toolbar-administration .toolbar-menu a:active, #toolbar-administration .toolbar-menu a.is-active { - fill: #1a1a1a; -} - -#toolbar-administration .toolbar-menu a.is-active[href="/"] { - fill: #1a1a1a; -} - -#toolbar-administration .toolbar-menu a:hover[href="/"], #toolbar-administration .toolbar-menu a:focus[href="/"], #toolbar-administration .toolbar-menu a:active[href="/"] { - fill: #1a1a1a; -} -/*# sourceMappingURL=seven_icons.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css.map deleted file mode 100644 index 3634c850f..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["seven_icons.scss","_variables.scss","seven_icons.css"],"names":[],"mappings":"AAAA;;GAEG;AAgBH;EAGI,qBAAoB;CACrB;;AAJH;EAYU,cCZiC;CDalC;;AAbT;EAgBU,eAAc;CACf;;AAjBT;;;;EAyBc,cCxB6B;CDyB9B;;AAOX;EAjCF;;;IAuCM,cAAa;GACd;CE9BJ;;AFVD;EA+CM,cC5CqC;CDgEtC;;AAnEL;EAqDQ,cCjDmC;CDkDpC;;AAtDP;EAyDQ,cCtDmC;CDuDpC;;AA1DP;EAgEU,cC5DiC;CD6DlC","file":"seven_icons.css","sourcesContent":[null,null,"/**\n * seven_icons\n */\n#toolbar-administration .toolbar-icon {\n padding: 0 .25em 0 0;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon {\n fill: #595959;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper .toolbar-icon-menu {\n width: 0.875em;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:active .toolbar-icon, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active .toolbar-icon,\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:hover .toolbar-icon,\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button:active .toolbar-icon,\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper button.is-active .toolbar-icon {\n fill: #1a1a1a;\n}\n\n@media only screen and (max-width: 24em) {\n #toolbar-administration .toolbar-bar .home-toolbar-tab,\n #toolbar-administration .toolbar-bar .tour-toolbar-tab,\n #toolbar-administration .toolbar-bar .toolbar-tab__items-wrapper .toolbar-icon {\n display: none;\n }\n}\n\n#toolbar-administration .toolbar-menu a {\n fill: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-menu a:hover, #toolbar-administration .toolbar-menu a:focus, #toolbar-administration .toolbar-menu a:active, #toolbar-administration .toolbar-menu a.is-active {\n fill: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-menu a.is-active[href=\"/\"] {\n fill: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-menu a:hover[href=\"/\"], #toolbar-administration .toolbar-menu a:focus[href=\"/\"], #toolbar-administration .toolbar-menu a:active[href=\"/\"] {\n fill: #1a1a1a;\n}\n\n/*# sourceMappingURL=seven_icons.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.scss deleted file mode 100644 index 2f74004d8..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_icons.scss +++ /dev/null @@ -1,90 +0,0 @@ -/** - * seven_icons - */ - -// Import global variables. -@import "variables"; - - -// Most icons are embedded SVG. Icons are embedded using Grunticon. We are using -// the original SVG icons from Drupal core, however the width and height -// attribute have been replaced with a viewBox attribute so we can scale them -// properly with CSS. Embedded SVG has the advantage of being styled with CSS, -// and by using Grunticon JS loading we negate most of the bloat and overhead -// associated with embedding SVG files. For the buttons (orientation toggles & -// menu click handles), and for sub-menu indicators we use a custom font icon -// that is tiny and only includes four icons. We rotate and color these in CSS -// as required. - -#toolbar-administration { - - .toolbar-icon { - padding: 0 .25em 0 0; - } - - - // Top level icons. - .toolbar-bar { - .toolbar-tab { - .toolbar-tab__items-wrapper { - .toolbar-icon { - fill: $tab-color ; - } - - .toolbar-icon-menu { - width: 0.875em; - } - - a, - button { - &:hover, - &:active, - &.is-active { - .toolbar-icon { - fill: $tab-active-color; - } - } - } - } - } - } - - @media only screen and (max-width: 24em) { - // Toolbar-themes module cannot hide the text, so instead we remove the - // icons and other redundant tabs in narrow screens. - .toolbar-bar .home-toolbar-tab, - .toolbar-bar .tour-toolbar-tab, - .toolbar-bar .toolbar-tab__items-wrapper .toolbar-icon { - display: none; - } - } - - - // Main menu icons. - .toolbar-menu { - a { - fill: $tray-color; - - &:hover, - &:focus, - &:active, - &.is-active { - fill: $tray-active; - } - - &.is-active[href="/"] { - fill: $tray-color; - } - - &:hover, - &:focus, - &:active { - &[href="/"] { - fill: $tray-active; - } - } - } - } -} - - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css deleted file mode 100644 index 9a517649b..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css +++ /dev/null @@ -1,368 +0,0 @@ -/** - * seven_theme - * Theme styles for menus and other toolbar elements. SVG icons are styled in - * the [theme]_icons.scss file, while click handles, e.g. origination buttons - * are styled here. - */ -body .toolbar-no-tabs { - padding-top: 1.625rem !important; -} - -#toolbar-administration { - font-family: "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", arial, sans-serif; - font-weight: 400; - font-size: 0.8125rem; - height: 3.25rem; - background-color: #c9c9c2; - -webkit-tap-highlight-color: transparent; -} - -.toolbar-vertical #toolbar-administration, -.toolbar-no-tabs #toolbar-administration, -#toolbar-administration .toolbar-tab, -#toolbar-administration .toolbar-tray { - height: 1.625rem; -} - -#toolbar-administration .toolbar-tray { - top: 1.625rem; -} - -#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus, -#toolbar-administration .toolbar-item a:hover, -#toolbar-administration .toolbar-item a:focus { - text-decoration: none; - outline: none; -} - -#toolbar-administration .toolbar-item { - padding: 0.35em 0.95em 0.2em; - display: block; -} - -#toolbar-administration .toolbar__link-label { - font-size: 1em; -} - -#toolbar-administration .toolbar-bar { - background-color: #c9c9c2; - color: #595959; - -webkit-box-shadow: -1px 0 3px 1px rgba(168, 168, 168, 0.65); - box-shadow: -1px 0 3px 1px rgba(168, 168, 168, 0.65); -} - -#toolbar-administration .toolbar-bar.no-tabs { - background-color: #ebebe6; -} - -[dir="rtl"] #toolbar-administration .toolbar-bar { - -webkit-box-shadow: 1px 0 3px 1px rgba(168, 168, 168, 0.65); - box-shadow: 1px 0 3px 1px rgba(168, 168, 168, 0.65); -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a { - color: #595959; -} - -#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:focus, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active { - color: #1a1a1a; - background-image: -webkit-gradient(linear, left top, left bottom, from(#c9c9c2), to(#ebebe6)); - background-image: -webkit-linear-gradient(#c9c9c2, #ebebe6); - background-image: -o-linear-gradient(#c9c9c2, #ebebe6); - background-image: linear-gradient(#c9c9c2, #ebebe6); -} - -#toolbar-administration .toolbar-bar .tour-toolbar-tab.toolbar-tab { - float: none; -} - -#toolbar-administration .toolbar-bar .tour-toolbar-tab button.toolbar-item { - padding: 0.35em 0.95em 0.2em; -} - -#toolbar-administration .toolbar-lining button:focus { - outline: none; -} - -#toolbar-administration .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; -} - -#toolbar-administration .toolbar-box a:focus { - outline: none; -} - -#toolbar-administration .toolbar-box a:hover:focus { - text-decoration: none; -} - -#toolbar-administration .toolbar-tray { - background-color: #ebebe6; -} - -#toolbar-administration .toolbar-tray a { - color: #1a1a1a; - cursor: pointer; - padding: 0.35em 0.95em 0.2em; -} - -#toolbar-administration .toolbar-tray a:hover, #toolbar-administration .toolbar-tray a:active, #toolbar-administration .toolbar-tray a:focus, #toolbar-administration .toolbar-tray a.is-active { - color: #1a1a1a; -} - -#toolbar-administration .toolbar-tray a.is-active[href="/"] { - color: #1a1a1a; -} - -#toolbar-administration .toolbar-tray-horizontal { - border-bottom: 1px solid #e6e4df; - -webkit-box-shadow: -2px 1px 3px 1px rgba(168, 168, 168, 0.65); - box-shadow: -2px 1px 3px 1px rgba(168, 168, 168, 0.65); -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal { - -webkit-box-shadow: 2px 1px 3px 1px rgba(168, 168, 168, 0.65); - box-shadow: 2px 1px 3px 1px rgba(168, 168, 168, 0.65); -} - -#toolbar-administration .toolbar-tray-horizontal a:focus { - outline: none; - background-color: #ebebe6; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu { - background-color: #f5f5f2; - -webkit-box-shadow: 0 2px 1px 1px rgba(168, 168, 168, 0.65); - box-shadow: 0 2px 1px 1px rgba(168, 168, 168, 0.65); -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item { - border-top: 1px solid #ebebe6; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item:first-child { - border-top-color: #ebebe6; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .toolbar-menu { - -webkit-box-shadow: 2px 2px 2px 0 rgba(168, 168, 168, 0.65); - box-shadow: 2px 2px 2px 0 rgba(168, 168, 168, 0.65); -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-menu { - top: -1px; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a { - border-right: 1px solid; - border-color: #ebebe6; - -webkit-border-image: -webkit-gradient(linear, left bottom, left top, from(#e6e4df), to(#ebebe6)) 1 100%; - -webkit-border-image: -webkit-linear-gradient(bottom, #e6e4df, #ebebe6) 1 100%; - -o-border-image: -o-linear-gradient(bottom, #e6e4df, #ebebe6) 1 100%; - border-image: -webkit-gradient(linear, left bottom, left top, from(#e6e4df), to(#ebebe6)) 1 100%; - border-image: linear-gradient(to top, #e6e4df, #ebebe6) 1 100%; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a, [dir="rtl"] -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a { - border-right: 0; - border-left: 1px solid; -} - -#toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:hover, #toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:focus { - background-color: #ebebe6; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:after { - color: #ccc; - right: 0.65em; - top: 0.2em; - display: block; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:hover:after, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:focus:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:hover:after, -#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:focus:after { - color: #1a1a1a; -} - -#toolbar-administration .toolbar-tray-horizontal .edit-shortcuts { - float: none; - position: absolute; - right: 2.2em; - top: 0; -} - -#toolbar-administration .toolbar-tray-vertical { - background-color: #ebebe6; - border-right: 1px solid #e6e4df; - height: 100%; - -webkit-box-shadow: 0 5px 5px 2px rgba(168, 168, 168, 0.65); - box-shadow: 0 5px 5px 2px rgba(168, 168, 168, 0.65); -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical { - border-left: 1px solid #e6e4df; - border-right: 0 none; - -webkit-box-shadow: 1px 0 5px 2px rgba(168, 168, 168, 0.65); - box-shadow: 1px 0 5px 2px rgba(168, 168, 168, 0.65); -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu { - display: none; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu { - display: block; - border-bottom-width: 0; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu .toolbar-menu { - border-bottom-width: 1px; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-handle + a { - margin-right: 3em; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-vertical .toolbar-handle + a { - margin-left: 3em; - margin-right: 0; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item + .menu-item { - border-top: 1px solid #e6e4df; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item:last-child { - border-bottom: 1px solid #e6e4df; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item .menu-item { - border: 0 none; -} - -#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:hover, -#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:focus { - background-color: #f6f6f4; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu.root { - border: 0; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu { - border-bottom: 1px solid; - border-top: 1px solid; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-1 > ul { - background-color: #efefef; - border-bottom-color: #dbd8d1; - border-top-color: #dbd8d1; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-2 > ul { - background-color: #e3e3e3; - border-bottom-color: #d0ccc2; - border-top-color: #d0ccc2; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-3 > ul { - background-color: #d6d6d6; - border-bottom-color: #c4c0b4; - border-top-color: #c4c0b4; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-4 > ul { - background-color: #c9c9c9; - border-bottom-color: #b9b4a6; - border-top-color: #b9b4a6; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-5 > ul { - background-color: #bcbcbc; - border-bottom-color: #aea897; - border-top-color: #aea897; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-6 > ul { - background-color: #b0b0b0; - border-bottom-color: #a39c89; - border-top-color: #a39c89; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-7 > ul { - background-color: #a3a3a3; - border-bottom-color: #988f7b; - border-top-color: #988f7b; -} - -#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-8 > ul { - background-color: #969696; - border-bottom-color: #8c836d; - border-top-color: #8c836d; -} - -#toolbar-administration .menu-item:last-child > .toolbar-menu { - border-bottom: 0; -} - -#toolbar-administration .toolbar-icon.toolbar-handle:before { - color: #bfbfba; -} - -#toolbar-administration .toolbar-icon.toolbar-handle.open:before { - color: #1a1a1a; -} - -#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before { - color: #bfbfba; -} - -#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus:before { - color: #1a1a1a; - background-color: transparent; -} - -#toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 1px solid #bfbfba; -} - -[dir="rtl"] #toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 0 none; - border-right: 1px solid #bfbfba; -} - -#toolbar-administration .toolbar-toggle-orientation [value="horizontal"]:after { - right: 0.95em; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-themes { - padding-top: 3rem !important; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal #toolbar-administration { - background-color: #333; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-has-tabs #toolbar-administration { - min-height: 4em; -} - -.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs #toolbar-administration { - min-height: 2.5em; -} - -.adminimal.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, .adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs { - padding-top: 1.8em !important; -} - -.adminimal.toolbar-fixed.toolbar-vertical.toolbar-no-tabs { - padding-top: 0 !important; -} -/*# sourceMappingURL=seven_theme.css.map */ \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css.map b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css.map deleted file mode 100644 index 379f79a81..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["seven_theme.scss","_variables.scss","seven_theme.css"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;EAEI,iCAAwC;CACzC;;AAGH;EACE,qGCfyH;EDgBzH,iBAAgB;EAChB,qBChB2C;EDiB3C,gBAA4B;EAC5B,0BCbyC;EDczC,yCCjBkD;CDgYnD;;AA7WC;;;;EAIE,iBCb8C;CDc/C;;AAbH;EAgBI,cCjB8C;CDkB/C;;AAjBH;;;EAwBQ,sBAAqB;EACrB,cAAa;CACd;;AA1BP;EA+BI,6BC/BkD;EDgClD,eAAc;CACf;;AAjCH;EAoCI,eAAc;CACf;;AArCH;EA0CI,0BClDuC;EDmDvC,eCpDuC;ED2DrC,6DCtDuD;UDsDvD,qDCtDuD;CD2F1D;;AAvFH;EA8CM,0BAAyB;CAC1B;;AEPL;EFaQ,4DCzDqD;UDyDrD,oDCzDqD;CD0DtD;;AAtDP;EAmEM,eCjEqC;CDyEtC;;AA3EL;EAwEQ,eCrEmC;EDsEnC,8FAA4E;EAA5E,4DAA4E;EAA5E,uDAA4E;EAA5E,oDAA4E;CAC7E;;AA1EP;EAgFQ,YAAW;CACZ;;AAjFP;EAoFQ,6BCpF8C;CDqF/C;;AArFP;EA4FI,cAAa;CACd;;AA7FH;EAkGI,iBAAgB;EAChB,UAAS;EACT,WAAU;CACX;;AArGH;EA4GM,cAAa;CACd;;AA7GL;EAgHM,sBAAqB;CACtB;;AAjHL;EAuHI,0BChHuC;CDkIxC;;AAzIH;EA0HM,eCrHqC;EDsHrC,gBAAe;EACf,6BC5HgD;CDwIjD;;AAxIL;EAkIQ,eC5HmC;CD6HpC;;AAnIP;EAsIQ,eCjImC;CDkIpC;;AAvIP;EA8II,iCCjJuC;EDoJrC,+DCrJuD;UDqJvD,uDCrJuD;CD8O1D;;AEpIH;EF8CQ,8DCxJqD;UDwJrD,sDCxJqD;CDyJtD;;AArJP;EAyJM,cAAa;EACb,0BCnJqC;CDoJtC;;AA3JL;EAgKQ,0BCnJmC;EDsJjC,4DCvKmD;UDuKnD,oDCvKmD;CD4LtD;;AAxLP;EAuKU,8BChKiC;CDqKlC;;AA5KT;EA0KY,0BCnK+B;CDoKhC;;AA3KX;EAiLY,4DCrLiD;UDqLjD,oDCrLiD;CDuLpD;;AAnLT;EAsLU,UAAS;CACV;;AAvLT;;EA4LQ,wBAAuB;EACvB,sBCtLmC;EDuLnC,yGAAkF;EAAlF,+EAAkF;OAAlF,qEAAkF;UAAlF,iGAAkF;UAAlF,+DAAkF;CAMnF;;AEzDP;;EFsDU,gBAAe;EACf,uBAAsB;CACvB;;AAnMT;EA2MU,0BCpMiC;CDqMlC;;AA5MT;;EAqNU,YCvM8B;EDwM9B,cAAa;EACb,WAAU;EACV,eAAc;CACf;;AAzNT;;;EA8NY,eCxN+B;CDyNhC;;AA/NX;EAqOM,YAAW;EACX,mBAAkB;EAClB,aAAY;EACZ,OAAM;CACP;;AAzOL;EA+OI,0BCxOuC;EDyOvC,gCCnPuC;EDoPvC,aAAY;EAGV,4DCxPuD;UDwPvD,oDCxPuD;CDmU1D;;AE9IH;EFwEM,+BC5PqC;ED6PrC,qBAAoB;EAGlB,4DCjQqD;UDiQrD,oDCjQqD;CDmQxD;;AA/PL;EAkQM,cAAa;CACd;;AAnQL;EAsQM,eAAc;EACd,uBAAsB;CAKvB;;AA5QL;EA0QQ,yBAAwB;CACzB;;AA3QP;EA+QM,kBAAiB;CAMlB;;AE7EL;EF0EQ,iBAAgB;EAChB,gBAAe;CAChB;;AApRP;EAyRQ,8BC/QmC;CDgRpC;;AA1RP;EA6RQ,iCCnRmC;CDoRpC;;AA9RP;EAiSQ,eAAc;CACf;;AAlSP;;EAsSQ,0BAA+C;CAChD;;AAvSP;EA4SQ,UAAS;CACV;;AA7SP;EAgTQ,yBAAwB;EACxB,sBAAqB;CACtB;;AAlTP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EA0TQ,0BAAuE;EACvE,6BAAuD;EACvD,0BAAuD;CACxD;;AA7TP;EAkUI,iBAAgB;CACjB;;AAnUH;EAyUM,eCzTqC;CD0TtC;;AA1UL;EA8UQ,eC7TmC;CD8TpC;;AA/UP;EAsVM,eCtUqC;CDuUtC;;AAvVL;EA6VM,eC5UqC;ED6UrC,8BAA6B;CAC9B;;AA/VL;EA0WI,+BCxVuC;CD8VxC;;AEhEH;EF6DM,oBAAmB;EACnB,gCC5VqC;CD6VtC;;AA/WL;EAmXI,cAAa;CACd;;AAIH;EAKU,6BAA4B;CAC7B;;AANT;EASU,uBAAsB;CACvB;;AAVT;EAaU,gBAAe;CAChB;;AAdT;EAiBU,kBAAiB;CAClB;;AAlBT;EAyBI,8BAA6B;CAC9B;;AA1BH;EA6BI,0BAAyB;CAC1B","file":"seven_theme.css","sourcesContent":[null,null,"/**\n * seven_theme\n * Theme styles for menus and other toolbar elements. SVG icons are styled in\n * the [theme]_icons.scss file, while click handles, e.g. origination buttons\n * are styled here.\n */\nbody .toolbar-no-tabs {\n padding-top: 1.625rem !important;\n}\n\n#toolbar-administration {\n font-family: \"Lucida Grande\", \"Lucida Sans Unicode\", \"DejaVu Sans\", \"Lucida Sans\", arial, sans-serif;\n font-weight: 400;\n font-size: 0.8125rem;\n height: 3.25rem;\n background-color: #c9c9c2;\n -webkit-tap-highlight-color: transparent;\n}\n\n.toolbar-vertical #toolbar-administration,\n.toolbar-no-tabs #toolbar-administration,\n#toolbar-administration .toolbar-tab,\n#toolbar-administration .toolbar-tray {\n height: 1.625rem;\n}\n\n#toolbar-administration .toolbar-tray {\n top: 1.625rem;\n}\n\n#toolbar-administration .toolbar-tab a:hover, #toolbar-administration .toolbar-tab a:focus,\n#toolbar-administration .toolbar-item a:hover,\n#toolbar-administration .toolbar-item a:focus {\n text-decoration: none;\n outline: none;\n}\n\n#toolbar-administration .toolbar-item {\n padding: 0.35em 0.95em 0.2em;\n display: block;\n}\n\n#toolbar-administration .toolbar__link-label {\n font-size: 1em;\n}\n\n#toolbar-administration .toolbar-bar {\n background-color: #c9c9c2;\n color: #595959;\n box-shadow: -1px 0 3px 1px rgba(168, 168, 168, 0.65);\n}\n\n#toolbar-administration .toolbar-bar.no-tabs {\n background-color: #ebebe6;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-bar {\n box-shadow: 1px 0 3px 1px rgba(168, 168, 168, 0.65);\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a {\n color: #595959;\n}\n\n#toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:hover, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a:focus, #toolbar-administration .toolbar-bar .toolbar-tab .toolbar-tab__items-wrapper a.is-active {\n color: #1a1a1a;\n background-image: linear-gradient(#c9c9c2, #ebebe6);\n}\n\n#toolbar-administration .toolbar-bar .tour-toolbar-tab.toolbar-tab {\n float: none;\n}\n\n#toolbar-administration .toolbar-bar .tour-toolbar-tab button.toolbar-item {\n padding: 0.35em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar-lining button:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-menu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n#toolbar-administration .toolbar-box a:focus {\n outline: none;\n}\n\n#toolbar-administration .toolbar-box a:hover:focus {\n text-decoration: none;\n}\n\n#toolbar-administration .toolbar-tray {\n background-color: #ebebe6;\n}\n\n#toolbar-administration .toolbar-tray a {\n color: #1a1a1a;\n cursor: pointer;\n padding: 0.35em 0.95em 0.2em;\n}\n\n#toolbar-administration .toolbar-tray a:hover, #toolbar-administration .toolbar-tray a:active, #toolbar-administration .toolbar-tray a:focus, #toolbar-administration .toolbar-tray a.is-active {\n color: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-tray a.is-active[href=\"/\"] {\n color: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-tray-horizontal {\n border-bottom: 1px solid #e6e4df;\n box-shadow: -2px 1px 3px 1px rgba(168, 168, 168, 0.65);\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal {\n box-shadow: 2px 1px 3px 1px rgba(168, 168, 168, 0.65);\n}\n\n#toolbar-administration .toolbar-tray-horizontal a:focus {\n outline: none;\n background-color: #ebebe6;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu {\n background-color: #f5f5f2;\n box-shadow: 0 2px 1px 1px rgba(168, 168, 168, 0.65);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item {\n border-top: 1px solid #ebebe6;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .menu-item:first-child {\n border-top-color: #ebebe6;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu .toolbar-menu {\n box-shadow: 2px 2px 2px 0 rgba(168, 168, 168, 0.65);\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration .toolbar-menu .toolbar-menu > .menu-item--expanded > .toolbar-menu {\n top: -1px;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a {\n border-right: 1px solid;\n border-color: #ebebe6;\n border-image: linear-gradient(to top, #e6e4df, #ebebe6) 1 100%;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > a, [dir=\"rtl\"]\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu > .menu-item > .toolbar-box a {\n border-right: 0;\n border-left: 1px solid;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:hover, #toolbar-administration .toolbar-tray-horizontal .menu-item .menu-item:focus {\n background-color: #ebebe6;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:after {\n color: #ccc;\n right: 0.65em;\n top: 0.2em;\n display: block;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:hover:after, #toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded > a:focus:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:hover:after,\n#toolbar-administration .toolbar-tray-horizontal .toolbar-menu-administration > .toolbar-menu .toolbar-menu > .menu-item--expanded .toolbar-box > a:focus:after {\n color: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .edit-shortcuts {\n float: none;\n position: absolute;\n right: 2.2em;\n top: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical {\n background-color: #ebebe6;\n border-right: 1px solid #e6e4df;\n height: 100%;\n box-shadow: 0 5px 5px 2px rgba(168, 168, 168, 0.65);\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical {\n border-left: 1px solid #e6e4df;\n border-right: 0 none;\n box-shadow: 1px 0 5px 2px rgba(168, 168, 168, 0.65);\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu {\n display: none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu {\n display: block;\n border-bottom-width: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item--expanded.open > .toolbar-menu .toolbar-menu {\n border-bottom-width: 1px;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-handle + a {\n margin-right: 3em;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-vertical .toolbar-handle + a {\n margin-left: 3em;\n margin-right: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item + .menu-item {\n border-top: 1px solid #e6e4df;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item:last-child {\n border-bottom: 1px solid #e6e4df;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item .menu-item {\n border: 0 none;\n}\n\n#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:hover,\n#toolbar-administration .toolbar-tray-vertical .menu-item .toolbar-box:focus {\n background-color: #f6f6f4;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu.root {\n border: 0;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu .toolbar-menu {\n border-bottom: 1px solid;\n border-top: 1px solid;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-1 > ul {\n background-color: #efefef;\n border-bottom-color: #dbd8d1;\n border-top-color: #dbd8d1;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-2 > ul {\n background-color: #e3e3e3;\n border-bottom-color: #d0ccc2;\n border-top-color: #d0ccc2;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-3 > ul {\n background-color: #d6d6d6;\n border-bottom-color: #c4c0b4;\n border-top-color: #c4c0b4;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-4 > ul {\n background-color: #c9c9c9;\n border-bottom-color: #b9b4a6;\n border-top-color: #b9b4a6;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-5 > ul {\n background-color: #bcbcbc;\n border-bottom-color: #aea897;\n border-top-color: #aea897;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-6 > ul {\n background-color: #b0b0b0;\n border-bottom-color: #a39c89;\n border-top-color: #a39c89;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-7 > ul {\n background-color: #a3a3a3;\n border-bottom-color: #988f7b;\n border-top-color: #988f7b;\n}\n\n#toolbar-administration .toolbar-tray-vertical .toolbar-menu > .level-8 > ul {\n background-color: #969696;\n border-bottom-color: #8c836d;\n border-top-color: #8c836d;\n}\n\n#toolbar-administration .menu-item:last-child > .toolbar-menu {\n border-bottom: 0;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle:before {\n color: #bfbfba;\n}\n\n#toolbar-administration .toolbar-icon.toolbar-handle.open:before {\n color: #1a1a1a;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:before {\n color: #bfbfba;\n}\n\n#toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:hover:after, #toolbar-administration .toolbar-toggle-orientation button.toolbar-icon:focus:before {\n color: #1a1a1a;\n background-color: transparent;\n}\n\n#toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation {\n border-left: 1px solid #bfbfba;\n}\n\n[dir=\"rtl\"] #toolbar-administration .toolbar-tray-horizontal .toolbar-toggle-orientation {\n border-left: 0 none;\n border-right: 1px solid #bfbfba;\n}\n\n#toolbar-administration .toolbar-toggle-orientation [value=\"horizontal\"]:after {\n right: 0.95em;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-themes {\n padding-top: 3rem !important;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal #toolbar-administration {\n background-color: #333;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-has-tabs #toolbar-administration {\n min-height: 4em;\n}\n\n.adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs #toolbar-administration {\n min-height: 2.5em;\n}\n\n.adminimal.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, .adminimal.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs {\n padding-top: 1.8em !important;\n}\n\n.adminimal.toolbar-fixed.toolbar-vertical.toolbar-no-tabs {\n padding-top: 0 !important;\n}\n\n/*# sourceMappingURL=seven_theme.css.map */"]} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.scss b/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.scss deleted file mode 100644 index 6b960b176..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/themes/seven/seven_theme.scss +++ /dev/null @@ -1,425 +0,0 @@ -/** - * seven_theme - * Theme styles for menus and other toolbar elements. SVG icons are styled in - * the [theme]_icons.scss file, while click handles, e.g. origination buttons - * are styled here. - */ - -// Import global variables. -@import "variables"; - -body { - .toolbar-no-tabs { - padding-top: $tab-item-height !important; - } -} - -#toolbar-administration { - font-family: $font-family; - font-weight: 400; - font-size: $font-size; - height: $tab-item-height * 2; - background-color: $toolbar-bar-background; - -webkit-tap-highlight-color: $tap-highlight; - - .toolbar-vertical &, - .toolbar-no-tabs &, - .toolbar-tab, - .toolbar-tray { - height: $tab-item-height; - } - - .toolbar-tray { - top: $tab-item-height; - } - - .toolbar-tab, - .toolbar-item { - a { - &:hover, - &:focus { - text-decoration: none; - outline: none; - } - } - } - - .toolbar-item { - padding: $toolbar-item-padding; - display: block; - } - - .toolbar__link-label { - font-size: 1em; - } - - - // Toolbar bar. - .toolbar-bar { - background-color: $toolbar-bar-background; - color: $toolbar-bar-color; - - &.no-tabs { - background-color: #ebebe6; - } - - @if $drop-shadows == true { - box-shadow: -1px 0 3px 1px $drop-shadow-color; - - [dir="rtl"] & { - box-shadow: 1px 0 3px 1px $drop-shadow-color; - } - } - - .toolbar-item { - &:hover, - &:focus, - &:active, - &.is-active { - - } - } - - .toolbar-tab .toolbar-tab__items-wrapper a { - color: $tab-color; - - &:hover, - &:focus, - &.is-active { - color: $tab-active-color; - background-image: linear-gradient($toolbar-bar-background, $tray-background); - } - } - - // Tour is a button. - .tour-toolbar-tab { - &.toolbar-tab { - float: none; // Override tour module CSS. - } - - button.toolbar-item { - padding: $toolbar-item-padding; - } - } - } - - - // Button reset. - .toolbar-lining button:focus { - outline: none; - } - - - // Menu reset. - .toolbar-menu { - list-style: none; - margin: 0; - padding: 0; - } - - - // Wrapper around list item items, injected when tray is vertical (and - // persists even if toggled back to vertical). - .toolbar-box a { - &:focus { - outline: none; - } - - &:hover:focus { - text-decoration: none; - } - } - - - // Toolbar tray. - .toolbar-tray { - background-color: $tray-background; - - a { - color: $tray-color; - cursor: pointer; - padding: $toolbar-item-padding; - - &:hover, - &:active, - &:focus, - &.is-active { - color: $tray-active; - } - - &.is-active[href="/"] { - color: $tray-color; - } - } - } - - - // Horizontal tray. - .toolbar-tray-horizontal { - border-bottom: 1px solid $border-color; - - @if $drop-shadows == true { - box-shadow: -2px 1px 3px 1px $drop-shadow-color; - - [dir="rtl"] & { - box-shadow: 2px 1px 3px 1px $drop-shadow-color; - } - } - - a:focus { - outline: none; - background-color: $tray-background; - } - - // Admin Toolbar Module drop menus. - .toolbar-menu-administration { - .toolbar-menu .toolbar-menu { - background-color: $drop-menu-background ; - - @if $drop-shadows == true { - box-shadow: 0 2px 1px 1px $drop-shadow-color; - } - - .menu-item { - border-top: 1px solid $tray-background; - - &:first-child { - border-top-color: $tray-background; - } - } - - // Sub-sub menus - .toolbar-menu { - @if $drop-shadows == true { - box-shadow: 2px 2px 2px 0 $drop-shadow-color; - } - } - - > .menu-item--expanded > .toolbar-menu { - top: -1px; - } - } - - > .toolbar-menu > .menu-item > a, - > .toolbar-menu > .menu-item > .toolbar-box a { - border-right: 1px solid; - border-color: $tray-background; - border-image: linear-gradient(to top, $tray-border-color, $tray-background) 1 100%; - - [dir="rtl"] & { - border-right: 0; - border-left: 1px solid; - } - } - } - - .menu-item { - .menu-item { - &:hover, - &:focus { - background-color: $tray-background; - } - } - } - - // Sub-menu indicator in drop menus. - .toolbar-menu-administration > .toolbar-menu .toolbar-menu { - > .menu-item--expanded > a, - > .menu-item--expanded .toolbar-box > a { - &:after { - color: $sub-menu-indicator; - right: 0.65em; - top: 0.2em; - display: block; - } - - &:hover, - &:focus { - &:after { - color: $tray-active; - } - } - } - } - - .edit-shortcuts { - float: none; // Override shortcut module CSS. - position: absolute; - right: 2.2em; - top: 0; - } - } - - - // Vertical tray. - .toolbar-tray-vertical { - background-color: $tray-vertical-background; - border-right: 1px solid $border-color; - height: 100%; - - @if $drop-shadows == true { - box-shadow: 0 5px 5px 2px $drop-shadow-color; - } - - - [dir="rtl"] & { - border-left: 1px solid $border-color; - border-right: 0 none; - - @if $drop-shadows == true { - box-shadow: 1px 0 5px 2px $drop-shadow-color; - } - } - - .toolbar-menu .toolbar-menu { - display: none; - } - - .menu-item--expanded.open > .toolbar-menu { - display: block; - border-bottom-width: 0; - - .toolbar-menu { - border-bottom-width: 1px; - } - } - - .toolbar-handle + a { - margin-right: 3em; - - [dir="rtl"] & { - margin-left: 3em; - margin-right: 0; - } - } - - .menu-item { - + .menu-item { - border-top: 1px solid $tray-border-color; - } - - &:last-child { - border-bottom: 1px solid $tray-border-color; - } - - .menu-item { - border: 0 none; - } - - .toolbar-box:hover, - .toolbar-box:focus { - background-color: lighten($tray-background, 5%); - } - } - - .toolbar-menu { - &.root { - border: 0; - } - - .toolbar-menu { - border-bottom: 1px solid; - border-top: 1px solid; - } - } - - // Loop to generate nested selectors and styles. - $self: '.toolbar-menu'; - @for $i from 1 through 8 { - $self: if($i == 1, "ul", nest($self, "ul")) !global; - #{$self} > .level-#{$i} > ul { - background-color: darken($toolbar-submenu-background-color , 5 * $i); - border-bottom-color: darken($tray-border-color, 5 * $i); - border-top-color: darken($tray-border-color, 5 * $i); - } - } - } - - .menu-item:last-child > .toolbar-menu { - border-bottom: 0; - } - - - // Click handles. - .toolbar-icon.toolbar-handle { - &:before { - color: $toggle-orientation-color; - } - - &.open { - &:before { - color: $toggle-orientation-active; - } - } - } - - .toolbar-toggle-orientation button.toolbar-icon { - &:after, - &:before { - color: $toggle-orientation-color; - } - - &:hover, - &:focus, - &:hover:after, - &:focus:before { - color: $toggle-orientation-active; - background-color: transparent; - } - } - - - // Orientation toggles and handles - .toolbar-toggle-orientation { - button {} - > .toolbar-lining {} - } - - .toolbar-tray-horizontal .toolbar-toggle-orientation { - border-left: 1px solid $toggle-orientation-border-color; - - [dir="rtl"] & { - border-left: 0 none; - border-right: 1px solid $toggle-orientation-border-color; - } - } - - .toolbar-toggle-orientation [value="horizontal"]:after { - right: 0.95em; - } -} - -// Support for the Adminimal admin theme. -.adminimal { - &.toolbar-tray-open { - &.toolbar-fixed { - &.toolbar-horizontal { - &.toolbar-themes { - padding-top: 3rem !important; - } - - #toolbar-administration { - background-color: #333; - } - - &.toolbar-has-tabs #toolbar-administration { - min-height: 4em; - } - - &.toolbar-no-tabs #toolbar-administration { - min-height: 2.5em; - } - } - } - } - - &.toolbar-fixed.toolbar-vertical.toolbar-has-tabs, - &.toolbar-tray-open.toolbar-fixed.toolbar-horizontal.toolbar-no-tabs { - padding-top: 1.8em !important; - } - - &.toolbar-fixed.toolbar-vertical.toolbar-no-tabs { - padding-top: 0 !important; - } -} - diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.info.yml b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.info.yml deleted file mode 100644 index 0fbc19c0d..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Toolbar Themes -description: Apply themes to the toolbar. -package: Administration -type: module -# core: '8.x' -dependencies: - - toolbar - -# Information added by Drupal.org packaging script on 2017-11-14 -version: '8.x-1.0-alpha4+10-dev' -core: '8.x' -project: 'toolbar_themes' -datestamp: 1510689489 diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.install b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.install deleted file mode 100644 index 702569735..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.install +++ /dev/null @@ -1,34 +0,0 @@ - $role) { - user_role_grant_permissions($rid, ['configure toolbar_themes']); - } - } -} - -/** - * Assign "Configure administration toolbar themes" permission to all roles. - */ -function toolbar_themes_update_8001() { - if ($roles = user_roles(FALSE, 'access toolbar')) { - foreach ($roles as $rid => $role) { - user_role_grant_permissions($rid, ['configure toolbar_themes']); - } - } -} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.libraries.yml b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.libraries.yml deleted file mode 100644 index 9682f9116..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.libraries.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Module Libraries -base: - css: - component: - css/toolbar-themes-form.css: {} - js: - js/base.js: {} - dependencies: - - core/jquery - -grunticon_load: - js: - themes/base/grunticons/icon_load.js: {} - -# Toolbar Themes - -# Base theme. -toolbar_themes_base.base: - version: 8.0-1.x - css: - theme: - themes/base/base_module.css: {} - themes/base/base_handles.css: {} - themes/base/base_theme.css: {} - -toolbar_themes_base.icons: - version: 8.0-1.x - css: - theme: - themes/base/base_icons.css: {} - -# Admin Menu theme. -toolbar_admin_menu.base: - version: 8.0-1.x - css: - theme: - themes/admin_menu/admin_menu_theme.css: {} - dependencies: - - toolbar_themes/toolbar_themes_base.base - -toolbar_admin_menu.icons: - version: 8.0-1.x - css: - theme: - themes/admin_menu/admin_menu_icons.css: {} - dependencies: - - toolbar_themes/toolbar_themes_base.icons - -# Toolbar Mini theme. -toolbar_mini.base: - version: 8.0-1.x - css: - theme: - themes/mini/mini_theme.css: {} - dependencies: - - toolbar_themes/toolbar_themes_base.base - -toolbar_mini.icons: - css: - theme: - themes/mini/mini_icons.css: {} - dependencies: - - toolbar_themes/toolbar_themes_base.icons - -# Seven theme. -toolbar_seven.base: - version: 8.0-1.x - css: - theme: - themes/seven/seven_theme.css: {} - dependencies: - - toolbar_themes/toolbar_themes_base.base - -toolbar_seven.icons: - version: 8.0-1.x - css: - theme: - themes/seven/seven_icons.css: {} - dependencies: - - toolbar_themes/toolbar_themes_base.icons diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.links.menu.yml b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.links.menu.yml deleted file mode 100644 index d52fca74e..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -toolbar_themes.settings: - title: 'Toolbar Themes' - description: 'Configure toolbar themes.' - route_name: toolbar_themes.settings - parent: system.admin_config_ui diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.module b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.module deleted file mode 100644 index 1382be350..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.module +++ /dev/null @@ -1,376 +0,0 @@ -get('toolbar_themes:definitions')) { - $definitions = $cache->data; - } - else { - $theme_handler = \Drupal::service('theme_handler'); - $module_handler = \Drupal::service('module_handler'); - $discovery = new YamlDiscovery('toolbar_themes', $module_handler->getModuleDirectories() + $theme_handler->getThemeDirectories()); - $definitions = $discovery->findAll(); - if (!empty($definitions)) { - \Drupal::cache()->set('toolbar_themes:definitions', $definitions); - } - } - return $definitions; -} - -/** - * Return all themes libraries. - * @return array - */ -function toolbar_themes_get_library_names() { - $libraries = []; - $definitions = toolbar_themes_get_theme_definitions(); - foreach ($definitions as $provider => $provider_themes) { - foreach ($provider_themes as $theme_key => $theme_values) { - $libraries[$theme_key] = $theme_values['libraries']; - } - } - return $libraries; -} - -/** - * Return a themes definitions. - * @return array - */ -function toolbar_themes_get_theme_definition($theme) { - $theme_definition = []; - $definitions = toolbar_themes_get_theme_definitions(); - foreach ($definitions as $provider => $provider_themes) { - foreach ($provider_themes as $theme_key => $theme_values) { - if ($theme == $theme_key) { - $theme_values['provider'] = $provider; - $theme_definition = $theme_values; - } - } - } - return $theme_definition; -} - -/** - * Implements hook_library_info_alter(). - * @param $libraries - * @param $extension - */ -function toolbar_themes_library_info_alter(&$libraries, $extension) { - // Remove Toolbar modules CSS. - if ($extension === 'toolbar') { - unset($libraries['toolbar']['css']); - unset($libraries['toolbar.menu']['css']); - } - // Remove Admin Toolbar modules CSS. - if ($extension === 'admin_toolbar') { - if (isset($libraries['toolbar.tree'])) { - unset($libraries['toolbar.tree']); - } - } -} - -/** - * Implements hook_toolbar_alter(). - * @param $items - */ -function toolbar_themes_toolbar_alter(&$items) { - // If tabs are hidden we unset all but the Manage tab, otherwise it becomes - // extremely problematic if the toolbar is showing anything other than Manage - // and in horizontal orientation at the time the settings are saved (it blows - // up and can hide the entire menu off screen, ouch...). - if (\Drupal::config('toolbar_themes.settings')->get('tabs') === 0) { - foreach ($items as $id => $item) { - if ($id !== 'administration') { - unset($items[$id]); - } - } - } -} - -/** - * Implements hook_theme_registry_alter(). - * ...well this seems repetitive. TODO, abstract something or? - * @param $theme_registry - */ -function toolbar_themes_theme_registry_alter(&$theme_registry) { - $config = \Drupal::config('toolbar_themes.settings'); - $default_theme = $config->get('default_theme'); - $path = drupal_get_path('module', 'toolbar_themes'); - - // Use our own template for toolbar. - $theme_registry['toolbar']['template'] = 'toolbar-themes--toolbar'; - $theme_registry['toolbar']['path'] = $path . '/templates'; - $theme_registry['toolbar']['preprocess functions'][] = 'toolbar_themes_preprocess_toolbar_themes__toolbar'; - - // Use our own template for toolbar menus. - $theme_registry['menu__toolbar']['template'] = 'toolbar-themes--menu'; - $theme_registry['menu__toolbar']['path'] = $path . '/templates'; - $theme_registry['menu__toolbar']['preprocess functions'][] = 'toolbar_themes_preprocess_toolbar_themes__menu'; - $theme_registry['menu__toolbar__admin'] = $theme_registry['menu__toolbar']; - - // Register templates and preprocess function for themes. - $theme_handler = \Drupal::service('theme_handler'); - $base_theme = []; - $toolbar_implementation = ''; - $menu_implementation = ''; - - // Check for a base theme. - $default_theme = toolbar_themes_get_theme_definition($default_theme); - if (isset($default_theme['base_theme'])) { - $base_theme = toolbar_themes_get_theme_definition($default_theme['base_theme']); - } - - // Toolbar template. - if (isset($default_theme['template_toolbar'])) { - $toolbar_implementation = $default_theme; - } - elseif (!empty($base_theme)) { - if (isset($base_theme['template_toolbar'])) { - $toolbar_implementation = $base_theme; - } - } - if (!empty($toolbar_implementation)) { - $provider_toolbar = $toolbar_implementation['provider']; - if ($theme_handler->themeExists($provider_toolbar)) { - $provider_path = drupal_get_path('theme', $provider_toolbar); - } - else { - $provider_path = drupal_get_path('module', $provider_toolbar); - } - if (isset($toolbar_implementation['path']) && !empty($toolbar_implementation['path'])) { - $template_toolbar_parts = explode('/', $toolbar_implementation['template_toolbar']); - $template_toolbar = array_pop($template_toolbar_parts); - $template_toolbar_path = implode('/', $template_toolbar_parts); - $preprocess_toolbar = $provider_toolbar . '_preprocess_' . strtr($template_toolbar, '-', '_'); - $theme_registry['toolbar']['template'] = $template_toolbar; - $theme_registry['toolbar']['path'] = $provider_path . '/' . $toolbar_implementation['path'] . '/' . $template_toolbar_path; - $theme_registry['toolbar']['preprocess functions'][] = $preprocess_toolbar; - } - } - - // Menu template. - if (isset($default_theme['template_toolbar_menu'])) { - $menu_implementation = $default_theme; - } - elseif (!empty($base_theme)) { - if (isset($base_theme['template_toolbar_menu'])) { - $menu_implementation = $base_theme; - } - } - if (!empty($menu_implementation)) { - $provider_menu = $menu_implementation['provider']; - if ($theme_handler->themeExists($provider_menu)) { - $provider_path = drupal_get_path('theme', $provider_menu); - } - else { - $provider_path = drupal_get_path('module', $provider_menu); - } - if (isset($menu_implementation['path']) && !empty($menu_implementation['path'])) { - $template_menu_parts = explode('/', $menu_implementation['template_toolbar_menu']); - $template_menu = array_pop($template_menu_parts); - $template_menu_path = implode('/', $template_menu_parts); - $preprocess_menu = $provider_menu . '_preprocess_' . strtr($template_menu, '-', '_'); - $theme_registry['menu__toolbar']['template'] = $template_menu; - $theme_registry['menu__toolbar']['path'] = $provider_path . '/' . $menu_implementation['path'] . '/' . $template_menu_path; - $theme_registry['menu__toolbar']['preprocess functions'][] = $preprocess_menu; - $theme_registry['menu__toolbar__admin'] = $theme_registry['menu__toolbar']; - } - } -} - -/** - * Implements hook_preprocess_HOOK(). - * @param $variables - */ -function toolbar_themes_preprocess_html(&$variables) { - // Settings body classes. - $config = \Drupal::config('toolbar_themes.settings'); - $variables['attributes']['class'][] = 'toolbar-themes'; - $variables['attributes']['class'][] = $config->get('tabs') === 1 ? 'toolbar-has-tabs' : 'toolbar-no-tabs'; - $variables['attributes']['class'][] = $config->get('icons') === 1 ? 'toolbar-has-icons' : 'toolbar-no-icons'; - - // Admin theme class - $admin_theme = \Drupal::config('system.theme')->get('admin'); - $variables['attributes']['class'][] = 'toolbar-themes-admin-theme--' . Html::cleanCssIdentifier($admin_theme); - - // Third party module classes - if (\Drupal::moduleHandler()->moduleExists('toolbar_anti_flicker') === TRUE) { - $variables['attributes']['class'][] = 'toolbar-anti-flicker'; - } - -// $font_size = $config->get('font_size'); -// if (isset($font_size)) { -// $padding = $font_size * 2.25; -// -// $tabs = $config->get('tabs'); -// if (isset($tabs) && $tabs === 1) { -// $padding = $padding * 2; -// } -// //$variables['attributes']['style'] = 'padding-top:' . $padding . 'px'; -// } - - //kint($toolbar_config); -} - -/** - * Implements hook_preprocess_HOOK(). - * - * Piling everything into preprocess like this is probably lazy programming, - * but it's what I'm familiar with, if you have a better way to do some of this - * stuff patches are most welcome! - * - * @param $variables - */ -function toolbar_themes_preprocess_toolbar_themes__toolbar(&$variables) { - $config = \Drupal::config('toolbar_themes.settings'); - $path = base_path() . drupal_get_path('module', 'toolbar_themes'); - - // Attributes for advanced styles. - $variables['tray.content_attributes'] = new Attribute(); - - // Wrapper class. - $variables['attributes']['class'][] = 'toolbar-themes-toolbar'; - - // Font size. Set as an attribute in toolbar-themes--toolbar.html.twig. -// if ($font_size = $config->get('font_size')) { -// $ems = $font_size/16; -// $variables['font_size'] = 'font-size:' . $ems . 'em'; -// } - - // Icons. - $variables['show_icons'] = $config->get('icons'); - - // Tabs. - $variables['show_tabs'] = $config->get('tabs'); - if ($variables['show_tabs'] === 1) { - if (isset($variables['tabs'])) { - foreach ($variables['tabs'] as $item_key => $item_values) { - // Home, hide it. - if ($item_key === 'home') { - $variables['tabs'][$item_key]['attributes']->addClass('hidden'); - } - - // Hide empty items. - if (isset($item_values['link']['#markup']) && $item_values['link']['#markup'] === '') { - $variables['tabs'][$item_key]['attributes']->addClass('hidden'); - } - } - } - } - - // Load the default themes libraries. - $default_theme = $config->get('default_theme'); - $library_names = toolbar_themes_get_library_names(); - foreach ($library_names as $library_key => $libraries) { - if ($default_theme === $library_key) { - foreach ($libraries as $type => $library_name) { - if ($type !== 'icons') { - $variables['#attached']['library'][] = $library_name; - } - if ($variables['show_icons'] === 1) { - $variables['#attached']['library'][] = $library_name; - } - } - } - } - - // Attach drupalSettings. - $drupalSettings = [ - 'icons' => $variables['show_icons'], - 'tabs' => $variables['show_tabs'], - 'path' => $path, - ]; - $variables['#attached']['drupalSettings']['toolbar'] = $drupalSettings; - - // The module base library. - $variables['#attached']['library'][] = 'toolbar_themes/base'; - - // Inject theme definitions. - $variables['base_theme'] = []; - $variables['default_theme'] = toolbar_themes_get_theme_definition($default_theme); - if (isset($variables['default_theme']['base_theme'])) { - $variables['base_theme'] = toolbar_themes_get_theme_definition($variables['default_theme']['base_theme']); - } -} - -/** - * Implements hook_preprocess_HOOK(). - * Preprocess variables for the base theme. - * @param $variables - */ -function toolbar_themes_preprocess_toolbar_themes__base_toolbar(&$variables) { - $config = \Drupal::config('toolbar_themes.settings'); - $path = base_path() . drupal_get_path('module', 'toolbar_themes'); - - // Icons. - $variables['show_icons'] = $config->get('icons'); - if ($variables['show_icons'] === 1) { - $icons_path = $variables['base_theme']['path'] . '/' . $variables['base_theme']['icons']; - if (!empty($icons_path)) { - $grunticon_loader = [ - '#type' => 'html_tag', - '#tag' => 'script', - '#attributes' => [ - 'src' => $path . '/' . $icons_path . '/grunticon.loader.js', - ], - ]; - $variables['#attached']['html_head'][] = [$grunticon_loader, 'grunticon_loader']; - - $grunticon_fallback = [ - '#type' => 'html_tag', - '#tag' => 'link', - '#noscript' => TRUE, - '#attributes' => [ - 'href' => $path . '/' . $icons_path . '/icons.fallback.css', - 'rel' => 'stylesheet', - ], - ]; - $variables['#attached']['html_head'][] = [$grunticon_fallback, 'grunticon_fallback']; - - // Icon load is a library, we use drupalSettings so it must load after. - $variables['#attached']['library'][] = 'toolbar_themes/grunticon_load'; - } - } - - // Tab icons. - $variables['show_tabs'] = $config->get('tabs'); - if ($variables['show_tabs'] === 1) { - if (isset($variables['tabs'])) { - foreach ($variables['tabs'] as $item_key => $item_values) { - // Icons. - if ($variables['show_icons'] === 1) { - $variables['tabs'][$item_key]['icon_attributes'] = new Attribute(); - $item_classes = $item_values['link']['#attributes']['class']; - $variables['tabs'][$item_key]['icon_attributes']->addClass($item_classes)->removeClass('toolbar-item', 'trigger'); - } - } - } - } -} - -/** - * Preprocess variables for menu templates. - * @param $variables - */ -function toolbar_themes_preprocess_toolbar_themes__menu(&$variables) { - $show_icons = \Drupal::config('toolbar_themes.settings')->get('icons'); - foreach ($variables['items'] as $item_key => $item_values) { - $variables['items'][$item_key]['show_icon'] = 0; - $attr = $item_values['url']->getOption('attributes') ?: []; - $item_classes = isset($attr['class']) ? $attr['class'] : ''; - $item_values['url']->setOption('attributes', ['class' => ['toolbar-menu__link']]); - if ($show_icons === 1) { - $variables['items'][$item_key]['icon_attributes'] = new Attribute(); - $variables['items'][$item_key]['icon_attributes']->addClass($item_classes); - $variables['items'][$item_key]['show_icon'] = 1; - } - } -} diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.permissions.yml b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.permissions.yml deleted file mode 100644 index c770a0125..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -configure toolbar_themes: - title: 'Configure toolbar themes' diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.routing.yml b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.routing.yml deleted file mode 100644 index 2b836a086..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -toolbar_themes.settings: - path: '/admin/config/toolbar-themes/settings' - defaults: - _form: '\Drupal\toolbar_themes\Form\ToolbarThemesSettingsForm' - _title: 'Toolbar Themes' - requirements: - _permission: 'configure toolbar_themes' diff --git a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.toolbar_themes.yml b/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.toolbar_themes.yml deleted file mode 100644 index 93df8cb83..000000000 --- a/sites/all/modules/contrib/admin/toolbar_themes/toolbar_themes.toolbar_themes.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Theme definitions for Toolbar themes. - -toolbar_themes_base: - label: "Toolbar Themes Base" - hidden: true - version: 8.0-1.x - description: "A minimal base theme for Toolbar" - path: themes/base - template_toolbar: templates/toolbar-themes--base-toolbar - template_toolbar_menu: templates/toolbar-themes--base-menu - icons: grunticons/processed - libraries: - base: toolbar_themes/toolbar_themes_base.base - icons: toolbar_themes/toolbar_themes_base.icons - -toolbar_admin_menu: - label: "Admin Menu" - version: 8.0-1.x - description: "Drupal 7 Admin Menu module style." - path: themes/admin_menu - screen_shot: screenshot.png - base_theme: toolbar_themes_base - libraries: - base: toolbar_themes/toolbar_admin_menu.base - icons: toolbar_themes/toolbar_admin_menu.icons - -toolbar_mini: - label: "Toolbar Mini" - version: 8.0-1.x - description: "A minified version of the standard toolbar." - path: themes/mini - screen_shot: screenshot.png - base_theme: toolbar_themes_base - libraries: - base: toolbar_themes/toolbar_mini.base - icons: toolbar_themes/toolbar_mini.icons - -toolbar_seven: - label: "Seven" - version: 8.0-1.x - description: "Toolbar styled to compliment the Seven admin themes color scheme." - path: themes/seven - screen_shot: screenshot.png - base_theme: toolbar_themes_base - libraries: - base: toolbar_themes/toolbar_seven.base - icons: toolbar_themes/toolbar_seven.icons diff --git a/sites/all/modules/contrib/admin/workflow/CHANGELOG.txt b/sites/all/modules/contrib/admin/workflow/CHANGELOG.txt deleted file mode 100644 index 97a4423fd..000000000 --- a/sites/all/modules/contrib/admin/workflow/CHANGELOG.txt +++ /dev/null @@ -1,7 +0,0 @@ -Changes since 8.x-1.x -Issue #2351299 by johnv: Porting D7-version to D8 - numerous commits. - -Issue #2585093 by johnv: Fixed lost error message on Workflow UI - Transitions page. -Issue #2587165 by johnv: Port Workflow to D8: dropped features, clone support. -Issue #297898: Move "Workflow tab permissions" to permissions page' -Issue #2587171: Make permission "schedule workflow transition" specific per Workflow type \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/workflow/LICENSE.txt b/sites/all/modules/contrib/admin/workflow/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/admin/workflow/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/admin/workflow/config/install/workflow.settings.yml b/sites/all/modules/contrib/admin/workflow/config/install/workflow.settings.yml deleted file mode 100644 index 815b395bb..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/install/workflow.settings.yml +++ /dev/null @@ -1 +0,0 @@ -workflow_states_per_page: 20 diff --git a/sites/all/modules/contrib/admin/workflow/config/optional/block.block.workflowtransitionform.yml b/sites/all/modules/contrib/admin/workflow/config/optional/block.block.workflowtransitionform.yml deleted file mode 100644 index 1fb03029b..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/optional/block.block.workflowtransitionform.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - workflow - theme: - - bartik -id: workflowtransitionform -theme: bartik -region: sidebar_second -weight: -7 -provider: null -plugin: workflow_transition_form_block -settings: - id: workflow_transition_form_block - label: 'Workflow Transition form' - provider: workflow - label_display: visible -visibility: { } diff --git a/sites/all/modules/contrib/admin/workflow/config/optional/system.action.change_a_node_to_next_workflow_state.yml b/sites/all/modules/contrib/admin/workflow/config/optional/system.action.change_a_node_to_next_workflow_state.yml deleted file mode 100644 index 4dda8ce56..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/optional/system.action.change_a_node_to_next_workflow_state.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: nl -status: true -dependencies: - module: - - action - - node - - workflow -id: change_a_node_to_next_workflow_state -label: 'Change a node to next Workflow state' -type: node -plugin: workflow_node_next_state_action -configuration: - label: 'Change a node to next Workflow state' - id: change_a_node_to_next_workflow_state - plugin: workflow_node_next_state_action - type: node - workflow_scheduling: - scheduled: '0' - comment: 'New state is set by a triggered Action.' - force: 0 - actions: { } diff --git a/sites/all/modules/contrib/admin/workflow/config/optional/views.view.workflow_entity_history.yml b/sites/all/modules/contrib/admin/workflow/config/optional/views.view.workflow_entity_history.yml deleted file mode 100644 index 5b3d5ba11..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/optional/views.view.workflow_entity_history.yml +++ /dev/null @@ -1,713 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - workflow -id: workflow_entity_history -label: 'Workflow Entity history' -module: views -description: 'Enable this View to configure the history tab.' -tag: '' -base_table: workflow_transition_history -base_field: hid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - hid: hid - timestamp: timestamp - field_name: field_name - from_sid: from_sid - to_sid: to_sid - uid: uid - comment: comment - operations: operations - info: - hid: - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' - timestamp: - align: '' - separator: '' - empty_column: false - responsive: '' - field_name: - align: '' - separator: '' - empty_column: false - responsive: '' - from_sid: - align: '' - separator: '' - empty_column: false - responsive: '' - to_sid: - align: '' - separator: '' - empty_column: false - responsive: '' - uid: - align: '' - separator: '' - empty_column: false - responsive: '' - comment: - align: '' - separator: '' - empty_column: false - responsive: '' - operations: - align: '' - separator: '' - empty_column: false - responsive: '' - default: hid - empty_table: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - hid: - id: hid - table: workflow_transition_history - field: hid - relationship: none - group_type: group - admin_label: '' - label: 'Transition ID' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: number_integer - settings: - thousand_separator: '' - prefix_suffix: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: hid - plugin_id: field - timestamp: - id: timestamp - table: workflow_transition_history - field: timestamp - relationship: none - group_type: group - admin_label: '' - label: Timestamp - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp - settings: - date_format: medium - custom_date_format: '' - timezone: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: timestamp - plugin_id: field - field_name: - id: field_name - table: workflow_transition_history - field: field_name - relationship: none - group_type: group - admin_label: '' - label: 'Field name' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: field_name - plugin_id: field - from_sid: - id: from_sid - table: workflow_transition_history - field: from_sid - relationship: none - group_type: group - admin_label: '' - label: 'From state' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: from_sid - plugin_id: field - to_sid: - id: to_sid - table: workflow_transition_history - field: to_sid - relationship: none - group_type: group - admin_label: '' - label: 'To state' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: to_sid - plugin_id: field - uid: - id: uid - table: workflow_transition_history - field: uid - relationship: none - group_type: group - admin_label: '' - label: 'User ID' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: uid - plugin_id: field - comment: - id: comment - table: workflow_transition_history - field: comment - relationship: none - group_type: group - admin_label: '' - label: 'Log message' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: basic_string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: workflow_transition - entity_field: comment - plugin_id: field - operations: - id: operations - table: workflow_transition_history - field: operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - entity_type: null - entity_field: null - plugin_id: entity_operations - filters: { } - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: - entity_id: - id: entity_id - table: workflow_transition_history - field: entity_id - relationship: none - group_type: group - admin_label: '' - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - not: false - entity_type: workflow_transition - entity_field: entity_id - plugin_id: numeric - display_extenders: { } - title: 'Workflow history' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - tags: { } - workflow_history_tab: - display_plugin: embed - id: workflow_history_tab - display_title: 'Workflow history tab' - position: 1 - display_options: - display_extenders: { } - display_description: 'Replaces the transition list in the Workflow tab.' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - tags: { } diff --git a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.schema.yml b/sites/all/modules/contrib/admin/workflow/config/schema/workflow.schema.yml deleted file mode 100644 index 35ff20cb3..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.schema.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Schema for the configuration files of the Workflow module. -workflow.settings: - type: config_object - label: 'Workflow settings' - mapping: - workflow_states_per_page: - type: integer - label: 'Number of workflow states per page' - -workflow.workflow.*: - type: config_entity - label: 'Workflow settings' - mapping: - id: - type: string - label: 'ID' - status: - type: boolean - label: 'Status' - label: - type: label - label: 'Label' - module: - type: string - label: 'Module' - options: - type: mapping - label: 'Options' - mapping: - name_as_title: - type: integer - label: 'Use the workflow name as the title of the workflow form' - fieldset: - type: integer - label: 'Show the form in a fieldset' - options: - type: string - label: 'How to show the available states' - schedule_timezone: - type: integer - label: 'Show a timezone when scheduling a transition' - comment_log_node: - type: integer - label: 'Show comment on the Content edit form' - watchdog_log: - type: integer - label: 'Log watchdog messages upon state change' - -field.storage_settings.workflow: - type: mapping - label: 'Workflow settings' - mapping: - workflow_type: - type: string - label: 'Workflow' - allowed_values: - type: sequence - label: 'Allowed values list' - sequence: - type: mapping - label: 'Allowed value with label' - mapping: - value: - type: string - label: 'Value' - label: - type: label - label: 'Label' - -field.field_settings.workflow: - type: mapping - label: 'Workflow settings' diff --git a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.state.schema.yml b/sites/all/modules/contrib/admin/workflow/config/schema/workflow.state.schema.yml deleted file mode 100644 index 6c6121fbd..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.state.schema.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Schema for the configuration files of the state from Workflow module. - -workflow.state.*: - type: config_entity - label: 'Workflow State' - mapping: - id: - type: string - label: 'ID' - status: - type: boolean - label: 'Status' - label: - type: label - label: 'Label' - module: - type: string - label: 'Module' - wid: - type: string - label: 'Machine name of the attached Workflow' - weight: - type: integer - label: 'Weight' - sysid: - type: integer - label: 'SysId' diff --git a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.transition.schema.yml b/sites/all/modules/contrib/admin/workflow/config/schema/workflow.transition.schema.yml deleted file mode 100644 index cee1c6f05..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.transition.schema.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Schema for the configuration files of the transitions for Workflow module. - -workflow.transition.*: - type: config_entity - label: 'Workflow Transition' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - module: - type: string - label: 'Module' - from_sid: - type: string - label: 'From workflow state' - to_sid: - type: string - label: 'To workflow state' - roles: - type: sequence - label: 'User roles' - sequence: - type: string - label: 'Role' diff --git a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.views.schema.yml b/sites/all/modules/contrib/admin/workflow/config/schema/workflow.views.schema.yml deleted file mode 100644 index a54f74f81..000000000 --- a/sites/all/modules/contrib/admin/workflow/config/schema/workflow.views.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Schema for the views plugins of the Workflow module. - -views.filter.workflow_state: - type: views.filter.many_to_one - -views.argument.workflow_state: - type: views.argument.string diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/install/workflow_access.settings.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/install/workflow_access.settings.yml deleted file mode 100644 index bfa09f363..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/install/workflow_access.settings.yml +++ /dev/null @@ -1 +0,0 @@ -workflow_access_priority: 0 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/schema/workflow_access.schema.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/schema/workflow_access.schema.yml deleted file mode 100644 index e8567d8c9..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/config/schema/workflow_access.schema.yml +++ /dev/null @@ -1,6 +0,0 @@ -workflow_access.settings: - type: config_object - label: Settings - mapping: - workflow_access_priority: - type: integer diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessRoleForm.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessRoleForm.php deleted file mode 100644 index d9048d74e..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessRoleForm.php +++ /dev/null @@ -1,143 +0,0 @@ - $this->t('State'), - 'view' => $this->t('Roles who can view posts in this state'), - 'update' => $this->t('Roles who can edit posts in this state'), - 'delete' => $this->t('Roles who can delete posts in this state'), - ]; - return $header; - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row = []; - - $workflow = $this->workflow; - if ($workflow) { - /* @var $state WorkflowState */ - $state = $entity; - $sid = $state->id(); - - // A list of role names keyed by role ID, including the 'author' role. - // Only get the roles with proper permission + Author role. - $type_id = $workflow->id(); - $roles = workflow_get_user_role_names("create $type_id workflow_transition"); - - if ($state->isCreationState()) { - // No need to set perms on creation. - return []; - } - - $view = $update = $delete = []; - $count = 0; - foreach (workflow_access_get_workflow_access_by_sid($sid) as $rid => $access) { - $count++; - $view[$rid] = ($access['grant_view']) ? $rid : 0; - $update[$rid] = ($access['grant_update']) ? $rid : 0; - $delete[$rid] = ($access['grant_delete']) ? $rid : 0; - } - // Allow view grants by default for anonymous and authenticated users, - // if no grants were set up earlier. - if (!$count) { - $view = [ - AccountInterface::ANONYMOUS_ROLE => AccountInterface::ANONYMOUS_ROLE, - AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE, - ]; - } - - $row['label_new'] = [ - '#type' => 'value', - '#markup' => $this->t('@label', ['@label' => $state->label()]), - ]; - $row['view'] = [ - '#type' => 'checkboxes', - '#options' => $roles, - '#default_value' => $view, - ]; - $row['update'] = [ - '#type' => 'checkboxes', - '#options' => $roles, - '#default_value' => $update, - ]; - $row['delete'] = [ - '#type' => 'checkboxes', - '#options' => $roles, - '#default_value' => $delete, - ]; - } - return $row; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - foreach ($form_state->getValue($this->entitiesKey) as $sid => $access) { - // @todo: not waterproof; can be done smarter, using elementchildren(). - if (!WorkflowState::load($sid)) { - continue; - } - - foreach ($access['view'] as $rid => $checked) { - $data[$rid] = [ - 'grant_view' => (!empty($access['view'][$rid])) ? (bool) $access['view'][$rid] : 0, - 'grant_update' => (!empty($access['update'][$rid])) ? (bool) $access['update'][$rid] : 0, - 'grant_delete' => (!empty($access['delete'][$rid])) ? (bool) $access['delete'][$rid] : 0, - ]; - } - workflow_access_insert_workflow_access_by_sid($sid, $data); - - // Update all nodes to reflect new settings. - node_access_needs_rebuild(TRUE); - } - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessSettingsForm.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessSettingsForm.php deleted file mode 100644 index 74925f3ab..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/src/Form/WorkflowAccessSettingsForm.php +++ /dev/null @@ -1,76 +0,0 @@ -config('workflow_access.settings'); - $weight = $config->get('workflow_access_priority'); - - $form['workflow_access'] = [ - '#type' => 'details', - '#open' => TRUE, - '#title' => $this->t('Workflow Access Settings'), - ]; - $form['workflow_access']['#tree'] = TRUE; - - $url = 'https://api.drupal.org/api/drupal/core%21modules%21node%21node.api.php/function/hook_node_access_records/8'; - $form['workflow_access']['workflow_access_priority'] = [ - '#type' => 'weight', - '#delta' => 10, - '#title' => $this->t('Workflow Access Priority'), - '#default_value' => $weight, - '#description' => $this->t( - 'This sets the node access priority. Changing this setting can be - dangerous. If there is any doubt, leave it at 0. - Read the manual.', - [':url' => $url]), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $weight = $form_state->getValues()['workflow_access']['workflow_access_priority']; - - $this->config('workflow_access.settings') - ->set('workflow_access_priority', $weight) - ->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.info.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.info.yml deleted file mode 100644 index 91d3f3283..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Workflow Access -type: module -description: 'Content access control based on workflows and roles. Depends on the node_access system, so only works for entities of type ''node''.' -package: Workflow -# core: 8.x -dependencies: - - workflow:workflow -configure: entity.workflow_type.collection - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-1.1+35-dev' -core: '8.x' -project: 'workflow' -datestamp: 1548801486 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.install b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.install deleted file mode 100644 index 57c658992..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.install +++ /dev/null @@ -1,41 +0,0 @@ -schema(); - $schema->dropTable('workflow_access'); - // Rebuild data. - node_access_needs_rebuild(TRUE); -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.links.task.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.links.task.yml deleted file mode 100644 index a1bac44cd..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.links.task.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Menu tasks for Workflow UI. - -workflow_access_settings: - route_name: workflow.access.settings - base_route: entity.workflow_type.collection - title: 'Access settings' - weight: 5 - appears_on: - - entity.workflow_type.collection - -entity.workflow_type.access_form: - title: 'Access' - route_name: entity.workflow_type.access_form - base_route: entity.workflow_type.edit_form - weight: -1 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.module b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.module deleted file mode 100644 index 5c44ecbef..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.module +++ /dev/null @@ -1,302 +0,0 @@ -"; - $output .= t( - "WARNING: Use of the 'Edit any', 'Edit own', and even 'View - published content' permissions for the content type may override these - access settings. You may disable those permissions or - alter the priority of - the Workflow access module.", [':url' => $url->toString()] - ); - if (\Drupal::moduleHandler()->moduleExists('og')) { - $output .= '
    '; - $output .= t( - 'WARNING: Organic Groups (OG) is present and may interfere - with these settings.' - ); - //$output .= ' '; - //$url = \Drupal\Core\Url::fromUri('admin/config/group/settings'); // @todo D8: FIXME when OG module is ported. - //$output .= t("In particular, if Strict node access - // permissions is enabled, since this may override Workflow access - // settings.", [':url' => $url]); - $output .= t( - 'In particular, if Strict node access permissions is enabled, - since this may override Workflow access settings.'); - } - break; - - default: - break; - } - return $output; -} - -/** - * Implements hook_workflow_operations(). - * - * Create action link for access form on EntityWorkflowUIController::overviewForm. - */ -function workflow_access_workflow_operations($op, EntityInterface $entity = NULL) { - $operations = []; - return $operations; -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - * - * We use the Role weight as an id. - * In contrary to content_access module, that uses a 'content_access_roles_gids' - * config setting. - * @todo: determine the best way for D8. See also content_access.module - * The problem is that node_access table uses Int, whereas the Role Id is string. - */ -function workflow_access_user_role_insert(EntityInterface $entity) { - // Attend user to Rebuild data, because the weight of a role - // is the key for workflow_Access. - /** @var $entity \Drupal\user\RoleInterface */ - node_access_needs_rebuild(TRUE); -} - -/** - * Implements hook_access_ENTITY_TYPE_update(). - * - * @param \Drupal\Core\Entity\EntityInterface $entity - */ -function workflow_access_user_role_update(EntityInterface $entity) { - // Attend user to Rebuild data, because the weight of a role - // is the key for workflow_Access. - /** @var $entity \Drupal\user\RoleInterface */ - if ($entity->getWeight() != $entity->original->getWeight()) { - // Role's weight has changed. - node_access_needs_rebuild(TRUE); - } -} - -/** - * Implements hook_node_grants(). - * - * Supply the workflow access grants. We are simply using - * roles as access lists, so rids translate directly to gids. - */ -function workflow_access_node_grants(AccountInterface $account, $op) { - $gids = []; - $roles = $account->getRoles(); - foreach ($roles as $role) { - // @todo D8: compare with content_access module. - $gids[] = workflow_access_get_role_gid($role); - } - - return [ - 'workflow_access' => $gids, - 'workflow_access_owner' => [$account->id()], - ]; -} - -/** - * Helper providing numeric id for role. - * Copied from content_access.module - */ -function workflow_access_get_role_gid($rid) { - // @todo D8: compare with content_access module. - // $config = \Drupal::configFactory()->getEditable('content_access.settings'); - // $roles_gids = $config->get('content_access_roles_gids'); - // return $roles_gids[$role]; - - // Return a weight, avoiding negative values by starting with 100. - // For 'Author', no role exists. - /* @var $role Role */ - $role = \Drupal\user\Entity\Role::load($rid); - $weight = $role ? 100 + $role->getWeight() : 100 - 20; - - return $weight; -} - -/** - * Implements hook_node_access_records(). - * - * Returns a list of grant records for the passed in node object. - * This hook is invoked by function node_access_acquire_grants(). - */ -function workflow_access_node_access_records(\Drupal\node\NodeInterface $node) { - $grants = []; - - // Only relevant for content with Workflow. - if (!$workflow_field_names = workflow_get_workflow_field_names($node, $node->getEntityTypeId())) { - return $grants; - } - - // Create grants for each translation of the node. - $priority = workflow_access_get_setting('workflow_access_priority'); - foreach ($node->getTranslationLanguages() as $langcode => $language) { - $translation = $node->getTranslation($langcode); - - // @todo: how to handle not published entities? - // if (!$translation->isPublished()) { - // return; - // } - - // Get 'author' of this entity. Some entities (e.g., taxonomy_term) - // do not have a uid. But then again: node_access is only for nodes... - $uid = ($translation->getOwnerId()) ? (int) $translation->getOwnerId() : 0; - - $workflow_transitions = []; - if (isset($translation->workflow_transitions)) { - $workflow_transitions = $translation->workflow_transitions; - } - else { - // Sometimes, a node is saved without going through workflow_transition_form. - // E.g., - // - when saving a node with workflow_node programmatically with node_save(); - // - when changing a state on a node view page/history tab; - // - when rebuilding permissions via batch for Workflow Fields. - // In that case, we need to create the workflow_transitions ourselves to - // calculate the grants. - foreach ($workflow_field_names as $field_name) { - // Create a dummy transition, just to set $workflow_transitions. - $old_sid = $new_sid = $translation->{$field_name}->value; - if ($old_sid) { - /* @var $transition WorkflowTransitionInterface */ - $transition = WorkflowTransition::create([$old_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($translation); - $transition->setValues($new_sid, $translation->getOwnerId(), \Drupal::time()->getRequestTime(), ''); - - $workflow_transitions[$field_name] = $transition; - } - } - } - - $count_workflow_fields = 0; - foreach ($workflow_transitions as $field_name => $transition) { - // @todo: add support for +1 workflows per entity. - if (++$count_workflow_fields > 1) { - continue; - } - - if (!$current_sid = workflow_node_current_state($translation, $field_name)) { - continue; - } - - foreach (workflow_access_get_workflow_access_by_sid($current_sid) as $rid => $grant) { - // Anonymous ($uid == 0) author is not allowed for role 'Author' (== -1). - // Both logically (Anonymous having more rights then authenticated) - // and technically ($gid must be a positive integer). - if ($uid == 0 && $rid == WORKFLOW_ROLE_AUTHOR_RID) { - continue; - } - - $grants[] = [ - 'realm' => ($uid > 0 && $rid == WORKFLOW_ROLE_AUTHOR_RID) - ? 'workflow_access_owner' : 'workflow_access', - 'gid' => ($uid > 0 && $rid == WORKFLOW_ROLE_AUTHOR_RID) - ? $uid : workflow_access_get_role_gid($rid), - 'grant_view' => (int) $grant['grant_view'], - 'grant_update' => (int) $grant['grant_update'], - 'grant_delete' => (int) $grant['grant_delete'], - 'priority' => $priority, - 'langcode' => $langcode, - 'field_name' => $field_name, // Just for analysis and info. - ]; - } - } - } - - return $grants; -} - -/** - * Implements hook_node_access_explain(). - * - * This is a Devel Node Access hook. - */ -function workflow_access_node_access_explain($row) { - static $interpretations = []; - switch ($row->realm) { - case 'workflow_access_owner': - $interpretations[$row->gid] = t( - 'Workflow access: author of the content may access' - ); - break; - - case 'workflow_access': - $roles = user_roles(); - $interpretations[$row->gid] = t( - 'Workflow access: %role may access', ['%role' => $roles[$row->gid]] - ); - break; - } - return (!empty($interpretations[$row->gid]) ? $interpretations[$row->gid] : NULL); -} - -/** - * DB functions - all DB interactions are isolated here to make for easy updating should our schema change. - */ - -/** - * Given a sid, retrieve the access information and return the row(s). - */ -function workflow_access_get_workflow_access_by_sid($sid) { - $result = \Drupal::config('workflow_access.role')->get($sid); - if ($result == NULL) { - // Avoid errors in calling function when no data available. - $result = []; - } - return $result; -} - -/** - * Given a sid, delete all access data for this state. - */ -function workflow_access_delete_workflow_access_by_sid($sid) { - \Drupal::configFactory()->getEditable('workflow_access.role') - ->clear($sid) - ->save(); -} - -/** - * Given data, insert into workflow access - we never update. - */ -function workflow_access_insert_workflow_access_by_sid($sid, &$data, Config $config = NULL) { - $config = \Drupal::configFactory()->getEditable('workflow_access.role'); - $config - ->set($sid, $data) - ->save(); -} - -/** - * Get the module settings. - * - * @see WorkflowAccessSettingsForm::submitForm() - */ -function workflow_access_get_setting($value) { - $config = \Drupal::config('workflow_access.settings'); - $priority = $config->get($value); - return $priority; -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.routing.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.routing.yml deleted file mode 100644 index f5bae05f6..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_access/workflow_access.routing.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Declaration of Workflow Access routings. - -### Workflow settings form -workflow.access.settings: - path: '/admin/config/workflow/workflow/access' - defaults: - _form: '\Drupal\workflow_access\Form\WorkflowAccessSettingsForm' - _title: 'Access settings' - requirements: - _permission: 'administer workflow' - _module_dependencies: 'workflow_ui' - -entity.workflow_type.access_form: - path: '/admin/config/workflow/workflow/{workflow_type}/access' - defaults: - _title: 'Edit Workflow' - _title_callback: 'workflow_url_get_title' - _form: '\Drupal\workflow_access\Form\WorkflowAccessRoleForm' - requirements: - _permission: 'administer workflow' - _module_dependencies: 'workflow_ui' diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/src/Form/WorkflowCleanupSettingsForm.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/src/Form/WorkflowCleanupSettingsForm.php deleted file mode 100644 index 09629fb18..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/src/Form/WorkflowCleanupSettingsForm.php +++ /dev/null @@ -1,142 +0,0 @@ -getWorkflow()) { - $orphans[$state->id()] = $state; - } - else { - // Is the state still active? - if (!$state->isActive()) { - $inactive[$state->id()] = $state; - } - } - } - - // Save the relevant states in an indexed array. - $form['#workflow_states'] = $orphans + $inactive; - - $form['no_workflow'] = [ - '#type' => 'details', - '#title' => $this->t('Orphaned States'), - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. - '#description' => $this->t( - 'These states no longer belong to an existing workflow.' - ), - '#tree' => TRUE, - ]; - foreach ($orphans as $sid => $state) { - $form['no_workflow'][$sid]['check'] = [ - '#type' => 'checkbox', - '#title' => $state->label(), - '#return_value' => $sid, - ]; - } - - $form['inactive'] = [ - '#type' => 'details', - '#title' => $this->t('Inactive (Deleted) States'), - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. - '#description' => $this->t( - 'These states belong to a workflow, but have been marked inactive (deleted).' - ), - '#tree' => TRUE, - ]; - foreach ($inactive as $sid => $state) { - $form['inactive'][$sid]['check'] = [ - '#type' => 'checkbox', - '#title' => $state->label() . ' (' . $state->getWorkflow()->label() . ')', - '#return_value' => $sid, - ]; - } - - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Delete selected states'), - ]; - - return $form; - } - - /** - * @inheritdoc - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $states = $form['#workflow_states']; - $values = $form_state->getValues(); - foreach (['no_workflow', 'inactive'] as $section) { - if (!isset($values[$section])) { - continue; - } - - foreach ($values[$section] as $sid => $data) { - if ($data['check']) { - /* @var $state WorkflowState */ - $state = $states[$sid]; - $state_name = $state->label(); - - // Delete any transitions this state is involved in. - $count = 0; - foreach (WorkflowConfigTransition::loadMultiple() as $config_transition) { - /* @var $config_transition WorkflowConfigTransition */ - if ($config_transition->getFromSid() == $sid || $config_transition->getToSid() == $sid) { - $config_transition->delete(); - $count++; - } - } - if ($count) { - drupal_set_message(t('@count transitions for the "@state" state have been deleted.', - ['@state' => $state_name, '@count' => $count])); - } - - // @todo: Remove history records too. - $count = 0; - // $count = db_delete('workflow_node_history')->condition('sid', $sid)->execute(); - if ($count) { - drupal_set_message(t('@count history records for the "@state" state have been deleted.', - ['@state' => $state_name, '@count' => $count])); - } - - $state->delete(); - drupal_set_message(t('The "@state" state has been deleted.', - ['@state' => $state_name])); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.info.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.info.yml deleted file mode 100644 index bcbb2100a..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Workflow Clean Up -type: module -description: 'Cleans up Workflow cruft. (Do not enable in production sites.)' -package: Workflow -# core: 8.x -dependencies: - - workflow:workflow -configure: workflow.cleanup.settings - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-1.1+35-dev' -core: '8.x' -project: 'workflow' -datestamp: 1548801486 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.links.task.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.links.task.yml deleted file mode 100644 index 3b9bd94e0..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.links.task.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Menu tasks for Workflow Cleanup. - -workflow.cleanup.settings: - title: 'Cleanup' - route_name: workflow.cleanup.settings - base_route: entity.workflow_type.collection - weight: 7 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.module b/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.module deleted file mode 100644 index 896b22fba..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_cleanup/workflow_cleanup.module +++ /dev/null @@ -1,26 +0,0 @@ -getPluginId()); - return hook_field_widget_form_alter($element, $form_state, $context); -} - -function workflow_devel_field_widget_workflow_default_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) { - // A hook specific for the 'workflow_default' widget. - // D7: This hook is introduced in Drupal 7.8. - // D8: This name is specified in the annotation of WorkflowDefaultWidget. - workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - return hook_field_widget_workflow_default_form_alter($element, $form_state, $context); -} - -function workflow_devel_form_workflow_transition_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, $form_id, ''); - return hook_form_workflow_transition_form_alter($form, $form_state, $form_id); -} - -function workflow_devel_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { - if (substr($form_id, 0, 8) == 'workflow') { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, $form_id, ''); - } - return hook_form_alter($form, $form_state, $form_id); -} - -/** - * Hooks defined by core: Change the operations column in an Entity list. - * - * @see EntityListBuilder::getOperations() - * - * @return array - */ -function workflow_devel_entity_operation($entities) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - $operations = []; - return $operations; -} - -function workflow_devel_entity_operation_alter(array $operations, EntityInterface $entity) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, $entity->getEntityTypeId(), $entity->id()); -} - -/** - * Hooks defined by core: hook_entity_CRUD. - * - * @see hook_entity_create(), hook_entity_update(), etc. - * @see hook_ENTITY_TYPE_create(), hook_ENTITY_TYPE_update(), etc. - */ -function workflow_devel_entity_create(EntityInterface $entity) { - //workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'create' , $entity->getEntityTypeId()); -} -function workflow_devel_entity_presave(EntityInterface $entity) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'presave', $entity->getEntityTypeId()); -} -function workflow_devel_entity_insert(EntityInterface $entity) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'insert', $entity->getEntityTypeId()); -} -function workflow_devel_entity_update(EntityInterface $entity) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'update', $entity->getEntityTypeId()); -} -function workflow_devel_entity_predelete(EntityInterface $entity) { - if (substr($entity->getEntityTypeId(), 0, 8) == 'workflow') { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'predelete', $entity->getEntityTypeId()); - } - return hook_entity_predelete($entity); -} -function workflow_devel_entity_delete(EntityInterface $entity) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'delete', $entity->getEntityTypeId()); - return hook_entity_delete($entity); -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_field/workflowfield.info.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_field/workflowfield.info.yml deleted file mode 100644 index 7af4fb227..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_field/workflowfield.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Workflow Field -type: module -description: 'A residual submodule. No need to enable this module for installations with workflow 8.x-1.0-beta6 and later.' -package: Workflow -# core: 8.x - -hidden: TRUE - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-1.1+35-dev' -core: '8.x' -project: 'workflow' -datestamp: 1548801486 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/Form/WorkflowTransitionRevertForm.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/Form/WorkflowTransitionRevertForm.php deleted file mode 100644 index 73dbbad3c..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/Form/WorkflowTransitionRevertForm.php +++ /dev/null @@ -1,133 +0,0 @@ -entity; - $state = $transition->getFromState(); - - if ($state) { - $question = t('Are you sure you want to revert %title to the "@state" state?', [ - '@state' => $state->label(), - '%title' => $transition->label(), - ]); - return $question; - } - else { - \Drupal::logger('workflow_revert')->error('Invalid state', []); - drupal_set_message(t('Invalid transition. Your information has been recorded.'), 'error'); - //drupal_goto($return_uri); - } - - return []; - } - - public function getCancelUrl() { - /* @var $transition WorkflowTransitionInterface */ - $transition = $this->entity; - return new Url('entity.node.workflow_history', ['node' => $transition->getTargetEntityId(), 'field_name' => $transition->getFieldname()]); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return t('Revert'); - } - - /** - * {@inheritdoc} - */ - //public function getDescription() { - // return ''; - //} - - /** - * The fact that we need to overwrite this function, is an indicator that - * the Transition is not completely a complete Entity. - * - * {@inheritdoc} - */ - protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) { - //return parent::copyFormValuesToEntity($entity, $form, $form_state); - return $this->entity; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) { - - // If Rules is available, signal the reversion. - // @todo: move this Rules_invoke_event to hook outside this module. - if (\Drupal::moduleHandler()->moduleExists('rules')) { - rules_invoke_event('workflow_state_reverted', $this->entity); - } - - /* @var $transition WorkflowTransitionInterface */ - $transition = $this->prepareRevertedTransition($this->entity); - - // The entity will be updated when the transition is executed. Keep the - // original one for the confirmation message. - $previous_sid = $transition->getToSid(); - - // Force the transition because it's probably not valid. - $transition->force(TRUE); - $new_sid = workflow_execute_transition($transition, TRUE); - - $comment = ($previous_sid == $new_sid) ? 'State is reverted.' : 'State could not be reverted.'; - drupal_set_message(t($comment), 'warning'); - - $form_state->setRedirect('entity.node.workflow_history', [ - 'node' => $transition->getTargetEntityId(), - 'field_name' => $transition->getFieldName(), - ] - ); - } - - /** - * Prepares a transition to be reverted. - * - * @param \Drupal\workflow\Entity\WorkflowTransitionInterface $transition - * The transition to be reverted. - * - * @return \Drupal\workflow\Entity\WorkflowTransitionInterface - * The prepared transition ready to be stored. - */ - protected function prepareRevertedTransition(WorkflowTransitionInterface $transition) { - $user = \Drupal::currentUser(); - - $entity = $transition->getTargetEntity(); - $field_name = $transition->getFieldName(); - $current_sid = workflow_node_current_state($entity, $field_name); - $previous_sid = $transition->getFromSid(); - $comment = t('State reverted.'); - - $transition = WorkflowTransition::create([$current_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($entity); - $transition->setValues($previous_sid, $user->id(), \Drupal::time()->getRequestTime(), $comment); - - return $transition; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowAccessControlHandler.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowAccessControlHandler.php deleted file mode 100644 index 6559809de..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowAccessControlHandler.php +++ /dev/null @@ -1,144 +0,0 @@ -entityTypeId = $entity_type->id(); - $this->entityType = $entity_type; - } - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type - ); - } - - /** - * Access check, to be called from - * - module.routing.yml - * - hook_entity_operation - * - * @param \Drupal\workflow_operations\WorkflowTransitionInterface | null $transition - * - * @return \Drupal\Core\Access\AccessResult - */ - public function revertAccess(WorkflowTransitionInterface $transition = NULL, AccountInterface $account = NULL, $return_as_object = TRUE) { - if ($transition) { - // Called from hook_entity_operation - } - else { - // Called from module.routing.yml - /* @var $transition WorkflowTransitionInterface */ - $route_match = \Drupal::routeMatch(); - $transition = $route_match->getParameter('workflow_transition'); - } - return $this->access($transition, 'revert', $account, $return_as_object); - } - - /** - * {@inheritdoc} - */ - public function access(EntityInterface $entity, $operation, AccountInterface $account = NULL, $return_as_object = FALSE) { - $result = AccessResult::neutral(); - - $account = $user = workflow_current_user($account); - - // This is only for Edit/Delete transition. For Add/create, use createAccess. - switch ($entity->getEntityTypeId()) { - - case 'workflow_transition': - case 'workflow_scheduled_transition': - /* @var $transition WorkflowTransitionInterface */ - $transition = $entity; - - switch ($operation) { - case 'revert': - $is_owner = WorkflowManager::isOwner($user, $transition); - $type_id = $transition->getWorkflowId(); - if ($transition->getFromSid() == $transition->getToSid()) { - // No access for same state transitions. - $result = AccessResult::forbidden(); - } - elseif ($user->hasPermission("revert any $type_id workflow_transition")) { - // OK, add operation. - $result = AccessResult::allowed(); - } - elseif ($is_owner && $user->hasPermission("revert own $type_id workflow_transition")) { - // OK, add operation. - $result = AccessResult::allowed(); - } - else { - // No access. - $result = AccessResult::forbidden(); - } - break; - - default: - $result = parent::access($entity, $operation, $account, $return_as_object)->cachePerPermissions(); - break; - } // End of switch ($operation). - - break; // case - - default: // $entity_type - $result = AccessResult::forbidden(); - } // End of switch($entity->getEntityTypeId()). - - return $return_as_object ? $result : $result->isAllowed(); - } - - /** - * {@inheritdoc} - */ - public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = [], $return_as_object = FALSE) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - $result = parent::createAccess($entity_bundle, $account, $context, TRUE)->cachePerPermissions(); - return $return_as_object ? $result : $result->isAllowed(); - } - - /** - * {@inheritdoc} - */ - protected function checkAccess(EntityInterface $transition, $operation, AccountInterface $account) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - return parent::checkAccess($transition, $operation, $account); - } - - /** - * {@inheritdoc} - */ - protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - return AccessResult::allowedIf($account->hasPermission('create ' . $entity_bundle . ' content'))->cachePerPermissions(); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowPermissions.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowPermissions.php deleted file mode 100644 index 085e9c401..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/src/WorkflowPermissions.php +++ /dev/null @@ -1,72 +0,0 @@ -id(); - $type_params = ['%type_name' => $type->label()]; - - return [ - // D7->D8-Conversion of 'edit workflow comment' permission to "edit own $type_id transition" (@see NodePermissions::edit any/own content). - // D7->D8-Conversion of 'edit workflow comment' permission to "edit any $type_id transition" (@see NodePermissions::edit any/own content). - "edit own $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Edit own comments', $type_params), - 'description' => t('Edit the comment of own executed state transitions.'), - 'restrict access' => TRUE, - ], - "edit any $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Edit any comments', $type_params), - 'description' => t('Edit the comment of any executed state transitions.'), - 'restrict access' => TRUE, - ], - /* - // Workflow has no 'delete' permissions. - "delete own $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Delete own content', $type_params), - ], - "delete any $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Delete any content', $type_params), - ], - */ - // D7->D8-Conversion of 'revert workflow' permission to "revert any/own $type_id transition" - "revert own $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Revert own state transition', $type_params), - 'description' => t('Allow user to revert own last executed state transition on entity.'), - 'restrict access' => TRUE, - ], - "revert any $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Revert any state transition', $type_params), - 'description' => t('Allow user to revert any last executed state transition on entity.'), - 'restrict access' => TRUE, - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.info.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.info.yml deleted file mode 100644 index 1ac46c676..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Workflow Operations -type: module -description: 'Adds lesser-used Transition permissions (edit, revert, delete permissions).' -package: Workflow -# core: 8.x -dependencies: - - workflow:workflow - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-1.1+35-dev' -core: '8.x' -project: 'workflow' -datestamp: 1548801486 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.module b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.module deleted file mode 100644 index 4f06f01e5..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.module +++ /dev/null @@ -1,97 +0,0 @@ - [ - 'group' => t('Workflow'), - 'label' => t('Workflow state reverted'), - 'variables' => rules_events_node_variables(t('updated content'), TRUE), - ], - ]; - return $events; -} - -/** - * Core hooks: Change the operations column in a Entity list. - * Add a 'revert' operation. - * - * @see EntityListBuilder::getOperations() - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * - * @return array - */ -function workflow_operations_entity_operation(\Drupal\Core\Entity\EntityInterface $entity) { - $operations = []; - - // Check correct entity type. - if (!in_array($entity->getEntityTypeId(), ['workflow_transition'])) { - return $operations; - } - - $user = workflow_current_user(); - /* @var $transition WorkflowTransitionInterface */ - $transition = $entity; - - // Check access, to avoid that user sees a revert link, but is not allowed to - // view the revert form. Use $first to check only once per page. - static $first = TRUE; - - if ($first) { - $handler = new WorkflowAccessControlHandler(); - $is_allowed = $handler->access($transition, 'revert', $user, FALSE); - if (!$is_allowed) { - // No access. We may try at next row. - return $operations; - } - } - - // Only mark the first row. - if ($first) { - // Some states are not fit to revert to. In each of these cases, prohibit - // to revert to an even older state. - if ((!$from_state = $transition->getFromState()) || !$from_state->isActive() || $from_state->isCreationState()) { - $first = FALSE; - } - else { - // Let's ask other modules if the reversion is allowed. Reversing old and new sid! - $permitted = \Drupal::moduleHandler()->invokeAll('workflow', ['transition revert', $transition, $user]); // @todo: add revert operation. - // Stop if a module says so. - if (!in_array(FALSE, $permitted, TRUE)) { - // Add the operation - it is not vetoed. - // @todo: Pluggability problem: the revert_form route is fixed in WorkflowTransition Annotation. Add to some alter() function. - $operations['revert'] = [ - 'title' => t('Revert to last state'), - 'url' => \Drupal\Core\Url::fromRoute('entity.workflow_transition.revert_form', ['workflow_transition' => $transition->id()]), - 'query' => \Drupal::destination()->getAsArray(), // Add destination. - 'weight' => 50, - ]; - - $first = FALSE; - } - } - } - - return $operations; -} - -/** - * Implements hook_entity_operation_alter - * This hook is not needed in this case. - */ -//function workflow_operations_entity_operation_alter(array $operations, \Drupal\Core\Entity\EntityInterface $entity) { -//} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.permissions.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.permissions.yml deleted file mode 100644 index b1281dc5c..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -permission_callbacks: - - \Drupal\workflow_operations\WorkflowPermissions::workflowTypePermissions diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.routing.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.routing.yml deleted file mode 100644 index 7c9501232..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_operations/workflow_operations.routing.yml +++ /dev/null @@ -1,10 +0,0 @@ -### Workflow Transition CRUD -entity.workflow_transition.revert_form: - path: '/workflow_transition/{workflow_transition}/revert' - defaults: - _entity_form: 'workflow_transition.revert' - _title: 'Revert Workflow transition' - requirements: -# _entity_access: 'workflow_transition.revert' - _custom_access: '\Drupal\workflow_operations\WorkflowAccessControlHandler::revertAccess' -# _access: 'true' diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowListBuilder.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowListBuilder.php deleted file mode 100644 index 59550bd79..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowListBuilder.php +++ /dev/null @@ -1,104 +0,0 @@ -t('ID'); - $header['label'] = $this->t('Label'); - $header['status'] = $this->t('Status'); - - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - /* @var $entity \Drupal\workflow\Entity\Workflow */ - $row['id'] = $entity->id(); - $row['label'] = $this->getLabel($entity); - $row['status'] = ''; // TODO $entity->getStatus(); - - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - - /* @var $workflow \Drupal\workflow\Entity\Workflow */ - $workflow = $entity; - - // Do not delete a Workflow if it contains content. - if (isset($operations['delete']) && !$workflow->isDeletable()) { - unset ($operations['delete']); - } - - /** - * Allow modules to insert their own workflow operations to the list. - */ - // This is what EntityListBuilder::getOperations() does: - // $operations = $this->getDefaultOperations($entity); - // $operations += $this->moduleHandler()->invokeAll('entity_operation', [$entity]); - // $this->moduleHandler->alter('entity_operation', $operations, $entity); - - // In D8, the interface of below hook_workflow_operations has changed a bit. - // @see EntityListBuilder::getOperations, workflow_operations, workflow.api.php. - $operations += $this->moduleHandler()->invokeAll('workflow_operations', ['workflow', $workflow]); - - return $operations; - } - - /** - * {@inheritdoc} - */ - public function render() { - $build = parent::render(); - - /** - * Allow modules to insert their own top_action links to the list, like cleanup module. - * - * This is not done anymore via the workflow hook. - * Instead, for an example: - * @see workflow_ui.links.action.yml - * @see workflow.api.php under 'hook_workflow_operations'. - */ - // $top_actions = \Drupal::moduleHandler() - // ->invokeAll('workflow_operations', ['top_actions', NULL]); - // $top_actions_args = [ - // 'links' => $top_actions, - // 'attributes' => ['class' => ['inline', 'action-links']], - // ]; - - return $build; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowStateListBuilder.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowStateListBuilder.php deleted file mode 100644 index bf1395cfa..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowStateListBuilder.php +++ /dev/null @@ -1,405 +0,0 @@ -id(); - /** @var WorkflowState[] $entities */ - $entities = parent::load(); - foreach ($entities as $key => $entity) { - if ($entity->getWorkflowId() != $wid) { - unset($entities[$key]); - } - } - - return $entities; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'workflow_state_form'; - } - - /** - * {@inheritdoc} - * - * Building the header and content lines for the contact list. - * - * Calling the parent::buildHeader() adds a column for the possible actions - * and inserts the 'edit' and 'delete' links as defined for the entity type. - */ - public function buildHeader() { - // The column 'weight' is added magically in the draggable EntityList. - // $header['weight'] = $this->t('Weight'); - // Some columns are not welcome in the list. - // $header['module'] = $this->t('Module'); - // $header['wid'] = $this->t('Workflow'); - // $header['sysid'] = $this->t('Sysid'); - // Column 'label' is manipulated in parent::buildForm(). So, we use 'label_new'. - // $header['label'] = $this->t('Label'); - $header['label_new'] = $this->t('Label'); - $header['id'] = $this->t('ID'); - $header['sysid'] = ''; - $header['status'] = $this->t('Active'); - $header['reassign'] = $this->t('Reassign'); - $header['count'] = $this->t('Count'); - - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row = []; - - if (!$workflow = workflow_url_get_workflow()) { - return $row; - } - - $wid = $url_wid = $workflow->id(); - /** @var $entity \Drupal\workflow\Entity\WorkflowState */ - $state = $entity; - $sid = $state->id(); - $label = $state->label(); - $count = $state->count(); - - // Build select options for reassigning states. - // We put a blank state first for validation. - $state_options = ['' => ' ']; - $state_options += workflow_get_workflow_state_names($wid, FALSE); - - // Make it impossible to reassign to the same state that is disabled. - $current_state_options = []; - if ($state->isActive() && !$state->isCreationState() && $sid) { - $current_state = [$sid => $state_options[$sid]]; - $current_state_options = array_diff($state_options, $current_state); - } - - /* - * Build the Row. - */ - // The column 'weight' is added magically in the draggable EntityList. - // $row['weight'] = $state->weight; - // Some columns are not welcome in the list. - // $row['module'] = $state->getModule(); - // $row['wid'] = $state->getWorkflow(); - // Column 'label' is manipulated in parent::buildForm(). So, we use 'label_new'. - // $row['label'] = $state->label(); - $row['label_new'] = [ - '#markup' => $label, - '#type' => 'textfield', - '#size' => 30, - '#maxlength' => 255, - '#default_value' => $label, - '#title' => NULL, // This hides the red 'required' asterisk. - '#disabled' => !$state->isActive(), - // '#required' => TRUE, - ]; - $row['id'] = [ - '#type' => 'machine_name', - '#title' => NULL, // This hides the red 'required' asterisk. - '#size' => 30, - '#description' => NULL, - '#disabled' => TRUE, // !$state->isNew(), - '#default_value' => $state->id(), - // N.B.: Keep machine_name in WorkflowState and ~ListBuilder aligned. - '#required' => FALSE, - // @TODO D8-port: enable machine_name as interactive WorkflowState element. - '#machine_name' => [ - 'exists' => [$this, 'exists'], // Local helper function, at the bottom of this class. - // 'source' => ['label_new'], - 'source' => ['states', $state->id(), 'label_new'], - // 'replace_pattern' =>'([^a-z0-9_]+)|(^custom$)', - 'replace_pattern' => '[^a-z0-9_()]+', // Added '()' characters from exclusion list since creation state has it. - 'error' => $this->t('The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores.'), - ], - ]; - $row['sysid'] = [ - '#type' => 'value', - '#value' => $state->sysid, - ]; - $row['status'] = [ - '#type' => 'checkbox', - '#default_value' => $state->isActive(), - '#disabled' => $state->isCreationState() || !$sid, - ]; - // The new value of states that are inactivated. - $row['reassign'] = [ - '#type' => 'select', - '#options' => $current_state_options, - ]; - $row['count'] = [ - '#type' => 'value', - '#value' => $count, - '#markup' => $count, - ]; - - // New state and disabled states cannot be reassigned. - if (!$state->isActive() || $state->isCreationState() || !$sid || !$count) { - $row['reassign']['#type'] = 'hidden'; - $row['reassign']['#disabled'] = TRUE; - } - - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - if (!$workflow = workflow_url_get_workflow()) { - return $form; - } - - $form = parent::buildForm($form, $form_state); - // Add a sticky header. - $form[$this->entitiesKey] += [ - '#sticky' => TRUE, - ]; - - $wid = $workflow->id(); - // Build select options for reassigning states. - // We put a blank state first for validation. - $state_options = workflow_get_workflow_state_names($wid, FALSE); - // Is this the last state available? - $form['#last_mohican'] = (count($state_options) == 1); - - $form['entities']['#prefix'] = '
    '; - $form['entities']['#suffix'] = '
    '; - // Create a placeholder WorkflowState (It must NOT be saved to DB). Add it to the item list. - if ($form_state->getTriggeringElement()['#name'] === 'add_state') { - $sid = ''; - $placeholder = $workflow->createState($sid, FALSE); - $placeholder->set('label', ''); - $this->entities['placeholder'] = $placeholder; - $form['entities']['placeholder'] = $this->buildRow($placeholder); - } - // Rename 'submit' button. - $form['actions']['submit']['#value'] = t('Save'); - // Add 'Add State' button. - $form['actions']['add_state'] = [ - '#name' => 'add_state', - '#type' => 'submit', - '#value' => t('Add State'), - '#ajax' => [ - 'callback' => '::addStateCallback', - 'wrapper' => 'states_table_wrapper', - ] - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - - /** @var $state \Drupal\workflow\Entity\WorkflowState */ - $state = $entity; - - /** - * Allow modules to insert their own workflow operations to the list. - */ - // This is what EntityListBuilder::getOperations() does: - // $operations = $this->getDefaultOperations($entity); - // $operations += $this->moduleHandler()->invokeAll('entity_operation', [$entity]); - // $this->moduleHandler->alter('entity_operation', $operations, $entity); - - // In D8, the interface of below hook_workflow_operations has changed a bit. - // @see EntityListBuilder::getOperations, workflow_operations, workflow.api.php. - $operations += $this->moduleHandler()->invokeAll('workflow_operations', ['state', $state]); - - return $operations; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // @TODO D8-port WorkflowStateListBuilder: enable machine_name as interactive WorkflowState element. - foreach ($form_state->getValue($this->entitiesKey) as $sid => $value) { - /** @var $state WorkflowState */ - $state = isset($this->entities[$sid]) ? $this->entities[$sid] : NULL; - - // State is de-activated (reassigning current content). - if ($state && $state->isActive() && !$value['status']) { - $args = ['%state' => $state->label()]; - // Does that state have content in it? - if (!$form['#last_mohican'] && $value['count'] > 0 && empty($value['reassign'])) { - $message = 'The %state state has content; you must - reassign the content to another state.'; - $form_state->setErrorByName("states'][$sid]['reassign'", $this->t($message, $args)); - } - } - } - - return []; - } - - /** - * {@inheritdoc} - * - * Overrides DraggableListBuilder::submitForm(). - * The WorkflowState entities are always saved. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - if (!$workflow = workflow_url_get_workflow()) { - return []; - } - - // The default min_weight is -10. Work with it. - $creation_weight = -11; - $max_weight = -9; - foreach ($form_state->getValue($this->entitiesKey) as $sid => $value) { - if (isset($this->entities[$sid])) { - /** @var $state WorkflowState */ - $state = $this->entities[$sid]; - - // Is the new state name empty? - if (empty($value['label_new'])) { - // No new state entered, so skip it. - continue; - } - - // Does user want to deactivate the state (reassign current content)? - if ($state && $state->isActive() && !$value['status'] && $sid) { - $new_sid = $value['reassign']; - $new_state = WorkflowState::load($new_sid); - - $args = [ - '%workflow' => $workflow->label(), - '%old_state' => $state->label(), - '%new_state' => isset($new_state) ? $new_state->label() : '', - ]; - - if ($value['count'] > 0) { - if ($form['#last_mohican']) { - $new_sid = NULL; // Do not reassign to new state. - $message = 'Removing workflow states from content in the %workflow.'; - drupal_set_message($this->t($message, $args)); - $message = 'Since you have deleted the last available - workflow state in this workflow, all content items - which with this %workflow workflow have their workflow state - removed.'; - drupal_set_message($this->t($message, $args), 'warning'); - } - else { - // Prepare the state delete function. - $message = 'Reassigning content from %old_state to %new_state.'; - drupal_set_message($this->t($message, $args)); - } - } - // Delete the old state without orphaning content, move them to the new state. - $state->deactivate($new_sid); - - $message = $this->t('Deactivated workflow state %old_state in %workflow.', $args); - \Drupal::logger('workflow')->notice($message, []); - drupal_set_message($message); - } - - // Set a proper weight to the new state. - $max_weight = max($max_weight, $state->get($this->weightKey)); - - // Is this a new state? - if ($sid === 'placeholder' && empty(!$value['label_new'])) { - // New state, add it. - $state->set('id', $value['id']); - // Set a proper weight to the new state. - $state->set($this->weightKey, $max_weight + 1); - } - elseif ($value['sysid'] == WORKFLOW_CREATION_STATE) { - // Set a proper weight to the creation state. - $state->set($this->weightKey, $creation_weight); - } - else { - $state->set($this->weightKey, $value['weight']); - } - $state->set('label', $value['label_new']); - $state->set('status', $value['status']); - - try { - $state->save(); - } catch(\Exception $e) { - $message = 'ID %id already exists'; - $args = ['%id' => $state->id()]; - return drupal_set_message($this->t($message, $args), 'error'); - } - } - } - - if ($form_state->getTriggeringElement()['#name'] === 'add_state') { - // Unset previous input in placeholder and rebuild the form. - $input = $form_state->getUserInput(); - unset($input['entities']['placeholder']['label_new']); - $form_state->setUserInput($input); - $form_state->setRebuild(); - } - - return drupal_set_message($this->t('The Workflow states have been updated.')); - } - - /** - * 'Add State' button callback. - * - * @param array $form - * @param FormStateInterface $form_state - * - * @return - */ - public function addStateCallback(array &$form, FormStateInterface $form_state) { - return $form['entities']; - } - - /** - * Validate duplicate machine names. - * Function registered in 'machine_name' form element. - * - * @param string $name - * @param array $element - * @param \Drupal\Core\Form\FormStateInterface $form_state - * - * @return bool - */ - function exists($name, array $element, FormStateInterface $form_state) { - $state_names = []; - foreach ($form_state->getValue($this->entitiesKey) as $sid => $value) { - $state_names[] = $value['id']; - } - $state_names = array_map('strtolower', $state_names); - $result = array_unique(array_diff_assoc($state_names, array_unique($state_names))); - - if (in_array($name, $result)) { - return TRUE; - } - return FALSE; - } -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowUiController.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowUiController.php deleted file mode 100644 index 6287a7288..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Controller/WorkflowUiController.php +++ /dev/null @@ -1,24 +0,0 @@ - 'Workflow settings form is not implemented yet.', - ]; - return $element; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionFormBase.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionFormBase.php deleted file mode 100644 index 71b513d63..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionFormBase.php +++ /dev/null @@ -1,191 +0,0 @@ -type and $this->entitiesKey must be set in the var section. - - // Get the Workflow from the page. - $this->workflow = workflow_url_get_workflow(); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'workflow_config_transition_' . $this->type . '_form'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return []; - } - - /** - * {@inheritdoc} - * - * Create an $entity for every ConfigTransition. - */ - public function load() { - $entities = []; - - $entity_type = $this->entitiesKey; - $workflow = $this->workflow; - $states = $workflow->getStates($all = 'CREATION'); - - if ($states) { - /* @var $from_state WorkflowState */ - /* @var $to_state WorkflowState */ - switch ($entity_type) { - case 'workflow_state': - foreach ($states as $from_state) { - $from_sid = $from_state->id(); - $entities[$from_sid] = $from_state; - } - break; - - case 'workflow_config_transition': - foreach ($states as $from_state) { - $from_sid = $from_state->id(); - foreach ($states as $to_state) { - $to_sid = $to_state->id(); - - // Don't allow transition TO (creation). - if ($to_state->isCreationState()) { - continue; - } -// // Only allow transitions from $from_state. -// if ($state->id() <> $from_state->id()) { -// continue; -// } - - // Load existing config_transitions. Create if not found. - $config_transitions = $workflow->getTransitionsByStateId($from_sid, $to_sid); - if (!$config_transition = reset($config_transitions)) { - $config_transition = $workflow->createTransition($from_sid, $to_sid); - } - $entities[] = $config_transition; - } - } - break; - - default: - drupal_set_message(t('Improper type provided in load method.'), 'error'); - \Drupal::logger('workflow_ui')->notice('Improper type provided in load method.', []); - return $entities; - } - } - return $entities; - } - - /** - * {@inheritdoc} - */ -// abstract public function buildHeader(); - - /** - * {@inheritdoc} - */ -// abstract public function buildRow(EntityInterface $entity); - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form = []; - - if (!$this->workflow) { - return $form; - } - - /* - * Begin of copied code DraggableListBuilder::buildForm() - */ - $form[$this->entitiesKey] = [ - '#type' => 'table', - '#header' => $this->buildHeader(), - '#sticky' => TRUE, - '#empty' => t('There is no @label yet.', ['@label' => 'Transition']), - '#tabledrag' => [['action' => 'order', 'relationship' => 'sibling', 'group' => 'weight', ], ], - ]; - - $this->entities = $this->load(); - $delta = 10; - // Change the delta of the weight field if have more than 20 entities. - if (!empty($this->weightKey)) { - $count = count($this->entities); - if ($count > 20) { - $delta = ceil($count / 2); - } - } - foreach ($this->entities as $entity) { - $row = $this->buildRow($entity); - if (isset($row['label'])) { - $row['label'] = ['#markup' => $row['label']]; - } - if (isset($row['weight'])) { - $row['weight']['#delta'] = $delta; - } - $form[$this->entitiesKey][$entity->id()] = $row; - } - /* - * End of copied code DraggableListBuilder::buildForm() - */ - - $form = parent::buildForm($form, $form_state); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionLabelForm.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionLabelForm.php deleted file mode 100644 index 090f3f968..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionLabelForm.php +++ /dev/null @@ -1,103 +0,0 @@ - t('Transition from'), - 'to' => t('Transition to'), - 'label_new' => t('label'), - 'config_transition' => '', - ]; - - return $header; - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row = []; - - $workflow = $this->workflow; - if ($workflow) { - /* @var $entity \Drupal\workflow\Entity\WorkflowConfigTransition */ - $config_transition = $entity; - - static $previous_from_sid = -1; - // Get transitions, sorted by weight of the old state. - $from_state = $config_transition->getFromState(); - $to_state = $config_transition->getToState(); - $from_sid = $from_state->id(); - - // Skip the transitions without any roles. - $skip = TRUE; - foreach ($config_transition->roles as $rid => $active) { - if ($active) { - $skip = FALSE; - } - } - if ($skip == TRUE && ($from_state != $to_state)) { - return $row; - } - - $row['from'] = [ - '#type' => 'value', - '#markup' => ($previous_from_sid != $from_sid) ? $from_state->label() : '"', - ]; - $row['to'] = [ - '#type' => 'value', - '#markup' => $to_state->label(), - ]; - $row['label_new'] = [ - '#type' => 'textfield', - '#default_value' => $config_transition->get('label'), - ]; - $row['config_transition'] = [ - '#type' => 'value', - '#value' => $config_transition, - ]; - - $previous_from_sid = $from_sid; - } - return $row; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - foreach ($form_state->getValue($this->entitiesKey) as $key => $value) { - $new_label = trim($value['label_new']); - $value['config_transition'] - ->set('label', $new_label) - ->save(); - } - - drupal_set_message(t('The transition labels have been saved.')); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionRoleForm.php b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionRoleForm.php deleted file mode 100644 index cb38b898f..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/src/Form/WorkflowConfigTransitionRoleForm.php +++ /dev/null @@ -1,186 +0,0 @@ -workflow; - $states = $workflow->getStates($all = 'CREATION'); - if ($states) { - $header['label_new'] = t('From \ To'); - - /* @var $state WorkflowState */ - foreach ($states as $state) { - // Don't allow transition TO (creation). - if (!$state->isCreationState()) { - $header[$state->id()] = t('@label', ['@label' => $state->label()]); - } - } - } - return $header; - } - - /** - * {@inheritdoc} - * - * Builds a row for the following table: - * Transitions, for example: - * 18 => [ - * 20 => [ - * 'author' => 1, - * 1 => 0, - * 2 => 1, - * ] - * ] - * means the transition from state 18 to state 20 can be executed by - * the content author or a user in role 2. The $transitions array should - * contain ALL transitions for the workflow. - */ - public function buildRow(EntityInterface $entity) { - $row = []; - - $workflow = $this->workflow; - if ($workflow) { - // Each $entity is a from-state. - /* @var $entity \Drupal\workflow\Entity\WorkflowState */ - $from_state = $entity; - $from_sid = $from_state->id(); - - /* @var $states WorkflowState[] */ - $states = $workflow->getStates($all = 'CREATION'); - if ($states) { - // Only get the roles with proper permission + Author role. - $type_id = $workflow->id(); - $roles = workflow_get_user_role_names("create $type_id workflow_transition"); - // Prepare default value for 'stay_on_this_state'. - $allow_all_roles = []; // array_combine (array_keys($roles) , array_keys($roles)); - - /* @var $state WorkflowState */ - foreach ($states as $state) { - $row['to'] = [ - '#type' => 'value', - '#markup' => t('@label', ['@label' => $from_state->label()]), - ]; - - /* @var $to_state WorkflowState */ - foreach ($states as $to_state) { - // Don't allow transition TO (creation). - if ($to_state->isCreationState()) { - continue; - } - // Only allow transitions from $from_state. - if ($state->id() <> $from_state->id()) { - continue; - } - $to_sid = $to_state->id(); - - // Load existing config_transitions. Create if not found. - $config_transitions = $workflow->getTransitionsByStateId($from_sid, $to_sid); - if (!$config_transition = reset($config_transitions)) { - $config_transition = $workflow->createTransition($from_sid, $to_sid); - } - $stay_on_this_state = !$config_transition->hasStateChange(); - - $row[$to_sid]['workflow_config_transition'] = ['#type' => 'value', '#value' => $config_transition,]; - $row[$to_sid]['roles'] = [ - '#type' => 'checkboxes', - '#options' => $stay_on_this_state ? [] : $roles, - '#disabled' => $stay_on_this_state, - '#default_value' => $stay_on_this_state ? $allow_all_roles : $config_transition->roles, - ]; - } - } - } - } - return $row; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $workflow = $this->workflow; - - // If only the 'Creation' state is available, - if (count($form_state->getValue($this->entitiesKey)) < 2) { - $form_state->setErrorByName('id', t('Please create at least one other state.', - [])); - } - - // Make sure 'author' is checked for (creation) -> [something]. - $creation_state = $workflow->getCreationState(); - $creation_state_id = $workflow->getCreationState()->id(); - $author_has_permission = FALSE; - foreach ($form_state->getValue($this->entitiesKey) as $from_sid => $to_data) { - foreach ($to_data as $to_sid => $transition_data) { - - if ($from_sid == $creation_state_id) { - // Same-state-transitions do not count. - if ($from_sid != $to_sid) { - if (!empty($transition_data['roles'][WORKFLOW_ROLE_AUTHOR_RID])) { - $author_has_permission = TRUE; - } - break; - } - } - - } - } - if (!$author_has_permission) { - $form_state->setErrorByName('id', t('Please give the author permission to go from %creation to at least one state!', - ['%creation' => $creation_state->label()])); - } - - parent::validateForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - foreach ($form_state->getValue($this->entitiesKey) as $from_sid => $to_data) { - foreach ($to_data as $transition_data) { - /* @var $config_transition WorkflowConfigTransition */ - if (isset($transition_data['workflow_config_transition'])) { - $config_transition = $transition_data['workflow_config_transition']; - $config_transition->roles = $transition_data['roles']; - $config_transition->save(); - } - else { - // Should not be possible. - // $config_transition = []; - } - } - } - - drupal_set_message(t('The workflow was updated.')); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.info.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.info.yml deleted file mode 100644 index 3acd00b65..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Workflow UI -type: module -description: 'Administrative UI for Workflow.' -package: Workflow -# core: 8.x -dependencies: - - workflow:workflow -configure: entity.workflow_type.collection - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-1.1+35-dev' -core: '8.x' -project: 'workflow' -datestamp: 1548801486 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.install b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.install deleted file mode 100644 index c2b2f663d..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.install +++ /dev/null @@ -1,24 +0,0 @@ - 'module-workflow']); - $message = t("Please review which roles may 'participate in workflows' - on the Permissions page.", - [':url' => $url->toString()]); - drupal_set_message($message); -} - -/** - * Drupal 8 updates. - */ -function workflow_ui_update_8001(&$sandbox) { -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.action.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.action.yml deleted file mode 100644 index 6e43aff42..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.action.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Action links for Workflow UI. - -### Workflow related actions. -workflow_type_add_action: - route_name: entity.workflow_type.add_form - title: 'Add workflow' - weight: 1 - appears_on: - - entity.workflow_type.collection - -### Workflow State related actions. - -### Workflow Transition related actions. diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.menu.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.menu.yml deleted file mode 100644 index 66f173fed..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.menu.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Menu links for Workflow UI. - -workflow.ui.workflows: - title: 'Workflow' - route_name: entity.workflow_type.collection - parent: system.admin_config_workflow - description: 'Workflow administration overview.' diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.task.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.task.yml deleted file mode 100644 index 573c11117..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.links.task.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Menu tasks for Workflow UI. - -workflow.ui.settings: - title: 'Settings' - route_name: workflow.ui.settings - base_route: entity.workflow_type.collection - weight: 9 -workflow.ui.workflows: - title: 'Workflows' - route_name: entity.workflow_type.collection - base_route: entity.workflow_type.collection - weight: 1 - -workflow.ui.workflow_states: - title: 'States' - route_name: entity.workflow_state.collection - base_route: entity.workflow_type.edit_form - weight: -4 -workflow.ui.workflow_transitions: - title: 'Transitions' - route_name: entity.workflow_transition.collection - base_route: entity.workflow_type.edit_form - weight: -3 -workflow.ui.workflow_labels: - title: 'Transition labels' - route_name: entity.workflow_label.collection - base_route: entity.workflow_type.edit_form - weight: -2 diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.module b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.module deleted file mode 100644 index 867a54af9..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.module +++ /dev/null @@ -1,93 +0,0 @@ -' - . t("A state must be marked as active, to be available in the - workflow's transitions.") . '
    ' - . t("If you wish to inactivate a state that has content (i.e. count is - not zero), then you need to select a state to which to reassign that - content."); - - case 'entity.workflow_transition.collection': - $url = \Drupal\Core\Url::fromRoute('user.admin_permissions', [], - ['fragment' => 'module-workflow']); - return t('You are currently viewing the possible transitions to and from - workflow states. The state is shown in the left column; the state to be - moved to is to the right. For each transition, check the box next to - the role(s) that may initiate the transition. For example, if only the - "production editor" role may move content from Review state to the - Published state, check the box next to "production editor". The author - role is built in and refers to the user who authored the content.') - . '
    ' - . t("If not all roles are in the list, please review which roles may - 'participate in workflows' on the Permissions page. - On that page, uncheck the 'Authenticated user' role temporarily to - view the permissions of each separate role.", - [':url' => $url->toString()]); - - case 'entity.workflow_label.collection': - return t('You can add labels to transitions if you don\'t like the - standard state labels. They will modify the Workflow form options, so - specific workflow transitions can have their own labels, relative to - the beginning and ending states. Rather than showing the user a - workflow box containing options like "review required" as a state in - the workflow, it could say "move to the editing department for grammar - review".'); - } - return []; -} - -/** - * Helper function to determine Workflow from Workflow UI URL. - * - * @deprecated : @see workflow_url_get_workflow . - */ -function workflow_ui_url_get_workflow() { - return workflow_url_get_workflow(); -} - -/** - * Helper function to determine the title of the page. - * - * @deprecated : @see workflow_url_get_title . - */ -function workflow_ui_url_get_title() { - return workflow_url_get_title(); -} - -/** - * Helper function to determine Workflow from Workflow UI URL. - * - * @deprecated : @see workflow_url_get_form_type . - */ -function workflow_ui_url_get_form_type($url = '') { - return workflow_url_get_form_type($url); -} diff --git a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.routing.yml b/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.routing.yml deleted file mode 100644 index 34dae7099..000000000 --- a/sites/all/modules/contrib/admin/workflow/modules/workflow_ui/workflow_ui.routing.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Declaration of Workflow UI routings. - -# copy from WorkflowUIController.php -# https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21entity.api.php/group/entity_api/8 - -### Workflow settings form -workflow.ui.settings: - path: '/admin/config/workflow/workflow/settings' - defaults: - _controller: '\Drupal\workflow_ui\Controller\WorkflowUiController::settingsForm' - _title: 'Workflow settings' - requirements: - _permission: 'administer workflow' - - -### Workflow States -entity.workflow_state.collection: - path: '/admin/config/workflow/workflow/{workflow_type}/states' - defaults: - _entity_list: 'workflow_state' -# _controller: '\workflow\EntityWorkflowUIController::adminOverview' - _title: 'Edit Workflow' - _title_callback: 'workflow_url_get_title' - requirements: - _permission: 'administer workflow' - options: - parameters: - workflow_type: - type: entity:workflow_type - -### Workflow Transitions -entity.workflow_transition.collection: - path: '/admin/config/workflow/workflow/{workflow_type}/transition_roles' - defaults: - _form: 'Drupal\workflow_ui\Form\WorkflowConfigTransitionRoleForm' - _title: 'Edit Workflow' - _title_callback: 'workflow_url_get_title' - requirements: - _permission: 'administer workflow' - options: - parameters: - workflow_type: - type: entity:workflow_type - -### Workflow Labels -entity.workflow_label.collection: - path: '/admin/config/workflow/workflow/{workflow_type}/transition_labels' - defaults: - _form: 'Drupal\workflow_ui\Form\WorkflowConfigTransitionLabelForm' - _title: 'Edit Workflow' - _title_callback: 'workflow_url_get_title' - requirements: - _permission: 'administer workflow' - options: - parameters: - workflow_type: - type: entity:workflow_type diff --git a/sites/all/modules/contrib/admin/workflow/src/Access/WorkflowHistoryAccess.php b/sites/all/modules/contrib/admin/workflow/src/Access/WorkflowHistoryAccess.php deleted file mode 100644 index 4c05791e6..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Access/WorkflowHistoryAccess.php +++ /dev/null @@ -1,79 +0,0 @@ -id() : -1; - - $entity = workflow_url_get_entity(NULL, $routeMatch); - $entity_id = $entity->id(); - $entity_type = $entity->getEntityTypeId(); - $entity_bundle = $entity->bundle(); - $field_name = workflow_url_get_parameter('field_name'); // @todo: this doesn't work. - - if (isset($access[$uid][$entity_type][$entity_id][$field_name ? $field_name : 'no_field'])) { - return $access[$uid][$entity_type][$entity_id][$field_name ? $field_name : 'no_field']; - } - - $access_result = AccessResult::forbidden(); - - // When having multiple workflows per bundle, use Views display - // 'Workflow history per entity' instead! - $fields = _workflow_info_fields($entity, $entity_type, $entity_bundle, $field_name); - if (!$fields) { - return AccessResult::forbidden(); - } - - // @todo: Keep below code aligned between WorkflowState, ~Transition, ~TransitionListController - // Determine if user is owner of the entity. - $is_owner = WorkflowManager::isOwner($account, $entity); - - /* - * Determine if user has Access. Fill the cache. - */ - // @todo: what to do with multiple workflow_fields per bundle? Use Views instead! Or introduce a setting. - // @todo D8-port: workflow_tab_access: use proper 'WORKFLOW_TYPE' permissions - foreach ($fields as $definition) { - $type_id = $definition->getSetting('workflow_type'); - if ($account->hasPermission("access any $type_id workflow_transion overview")) { - $access_result = AccessResult::allowed(); - } - elseif ($is_owner && $account->hasPermission("access own $type_id workflow_transion overview")) { - $access_result = AccessResult::allowed(); - } - elseif ($account->hasPermission('administer nodes')) { - $access_result = AccessResult::allowed(); - } - $access[$uid][$entity_type][$entity_id][$field_name ? $field_name : 'no_field'] = $access_result; - } - - return $access_result; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/workflow/src/Controller/WorkflowTransitionListController.php b/sites/all/modules/contrib/admin/workflow/src/Controller/WorkflowTransitionListController.php deleted file mode 100644 index 636e1f8aa..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Controller/WorkflowTransitionListController.php +++ /dev/null @@ -1,136 +0,0 @@ -dateFormatter = $date_formatter; - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('date.formatter'), - $container->get('renderer') - ); - } - - /** - * Generates an overview table of older revisions of a node, - * but only if WorkflowHistoryAccess::access() allows it. - * - * @param \Drupal\Core\Entity\EntityInterface $node - * A node object. - * @return array An array as expected by drupal_render(). - * An array as expected by drupal_render(). - */ - public function historyOverview(EntityInterface $node = NULL) { - $form = []; - - /* - * Get data from parameters. - */ - - // @todo D8-port: make Workflow History tab happen for every entity_type. - // For workflow_tab_page with multiple workflows, use a separate view. See [#2217291]. - // @see workflow.routing.yml, workflow.links.task.yml, WorkflowTransitionListController. - // workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - // ATM it only works for Nodes and Terms. - // This is a hack. The Route should always pass an object. - // On view tab, $entity is object, - // On workflow tab, $entity is id(). - // Get the entity for this form. - if (!$entity = workflow_url_get_entity($node)) { - return $form; - } - - /* - * Get derived data from parameters. - */ - if (!$field_name = workflow_get_field_name($entity, workflow_url_get_field_name())) { - return $form; - } - - /* - * Step 1: generate the Transition Form. - */ - // Add the WorkflowTransitionForm to the page. - $form = WorkflowManager::getWorkflowTransitionForm($entity, $field_name, []); - - /* - * Step 2: generate the Transition History List. - */ - $view = NULL; - $moduleHandler = \Drupal::service('module_handler'); - if ($moduleHandler->moduleExists('views')) { - $view = Views::getView('workflow_entity_history'); - } - if (is_object($view) && $view->storage->status()) { - // Add the history list from configured Views display. - $args = [$entity->id()]; - $view->setArguments($args); - $view->setDisplay('workflow_history_tab'); - $view->preExecute(); - $view->execute(); - $form['table'] = $view->buildRenderable(); - } - else { - // @deprecated. Use the Views display above. - // Add the history list from programmed WorkflowTransitionListController. - $entity_type = 'workflow_transition'; - $list_builder = $this->entityTypeManager()->getListBuilder($entity_type); - // Add the Node explicitly, since $list_builder expects a Transition. - $list_builder->workflow_entity = $entity; - $form += $list_builder->render(); - - } - - /* - * Finally: sort the elements (overriding their weight). - */ - $form['actions']['#weight'] = 100; - $form['table']['#weight'] = 201; - - return $form; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Element/WorkflowTransitionElement.php b/sites/all/modules/contrib/admin/workflow/src/Element/WorkflowTransitionElement.php deleted file mode 100644 index c959e5eb7..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Element/WorkflowTransitionElement.php +++ /dev/null @@ -1,568 +0,0 @@ -getFieldName(); - $workflow = $transition->getWorkflow(); - $wid = $transition->getWorkflowId(); - $force = $transition->isForced(); - $entity = $transition->getTargetEntity(); - $entity_type = $transition->getTargetEntityTypeId(); - $entity_id = $transition->getTargetEntityId(); - - if ($transition->isExecuted()) { - // We are editing an existing/executed/not-scheduled transition. - // Only the comments may be changed! - - $current_sid = $from_sid = $transition->getFromSid(); - // The states may not be changed anymore. - $to_state = $transition->getToState(); - $options = [$to_state->id() => $to_state->label()]; - // We need the widget to edit the comment. - $show_widget = TRUE; - $default_value = $transition->getToSid(); - } - elseif ($entity) { - // Normal situation: adding a new transition on an new/existing entity. - - // Get the scheduling info, only when updating an existing entity. - // This may change the $default_value on the Form. - // Technically you could have more than one scheduled transition, but - // this will only add the soonest one. - // @todo: Read the history with an explicit langcode? - $langcode = ''; // $entity->language()->getId(); - if ($entity_id && $scheduled_transition = WorkflowScheduledTransition::loadByProperties($entity_type, $entity_id, [], $field_name, $langcode)) { - $transition = $scheduled_transition; - } - - $current_sid = $from_sid = $transition->getFromSid(); - $current_state = $from_state = $transition->getFromState(); - $options = ($current_state) ? $current_state->getOptions($entity, $field_name, $user, FALSE) : []; - $show_widget = ($from_state) ? $from_state->showWidget($entity, $field_name, $user, FALSE) : []; - $default_value = $from_sid; - $default_value = ($from_state && $from_state->isCreationState()) ? $workflow->getFirstSid($entity, $field_name, $user, FALSE) : $default_value; - $default_value = ($transition->isScheduled()) ? $transition->getToSid() : $default_value; - } - elseif (!$entity) { - // Sometimes, no entity is given. We encountered the following cases: - // - D7: the Field settings page, - // - D7: the VBO action form; - // - D7/D8: the Advance Action form on admin/config/system/actions; - // If so, show all options for the given workflow(s). - if (!$temp_state = $transition->getFromState()) { - $temp_state = $transition->getToState(); - } - $options = ($temp_state) - ? $temp_state->getOptions($entity, $field_name, $user, FALSE) - : workflow_get_workflow_state_names($wid, $grouped = TRUE); - $show_widget = TRUE; - $current_sid = $transition->getToSid(); // @todo - $default_value = $from_sid = $transition->getToSid(); // @todo - } - else { - // We are in trouble! A message is already set in workflow_node_current_state(). - $options = []; - $current_sid = 0; - $show_widget = FALSE; - $default_value = FALSE; - } - - /* - * Output: generate the element. - */ - // Get settings from workflow. @todo: implement default_settings. - if ($workflow) { - $workflow_settings = $workflow->options; - } - else { - // @todo D8-port: now only tested with Action. - $workflow_settings = [ - 'name_as_title' => 0, - 'options' => "radios", - 'schedule_timezone' => 1, - 'comment_log_node' => "1", - 'watchdog_log' => TRUE, - ]; - } - // Current sid and default value may differ in a scheduled transition. - - $workflow_settings['comment'] = $workflow_settings['comment_log_node']; // 'comment_log_tab' is removed; - - // Capture settings to format the form/widget. - $settings_title_as_name = !empty($workflow_settings['name_as_title']); - $settings_fieldset = isset($workflow_settings['fieldset']) ? $workflow_settings['fieldset'] : 0; - $settings_options_type = $workflow_settings['options']; - - // Display scheduling form if user has permission. - // Not shown on new entity (not supported by workflow module, because that - // leaves the entity in the (creation) state until scheduling time.) - // Not shown when editing existing transition. - $type_id = ($workflow) ? $workflow->id() : ''; // Might be empty on Action configuration. - $settings_schedule = !$transition->isExecuted() && $user->hasPermission("schedule $type_id workflow_transition"); - if ($settings_schedule) { - //@todo D8-port: check below code: form on VBO. - // workflow_debug( __FILE__ , __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - $step = $form_state->getValue('step'); - if (isset($step) && ($form_state->getValue('step') == 'views_bulk_operations_config_form')) { - // On VBO 'modify entity values' form, leave field settings. - $settings_schedule = TRUE; - } - else { - // ... and cannot be shown on a Content add page (no $entity_id), - // ...but can be shown on a VBO 'set workflow state to..'page (no entity). - $settings_schedule = !($entity && !$entity_id); - } - } - - $settings_schedule_timezone = !empty($workflow_settings['schedule_timezone']); - // Show comment, when both Field and Instance allow this. - $settings_comment = $workflow_settings['comment']; - - $transition_is_scheduled = $transition->isScheduled(); - // Save the current value of the entity in the form, for later Workflow-module specific references. - // We add prefix, since #tree == FALSE. - $element['workflow_transition'] = [ - '#type' => 'value', - '#value' => $transition, - ]; - - // Decide if we show a widget or a formatter. - // There is no need for a widget when the only option is the current sid. - - // Add a state formatter before the rest of the form, - // when transition is scheduled or widget is hidden. - if ((!$show_widget) || $transition_is_scheduled || $transition->isExecuted()) { - $element['workflow_current_state'] = workflow_state_formatter($entity, $field_name, $current_sid); - // Set a proper weight, which works for Workflow Options in select list AND action buttons. - $element['workflow_current_state']['#weight'] = -0.005; - } - - $element['#tree'] = TRUE; - // Add class following node-form pattern (both on form and container). - $workflow_type_id = ($workflow) ? $workflow->id() : ''; - $element['#attributes']['class'][] = 'workflow-transition-' . $workflow_type_id . '-container'; - $element['#attributes']['class'][] = 'workflow-transition-container'; - if (!$show_widget) { - // Show no widget. - $element['to_sid']['#type'] = 'value'; - $element['to_sid']['#value'] = $default_value; - $element['to_sid']['#options'] = $options; // In case action buttons need them. - $element['comment']['#type'] = 'value'; - $element['comment']['#value'] = ''; - - return $element; // <-- exit. - } - - // @todo: repair the usage of $settings_title_as_name: no container if no details (schedule/comment). - // Prepare a UI wrapper. This might be a fieldset. - if ($settings_fieldset == 0) { // Use 'container'. - $element += [ - '#type' => 'container', - ]; - } - else { - $element += [ - '#type' => 'details', - '#collapsible' => TRUE, - '#open' => ($settings_fieldset == 2) ? FALSE : TRUE, - ]; - } - - $element['field_name'] = [ - '#type' => 'select', - '#title' => t('Field name'), - '#description' => t('Choose the field name.'), - '#access' => FALSE, // Only show on VBO/Actions screen. - '#options' => workflow_get_workflow_field_names($entity), - '#default_value' => $field_name, - '#required' => TRUE, - '#weight' => -20, - ]; - $element['force'] = [ - '#type' => 'checkbox', - '#title' => t('Force transition'), - '#description' => t('If this box is checked, the new state will be assigned even if workflow permissions disallow it.'), - '#access' => FALSE, // Only show on VBO/Actions screen. - '#default_value' => $force, - '#weight' => -19, - ]; - - // This overrides BaseFieldDefinition. @todo: apply for form and widget. - // The 'options' widget. May be removed later if 'Action buttons' are chosen. - // The help text is not available for container. Let's add it to the - // State box. N.B. it is empty on Workflow Tab, Node View page. - $help_text = isset($element['#description']) ? $element['#description'] : ''; - // This overrides BaseFieldDefinition. @todo: apply for form and widget. - $element['to_sid'] = [ - '#type' => ($wid) ? $settings_options_type : 'select', // Avoid error with grouped options. - '#title' => ($settings_title_as_name && !$transition->isExecuted()) - ? t('Change @name state', ['@name' => $workflow->label()]) - : t('Target state'), - '#access' => TRUE, - '#options' => $options, - // '#parents' => array('workflow'), - '#default_value' => $default_value, - '#description' => $help_text, - ]; - - // Display scheduling form under certain conditions. - if ($settings_schedule == TRUE) { - $timezone = $user->getTimeZone(); - - $timezone_options = array_combine(timezone_identifiers_list(), timezone_identifiers_list()); - $timestamp = $transition ? $transition->getTimestamp() : \Drupal::time()->getRequestTime(); - $hours = (!$transition_is_scheduled) ? '00:00' : \Drupal::service('date.formatter')->format($timestamp, 'custom', 'H:i', $timezone); - // Add a container, so checkbox and time stay together in extra fields. - $element['workflow_scheduling'] = [ - '#type' => 'container', - '#tree' => TRUE, - ]; - // Define class for '#states' behaviour. - // Fetch the form ID. This is unique for each entity, to allow multiple form per page (Views, etc.). - // Make it uniquer by adding the field name, or else the scheduling of - // multiple workflow_fields is not independent of each other. - // If we are indeed on a Transition form (so, not a Node Form with widget) - // then change the form id, too. - $form_id = $form_state->getBuildInfo()['form_id']; - $class_identifier = Html::getClass('scheduled_' . Html::getUniqueId($form_id).'-'.$field_name); - $element['workflow_scheduling']['scheduled'] = [ - '#type' => 'radios', - '#title' => t('Schedule'), - '#options' => [ - '0' => t('Immediately'), - '1' => t('Schedule for state change'), - ], - '#default_value' => $transition_is_scheduled ? '1' : '0', - '#attributes' => [ - // 'id' => 'scheduled_' . $form_id, - 'class' => [$class_identifier], - ], - ]; - $element['workflow_scheduling']['date_time'] = [ - '#type' => 'details', // 'container', - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. - '#attributes' => ['class' => ['container-inline']], - '#prefix' => '
    ', - '#suffix' => '
    ', - '#states' => [ - //'visible' => array(':input[id="' . 'scheduled_' . $form_id . '"]' => array('value' => '1')), - 'visible' => ['input.' . $class_identifier => ['value' => '1']], - ], - ]; - $element['workflow_scheduling']['date_time']['workflow_scheduled_date'] = [ - '#type' => 'date', - '#prefix' => t('At'), - '#default_value' => implode('-', [ - 'year' => date('Y', $timestamp), - 'month' => date('m', $timestamp), - 'day' => date('d', $timestamp), - ] - ), - ]; - $element['workflow_scheduling']['date_time']['workflow_scheduled_hour'] = [ - '#type' => 'textfield', - '#title' => t('Time'), - '#maxlength' => 7, - '#size' => 6, - '#default_value' => $hours, - '#element_validate' => ['_workflow_transition_form_element_validate_time'], // @todo D8-port: this is not called. - ]; - $element['workflow_scheduling']['date_time']['workflow_scheduled_timezone'] = [ - '#type' => $settings_schedule_timezone ? 'select' : 'hidden', - '#title' => t('Time zone'), - '#options' => $timezone_options, - '#default_value' => [$timezone => $timezone], - ]; - $element['workflow_scheduling']['date_time']['workflow_scheduled_help'] = [ - '#type' => 'item', - '#prefix' => '
    ', - '#description' => t('Please enter a time. - If no time is included, the default will be midnight on the specified date. - The current time is: @time.', ['@time' => \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'custom', 'H:i', $timezone)] - ), - ]; - } - - // This overrides BaseFieldDefinition. @todo: apply for form and widget. - $element['comment'] = [ - '#type' => 'textarea', - '#required' => $settings_comment == '2', - '#access' => $settings_comment != '0', // Align with action buttons. - '#title' => t('Workflow comment'), - '#description' => t('A comment to put in the workflow log.'), - '#default_value' => $transition ? $transition->getComment() : '', - '#rows' => 2, - ]; - - // In WorkflowTransitionForm, a default 'Submit' button is added over there. - // In Entity Form, a button per permitted state is added in workflow_form_alter(). - if ($settings_options_type == 'buttons' || $settings_options_type == 'dropbutton') { - // D7: How do action buttons work? See also d.o. issue #2187151. - // D7: Create 'action buttons' per state option. Set $sid property on each button. - // 1. Admin sets ['widget']['options']['#type'] = 'buttons'. - // 2. This function formElement() creates 'action buttons' per state option; - // sets $sid property on each button. - // 3. User clicks button. - // 4. Callback _workflow_transition_form_validate_buttons() sets proper State. - // 5. Callback _workflow_transition_form_validate_buttons() sets Submit function. - - // Performance: inform workflow_form_alter() to do its job. - _workflow_use_action_buttons($settings_options_type); - - // Make sure the '#type' is not set to the invalid 'buttons' value. - // It will be replaced by action buttons, but sometimes, the select box - // is still shown. - // @see workflow_form_alter(). - $element['to_sid']['#type'] = 'select'; - $element['to_sid']['#access'] = FALSE; - } - return $element; - } - - /** - * Returns a unique string identifying the form. - * - * @return string - */ - protected static function getFormId() { - return 'workflow_transition_form'; //@todo D8-port: add $form_id for widget and History tab. - } - - /** - * Implements ContentEntityForm::copyFormValuesToEntity(), and is called from: - * - WorkflowTransitionForm::copyFormValuesToEntity() - * - WorkflowDefaultWidget - * - * N.B. in contrary to ContentEntityForm::copyFormValuesToEntity(), - * - parameter 1 is returned as result, to be able to create a new Transition object. - * - parameter 3 is not $form_state (from Form), but an $item array (from Widget). - * - * @param \Drupal\Core\Entity\EntityInterface $transition - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @param array $item - * - * @return WorkflowTransitionInterface - */ - static public function copyFormValuesToTransition(EntityInterface $transition, array $form, FormStateInterface $form_state, array $item) { - /** @var WorkflowTransitionInterface $transition */ - /** @var \Drupal\user\UserInterface $user */ - $user = workflow_current_user(); // @todo #2287057: verify if submit() really is only used for UI. If not, $user must be passed. - - /** - * Derived input - */ - // Make sure we have subset ['workflow_scheduled_date_time'] - if (!isset($item['to_sid'])) { - $entity_id = $transition->getTargetEntityId(); - drupal_set_message(t('Error: content @id has no workflow attached. The data is not saved.', ['@id' => $entity_id]), 'error'); - // The new state is still the previous state. - return $transition; - } - - // In WorkflowTransitionForm, we receive the complete $form_state. - // Remember, the workflow_scheduled element is not set on 'add' page. - $scheduled = !empty($item['workflow_scheduling']['scheduled']); - $schedule_values = ($scheduled) ? $item['workflow_scheduling']['date_time'] : []; - - // Get user input from element. - $to_sid = $item['to_sid']; - $comment = $item['comment']; - $force = FALSE; - - // @todo D8: add the VBO use case. - /* - // Determine if the transition is forced. - // This can be set by a 'workflow_vbo action' in an additional form element. - $force = isset($form_state['input']['workflow_force']) ? $form_state['input']['workflow_force'] : FALSE; - if (!$entity) { - // E.g., on VBO form. - } - */ - - // @todo D8-port: add below exception. - // Extract the data from $items, depending on the type of widget. - // @todo D8: use MassageFormValues($item, $form, $form_state). - /* - $old_sid = workflow_node_previous_state($entity, $entity_type, $field_name); - if (!$old_sid) { - // At this moment, $old_sid should have a value. If the content does not - // have a state yet, old_sid contains '(creation)' state. But if the - // content is not associated to a workflow, old_sid is now 0. This may - // happen in workflow_vbo, if you assign a state to non-relevant nodes. - $entity_id = entity_id($entity_type, $entity); - drupal_set_message(t('Error: content @id has no workflow attached. The data is not saved.', array('@id' => $entity_id)), 'error'); - // The new state is still the previous state. - $new_sid = $old_sid; - return $new_sid; - } - */ - - $timestamp = \Drupal::time()->getRequestTime(); - if ($scheduled) { - // Fetch the (scheduled) timestamp to change the state. - // Override $timestamp. - $scheduled_date_time = implode(' ', [ - $schedule_values['workflow_scheduled_date'], - $schedule_values['workflow_scheduled_hour'], - // $schedule_values['workflow_scheduled_timezone'], - ]); - $timezone = $schedule_values['workflow_scheduled_timezone']; - $old_timezone = date_default_timezone_get(); - date_default_timezone_set($timezone); - $timestamp = strtotime($scheduled_date_time); - date_default_timezone_set($old_timezone); - if (!$timestamp) { - // Time should have been validated in form/widget. - $timestamp = \Drupal::time()->getRequestTime(); - } - } - - /** - * Process - */ - - /* - * Create a new ScheduledTransition. - */ - if ($scheduled) { - $transition_entity = $transition->getTargetEntity(); - $field_name = $transition->getFieldName(); - $from_sid = $transition->getFromSid(); - /** @var $transition WorkflowTransitionInterface */ - $transition = WorkflowScheduledTransition::create([$from_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($transition_entity); - $transition->setValues($to_sid, $user->id(), $timestamp, $comment); - } - if (!$transition->isExecuted()) { - // Set new values. - // When editing an existing Transition, only comments may change. - $transition->setValues($to_sid, $user->id(), $timestamp, $comment); - $transition->schedule($scheduled); - $transition->force($force); - } - $transition->setComment($comment); - - // Determine and add the attached fields. - // Caveat: This works automatically on a Workflow Form, - // but only with a hack on a widget. - // @todo: Attached fields are not supported in ScheduledTransitions. - $fields = WorkflowManager::getAttachedFields('workflow_transition', $transition->bundle()); - /** @var \Drupal\Core\Field\Entity\BaseFieldOverride $field */ - foreach ($fields as $field_name => $field) { - $user_input = isset($form_state->getUserInput()[$field_name]) ? $form_state->getUserInput()[$field_name] : []; - if (isset($item[$field_name])) { - // On Workflow Form (e.g., history tab, block). - // @todo, in latest tests, this line seems not necessary. - $transition->{$field_name} = $item[$field_name]; - } - elseif ($user_input) { - // On Workflow Widget (e.g., on node, comment). - // @todo, some field types are not supported here. - $transition->{$field_name} = $user_input; - } - } - - return $transition; - } - - /** - * {@inheritdoc} - */ - public function getInfo() { - $class = get_class($this); - return [ - '#input' => TRUE, - '#return_value' => 1, - '#process' => [ - [$class, 'processTransition'], - [$class, 'processAjaxForm'], - //array($class, 'processGroup'), - ], - '#element_validate' => [ - [$class, 'validateTransition'], - ], - '#pre_render' => [ - [$class, 'preRenderTransition'], - //array($class, 'preRenderGroup'), - ], - //'#theme' => 'input__checkbox', - //'#theme' => 'input__textfield', - '#theme_wrappers' => ['form_element'], - //'#title_display' => 'after', - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/Workflow.php b/sites/all/modules/contrib/admin/workflow/src/Entity/Workflow.php deleted file mode 100644 index a2b7459e3..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/Workflow.php +++ /dev/null @@ -1,468 +0,0 @@ -getCreationState(); - } - - return $status; - } - - /** - * {@inheritdoc} - */ - public static function postLoad(EntityStorageInterface $storage, array &$entities) { - /** @var Workflow $workflow */ - foreach($entities as &$workflow) { - //Better performance, together with Annotation static_cache = TRUE. - // Load the states, and set the creation state. - $workflow->getStates(); - $workflow->getCreationState(); - } - } - - /** - * Given a wid, delete the workflow and its data. - */ - public function delete() { - if (!$this->isDeletable()) { - $message = t('Workflow %workflow is not Deletable. Please delete the field where this workflow type is referred', - ['%workflow' => $this->label()]); - drupal_set_message($message, 'error'); - return; - } - else { - // Delete associated state (also deletes any associated transitions). - foreach ($this->getStates(TRUE) as $state) { - $state->deactivate(''); - $state->delete(); - } - - // Delete the workflow. - parent::delete(); - } - } - - /** - * {@inheritdoc} - */ - public function isValid() { - $is_valid = TRUE; - - // Don't allow Workflow without states. There should always be a creation state. - $states = $this->getStates(FALSE); - if (count($states) < 1) { - // That's all, so let's remind them to create some states. - $message = t('Workflow %workflow has no states defined, so it cannot be assigned to content yet.', - ['%workflow' => $this->label()]); - drupal_set_message($message, 'warning'); - - // Skip allowing this workflow. - $is_valid = FALSE; - } - - // Also check for transitions, at least out of the creation state. Don't filter for roles. - $transitions = $this->getTransitionsByStateId($this->getCreationSid(), ''); - if (count($transitions) < 1) { - // That's all, so let's remind them to create some transitions. - $message = t('Workflow %workflow has no transitions defined, so it cannot be assigned to content yet.', - ['%workflow' => $this->label()]); - drupal_set_message($message, 'warning'); - - // Skip allowing this workflow. - $is_valid = FALSE; - } - - return $is_valid; - } - - /** - * {@inheritdoc} - */ - public function isDeletable() { - - // May not be deleted if assigned to a Field. - foreach (_workflow_info_fields() as $field_info) { - if ($field_info->getSetting('workflow_type') == $this->id()) { - return FALSE; - } - } - return TRUE; - } - - /** - * Property functions. - */ - - /** - * {@inheritdoc} - */ - public function getWorkflowId() { - return $this->id(); - } - - /** - * {@inheritdoc} - */ - public function createState($sid, $save = TRUE) { - $wid = $this->id(); - /* @var $state WorkflowState */ - $state = WorkflowState::load($sid); - if (!$state || $wid != $state->getWorkflowId()) { - $values = ['id' => $sid, 'wid' => $wid]; - $state = WorkflowState::create($values); - if ($save) { - $state->save(); - } - } - - // Maintain the new object in the workflow. - $this->states[$state->id()] = $state; - - return $state; - } - - /** - * {@inheritdoc} - */ - public function getCreationState() { - // First, find it. - if (!$this->creation_state) { - foreach ($this->getStates(TRUE) as $state) { - if ($state->isCreationState()) { - $this->creation_state = $state; - $this->creation_sid = $state->id(); - } - } - } - - // First, then, create it. - if (!$this->creation_state) { - $state = $this->createState(WORKFLOW_CREATION_STATE_NAME); - $this->creation_state = $state; - $this->creation_sid = $state->id(); - } - - return $this->creation_state; - } - - /** - * {@inheritdoc} - */ - public function getCreationSid() { - if (!$this->creation_sid) { - $state = $this->getCreationState(); - return $state->id(); - } - return $this->creation_sid; - } - - /** - * {@inheritdoc} - */ - public function getFirstSid(EntityInterface $entity, $field_name, AccountInterface $user, $force = FALSE) { - $creation_state = $this->getCreationState(); - $options = $creation_state->getOptions($entity, $field_name, $user, $force); - if ($options) { - $keys = array_keys($options); - $sid = $keys[0]; - } - else { - // This should never happen, but it did during testing. - drupal_set_message(t('There are no workflow states available. Please notify your site administrator.'), 'error'); - $sid = 0; - } - return $sid; - } - - /** - * {@inheritdoc} - */ - public function getNextSid(EntityInterface $entity, $field_name, AccountInterface $user, $force = FALSE) { - $current_sid = WorkflowManager::getCurrentStateId($entity, $field_name); - /* @var $current_state WorkflowState */ - $current_state = WorkflowState::load($current_sid); - $options = $current_state->getOptions($entity, $field_name, $user, $force); - // Loop over every option. To find the next one. - $flag = $current_state->isCreationState(); - $new_sid = $current_state->id(); - - foreach ($options as $sid => $name) { - if ($flag) { - $new_sid = $sid; - break; - } - if ($sid == $current_state->id()) { - $flag = TRUE; - } - } - - return $new_sid; - } - - /** - * {@inheritdoc} - */ - public function getStates($all = FALSE, $reset = FALSE) { - $wid = $this->id(); - - if ($reset) { - $this->states = $wid ? WorkflowState::loadMultiple([], $wid, $reset) : []; - } - elseif ($this->states === NULL) { - $this->states = $wid ? WorkflowState::loadMultiple([], $wid, $reset) : []; - } - elseif ($this->states === []) { - $this->states = $wid ? WorkflowState::loadMultiple([], $wid, $reset) : []; - } - - // Do not unset, but add to array - you'll remove global objects otherwise. - $states = []; - foreach ($this->states as $state) { - $id = $state->id(); - if ($all === TRUE) { - $states[$id] = $state; - } - elseif (($all === FALSE) && ($state->isActive() && !$state->isCreationState())) { - $states[$id] = $state; - } - elseif (($all == 'CREATION') && ($state->isActive() || $state->isCreationState())) { - $states[$id] = $state; - } - else { - // Do not add state. - } - } - return $states; - } - - /** - * {@inheritdoc} - */ - public function getState($sid) { - $wid = $this->id(); - $state = WorkflowState::load($sid); - if (!$wid || $wid == $state->getWorkflowId()) { - return $state; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function createTransition($from_sid, $to_sid, $values = []) { - $config_transition = NULL; - - // First check if this transition already exists. - $transitions = $this->getTransitionsByStateId($from_sid, $to_sid); - if ($transitions) { - $config_transition = reset($transitions); - } - else { - $values['wid'] = $this->id(); - $values['from_sid'] = $from_sid; - $values['to_sid'] = $to_sid; - $config_transition = WorkflowConfigTransition::create($values); - $config_transition->save(); - } - // Maintain the new object in the workflow. - $this->transitions[$config_transition->id()] = $config_transition; - - return $config_transition; - } - - /** - * {@inheritdoc} - */ - public function sortTransitions() { - // Sort the transitions on state weight. - uasort($this->transitions, ['Drupal\workflow\Entity\WorkflowConfigTransition', 'sort'] ); - } - - /** - * {@inheritdoc} - */ - public function getTransitions(array $ids = NULL, array $conditions = []) { - $config_transitions = []; - - // Get filters on 'from' states, 'to' states, roles. - $from_sid = isset($conditions['from_sid']) ? $conditions['from_sid'] : FALSE; - $to_sid = isset($conditions['to_sid']) ? $conditions['to_sid'] : FALSE; - - // Get valid states + creation state. - $states = $this->getStates('CREATION'); - // Cache all transitions in the workflow. - if (!$this->transitions) { - $this->transitions = WorkflowConfigTransition::loadMultiple($ids); - - $this->sortTransitions(); - } - - /* @var $config_transition WorkflowConfigTransition */ - foreach ($this->transitions as &$config_transition) { - if (!isset($states[$config_transition->getFromSid()])) { - // Not a valid transition for this workflow. @todo: delete them. - } - elseif ($from_sid && $from_sid != $config_transition->getFromSid()) { - // Not the requested 'from' state. - } - elseif ($to_sid && $to_sid != $config_transition->getToSid()) { - // Not the requested 'to' state. - } - else { - // Transition is allowed, permitted. Add to list. - $config_transitions[$config_transition->id()] = $config_transition; - } - } - return $config_transitions; - } - - /** - * {@inheritdoc} - */ - public function getTransitionsById($tid) { - return $this->getTransitions([$tid]); - } - - /** - * {@inheritdoc} - */ - public function getTransitionsByStateId($from_sid, $to_sid) { - $conditions = [ - 'from_sid' => $from_sid, - 'to_sid' => $to_sid, - ]; - return $this->getTransitions(NULL, $conditions); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransition.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransition.php deleted file mode 100644 index 50b9b58cc..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransition.php +++ /dev/null @@ -1,237 +0,0 @@ -to_sid ? $this->to_sid : $this->from_sid); - if($state) { - $this->setWorkflow($state->getWorkflow()); - } - } - - /** - * Helper function for __construct. Used for all children of WorkflowTransition (aka WorkflowScheduledTransition) - * @param $from_sid - * @param $to_sid - */ - public function setValues($from_sid, $to_sid) { - // @todo : unused parameters. Remove the method/parameters? - $state = WorkflowState::load($this->to_sid ? $this->to_sid : $this->from_sid); - if($state) { - $this->setWorkflow($state->getWorkflow()); - } - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - parent::calculateDependencies(); - $this->addDependency('config', $this->getFromState()->getConfigDependencyName()); - $this->addDependency('config', $this->getToState()->getConfigDependencyName()); - return $this; - } - - /** - * {@inheritdoc} - */ - public function save() { - $workflow = $this->getWorkflow(); - - // To avoid double posting, check if this (new) transition already exist. - if (empty($this->id())) { - if ($workflow) { - $config_transitions = $workflow->getTransitionsByStateId($this->from_sid, $this->to_sid); - $config_transition = reset($config_transitions); - if ($config_transition) { - $this->set('id', $config_transition->id()); - } - } - } - - // Create the machine_name. This can be used to rebuild/revert the Feature in a target system. - if (empty($this->id())) { - $wid = $workflow->id(); - $this->set('id', implode('', [$wid, substr($this->from_sid, strlen($wid)), substr($this->to_sid, strlen($wid))])); - } - - $status = parent::save(); - - if ($status) { - // Save in current workflow for the remainder of this page request. - // Keep in sync with Workflow::getTransitions() ! - if ($workflow) { - $workflow->transitions[$this->id()] = $this; - // $workflow->sortTransitions(); - } - } - - return $status; - } - - /** @noinspection PhpMissingParentCallCommonInspection - * {@inheritdoc} - */ - public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) { - // Sort the entities using the entity class's sort() method. - // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort(). - /** @var WorkflowTransitionInterface $a */ - /** @var WorkflowTransitionInterface $b */ - if (!$a->getFromSid() || !$b->getFromSid()) { - return 0; - } - // First sort on From-State. - $from_state_a = $a->getFromState(); - $from_state_b = $b->getFromState(); - if ($from_state_a->weight < $from_state_b->weight) return -1; - if ($from_state_a->weight > $from_state_b->weight) return +1; - - // Then sort on To-State. - $to_state_a = $a->getToState(); - $to_state_b = $b->getToState(); - if ($to_state_a->weight < $to_state_b->weight) return -1; - if ($to_state_a->weight > $to_state_b->weight) return +1; - - return 0; - } - - /** - * Property functions. - */ - - /** - * {@inheritdoc} - */ - public function getFromState() { - return WorkflowState::load($this->from_sid); - } - - /** - * {@inheritdoc} - */ - public function getToState() { - return WorkflowState::load($this->to_sid); - } - - /** - * {@inheritdoc} - */ - public function getFromSid() { - return $this->from_sid; - } - - /** - * {@inheritdoc} - */ - public function getToSid() { - return $this->to_sid; - } - - /** - * {@inheritdoc} - */ - public function isAllowed(UserInterface $user, $force = FALSE) { - - $type_id = $this->getWorkflowId(); - if ($user->hasPermission("bypass $type_id workflow_transition access")) { - // Superuser is special. And $force allows Rules to cause transition. - return TRUE; - } - if ($force) { - return TRUE; - } - if ($this->getFromSid() == $this->getToSid()) { - // Anyone may save an entity without changing state. - return TRUE; - } - return TRUE == array_intersect($user->getRoles(), $this->roles); - } - - /** - * Determines if the State changes by this Transition. - * @return bool - */ - public function hasStateChange() { - if ($this->from_sid == $this->to_sid) { - return FALSE; - } - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransitionInterface.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransitionInterface.php deleted file mode 100644 index 7e923b0fc..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowConfigTransitionInterface.php +++ /dev/null @@ -1,74 +0,0 @@ -settingsForm() - * - * @return bool - * $is_valid - */ - public function isValid(); - - /** - * Returns if the Workflow may be deleted. - * - * @return bool - * TRUE if a Workflow may safely be deleted. - */ - public function isDeletable(); - - /** - * Create a new state for this workflow. - * - * @param string $sid - * @param bool $save - * Indicator if the new state must be saved. Normally, the new State is - * saved directly in the database. This is because you can use States only - * with Transitions, and they rely on State IDs which are generated - * magically when saving the State. But you may need a temporary state. - * - * @return \Drupal\workflow\Entity\WorkflowState - * The new state. - */ - public function createState($sid, $save = TRUE); - - /** - * Gets the initial state for a newly created entity. - */ - public function getCreationState(); - - /** - * Gets the ID of the initial state for a newly created entity. - */ - public function getCreationSid(); - - /** - * Gets the first valid state ID, after the creation state. - * - * Uses WorkflowState::getOptions(), because this does an access check. - * The first State ID is user-dependent! - * - * @param \Drupal\Core\Entity\EntityInterface | null $entity - * The entity at hand. May be NULL (E.g., on a Field settings page). - * @param $field_name - * @param \Drupal\Core\Session\AccountInterface $user - * @param bool $force - * - * @return string - * A State ID. - */ - public function getFirstSid(EntityInterface $entity, $field_name, AccountInterface $user, $force = FALSE); - - /** - * Returns the next state for the current state. - * Is used in VBO Bulk actions. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity at hand. - * @param $field_name - * @param \Drupal\Core\Session\AccountInterface $user - * @param bool $force - * - * @return string - * A State ID. - */ - public function getNextSid(EntityInterface $entity, $field_name, AccountInterface $user, $force = FALSE); - - /** - * Gets all states for a given workflow. - * - * @param mixed $all - * Indicates to which states to return. - * - TRUE = all, including Creation and Inactive; - * - FALSE = only Active states, not Creation; - * - 'CREATION' = only Active states, including Creation. - * @param bool $reset - * - * @return WorkflowState[] - * An array of WorkflowState objects. - */ - public function getStates($all = FALSE, $reset = FALSE); - - /** - * Gets a state for a given workflow. - * - * @param string $sid - * A state ID. - * - * @return WorkflowState - * A WorkflowState object. - */ - public function getState($sid); - - /** - * Creates a Transition for this workflow. - * - * @param string $from_sid - * @param string $to_sid - * @param array $values - * - * @return WorkflowConfigTransitionInterface - */ - public function createTransition($from_sid, $to_sid, $values = []); - - /** - * Sorts all Transitions for this workflow, according to State weight. - * - * This is only needed for the Admin UI. - */ - public function sortTransitions(); - - /** - * Loads all allowed ConfigTransitions for this workflow. - * - * @param array|null $ids - * Array of Transitions IDs. If NULL, show all transitions. - * @param array $conditions - * $conditions['from_sid'] : if provided, a 'from' State ID. - * $conditions['to_sid'] : if provided, a 'to' state ID. - * - * @return \Drupal\workflow\Entity\WorkflowConfigTransition[] - */ - public function getTransitions(array $ids = NULL, array $conditions = []); - - public function getTransitionsById($tid); - - /** - * Get a specific transition. - * - * @param string $from_sid - * @param string $to_sid - * - * @return \Drupal\workflow\Entity\WorkflowConfigTransition[] - */ - public function getTransitionsByStateId($from_sid, $to_sid); - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManager.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManager.php deleted file mode 100644 index 06493beb5..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManager.php +++ /dev/null @@ -1,463 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->userConfig = $config_factory->get('user.settings'); - $this->stringTranslation = $string_translation; - $this->moduleHandler = $module_handler; - $this->currentUser = $current_user; - } - - /** - * {@inheritdoc} - */ - public static function executeScheduledTransitionsBetween($start = 0, $end = 0) { - $clear_cache = FALSE; - - // If the time now is greater than the time to execute a transition, do it. - foreach (WorkflowScheduledTransition::loadBetween($start, $end) as $scheduled_transition) { - $field_name = $scheduled_transition->getFieldName(); - $entity = $scheduled_transition->getTargetEntity(); - $from_sid = $scheduled_transition->getFromSid(); - - // Make sure transition is still valid: the entity must still be in - // the state it was in, when the transition was scheduled. - if (!$entity) { - continue; - } - - $current_sid = workflow_node_current_state($entity, $field_name); - if (!$current_sid || ($current_sid != $from_sid)) { - // Entity is not in the same state it was when the transition - // was scheduled. Defer to the entity's current state and - // abandon the scheduled transition. - $message = t('Scheduled Transition is discarded, since Entity has state ID %sid1, instead of expected ID %sid2.'); - $scheduled_transition->logError($message, 'error', $current_sid, $from_sid); - $scheduled_transition->delete(); - continue; - } - - // If user didn't give a comment, create one. - $comment = $scheduled_transition->getComment(); - if (empty($comment)) { - $scheduled_transition->addDefaultComment(); - } - - // Do transition. Force it because user who scheduled was checked. - // The scheduled transition is not scheduled anymore, and is also deleted from DB. - // A watchdog message is created with the result. - $scheduled_transition->schedule(FALSE); - $scheduled_transition->executeAndUpdateEntity(TRUE); - - if (!$field_name) { - $clear_cache = TRUE; - } - } - - if ($clear_cache) { - // Clear the cache so that if the transition resulted in a entity - // being published, the anonymous user can see it. - Cache::invalidateTags(['rendered']); - } - } - - /** - * {@inheritdoc} - */ - public static function executeTransitionsOfEntity(EntityInterface $entity) { - - // Avoid this hook on workflow objects. - if (WorkflowManager::isWorkflowEntityType($entity->getEntityTypeId())) { - return; - } - - $user = workflow_current_user(); - - foreach (workflow_get_workflow_field_names($entity) as $field_name) { - // Transition is created in widget or WorkflowTransitionForm. - /** @var $transition WorkflowTransitionInterface */ - $transition = $entity->{$field_name}->__get('workflow_transition'); - if (!$transition) { - // We come from creating/editing an entity via entity_form, with core widget or hidden Workflow widget. - // @todo D8: from an Edit form with hidden widget. - /** @noinspection PhpUndefinedFieldInspection */ - if ($entity->original) { - // Editing a Node with hidden Widget. State change not possible, so bail out. -// $entity->{$field_name}->value = $entity->original->{$field_name}->value; -// continue; - } - - // Creating a Node with hidden Workflow Widget. Generate valid first transition. - // @todo D8: Test Creating a non-Node Entity with hidden Workflow widget. - $comment = ''; - $old_sid = WorkflowManager::getPreviousStateId($entity, $field_name); - $new_sid = $entity->{$field_name}->value; - $field_info = FieldStorageConfig::loadByName($entity->getEntityTypeId(), $field_name); - if ((!$new_sid) && $wid = $field_info->getSetting('workflow_type')) { - /** @var Workflow $workflow */ - $workflow = Workflow::load($wid); - $new_sid = $workflow->getFirstSid($entity, $field_name, $user); - } - $transition = WorkflowTransition::create([$old_sid, 'field_name' => $field_name]); - $transition->setValues($new_sid, $user->id(), \Drupal::time()->getRequestTime(), $comment, TRUE); - } - - // We come from Content/Comment edit page, from widget. - // Set the just-saved entity explicitly. Not necessary for update, - // but upon insert, the old version didn't have an ID, yet. - $transition->setTargetEntity($entity); - - if ($transition->isExecuted()) { - // Sometimes (due to Rules, or extra programming) it can happen that - // a Transition is executed twice in a call. This check avoids that - // situation, that generates message "Transition is executed twice". - $executed = TRUE; - } - elseif ($transition->isScheduled()) { - $executed = $transition->save(); // Returns a positive integer. - } - elseif ($entity->getEntityTypeId() == 'comment') { - // If Transition is added via CommentForm, save Comment AND Entity. - // Execute and check the result. - $new_sid = $transition->executeAndUpdateEntity(); - $executed = ($new_sid == $transition->getToSid()) ? TRUE : FALSE; - } - else { - // Execute and check the result. - $new_sid = $transition->execute(); - $executed = ($new_sid == $transition->getToSid()) ? TRUE : FALSE; - } - - // If the transition failed, revert the entity workflow status. - // For new entities, we do nothing: it has no original. - if (!$executed && isset($entity->original)) { - $originalValue = $entity->original->{$field_name}->value; - $entity->{$field_name}->setValue($originalValue); - } - } - } - - /** - * {@inheritdoc} - */ - public static function getPreviousStateId(EntityInterface $entity, $field_name = '') { - $sid = ''; - - if (!$entity) { - return $sid; - } - - // If $field_name is not known, yet, determine it. - $field_name = ($field_name) ? $field_name : workflow_get_field_name($entity, $field_name); - // If $field_name is found, get more details. - if (!$field_name) { - // Return the initial value. - return $sid; - } - - // A node may not have a Workflow attached. - if ($entity->isNew()) { - // A new Node. D7: $is_new is not set when saving terms, etc. - $sid = self::getCreationStateId($entity, $field_name); - } - else { - // @todo?: Read the history with an explicit langcode. - // @todo D8: #2373383 add integration with older revisions via Revisioning module. - $langcode = ''; // $entity->language()->getId(); - $entity_type = $entity->getEntityTypeId(); - $last_transition = WorkflowTransition::loadByProperties($entity_type, $entity->id(), [], $field_name, $langcode, 'DESC'); - if ($last_transition) { - $sid = $last_transition->getToSid(); // @see #2637092, #2612702 - } - } - - if (!$sid) { - // No history found on an existing entity. - $sid = self::getCreationStateId($entity, $field_name); - } - - return $sid; - } - - /** - * Gets the creation sid for a given $entity and $field_name. - * - * Is a helper function for: - * - workflow_node_current_state() - * - workflow_node_previous_state() - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * @param string $field_name - * - * @return string - * The ID of the creation State for the Workflow of the field. - */ - private static function getCreationStateId($entity, $field_name) { - $sid = ''; - - /** @var \Drupal\Core\Config\Entity\ConfigEntityBase $entity */ - /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_config */ - $field_config = $entity->get($field_name)->getFieldDefinition(); - $field_storage = $field_config->getFieldStorageDefinition(); - $wid = $field_storage->getSetting('workflow_type'); - if ($wid) { - /** @var Workflow $workflow */ - $workflow = Workflow::load($wid); - if (!$workflow) { - drupal_set_message(t('Workflow %wid cannot be loaded. Contact your system administrator.', ['%wid' => $wid]), 'error'); - } - else { - $sid = $workflow->getCreationSid(); - } - } - - return $sid; - } - - /** - * {@inheritdoc} - */ - public static function deleteUser(AccountInterface $account) { - self::cancelUser([], $account, 'user_cancel_delete'); - } - - /** - * {@inheritdoc} - */ - public static function cancelUser($edit, AccountInterface $account, $method) { - - switch ($method) { - case 'user_cancel_block': - // Disable the account and keep its content. - case 'user_cancel_block_unpublish': - // Disable the account and unpublish its content. - // Do nothing. - break; - case 'user_cancel_reassign': - // Delete the account and make its content belong to the Anonymous user. - case 'user_cancel_delete': - // Delete the account and its content. - /** - * Update tables for deleted account, move account to user 0 (anon.) - * ALERT: This may cause previously non-Anonymous posts to suddenly - * be accessible to Anonymous. - */ - - /** - * Given a user id, re-assign history to the new user account. - * Called by user_delete(). - */ - $uid = $account->id(); - $new_uid = 0; - $database = \Drupal::database(); - $database->update('workflow_transition_history') - ->fields(['uid' => $new_uid]) - ->condition('uid', $uid, '=') - ->execute(); - $database->update('workflow_transition_schedule') - ->fields(['uid' => $new_uid]) - ->condition('uid', $uid, '=') - ->execute(); - - break; - } - } - - /** - * {@inheritdoc} - */ - public static function participateUserRoles(EntityInterface $workflow) { - $type_id = $workflow->id(); - foreach (user_roles() as $rid => $role) { - $perms = ["create $type_id workflow_transition" => 1]; - user_role_change_permissions($rid, $perms); // <=== Enable Roles. - } - } - - /** - * {@inheritdoc} - */ - public static function getWorkflowTransitionForm(EntityInterface $entity, $field_name, array $form_state_additions = []) { - // Create a transition, to pass to the form. No need to use setValues(). - $current_sid = workflow_node_current_state($entity, $field_name); - $transition = WorkflowTransition::create([$current_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($entity); - // Create the WorkflowTransitionForm. - /** @var \Drupal\Core\Entity\EntityFormBuilder $entity_form_builder */ - $entity_form_builder = \Drupal::getContainer()->get('entity.form_builder'); - $form = $entity_form_builder->getForm($transition, 'add', $form_state_additions); - return $form; - } - - /** - * {@inheritdoc} - */ - public function getFields($entity_type_id) { - $entity_type = $this->entityTypeManager->getDefinition($entity_type_id); - if (!$entity_type->entityClassImplements(FieldableEntityInterface::class)) { - return []; - } - - $map = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('workflow'); - return isset($map[$entity_type_id]) ? $map[$entity_type_id] : []; - } - - /** - * {@inheritdoc} - */ - public static function getAttachedFields($entity_type_id, $bundle) { - $added_fields = []; - - // Determine the fields added by Field UI. - $entity_field_manager = \Drupal::service('entity_field.manager'); - //$extra_fields = $this->entityFieldManager->getExtraFields($entity_type_id, $bundle); - //$base_fields = $entity_field_manager->getBaseFieldDefinitions($entity_type_id, $bundle); - $fields = $entity_field_manager->getFieldDefinitions($entity_type_id, $bundle); - foreach ($fields as $key => $field) { - // Remove BaseFieldDefinition, BaseFieldOverride. - if (($field instanceof FieldConfig)) { - $added_fields[$key] = $field; - } - } - return $added_fields; - } - - /** - * {@inheritdoc} - */ - public static function getCurrentStateId(EntityInterface $entity, $field_name = '') { - $sid = ''; - - if (!$entity) { - return $sid; - } - - // If $field_name is not known, yet, determine it. - $field_name = ($field_name) ? $field_name : workflow_get_field_name($entity, $field_name); - // If $field_name is found, get more details. - if (!$field_name || !isset($entity->{$field_name})) { - // Return the initial value. - return $sid; - } - - // Normal situation: get the value. - $sid = $entity->{$field_name}->value; - - // Entity is new or in preview or there is no current state. Use previous state. - // (E.g., content was created before adding workflow.) - if (!$sid || !empty($entity->isNew()) || !empty($entity->in_preview)) { - $sid = self::getPreviousStateId($entity, $field_name); - } - - return $sid; - } - - /** - * {@inheritdoc} - */ - public static function isOwner(AccountInterface $account, EntityInterface $entity = NULL) { - $is_owner = FALSE; - - // @todo: Keep below code aligned between WorkflowState, ~Transition, ~TransitionListController - // Determine if user is owner of the entity. - $uid = ($account) ? $account->id() : -1; - // Get the entity's ID and Author ID. - $entity_id = ($entity) ? $entity->id() : ''; - // Some entities (e.g., taxonomy_term) do not have a uid. - // $entity_uid = $entity->get('uid'); // isset($entity->uid) ? $entity->uid : 0; - $entity_uid = (method_exists($entity, 'getOwnerId')) ? $entity->getOwnerId() : -1; - - if (!$entity_id) { - // This is a new entity. User is author. Add 'author' role to user. - $is_owner = TRUE; - } - elseif (($entity_uid > 0) && ($uid > 0) && ($entity_uid == $uid)) { - // This is an existing entity. User is author. - // D8: use "access own" permission. D7: Add 'author' role to user. - // N.B.: If 'anonymous' is the author, don't allow access to History Tab, - // since anyone can access it, and it will be published in Search engines. - $is_owner = TRUE; - } - else { - // This is an existing entity. User is not the author. Do nothing. - } - return $is_owner; - } - - /** - * {@inheritdoc} - */ - public static function isWorkflowEntityType($entity_type_id) { - return in_array($entity_type_id, [ - 'workflow_type', - 'workflow_state', - 'workflow_config_transition', - 'workflow_transition', - 'workflow_scheduled_transition', - ]); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManagerInterface.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManagerInterface.php deleted file mode 100644 index 7fc0c5f5f..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowManagerInterface.php +++ /dev/null @@ -1,173 +0,0 @@ -is_scheduled = TRUE; - // This transition is not executed. - $this->is_executed = FALSE; - } - - /** - * {@inheritdoc} - */ - public function setValues($to_sid, $uid = NULL, $scheduled = NULL, $comment = '', $force_create = FALSE) { - parent::setValues($to_sid, $uid, $scheduled, $comment, $force_create); - } - - /** - * {@inheritdoc} - * - * This is a hack to avoid the following error, because ScheduledTransition is not a bundle of Workflow: - * Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:workflow_scheduled_transition:first" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 60 of core\lib\Drupal\Component\Plugin\Discovery\DiscoveryTrait.php). - */ - function validate() { - // Since this function generates an error in one use case (using WorkflowTransitionForm) - // and is not called in the other use case (using the Workflow Widget), - // this function is disabled for now. - // @todo: this function is only called in the WorkflowTransitionForm, not in the Widget. - // @todo: repair https://www.drupal.org/node/2896650 - // - // The following is from return parent::validate(); - $this->validated = TRUE; - //$violations = $this->getTypedData()->validate(); - // return new EntityConstraintViolationList($this, iterator_to_array($violations)); - $violations = []; - return new EntityConstraintViolationList($this, $violations); - } - - /** - * CRUD functions. - */ - - /** - * {@inheritdoc} - * - * Saves a scheduled transition. If the transition is executed, save in history. - */ - public function save() { - - // If executed, save in history. - if ($this->is_executed) { - // Be careful, we are not a WorkflowScheduleTransition anymore! - // No fuzzing around, just copy the ScheduledTransition to a normal one. - $current_sid = $this->getFromSid(); - $field_name = $this->getFieldName(); - $executed_transition = WorkflowTransition::create([$current_sid, 'field_name' => $field_name]); - $executed_transition->setTargetEntity($this->getTargetEntity()); - $executed_transition->setValues($this->getToSid(), $this->getOwnerId(), \Drupal::time()->getRequestTime(), $this->getComment()); - return $executed_transition->save(); // <-- exit !! - } - - $hid = $this->id(); - if (!$hid) { - // Insert the transition. Make sure it hasn't already been inserted. - // @todo: Allow a scheduled transition per revision. - $entity = $this->getTargetEntity(); - $found_transition = self::loadByProperties($entity->getEntityTypeId(), $entity->id(), [], $this->getFieldName(), $this->getLangcode()); - if ($found_transition) { - // Avoid duplicate entries. - $found_transition->delete(); - $result = parent::save(); - } - else { - $result = parent::save(); - } - } - else { - workflow_debug(__FILE__, __FUNCTION__, __LINE__ ); // @todo D8-port: still test this snippet. - // Update the transition. - $result = parent::save(); - } - - // Create user message. - if ($state = $this->getToState()) { - $entity = $this->getTargetEntity(); - $message = '%entity_title scheduled for state change to %state_name on %scheduled_date'; - $args = [ - '%entity_title' => $entity->label(), - '%state_name' => $state->label(), - '%scheduled_date' => $this->getTimestampFormatted(), - 'link' => ($this->getTargetEntityId() && $this->getTargetEntity()->hasLinkTemplate('canonical')) ? $this->getTargetEntity()->toLink(t('View'))->toString() : '', - ]; - \Drupal::logger('workflow')->notice($message, $args); - drupal_set_message(t($message, $args)); - } - - return $result; - } - - /** - * {@inheritdoc} - */ - public static function loadByProperties($entity_type, $entity_id, array $revision_ids = [], $field_name = '', $langcode = '', $sort = 'ASC', $transition_type = 'workflow_scheduled_transition') { - // N.B. $transition_type is set as parameter default. - return parent::loadByProperties($entity_type, $entity_id, $revision_ids, $field_name, $langcode, $sort, $transition_type); - } - - /** - * {@inheritdoc} - */ - public static function loadMultipleByProperties($entity_type, array $entity_ids, array $revision_ids = [], $field_name = '', $langcode = '', $limit = NULL, $sort = 'ASC', $transition_type = 'workflow_scheduled_transition') { - // N.B. $transition_type is set as parameter default. - return parent::loadMultipleByProperties($entity_type, $entity_ids, $revision_ids, $field_name, $langcode, $limit, $sort, $transition_type); - } - - /** - * Given a time frame, get all scheduled transitions. - * - * @param int $start - * @param int $end - * @param string $from_sid - * @param string $to_sid - * - * @return WorkflowScheduledTransition[] - * An array of transitions. - */ - public static function loadBetween($start = 0, $end = 0, $from_sid = '', $to_sid = '') { - $transition_type = 'workflow_scheduled_transition'; // @todo: get this from annotation. - - /* @var $query \Drupal\Core\Entity\Query\QueryInterface */ - $query = \Drupal::entityQuery($transition_type) - ->sort('timestamp', 'ASC') - ->addTag($transition_type); - if ($start) { - $query->condition('timestamp', $start, '>'); - } - if ($end) { - $query->condition('timestamp', $end, '<'); - } - if ($from_sid) { - $query->condition('from_sid', $from_sid, '='); - } - if ($to_sid) { - $query->condition('to_sid', $from_sid, '='); - } - - $ids = $query->execute(); - $transitions = self::loadMultiple($ids); - return $transitions; - } - - /** - * Property functions. - */ - - /** - * If a scheduled transition has no comment, a default comment is added before executing it. - */ - public function addDefaultComment() { - $this->setComment(t('Scheduled by user @uid.', ['@uid' => $this->getOwnerId()])); - } - - /** - * Define the fields. Modify the parent fields. - * {@inheritdoc} - */ - public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { - $fields = []; - - // Add the specific ID-field : tid vs. hid. - $fields['tid'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Transition ID')) - ->setDescription(t('The transition ID.')) - ->setReadOnly(TRUE) - ->setSetting('unsigned', TRUE); - - // Get the rest of the fields. - $fields += parent::baseFieldDefinitions($entity_type); - - // The timestamp has a different description. - $fields['timestamp'] = []; // Reset old value. - $fields['timestamp'] = BaseFieldDefinition::create('created') - ->setLabel(t('Scheduled')) - ->setDescription(t('The date+time this transition is scheduled for.')) -// ->setQueryable(FALSE) -// ->setCustomStorage(FALSE) -// ->setTranslatable(TRUE) -// ->setDisplayOptions('view', array( -// 'label' => 'hidden', -// 'type' => 'timestamp', -// 'weight' => 0, -// )) -// ->setDisplayOptions('form', array( -// 'type' => 'datetime_timestamp', -// 'weight' => 10, -// )) -// ->setDisplayConfigurable('form', TRUE); - ->setRevisionable(TRUE); - - - // Remove the specific ID-field : tid vs. hid. - unset($fields['hid']); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowState.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowState.php deleted file mode 100644 index 165eb58b4..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowState.php +++ /dev/null @@ -1,556 +0,0 @@ -getWorkflow()->getConfigDependencyName() because - // calling $this->getWorkflow() here causes an infinite loop. - /** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $workflow_type */ - $workflow_type = \Drupal::entityTypeManager()->getDefinition('workflow_type'); - $this->addDependency('config', $workflow_type->getConfigPrefix() . '.' . $this->getWorkflowId()); - return $this; - } - - /** - * {@inheritdoc} - */ - public function save($create_creation_state = TRUE) { - // Create the machine_name for new states. - // N.B.: Keep machine_name in WorkflowState and ~ListBuilder aligned. - $sid = $this->id(); - $wid = $this->getWorkflowId(); - $label = $this->label(); - - // Set the workflow-including machine_name. - if ($sid == WORKFLOW_CREATION_STATE_NAME) { - // Set the initial sid. - $sid = implode('_', [$wid, $sid]); - $this->set('id', $sid); - } - elseif (empty($sid)) { - if ($label) { - $transliteration = \Drupal::service('transliteration'); - $value = $transliteration->transliterate($label, LanguageInterface::LANGCODE_DEFAULT, '_'); - $value = strtolower($value); - $value = preg_replace('/[^a-z0-9_]+/', '_', $value); - $sid = implode('_', [$wid, $value]); - } - else { - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - $sid = 'state_' . $this->id(); - $sid = implode('_', [$wid, $sid]); - } - $this->set('id', $sid); - } - - return parent::save(); - } - - /** - * Get all states in the system, with options to filter, only where a workflow exists. - * - * @_deprecated WorkflowState::getStates() ==> WorkflowState::loadMultiple() - * - * {@inheritdoc} - * - * @param $wid - * The requested Workflow ID. - * @param bool $reset - * An option to refresh all caches. - * - * @return WorkflowState[] - * An array of cached states, keyed by state_id. - */ - public static function loadMultiple(array $ids = NULL, $wid = '', $reset = FALSE) { - $states = parent::loadMultiple(); - usort($states, ['Drupal\workflow\Entity\WorkflowState', 'sort'] ); - - // Filter on Wid, if requested, E.g., by Workflow->getStates(). - // Set the ID as array key. - $result = []; - foreach ($states as $state) { - /** @var WorkflowState $state */ - if ((!$wid) || ($wid == $state->getWorkflowId())) { - $result[$state->id()] = $state; - } - } - return $result; - } - - /** - * {@inheritdoc} - */ - public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) { - /** @var WorkflowState $a */ - /** @var WorkflowState $b */ - $a_wid = $a->getWorkflowId(); - $b_wid = $b->getWorkflowId(); - if ($a_wid == $b_wid) { - $a_weight = $a->getWeight(); - $b_weight = $b->getWeight(); - return ($a_weight < $b_weight) ? -1 : 1; - } - return ($a_wid < $b_wid) ? -1 : 1; - } - - /** - * Deactivate a Workflow State, moving existing content to a given State. - * - * @param int $new_sid - * The state ID, to which all affected entities must be moved. - */ - public function deactivate($new_sid) { - - $current_sid = $this->id(); - $force = TRUE; - - // Notify interested modules. We notify first to allow access to data before we zap it. - // - re-parents any entity that we don't want to orphan, whilst deactivating a State. - // - delete any lingering entity to state values. - // \Drupal::moduleHandler()->invokeAll('workflow', ['state delete', $current_sid, $new_sid, NULL, $force]); - // Invoke the hook. - \Drupal::moduleHandler()->invokeAll('entity_' . $this->getEntityTypeId() . '_predelete', [$this, $current_sid, $new_sid]); - - // Re-parent any entity that we don't want to orphan, whilst deactivating a State. - // TODO D8-port: State should not know about Transition: move this to Workflow->DeactivateState. - if ($new_sid) { - // A candidate for the batch API. - // @TODO: Future updates should seriously consider setting this with batch. - $user = \Drupal::currentUser(); // We can use global, since deactivate() is a UI-only function. - $comment = t('Previous state deleted'); - - foreach (_workflow_info_fields() as $field_info) { - $entity_type_id = $field_info->getTargetEntityTypeId(); - $field_name = $field_info->getName(); - - $result = []; - // CommentForm's are not re-parented upon Deactivate WorkflowState. - if ($entity_type_id != 'comment') { - $query = \Drupal::entityQuery($entity_type_id); - $query->condition($field_name, $current_sid, '='); - $result = $query->execute(); - } - - foreach ($result as $entity_id) { - $entity = \Drupal::entityTypeManager()->getStorage($entity_type_id)->load($entity_id); - $transition = WorkflowTransition::create([$current_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($entity); - $transition->setValues($new_sid, $user->id(), \Drupal::time()->getRequestTime(), $comment, TRUE); - $transition->force($force); - - // Execute Transition, invoke 'pre' and 'post' events, save new state in Field-table, save also in workflow_transition_history. - // For Workflow Node, only {workflow_node} and {workflow_transition_history} are updated. For Field, also the Entity itself. - // Execute transition and update the attached entity. - $new_sid = $transition->executeAndUpdateEntity($force); - } - } - } - - // Delete the transitions this state is involved in. - $workflow = Workflow::load($this->getWorkflowId()); - /** @var WorkflowInterface $workflow */ - /** @var WorkflowTransitionInterface $transition */ - foreach ($workflow->getTransitionsByStateId($current_sid, '') as $transition) { - $transition->delete(); - } - foreach ($workflow->getTransitionsByStateId('', $current_sid) as $transition) { - $transition->delete(); - } - - // Delete the state. -- We don't actually delete, just deactivate. - // This is a matter up for some debate, to delete or not to delete, since this - // causes name conflicts for states. In the meantime, we just stick with what we know. - // If you really want to delete the states, use workflow_cleanup module, or delete(). - $this->status = FALSE; - $this->save(); - - // Clear the cache. - self::loadMultiple([], 0, TRUE); - } - - /** - * Property functions. - */ - - /** - * {@inheritdoc} - */ - public function getWeight() { - return $this->weight; - } - - /** - * Returns the Workflow object of this State. - * - * @return bool - * TRUE if state is active, else FALSE. - */ - public function isActive() { - return (bool) $this->status; - } - - /** - * Checks if the given state is the 'Create' state. - * - * @return bool - */ - public function isCreationState() { - return $this->sysid == WORKFLOW_CREATION_STATE; - } - - /** - * Determines if the Workflow Form must be shown. - * - * If not, a formatter must be shown, since there are no valid options. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * @param string $field_name - * @param \Drupal\Core\Session\AccountInterface $account - * @param bool $force - * - * @return bool - * TRUE = a form (a.k.a. widget) must be shown; FALSE = no form, a formatter must be shown instead. - */ - public function showWidget(EntityInterface $entity, $field_name, AccountInterface $account, $force) { - $options = $this->getOptions($entity, $field_name, $account, $force); - $count = count($options); - // The easiest case first: more then one option: always show form. - if ($count > 1) { - return TRUE; - } - // #2226451: Even in Creation state, we must have 2 visible states to show the widget. - // // Only when in creation phase, one option is sufficient, - // // since the '(creation)' option is not included in $options. - // // When in creation state, - // if ($this->isCreationState()) { - // return TRUE; - // } - return FALSE; - } - - /** - * Returns the allowed transitions for the current state. - * - * @param \Drupal\Core\Entity\EntityInterface|null $entity - * The entity at hand. May be NULL (E.g., on a Field settings page). - * @param string $field_name - * @param \Drupal\Core\Session\AccountInterface|null $account - * @param bool|false $force - * - * @return \Drupal\workflow\Entity\WorkflowConfigTransition[] - * An array of id=>transition pairs with allowed transitions for State. - */ - public function getTransitions(EntityInterface $entity = NULL, $field_name = '', AccountInterface $account = NULL, $force = FALSE) { - $transitions = []; - - if (!$workflow = $this->getWorkflow()) { - // No workflow, no options ;-) - return $transitions; - } - // Load a User object, since we cannot add Roles to AccountInterface. - if (!$user = workflow_current_user($account)) { - // In some edge cases, no user is provided. - return $transitions; - } - - // @todo: Keep below code aligned between WorkflowState, ~Transition, ~TransitionListController - /** - * Get permissions of user, adding a Role to user, depending on situation. - */ - // Determine if user is owner of the entity. - $is_owner = WorkflowManager::isOwner($user, $entity); - - // Check allow-ability of state change if user is not superuser (might be cron) - $type_id = $this->getWorkflowId(); - if ($user->hasPermission("bypass $type_id workflow_transition access")) { - // Superuser is special. And $force allows Rules to cause transition. - $force = TRUE; - } - - if ($is_owner) { - $user->addRole(WORKFLOW_ROLE_AUTHOR_RID); - } - - /** - * Get the object and its permissions. - */ - /** @var WorkflowConfigTransition[] $transitions */ - /** @var Workflow $workflow */ - $transitions = $workflow->getTransitionsByStateId($this->id(), ''); - - /** - * Determine if user has Access. - */ - // Use default module permissions. - foreach ($transitions as $key => $transition) { - if (!$transition->isAllowed($user, $force)) { - unset($transitions[$key]); - } - } - // Let custom code add/remove/alter the available transitions, - // using the new drupal_alter. - // Modules may veto a choice by removing a transition from the list. - // Lots of data can be fetched via the $transition object. - $context = [ - 'entity' => $entity, // ConfigEntities do not have entity attached - 'field_name' => $field_name, // or field. - 'user' => $user, // user may have the custom role AUTHOR. - 'workflow' => $workflow, - 'state' => $this, - 'force' => $force, - ]; - \Drupal::moduleHandler()->alter('workflow_permitted_state_transitions', $transitions, $context); - - /** - * Determine if user has Access. - */ - // As of 8.x-1.x, below hook() is removed, in favour of above alter(). - // Let custom code change the options, using old_style hook. - // Above drupal_alter() calls hook_workflow_permitted_state_transitions_alter() only once. -// foreach ($transitions as $transition) { -// $to_sid = $transition->to_sid; -// $permitted = []; -// -// // We now have a list of config_transitions. Check each against the Entity. -// // Invoke a callback indicating that we are collecting state choices. -// // Modules may veto a choice by returning FALSE. -// // In this case, the choice is never presented to the user. -// if (!$force) { -// // @todo: D8-port: simplify interface for workflow_hook. Remove redundant context. -// $permitted = \Drupal::moduleHandler()->invokeAll('workflow', ['transition permitted', $transition, $user]); -// } -// -// // If vetoed by a module, remove from list. -// if (in_array(FALSE, $permitted, TRUE)) { -// unset($transitions[$transition->id()]); -// } -// } - return $transitions; - } - - /** - * Returns the allowed values for the current state. - * - * @param object $entity - * The entity at hand. May be NULL (E.g., on a Field settings page). - * @param string $field_name - * @param \Drupal\Core\Session\AccountInterface|null $account - * @param bool $force - * - * @return array - * An array of sid=>label pairs. - * If $this->id() is set, returns the allowed transitions from this state. - * If $this->id() is 0 or FALSE, then labels of ALL states of the State's - * Workflow are returned. - */ - public function getOptions($entity, $field_name, AccountInterface $account = NULL, $force = FALSE) { - $options = []; - - // Define an Entity-specific cache per page load. - static $cache = []; - - $entity_id = ($entity) ? $entity->id() : ''; - $entity_type_id = ($entity) ? $entity->getEntityTypeId() : ''; - $current_sid = $this->id(); - - // Get options from page cache, using a non-empty index (just to be sure). - $entity_index = (!$entity) ? 'x' : $entity_id; - if (isset($cache[$entity_type_id][$entity_index][$force][$current_sid])) { - $options = $cache[$entity_type_id][$entity_index][$force][$current_sid]; - return $options; - } - - $workflow = $this->getWorkflow(); - if (!$workflow) { - // No workflow, no options ;-) - $options = []; - } - elseif (!$current_sid) { - // If no State ID is given, we return all states. - // We cannot use getTransitions, since there are no ConfigTransitions - // from State with ID 0, and we do not want to repeat States. - /** @var WorkflowState $state */ - /** @var Workflow $workflow */ - foreach ($workflow->getStates() as $state) { - $options[$state->id()] = html_entity_decode(t('@label', ['@label' => $state->label()])); - } - } - else { - $transitions = $this->getTransitions($entity, $field_name, $account, $force); - foreach ($transitions as $transition) { - // Get the label of the transition, and if empty of the target state. - // Beware: the target state may not exist, since it can be invented - // by custom code in the above drupal_alter() hook. - if (!$label = $transition->label()) { - $to_state = $transition->getToState(); - $label = $to_state ? $to_state->label() : ''; - } - $to_sid = $transition->to_sid; - $options[$to_sid] = html_entity_decode(t('@label', ['@label' => $label])); - } - - // Save to entity-specific cache. - $cache[$entity_type_id][$entity_index][$force][$current_sid] = $options; - } - - return $options; - } - - /** - * Returns the number of entities with this state. - * - * @return int - * Counted number. - * - * @todo: add $options to select on entity type, etc. - */ - public function count() { - $count = 0; - $sid = $this->id(); - - foreach (_workflow_info_fields() as $field_info) { - $field_name = $field_info->getName(); - $query = \Drupal::entityQuery($field_info->getTargetEntityTypeId()); - // @see #2285983 for using SQLite on D7. - $count += $query - ->condition($field_name, $sid, '=') - ->count() // We only need the count. - ->execute(); - } - - return $count; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowStorage.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowStorage.php deleted file mode 100644 index 8c28242ce..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowStorage.php +++ /dev/null @@ -1,76 +0,0 @@ -stateService = $state_service; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('config.factory'), - $container->get('uuid'), - $container->get('language_manager'), - $container->get('state') - ); - } - - /** - * Returns a list of event names that are used by active workflows. - * - * @return string[] - * The list of event names keyed by event name. - */ - protected function getRegisteredEvents() { -// $events = []; -// foreach ($this->loadMultiple() as $rules_config) { -// $event = $rules_config->getEvent(); -// if ($event && !isset($events[$event])) { -// $events[$event] = $event; -// } -// } -// return $events; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransition.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransition.php deleted file mode 100644 index 7be052cd8..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransition.php +++ /dev/null @@ -1,1069 +0,0 @@ -getTargetEntity() to fetch this. - protected $user = NULL; // Use WorkflowTransition->getOwner() to fetch this. - - /* - * Extra data: describe the state of the transition. - */ - protected $is_scheduled; - protected $is_executed; - protected $is_forced = FALSE; - - /** - * Entity class functions. - */ - - /** - * Creates a new entity. - * - * @param array $values - * @param string $entityType - * The entity type of this Entity subclass. - * - * @param bool $bundle - * @param array $translations - * @internal param string $entity_type The entity type of the attached $entity. - * @see entity_create() - * - * No arguments passed, when loading from DB. - * All arguments must be passed, when creating an object programmatically. - * One argument $entity may be passed, only to directly call delete() afterwards. - */ - public function __construct(array $values = [], $entityType = 'workflow_transition', $bundle = FALSE, $translations = []) { - // Please be aware that $entity_type and $entityType are different things! - parent::__construct($values, $entityType, $bundle, $translations); - // This transition is not scheduled. - $this->is_scheduled = FALSE; - // This transition is not executed, if it has no hid, yet, upon load. - $this->is_executed = ($this->id() > 0); - } - - /** - * {@inheritdoc} - * - * @param array $values - * $values[0] may contain a Workflow object or State object or State ID. - * - * @return static - * The entity object. - */ - public static function create(array $values = []) { - if (is_array($values) && isset($values[0])) { - $value = $values[0]; - $state = NULL; - if (is_string($value)) { - $state = WorkflowState::load($value); - } - elseif (is_object($value) && $value instanceof WorkflowState) { - $state = $value; - } - $values['wid'] = $state ? $state->getWorkflowId() : ''; - $values['from_sid'] = $state ? $state->id() : ''; - } - - // Add default values. - $values += [ - 'timestamp' => \Drupal::time()->getRequestTime(), - 'uid' => \Drupal::currentUser()->id(), - ]; - return parent::create($values); - } - - /** - * {@inheritdoc} - */ - public function setValues($to_sid, $uid = NULL, $timestamp = NULL, $comment = '', $force_create = FALSE) { - // Normally, the values are passed in an array, and set in parent::__construct, but we do it ourselves. - - $uid = ($uid === NULL) ? workflow_current_user()->id() : $uid; - $from_sid = $this->getFromSid(); - - $this->set('to_sid', $to_sid); - $this->setOwnerId($uid); - $this->setTimestamp($timestamp == NULL ? \Drupal::time()->getRequestTime() : $timestamp); - $this->setComment($comment); - - // If constructor is called with new() and arguments. - if (!$from_sid && !$to_sid && !$this->getTargetEntity()) { - // If constructor is called without arguments, e.g., loading from db. - } - elseif ($from_sid && $this->getTargetEntity()) { - // Caveat: upon entity_delete, $to_sid is '0'. - // If constructor is called with new() and arguments. - } - elseif (!$from_sid) { - // Not all parameters are passed programmatically. - if (!$force_create) { - drupal_set_message( - t('Wrong call to constructor Workflow*Transition(%from_sid to %to_sid)', - ['%from_sid' => $from_sid, '%to_sid' => $to_sid]), - 'error'); - } - } - - return $this; - } - - /** - * CRUD functions. - */ - - /** - * Saves the entity. - * Mostly, you'd better use WorkflowTransitionInterface::execute(); - * - * {@inheritdoc} - */ - public function save() { - // Set Target Entity, to be used by Rules. - $reference = $this->get('entity_id')->first(); - $reference->set('entity', $this->getTargetEntity()); - - // Avoid custom actions for subclass WorkflowScheduledTransition. - if ($this->isScheduled()) { - return parent::save(); - } - if ($this->getEntityTypeId() != 'workflow_transition') { - return parent::save(); - } - - $transition = $this; - $entity_type = $transition->getTargetEntityTypeId(); - $entity_id = $transition->getTargetEntityId(); - $field_name = $transition->getFieldName(); - - // Remove any scheduled state transitions. - foreach (WorkflowScheduledTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name) as $scheduled_transition) { - /** @var WorkflowTransitionInterface $scheduled_transition */ - $scheduled_transition->delete(); - } - - // Check for no transition. - if ($this->isEmpty()) { - return SAVED_UPDATED; - } - // Update the transition, if already exists. - if ($this->id()) { - return parent::save(); - } - // Insert the transition. Make sure it hasn't already been inserted. - // @todo: Allow a scheduled transition per revision. - // @todo: Allow a state per language version (langcode). - $found_transition = self::loadByProperties($entity_type, $entity_id, [], $field_name); - if ($found_transition && - $found_transition->getTimestamp() == \Drupal::time()->getRequestTime() && - $found_transition->getToSid() == $this->getToSid()) { - return SAVED_UPDATED; - } - return parent::save(); - } - - /** - * {@inheritdoc} - */ - public static function loadByProperties($entity_type, $entity_id, array $revision_ids = [], $field_name = '', $langcode = '', $sort = 'ASC', $transition_type = 'workflow_transition') { - $limit = 1; - $transitions = self::loadMultipleByProperties($entity_type, [$entity_id], $revision_ids, $field_name, $langcode, $limit, $sort, $transition_type); - if ($transitions) { - $transition = reset($transitions); - return $transition; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public static function loadMultipleByProperties($entity_type, array $entity_ids, array $revision_ids = [], $field_name = '', $langcode = '', $limit = NULL, $sort = 'ASC', $transition_type = 'workflow_transition') { - - /** @var $query \Drupal\Core\Entity\Query\QueryInterface */ - $query = \Drupal::entityQuery($transition_type) - ->condition('entity_type', $entity_type) - ->sort('timestamp', $sort)// 'DESC' || 'ASC' - ->addTag($transition_type); - if (!empty($entity_ids)) { - $query->condition('entity_id', $entity_ids, 'IN'); - } - if (!empty($revision_ids)) { - $query->condition('revision_id', $entity_ids, 'IN'); - } - if ($field_name != '') { - $query->condition('field_name', $field_name, '='); - } - if ($langcode != '') { - $query->condition('langcode', $langcode, '='); - } - if ($limit) { - $query->range(0, $limit); - } - if ($transition_type == 'workflow_transition') { - // The timestamp is only granular to the second; on a busy site, we need the id. - // $query->orderBy('h.timestamp', 'DESC'); - $query->sort('hid', 'DESC'); - } - $ids = $query->execute(); - $transitions = self::loadMultiple($ids); - return $transitions; - } - - /** - * Implementing interface WorkflowTransitionInterface - properties. - */ - - /** - * Determines if the Transition is valid and can be executed. - * @todo: add to isAllowed() ? - * @todo: add checks to WorkflowTransitionElement ? - * - * @return bool - */ - public function isValid() { - // Load the entity, if not already loaded. - // This also sets the (empty) $revision_id in Scheduled Transitions. - $entity = $this->getTargetEntity(); - - if (!$entity) { - // @todo: There is a watchdog error, but no UI-error. Is this OK? - $message = 'User tried to execute a Transition without an entity.'; - $this->logError($message); - return FALSE; // <-- exit !!! - } - if (!$this->getFromState()) { - // @todo: the page is not correctly refreshed after this error. - $message = t('You tried to set a Workflow State, but - the entity is not relevant. Please contact your system administrator.'); - drupal_set_message($message, 'error'); - $message = 'Setting a non-relevant Entity from state %sid1 to %sid2'; - $this->logError($message); - return FALSE; // <-- exit !!! - } - - // The transition is OK. - return TRUE; - } - - /** - * Check if anything has changed in this transition. - * - * @return bool - */ - protected function isEmpty() { - if ($this->getToSid() != $this->getFromSid()) { - return FALSE; - } - if ($this->getComment()) { - return FALSE; - } - $fields = WorkflowManager::getAttachedFields('workflow_transition', $this->bundle()); - /** @var \Drupal\Core\Field\Entity\BaseFieldOverride $field */ - foreach ($fields as $field_name => $field) { - if (!$this->{$field_name}->isEmpty()) { - return FALSE; - } - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function isAllowed(UserInterface $user, $force = FALSE) { - /** - * Get early permissions of user, and bail out to avoid extra hook-calls. - */ - - if ($force) { - // $force allows Rules to cause transition. - return TRUE; - } - - // Determine if user is owner of the entity. - $is_owner = WorkflowManager::isOwner($user, $this->getTargetEntity()); - // Check allow-ability of state change if user is not superuser (might be cron). - $type_id = $this->getWorkflowId(); - if ($user->hasPermission("bypass $type_id workflow_transition access")) { - // Superuser is special. And $force allows Rules to cause transition. - return TRUE; - } - // Determine if user is owner of the entity. - if ($is_owner) { - $user->addRole(WORKFLOW_ROLE_AUTHOR_RID); - } - - // @todo: Keep below code aligned between WorkflowState, ~Transition, ~TransitionListController - /** - * Get the object and its permissions. - */ - $config_transitions = $this->getWorkflow()->getTransitionsByStateId($this->getFromSid(), $this->getToSid()); - - /** - * Determine if user has Access. - */ - $result = FALSE; - /** @var $config_transition WorkflowTransitionInterface */ - foreach ($config_transitions as $config_transition) { - $result = $result || $config_transition->isAllowed($user, $force); - } - - if ($result == FALSE) { - // @todo: There is a watchdog error, but no UI-error. Is this OK? - $message = t('Attempt to go to nonexistent transition (from %sid1 to %sid2)'); - $this->logError($message); - } - - return $result; - } - - /** - * Determines if the State changes by this Transition. - * @return bool - */ - public function hasStateChange() { - if ($this->from_sid->target_id == $this->to_sid->target_id) { - return FALSE; - } - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function execute($force = FALSE) { - // Load the entity, if not already loaded. - // This also sets the (empty) $revision_id in Scheduled Transitions. - /** @var $entity \Drupal\Core\Entity\EntityInterface */ - $entity = $this->getTargetEntity(); - $entity_id = $entity->id(); - // Load explicit User object (not via $transition) for adding Role later. - /** @var $user \Drupal\user\UserInterface */ - $user = $this->getOwner(); - $from_sid = $this->getFromSid(); - $to_sid = $this->getToSid(); - $field_name = $this->getFieldName(); - $comment = $this->getComment(); - // Create a label to identify this transition, - // even upon insert, when id() is not set, yet. - $label = $from_sid . '-' . $to_sid; - - static $static_info = NULL; - - if (isset($static_info[$entity_id][$field_name][$label]) && !$this->isEmpty()) { - // Error: this Transition is already executed. - // On the development machine, execute() is called twice, when - // on an Edit Page, the entity has a scheduled transition, and - // user changes it to 'immediately'. - // Why does this happen?? ( BTW. This happens with every submit.) - // Remedies: - // - search root cause of second call. - // - try adapting code of transition->save() to avoid second record. - // - avoid executing twice. - $message = 'Transition is executed twice in a call. The second call for - @entity_type %entity_id is not executed.'; - $this->logError($message); - - // Return the result of the last call. - return $static_info[$entity_id][$field_name][$label]; // <-- exit !!! - } - - // OK. Prepare for next round. Do not set last_sid!! - $static_info[$entity_id][$field_name][$label] = $from_sid; - - // Make sure $force is set in the transition, too. - if ($force) { - $this->force($force); - } - $force = $this->isForced(); - - // Store the transition(s), so it can be easily fetched later on. - // This is a.o. used in: - // - hook_entity_update to trigger 'transition post'. - // - hook workflow_access_node_access_records - $entity->workflow_transitions[$field_name] = $this; - - if (!$this->isValid()) { - return $from_sid; // <-- exit !!! - } - - // @todo: move below code to $this->isAllowed(). - // If the state has changed, check the permissions. - // No need to check if Comments or attached fields are filled. - if ($this->hasStateChange()) { - // Make sure this transition is allowed by workflow module Admin UI. - if (!$force) { - $user->addRole(WORKFLOW_ROLE_AUTHOR_RID); - } - if (!$this->isAllowed($user, $force)) { - $message = 'User %user not allowed to go from state %sid1 to %sid2'; - $this->logError($message); - return FALSE; // <-- exit !!! - } - - // Make sure this transition is valid and allowed for the current user. - // Invoke a callback indicating a transition is about to occur. - // Modules may veto the transition by returning FALSE. - // (Even if $force is TRUE, but they shouldn't do that.) - // P.S. The D7 hook_workflow 'transition permitted' is removed, in favour of below hook_workflow 'transition pre'. - $permitted = \Drupal::moduleHandler()->invokeAll('workflow', ['transition pre', $this, $user]); - // Stop if a module says so. - if (in_array(FALSE, $permitted, TRUE)) { - // @todo: There is a watchdog error, but no UI-error. Is this OK? - $message = 'Transition vetoed by module.'; - $this->logError($message, 'notice'); - return FALSE; // <-- exit !!! - } - } - - /** - * Output: process the transition. - */ - if ($this->isScheduled()) { - /* - * Log the transition in {workflow_transition_scheduled}. - */ - $this->save(); - } - else { - // The transition is allowed, but not scheduled. - // Let other modules modify the comment. - // The transition (in context) contains all relevant data. - $context = ['transition' => $this]; - \Drupal::moduleHandler()->alter('workflow_comment', $comment, $context); - $this->setComment($comment); - - $this->is_executed = TRUE; - - if (!$this->isEmpty()) { - /* - * Log the transition in {workflow_transition_history}. - */ - $this->save(); - - // Register state change with watchdog. - if ($this->hasStateChange() && !empty($this->getWorkflow()->options['watchdog_log'])) { - if ($this->getEntityTypeId() == 'workflow_scheduled_transition') { - $message = 'Scheduled state change of @entity_type_label %entity_label to %sid2 executed'; - } - else { - $message = 'State of @entity_type_label %entity_label set to %sid2'; - } - $this->logError($message, 'notice'); - } - - // Notify modules that transition has occurred. - // Action triggers should take place in response to this callback, not the 'transaction pre'. - // - //\Drupal::moduleHandler()->invokeAll('workflow', ['transition post', $this, $user]); - // We have a problem here with Rules, Trigger, etc. when invoking - // 'transition post': the entity has not been saved, yet. we are still - // IN the transition, not AFTER. Alternatives: - // 1. Save the field here explicitly, using field_attach_save; - // 2. Move the invoke to another place: hook_entity_insert(), hook_entity_update(); - // 3. Rely on the entity hooks. This works for Rules, not for Trigger. - // --> We choose option 2: - // @todo D8-port: figure out usage of $entity->workflow_transitions[$field_name] - // - First, $entity->workflow_transitions[] is set for easy re-fetching. - // - Then, post_execute() is invoked via workflow_entity_insert(), _update(). - } - } - - // Save value in static from top of this function. - $static_info[$entity_id][$field_name][$label] = $to_sid; - - return $to_sid; - } - - /** - * {@inheritdoc} - */ - public function executeAndUpdateEntity($force = FALSE) { - $to_sid = $this->getToSid(); - - - // Generate error and stop if transition has no new State. - if (!$to_sid) { - $t_args = [ - '%sid2' => $this->getToState()->label(), - '%entity_label' => $this->getTargetEntity()->label(), - ]; - $message = "Transition is not executed for %entity_label, since 'To' state %sid2 is invalid."; - $this->logError($message); - drupal_set_message(t($message, $t_args), 'error'); - - return $this->getFromSid(); - } - - // Save the (scheduled) transition. - $do_update_entity = (!$this->isScheduled() && !$this->isExecuted()); - if ($do_update_entity) { - $this->_updateEntity(); - } - else { - // We create a new transition, or update an existing one. - // Do not update the entity itself. - // Validate transition, save in history table and delete from schedule table. - $to_sid = $this->execute($force); - } - - return $to_sid; - } - - private function _updateEntity() { - // Update the workflow field of the entity. - $field_name = $this->getFieldName(); - $entity = $this->getTargetEntity(); - // N.B. Align the following functions: - // - WorkflowDefaultWidget::massageFormValues(); - // - WorkflowManager::executeTransition(). - $entity->{$field_name}->workflow_transition = $this; - $entity->{$field_name}->value = $this->getToSid(); - - $entity->save(); - } - - /** - * {@inheritdoc} - */ - public function post_execute($force = FALSE) { - // @todo D8-port: This function post_execute() is not yet used. - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: Test this snippet. - if (!$this->isEmpty()) { - $user = $this->getOwner(); - \Drupal::moduleHandler()->invokeAll('workflow', ['transition post', $this, $user]); - } - } - - /** - * {@inheritdoc} - */ - public function setTargetEntity($entity) { - $this->entity_type = ''; - $this->entity_id = ''; - $this->revision_id = ''; - $this->delta = 0; // Only single value is supported. - $this->langcode = Language::LANGCODE_NOT_SPECIFIED; - - if (!$entity) { - return $this; - } - - // If Transition is added via CommentForm, use the Commented Entity. - if ($entity->getEntityTypeId() == 'comment') { - /** @var $entity \Drupal\comment\CommentInterface */ - $entity = $entity->getCommentedEntity(); - } - - $this->entity = $entity; - /** @var \Drupal\Core\Entity\RevisionableContentEntityBase $entity */ - $this->entity_type = $entity->getEntityTypeId(); - $this->entity_id = $entity->id(); - $this->revision_id = $entity->getRevisionId(); - $this->delta = 0; // Only single value is supported. - $this->langcode = $entity->language()->getId(); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getTargetEntity() { - // Use an explicit property, in case of adding new entities. - if (isset($this->entity)) { - return $this->entity; - } - // @todo D8: the following line only returns Node, not Term. - /* return $this->entity = $this->get('entity_id')->entity; */ - - $entity_type = $this->getTargetEntityTypeId(); - if ($id = $this->getTargetEntityId()) { - $this->entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($id); - } - return $this->entity; - } - - /** - * {@inheritdoc} - */ - public function getTargetEntityId() { - return $this->get('entity_id')->target_id; - } - - /** - * {@inheritdoc} - */ - public function getTargetEntityTypeId() { - return $this->get('entity_type')->value; - } - - /** - * {@inheritdoc} - */ - public function getFieldName() { - return $this->get('field_name')->value; - } - - /** - * {@inheritdoc} - */ - public function getLangcode() { - return $this->getTargetEntity()->language()->getId(); - - } - - /** - * {@inheritdoc} - */ - public function getFromState() { - $sid = $this->getFromSid(); - return ($sid) ? WorkflowState::load($sid) : NULL; - } - - /** - * {@inheritdoc} - */ - public function getToState() { - $sid = $this->getToSid(); - return ($sid) ? WorkflowState::load($sid) : NULL; - } - - /** - * {@inheritdoc} - */ - public function getFromSid() { - $sid = $this->{'from_sid'}->target_id; - return $sid; - } - - /** - * {@inheritdoc} - */ - public function getToSid() { - $sid = $this->{'to_sid'}->target_id; - return $sid; - } - - /** - * {@inheritdoc} - */ - public function getComment() { - return $this->get('comment')->value; - } - - /** - * {@inheritdoc} - */ - public function setComment($value) { - $this->set('comment', $value); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getTimestamp() { - return $this->get('timestamp')->value; - } - - /** - * {@inheritdoc} - */ - public function getTimestampFormatted() { - $timestamp = $this->getTimestamp(); - return \Drupal::service('date.formatter')->format($timestamp); - } - - /** - * {@inheritdoc} - */ - public function setTimestamp($value) { - $this->set('timestamp', $value); - return $this; - } - - /** - * {@inheritdoc} - */ - public function isScheduled() { - return $this->is_scheduled; - } - - /** - * {@inheritdoc} - */ - public function schedule($schedule = TRUE) { - // We do a tricky thing here. The id of the entity is altered, so - // all functions of another subclass are called. - // $this->entityTypeId = ($schedule) ? 'workflow_scheduled_transition' : 'workflow_transition'; - // - $this->is_scheduled = $schedule; - return $this; - } - - /** - * {@inheritdoc} - */ - public function setExecuted($is_executed = TRUE) { - $this->is_executed = $is_executed; - return $this; - } - - /** - * {@inheritdoc} - */ - public function isExecuted() { - return (bool) $this->is_executed; - } - - /** - * {@inheritdoc} - */ - public function isForced() { - return (bool) $this->is_forced; - } - - /** - * {@inheritdoc} - */ - public function force($force = TRUE) { - $this->is_forced = $force; - return $this; - } - - /** - * Implementing interface EntityOwnerInterface. Copied from Comment.php. - */ - - /** - * {@inheritdoc} - */ - public function getOwner() { - /** @var $user UserInterface */ - $user = $this->get('uid')->entity; - if (!$user || $user->isAnonymous()) { - $user = User::getAnonymousUser(); - $user->setUsername(\Drupal::config('user.settings')->get('anonymous')); - } - return $user; - } - - /** - * {@inheritdoc} - */ - public function getOwnerId() { - return $this->get('uid')->target_id; - } - - /** - * {@inheritdoc} - */ - public function setOwnerId($uid) { - $this->set('uid', $uid); - return $this; - } - - /** - * {@inheritdoc} - */ - public function setOwner(UserInterface $account) { - $this->set('uid', $account->id()); - return $this; - } - - /** - * Implementing interface FieldableEntityInterface extends EntityInterface. - */ - - /** - * {@inheritdoc} - */ - public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { - $fields = []; - - $fields['hid'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Transition ID')) - ->setDescription(t('The transition ID.')) - ->setReadOnly(TRUE) - ->setSetting('unsigned', TRUE); - -// $fields['wid'] = BaseFieldDefinition::create('string') - $fields['wid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Workflow Type')) - ->setDescription(t('The workflow type the transition relates to.')) - ->setSetting('target_type', 'workflow_type') - ->setRequired(TRUE) - ->setTranslatable(FALSE) - ->setRevisionable(FALSE) -// ->setSetting('max_length', 32) -// ->setDisplayOptions('view', [ -// 'label' => 'hidden', -// 'type' => 'string', -// 'weight' => -5, -// ]) -// ->setDisplayOptions('form', [ -// 'type' => 'string_textfield', -// 'weight' => -5, -// ]) -// ->setDisplayConfigurable('form', TRUE) - ; - - $fields['entity_type'] = BaseFieldDefinition::create('string') - ->setLabel(t('Entity type')) - ->setDescription(t('The Entity type this transition belongs to.')) - ->setSetting('is_ascii', TRUE) - ->setSetting('max_length', EntityTypeInterface::ID_MAX_LENGTH) - ->setReadOnly(TRUE); - - $fields['entity_id'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Entity ID')) - ->setDescription(t('The Entity ID this record is for.')) - ->setRequired(TRUE) - ->setReadOnly(TRUE) - ->setSetting('unsigned', TRUE); - - $fields['revision_id'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Revision ID')) - ->setDescription(t('The current version identifier.')) - ->setReadOnly(TRUE) - ->setSetting('unsigned', TRUE); - - $fields['field_name'] = BaseFieldDefinition::create('string') - ->setLabel(t('Field name')) - ->setDescription(t('The name of the field the transition relates to.')) - ->setRequired(TRUE) - ->setTranslatable(FALSE) - ->setRevisionable(FALSE) - ->setSetting('max_length', 32) -// ->setDisplayConfigurable('form', FALSE) -// ->setDisplayOptions('form', [ -// 'type' => 'string_textfield', -// 'weight' => -5, -// ]) -// ->setDisplayConfigurable('view', FALSE) -// ->setDisplayOptions('view', [ -// 'label' => 'hidden', -// 'type' => 'string', -// 'weight' => -5, -// ]) - ; - - $fields['langcode'] = BaseFieldDefinition::create('language') - ->setLabel(t('Language')) - ->setDescription(t('The entity language code.')) - ->setTranslatable(TRUE) - ->setDisplayOptions('view', [ - 'type' => 'hidden', - ]) - ->setDisplayOptions('form', [ - 'type' => 'language_select', - 'weight' => 2, - ]); - - $fields['delta'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Delta')) - ->setDescription(t('The sequence number for this data item, used for multi-value fields.')) - ->setReadOnly(TRUE) - ->setSetting('unsigned', TRUE); - - $fields['from_sid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('From state')) - ->setDescription(t('The {workflow_states}.sid the entity started as.')) - ->setSetting('target_type', 'workflow_state') - ->setReadOnly(TRUE); - - $fields['to_sid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('To state')) - ->setDescription(t('The {workflow_states}.sid the entity transitioned to.')) - ->setSetting('target_type', 'workflow_state') -// @todo D8: activate this. Test with both Form and Widget. -// ->setDisplayOptions('form', [ -// 'type' => 'select', -// 'weight' => -5, -// ]) -// ->setDisplayConfigurable('form', TRUE) - ->setReadOnly(TRUE); - - $fields['uid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('User ID')) - ->setDescription(t('The user ID of the transition author.')) - ->setTranslatable(TRUE) - ->setSetting('target_type', 'user') - ->setDefaultValue(0) -// ->setQueryable(FALSE) -// ->setSetting('handler', 'default') -// ->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId') -// ->setTranslatable(TRUE) -// ->setDisplayOptions('view', [ -// 'label' => 'hidden', -// 'type' => 'author', -// 'weight' => 0, -// ]) -// ->setDisplayOptions('form', [ -// 'type' => 'entity_reference_autocomplete', -// 'weight' => 5, -// 'settings' => [ -// 'match_operator' => 'CONTAINS', -// 'size' => '60', -// 'placeholder' => '', -// ], -// ]) -// ->setDisplayConfigurable('form', TRUE), - ->setRevisionable(TRUE); - - $fields['timestamp'] = BaseFieldDefinition::create('created') - ->setLabel(t('Timestamp')) - ->setDescription(t('The time that the current transition was executed.')) -// ->setQueryable(FALSE) -// ->setTranslatable(TRUE) -// ->setDisplayOptions('view', [ -// 'label' => 'hidden', -// 'type' => 'timestamp', -// 'weight' => 0, -// ]) -// @todo D8: activate this. Test with both Form and Widget. -// ->setDisplayOptions('form', [ -// 'type' => 'datetime_timestamp', -// 'weight' => 10, -// ]) -// ->setDisplayConfigurable('form', TRUE); - ->setRevisionable(TRUE); - - $fields['comment'] = BaseFieldDefinition::create('string_long') - ->setLabel(t('Log message')) - ->setDescription(t('The comment explaining this transition.')) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) -// @todo D8: activate this. Test with both Form and Widget. -// ->setDisplayOptions('form', [ -// 'type' => 'string_textarea', -// 'weight' => 25, -// 'settings' => [ -// 'rows' => 4, -// ], -// ]) -// ->setDisplayConfigurable('form', FALSE) - ; - - return $fields; - } - - /** - * Generate a Watchdog error - * - * @param $message - * @param $type {'error' | 'notice'} - * @param $from_sid - * @param $to_sid - */ - public function logError($message, $type = 'error', $from_sid = '', $to_sid = '') { - - // Prepare an array of arguments for error messages. - $entity = $this->getTargetEntity(); - $t_args = [ - /** @var $user \Drupal\user\UserInterface */ - '%user' => ($user = $this->getOwner()) ? $user->getDisplayName() : '', - '%sid1' => ($from_sid) ? $from_sid : $this->getFromState()->label(), - '%sid2' => ($to_sid) ? $to_sid : $this->getToState()->label(), - '%entity_id' => $this->getTargetEntityId(), - '%entity_label' => $entity ? $entity->label() : '', - '@entity_type' => ($entity) ? $entity->getEntityTypeId() : '', - '@entity_type_label' => ($entity) ? $entity->getEntityType()->getLabel() : '', - 'link' => ($this->getTargetEntityId() && $this->getTargetEntity()->hasLinkTemplate('canonical')) ? $this->getTargetEntity()->toLink(t('View'))->toString() : '', - ]; - ($type == 'error') ? \Drupal::logger('workflow')->error($message, $t_args) - : \Drupal::logger('workflow')->notice($message, $t_args); - } - - /** - * {@inheritdoc} - */ - public function dpm($function = '') { - $transition = $this; - $entity = $transition->getTargetEntity(); - $time = \Drupal::service('date.formatter')->format($transition->getTimestamp()); - // Do this extensive $user_name lines, for some troubles with Action. - $user = $transition->getOwner(); - $user_name = ($user) ? $user->getAccountName() : 'unknown username'; - $t_string = $this->getEntityTypeId() . ' ' . $this->id() . ' for workflow_type ' . $this->getWorkflowId() . ' ' . ($function ? ("in function '$function'") : ''); - $output[] = 'Entity = ' . $this->getTargetEntityTypeId() . '/' . (($entity) ? ($entity->bundle() . '/' . $entity->id()) : '___/0'); - $output[] = 'Field = ' . $transition->getFieldName(); - $output[] = 'From/To = ' . $transition->getFromSid() . ' > ' . $transition->getToSid() . ' @ ' . $time; - $output[] = 'Comment = ' . $user_name . ' says: ' . $transition->getComment(); - $output[] = 'Forced = ' . ($transition->isForced() ? 'yes' : 'no') . '; ' . 'Scheduled = ' . ($transition->isScheduled() ? 'yes' : 'no'); - if (function_exists('dpm')) { // in Workflow->dpm(). - dpm($output, $t_string); // in Workflow->dpm(). - } // in Workflow->dpm(). - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransitionInterface.php b/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransitionInterface.php deleted file mode 100644 index ad55871c8..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Entity/WorkflowTransitionInterface.php +++ /dev/null @@ -1,277 +0,0 @@ - $field_name]); - * $transition->setTargetEntity($entity); - * $transition->setValues($new_sid, $user->id(), REQUEST_TIME, $comment); - * - * @param string $to_sid - * @param int $uid - * @param int $timestamp - * @param string $comment - * @param bool $force_create - */ - public function setValues($to_sid, $uid = NULL, $timestamp = NULL, $comment = '', $force_create = FALSE); - - /** - * Load (Scheduled) WorkflowTransitions, most recent first. - * - * @param string $entity_type - * @param int $entity_id - * @param array $revision_ids - * @param string $field_name - * @param string $langcode - * @param string $sort - * @param string $transition_type - * - * @return \Drupal\workflow\Entity\WorkflowTransitionInterface - * Object representing one row from the {workflow_transition_history} table. - */ - public static function loadByProperties($entity_type, $entity_id, array $revision_ids = [], $field_name = '', $langcode = '', $sort = 'ASC', $transition_type = ''); - - /** - * Given an entity, get all transitions for it. - * - * Since this may return a lot of data, a limit is included to allow for only one result. - * - * @param string $entity_type - * @param int[] $entity_ids - * @param int[] $revision_ids - * @param string $field_name - * Optional. Can be NULL, if you want to load any field. - * @param string $langcode - * Optional. Can be empty, if you want to load any language. - * @param int $limit - * Optional. Can be NULL, if you want to load all transitions. - * @param string $sort - * Optional sort order. {'ASC'|'DESC'} - * @param string $transition_type - * The type of the transition to be fetched. - * - * @return WorkflowTransitionInterface[] - * An array of transitions. - */ - public static function loadMultipleByProperties($entity_type, array $entity_ids, array $revision_ids = [], $field_name = '', $langcode = '', $limit = NULL, $sort = 'ASC', $transition_type = ''); - - /** - * Execute a transition (change state of an entity). - * - * A Scheduled Transition shall only be saved, unless the - * 'schedule' property is set. - * @usage - * $transition->schedule(FALSE); - * $to_sid = $transition->execute(TRUE); - * - * @param bool $force - * If set to TRUE, workflow permissions will be ignored. - * - * @return - * New state ID. If execution failed, old state ID is returned, - */ - public function execute($force = FALSE); - - /** - * Executes a transition (change state of an entity), from OUTSIDE the entity. - * - * Use $transition->executeAndUpdateEntity() to start a State Change from - * outside an entity, e.g., workflow_cron(). - * Use $transition->execute() to start a State Change from within an entity. - * - * A Scheduled Transition ($transition->isScheduled() == TRUE) will be - * un-scheduled and saved in the history table. - * The entity will not be updated. - * If $transition->isScheduled() == FALSE, the Transition will be - * removed from the {workflow_transition_scheduled} table (if necessary), - * and added to {workflow_transition_history} table. - * Then the entity wil be updated to reflect the new status. - * - * @usage - * $to_sid = $transition->->executeAndUpdateEntity($force); - * - * @see workflow_execute_transition() - * - * @param bool $force - * If set to TRUE, workflow permissions will be ignored. - * - * @return string - * The resulting WorkflowState id. - */ - public function executeAndUpdateEntity($force = FALSE); - - /** - * Invokes 'transition post'. - * Adds the possibility to invoke the hook from elsewhere. - * - * @param bool $force - */ - public function post_execute($force = FALSE); - - /** - * Set the Entity, that is added to the Transition. - * Also set all dependent fields, that will be saved in tables {workflow_transition_*} - * - * @param EntityInterface $entity - * The Entity ID or the Entity object, to add to the Transition. - * - * @return object - * The Entity, that is added to the Transition. - */ - public function setTargetEntity($entity); - - /** - * Returns the entity to which the workflow is attached. - * - * @return EntityInterface - * The entity to which the workflow is attached. - */ - public function getTargetEntity(); - - /** - * Returns the ID of the entity to which the workflow is attached. - * - * @return int - * The ID of the entity to which the workflow is attached. - */ - public function getTargetEntityId(); - - /** - * Returns the type of the entity to which the workflow is attached. - * - * @return string - * An entity type. - */ - public function getTargetEntityTypeId(); - - /** - * Get the field_name for which the Transition is valid. - * - * @return string - * The field_name, that is added to the Transition. - */ - public function getFieldName(); - - /** - * Get the language code for which the Transition is valid. - * - * @todo: OK?? Shouldn't we use entity's language() method for langcode? - * - * @return string $langcode - */ - public function getLangcode(); - - /** - * Get the comment of the Transition. - * - * @return - * The comment - */ - public function getComment(); - - /** - * Get the comment of the Transition. - * - * @param $value - * The new comment. - * - * @return WorkflowTransitionInterface - */ - public function setComment($value); - - /** - * Returns the time on which the transitions was or will be executed. - * - * @return - */ - public function getTimestamp(); - - /** - * Returns the human-readable time. - * - * @return string - */ - public function getTimestampFormatted(); - - /** - * Returns the time on which the transitions was or will be executed. - * - * @param $value - * The new timestamp. - * @return WorkflowTransitionInterface - */ - public function setTimestamp($value); - - /** - * Returns if this is a Scheduled Transition. - * - * @return bool - */ - public function isScheduled(); - - /** - * Sets the Transition to be scheduled or not. - * - * @param bool $schedule - * @return WorkflowTransitionInterface - */ - public function schedule($schedule = TRUE); - - /** - * Set the 'is_executed' property. - * - * @param bool $is_executed - * - * @return WorkflowTransitionInterface - */ - public function setExecuted($is_executed = TRUE); - - /** - * Returns if this is an Executed Transition. - * - * @return bool - */ - public function isExecuted(); - - /** - * A transition may be forced skipping checks. - * - * @return bool - * If the transition is forced. (Allow not-configured transitions). - */ - public function isForced(); - - /** - * Set if a transition must be executed, even if transition is invalid - * or user not authorized. - * - * @param bool $force - * - * @return object - * The transition itself - */ - public function force($force = TRUE); - - /** - * Helper/debugging function. Shows simple contents of Transition. - * - * @param string $function - */ - public function dpm($function = ''); - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTransitionForm.php b/sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTransitionForm.php deleted file mode 100644 index e190fe3a0..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTransitionForm.php +++ /dev/null @@ -1,211 +0,0 @@ -entity; - $field_name = $transition->getFieldName(); - - /** @var $entity \Drupal\Core\Entity\EntityInterface */ - // Entity may be empty on VBO bulk form. - // $entity = $transition->getTargetEntity(); - // Compose Form Id from string + Entity Id + Field name. - // Field ID contains entity_type, bundle, field_name. - // The Form Id is unique, to allow for multiple forms per page. - // $workflow_type_id = $transition->getWorkflowId(); - // Field name contains implicit entity_type & bundle (since 1 field per entity) - // $entity_type = $transition->getTargetEntityTypeId(); - // $entity_id = $transition->getTargetEntityId();; - - $suffix = 'form'; - // Emulate nodeForm convention. - if ($transition->id()) { - $suffix = 'edit_form'; - } - $form_id = implode('_', ['workflow_transition', $field_name, $suffix]); - $form_id = Html::getUniqueId($form_id); - - return $form_id; - } - - /** - * {@inheritdoc} - * - * N.B. The D8-version of this form is stripped. If any use case is missing: - * - compare with the D7-version of WorkflowTransitionForm::submitForm() - * - compare with the D8-version of WorkflowTransitionElement::copyFormValuesToEntity() - */ - /* - public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); - } - */ - - /* ************************************************************************* - * - * Implementation of interface EntityFormInterface (extends FormInterface). - * - */ - - /** - * This function is called by buildForm(). - * Caveat: !! It is not declared in the EntityFormInterface !! - * - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - // Call parent to get (extra) fields. - // This might cause baseFieldDefinitions to appear twice. - $form = parent::form($form, $form_state); - - /** @var $transition \Drupal\workflow\Entity\WorkflowTransitionInterface */ - $transition = $this->entity; - - // Do not pass the element, but the form. - // $element['#default_value'] = $transition; - // $form += WorkflowTransitionElement::transitionElement($element, $form_state, $form); - // - // Pass the form via parameter - $form['#default_value'] = $transition; - $form = WorkflowTransitionElement::transitionElement($form, $form_state, $form); - return $form; - } - - /* - * Returns the action form element for the current entity form. - * Caveat: !! It is not declared in the EntityFormInterface !! - * - * {@inheritdoc} - protected function actionsElement(array $form, FormStateInterface $form_state) { - $element = parent::actionsElement($form, $form_state); - return $element; - } - */ - - /** - * Returns an array of supported actions for the current entity form. - * Caveat: !! It is not declared in the EntityFormInterface !! - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @return array - */ - protected function actions(array $form, FormStateInterface $form_state) { - // N.B. Keep code aligned: workflow_form_alter(), WorkflowTransitionForm::actions(). - $actions = parent::actions($form, $form_state); - - // A default button is provided by core. Override it. - $actions['submit']['#value'] = $this->t('Update workflow'); - $actions['submit']['#attributes'] = ['class' => ['form-save-default-button']]; - - if (!_workflow_use_action_buttons()) { - // Change the default submit button on the Workflow History tab. - return $actions; - } - - // Find the first workflow. - // (So this won't work with multiple workflows per entity.) - // Quit if there is no Workflow on this page. - if (!$workflow_form = &$form) { - return $actions; - } - - // Quit if there are no Workflow Action buttons. - // (If user has only 1 workflow option, there are no Action buttons.) - if (count($workflow_form['to_sid']['#options']) <= 1) { - return $actions; - } - - // Place the buttons. Remove the default 'Save' button. - // $actions += _workflow_transition_form_get_action_buttons($form, $workflow_form); - // Remove the default submit button from the form. - // unset($actions['submit']); - $default_submit_action = $actions['submit']; - $actions = _workflow_transition_form_get_action_buttons($form, $workflow_form, $default_submit_action); - foreach ($actions as $key => &$action) { - $action['#submit'] = $default_submit_action['#submit']; - } - - return $actions; - } - - /** - * {@inheritdoc} - */ - /** @noinspection PhpMissingParentCallCommonInspection */ - public function buildEntity(array $form, FormStateInterface $form_state) { - /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */ - $entity = clone $this->entity; - // Update the entity. - $entity = $this->copyFormValuesToEntity($entity, $form, $form_state); - // Mark the entity as NOT requiring validation. (Used in validateForm().) - $entity->setValidationRequired(FALSE); - - return $entity; - } - - /** - * {@inheritdoc} - */ - public function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) { - parent::copyFormValuesToEntity($entity, $form, $form_state); - // Use a proprietary version of copyFormValuesToEntity(), passing $entity by reference... - $values = $form_state->getValues(); - // ... but only the returning object is OK (!). - return WorkflowTransitionElement::copyFormValuesToTransition($entity, $form, $form_state, $values); - } - - /** - * {@inheritdoc} - * - * This is called from submitForm(). - */ - /** @noinspection PhpMissingParentCallCommonInspection */ - public function save(array $form, FormStateInterface $form_state) { - // Execute transition and update the attached entity. - /** @var WorkflowTransitionInterface $transition */ - $transition = $this->getEntity(); - return $transition->executeAndUpdateEntity(); - } - - /************************************************************************* - * - * Implementation of interface ContentEntityFormInterface (extends EntityFormInterface). - * - */ - - /** - * {@inheritdoc} - */ - //public function validateForm(array &$form, FormStateInterface $form_state) { - // return parent::validateForm($form, $form_state); - //} - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTypeForm.php b/sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTypeForm.php deleted file mode 100644 index 2bfbe6db6..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Form/WorkflowTypeForm.php +++ /dev/null @@ -1,281 +0,0 @@ - $this->t('No fieldset'), - 1 => $this->t('Collapsible fieldset'), - 2 => $this->t('Collapsed fieldset') - ]; - /* @var $workflow Workflow */ - $workflow = $this->entity; - - $form['label'] = [ - '#type' => 'textfield', - '#description' => $this->t( - 'The human-readable label of the workflow.This will be used as a label - when the workflow status is shown during editing of content.' - ), - '#title' => $this->t('Label'), - '#default_value' => $this->entity->label(), - '#required' => TRUE, - ]; - - $form['id'] = [ - '#type' => 'machine_name', - '#description' => $this->t( - 'A unique machine-readable name. Can only contain lowercase letters, - numbers, and underscores.' - ), - '#disabled' => !$this->entity->isNew(), - '#default_value' => $this->entity->id(), - '#machine_name' => [ - 'exists' => [$this, 'exists'], - 'replace_pattern' => '([^a-z0-9_]+)|(^custom$)', - 'error' => $this->t( - 'The machine-readable name must be unique, and can only contain - lowercase letters, numbers, and underscores. - Additionally, it can not be the reserved word "custom".' - ), - ], - ]; - - $form['permissions'] = [ - '#type' => 'details', - '#title' => $this->t('Workflow permissions'), - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. - '#description' => $this->t( - 'To enable further Workflow functionality, go to the - /admin/people/permissions page and select any roles that should - have access to below and other functionality.'), - ]; - $form['permissions']['transition_execute'] = [ - '#type' => 'item', - '#title' => $this->t( - 'Participate in workflow (create, execute transitions)' - ), - '#markup' => $this->t( - "You can determine which roles are enabled on the - 'Workflow Transitions & roles' configuration page. Use this to enable - only the relevant roles. Some sites have too many roles to show on - the configuration page." - ), - ]; - $form['permissions']['transition_schedule'] = [ - '#type' => 'item', - '#title' => $this->t('Schedule state transition'), - '#markup' => $this->t( - 'Workflow transitions may be scheduled to a moment - in the future. Soon after the desired moment, the transition is - executed by Cron. This may be hidden by settings in widgets, - formatters or permissions.' - ), - ]; - $form['permissions']['history_tab'] = [ - '#type' => 'item', - '#title' => $this->t('Access Workflow history tab'), - '#markup' => $this->t( - "You can determine if a tab 'Workflow history' is shown on the entity - view page, which gives access to the History of the workflow. - If you have multiple workflows per bundle, better disable this - feature, and use, clone & adapt the Views display - 'Workflow history per Entity'." - ), - ]; - - $form['basic'] = [ - '#type' => 'details', - '#title' => $this->t('Workflow form settings'), - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. - ]; - - $form['basic']['fieldset'] = [ - '#type' => 'select', - '#options' => $fieldset_options, - '#title' => $this->t('Show the form in a fieldset?'), - '#default_value' => isset($workflow->options['fieldset']) - ? $workflow->options['fieldset'] : 0, - ]; - $form['basic']['options'] = [ - '#type' => 'select', - '#title' => $this->t('How to show the available states'), - '#required' => FALSE, - '#default_value' => isset($workflow->options['options']) - ? $workflow->options['options'] : 'radios', - // '#multiple' => TRUE / FALSE, - '#options' => [ - // These options are taken from options.module - 'select' => 'Select list', - 'radios' => 'Radio buttons', - 'buttons' => 'Action buttons', - 'dropbutton' => 'Drop button', - ], - '#description' => $this->t( - 'The Widget shows all available states. - Decide which is the best way to show them.' - ), - ]; - - $form['basic']['name_as_title'] = [ - '#type' => 'checkbox', - '#attributes' => ['class' => ['container-inline']], - '#title' => $this->t( - 'Use the workflow name as the title of the workflow form' - ), - '#default_value' => isset($workflow->options['name_as_title']) - ? $workflow->options['name_as_title'] : 0, - '#description' => $this->t( - 'The workflow section of the editing form is in its own fieldset. - Checking the box will add the workflow name as the title of workflow - section of the editing form.' - ), - ]; - - $form['basic']['schedule_timezone'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Show a timezone when scheduling a transition.'), - '#required' => FALSE, - '#default_value' => isset($workflow->options['schedule_timezone']) - ? $workflow->options['schedule_timezone'] : 1, - ]; - - $form['basic']['comment_log_node'] = [ - '#type' => 'select', - '#required' => FALSE, - '#options' => [ - // Use 0/1/2 to stay compatible with previous checkbox. - 0 => $this->t('hidden'), - 1 => $this->t('optional'), - 2 => $this->t('required'), - ], - '#attributes' => ['class' => ['container-inline']], - '#title' => $this->t('How to show the Comment sub-field'), - '#default_value' => isset($workflow->options['comment_log_node']) - ? $workflow->options['comment_log_node'] : 1, - '#description' => $this->t( - 'A Comment area can be shown on the Workflow Transition form so that - the person making a state change can record reasons for doing so. - The comment is then included in the content\'s workflow history.' - ), - ]; - - $form['watchdog'] = [ - '#type' => 'details', - '#title' => $this->t('Watchdog'), - '#description' => $this->t( - 'Informational watchdog messages can be logged when a transition is - executed (state of a node is changed).' - ), - '#open' => TRUE, // Controls the HTML5 'open' attribute. Defaults to FALSE. - ]; - - $form['watchdog']['watchdog_log'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Log watchdog messages upon state change'), - '#default_value' => isset($workflow->options['watchdog_log']) ? $workflow->options['watchdog_log'] : 0, - '#description' => '', - ]; - - return parent::form($form, $form_state); - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - // $actions['submit']['#value'] = $this->t('Save'); - return $actions; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - /* @var $entity \Drupal\workflow\Entity\Workflow */ - $entity = $this->entity; - - // Prevent leading and trailing spaces. - $entity->set('label', trim($entity->label())); - - $entity->set('options', [ - 'name_as_title' => $form_state->getValue('name_as_title'), - 'fieldset' => $form_state->getValue('fieldset'), - 'options' => $form_state->getValue('options'), - 'schedule_timezone' => $form_state->getValue('schedule_timezone'), - 'comment_log_node' => $form_state->getValue('comment_log_node'), - 'watchdog_log' => $form_state->getValue('watchdog_log'), - ] - ); - - $status = parent::save($form, $form_state); - $action = $status == SAVED_UPDATED ? 'updated' : 'added'; - - // Tell the user we've updated the data. - $args = [ - '%label' => $entity->label(), - '%action' => $action, - 'link' => $entity->toLink($this->t('Edit'))->toString(), - ]; - drupal_set_message($this->t( - 'Workflow %label has been %action. Please maintain the permissions, - states and transitions.', $args) - ); - $this->logger('workflow')->notice('Workflow %label has been %action.', $args); - - if ($status == SAVED_NEW) { - $form_state->setRedirect('entity.workflow_type.edit_form', ['workflow_type' => $entity->id()]); - } - - } - - /** - * Form validation handler. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $workflow = $this->entity; - $name = $workflow->id(); - - // Make sure workflow name is not numeric. - // TODO: this was a prerequisite in D7. Remove in D8? - if (ctype_digit($name)) { - $form_state->setErrorByName('id', t('Please choose a non-numeric name for your workflow.')); - } - - parent::validateForm($form, $form_state); - } - - /** - * Machine name exists callback. - * - * @param string $id - * The machine name ID. - * - * @return bool - * TRUE if an entity with the same name already exists, FALSE otherwise. - */ - public function exists($id) { - $type = $this->entity->getEntityTypeId(); - - return (bool) $this->entityTypeManager->getStorage($type)->load($id); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeGivenStateAction.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeGivenStateAction.php deleted file mode 100644 index 1950817af..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeGivenStateAction.php +++ /dev/null @@ -1,79 +0,0 @@ - ['workflow', 'node'], - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form = parent::buildConfigurationForm($form, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function execute($object = NULL) { - /* - * D7: As advanced action with Trigger 'node': - * - $entity is empty; - * - $context['group'] = 'node' - * - $context['hook'] = 'node_insert / _update / _delete' - * - $context['node'] = (Object) stdClass - * - $context['entity_type'] = NULL - * - * D7: As advanced action with Trigger 'taxonomy': - * - $entity is (Object) stdClass; - * - $context['type'] = 'entity' - * - $context['group'] = 'taxonomy' - * - $context['hook'] = 'taxonomy_term_insert / _update / _delete' - * - $context['node'] = (Object) stdClass - * - $context['entity_type'] = NULL - * - * D7: As advanced action with Trigger 'workflow API': - * ... - * - * D7: As VBO action: - * - $entity is (Object) stdClass; - * - $context['type'] = NULL - * - $context['group'] = NULL - * - $context['hook'] = NULL - * - $context['node'] = (Object) stdClass - * - $context['entity_type'] = 'node' - */ - - if (!$transition = $this->getTransitionForExecution($object)) { - drupal_set_message('The entity is not valid for this action.'); - return; - } - - // Fire the transition. - workflow_execute_transition($transition, $force = FALSE); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeNextStateAction.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeNextStateAction.php deleted file mode 100644 index 87caa85f3..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowNodeNextStateAction.php +++ /dev/null @@ -1,71 +0,0 @@ - ['workflow', 'node'], - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form = parent::buildConfigurationForm($form, $form_state); - - // Remove to_sid. User can't set it, since we want a dynamic 'next' state. - unset($form['to_sid']); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function execute($object = NULL) { - - if (!$transition = $this->getTransitionForExecution($object)) { - drupal_set_message('The object is not valid for this action.', 'warning'); - return; - } - - /* - * Set the new next state. - */ - $entity = $transition->getTargetEntity(); - $field_name = $transition->getFieldName(); - $user = $transition->getOwner(); - $force = $this->configuration['force']; - // $comment = $transition->getComment(); - - // Get the node's new State Id (which is the next available state). - $to_sid = $transition->getWorkflow()->getNextSid($entity, $field_name, $user, $force); - - // Add actual data. - $transition->to_sid = $to_sid; - - // Fire the transition. - workflow_execute_transition($transition, $force); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowStateActionBase.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowStateActionBase.php deleted file mode 100644 index 8a10dcdd9..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Action/WorkflowStateActionBase.php +++ /dev/null @@ -1,232 +0,0 @@ - ['workflow',], - ]; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - $configuration = parent::defaultConfiguration(); - $configuration += $this->configuration; - $configuration += [ - 'field_name' => '', - 'to_sid' => '', - 'comment' => "New state is set by a triggered Action.", - 'force' => 0, - ]; - return $configuration; - } - - /** - * @param \Drupal\Core\Entity\EntityInterface $entity - * - * @return \Drupal\workflow\Entity\WorkflowTransitionInterface - */ - protected function getTransitionForExecution(EntityInterface $entity) { - $user = workflow_current_user(); - - if (!$entity) { - \Drupal::logger('workflow_action')->notice('Unable to get current entity - entity is not defined.', []); - return NULL; - } - - // Get the entity type and numeric ID. - $entity_id = $entity->id(); - if (!$entity_id) { - \Drupal::logger('workflow_action')->notice('Unable to get current entity ID - entity is not yet saved.', []); - return NULL; - } - - // In 'after saving new content', the node is already saved. Avoid second insert. - // @todo: clone? - $entity->enforceIsNew(FALSE); - - $config = $this->configuration; - $field_name = workflow_get_field_name($entity, $config['field_name']); - $current_sid = workflow_node_current_state($entity, $field_name); - if (!$current_sid) { - \Drupal::logger('workflow_action')->notice('Unable to get current workflow state of entity %id.', ['%id' => $entity_id]); - return NULL; - } - - $to_sid = isset($config['to_sid']) ? $config['to_sid'] : ''; - // Get the Comment. Parse the $comment variables. - $comment_string = $this->configuration['comment']; - $comment = t($comment_string, [ - '%title' => $entity->label(), - // "@" and "%" will automatically run check_plain(). - '%state' => workflow_get_sid_name($to_sid), - '%user' => $user->getDisplayName(), - ]); - $force = $this->configuration['force']; - - $transition = WorkflowTransition::create([$current_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($entity); - $transition->setValues($to_sid, $user->id(), \Drupal::time()->getRequestTime(), $comment); - $transition->force($force); - - return $transition; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - - // If we are on admin/config/system/actions and use CREATE AN ADVANCED ACTION - // Then $context only contains: - // - $context['actions_label'] = "Change workflow state of post to new state" - // - $context['actions_type'] = "entity" - // - // If we are on a VBO action form, then $context only contains: - // - $context['entity_type'] = "node" - // - $context['view'] = "(Object) view" - // - $context['settings'] = "[]" - - $config = $this->configuration; - $field_name = $config['field_name']; - $wids = workflow_get_workflow_names(); - - if (empty($field_name) && count($wids) > 1) { - drupal_set_message('You have multiple workflows in the system. Please first select the field name - and save the form. Then, revisit the form to set the correct state value.', 'warning'); - } - - $wid = count($wids) ? array_keys($wids)[0] : ''; - if (!empty($field_name)) { - $fields = _workflow_info_fields($entity = NULL, $entity_type = '', $entity_bundle = '', $field_name); - $wid = count($fields) ? reset($fields)->getSetting('workflow_type') : ''; - } - - // Get the common Workflow, or create a dummy Workflow. - /** @var Workflow $workflow */ - $workflow = $wid ? Workflow::load($wid) : Workflow::create(['id' => 'dummy_action', 'label' => 'dummy_action']); - $current_state = $workflow->getCreationState(); - - /* - // @todo D8-port for VBO - // Show the current state and the Workflow form to allow state changing. - // N.B. This part is replicated in hook_node_view, workflow_tab_page, workflow_vbo. - if ($workflow) { - $field = _workflow_info_field($field_name, $workflow); - $field_name = $field['field_name']; - $field_id = $field['id']; - $instance = field_info_instance($entity_type, $field_name, $entity_bundle); - - // Hide the submit button. VBO has its own 'next' button. - $instance['widget']['settings']['submit_function'] = ''; - if (!$field_id) { - // This is a Workflow Node workflow. Set widget options as in v7.x-1.2 - $field['settings']['widget']['comment'] = $workflow->options['comment_log_node']; // 'comment_log_tab' is removed; - $field['settings']['widget']['current_status'] = TRUE; - // As stated above, the options list is probably very long, so let's use select list. - $field['settings']['widget']['options'] = 'select'; - // Do not show the default [Update workflow] button on the form. - $instance['widget']['settings']['submit_function'] = ''; - } - } - - // Add the form/widget to the formatter, and include the nid and field_id in the form id, - // to allow multiple forms per page (in listings, with hook_forms() ). - // Ultimately, this is a wrapper for WorkflowDefaultWidget. - // $form['workflow_current_state'] = workflow_state_formatter($entity_type, $entity, $field, $instance); - $form_id = implode('_', [ - 'workflow_transition_form', - $entity_type, - $entity_id, - $field_id - ]); - */ - $user = workflow_current_user(); - $transition = WorkflowTransition::create([$current_state, 'field_name' => $field_name]); - $transition->setValues( - $to_sid = $config['to_sid'], - $user->id(), - \Drupal::time()->getRequestTime(), - $comment = $config['comment'], - $force = $config['force'] - ); - - // Add the WorkflowTransitionForm to the page. @todo - - $element = []; // Just to be explicit. - $element['#default_value'] = $transition; - - // Avoid Action Buttons. That removes the options box&more. No Buttons in config screens! - $original_options = $transition->getWorkflow()->options['options']; - $transition->getWorkflow()->options['options'] = 'select'; - // Generate and add the Workflow form element. - $element = WorkflowTransitionElement::transitionElement($element, $form_state, $form); - // Just to be sure, reset the options box setting. - $transition->getWorkflow()->options['options'] = $original_options; - - // Make adaptations for VBO-form: - $element['field_name']['#access'] = TRUE; - $element['force']['#access'] = TRUE; - $element['to_sid']['#description'] = t('Please select the state that should be assigned when this action runs.'); - $element['comment']['#title'] = $this->t('Message'); - $element['comment']['#description'] = $this->t('This message will be written into the workflow history log when the action - runs. You may include the following variables: %state, %title, %user.'); - - $form['workflow_transition_action_config'] = $element; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $configuration = $form_state->getValue('workflow_transition_action_config'); - // Remove the transition: generates an error upon saving the action definition. - unset($configuration['workflow_transition']); - - $this->configuration = $configuration; - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access = AccessResult::allowed(); - return $return_as_object ? $access : $access->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Block/WorkflowTransitionBlock.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Block/WorkflowTransitionBlock.php deleted file mode 100644 index ffe03d057..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Block/WorkflowTransitionBlock.php +++ /dev/null @@ -1,85 +0,0 @@ - DRUPAL_NO_CACHE, // DRUPAL_CACHE_PER_ROLE will be assumed. - * - * @Block( - * id = "workflow_transition_form_block", - * admin_label = @Translation("Workflow Transition form"), - * category = @Translation("Forms") - * ) - */ -class WorkflowTransitionBlock extends BlockBase { - - /** - * {@inheritdoc} - */ - protected function blockAccess(AccountInterface $account) { - /* @var $entity \Drupal\Core\Entity\EntityInterface */ - if (!$entity = workflow_url_get_entity()) { - return AccessResult::forbidden(); - } - - // Only show block on entity view page (when default operation = ''). - if ($operation = workflow_url_get_operation()) { - return AccessResult::forbidden(); - } - - // Only show block if entity has workflow, and user has permission. - foreach (_workflow_info_fields($entity) as $definition) { - $type_id = $definition->getSetting('workflow_type'); - if ($account->hasPermission("access $type_id workflow_transition form")) { - return AccessResult::allowed(); - } - } - - return AccessResult::forbidden(); - } - - /** - * {@inheritdoc} - */ - public function build() { - $form = []; - - // Get the entity for this form. - /* @var $entity \Drupal\Core\Entity\EntityInterface */ - if (!$entity = workflow_url_get_entity()) { - return $form; - } - // Get the field name. Avoid error on Node Add page. - if (!$field_name = workflow_get_field_name($entity)) { - return $form; - } - - /* - * Output: generate the Transition Form. - */ - // Add the WorkflowTransitionForm to the page. - $form = WorkflowManager::getWorkflowTransitionForm($entity, $field_name, []); - - return $form; - } - - /** - * Retrieves the entity form builder. - * - * @return \Drupal\Core\Entity\EntityFormBuilderInterface - * The entity form builder. - */ - protected function entityFormBuilder() { - return \Drupal::getContainer()->get('entity.form_builder'); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Derivative/WorkflowLocalTask.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Derivative/WorkflowLocalTask.php deleted file mode 100644 index b33817a73..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Derivative/WorkflowLocalTask.php +++ /dev/null @@ -1,75 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $this->derivatives = []; - - $field_list = workflow_get_workflow_fields_by_entity_type(); - foreach ($field_list as $entity_type_id => $fields) { - $this->derivatives["entity.$entity_type_id.workflow_history"] = [ - 'route_name' => "entity.$entity_type_id.workflow_history", - 'title' => $this->t('Workflow'), - 'base_route' => "entity.$entity_type_id.canonical", - 'weight' => 100, - ]; - } - - foreach ($this->derivatives as &$entry) { - $entry += $base_plugin_definition; - } - - return $this->derivatives; - } - -} \ No newline at end of file diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldFormatter/WorkflowDefaultFormatter.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldFormatter/WorkflowDefaultFormatter.php deleted file mode 100644 index 695037e1a..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldFormatter/WorkflowDefaultFormatter.php +++ /dev/null @@ -1,206 +0,0 @@ -get('current_user'), - $container->get('entity.manager'), - $container->get('entity.form_builder') - ); - } - - /** - * Constructs a new WorkflowDefaultFormatter. - * - * @param string $plugin_id - * The plugin_id for the formatter. - * @param mixed $plugin_definition - * The plugin implementation definition. - * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition - * The definition of the field to which the formatter is associated. - * @param array $settings - * The formatter settings. - * @param string $label - * The formatter label display setting. - * @param string $view_mode - * The view mode. - * @param array $third_party_settings - * Third party settings. - * @param \Drupal\Core\Session\AccountInterface $current_user - * The current user. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager - * The entity manager - * @param \Drupal\Core\Entity\EntityFormBuilderInterface $entity_form_builder - * The entity form builder. - */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, EntityTypeManagerInterface $entity_manager, EntityFormBuilderInterface $entity_form_builder) { - parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); - $this->viewBuilder = $entity_manager->getViewBuilder('workflow_transition'); - $this->storage = $entity_manager->getStorage('workflow_transition'); - $this->currentUser = $current_user; - $this->entityTypeManager = $entity_manager; - $this->entityFormBuilder = $entity_form_builder; - } - - /** - * {@inheritdoc} - * - * N.B. A large part of this function is taken from CommentDefaultFormatter. - */ - public function viewElements(FieldItemListInterface $items, $langcode) { - $output = []; - - $field_name = $this->fieldDefinition->getName(); - $entity = $items->getEntity(); - $entity_type = $entity->getEntityTypeId(); - - $user = \Drupal::currentUser(); // @todo #2287057: OK? - // @todo: Perhaps global user is not always the correct user. - // E.g., on ScheduledTransition->execute()? But this function is mostly used in UI. - - $current_sid = WorkflowManager::getCurrentStateId($entity, $field_name); - /* @var $current_state WorkflowState */ - $current_state = WorkflowState::load($current_sid); - - // First compose the current value with the normal formatter from list.module. - $elements = workflow_state_formatter($entity, $field_name, $current_sid); - - // The state must not be deleted, or corrupted. - if (!$current_state) { - return $elements; - } - - // Check permission, so that even with state change rights, - // the form can be suppressed from the entity view (#1893724). - $type_id = $current_state->getWorkflowId(); - if (!\Drupal::currentUser()->hasPermission("access $type_id workflow_transition form")) { - return $elements; - } - - // Workflows are added to the search results and search index by - // workflow_node_update_index() instead of by this formatter, so don't - // return anything if the view mode is search_index or search_result. - if (in_array($this->viewMode, ['search_result', 'search_index'])) { - return $elements; - } - - if ($entity_type == 'comment') { - // No Workflow form allowed on a comment display. - // (Also, this avoids a lot of error messages.) - return $elements; - } - - // Only build form if user has possible target state(s). - if (!$current_state->showWidget($entity, $field_name, $user, FALSE)) { - return $elements; - } - - // Remove the default formatter. We are now building the widget. - $elements = []; - - // BEGIN Copy from CommentDefaultFormatter - $elements['#cache']['contexts'][] = 'user.permissions'; - // Add the WorkflowTransitionForm to the page. - $output['workflows'] = WorkflowManager::getWorkflowTransitionForm($entity, $field_name, []); - - // Only show the add workflow form if the user has permission. - $elements['#cache']['contexts'][] = 'user.roles'; - // Do not show the form for the print view mode. - $elements[] = $output + [ - '#workflow_type' => $this->getFieldSetting('workflow_type'), - '#workflow_display_mode' => $this->getFieldSetting('default_mode'), - 'workflows' => [], - ]; - // END Copy from CommentDefaultFormatter - - return $elements; - } - - /** - * Retrieves the entity form builder. - * - * @return \Drupal\Core\Entity\EntityFormBuilderInterface - * The entity form builder. - */ - protected function entityFormBuilder() { - if (!$this->entityFormBuilder) { - $this->entityFormBuilder = $this->container()->get('entity.form_builder'); - } - return $this->entityFormBuilder; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldType/WorkflowItem.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldType/WorkflowItem.php deleted file mode 100644 index 26896c8c8..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldType/WorkflowItem.php +++ /dev/null @@ -1,420 +0,0 @@ - label' pairs, i.e. 'Publishing': 1 => unpublished, 2 => draft, 3 => published."), - * category = @Translation("Workflow"), - * default_widget = "workflow_default", - * default_formatter = "list_default", - * constraints = { - * "WorkflowField" = {} - * }, - * ) - */ -class WorkflowItem extends ListItemBase { - //class WorkflowItem extends FieldItemBase implements OptionsProviderInterface { - // @todo D8-port: perhaps even: - //class WorkflowItem extends FieldStringItem { - - /** - * {@inheritdoc} - */ - public static function schema(FieldStorageDefinitionInterface $field_definition) { - $schema = [ - 'columns' => [ - 'value' => [ - 'description' => 'The {workflow_states}.sid that this entity is currently in.', - 'type' => 'varchar', - 'length' => 128, - ], - ], - 'indexes' => [ - 'value' => ['value'], - ], - ]; - - return $schema; - } - - /** - * {@inheritdoc} - */ - public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { - - /** - * Property definitions of the contained properties. - * - * @see FileItem::getPropertyDefinitions() - * - * @var array - */ - static $propertyDefinitions; - - - $definition['settings']['target_type'] = 'workflow_transition'; - // Definitions vary by entity type and bundle, so key them accordingly. - $key = $definition['settings']['target_type'] . ':'; - $key .= isset($definition['settings']['target_bundle']) ? $definition['settings']['target_bundle'] : ''; - - if (!isset($propertyDefinitions[$key])) { - - $propertyDefinitions[$key]['value'] = DataDefinition::create('string') // TODO D8-port : or 'any' - ->setLabel(t('Workflow state')) - ->addConstraint('Length', ['max' => 128]) - ->setRequired(TRUE); - - //workflow_debug( __FILE__ , __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - /* - // @todo D8-port: test this. - $propertyDefinitions[$key]['workflow_transition'] = DataDefinition::create('any') - // $properties['workflow_transition'] = DataDefinition::create('WorkflowTransition') - ->setLabel(t('Transition')) - ->setDescription(t('The computed WorkflowItem object.')) - ->setComputed(TRUE) - ->setClass('\Drupal\workflow\Entity\WorkflowTransition') - ->setSetting('date source', 'value'); - - $propertyDefinitions[$key]['display'] = array( - 'type' => 'boolean', - 'label' => t('Flag to control whether this file should be displayed when viewing content.'), - ); - $propertyDefinitions[$key]['description'] = array( - 'type' => 'string', - 'label' => t('A description of the file.'), - ); - - $propertyDefinitions[$key]['display'] = array( - 'type' => 'boolean', - 'label' => t('Flag to control whether this file should be displayed when viewing content.'), - ); - $propertyDefinitions[$key]['description'] = array( - 'type' => 'string', - 'label' => t('A description of the file.'), - ); - */ - } - return $propertyDefinitions[$key]; - } - - /** - * {@inheritdoc} - */ - public function getEntity() { - $entity = parent::getEntity(); - - // For Workflow on CommentForm, get the CommentedEntity. - if ($entity->getEntityTypeId() == 'comment') { - /** @var \Drupal\comment\CommentInterface $entity */ - $entity = $entity->getCommentedEntity(); - } - - return $entity; - } - - /** - * {@inheritdoc} - */ - public function isEmpty() { - $is_empty = empty($this->value); - return $is_empty; - } - - /** - * {@inheritdoc} - */ - public function onChange($property_name, $notify = TRUE) { - //workflow_debug( __FILE__ , __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - - // TODO D8: use this function onChange for adding a line in table workflow_transition_* - // Enforce that the computed date is recalculated. - //if ($property_name == 'value') { - // $this->date = NULL; - //} - parent::onChange($property_name, $notify); - } - - /** - * {@inheritdoc} - */ - public static function defaultStorageSettings() { - - return [ - 'workflow_type' => '', - ] + parent::defaultStorageSettings(); - } - - /** - * Implements hook_field_settings_form() -> ConfigFieldItemInterface::settingsForm(). - */ - public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) { - $element = []; - - // Create list of all Workflow types. Include an initial empty value. - // Validate each workflow, and generate a message if not complete. - $workflows = workflow_get_workflow_names(FALSE); - - // @todo D8: add this to WorkflowFieldConstraintValidator. - // Set message, if no 'validated' workflows exist. - if (count($workflows) == 1) { - drupal_set_message( - $this->t('You must create at least one workflow - before content can be assigned to a workflow.', - [':create' => Url::fromRoute('entity.workflow_type.collection')->toString(),] - ), 'warning' - ); - } - - // Validate via annotation WorkflowFieldConstraint. Show a message for each error. - $violation_list = $this->validate(); - /** @var \Symfony\Component\Validator\ConstraintViolation $violation */ - foreach ($violation_list->getIterator() as $violation) { - switch ($violation->getPropertyPath()) { - case 'fieldnameOnComment': - // @todo D8: CommentForm & constraints on storageSettingsForm() - // A 'comment' field name MUST be equal to content field name. - // @todo: Still not waterproof. You could have a field on a non-relevant entity_type. - drupal_set_message($violation->getMessage(), 'error'); - $workflows = []; - break; - - default: - break; - } - } - - // @todo D8: CommentForm & constraints on storageSettingsForm - // Set the required workflow_type on 'comment' fields. - // N.B. the following must BELOW the (count($workflows) == 1) snippet. - /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage */ - $field_storage = $this->getFieldDefinition()->getFieldStorageDefinition(); - if (!$this->getSetting('workflow_type') && $field_storage->getTargetEntityTypeId() == 'comment') { - $field_name = $field_storage->get('field_name'); - $workflows = []; - foreach (_workflow_info_fields($entity = NULL, $entity_type = '', $entity_bundle = '', $field_name) as $key => $info) { - if ($info->getName() == $field_name && ($info->getTargetEntityTypeId() !== 'comment')) { - $wid = $info->getSetting('workflow_type'); - $workflow = Workflow::load($wid); - $workflows[$wid] = $workflow->label(); - } - } - } - - // Let the user choose between the available workflow types. - $wid = $this->getSetting('workflow_type'); - $url = Url::fromRoute('entity.workflow_type.collection')->toString(); - $element['workflow_type'] = [ - '#type' => 'select', - '#title' => $this->t('Workflow type'), - '#options' => $workflows, - '#default_value' => $wid, - '#required' => TRUE, - '#disabled' => $has_data, - '#description' => $this->t('Choose the Workflow type. Maintain workflows - here.', [':url' => $url]), - ]; - - // Get a string representation to show all options. - - /* - * Overwrite ListItemBase::storageSettingsForm(). - */ - if ($wid) { - $allowed_values = WorkflowState::loadMultiple([], $wid); - // $allowed_values_function = $this->getSetting('allowed_values_function'); - - $element['allowed_values'] = [ - '#type' => 'textarea', - '#title' => $this->t('Allowed values for the selected Workflow type'), - '#default_value' => ($wid) ? $this->allowedValuesString($allowed_values) : [], - '#rows' => count($allowed_values), - '#access' => ($wid) ? TRUE : FALSE, // User can see the data, - '#disabled' => TRUE, // .. but cannot change them. - '#element_validate' => [[get_class($this), 'validateAllowedValues']], - - '#field_has_data' => $has_data, - '#field_name' => $this->getFieldDefinition()->getName(), - '#entity_type' => ($this->getEntity()) ? $this->getEntity()->getEntityTypeId() : '', - '#allowed_values' => $allowed_values, - '#description' => $this->allowedValuesDescription(), - ]; - } - - return $element; - } - - /** - * {@inheritdoc} - */ - protected function allowedValuesDescription() { - return ''; - } - - /** - * Generates a string representation of an array of 'allowed values'. - * - * This string format is suitable for edition in a textarea. - * - * @param \Drupal\Core\Entity\EntityInterface[] $states - * An array of WorkflowStates, where array keys are values and array values are - * labels. - * - * @return string - * The string representation of the $states array: - * - Values are separated by a carriage return. - * - Each value is in the format "value|label" or "value". - */ - protected function allowedValuesString($states) { - $lines = []; - - $wid = $this->getSetting('workflow_type'); - - $previous_wid = -1; - /** @var \Drupal\workflow\Entity\WorkflowState $state */ - foreach ($states as $key => $state) { - // Only show enabled states. - if ($state->isActive()) { - // Show a Workflow name between Workflows, if more then 1 in the list. - if ((!$wid) && ($previous_wid <> $state->getWorkflowId())) { - $previous_wid = $state->getWorkflowId(); - $lines[] = $state->getWorkflow()->label() . "'s states: "; - } - $label = $this->t('@label', ['@label' => $state->label()]); - - $lines[] = " $key|$label"; - } - } - return implode("\n", $lines); - } - -// /** -// * {@inheritdoc} -// */ -// public static function generateSampleValue(FieldDefinitionInterface $field_definition) { -// // @todo Implement this once https://www.drupal.org/node/2238085 lands. -// $values['value'] = rand(pow(10, 8), pow(10, 9)-1); -// return $values; -// } - - - /** - * Implementation of TypedDataInterface - * - * @see folder \workflow\src\Plugin\Validation\Constraint - */ - - /** - * {@inheritdoc} - * - * @see folder \workflow\src\Plugin\Validation\Constraint - */ -// public function getConstraints() { -// $constraints = parent::getConstraints(); -// return $constraints; -// } - - /** - * {@inheritdoc} - * - * @see folder \workflow\src\Plugin\Validation\Constraint - */ -// public function validate() { -// $result = parent::validate(); -// return $result; -// } - - /** - * Implementation of OptionsProviderInterface - * - * An array of settable options for the object that may be used in an - * Options widget, usually when new data should be entered. It may either be - * a flat array of option labels keyed by values, or a two-dimensional array - * of option groups (array of flat option arrays, keyed by option group - * label). Note that labels should NOT be sanitized. - */ - - /** - * {@inheritdoc} - */ - public function getPossibleValues(AccountInterface $account = NULL) { - // Flatten options first, because SettableOptions may have 'group' arrays. - $flatten_options = OptGroup::flattenOptions($this->getPossibleOptions($account)); - return array_keys($flatten_options); - } - - /** - * {@inheritdoc} - */ - public function getPossibleOptions(AccountInterface $account = NULL) { - $allowed_options = []; - - // When we are initially on the Storage settings form, no wid is set, yet. - if (!$wid = $this->getSetting('workflow_type')) { - return $allowed_options; - } - - // Create an empty State. This triggers to show all possible states for the Workflow. - if ($workflow = Workflow::load($wid)) { - // There is no entity, E.g., on the Rules action "Set a data value". - $user = workflow_current_user($account); // @todo #2287057: OK? - /** @var \Drupal\workflow\Entity\WorkflowState $state */ - $state = WorkflowState::create(['wid' => $wid, 'id' => '']); - $allowed_options = $state->getOptions(NULL, '', $user, FALSE); - } - - return $allowed_options; - } - - /** - * {@inheritdoc} - */ - public function getSettableValues(AccountInterface $account = NULL) { - // Flatten options first, because SettableOptions may have 'group' arrays. - $flatten_options = OptGroup::flattenOptions($this->getSettableOptions($account)); - return array_keys($flatten_options); - } - - /** - * {@inheritdoc} - */ - public function getSettableOptions(AccountInterface $account = NULL) { - $allowed_options = []; - - // When we are initially on the Storage settings form, no wid is set, yet. - if (!$wid = $this->getSetting('workflow_type')) { - return $allowed_options; - } - - // Use the 'allowed_values_function' to calculate the options. - $definition = $this->getFieldDefinition()->getFieldStorageDefinition(); - $entity = $this->getEntity(); - $field_name = $definition->getName(); - $user = workflow_current_user($account); // @todo #2287057: OK? - - // Get the allowed new states for the entity's current state. - // @todo D8-port: overwrite getValue(). - // $sid = $value = $this->getValue(); - /** @var \Drupal\workflow\Entity\WorkflowState $state */ - $sid = workflow_node_current_state($entity, $field_name); - $state = WorkflowState::load($sid); - $allowed_options = ($state) ? $state->getOptions($entity, $field_name, $user, FALSE) : []; - - return $allowed_options; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldWidget/WorkflowDefaultWidget.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldWidget/WorkflowDefaultWidget.php deleted file mode 100644 index 45f03c2c1..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Field/FieldWidget/WorkflowDefaultWidget.php +++ /dev/null @@ -1,239 +0,0 @@ - array( - 'label' => $this->t('Workflow'), - 'field types' => array('workflow'), - 'settings' => array( - 'fieldset' => 0, - 'name_as_title' => 1, - 'comment' => 1, - ), - ), - */ - ] + parent::defaultSettings(); - } - - /** - * {@inheritdoc} - * - * Be careful: Widget may be shown in very different places. Test carefully!! - * - On a entity add/edit page - * - On a entity preview page - * - On a entity view page - * - On a entity 'workflow history' tab - * - On a comment display, in the comment history - * - On a comment form, below the comment history - * - * @todo D8: change "array $items" to "FieldInterface $items" - */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { - - $wid = $this->getFieldSetting('workflow_type'); - /** @var $workflow Workflow */ - if (!$workflow = Workflow::load($wid)) { - // @todo: add error message. - return $element; - } - - if ($this->isDefaultValueWidget($form_state)) { - // On the Field settings page, User may not set a default value - // (this is done by the Workflow module). - return []; - } - - /** @var $item \Drupal\workflow\Plugin\Field\FieldType\WorkflowItem */ - $item = $items[$delta]; - /** @var \Drupal\field\Entity\FieldConfig $field_config */ - $field_config = $item->getFieldDefinition(); - /** @var $field_storage \Drupal\field\Entity\FieldStorageConfig */ - $field_storage = $field_config->getFieldStorageDefinition(); - - $entity = $item->getEntity(); - $field_name = $field_storage->getName(); - - // Create a transition, to pass to the form. No need to use setValues(). - $from_sid = workflow_node_current_state($entity, $field_name); - /** @var $transition WorkflowTransition */ - $transition = WorkflowTransition::create([$from_sid, 'field_name' => $field_name]); - $transition->setTargetEntity($entity); - - // Here, on entity form, not the $element is added, but the entity form. - // Problem 1: adding the element, does not add added fields. - // Problem 2: adding the form, generates wrong UI. - // Problem 3: does not work on ScheduledTransition. - - // Step 1: use the Element. - $element['#default_value'] = $transition; - $element += WorkflowTransitionElement::transitionElement($element, $form_state, $form); - // Step 2: use the Form, in order to get extra fields. - $form_state_additions = [ - 'input' => $form_state->getUserInput(), - 'values' => $form_state->getValues(), - 'triggering_element' => $form_state->getTriggeringElement(), - ]; - $workflow_form = WorkflowManager::getWorkflowTransitionForm($entity, $field_name, $form_state_additions); - - // Determine and add the attached fields. - $attached_fields = WorkflowManager::getAttachedFields('workflow_transition', $wid); - foreach ($attached_fields as $key => $attached_field) { - $element[$key] = $workflow_form[$key]; - } - - // Option 3: use the true Element. - // $form = $this->element($form, $form_state, $transition); - //$element['workflow_transition'] = array( - // '#type' => 'workflow_transition', - // '#title' => $this->t('Workflow transition'), - // '#default_value' => $transition, - // ); - - return $element; - } - - /** - * {@inheritdoc} - * - * Implements workflow_transition() -> WorkflowDefaultWidget::submit(). - * - * Overrides submit(array $form, array &$form_state). - * Contains 2 extra parameters for D7 - * - * @param array $form - * @param array $form_state - * @param array $items - * The value of the field. - * @param bool $force - * TRUE if all access must be overridden, e.g., for Rules. - * - * @return int - * If update succeeded, the new State Id. Else, the old Id is returned. - * - * This is called from function _workflow_form_submit($form, &$form_state) - * It is a replacement of function workflow_transition($entity, $to_sid, $force, $field) - * It performs the following actions; - * - save a scheduled action - * - update history - * - restore the normal $items for the field. - * @todo: remove update of {node_form} table. (separate task, because it has features, too) - */ - public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { - - $user = workflow_current_user(); // @todo #2287057: verify if submit() really is only used for UI. If not, $user must be passed. - - // Set the new value. - // Beware: We presume cardinality = 1 !! - // The widget form element type has transformed the value to a - // WorkflowTransition object at this point. We need to convert it - // back to the regular 'value' string format. - foreach ($values as &$item) { - if (!empty($item)) { // } && $item['value'] instanceof DrupalDateTime) { - - // The following can NOT be retrieved from the WorkflowTransition. - /** @var $entity \Drupal\Core\Entity\EntityInterface */ - $entity = $form_state->getFormObject()->getEntity(); - /** @var $transition \Drupal\workflow\Entity\WorkflowTransitionInterface */ - $transition = $item['workflow_transition']; - // N.B. Use a proprietary version of copyFormValuesToEntity, - // where $entity/$transition is passed by reference. - /** @var $transition \Drupal\workflow\Entity\WorkflowTransitionInterface */ - $transition = WorkflowTransitionElement::copyFormValuesToTransition($transition, $form, $form_state, $item); - - // Try to execute the transition. Return $from_sid when error. - if (!$transition) { - // This should not be possible (perhaps when testing/developing). - drupal_set_message($this->t('Error: the transition from %from_sid to %to_sid could not be generated.'), 'error'); - // The current value is still the previous state. - $to_sid = $from_sid = 0; - } - else { - // The transition may be scheduled or not. Save the result, and - // rely upon hook workflow_entity_insert/update($entity) in - // file workflow.module to save/execute the transition. - - // - validate option; add hook to let other modules change comment. - // - add to history; add to watchdog - // Return the new State ID. (Execution may fail and return the old Sid.) - - // Get the new value from an action button if set in the workflow settings. - $action_info = _workflow_transition_form_get_triggering_button($form_state); - $field_name = $transition->getFieldName(); - if ($field_name == $action_info['field_name']) { - $transition->set('to_sid', $action_info['to_sid']); - } - - $force = FALSE; // @TODO D8-port: add to form for usage in VBO. - - // Now, save/execute the transition. - $from_sid = $transition->getFromSid(); - $force = $force || $transition->isForced(); - - if (!$transition->isAllowed($user, $force)) { - // Transition is not allowed. - $to_sid = $from_sid; - } - elseif (!$entity || !$entity->id()) { - // Entity is inserted. The Id is not yet known. - // So we can't yet save the transition right now, but must rely on - // function/hook workflow_entity_insert($entity) in file workflow.module. - // $to_sid = $transition->execute($force); - $to_sid = $transition->getToSid(); - } - else { - // Entity is updated. To stay in sync with insert, we rely on - // function/hook workflow_entity_update($entity) in file workflow.module. - // $to_sid = $transition->execute($force); - $to_sid = $transition->getToSid(); - } - } - - // Now the data is captured in the Transition, and before calling the - // Execution, restore the default values for Workflow Field. - // For instance, workflow_rules evaluates this. - // - // N.B. Align the following functions: - // - WorkflowDefaultWidget::massageFormValues(); - // - WorkflowManager::executeTransition(). - // Set the transition back, to be used in hook_entity_update(). - $item['workflow_transition'] = $transition; - // Set the value at the proper location. - if ($transition && $transition->isScheduled()) { - $item['value'] = $from_sid; - } - else { - $item['value'] = $to_sid; - } - } - } - return $values; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/Validation/Constraint/WorkflowFieldConstraint.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/Validation/Constraint/WorkflowFieldConstraint.php deleted file mode 100644 index dbc7eb15f..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/Validation/Constraint/WorkflowFieldConstraint.php +++ /dev/null @@ -1,36 +0,0 @@ -userStorage = $user_storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('entity.manager')->getStorage('user')); - } - - /** - * {@inheritdoc} - */ - public function validate($entity, Constraint $constraint) { - // Workflow field name on CommentForm has special requirements. - /** @var FieldStorageConfig $field_storage */ - $field_storage = $entity->getFieldDefinition()->getFieldStorageDefinition(); - if ($field_storage->getTargetEntityTypeId() == 'comment') { - if (!$this->isValidFieldname($field_storage)) { - $this->context->buildViolation($constraint->messageFieldname) - ->atPath('fieldnameOnComment') - ->addViolation(); - } - } - } - - /** - * @param \Drupal\field\Entity\FieldStorageConfig $field_storage - * - * @return bool - */ - protected function isValidFieldname(FieldStorageConfig $field_storage) { - $comment_field_name_ok = FALSE; - - if ($field_storage->getTargetEntityTypeId() !== 'comment') { - return TRUE; - } - - $field_name = $field_storage->getName(); - - // Check if the 'comment' field name exists on the 'commented' entity type. - // @todo: Still not waterproof. You could have a field on a non-relevant entity_type. - foreach (_workflow_info_fields() as $key => $info) { - if (($info->getName() == $field_name) && ($info->getTargetEntityTypeId() !== 'comment')) { - $comment_field_name_ok = TRUE; - } - } - - return $comment_field_name_ok; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/views/argument/WorkflowState.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/views/argument/WorkflowState.php deleted file mode 100644 index bb08a4ad4..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/views/argument/WorkflowState.php +++ /dev/null @@ -1,23 +0,0 @@ -argument); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Plugin/views/filter/WorkflowState.php b/sites/all/modules/contrib/admin/workflow/src/Plugin/views/filter/WorkflowState.php deleted file mode 100644 index 8556a69c2..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Plugin/views/filter/WorkflowState.php +++ /dev/null @@ -1,55 +0,0 @@ -definition['wid']) ? $this->definition['wid'] : ''; - $grouped = isset($options['group_info']['widget']) ? $options['group_info']['widget'] == 'select' : false; - $this->valueOptions = workflow_get_workflow_state_names($wid, $grouped); - } - - /** - * Child classes should be used to override this function and set the - * 'value options', unless 'options callback' is defined as a valid function - * or static public method to generate these values. - * - * This can use a guard to be used to reduce database hits as much as - * possible. - * - * @return array|null - * The stored values from $this->valueOptions. - */ - public function getValueOptions() { - - if (isset($this->valueOptions)) { - return $this->valueOptions; - } - - //@todo: implement the below code, and remove the line from init. - // @todo: follow Options patterns - // @see callback_allowed_values_function() - // @see options_allowed_values() - - return parent::getValueOptions(); - } -} diff --git a/sites/all/modules/contrib/admin/workflow/src/Routing/RouteSubscriber.php b/sites/all/modules/contrib/admin/workflow/src/Routing/RouteSubscriber.php deleted file mode 100644 index e22dadcdb..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/Routing/RouteSubscriber.php +++ /dev/null @@ -1,135 +0,0 @@ -entityTypeManager = $entity_manager; - } - - /** - * {@inheritdoc} - */ - protected function alterRoutes(RouteCollection $collection) { - - $field_list = workflow_get_workflow_fields_by_entity_type(); - foreach ($field_list as $entityTypeId => $fields) { - - /* - * @todo: For entities with +1 workflow fields, Create an - * Entity workflow field list page and a route - * that redirect to the correct page. - * @todo: Routes for 3 workflow fields on 3 different bundles of 1 entity type. - */ - - // Generate route for default field. Redirect to workflow/{field_name}. - $path = "/$entityTypeId/{{$entityTypeId}}/workflow"; - $route = $this->getEntityLoadRoute($entityTypeId, $path); - $collection->add("entity.$entityTypeId.workflow_history", $route); - - // Generate one route for each workflow field. - foreach ($fields as $field_name => $field) { - $path = "/$entityTypeId/{{$entityTypeId}}/workflow/$field_name"; - $route = $this->getEntityLoadRoute($entityTypeId, $path); - $collection->add("entity.$entityTypeId.workflow_history.$field_name", $route); - } - } - } - - /** - * Gets the entity load route. - * - * @param string $entityTypeId - * The entity type id. - * @param string $path - * The Path of the route. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getEntityLoadRoute($entityTypeId, $path) { - - /* - * @todo Create the Route for taxonomy term like - * '/taxonomy/term/{taxonomy_term}/workflow/{field_name}' - * - */ - $route = new Route( - $path, - [ - '_controller' => '\Drupal\workflow\Controller\WorkflowTransitionListController::historyOverview', - '_title' => 'Workflow history', - ], - [ - '_custom_access' => '\Drupal\workflow\Access\WorkflowHistoryAccess::access', - ], - [ - '_admin_route' => TRUE, - '_workflow_entity_type_id' => $entityTypeId, // @todo: remove - 'parameters' => [ - $entityTypeId => ['type' => 'entity:' . $entityTypeId], - ], - ] - ); - - return $route; - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events = parent::getSubscribedEvents(); - $events[RoutingEvents::ALTER] = ['onAlterRoutes', 100]; - return $events; - } - - /** - * Get all field of type workflow. - * - * @return array - * Return all workflow fields. - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - */ - public function listWorkflowFields() { - $fieldType = 'workflow'; - $fieldStorageConfigs = $this->entityTypeManager->getStorage('field_storage_config')->loadByProperties(['type' => $fieldType]); - if (!$fieldStorageConfigs) { - return []; - } - - $availableItems = []; - foreach ($fieldStorageConfigs as $fieldStorage) { - $availableItems[] = $fieldStorage; - } - - return $availableItems; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/WorkflowAccessControlHandler.php b/sites/all/modules/contrib/admin/workflow/src/WorkflowAccessControlHandler.php deleted file mode 100644 index f8993b570..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/WorkflowAccessControlHandler.php +++ /dev/null @@ -1,146 +0,0 @@ -prepareUser($account); - - // This is only for Edit/Delete transition. For Add/create, use createAccess. - switch ($entity->getEntityTypeId()) { - case 'workflow_scheduled_transition': - switch ($operation) { - case 'update': - // This operation is not defined for Scheduled Transitions. - $result = AccessResult::forbidden(); - break; - case 'delete': - // This operation is not defined for Scheduled Transitions. - $result = AccessResult::forbidden(); - break; - case 'revert': - // This operation is not defined for Scheduled Transitions. - $result = AccessResult::forbidden(); - break; - default: - $result = parent::access($entity, $operation, $account, $return_as_object); - break; - } // End of switch ($operation). - - break; - - case 'workflow_transition': - /* @var $transition \Drupal\workflow\Entity\WorkflowTransitionInterface */ - $transition = $entity; - switch ($operation) { - case 'update': - $is_owner = WorkflowManager::isOwner($account, $transition); - $type_id = $transition->getWorkflowId(); - if ($account->hasPermission("bypass $type_id workflow_transition access")) { - $result = AccessResult::allowed()->cachePerPermissions(); - } - elseif ($account->hasPermission("edit any $type_id workflow_transition")) { - $result = AccessResult::allowed()->cachePerPermissions(); - } - elseif ($is_owner && $account->hasPermission("edit own $type_id workflow_transition")) { - $result = AccessResult::allowed()->cachePerPermissions(); - } - return $return_as_object ? $result : $result->isAllowed(); - case 'delete': - // The delete operation is not defined for Transitions. - $result = AccessResult::forbidden(); - break; - case 'revert': - // @see workflow_operations. - default: - $result = parent::access($entity, $operation, $account, $return_as_object); - //if ($account->hasPermission("bypass $type_id workflow_transition access")) { - // $result = AccessResult::allowed()->cachePerPermissions(); - //} - break; - } // End of switch ($operation). - - break; - - case 'workflow_config_transition': - // This is not (yet) configured. - break; - - case 'workflow_state': - switch ($operation) { - case 'view label': - // The following two lines are copied from below, and need to be reviewed carefully. - $result = AccessResult::allowed(); - return $return_as_object ? $result : $result->isAllowed(); - default: - // E.g., operation 'update' on the WorkflowStates config page. - break; - } // End of switch ($operation). - - break; - - } - - /** @var $result AccessResult $result */ -// $result = parent::createAccess($entity_bundle, $account, $context, TRUE); - $result = $result->cachePerPermissions(); - return $return_as_object ? $result : $result->isAllowed(); - } - - /** - * {@inheritdoc} - */ - public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = [], $return_as_object = FALSE) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - /** @var $result AccessResult $result */ - $result = parent::createAccess($entity_bundle, $account, $context, TRUE); - $result = $result->cachePerPermissions(); - return $return_as_object ? $result : $result->isAllowed(); - } - - /** - * {@inheritdoc} - */ - protected function checkAccess(EntityInterface $transition, $operation, AccountInterface $account) { - return parent::checkAccess($transition, $operation, $account); - } - - /** - * {@inheritdoc} - */ - protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { - workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8-port: still test this snippet. - return AccessResult::allowedIf($account->hasPermission('create ' . $entity_bundle . ' content'))->cachePerPermissions(); - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/WorkflowPermissions.php b/sites/all/modules/contrib/admin/workflow/src/WorkflowPermissions.php deleted file mode 100644 index ab440c384..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/WorkflowPermissions.php +++ /dev/null @@ -1,79 +0,0 @@ -buildPermissions($type); - } - return $perms; - } - - /** - * Returns a list of workflow permissions for a given workflow type. - * - * @param \Drupal\workflow\Entity\Workflow $type - * The workflow type. - * - * @return array - * An associative array of permission names and descriptions. - */ - protected function buildPermissions(Workflow $type) { - $type_id = $type->id(); - $type_params = ['%type_name' => $type->label()]; - - return [ - // D7->D8-Conversion of the 'User 1 is special' permission (@see NodePermissions::bypass node access). - "bypass $type_id workflow_transition access" => [ - 'title' => $this->t('%type_name: Bypass transition access control', $type_params), - 'description' => $this->t('View, edit and delete all transitions regardless of permission restrictions.'), - 'restrict access' => TRUE, - ], - // D7->D8-Conversion of 'participate in workflow' permission to "create $type_id transition" (@see NodePermissions::create content). - "create $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Participate in workflow', $type_params), - 'description' => $this->t("Role is enabled to create state transitions. (Determines transition-specific permission on the workflow admin page. - Warning: For better control, uncheck the 'Authenticated user', and manage the permissions per separate role.)"), - ], - // D7->D8-Conversion of 'schedule workflow transitions' permission to "schedule $type_id transition" (@see NodePermissions::create content). - "schedule $type_id workflow_transition" => [ - 'title' => $this->t('%type_name: Schedule state transition', $type_params), - 'description' => $this->t('Role is enabled to schedule state transitions.'), - ], - // D7->D8-Conversion of 'workflow history' permission on Workflow settings to "access $type_id overview" (@see NodePermissions::access content overview). - "access own $type_id workflow_transion overview" => [ - 'title' => $this->t('%type_name: Access Workflow history tab of own content', $type_params), - 'description' => $this->t('Role is enabled to view the "Workflow state transition history" tab on own entity.'), - ], - "access any $type_id workflow_transion overview" => [ - 'title' => $this->t('%type_name: Access Workflow history tab of any content', $type_params), - 'description' => $this->t('Role is enabled to view the "Workflow state transition history" tab on any entity.'), - ], - // D7->D8-Conversion of 'show workflow transition form' permission. @see #1893724 - "access $type_id workflow_transition form" => [ - 'title' => $this->t('%type_name: Access the Workflow state transition form on entity view page', $type_params), - 'description' => $this->t('Role is enabled to view a "Workflow state transition" block/widget and add a state transition on the entity page.'), - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/WorkflowScheduledTransitionViewsData.php b/sites/all/modules/contrib/admin/workflow/src/WorkflowScheduledTransitionViewsData.php deleted file mode 100644 index 9319a5d17..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/WorkflowScheduledTransitionViewsData.php +++ /dev/null @@ -1,22 +0,0 @@ -workflow_entity; // N.B. This is a custom variable. - $entity_type = $entity->getEntityTypeId(); - $entity_id = $entity->id(); - $field_name = workflow_url_get_field_name(); - - // @todo D8-port: document $limit. Should be used in pager, not in load(). - // N.B. Using the provided default History view is recommended. - $this->limit = \Drupal::config('workflow.settings')->get('workflow_states_per_page'); - $limit = $this->limit; - // Get Transitions with highest timestamp first. - $entities = WorkflowTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name, '', $limit, 'DESC'); - return $entities; - } - - /** - * {@inheritdoc} - * - * Building the header and content lines for the contact list. - * - * Calling the parent::buildHeader() adds a column for the possible actions - * and inserts the 'edit' and 'delete' links as defined for the entity type. - */ - public function buildHeader() { - - $entity = $this->workflow_entity; // N.B. This is a custom variable. - - $header['timestamp'] = $this->t('Date'); - if ($this->showColumnFieldname($entity)) { - $header['field_name'] = $this->t('Field name'); - } - $header['from_state'] = $this->t('From State'); - $header['to_state'] = $this->t('To State'); - $header['user_name'] = $this->t('By'); - $header['comment'] = $this->t('Comment'); - - // column 'Operations' is now added by core. - //$header['operations'] = $this->t('Operations'); - - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $transition) { - // Show the history table. - $current_themed = FALSE; - /** @var $transition \Drupal\workflow\Entity\WorkflowTransitionInterface */ - $entity = $transition->getTargetEntity(); - $field_name = $transition->getFieldName(); - $current_sid = workflow_node_current_state($entity, $field_name); - - $to_state = $transition->getToState(); - if (!$to_state) { - // This is an invalid/deleted state. - $to_label = self::WORKFLOW_MARK_STATE_IS_DELETED; - // Add a footer to explain the addition. - $this->footer_needed = TRUE; - } - else { - $label = Html::escape($this->t($to_state->label())); - if ($transition->getToSid() == $current_sid && $to_state->isActive() && !$current_themed) { - $to_label = $label; - - // Make a note that we have themed the current state; other times in the history - // of this entity where the entity was in this state do not need to be specially themed. - $current_themed = TRUE; - } - elseif (!$to_state->isActive()) { - $to_label = $label . self::WORKFLOW_MARK_STATE_IS_DELETED; - // Add a footer to explain the addition. - $this->footer_needed = TRUE; - } - else { - // Regular state. - $to_label = $label; - } - } - unset($to_state); // Not needed anymore. - - $from_state = $transition->getFromState(); - if (!$from_state) { - // This is an invalid/deleted state. - $from_label = self::WORKFLOW_MARK_STATE_IS_DELETED; - // Add a footer to explain the addition. - $this->footer_needed = TRUE; - } - else { - $label = Html::escape($this->t($from_state->label())); - if (!$from_state->isActive()) { - $from_label = $label . self::WORKFLOW_MARK_STATE_IS_DELETED; - // Add a footer to explain the addition. - $this->footer_needed = TRUE; - } - else { - // Regular state. - $from_label = $label; - } - } - unset($from_state); // Not needed anymore. - - $owner = $transition->getOwner(); - $field_label = $transition->getFieldName(); - $variables = [ - 'transition' => $transition, - 'extra' => '', - 'from_label' => $from_label, - 'to_label' => $to_label, - 'user' => $owner, - ]; - // Allow other modules to modify the row. - \Drupal::moduleHandler()->alter('workflow_history', $variables); - - // 'class' => array('workflow_history_row'), // TODO D8-port - $row['timestamp']['data'] = $transition->getTimestampFormatted(); // 'class' => array('timestamp') - // html_entity_decode() transforms chars like '&' correctly. - if ($this->showColumnFieldname($entity)) { - $row['field_name']['data'] = html_entity_decode($field_label); - } - $row['from_state']['data'] = html_entity_decode($from_label); // 'class' => array('previous-state-name')) - $row['to_state']['data'] = html_entity_decode($to_label); // 'class' => array('state-name')) - $row['user_name']['data'] = $owner->toLink($owner->getDisplayName())->toString(); // 'class' => array('user-name') - $row['comment']['data'] = html_entity_decode($transition->getComment()); // 'class' => array('log-comment') - - // Column 'Operations' is now added by core. - // D7: $row['operations']['data'] = $this->buildOperations($entity); - $row += parent::buildRow($transition); - - return $row; - } - - /** - * {@inheritdoc} - * - * Builds the entity listing as renderable array for table.html.twig. - */ - public function render() { - $build = []; - - // @todo d8-port: get pager working. - $this->limit = \Drupal::config('workflow.settings')->get('workflow_states_per_page'); // TODO D8-port - // $output .= theme('pager', array('tags' => $limit)); // @todo D8-port - - $build += parent::render(); - - // Add a footer. This is not yet added in EntityListBuilder::render() - if ($this->footer_needed) { // @todo D8-port: test this. - // Two variants. First variant is official, but I like 2nd better. - /* - $build['table']['#footer'] = [ - [ - 'class' => ['footer-class'], - 'data' => [ - [ - 'data' => self::WORKFLOW_MARK_STATE_IS_DELETED . ' ' . t('State is no longer available.'), - 'colspan' => count($build['table']['#header']), - ], - ], - ], - ]; - */ - $build['workflow_footer'] = [ - '#markup' => self::WORKFLOW_MARK_STATE_IS_DELETED . ' ' . t('State is no longer available.'), - '#weight' => 500, // @todo Make this better. - ]; - } - - return $build; - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - - if (isset($operations['edit'])) { - $destination = \Drupal::destination()->getAsArray(); - $operations['edit']['query'] = $destination; - } - - return $operations; - } - - /** - * Gets the title of the page. - * - * @return string - * A string title of the page. - */ - protected function getTitle() { - return $this->t('Workflow history'); - } - - /** - * Determines if the column 'Field name' must be shown. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * - * @return bool - */ - protected function showColumnFieldname(EntityInterface $entity) { - if (is_null($this->show_column_fieldname)) { - // @todo: also remove when field_name is set in route?? - if (count(_workflow_info_fields($entity)) > 1) { - $this->show_column_fieldname = TRUE; - } - } - return $this->show_column_fieldname; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/WorkflowTransitionViewsData.php b/sites/all/modules/contrib/admin/workflow/src/WorkflowTransitionViewsData.php deleted file mode 100644 index dff6d55d2..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/WorkflowTransitionViewsData.php +++ /dev/null @@ -1,176 +0,0 @@ -entityType->getBaseTable(); - $base_field = $this->entityType->getKey('id'); - - // @todo D8-port: Add data from D7 function workflow_views_views_data_alter() - // @see http://cgit.drupalcode.org/workflow/tree/workflow_views/workflow_views.views.inc - - $data[$base_table]['table']['group'] = $this->t('Workflow'); - $data[$base_table]['table']['provider'] = 'workflow'; - - $data[$base_table]['table']['join'] = [ - // This is provided for the many_to_one argument. - $base_table => [ - 'field' => $base_field, - 'left_field' => $base_field, - ], - ]; - - // @todo: this relationship needs to be reversed. See also taxonomy/src/NodeTermData.php - //$data[$base_table]['nid'] = [ - // 'title' => $this->t('Content with workflow'), - // 'help' => $this->t('Relate all content with a workflow.'), - // 'relationship' => [ - // 'id' => 'standard', - // 'base' => 'node', - // 'base field' => 'nid', - // 'label' => $this->t('node'), - // 'skip base' => 'node', - // ], - //]; - - $data[$base_table]['from_sid']['filter']['id'] = 'workflow_state'; - $data[$base_table]['from_sid']['help'] = $this->t('The name of the previous state of the transition.'); - - $data[$base_table]['to_sid']['filter']['id'] = 'workflow_state'; - $data[$base_table]['to_sid']['help'] = $this->t('The name of the new state of the transition. (For the latest transition, this is the current state.)'); - - $data[$base_table]['uid']['help'] = $this->t('The user who triggered the transition. If you need more fields than the uid add the content: author relationship'); - $data[$base_table]['uid']['filter']['id'] = 'user_name'; - $data[$base_table]['uid']['relationship']['title'] = $this->t('User'); - $data[$base_table]['uid']['relationship']['help'] = $this->t('The user who triggered the transition.'); - $data[$base_table]['uid']['relationship']['label'] = $this->t('User'); - - // @todo Add similar support to any date field - // @see https://www.drupal.org/node/2337507 - $data[$base_table]['timestamp_fulldate'] = [ - 'title' => $this->t('Created date'), - 'help' => $this->t('Date in the form of CCYYMMDD.'), - 'argument' => [ - 'field' => 'timestamp', - 'id' => 'date_fulldate', - ], - ]; - - $data[$base_table]['timestamp_year_month'] = [ - 'title' => $this->t('Created year + month'), - 'help' => $this->t('Date in the form of YYYYMM.'), - 'argument' => [ - 'field' => 'timestamp', - 'id' => 'date_year_month', - ], - ]; - - $data[$base_table]['timestamp_year'] = [ - 'title' => $this->t('Created year'), - 'help' => $this->t('Date in the form of YYYY.'), - 'argument' => [ - 'field' => 'timestamp', - 'id' => 'date_year', - ], - ]; - - $data[$base_table]['timestamp_month'] = [ - 'title' => $this->t('Created month'), - 'help' => $this->t('Date in the form of MM (01 - 12).'), - 'argument' => [ - 'field' => 'timestamp', - 'id' => 'date_month', - ], - ]; - - $data[$base_table]['timestamp_day'] = [ - 'title' => $this->t('Created day'), - 'help' => $this->t('Date in the form of DD (01 - 31).'), - 'argument' => [ - 'field' => 'timestamp', - 'id' => 'date_day', - ], - ]; - - $data[$base_table]['timestamp_week'] = [ - 'title' => $this->t('Created week'), - 'help' => $this->t('Date in the form of WW (01 - 53).'), - 'argument' => [ - 'field' => 'timestamp', - 'id' => 'date_week', - ], - ]; - - $data[$base_table]['changed_fulldate'] = [ - 'title' => $this->t('Updated date'), - 'help' => $this->t('Date in the form of CCYYMMDD.'), - 'argument' => [ - 'field' => 'changed', - 'id' => 'date_fulldate', - ], - ]; - - $data[$base_table]['changed_year_month'] = [ - 'title' => $this->t('Updated year + month'), - 'help' => $this->t('Date in the form of YYYYMM.'), - 'argument' => [ - 'field' => 'changed', - 'id' => 'date_year_month', - ], - ]; - - $data[$base_table]['changed_year'] = [ - 'title' => $this->t('Updated year'), - 'help' => $this->t('Date in the form of YYYY.'), - 'argument' => [ - 'field' => 'changed', - 'id' => 'date_year', - ], - ]; - - $data[$base_table]['changed_month'] = [ - 'title' => $this->t('Updated month'), - 'help' => $this->t('Date in the form of MM (01 - 12).'), - 'argument' => [ - 'field' => 'changed', - 'id' => 'date_month', - ], - ]; - - $data[$base_table]['changed_day'] = [ - 'title' => $this->t('Updated day'), - 'help' => $this->t('Date in the form of DD (01 - 31).'), - 'argument' => [ - 'field' => 'changed', - 'id' => 'date_day', - ], - ]; - - $data[$base_table]['changed_week'] = [ - 'title' => $this->t('Updated week'), - 'help' => $this->t('Date in the form of WW (01 - 53).'), - 'argument' => [ - 'field' => 'changed', - 'id' => 'date_week', - ], - ]; - - return $data; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/WorkflowTypeAttributeTrait.php b/sites/all/modules/contrib/admin/workflow/src/WorkflowTypeAttributeTrait.php deleted file mode 100644 index 105db185b..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/WorkflowTypeAttributeTrait.php +++ /dev/null @@ -1,105 +0,0 @@ -wid = ''; - $this->workflow = NULL; - if ($workflow) { - $this->wid = $workflow->id(); - $this->workflow = $workflow; - } - } - - /** - * Returns the Workflow object of this object. - * - * @return Workflow - * Workflow object. - */ - public function getWorkflow() { - if (!empty($this->workflow)) { - return $this->workflow; - } - - /** @noinspection PhpAssignmentInConditionInspection */ - if ($wid = $this->getWorkflowId()) { - $this->workflow = Workflow::load($wid); - } - return $this->workflow; - } - - /** - * Sets the Workflow ID of this object. - * - * @param $wid Workflow ID - * - * @return object - */ - public function setWorkflowId($wid) { - $this->wid = $wid; - $this->workflow = NULL; - return $this; - } - - /** - * Returns the Workflow ID of this object. - * - * @return string - * Workflow Id. - */ - public function getWorkflowId() { - /** @var ContentEntityBase $this */ - if (!empty($this->wid)) { - return $this->wid; - } - - $value = $this->get('wid'); - if (is_string($value)) { - $this->wid = $value; - } - elseif (is_object($value)) { - $wid = isset($value->getValue()[0]['target_id']) ? $value->getValue()[0]['target_id'] : ''; - // or: $this->set('wid', $wid); - $this->wid = $wid; // in WorkflowTransition. - } - else { - workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - } - - return $this->wid; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/src/WorkflowURLRouteParametersTrait.php b/sites/all/modules/contrib/admin/workflow/src/WorkflowURLRouteParametersTrait.php deleted file mode 100644 index 0941702a0..000000000 --- a/sites/all/modules/contrib/admin/workflow/src/WorkflowURLRouteParametersTrait.php +++ /dev/null @@ -1,19 +0,0 @@ -getWorkflowId(); - return $uri_route_parameters; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/workflow.api.php b/sites/all/modules/contrib/admin/workflow/workflow.api.php deleted file mode 100644 index 99f52bd41..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.api.php +++ /dev/null @@ -1,431 +0,0 @@ - $workflow->label()]); - $attributes = ['alt' => $alt, 'title' => $alt]; - $operations['workflow_access_form'] = [ - 'title' => t('Access'), - 'weight' => 50, - 'url' => \Drupal\Core\Url::fromRoute('entity.workflow_type.access_form', ['workflow_type' => $workflow->id()]), - 'query' => \Drupal::destination()->getAsArray(), // Add destination. - ]; - return $operations; - - case 'state': - /* @var $state WorkflowState */ - $state = $entity; - break; - - case 'workflow_transition': - // As of D8, below hook_workflow_operations is removed, in favour of core hooks. - // @see EntityListBuilder::getOperations, workflow_operations, workflow.api.php. - - // Your module may add operations to the Entity list. - /* @var $transition WorkflowTransitionInterface */ - $transition = $entity; - break; - - default: - break; - } - return $operations; -} - -/** - * Implements hook_workflow(). - * - * NOTE: This hook may reside in the implementing module - * or in a module.workflow.inc file. - * - * @param string $op - * The current workflow operation. - * E.g., 'transition pre', 'transition post'. - * @param \Drupal\workflow\Entity\WorkflowTransitionInterface $transition - * The transition, that contains all of the above. - * @param \Drupal\user\UserInterface $user - * - * @return bool|void - */ -function hook_workflow($op, WorkflowTransitionInterface $transition, UserInterface $user) { - switch ($op) { - case 'transition permitted': - // As of version 8.x-1.x, this operation is never called to check if transition is permitted. - // This was called in the following situations: - // case 1. when building a workflow widget with list of available transitions; - // case 2. when executing a transition, just before the 'transition pre'; - // case 3. when showing a 'revert state' link in a Views display. - // Your module's implementation may return FALSE here and disallow - // the execution, or avoid the presentation of the new State. - // This may be user-dependent. - // As of version 8.x-1.x: - // case 1: use hook_workflow_permitted_state_transitions_alter(); - // case 2: use the 'transition pre' operation; - // case 3: use the 'transition pre' operation; - return TRUE; - - case 'transition revert': - // Hook is called when showing the Transition Revert form. - // Implement this hook if you need to control this. - // If you return FALSE here, you will veto the transition. - - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, $op, ''); - break; - - case 'transition pre': - // The workflow module does nothing during this operation. - // Implement this hook if you need to change/do something BEFORE anything - // is saved to the database. - // If you return FALSE here, you will veto the transition. - - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, $op, ''); - break; - - case 'transition post': - // In D7, this is called by Workflow Node during update of the state, directly - // after updating the Workflow. Workflow Field does not call this, - // since you can call a hook_entity_* event after saving the entity. - // @see https://api.drupal.org/api/drupal/includes%21module.inc/group/hooks/7 - - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, $op, ''); - break; - - case 'transition delete': - case 'state delete': - case 'workflow delete': - // These hooks are removed in D8, in favour of the core hooks: - // - workflow_entity_predelete(EntityInterface $entity) - // - workflow_entity_delete(EntityInterface $entity) - // See examples at the bottom of this file. - break; - } - - return; -} - -/** - * Implements hook_workflow_history_alter(). - * - * In D8, hook_workflow_history_alter() is removed, in favour - * of ListBuilder::getDefaultOperations - * and hook_workflow_operations('workflow_transition'). - * - * Allow other modules to add Operations to the most recent history change. - * E.g., Workflow Revert implements an 'undo' operation. - * - * @param array $variables - * The current workflow history information as an array. - * 'old_sid' - The state ID of the previous state. - * 'old_state_name' - The state name of the previous state. - * 'sid' - The state ID of the current state. - * 'state_name' - The state name of the current state. - * 'history' - The row from the workflow_transition_history table. - * 'transition' - a WorkflowTransition object, containing all of the above. - */ -function hook_workflow_history_alter(array &$variables) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - - // The Workflow module does nothing with this hook. - // For an example implementation, see the Workflow Revert add-on. -} - -/** - * Implements hook_workflow_comment_alter(). - * - * Allow other modules to change the user comment when saving a state change. - * - * @param string $comment - * The comment of the current state transition. - * @param array $context - * 'transition' - The current transition itself. - */ -function hook_workflow_comment_alter(&$comment, array &$context) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - - /* @var $transition WorkflowTransitionInterface */ - $transition = $context['transition']; - //$comment = $transition->getOwner()->getUsername() . ' says: ' . $comment; -} - -/** - * Implements hook_workflow_permitted_state_transitions_alter(). - * - * @param array $transitions - * An array of allowed transitions from the current state (as provided in - * $context). They are already filtered by the settings in Admin UI. - * @param array $context - * An array of relevant objects. Currently: - * $context = array( - * 'user' => $user, - * 'workflow' => $workflow, - * 'state' => $current_state, - * 'force' => $force, - * ); - * - * This hook allows you to add custom filtering of allowed target states, add - * new custom states, change labels, etc. - * It is invoked in WorkflowState::getOptions(). - */ -function hook_workflow_permitted_state_transitions_alter(array &$transitions, array $context) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - - $user = $context['user']; // user may have the custom role AUTHOR. - // The following could be fetched from each transition. - $workflow = $context['workflow']; - $current_state = $context['state']; - // The following could be fetched from the $user and $transition objects. - $force = $context['force']; - - // Implement here own permission logic. - foreach ($transitions as $key => $transition) { - /* @var $transition WorkflowTransitionInterface */ - if (!$transition->isAllowed($user, $force)) { - //unset($transitions[$key]); - } - } - - // This example creates a new custom target state. - $values = [ - // Fixed values for new transition. - 'wid' => $context['workflow']->id(), - 'from_sid' => $context['state']->id(), - - // Custom values for new transition. - // The ID must be an integer, due to db-table constraints. - 'to_sid' => '998', - 'label' => 'go to my new fantasy state', - ]; - $new_transition = WorkflowConfigTransition::create($values); - // $transitions[] = $new_transition; -} - - -/********************************************************************** - * Hooks defined by core Form API: hooks to to alter the Workflow Form/Widget. - */ - -/** - * Alter forms for field widgets provided by other modules. - * - * @param $element - * The field widget form element as constructed by hook_field_widget_form(). - * @param $form_state - * An associative array containing the current state of the form. - * @param $context - * An associative array containing the following key-value pairs, matching the - * arguments received by hook_field_widget_form(): - * - form: The form structure to which widgets are being attached. This may be - * a full form structure, or a sub-element of a larger form. - * - field: The field structure. - * - instance: The field instance structure. - * - langcode: The language associated with $items. - * - items: Array of default values for this field. - * - delta: The order of this item in the array of subelements (0, 1, 2, etc). - * - * @see hook_field_widget_form() - * @see hook_field_widget_WIDGET_TYPE_form_alter() - */ -function hook_field_widget_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) { - // A hook for changing any widget. Better not use it: it is called on EVERY - // Widget. (Even though the message is only shown once.) - // D7: This hook is introduced in Drupal 7.8. - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - // dpm($context['widget']->getPluginId()); -} - -function hook_field_widget_workflow_default_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) { - // A hook specific for the 'workflow_default' widget. - // D7: This hook is introduced in Drupal 7.8. - // D8: This name is specified in the annotation of WorkflowDefaultWidget. - workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', ''); - - // A widget on an entity form. - if ('workflow_default' == $context['widget']->getPluginId()) { - // This object contains all you need. You may find it in one of two locations. - /* @var $transition WorkflowTransitionInterface */ - /* @var $transition WorkflowTransitionInterface */ - $transition = $element['#default_value']; - - // An example of customizing/overriding the workflow widget. - // Beware, until now, you must do this twice: on the widget and on the form. - if ($transition->getOwnerId() == 1) { - drupal_set_message('(Test/Devel message) I got you, user 1, you will never schedule again, - and you WILL document each state change!', 'warning'); - // Let's prohibit scheduling for user 1. - $element['workflow_scheduling']['#access'] = FALSE; - // Let's prohibit scheduling for user 1. - if ($element['comment']['#access'] == TRUE) { - $element['comment']['#required'] = TRUE; - } - } - } -} - -/** - * Implements hook_form_BASE_FORM_ID_alter(). - * - * Use this hook to alter the form. - * It is only suited if you only use View Page or Workflow Tab. - * If you change the state on the Entity Edit page (form), you need the hook - * hook_form_alter(). See below for more info. - */ -function hook_form_workflow_transition_form_alter(&$form, FormStateInterface $form_state, $form_id) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, $form_id, ''); - - // The WorkflowTransitionForm (E.g., Workflow History tab, Block). - // It has its own handling. - // @todo: Populate the WorkflowTransitionForm with a Widget, so we have 1 way-of-working. - - // Let's take a (changeable) reference to the element. - $workflow_element = &$form; - - // This object contains all you need. You may find it in one of two locations. - /* @var $transition WorkflowTransitionInterface */ - $transition = $form['workflow_transition']['#value']; - // dpm($transition); - - // An example of customizing/overriding the workflow widget. - // Beware, until now, you must do this twice: on the widget and on the form. - if ($transition->getOwnerId() == 1) { - drupal_set_message('(Test/Devel message) I got you, user 1, you will never schedule again, - and you WILL document each state change!', 'warning'); - // Let's prohibit scheduling for user 1. - $workflow_element['workflow_scheduling']['#access'] = FALSE; - // Let's prohibit scheduling for user 1. - if ( $workflow_element['comment']['#access'] == TRUE) { - $workflow_element['comment']['#required'] = TRUE; - } - } - - // Get the Entity. - /* @var $entity \Drupal\Core\Entity\EntityInterface */ - $entity = NULL; - //$entity = $form['workflow_entity']['#value']; - $entity_type = 'node'; // $form['workflow_entity_type']['#value']; - $entity_bundle = ''; // $entity->bundle(); - $sid = ''; - if ($entity) { - $entity_type = $entity->getEntityTypeId(); - $entity_bundle = $entity->bundle(); - - // Get the current State ID. - $sid = workflow_node_current_state($entity, $field_name = NULL); - // Get the State object, if needed. - $state = WorkflowState::load($sid); - } - - // Change the form, depending on the state ID. - // In the upcoming version 7.x-2.4, States should have a machine_name, too. - if ($entity_type == 'node' && $entity_bundle == 'MY_NODE_TYPE') { - switch ($sid) { - case '2': - // Change form element, form validate and form submit for state '2'. - break; - - case '3': - // Change form element, form validate and form submit for state '3'. - break; - } - } - -} - -/** - * Implements hook_form_alter(). - * - * Use this hook to alter the form on an Entity Form, Comment Form (Edit page). - * - * @see hook_form_workflow_transition_form_alter() for example code. - */ -function hook_form_alter(&$form, FormStateInterface $form_state, $form_id) { - if (substr($form_id, 0, 8) == 'workflow') { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, $form_id, ''); - } -} - - -/** - * Hooks defined by core Entity: hook_entity_CRUD. - * - * Instead of using hook_entity_OPERATION, better use hook_ENTITY_TYPE_OPERATION. - * - * @see hook_entity_create(), hook_entity_update(), etc. - * @see hook_ENTITY_TYPE_create(), hook_ENTITY_TYPE_update(), etc. - */ -function hook_entity_predelete(EntityInterface $entity) { - if (substr($entity->getEntityTypeId(), 0, 8) == 'workflow') { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'pre-delete' , $entity->getEntityTypeId()); - } - switch ($entity->getEntityTypeId()) { - case 'workflow_config_transition': - case 'workflow_state': - case 'workflow_type': - // Better use hook_ENTITY_TYPE_OPERATION. - // E.g., hook_workflow_type_predelete - break; - } -} - -function hook_entity_delete(EntityInterface $entity) { - if (substr($entity->getEntityTypeId(), 0, 8) == 'workflow') { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'delete' , $entity->getEntityTypeId()); - } -} - -function hook_workflow_type_delete(EntityInterface $entity) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'delete' , $entity->getEntityTypeId()); -} - -function hook_workflow_config_transition_delete(EntityInterface $entity) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'delete' , $entity->getEntityTypeId()); -} - -function hook_workflow_state_delete(EntityInterface $entity) { - // workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'delete' , $entity->getEntityTypeId()); -} diff --git a/sites/all/modules/contrib/admin/workflow/workflow.field.inc b/sites/all/modules/contrib/admin/workflow/workflow.field.inc deleted file mode 100644 index ba0a6e845..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.field.inc +++ /dev/null @@ -1,141 +0,0 @@ -getFormObject()->getEntity()->getType(); - - if ($field_name == 'workflow') { - // Make sure only 1 value can be entered in the Workflow field. - $form['cardinality_container']['cardinality']['#default_value'] = 'number'; - $form['cardinality_container']['cardinality']['#disabled'] = TRUE; - $form['cardinality_container']['cardinality_number']['#default_value'] = 1; - $form['cardinality_container']['cardinality_number']['#disabled'] = TRUE; - $form['cardinality_container']['cardinality_number']['#states'] = []; - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function workflow_form_field_config_edit_form_alter(&$form, - FormStateInterface $form_state, - /** @noinspection PhpUnusedParameterInspection */ $form_id) { - /** @noinspection PhpUndefinedMethodInspection */ - $field_name = $form_state->getFormObject()->getEntity()->getType(); - - if ($field_name == 'workflow') { - // The Workflow field must have a value, so set to required. - $form['required']['#default_value'] = 1; - $form['required']['#disabled'] = TRUE; - - // There are alterations on the widget, too. - // @see WorkflowDefaultWidget::formElement(); - } -} - -/** - * We will be using some default formatters and widgets from the List and Options modules. - */ - -/** - * Implements hook_field_formatter_info_alter(). - * - * The module reuses the formatters defined in list.module. - */ -function workflow_field_formatter_info_alter(&$info) { - $info['list_key']['field_types'][] = 'workflow'; - $info['list_default']['field_types'][] = 'workflow'; -} - -/** - * Implements hook_field_widget_info_alter(). - * - * The module does not implement widgets of its own, but reuses the - * widgets defined in options.module. - * - * @see workflow_options_list() - */ -function workflow_field_widget_info_alter(&$info) { - $info['options_select']['field_types'][] = 'workflow'; - $info['options_buttons']['field_types'][] = 'workflow'; -} - -/** - * Creates a form element to show the current value of a Workflow state. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity this field is on. - * @param string $field_name - * The field_name - * @param string $current_sid - * The current State Id. - * - * @return array - * Form element, resembling the formatter of List module. - * If state 0 is given, return an empty form element. - */ -function workflow_state_formatter($entity, $field_name, $current_sid = '') { - $element = []; - - if (!$current_sid) { - $current_sid = workflow_node_current_state($entity, $field_name); - } - // If user creates a node, and only 1 option is available, the formatter - // is shown with key, not value, because creation state does not count. - // In this case, hide the formatter. - /** @var \Drupal\workflow\Entity\WorkflowState $state */ - $state = \Drupal\workflow\Entity\WorkflowState::load($current_sid); - if ($state->isCreationState()) { - return $element; - } - // Clone the entity and restore old value, in case you want to show an - // executed transition. - if ($entity->{$field_name}->value != $current_sid) { - $entity = clone $entity; - $entity->{$field_name}->value = $current_sid; - } - // Generate a renderable array for the field. Use default language determination ($langcode = NULL). - // First, add the 'current value' formatter for this field. - // $list_display = $instance['display']['default']; - $list_display['type'] = 'list_default'; - $element = $entity->{$field_name}->view($list_display); - - // @todo D8: make weight better (even better: hook_field_extra_fields). - // Make sure the current value is before the form. (which has weight = 0.005) - // $element['#weight'] = 0; - - return $element; -} - -/** - * This function is a residue for installations that have v8.x-1.0 - * The setting for options_allowed_values is still in the Field configuration - * Saving the field data again does not remove the settings. - * So, we copy code from options_allowed_values(). - * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $definition - * - * @return mixed - */ -function workflow_state_allowed_values(\Drupal\Core\Field\FieldStorageDefinitionInterface $definition) { - $values = $definition->getSetting('allowed_values'); - return $values; -} diff --git a/sites/all/modules/contrib/admin/workflow/workflow.form.inc b/sites/all/modules/contrib/admin/workflow/workflow.form.inc deleted file mode 100644 index 384ae9bea..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.form.inc +++ /dev/null @@ -1,277 +0,0 @@ -getBuildInfo()['base_form_id']) && $form_state->getBuildInfo()['base_form_id'] == 'workflow_transition_form') { - // The WorkflowTransitionForm::actions() has its own handling. - // E.g., Workflow History tab, Block. - return; - } - - // Find the first workflow. - // (So this won't work with multiple workflows per entity.) - $workflow_element = _workflow_transition_form_get_first_workflow_element($form); - - // Quit if there is no Workflow on this page. - if (!$workflow_element ) { - return; - } - - // Quit if there are no Workflow Action buttons. - // (If user has only 1 workflow option, there are no Action buttons.) - if (count($workflow_element['to_sid']['#options']) <= 1) { - return; - } - - // Find the default submit button and replace with our own action buttons. - if (isset($form['actions']['submit'])) { - $default_submit_action = $form['actions']['submit']; - // @todo D8-port: on Node-form, this is not sufficient. - unset($form['actions']['submit']); - } - elseif (isset($form['actions']['save'])) { - $default_submit_action = $form['actions']['save']; - unset($form['actions']['save']); - } - else { - // @todo test: when does this happen? - $default_submit_action = []; - } - if (isset($default_submit_action)) { - $actions = _workflow_transition_form_get_action_buttons($form, $workflow_element, $default_submit_action); - // Place the button with the other action buttons. - $form['actions'] = isset($form['actions']) ? $form['actions'] : []; - $form['actions'] += $actions; - } -} - -/** - * Fetches the first workflow_element from one of the Workflow Fields. - * - * @param array $form - * - * @return array - */ -function _workflow_transition_form_get_first_workflow_element(&$form) { - $workflow_element = []; - - // Find the first workflow. - // (So this won't work with multiple workflows per entity.) - foreach (\Drupal\Core\Render\Element::children($form) as $key) { - if (isset($form[$key]['widget'][0]['#default_value'])) { - $transition = $form[$key]['widget'][0]['#default_value']; - if (is_object($transition) && $transition instanceof WorkflowTransitionInterface ) { - $workflow_element = $form[$key]['widget'][0]; - break; - } - } - } - return $workflow_element; -} - -/** - * Returns the action buttons from the options widget. - * - * @param array $form - * @param array $workflow_element - * @param array $default_submit_action - * - * @return array $actions - */ -function _workflow_transition_form_get_action_buttons(array $form, array $workflow_element, array $default_submit_action) { - $actions = []; - $current_sid = $workflow_element['to_sid']['#default_value']; - /* @var $transition WorkflowTransitionInterface */ - $transition = $workflow_element['workflow_transition']['#value']; - $field_name = $transition->getFieldName(); - - // Find the default submit button and add our action buttons before it. - // Get the min weight for our buttons. - $option_weight = isset($default_submit_action['#weight']) ? $default_submit_action['#weight'] : 0; - $option_weight = $option_weight - count($workflow_element['to_sid']['#options']); - $min_weight = $option_weight; - foreach ($workflow_element['to_sid']['#options'] as $sid => $option_name) { - // Make the workflow button act exactly like the original submit button. - - $same_state_button = ($sid == $current_sid); - $workflow_submit_action = $default_submit_action; - // Add target State ID and Field name, to set correct value in validate_buttons callback. - $workflow_submit_action['#workflow'] = [ - 'field_name' => $field_name, - 'to_sid' => $sid, - ]; - // Keep option order. Put current state first. - $workflow_submit_action['#weight'] = ($same_state_button) ? $min_weight : ++$option_weight; - // Add/Overwrite some other settings. - $workflow_submit_action['#access'] = TRUE; - $workflow_submit_action['#value'] = $option_name; - // Use one drop button, instead of several action buttons. - if ('dropbutton' == _workflow_use_action_buttons()) { - $workflow_submit_action['#dropbutton'] = 'save'; - } - $workflow_submit_action['#attributes'] = ($same_state_button) ? ['class' => ['form-save-default-button']] : []; - $workflow_submit_action['#button_type'] = ($same_state_button) ? 'primary' : ''; // @todo: works for node form and workflow tab, not for workflow block. - //$workflow_submit_action['#executes_submit_callback'] = TRUE; - // Add class to workflow button. - $workflow_submit_action['#attributes']['class'][] = Html::getClass('workflow_button_' . $option_name); - // Append the form's #validate function, or it won't be called upon submit, - // because the workflow buttons have its own #validate. - $workflow_submit_action['#validate'] = []; - $workflow_submit_action['#validate'][] = '_workflow_transition_form_validate_buttons'; - if (isset($default_submit_action['#validate'])) { - $workflow_submit_action['#validate'] = $default_submit_action['#validate']; - } - elseif (isset($form['#validate'])) { - $workflow_submit_action['#validate'] = $form['#validate']; - } - // Append the submit-buttons's #submit function, or it won't be called upon submit. - if (isset($default_submit_action['#submit'])) { - $workflow_submit_action['#submit'] = $default_submit_action['#submit']; - } - elseif (isset($form['#submit'])) { - $workflow_submit_action['#submit'] = $form['#submit']; - } - - // Hide the same-state button in some cases. - if ($same_state_button) { - if (isset($form['#form_id']) && substr($form['#form_id'], 0, 24) == 'workflow_transition_form') { - // Hide same-state-button on the transition-form (that is: - // view page or workflow history tab) if there is nothing to do. - // However, a Transition may be fieldable (have attached fields). - if ($form['comment']['#access'] == FALSE) { - $workflow_submit_action['#access'] = FALSE; - } - } - elseif (isset($form['#id']) && $form['#id'] == 'comment-form') { - // On comment-form, the button must stay, since you can comment to same state. - } - else { - // On a entity edit page, the button must stay. - } - } - - // Place the button with the other action buttons. - $actions['workflow_' . $sid] = $workflow_submit_action; - } - - return $actions; -} - -/** - * Get the Workflow parameter from the button, pressed by the user. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * @return array - * A $field_name => $to_sid array. - */ -function _workflow_transition_form_get_triggering_button(\Drupal\Core\Form\FormStateInterface $form_state) { - $result = ['field_name' => '', 'to_sid' => '']; - - $triggering_element = $form_state->getTriggeringElement(); - if (isset($triggering_element['#workflow'])) { - $result['field_name'] = $triggering_element['#workflow']['field_name']; - $result['to_sid'] = $triggering_element['#workflow']['to_sid']; - } - - return $result; -} - -/** - * Submit callback function for the Workflow Form / DefaultWidget. - * - * Validate form data for 'time' element. - * @param $element - * @param \Drupal\Core\Form\FormStateInterface $form_state - * @param $form - */ -function _workflow_transition_form_element_validate_time($element, \Drupal\Core\Form\FormStateInterface &$form_state, $form) { - if (!strtotime($element['#value'])) { - $form_state->setError($element, t('Please enter a valid value for time.')); - } -} - -/** - * Submit callback function for the Workflow Form / DefaultWidget. - * - * This is only used when using action buttons in the widget. - * It sets the new state to proper - * element and sets a submit function if needed, making sure the action is - * executed, influencing function core/includes/form.inc/form_execute_handlers(). - * (While constructing the Workflow form, we were not yet aware of the submit - * buttons of the complete form. We try to correct this here, without adding - * another hook_form_alter. We guess the first button is the Save button. - */ -function _workflow_transition_form_validate_buttons($form, \Drupal\Core\Form\FormStateInterface &$form_state) { - // Retrieve the data from the form. - $transition = $form_state->getValue('workflow_transition'); - if ($transition) { - // On WorkflowTransitionForm : - // D7: $form_state['input']['to_sid'] = $new_sid; - // D7: $form_state['values'][$field_name][$langcode][0]['to_sid'] = $new_sid; - - $values = $form_state->getValues(); - - $to_sid = $form_state->getTriggeringElement()['#workflow']['to_sid']; - $values['to_sid'] = $to_sid; - - // Update the form_state. - $form_state->setValues($values); - } - else { - // On edit form : See $form_state->getTriggeringElement() in WorkflowDefaultWidget; - } - -} diff --git a/sites/all/modules/contrib/admin/workflow/workflow.info.yml b/sites/all/modules/contrib/admin/workflow/workflow.info.yml deleted file mode 100644 index cc92fca74..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Workflow -type: module -description: 'Defines a field type with Workflows, containing customizable state transitions.' -package: Workflow -# core: 8.x - -dependencies: - - drupal:field - - drupal:options - - drupal:user - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-1.1+35-dev' -core: '8.x' -project: 'workflow' -datestamp: 1548801486 diff --git a/sites/all/modules/contrib/admin/workflow/workflow.install b/sites/all/modules/contrib/admin/workflow/workflow.install deleted file mode 100644 index 19b8b360f..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.install +++ /dev/null @@ -1,102 +0,0 @@ - 'edit-modules-workflow']); - $message = t('Thanks for using Workflow. To maintain workflows, - install the Workflow UI module. To start using - a Workflow, add a Workflow Field to your entity.', - [':url' => $url->toString()] - ); - drupal_set_message($message); -} - -/** - * Implements hook_requirements(). - * - * Let admins know that Workflow is in use. - * - * @todo: extend workflow_requirements() for use with Workflow Field API. - * - * @param $phase - * @return array - */ -function workflow_requirements($phase) { - $requirements = []; - switch ($phase) { - case 'install': - break; - - case 'update': - break; - - case 'runtime': -// workflow_debug(__FILE__), __FUNCTION__, __LINE__, $form_id); // @todo D8-port: still test this snippet. - - /* - // Show info on admin/reports/status. - $type_list = 'Not yet determined.'; - - // $types = db_query('SELECT wid, type FROM {workflow_type_map} WHERE wid <> 0 ORDER BY type')->fetchAllKeyed(); - // If there are no types, then just bail. - if (count($types) == 0) { - return; - } - // Let's make it look nice. - if (count($types) == 1) { - $type_list = current($types); - } else { - $last = array_pop($types); - if (count($types) > 2) { - $type_list = implode(', ', $types) . ', and ' . $last; - } else { - $type_list = current($types) . ' and ' . $last; - } - } - */ - - /* - $requirements['workflow'] = array( - 'title' => $t('Workflow'), - 'value' => $t('Workflow is active on the @types content types.', array('@types' => $type_list)), - 'severity' => REQUIREMENT_OK, - ); - */ - break; - - } - - return $requirements; -} - -/** - * Implements hook_schema(). - * - * The D8-schema's have moved to: - * - Workflow annotation (it is a Config Entity now); - * - WorkfowState annotation (it is a Config Entity now); - * - WorkfowConfigTransition annotation (it is a Config Entity now); - * - WorkflowTransition::baseFieldDefinitions(); - * - WorkflowScheduledTransition::baseFieldDefinitions(). - */ -function workflow_schema() { - return $schema = []; -} - -/** - * Drupal 8 updates. - */ - -/** - * Update from version beta1 to beta2 are not possible. Please re-install this module. - */ -function workflow_update_8001(&$sandbox) { - drupal_set_message("Update from version beta1 to beta2 is not possible. Please re-install this module."); -} diff --git a/sites/all/modules/contrib/admin/workflow/workflow.links.task.yml b/sites/all/modules/contrib/admin/workflow/workflow.links.task.yml deleted file mode 100644 index 0b5c25633..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.links.task.yml +++ /dev/null @@ -1,23 +0,0 @@ -#workflow.entities: -# class: \Drupal\Core\Menu\LocalTaskDefault -# deriver: \Drupal\workflow\Plugin\Derivative\WorkflowLocalTask - -#entity.workflow_type.canonical: -# route_name: entity.workflow_type.canonical -# base_route: entity.workflow_type.edit_form -# title: 'Edit' -# weight: -5 -entity.workflow_type.edit_form: - route_name: entity.workflow_type.canonical - base_route: entity.workflow_type.edit_form - title: 'Edit' - weight: -5 -entity.workflow_type.delete_form: - route_name: entity.workflow_type.delete_form - base_route: entity.workflow_type.edit_form - title: 'Delete' - weight: 10 - -workflow.entities: - deriver: 'Drupal\workflow\Plugin\Derivative\WorkflowLocalTask' - weight: 100 diff --git a/sites/all/modules/contrib/admin/workflow/workflow.module b/sites/all/modules/contrib/admin/workflow/workflow.module deleted file mode 100644 index 9c5285800..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.module +++ /dev/null @@ -1,774 +0,0 @@ -loadInclude('workflow', 'inc', 'workflow.form'); -\Drupal::moduleHandler()->loadInclude('workflow', 'inc', 'workflow.field'); - -/********************************************************************** - * Info hooks. - */ - -/** - * Implements hook_help(). - * - * @param string $route_name - * A route. - * - * @return string - * The html output. - */ -function workflow_help($route_name) { - $output = ''; - - switch ($route_name) { - case 'help.page.workflow': - $output .= '

    ' . t('About') . '

    '; - $output .= '

    ' . t('The Workflow module adds a field to Entities to - store field values as Workflow states. You can control "state transitions" - and add action to specific transitions.') . '

    '; - } - return $output; -} - -/** - * Implements hook_hook_info(). - * - * Allow adopters to place their hook implementations in either - * their main module or in a module.workflow.inc file. - */ -function workflow_hook_info() { - $hooks['workflow'] = ['group' => 'workflow']; - return $hooks; -} - -/********************************************************************** - * CRUD hooks. - */ - -/** - * Implements hook_user_cancel(). - * - * Update tables for deleted account, move account to user 0 (anon.) - * ALERT: This may cause previously non-Anonymous posts to suddenly - * be accessible to Anonymous. - * - * @param $edit - * @param \Drupal\Core\Session\AccountInterface $account - * An account object. - * @param string $method - * - * @see hook_user_cancel() - */ - -function workflow_user_cancel($edit, AccountInterface $account, $method) { - WorkflowManager::cancelUser($edit, $account, $method); -} - -/** - * Implements hook_user_delete(). - * - * @param \Drupal\Core\Session\AccountInterface $account - * An account object. - * - * @todo: hook_user_delete does not exist. hook_ENTITY_TYPE_delete? - */ -function workflow_user_delete($account) { - WorkflowManager::deleteUser($account); -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - * - * Is called when adding a new Workflow type. - * The technical name for the Workflow entity is 'workflow_type'. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An Entity. - */ -function workflow_workflow_type_insert(EntityInterface $entity) { - WorkflowManager::participateUserRoles($entity); -} - -/** - * Implements hook_entity_insert(). - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An Entity. - */ -function workflow_entity_insert(EntityInterface $entity) { - // Execute updates in hook_presave() to revert executions, - // Execute inserts in hook_insert, to have the Entity ID determined. - _workflow_execute_transitions($entity); -} - -/** - * Implements hook_entity_presave(). - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An EntityInterface object. - */ -function workflow_entity_presave(EntityInterface $entity) { - if (!$entity->isNew()) { - // Avoid a double call by hook_entity_presave and hook_entity_insert. - _workflow_execute_transitions($entity); - } -} - -/** - * Execute transitions. if prohibited, restore original field value. - * - insert: use hook_insert(), to have the Entity ID determined when saving transitions. - * - update: use hook_presave() to revert executions, - * - so, do not use hook_update(). - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An Entity. - */ -function _workflow_execute_transitions(EntityInterface $entity) { - // Avoid this hook on workflow objects. - if (WorkflowManager::isWorkflowEntityType($entity->getEntityTypeId())) { - return; - } - - // Execute/save the transitions fom the widgets in the entity form. - WorkflowManager::executeTransitionsOfEntity($entity); -} - -/** - * Implements hook_entity_delete(). - * - * Delete the corresponding workflow table records. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An Entity. - */ -function workflow_entity_delete(EntityInterface $entity) { - // @todo: test with multiple workflows. - if (get_class($entity) == 'Drupal\field\Entity\FieldConfig' - || get_class($entity) == 'Drupal\field\Entity\FieldStorageConfig') { - // A Workflow Field is removed from an entity. - $field_config = $entity; - /** @var \Drupal\Core\Entity\ContentEntityBase $field_config */ - $entity_type = $field_config->get('entity_type'); - $field_name = $field_config->get('field_name'); - /** @var $transition Drupal\workflow\Entity\WorkflowTransitionInterface */ - foreach (WorkflowScheduledTransition::loadMultipleByProperties($entity_type, [], [], $field_name) as $transition) { - $transition->delete(); - } - foreach (WorkflowTransition::loadMultipleByProperties($entity_type, [], [], $field_name) as $transition) { - $transition->delete(); - } - } - elseif (!WorkflowManager::isWorkflowEntityType($entity->getEntityTypeId())) { - // A 'normal' entity is deleted. - foreach ($fields = _workflow_info_fields($entity) as $field_id => $field_storage) { - $entity_id = $entity->id(); - $entity_type = $field_storage->getTargetEntityTypeId(); - $field_name = $field_storage->getName(); - /** @var $transition Drupal\workflow\Entity\WorkflowTransitionInterface */ - foreach (WorkflowScheduledTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name) as $transition) { - $transition->delete(); - } - foreach (WorkflowTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name) as $transition) { - $transition->delete(); - } - } - } -} - -/** - * Implements hook_cron(). - * - * Given a time frame, execute all scheduled transitions. - */ -function workflow_cron() { - WorkflowManager::executeScheduledTransitionsBetween(0, \Drupal::time()->getRequestTime()); -} - -/** - * Business related functions, the API. - */ - -/** - * @param \Drupal\workflow\Entity\WorkflowTransitionInterface $transition - * A WorkflowTransition. - * @param bool $force - * Indicator if the transition must be forces. - * - * @return string - * A string. - */ -function workflow_execute_transition(WorkflowTransitionInterface $transition, $force = FALSE) { - // Execute transition and update the attached entity. - return $transition->executeAndUpdateEntity($force); -} - -/** - * Functions to get an options list (to show in a Widget). - * To be used in non-OO modules, like workflow_rules, workflow_views. - * - * The naming convention is workflow_get__names. - * (A bit different from 'user_role_names'.) - * Can be used for hook_allowed_values from list.module: - * - user_role - * - workflow - * - workflow_state - * - sid. - */ - -/** - * Retrieves the names of roles matching specified conditions. - * - * Deprecated D8: workflow_get_roles --> workflow_get_user_role_names. - * - * Usage: - * D7: $roles = workflow_get_user_role_names('participate in workflow'); - * D8: $type_id = $workflow->id(); - * D8: $roles = workflow_get_user_role_names("create $type_id workflow_transition"); - * - * @param string $permission - * (optional) A string containing a permission. If set, only roles - * containing that permission are returned. Defaults to NULL, which - * returns all roles. - * Normal usage for filtering roles that are enabled in a workflow_type - * would be: $permission = 'create $type_id transition'. - * - * @return array - * Array of role names keyed by role ID, including the 'author' role. - */ -function workflow_get_user_role_names($permission) { - static $roles = NULL; - if ($roles[$permission]) { - return $roles[$permission]; - } - - // Copied from AccountForm::form(). - $roles[$permission] = array_map(['\Drupal\Component\Utility\Html', 'escape'], - [WORKFLOW_ROLE_AUTHOR_RID => '(' . t(WORKFLOW_ROLE_AUTHOR_NAME) . ')'] - + user_role_names(FALSE, $permission)); - - return $roles[$permission]; -} - -/** - * Get an options list for workflow states. - * - * @param mixed $wid - * The Workflow ID. - * @param bool $grouped - * Indicates if the value must be grouped per workflow. - * This influences the rendering of the select_list options. - * - * @return array - * An array of $sid => state->label(), grouped per Workflow. - */ -function workflow_get_workflow_state_names($wid = '', $grouped = FALSE) { - $options = []; - - // @todo: implement $add parameter. - // - // @todo: follow Options pattern - // @see callback_allowed_values_function() - // @see options_allowed_values() - - // Get the (user-dependent) options. - // Since this function is only used in UI, it is save to use the global $user. - $user = workflow_current_user(); - - /** @var $workflows Workflow[] */ - $workflows = Workflow::loadMultiple($wid ? [$wid] : NULL); - // Do not group if only 1 Workflow is configured or selected. - $grouped = count($workflows) == 1 ? FALSE : $grouped; - - foreach ($workflows as $wid => $workflow) { - /** @var $state WorkflowState */ - $state = WorkflowState::create(['wid' => $wid]); - $workflow_options = $state->getOptions(NULL, '', $user, FALSE); - if (!$grouped) { - $options += $workflow_options; - } - else { - // Make a group for each Workflow. - $options[$workflow->label()] = $workflow_options; - } - } - - return $options; -} - -/** - * Get an options list for workflows. Include an initial empty value - * if requested. Validate each workflow, and generate a message if not complete. - * - * @param bool $required - * Indicates if the resulting list contains a options value. - * - * @return array - * An array of $wid => workflow->label(). - */ -function workflow_get_workflow_names($required = TRUE) { - $options = []; - - if (!$required) { - $options[''] = t('- Select a value -'); - } - foreach (Workflow::loadMultiple() as $wid => $workflow) { - /** @var $workflow Workflow */ - if ($workflow->isValid()) { - $options[$wid] = $workflow->label(); - } - } - - return $options; -} - -/** - * Gets an Options list of field names. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An entity. - * @param string $entity_type - * An entity_type. - * @param string $entity_bundle - * An entity. - * @param string $field_name - * A field name. - * - * @return array - * An list of field names. - */ -function workflow_get_workflow_field_names(EntityInterface $entity = NULL, $entity_type = '', $entity_bundle = '', $field_name = '') { - $result = []; - foreach (_workflow_info_fields($entity, $entity_type, $entity_bundle, $field_name) as $definition) { - $field_name2 = $definition->getName(); - $result[$field_name2] = $field_name2; - } - return $result; -} - -/** - * Helper function, to get the label of a given State Id. - * deprecated: workflow_get_sid_label() --> workflow_get_sid_name() - * - * @param string $sid - * A State ID. - * - * @return string - * An translated label. - */ -function workflow_get_sid_name($sid) { - - if (empty($sid)) { - $label = 'No state'; - } - /** @noinspection PhpAssignmentInConditionInspection */ - elseif ($state = WorkflowState::load($sid)) { - $label = $state->label(); - } - else { - $label = 'Unknown state'; - } - return t($label); -} - -/** - * Determines the Workflow field_name of an entity. - * If an entity has multiple workflows, only returns the first one. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity at hand. - * @param string $field_name - * The field name. If given, will be passed as return value. - * - * @return string - * The found Field name. - */ -function workflow_get_field_name(EntityInterface $entity, $field_name = '') { - if (!$entity) { - // $entity may be empty on Entity Add page. - return ''; - } - - if ($field_name) { - return $field_name; - } - $fields = workflow_get_workflow_field_names($entity); - $field_name = reset($fields); - return $field_name; -} - -/** - * Functions to get the state of an entity. - */ - -/** - * Wrapper function to get a UserInterface object. - * We use UserInterface to check permissions. - * - * @param \Drupal\Core\Session\AccountInterface|null $account - * An Account. - * - * @return \Drupal\user\UserInterface - * A User. - */ -function workflow_current_user(AccountInterface $account = NULL) { - $account = ($account) ? $account : \Drupal::currentUser(); - return User::load($account->id()); -} - -/** - * Gets the current state ID of a given entity. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An entity. - * @param string $field_name - * A Field name. - * - * @return string - * The current State ID. - */ -function workflow_node_current_state(EntityInterface $entity, $field_name = '') { - return WorkflowManager::getCurrentStateId($entity, $field_name); -} - -/** - * Gets the previous state ID of a given entity. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An entity. - * @param string $field_name - * A field_name. - * - * @return string - * The previous State ID. - */ -function workflow_node_previous_state(EntityInterface $entity, $field_name = '') { - return WorkflowManager::getPreviousStateId($entity, $field_name); -} - -/** - * Get a specific workflow, given an entity type. - * Only one workflow is possible per node type. - * Caveat: gives undefined results with multiple workflows per entity. - * @todo: support multiple workflows per entity. - * - * @param string $entity_bundle - * An entity bundle. - * @param string $entity_type - * An entity type. This is passed when also the Field API must be checked. - * - * @return \Drupal\workflow\Entity\Workflow - * A Workflow object, or NULL if no workflow is retrieved. - */ -function workflow_get_workflows_by_type($entity_bundle, $entity_type) { - static $map = []; - - if (isset($map[$entity_type][$entity_bundle])) { - return $map[$entity_type][$entity_bundle]; - } - - $wid = FALSE; - if (isset($entity_type)) { - foreach (_workflow_info_fields(NULL, $entity_type, $entity_bundle) as $field_info) { - $wid = $field_info->getSetting('workflow_type'); - } - } - // Set the cache with a workflow object. - $map[$entity_type][$entity_bundle] = NULL; - if ($wid) { - $map[$entity_type][$entity_bundle] = Workflow::load($wid); - } - - return $map[$entity_type][$entity_bundle]; -} - -/** - * Finds the Workflow fields on a given Entity type. - * - * @return mixed - * - * @see EntityFieldManager::getFieldMapByFieldType - */ -function workflow_get_workflow_fields_by_entity_type() { - return \Drupal::service('entity_field.manager')->getFieldMapByFieldType('workflow'); -} - -/** - * Gets the workflow field names, if not known already. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * Object to work with. May be empty, e.g., on menu build. - * @param string $entity_type - * Entity type of object. Optional, but required if $entity provided. - * @param string $entity_bundle - * Bundle of entity. Optional. - * @param string $field_name - * Field name. Optional. - * - * @return Drupal\field\Entity\FieldStorageConfig[] - * An array of FieldStorageConfig objects. - */ -function _workflow_info_fields($entity = NULL, $entity_type = '', $entity_bundle = '', $field_name = '') { - $field_info = []; - - // Figure out the $entity's bundle and id. - if ($entity) { - $entity_type = $entity->getEntityTypeId(); - $entity_bundle = $entity->bundle(); - } - else { - // Entity type and bundle should be specified. - } - - $field_list = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('workflow'); - foreach ($field_list as $e_type => $data) { - if (!$entity_type || ($entity_type == $e_type)) { - foreach ($data as $f_name => $value) { - if (!$entity_bundle || isset($value['bundles'][$entity_bundle])) { - if (!$field_name || ($field_name == $f_name)) { - // Do not use the field_name as ID, but the - // unique . since you cannot share the - // same field on multiple entity_types (unlike D7). - $field_config = FieldStorageConfig::loadByName($e_type, $f_name); - if ($field_config) { - $field_info[$field_config->id()] = $field_config; - } - else { - // The field is a base/extra field. - // not a configurable Field via Field UI. - // Re-fetch the field definitions, with extra data. - $field_definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions($e_type, $entity_bundle); - // @todo: ?? Loop over bundles? - /** @var \Drupal\Core\Field\BaseFieldDefinition $field_config */ - $field_config = $field_definitions[$f_name]; - if ($field_config) { - $field_info[$field_config->getUniqueStorageIdentifier()] = $field_config; - } - else { - // @todo: ?? Loop over bundles? - } - } - } - } - } - } - } - return $field_info; -} - -/** - * Helper function to get the entity from a route. - * - * This is a hack. It should be solved by using $route_match. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * An optional entity. - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * A route. - * - * @return \Drupal\Core\Entity\EntityInterface - * Entity from the route. - */ -function workflow_url_get_entity(EntityInterface $entity = NULL, RouteMatchInterface $route_match = NULL) { - if ($entity) { - return $entity; - } - - if (!$route_match) { - $route_match = \Drupal::routeMatch(); - } - - $entities = []; - foreach ($route_match->getParameters() as $param) { - if ($param instanceof EntityInterface) { - $entities[] = $param; - } - } - $value = reset($entities); - - if ($value && is_object($value)) { - return $value; - } - - if ($value && !is_object($value)) { - // On workflow tab, we'd get an id. - // This is an indicator that the route is mal-configured. - workflow_debug(__FILE__, __FUNCTION__, __LINE__, 'route declaration is not optimal.'); - /* Return $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($value); */ - return NULL; - } - - return $value; -} - -/** - * Helper function to get the field name from a route. - * - * For now only used for ../{entity_id}/workflow history tab. - * - * @return string|null - * Return $field_name - */ -function workflow_url_get_field_name() { - return workflow_url_get_parameter('field_name'); -} - -/** - * Helper function to get the entity from a route. - * - * @return mixed|string - * Return $operation - */ -function workflow_url_get_operation() { - $url = Url::fromRoute(''); - // The last part of the path is the operation: edit, workflow, devel. - $url_parts = explode('/', $url->toString()); - $operation = array_pop($url_parts); - // Except for view pages. - if (is_numeric($operation) || $operation == 'view') { - $operation = ''; - } - return $operation; -} - -/** - * Helper function to get arbitrary parameter from a route. - * - * @param string $parameter - * The requested parameter. - * - * @return string - * field_name - */ -function workflow_url_get_parameter($parameter) { - return \Drupal::routeMatch()->getParameter($parameter); - // Return \Drupal::request()->get($parameter); -} - -/** - * Helper function to determine Workflow from Workflow UI URL. - * - * @return \Drupal\workflow\Entity\Workflow - * Workflow Object. - */ -function workflow_url_get_workflow() { - /** @var $workflows \Drupal\workflow\Entity\Workflow[] */ - static $workflows = []; - - $wid = workflow_url_get_parameter('workflow_type'); - if (is_object($wid)) { - // $wid is a Workflow object. - return $wid; - } - - if (!isset($workflows[$wid])) { - // $wid is a string. - $workflows[$wid] = $wid ? Workflow::load($wid) : NULL; - } - return $workflows[$wid]; -} - -/** - * Helper function to determine the title of the page. - * - * Used in file workflow_ui.routing.yml. - * - * @return \Drupal\Core\StringTranslation\TranslatableMarkup - * the page title. - */ -function workflow_url_get_title() { - $label = ''; - - // Get the Workflow from the page. - /** @var $workflow \Drupal\workflow\Entity\Workflow */ - /** @noinspection PhpAssignmentInConditionInspection */ - if ($workflow = workflow_url_get_workflow()) { - $label = $workflow->label(); - } - - $title = t('Edit @entity %label', ['@entity' => 'Workflow', '%label' => $label]); - return $title; -} - -/** - * Helper function to determine Workflow from Workflow UI URL. - * - * @param string $url - * URL. - * - * @return mixed - * the Workflow type. - */ -function workflow_url_get_form_type($url = '') { - // For some reason, $_SERVER is not allowed as default. - $url = ($url == '') ? $_SERVER['REQUEST_URI'] : $url; - - $base_url = '/config/workflow/workflow/'; - $string = substr($url, strpos($url, $base_url) + strlen($base_url)); - $type = explode('/', $string)[1]; - return $type; -} - -/** - * Helper function for D8-port: Get some info on screen. - * - * @param string $class_name - * @param string $function_name - * @param string $line_nr - * @param string $value1 - * @param string $value2 - * - * @see workflow_devel-module - * - * Usage: - * workflow_debug( __FILE__, __FUNCTION__, __LINE__, '', ''); - */ -function workflow_debug($class_name, $function_name, $line_nr = '', $value1 = '', $value2 = '') { - $debug_switch = FALSE; -// $debug_switch = TRUE; - - if (!$debug_switch) { - return; - } - - $class_name_elements = explode("\\", $class_name); - $output = 'Testing... function ' . end($class_name_elements) . '::' . $function_name . '/' . $line_nr; - if ($value1) { - $output .= ' = ' . $value1; - } - if ($value2) { - $output .= ' > ' . $value2; - } - drupal_set_message($output, 'warning', TRUE); -} diff --git a/sites/all/modules/contrib/admin/workflow/workflow.permissions.yml b/sites/all/modules/contrib/admin/workflow/workflow.permissions.yml deleted file mode 100644 index 83134605c..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.permissions.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Permissions are declared in Workflow (not Workflow UI) so other contrib -# modules can make use of it. - -administer workflow: - title: 'Administer workflows' - description: 'Administer all Workflow configurations and settings.' - restrict access: true - -permission_callbacks: - - \Drupal\workflow\WorkflowPermissions::workflowTypePermissions diff --git a/sites/all/modules/contrib/admin/workflow/workflow.routing.yml b/sites/all/modules/contrib/admin/workflow/workflow.routing.yml deleted file mode 100644 index 1ff93ad75..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.routing.yml +++ /dev/null @@ -1,111 +0,0 @@ -# All other routes for Workflow maintenance are declared in Workflow UI. - -### Workflow CRUD -entity.workflow_type.collection: - path: '/admin/config/workflow/workflow' - defaults: - _entity_list: 'workflow_type' -# _controller: '\workflow\EntityWorkflowUIController::adminOverview' - _title: 'Workflows' - requirements: - _permission: 'administer workflow' - -entity.workflow_type.canonical: - path: '/admin/config/workflow/workflow/{workflow_type}' - defaults: - _entity_form: 'workflow_type.edit' - _title: 'Edit Workflow' - _title_callback: 'workflow_url_get_title' - requirements: - _permission: 'administer workflow' -# _entity_access: 'workflow.update' - -entity.workflow_type.add_form: - path: '/admin/config/workflow/workflow/add' - defaults: - _entity_form: 'workflow_type.add' - _title: 'Add Workflow' - requirements: - _permission: 'administer workflow' -# _entity_access: 'workflow.update' - -entity.workflow_type.edit_form: - path: '/admin/config/workflow/workflow/{workflow_type}' - defaults: - _entity_form: 'workflow_type.edit' - _title: 'Edit Workflow' - _title_callback: 'workflow_url_get_title' - requirements: - _permission: 'administer workflow' -# _entity_access: 'workflow.update' - -entity.workflow_type.delete_form: - path: '/admin/config/workflow/workflow/{workflow_type}/delete' - defaults: - _entity_form: 'workflow_type.delete' - _title: 'Delete Workflow' - requirements: - _permission: 'administer workflow' -# _entity_access: 'workflow.update' - -### Workflow Executed Transition CRUD -entity.workflow_transition.canonical: - path: '/workflow_transition/{workflow_transition}' - defaults: - # Calls the view controller, defined in the annotation of the contact entity - # _entity_view: 'workflow_transition' - _title: 'Workflow transition' - #requirements: - # Calls the access controller of the entity, $operation 'view' - # _entity_access: 'workflow_transition.view' - -entity.workflow_transition.edit_form: - path: '/workflow_transition/{workflow_transition}/edit' - defaults: - _entity_form: 'workflow_transition.edit' - _title: 'Edit Workflow transition' - options: - _admin_route: TRUE - requirements: - _entity_access: 'workflow_transition.update' - -entity.workflow_transition.delete_form: - path: '/workflow_transition/{workflow_transition}/delete' - defaults: - _entity_form: 'workflow_transition.delete' - _title: 'Delete Workflow transition' - options: - _admin_route: TRUE - requirements: - _entity_access: 'workflow_transition.delete' - -### Workflow Scheduled Transition CRUD -entity.workflow_scheduled_transition.canonical: - path: '/workflow_transition/{workflow_transition}' - defaults: - # Calls the view controller, defined in the annotation of the contact entity - # _entity_view: 'workflow_transition' - _title: 'Workflow transition' - #requirements: - # Calls the access controller of the entity, $operation 'view' - # _entity_access: 'workflow_transition.view' - -entity.workflow_scheduled_transition.edit_form: - path: '/workflow_transition/{workflow_transition}/edit' - defaults: - _entity_form: 'workflow_transition.edit' - _title: 'Edit Workflow transition' - options: - _admin_route: TRUE - requirements: - _entity_access: 'workflow_transition.update' - -entity.workflow_scheduled_transition.delete_form: - path: '/workflow_transition/{workflow_transition}/delete' - defaults: - _entity_form: 'workflow_transition.delete' - _title: 'Delete Workflow transition' - options: - _admin_route: TRUE - requirements: - _entity_access: 'workflow_transition.delete' diff --git a/sites/all/modules/contrib/admin/workflow/workflow.services.yml b/sites/all/modules/contrib/admin/workflow/workflow.services.yml deleted file mode 100644 index fd75fc2fc..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.services.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - workflow.manager: - class: Drupal\workflow\Entity\WorkflowManager - arguments: ['@entity_type.manager', '@config.factory', '@string_translation', '@module_handler', '@current_user'] - - workflow.route_subscriber: - class: Drupal\workflow\Routing\RouteSubscriber - arguments: ['@entity.manager'] - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/admin/workflow/workflow.views.inc b/sites/all/modules/contrib/admin/workflow/workflow.views.inc deleted file mode 100644 index 172ee6a86..000000000 --- a/sites/all/modules/contrib/admin/workflow/workflow.views.inc +++ /dev/null @@ -1,86 +0,0 @@ -getSettings(); - - foreach ($data as $table_name => $table_data) { - foreach ($table_data as $field_name => $field_data) { - if ($field_name == 'delta') { - continue; - } - if (isset($field_data['filter'])) { - $data[$table_name][$field_name]['filter']['wid'] = (array_key_exists('workflow_type', $settings)) ? $settings['workflow_type'] : ''; - $data[$table_name][$field_name]['filter']['id'] = 'workflow_state'; - } - if (isset($field_data['argument'])) { - $data[$table_name][$field_name]['argument']['id'] = 'workflow_state'; - } - } - } - - return $data; -} - -/** - * Implements hook_views_data_alter(). - */ -function workflow_views_data_alter(array &$data) { - // Provide an integration for each entity type except workflow entities. - // Copied from comment.views.inc. - foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) { - if (WorkflowManager::isWorkflowEntityType($entity_type_id)) { - continue; - } - if (!$entity_type->entityClassImplements(ContentEntityInterface::class)) { - continue; - } - if (!$entity_type->getBaseTable()) { - continue; - } - - $fields = \Drupal::service('workflow.manager')->getFields($entity_type_id); - if ($fields) { - $base_table = $entity_type->getDataTable() ?: $entity_type->getBaseTable(); - $args = ['@entity_type' => $entity_type_id]; - foreach ($fields as $field_name => $field) { - $data[$base_table][$field_name . '_tid'] = [ - 'title' => t('Workflow transitions on @entity_type using field: @field_name', $args + ['@field_name' => $field_name]), - 'help' => t('Relate all transitions ongit status @entity_type. This will create 1 duplicate record for every transition. Usually if you need this it is better to create a Transition view.', $args), - 'relationship' => [ - 'group' => t('Workflow transition'), - 'label' => t('workflow transition'), - 'base' => 'workflow_transition_history', - 'base field' => 'entity_id', - 'relationship field' => $entity_type->getKey('id'), - 'id' => 'standard', - 'extra' => [ - [ - 'field' => 'entity_type', - 'value' => $entity_type_id, - ], - [ - 'field' => 'field_name', - 'value' => $field_name, - ], - ], - ], - ]; - } - } - } -} diff --git a/sites/all/modules/contrib/dev/config_devel/LICENSE.txt b/sites/all/modules/contrib/dev/config_devel/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/config_devel/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/config_devel/composer.json b/sites/all/modules/contrib/dev/config_devel/composer.json deleted file mode 100644 index e298e1e46..000000000 --- a/sites/all/modules/contrib/dev/config_devel/composer.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "drupal/config_devel", - "description": "Helps developers work with configuration.", - "type": "drupal-module", - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": { } -} diff --git a/sites/all/modules/contrib/dev/config_devel/config/install/config_devel.settings.yml b/sites/all/modules/contrib/dev/config_devel/config/install/config_devel.settings.yml deleted file mode 100644 index ee63214b3..000000000 --- a/sites/all/modules/contrib/dev/config_devel/config/install/config_devel.settings.yml +++ /dev/null @@ -1,2 +0,0 @@ -auto_import: [] -auto_export: [] diff --git a/sites/all/modules/contrib/dev/config_devel/config/schema/config_devel.schema.yml b/sites/all/modules/contrib/dev/config_devel/config/schema/config_devel.schema.yml deleted file mode 100644 index e7b242e53..000000000 --- a/sites/all/modules/contrib/dev/config_devel/config/schema/config_devel.schema.yml +++ /dev/null @@ -1,23 +0,0 @@ -config_devel.settings: - type: config_object - label: config devel settings - mapping: - auto_import: - type: sequence - sequence: - - type: mapping - mapping: - filename: - type: string - hash: - type: string - auto_export: - type: sequence - sequence: - - type: string -config_devel.test: - type: config_object - label: config devel test - mapping: - label: - type: label diff --git a/sites/all/modules/contrib/dev/config_devel/config_devel.info.yml b/sites/all/modules/contrib/dev/config_devel/config_devel.info.yml deleted file mode 100644 index 7a471b680..000000000 --- a/sites/all/modules/contrib/dev/config_devel/config_devel.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Configuration development module -type: module -description: 'Helps developers work with configuration.' -package: Configuration -# version: VERSION -# core: 8.x -configure: config_devel.settings - -# Information added by Drupal.org packaging script on 2017-11-16 -version: '8.x-1.2' -core: '8.x' -project: 'config_devel' -datestamp: 1510843086 diff --git a/sites/all/modules/contrib/dev/config_devel/config_devel.links.menu.yml b/sites/all/modules/contrib/dev/config_devel/config_devel.links.menu.yml deleted file mode 100644 index 2aa34616b..000000000 --- a/sites/all/modules/contrib/dev/config_devel/config_devel.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -config_devel.settings: - title: Config devel - description: 'Specify which configuration objects to automatically import/export.' - route_name: config_devel.settings - parent: system.admin_config_development diff --git a/sites/all/modules/contrib/dev/config_devel/config_devel.routing.yml b/sites/all/modules/contrib/dev/config_devel/config_devel.routing.yml deleted file mode 100644 index 7a416ea34..000000000 --- a/sites/all/modules/contrib/dev/config_devel/config_devel.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -config_devel.settings: - path: '/admin/config/development/config_devel' - defaults: - _form: 'Drupal\config_devel\Form\ConfigDevelSettingsForm' - _title: 'Config Devel' - requirements: - _permission: 'import configuration' diff --git a/sites/all/modules/contrib/dev/config_devel/config_devel.services.yml b/sites/all/modules/contrib/dev/config_devel/config_devel.services.yml deleted file mode 100644 index ec7c0bb1f..000000000 --- a/sites/all/modules/contrib/dev/config_devel/config_devel.services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - config_devel.writeback_subscriber: - class: Drupal\config_devel\EventSubscriber\ConfigDevelAutoExportSubscriber - arguments: ['@config.factory', '@config.manager', '@event_dispatcher'] - tags: - - { name: event_subscriber } - config_devel.auto_import_subscriber: - class: Drupal\config_devel\EventSubscriber\ConfigDevelAutoImportSubscriber - arguments: ['@config.factory', '@config.manager'] - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/dev/config_devel/drush.services.yml b/sites/all/modules/contrib/dev/config_devel/drush.services.yml deleted file mode 100644 index 5d75b380d..000000000 --- a/sites/all/modules/contrib/dev/config_devel/drush.services.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - config_devel.commands: - class: \Drupal\config_devel\Commands\ConfigDevelCommands - arguments: - - '@module_handler' - - '@theme_handler' - - '@info_parser' - - '@config.factory' - - '@config_devel.writeback_subscriber' - - '@config_devel.auto_import_subscriber' - - '@file_system' - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/dev/config_devel/drush/config_devel.drush.inc b/sites/all/modules/contrib/dev/config_devel/drush/config_devel.drush.inc deleted file mode 100644 index fc3244abd..000000000 --- a/sites/all/modules/contrib/dev/config_devel/drush/config_devel.drush.inc +++ /dev/null @@ -1,258 +0,0 @@ - "Write back configuration to module's config directory.\n" . $description, - 'arguments' => array( - 'module' => 'Module machine name.', - ), - 'options' => array( - ), - 'required-arguments' => TRUE, - 'examples' => array( - 'drush config-devel-export MODULE_NAME' => 'Write back configuration to the specified module, based on .info file.', - ), - 'aliases' => array('cde', 'cd-em'), - ); - - $items['config-devel-import'] = array( - 'description' => "Import configuration from module's config directory to active storage.\n" . $description, - 'arguments' => array( - 'module' => 'Module machine name.', - ), - 'options' => array( - ), - 'required-arguments' => TRUE, - 'examples' => array( - 'drush config-devel-import MODULE_NAME' => 'Import configuration from the specified module into the active storage, based on .info file.', - ), - 'aliases' => array('cdi', 'cd-im'), - ); - - $items['config-devel-import-one'] = array( - 'description' => "Import a single configuration item from module's config directory to active storage.\n" . $description, - 'arguments' => array( - 'path' => 'Config file name.', - ), - 'options' => array( - ), - 'required-arguments' => TRUE, - 'examples' => array( - 'drush config-devel-import-one system.site.yml' => 'Import the contents of system.site.yml into the config object system.site.', - 'drush config-devel-import-one system.site' => 'Import the standard input into the config object system.site. Helpful for scripting copying to remote', - ), - 'aliases' => array('cdi1', 'cd-i1'), - ); - - return $items; -} - -/** - * Drush command callback. - */ -function drush_config_devel_export($extension) { - // Determine the type of extension we're dealing with. - $type = drush_config_devel_get_type($extension); - - if ($type) { - // Get the config - $config = drush_config_devel_get_config($type, $extension); - - // Process config - if (isset($config['install'])) { - drush_config_devel_process_config($config['install'], $type, $extension, InstallStorage::CONFIG_INSTALL_DIRECTORY); - } - - // If we have any optional configuration, process that as well. - if (isset($config['optional'])) { - drush_config_devel_process_config($config['optional'], $type, $extension, InstallStorage::CONFIG_OPTIONAL_DIRECTORY); - } - } - else { - drush_set_error("Couldn't export configuration. The '$extension' extension is not enabled."); - } -} - -/** - * Drush command callback. - */ -function drush_config_devel_import($extension) { - // Determine the type of extension we're dealing with. - $type = drush_config_devel_get_type($extension); - - if ($type) { - // Get the config - $config = drush_config_devel_get_config($type, $extension); - - // Import config - if (isset($config['install'])) { - drush_config_devel_import_config($config['install'], $type, $extension, InstallStorage::CONFIG_INSTALL_DIRECTORY); - } - - // Import optional config - if (isset($config['optional'])) { - drush_config_devel_import_config($config['optional'], $type, $extension, InstallStorage::CONFIG_OPTIONAL_DIRECTORY); - } - } - else { - drush_set_error("Couldn't import configuration. The '$extension' extension is not enabled."); - } -} - -/** - * Drush command callback. - */ -function drush_config_devel_import_one($path) { - $contents = ''; - if (!file_exists($path)) { - if (substr($path, -4) != '.yml') { - $contents = file_get_contents('php://stdin'); - } - elseif (!empty($_SERVER['PWD'])) { - $path = $_SERVER['PWD'] . '/' . trim($path, '/'); - } - } - if ($contents || file_exists($path)) { - \Drupal::service('config_devel.auto_import_subscriber')->importOne($path, '', $contents); - } - else { - drush_log("file '$path' not found", 'error'); - exit; - } -} - -/** - * Exports a list of configuration entities. - * - * @param array $config_list - * An array of configuration entities. - * @param string $type - * The type of extension we're exporting, one of module or theme. - * @param string $extension - * The module, theme or install profile we're exporting. - * @param string $directory - * The directory we're exporting to. - * - * @return bool - * TRUE when the configuration was successfully exported. FALSE otherwise. - */ -function drush_config_devel_process_config($config_list, $type, $extension, $directory) { - $config_path = drupal_get_path($type, $extension) . "/$directory"; - - // Ensure the directory always exists. - if (!file_exists($config_path) && !\Drupal::service('file_system')->mkdir($config_path, NULL, TRUE)) { - drush_set_error('CONFIG_DEVEL_DIRECTORY_NOT_CREATED', sprintf('The %s directory could not be created', $config_path)); - return FALSE; - } - - foreach ($config_list as $name) { - $config = \Drupal::config($name); - $file_names = array($config_path . '/' . $name . '.yml'); - - \Drupal::service('config_devel.writeback_subscriber')->writeBackConfig($config, $file_names); - } - - return TRUE; -} - -/** - * Imports a list of configuration entities - * - * @param array $config_list - * An array of configuration entities. - * @param string $type - * The type of extension we're exporting, one of module or theme. - * @param string $extension - * The module, theme or install profile we're exporting. - * @param string $directory - * The directory we're exporting to. - */ -function drush_config_devel_import_config($config_list, $type, $extension, $directory) { - $config_path = drupal_get_path($type, $extension) . "/$directory"; - foreach ($config_list as $name) { - $file_name = $config_path . '/' . $name . '.yml'; - drush_config_devel_import_one($file_name); - } -} - -/** - * Gets the config. - * - * @param string $type - * module, theme or profile - * @param string $extension - * extension name - * @return array - * An array containing install and optional config - */ -function drush_config_devel_get_config($type, $extension) { - $filename = drupal_get_path($type, $extension) . '/' . $extension .'.info.yml'; - $info = \Drupal::service('info_parser')->parse($filename); - - $config = array(); - if (isset($info['config_devel'])) { - // Keep backwards compatibility for the old format. This has config names - // listed directly beneath 'config_devel', rather than an intermediate level - // for 'install' and 'optional'. - // Detect the old format based on whether there's neither of these two keys. - if (!isset($info['config_devel']['install']) && !isset($info['config_devel']['optional'])) { - $info['config_devel']['install'] = $info['config_devel']; - } - - $config['install'] = $info['config_devel']['install']; - - // If we have any optional configuration, fetch that as well. - if (isset($info['config_devel']['optional'])) { - $config['optional'] = $info['config_devel']['optional']; - } - } - - return $config; -} - -/** - * Gets the type for the given extension. - * - * @param string $extension - * extension name - * @return string - * module, theme, profile, or FALSE if no valid extension provided. - */ -function drush_config_devel_get_type($extension) { - $type = NULL; - if (\Drupal::moduleHandler()->moduleExists($extension)) { - $type = 'module'; - } - elseif (\Drupal::service('theme_handler')->themeExists($extension)) { - $type = 'theme'; - } - elseif (drupal_get_profile() === $extension) { - $type = 'profile'; - } - - return $type; -} diff --git a/sites/all/modules/contrib/dev/config_devel/src/Commands/ConfigDevelCommands.php b/sites/all/modules/contrib/dev/config_devel/src/Commands/ConfigDevelCommands.php deleted file mode 100644 index 8d074d181..000000000 --- a/sites/all/modules/contrib/dev/config_devel/src/Commands/ConfigDevelCommands.php +++ /dev/null @@ -1,353 +0,0 @@ -moduleHandler = $moduleHandler; - $this->themeHandler = $themeHandler; - $this->infoParser = $infoParser; - $this->configFactory = $configFactory; - // @todo We should not depend on event subscribers directly. - // @see https://www.drupal.org/node/2388253 - $this->autoExportSubscriber = $autoExportSubscriber; - $this->autoImportSubscriber = $autoImportSubscriber; - $this->fileSystem = $fileSystem; - } - - /** - * Write back configuration to module's config directory. - * - * List which configuration settings you want to export in the module's info - * file by listing them under 'config_devel', as shown below: - * - * config_devel: - * install: - * - entity.view_display.node.article.default - * - entity.view_display.node.article.teaser - * - field.instance.node.article.body - * optional: - * - field.instance.node.article.tags - * - * @command config-devel-export - * @param string $extension Machine name of the module, profile or theme to export. - * @usage drush config-devel-export MODULE_NAME - * Write back configuration to the specified module, based on .info file. - * @aliases cde,cd-em - * - * @throws \Exception - * Thrown when the passed in extension - */ - public function export($extension) { - // Determine the type of extension we're dealing with. - $type = $this->getExtensionType($extension); - - if (!$type) { - throw new \Exception("Couldn't export configuration. The '$extension' extension is not enabled."); - } - - // Get the config. - $config = $this->getExtensionConfig($type, $extension); - - // Export the required config. - if (isset($config['install'])) { - $this->exportConfig($config['install'], $type, $extension, InstallStorage::CONFIG_INSTALL_DIRECTORY); - } - - // If we have any optional configuration, export that as well. - if (isset($config['optional'])) { - $this->exportConfig($config['optional'], $type, $extension, InstallStorage::CONFIG_OPTIONAL_DIRECTORY); - } - } - - /** - * Import configuration from module's config directory to active storage. - * - * List which configuration settings you want to export in the module's info - * file by listing them under 'config_devel', as shown below: - * - * config_devel: - * install: - * - entity.view_display.node.article.default - * - entity.view_display.node.article.teaser - * - field.instance.node.article.body - * optional: - * - field.instance.node.article.tags - * - * @command config-devel-import - * @param string $extension Machine name of the module, profile or theme. - * @usage drush config-devel-import MODULE_NAME - * Import configuration from the specified module, profile or theme into the active storage, based on .info file. - * @aliases cdi,cd-im - * - * @throws \Exception - * Thrown when the passed in extension is not enabled. - */ - public function import($extension) { - // Determine the type of extension we're dealing with. - $type = $this->getExtensionType($extension); - - if (!$type) { - throw new \Exception("Couldn't import configuration. The '$extension' extension is not enabled."); - } - - // Get the config - $config = $this->getExtensionConfig($type, $extension); - - // Import config - if (isset($config['install'])) { - $this->importConfig($config['install'], $type, $extension, InstallStorage::CONFIG_INSTALL_DIRECTORY); - } - - // Import optional config - if (isset($config['optional'])) { - $this->importConfig($config['optional'], $type, $extension, InstallStorage::CONFIG_OPTIONAL_DIRECTORY); - } - } - - /** - * Import a single config item into active storage. - * - * List which configuration settings you want to export in the module's info - * file by listing them under 'config_devel', as shown below: - * - * config_devel: - * install: - * - entity.view_display.node.article.default - * - entity.view_display.node.article.teaser - * - field.instance.node.article.body - * optional: - * - field.instance.node.article.tags - * - * @command config-devel-import-one - * @param string $path Config file name. - * @usage drush config-devel-import-one system.site.yml - * Import the contents of system.site.yml into the config object system.site. - * @usage drush config-devel-import-one system.site - * Import the standard input into the config object system.site. Helpful for scripting copying to remote. - * @aliases cdi1,cd-i1 - * - * @throws \Exception - * Thrown when the given file was not found. - */ - public function importSingle($path) { - $contents = ''; - if (!file_exists($path)) { - if (substr($path, -4) != '.yml') { - $contents = file_get_contents('php://stdin'); - } - elseif (!empty($_SERVER['PWD'])) { - $path = $_SERVER['PWD'] . '/' . trim($path, '/'); - } - } - if ($contents || file_exists($path)) { - $this->autoImportSubscriber->importOne($path, '', $contents); - } - else { - throw new \Exception("File '$path' not found."); - } - } - - /** - * Returns the type for the given extension. - * - * @param string $extension - * The extension name. - * - * @return string - * Either 'module', 'theme', 'profile', or NULL if no valid extension was - * provided. - */ - protected function getExtensionType($extension) { - $type = NULL; - - if ($this->moduleHandler->moduleExists($extension)) { - $type = 'module'; - } - elseif ($this->themeHandler->themeExists($extension)) { - $type = 'theme'; - } - elseif (\Drupal::installProfile() === $extension) { - $type = 'profile'; - } - - return $type; - } - - /** - * Returns the config for the given extension. - * - * @param string $type - * Either 'module', 'theme' or 'profile'. - * @param string $extension - * The name of the extension for which to return the config. - * - * @return array - * An array containing install and optional config. - */ - protected function getExtensionConfig($type, $extension) { - $filename = drupal_get_path($type, $extension) . '/' . $extension .'.info.yml'; - $info = $this->infoParser->parse($filename); - - $config = []; - if (isset($info['config_devel'])) { - // Keep backwards compatibility for the old format. This has config names - // listed directly beneath 'config_devel', rather than an intermediate - // level for 'install' and 'optional'. - // Detect the old format based on whether there's neither of these two - // keys. - if (!isset($info['config_devel']['install']) && !isset($info['config_devel']['optional'])) { - $info['config_devel']['install'] = $info['config_devel']; - } - - $config['install'] = $info['config_devel']['install']; - - // If we have any optional configuration, fetch that as well. - if (isset($info['config_devel']['optional'])) { - $config['optional'] = $info['config_devel']['optional']; - } - } - - return $config; - } - - /** - * Exports a list of configuration entities. - * - * @param array $config_list - * An array of configuration entities. - * @param string $type - * The type of extension we're exporting, one of 'module', 'profile' or - * 'theme'. - * @param string $extension - * The name of the extension we're exporting. - * @param string $directory - * The directory we're exporting to. - * - * @throws \Exception - * Thrown when the directory to export to is missing and could not be - * created. - */ - protected function exportConfig($config_list, $type, $extension, $directory) { - $config_path = drupal_get_path($type, $extension) . "/$directory"; - // Ensure the directory always exists. - if (!file_exists($config_path) && !$this->fileSystem->mkdir($config_path, NULL, TRUE)) { - throw new \Exception(sprintf('The %s directory could not be created', $config_path)); - } - - foreach ($config_list as $name) { - $config = $this->configFactory->get($name); - $file_names = [$config_path . '/' . $name . '.yml']; - $this->autoExportSubscriber->writeBackConfig($config, $file_names); - } - } - - /** - * Imports a list of configuration entities. - * - * @param array $config_list - * An array of configuration entities. - * @param string $type - * The type of extension we're importing, one of 'module'. 'profile' or - * 'theme'. - * @param string $extension - * The module, theme or install profile we're importing. - * @param string $directory - * The directory we're importing. - */ - protected function importConfig($config_list, $type, $extension, $directory) { - $config_path = drupal_get_path($type, $extension) . "/$directory"; - foreach ($config_list as $name) { - $file_name = $config_path . '/' . $name . '.yml'; - $this->importSingle($file_name); - } - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/src/Event/ConfigDevelEvents.php b/sites/all/modules/contrib/dev/config_devel/src/Event/ConfigDevelEvents.php deleted file mode 100644 index 3ee19651a..000000000 --- a/sites/all/modules/contrib/dev/config_devel/src/Event/ConfigDevelEvents.php +++ /dev/null @@ -1,26 +0,0 @@ -fileNames = $file_names; - $this->data = $data; - } - - /** - * Gets the filenames that will be saved. - * - * @return array - * An array of file names. - */ - public function getFileNames() { - return $this->fileNames; - } - - /** - * Sets the file names. - * - * @param array $file_names - * An array of file names to be written out - */ - public function setFileNames(array $file_names) { - $this->fileNames = $file_names; - } - - /** - * Gets the data representing the config object. - * - * @return array - * An array of config data. - */ - public function getData() { - return $this->data; - } - - /** - * Sets the data for the config object. - * - * @param array $data - * The config data. - */ - public function setData(array $data) { - $this->data = $data; - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoExportSubscriber.php b/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoExportSubscriber.php deleted file mode 100644 index 51cc8aa41..000000000 --- a/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoExportSubscriber.php +++ /dev/null @@ -1,136 +0,0 @@ -configFactory = $config_factory; - $this->configManager = $config_manager; - $this->eventDispatcher = $event_dispatcher; - } - - /** - * The files to automatically export. - * - * @var array - */ - protected $autoExportFiles; - - /** - * React to configuration ConfigEvent::SAVE events. - * - * @param \Drupal\Core\Config\ConfigCrudEvent $event - * The event to process. - */ - public function onConfigSave(ConfigCrudEvent $event) { - $this->autoExportConfig($event->getConfig()); - } - - /** - * React to configuration ConfigEvent::RENAME events. - * - * @param \Drupal\Core\Config\ConfigRenameEvent $event - * The event to process. - */ - public function onConfigRename(ConfigRenameEvent $event) { - $this->autoExportConfig($event->getConfig()); - } - - /** - * Automatically export configuration. - * - * @param Config $config - * The config object. - */ - protected function autoExportConfig(Config $config) { - $config_name = $config->getName(); - $file_names = array_filter($this->getSettings()->get('auto_export') ?: [], function ($file_name) use ($config_name) { - return basename($file_name, '.' . FileStorage::getFileExtension()) == $config_name; - }); - $this->writeBackConfig($config, $file_names); - } - - /** - * write configuration back to files. - * - * @param \Drupal\Core\Config\Config $config - * The config object. - * @param array $file_names - * The file names to which the configuration should be written. - */ - public function writeBackConfig(Config $config, array $file_names) { - if ($file_names) { - $data = $config->get(); - $config_name = $config->getName(); - unset($data['_core']); - if ($entity_type_id = $this->configManager->getEntityTypeIdByName($config_name)) { - unset($data['uuid']); - } - - // Let everyone else have a change to update the exported data. - $event = new ConfigDevelSaveEvent($file_names, $data); - $this->eventDispatcher->dispatch(ConfigDevelEvents::SAVE, $event); - $data = $event->getData(); - $file_names = $event->getFileNames(); - - foreach ($file_names as $file_name) { - try { - file_put_contents($file_name, (new InstallStorage())->encode($data)); - } - catch (DumpException $e) { - // Do nothing. What could we do? - } - } - } - } - - /** - * Registers the methods in this class that should be listeners. - * - * @return array - * An array of event listener definitions. - */ - static function getSubscribedEvents() { - $events[ConfigEvents::SAVE][] = array('onConfigSave', 10); - $events[ConfigEvents::RENAME][] = array('onConfigRename', 10); - return $events; - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoImportSubscriber.php b/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoImportSubscriber.php deleted file mode 100644 index 54f60d8d4..000000000 --- a/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelAutoImportSubscriber.php +++ /dev/null @@ -1,83 +0,0 @@ -getSettings(); - $changed = FALSE; - foreach ($config->get('auto_import') as $key => $file) { - if ($new_hash = $this->importOne($file['filename'], $file['hash'])) { - $config->set("auto_import.$key.hash", $new_hash); - $changed = TRUE; - } - } - if ($changed) { - $config->save(); - } - } - - /** - * Registers the methods in this class that should be listeners. - * - * @return array - * An array of event listener definitions. - */ - static function getSubscribedEvents() { - $events[KernelEvents::REQUEST][] = array('autoImportConfig', 20); - return $events; - } - - /** - * @param string $filename - * @param string $original_hash - * @return bool - */ - public function importOne($filename, $original_hash = '', $contents = '') { - $hash = ''; - if (!$contents && (!$contents = @file_get_contents($filename))) { - return $hash; - } - $needs_import = TRUE; - if ($original_hash) { - $hash = Crypt::hashBase64($contents); - if ($hash == $original_hash) { - $needs_import = FALSE; - } - } - if ($needs_import) { - $data = (new InstallStorage())->decode($contents); - $config_name = basename($filename, '.yml'); - $entity_type_id = $this->configManager->getEntityTypeIdByName($config_name); - if ($entity_type_id) { - $entity_storage = $this->getStorage($entity_type_id); - $entity_id = $this->getEntityId($entity_storage, $config_name); - $entity_type = $entity_storage->getEntityType(); - $id_key = $entity_type->getKey('id'); - $data[$id_key] = $entity_id; - /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ - $entity = $entity_storage->create($data); - if ($existing_entity = $entity_storage->load($entity_id)) { - $entity - ->set('uuid', $existing_entity->uuid()) - ->enforceIsNew(FALSE); - } - $entity_storage->save($entity); - } - else { - $this->configFactory->getEditable($config_name)->setData($data)->save(); - } - } - return $hash; - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelSubscriberBase.php b/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelSubscriberBase.php deleted file mode 100644 index 027f99df9..000000000 --- a/sites/all/modules/contrib/dev/config_devel/src/EventSubscriber/ConfigDevelSubscriberBase.php +++ /dev/null @@ -1,66 +0,0 @@ -configFactory = $config_factory; - $this->configManager = $config_manager; - } - - /** - * @param string $entity_type_id - * - * @return \Drupal\Core\Config\Entity\ConfigEntityStorageInterface - */ - protected function getStorage($entity_type_id) { - return $this->configManager->getEntityManager()->getStorage($entity_type_id); - } - - /** - * @param \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $entity_storage - * @param string $config_name - * - * @return string - */ - protected function getEntityId(ConfigEntityStorageInterface $entity_storage, $config_name) { - // getIDFromConfigName adds a dot but getConfigPrefix has a dot already. - return $entity_storage::getIDFromConfigName($config_name, $entity_storage->getEntityType()->getConfigPrefix()); - } - - /** - * @return \Drupal\Core\Config\Config - */ - protected function getSettings() { - return $this->configFactory->getEditable('config_devel.settings'); - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/src/Form/ConfigDevelSettingsForm.php b/sites/all/modules/contrib/dev/config_devel/src/Form/ConfigDevelSettingsForm.php deleted file mode 100644 index ab8d45087..000000000 --- a/sites/all/modules/contrib/dev/config_devel/src/Form/ConfigDevelSettingsForm.php +++ /dev/null @@ -1,100 +0,0 @@ -config(static::CONFIGNAME)->get('auto_import') as $file) { - $default_value .= $file['filename'] . "\n"; - } - $form['auto_import'] = array( - '#type' => 'textarea', - '#title' => $this->t('Auto import'), - '#default_value' => $default_value, - '#description' => $this->t('When these files change, they will be automatically imported at the beginning of the next request.') . '
    ' . - $this->t('Enter one item per line. Each item should consist of a path relative to the Drupal root and a filename in the same form as a config YML file.') . '
    ' . - $this->t('For example: "modules/mymodule/config/install/node.type.mytype.yml".'), - ); - $form['auto_export'] = array( - '#type' => 'textarea', - '#title' => $this->t('Auto export'), - '#default_value' => implode("\n", $this->config(static::CONFIGNAME)->get('auto_export')), - '#description' => $this->t('Automatically export to the files specified when the corresponding config item is changed in the admin UI.') . '
    ' . - $this->t('Enter one item per line. Each item should consist of a path relative to the Drupal root and a filename in the same form as a config YML file.') . '
    ' . - $this->t('For example: "modules/mymodule/config/install/node.type.mytype.yml".'), - ); - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - foreach (array('auto_import', 'auto_export') as $key) { - $form_state->setValue($key, array_filter(preg_split("/\r\n/", $form_state->getValues()[$key]))); - } - foreach ($form_state->getValues()['auto_import'] as $file) { - $name = basename($file, '.' . FileStorage::getFileExtension()); - if (in_array($name, array('system.site', 'core.extension', 'simpletest.settings'))) { - $form_state->setErrorByName('auto_import', $this->t('@name is not compatible with this module', array('@name' => $name))); - } - } - parent::validateForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $auto_import = array(); - foreach ($form_state->getValues()['auto_import'] as $file) { - $auto_import[] = array( - 'filename' => $file, - 'hash' => '', - ); - } - $this->config(static::CONFIGNAME) - ->set('auto_import', $auto_import) - ->set('auto_export', $form_state->getValues()['auto_export']) - ->save(); - parent::submitForm($form, $form_state); - } - - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'config_devel_settings'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['config_devel.settings']; - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberEntityTest.php b/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberEntityTest.php deleted file mode 100644 index f25df3302..000000000 --- a/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberEntityTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertIdentical($data['label'], $entity->get('label')); - $this->assertIdentical($exported_data['label'], $data['label']); - $this->assertIdentical($exported_data['id'], 'test'); - $this->assertFalse(isset($exported_data['uuid'])); - } -} diff --git a/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberRawTest.php b/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberRawTest.php deleted file mode 100644 index 99ff6ba24..000000000 --- a/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberRawTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertIdentical($data, $this->storage->read(static::CONFIGNAME)); - $this->assertIdentical($data, $exported_data); - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberTestBase.php b/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberTestBase.php deleted file mode 100644 index 905912d48..000000000 --- a/sites/all/modules/contrib/dev/config_devel/tests/src/Kernel/ConfigDevelSubscriberTestBase.php +++ /dev/null @@ -1,65 +0,0 @@ -installDefaultConfig('module', 'config_devel'); - $filename = 'public://'. static::CONFIGNAME . '.yml'; - drupal_mkdir('public://exported'); - $exported_filename = 'public://exported/' . static::CONFIGNAME . '.yml'; - \Drupal::configFactory()->getEditable('config_devel.settings') - ->set('auto_import', array(array( - 'filename' => $filename, - 'hash' => '', - ))) - ->set('auto_export', array( - $exported_filename, - )) - ->save(); - $this->storage = \Drupal::service('config.storage'); - $this->assertFalse($this->storage->exists(static::CONFIGNAME)); - $subscriber = \Drupal::service('config_devel.auto_import_subscriber'); - for ($i = 2; $i; $i--) { - $data['label'] = $this->randomString(); - file_put_contents($filename, Yaml::encode($data)); - // The import fires an export too. - $subscriber->autoImportConfig(); - $this->doAssert($data, Yaml::decode(file_get_contents($exported_filename))); - } - } - - /** - * Assert that the config import succeeded. - * - * @param array $writen_data - * The config data as written. - * @param array $exported_data - * The config data exported. - */ - abstract protected function doAssert(array $data, array $exported_data); - -} diff --git a/sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelAutoExportSubscriberTest.php b/sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelAutoExportSubscriberTest.php deleted file mode 100644 index 1eead964c..000000000 --- a/sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelAutoExportSubscriberTest.php +++ /dev/null @@ -1,53 +0,0 @@ - $this->randomMachineName(), - 'langcode' => 'en', - 'uuid' => '836769f4-6791-402d-9046-cc06e20be87f', - ); - - $config = $this->getMockBuilder('\Drupal\Core\Config\Config') - ->disableOriginalConstructor() - ->getMock(); - $config->expects($this->any()) - ->method('getName') - ->will($this->returnValue($this->randomMachineName())); - $config->expects($this->any()) - ->method('get') - ->will($this->returnValue($config_data)); - - $file_names = array( - vfsStream::url('public://' . $this->randomMachineName() . '.yml'), - vfsStream::url('public://' . $this->randomMachineName() . '.yml'), - ); - - $configDevelSubscriber = new ConfigDevelAutoExportSubscriber($this->configFactory, $this->configManager, $this->eventDispatcher); - $configDevelSubscriber->writeBackConfig($config, $file_names); - - $data = $config_data; - unset($data['uuid']); - unset($data['_core']); - - foreach ($file_names as $file_name) { - $this->assertEquals($data, Yaml::decode(file_get_contents($file_name))); - } - } - -} diff --git a/sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelTestBase.php b/sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelTestBase.php deleted file mode 100644 index 443919d21..000000000 --- a/sites/all/modules/contrib/dev/config_devel/tests/src/Unit/ConfigDevelTestBase.php +++ /dev/null @@ -1,44 +0,0 @@ -configFactory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface'); - - $this->eventDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); - - $this->configManager = $this->getMock('Drupal\Core\Config\ConfigManagerInterface'); - $this->configManager->expects($this->any()) - ->method('getEntityTypeIdByName') - ->will($this->returnArgument(0)); - - vfsStream::setup('public://'); - } -} diff --git a/sites/all/modules/contrib/dev/config_filter/.gitignore b/sites/all/modules/contrib/dev/config_filter/.gitignore deleted file mode 100644 index 7579f7431..000000000 --- a/sites/all/modules/contrib/dev/config_filter/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor -composer.lock diff --git a/sites/all/modules/contrib/dev/config_filter/.travis.yml b/sites/all/modules/contrib/dev/config_filter/.travis.yml deleted file mode 100644 index bc434ee30..000000000 --- a/sites/all/modules/contrib/dev/config_filter/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: php - -php: - - 5.6 - - 7.0 - -env: - global: - - PATH=$PATH:/home/travis/.composer/vendor/bin - -install: - - composer self-update - -before_script: - # Set sendmail so drush doesn't throw an error during site install. - - echo "sendmail_path=`which true`" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'` - # Create database. - - mysql -e 'create database drupal' - # Install Drupal 8 target site. - - cd tests - - mkdir -p themes modules profiles - - composer install --prefer-dist - - ./vendor/bin/drush si standard -y --db-url=mysql://travis:@127.0.0.1/drupal - # Test latest commit on current branch. - - git clone --branch=$TRAVIS_BRANCH https://github.com/$TRAVIS_REPO_SLUG.git modules/config_filter - - ./vendor/bin/drush en config_filter -y - # Run Drush web server. - - ./vendor/bin/drush --debug runserver :8888 > ~/debug.txt 2>&1 & - - sleep 4s - - chmod -R ug+w sites - -script: - - cd $TRAVIS_BUILD_DIR - - cd tests - - ./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer - - ./vendor/bin/phpcs --config-set show_progress 1 - - ./vendor/bin/phpcs --warning-severity=0 --standard=Drupal,DrupalPractice ../src - - ./vendor/bin/phpunit - -notifications: - email: false diff --git a/sites/all/modules/contrib/dev/config_filter/LICENSE.txt b/sites/all/modules/contrib/dev/config_filter/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/config_filter/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/config_filter/README.md b/sites/all/modules/contrib/dev/config_filter/README.md deleted file mode 100644 index 253c90403..000000000 --- a/sites/all/modules/contrib/dev/config_filter/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Config Filter - -[![Build Status](https://travis-ci.org/nuvoleweb/config_filter.svg?branch=8.x-1.x)](https://travis-ci.org/nuvoleweb/config_filter) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nuvoleweb/config_filter/badges/quality-score.png?b=8.x-1.x)](https://scrutinizer-ci.com/g/nuvoleweb/config_filter/?branch=8.x-1.x) - - -## Introduction - -Modules such as Config Split want to modify the configuration when it is -synchronized between the database and the exported yaml files. -This module provides the API to do so but does not influence a sites operation. - -## How it works - -Configuration Filter swaps the config.storage.sync service from Drupal 8 core. -The new service wraps the file storage and applies filters to it. -This allows other modules to change the configuration as it gets imported or -exported both in the Drupal UI and with drush. - -## What is a ConfigFilter - -A ConfigFilter is a plugin. This module provides the plugin definition, the -plugin manager and the storage factory. -A ConfigFilter can have the following annotation: - -```php -/** - * @ConfigFilter( - * id = "may_plugin_id", - * label = @Translation("An example configuration filter"), - * weight = 0, - * status = TRUE, - * storages = {"config.storage.sync"}, - * ) - */ -``` -See `\Drupal\config_filter\Annotation\ConfigFilter`. - -The weight allows the filters to be sorted. The status allows the filter to be -active or inactive, the `ConfigFilterManagerInterface::getFiltersForStorages` -will only take active filters into consideration. The weight, status and -storages are optional and the above values are the default. - -## Alternative Config Filter Managers - -Plugins are only available from enabled modules. If you want to provide a -config filter from a php library, all you have to do is implement the -`\Drupal\config_filter\ConfigFilterManagerInterface` and add it to the -service container with a `config.filter` tag. -Services with higher priority will have their filters added first. diff --git a/sites/all/modules/contrib/dev/config_filter/composer.json b/sites/all/modules/contrib/dev/config_filter/composer.json deleted file mode 100644 index 68bbb961a..000000000 --- a/sites/all/modules/contrib/dev/config_filter/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "drupal/config_filter", - "type": "drupal-module", - "description": "Config Filter allows other modules to interact with a ConfigStorage through filter plugins.", - "keywords": ["Drupal", "configuration", "configuration management"], - "authors": [ - { - "name": "Fabian Bircher", - "email": "opensource@fabianbircher.com", - "homepage": "https://www.drupal.org/u/bircher", - "role": "Maintainer" - }, - { - "name": "Nuvole Web", - "email": "info@nuvole.org", - "homepage": "http://nuvole.org", - "role": "Maintainer" - } - ], - "homepage": "https://www.drupal.org/project/config_filter", - "support": { - "issues": "https://www.drupal.org/project/issues/config_filter", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/config_filter" - }, - "license": "GPL-2.0+", - "require": {}, - "suggest": { - "drupal/config_split": "Split site configuration for different environments." - } -} diff --git a/sites/all/modules/contrib/dev/config_filter/config_filter.info.yml b/sites/all/modules/contrib/dev/config_filter/config_filter.info.yml deleted file mode 100644 index 308003b3b..000000000 --- a/sites/all/modules/contrib/dev/config_filter/config_filter.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Config Filter -type: module -description: Config Filter allows other modules to interact with a ConfigStorage through filter plugins. -# core: 8.x -package: Config - -# Information added by Drupal.org packaging script on 2018-11-14 -version: '8.x-1.4' -core: '8.x' -project: 'config_filter' -datestamp: 1542184984 diff --git a/sites/all/modules/contrib/dev/config_filter/config_filter.services.yml b/sites/all/modules/contrib/dev/config_filter/config_filter.services.yml deleted file mode 100644 index 5d77008db..000000000 --- a/sites/all/modules/contrib/dev/config_filter/config_filter.services.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - plugin.manager.config_filter: - class: Drupal\config_filter\Plugin\ConfigFilterPluginManager - parent: default_plugin_manager - tags: - - { name: config.filter } - config_filter.storage.sync: - class: Drupal\config_filter\Config\FilteredStorage - factory: config_filter.storage_factory:getSync - decorates: config.storage.staging - public: false - config_filter.storage_factory: - class: Drupal\config_filter\ConfigFilterStorageFactory - arguments: ['@config_filter.storage.sync.inner'] - tags: - - { name: service_collector, tag: 'config.filter', call: addConfigFilterManager } diff --git a/sites/all/modules/contrib/dev/config_filter/src/Annotation/ConfigFilter.php b/sites/all/modules/contrib/dev/config_filter/src/Annotation/ConfigFilter.php deleted file mode 100644 index 5d768382a..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Annotation/ConfigFilter.php +++ /dev/null @@ -1,62 +0,0 @@ -storage = $storage; - $this->filters = $filters; - - // Set the storage to all the filters. - foreach ($this->filters as $filter) { - if (!$filter instanceof StorageFilterInterface) { - throw new InvalidStorageFilterException(); - } - $filter->setSourceStorage(new ReadOnlyStorage($storage)); - $filter->setFilteredStorage($this); - } - } - - /** - * {@inheritdoc} - */ - public function exists($name) { - $exists = $this->storage->exists($name); - foreach ($this->filters as $filter) { - $exists = $filter->filterExists($name, $exists); - } - - return $exists; - } - - /** - * {@inheritdoc} - */ - public function read($name) { - $data = $this->storage->read($name); - foreach ($this->filters as $filter) { - $data = $filter->filterRead($name, $data); - } - - return $data; - } - - /** - * {@inheritdoc} - */ - public function readMultiple(array $names) { - $data = $this->storage->readMultiple($names); - foreach ($this->filters as $filter) { - $data = $filter->filterReadMultiple($names, $data); - } - ksort($data); - return array_filter($data); - } - - /** - * {@inheritdoc} - */ - public function write($name, array $data) { - foreach ($this->filters as $filter) { - if ($data) { - $data = $filter->filterWrite($name, $data); - } - else { - // The filterWrite has an array type hint in the interface. - $data = $filter->filterWrite($name, []); - } - } - - if ($data) { - return $this->storage->write($name, $data); - } - - // The data has been unset, check if it should be deleted. - if ($this->storage->exists($name)) { - foreach ($this->filters as $filter) { - if ($filter->filterWriteEmptyIsDelete($name)) { - return $this->storage->delete($name); - } - } - } - - // The data was not written, but it is not an error. - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function delete($name) { - $success = TRUE; - foreach ($this->filters as $filter) { - $success = $filter->filterDelete($name, $success); - } - - if ($success) { - $success = $this->storage->delete($name); - } - - return $success; - } - - /** - * {@inheritdoc} - */ - public function rename($name, $new_name) { - $success = TRUE; - foreach ($this->filters as $filter) { - $success = $filter->filterRename($name, $new_name, $success); - } - - if ($success) { - $success = $this->storage->rename($name, $new_name); - } - - return $success; - } - - /** - * {@inheritdoc} - */ - public function encode($data) { - return $this->storage->encode($data); - } - - /** - * {@inheritdoc} - */ - public function decode($raw) { - return $this->storage->decode($raw); - } - - /** - * {@inheritdoc} - */ - public function listAll($prefix = '') { - $data = $this->storage->listAll($prefix); - foreach ($this->filters as $filter) { - $data = $filter->filterListAll($prefix, $data); - } - sort($data); - return $data; - } - - /** - * {@inheritdoc} - */ - public function deleteAll($prefix = '') { - $delete = TRUE; - foreach ($this->filters as $filter) { - $delete = $filter->filterDeleteAll($prefix, $delete); - } - - if ($delete) { - return $this->storage->deleteAll($prefix); - } - - // The filters returned FALSE for $delete, so we delete the names - // individually and allow filters to prevent deleting the config. - foreach ($this->storage->listAll($prefix) as $name) { - $this->delete($name); - } - - // The filters wanted to prevent deleting all and were called to delete the - // individual config name, is this a success? Let us say it is. - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function createCollection($collection) { - $filters = []; - foreach ($this->filters as $key => $filter) { - $filter = $filter->filterCreateCollection($collection); - if ($filter) { - $filters[$key] = $filter; - } - } - - return new static($this->storage->createCollection($collection), $filters); - } - - /** - * {@inheritdoc} - */ - public function getAllCollectionNames() { - $collections = $this->storage->getAllCollectionNames(); - foreach ($this->filters as $filter) { - $collections = $filter->filterGetAllCollectionNames($collections); - } - $collections = array_unique($collections); - sort($collections); - - return $collections; - } - - /** - * {@inheritdoc} - */ - public function getCollectionName() { - $collection = $this->storage->getCollectionName(); - foreach ($this->filters as $filter) { - $collection = $filter->filterGetCollectionName($collection); - } - - return $collection; - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Config/FilteredStorageInterface.php b/sites/all/modules/contrib/dev/config_filter/src/Config/FilteredStorageInterface.php deleted file mode 100644 index 0da0f131d..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Config/FilteredStorageInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -storage = $storage; - } - - /** - * {@inheritdoc} - */ - public function exists($name) { - return $this->storage->exists($name); - } - - /** - * {@inheritdoc} - */ - public function read($name) { - return $this->storage->read($name); - } - - /** - * {@inheritdoc} - */ - public function readMultiple(array $names) { - return $this->storage->readMultiple($names); - } - - /** - * {@inheritdoc} - */ - public function write($name, array $data) { - throw new UnsupportedMethod(__METHOD__ . ' is not allowed on a ReadOnlyStorage'); - } - - /** - * {@inheritdoc} - */ - public function delete($name) { - throw new UnsupportedMethod(__METHOD__ . ' is not allowed on a ReadOnlyStorage'); - } - - /** - * {@inheritdoc} - */ - public function rename($name, $new_name) { - throw new UnsupportedMethod(__METHOD__ . ' is not allowed on a ReadOnlyStorage'); - } - - /** - * {@inheritdoc} - */ - public function encode($data) { - return $this->storage->encode($data); - } - - /** - * {@inheritdoc} - */ - public function decode($raw) { - return $this->storage->decode($raw); - } - - /** - * {@inheritdoc} - */ - public function listAll($prefix = '') { - return $this->storage->listAll($prefix); - } - - /** - * {@inheritdoc} - */ - public function deleteAll($prefix = '') { - throw new UnsupportedMethod(__METHOD__ . ' is not allowed on a ReadOnlyStorage'); - } - - /** - * {@inheritdoc} - */ - public function createCollection($collection) { - return new static($this->storage->createCollection($collection)); - } - - /** - * {@inheritdoc} - */ - public function getAllCollectionNames() { - return $this->storage->getAllCollectionNames(); - } - - /** - * {@inheritdoc} - */ - public function getCollectionName() { - return $this->storage->getCollectionName(); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Config/StorageFilterInterface.php b/sites/all/modules/contrib/dev/config_filter/src/Config/StorageFilterInterface.php deleted file mode 100644 index ad2c38eb9..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Config/StorageFilterInterface.php +++ /dev/null @@ -1,223 +0,0 @@ -source = $storage; - } - - /** - * {@inheritdoc} - */ - public function setFilteredStorage(StorageInterface $storage) { - $this->filtered = $storage; - } - - /** - * Get the read-only source Storage. - * - * @return \Drupal\Core\Config\StorageInterface - * The source storage. - */ - protected function getSourceStorage() { - return $this->source; - } - - /** - * Get the decorator storage which applies the filters. - * - * @return \Drupal\Core\Config\StorageInterface - * The filtered decorator storage. - */ - protected function getFilteredStorage() { - return $this->filtered; - } - - /** - * {@inheritdoc} - */ - public function filterRead($name, $data) { - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterWrite($name, array $data) { - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterWriteEmptyIsDelete($name) { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function filterExists($name, $exists) { - return $exists; - } - - /** - * {@inheritdoc} - */ - public function filterDelete($name, $delete) { - return $delete; - } - - /** - * {@inheritdoc} - */ - public function filterReadMultiple(array $names, array $data) { - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterRename($name, $new_name, $rename) { - return $rename; - } - - /** - * {@inheritdoc} - */ - public function filterListAll($prefix, array $data) { - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterDeleteAll($prefix, $delete) { - return $delete; - } - - /** - * {@inheritdoc} - */ - public function filterCreateCollection($collection) { - return clone $this; - } - - /** - * {@inheritdoc} - */ - public function filterGetAllCollectionNames(array $collections) { - return $collections; - } - - /** - * {@inheritdoc} - */ - public function filterGetCollectionName($collection) { - return $collection; - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/ConfigFilterManagerInterface.php b/sites/all/modules/contrib/dev/config_filter/src/ConfigFilterManagerInterface.php deleted file mode 100644 index 6e7c10254..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/ConfigFilterManagerInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -sync = $sync; - } - - /** - * Add a config filter manager. - * - * @param \Drupal\config_filter\ConfigFilterManagerInterface $manager - * The ConfigFilter plugin manager. - */ - public function addConfigFilterManager(ConfigFilterManagerInterface $manager) { - $this->managers[] = $manager; - } - - /** - * Get the sync storage Drupal uses. - * - * @return \Drupal\config_filter\Config\FilteredStorageInterface - * The decorated sync config storage. - */ - public function getSync() { - return $this->getFilteredStorage($this->sync, ['config.storage.sync']); - } - - /** - * Get the sync storage Drupal uses and exclude some plugins. - * - * @param string[] $excluded - * The ids of filters to exclude. - * - * @return \Drupal\config_filter\Config\FilteredStorageInterface - * The decorated sync config storage. - */ - public function getSyncWithoutExcluded(array $excluded) { - return $this->getFilteredStorage($this->sync, ['config.storage.sync'], $excluded); - } - - /** - * Get a decorated storage with filters applied. - * - * @param \Drupal\Core\Config\StorageInterface $storage - * The storage to decorate. - * @param string[] $storage_names - * The names of the storage, so the correct filters can be applied. - * @param string[] $excluded - * The ids of filters to exclude. - * - * @return \Drupal\config_filter\Config\FilteredStorageInterface - * The decorated storage with the filters applied. - */ - public function getFilteredStorage(StorageInterface $storage, array $storage_names, array $excluded = []) { - $filters = []; - foreach ($this->managers as $manager) { - // Filters from managers that come first will not be overwritten by - // filters from lower priority managers. - $filters = $filters + $manager->getFiltersForStorages($storage_names, $excluded); - } - return new FilteredStorage($storage, $filters); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Exception/InvalidStorageFilterException.php b/sites/all/modules/contrib/dev/config_filter/src/Exception/InvalidStorageFilterException.php deleted file mode 100644 index f3a62fe60..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Exception/InvalidStorageFilterException.php +++ /dev/null @@ -1,19 +0,0 @@ -alterInfo('config_filter_info'); - $this->setCacheBackend($cache_backend, 'config_filter_plugins'); - } - - /** - * {@inheritdoc} - */ - public function getFiltersForStorages(array $storage_names, array $excluded = []) { - $definitions = $this->getDefinitions(); - $filters = []; - foreach ($definitions as $id => $definition) { - if ($definition['status'] && array_intersect($storage_names, $definition['storages']) && !in_array($id, $excluded)) { - $filters[$id] = $this->createInstance($id, $definition); - } - } - - return $filters; - } - - /** - * {@inheritdoc} - */ - public function getFilterInstance($id) { - $definitions = $this->getDefinitions(); - if (array_key_exists($id, $definitions)) { - return $this->createInstance($id, $definitions[$id]); - } - - return NULL; - } - - /** - * {@inheritdoc} - */ - protected function findDefinitions() { - $definitions = array_map(function ($definition) { - if (empty($definition['storages'])) { - // The sync storage is the default. - $definition['storages'] = ['config.storage.sync']; - } - return $definition; - }, parent::findDefinitions()); - - // Sort the definitions by weight. - uasort($definitions, function ($a, $b) { - return strcmp($a['weight'], $b['weight']); - }); - - return $definitions; - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Tests/FilteredStorageTest.php b/sites/all/modules/contrib/dev/config_filter/src/Tests/FilteredStorageTest.php deleted file mode 100644 index 75dfa4723..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Tests/FilteredStorageTest.php +++ /dev/null @@ -1,429 +0,0 @@ -storage = new FilteredStorage($this->storage, [new TransparentFilter()]); - } - - /** - * Test that the storage is set on the filters. - */ - public function testSettingStorages() { - /** @var \Drupal\config_filter\Tests\TransparentFilter[] $filters */ - $filters = static::getProtectedFilters($this->storage); - foreach ($filters as $filter) { - // Test that the source storage is a ReadonlyStorage and wraps the cached - // storage from the inherited test. - $readonly = $filter->getPrivateSourceStorage(); - $this->assertInstanceOf(ReadOnlyStorage::class, $readonly); - $readonlyReflection = new \ReflectionClass(ReadOnlyStorage::class); - $storageProperty = $readonlyReflection->getProperty('storage'); - $storageProperty->setAccessible(TRUE); - $source = $storageProperty->getValue($readonly); - $this->assertInstanceOf(CachedStorage::class, $source); - - // Assert that the filter gets the storage. - $this->assertEquals($this->storage, $filter->getPrivateFilteredStorage()); - } - } - - /** - * Test that creating collections keeps filters set to the correct storages. - */ - public function testCollectionStorages() { - $collection = $this->randomString(); - - // The storage is in its default state. - $this->assertEquals(StorageInterface::DEFAULT_COLLECTION, $this->storage->getCollectionName()); - - /** @var \Drupal\config_filter\Tests\TransparentFilter[] $filters */ - $filters = static::getProtectedFilters($this->storage); - foreach ($filters as $filter) { - // Test that the filters have the correct storage set. - $this->assertEquals($this->storage, $filter->getPrivateFilteredStorage()); - $this->assertEquals(StorageInterface::DEFAULT_COLLECTION, $filter->getPrivateSourceStorage()->getCollectionName()); - } - - // Create a collection which creates a clone of the storage and filters. - $collectionStorage = $this->storage->createCollection($collection); - $this->assertInstanceOf(FilteredStorageInterface::class, $collectionStorage); - - /** @var \Drupal\config_filter\Tests\TransparentFilter[] $collectionFilters */ - $collectionFilters = static::getProtectedFilters($collectionStorage); - foreach ($collectionFilters as $filter) { - // Test that the cloned filter has the correct storage set. - $this->assertEquals($collectionStorage, $filter->getPrivateFilteredStorage()); - $this->assertEquals($collection, $filter->getPrivateSourceStorage()->getCollectionName()); - } - - /** @var \Drupal\config_filter\Tests\TransparentFilter[] $filters */ - $filters = static::getProtectedFilters($this->storage); - foreach ($filters as $filter) { - // Test that the filters on the original storage are still correctly set. - $this->assertEquals($this->storage, $filter->getPrivateFilteredStorage()); - $this->assertEquals(StorageInterface::DEFAULT_COLLECTION, $filter->getPrivateSourceStorage()->getCollectionName()); - } - } - - /** - * Test setting up filters in FilteredStorage::createCollection(). - */ - public function testCreateCollectionFilter() { - $collection = $this->randomString(); - $filteredCollection = $this->randomString(); - - $filter = $this->prophesizeFilter(); - $filterC = $this->prophesizeFilter(); - $filterC->filterGetCollectionName($collection)->willReturn($filteredCollection); - $filter->filterCreateCollection($collection)->willReturn($filterC->reveal()); - - $source = $this->prophesize(StorageInterface::class); - $sourceC = $this->prophesize(StorageInterface::class); - $sourceC->getCollectionName()->willReturn($collection); - $source->createCollection($collection)->willReturn($sourceC->reveal()); - - $storage = new FilteredStorage($source->reveal(), [$filter->reveal()]); - // Creating a collection makes sure the filters were correctly set up. - $storageC = $storage->createCollection($collection); - - // Test that the collection is filtered in the collection storage. - $this->assertEquals($filteredCollection, $storageC->getCollectionName()); - } - - /** - * Test collection names from FilteredStorage::getAllCollectionNames(). - */ - public function testGetAllCollectionNamesFilter() { - $source = $this->prophesize(StorageInterface::class); - $source->getAllCollectionNames()->willReturn(['a', 'b']); - - $filter = $this->prophesizeFilter(); - $filter->filterGetAllCollectionNames(['a', 'b'])->willReturn(['b', 'b', 'c']); - - $storage = new FilteredStorage($source->reveal(), [$filter->reveal()]); - - $this->assertEquals(['b', 'c'], $storage->getAllCollectionNames()); - } - - /** - * Test the read methods invokes the correct filter methods. - * - * @dataProvider readFilterProvider - */ - public function testReadFilter($name, $storageMethod, $filterMethod, $data, $expected) { - $source = $this->prophesize(StorageInterface::class); - $filterA = $this->prophesizeFilter(); - $filterB = $this->prophesizeFilter(); - - $source->$storageMethod($name)->willReturn($data); - $interim = $this->randomArray(); - $filterA->$filterMethod($name, $data)->willReturn($interim); - $filterB->$filterMethod($name, $interim)->willReturn($expected); - - $storage = new FilteredStorage($source->reveal(), [$filterA->reveal(), $filterB->reveal()]); - $this->assertEquals($expected, $storage->$storageMethod($name)); - } - - /** - * Data provider for testReadFilter. - */ - public function readFilterProvider() { - // @codingStandardsIgnoreStart - return [ - [$this->randomString(), 'exists', 'filterExists', TRUE, TRUE], - [$this->randomString(), 'exists', 'filterExists', TRUE, FALSE], - [$this->randomString(), 'exists', 'filterExists', FALSE, TRUE], - [$this->randomString(), 'exists', 'filterExists', FALSE, FALSE], - - [$this->randomString(), 'read', 'filterRead', $this->randomArray(), $this->randomArray()], - [$this->randomString(), 'read', 'filterRead', NULL, $this->randomArray()], - [$this->randomString(), 'read', 'filterRead', $this->randomArray(), NULL], - - [ - [$this->randomString(), $this->randomString()], - 'readMultiple', - 'filterReadMultiple', - [$this->randomArray(), $this->randomArray()], - [$this->randomArray(), $this->randomArray()], - ], - [ - [$this->randomString(), $this->randomString()], - 'readMultiple', - 'filterReadMultiple', - [$this->randomArray(), FALSE], - [$this->randomArray(), $this->randomArray()], - ], - - [ - $this->randomString(), - 'listAll', - 'filterListAll', - ['a' . $this->randomString(), 'b' . $this->randomString()], - ['a' . $this->randomString(), 'b' . $this->randomString()], - ], - ]; - // @codingStandardsIgnoreEnd - } - - /** - * Test that when a filter removes config on a readMultiple it is not set. - */ - public function testReadMultipleWithEmptyResults() { - $names = [$this->randomString(), $this->randomString()]; - $source = $this->prophesize(StorageInterface::class); - $data = [$this->randomArray(), $this->randomArray()]; - $source->readMultiple($names)->willReturn($data); - $source = $source->reveal(); - - foreach ([0, [], NULL] as $none) { - $filtered = $data; - $filtered[1] = $none; - $filter = $this->prophesizeFilter(); - $filter->filterReadMultiple($names, $data)->willReturn($filtered); - - $storage = new FilteredStorage($source, [$filter->reveal()]); - $this->assertEquals([$data[0]], $storage->readMultiple($names)); - } - } - - /** - * Test the write method invokes the filterWrite in filters. - * - * @dataProvider writeFilterProvider - */ - public function testWriteFilter($interim, $expected, $exists = TRUE) { - $name = $this->randomString(); - $data = $this->randomArray(); - $source = $this->prophesize(StorageInterface::class); - $filterA = $this->prophesizeFilter(); - $filterB = $this->prophesizeFilter(); - - $filterA->filterWrite($name, $data)->willReturn($interim); - $interim = is_array($interim) ? $interim : []; - $filterB->filterWrite($name, $interim)->willReturn($expected); - - if ($expected) { - $source->write($name, $expected)->willReturn(TRUE); - } - else { - $source->write(Argument::any())->shouldNotBeCalled(); - $source->exists($name)->willReturn($exists); - if ($exists) { - $filterA->filterWriteEmptyIsDelete($name)->willReturn(TRUE); - $source->delete($name)->willReturn(TRUE); - } - } - - $storage = new FilteredStorage($source->reveal(), [$filterA->reveal(), $filterB->reveal()]); - $this->assertTrue($storage->write($name, $data)); - } - - /** - * Data provider for testWriteFilter. - */ - public function writeFilterProvider() { - return [ - [$this->randomArray(), $this->randomArray()], - [NULL, $this->randomArray()], - [[], $this->randomArray()], - [$this->randomArray(), NULL, FALSE], - [$this->randomArray(), [], FALSE], - [$this->randomArray(), NULL, TRUE], - ]; - } - - /** - * Test the delete method invokes the filterDelete in filters. - * - * @dataProvider deleteFilterProvider - */ - public function testDeleteFilter($interim, $expected) { - $name = $this->randomString(); - $source = $this->prophesize(StorageInterface::class); - $filterA = $this->prophesizeFilter(); - $filterB = $this->prophesizeFilter(); - - $filterA->filterDelete($name, TRUE)->willReturn($interim); - $filterB->filterDelete($name, $interim)->willReturn($expected); - - if ($expected) { - $source->delete($name)->willReturn(TRUE); - } - else { - $source->delete(Argument::any())->shouldNotBeCalled(); - } - - $storage = new FilteredStorage($source->reveal(), [$filterA->reveal(), $filterB->reveal()]); - $this->assertEquals($expected, $storage->delete($name)); - } - - /** - * Data provider for testDeleteFilter. - */ - public function deleteFilterProvider() { - return [ - [TRUE, TRUE], - [FALSE, TRUE], - [TRUE, FALSE], - [FALSE, FALSE], - ]; - } - - /** - * Test the rename method invokes the filterRename in filters. - * - * @dataProvider renameFilterProvider - */ - public function testRenameFilter($interim, $expected) { - $name = $this->randomString(); - $name2 = $this->randomString(); - $source = $this->prophesize(StorageInterface::class); - $filterA = $this->prophesizeFilter(); - $filterB = $this->prophesizeFilter(); - - $filterA->filterRename($name, $name2, TRUE)->willReturn($interim); - $filterB->filterRename($name, $name2, $interim)->willReturn($expected); - - if ($expected) { - $source->rename($name, $name2)->willReturn(TRUE); - } - else { - $source->rename(Argument::any())->shouldNotBeCalled(); - } - - $storage = new FilteredStorage($source->reveal(), [$filterA->reveal(), $filterB->reveal()]); - $this->assertEquals($expected, $storage->rename($name, $name2)); - } - - /** - * Data provider for testRenameFilter. - */ - public function renameFilterProvider() { - return [ - [TRUE, TRUE], - [FALSE, TRUE], - [TRUE, FALSE], - [FALSE, FALSE], - ]; - } - - /** - * Test the deleteAll method invokes the filterDeleteAll in filters. - * - * @dataProvider deleteAllFilterProvider - */ - public function testDeleteAllFilter($interim, $expected) { - $name = $this->randomString(); - $source = $this->prophesize(StorageInterface::class); - $filterA = $this->prophesizeFilter(); - $filterB = $this->prophesizeFilter(); - - $filterA->filterDeleteAll($name, TRUE)->willReturn($interim); - $filterB->filterDeleteAll($name, $interim)->willReturn($expected); - - if ($expected) { - $source->deleteAll($name)->willReturn(TRUE); - } - else { - $source->deleteAll(Argument::any())->shouldNotBeCalled(); - $all = [$this->randomString(), $this->randomString()]; - $source->listAll($name)->willReturn($all); - - foreach ($all as $item) { - $filterA->filterDelete($item, TRUE)->willReturn(TRUE); - $filterB->filterDelete($item, TRUE)->willReturn(FALSE); - } - } - - $storage = new FilteredStorage($source->reveal(), [$filterA->reveal(), $filterB->reveal()]); - $this->assertTrue($storage->deleteAll($name)); - } - - /** - * Data provider for testDeleteAllFilter. - */ - public function deleteAllFilterProvider() { - return [ - [TRUE, TRUE], - [FALSE, TRUE], - [TRUE, FALSE], - [FALSE, FALSE], - ]; - } - - /** - * Test that an exception is thrown when invalid arguments are passed. - */ - public function testInvalidStorageFilterArgument() { - $source = $this->prophesize(StorageInterface::class); - - // We would do this with $this->expectException but alas drupal is stuck on - // phpunit 4 and we try not to add deprecated code. - try { - new FilteredStorage($source->reveal(), [new \stdClass()]); - $this->fail('An exception should have been thrown.'); - } - catch (InvalidStorageFilterException $exception) { - $this->assertTrue(TRUE); - } - } - - /** - * Prophesize a StorageFilter. - */ - protected function prophesizeFilter() { - $filter = $this->prophesize(StorageFilterInterface::class); - $filter->setSourceStorage(Argument::type(ReadOnlyStorage::class))->shouldBeCalledTimes(1); - $filter->setFilteredStorage(Argument::type(FilteredStorage::class))->shouldBeCalledTimes(1); - return $filter; - } - - /** - * Get the filters from a FilteredStorageInterface. - * - * @param \Drupal\Core\Config\StorageInterface $storage - * The storage with the protected filters property. - * - * @return \Drupal\config_filter\Config\StorageFilterInterface[] - * The array of filters. - */ - protected static function getProtectedFilters(StorageInterface $storage) { - $filterReflection = new \ReflectionClass(FilteredStorage::class); - $filtersProperty = $filterReflection->getProperty('filters'); - $filtersProperty->setAccessible(TRUE); - - return $filtersProperty->getValue($storage); - } - - /** - * Create a random array. - */ - protected function randomArray($size = 4) { - return (array) $this->randomObject($size); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Tests/GhostStorageTest.php b/sites/all/modules/contrib/dev/config_filter/src/Tests/GhostStorageTest.php deleted file mode 100644 index a384badd5..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Tests/GhostStorageTest.php +++ /dev/null @@ -1,44 +0,0 @@ -prophesize(StorageInterface::class); - $source->$method(Argument::any())->shouldNotBeCalled(); - - $storage = $this->getStorage($source->reveal()); - - $actual = call_user_func_array([$storage, $method], $arguments); - $this->assertTrue($actual); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Tests/ReadonlyStorageTest.php b/sites/all/modules/contrib/dev/config_filter/src/Tests/ReadonlyStorageTest.php deleted file mode 100644 index ee1917133..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Tests/ReadonlyStorageTest.php +++ /dev/null @@ -1,138 +0,0 @@ -prophesize(StorageInterface::class); - $methodProhecy = new MethodProphecy($source, $method, $arguments); - $methodProhecy->shouldBeCalledTimes(1); - $methodProhecy->willReturn($returnValue); - $source->addMethodProphecy($methodProhecy); - - $storage = $this->getStorage($source->reveal()); - $actual = call_user_func_array([$storage, $method], $arguments); - $this->assertEquals($actual, $returnValue); - } - - /** - * Provide the methods that should continue to work. - * - * @return array - * The data. - */ - public function readMethodsProvider() { - return [ - ['exists', [$this->randomMachineName()], $this->randomMachineName()], - ['read', [$this->randomMachineName()], $this->randomArray()], - ['readMultiple', [$this->randomArray()], $this->randomArray()], - ['encode', [$this->randomArray()], $this->randomMachineName()], - ['decode', [$this->randomMachineName()], $this->randomArray()], - ['listAll', [$this->randomMachineName()], $this->randomArray()], - ['getAllCollectionNames', [], $this->randomArray()], - ['getCollectionName', [], $this->randomMachineName()], - ]; - } - - /** - * Test creating a collection. - * - * Creating collections returns a new instance, make sure it decorates the - * new instance of the source. - */ - public function testCreateCollection() { - $name = $this->randomMachineName(); - $source = $this->prophesize(StorageInterface::class); - $collectionSource = $this->prophesize(StorageInterface::class)->reveal(); - $source->createCollection($name)->willReturn($collectionSource); - - $storage = $this->getStorage($source->reveal()); - $collectionStorage = $storage->createCollection($name); - - $this->assertInstanceOf(ReadOnlyStorage::class, $collectionStorage); - - $readonlyReflection = new \ReflectionClass(ReadOnlyStorage::class); - $storageProperty = $readonlyReflection->getProperty('storage'); - $storageProperty->setAccessible(TRUE); - $actualSource = $storageProperty->getValue($collectionStorage); - $this->assertEquals($collectionSource, $actualSource); - } - - /** - * Test the operations that should throw an error. - * - * @dataProvider writeMethodsProvider - */ - public function testWriteOperations($method, $arguments) { - $source = $this->prophesize(StorageInterface::class); - $source->$method(Argument::any())->shouldNotBeCalled(); - - $storage = $this->getStorage($source->reveal()); - try { - call_user_func_array([$storage, $method], $arguments); - $this->fail(); - } - catch (UnsupportedMethod $exception) { - $this->assertEquals(ReadOnlyStorage::class . '::' . $method . ' is not allowed on a ReadOnlyStorage', $exception->getMessage()); - } - } - - /** - * Provide the methods that should throw an exception. - * - * @return array - * The data - */ - public function writeMethodsProvider() { - return [ - ['write', [$this->randomMachineName(), $this->randomArray()]], - ['delete', [$this->randomMachineName()]], - ['rename', [$this->randomMachineName(), $this->randomMachineName()]], - ['deleteAll', [$this->randomMachineName()]], - ]; - } - - /** - * Get a random array. - * - * @return array - * A random array used for data testing. - */ - protected function randomArray() { - return (array) $this->getRandomGenerator()->object(); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/src/Tests/TransparentFilter.php b/sites/all/modules/contrib/dev/config_filter/src/Tests/TransparentFilter.php deleted file mode 100644 index d96d6bb5c..000000000 --- a/sites/all/modules/contrib/dev/config_filter/src/Tests/TransparentFilter.php +++ /dev/null @@ -1,40 +0,0 @@ -getSourceStorage(); - } - - /** - * Get the decorator storage which applies the filters. - * - * @return \Drupal\Core\Config\StorageInterface - * The filtered decorator storage. - */ - public function getPrivateFilteredStorage() { - return $this->getFilteredStorage(); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/tests/composer.json b/sites/all/modules/contrib/dev/config_filter/tests/composer.json deleted file mode 100644 index fe60edb17..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "nuvoleweb/config-filter-test-site", - "description": "Config Filter test site.", - "type": "project", - "require": { - "composer/installers": "^1.2", - "drupal-composer/drupal-scaffold": "^2.2", - "drupal/core": "~8", - "drush/drush": "~8.0", - "drupal/coder": "^8.2", - "squizlabs/php_codesniffer": "^2.8", - "phpunit/phpunit": "5.5.*", - "bovigo/assert": "~1.7", - "mikey179/vfsStream": "*" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "repositories": [ - {"type": "composer", "url": "https://packages.drupal.org/8"} - ], - "conflict": { - "drupal/drupal": "*" - } -} diff --git a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/README.md b/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/README.md deleted file mode 100644 index 37b67f463..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Config Filter Split test -This is a module for testing the proper functioning of config_filter. -But it also demonstrates how a filter can be used to read and write to a -different config storage. As such it is an instructive example. -But it also has a practical purpose: We can use it to read migrate config -directly from files. Of course it is in general a bad idea to directly -edit the active configuration since Drupal does many checks and database -alterations when synchronizing configuration. - -This is just here for the brave. You have been warned. - -## Developing with migrate configuration read from the files. - -Migrations are configurations, by default active configuration is stored in the -database. So when developing, the configuration has to be synced all the time. -To avoid this we can split out the migrate configuration to read directly -from the files. - -Enable the config_filter_split_test testing module from config_filter. - -To swap out the active storage, add the following to your services.local.yml: -```yaml -services: - config.storage: - class: Drupal\config_filter_split_test\Config\ActiveMigrateStorage - arguments: - - '@config.storage.active' - - '@cache.config' - - '../config/migrate_active' # The path to the folder. -``` - -Migrations are plugins, and plugin definitions are cached. The configuration -storage is also cached. -So either you have to clear the caches after you edit the migration or you add -the following to your settings.php (assuming you have the null cache set too): -```php -$settings['cache']['bins']['config'] = 'cache.backend.null'; -$settings['cache']['bins']['discovery'] = 'cache.backend.null'; -``` -This has an obvious performance implication. diff --git a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/config_filter_split_test.info.yml b/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/config_filter_split_test.info.yml deleted file mode 100644 index 69f4f5a5a..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/config_filter_split_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: 'Simple split filter' -type: module -# core: 8.x -package: Testing -dependencies: - - config_filter:config_filter - -# Information added by Drupal.org packaging script on 2018-11-14 -version: '8.x-1.4' -core: '8.x' -project: 'config_filter' -datestamp: 1542184984 diff --git a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/src/Config/ActiveMigrateStorage.php b/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/src/Config/ActiveMigrateStorage.php deleted file mode 100644 index 068023497..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_split_test/src/Config/ActiveMigrateStorage.php +++ /dev/null @@ -1,34 +0,0 @@ -storage = $storage; - $this->name = $name; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static(new DatabaseStorage($container->get('database'), 'config_filter_split_test'), 'core.'); - } - - /** - * Decide to split the config off or not. - * - * @param string $name - * The name of the configuration to check. - * - * @return bool - * Whether the configuration is supposed to be split. - */ - protected function isSplitConfig($name) { - return (strpos($name, $this->name) === 0); - } - - /** - * {@inheritdoc} - */ - public function filterRead($name, $data) { - if ($this->isSplitConfig($name)) { - if ($this->storage->exists($name)) { - $data = $this->storage->read($name); - } - } - - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterExists($name, $exists) { - if ($this->isSplitConfig($name) && !$exists) { - $exists = $this->storage->exists($name); - } - - return $exists; - } - - /** - * {@inheritdoc} - */ - public function filterReadMultiple(array $names, array $data) { - return array_merge($data, $this->storage->readMultiple($names)); - } - - /** - * {@inheritdoc} - */ - public function filterListAll($prefix, array $data) { - return array_unique(array_merge($data, $this->storage->listAll($prefix))); - } - - /** - * {@inheritdoc} - */ - public function filterWrite($name, array $data) { - if ($this->isSplitConfig($name)) { - $this->storage->write($name, $data); - return NULL; - } - - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterWriteEmptyIsDelete($name) { - return ($this->isSplitConfig($name) ? TRUE : NULL); - } - - /** - * {@inheritdoc} - */ - public function filterDelete($name, $delete) { - if ($delete && $this->storage->exists($name)) { - // Call delete on the secondary storage anyway. - $this->storage->delete($name); - } - - return $delete; - } - - /** - * {@inheritdoc} - */ - public function filterDeleteAll($prefix, $delete) { - if ($delete && $this->storage) { - try { - $this->storage->deleteAll($prefix); - } - catch (\UnexpectedValueException $exception) { - // The file storage tries to remove directories of collections. But this - // fails if the directory doesn't exist. So everything is actually fine. - } - } - - return $delete; - } - - /** - * {@inheritdoc} - */ - public function filterCreateCollection($collection) { - return new static($this->storage->createCollection($collection), $this->name); - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/config_filter_test.info.yml b/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/config_filter_test.info.yml deleted file mode 100644 index 0c97ec25d..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/config_filter_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Config Filter Test -type: module -# core: 8.x -package: Testing -dependencies: - - config_filter:config_filter - -# Information added by Drupal.org packaging script on 2018-11-14 -version: '8.x-1.4' -core: '8.x' -project: 'config_filter' -datestamp: 1542184984 diff --git a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/src/Plugin/ConfigFilter/PirateFilter.php b/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/src/Plugin/ConfigFilter/PirateFilter.php deleted file mode 100644 index 96b022c9e..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/modules/config_filter_test/src/Plugin/ConfigFilter/PirateFilter.php +++ /dev/null @@ -1,40 +0,0 @@ -filterRead('system.site', $data['system.site']); - } - - return $data; - } - -} diff --git a/sites/all/modules/contrib/dev/config_filter/tests/phpunit.xml.dist b/sites/all/modules/contrib/dev/config_filter/tests/phpunit.xml.dist deleted file mode 100644 index abb466ba1..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/phpunit.xml.dist +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - ./modules/config_filter/ - - - diff --git a/sites/all/modules/contrib/dev/config_filter/tests/src/Kernel/ConfigFilterStorageFactoryTest.php b/sites/all/modules/contrib/dev/config_filter/tests/src/Kernel/ConfigFilterStorageFactoryTest.php deleted file mode 100644 index 5b801dab2..000000000 --- a/sites/all/modules/contrib/dev/config_filter/tests/src/Kernel/ConfigFilterStorageFactoryTest.php +++ /dev/null @@ -1,88 +0,0 @@ -installConfig(['system']); - } - - /** - * Test that the config.storage.sync is decorated with the filtering version. - */ - public function testServiceProvider() { - // Export the configuration. - $this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync')); - - // The pirate filter changes the system.site when importing. - $this->assertEquals(['system.site'], $this->configImporter()->getStorageComparer()->getChangelist('update')); - $this->assertEmpty($this->configImporter()->getStorageComparer()->getChangelist('create')); - $this->assertEmpty($this->configImporter()->getStorageComparer()->getChangelist('delete')); - $this->assertEmpty($this->configImporter()->getStorageComparer()->getChangelist('rename')); - - $config = $this->config('system.site')->getRawData(); - $config['name'] .= ' Arrr'; - - $this->assertEquals($config, $this->container->get('config.storage.sync')->read('system.site')); - } - - /** - * Test the storage factory decorating properly. - */ - public function testStorageFactory() { - /** @var \Drupal\Core\Database\Connection $database */ - $database = $this->container->get('database'); - $destination = new DatabaseStorage($database, 'config_filter_source_test'); - - // The $filtered storage will have the simple split applied to the - // destination storage, but is the unified storage. - $filtered = $this->container->get('config_filter.storage_factory')->getFilteredStorage($destination, ['test_storage']); - - /** @var \Drupal\Core\Config\StorageInterface $active */ - $active = $this->container->get('config.storage'); - - // Export the configuration to the filtered storage. - $this->copyConfig($active, $filtered); - - // Get the storage of the test split plugin. - $splitStorage = new DatabaseStorage($database, 'config_filter_split_test'); - - // Assert that the storage is properly split. - $this->assertTrue(count($destination->listAll()) > 0); - $this->assertTrue(count($splitStorage->listAll()) > 0); - $this->assertEquals(count($active->listAll()), count($destination->listAll()) + count($splitStorage->listAll())); - $this->assertEquals($active->listAll('core'), $splitStorage->listAll()); - $this->assertEquals($active->listAll('system'), $destination->listAll('system')); - - $this->assertEquals($active->readMultiple($active->listAll('core')), $splitStorage->readMultiple($splitStorage->listAll())); - $this->assertEquals($active->readMultiple($active->listAll('system')), $destination->readMultiple($destination->listAll('system'))); - - // Reading from the $filtered storage returns the merged config. - $this->assertEquals($active->listAll(), $filtered->listAll()); - $this->assertEquals($active->readMultiple($active->listAll()), $filtered->readMultiple($filtered->listAll())); - } - -} diff --git a/sites/all/modules/contrib/dev/config_ignore/LICENSE.txt b/sites/all/modules/contrib/dev/config_ignore/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/config_ignore/README.txt b/sites/all/modules/contrib/dev/config_ignore/README.txt deleted file mode 100644 index 0a51fe965..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/README.txt +++ /dev/null @@ -1,41 +0,0 @@ -Config Ignore -============= - -INTRODUCTION ------------- -Ever experienced that your sites configuration was overridden by the configuration on the filesystem, when doing a -`drush cim`? - -Not anymore! - -This modules is a tool to let you keep the configuration you want, in place. - -Lets say that you do would like the `system.site` configuration (which contains that sites name, slogan, email, etc) to -remain untouched, on your live site, no matter what the configuration, in the export folder says. - -Or maybe you are getting tired of having the `devel.settings` changed every time you import configuration? - -Then this module is what you are looking for. - -REQUIREMENTS ------------- -You will need the `config_filter` module to be enabled. - -INSTALLATION ------------- -Consult https://www.drupal.org/docs/8/extending-drupal-8/installing-contributed-modules-find-import-enable-configure-drupal-8 -to see how to install and manage modules in Drupal 8. - -CONFIGURATION -------------- -Go to `admin/config/development/configuration/ignore` to set what configuration you want to ignore upon import. - -Do not ignore the `core.extension` configuration as it will prevent you from enabling new modules with a config import. -Use the `config_split` module for environment specific modules. - -MAINTAINERS ------------ -Current maintainers: - - * Tommy Lynge Jørgensen (TLyngeJ) - https://www.drupal.org/u/tlyngej - * Fabian Bircher (bircher) - https://www.drupal.org/u/bircher diff --git a/sites/all/modules/contrib/dev/config_ignore/composer.json b/sites/all/modules/contrib/dev/config_ignore/composer.json deleted file mode 100644 index 9e8ee9b99..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "drupal/config_ignore", - "description": "Ignore certain configuration during import.", - "type": "drupal-module", - "homepage": "http://drupal.org/project/config_ignore", - "authors": [ - { - "name": "Tommy Lynge Jørgensen", - "email": "tlyngej@gmail.com", - "homepage": "https://www.drupal.org/u/tlyngej", - "role": "Maintainer" - }, - { - "name": "Fabian Bircher", - "homepage": "https://www.drupal.org/u/bircher", - "role": "Maintainer" - } - ], - "support": { - "issues": "http://drupal.org/project/config_ignore", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/config_ignore" - }, - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": { - "drupal/config_filter": "1.*" - } -} diff --git a/sites/all/modules/contrib/dev/config_ignore/config/install/config_ignore.settings.yml b/sites/all/modules/contrib/dev/config_ignore/config/install/config_ignore.settings.yml deleted file mode 100644 index 629b34249..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/config/install/config_ignore.settings.yml +++ /dev/null @@ -1 +0,0 @@ -ignored_config_entities: { } diff --git a/sites/all/modules/contrib/dev/config_ignore/config/schema/config_ignore.schema.yml b/sites/all/modules/contrib/dev/config_ignore/config/schema/config_ignore.schema.yml deleted file mode 100644 index 9930f0d9d..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/config/schema/config_ignore.schema.yml +++ /dev/null @@ -1,9 +0,0 @@ -config_ignore.settings: - type: config_object - label: 'Config Ignore Settings' - mapping: - ignored_config_entities: - type: sequence - label: 'List of ignored configurations' - sequence: - type: string diff --git a/sites/all/modules/contrib/dev/config_ignore/config_ignore.api.php b/sites/all/modules/contrib/dev/config_ignore/config_ignore.api.php deleted file mode 100644 index 89e9f9189..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/config_ignore.api.php +++ /dev/null @@ -1,23 +0,0 @@ -get('module_installer')->install(['config_filter']); -} diff --git a/sites/all/modules/contrib/dev/config_ignore/config_ignore.links.task.yml b/sites/all/modules/contrib/dev/config_ignore/config_ignore.links.task.yml deleted file mode 100644 index b65a8dd60..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/config_ignore.links.task.yml +++ /dev/null @@ -1,5 +0,0 @@ -config_ignore.settings: - route_name: 'config_ignore.settings' - title: 'Ignore' - base_route: config.sync - weight: 99 diff --git a/sites/all/modules/contrib/dev/config_ignore/config_ignore.module b/sites/all/modules/contrib/dev/config_ignore/config_ignore.module deleted file mode 100644 index 3ed573ad7..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/config_ignore.module +++ /dev/null @@ -1,70 +0,0 @@ -getSyncWithoutExcluded(['config_ignore']); - $active_storage_sync = \Drupal::service('config.storage.sync'); - $storage = \Drupal::service('config.storage'); - $config_manager = \Drupal::service('config.manager'); - - // Create two StorageComparer objects, one with the filter enabled and one - // as without. We will compare them later to see what changes that has been - // ignored. - $unfiltered_storage_compare = new StorageComparer($stock_storage_sync, $storage, $config_manager); - $filtered_storage_compare = new StorageComparer($active_storage_sync, $storage, $config_manager); - $unfiltered_storage_compare->createChangelist(); - $filtered_storage_compare->createChangelist(); - - // Create an array of the changes with the filter on. - $config_changes = []; - foreach ($filtered_storage_compare->getChangelist() as $config_names) { - foreach ($config_names as $config_name) { - $config_changes[] = $config_name; - } - } - - foreach ($unfiltered_storage_compare->getAllCollectionNames() as $collection) { - foreach ($unfiltered_storage_compare->getChangelist(NULL, $collection) as $config_change_type => $config_names) { - foreach ($config_names as $config_name) { - // If the config name exists here, but not in the $config_changes array - // the it's because it's getting ignored. - if (!in_array($config_name, $config_changes)) { - $ignored_config_entities[] = [ - $config_name, - $config_change_type, - ]; - } - } - } - } - - // Build a table of changes that are not going to happen, due to the ignored - // config entities. - if (!empty($ignored_config_entities)) { - $form['ignored'] = [ - '#type' => 'table', - '#header' => ['Config name', 'Action'], - '#caption' => t('

    The following configuration entities are ignored due to the Config Ignore Settings and therefore not displayed in the list above

    ', [ - '@url' => Url::fromRoute('config_ignore.settings') - ->toString() - ]), - '#rows' => $ignored_config_entities, - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/config_ignore/config_ignore.routing.yml b/sites/all/modules/contrib/dev/config_ignore/config_ignore.routing.yml deleted file mode 100644 index 5a16abfa8..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/config_ignore.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -config_ignore.settings: - path: '/admin/config/development/configuration/ignore' - defaults: - _form: '\Drupal\config_ignore\Form\Settings' - _title: 'Ignore' - requirements: - _permission: 'import configuration' diff --git a/sites/all/modules/contrib/dev/config_ignore/src/Form/Settings.php b/sites/all/modules/contrib/dev/config_ignore/src/Form/Settings.php deleted file mode 100644 index 8029db085..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/src/Form/Settings.php +++ /dev/null @@ -1,76 +0,0 @@ -t('One configuration name per line.
    -Examples:
      -
    • user.settings
    • -
    • views.settings
    • -
    • contact.settings
    • -
    • webform.webform.* (will ignore all config entities that starts with webform.webform)
    • -
    • *.contact_message.custom_contact_form.* (will ignore all config entities that starts with .contact_message.custom_contact_form. like fields attached to a custom contact form)
    • -
    • * (will ignore everything)
    • -
    • ~webform.webform.contact (will force import for this configuration, even if ignored by a wildcard)
    • -
    • user.mail:register_no_approval_required.body (will ignore the body of the no approval required email setting, but will not ignore other user.mail configuration.)
    • -
    '); - - $config_ignore_settings = $this->config('config_ignore.settings'); - $form['ignored_config_entities'] = [ - '#type' => 'textarea', - '#rows' => 25, - '#title' => $this->t('Configuration entity names to ignore'), - '#description' => $description, - '#default_value' => implode(PHP_EOL, $config_ignore_settings->get('ignored_config_entities')), - '#size' => 60, - ]; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $config_ignore_settings = $this->config('config_ignore.settings'); - $config_ignore_settings_array = preg_split("[\n|\r]", $values['ignored_config_entities']); - $config_ignore_settings_array = array_filter($config_ignore_settings_array); - $config_ignore_settings->set('ignored_config_entities', $config_ignore_settings_array); - $config_ignore_settings->save(); - parent::submitForm($form, $form_state); - - // Clear the config_filter plugin cache. - \Drupal::service('plugin.manager.config_filter')->clearCachedDefinitions(); - } - -} diff --git a/sites/all/modules/contrib/dev/config_ignore/src/Plugin/ConfigFilter/IgnoreFilter.php b/sites/all/modules/contrib/dev/config_ignore/src/Plugin/ConfigFilter/IgnoreFilter.php deleted file mode 100644 index 07fc90801..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/src/Plugin/ConfigFilter/IgnoreFilter.php +++ /dev/null @@ -1,236 +0,0 @@ -active = $active; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - // Get the list of ignored config. - $ignored = $container->get('config.factory')->get('config_ignore.settings')->get('ignored_config_entities'); - // Allow hooks to alter the list. - $container->get('module_handler')->invokeAll('config_ignore_settings_alter', [&$ignored]); - // Set the list in the plugin configuration. - $configuration['ignored'] = $ignored; - - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('config.storage') - ); - } - - /** - * Match a config entity name against the list of ignored config entities. - * - * @param string $config_name - * The name of the config entity to match against all ignored entities. - * - * @return bool - * True, if the config entity is to be ignored, false otherwise. - */ - protected function matchConfigName($config_name) { - if (Settings::get('config_ignore_deactivate')) { - // Allow deactivating config_ignore in settings.php. Do not match any name - // in that case and allow a normal configuration import to happen. - return FALSE; - } - - // If the string is an excluded config, don't ignore it. - if (in_array(static::FORCE_EXCLUSION_PREFIX . $config_name, $this->configuration['ignored'], TRUE)) { - return FALSE; - } - - foreach ($this->configuration['ignored'] as $config_ignore_setting) { - // Split the ignore settings so that we can ignore individual keys. - $ignore = explode(':', $config_ignore_setting); - if (fnmatch($ignore[0], $config_name)) { - return TRUE; - } - } - - return FALSE; - } - - /** - * Read from the active configuration. - * - * This method will read the configuration from the active config store. - * But rather than just straight up returning the value it will check if - * a nested config key is set to be ignored and set only that value on the - * data to be filtered. - * - * @param string $name - * The name of the configuration to read. - * @param mixed $data - * The data to be filtered. - * - * @return mixed - * The data filtered or read from the active storage. - */ - protected function activeRead($name, $data) { - $keys = []; - foreach ($this->configuration['ignored'] as $ignored) { - // Split the ignore settings so that we can ignore individual keys. - $ignored = explode(':', $ignored); - if (fnmatch($ignored[0], $name)) { - if (count($ignored) == 1) { - // If one of the definitions does not have keys ignore the - // whole config. - return $this->active->read($name); - } - else { - // Add the sub parts to ignore to the keys. - $keys[] = $ignored[1]; - } - } - - } - - $active = $this->active->read($name); - foreach ($keys as $key) { - $parts = explode('.', $key); - - if (count($parts) == 1) { - if (isset($active[$key])) { - $data[$key] = $active[$key]; - } - } - else { - $value = NestedArray::getValue($active, $parts, $key_exists); - if ($key_exists) { - // Enforce the value if it existed in the active config. - NestedArray::setValue($data, $parts, $value, TRUE); - } - } - } - - return $data; - } - - /** - * Read multiple from the active storage. - * - * @param array $names - * The names of the configuration to read. - * @param array $data - * The data to filter. - * - * @return array - * The new data. - */ - protected function activeReadMultiple(array $names, array $data) { - $filtered_data = []; - foreach ($names as $name) { - $filtered_data[$name] = $this->activeRead($name, $data[$name]); - } - - return $filtered_data; - } - - /** - * {@inheritdoc} - */ - public function filterRead($name, $data) { - // Read from the active storage when the name is in the ignored list. - if ($this->matchConfigName($name)) { - return $this->activeRead($name, $data); - } - - return $data; - } - - /** - * {@inheritdoc} - */ - public function filterExists($name, $exists) { - // A name exists if it is ignored and exists in the active storage. - return $exists || ($this->matchConfigName($name) && $this->active->exists($name)); - } - - /** - * {@inheritdoc} - */ - public function filterReadMultiple(array $names, array $data) { - // Limit the names which are read from the active storage. - $names = array_filter($names, [$this, 'matchConfigName']); - $active_data = $this->activeReadMultiple($names, $data); - - // Return the data with merged in active data. - return array_merge($data, $active_data); - } - - /** - * {@inheritdoc} - */ - public function filterListAll($prefix, array $data) { - $active_names = $this->active->listAll($prefix); - // Filter out only ignored config names. - $active_names = array_filter($active_names, [$this, 'matchConfigName']); - - // Return the data with the active names which are ignored merged in. - return array_unique(array_merge($data, $active_names)); - } - - /** - * {@inheritdoc} - */ - public function filterCreateCollection($collection) { - return new static($this->configuration, $this->pluginId, $this->pluginDefinition, $this->active->createCollection($collection)); - } - - /** - * {@inheritdoc} - */ - public function filterGetAllCollectionNames(array $collections) { - // Add active collection names as there could be ignored config in them. - return array_merge($collections, $this->active->getAllCollectionNames()); - } - -} diff --git a/sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.info.yml b/sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.info.yml deleted file mode 100644 index 02e72b064..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Config Ignore Hook Test -type: module -description: Module that implements all the hook from Config Ignore for testing purposes -# core: 8.x -package: Configuration -dependencies: - - config_ignore - -# Information added by Drupal.org packaging script on 2017-10-11 -version: '8.x-2.1' -core: '8.x' -project: 'config_ignore' -datestamp: 1507706047 diff --git a/sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.module b/sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.module deleted file mode 100644 index 97ec446ca..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/tests/config_ignore_hook_test/config_ignore_hook_test.module +++ /dev/null @@ -1,13 +0,0 @@ -container->get('config.storage.sync'), - $this->container->get('config.storage'), - $this->container->get('config.manager') - ); - - $config_importer = new ConfigImporter( - $storage_comparer->createChangelist(), - $this->container->get('event_dispatcher'), - $this->container->get('config.manager'), - $this->container->get('lock'), - $this->container->get('config.typed'), - $this->container->get('module_handler'), - $this->container->get('module_installer'), - $this->container->get('theme_handler'), - $this->container->get('string_translation') - ); - - $config_importer->reset()->import(); - } - - /** - * Perform a config export to sync. folder. - */ - public function doExport() { - // Setup a config sync. dir with a, more or less, know set of config - // entities. This is a full blown export of yaml files, written to the disk. - $destination = CONFIG_SYNC_DIRECTORY; - $destination_dir = config_get_config_directory($destination); - /** @var \Drupal\Core\Config\CachedStorage $source_storage */ - $source_storage = \Drupal::service('config.storage'); - $destination_storage = new FileStorage($destination_dir); - foreach ($source_storage->listAll() as $name) { - $destination_storage->write($name, $source_storage->read($name)); - } - } - -} diff --git a/sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreHookTest.php b/sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreHookTest.php deleted file mode 100644 index a17ac2886..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreHookTest.php +++ /dev/null @@ -1,47 +0,0 @@ -config('system.site')->set('name', 'Test import')->save(); - - $this->doExport(); - - $this->config('system.site')->set('name', 'Changed title')->save(); - - $this->doImport(); - - // Test if the `config_ignore_hook_test` module got to ignore the site name - // config. - $this->assertEquals('Changed title', $this->config('system.site')->get('name')); - - } - -} diff --git a/sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreTest.php b/sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreTest.php deleted file mode 100644 index f632f4923..000000000 --- a/sites/all/modules/contrib/dev/config_ignore/tests/src/Functional/ConfigIgnoreTest.php +++ /dev/null @@ -1,196 +0,0 @@ -config('system.site')->set('name', 'Test import')->save(); - $this->config('system.date')->set('first_day', '0')->save(); - $this->config('config_ignore.settings')->set('ignored_config_entities', ['system.site'])->save(); - - $this->doExport(); - - // Login with a user that has permission to sync. config. - $this->drupalLogin($this->drupalCreateUser(['synchronize configuration'])); - - // Change the site name, which is supposed to look as an ignored change - // in on the sync. page. - $this->config('system.site')->set('name', 'Test import with changed title')->save(); - $this->config('system.date')->set('first_day', '1')->save(); - - // Validate that the sync. table informs the user that the config will be - // ignored. - $this->drupalGet('admin/config/development/configuration'); - $this->assertSession()->linkExists('Config Ignore Settings'); - /** @var \Behat\Mink\Element\NodeElement[] $table_content */ - $table_content = $this->xpath('//table[@id="edit-ignored"]//td'); - - $table_values = []; - foreach ($table_content as $item) { - $table_values[] = $item->getHtml(); - } - - $this->assertTrue(in_array('system.site', $table_values)); - $this->assertFalse(in_array('system.date', $table_values)); - } - - /** - * Verify that the settings form works. - */ - public function testSettingsForm() { - // Login with a user that has permission to import config. - $this->drupalLogin($this->drupalCreateUser(['import configuration'])); - - $edit = [ - 'ignored_config_entities' => 'config.test', - ]; - - $this->drupalGet('admin/config/development/configuration/ignore'); - $this->submitForm($edit, t('Save configuration')); - - $settings = $this->config('config_ignore.settings')->get('ignored_config_entities'); - - $this->assertEqual($settings, ['config.test']); - } - - /** - * Verify that config can get ignored. - */ - public function testValidateIgnoring() { - - // Set the site name to a known value that we later will try and overwrite. - $this->config('system.site')->set('name', 'Test import')->save(); - - // Set the system.site:name to be ignored upon config import. - $this->config('config_ignore.settings')->set('ignored_config_entities', ['system.site'])->save(); - - $this->doExport(); - - // Change the site name, perform an import and see if the site name remains - // the same, as it should. - $this->config('system.site')->set('name', 'Changed title')->save(); - $this->doImport(); - $this->assertEquals('Changed title', $this->config('system.site')->get('name')); - - } - - /** - * Verify all wildcard asterisk is working. - */ - public function testValidateIgnoringWithWildcard() { - - // Set the site name to a known value that we later will try and overwrite. - $this->config('system.site')->set('name', 'Test import')->save(); - - // Set the system.site:name to be ignored upon config import. - $this->config('config_ignore.settings')->set('ignored_config_entities', ['system.' . IgnoreFilter::INCLUDE_SUFFIX])->save(); - - $this->doExport(); - - // Change the site name, perform an import and see if the site name remains - // the same, as it should. - $this->config('system.site')->set('name', 'Changed title')->save(); - $this->doImport(); - $this->assertEquals('Changed title', $this->config('system.site')->get('name')); - - } - - /** - * Verify Force Import syntax is working. - * - * This test makes sure we avoid regression issues. - */ - public function testValidateForceImporting() { - // Set the site name to a known value that we later will try and overwrite. - $this->config('system.site')->set('name', 'Test import')->save(); - - // Set the system.site:name to be (force-) imported upon config import. - $settings = [IgnoreFilter::FORCE_EXCLUSION_PREFIX . 'system.site']; - $this->config('config_ignore.settings')->set('ignored_config_entities', $settings)->save(); - - $this->doExport(); - - // Change the site name, perform an import and see if the site name remains - // the same, as it should. - $this->config('system.site')->set('name', 'Changed title')->save(); - $this->doImport(); - $this->assertEquals('Test import', $this->config('system.site')->get('name')); - } - - /** - * Verify excluded configuration works with wildcards. - * - * This test cover the scenario where a wildcard matches a specific - * configuration, but that's still imported due exclusion. - */ - public function testValidateForceImportingWithWildcard() { - - // Set the site name to a known value that we later will try and overwrite. - $this->config('system.site')->set('name', 'Test import')->save(); - - // Set the system.site:name to be (force-) imported upon config import. - $settings = ['system.' . IgnoreFilter::INCLUDE_SUFFIX, IgnoreFilter::FORCE_EXCLUSION_PREFIX . 'system.site']; - $this->config('config_ignore.settings')->set('ignored_config_entities', $settings)->save(); - - $this->doExport(); - - // Change the site name, perform an import and see if the site name remains - // the same, as it should. - $this->config('system.site')->set('name', 'Changed title')->save(); - $this->doImport(); - $this->assertEquals('Test import', $this->config('system.site')->get('name')); - - } - - /** - * Verify ignoring only some config keys. - * - * This test covers the scenario when not the whole config is to be ignored - * but only a certain subset of it. - */ - public function testValidateImportingWithIgnoredSubKeys() { - - // Set the site name to a known value that we later will try and overwrite. - $this->config('system.site') - ->set('name', 'Test name') - ->set('slogan', 'Test slogan') - ->set('page.front', '/ignore') - ->save(); - - // Set the system.site:name to be (force-) imported upon config import. - $settings = ['system.site:name', 'system.site:page.front']; - $this->config('config_ignore.settings')->set('ignored_config_entities', $settings)->save(); - - $this->doExport(); - - // Change the site name, perform an import and see if the site name remains - // the same, as it should. - $this->config('system.site') - ->set('name', 'Changed title') - ->set('slogan', 'Changed slogan') - ->set('page.front', '/new-ignore') - ->save(); - - $this->doImport(); - $this->assertEquals('Changed title', $this->config('system.site')->get('name')); - $this->assertEquals('Test slogan', $this->config('system.site')->get('slogan')); - $this->assertEquals('/new-ignore', $this->config('system.site')->get('page.front')); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/LICENSE.txt b/sites/all/modules/contrib/dev/ctools/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/ctools/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/ctools/composer.json b/sites/all/modules/contrib/dev/ctools/composer.json deleted file mode 100644 index 62fe080cb..000000000 --- a/sites/all/modules/contrib/dev/ctools/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "drupal/ctools", - "description": "Provides a number of utility and helper APIs for Drupal developers and site builders.", - "type": "drupal-module", - "license": "GPL-2.0+", - "minimum-stability": "dev", - "homepage": "https://www.drupal.org/project/ctools", - "authors": [ - { - "name": "Kris Vanderwater (EclipseGc)", - "homepage": "https://www.drupal.org/u/eclipsegc", - "role": "Maintainer" - }, - { - "name": "Jakob Perry (japerry)", - "homepage": "https://www.drupal.org/u/japerry", - "role": "Maintainer" - }, - { - "name": "Tim Plunkett (tim.plunkett)", - "homepage": "https://www.drupal.org/u/timplunkett", - "role": "Maintainer" - }, - { - "name": "James Gilliland (neclimdul)", - "homepage": "https://www.drupal.org/u/neclimdul", - "role": "Maintainer" - }, - { - "name": "Daniel Wehner (dawehner)", - "homepage": "https://www.drupal.org/u/dawehner", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/ctools", - "source": "http://cgit.drupalcode.org/ctools" - }, - "require": {} -} diff --git a/sites/all/modules/contrib/dev/ctools/config/schema/ctools.schema.yml b/sites/all/modules/contrib/dev/ctools/config/schema/ctools.schema.yml deleted file mode 100644 index 596c3fd68..000000000 --- a/sites/all/modules/contrib/dev/ctools/config/schema/ctools.schema.yml +++ /dev/null @@ -1,63 +0,0 @@ -ctools.context: - type: mapping - label: Context - mapping: - label: - type: label - label: 'Label of the context' - type: - type: string - label: 'Context type' - description: - type: string - label: 'Description of the context' - value: - type: string - label: 'Context value' - -ctools.relationship: - type: mapping - label: 'Relationship' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - -condition.plugin.entity_bundle:*: - type: condition.plugin - mapping: - bundles: - type: sequence - sequence: - type: string - -ctools.block_plugin.*: - type: block.settings.[id] - mapping: - region: - type: string - label: 'Region' - weight: - type: integer - label: 'Weight' - uuid: - type: string - label: 'UUID' - context_mapping: - type: sequence - label: 'Context assignments' - sequence: - - type: string - -ctools.block_display_variant: - type: display_variant.plugin - label: 'Block display variant' - mapping: - blocks: - type: sequence - label: 'Blocks' - sequence: - - type: ctools.block_plugin.[id] diff --git a/sites/all/modules/contrib/dev/ctools/ctools.info.yml b/sites/all/modules/contrib/dev/ctools/ctools.info.yml deleted file mode 100644 index 01f59c94d..000000000 --- a/sites/all/modules/contrib/dev/ctools/ctools.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Chaos Tools -type: module -description: 'Provides a number of utility and helper APIs for Drupal developers and site builders.' -package: Chaos tool suite -# core: 8.x -dependencies: - - drupal:system (>=8.5) - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/ctools.module b/sites/all/modules/contrib/dev/ctools/ctools.module deleted file mode 100644 index ec4daba98..000000000 --- a/sites/all/modules/contrib/dev/ctools/ctools.module +++ /dev/null @@ -1,64 +0,0 @@ - [ - 'variables' => [ - 'wizard' => NULL, - 'cached_values' => [], - 'trail' => [], - 'divider' => ' » ', - 'step' => NULL, - ], - ], - 'ctools_wizard_trail_links' => [ - 'variables' => [ - 'wizard' => NULL, - 'cached_values' => [], - 'trail' => [], - 'divider' => ' » ', - 'step' => NULL, - ], - ], - ]; -} - -function template_preprocess_ctools_wizard_trail(&$variables) { - /** @var $wizard \Drupal\ctools\Wizard\FormWizardInterface|\Drupal\ctools\Wizard\EntityFormWizardInterface */ - $wizard = $variables['wizard']; - $cached_values = $variables['cached_values']; - $trail = $variables['trail']; - $variables['step'] = $wizard->getStep($cached_values); - foreach ($wizard->getOperations($cached_values) as $step => $operation) { - $trail[$step] = !empty($operation['title']) ? $operation['title'] : ''; - } - $variables['trail'] = $trail; -} - -function template_preprocess_ctools_wizard_trail_links(&$variables) { - /** @var $wizard \Drupal\ctools\Wizard\FormWizardInterface|\Drupal\ctools\Wizard\EntityFormWizardInterface */ - $wizard = $variables['wizard']; - $cached_values = $variables['cached_values']; - $trail = $variables['trail']; - $variables['step'] = $wizard->getStep($cached_values); - foreach ($wizard->getOperations($cached_values) as $step => $operation) { - $parameters = $wizard->getNextParameters($cached_values); - // Override step to be the step we want. - $parameters['step'] = $step; - $trail[$step] = [ - 'title' => !empty($operation['title']) ? $operation['title'] : '', - 'url' => new \Drupal\Core\Url($wizard->getRouteName(), $parameters), - ]; - } - $variables['trail'] = $trail; -} - -function ctools_condition_info_alter(&$definitions) { - // If the node_type's class is unaltered, use a custom ctools implementation. - if (isset($definitions['node_type']) && $definitions['node_type']['class'] == 'Drupal\node\Plugin\Condition\NodeType') { - $definitions['node_type']['class'] = 'Drupal\ctools\Plugin\Condition\NodeType'; - } -} diff --git a/sites/all/modules/contrib/dev/ctools/ctools.services.yml b/sites/all/modules/contrib/dev/ctools/ctools.services.yml deleted file mode 100644 index 59f91f92a..000000000 --- a/sites/all/modules/contrib/dev/ctools/ctools.services.yml +++ /dev/null @@ -1,38 +0,0 @@ -services: - ctools.wizard.form: - class: Drupal\ctools\Controller\WizardFormController - arguments: ['@controller_resolver', '@form_builder', '@ctools.wizard.factory'] - ctools.wizard.entity.form: - class: Drupal\ctools\Controller\WizardEntityFormController - arguments: ['@controller_resolver', '@form_builder', '@ctools.wizard.factory', '@entity_type.manager'] - ctools.wizard_enhancer: - class: Drupal\ctools\Routing\Enhancer\WizardEnhancer - tags: - - { name: route_enhancer } - ctools.wizard.factory: - class: Drupal\ctools\Wizard\WizardFactory - arguments: ['@form_builder', '@event_dispatcher', '@renderer'] - ctools.paramconverter.tempstore: - class: Drupal\ctools\ParamConverter\TempstoreConverter - arguments: ['@tempstore.shared', '@entity_type.manager'] - tags: - - { name: paramconverter } - ctools.typed_data.resolver: - class: Drupal\ctools\TypedDataResolver - arguments: ['@typed_data_manager', '@string_translation'] - ctools.access: - class: Drupal\ctools\Access\TempstoreAccess - arguments: ['@tempstore.shared'] - tags: - - { name: access_check, applies_to: _ctools_access } - plugin.manager.ctools.relationship: - class: Drupal\ctools\Plugin\RelationshipManager - parent: default_plugin_manager - ctools.context_mapper: - class: Drupal\ctools\ContextMapper - arguments: ['@entity.repository'] - ctools.serializable.tempstore.factory: - class: Drupal\ctools\SerializableTempstoreFactory - arguments: ['@keyvalue.expirable', '@lock', '@request_stack', '%tempstore.expire%', '@current_user'] - tags: - - { name: backend_overridable } diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/config/schema/ctools_block.schema.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/config/schema/ctools_block.schema.yml deleted file mode 100644 index 6b1520aae..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/config/schema/ctools_block.schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -block.settings.entity_field:*:*: - type: block_settings - label: 'Entity field block' - mapping: - formatter: - type: mapping - label: 'Field formatter' - mapping: - type: - type: string - label: 'Format type machine name' - weight: - type: integer - label: 'Weight' - region: - type: string - label: 'Region' - label: - type: string - label: 'Label setting machine name' - settings: - type: field.formatter.settings.[%parent.type] - label: 'Settings' - third_party_settings: - type: sequence - label: 'Third party settings' - sequence: - type: field.formatter.third_party.[%key] diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.info.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.info.yml deleted file mode 100644 index e5cb62e95..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Chaos Tools Blocks -type: module -description: 'Provides improvements to blocks that will one day be added to Drupal core.' -package: Chaos tool suite (Experimental) -# version: 3.x -# core: 8.x -dependencies: - - ctools:ctools - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.module b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.module deleted file mode 100644 index 12c80348e..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/ctools_block.module +++ /dev/null @@ -1,16 +0,0 @@ -moduleExists('layout_builder')){ - foreach ($definitions AS $label => $definition) { - if($definition['provider'] == 'ctools_block') { - unset($definitions[$label]); - } - } - } -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Block/EntityField.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Block/EntityField.php deleted file mode 100644 index e86ce0101..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Block/EntityField.php +++ /dev/null @@ -1,375 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityFieldManager = $entity_field_manager; - $this->fieldTypeManager = $field_type_manager; - $this->formatterManager = $formatter_manager; - - // Get the entity type and field name from the plugin id. - list (, $entity_type_id, $field_name) = explode(':', $plugin_id); - $this->entityTypeId = $entity_type_id; - $this->fieldName = $field_name; - - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('entity_field.manager'), - $container->get('plugin.manager.field.field_type'), - $container->get('plugin.manager.field.formatter') - ); - } - - /** - * {@inheritdoc} - */ - public function build() { - /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */ - $entity = $this->getContextValue('entity'); - $build = []; - /** @var \Drupal\Core\Field\FieldItemListInterface $field */ - $field = $entity->{$this->fieldName}; - $display_settings = $this->getConfiguration()['formatter']; - $build['field'] = $field->view($display_settings); - - // Set the cache data appropriately. - $build['#cache']['contexts'] = $this->getCacheContexts(); - $build['#cache']['tags'] = $this->getCacheTags(); - $build['#cache']['max-age'] = $this->getCacheMaxAge(); - - return $build; - } - - /** - * {@inheritdoc} - */ - protected function blockAccess(AccountInterface $account) { - /** @var \Drupal\Core\Entity\EntityInterface $entity */ - $entity = $this->getContextValue('entity'); - // Make sure we have access to the entity. - $access = $entity->access('view', $account, TRUE); - if ($access->isAllowed()) { - // Check that the entity in question has this field. - if ($entity instanceof FieldableEntityInterface && $entity->hasField($this->fieldName)) { - // Check field access. - $field_access = $this->entityTypeManager - ->getAccessControlHandler($this->entityTypeId) - ->fieldAccess('view', $this->getFieldDefinition(), $account); - - if ($field_access) { - // Build a renderable array for the field. - $build = $entity->get($this->fieldName)->view($this->configuration['formatter']); - // If there are actual renderable children, grant access. - if (Element::children($build)) { - return AccessResult::allowed(); - } - } - } - // Entity doesn't have this field, so access is denied. - return AccessResult::forbidden(); - } - // If we don't have access to the entity, return the forbidden result. - return $access; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - $field_type_definition = $this->getFieldTypeDefinition(); - return [ - 'formatter' => [ - 'label' => 'above', - 'type' => isset($field_type_definition['default_formatter']) ? $field_type_definition['default_formatter'] : '', - 'settings' => [], - 'third_party_settings' => [], - 'weight' => 0, - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function blockForm($form, FormStateInterface $form_state) { - $config = $this->getConfiguration(); - - $form['formatter_label'] = [ - '#type' => 'select', - '#title' => $this->t('Label'), - '#options' => [ - 'above' => $this->t('Above'), - 'inline' => $this->t('Inline'), - 'hidden' => '- ' . $this->t('Hidden') . ' -', - 'visually_hidden' => '- ' . $this->t('Visually Hidden') . ' -', - ], - '#default_value' => $config['formatter']['label'], - ]; - - $form['formatter_type'] = [ - '#type' => 'select', - '#title' => $this->t('Formatter'), - '#options' => $this->getFormatterOptions(), - '#default_value' => $config['formatter']['type'], - '#ajax' => [ - 'callback' => [static::class, 'formatterSettingsAjaxCallback'], - 'wrapper' => 'formatter-settings-wrapper', - 'effect' => 'fade', - ], - ]; - - // Add the formatter settings to the form via AJAX. - $form['#process'][] = [$this, 'formatterSettingsProcessCallback']; - $form['formatter_settings_wrapper'] = [ - '#prefix' => '
    ', - '#suffix' => '
    ', - ]; - $form['formatter_settings_wrapper']['formatter_settings'] = [ - '#tree' => TRUE, - // The settings from the formatter plugin will be added in the - // ::formatterSettingsProcessCallback method. - ]; - - return $form; - } - - /** - * Render API callback: builds the formatter settings elements. - */ - public function formatterSettingsProcessCallback(array &$element, FormStateInterface $form_state, array &$complete_form) { - $config = $this->getConfiguration(); - $parents_base = $element['#parents']; - $formatter_parent = array_merge($parents_base, ['formatter_type']); - $formatter_settings_parent = array_merge($parents_base, ['formatter_settings']); - - $settings_element = &$element['formatter_settings_wrapper']['formatter_settings']; - - // Set the #parents on the formatter_settings so they end up as a peer to - // formatter_type. - $settings_element['#parents'] = $formatter_settings_parent; - - // Get the formatter name in a way that works regardless of whether we're - // getting the value via AJAX or not. - $formatter_name = NestedArray::getValue($form_state->getUserInput(), $formatter_parent) ?: $element['formatter_type']['#default_value']; - - // Place the formatter settings on the form if a formatter is selected. - $formatter = $this->getFormatter($formatter_name, $form_state->getValue('formatter_label'), $form_state->getValue($formatter_settings_parent, $config['formatter']['settings']), $config['formatter']['third_party_settings']); - $settings_element = array_merge($formatter->settingsForm($settings_element, $form_state), $settings_element); - - // Store the array parents for our element so that we can use it to pull out - // the formatter settings in our AJAX callback. - $complete_form['#formatter_array_parents'] = $element['#array_parents']; - - return $element; - } - - /** - * Render API callback: gets the layout settings elements. - */ - public static function formatterSettingsAjaxCallback(array $form, FormStateInterface $form_state) { - $formatter_array_parents = $form['#formatter_array_parents']; - return NestedArray::getValue($form, array_merge($formatter_array_parents, ['formatter_settings_wrapper'])); - } - - /** - * {@inheritdoc} - */ - public function blockSubmit($form, FormStateInterface $form_state) { - $this->configuration['formatter']['label'] = $form_state->getValue('formatter_label'); - $this->configuration['formatter']['type'] = $form_state->getValue('formatter_type'); - // @todo Remove this manual cast after https://www.drupal.org/node/2635236 - // is resolved. - $this->configuration['formatter']['settings'] = (array) $form_state->getValue('formatter_settings'); - } - - /** - * Gets the field definition. - * - * @return \Drupal\Core\Field\FieldDefinitionInterface - */ - protected function getFieldDefinition() { - if (empty($this->fieldDefinition)) { - $field_map = $this->entityFieldManager->getFieldMap(); - $bundle = reset($field_map[$this->entityTypeId][$this->fieldName]['bundles']); - $field_definitions = $this->entityFieldManager->getFieldDefinitions($this->entityTypeId, $bundle); - $this->fieldDefinition = $field_definitions[$this->fieldName]; - } - return $this->fieldDefinition; - } - - /** - * Gets the field storage definition. - * - * @return \Drupal\Core\Field\FieldStorageDefinitionInterface - */ - protected function getFieldStorageDefinition() { - if (empty($this->fieldStorageDefinition)) { - $field_definitions = $this->entityFieldManager->getFieldStorageDefinitions($this->entityTypeId); - $this->fieldStorageDefinition = $field_definitions[$this->fieldName]; - } - return $this->fieldStorageDefinition; - } - - /** - * Gets field type definition. - * - * @return array - * The field type definition. - */ - protected function getFieldTypeDefinition() { - return $this->fieldTypeManager->getDefinition($this->getFieldStorageDefinition()->getType()); - } - - /** - * Gets the formatter options for this field type. - * - * @return array - * The formatter options. - */ - protected function getFormatterOptions() { - return $this->formatterManager->getOptions($this->getFieldStorageDefinition()->getType()); - } - - /** - * Gets the formatter object. - * - * @param string $type - * The formatter name. - * @param string $label - * The label option for the formatter. - * @param array $settings - * The formatter settings. - * @param array $third_party_settings - * The formatter third party settings. - * - * @return \Drupal\Core\Field\FormatterInterface - * The formatter object. - */ - protected function getFormatter($type, $label, array $settings, array $third_party_settings) { - return $this->formatterManager->createInstance($type, [ - 'field_definition' => $this->getFieldDefinition(), - 'view_mode' => 'default', - 'prepare' => TRUE, - 'label' => $label, - 'settings' => $settings, - 'third_party_settings' => $third_party_settings, - ]); - } - - public function __wakeup() { - parent::__wakeup(); - // @todo figure out why this happens. - // prevent $fieldStorageDefinition being erroneously set to $this. - $this->fieldStorageDefinition = NULL; - } - - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php deleted file mode 100644 index 7413605fb..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php +++ /dev/null @@ -1,65 +0,0 @@ -entityTypeRepository->getEntityTypeLabels(); - foreach ($this->entityFieldManager->getFieldMap() as $entity_type_id => $entity_field_map) { - foreach ($this->entityFieldManager->getFieldStorageDefinitions($entity_type_id) as $field_storage_definition) { - $field_name = $field_storage_definition->getName(); - - // The blocks are based on fields. However, we are looping through field - // storages for which no fields may exist. If that is the case, skip - // this field storage. - if (!isset($entity_field_map[$field_name])) { - continue; - } - - $field_info = $entity_field_map[$field_name]; - $derivative_id = $entity_type_id . ":" . $field_name; - - // Get the admin label for both base and configurable fields. - if ($field_storage_definition->isBaseField()) { - $admin_label = $field_storage_definition->getLabel(); - } - else { - // We take the field label used on the first bundle. - $first_bundle = reset($field_info['bundles']); - $bundle_field_definitions = $this->entityFieldManager->getFieldDefinitions($entity_type_id, $first_bundle); - - // The field storage config may exist, but it's possible that no - // fields are actually using it. If that's the case, skip to the next - // field. - if (empty($bundle_field_definitions[$field_name])) { - continue; - } - $admin_label = $bundle_field_definitions[$field_name]->getLabel(); - } - - // Set plugin definition for derivative. - $derivative = $base_plugin_definition; - $derivative['category'] = $this->t('@entity', ['@entity' => $entity_type_labels[$entity_type_id]]); - $derivative['admin_label'] = $admin_label; - $derivative['context'] = [ - 'entity' => new ContextDefinition('entity:' . $entity_type_id, $entity_type_labels[$entity_type_id], TRUE), - ]; - - $this->derivatives[$derivative_id] = $derivative; - - } - } - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.base_field_override.node.ctools_block_field_test.promote.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.base_field_override.node.ctools_block_field_test.promote.yml deleted file mode 100644 index 6b1a61005..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.base_field_override.node.ctools_block_field_test.promote.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - node.type.ctools_block_field_test -_core: - default_config_hash: hoRuk0InNhhRVGnhQ9hzifTXVz432i9hvPe-tVstUbc -id: node.ctools_block_field_test.promote -field_name: promote -entity_type: node -bundle: ctools_block_field_test -label: 'Promoted to front page' -description: '' -required: false -translatable: true -default_value: - - - value: 0 -default_value_callback: '' -settings: - on_label: 'On' - off_label: 'Off' -field_type: boolean diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_form_display.node.ctools_block_field_test.default.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_form_display.node.ctools_block_field_test.default.yml deleted file mode 100644 index acfaaefc4..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_form_display.node.ctools_block_field_test.default.yml +++ /dev/null @@ -1,62 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.ctools_block_field_test.body - - node.type.ctools_block_field_test - module: - - path - - text -_core: - default_config_hash: xpDeWNLzjX4dDB9YyBlO9y9FR4vHwMv0GKsuqDYy0Bc -id: node.ctools_block_field_test.default -targetEntityType: node -bundle: ctools_block_field_test -mode: default -content: - body: - type: text_textarea_with_summary - weight: 31 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 10 - settings: { } - third_party_settings: { } - path: - type: path - weight: 30 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - third_party_settings: { } - title: - type: string_textfield - weight: -5 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.default.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.default.yml deleted file mode 100644 index 3844350c4..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.default.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.ctools_block_field_test.body - - node.type.ctools_block_field_test - module: - - user -_core: - default_config_hash: clNnyw6fhh5SwIme5I_3zjbLv-PMfpY-JXofVAC3CV8 -id: node.ctools_block_field_test.default -targetEntityType: node -bundle: ctools_block_field_test -mode: default -content: { } -hidden: - body: true - links: true diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.teaser.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.teaser.yml deleted file mode 100644 index 8b55c0b35..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/core.entity_view_display.node.ctools_block_field_test.teaser.yml +++ /dev/null @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.ctools_block_field_test.body - - node.type.ctools_block_field_test - module: - - text - - user -_core: - default_config_hash: gQV5baI7pCIOBUtLkbJ1c2WJwM8CdlKiKOtLLIWnfy0 -id: node.ctools_block_field_test.teaser -targetEntityType: node -bundle: ctools_block_field_test -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 101 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 100 -hidden: { } diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.body.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.body.yml deleted file mode 100644 index 42853da52..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.body.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.ctools_block_field_test - module: - - text -_core: - default_config_hash: fzUnwtwftRsgKExjpF6XdMqbUzP16ytkjQniBZl1Hqg -id: node.ctools_block_field_test.body -field_name: body -entity_type: node -bundle: ctools_block_field_test -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.field_image.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.field_image.yml deleted file mode 100644 index 0696ece53..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.field.node.ctools_block_field_test.field_image.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_image - - node.type.ctools_block_field_test - module: - - image -id: node.ctools_block_field_test.field_image -field_name: field_image -entity_type: node -bundle: ctools_block_field_test -label: Image -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - file_directory: '[date:custom:Y]-[date:custom:m]' - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - title_field: false - alt_field_required: true - title_field_required: false - default_image: - uuid: null - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.storage.node.field_image.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.storage.node.field_image.yml deleted file mode 100644 index e4da70854..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/field.storage.node.field_image.yml +++ /dev/null @@ -1,31 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_image -field_name: field_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: null - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: 1 -translatable: true -indexes: - target_id: - - target_id -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/node.type.ctools_block_field_test.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/node.type.ctools_block_field_test.yml deleted file mode 100644 index caf9cff81..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/config/install/node.type.ctools_block_field_test.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - menu_ui -third_party_settings: - menu_ui: - available_menus: { } - parent: '' -_core: - default_config_hash: hjC271ZF6B5XYgF6-F5Ak73sJiZWJRmSLsgk8S7Vo-8 -name: 'CTools block field test' -type: ctools_block_field_test -description: 'A content type used for the ctools_block field tests.' -help: '' -new_revision: false -preview_mode: 0 -display_submitted: false diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/ctools_block_field_test.info.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/ctools_block_field_test.info.yml deleted file mode 100644 index 82daed53d..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/modules/ctools_block_field_test/ctools_block_field_test.info.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Chaos Tools blocks test' -type: module -description: 'Support module for Chaos tools blocks tests.' -# core: 8.x -package: Testing -# version: 8.0.1 -dependencies: - - image - - menu_ui - - node - - path - - text - - user -features: true - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/src/Functional/EntityFieldBlockTest.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/src/Functional/EntityFieldBlockTest.php deleted file mode 100644 index 4fa77c5ec..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_block/tests/src/Functional/EntityFieldBlockTest.php +++ /dev/null @@ -1,132 +0,0 @@ -drupalPlaceBlock('entity_field:node:body', [ - 'formatter' => [ - 'type' => 'text_default', - ], - 'context_mapping' => [ - 'entity' => '@node.node_route_context:node', - ], - ]); - $node = $this->drupalCreateNode(['type' => 'ctools_block_field_test']); - $this->drupalGet('node/' . $node->id()); - $assert = $this->assertSession(); - $assert->pageTextContains($block->label()); - $assert->pageTextContains($node->body->value); - - $node->set('body', NULL)->save(); - $this->getSession()->reload(); - // The block should not appear if there is no value in the field. - $assert->pageTextNotContains($block->label()); - } - - /** - * Tests that empty image fields will still render their default value. - */ - public function testEmptyImageField() { - $source = \Drupal::moduleHandler()->getModule('image')->getPath() . '/sample.png'; - file_unmanaged_copy($source, 'public://sample.png'); - - /** @var \Drupal\file\FileInterface $file */ - $file = \Drupal::entityTypeManager() - ->getStorage('file') - ->create([ - 'uri' => 'public://sample.png', - ]); - $file->save(); - - /** @var \Drupal\field\FieldConfigInterface $field */ - $field = \Drupal::entityTypeManager() - ->getStorage('field_config') - ->load('node.ctools_block_field_test.field_image'); - $settings = $field->getSettings(); - $settings['default_image']['uuid'] = $file->uuid(); - $field->set('settings', $settings)->save(); - - $this->drupalPlaceBlock('entity_field:node:field_image', [ - 'formatter' => [ - 'type' => 'image_image', - ], - 'context_mapping' => [ - 'entity' => '@node.node_route_context:node', - ], - ]); - - $node = $this->drupalCreateNode(['type' => 'ctools_block_field_test']); - $this->drupalGet('node/' . $node->id()); - - $url = $file->getFileUri(); - $url = file_create_url($url); - $url = file_url_transform_relative($url); - $this->assertSession()->responseContains('src="' . $url . '"'); - } - - /** - * Tests using the node uid base field in a block. - */ - public function testNodeBaseFields() { - $block = $this->drupalPlaceBlock('entity_field:node:title', [ - 'formatter' => [ - 'type' => 'string', - ], - 'context_mapping' => [ - 'entity' => '@node.node_route_context:node', - ], - ]); - $node = $this->drupalCreateNode(['type' => 'ctools_block_field_test', 'uid' => 1]); - $this->drupalGet('node/' . $node->id()); - $assert = $this->assertSession(); - $assert->pageTextContains($block->label()); - $assert->pageTextContains($node->getTitle()); - } - - /** - * Tests that we are setting the render cache metadata correctly. - */ - public function testRenderCache() { - $this->drupalPlaceBlock('entity_field:node:body', [ - 'formatter' => [ - 'type' => 'text_default', - ], - 'context_mapping' => [ - 'entity' => '@node.node_route_context:node', - ], - ]); - $a = $this->drupalCreateNode(['type' => 'ctools_block_field_test']); - $b = $this->drupalCreateNode(['type' => 'ctools_block_field_test']); - - $assert = $this->assertSession(); - $this->drupalGet('node/' . $a->id()); - $assert->pageTextContains($a->body->value); - $this->drupalGet('node/' . $b->id()); - $assert->pageTextNotContains($a->body->value); - $assert->pageTextContains($b->body->value); - - $text = 'This is my text. Are you not entertained?'; - $a->body->value = $text; - $a->save(); - $this->drupalGet('node/' . $a->id()); - $assert->pageTextContains($text); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.info.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.info.yml deleted file mode 100644 index 8e7d0d53d..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Entity Mask' -# core: 8.x -type: module -description: 'Allows an entity type to borrow the fields and display configuration of another entity type.' -# version: VERSION - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.module b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.module deleted file mode 100644 index 063a8d3cc..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/ctools_entity_mask.module +++ /dev/null @@ -1,189 +0,0 @@ -getDefinitions() as $id => $entity_type) { - $mask = $entity_type->get('mask'); - - if ($mask && isset($display_modes[$mask])) { - $display_modes[$id] = $display_modes[$mask]; - } - } -} - -/** - * Implements hook_entity_view_mode_info_alter(). - */ -function ctools_entity_mask_entity_view_mode_info_alter(&$view_modes) { - ctools_entity_mask_copy_display_modes($view_modes); -} - -/** - * Implements hook_entity_form_mode_info_alter(). - */ -function ctools_entity_mask_entity_form_mode_info_alter(&$form_modes) { - ctools_entity_mask_copy_display_modes($form_modes); -} - -/** - * Implements hook_entity_type_alter(). - */ -function ctools_entity_mask_entity_type_alter(array &$entity_types) { - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */ - foreach ($entity_types as $entity_type) { - // Mask entities should use our specialized storage handler, which simulates - // a save but does not write anything to the database. - if ($entity_type->get('mask') && $entity_type->getStorageClass() == SqlContentEntityStorage::class) { - $entity_type->setStorageClass(MaskContentEntityStorage::class); - // Mask entities should not maintain any tables. - $entity_type->set('base_table', NULL); - $entity_type->set('revision_table', NULL); - $entity_type->set('data_table', NULL); - $entity_type->set('revision_data_table', NULL); - - // Nor should they be exposed to Field UI. - $entity_type->set('field_ui_base_route', NULL); - } - } -} - -/** - * Copies all components from a display for a masked entity type. - * - * If the given display is for a mask entity type, the corresponding display for - * the masked entity type is loaded and all of its components are copied into - * the given display. If no corresponding display exists for the masked entity - * type, the default display will be loaded and used. - * - * @param \Drupal\Core\Entity\Display\EntityDisplayInterface $display - * The display for the mask entity type. - */ -function ctools_entity_mask_copy_display(EntityDisplayInterface $display) { - $mask = \Drupal::entityTypeManager() - ->getDefinition($display->getTargetEntityTypeId()) - ->get('mask'); - - // If the target entity type is not masking another entity type, there is - // nothing to do here. - if (empty($mask)) { - return; - } - - // Try to load the corresponding entity display for the masked entity type, - // in descending order of preference. - $bundle = $display->getTargetBundle(); - $displays = $display::loadMultiple([ - $mask . '.' . $bundle . '.' . $display->getMode(), - $mask . '.' . $bundle . '.default', - ]); - - // Nothing to do if there is no display we can borrow components from. - if (empty($displays)) { - return; - } - foreach (reset($displays)->getComponents() as $key => $component) { - $display->setComponent($key, $component); - } -} - -/** - * Implements hook_ENTITY_TYPE_create(). - */ -function ctools_entity_mask_entity_view_display_create(EntityViewDisplayInterface $display) { - ctools_entity_mask_copy_display($display); -} - -/** - * Implements hook_ENTITY_TYPE_create(). - */ -function ctools_entity_mask_entity_form_display_create(EntityFormDisplayInterface $display) { - ctools_entity_mask_copy_display($display); -} - -/** - * Implements hook_entity_view_display_alter(). - */ -function ctools_entity_mask_entity_view_display_alter(EntityViewDisplayInterface $display, array $context) { - ctools_entity_mask_copy_display($display); -} - -/** - * Implements hook_entity_form_display_alter(). - */ -function ctools_entity_mask_entity_form_display_alter(EntityFormDisplayInterface $form_display, array $context) { - ctools_entity_mask_copy_display($form_display); -} - -/** - * Implements hook_entity_bundle_field_info(). - */ -function ctools_entity_mask_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle) { - $info = []; - - $mask = $entity_type->get('mask'); - // Nothing to do if the entity type is not masking another entity type. - if (empty($mask)) { - return $info; - } - - $storage_info = ctools_entity_mask_entity_field_storage_info($entity_type); - - /** @var \Drupal\field\FieldConfigInterface[] $fields */ - $fields = \Drupal::entityTypeManager() - ->getStorage('field_config') - ->loadByProperties([ - 'entity_type' => $mask, - 'bundle' => $bundle, - ]); - - foreach ($fields as $field) { - $field_name = $field->getName(); - - $info[$field_name] = $field - ->createDuplicate() - ->set('entity_type', $mask) - ->set('fieldStorage', $storage_info[$field_name]); - } - return $info; -} - -/** - * Implements hook_entity_field_storage_info(). - */ -function ctools_entity_mask_entity_field_storage_info(EntityTypeInterface $entity_type) { - $info = []; - - $mask = $entity_type->get('mask'); - // Nothing to do if the entity type is not masking another entity type. - if (empty($mask)) { - return $info; - } - - /** @var \Drupal\field\FieldStorageConfigInterface[] $fields */ - $fields = \Drupal::entityTypeManager() - ->getStorage('field_storage_config') - ->loadByProperties([ - 'entity_type' => $mask, - ]); - - foreach ($fields as $field) { - $field_name = $field->getName(); - $info[$field_name] = $field->createDuplicate()->set('entity_type', $mask); - } - return $info; -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/src/MaskContentEntityStorage.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/src/MaskContentEntityStorage.php deleted file mode 100644 index 0c9151107..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/src/MaskContentEntityStorage.php +++ /dev/null @@ -1,81 +0,0 @@ -uuid(); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/block_content.type.basic.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/block_content.type.basic.yml deleted file mode 100644 index f01ced96b..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/block_content.type.basic.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: basic -label: 'Basic block' -revision: 0 -description: 'A basic block contains a title and a body.' diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_form_display.block_content.basic.default.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_form_display.block_content.basic.default.yml deleted file mode 100644 index 4baffd4f8..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_form_display.block_content.basic.default.yml +++ /dev/null @@ -1,52 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - block_content.type.basic - - field.field.block_content.basic.body - - field.field.block_content.basic.field_image - - field.field.block_content.basic.field_link - - image.style.thumbnail - module: - - image - - link - - text -id: block_content.basic.default -targetEntityType: block_content -bundle: basic -mode: default -content: - body: - type: text_textarea_with_summary - weight: 1 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - region: content - field_image: - type: image_image - weight: 3 - settings: - preview_image_style: thumbnail - progress_indicator: throbber - third_party_settings: { } - region: content - field_link: - weight: 2 - settings: - placeholder_url: '' - placeholder_title: '' - third_party_settings: { } - type: link_default - region: content - info: - type: string_textfield - weight: 0 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - region: content -hidden: { } diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_view_display.block_content.basic.default.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_view_display.block_content.basic.default.yml deleted file mode 100644 index 6b554554e..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/core.entity_view_display.block_content.basic.default.yml +++ /dev/null @@ -1,46 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - block_content.type.basic - - field.field.block_content.basic.body - - field.field.block_content.basic.field_image - - field.field.block_content.basic.field_link - module: - - image - - link - - text -id: block_content.basic.default -targetEntityType: block_content -bundle: basic -mode: default -content: - body: - type: text_default - weight: 0 - label: hidden - settings: { } - third_party_settings: { } - region: content - field_image: - weight: 2 - label: above - settings: - image_style: '' - image_link: '' - third_party_settings: { } - type: image - region: content - field_link: - weight: 1 - label: above - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' - third_party_settings: { } - type: link - region: content -hidden: { } diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.body.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.body.yml deleted file mode 100644 index 89118eff0..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.body.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - block_content.type.basic - - field.storage.block_content.body - module: - - text -id: block_content.basic.body -field_name: body -entity_type: block_content -bundle: basic -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: false -field_type: text_with_summary diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_image.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_image.yml deleted file mode 100644 index 3e11e9639..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_image.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - block_content.type.basic - - field.storage.block_content.field_image - module: - - image -id: block_content.basic.field_image -field_name: field_image -entity_type: block_content -bundle: basic -label: Image -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: '[date:custom:Y]-[date:custom:m]' - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - alt_field_required: true - title_field: false - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_link.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_link.yml deleted file mode 100644 index d79e9ff02..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.field.block_content.basic.field_link.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - block_content.type.basic - - field.storage.block_content.field_link - module: - - link -id: block_content.basic.field_link -field_name: field_link -entity_type: block_content -bundle: basic -label: Link -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - link_type: 17 - title: 1 -field_type: link diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_image.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_image.yml deleted file mode 100644 index 6e0ba2464..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_image.yml +++ /dev/null @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - block_content - - file - - image -id: block_content.field_image -field_name: field_image -entity_type: block_content -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_link.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_link.yml deleted file mode 100644 index bddf13e1c..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/config/install/field.storage.block_content.field_link.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - block_content - - link -id: block_content.field_link -field_name: field_link -entity_type: block_content -type: link -settings: { } -module: link -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.info.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.info.yml deleted file mode 100644 index 46be42c73..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Entity Mask test' -# core: 8.x -type: module -dependencies: - - block_content - - ctools_entity_mask - - image - - text - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.routing.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.routing.yml deleted file mode 100644 index 85d2c8d3b..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/entity_mask_test.routing.yml +++ /dev/null @@ -1,9 +0,0 @@ -fake_block_content.add_form: - path: '/fake-block/add/{block_content_type}' - defaults: - _controller: '\Drupal\block_content\Controller\BlockContentController::addForm' - _title_callback: 'Drupal\block_content\Controller\BlockContentController::getAddFormTitle' - options: - _admin_route: TRUE - requirements: - _permission: 'administer blocks' diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/src/Entity/BlockContent.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/src/Entity/BlockContent.php deleted file mode 100644 index 754466848..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/modules/entity_mask_test/src/Entity/BlockContent.php +++ /dev/null @@ -1,70 +0,0 @@ -drupalCreateUser(['administer blocks']); - $this->drupalLogin($account); - } - - /** - * Tests that the form display for a masked entity replicates its source. - */ - public function testFormDisplay() { - $assert = $this->assertSession(); - - $this->drupalGet('/fake-block/add/basic'); - $assert->statusCodeEquals(200); - $assert->fieldExists('Body'); - $assert->fieldExists('Link'); - $assert->fieldExists('Image'); - } - - /** - * Tests that the view display for a masked entity replicates its source. - */ - public function testViewDisplay() { - // Generate a random image for the image field, since that can potentially - // be tricky. - $image_uri = uniqid('public://') . '.png'; - $image_uri = $this->getRandomGenerator()->image($image_uri, '100x100', '200x200'); - $image = File::create(['uri' => $image_uri]); - $image->save(); - - $body = 'Qui animated corpse, cricket bat max brucks terribilem incessu zomby.'; - $link = 'https://www.drupal.org/project/ctools'; - - $block = BlockContent::create([ - 'type' => 'basic', - 'body' => $body, - 'field_link' => $link, - 'field_image' => $image, - ]); - $block->save(); - - // Ensure that the entity is intact after serialization and deserialization, - // since that may prove to be a common storage mechanism for mask entities. - $block = serialize($block); - $block = unserialize($block); - - $this->assertSame($body, $block->body->value); - $this->assertSame($link, $block->field_link->uri); - $this->assertSame($image_uri, $block->field_image->entity->getFileUri()); - - $build = \Drupal::entityTypeManager() - ->getViewBuilder('fake_block_content') - ->view($block); - - // If the fields are not in the renderable array, something has gone awry. - $this->assertArrayHasKey('body', $build); - $this->assertArrayHasKey('field_link', $build); - $this->assertArrayHasKey('field_image', $build); - - // Render the block and check the output too, just to be sure. - $rendered = \Drupal::service('renderer')->renderRoot($build); - $rendered = (string) $rendered; - - $this->assertContains($block->body->value, $rendered); - $this->assertContains($block->field_link->uri, $rendered); - - $image_url = $block->field_image->entity->getFileUri(); - $image_url = file_create_url($image_url); - // file_create_url() will include the host and port, but the rendered output - // won't include those. - $image_url = file_url_transform_relative($image_url); - $this->assertContains($image_url, $rendered); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/src/Kernel/EntityMaskTest.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/src/Kernel/EntityMaskTest.php deleted file mode 100644 index 273a1a457..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_entity_mask/tests/src/Kernel/EntityMaskTest.php +++ /dev/null @@ -1,216 +0,0 @@ -installConfig(['block_content', 'entity_mask_test']); - $this->installEntitySchema('fake_block_content'); - } - - /** - * Tests that fields are correctly masked. - */ - public function testFields() { - $block = BlockContent::create([ - 'type' => 'basic', - ]); - - $this->assertTrue($block->hasField('body')); - $this->assertTrue($block->hasField('field_link')); - $this->assertTrue($block->hasField('field_image')); - } - - /** - * Tests that entity view displays are correctly masked. - */ - public function testViewDisplays() { - $view_modes = $this->container - ->get('entity_display.repository') - ->getAllViewModes(); - $this->assertSame($view_modes['block_content'], $view_modes['fake_block_content']); - - $display = entity_get_display('fake_block_content', 'basic', 'default'); - $this->assertTrue($display->isNew()); - - $components = $display->getComponents(); - $this->assertArrayHasKey('body', $components); - $this->assertArrayHasKey('field_link', $components); - $this->assertArrayHasKey('field_image', $components); - } - - /** - * Tests that entity form displays are correctly masked. - */ - public function testFormDisplays() { - EntityFormMode::create([ - 'id' => 'block_content.foobar', - 'label' => $this->randomString(), - 'targetEntityType' => 'block_content', - ])->save(); - - $form_modes = $this->container - ->get('entity_display.repository') - ->getAllFormModes(); - $this->assertSame($form_modes['block_content'], $form_modes['fake_block_content']); - - $display = entity_get_form_display('fake_block_content', 'basic', 'default'); - $this->assertTrue($display->isNew()); - - $components = $display->getComponents(); - $this->assertArrayHasKey('body', $components); - $this->assertArrayHasKey('field_link', $components); - $this->assertArrayHasKey('field_image', $components); - } - - /** - * Tests that mask entity types define no tables. - */ - public function testNoTables() { - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */ - $entity_type = $this->container - ->get('entity_type.manager') - ->getDefinition('fake_block_content'); - - $this->assertNull($entity_type->getBaseTable()); - $this->assertNull($entity_type->getDataTable()); - $this->assertNull($entity_type->getRevisionTable()); - $this->assertNull($entity_type->getRevisionDataTable()); - } - - /** - * Tests that mask entity types are not exposed to Field UI. - */ - public function testNotExposedToFieldUI() { - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */ - $entity_type = $this->container - ->get('entity_type.manager') - ->getDefinition('fake_block_content'); - - $this->assertNull($entity_type->get('field_ui_base_route')); - } - - /** - * Asserts that a mask entity can be serialized and de-serialized coherently. - * - * @depends testFields - */ - public function testSerialization() { - $body = $this->getRandomGenerator()->paragraphs(2); - $link = 'https://www.drupal.org/project/ctools'; - - /** @var \Drupal\Core\Entity\EntityInterface $block */ - $block = BlockContent::create([ - 'type' => 'basic', - 'body' => $body, - 'field_link' => $link, - ]); - - $block = serialize($block); - $block = unserialize($block); - - $this->assertSame($body, $block->body->value); - $this->assertSame($link, $block->field_link->uri); - } - - /** - * Tests that mask entities' isNew() method behaves consistently. - */ - public function testIsNew() { - $block = BlockContent::create(['type' => 'basic']); - $this->assertTrue($block->isNew()); - $block->save(); - $this->assertFalse($block->isNew()); - } - - /** - * Tests that mask entities' id() method returns the UUID. - */ - public function testId() { - $block = BlockContent::create(['type' => 'basic']); - $this->assertSame($block->id(), $block->uuid()); - $block->save(); - $this->assertSame($block->id(), $block->uuid()); - } - - /** - * Tests that mask entities cannot be loaded. - * - * @depends testId - */ - public function testLoad() { - $block = BlockContent::create(['type' => 'basic']); - $block->save(); - - /** @var \Drupal\Core\Entity\EntityStorageInterface $storage */ - $storage = $this->container->get('entity_type.manager')->getStorage('fake_block_content'); - - $id = $block->id(); - $this->assertNull($storage->load($id)); - $this->assertEmpty($storage->loadMultiple([$id])); - } - - /** - * Tests that deleting a mask entity doesn't throw an exception or anything. - */ - public function testDelete() { - $block = BlockContent::create(['type' => 'basic']); - $block->save(); - $block->delete(); - } - - /** - * Tests that mask entities have field data after save. - * - * @depends testFields - * @depends testNoTables - */ - public function testSave() { - $body = $this->getRandomGenerator()->paragraphs(2); - $link = 'https://www.drupal.org/project/ctools'; - - /** @var \Drupal\Core\Entity\EntityInterface $block */ - $block = BlockContent::create([ - 'type' => 'basic', - 'body' => $body, - 'field_link' => $link, - ]); - - // Ensure that the field values are preserved after save... - $this->assertSame($body, $block->body->value); - $this->assertSame($link, $block->field_link->uri); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.info.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.info.yml deleted file mode 100644 index 9f3898ee1..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Chaos Tools Views -type: module -description: 'A set of improvements to the core Views code that allows for greater control over Blocks.' -package: Chaos tool suite (Experimental) -# version: 3.x -# core: 8.x -dependencies: - - drupal:block - - drupal:views - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.module b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.module deleted file mode 100644 index 845feb6a0..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/ctools_views.module +++ /dev/null @@ -1,104 +0,0 @@ - 'string', - 'label' => 'Pager type' - ]; - $definitions['views_block']['mapping']['fields'] = [ - 'type' => 'sequence', - 'label' => 'Fields settings', - 'sequence' => [ - [ - 'type' => 'mapping', - 'label' => 'Field settings', - 'mapping' => [ - 'hide' => [ - 'type' => 'boolean', - 'label' => 'Hide field', - ], - 'weight' => [ - 'type' => 'integer', - 'label' => 'Field weight', - ], - ], - ], - ], - ]; - $definitions['views_block']['mapping']['filter'] = [ - 'type' => 'sequence', - 'label' => 'Filters settings', - 'sequence' => [ - [ - 'type' => 'mapping', - 'label' => 'Filter settings', - 'mapping' => [ - 'type' => [ - 'type' => 'string', - 'label' => 'Plugin id', - ], - 'disable' => [ - 'type' => 'boolean', - 'label' => 'Disable filter', - ], - ], - ], - ], - ]; - $definitions['views_block']['mapping']['sort'] = [ - 'type' => 'sequence', - 'label' => 'Sort settings', - 'sequence' => [ - [ - 'type' => 'string', - 'label' => 'Sort order value', - ], - ], - ]; - $definitions['views_block']['mapping']['pager_offset'] = [ - 'type' => 'integer', - 'label' => 'Pager offset' - ]; - - // Add to the views block display plugin schema. - $definitions['views.display.block']['mapping']['allow']['mapping']['offset'] = [ - 'type' => 'string', - 'label' => 'Pager offset', - ]; - $definitions['views.display.block']['mapping']['allow']['mapping']['pager'] = [ - 'type' => 'string', - 'label' => 'Pager type', - ]; - $definitions['views.display.block']['mapping']['allow']['mapping']['hide_fields'] = [ - 'type' => 'string', - 'label' => 'Hide fields', - ]; - $definitions['views.display.block']['mapping']['allow']['mapping']['sort_fields'] = [ - 'type' => 'string', - 'label' => 'Sort fields', - ]; - $definitions['views.display.block']['mapping']['allow']['mapping']['disable_filters'] = [ - 'type' => 'string', - 'label' => 'Disable filters', - ]; - $definitions['views.display.block']['mapping']['allow']['mapping']['configure_sorts'] = [ - 'type' => 'string', - 'label' => 'Configure sorts', - ]; -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Plugin/Display/Block.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Plugin/Display/Block.php deleted file mode 100644 index 7ebc1b1fd..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Plugin/Display/Block.php +++ /dev/null @@ -1,440 +0,0 @@ -getOption('allow')); - $filter_options = [ - 'items_per_page' => $this->t('Items per page'), - 'offset' => $this->t('Pager offset'), - 'pager' => $this->t('Pager type'), - 'hide_fields' => $this->t('Hide fields'), - 'sort_fields' => $this->t('Reorder fields'), - 'disable_filters' => $this->t('Disable filters'), - 'configure_sorts' => $this->t('Configure sorts') - ]; - $filter_intersect = array_intersect_key($filter_options, $filtered_allow); - - $options['allow'] = array( - 'category' => 'block', - 'title' => $this->t('Allow settings'), - 'value' => empty($filtered_allow) ? $this->t('None') : implode(', ', $filter_intersect), - ); - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - $options = $form['allow']['#options']; - $options['offset'] = $this->t('Pager offset'); - $options['pager'] = $this->t('Pager type'); - $options['hide_fields'] = $this->t('Hide fields'); - $options['sort_fields'] = $this->t('Reorder fields'); - $options['disable_filters'] = $this->t('Disable filters'); - $options['configure_sorts'] = $this->t('Configure sorts'); - $form['allow']['#options'] = $options; - // Update the items_per_page if set. - $defaults = []; - if (!empty($form['allow']['#default_value'])) { - $defaults = array_filter($form['allow']['#default_value']); - if (!empty($defaults['items_per_page'])) { - $defaults['items_per_page'] = 'items_per_page'; - } - } - - $form['allow']['#default_value'] = $defaults; - } - - /** - * {@inheritdoc} - */ - public function blockForm(ViewsBlock $block, array &$form, FormStateInterface $form_state) { - $form = parent::blockForm($block, $form, $form_state); - - $allow_settings = array_filter($this->getOption('allow')); - $block_configuration = $block->getConfiguration(); - - // Modify "Items per page" block settings form. - if (!empty($allow_settings['items_per_page'])) { - // Items per page - $form['override']['items_per_page']['#type'] = 'number'; - unset($form['override']['items_per_page']['#options']); - } - - // Provide "Pager offset" block settings form. - if (!empty($allow_settings['offset'])) { - $form['override']['pager_offset'] = [ - '#type' => 'number', - '#title' => $this->t('Pager offset'), - '#default_value' => isset($block_configuration['pager_offset']) ? $block_configuration['pager_offset'] : 0, - '#description' => $this->t('For example, set this to 3 and the first 3 items will not be displayed.'), - ]; - } - - // Provide "Pager type" block settings form. - if (!empty($allow_settings['pager'])) { - $pager_options = [ - 'view' => $this->t('Inherit from view'), - 'some' => $this->t('Display a specified number of items'), - 'none' => $this->t('Display all items') - ]; - $form['override']['pager'] = [ - '#type' => 'radios', - '#title' => $this->t('Pager'), - '#options' => $pager_options, - '#default_value' => isset($block_configuration['pager']) ? $block_configuration['pager'] : 'view' - ]; - } - - // Provide "Hide fields" / "Reorder fields" block settings form. - if (!empty($allow_settings['hide_fields']) || !empty($allow_settings['sort_fields'])) { - // Set up the configuration table for hiding / sorting fields. - $fields = $this->getHandlers('field'); - $header = []; - if (!empty($allow_settings['hide_fields'])) { - $header['hide'] = $this->t('Hide'); - } - $header['label'] = $this->t('Label'); - if (!empty($allow_settings['sort_fields'])) { - $header['weight'] = $this->t('Weight'); - } - $form['override']['order_fields'] = [ - '#type' => 'table', - '#header' => $header, - '#rows' => array(), - ]; - if (!empty($allow_settings['sort_fields'])) { - $form['override']['order_fields']['#tabledrag'] = [ - [ - 'action' => 'order', - 'relationship' => 'sibling', - 'group' => 'field-weight', - ] - ]; - $form['override']['order_fields']['#attributes'] = ['id' => 'order-fields']; - } - - // Sort available field plugins by their currently configured weight. - $sorted_fields = []; - if (!empty($allow_settings['sort_fields']) && isset($block_configuration['fields'])) { - uasort($block_configuration['fields'], '\Drupal\ctools_views\Plugin\Display\Block::sortFieldsByWeight'); - foreach (array_keys($block_configuration['fields']) as $field_name) { - if (!empty($fields[$field_name])) { - $sorted_fields[$field_name] = $fields[$field_name]; - unset($fields[$field_name]); - } - } - if (!empty($fields)) { - foreach ($fields as $field_name => $field_info) { - $sorted_fields[$field_name] = $field_info; - } - } - } - else { - $sorted_fields = $fields; - } - - // Add each field to the configuration table. - foreach ($sorted_fields as $field_name => $plugin) { - $field_label = $plugin->adminLabel(); - if (!empty($plugin->options['label'])) { - $field_label .= ' (' . $plugin->options['label'] . ')'; - } - if (!empty($allow_settings['sort_fields'])) { - $form['override']['order_fields'][$field_name]['#attributes']['class'][] = 'draggable'; - } - $form['override']['order_fields'][$field_name]['#weight'] = !empty($block_configuration['fields'][$field_name]['weight']) ? $block_configuration['fields'][$field_name]['weight'] : 0; - if (!empty($allow_settings['hide_fields'])) { - $form['override']['order_fields'][$field_name]['hide'] = [ - '#type' => 'checkbox', - '#default_value' => !empty($block_configuration['fields'][$field_name]['hide']) ? $block_configuration['fields'][$field_name]['hide'] : 0, - ]; - } - $form['override']['order_fields'][$field_name]['label'] = [ - '#markup' => $field_label, - ]; - if (!empty($allow_settings['sort_fields'])) { - $form['override']['order_fields'][$field_name]['weight'] = [ - '#type' => 'weight', - '#title' => $this->t('Weight for @title', ['@title' => $field_label]), - '#title_display' => 'invisible', - '#delta' => 50, - '#default_value' => !empty($block_configuration['fields'][$field_name]['weight']) ? $block_configuration['fields'][$field_name]['weight'] : 0, - '#attributes' => ['class' => ['field-weight']], - ]; - } - } - } - - // Provide "Configure filters" / "Disable filters" block settings form. - if (!empty($allow_settings['disable_filters'])) { - $items = []; - foreach ((array) $this->getOption('filters') as $filter_name => $item) { - $item['value'] = isset($block_configuration["filter"][$filter_name]['value']) ? $block_configuration["filter"][$filter_name]['value'] : ''; - $items[$filter_name] = $item; - } - $this->setOption('filters', $items); - $filters = $this->getHandlers('filter'); - - // Add a settings form for each exposed filter to configure or hide it. - foreach ($filters as $filter_name => $plugin) { - if ($plugin->isExposed() && $exposed_info = $plugin->exposedInfo()) { - $form['override']['filters'][$filter_name] = [ - '#type' => 'details', - '#title' => $exposed_info['label'], - ]; - $form['override']['filters'][$filter_name]['plugin'] = [ - '#type' => 'value', - '#value' => $plugin, - ]; - // Render "Disable filters" settings form. - if (!empty($allow_settings['disable_filters'])) { - $form['override']['filters'][$filter_name]['disable'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Disable'), - '#default_value' => !empty($block_configuration['filter'][$filter_name]['disable']) ? $block_configuration['filter'][$filter_name]['disable'] : 0, - ]; - } - } - } - } - - // Provide "Configure sorts" block settings form. - if (!empty($allow_settings['configure_sorts'])) { - $sorts = $this->getHandlers('sort'); - $options = array( - 'ASC' => $this->t('Sort ascending'), - 'DESC' => $this->t('Sort descending'), - ); - foreach ($sorts as $sort_name => $plugin) { - $form['override']['sort'][$sort_name] = [ - '#type' => 'details', - '#title' => $plugin->adminLabel(), - ]; - $form['override']['sort'][$sort_name]['plugin'] = [ - '#type' => 'value', - '#value' => $plugin, - ]; - $form['override']['sort'][$sort_name]['order'] = array( - '#title' => $this->t('Order'), - '#type' => 'radios', - '#options' => $options, - '#default_value' => $plugin->options['order'] - ); - - // Set default values for sorts for this block. - if (!empty($block_configuration["sort"][$sort_name])) { - $form['override']['sort'][$sort_name]['order']['#default_value'] = $block_configuration["sort"][$sort_name]; - } - } - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function blockSubmit(ViewsBlock $block, $form, FormStateInterface $form_state) { - // Set default value for items_per_page if left blank. - if (empty($form_state->getValue(array('override', 'items_per_page')))) { - $form_state->setValue(array('override', 'items_per_page'), "none"); - } - - parent::blockSubmit($block, $form, $form_state); - $configuration = $block->getConfiguration(); - $allow_settings = array_filter($this->getOption('allow')); - - // Save "Pager type" settings to block configuration. - if (!empty($allow_settings['pager'])) { - if ($pager = $form_state->getValue(['override', 'pager'])) { - $configuration['pager'] = $pager; - } - } - - // Save "Pager offset" settings to block configuration. - if (!empty($allow_settings['offset'])) { - $configuration['pager_offset'] = $form_state->getValue(['override', 'pager_offset']); - } - - // Save "Hide fields" / "Reorder fields" settings to block configuration. - if (!empty($allow_settings['hide_fields']) || !empty($allow_settings['sort_fields'])) { - if ($fields = array_filter($form_state->getValue(['override', 'order_fields']))) { - uasort($fields, '\Drupal\ctools_views\Plugin\Display\Block::sortFieldsByWeight'); - $configuration['fields'] = $fields; - } - } - - // Save "Configure filters" / "Disable filters" settings to block - // configuration. - unset($configuration['filter']); - if (!empty($allow_settings['disable_filters'])) { - if ($filters = $form_state->getValue(['override', 'filters'])) { - foreach ($filters as $filter_name => $filter) { - /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $plugin */ - $plugin = $form_state->getValue(['override', 'filters', $filter_name, 'plugin']); - $configuration["filter"][$filter_name]['type'] = $plugin->getPluginId(); - - // Check if we want to disable this filter. - if (!empty($allow_settings['disable_filters'])) { - $disable = $form_state->getValue(['override', 'filters', $filter_name, 'disable']); - // If marked disabled, we don't really care about other stuff. - if ($disable) { - $configuration["filter"][$filter_name]['disable'] = $disable; - continue; - } - } - } - } - } - - // Save "Configure sorts" settings to block configuration. - if (!empty($allow_settings['configure_sorts'])) { - $sorts = $form_state->getValue(['override', 'sort']); - foreach ($sorts as $sort_name => $sort) { - $plugin = $sort['plugin']; - // Check if we want to override the default sort order - if ($plugin->options['order'] != $sort['order']) { - $configuration['sort'][$sort_name] = $sort['order']; - } - } - } - - $block->setConfiguration($configuration); - } - - /** - * {@inheritdoc} - */ - public function preBlockBuild(ViewsBlock $block) { - parent::preBlockBuild($block); - - $allow_settings = array_filter($this->getOption('allow')); - $config = $block->getConfiguration(); - list(, $display_id) = explode('-', $block->getDerivativeId(), 2); - - // Change pager offset settings based on block configuration. - if (!empty($allow_settings['offset'])) { - $this->view->setOffset($config['pager_offset']); - } - - // Change pager style settings based on block configuration. - if (!empty($allow_settings['pager'])) { - $pager = $this->view->display_handler->getOption('pager'); - if (!empty($config['pager']) && $config['pager'] != 'view') { - $pager['type'] = $config['pager']; - } - $this->view->display_handler->setOption('pager', $pager); - } - - // Change fields output based on block configuration. - if (!empty($allow_settings['hide_fields']) || !empty($allow_settings['sort_fields'])) { - if (!empty($config['fields']) && $this->view->getStyle()->usesFields()) { - $fields = $this->view->getHandlers('field'); - uasort($config['fields'], '\Drupal\ctools_views\Plugin\Display\Block::sortFieldsByWeight'); - $iterate_fields = !empty($allow_settings['sort_fields']) ? $config['fields'] : $fields; - foreach (array_keys($iterate_fields) as $field_name) { - // Remove each field in sequence and re-add them to sort - // appropriately or hide if disabled. - $this->view->removeHandler($display_id, 'field', $field_name); - if (empty($allow_settings['hide_fields']) || (!empty($allow_settings['hide_fields']) && empty($config['fields'][$field_name]['hide']))) { - $this->view->addHandler($display_id, 'field', $fields[$field_name]['table'], $fields[$field_name]['field'], $fields[$field_name], $field_name); - } - } - } - } - - // Change filters output based on block configuration. - if (!empty($allow_settings['disable_filters'])) { - $filters = $this->view->getHandlers('filter', $display_id); - foreach ($filters as $filter_name => $filter) { - // If we allow disabled filters and this filter is disabled, disable it - // and continue. - if (!empty($allow_settings['disable_filters']) && !empty($config["filter"][$filter_name]['disable'])) { - $this->view->removeHandler($display_id, 'filter', $filter_name); - continue; - } - } - } - - // Change sorts based on block configuration. - if (!empty($allow_settings['configure_sorts'])) { - $sorts = $this->view->getHandlers('sort', $display_id); - foreach ($sorts as $sort_name => $sort) { - if (!empty($config["sort"][$sort_name])) { - $sort['order'] = $config["sort"][$sort_name]; - $this->view->setHandler($display_id, 'sort', $sort_name, $sort); - } - } - } - } - - protected function getFilterOptionsValue(array $filter, array $config) { - $plugin_definition = \Drupal::service('plugin.manager.views.filter')->getDefinition($config['type']); - if (is_subclass_of($plugin_definition['class'], '\Drupal\views\Plugin\views\filter\InOperator')) { - return array_values($config['value']); - } - return $config['value'][$filter['expose']['identifier']]; - } - - /** - * {@inheritdoc} - */ - public function usesExposed() { - $filters = $this->getHandlers('filter'); - foreach ($filters as $filter_name => $filter) { - if ($filter->isExposed() && !empty($filter->exposedInfo())) { - return TRUE; - } - } - return FALSE; - } - - /** - * Exposed widgets typically only work with ajax in Drupal core, however - * #2605218 totally breaks the rest of the functionality in this display and - * in Core's Block display as well, so we allow non-ajax block views to use - * exposed filters and manually set the #action to the current request uri. - */ - public function elementPreRender(array $element) { - /** @var \Drupal\views\ViewExecutable $view */ - $view = $element['#view']; - if (!empty($view->exposed_widgets['#action']) && !$view->ajaxEnabled()) { - $view->exposed_widgets['#action'] = \Drupal::request()->getRequestUri(); - } - return parent::elementPreRender($element); - } - - /** - * Sort field config array by weight. - * - * @param $a - * @param $b - * @return int - */ - public static function sortFieldsByWeight($a, $b) { - $a_weight = isset($a['weight']) ? $a['weight'] : 0; - $b_weight = isset($b['weight']) ? $b['weight'] : 0; - if ($a_weight == $b_weight) { - return 0; - } - return ($a_weight < $b_weight) ? -1 : 1; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php deleted file mode 100644 index 559f38ba9..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php +++ /dev/null @@ -1,350 +0,0 @@ -storage = $this->container->get('entity_type.manager')->getStorage('block'); - } - - /** - * Test ctools_views "items_per_page" configuration. - */ - public function testItemsPerPage() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_pager/' . $default_theme); - $this->assertFieldByXPath('//input[@type="number" and @name="settings[override][items_per_page]"]', NULL, 'items_per_page setting is a number field'); - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 0; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_pager/' . $default_theme, $edit, $this->t('Save block')); - - // Assert items per page default settings. - $this->drupalGet(''); - $result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2'); - $this->assertEqual((string) $result[0], 'CTools Views Pager Block'); - $this->assertRaw('Showing 3 records on page 1'); - $this->assertEqual(3, count($this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table/tbody/tr'))); - - // Override items per page settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 2; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_pager', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_pager'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual(2, $config['items_per_page'], "'Items per page' is properly saved."); - - // Assert items per page overridden settings. - $this->drupalGet(''); - $result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2'); - $this->assertEqual((string) $result[0], 'CTools Views Pager Block'); - $this->assertRaw('Showing 2 records on page 1'); - $this->assertEqual(2, count($this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table/tbody/tr'))); - $this->assertEqual([1, 2], $this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table//tr//td[contains(@class, "views-field-id")]')); - } - - /** - * Test ctools_views "offset" configuration. - */ - public function testOffset() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_pager/' . $default_theme); - $this->assertFieldByXPath('//input[@type="number" and @name="settings[override][pager_offset]"]', NULL, 'items_per_page setting is a number field'); - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 0; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_pager/' . $default_theme, $edit, $this->t('Save block')); - - // Assert pager offset default settings. - $this->drupalGet(''); - $this->assertEqual([1, 2, 3], $this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table//tr//td[contains(@class, "views-field-id")]')); - - // Override pager offset settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 0; - $edit['settings[override][pager_offset]'] = 1; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_pager', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_pager'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual(1, $config['pager_offset'], "'Pager offset' is properly saved."); - - // Assert pager offset overridden settings. - $this->drupalGet(''); - $this->assertEqual([2, 3, 4], $this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table//tr//td[contains(@class, "views-field-id")]')); - } - - /** - * Test ctools_views "pager" configuration. - */ - public function testPager() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_pager/' . $default_theme); - $this->assertFieldById('edit-settings-override-pager-view', 'view'); - $this->assertFieldById('edit-settings-override-pager-some'); - $this->assertFieldById('edit-settings-override-pager-none'); - - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 0; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_pager/' . $default_theme, $edit, $this->t('Save block')); - - // Assert pager default settings. - $this->drupalGet(''); - $this->assertText('Page 1'); - $this->assertText('Next ›'); - - // Override pager settings to 'some'. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 0; - $edit['settings[override][pager]'] = 'some'; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_pager', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_pager'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual('some', $config['pager'], "'Pager' setting is properly saved."); - - // Assert pager overridden settings to 'some', showing no pager. - $this->drupalGet(''); - $this->assertEqual(3, count($this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table/tbody/tr'))); - $this->assertNoText('Page 1'); - $this->assertNoText('Next ›'); - - // Override pager settings to 'none'. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][items_per_page]'] = 0; - $edit['settings[override][pager]'] = 'none'; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_pager', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_pager'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual('none', $config['pager'], "'Pager' setting is properly saved."); - - // Assert pager overridden settings to 'some', showing no pager. - $this->drupalGet(''); - $this->assertEqual(5, count($this->xpath('//div[contains(@class, "view-display-id-block_pager")]//table/tbody/tr'))); - $this->assertNoText('Page 1'); - $this->assertNoText('Next ›'); - } - - /** - * Test ctools_views 'hide_fields' configuration. - */ - public function testHideFields() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_fields/' . $default_theme); - $this->assertFieldById('edit-settings-override-order-fields-id-hide'); - - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_fields/' . $default_theme, $edit, $this->t('Save block')); - - // Assert hide_fields default settings. - $this->drupalGet(''); - $this->assertEqual(5, count($this->xpath('//div[contains(@class, "view-display-id-block_fields")]//table//td[contains(@class, "views-field-id")]'))); - - // Override hide_fields settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][order_fields][id][hide]'] = 1; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_fields', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_fields'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual(1, $config['fields']['id']['hide'], "'hide_fields' setting is properly saved."); - $this->assertEqual(0, $config['fields']['name']['hide'], "'hide_fields' setting is properly saved."); - - // Assert hide_fields overridden settings. - $this->drupalGet(''); - $this->assertEqual(0, count($this->xpath('//div[contains(@class, "view-display-id-block_fields")]//table//td[contains(@class, "views-field-id")]'))); - } - - /** - * Test ctools_views 'sort_fields' configuration. - */ - public function testOrderFields() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_fields/' . $default_theme); - $this->assertFieldById('edit-settings-override-order-fields-id-weight', 0); - - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_fields/' . $default_theme, $edit, $this->t('Save block')); - - // Assert sort_fields default settings. - $this->drupalGet(''); - // Check that the td with class "views-field-id" is the first td in the first tr element. - $this->assertEqual(0, count($this->xpath('count(//div[contains(@class, "view-display-id-block_fields")]//table//tr[1]//td[contains(@class, "views-field-id")]/preceding-sibling::td)'))); - - // Override sort_fields settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][order_fields][name][weight]'] = -50; - $edit['settings[override][order_fields][age][weight]'] = -49; - $edit['settings[override][order_fields][job][weight]'] = -48; - $edit['settings[override][order_fields][created][weight]'] = -47; - $edit['settings[override][order_fields][id][weight]'] = -46; - $edit['settings[override][order_fields][name_1][weight]'] = -45; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_fields', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_fields'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual(-46, $config['fields']['id']['weight'], "'sort_fields' setting is properly saved."); - $this->assertEqual(-50, $config['fields']['name']['weight'], "'sort_fields' setting is properly saved."); - - // Assert sort_fields overridden settings. - $this->drupalGet(''); - - // Check that the td with class "views-field-id" is the 5th td in the first tr element. - $this->assertEqual(4, count($this->xpath('//div[contains(@class, "view-display-id-block_fields")]//table//tr[1]//td[contains(@class, "views-field-id")]/preceding-sibling::td'))); - - // Check that duplicate fields in the View produce expected outpu - $name1_element = $this->xpath('//div[contains(@class, "view-display-id-block_fields")]//table//tr[1]/td[contains(@class, "views-field-name")]/text()'); - $name1 = (string) $name1_element[0]; - $this->assertEqual("John", trim($name1)); - $name2_element = $this->xpath('//div[contains(@class, "view-display-id-block_fields")]//table//tr[1]/td[contains(@class, "views-field-name-1")]/text()'); - $name2 = (string) $name2_element[0]; - $this->assertEqual("John", trim($name2)); - } - - /** - * Test ctools_views 'disable_filters' configuration. - */ - public function testDisableFilters() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_filter/' . $default_theme); - $this->assertFieldById('edit-settings-override-filters-status-disable'); - $this->assertFieldById('edit-settings-override-filters-job-disable'); - - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_filter/' . $default_theme, $edit, $this->t('Save block')); - - // Assert disable_filters default settings. - $this->drupalGet(''); - // Check that the default settings show both filters - $this->assertFieldByXPath('//select[@name="status"]'); - $this->assertFieldByXPath('//input[@name="job"]'); - - // Override disable_filters settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][filters][status][disable]'] = 1; - $edit['settings[override][filters][job][disable]'] = 1; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_filter', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_filter'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual(1, $config['filter']['status']['disable'], "'disable_filters' setting is properly saved."); - $this->assertEqual(1, $config['filter']['job']['disable'], "'disable_filters' setting is properly saved."); - - // Assert disable_filters overridden settings. - $this->drupalGet(''); - $this->assertNoFieldByXPath('//select[@name="status"]'); - $this->assertNoFieldByXPath('//input[@name="job"]'); - } - - /** - * Test ctools_views 'configure_sorts' configuration. - */ - public function testConfigureSorts() { - $default_theme = $this->config('system.theme')->get('default'); - - // Get the "Configure block" form for our Views block. - $this->drupalGet('admin/structure/block/add/views_block:ctools_views_test_view-block_sort/' . $default_theme); - $this->assertFieldByXPath('//input[@name="settings[override][sort][id][order]"]'); - - // Add block to sidebar_first region with default settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $this->drupalPostForm('admin/structure/block/add/views_block:ctools_views_test_view-block_sort/' . $default_theme, $edit, $this->t('Save block')); - - // Assert configure_sorts default settings. - $this->drupalGet(''); - // Check that the results are sorted ASC - $element = $this->xpath('//div[contains(@class, "view-display-id-block_sort")]//table//tr[1]/td[1]/text()'); - $value = (string) $element[0]; - $this->assertEqual("1", trim($value)); - - // Override configure_sorts settings. - $edit = array(); - $edit['region'] = 'sidebar_first'; - $edit['settings[override][sort][id][order]'] = "DESC"; - $this->drupalPostForm('admin/structure/block/manage/views_block__ctools_views_test_view_block_sort', $edit, $this->t('Save block')); - - $block = $this->storage->load('views_block__ctools_views_test_view_block_sort'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEqual("DESC", $config['sort']['id'], "'configure_sorts' setting is properly saved."); - - // Assert configure_sorts overridden settings. - // Check that the results are sorted DESC - $this->drupalGet(''); - $element = $this->xpath('//div[contains(@class, "view-display-id-block_sort")]//table//tr[1]/td[1]/text()'); - $value = (string) $element[0]; - $this->assertEqual("5", trim($value)); - } -} diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/ctools_views_test_views.info.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/ctools_views_test_views.info.yml deleted file mode 100644 index d476c0518..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/ctools_views_test_views.info.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'CTools Views test views' -type: module -description: 'Provides default views for CTools Views tests.' -package: Testing -# core: 8.x -dependencies: - - views - - block - - entity_test - - ctools_views - - text - - user - - node - - taxonomy - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_entity_test.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_entity_test.yml deleted file mode 100644 index fbdfb3e9c..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_entity_test.yml +++ /dev/null @@ -1,543 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - node.type.ctools_views - - taxonomy.vocabulary.tags - module: - - datetime - - node - - options - - taxonomy - - user -id: ctools_views_entity_test -label: 'CTools Views Entity Test View' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - offset: 0 - style: - type: table - row: - type: fields - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - ctools_views: ctools_views - entity_type: node - entity_field: type - plugin_id: bundle - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'CTools Views Entity Test View' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: { } - block_filter_date: - display_plugin: block - id: block_filter_date - display_title: 'Date filter' - position: 4 - display_options: - display_extenders: { } - display_description: '' - title: 'Date filter' - defaults: - title: false - filters: false - filter_groups: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - ctools_views: ctools_views - entity_type: node - entity_field: type - plugin_id: bundle - group: 1 - field_ctools_views_date_value: - id: field_ctools_views_date_value - table: node__field_ctools_views_date - field: field_ctools_views_date_value - relationship: none - group_type: group - admin_label: '' - operator: between - group: 1 - exposed: true - expose: - operator_id: field_ctools_views_date_value_op - label: 'CTools Views Date (field_ctools_views_date)' - description: '' - use_operator: false - operator: field_ctools_views_date_value_op - identifier: field_ctools_views_date_value - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator1: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: datetime - filter_groups: - operator: AND - groups: - 1: AND - allow: - items_per_page: false - offset: '0' - pager: '0' - hide_fields: '0' - sort_fields: '0' - disable_filters: '0' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: { } - block_filter_list: - display_plugin: block - id: block_filter_list - display_title: 'List filter' - position: 3 - display_options: - display_extenders: { } - display_description: '' - title: 'List filter' - defaults: - title: false - filters: false - filter_groups: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - ctools_views: ctools_views - entity_type: node - entity_field: type - plugin_id: bundle - field_ctools_views_list_value: - id: field_ctools_views_list_value - table: node__field_ctools_views_list - field: field_ctools_views_list_value - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_ctools_views_list_value_op - label: 'Ctools Views List (field_ctools_views_list)' - description: '' - use_operator: false - operator: field_ctools_views_list_value_op - identifier: field_ctools_views_list_value - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator1: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - plugin_id: list_field - filter_groups: - operator: AND - groups: - 1: AND - allow: - items_per_page: false - offset: '0' - pager: '0' - hide_fields: '0' - sort_fields: '0' - disable_filters: '0' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: { } - block_filter_tax: - display_plugin: block - id: block_filter_tax - display_title: 'Taxonomy filter' - position: 2 - display_options: - display_extenders: { } - display_description: '' - title: 'Taxonomy filter' - defaults: - title: false - filters: false - filter_groups: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - ctools_views: ctools_views - entity_type: node - entity_field: type - plugin_id: bundle - group: 1 - field_ctools_views_tags_target_id: - id: field_ctools_views_tags_target_id - table: node__field_ctools_views_tags - field: field_ctools_views_tags_target_id - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: true - expose: - operator_id: field_ctools_views_tags_target_id_op - label: 'Tags (field_ctools_views_tags)' - description: '' - use_operator: false - operator: field_ctools_views_tags_target_id_op - identifier: field_ctools_views_tags_target_id - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator1: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - type: select - limit: true - vid: tags - hierarchy: false - error_message: true - plugin_id: taxonomy_index_tid - filter_groups: - operator: AND - groups: - 1: AND - allow: - items_per_page: false - offset: '0' - pager: '0' - hide_fields: '0' - sort_fields: '0' - disable_filters: '0' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - user - - 'user.node_grants:view' - - user.permissions - tags: { } - block_filter_text: - display_plugin: block - id: block_filter_text - display_title: 'Textfield filter' - position: 1 - display_options: - display_extenders: { } - display_description: '' - title: 'Textfield filter' - defaults: - title: false - filters: false - filter_groups: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - ctools_views: ctools_views - entity_type: node - entity_field: type - plugin_id: bundle - field_ctools_views_text_value: - id: field_ctools_views_text_value - table: node__field_ctools_views_text - field: field_ctools_views_text_value - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: field_ctools_views_text_value_op - label: 'Text (field_ctools_views_text)' - description: '' - use_operator: false - operator: field_ctools_views_text_value_op - identifier: field_ctools_views_text_value - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator1: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - filter_groups: - operator: AND - groups: - 1: AND - allow: - items_per_page: false - offset: '0' - pager: '0' - hide_fields: '0' - sort_fields: '0' - disable_filters: '0' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_test_view.yml b/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_test_view.yml deleted file mode 100644 index 7187b56c1..000000000 --- a/sites/all/modules/contrib/dev/ctools/modules/ctools_views/tests/modules/ctools_views_test_views/test_views/views.view.ctools_views_test_view.yml +++ /dev/null @@ -1,949 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: ctools_views_test_view -label: 'CTools Views Test View' -module: views -description: '' -tag: '' -base_table: views_test_data -base_field: id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - offset: 0 - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - id: id - age: age - created: created - id_1: id_1 - job: job - name: name - info: - id: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - age: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - created: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - id_1: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - job: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - name: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - fields: - id: - id: id - table: views_test_data - field: id - relationship: none - group_type: group - admin_label: '' - label: ID - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: "1\x03@count" - prefix: '' - suffix: '' - entity_type: null - entity_field: null - plugin_id: numeric - name: - id: name - table: views_test_data - field: name - relationship: none - group_type: group - admin_label: '' - label: Name - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - age: - id: age - table: views_test_data - field: age - relationship: none - group_type: group - admin_label: '' - label: Age - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: "1\x03@count" - prefix: '' - suffix: '' - plugin_id: numeric - job: - id: job - table: views_test_data - field: job - relationship: none - group_type: group - admin_label: '' - label: Job - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - created: - id: created - table: views_test_data - field: created - relationship: none - group_type: group - admin_label: '' - label: Created - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' - plugin_id: date - filters: { } - sorts: - id: - id: id - table: views_test_data - field: id - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - plugin_id: standard - title: 'CTools Views Test View' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - use_ajax: false - filter_groups: - operator: AND - groups: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - tags: { } - block_fields: - display_plugin: block - id: block_fields - display_title: 'CTools Views Fields Block' - position: 2 - display_options: - display_extenders: { } - block_category: 'CTools Views' - allow: - hide_fields: hide_fields - sort_fields: sort_fields - items_per_page: false - offset: '0' - pager: '0' - disable_filters: '0' - block_description: 'CTools Views Fields Block' - display_description: '' - pager: - type: none - options: - offset: 0 - defaults: - pager: false - title: false - fields: false - title: 'CTools Views Fields Block' - fields: - id: - id: id - table: views_test_data - field: id - relationship: none - group_type: group - admin_label: '' - label: ID - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: "1\x03@count" - prefix: '' - suffix: '' - entity_type: null - entity_field: null - plugin_id: numeric - name: - id: name - table: views_test_data - field: name - relationship: none - group_type: group - admin_label: '' - label: Name - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - age: - id: age - table: views_test_data - field: age - relationship: none - group_type: group - admin_label: '' - label: Age - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: "1\x03@count" - prefix: '' - suffix: '' - plugin_id: numeric - job: - id: job - table: views_test_data - field: job - relationship: none - group_type: group - admin_label: '' - label: Job - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - created: - id: created - table: views_test_data - field: created - relationship: none - group_type: group - admin_label: '' - label: Created - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' - plugin_id: date - name_1: - id: name_1 - table: views_test_data - field: name - relationship: none - group_type: group - admin_label: '' - label: '2nd name field' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: standard - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - tags: { } - block_filter: - display_plugin: block - id: block_filter - display_title: 'CTools Views Filter Block' - position: 3 - display_options: - display_extenders: { } - display_description: '' - block_category: 'CTools Views' - block_description: 'CTools Views Filter Block' - allow: - disable_filters: disable_filters - items_per_page: false - offset: '0' - pager: '0' - hide_fields: '0' - sort_fields: '0' - filters: - status: - id: status - table: views_test_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: true - group: 1 - exposed: true - expose: - operator_id: '' - label: Status - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator1: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: boolean - job: - id: job - table: views_test_data - field: job - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: job_op - label: Job - description: '' - use_operator: false - operator: job_op - identifier: job - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator1: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - defaults: - filters: false - filter_groups: false - title: false - filter_groups: - operator: AND - groups: - 1: AND - title: 'CTools Views Filter Block' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - tags: { } - block_pager: - display_plugin: block - id: block_pager - display_title: 'CTools Views Pager Block' - position: 1 - display_options: - display_extenders: { } - block_description: 'CTools Views Pager Block' - block_category: 'CTools Views' - allow: - items_per_page: true - offset: offset - pager: pager - hide_fields: '0' - sort_fields: '0' - disable_filters: '0' - display_description: '' - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - empty: false - content: "Displaying @start - @end of @total\nShowing @current_record_count records on page @current_page" - plugin_id: result - defaults: - header: false - pager: false - title: false - pager: - type: mini - options: - items_per_page: 3 - offset: 0 - id: 0 - total_pages: null - tags: - previous: '‹ Previous' - next: 'Next ›' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - title: 'CTools Views Pager Block' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url.query_args - tags: { } - block_sort: - display_plugin: block - id: block_sort - display_title: 'CTools Views Sort Block' - position: 4 - display_options: - display_extenders: { } - display_description: '' - title: 'CTools Views Sort Block' - defaults: - title: false - block_description: 'CTools Views Sort Block' - block_category: 'CTools Views' - allow: - configure_sorts: configure_sorts - items_per_page: false - offset: '0' - pager: '0' - hide_fields: '0' - sort_fields: '0' - disable_filters: '0' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - tags: { } diff --git a/sites/all/modules/contrib/dev/ctools/plugins/access/node.inc b/sites/all/modules/contrib/dev/ctools/plugins/access/node.inc deleted file mode 100644 index 07d500025..000000000 --- a/sites/all/modules/contrib/dev/ctools/plugins/access/node.inc +++ /dev/null @@ -1,6 +0,0 @@ -tempstore = $tempstore; - } - - protected function getTempstore() { - return $this->tempstore; - } - - public function access(Route $route, RouteMatch $match, AccountInterface $account) { - $tempstore_id = $match->getParameter('tempstore_id') ? $match->getParameter('tempstore_id') : $route->getDefault('tempstore_id'); - $id = $match->getParameter($route->getRequirement('_ctools_access')); - if ($tempstore_id && $id) { - $cached_values = $this->getTempstore()->get($tempstore_id)->get($id); - if (!empty($cached_values['access']) && ($cached_values['access'] instanceof CToolsAccessInterface)) { - $access = $cached_values['access']->access($account); - } - else { - $access = AccessResult::allowed(); - } - } - else { - $access = AccessResult::forbidden(); - } - // The different wizards will have different tempstore ids and adding this - // cache context allows us to nuance the access per wizard. - $access->addCacheContexts(['url.query_args:tempstore_id']); - return $access; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/ctools/src/Ajax/OpenModalWizardCommand.php b/sites/all/modules/contrib/dev/ctools/src/Ajax/OpenModalWizardCommand.php deleted file mode 100644 index fc1642cdc..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Ajax/OpenModalWizardCommand.php +++ /dev/null @@ -1,23 +0,0 @@ - $tempstore_id, - 'machine_name' => NULL, - 'step' => NULL, - ]; - $form = \Drupal::service('ctools.wizard.factory')->getWizardForm($object, $parameters, TRUE); - $title = isset($form['#title']) ? $form['#title'] : ''; - $content = $form; - - parent::__construct($title, $content, $dialog_options, $settings); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Annotation/Relationship.php b/sites/all/modules/contrib/dev/ctools/src/Annotation/Relationship.php deleted file mode 100644 index 452f6992b..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Annotation/Relationship.php +++ /dev/null @@ -1,54 +0,0 @@ -entityRepository = $entity_repository; - $this->uuid = $uuid; - } - - /** - * {@inheritdoc} - */ - public function getContextValue() { - if (!$this->contextData) { - $entity_type_id = substr($this->contextDefinition->getDataType(), 7); - $this->setContextValue($this->entityRepository->loadEntityByUuid($entity_type_id, $this->uuid)); - } - return parent::getContextValue(); - } - - /** - * {@inheritdoc} - */ - public function hasContextValue() { - // Ensure that the entity is loaded before checking if it exists. - if (!$this->contextData) { - $this->getContextValue(); - } - return parent::hasContextValue(); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/ContextMapper.php b/sites/all/modules/contrib/dev/ctools/src/ContextMapper.php deleted file mode 100644 index 284dcf070..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/ContextMapper.php +++ /dev/null @@ -1,50 +0,0 @@ -entityRepository = $entity_repository; - } - - /** - * {@inheritdoc} - */ - public function getContextValues(array $context_configurations) { - $contexts = []; - foreach ($context_configurations as $name => $context_configuration) { - $context_definition = new ContextDefinition($context_configuration['type'], $context_configuration['label'], TRUE, FALSE, $context_configuration['description']); - if (strpos($context_configuration['type'], 'entity:') === 0) { - $context = new EntityLazyLoadContext($context_definition, $this->entityRepository, $context_configuration['value']); - } - else { - $context = new Context($context_definition, $context_configuration['value']); - } - $contexts[$name] = $context; - } - return $contexts; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/ContextMapperInterface.php b/sites/all/modules/contrib/dev/ctools/src/ContextMapperInterface.php deleted file mode 100644 index b583817e7..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/ContextMapperInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - protected function getFormArgument(RouteMatchInterface $route_match) { - $form_arg = $route_match->getRouteObject()->getDefault('_entity_wizard'); - list($entity_type_id, $operation) = explode('.', $form_arg); - $definition = $this->entityTypeManager->getDefinition($entity_type_id); - $handlers = $definition->getHandlerClasses(); - if (empty($handlers['wizard'][$operation])) { - throw new \Exception(sprintf('Unsupported wizard operation %s', $operation)); - } - return $handlers['wizard'][$operation]; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Controller/WizardFormController.php b/sites/all/modules/contrib/dev/ctools/src/Controller/WizardFormController.php deleted file mode 100644 index d7eb9b85c..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Controller/WizardFormController.php +++ /dev/null @@ -1,81 +0,0 @@ -wizardFactory = $wizard_factory; - } - - /** - * {@inheritdoc} - */ - protected function getFormArgument(RouteMatchInterface $route_match) { - return $route_match->getRouteObject()->getDefault('_wizard'); - } - - /** - * Wizards are not instantiated as simply as forms, so this method is unused. - */ - protected function getFormObject(RouteMatchInterface $route_match, $form_arg) { - if (!is_subclass_of($form_arg, '\Drupal\ctools\Wizard\FormWizardInterface')) { - throw new \Exception("The _wizard default must reference a class instance of \\Drupal\\ctools\\Wizard\\FormWizardInterface."); - } - $parameters = $route_match->getParameters()->all(); - $parameters += $form_arg::getParameters(); - $parameters['route_match'] = $route_match; - return $this->wizardFactory->createWizard($form_arg, $parameters); - } - - /** - * {@inheritdoc} - */ - public function getContentResult(Request $request, RouteMatchInterface $route_match) { - $wizard = $this->getFormObject($route_match, $this->getFormArgument($route_match)); - $ajax = $request->attributes->get('js') == 'ajax' ? TRUE : FALSE; - - return $this->wizardFactory->getWizardForm($wizard, $request->attributes->all(), $ajax); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvent.php b/sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvent.php deleted file mode 100644 index 35df32dd3..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvent.php +++ /dev/null @@ -1,56 +0,0 @@ -block = $block; - $this->variant = $variant; - } - - /** - * Gets the block plugin. - * - * @return \Drupal\Core\Block\BlockPluginInterface - */ - public function getBlock() { - return $this->block; - } - - /** - * Gets the variant plugin. - * - * @return \Drupal\ctools\Plugin\BlockVariantInterface - */ - public function getVariant() { - return $this->variant; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvents.php b/sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvents.php deleted file mode 100644 index ea4ec364a..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Event/BlockVariantEvents.php +++ /dev/null @@ -1,49 +0,0 @@ -wizard = $wizard; - $this->values = $values; - } - - public function getWizard() { - return $this->wizard; - } - - public function getValues() { - return $this->values; - } - - public function setValues($values) { - $this->values = $values; - return $this; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/AjaxFormTrait.php b/sites/all/modules/contrib/dev/ctools/src/Form/AjaxFormTrait.php deleted file mode 100644 index b30250bbb..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/AjaxFormTrait.php +++ /dev/null @@ -1,43 +0,0 @@ - ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 'auto', - ]), - ]; - } - - /** - * Gets attributes for use with an add button AJAX modal. - * - * @return array - */ - public static function getAjaxButtonAttributes() { - return NestedArray::mergeDeep(AjaxFormTrait::getAjaxAttributes(), [ - 'class' => [ - 'button', - 'button--small', - 'button-action', - ], - ]); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ConditionConfigure.php b/sites/all/modules/contrib/dev/ctools/src/Form/ConditionConfigure.php deleted file mode 100644 index 7a370df4b..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ConditionConfigure.php +++ /dev/null @@ -1,183 +0,0 @@ -get('tempstore.shared'), $container->get('plugin.manager.condition')); - } - - function __construct(SharedTempStoreFactory $tempstore, PluginManagerInterface $manager) { - $this->tempstore = $tempstore; - $this->manager = $manager; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_condition_configure'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $condition = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - if (is_numeric($condition) || Uuid::isValid($condition)) { - $id = $condition; - $condition = $this->getConditions($cached_values)[$id]; - $instance = $this->manager->createInstance($condition['id'], $condition); - } - else { - $instance = $this->manager->createInstance($condition, []); - } - $form_state->setTemporaryValue('gathered_contexts', $this->getContexts($cached_values)); - /** @var $instance \Drupal\Core\Condition\ConditionInterface */ - $form = $instance->buildConfigurationForm($form, $form_state); - if (isset($id)) { - // Conditionally set this form element so that we can update or add. - $form['id'] = [ - '#type' => 'value', - '#value' => $id - ]; - } - $form['instance'] = [ - '#type' => 'value', - '#value' => $instance - ]; - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - '#ajax' => [ - 'callback' => [$this, 'ajaxSave'], - ] - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - /** @var $instance \Drupal\Core\Condition\ConditionInterface */ - $instance = $form_state->getValue('instance'); - $instance->submitConfigurationForm($form, $form_state); - $conditions = $this->getConditions($cached_values); - if ($instance instanceof ContextAwarePluginInterface) { - /** @var $instance \Drupal\Core\Plugin\ContextAwarePluginInterface */ - $context_mapping = $form_state->hasValue('context_mapping')? $form_state->getValue('context_mapping') : []; - $instance->setContextMapping($context_mapping); - } - if ($instance instanceof ConstraintConditionInterface) { - /** @var $instance \Drupal\ctools\ConstraintConditionInterface */ - $instance->applyConstraints($this->getContexts($cached_values)); - } - if ($form_state->hasValue('id')) { - $conditions[$form_state->getValue('id')] = $instance->getConfiguration(); - } - else { - $conditions[] = $instance->getConfiguration(); - } - $cached_values = $this->setConditions($cached_values, $conditions); - $this->tempstore->get($this->tempstore_id)->set($this->machine_name, $cached_values); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $form_state->setRedirect($route_name, $route_parameters); - } - - public function ajaxSave(array &$form, FormStateInterface $form_state) { - $response = new AjaxResponse(); - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $url = Url::fromRoute($route_name, $route_parameters); - $response->addCommand(new RedirectCommand($url->toString())); - $response->addCommand(new CloseModalDialogCommand()); - return $response; - } - - /** - * Document the route name and parameters for redirect after submission. - * - * @param $cached_values - * - * @return array - * In the format of - * return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name']]; - */ - abstract protected function getParentRouteInfo($cached_values); - - /** - * Custom logic for retrieving the conditions array from cached_values. - * - * @param $cached_values - * - * @return array - */ - abstract protected function getConditions($cached_values); - - /** - * Custom logic for setting the conditions array in cached_values. - * - * @param $cached_values - * - * @param $conditions - * The conditions to set within the cached values. - * - * @return mixed - * Return the $cached_values - */ - abstract protected function setConditions($cached_values, $conditions); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ConditionDelete.php b/sites/all/modules/contrib/dev/ctools/src/Form/ConditionDelete.php deleted file mode 100644 index 0655934d9..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ConditionDelete.php +++ /dev/null @@ -1,210 +0,0 @@ -get('tempstore.shared'), $container->get('plugin.manager.condition')); - } - - function __construct(SharedTempStoreFactory $tempstore, PluginManagerInterface $manager) { - $this->tempstore = $tempstore; - $this->manager = $manager; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_condition_delete'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $id = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $this->id = $id; - - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $form ['#title'] = $this->getQuestion($id, $cached_values); - - $form ['#attributes']['class'][] = 'confirmation'; - $form ['description'] = array('#markup' => $this->getDescription()); - $form [$this->getFormName()] = array('#type' => 'hidden', '#value' => 1); - - // By default, render the form using theme_confirm_form(). - if (!isset($form ['#theme'])) { - $form ['#theme'] = 'confirm_form'; - } - $form['actions'] = array('#type' => 'actions'); - $form['actions'] += $this->actions($form, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $conditions = $this->getConditions($cached_values); - /** @var $instance \Drupal\ctools\ConstraintConditionInterface */ - $instance = $this->manager->createInstance($conditions[$this->id]['id'], $conditions[$this->id]); - if ($instance instanceof ConstraintConditionInterface) { - $instance->removeConstraints($this->getContexts($cached_values)); - } - unset($conditions[$this->id]); - $cached_values = $this->setConditions($cached_values, $conditions); - $this->tempstore->get($this->tempstore_id)->set($this->machine_name, $cached_values); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $form_state->setRedirect($route_name, $route_parameters); - } - - public function getQuestion($id = NULL, $cached_values = NULL) { - $condition = $this->getConditions($cached_values)[$id]; - return $this->t('Are you sure you want to delete the @label condition?', array( - '@label' => $condition['id'], - )); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getFormName() { - return 'confirm'; - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - return array( - 'submit' => array( - '#type' => 'submit', - '#value' => $this->getConfirmText(), - '#validate' => array( - array($this, 'validateForm'), - ), - '#submit' => array( - array($this, 'submitForm'), - ), - ), - 'cancel' => ConfirmFormHelper::buildCancelLink($this, $this->getRequest()), - ); - } - - /** - * Returns the route to go to if the user cancels the action. - * - * @return \Drupal\Core\Url - * A URL object. - */ - public function getCancelUrl() { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - return new Url($route_name, $route_parameters); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function getCancelText() { - return $this->t('Cancel'); - } - - /** - * Document the route name and parameters for redirect after submission. - * - * @param $cached_values - * - * @return array - * In the format of - * return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name]]; - */ - abstract protected function getParentRouteInfo($cached_values); - - /** - * Custom logic for retrieving the conditions array from cached_values. - * - * @param $cached_values - * - * @return array - */ - abstract protected function getConditions($cached_values); - - /** - * Custom logic for setting the conditions array in cached_values. - * - * @param $cached_values - * - * @param $conditions - * The conditions to set within the cached values. - * - * @return mixed - * Return the $cached_values - */ - abstract protected function setConditions($cached_values, $conditions); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ContextConfigure.php b/sites/all/modules/contrib/dev/ctools/src/Form/ContextConfigure.php deleted file mode 100644 index f5f1c57d5..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ContextConfigure.php +++ /dev/null @@ -1,264 +0,0 @@ -get('tempstore.shared'), - $container->get('entity_type.manager') - ); - } - - function __construct(SharedTempStoreFactory $tempstore, EntityTypeManagerInterface $entity_type_manager) { - $this->tempstore = $tempstore; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_context_configure'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $context_id = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $contexts = $this->getContexts($cached_values); - $edit = FALSE; - if (!empty($contexts[$context_id])) { - $context = $contexts[$context_id]; - $machine_name = $context_id; - $edit = TRUE; - } - else { - $context_definition = new ContextDefinition($context_id); - $context = new Context($context_definition); - $machine_name = ''; - } - $label = $context->getContextDefinition()->getLabel(); - $description = $context->getContextDefinition()->getDescription(); - $data_type = $context->getContextDefinition()->getDataType(); - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $form['context_id'] = [ - '#type' => 'value', - '#value' => $context_id - ]; - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#default_value' => $label, - '#required' => TRUE, - ]; - $form['machine_name'] = [ - '#type' => 'machine_name', - '#title' => $this->t('Machine Name'), - '#default_value' => $machine_name, - '#required' => TRUE, - '#maxlength' => 128, - '#machine_name' => [ - 'source' => ['label'], - 'exists' => [$this, 'contextExists'], - ], - '#disabled' => $this->disableMachineName($cached_values, $machine_name), - ]; - $form['description'] = [ - '#type' => 'textarea', - '#title' => $this->t('Description'), - '#default_value' => $description, - ]; - if (strpos($data_type, 'entity:') === 0) { - list(, $entity_type) = explode(':', $data_type); - /** @var EntityAdapter $entity */ - $entity = $edit ? $context->getContextValue() : NULL; - $form['context_value'] = [ - '#type' => 'entity_autocomplete', - '#required' => TRUE, - '#target_type' => $entity_type, - '#default_value' => $entity, - '#title' => $this->t('Select entity'), - ]; - } - else { - $value = $context->getContextData()->getValue(); - $form['context_value'] = [ - '#title' => $this->t('Set a context value'), - '#type' => 'textfield', - '#required' => TRUE, - '#default_value' => $value, - ]; - } - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - '#ajax' => [ - 'callback' => [$this, 'ajaxSave'], - ] - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // If these are not equal, then we're adding a new context and should not override an existing context. - if ($form_state->getValue('machine_name') != $form_state->getValue('context_id')) { - $machine_name = $form_state->getValue('machine_name'); - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - if (!empty($this->getContexts($cached_values)[$machine_name])) { - $form_state->setError($form['machine_name'], $this->t('That machine name is in use by another context definition.')); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $contexts = $this->getContexts($cached_values); - if ($form_state->getValue('machine_name') != $form_state->getValue('context_id')) { - $data_type = $form_state->getValue('context_id'); - $context_definition = new ContextDefinition($data_type, $form_state->getValue('label'), TRUE, FALSE, $form_state->getValue('description')); - } - else { - $context = $contexts[$form_state->getValue('machine_name')]; - $context_definition = $context->getContextDefinition(); - $context_definition->setLabel($form_state->getValue('label')); - $context_definition->setDescription($form_state->getValue('description')); - } - // We're dealing with an entity and should make sure it's loaded. - if (strpos($context_definition->getDataType(), 'entity:') === 0) { - list(, $entity_type) = explode(':', $context_definition->getDataType()); - if (is_numeric($form_state->getValue('context_value'))) { - $value = $this->entityTypeManager->getStorage($entity_type)->load($form_state->getValue('context_value')); - } - } - // No loading required for non-entity values. - else { - $value = $form_state->getValue('context_value'); - } - $context = new Context($context_definition, $value); - - $cached_values = $this->addContext($cached_values, $form_state->getValue('machine_name'), $context); - $this->tempstore->get($this->tempstore_id)->set($this->machine_name, $cached_values); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $form_state->setRedirect($route_name, $route_parameters); - } - - public function ajaxSave(array &$form, FormStateInterface $form_state) { - $response = new AjaxResponse(); - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $url = new Url($route_name, $route_parameters); - $response->addCommand(new RedirectCommand($url->toString())); - $response->addCommand(new CloseModalDialogCommand()); - return $response; - } - - /** - * Document the route name and parameters for redirect after submission. - * - * @param $cached_values - * - * @return array - * In the format of - * return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name]]; - */ - abstract protected function getParentRouteInfo($cached_values); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - - /** - * Custom logic for adding a context to the cached_values contexts array. - * - * @param array $cached_values - * The cached_values currently in use. - * @param string $context_id - * The context identifier. - * @param \Drupal\Core\Plugin\Context\ContextInterface $context - * The context to add or update within the cached values. - * - * @return mixed - * Return the $cached_values - */ - abstract protected function addContext($cached_values, $context_id, ContextInterface $context); - - /** - * Custom "exists" logic for the context to be created. - * - * @param string $value - * The name of the context. - * @param $element - * The machine_name element - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * - * @return bool - * Return true if a context of this name exists. - */ - abstract public function contextExists($value, $element, $form_state); - - /** - * Determines if the machine_name should be disabled. - * - * @param $cached_values - * - * @return bool - */ - abstract protected function disableMachineName($cached_values, $machine_name); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ContextDelete.php b/sites/all/modules/contrib/dev/ctools/src/Form/ContextDelete.php deleted file mode 100644 index ec1406b80..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ContextDelete.php +++ /dev/null @@ -1,84 +0,0 @@ -get('tempstore.shared')); - } - - public function __construct(SharedTempStoreFactory $tempstore) { - $this->tempstore = $tempstore; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_context_delete_form'; - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $tempstore_id = NULL, $machine_name = NULL, $context_id = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $this->context_id = $context_id; - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirectUrl($this->getCancelUrl()); - } - - protected function getTempstore() { - return $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - } - - protected function setTempstore($cached_values) { - $this->tempstore->get($this->tempstore_id)->set($this->machine_name, $cached_values); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ManageConditions.php b/sites/all/modules/contrib/dev/ctools/src/Form/ManageConditions.php deleted file mode 100644 index 7e4bcb648..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ManageConditions.php +++ /dev/null @@ -1,242 +0,0 @@ -get('plugin.manager.condition'), - $container->get('form_builder') - ); - } - - function __construct(PluginManagerInterface $manager, FormBuilder $form_builder) { - $this->manager = $manager; - $this->formBuilder = $form_builder; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_manage_conditions_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $this->machine_name = $cached_values['id']; - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $options = []; - $contexts = $this->getContexts($cached_values); - foreach ($this->manager->getDefinitionsForContexts($contexts) as $plugin_id => $definition) { - $options[$plugin_id] = (string) $definition['label']; - } - $form['items'] = array( - '#type' => 'markup', - '#prefix' => '
    ', - '#suffix' => '
    ', - '#theme' => 'table', - '#header' => array($this->t('Plugin Id'), $this->t('Summary'), $this->t('Operations')), - '#rows' => $this->renderRows($cached_values), - '#empty' => $this->t('No required conditions have been configured.') - ); - $form['conditions'] = [ - '#type' => 'select', - '#options' => $options, - ]; - $form['add'] = [ - '#type' => 'submit', - '#name' => 'add', - '#value' => $this->t('Add Condition'), - '#ajax' => [ - 'callback' => [$this, 'add'], - 'event' => 'click', - ], - '#submit' => [ - 'callback' => [$this, 'submitForm'], - ] - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getOperationsRouteInfo($cached_values, $this->machine_name, $form_state->getValue('conditions')); - $form_state->setRedirect($this->getAddRoute($cached_values), $route_parameters); - } - - public function add(array &$form, FormStateInterface $form_state) { - $condition = $form_state->getValue('conditions'); - $content = $this->formBuilder->getForm($this->getConditionClass(), $condition, $this->getTempstoreId(), $this->machine_name); - $content['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getOperationsRouteInfo($cached_values, $this->machine_name, $form_state->getValue('conditions')); - $route_name = $this->getAddRoute($cached_values); - $route_options = [ - 'query' => [ - FormBuilderInterface::AJAX_FORM_REQUEST => TRUE, - ], - ]; - $url = Url::fromRoute($route_name, $route_parameters, $route_options); - $content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString(); - $response = new AjaxResponse(); - $response->addCommand(new OpenModalDialogCommand($this->t('Configure Required Context'), $content, array('width' => '700'))); - return $response; - } - - /** - * @param $cached_values - * - * @return array - */ - public function renderRows($cached_values) { - $configured_conditions = array(); - foreach ($this->getConditions($cached_values) as $row => $condition) { - /** @var $instance \Drupal\Core\Condition\ConditionInterface */ - $instance = $this->manager->createInstance($condition['id'], $condition); - list($route_name, $route_parameters) = $this->getOperationsRouteInfo($cached_values, $cached_values['id'], $row); - $build = array( - '#type' => 'operations', - '#links' => $this->getOperations($route_name, $route_parameters), - ); - $configured_conditions[] = array( - $instance->getPluginId(), - $instance->summary(), - 'operations' => [ - 'data' => $build, - ], - ); - } - return $configured_conditions; - } - - protected function getOperations($route_name_base, array $route_parameters = array()) { - $operations['edit'] = array( - 'title' => $this->t('Edit'), - 'url' => new Url($route_name_base . '.edit', $route_parameters), - 'weight' => 10, - 'attributes' => array( - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ), - ); - $route_parameters['id'] = $route_parameters['condition']; - $operations['delete'] = array( - 'title' => $this->t('Delete'), - 'url' => new Url($route_name_base . '.delete', $route_parameters), - 'weight' => 100, - 'attributes' => array( - 'class' => array('use-ajax'), - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ), - ); - return $operations; - } - - /** - * Return a subclass of '\Drupal\ctools\Form\ConditionConfigure'. - * - * The ConditionConfigure class is designed to be subclassed with custom - * route information to control the modal/redirect needs of your use case. - * - * @return string - */ - abstract protected function getConditionClass(); - - /** - * The route to which condition 'add' actions should submit. - * - * @param mixed $cached_values - * - * @return string - */ - abstract protected function getAddRoute($cached_values); - - /** - * Provide the tempstore id for your specified use case. - * - * @return string - */ - abstract protected function getTempstoreId(); - - /** - * Document the route name and parameters for edit/delete context operations. - * - * The route name returned from this method is used as a "base" to which - * ".edit" and ".delete" are appended in the getOperations() method. - * Subclassing '\Drupal\ctools\Form\ConditionConfigure' and - * '\Drupal\ctools\Form\ConditionDelete' should set you up for using this - * approach quite seamlessly. - * - * @param mixed $cached_values - * - * @param string $machine_name - * - * @param string $row - * - * @return array - * In the format of - * return ['route.base.name', ['machine_name' => $machine_name, 'context' => $row]]; - */ - abstract protected function getOperationsRouteInfo($cached_values, $machine_name, $row); - - /** - * Custom logic for retrieving the conditions array from cached_values. - * - * @param $cached_values - * - * @return array - */ - abstract protected function getConditions($cached_values); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ManageContext.php b/sites/all/modules/contrib/dev/ctools/src/Form/ManageContext.php deleted file mode 100644 index 9b9d9cf8f..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ManageContext.php +++ /dev/null @@ -1,355 +0,0 @@ -typedDataManager = $typed_data_manager; - $this->formBuilder = $form_builder; - $this->typedDataResolver = $ctools_typed_data_resolver; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('typed_data_manager'), - $container->get('form_builder'), - $container->get('ctools.typed_data.resolver') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_manage_context_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $this->machine_name = $cached_values['id']; - $form['items'] = array( - '#type' => 'markup', - '#prefix' => '
    ', - '#suffix' => '
    ', - '#theme' => 'table', - '#header' => array($this->t('Context ID'), $this->t('Label'), $this->t('Data Type'), $this->t('Options')), - '#rows' => $this->renderRows($cached_values), - '#empty' => $this->t('No contexts or relationships have been added.') - ); - foreach ($this->typedDataManager->getDefinitions() as $type => $definition) { - $types[$type] = $definition['label']; - } - if (isset($types['entity'])) { - unset($types['entity']); - } - asort($types); - $form['context'] = [ - '#type' => 'select', - '#options' => $types, - ]; - $form['add'] = [ - '#type' => 'submit', - '#name' => 'add', - '#value' => $this->t('Add new context'), - '#ajax' => [ - 'callback' => [$this, 'addContext'], - 'event' => 'click', - ], - '#submit' => [ - 'callback' => [$this, 'submitForm'], - ] - ]; - - $form['relationships'] = [ - '#type' => 'select', - '#title' => $this->t('Add a relationship'), - '#options' => $this->getAvailableRelationships($cached_values), - '#access' => $this->relationships, - ]; - $form['add_relationship'] = [ - '#type' => 'submit', - '#name' => 'add_relationship', - '#value' => $this->t('Add Relationship'), - '#ajax' => [ - 'callback' => [$this, 'addRelationship'], - 'event' => 'click', - ], - '#submit' => [ - 'callback' => [$this, 'submitForm'], - ], - '#access' => $this->relationships, - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - if ($form_state->getTriggeringElement()['#name'] == 'add') { - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getContextOperationsRouteInfo($cached_values, $this->machine_name, $form_state->getValue('context')); - $form_state->setRedirect($this->getContextAddRoute($cached_values), $route_parameters); - } - if ($form_state->getTriggeringElement()['#name'] == 'add_relationship') { - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getRelationshipOperationsRouteInfo($cached_values, $this->machine_name, $form_state->getValue('relationships')); - $form_state->setRedirect($this->getRelationshipAddRoute($cached_values), $route_parameters); - } - } - - public function addContext(array &$form, FormStateInterface $form_state) { - $context = $form_state->getValue('context'); - $content = $this->formBuilder->getForm($this->getContextClass(), $context, $this->getTempstoreId(), $this->machine_name); - $content['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getContextOperationsRouteInfo($cached_values, $this->machine_name, $context); - $route_name = $this->getContextAddRoute($cached_values); - $route_options = [ - 'query' => [ - FormBuilderInterface::AJAX_FORM_REQUEST => TRUE, - ], - ]; - $url = Url::fromRoute($route_name, $route_parameters, $route_options); - $content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString(); - $response = new AjaxResponse(); - $response->addCommand(new OpenModalDialogCommand($this->t('Add new context'), $content, array('width' => '700'))); - return $response; - } - - public function addRelationship(array &$form, FormStateInterface $form_state) { - $relationship = $form_state->getValue('relationships'); - $content = $this->formBuilder->getForm($this->getRelationshipClass(), $relationship, $this->getTempstoreId(), $this->machine_name); - $content['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getRelationshipOperationsRouteInfo($cached_values, $this->machine_name, $relationship); - $route_name = $this->getRelationshipAddRoute($cached_values); - $route_options = [ - 'query' => [ - FormBuilderInterface::AJAX_FORM_REQUEST => TRUE, - ], - ]; - $url = Url::fromRoute($route_name, $route_parameters, $route_options); - $content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString(); - $response = new AjaxResponse(); - $response->addCommand(new OpenModalDialogCommand($this->t('Configure Relationship'), $content, array('width' => '700'))); - return $response; - } - - protected function getAvailableRelationships($cached_values) { - /** @var \Drupal\ctools\TypedDataResolver $resolver */ - $resolver = $this->typedDataResolver; - return $resolver->getTokensForContexts($this->getContexts($cached_values)); - } - - /** - * @param $cached_values - * - * @return array - */ - protected function renderRows($cached_values) { - $contexts = array(); - foreach ($this->getContexts($cached_values) as $row => $context) { - list($route_name, $route_parameters) = $this->getContextOperationsRouteInfo($cached_values, $this->machine_name, $row); - $build = array( - '#type' => 'operations', - '#links' => $this->getOperations($cached_values, $row, $route_name, $route_parameters), - ); - $contexts[$row] = array( - $row, - $context->getContextDefinition()->getLabel(), - $context->getContextDefinition()->getDataType(), - 'operations' => [ - 'data' => $build, - ], - ); - } - return $contexts; - } - - /** - * @param array $cached_values - * @param string $row - * @param string $route_name_base - * @param array $route_parameters - * - * @return mixed - */ - protected function getOperations($cached_values, $row, $route_name_base, array $route_parameters = array()) { - $operations = []; - if ($this->isEditableContext($cached_values, $row)) { - $operations['edit'] = array( - 'title' => $this->t('Edit'), - 'url' => new Url($route_name_base . '.edit', $route_parameters), - 'weight' => 10, - 'attributes' => array( - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ), - ); - $operations['delete'] = array( - 'title' => $this->t('Delete'), - 'url' => new Url($route_name_base . '.delete', $route_parameters), - 'weight' => 100, - 'attributes' => array( - 'class' => array('use-ajax'), - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ), - ); - } - return $operations; - } - - /** - * Return a subclass of '\Drupal\ctools\Form\ContextConfigure'. - * - * The ContextConfigure class is designed to be subclassed with custom - * route information to control the modal/redirect needs of your use case. - * - * @return string - */ - abstract protected function getContextClass($cached_values); - - /** - * Return a subclass of '\Drupal\ctools\Form\RelationshipConfigure'. - * - * The RelationshipConfigure class is designed to be subclassed with custom - * route information to control the modal/redirect needs of your use case. - * - * @return string - */ - abstract protected function getRelationshipClass($cached_values); - - /** - * The route to which context 'add' actions should submit. - * - * @return string - */ - abstract protected function getContextAddRoute($cached_values); - - /** - * The route to which relationship 'add' actions should submit. - * - * @return string - */ - abstract protected function getRelationshipAddRoute($cached_values); - - /** - * Provide the tempstore id for your specified use case. - * - * @return string - */ - abstract protected function getTempstoreId(); - - /** - * Returns the contexts already available in the wizard. - * - * @param mixed $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - - /** - * @param mixed $cached_values - * @param string $machine_name - * @param string $row - * - * @return array - */ - abstract protected function getContextOperationsRouteInfo($cached_values, $machine_name, $row); - - /** - * @param mixed $cached_values - * @param string $machine_name - * @param string $row - * - * @return array - */ - abstract protected function getRelationshipOperationsRouteInfo($cached_values, $machine_name, $row); - - /** - * @param mixed $cached_values - * @param string $row - * - * @return bool - */ - abstract protected function isEditableContext($cached_values, $row); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ManageResolverRelationships.php b/sites/all/modules/contrib/dev/ctools/src/Form/ManageResolverRelationships.php deleted file mode 100644 index bb6bcfb2e..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ManageResolverRelationships.php +++ /dev/null @@ -1,251 +0,0 @@ -typedDataResolver = $ctools_typed_data_resolver; - $this->formBuilder = $form_builder; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('ctools.typed_data.resolver'), - $container->get('form_builder') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_manage_resolver_relationships_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $this->machine_name = $cached_values['id']; - $form['items'] = array( - '#type' => 'markup', - '#prefix' => '
    ', - '#suffix' => '
    ', - '#theme' => 'table', - '#header' => array($this->t('Context ID'), $this->t('Label'), $this->t('Data Type'), $this->t('Options')), - '#rows' => $this->renderRows($cached_values), - '#empty' => $this->t('No relationships have been added.') - ); - - $form['relationships'] = [ - '#type' => 'select', - '#title' => $this->t('Add a relationship'), - '#options' => $this->getAvailableRelationships($cached_values), - ]; - $form['add_relationship'] = [ - '#type' => 'submit', - '#name' => 'add', - '#value' => $this->t('Add Relationship'), - '#ajax' => [ - 'callback' => [$this, 'addRelationship'], - 'event' => 'click', - ], - '#submit' => [ - 'callback' => [$this, 'submitForm'], - ] - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - if ($form_state->getTriggeringElement()['#name'] == 'add') { - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getRelationshipOperationsRouteInfo($cached_values, $this->machine_name, $form_state->getValue('relationships')); - $form_state->setRedirect($this->getAddRoute($cached_values), $route_parameters); - } - } - - public function addRelationship(array &$form, FormStateInterface $form_state) { - $relationship = $form_state->getValue('relationships'); - $content = $this->formBuilder->getForm($this->getContextClass(), $relationship, $this->getTempstoreId(), $this->machine_name); - $content['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $cached_values = $form_state->getTemporaryValue('wizard'); - list(, $route_parameters) = $this->getRelationshipOperationsRouteInfo($cached_values, $this->machine_name, $relationship); - $route_name = $this->getAddRoute($cached_values); - $route_options = [ - 'query' => [ - FormBuilderInterface::AJAX_FORM_REQUEST => TRUE, - ], - ]; - $url = Url::fromRoute($route_name, $route_parameters, $route_options); - $content['submit']['#attached']['drupalSettings']['ajax'][$content['submit']['#id']]['url'] = $url->toString(); - $response = new AjaxResponse(); - $response->addCommand(new OpenModalDialogCommand($this->t('Configure Relationship'), $content, array('width' => '700'))); - return $response; - } - - protected function getAvailableRelationships($cached_values) { - /** @var \Drupal\ctools\TypedDataResolver $resolver */ - $resolver = $this->typedDataResolver; - return $resolver->getTokensForContexts($this->getContexts($cached_values)); - } - - /** - * @param $cached_values - * - * @return array - */ - protected function renderRows($cached_values) { - $contexts = array(); - foreach ($this->getContexts($cached_values) as $row => $context) { - list($route_name, $route_parameters) = $this->getRelationshipOperationsRouteInfo($cached_values, $this->machine_name, $row); - $build = array( - '#type' => 'operations', - '#links' => $this->getOperations($cached_values, $row, $route_name, $route_parameters), - ); - $contexts[$row] = array( - $row, - $context->getContextDefinition()->getLabel(), - $context->getContextDefinition()->getDataType(), - 'operations' => [ - 'data' => $build, - ], - ); - } - return $contexts; - } - - /** - * @param array $cached_values - * @param string $row - * @param string $route_name_base - * @param array $route_parameters - * - * @return mixed - */ - protected function getOperations($cached_values, $row, $route_name_base, array $route_parameters = array()) { - // Base contexts will not be a : separated and generated relationships should have 3 parts. - if (count(explode(':', $row)) < 2) { - return []; - } - $operations['edit'] = array( - 'title' => $this->t('Edit'), - 'url' => new Url($route_name_base . '.edit', $route_parameters), - 'weight' => 10, - 'attributes' => array( - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ), - ); - $route_parameters['id'] = $route_parameters['context']; - $operations['delete'] = array( - 'title' => $this->t('Delete'), - 'url' => new Url($route_name_base . '.delete', $route_parameters), - 'weight' => 100, - 'attributes' => array( - 'class' => array('use-ajax'), - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ), - ); - return $operations; - } - - /** - * Return a subclass of '\Drupal\ctools\Form\ResolverRelationshipConfigure'. - * - * The ConditionConfigure class is designed to be subclassed with custom - * route information to control the modal/redirect needs of your use case. - * - * @return string - */ - abstract protected function getContextClass($cached_values); - - /** - * The route to which relationship 'add' actions should submit. - * - * @return string - */ - abstract protected function getAddRoute($cached_values); - - /** - * Provide the tempstore id for your specified use case. - * - * @return string - */ - abstract protected function getTempstoreId(); - - /** - * @param $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - - /** - * @param string $cached_values - * @param string $machine_name - * @param string $row - * - * @return array - */ - abstract protected function getRelationshipOperationsRouteInfo($cached_values, $machine_name, $row); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/RelationshipConfigure.php b/sites/all/modules/contrib/dev/ctools/src/Form/RelationshipConfigure.php deleted file mode 100644 index 167ee4cc4..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/RelationshipConfigure.php +++ /dev/null @@ -1,154 +0,0 @@ -get('tempstore.shared'), $container->get('ctools.typed_data.resolver')); - } - - public function __construct(SharedTempStoreFactory $tempstore, TypedDataResolver $resolver) { - $this->tempstore = $tempstore; - $this->resolver = $resolver; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_relationship_configure'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $context_id = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - - /** @var \Drupal\Core\Plugin\Context\ContextInterface[] $contexts */ - $contexts = $this->getContexts($cached_values); - $context_object = $this->resolver->convertTokenToContext($context_id, $contexts); - $form['id'] = [ - '#type' => 'value', - '#value' => $context_id - ]; - $form['context_object'] = [ - '#type' => 'value', - '#value' => $context_object, - ]; - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Context label'), - '#default_value' => !empty($contexts[$context_id]) ? $contexts[$context_id]->getContextDefinition()->getLabel() : $this->resolver->getLabelByToken($context_id, $contexts), - '#required' => TRUE, - ]; - $form['context_data'] = [ - '#type' => 'item', - '#title' => $this->t('Data type'), - '#markup' => $context_object->getContextDefinition()->getDataType(), - ]; - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - '#ajax' => [ - 'callback' => [$this, 'ajaxSave'], - ] - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_options) = $this->getParentRouteInfo($cached_values); - $form_state->setRedirect($route_name, $route_options); - } - - /** - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * - * @return \Drupal\Core\Ajax\AjaxResponse - */ - public function ajaxSave(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $response = new AjaxResponse(); - $url = Url::fromRoute($route_name, $route_parameters); - $response->addCommand(new RedirectCommand($url->toString())); - $response->addCommand(new CloseModalDialogCommand()); - return $response; - } - - /** - * Document the route name and parameters for redirect after submission. - * - * @param array $cached_values - * - * @return array In the format of - * In the format of - * return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name']]; - */ - abstract protected function getParentRouteInfo($cached_values); - - /** - * Custom logic for setting the conditions array in cached_values. - * - * @param $cached_values - * - * @param $contexts - * The conditions to set within the cached values. - * - * @return mixed - * Return the $cached_values - */ - abstract protected function setContexts($cached_values, $contexts); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract protected function getContexts($cached_values); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/RequiredContext.php b/sites/all/modules/contrib/dev/ctools/src/Form/RequiredContext.php deleted file mode 100644 index 07ae6be67..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/RequiredContext.php +++ /dev/null @@ -1,224 +0,0 @@ -get('typed_data_manager'), - $container->get('form_builder') - ); - } - - public function __construct(PluginManagerInterface $typed_data_manager, FormBuilder $form_builder) { - $this->typedDataManager = $typed_data_manager; - $this->formBuilder = $form_builder; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_required_context_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $this->machine_name = $cached_values['id']; - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $options = []; - foreach ($this->typedDataManager->getDefinitions() as $plugin_id => $definition) { - $options[$plugin_id] = (string) $definition['label']; - } - $form['items'] = array( - '#type' => 'markup', - '#prefix' => '
    ', - '#suffix' => '
    ', - '#theme' => 'table', - '#header' => array($this->t('Information'), $this->t('Description'), $this->t('Operations')), - '#rows' => $this->renderContexts($cached_values), - '#empty' => $this->t('No required contexts have been configured.') - ); - $form['contexts'] = [ - '#type' => 'select', - '#options' => $options, - ]; - $form['add'] = [ - '#type' => 'submit', - '#name' => 'add', - '#value' => $this->t('Add required context'), - '#ajax' => [ - 'callback' => [$this, 'add'], - 'event' => 'click', - ], - '#submit' => [ - 'callback' => [$this, 'submitform'], - ] - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - list($route_name, $route_parameters) = $this->getOperationsRouteInfo($cached_values, $this->machine_name, $form_state->getValue('contexts')); - $form_state->setRedirect($route_name . '.edit', $route_parameters); - } - - /** - * Custom ajax form submission handler. - * - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * - * @return \Drupal\Core\Ajax\AjaxResponse - */ - public function add(array &$form, FormStateInterface $form_state) { - $context = $form_state->getValue('contexts'); - $content = $this->formBuilder->getForm($this->getContextClass(), $context, $this->getTempstoreId(), $this->machine_name); - $content['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $response = new AjaxResponse(); - $response->addCommand(new OpenModalDialogCommand($this->t('Configure Required Context'), $content, array('width' => '700'))); - return $response; - } - - /** - * @param $cached_values - * - * @return array - */ - public function renderContexts($cached_values) { - $configured_contexts = array(); - foreach ($this->getContexts($cached_values) as $row => $context) { - list($plugin_id, $label, $machine_name, $description) = array_values($context); - list($route_name, $route_parameters) = $this->getOperationsRouteInfo($cached_values, $cached_values['id'], $row); - $build = array( - '#type' => 'operations', - '#links' => $this->getOperations($route_name, $route_parameters), - ); - $configured_contexts[] = array( - $this->t('Label: @label
    Type: @type', ['@label' => $label, '@type' => $plugin_id]), - $this->t('@description', ['@description' => $description]), - 'operations' => [ - 'data' => $build, - ], - ); - } - return $configured_contexts; - } - - protected function getOperations($route_name_base, array $route_parameters = array()) { - $operations['edit'] = array( - 'title' => $this->t('Edit'), - 'url' => new Url($route_name_base . '.edit', $route_parameters), - 'weight' => 10, - 'attributes' => array( - 'class' => array('use-ajax'), - 'data-accepts' => 'application/vnd.drupal-modal', - 'data-dialog-options' => json_encode(array( - 'width' => 700, - )), - ), - 'ajax' => [ - '' - ], - ); - $route_parameters['id'] = $route_parameters['context']; - $operations['delete'] = array( - 'title' => $this->t('Delete'), - 'url' => new Url($route_name_base . '.delete', $route_parameters), - 'weight' => 100, - 'attributes' => array( - 'class' => array('use-ajax'), - 'data-accepts' => 'application/vnd.drupal-modal', - 'data-dialog-options' => json_encode(array( - 'width' => 700, - )), - ), - ); - return $operations; - } - - /** - * Return a subclass of '\Drupal\ctools\Form\ContextConfigure'. - * - * The ContextConfigure class is designed to be subclassed with custom route - * information to control the modal/redirect needs of your use case. - * - * @return string - */ - abstract protected function getContextClass(); - - /** - * Provide the tempstore id for your specified use case. - * - * @return string - */ - abstract protected function getTempstoreId(); - - /** - * Document the route name and parameters for edit/delete context operations. - * - * The route name returned from this method is used as a "base" to which - * ".edit" and ".delete" are appended in the getOperations() method. - * Subclassing '\Drupal\ctools\Form\ContextConfigure' and - * '\Drupal\ctools\Form\RequiredContextDelete' should set you up for using - * this approach quite seamlessly. - * - * @param mixed $cached_values - * - * @param string $machine_name - * - * @param string $row - * - * @return array - * In the format of - * return ['route.base.name', ['machine_name' => $machine_name, 'context' => $row]]; - */ - abstract protected function getOperationsRouteInfo($cached_values, $machine_name, $row); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return array - */ - abstract protected function getContexts($cached_values); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/RequiredContextDelete.php b/sites/all/modules/contrib/dev/ctools/src/Form/RequiredContextDelete.php deleted file mode 100644 index e65ce80f2..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/RequiredContextDelete.php +++ /dev/null @@ -1,194 +0,0 @@ -get('tempstore.shared')); - } - - /** - * @param \Drupal\Core\TempStore\SharedTempStoreFactory $tempstore - */ - function __construct(SharedTempStoreFactory $tempstore) { - $this->tempstore = $tempstore; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_required_context_delete'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $id = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $this->id = $id; - - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $form ['#title'] = $this->getQuestion($id, $cached_values); - - $form ['#attributes']['class'][] = 'confirmation'; - $form ['description'] = array('#markup' => $this->getDescription()); - $form [$this->getFormName()] = array('#type' => 'hidden', '#value' => 1); - - // By default, render the form using theme_confirm_form(). - if (!isset($form ['#theme'])) { - $form ['#theme'] = 'confirm_form'; - } - $form['actions'] = array('#type' => 'actions'); - $form['actions'] += $this->actions($form, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $contexts = $this->getContexts($cached_values); - unset($contexts[$this->id]); - $cached_values = $this->setContexts($cached_values, $contexts); - $this->tempstore->get($this->tempstore_id)->set($this->machine_name, $cached_values); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $form_state->setRedirect($route_name, $route_parameters); - } - - /** - * {@inheritdoc} - */ - public function getQuestion($id = NULL, $cached_values = NULL) { - $context = $this->getContexts($cached_values)[$id]; - return $this->t('Are you sure you want to delete the @label context?', array( - '@label' => $context['label'], - )); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getFormName() { - return 'confirm'; - } - - /** - * Provides the action buttons for submitting this form. - */ - protected function actions(array $form, FormStateInterface $form_state) { - return array( - 'submit' => array( - '#type' => 'submit', - '#value' => $this->getConfirmText(), - '#validate' => array( - array($this, 'validate'), - ), - '#submit' => array( - array($this, 'submitForm'), - ), - ), - 'cancel' => ConfirmFormHelper::buildCancelLink($this, $this->getRequest()), - ); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - return new Url($route_name, $route_parameters); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function getCancelText() { - return $this->t('Cancel'); - } - - /** - * Document the route name and parameters for redirect after submission. - * - * @param $cached_values - * - * @return array - * In the format of - * return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name]]; - */ - abstract protected function getParentRouteInfo($cached_values); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return array - */ - abstract protected function getContexts($cached_values); - - /** - * Custom logic for setting the contexts array in cached_values. - * - * @param $cached_values - * - * @param $contexts - * The contexts to set within the cached values. - * - * @return mixed - * Return the $cached_values - */ - abstract protected function setContexts($cached_values, $contexts); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipConfigure.php b/sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipConfigure.php deleted file mode 100644 index 5ec43d5f9..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipConfigure.php +++ /dev/null @@ -1,183 +0,0 @@ -get('tempstore.shared')); - } - - function __construct(SharedTempStoreFactory $tempstore) { - $this->tempstore = $tempstore; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_context_configure'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $context = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - if (is_numeric($context)) { - $id = $context; - $contexts = $this->getContexts($cached_values); - $context = $contexts[$id]['context']; - $label = $contexts[$id]['label']; - $machine_name = $contexts[$id]['machine_name']; - $description = $contexts[$id]['description']; - // Conditionally set this form element so that we can update or add. - $form['id'] = [ - '#type' => 'value', - '#value' => $id - ]; - } - else { - $label = ''; - $machine_name = ''; - $description = ''; - } - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $form['context'] = [ - '#type' => 'value', - '#value' => $context - ]; - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#default_value' => $label, - '#required' => TRUE, - ]; - $form['machine_name'] = [ - '#type' => 'textfield', - '#title' => $this->t('Machine Name'), - '#default_value' => $machine_name, - '#required' => TRUE, - ]; - $form['description'] = [ - '#type' => 'textarea', - '#title' => $this->t('Description'), - '#default_value' => $description, - ]; - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - '#ajax' => [ - 'callback' => [$this, 'ajaxSave'], - ] - ]; - return $form; - } - - public function validateForm(array &$form, FormStateInterface $form_state) { - $machine_name = $form_state->getValue('machine_name'); - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - foreach ($this->getContexts($cached_values) as $id => $context) { - if ($context['machine_name'] == $machine_name) { - $form_state->setError($form['machine_name'], $this->t('That machine name is in use by another context definition.')); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $contexts = $this->getContexts($cached_values); - $context = [ - 'context' => $form_state->getValue('context'), - 'label' => $form_state->getValue('label'), - 'machine_name' => $form_state->getValue('machine_name'), - 'description' => $form_state->getValue('description'), - ]; - if ($form_state->hasValue('id')) { - $contexts[$form_state->getValue('id')] = $context; - } - else { - $contexts[] = $context; - } - $cached_values = $this->setContexts($cached_values, $contexts); - $this->tempstore->get($this->tempstore_id)->set($this->machine_name, $cached_values); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $form_state->setRedirect($route_name, $route_parameters); - } - - public function ajaxSave(array &$form, FormStateInterface $form_state) { - $response = new AjaxResponse(); - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - list($route_name, $route_parameters) = $this->getParentRouteInfo($cached_values); - $url = Url::fromRoute($route_name, $route_parameters); - $response->addCommand(new RedirectCommand($url->toString())); - $response->addCommand(new CloseModalDialogCommand()); - return $response; - } - - /** - * Document the route name and parameters for redirect after submission. - * - * @param $cached_values - * - * @return array - * In the format of - * return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name]]; - */ - abstract protected function getParentRouteInfo($cached_values); - - /** - * Custom logic for retrieving the contexts array from cached_values. - * - * @param $cached_values - * - * @return array - */ - abstract protected function getContexts($cached_values); - - /** - * Custom logic for setting the contexts array in cached_values. - * - * @param $cached_values - * - * @param $contexts - * The contexts to set within the cached values. - * - * @return mixed - * Return the $cached_values - */ - abstract protected function setContexts($cached_values, $contexts); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipDelete.php b/sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipDelete.php deleted file mode 100644 index 7195e3cf8..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Form/ResolverRelationshipDelete.php +++ /dev/null @@ -1,149 +0,0 @@ -get('tempstore.shared'), $container->get('ctools.typed_data.resolver')); - } - - /** - * @param \Drupal\Core\TempStore\SharedTempStoreFactory $tempstore - * The shared tempstore. - * @param \Drupal\ctools\TypedDataResolver $resolver - * The typed data resolver. - */ - public function __construct(SharedTempStoreFactory $tempstore, TypedDataResolver $resolver) { - $this->tempstore = $tempstore; - $this->resolver = $resolver; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_resolver_relationship_delete'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion($id = NULL, $cached_values = []) { - $context = $this->getContexts($cached_values)[$id]; - return $this->t('Are you sure you want to delete the @label relationship?', [ - '@label' => $context->getContextDefinition()->getLabel(), - ]); - } - - /** - * {@inheritdoc} - */ - abstract public function getCancelUrl($cached_values = []); - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $id = NULL, $tempstore_id = NULL, $machine_name = NULL) { - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $this->id = $id; - - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $form ['#title'] = $this->getQuestion($id, $cached_values); - - $form ['#attributes']['class'][] = 'confirmation'; - $form ['description'] = array('#markup' => $this->getDescription()); - $form [$this->getFormName()] = array('#type' => 'hidden', '#value' => 1); - - // By default, render the form using theme_confirm_form(). - if (!isset($form ['#theme'])) { - $form ['#theme'] = 'confirm_form'; - } - $form['actions'] = array('#type' => 'actions'); - $form['actions'] += $this->actions($form, $form_state, $cached_values); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $this->tempstore->get($this->tempstore_id)->get($this->machine_name); - $form_state->setRedirectUrl($this->getCancelUrl($cached_values)); - } - - /** - * A custom form actions method. - * - * @param array $form - * The form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * @param $cached_values - * The current wizard cached values. - * - * @return array - */ - protected function actions(array $form, FormStateInterface $form_state, $cached_values) { - return array( - 'submit' => array( - '#type' => 'submit', - '#value' => $this->getConfirmText(), - '#validate' => array( - array($this, 'validate'), - ), - '#submit' => array( - array($this, 'submitForm'), - ), - ), - 'cancel' => ConfirmFormHelper::buildCancelLink($this, $this->getRequest()), - ); - } - - /** - * Extract contexts from the cached values. - * - * @param array $cached_values - * The cached values. - * - * @return \Drupal\Core\Plugin\Context\ContextInterface[] - */ - abstract public function getContexts($cached_values); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/ParamConverter/TempstoreConverter.php b/sites/all/modules/contrib/dev/ctools/src/ParamConverter/TempstoreConverter.php deleted file mode 100644 index 939bd87d6..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/ParamConverter/TempstoreConverter.php +++ /dev/null @@ -1,168 +0,0 @@ -tempstore = $tempstore; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public function convert($value, $definition, $name, array $defaults) { - $tempstore_id = !empty($definition['tempstore_id']) ? $definition['tempstore_id'] : $defaults['tempstore_id']; - $machine_name = $this->convertVariable($value, $defaults); - - list(, $parts) = explode(':', $definition['type'], 2); - $parts = explode(':', $parts); - foreach ($parts as $key => $part) { - $parts[$key] = $this->convertVariable($part, $defaults); - } - $cached_values = $this->tempstore->get($tempstore_id)->get($machine_name); - // Entity type upcasting is most common, so we just assume that here. - // @todo see if there's a better way to do this. - if (!$cached_values && $this->entityTypeManager->hasDefinition($name)) { - $value = $this->entityTypeManager->getStorage($name)->load($machine_name); - return $value; - } - elseif (!$cached_values) { - return NULL; - } - else { - $value = NestedArray::getValue($cached_values, $parts, $key_exists); - return $key_exists ? $value : NULL; - } - } - - /** - * A helper function for converting string variable names from the defaults. - * - * @param mixed $name - * If name is a string in the format of {var} it will parse the defaults - * for a 'var' default. If $name isn't a string or isn't a slug, it will - * return the raw $name value. If no default is found, it will return NULL - * @param array $defaults - * The route defaults array. - * - * @return mixed - * The value of a variable in defaults. - */ - protected function convertVariable($name, $defaults) { - if (is_string($name) && strpos($name, '{') === 0) { - $length = strlen($name); - $name = substr($name, 1, $length -2); - return isset($defaults[$name]) ? $defaults[$name] : NULL; - } - return $name; - } - - /** - * {@inheritdoc} - */ - public function applies($definition, $name, Route $route) { - if (!empty($definition['type']) && ($definition['type'] == 'tempstore' || strpos($definition['type'], 'tempstore:') === 0)) { - if (!empty($definition['tempstore_id']) || $route->hasDefault('tempstore_id')) { - return TRUE; - } - } - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Block/EntityView.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Block/EntityView.php deleted file mode 100644 index 3db471cf2..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Block/EntityView.php +++ /dev/null @@ -1,117 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityDisplayRepository = $entity_display_repository; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('entity_display.repository') - ); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'view_mode' => 'default', - ]; - } - - /** - * {@inheritdoc} - */ - public function blockForm($form, FormStateInterface $form_state) { - $form['view_mode'] = [ - '#type' => 'select', - '#options' => $this->entityDisplayRepository->getViewModeOptions($this->getDerivativeId()), - '#title' => $this->t('View mode'), - '#default_value' => $this->configuration['view_mode'], - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function blockSubmit($form, FormStateInterface $form_state) { - $this->configuration['view_mode'] = $form_state->getValue('view_mode'); - } - - /** - * {@inheritdoc} - */ - public function build() { - /** @var $entity \Drupal\Core\Entity\EntityInterface */ - $entity = $this->getContextValue('entity'); - - $view_builder = $this->entityTypeManager->getViewBuilder($entity->getEntityTypeId()); - $build = $view_builder->view($entity, $this->configuration['view_mode']); - - CacheableMetadata::createFromObject($this->getContext('entity')) - ->applyTo($build); - - return $build; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/BlockPluginCollection.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/BlockPluginCollection.php deleted file mode 100644 index 56d51b7cf..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/BlockPluginCollection.php +++ /dev/null @@ -1,53 +0,0 @@ - $block) { - $configuration = $block->getConfiguration(); - $region = isset($configuration['region']) ? $configuration['region'] : NULL; - $region_assignments[$region][$block_id] = $block; - } - foreach ($region_assignments as $region => $region_assignment) { - // @todo Determine the reason this needs error suppression. - @uasort($region_assignment, function (BlockPluginInterface $a, BlockPluginInterface $b) { - $a_config = $a->getConfiguration(); - $a_weight = isset($a_config['weight']) ? $a_config['weight'] : 0; - $b_config = $b->getConfiguration(); - $b_weight = isset($b_config['weight']) ? $b_config['weight'] : 0; - if ($a_weight == $b_weight) { - return strcmp($a->label(), $b->label()); - } - return $a_weight > $b_weight ? 1 : -1; - }); - $region_assignments[$region] = $region_assignment; - } - return $region_assignments; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/BlockVariantInterface.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/BlockVariantInterface.php deleted file mode 100644 index aa2709ace..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/BlockVariantInterface.php +++ /dev/null @@ -1,96 +0,0 @@ -getBlockCollection()->get($block_id); - } - - /** - * @see \Drupal\ctools\Plugin\BlockVariantInterface::addBlock() - */ - public function addBlock(array $configuration) { - $configuration['uuid'] = $this->uuidGenerator()->generate(); - $this->getBlockCollection()->addInstanceId($configuration['uuid'], $configuration); - - $block = $this->getBlock($configuration['uuid']); - // Allow modules to react to the change. - $event = new BlockVariantEvent($block, $this); - $this->eventDispatcher()->dispatch(BlockVariantEvents::ADD_BLOCK, $event); - - return $configuration['uuid']; - } - - /** - * @see \Drupal\ctools\Plugin\BlockVariantInterface::removeBlock() - */ - public function removeBlock($block_id) { - $block = $this->getBlock($block_id); - $this->getBlockCollection()->removeInstanceId($block_id); - - // Allow modules to react to the change. - $event = new BlockVariantEvent($block, $this); - $this->eventDispatcher()->dispatch(BlockVariantEvents::DELETE_BLOCK, $event); - - return $this; - } - - /** - * @see \Drupal\ctools\Plugin\BlockVariantInterface::updateBlock() - */ - public function updateBlock($block_id, array $configuration) { - $block = $this->getBlock($block_id); - $existing_configuration = $block->getConfiguration(); - $this->getBlockCollection()->setInstanceConfiguration($block_id, $configuration + $existing_configuration); - - // Allow modules to react to the change. - $event = new BlockVariantEvent($block, $this); - $this->eventDispatcher()->dispatch(BlockVariantEvents::UPDATE_BLOCK, $event); - - return $this; - } - - /** - * @see \Drupal\ctools\Plugin\BlockVariantInterface::getRegionAssignment() - */ - public function getRegionAssignment($block_id) { - $configuration = $this->getBlock($block_id)->getConfiguration(); - return isset($configuration['region']) ? $configuration['region'] : NULL; - } - - /** - * @see \Drupal\ctools\Plugin\BlockVariantInterface::getRegionAssignments() - */ - public function getRegionAssignments() { - // Build an array of the region names in the right order. - $empty = array_fill_keys(array_keys($this->getRegionNames()), []); - $full = $this->getBlockCollection()->getAllByRegion(); - // Merge it with the actual values to maintain the ordering. - return array_intersect_key(array_merge($empty, $full), $empty); - } - - /** - * @see \Drupal\ctools\Plugin\BlockVariantInterface::getRegionName() - */ - public function getRegionName($region) { - $regions = $this->getRegionNames(); - return isset($regions[$region]) ? $regions[$region] : ''; - } - - /** - * Gets the block plugin manager. - * - * @return \Drupal\Core\Block\BlockManager - * The block plugin manager. - */ - protected function getBlockManager() { - if (!$this->blockManager) { - $this->blockManager = \Drupal::service('plugin.manager.block'); - } - return $this->blockManager; - } - - /** - * Returns the block plugins used for this display variant. - * - * @return \Drupal\Core\Block\BlockPluginInterface[]|\Drupal\ctools\Plugin\BlockPluginCollection - * An array or collection of configured block plugins. - */ - protected function getBlockCollection() { - if (!$this->blockPluginCollection) { - $this->blockPluginCollection = new BlockPluginCollection($this->getBlockManager(), $this->getBlockConfig()); - } - return $this->blockPluginCollection; - } - - /** - * Gets the event dispatcher. - * - * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface - */ - protected function eventDispatcher() { - if (!$this->eventDispatcher) { - $this->eventDispatcher = \Drupal::service('event_dispatcher'); - } - return $this->eventDispatcher; - } - - /** - * Returns the UUID generator. - * - * @return \Drupal\Component\Uuid\UuidInterface - */ - abstract protected function uuidGenerator(); - - /** - * Returns the configuration for stored blocks. - * - * @return array - * An array of block configuration, keyed by the unique block ID. - */ - abstract protected function getBlockConfig(); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/EntityBundle.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/EntityBundle.php deleted file mode 100644 index 57547f348..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/EntityBundle.php +++ /dev/null @@ -1,160 +0,0 @@ -entityTypeBundleInfo = $entity_type_bundle_info; - $this->bundleOf = $entity_type_manager->getDefinition($this->getDerivativeId()); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $container->get('entity_type.manager'), - $container->get('entity_type.bundle.info'), - $configuration, - $plugin_id, - $plugin_definition - ); - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $options = array(); - $bundles = $this->entityTypeBundleInfo->getBundleInfo($this->bundleOf->id()); - foreach ($bundles as $id => $info) { - $options[$id] = $info['label']; - } - $form['bundles'] = array( - '#title' => $this->pluginDefinition['label'], - '#type' => 'checkboxes', - '#options' => $options, - '#default_value' => $this->configuration['bundles'], - ); - return parent::buildConfigurationForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->configuration['bundles'] = array_filter($form_state->getValue('bundles')); - parent::submitConfigurationForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function evaluate() { - if (empty($this->configuration['bundles']) && !$this->isNegated()) { - return TRUE; - } - /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = $this->getContextValue($this->bundleOf->id()); - return !empty($this->configuration['bundles'][$entity->bundle()]); - } - - /** - * {@inheritdoc} - */ - public function summary() { - if (count($this->configuration['bundles']) > 1) { - $bundles = $this->configuration['bundles']; - $last = array_pop($bundles); - $bundles = implode(', ', $bundles); - return $this->t('@bundle_type is @bundles or @last', array('@bundle_type' => $this->bundleOf->getBundleLabel(), '@bundles' => $bundles, '@last' => $last)); - } - $bundle = reset($this->configuration['bundles']); - return $this->t('@bundle_type is @bundle', array('@bundle_type' => $this->bundleOf->getBundleLabel(), '@bundle' => $bundle)); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return array('bundles' => array()) + parent::defaultConfiguration(); - } - - /** - * {@inheritdoc} - * - * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts - */ - public function applyConstraints(array $contexts = array()) { - // Nullify any bundle constraints on contexts we care about. - $this->removeConstraints($contexts); - $bundle = array_values($this->configuration['bundles']); - // There's only one expected context for this plugint type. - foreach ($this->getContextMapping() as $definition_id => $context_id) { - $contexts[$context_id]->getContextDefinition()->addConstraint('Bundle', ['value' => $bundle]); - } - } - - /** - * {@inheritdoc} - * - * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts - */ - public function removeConstraints(array $contexts = array()) { - // Reset the bundle constraint for any context we've mapped. - foreach ($this->getContextMapping() as $definition_id => $context_id) { - $constraints = $contexts[$context_id]->getContextDefinition()->getConstraints(); - unset($constraints['Bundle']); - $contexts[$context_id]->getContextDefinition()->setConstraints($constraints); - } - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/NodeType.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/NodeType.php deleted file mode 100644 index 3cf96006a..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Condition/NodeType.php +++ /dev/null @@ -1,41 +0,0 @@ -removeConstraints($contexts); - // If a single bundle is configured, we can set a proper constraint. - if (count($this->configuration['bundles']) == 1) { - $bundle = array_values($this->configuration['bundles']); - foreach ($this->getContextMapping() as $definition_id => $context_id) { - $contexts[$context_id]->getContextDefinition()->addConstraint('Bundle', ['value' => $bundle[0]]); - } - } - } - - /** - * {@inheritdoc} - * - * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts - */ - public function removeConstraints(array $contexts = array()) { - // Reset the bundle constraint for any context we've mapped. - foreach ($this->getContextMapping() as $definition_id => $context_id) { - $constraints = $contexts[$context_id]->getContextDefinition()->getConstraints(); - unset($constraints['Bundle']); - $contexts[$context_id]->getContextDefinition()->setConstraints($constraints); - } - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityBundle.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityBundle.php deleted file mode 100644 index 1adf70580..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityBundle.php +++ /dev/null @@ -1,53 +0,0 @@ -entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->hasKey('bundle')) { - $this->derivatives[$entity_type_id] = $base_plugin_definition; - $this->derivatives[$entity_type_id]['label'] = $this->getEntityBundleLabel($entity_type); - $this->derivatives[$entity_type_id]['context'] = [ - "$entity_type_id" => new ContextDefinition('entity:' . $entity_type_id), - ]; - } - } - return $this->derivatives; - } - - /** - * Provides the bundle label with a fallback when not defined. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type we are looking the bundle label for. - * - * @return \Drupal\Core\StringTranslation\TranslatableMarkup - * The entity bundle label or a fallback label. - */ - protected function getEntityBundleLabel($entity_type) { - - if ($label = $entity_type->getBundleLabel()) { - return $this->t('@label', ['@label' => $label]); - } - - $fallback = $entity_type->getLabel(); - if ($bundle_entity_type = $entity_type->getBundleEntityType()) { - // This is a better fallback. - $fallback = $this->entityTypeManager->getDefinition($bundle_entity_type)->getLabel(); - } - - return $this->t('@label bundle', ['@label' => $fallback]); - - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityDeriverBase.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityDeriverBase.php deleted file mode 100644 index 9fc99baa2..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityDeriverBase.php +++ /dev/null @@ -1,75 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->stringTranslation = $string_translation; - $this->entityFieldManager = $entity_field_manager; - $this->entityTypeRepository = $entity_type_repository; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('string_translation'), - $container->get('entity_field.manager'), - $container->get('entity_type.repository') - ); - } - -} - diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityViewDeriver.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityViewDeriver.php deleted file mode 100644 index 0e2c725e8..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/EntityViewDeriver.php +++ /dev/null @@ -1,28 +0,0 @@ -entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->hasViewBuilderClass()) { - $this->derivatives[$entity_type_id] = $base_plugin_definition; - $this->derivatives[$entity_type_id]['admin_label'] = $this->t('Entity view (@label)', ['@label' => $entity_type->getLabel()]); - $this->derivatives[$entity_type_id]['context'] = [ - 'entity' => new ContextDefinition('entity:' . $entity_type_id), - ]; - } - } - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataEntityRelationshipDeriver.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataEntityRelationshipDeriver.php deleted file mode 100644 index cd2d83fef..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataEntityRelationshipDeriver.php +++ /dev/null @@ -1,24 +0,0 @@ -getType() == 'entity_reference') { - parent::generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, $base_definition, $property_name, $property_definition); - } - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataLanguageRelationshipDeriver.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataLanguageRelationshipDeriver.php deleted file mode 100644 index d662d2985..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataLanguageRelationshipDeriver.php +++ /dev/null @@ -1,40 +0,0 @@ -getType() == 'language') { - parent::generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, $base_definition, $property_name, $property_definition); - } - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - parent::getDerivativeDefinitions($base_plugin_definition); - // The data types will all be set to string since language extends string - // and the parent class finds the related primitive. - foreach ($this->derivatives as $plugin_id => $derivative) { - $this->derivatives[$plugin_id]['data_type'] = 'language'; - } - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataPropertyDeriverBase.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataPropertyDeriverBase.php deleted file mode 100644 index ae8bbc2d0..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataPropertyDeriverBase.php +++ /dev/null @@ -1,113 +0,0 @@ -typedDataManager = $typed_data_manager; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('typed_data_manager'), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - foreach ($this->typedDataManager->getDefinitions() as $data_type_id => $data_type_definition) { - if (is_subclass_of($data_type_definition['class'], ComplexDataInterface::class, TRUE)) { - /** @var \Drupal\Core\TypedData\ComplexDataDefinitionInterface $base_definition */ - $base_definition = $this->typedDataManager->createDataDefinition($data_type_id); - foreach ($base_definition->getPropertyDefinitions() as $property_name => $property_definition) { - if ($property_definition instanceof BaseFieldDefinition || $property_definition instanceof FieldConfig) { - $this->generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, $base_definition, $property_name, $property_definition); - } - } - } - } - return $this->derivatives; - } - - /** - * @param $property_definition - * - * @return mixed - */ - protected function getDataType($property_definition) { - if ($property_definition instanceof DataReferenceDefinitionInterface) { - return $property_definition->getTargetDefinition()->getDataType(); - } - if ($property_definition instanceof ListDataDefinitionInterface) { - return $property_definition->getItemDefinition()->getDataType(); - } - return $property_definition->getDataType(); - } - - /** - * Generates and maintains a derivative definition. - * - * This method should directly manipulate $this->derivatives and not return - * values. This allows implementations control over the derivative names. - * - * @param $base_plugin_definition - * The base plugin definition. - * @param string $data_type_id - * The plugin id of the data type. - * @param mixed $data_type_definition - * The plugin definition of the data type. - * @param \Drupal\Core\TypedData\DataDefinitionInterface $base_definition - * The data type definition of a complex data object. - * @param string $property_name - * The name of the property - * @param \Drupal\Core\TypedData\DataDefinitionInterface $property_definition - * The property definition. - * - */ - abstract protected function generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, DataDefinitionInterface $base_definition, $property_name, DataDefinitionInterface $property_definition); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataRelationshipDeriver.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataRelationshipDeriver.php deleted file mode 100644 index e0f8dbbd8..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Deriver/TypedDataRelationshipDeriver.php +++ /dev/null @@ -1,75 +0,0 @@ -getConstraint('Bundle'); - // Identify base definitions that appear on bundle-able entities. - if ($bundle_info && array_filter($bundle_info) && $base_definition->getConstraint('EntityType')) { - $base_data_type = 'entity:' . $base_definition->getConstraint('EntityType'); - } - // Otherwise, just use the raw data type identifier. - else { - $base_data_type = $data_type_id; - } - // If we've not processed this thing before. - if (!isset($this->derivatives[$base_data_type . ':' . $property_name])) { - $derivative = $base_plugin_definition; - - $derivative['label'] = $this->t($this->label, [ - '@property' => $property_definition->getLabel(), - '@base' => $data_type_definition['label'], - ]); - $derivative['data_type'] = $property_definition->getFieldStorageDefinition()->getPropertyDefinition($property_definition->getFieldStorageDefinition()->getMainPropertyName())->getDataType(); - $derivative['property_name'] = $property_name; - $context_definition = new ContextDefinition($base_data_type, $this->typedDataManager->createDataDefinition($base_data_type)); - // Add the constraints of the base definition to the context definition. - if ($base_definition->getConstraint('Bundle')) { - $context_definition->addConstraint('Bundle', $base_definition->getConstraint('Bundle')); - } - $derivative['context'] = [ - 'base' => $context_definition, - ]; - $derivative['property_name'] = $property_name; - - $this->derivatives[$base_data_type . ':' . $property_name] = $derivative; - } - // Individual fields can be on multiple bundles. - elseif ($property_definition instanceof FieldConfigInterface) { - // We should only end up in here on entity bundles. - $derivative = $this->derivatives[$base_data_type . ':' . $property_name]; - // Update label - /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */ - $label = $derivative['label']; - list(,, $argument_name) = explode(':', $data_type_id); - $arguments = $label->getArguments(); - $arguments['@'. $argument_name] = $data_type_definition['label']; - $string_args = $arguments; - array_shift($string_args); - $last = array_slice($string_args, -1); - // The slice doesn't remove, so do that now. - array_pop($string_args); - $string = count($string_args) >= 2 ? '@property from '. implode(', ', array_keys($string_args)) .' and '. array_keys($last)[0] : '@property from @base and '. array_keys($last)[0]; - $this->derivatives[$base_data_type . ':' . $property_name]['label'] = $this->t($string, $arguments); - if ($base_definition->getConstraint('Bundle')) { - // Add bundle constraints - $context_definition = $derivative['context']['base']; - $bundles = $context_definition->getConstraint('Bundle') ?: []; - $bundles = array_merge($bundles, $base_definition->getConstraint('Bundle')); - $context_definition->addConstraint('Bundle', $bundles); - } - } - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/DisplayVariant/BlockDisplayVariant.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/DisplayVariant/BlockDisplayVariant.php deleted file mode 100644 index eb8615da6..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/DisplayVariant/BlockDisplayVariant.php +++ /dev/null @@ -1,224 +0,0 @@ -contextHandler = $context_handler; - $this->account = $account; - $this->uuidGenerator = $uuid_generator; - $this->token = $token; - $this->blockManager = $block_manager; - $this->conditionManager = $condition_manager; - - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('context.handler'), - $container->get('current_user'), - $container->get('uuid'), - $container->get('token'), - $container->get('plugin.manager.block'), - $container->get('plugin.manager.condition') - ); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return parent::defaultConfiguration() + [ - 'blocks' => [] - ]; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - foreach ($this->getBlockCollection() as $instance) { - $this->calculatePluginDependencies($instance); - } - return $this->dependencies; - } - - /** - * {@inheritdoc} - */ - public function getConfiguration() { - return [ - 'blocks' => $this->getBlockCollection()->getConfiguration(), - ] + parent::getConfiguration(); - } - - /** - * {@inheritdoc} - */ - public function setConfiguration(array $configuration) { - // preserve the uuid. - if ($this->configuration && !empty($this->configuration['uuid'])) { - $configuration['uuid'] = $this->configuration['uuid']; - } - parent::setConfiguration($configuration); - $this->getBlockCollection()->setConfiguration($this->configuration['blocks']); - return $this; - } - - /** - * Gets the contexts. - * - * @return \Drupal\Component\Plugin\Context\ContextInterface[] - * An array of set contexts, keyed by context name. - */ - public function getContexts() { - return $this->contexts; - } - - /** - * Sets the contexts. - * - * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts - * An array of contexts, keyed by context name. - * - * @return $this - */ - public function setContexts(array $contexts) { - $this->contexts = $contexts; - return $this; - } - - /** - * {@inheritdoc} - */ - protected function contextHandler() { - return $this->contextHandler; - } - - /** - * {@inheritdoc} - */ - protected function getBlockConfig() { - return $this->configuration['blocks']; - } - - /** - * {@inheritdoc} - */ - protected function uuidGenerator() { - return $this->uuidGenerator; - } - - /** - * {@inheritdoc} - */ - public function __sleep() { - $vars = parent::__sleep(); - - // Gathered contexts objects should not be serialized. - if (($key = array_search('contexts', $vars)) !== FALSE) { - unset($vars[$key]); - } - - // The block plugin collection should also not be serialized, ensure that - // configuration is synced back. - if (($key = array_search('blockPluginCollection', $vars)) !== FALSE) { - if ($this->blockPluginCollection) { - $this->configuration['blocks'] = $this->blockPluginCollection->getConfiguration(); - } - unset($vars[$key]); - } - - return $vars; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/PluginWizardInterface.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/PluginWizardInterface.php deleted file mode 100644 index cbb5e7714..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/PluginWizardInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -getPluginDefinition(); - - $entity_type = $this->getData($this->getContext('base'))->getDataDefinition()->getSetting('target_type'); - $context_definition = new ContextDefinition("entity:$entity_type", $plugin_definition['label']); - $context_value = NULL; - - // If the 'base' context has a value, then get the property value to put on - // the context (otherwise, mapping hasn't occurred yet and we just want to - // return the context with the right definition and no value). - if ($this->getContext('base')->hasContextValue()) { - $context_value = $this->getData($this->getContext('base'))->entity; - } - - $context_definition->setDefaultValue($context_value); - return new Context($context_definition, $context_value); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataLanguageRelationship.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataLanguageRelationship.php deleted file mode 100644 index 17794eb4d..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataLanguageRelationship.php +++ /dev/null @@ -1,36 +0,0 @@ -getPluginDefinition(); - - $context_definition = new ContextDefinition("language", $plugin_definition['label']); - $context_value = NULL; - - // If the 'base' context has a value, then get the property value to put on - // the context (otherwise, mapping hasn't occurred yet and we just want to - // return the context with the right definition and no value). - if ($this->getContext('base')->hasContextValue()) { - $context_value = $this->getData($this->getContext('base'))->language; - } - - $context_definition->setDefaultValue($context_value); - return new Context($context_definition, $context_value); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataRelationship.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataRelationship.php deleted file mode 100644 index 6c8523b55..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/Relationship/TypedDataRelationship.php +++ /dev/null @@ -1,75 +0,0 @@ -getPluginDefinition(); - - $data_type = $plugin_definition['data_type']; - $context_definition = new ContextDefinition($data_type, $plugin_definition['label']); - $context_value = NULL; - - // If the 'base' context has a value, then get the property value to put on - // the context (otherwise, mapping hasn't occurred yet and we just want to - // return the context with the right definition and no value). - if ($this->getContext('base')->hasContextValue()) { - $data = $this->getData($this->getContext('base')); - $property = $this->getMainPropertyName($data); - $context_value = $data->get($property)->getValue(); - } - - $context_definition->setDefaultValue($context_value); - return new Context($context_definition, $context_value); - } - - public function getName() { - return $this->getPluginDefinition()['property_name']; - } - - protected function getData(ContextInterface $context) { - /** @var \Drupal\Core\TypedData\ComplexDataInterface $base */ - $base = $context->getContextValue(); - $name = $this->getPluginDefinition()['property_name']; - $data = $base->get($name); - // @todo add configuration to get N instead of first. - if ($data instanceof ListInterface) { - $data = $data->first(); - } - if ($data instanceof DataReferenceInterface) { - $data = $data->getTarget(); - } - return $data; - } - - protected function getMainPropertyName(FieldItemInterface $data) { - return $data->getFieldDefinition()->getFieldStorageDefinition()->getMainPropertyName(); - } - - public function getRelationshipValue() { - $property = $this->getMainPropertyName(); - /** @var \Drupal\Core\TypedData\ComplexDataInterface $data */ - $data = $this->getRelationship()->getContextData(); - $data->get($property)->getValue(); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipBase.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipBase.php deleted file mode 100644 index 9f1e1cf18..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipBase.php +++ /dev/null @@ -1,10 +0,0 @@ -alterInfo('ctools_relationship_info'); - $this->setCacheBackend($cache_backend, 'ctools_relationship_plugins'); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipManagerInterface.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipManagerInterface.php deleted file mode 100644 index 6de2395b5..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/RelationshipManagerInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -uuidGenerator()->generate(); - $this->getVariants()->addInstanceId($configuration['uuid'], $configuration); - return $configuration['uuid']; - } - - /** - * @see \Drupal\ctools\Plugin\VariantCollectionInterface::getVariant() - */ - public function getVariant($variant_id) { - return $this->getVariants()->get($variant_id); - } - - /** - * @see \Drupal\ctools\Plugin\VariantCollectionInterface::removeVariant() - */ - public function removeVariant($variant_id) { - $this->getVariants()->removeInstanceId($variant_id); - return $this; - } - - /** - * @see \Drupal\ctools\Plugin\VariantCollectionInterface::getVariants() - */ - public function getVariants() { - if (!$this->variantCollection) { - $this->variantCollection = new VariantPluginCollection(\Drupal::service('plugin.manager.display_variant'), $this->getVariantConfig()); - $this->variantCollection->sort(); - } - return $this->variantCollection; - } - - /** - * Returns the configuration for stored variants. - * - * @return array - * An array of variant configuration, keyed by the unique variant ID. - */ - abstract protected function getVariantConfig(); - - /** - * Returns the UUID generator. - * - * @return \Drupal\Component\Uuid\UuidInterface - */ - abstract protected function uuidGenerator(); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Plugin/VariantPluginCollection.php b/sites/all/modules/contrib/dev/ctools/src/Plugin/VariantPluginCollection.php deleted file mode 100644 index 77914cd1d..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Plugin/VariantPluginCollection.php +++ /dev/null @@ -1,43 +0,0 @@ -instanceIDs, [$this, 'sortHelper']); - return $this; - } - - /** - * {@inheritdoc} - */ - public function sortHelper($aID, $bID) { - $a_weight = $this->get($aID)->getWeight(); - $b_weight = $this->get($bID)->getWeight(); - if ($a_weight == $b_weight) { - return strcmp($aID, $bID); - } - - return ($a_weight < $b_weight) ? -1 : 1; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Routing/Enhancer/WizardEnhancer.php b/sites/all/modules/contrib/dev/ctools/src/Routing/Enhancer/WizardEnhancer.php deleted file mode 100644 index e16f6d264..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Routing/Enhancer/WizardEnhancer.php +++ /dev/null @@ -1,47 +0,0 @@ -isApplicable($route)) { - return $defaults; - } - - if (!empty($defaults['_wizard'])) { - $defaults['_controller'] = 'ctools.wizard.form:getContentResult'; - } - if (!empty($defaults['_entity_wizard'])) { - $defaults['_controller'] = 'ctools.wizard.entity.form:getContentResult'; - } - - return $defaults; - } - - /** - * Returns if current route use ctools default parameters. - * - * @param \Symfony\Component\Routing\Route $route - * The route to check. - * - * @return bool - * TRUE if the route use one of ctools route default parameters or FALSE. - */ - public function isApplicable(Route $route) { - return !$route->hasDefault('_controller') && ($route->hasDefault('_wizard') || $route->hasDefault('_entity_wizard')); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/SerializableTempstore.php b/sites/all/modules/contrib/dev/ctools/src/SerializableTempstore.php deleted file mode 100644 index 2fbac0b70..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/SerializableTempstore.php +++ /dev/null @@ -1,13 +0,0 @@ -currentUser = $current_user ?: \Drupal::currentUser(); - } - - /** - * {@inheritdoc} - */ - public function get($collection, $owner = NULL) { - // Use the currently authenticated user ID or the active user ID unless the - // owner is overridden. - if (!isset($owner)) { - $owner = $this->currentUser->id() ?: session_id(); - } - - // Store the data for this collection in the database. - $storage = $this->storageFactory->get("tempstore.shared.$collection"); - return new SerializableTempstore($storage, $this->lockBackend, $owner, $this->requestStack, $this->expire); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Testing/EntityCreationTrait.php b/sites/all/modules/contrib/dev/ctools/src/Testing/EntityCreationTrait.php deleted file mode 100644 index 6de483d60..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Testing/EntityCreationTrait.php +++ /dev/null @@ -1,54 +0,0 @@ - 'foo'. - * - * @return \Drupal\Core\Entity\EntityInterface - * Created entity. - */ - protected function createEntity($entity_type, array $values = array()) { - $storage = $this->getEntityTypeManager()->getStorage($entity_type); - $entity = $storage->create($values); - $status = $entity->save(); - \Drupal::service('router.builder')->rebuild(); - - if ($this instanceof \PHPUnit_Framework_TestCase) { - $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created entity %id of type %type.', ['%id' => $entity->id(), '%type' => $entity_type]))->__toString()); - } - else { - $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created entity %id of type %type.', ['%id' => $entity->id(), '%type' => $entity_type]))->__toString()); - } - - return $entity; - } - - /** - * @return \Drupal\Core\Entity\EntityTypeManagerInterface - */ - protected function getEntityTypeManager() { - if (!isset($this->entityTypeManager)) { - $this->entityTypeManager = $this->container->get('entity_type.manager'); - } - return $this->entityTypeManager; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Tests/Wizard/CToolsWizardTest.php b/sites/all/modules/contrib/dev/ctools/src/Tests/Wizard/CToolsWizardTest.php deleted file mode 100644 index d459dfc38..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Tests/Wizard/CToolsWizardTest.php +++ /dev/null @@ -1,142 +0,0 @@ -drupalGet('ctools/wizard'); - $this->assertSession()->pageTextContains('Form One'); - $this->dumpHeaders = TRUE; - // Check that $operations['one']['values'] worked. - $this->assertSession()->pageTextContains('Xylophone'); - // Submit first step in the wizard. - $edit = [ - 'one' => 'test', - ]; - $this->drupalPostForm('ctools/wizard', $edit, $this->t('Next')); - // Redirected to the second step. - $this->assertSession()->pageTextContains('Form Two'); - $this->assertSession()->pageTextContains('Dynamic value submitted: Xylophone'); - // Check that $operations['two']['values'] worked. - $this->assertSession()->pageTextContains('Zebra'); - // Hit previous to make sure our form value are preserved. - $this->drupalPostForm(NULL, [], $this->t('Previous')); - // Check the known form values. - $this->assertSession()->fieldValueEquals('one', 'test'); - $this->assertSession()->pageTextContains('Xylophone'); - // Goto next step again and finish this wizard. - $this->drupalPostForm(NULL, [], $this->t('Next')); - $edit = [ - 'two' => 'Second test', - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Finish')); - // Check that the wizard finished properly. - $this->assertSession()->pageTextContains('Value One: test'); - $this->assertSession()->pageTextContains('Value Two: Second test'); - } - - /** - * Test wizard validate and submit. - */ - public function testStepValidateAndSubmit() { - $this->drupalGet('ctools/wizard'); - $this->assertSession()->pageTextContains('Form One'); - // Submit first step in the wizard. - $edit = [ - 'one' => 'wrong', - ]; - $this->drupalPostForm('ctools/wizard', $edit, $this->t('Next')); - // We're still on the first form and the error is present. - $this->assertSession()->pageTextContains('Form One'); - $this->assertSession()->pageTextContains('Cannot set the value to "wrong".'); - // Try again with the magic value. - $edit = [ - 'one' => 'magic', - ]; - $this->drupalPostForm('ctools/wizard', $edit, $this->t('Next')); - // Redirected to the second step. - $this->assertSession()->pageTextContains('Form Two'); - $edit = [ - 'two' => 'Second test', - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Finish')); - // Check that the magic value triggered our submit callback. - $this->assertSession()->pageTextContains('Value One: Abraham'); - $this->assertSession()->pageTextContains('Value Two: Second test'); - } - - /** - * Test wizard entity config update. - */ - public function testEntityWizard() { - $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); - - // Start adding a new config entity. - $this->drupalGet('admin/structure/ctools_wizard_test_config_entity/add'); - $this->assertSession()->pageTextContains('Example entity'); - $this->assertSession()->pageTextNotContains('Existing entity'); - - // Submit the general step. - $edit = [ - 'id' => 'test123', - 'label' => 'Test Config Entity 123', - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Next')); - - // Submit the first step. - $edit = [ - 'one' => 'The first bit', - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Next')); - - // Submit the second step. - $edit = [ - 'two' => 'The second bit', - ]; - $this->drupalPostForm(NULL, $edit, $this->t('Finish')); - - // Now we should be looking at the list of entities. - $this->assertSession()->addressEquals('admin/structure/ctools_wizard_test_config_entity'); - $this->assertSession()->pageTextContains('Test Config Entity 123'); - - // Edit the entity again and make sure the values are what we expect. - $this->clickLink(t('Edit')); - $this->assertSession()->pageTextContains('Existing entity'); - $this->assertSession()->fieldValueEquals('label', 'Test Config Entity 123'); - $this->clickLink(t('Form One')); - $this->assertSession()->fieldValueEquals('one', 'The first bit'); - $previous = $this->getUrl(); - $this->clickLink(t('Show on dialog')); - $this->assertSession()->responseContains('Value from one: The first bit'); - $this->drupalGet($previous); - // Change the value for 'one'. - $this->drupalPostForm(NULL, ['one' => 'New value'], $this->t('Next')); - $this->assertSession()->fieldValueEquals('two', 'The second bit'); - $this->drupalPostForm(NULL, [], $this->t('Next')); - // Make sure we get the additional step because the entity exists. - $this->assertSession()->pageTextContains('This step only shows if the entity is already existing!'); - $this->drupalPostForm(NULL, [], $this->t('Finish')); - - // Edit the entity again and make sure the change stuck. - $this->assertSession()->addressEquals('admin/structure/ctools_wizard_test_config_entity'); - $this->clickLink(t('Edit')); - $this->clickLink(t('Form One')); - $this->assertSession()->fieldValueEquals('one', 'New value'); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/TypedDataResolver.php b/sites/all/modules/contrib/dev/ctools/src/TypedDataResolver.php deleted file mode 100644 index f06ec419c..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/TypedDataResolver.php +++ /dev/null @@ -1,250 +0,0 @@ -manager = $manager; - $this->translation = $translation; - } - - /** - * Convert a property to a context. - * - * This method will respect the value of contexts as well, so if a context - * object is pass that contains a value, the appropriate value will be - * extracted and injected into the resulting context object if available. - * - * @param string $property_path - * The name of the property. - * @param \Drupal\Core\Plugin\Context\ContextInterface $context - * The context from which we will extract values if available. - * - * @return \Drupal\Core\Plugin\Context\Context - * A context object that represents the definition & value of the property. - * @throws \Exception - */ - public function getContextFromProperty($property_path, ContextInterface $context) { - $value = NULL; - $data_definition = NULL; - if ($context->hasContextValue()) { - /** @var \Drupal\Core\TypedData\ComplexDataInterface $data */ - $data = $context->getContextData(); - foreach (explode(':', $property_path) as $name) { - - if ($data instanceof ListInterface) { - if (!is_numeric($name)) { - // Implicitly default to delta 0 for lists when not specified. - $data = $data->first(); - } - else { - // If we have a delta, fetch it and continue with the next part. - $data = $data->get($name); - continue; - } - } - - // Forward to the target value if this is a data reference. - if ($data instanceof DataReferenceInterface) { - $data = $data->getTarget(); - } - - if (!$data->getDataDefinition()->getPropertyDefinition($name)) { - throw new \Exception("Unknown property $name in property path $property_path"); - } - $data = $data->get($name); - } - - $value = $data->getValue(); - $data_definition = $data instanceof DataReferenceInterface ? $data->getDataDefinition()->getTargetDefinition() : $data->getDataDefinition(); - } - else { - /** @var \Drupal\Core\TypedData\ComplexDataDefinitionInterface $data_definition */ - $data_definition = $context->getContextDefinition()->getDataDefinition(); - foreach (explode(':', $property_path) as $name) { - - if ($data_definition instanceof ListDataDefinitionInterface) { - $data_definition = $data_definition->getItemDefinition(); - - // If the delta was specified explicitly, continue with the next part. - if (is_numeric($name)) { - continue; - } - } - - // Forward to the target definition if this is a data reference - // definition. - if ($data_definition instanceof DataReferenceDefinitionInterface) { - $data_definition = $data_definition->getTargetDefinition(); - } - - if (!$data_definition->getPropertyDefinition($name)) { - throw new \Exception("Unknown property $name in property path $property_path"); - } - $data_definition = $data_definition->getPropertyDefinition($name); - } - - // Forward to the target definition if this is a data reference - // definition. - if ($data_definition instanceof DataReferenceDefinitionInterface) { - $data_definition = $data_definition->getTargetDefinition(); - } - } - $context_definition = new ContextDefinition($data_definition->getDataType(), $data_definition->getLabel(), $data_definition->isRequired(), FALSE, $data_definition->getDescription()); - return new Context($context_definition, $value); - } - - /** - * Extracts a context from an array of contexts by a tokenized pattern. - * - * This is more than simple isset/empty checks on the contexts array. The - * pattern could be node:uid:name which will iterate over all provided - * contexts in the array for one named 'node', it will then load the data - * definition of 'node' and check for a property named 'uid'. This will then - * set a new (temporary) context on the array and recursively call itself to - * navigate through related properties all the way down until the request - * property is located. At that point the property is passed to a - * TypedDataResolver which will convert it to an appropriate ContextInterface - * object. - * - * @param $token - * A ":" delimited set of tokens representing - * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts - * The array of available contexts. - * - * @return \Drupal\Core\Plugin\Context\ContextInterface - * The requested token as a full Context object. - * - * @throws \Drupal\ctools\ContextNotFoundException - */ - public function convertTokenToContext($token, $contexts) { - // If the requested token is already a context, just return it. - if (isset($contexts[$token])) { - return $contexts[$token]; - } - else { - list($base, $property_path) = explode(':', $token, 2); - // A base must always be set. This method recursively calls itself - // setting bases for this reason. - if (!empty($contexts[$base])) { - return $this->getContextFromProperty($property_path, $contexts[$base]); - } - // @todo improve this exception message. - throw new ContextNotFoundException("The requested context was not found in the supplied array of contexts."); - } - } - - /** - * Provides an administrative label for a tokenized relationship. - * - * @param string $token - * The token related to a context in the contexts array. - * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts - * An array of contexts from which to extract our token's label. - * - * @return \Drupal\Core\StringTranslation\TranslatableMarkup - * The administrative label of $token. - */ - public function getLabelByToken($token, $contexts) { - // @todo Optimize this by allowing to limit the desired token? - $tokens = $this->getTokensForContexts($contexts); - if (isset($tokens[$token])) { - return $tokens[$token]; - } - } - - /** - * Extracts an array of tokens and labels. - * - * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts - * The array of contexts with which we are currently dealing. - * - * @return array - * An array of token keys and corresponding labels. - */ - public function getTokensForContexts($contexts) { - $tokens = []; - foreach ($contexts as $context_id => $context) { - $data_definition = $context->getContextDefinition()->getDataDefinition(); - if ($data_definition instanceof ComplexDataDefinitionInterface) { - foreach ($this->getTokensFromComplexData($data_definition) as $token => $label) { - $tokens["$context_id:$token"] = $data_definition->getLabel() . ': ' . $label; - } - } - } - return $tokens; - } - - /** - * Returns tokens for a complex data definition. - * - * @param \Drupal\Core\TypedData\ComplexDataDefinitionInterface $complex_data_definition - * - * @return array - * An array of token keys and corresponding labels. - */ - protected function getTokensFromComplexData(ComplexDataDefinitionInterface $complex_data_definition) { - $tokens = []; - // Loop over all properties. - foreach ($complex_data_definition->getPropertyDefinitions() as $property_name => $property_definition) { - - // Item definitions do not always have a label. Use the list definition - // label if the item does not have one. - $property_label = $property_definition->getLabel(); - if ($property_definition instanceof ListDataDefinitionInterface) { - $property_definition = $property_definition->getItemDefinition(); - $property_label = $property_definition->getLabel() ?: $property_label; - } - - // If the property is complex too, recurse to find child properties. - if ($property_definition instanceof ComplexDataDefinitionInterface) { - $property_tokens = $this->getTokensFromComplexData($property_definition); - foreach ($property_tokens as $token => $label) { - $tokens[$property_name . ':' . $token] = count($property_tokens) > 1 ? ($property_label . ': ' . $label) : $property_label; - } - } - - // Only expose references as tokens. - // @todo Consider to expose primitive and non-reference typed data - // definitions too, like strings, integers and dates. The current UI - // will not scale to that. - if ($property_definition instanceof DataReferenceDefinitionInterface) { - $tokens[$property_name] = $property_definition->getLabel(); - } - } - return $tokens; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardBase.php b/sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardBase.php deleted file mode 100644 index 9cac6854b..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardBase.php +++ /dev/null @@ -1,183 +0,0 @@ -entityTypeManager = $entity_type_manager; - parent::__construct($tempstore, $builder, $class_resolver, $event_dispatcher, $route_match, $tempstore_id, $machine_name, $step); - } - - /** - * {@inheritdoc} - */ - public static function getParameters() { - return [ - 'tempstore' => \Drupal::service('tempstore.shared'), - 'builder' => \Drupal::service('form_builder'), - 'class_resolver' => \Drupal::service('class_resolver'), - 'event_dispatcher' => \Drupal::service('event_dispatcher'), - // Keep the deprecated entity manager service as a parameter as well for - // BC, so that subclasses still work. - 'entity_manager' => \Drupal::service('entity.manager'), - 'entity_type_manager' => \Drupal::service('entity_type.manager'), - ]; - } - - /** - * {@inheritdoc} - */ - public function initValues() { - $storage = $this->entityTypeManager->getStorage($this->getEntityType()); - if ($this->getMachineName()) { - $values = $this->getTempstore()->get($this->getMachineName()); - if (!$values) { - $entity = $storage->load($this->getMachineName()); - $values[$this->getEntityType()] = $entity; - $values['id'] = $entity->id(); - $values['label'] = $entity->label(); - } - } - else { - $entity = $storage->create([]); - $values[$this->getEntityType()] = $entity; - } - $event = new WizardEvent($this, $values); - $this->dispatcher->dispatch(FormWizardInterface::LOAD_VALUES, $event); - return $event->getValues(); - } - - /** - * {@inheritdoc} - */ - public function finish(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - /** @var \Drupal\Core\Entity\EntityInterface $entity */ - $entity = $cached_values[$this->getEntityType()]; - $entity->set('id', $cached_values['id']); - $entity->set('label', $cached_values['label']); - $status = $entity->save(); - - $arguments = [ - '@entity-type' => $entity->getEntityType()->getLowercaseLabel(), - '%label' => $entity->label(), - ]; - if ($status === SAVED_UPDATED) { - $this->messenger()->addMessage($this->t('The @entity-type %label has been updated.', $arguments)); - $this->logger($entity->getEntityType()->getProvider())->notice('Updated @entity-type %label.', $arguments); - } - elseif ($status === SAVED_NEW) { - $this->messenger()->addMessage($this->t('The @entity-type %label has been added.', $arguments)); - $this->logger($entity->getEntityType()->getProvider())->notice('Added @entity-type %label.', $arguments); - } - - $form_state->setRedirectUrl($entity->toUrl('collection')); - parent::finish($form, $form_state); - } - - /** - * Helper function for generating label and id form elements. - * - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * - * @return array - */ - protected function customizeForm(array $form, FormStateInterface $form_state) { - $form = parent::customizeForm($form, $form_state); - if ($this->machine_name) { - $entity = $this->entityTypeManager->getStorage($this->getEntityType()) - ->load($this->machine_name); - } - else { - $entity = NULL; - } - $cached_values = $form_state->getTemporaryValue('wizard'); - // If the entity already exists, allow for non-linear step interaction. - if ($entity) { - // Setup the step rendering theme element. - $prefix = [ - '#theme' => ['ctools_wizard_trail_links'], - '#wizard' => $this, - '#cached_values' => $cached_values, - ]; - $form['#prefix'] = \Drupal::service('renderer')->render($prefix); - } - // Get the current form operation. - $operation = $this->getOperation($cached_values); - $operations = $this->getOperations($cached_values); - $default_operation = reset($operations); - if ($operation['form'] == $default_operation['form']) { - // Get the plugin definition of this entity. - $definition = $this->entityTypeManager->getDefinition($this->getEntityType()); - // Create id and label form elements. - $form['name'] = array( - '#type' => 'fieldset', - '#attributes' => array('class' => array('fieldset-no-legend')), - '#title' => $this->getWizardLabel(), - ); - $form['name']['label'] = array( - '#type' => 'textfield', - '#title' => $this->getMachineLabel(), - '#required' => TRUE, - '#size' => 32, - '#default_value' => !empty($cached_values['label']) ? $cached_values['label'] : '', - '#maxlength' => 255, - '#disabled' => !empty($cached_values['label']), - ); - $form['name']['id'] = array( - '#type' => 'machine_name', - '#maxlength' => 128, - '#machine_name' => array( - 'source' => array('name', 'label'), - 'exists' => $this->exists(), - ), - '#description' => $this->t('A unique machine-readable name for this @entity_type. It must only contain lowercase letters, numbers, and underscores.', ['@entity_type' => $definition->getLabel()]), - '#default_value' => !empty($cached_values['id']) ? $cached_values['id'] : '', - '#disabled' => !empty($cached_values['id']), - ); - } - - return $form; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardInterface.php b/sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardInterface.php deleted file mode 100644 index 92f557974..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Wizard/EntityFormWizardInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -tempstore = $tempstore; - $this->builder = $builder; - $this->classResolver = $class_resolver; - $this->dispatcher = $event_dispatcher; - $this->routeMatch = $route_match; - $this->tempstore_id = $tempstore_id; - $this->machine_name = $machine_name; - $this->step = $step; - } - - /** - * {@inheritdoc} - */ - public static function getParameters() { - return [ - 'tempstore' => \Drupal::service('tempstore.shared'), - 'builder' => \Drupal::service('form_builder'), - 'class_resolver' => \Drupal::service('class_resolver'), - 'event_dispatcher' => \Drupal::service('event_dispatcher'), - ]; - } - - /** - * {@inheritdoc} - */ - public function initValues() { - $values = []; - $event = new WizardEvent($this, $values); - $this->dispatcher->dispatch(FormWizardInterface::LOAD_VALUES, $event); - return $event->getValues(); - } - - /** - * {@inheritdoc} - */ - public function getTempstoreId() { - return $this->tempstore_id; - } - - /** - * {@inheritdoc} - */ - public function getTempstore() { - $tempstore = $this->tempstore->get($this->getTempstoreId()); - return $tempstore; - } - - /** - * {@inheritdoc} - */ - public function getMachineName() { - return $this->machine_name; - } - - /** - * {@inheritdoc} - */ - public function getStep($cached_values) { - if (!$this->step) { - $operations = $this->getOperations($cached_values); - $steps = array_keys($operations); - $this->step = reset($steps); - } - return $this->step; - } - - /** - * {@inheritdoc} - */ - public function getOperation($cached_values) { - $operations = $this->getOperations($cached_values); - $step = $this->getStep($cached_values); - if (!empty($operations[$step])) { - return $operations[$step]; - } - $operation = reset($operations); - return $operation; - } - - /** - * The translated text of the "Next" button's text. - * - * @return string - */ - public function getNextOp() { - return $this->t('Next'); - } - - /** - * {@inheritdoc} - */ - public function getNextParameters($cached_values) { - // Get the steps by key. - $operations = $this->getOperations($cached_values); - $steps = array_keys($operations); - // Get the steps after the current step. - $after = array_slice($operations, array_search($this->getStep($cached_values), $steps) + 1); - // Get the steps after the current step by key. - $after_keys = array_keys($after); - $step = reset($after_keys); - if (!$step) { - $keys = array_keys($operations); - $step = end($keys); - } - return [ - 'machine_name' => $this->getMachineName(), - 'step' => $step, - 'js' => 'nojs', - ]; - } - - /** - * {@inheritdoc} - */ - public function getPreviousParameters($cached_values) { - $operations = $this->getOperations($cached_values); - $step = $this->getStep($cached_values); - - // Get the steps by key. - $steps = array_keys($operations); - // Get the steps before the current step. - $before = array_slice($operations, 0, array_search($step, $steps)); - // Get the steps before the current step by key. - $before = array_keys($before); - // Reverse the steps for easy access to the next step. - $before_steps = array_reverse($before); - $step = reset($before_steps); - return [ - 'machine_name' => $this->getMachineName(), - 'step' => $step, - 'js' => 'nojs', - ]; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - if (!$this->getMachineName() || !$this->getTempstore()->get($this->getMachineName())) { - $cached_values = $this->initValues(); - } - else { - $cached_values = $this->getTempstore()->get($this->getMachineName()); - } - $operation = $this->getOperation($cached_values); - /* @var $operation \Drupal\Core\Form\FormInterface */ - $operation = $this->classResolver->getInstanceFromDefinition($operation['form']); - return $operation->getFormId(); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - // Get the current form operation. - $operation = $this->getOperation($cached_values); - $form = $this->customizeForm($form, $form_state); - /* @var $formClass \Drupal\Core\Form\FormInterface */ - $formClass = $this->classResolver->getInstanceFromDefinition($operation['form']); - // Pass include any custom values for this operation. - if (!empty($operation['values'])) { - $cached_values = array_merge($cached_values, $operation['values']); - $form_state->setTemporaryValue('wizard', $cached_values); - } - // Build the form. - $form = $formClass->buildForm($form, $form_state); - if (isset($operation['title'])) { - $form['#title'] = $operation['title']; - } - $form['actions'] = $this->actions($formClass, $form_state); - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) {} - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Only perform this logic if we're moving to the next page. This prevents - // the loss of cached values on ajax submissions. - if ((string)$form_state->getValue('op') == (string)$this->getNextOp()) { - $cached_values = $form_state->getTemporaryValue('wizard'); - if ($form_state->hasValue('label')) { - $cached_values['label'] = $form_state->getValue('label'); - } - if ($form_state->hasValue('id')) { - $cached_values['id'] = $form_state->getValue('id'); - } - if (is_null($this->machine_name) && !empty($cached_values['id'])) { - $this->machine_name = $cached_values['id']; - } - $this->getTempstore()->set($this->getMachineName(), $cached_values); - if (!$form_state->get('ajax')) { - $form_state->setRedirect($this->getRouteName(), $this->getNextParameters($cached_values)); - } - } - } - - /** - * {@inheritdoc} - */ - public function populateCachedValues(array &$form, FormStateInterface $form_state) { - $cached_values = $this->getTempstore()->get($this->getMachineName()); - if (!$cached_values) { - $cached_values = $form_state->getTemporaryValue('wizard'); - if (!$cached_values) { - $cached_values = $this->initValues(); - $form_state->setTemporaryValue('wizard', $cached_values); - } - } - } - - /** - * {@inheritdoc} - */ - public function previous(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $form_state->setRedirect($this->getRouteName(), $this->getPreviousParameters($cached_values)); - } - - /** - * {@inheritdoc} - */ - public function finish(array &$form, FormStateInterface $form_state) { - $this->getTempstore()->delete($this->getMachineName()); - } - - /** - * Helper function for generating default form elements. - * - * @param array $form - * @param \Drupal\Core\Form\FormStateInterface $form_state - * - * @return array - */ - protected function customizeForm(array $form, FormStateInterface $form_state) { - // Setup the step rendering theme element. - $prefix = [ - '#theme' => ['ctools_wizard_trail'], - '#wizard' => $this, - '#cached_values' => $form_state->getTemporaryValue('wizard'), - ]; - // @todo properly inject the renderer. - $form['#prefix'] = \Drupal::service('renderer')->render($prefix); - return $form; - } - - /** - * Generates action elements for navigating between the operation steps. - * - * @param \Drupal\Core\Form\FormInterface $form_object - * The current operation form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * - * @return array - */ - protected function actions(FormInterface $form_object, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $operations = $this->getOperations($cached_values); - $step = $this->getStep($cached_values); - $operation = $operations[$step]; - - $steps = array_keys($operations); - // Slice to find the operations that occur before the current operation. - $before = array_slice($operations, 0, array_search($step, $steps)); - // Slice to find the operations that occur after the current operation. - $after = array_slice($operations, array_search($step, $steps) + 1); - - $actions = [ - 'submit' => [ - '#type' => 'submit', - '#value' => $this->t('Next'), - '#button_type' => 'primary', - '#validate' => [ - '::populateCachedValues', - [$form_object, 'validateForm'], - ], - '#submit' => [ - [$form_object, 'submitForm'], - ], - ], - ]; - - // Add any submit or validate functions for the step and the global ones. - if (isset($operation['validate'])) { - $actions['submit']['#validate'] = array_merge($actions['submit']['#validate'], $operation['validate']); - } - $actions['submit']['#validate'][] = '::validateForm'; - if (isset($operation['submit'])) { - $actions['submit']['#submit'] = array_merge($actions['submit']['#submit'], $operation['submit']); - } - $actions['submit']['#submit'][] = '::submitForm'; - - if ($form_state->get('ajax')) { - // Ajax submissions need to submit to the current step, not "next". - $parameters = $this->getNextParameters($cached_values); - $parameters['step'] = $this->getStep($cached_values); - $actions['submit']['#ajax'] = [ - 'callback' => '::ajaxSubmit', - 'url' => Url::fromRoute($this->getRouteName(), $parameters), - 'options' => ['query' => $this->getRequest()->query->all() + [FormBuilderInterface::AJAX_FORM_REQUEST => TRUE]], - ]; - } - - // If there are steps before this one, label the button "previous" - // otherwise do not display a button. - if ($before) { - $actions['previous'] = array( - '#type' => 'submit', - '#value' => $this->t('Previous'), - '#validate' => array( - array($this, 'populateCachedValues'), - ), - '#submit' => array( - array($this, 'previous'), - ), - '#limit_validation_errors' => array(), - '#weight' => -10, - ); - if ($form_state->get('ajax')) { - // Ajax submissions need to submit to the current step, not "previous". - $parameters = $this->getPreviousParameters($cached_values); - $parameters['step'] = $this->getStep($cached_values); - $actions['previous']['#ajax'] = [ - 'callback' => '::ajaxPrevious', - 'url' => Url::fromRoute($this->getRouteName(), $parameters), - 'options' => ['query' => $this->getRequest()->query->all() + [FormBuilderInterface::AJAX_FORM_REQUEST => TRUE]], - ]; - } - } - - // If there are not steps after this one, label the button "Finish". - if (!$after) { - $actions['submit']['#value'] = $this->t('Finish'); - $actions['submit']['#submit'][] = array($this, 'finish'); - if ($form_state->get('ajax')) { - $actions['submit']['#ajax']['callback'] = [$this, 'ajaxFinish']; - } - } - - return $actions; - } - - public function ajaxSubmit(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $response = new AjaxResponse(); - $parameters = $this->getNextParameters($cached_values); - $response->addCommand(new OpenModalWizardCommand($this, $this->getTempstoreId(), $parameters)); - return $response; - } - - public function ajaxPrevious(array $form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $response = new AjaxResponse(); - $parameters = $this->getPreviousParameters($cached_values); - $response->addCommand(new OpenModalWizardCommand($this, $this->getTempstoreId(), $parameters)); - return $response; - } - - public function ajaxFinish(array $form, FormStateInterface $form_state) { - $response = new AjaxResponse(); - $response->addCommand(new CloseModalDialogCommand()); - return $response; - } - - public function getRouteName() { - return $this->routeMatch->getRouteName(); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Wizard/FormWizardInterface.php b/sites/all/modules/contrib/dev/ctools/src/Wizard/FormWizardInterface.php deleted file mode 100644 index 53ccc48fc..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Wizard/FormWizardInterface.php +++ /dev/null @@ -1,182 +0,0 @@ -getTempstore()->get($this->getMachineName()); - * - * @return string - */ - public function getStep($cached_values); - - /** - * Retrieve a list of FormInterface classes by their step key in the wizard. - * - * @param mixed $cached_values - * The values returned by $this->getTempstore()->get($this->getMachineName()); * - * - * @return array - * An associative array keyed on the step name with an array value with the - * following keys: - * - title (string): Human-readable title of the step. - * - form (string): Fully-qualified class name of the form for this step. - * - values (array): Optional array of cached values to override when on - * this step. - * - validate (array): Optional array of callables to be called when this - * step is validated. - * - submit (array): Optional array of callables to be called when this - * step is submitted. - */ - public function getOperations($cached_values); - - /** - * Retrieve the current Operation. - * - * @param mixed $cached_values - * The values returned by $this->getTempstore()->get($this->getMachineName()); - * - * @return string - * The class name to instantiate. - */ - public function getOperation($cached_values); - - /** - * The name of the route to which forward or backwards steps redirect. - * - * @return string - */ - public function getRouteName(); - - /** - * The Route parameters for a 'next' step. - * - * If your route requires more than machine_name and step keys, override and - * extend this method as needed. - * - * @param mixed $cached_values - * The values returned by $this->getTempstore()->get($this->getMachineName()); - * - * @return array - * An array keyed by: - * machine_name - * step - */ - public function getNextParameters($cached_values); - - /** - * The Route parameters for a 'previous' step. - * - * If your route requires more than machine_name and step keys, override and - * extend this method as needed. - * - * @param mixed $cached_values - * The values returned by $this->getTempstore()->get($this->getMachineName()); - * - * @return array - * An array keyed by: - * machine_name - * step - */ - public function getPreviousParameters($cached_values); - - /** - * Form validation handler that populates the cached values from tempstore. - * - * Temporary values are only available for a single page load so form - * submission will lose all the values. This was we reload and provide them - * to the validate and submit process. - * - * @param array $form - * Drupal form array - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The initial form state before validation or submission of the steps. - */ - public function populateCachedValues(array &$form, FormStateInterface $form_state); - - /** - * Form submit handler to step backwards in the wizard. - * - * "Next" steps are handled by \Drupal\Core\Form\FormInterface::submitForm(). - * - * @param array $form - * Drupal form array - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state of the wizard. This will not contain values from - * the current step since the previous button does not actually submit - * those values. - */ - public function previous(array &$form, FormStateInterface $form_state); - - /** - * Form submit handler for finalizing the wizard values. - * - * If you need to generate an entity or save config or raw table data - * subsequent to your form wizard, this is the responsible method. - * - * @param array $form - * Drupal form array - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The final form state of the wizard. - */ - public function finish(array &$form, FormStateInterface $form_state); - - public function ajaxSubmit(array $form, FormStateInterface $form_state); - - public function ajaxPrevious(array $form, FormStateInterface $form_state); - - public function ajaxFinish(array $form, FormStateInterface $form_state); - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactory.php b/sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactory.php deleted file mode 100644 index 4edfe8a4d..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactory.php +++ /dev/null @@ -1,141 +0,0 @@ -builder = $form_builder; - $this->dispatcher = $event_dispatcher; - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public function getWizardForm(FormWizardInterface $wizard, array $parameters = [], $ajax = FALSE) { - $form_state = $this->getFormState($wizard, $parameters, $ajax); - $form = $this->builder->buildForm($wizard, $form_state); - - if ($ajax) { - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - $status_messages = ['#type' => 'status_messages']; - if ($messages = $this->renderer->renderRoot($status_messages)) { - if (!empty($form['#prefix'])) { - // Form prefix is expected to be a string. Prepend the messages to - // that string. - $form['#prefix'] = '
    ' . $messages . '
    ' . $form['#prefix']; - } - } - } - return $form; - } - - /** - * @param string $class - * A class name implementing FormWizardInterface. - * @param array $parameters - * The array of parameters specific to this wizard. - * - * @return \Drupal\ctools\Wizard\FormWizardInterface - */ - public function createWizard($class, array $parameters) { - $arguments = []; - $reflection = new \ReflectionClass($class); - $constructor = $reflection->getMethod('__construct'); - foreach ($constructor->getParameters() as $parameter) { - if (array_key_exists($parameter->name, $parameters)) { - $arguments[] = $parameters[$parameter->name]; - } - elseif ($parameter->isDefaultValueAvailable()) { - $arguments[] = $parameter->getDefaultValue(); - } - } - /** @var $wizard \Drupal\ctools\Wizard\FormWizardInterface */ - $wizard = $reflection->newInstanceArgs($arguments); - return $wizard; - } - - /** - * Get the wizard form state. - * - * @param \Drupal\ctools\Wizard\FormWizardInterface $wizard - * The form wizard. - * @param array $parameters - * The array of parameters specific to this wizard. - * @param bool $ajax - * - * @return \Drupal\Core\Form\FormState - */ - public function getFormState(FormWizardInterface $wizard, array $parameters, $ajax = FALSE) { - $form_state = new FormState(); - // If a wizard has no values, initialize them. - if (!$wizard->getMachineName() || !$wizard->getTempstore()->get($wizard->getMachineName())) { - $cached_values = $wizard->initValues(); - // Save the cached values that were initialized. - if ($wizard->getMachineName()) { - $wizard->getTempstore()->set($wizard->getMachineName(), $cached_values); - } - } - else { - $cached_values = $wizard->getTempstore()->get($wizard->getMachineName()); - } - $form_state->setTemporaryValue('wizard', $cached_values); - $form_state->set('ajax', $ajax); - - $parameters['form'] = []; - $parameters['form_state'] = $form_state; - $method = new \ReflectionMethod($wizard, 'buildForm'); - $arguments = []; - foreach ($method->getParameters() as $parameter) { - if (array_key_exists($parameter->name, $parameters)) { - $arguments[] = $parameters[$parameter->name]; - } - elseif ($parameter->isDefaultValueAvailable()) { - $arguments[] = $parameter->getDefaultValue(); - } - } - unset($parameters['form'], $parameters['form_state']); - // Remove $form and $form_state from the arguments, and re-index them. - unset($arguments[0], $arguments[1]); - $form_state->addBuildInfo('args', array_values($arguments)); - return $form_state; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactoryInterface.php b/sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactoryInterface.php deleted file mode 100644 index d9b3c8e71..000000000 --- a/sites/all/modules/contrib/dev/ctools/src/Wizard/WizardFactoryInterface.php +++ /dev/null @@ -1,43 +0,0 @@ - - {% for key, value in trail %} - {% if key is same as(step) %} - {{ link(value.title, value.url) }} - {% else %} - {{ link(value.title, value.url) }} - {% endif %} - {% if value is not same as(trail|last) %} - {{ divider }} - {% endif %} - {% endfor %} - -{% endif %} diff --git a/sites/all/modules/contrib/dev/ctools/templates/ctools-wizard-trail.html.twig b/sites/all/modules/contrib/dev/ctools/templates/ctools-wizard-trail.html.twig deleted file mode 100644 index 308330789..000000000 --- a/sites/all/modules/contrib/dev/ctools/templates/ctools-wizard-trail.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% if trail %} -
    - {% for key, value in trail %} - {% if key is same as(step) %} - {{ value }} - {% else %} - {{ value }} - {% endif %} - {% if value is not same as(trail|last) %} - {{ divider }} - {% endif %} - {% endfor %} -
    -{% endif %} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/ctools_block_display_test.info.yml b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/ctools_block_display_test.info.yml deleted file mode 100644 index bfc9fb558..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/ctools_block_display_test.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Block Display Variant Test -type: module -description: 'Testing infrastructure for CTools block display variants.' -package: Testing -# version: 3.x -# core: 8.x -dependencies: - - ctools:ctools - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-3.2' -core: '8.x' -project: 'ctools' -datestamp: 1550728390 diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/src/Plugin/DisplayVariant/BlockDisplayVariant.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/src/Plugin/DisplayVariant/BlockDisplayVariant.php deleted file mode 100644 index 2aa254b35..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_block_display_test/src/Plugin/DisplayVariant/BlockDisplayVariant.php +++ /dev/null @@ -1,23 +0,0 @@ -one; - } - - /** - * @inheritDoc - */ - public function getTwo() { - return $this->two; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityInterface.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityInterface.php deleted file mode 100644 index a4519e491..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/ExampleConfigEntityInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -t('Example config entity'); - $header['id'] = $this->t('Machine name'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row['label'] = $entity->label(); - $row['id'] = $entity->id(); - // You probably want a few more properties here... - return $row + parent::buildRow($entity); - } - - /** - * @inheritDoc - */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - - if (!empty($operations['edit'])) { - /** @var \Drupal\Core\Url $edit */ - $edit = $operations['edit']['url']; - $edit->setRouteParameters([ - 'machine_name' => $entity->id(), - 'step' => 'general', - ]); - } - - return $operations; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityDeleteForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityDeleteForm.php deleted file mode 100644 index 035034ca4..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityDeleteForm.php +++ /dev/null @@ -1,51 +0,0 @@ -t('Are you sure you want to delete %name?', array('%name' => $this->entity->label())); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.ctools_wizard_test_config_entity.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - $this->messenger()->addMessage( - $this->t('content @type: deleted @label.', - [ - '@type' => $this->entity->bundle(), - '@label' => $this->entity->label() - ] - ) - ); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExistingForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExistingForm.php deleted file mode 100644 index 0ffca3dee..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExistingForm.php +++ /dev/null @@ -1,37 +0,0 @@ - '

    This step only shows if the entity is already existing!

    ', - ); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Do nothing! - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExternalForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExternalForm.php deleted file mode 100644 index d82b80c4c..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityExternalForm.php +++ /dev/null @@ -1,68 +0,0 @@ -tempstore = $tempstore; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('tempstore.shared')); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'ctools_wizard_test_example_config_entity_external_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $machine_name = '') { - $cached_values = $this->tempstore->get('ctools_wizard_test.config_entity')->get($machine_name); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $form['blah'] = [ - '#markup' => 'Value from one: ' . $config_entity->getOne(), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Don't do anything. - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityGeneralForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityGeneralForm.php deleted file mode 100644 index 6120342e9..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityGeneralForm.php +++ /dev/null @@ -1,46 +0,0 @@ -getTemporaryValue('wizard'); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - // The label and id will be added by the EntityFormWizardBase. - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $config_entity->set('id', $form_state->getValue('id')); - $config_entity->set('label', $form_state->getValue('label')); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityOneForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityOneForm.php deleted file mode 100644 index 6d1cf6dcb..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityOneForm.php +++ /dev/null @@ -1,62 +0,0 @@ -getTemporaryValue('wizard'); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $form['one'] = [ - '#title' => $this->t('One'), - '#type' => 'textfield', - '#default_value' => $config_entity->getOne() ?: '', - ]; - - $form['external'] = [ - '#type' => 'link', - '#title' => $this->t('Show on dialog'), - '#url' => new Url('entity.ctools_wizard_test_config_entity.external_form', [ - 'machine_name' => $config_entity->id(), - ]), - '#attributes' => [ - 'class' => 'use-ajax', - 'data-dialog-type' => 'modal', - ], - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $config_entity->set('one', $form_state->getValue('one')); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityTwoForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityTwoForm.php deleted file mode 100644 index 6ea2f40bb..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/ExampleConfigEntityTwoForm.php +++ /dev/null @@ -1,47 +0,0 @@ -getTemporaryValue('wizard'); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $form['two'] = array( - '#title' => $this->t('Two'), - '#type' => 'textfield', - '#default_value' => $config_entity->getTwo() ?: '', - ); - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $config_entity->set('two', $form_state->getValue('two')); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/OneForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/OneForm.php deleted file mode 100644 index 6ee5d67ef..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/OneForm.php +++ /dev/null @@ -1,70 +0,0 @@ -getTemporaryValue('wizard'); - $form['one'] = [ - '#title' => $this->t('One'), - '#type' => 'textfield', - '#default_value' => !empty($cached_values['one']) ? $cached_values['one'] : '', - ]; - $form['dynamic'] = [ - '#title' => $this->t('Dynamic value'), - '#type' => 'item', - '#markup' => !empty($cached_values['dynamic']) ? $cached_values['dynamic'] : '', - ]; - return $form; - } - - /** - * Form submission handler. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $keys = array( - 'one', - ); - $cached_values = $form_state->getTemporaryValue('wizard'); - foreach ($keys as $key) { - $cached_values[$key] = $form_state->getValue($key); - } - $form_state->setTemporaryValue('wizard', $cached_values); - $this->messenger()->addMessage($this->t('Dynamic value submitted: @value', ['@value' => $cached_values['dynamic']])); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/TwoForm.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/TwoForm.php deleted file mode 100644 index 01ae10a78..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Form/TwoForm.php +++ /dev/null @@ -1,69 +0,0 @@ -getTemporaryValue('wizard'); - $form['two'] = [ - '#title' => $this->t('Two'), - '#type' => 'textfield', - '#default_value' => !empty($cached_values['two']) ? $cached_values['two'] : '', - ]; - $form['dynamic'] = [ - '#title' => $this->t('Dynamic value'), - '#type' => 'item', - '#markup' => !empty($cached_values['dynamic']) ? $cached_values['dynamic'] : '', - ]; - return $form; - } - - /** - * Form submission handler. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $keys = array( - 'two', - ); - $cached_values = $form_state->getTemporaryValue('wizard'); - foreach ($keys as $key) { - $cached_values[$key] = $form_state->getValue($key); - } - $form_state->setTemporaryValue('wizard', $cached_values); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/EntityAddWizardTest.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/EntityAddWizardTest.php deleted file mode 100644 index 77ab5d599..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/EntityAddWizardTest.php +++ /dev/null @@ -1,15 +0,0 @@ -t('Example entity'); - } - - /** - * {@inheritdoc} - */ - public function getMachineLabel() { - return $this->t('Label'); - } - - /** - * {@inheritdoc} - */ - public function getEntityType() { - return 'ctools_wizard_test_config_entity'; - } - - /** - * {@inheritdoc} - */ - public function exists() { - return '\Drupal\ctools_wizard_test\Entity\ExampleConfigEntity::load'; - } - - /** - * {@inheritdoc} - */ - public function getOperations($cached_values) { - /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */ - $config_entity = $cached_values['ctools_wizard_test_config_entity']; - - $steps = [ - 'general' => [ - 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityGeneralForm', - 'title' => $this->t('General'), - ], - 'one' => [ - 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityOneForm', - 'title' => $this->t('Form One'), - ], - 'two' => [ - 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityTwoForm', - 'title' => $this->t('Form Two'), - ], - ]; - - // To test that we can get the config entity and add/remove steps - // based on it's values, we'll add a special step only when the entity - // is pre-existing. - if (!empty($config_entity) && !$config_entity->isNew()) { - $steps['existing'] = [ - 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityExistingForm', - 'title' => $this->t('Existing entity'), - ]; - } - - return $steps; - } -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/WizardTest.php b/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/WizardTest.php deleted file mode 100644 index 49a3ce597..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/modules/ctools_wizard_test/src/Wizard/WizardTest.php +++ /dev/null @@ -1,82 +0,0 @@ -t('Wizard Information'); - } - - /** - * {@inheritdoc} - */ - public function getMachineLabel() { - return $this->t('Wizard Test Name'); - } - - /** - * {@inheritdoc} - */ - public function getOperations($cached_values) { - return array( - 'one' => [ - 'form' => 'Drupal\ctools_wizard_test\Form\OneForm', - 'title' => $this->t('Form One'), - 'values' => ['dynamic' => 'Xylophone'], - 'validate' => ['::stepOneValidate'], - 'submit' => ['::stepOneSubmit'], - ], - 'two' => [ - 'form' => 'Drupal\ctools_wizard_test\Form\TwoForm', - 'title' => $this->t('Form Two'), - 'values' => ['dynamic' => 'Zebra'], - ], - ); - } - - /** - * Validation callback for the first step. - */ - public function stepOneValidate($form, FormStateInterface $form_state) { - if ($form_state->getValue('one') == 'wrong') { - $form_state->setErrorByName('one', $this->t('Cannot set the value to "wrong".')); - } - } - - /** - * Submission callback for the first step. - */ - public function stepOneSubmit($form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - if ($form_state->getValue('one') == 'magic') { - $cached_values['one'] = 'Abraham'; - } - $form_state->setTemporaryValue('wizard', $cached_values); - } - - /** - * {@inheritdoc} - */ - public function getRouteName() { - return 'ctools.wizard.test.step'; - } - - /** - * {@inheritdoc} - */ - public function finish(array &$form, FormStateInterface $form_state) { - $cached_values = $form_state->getTemporaryValue('wizard'); - $this->messenger()->addMessage($this->t('Value One: @one', ['@one' => $cached_values['one']])); - $this->messenger()->addMessage($this->t('Value Two: @two', ['@two' => $cached_values['two']])); - parent::finish($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/BlockDisplayVariantTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/BlockDisplayVariantTest.php deleted file mode 100644 index 01e462665..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/BlockDisplayVariantTest.php +++ /dev/null @@ -1,53 +0,0 @@ -prophesize(EventDispatcherInterface::class); - // Swap in a mock event dispatcher so we can spy on method calls. - $this->container->set('event_dispatcher', $event_dispatcher->reveal()); - - $variant = BlockDisplayVariant::create( - $this->container, - [], - 'foobar', - [] - ); - // Set up the expected calls to the event dispatcher. - $event = Argument::type(BlockVariantEvent::class); - - $event_dispatcher->dispatch(BlockVariantEvents::ADD_BLOCK, $event) - ->shouldBeCalled(); - $event_dispatcher->dispatch(BlockVariantEvents::UPDATE_BLOCK, $event) - ->shouldBeCalled(); - $event_dispatcher->dispatch(BlockVariantEvents::DELETE_BLOCK, $event) - ->shouldBeCalled(); - - $block_id = $variant->addBlock(['id' => 'system_powered_by_block']); - $variant->updateBlock($block_id, []); - $variant->removeBlock($block_id); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipManagerTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipManagerTest.php deleted file mode 100644 index 909c52c68..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipManagerTest.php +++ /dev/null @@ -1,63 +0,0 @@ -relationshipManager->getDefinitions(); - $expected = [ - 'Bundle' => [ - 0 => "page", - 1 => "foo" - ] - ]; - $this->assertSame($expected, $definitions['typed_data_relationship:entity:node:body']['context']['base']->getConstraints()); - - // Check that typed data primitive labels are formatted properly. - $this->assertSame('Body from Page and Foo', (string) $definitions['typed_data_relationship:entity:node:body']['label']); - - // Check that entity relationship labels are formatted properly. - $this->assertSame('Authored by Entity from Content', (string) $definitions['typed_data_entity_relationship:entity:node:uid']['label']); - - // Check that language relationship labels are formatted properly. - $this->assertSame('Language Language from Content', (string) $definitions['typed_data_language_relationship:entity:node:langcode']['label']); - } - - /** - * @covers ::getDefinitionsForContexts - */ - public function testRelationshipPluginAvailability() { - $context_definition = new ContextDefinition('entity:node'); - $contexts = [ - 'node' => new Context($context_definition, $this->entities['node1']), - ]; - $definitions = $this->relationshipManager->getDefinitionsForContexts($contexts); - //$this->assertTrue(isset($definitions['typed_data_relationship:entity:node:body'])); - - $context_definition = new ContextDefinition('entity:node'); - $contexts = [ - 'node' => new Context($context_definition, $this->entities['node2']), - ]; - $definitions = $this->relationshipManager->getDefinitionsForContexts($contexts); - $this->assertFalse(isset($definitions['typed_data_relationship:entity:node:body'])); - - $context_definition = new ContextDefinition('entity:node'); - $contexts = [ - 'node' => new Context($context_definition, $this->entities['node3']), - ]; - $definitions = $this->relationshipManager->getDefinitionsForContexts($contexts); - //$this->assertTrue(isset($definitions['typed_data_relationship:entity:node:body'])); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipsTestBase.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipsTestBase.php deleted file mode 100644 index cd58379bb..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/RelationshipsTestBase.php +++ /dev/null @@ -1,96 +0,0 @@ -installSchema('system', ['sequences', 'router']); - $this->installEntitySchema('user'); - $this->installEntitySchema('node_type'); - $this->installEntitySchema('node'); - $this->installConfig('node'); - $page = $this->createEntity('node_type', [ - 'type' => 'page', - 'name' => 'Page' - ]); - node_add_body_field($page); - $article = $this->createEntity('node_type', [ - 'type' => 'article', - 'name' => 'Article' - ]); - // Not adding the body field the articles so that we can perform a test. - $foo = $this->createEntity('node_type', [ - 'type' => 'foo', - 'name' => 'Foo' - ]); - node_add_body_field($foo); - $this->relationshipManager = $this->container->get('plugin.manager.ctools.relationship'); - - $user = $this->createEntity('user', [ - 'name' => 'test_user', - 'password' => 'password', - 'mail' => 'mail@test.com', - 'status' => 1, - ]); - $node1 = $this->createEntity('node', [ - 'title' => 'Node 1', - 'type' => 'page', - 'uid' => $user->id(), - 'body' => 'This is a test', - ]); - $node2 = $this->createEntity('node', [ - 'title' => 'Node 2', - 'type' => 'article', - 'uid' => $user->id() - ]); - $node3 = $this->createEntity('node', [ - 'title' => 'Node 3', - 'type' => 'foo', - 'uid' => $user->id() - ]); - - $this->entities = [ - 'user' => $user, - 'node1' => $node1, - 'node2' => $node2, - 'node3' => $node3, - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/SerializableTempstoreTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/SerializableTempstoreTest.php deleted file mode 100644 index 16e0704a9..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/SerializableTempstoreTest.php +++ /dev/null @@ -1,64 +0,0 @@ -installSchema('system', ['key_value_expire']); - } - - /** - * Tests serializing a serializable temp store object. - */ - public function testSerializableTempStore() { - $store = $this->container - ->get('ctools.serializable.tempstore.factory') - ->get('foobar'); - - // Add an unserializable request to the request stack. If the tempstore - // didn't use DependencySerializationTrait, the exception would be thrown - // when we try to serialize the tempstore. - $request = $this->prophesize(Request::class); - $request->willImplement('\Serializable'); - $request->serialize()->willThrow(new \LogicException('Not cool, bruh!')); - $this->container->get('request_stack')->push($request->reveal()); - - $this->assertInstanceOf(SerializableTempstore::class, $store); - /** @var SerializableTempstore $store */ - - $store = serialize($store); - $this->assertInternalType('string', $store); - $this->assertNotEmpty($store, 'The tempstore was serialized.'); - - $store = unserialize($store); - $this->assertInstanceOf(SerializableTempstore::class, $store, 'The tempstore was unserialized.'); - - $request_stack = $this->getObjectAttribute($store, 'requestStack'); - $this->assertSame( - $this->container->get('request_stack'), - $request_stack, - 'The request stack was pulled from the container during unserialization.' - ); - $this->assertSame($request->reveal(), $request_stack->pop()); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataEntityRelationshipPluginTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataEntityRelationshipPluginTest.php deleted file mode 100644 index 042eb7b05..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataEntityRelationshipPluginTest.php +++ /dev/null @@ -1,46 +0,0 @@ -relationshipManager->createInstance('typed_data_entity_relationship:entity:node:type'); - $this->assertSame('type', $type_plugin->getName()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $uuid_plugin */ - $uid_plugin = $this->relationshipManager->createInstance('typed_data_entity_relationship:entity:node:uid'); - $this->assertSame('uid', $uid_plugin->getName()); - } - - /** - * @covers ::getRelationship - */ - public function testRelationship() { - /** @var \Drupal\ctools\Plugin\RelationshipInterface $type_plugin */ - $type_plugin = $this->relationshipManager->createInstance('typed_data_entity_relationship:entity:node:type'); - $type_plugin->setContextValue('base', $this->entities['node1']); - $relationship = $type_plugin->getRelationship(); - $this->assertTrue($relationship->getContextValue() instanceof NodeType); - $this->assertSame('entity:node_type', $relationship->getContextDefinition()->getDataType()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $uid_plugin */ - $uid_plugin = $this->relationshipManager->createInstance('typed_data_entity_relationship:entity:node:uid'); - $uid_plugin->setContextValue('base', $this->entities['node3']); - $relationship = $uid_plugin->getRelationship(); - $this->assertTrue($relationship->getContextValue() instanceof User); - $this->assertSame('entity:user', $relationship->getContextDefinition()->getDataType()); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataLanguageRelationshipPluginTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataLanguageRelationshipPluginTest.php deleted file mode 100644 index 3e9453152..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataLanguageRelationshipPluginTest.php +++ /dev/null @@ -1,36 +0,0 @@ -relationshipManager->createInstance('typed_data_language_relationship:entity:node:langcode'); - $this->assertSame('langcode', $langcode_plugin->getName()); - } - - /** - * @covers ::getRelationship - * - * @todo expand to include a new language. - */ - public function testRelationship() { - /** @var \Drupal\ctools\Plugin\RelationshipInterface $langcode_plugin */ - $langcode_plugin = $this->relationshipManager->createInstance('typed_data_language_relationship:entity:node:langcode'); - $langcode_plugin->setContextValue('base', $this->entities['node1']); - $relationship = $langcode_plugin->getRelationship(); - $this->assertTrue($relationship->getContextValue() instanceof LanguageInterface); - $this->assertSame('en', $relationship->getContextValue()->getId()); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataRelationshipPluginTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataRelationshipPluginTest.php deleted file mode 100644 index f9a07cfb6..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataRelationshipPluginTest.php +++ /dev/null @@ -1,103 +0,0 @@ -relationshipManager->createInstance('typed_data_relationship:entity:node:nid'); - $this->assertSame('nid', $nid_plugin->getName()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $uuid_plugin */ - $uuid_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:uuid'); - $this->assertSame('uuid', $uuid_plugin->getName()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $title_plugin */ - $title_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:title'); - $this->assertSame('title', $title_plugin->getName()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $body_plugin */ - $body_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:body'); - $this->assertSame('body', $body_plugin->getName()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $uid_plugin */ - $uid_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:uid'); - $this->assertSame('uid', $uid_plugin->getName()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $mail_plugin */ - $mail_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:user:mail'); - $this->assertSame('mail', $mail_plugin->getName()); - } - - /** - * @covers ::getRelationship - */ - public function testRelationship() { - /** @var \Drupal\ctools\Plugin\RelationshipInterface $nid_plugin */ - $nid_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:nid'); - $nid_plugin->setContextValue('base', $this->entities['node1']); - $relationship = $nid_plugin->getRelationship(); - $this->assertTrue($relationship instanceof ContextInterface); - $this->assertTrue($relationship->getContextDefinition()->getDataType() == 'integer'); - $this->assertTrue($relationship->hasContextValue()); - $this->assertTrue($relationship->getContextValue() == $this->entities['node1']->id()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $uuid_plugin */ - $uuid_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:uuid'); - $uuid_plugin->setContextValue('base', $this->entities['node1']); - $relationship = $uuid_plugin->getRelationship(); - $this->assertTrue($relationship instanceof ContextInterface); - $this->assertTrue($relationship->getContextDefinition()->getDataType() == 'string'); - $this->assertTrue($relationship->hasContextValue()); - $this->assertTrue($relationship->getContextValue() == $this->entities['node1']->uuid()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $title_plugin */ - $title_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:title'); - $title_plugin->setContextValue('base', $this->entities['node1']); - $relationship = $title_plugin->getRelationship(); - $this->assertTrue($relationship instanceof ContextInterface); - $this->assertTrue($relationship->getContextDefinition()->getDataType() == 'string'); - $this->assertTrue($relationship->hasContextValue()); - $this->assertTrue($relationship->getContextValue() == $this->entities['node1']->label()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $body_plugin */ - $body_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:body'); - $body_plugin->setContextValue('base', $this->entities['node1']); - $relationship = $body_plugin->getRelationship(); - $this->assertTrue($relationship instanceof ContextInterface); - $this->assertTrue($relationship->getContextDefinition()->getDataType() == 'string'); - $this->assertTrue($relationship->hasContextValue()); - $this->assertTrue($relationship->getContextValue() == $this->entities['node1']->get('body')->first()->get('value')->getValue()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $uid_plugin */ - $uid_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:node:uid'); - $uid_plugin->setContextValue('base', $this->entities['node3']); - $relationship = $uid_plugin->getRelationship(); - $this->assertTrue($relationship instanceof ContextInterface); - $this->assertTrue($relationship->getContextDefinition()->getDataType() == 'integer'); - $this->assertTrue($relationship->hasContextValue()); - $this->assertTrue($relationship->getContextValue() == $this->entities['node3']->getOwnerId()); - - /** @var \Drupal\ctools\Plugin\RelationshipInterface $mail_plugin */ - $mail_plugin = $this->relationshipManager->createInstance('typed_data_relationship:entity:user:mail'); - $mail_plugin->setContextValue('base', $this->entities['user']); - $relationship = $mail_plugin->getRelationship(); - $this->assertTrue($relationship instanceof ContextInterface); - $this->assertTrue($relationship->getContextDefinition()->getDataType() == 'email'); - $this->assertTrue($relationship->hasContextValue()); - $this->assertTrue($relationship->getContextValue() == $this->entities['user']->getEmail()); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataResolverTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataResolverTest.php deleted file mode 100644 index c53c9c1f2..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Kernel/TypedDataResolverTest.php +++ /dev/null @@ -1,105 +0,0 @@ -installSchema('system', 'sequences'); - $this->installEntitySchema('user'); - - $this->typedDataResolver = \Drupal::service('ctools.typed_data.resolver'); - } - - /** - * Tests context extraction from properties. - */ - public function testGetContextFromProperty() { - // Create a user and test entity to extract context from. - $user = User::create(['uid' => 2, 'name' => 'username', 'mail' => 'mail@example.org']); - $user->enforceIsNew(TRUE); - $user->save(); - $entity_test = EntityTest::create(['user_id' => $user->id(), 'name' => 'Test name']); - - // Test the language property. - $property_context = $this->assertPropertyPath($entity_test, 'langcode:language', 'language'); - $this->assertEquals('en', $property_context->getContextValue()->getId()); - - // Test the reference to the user. - $property_context = $this->assertPropertyPath($entity_test, 'user_id:entity', 'entity:user'); - $this->assertEquals($user->id(), $property_context->getContextValue()->id()); - - // Test the reference to the name. - $property_context = $this->assertPropertyPath($entity_test, 'name:value', 'string'); - $this->assertEquals('Test name', $property_context->getContextValue()); - - // Test explicitly specifying the delta. - $property_context = $this->assertPropertyPath($entity_test, 'name:0:value', 'string'); - $this->assertEquals('Test name', $property_context->getContextValue()); - - // Test following the reference. - $property_context = $this->assertPropertyPath($entity_test, 'user_id:entity:mail:value', 'email'); - $this->assertEquals('mail@example.org', $property_context->getContextValue()); - } - - /** - * Asserts that a context for the given property path can be derived. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity to test with. - * @param $property_path - * The property path to look for. - * @param $expected_data_type - * The expected data type. - * - * @return \Drupal\Core\Plugin\Context\ContextInterface - * The context with a value. - */ - protected function assertPropertyPath(ContentEntityInterface $entity, $property_path, $expected_data_type) { - $typed_data_entity = $entity->getTypedData(); - $context_definition = new ContextDefinition($typed_data_entity->getDataDefinition()->getDataType()); - $context_with_value = new Context($context_definition, $typed_data_entity); - $context_without_value = new Context($context_definition); - - // Test the context without value. - $property_context = $this->typedDataResolver->getContextFromProperty($property_path, $context_without_value); - $this->assertEquals($expected_data_type, $property_context->getContextDefinition()->getDataType()); - - // Test the context with value. - $property_context = $this->typedDataResolver->getContextFromProperty($property_path, $context_with_value); - $this->assertEquals($expected_data_type, $property_context->getContextDefinition()->getDataType()); - - // Return the context with value so it can be asserted. - return $property_context; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockDisplayVariantTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockDisplayVariantTest.php deleted file mode 100644 index ed04f3d64..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockDisplayVariantTest.php +++ /dev/null @@ -1,90 +0,0 @@ -prophesize(AccountInterface::class); - $context_handler = $this->prophesize(ContextHandlerInterface::class); - $uuid_generator = $this->prophesize(UuidInterface::class); - $token = $this->prophesize(Token::class); - $block_manager = $this->prophesize(BlockManager::class); - $condition_manager = $this->prophesize(ConditionManager::class); - - $display_variant = new TestBlockDisplayVariant([], '', [], $context_handler->reveal(), $account->reveal(), $uuid_generator->reveal(), $token->reveal(), $block_manager->reveal(), $condition_manager->reveal()); - - $form = []; - $form_state = (new FormState())->setValues($values); - $display_variant->submitConfigurationForm($form, $form_state); - $this->assertSame($values['label'], $display_variant->label()); - } - - /** - * Provides data for testSubmitConfigurationForm(). - */ - public function providerTestSubmitConfigurationForm() { - $data = []; - $data[] = [ - [ - 'label' => 'test_label1', - ], - ]; - $data[] = [ - [ - 'label' => 'test_label2', - 'blocks' => ['foo1' => []], - ], - ]; - $data[] = [ - [ - 'label' => 'test_label3', - 'blocks' => ['foo1' => [], 'foo2' => []], - ], - ]; - return $data; - } - -} - -class TestBlockDisplayVariant extends BlockDisplayVariant { - - /** - * {@inheritdoc} - */ - public function build() { - return []; - } - - public function getRegionNames() { - return [ - 'top' => 'Top', - 'bottom' => 'Bottom', - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockPluginCollectionTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockPluginCollectionTest.php deleted file mode 100644 index c9281070b..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockPluginCollectionTest.php +++ /dev/null @@ -1,81 +0,0 @@ - [ - 'id' => 'foo', - 'label' => 'Foo', - 'plugin' => 'system_powered_by_block', - 'region' => 'bottom', - ], - 'bar' => [ - 'id' => 'bar', - 'label' => 'Bar', - 'plugin' => 'system_powered_by_block', - 'region' => 'top', - ], - 'bing' => [ - 'id' => 'bing', - 'label' => 'Bing', - 'plugin' => 'system_powered_by_block', - 'region' => 'bottom', - 'weight' => -10, - ], - 'baz' => [ - 'id' => 'baz', - 'label' => 'Baz', - 'plugin' => 'system_powered_by_block', - 'region' => 'bottom', - ], - ]; - $block_manager = $this->prophesize(BlockManagerInterface::class); - $plugins = []; - foreach ($blocks as $block_id => $block) { - $plugin = $this->prophesize(BlockPluginInterface::class); - $plugin->label()->willReturn($block['label']); - $plugin->getConfiguration()->willReturn($block); - $plugins[$block_id] = $plugin->reveal(); - - $block_manager->createInstance($block_id, $block) - ->willReturn($plugin->reveal()) - ->shouldBeCalled(); - } - - - $block_plugin_collection = new BlockPluginCollection($block_manager->reveal(), $blocks); - $expected = [ - 'bottom' => [ - 'bing' => $plugins['bing'], - 'baz' => $plugins['baz'], - 'foo' => $plugins['foo'], - ], - 'top' => [ - 'bar' => $plugins['bar'], - ], - ]; - $this->assertSame($expected, $block_plugin_collection->getAllByRegion()); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockVariantTraitTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockVariantTraitTest.php deleted file mode 100644 index 892687943..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/BlockVariantTraitTest.php +++ /dev/null @@ -1,149 +0,0 @@ -prophesize(BlockPluginCollection::class); - $block_collection->getAllByRegion() - ->willReturn($blocks) - ->shouldBeCalled(); - - $display_variant = new TestBlockVariantTrait(); - $display_variant->setBlockPluginCollection($block_collection->reveal()); - - $this->assertSame($expected, $display_variant->getRegionAssignments()); - } - - public function providerTestGetRegionAssignments() { - return [ - [ - [ - 'top' => [], - 'bottom' => [], - ], - ], - [ - [ - 'top' => ['foo'], - 'bottom' => [], - ], - [ - 'top' => ['foo'], - ], - ], - [ - [ - 'top' => [], - 'bottom' => [], - ], - [ - 'invalid' => ['foo'], - ], - ], - [ - [ - 'top' => [], - 'bottom' => ['foo'], - ], - [ - 'bottom' => ['foo'], - 'invalid' => ['bar'], - ], - ], - ]; - } - -} - -class TestBlockVariantTrait { - use BlockVariantTrait; - - /** - * @var array - */ - protected $blockConfig = []; - - /** - * @var \Drupal\Component\Uuid\UuidInterface - */ - protected $uuidGenerator; - - /** - * @param BlockPluginCollection $block_plugin_collection - * - * @return $this - */ - public function setBlockPluginCollection(BlockPluginCollection $block_plugin_collection) { - $this->blockPluginCollection = $block_plugin_collection; - return $this; - } - - /** - * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator - * - * @return $this - */ - public function setUuidGenerator(UuidInterface $uuid_generator) { - $this->uuidGenerator = $uuid_generator; - return $this; - } - - /** - * {@inheritdoc} - */ - protected function uuidGenerator() { - return $this->uuidGenerator; - } - - /** - * Sets the block configuration. - * - * @param array $config - * The block configuration. - * - * @return $this - */ - public function setBlockConfig(array $config) { - $this->blockConfig = $config; - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getBlockConfig() { - return $this->blockConfig; - } - - /** - * {@inheritdoc} - */ - public function getRegionNames() { - return [ - 'top' => 'Top', - 'bottom' => 'Bottom', - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/ContextMapperTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Unit/ContextMapperTest.php deleted file mode 100644 index 24a85f286..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/ContextMapperTest.php +++ /dev/null @@ -1,104 +0,0 @@ -typedDataManager = $this->prophesize(TypedDataManager::class); - $this->entityRepository = $this->prophesize(EntityRepositoryInterface::class); - $this->staticContext = new ContextMapper($this->entityRepository->reveal()); - - $container = new ContainerBuilder(); - $container->set('typed_data_manager', $this->typedDataManager->reveal()); - \Drupal::setContainer($container); - } - - /** - * @covers ::getContextValues - */ - public function testGetContextValues() { - $input = []; - $actual = $this->staticContext->getContextValues($input); - $this->assertEquals([], $actual); - } - - /** - * @covers ::getContextValues - */ - public function testGetContextValuesContext() { - $data_definition = DataDefinition::createFromDataType('integer'); - $typed_data = IntegerData::createInstance($data_definition); - $this->typedDataManager->createDataDefinition('integer')->willReturn($data_definition); - $this->typedDataManager->getDefaultConstraints($data_definition)->willReturn([]); - $this->typedDataManager->create($data_definition, 5)->willReturn($typed_data); - - $input = [ - 'foo' => [ - 'label' => 'Foo', - 'description' => NULL, - 'type' => 'integer', - 'value' => 5, - ], - ]; - $expected = new Context(new ContextDefinition('integer', 'Foo'), 5); - $actual = $this->staticContext->getContextValues($input)['foo']; - $this->assertEquals($expected, $actual); - } - - /** - * @covers ::getContextValues - */ - public function testGetContextValuesEntityContext() { - $input = [ - 'foo' => [ - 'label' => 'Foo', - 'description' => NULL, - 'type' => 'entity:node', - 'value' => 'the_node_uuid', - ], - ]; - $expected = new EntityLazyLoadContext(new ContextDefinition('entity:node', 'Foo'), $this->entityRepository->reveal(), 'the_node_uuid'); - $actual = $this->staticContext->getContextValues($input)['foo']; - $this->assertEquals($expected, $actual); - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/VariantCollectionTraitTest.php b/sites/all/modules/contrib/dev/ctools/tests/src/Unit/VariantCollectionTraitTest.php deleted file mode 100644 index 4e93ea013..000000000 --- a/sites/all/modules/contrib/dev/ctools/tests/src/Unit/VariantCollectionTraitTest.php +++ /dev/null @@ -1,209 +0,0 @@ -manager = $this->prophesize(PluginManagerInterface::class); - $container->set('plugin.manager.display_variant', $this->manager->reveal()); - \Drupal::setContainer($container); - } - - /** - * @covers ::getVariants - */ - public function testGetVariantsEmpty() { - $trait_object = new TestVariantCollectionTrait(); - $this->manager->createInstance()->shouldNotBeCalled(); - - $variants = $trait_object->getVariants(); - $this->assertInstanceOf(VariantPluginCollection::class, $variants); - $this->assertSame(0, count($variants)); - } - - /** - * @covers ::getVariants - */ - public function testGetVariants() { - $trait_object = new TestVariantCollectionTrait(); - $config = [ - 'foo' => ['id' => 'foo_plugin'], - 'bar' => ['id' => 'bar_plugin'], - ]; - foreach ($config as $value) { - $plugin = $this->prophesize(VariantInterface::class); - $this->manager->createInstance($value['id'], $value)->willReturn($plugin->reveal()); - } - $trait_object->setVariantConfig($config); - - $variants = $trait_object->getVariants(); - $this->assertInstanceOf(VariantPluginCollection::class, $variants); - $this->assertSame(2, count($variants)); - return $variants; - } - - /** - * @covers ::getVariants - * - * @depends testGetVariants - */ - public function testGetVariantsSort(VariantPluginCollection $variants) { - $this->assertSame(['bar' => 'bar', 'foo' => 'foo'], $variants->getInstanceIds()); - } - - /** - * @covers ::addVariant - */ - public function testAddVariant() { - $config = ['id' => 'foo']; - $uuid = 'test-uuid'; - $expected_config = $config + ['uuid' => $uuid]; - - $uuid_generator = $this->prophesize(UuidInterface::class); - $uuid_generator->generate() - ->willReturn($uuid) - ->shouldBeCalledTimes(1); - $trait_object = new TestVariantCollectionTrait(); - $trait_object->setUuidGenerator($uuid_generator->reveal()); - - $plugin_prophecy = $this->prophesize(VariantInterface::class); - $plugin_prophecy->getConfiguration() - ->willReturn($expected_config) - ->shouldBeCalled(); - $plugin_prophecy->setConfiguration($expected_config) - ->willReturn($expected_config) - ->shouldBeCalled(); - - $this->manager->createInstance('foo', $expected_config) - ->willReturn($plugin_prophecy->reveal()); - - $resulting_uuid = $trait_object->addVariant($config); - $this->assertSame($uuid, $resulting_uuid); - - $variants = $trait_object->getVariants(); - $this->assertSame([$uuid => $uuid], $variants->getInstanceIds()); - $this->assertSame([$uuid => $expected_config], $variants->getConfiguration()); - $this->assertSame($plugin_prophecy->reveal(), $variants->get($uuid)); - return [$trait_object, $uuid, $plugin_prophecy->reveal()]; - } - - /** - * @covers ::getVariant - * - * @depends testAddVariant - */ - public function testGetVariant($data) { - list($trait_object, $uuid, $plugin) = $data; - $this->manager->createInstance()->shouldNotBeCalled(); - - $this->assertSame($plugin, $trait_object->getVariant($uuid)); - return [$trait_object, $uuid]; - } - - /** - * @covers ::removeVariant - * - * @depends testGetVariant - */ - public function testRemoveVariant($data) { - list($trait_object, $uuid) = $data; - - $this->assertSame($trait_object, $trait_object->removeVariant($uuid)); - $this->assertFalse($trait_object->getVariants()->has($uuid)); - return [$trait_object, $uuid]; - } - - /** - * @covers ::getVariant - * - * @depends testRemoveVariant - * - * @expectedException \Drupal\Component\Plugin\Exception\PluginNotFoundException - * @expectedExceptionMessage Plugin ID 'test-uuid' was not found. - */ - public function testGetVariantException($data) { - list($trait_object, $uuid) = $data; - // Attempt to retrieve a variant that has been removed. - $this->assertNull($trait_object->getVariant($uuid)); - } - -} - -class TestVariantCollectionTrait { - use VariantCollectionTrait; - - /** - * @var array - */ - protected $variantConfig = []; - - /** - * @var \Drupal\Component\Uuid\UuidInterface - */ - protected $uuidGenerator; - - /** - * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator - * - * @return $this - */ - public function setUuidGenerator(UuidInterface $uuid_generator) { - $this->uuidGenerator = $uuid_generator; - return $this; - } - - /** - * {@inheritdoc} - */ - protected function uuidGenerator() { - return $this->uuidGenerator; - } - - /** - * Sets the variant configuration. - * - * @param array $config - * The variant configuration. - * - * @return $this - */ - public function setVariantConfig(array $config) { - $this->variantConfig = $config; - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getVariantConfig() { - return $this->variantConfig; - } - -} diff --git a/sites/all/modules/contrib/dev/ctools/views_content/views_content.admin.inc b/sites/all/modules/contrib/dev/ctools/views_content/views_content.admin.inc deleted file mode 100644 index 589cf42b6..000000000 --- a/sites/all/modules/contrib/dev/ctools/views_content/views_content.admin.inc +++ /dev/null @@ -1,6 +0,0 @@ - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/devel/README.txt b/sites/all/modules/contrib/dev/devel/README.txt deleted file mode 100644 index 634f226a1..000000000 --- a/sites/all/modules/contrib/dev/devel/README.txt +++ /dev/null @@ -1,88 +0,0 @@ -README.txt for Devel module ---------------------------- - -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Requirements - * Included Modules and Features - * Recommended Modules - * Installation - * Configuration - * Maintainers - -INTRODUCTION ------------- - -Devel module contains helper functions and pages for Drupal developers and -inquisitive admins: - - - A block for quickly accessing devel pages - - A block for masquerading as other users (useful for testing) - - A mail-system class which redirects outbound email to files - - Drush commands such as fn-hook, fn-event, ... - - Docs at https://api.drupal.org/api/devel - - more - -This module is safe to use on a production site. Just be sure to only grant -'access development information' permission to developers. - - - For a full description of the module visit: - https://www.drupal.org/project/devel - - - To submit bug reports and feature suggestions, or to track changes visit: - https://www.drupal.org/project/issues/devel - - -REQUIREMENTS ------------- - -This module requires no modules outside of Drupal core. - - -INCLUDED MODULES AND FEATURES ------------------------------ - -Devel Kint - Provides a dpr() function, which pretty prints variables. -Useful during development. Also see similar helpers like dpm(), dvm(). - -Webprofiler - Adds a debug bar at bottom of all pages with tons of useful -information like a query list, cache hit/miss data, memory profiling, page -speed, php info, session info, etc. - -Devel Generate - Bulk creates nodes, users, comment, terms for development. Has -Drush integration. - -Drush Unit Testing - See develDrushTest.php for an example of unit testing of -the Drush integration. This uses Drush's own test framework, based on PHPUnit. -To run the tests, use run-tests-drush.sh. You may pass in any arguments that -are valid for `phpunit`. - - -RECOMMENDED MODULE ------------------- - -Devel Generate Extensions - Devel Images Provider allows to configure external -providers for images. - - - http://drupal.org/project/devel_image_provider - - -INSTALLATION ------------- - - - Install the Devel module as you would normally install a contributed Drupal - module. Visit https://www.drupal.org/node/1897420 for further information. - - -Author/Maintainers ------------------- - - - Moshe Weitzman (moshe weitzman) - https://www.drupal.org/u/moshe-weitzman - - Hans Salvisberg (salvis) - https://www.drupal.org/u/salvis - - Pedro Cambra https://drupal.org/user/122101/contact http://www.ymbra.com/ - - Juan Pablo Novillo https://www.drupal.org/u/juampynr - - lussoluca https://www.drupal.org/u/lussoluca - - willzyx https://www.drupal.org/u/willzyx - diff --git a/sites/all/modules/contrib/dev/devel/composer.json b/sites/all/modules/contrib/dev/devel/composer.json deleted file mode 100644 index 3c27d59eb..000000000 --- a/sites/all/modules/contrib/dev/devel/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "drupal/devel", - "description": "Various blocks, pages, and functions for developers.", - "type": "drupal-module", - "homepage": "http://drupal.org/project/devel", - "authors": [ - { - "name": "Moshe Weitzman", - "email": "weitzman@tejasa.com", - "homepage": "https://github.com/weitzman", - "role": "Maintainer" - }, - { - "name": "Hans Salvisberg", - "email": "drupal@salvisberg.com", - "homepage": "https://www.drupal.org/u/salvis", - "role": "Maintainer" - }, - { - "name": "Luca Lusso", - "homepage": "https://www.drupal.org/u/lussoluca", - "role": "Maintainer" - }, - { - "name": "Marco (willzyx)", - "homepage": "https://www.drupal.org/u/willzyx", - "role": "Maintainer" - }, - { - "name": "See contributors", - "homepage": "https://www.drupal.org/node/3236/committers" - } - ], - "support": { - "issues": "http://drupal.org/project/devel", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/devel" - }, - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": { - "symfony/var-dumper": "~2.7|^3" - }, - "suggest": {}, - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/config/install/devel.settings.yml b/sites/all/modules/contrib/dev/devel/config/install/devel.settings.yml deleted file mode 100644 index 66501f0fa..000000000 --- a/sites/all/modules/contrib/dev/devel/config/install/devel.settings.yml +++ /dev/null @@ -1,8 +0,0 @@ -page_alter: FALSE -raw_names: FALSE -error_handlers: - 1: 1 -rebuild_theme: FALSE -debug_mail_file_format: '%to-%subject-%datetime.mail.txt' -debug_mail_directory: 'temporary://devel-mails' -devel_dumper: 'default' diff --git a/sites/all/modules/contrib/dev/devel/config/install/devel.toolbar.settings.yml b/sites/all/modules/contrib/dev/devel/config/install/devel.toolbar.settings.yml deleted file mode 100644 index b12c5bdc9..000000000 --- a/sites/all/modules/contrib/dev/devel/config/install/devel.toolbar.settings.yml +++ /dev/null @@ -1,8 +0,0 @@ -toolbar_items: - - 'devel.admin_settings_link' - - 'devel.cache_clear' - - 'devel.container_info.service' - - 'devel.menu_rebuild' - - 'devel.reinstall' - - 'devel.route_info' - - 'devel.run_cron' diff --git a/sites/all/modules/contrib/dev/devel/config/install/system.menu.devel.yml b/sites/all/modules/contrib/dev/devel/config/install/system.menu.devel.yml deleted file mode 100644 index 21fb00214..000000000 --- a/sites/all/modules/contrib/dev/devel/config/install/system.menu.devel.yml +++ /dev/null @@ -1,9 +0,0 @@ -id: devel -label: 'Development' -description: 'Links related to Devel module.' -langcode: en -locked: true -dependencies: - enforced: - module: - - devel diff --git a/sites/all/modules/contrib/dev/devel/config/schema/devel.schema.yml b/sites/all/modules/contrib/dev/devel/config/schema/devel.schema.yml deleted file mode 100644 index d4d0c0393..000000000 --- a/sites/all/modules/contrib/dev/devel/config/schema/devel.schema.yml +++ /dev/null @@ -1,53 +0,0 @@ -# Schema for the configuration files of the Devel module. - -devel.settings: - type: config_object - label: 'Devel settings' - mapping: - page_alter: - type: boolean - label: 'Page alter' - raw_names: - type: boolean - label: 'Raw names' - error_handlers: - label: 'Error handlers' - type: sequence - sequence: - type: integer - rebuild_theme: - type: boolean - label: 'Rebuild theme information' - debug_mail_file_format: - type: string - label: 'Mail debug file format' - debug_mail_directory: - type: string - label: 'Mail debug directory' - devel_dumper: - type: string - label: 'Devel variable dumper' - -devel.toolbar.settings: - type: config_object - label: 'Devel Toolbar settings' - mapping: - toolbar_items: - type: sequence - label: 'Toolbar items' - sequence: - type: string - -block.settings.devel_switch_user: - type: block_settings - label: 'Switch user block' - mapping: - list_size: - type: integer - label: 'List size' - include_anon: - type: boolean - label: 'Include Anonymous user' - show_form: - type: boolean - label: 'Show search form' diff --git a/sites/all/modules/contrib/dev/devel/css/devel.css b/sites/all/modules/contrib/dev/devel/css/devel.css deleted file mode 100644 index 0abe966a3..000000000 --- a/sites/all/modules/contrib/dev/devel/css/devel.css +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Dumpers - */ -.devel-dumper .details-wrapper{ - max-height: 450px; - margin-right: 3px; - overflow: auto; -} - -/** - * Switch User block - */ -#content .block-devel-switch-user ul.links, -#footer .block-devel-switch-user ul.links { - margin-left: 0; - padding-left: 0; -} - -#content .block-devel-switch-user ul.links li, -#footer .block-devel-switch-user ul.links li { - display: inline-block; - margin-left: 0; - margin-right: 1.5em; - padding-right: 0; -} - -#footer .block-devel-switch-user ul.links li a { - margin: 0; - padding: 0; - border: none; -} - -#content #devel-switch-user-form .form-item-username, -#footer #devel-switch-user-form .form-item-username { - float: left; - margin-right: 2em; -} - -#content #devel-switch-user-form .button-primary, -#footer #devel-switch-user-form .button-primary { - margin-top: 1em; -} diff --git a/sites/all/modules/contrib/dev/devel/css/devel.toolbar.css b/sites/all/modules/contrib/dev/devel/css/devel.toolbar.css deleted file mode 100644 index c9871bb7b..000000000 --- a/sites/all/modules/contrib/dev/devel/css/devel.toolbar.css +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file - * Styling for devel toolbar module. - */ - -.toolbar .toolbar-tray-vertical .edit-devel-toolbar { - text-align: right; /* LTR */ - padding: 1em; -} -[dir="rtl"] .toolbar .toolbar-tray-vertical .edit-devel-toolbar { - text-align: left; -} - -.toolbar .toolbar-tray-horizontal .edit-devel-toolbar { - float: right; /* LTR */ -} -[dir="rtl"] .toolbar .toolbar-tray-horizontal .edit-devel-toolbar { - float: left; -} - -.toolbar .toolbar-tray-horizontal .toolbar-menu { - float: left; /* LTR */ -} -[dir="rtl"] .toolbar .toolbar-tray-horizontal .toolbar-menu { - float: right; -} - -.toolbar .toolbar-bar .toolbar-icon-devel:before{ - background-image: url(../icons/bebebe/cog.svg); -} -.toolbar-bar .toolbar-icon-devel:active:before, -.toolbar-bar .toolbar-icon-devel.is-active:before { - background-image: url(../icons/ffffff/cog.svg); -} - -.toolbar-horizontal .toolbar-horizontal-item-hidden { - display: none; -} diff --git a/sites/all/modules/contrib/dev/devel/devel.api.php b/sites/all/modules/contrib/dev/devel/devel.api.php deleted file mode 100644 index 4a413db6e..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.api.php +++ /dev/null @@ -1,25 +0,0 @@ - t('Devel module enabled'), - 'description' => t('The Devel module provides access to internal debugging information; therefore it\'s recommended to disable this module on sites in production.'), - 'severity' => REQUIREMENT_INFO, - ]; - } - - return $requirements; -} - -/** - * Set the default devel dumper plugin. - */ -function devel_update_8001() { - $kint_enabled = \Drupal::moduleHandler()->moduleExists('kint'); - - $default_dumper = $kint_enabled ? 'kint' : 'default'; - - // Set the default dumper plugin to kint if kint module is available. - \Drupal::configFactory()->getEditable('devel.settings') - ->set('devel_dumper', $default_dumper) - ->save(TRUE); -} - -/** - * Add enforced dependencies to system.menu.devel - */ -function devel_update_8002() { - $config = \Drupal::configFactory()->getEditable('system.menu.devel'); - $dependencies = $config->get('dependencies'); - $dependencies['enforced']['module'][] = 'devel'; - $config->set('dependencies', $dependencies)->save(TRUE); -} diff --git a/sites/all/modules/contrib/dev/devel/devel.libraries.yml b/sites/all/modules/contrib/dev/devel/devel.libraries.yml deleted file mode 100644 index 6d935ce46..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.libraries.yml +++ /dev/null @@ -1,11 +0,0 @@ -devel: - version: 0 - css: - theme: - css/devel.css: {} - -devel-toolbar: - version: VERSION - css: - component: - css/devel.toolbar.css: {} diff --git a/sites/all/modules/contrib/dev/devel/devel.links.menu.yml b/sites/all/modules/contrib/dev/devel/devel.links.menu.yml deleted file mode 100644 index 4becee6f1..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.links.menu.yml +++ /dev/null @@ -1,89 +0,0 @@ -devel.admin_settings: - title: 'Devel settings' - description: 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the block administration page.' - route_name: devel.admin_settings - parent: 'system.admin_config_development' -devel.admin_settings_link: - title: 'Devel settings' - description: 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the block administration page.' - route_name: devel.admin_settings - menu_name: devel -devel.configs_list: - title: 'Config editor' - description: 'Edit configuration.' - route_name: devel.configs_list - menu_name: devel -devel.reinstall: - title: 'Reinstall Modules' - route_name: devel.reinstall - menu_name: devel - class: \Drupal\devel\Plugin\Menu\DestinationMenuLink -devel.menu_rebuild: - title: 'Rebuild Menu' - route_name: devel.menu_rebuild - menu_name: devel - class: \Drupal\devel\Plugin\Menu\DestinationMenuLink -devel.state_system_page: - title: 'State editor' - description: 'Edit state system values.' - route_name: devel.state_system_page - menu_name: devel -devel.theme_registry: - title: 'Theme registry' - route_name: devel.theme_registry - menu_name: devel -devel.entity_info_page: - title: 'Entity Info' - route_name: devel.entity_info_page -# parent: 'system.admin_config_development' - menu_name: devel -devel.field_info_page: - title: 'Field Info' - route_name: devel.field_info_page -# parent: 'system.admin_config_development' - menu_name: devel -devel.phpinfo: - title: 'PHPinfo()' - route_name: system.php - menu_name: devel -devel.session: - title: 'View Session' - route_name: devel.session - menu_name: devel -devel.elements_page: - title: 'Element Info' - route_name: devel.elements_page - menu_name: devel -devel.cache_clear: - title: 'Cache clear' - route_name: devel.cache_clear - menu_name: devel - class: \Drupal\devel\Plugin\Menu\DestinationMenuLink -devel.run_cron: - title: 'Run cron' - route_name: devel.run_cron - menu_name: devel - class: \Drupal\devel\Plugin\Menu\DestinationMenuLink - -# Container info -devel.container_info.service: - title: 'Container Info' - route_name: devel.container_info.service - menu_name: devel - -# Routes info -devel.route_info: - title: 'Routes Info' - route_name: devel.route_info - menu_name: devel -devel.route_info.item: - title: 'Current route info' - route_name: devel.route_info.item - menu_name: devel - class: \Drupal\devel\Plugin\Menu\RouteDetailMenuLink - -# Event info -devel.event_info: - title: 'Events Info' - route_name: devel.event_info - menu_name: devel diff --git a/sites/all/modules/contrib/dev/devel/devel.links.task.yml b/sites/all/modules/contrib/dev/devel/devel.links.task.yml deleted file mode 100644 index 9c7d349e0..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.links.task.yml +++ /dev/null @@ -1,18 +0,0 @@ -devel.entities: - class: \Drupal\Core\Menu\LocalTaskDefault - deriver: \Drupal\devel\Plugin\Derivative\DevelLocalTask -devel.admin_settings: - title: 'Settings' - route_name: devel.admin_settings - base_route: devel.admin_settings - weight: 0 - -# Container info -devel.container_info.service: - title: 'Services' - route_name: devel.container_info.service - base_route: devel.container_info.service -devel.container_info.parameter: - title: 'Parameters' - route_name: devel.container_info.parameter - base_route: devel.container_info.service diff --git a/sites/all/modules/contrib/dev/devel/devel.module b/sites/all/modules/contrib/dev/devel/devel.module deleted file mode 100644 index 6364d2ba7..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.module +++ /dev/null @@ -1,630 +0,0 @@ -' . t('About') . ''; - $output .= '

    ' . t('The Devel module provides a suite of modules containing fun for module developers and themers. For more information, see the online documentation for the Devel module.', [':url' => 'https://www.drupal.org/docs/8/modules/devel']) . '

    '; - $output .= '

    ' . t('Uses') . '

    '; - $output .= '
    '; - $output .= '
    ' . t('Inspecting Service Container') . '
    '; - $output .= '
    ' . t('The module allows you to inspect Services and Parameters registered in the Service Container. You can see those informations on Container info page.', [':url' => Url::fromRoute('devel.container_info.service')->toString()]) . '
    '; - $output .= '
    ' . t('Inspecting Routes') . '
    '; - $output .= '
    ' . t('The module allows you to inspect routes information, gathering all routing data from .routing.yml files and from classes which subscribe to the route build/alter events. You can see those informations on Routes info page.', [':url' => Url::fromRoute('devel.route_info')->toString()]) . '
    '; - $output .= '
    ' . t('Inspecting Events') . '
    '; - $output .= '
    ' . t('The module allow you to inspect listeners registered in the event dispatcher. You can see those informations on Events info page.', [':url' => Url::fromRoute('devel.event_info')->toString()]) . '
    '; - $output .= '
    '; - return $output; - - case 'devel.container_info.service': - case 'devel.container_info.parameter': - $output = ''; - $output .= '

    ' . t('Displays Services and Parameters registered in the Service Container. For more informations on the Service Container, see the Symfony online documentation.', [':url' => 'http://symfony.com/doc/current/service_container.html']) . '

    '; - return $output; - - case 'devel.route_info': - $output = ''; - $output .= '

    ' . t('Displays registered routes for the site. For a complete overview of the routing system, see the online documentation.', [':url' => 'https://www.drupal.org/docs/8/api/routing-system']) . '

    '; - return $output; - - case 'devel.event_info': - $output = ''; - $output .= '

    ' . t('Displays events and listeners registered in the event dispatcher. For a complete overview of the event system, see the Symfony online documentation.', [':url' => 'http://symfony.com/doc/current/components/event_dispatcher.html']) . '

    '; - return $output; - - case 'devel.reinstall': - $output = '

    ' . t('Warning - will delete your module tables and configuration.') . '

    '; - $output .= '

    ' . t('Uninstall and then install the selected modules. hook_uninstall() and hook_install() will be executed and the schema version number will be set to the most recent update number.') . '

    '; - return $output; - - case 'devel/session': - return '

    ' . t('Here are the contents of your $_SESSION variable.') . '

    '; - - case 'devel.state_system_page': - return '

    ' . t('This is a list of state variables and their values. For more information read online documentation of State API in Drupal 8.', array(':documentation' => "https://www.drupal.org/developing/api/8/state")) . '

    '; - - case 'devel.layout_info': - $output = ''; - $output .= '

    ' . t('Displays layouts available to the site. For a complete overview of the layout system, see the Layout API documentation.', [':url' => 'https://www.drupal.org/docs/8/api/layout-api']) . '

    '; - return $output; - - } -} - -/** - * Implements hook_entity_type_alter(). - */ -function devel_entity_type_alter(array &$entity_types) { - return \Drupal::service('class_resolver') - ->getInstanceFromDefinition(EntityTypeInfo::class) - ->entityTypeAlter($entity_types); -} - -/** - * Implements hook_entity_operation(). - */ -function devel_entity_operation(EntityInterface $entity) { - return \Drupal::service('class_resolver') - ->getInstanceFromDefinition(EntityTypeInfo::class) - ->entityOperation($entity); -} - -/** - * Implements hook_toolbar(). - */ -function devel_toolbar() { - return \Drupal::service('class_resolver') - ->getInstanceFromDefinition(ToolbarHandler::class) - ->toolbar(); -} - -/** - * Implements hook_menu_links_discovered_alter(). - */ -function devel_menu_links_discovered_alter(&$links) { - // Conditionally add the Layouts info menu link. - if (\Drupal::moduleHandler()->moduleExists('layout_discovery')) { - $links['devel.layout_info'] = [ - 'title' => new TranslatableMarkup('Layouts Info'), - 'route_name' => 'devel.layout_info', - 'description' => new TranslatableMarkup('Overview of layouts available to the site.'), - 'menu_name' => 'devel', - ]; - } -} - -/** - * Implements hook_local_tasks_alter(). - */ -function devel_local_tasks_alter(&$local_tasks) { - if (\Drupal::moduleHandler()->moduleExists('toolbar')) { - $local_tasks['devel.toolbar.settings_form'] = [ - 'title' => 'Toolbar Settings', - 'base_route' => 'devel.admin_settings', - 'route_name' => 'devel.toolbar.settings_form', - 'class' => LocalTaskDefault::class, - 'options' => [], - ]; - } -} - -/** - * Sets message. - */ -function devel_set_message($msg, $type = NULL) { - if (function_exists('drush_log')) { - drush_log($msg, $type); - } - else { - drupal_set_message($msg, $type, TRUE); - } -} - -/** - * Gets error handlers. - */ -function devel_get_handlers() { - $error_handlers = \Drupal::config('devel.settings')->get('error_handlers'); - if (!empty($error_handlers)) { - unset($error_handlers[DEVEL_ERROR_HANDLER_NONE]); - } - return $error_handlers; -} - -/** - * Sets a new error handler or restores the prior one. - */ -function devel_set_handler($handlers) { - if (empty($handlers)) { - restore_error_handler(); - } - elseif (count($handlers) == 1 && isset($handlers[DEVEL_ERROR_HANDLER_STANDARD])) { - // Do nothing. - } - else { - set_error_handler('backtrace_error_handler'); - } -} - -/** - * Displays backtrace showing the route of calls to the current error. - * - * @param int $error_level - * The level of the error raised. - * @param string $message - * The error message. - * @param string $filename - * The filename that the error was raised in. - * @param int $line - * The line number the error was raised at. - * @param array $context - * An array that points to the active symbol table at the point the error - * occurred. - */ -function backtrace_error_handler($error_level, $message, $filename, $line, $context) { - // Hide stack trace and parameters from unqualified users. - if (!\Drupal::currentUser()->hasPermission('access devel information')) { - // Do what core does in bootstrap.inc and errors.inc. - // (We need to duplicate the core code here rather than calling it - // to avoid having the backtrace_error_handler() on top of the call stack.) - if ($error_level & error_reporting()) { - $types = drupal_error_levels(); - list($severity_msg, $severity_level) = $types[$error_level]; - $backtrace = debug_backtrace(); - $caller = Error::getLastCaller($backtrace); - - // We treat recoverable errors as fatal. - _drupal_log_error(array( - '%type' => isset($types[$error_level]) ? $severity_msg : 'Unknown error', - '@message' => $message, - '%function' => $caller['function'], - '%file' => $caller['file'], - '%line' => $caller['line'], - 'severity_level' => $severity_level, - 'backtrace' => $backtrace, - ), $error_level == E_RECOVERABLE_ERROR); - } - - return; - } - - // Don't respond to the error if it was suppressed with a '@' - if (error_reporting() == 0) { - return; - } - - // Don't respond to warning caused by ourselves. - if (preg_match('#Cannot modify header information - headers already sent by \\([^\\)]*[/\\\\]devel[/\\\\]#', $message)) { - return; - } - - if ($error_level & error_reporting()) { - // Only write each distinct NOTICE message once, as repeats do not give any - // further information and can choke the page output. - if ($error_level == E_NOTICE) { - static $written = array(); - if (!empty($written[$line][$filename][$message])) { - return; - } - $written[$line][$filename][$message] = TRUE; - } - - $types = drupal_error_levels(); - list($severity_msg, $severity_level) = $types[$error_level]; - - $backtrace = debug_backtrace(); - $caller = Error::getLastCaller($backtrace); - $variables = array( - '%type' => isset($types[$error_level]) ? $severity_msg : 'Unknown error', - '@message' => $message, - '%function' => $caller['function'], - '%file' => $caller['file'], - '%line' => $caller['line'], - ); - $msg = t('%type: @message in %function (line %line of %file).', $variables); - - // Show message if error_level is ERROR_REPORTING_DISPLAY_SOME or higher. - // (This is Drupal's error_level, which is different from $error_level, - // and we purposely ignore the difference between _SOME and _ALL, - // see #970688!) - if (\Drupal::config('system.logging')->get('error_level') != 'hide') { - $error_handlers = devel_get_handlers(); - if (!empty($error_handlers[DEVEL_ERROR_HANDLER_STANDARD])) { - drupal_set_message($msg, ($severity_level <= RfcLogLevel::NOTICE ? 'error' : 'warning'), TRUE); - } - if (!empty($error_handlers[DEVEL_ERROR_HANDLER_BACKTRACE_KINT])) { - print kpr(ddebug_backtrace(TRUE, 1), TRUE, $msg); - } - if (!empty($error_handlers[DEVEL_ERROR_HANDLER_BACKTRACE_DPM])) { - dpm(ddebug_backtrace(TRUE, 1), $msg, 'warning'); - } - } - - \Drupal::logger('php')->log($severity_level, $msg); - } -} - -/** - * Implements hook_page_attachments_alter(). - */ -function devel_page_attachments_alter(&$page) { - if (\Drupal::currentUser()->hasPermission('access devel information') && \Drupal::config('devel.settings')->get('page_alter')) { - dpm($page, 'page'); - } -} - -/** - * Wrapper for DevelDumperManager::dump(). - * - * Calls the http://www.firephp.org/ fb() function if it is found. - * - * @see \Drupal\devel\DevelDumperManager::dump() - */ -function dfb() { - $args = func_get_args(); - \Drupal::service('devel.dumper')->dump($args, NULL, 'firephp'); -} - -/** - * Wrapper for DevelDumperManager::dump(). - * - * Calls dfb() to output a backtrace. - * - * @see \Drupal\devel\DevelDumperManager::dump() - */ -function dfbt($label) { - \Drupal::service('devel.dumper')->dump(FirePHP::TRACE, $label, 'firephp'); -} - -/** - * Wrapper for DevelDumperManager::dump(). - * - * Wrapper for ChromePHP Class log method. - * - * @see \Drupal\devel\DevelDumperManager::dump() - */ -function dcp() { - $args = func_get_args(); - \Drupal::service('devel.dumper')->dump($args, NULL, 'chromephp'); -} - -if (!function_exists('dd')) { - /** - * Wrapper for DevelDumperManager::debug(). - * - * @deprecated since Drupal 8.6.0 because symfony now has dd() as a function. - * Use the ddm() function instead. - * - * @see \Drupal\devel\DevelDumperManager::debug() - */ - function dd($data, $label = NULL) { - return \Drupal::service('devel.dumper')->debug($data, $label, 'default'); - } -} - -if (!function_exists('ddm')) { - /** - * Wrapper for DevelDumperManager::debug() to replace previous dd function. - * - * @see \Drupal\devel\DevelDumperManager::debug() - */ - function ddm($data, $label = NULL) { - return \Drupal::service('devel.dumper')->debug($data, $label, 'default'); - } -} - -/** - * Wrapper for DevelDumperManager::message(). - * - * Prints a variable to the 'message' area of the page. - * - * Uses drupal_set_message(). - * - * @param $input - * An arbitrary value to output. - * @param string $name - * Optional name for identifying the output. - * @param string $type - * Optional message type for drupal_set_message(), defaults to 'status'. - * - * @return input - * The unaltered input value. - * - * @see \Drupal\devel\DevelDumperManager::message() - */ -function dpm($input, $name = NULL, $type = 'status') { - \Drupal::service('devel.dumper')->message($input, $name, $type); - return $input; -} - -/** - * Wrapper for DevelDumperManager::message(). - * - * Displays a Variable::export() variable to the 'message' area of the page. - * - * Uses drupal_set_message(). - * - * @param $input - * An arbitrary value to output. - * @param string $name - * Optional name for identifying the output. - * - * @return input - * The unaltered input value. - * - * @see \Drupal\devel\DevelDumperManager::message() - */ -function dvm($input, $name = NULL) { - \Drupal::service('devel.dumper')->message($input, $name, 'status', 'drupal_variable'); - return $input; -} - -/** - * An alias for dpm(), for historic reasons. - */ -function dsm($input, $name = NULL) { - return dpm($input, $name); -} - -/** - * Wrapper for DevelDumperManager::dumpOrExport(). - * - * An alias for the devel.dumper service. Saves carpal tunnel syndrome. - * - * @see \Drupal\devel\DevelDumperManager::dumpOrExport() - */ -function dpr($input, $export = FALSE, $name = NULL) { - return \Drupal::service('devel.dumper')->dumpOrExport($input, $name, $export, 'default'); -} - -/** - * Wrapper for DevelDumperManager::dumpOrExport(). - * - * An alias for devel_dump(). Saves carpal tunnel syndrome. - * - * @see \Drupal\devel\DevelDumperManager::dumpOrExport() - */ -function kpr($input, $export = FALSE, $name = NULL) { - return \Drupal::service('devel.dumper')->dumpOrExport($input, $name, $export); -} - -/** - * Wrapper for DevelDumperManager::dumpOrExport(). - * - * Like dpr(), but uses Variable::export() instead. - * - * @see \Drupal\devel\DevelDumperManager::dumpOrExport() - */ -function dvr($input, $export = FALSE, $name = NULL) { - return \Drupal::service('devel.dumper')->dumpOrExport($input, $name, $export, 'drupal_variable'); -} - -/** - * Prints the arguments passed into the current function. - */ -function dargs($always = TRUE) { - static $printed; - if ($always || !$printed) { - $bt = debug_backtrace(); - print kpr($bt[1]['args'], TRUE); - $printed = TRUE; - } -} - -/** - * Prints a SQL string from a DBTNG Select object. Includes quoted arguments. - * - * @param object $query - * An object that implements the SelectInterface interface. - * @param boolean $return - * Whether to return the string. Default is FALSE, meaning to print it - * and return $query instead. - * @param string $name - * Optional name for identifying the output. - * - * @return object|string - * The $query object, or the query string if $return was TRUE. - */ -function dpq($query, $return = FALSE, $name = NULL) { - if (\Drupal::currentUser()->hasPermission('access devel information')) { - if (method_exists($query, 'preExecute')) { - $query->preExecute(); - } - $sql = (string) $query; - $quoted = array(); - $connection = Database::getConnection(); - foreach ((array) $query->arguments() as $key => $val) { - $quoted[$key] = is_null($val) ? 'NULL' : $connection->quote($val); - } - $sql = strtr($sql, $quoted); - if ($return) { - return $sql; - } - dpm($sql, $name); - } - return ($return ? NULL : $query); -} - -/** - * Prints a renderable array element to the screen using kprint_r(). - * - * #pre_render and/or #post_render pass-through callback for kprint_r(). - * - * @todo Investigate appending to #suffix. - * @todo Investigate label derived from #id, #title, #name, and #theme. - */ -function devel_render() { - $args = func_get_args(); - // #pre_render and #post_render pass the rendered $element as last argument. - kpr(end($args)); - // #pre_render and #post_render expect the first argument to be returned. - return reset($args); -} - -/** - * Prints the function call stack. - * - * @param $return - * Pass TRUE to return the formatted backtrace rather than displaying it in - * the browser via kprint_r(). - * @param $pop - * How many items to pop from the top of the stack; useful when calling from - * an error handler. - * @param $options - * Options to pass on to PHP's debug_backtrace(). - * - * @return string|NULL - * The formatted backtrace, if requested, or NULL. - * - * @see http://php.net/manual/en/function.debug-backtrace.php - */ -function ddebug_backtrace($return = FALSE, $pop = 0, $options = DEBUG_BACKTRACE_PROVIDE_OBJECT) { - if (\Drupal::currentUser()->hasPermission('access devel information')) { - $backtrace = debug_backtrace($options); - while ($pop-- > 0) { - array_shift($backtrace); - } - $counter = count($backtrace); - $path = $backtrace[$counter - 1]['file']; - $path = substr($path, 0, strlen($path) - 10); - $paths[$path] = strlen($path) + 1; - $paths[DRUPAL_ROOT] = strlen(DRUPAL_ROOT) + 1; - $nbsp = "\xC2\xA0"; - - // Show message if error_level is ERROR_REPORTING_DISPLAY_SOME or higher. - // (This is Drupal's error_level, which is different from $error_level, - // and we purposely ignore the difference between _SOME and _ALL, - // see #970688!) - if (\Drupal::config('system.logging')->get('error_level') != 'hide') { - while (!empty($backtrace)) { - $call = array(); - if (isset($backtrace[0]['file'])) { - $call['file'] = $backtrace[0]['file']; - foreach ($paths as $path => $len) { - if (strpos($backtrace[0]['file'], $path) === 0) { - $call['file'] = substr($backtrace[0]['file'], $len); - } - } - $call['file'] .= ':' . $backtrace[0]['line']; - } - if (isset($backtrace[1])) { - if (isset($backtrace[1]['class'])) { - $function = $backtrace[1]['class'] . $backtrace[1]['type'] . $backtrace[1]['function'] . '()'; - } - else { - $function = $backtrace[1]['function'] . '()'; - } - $backtrace[1] += array('args' => array()); - foreach ($backtrace[1]['args'] as $key => $value) { - $call['args'][$key] = $value; - } - } - else { - $function = 'main()'; - $call['args'] = $_GET; - } - $nicetrace[($counter <= 10 ? $nbsp : '') . --$counter . ': ' . $function] = $call; - array_shift($backtrace); - } - if ($return) { - return $nicetrace; - } - kpr($nicetrace); - } - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Adds mouse-over hints on the Permissions page to display - * language-independent machine names and module base names. - * - * @see \Drupal\user\Form\UserPermissionsForm::buildForm() - */ -function devel_form_user_admin_permissions_alter(&$form, FormStateInterface $form_state) { - if (\Drupal::currentUser()->hasPermission('access devel information') && \Drupal::config('devel.settings')->get('raw_names')) { - foreach (Element::children($form['permissions']) as $key) { - if (isset($form['permissions'][$key][0])) { - $form['permissions'][$key][0]['#wrapper_attributes']['title'] = $key; - } - elseif(isset($form['permissions'][$key]['description'])) { - $form['permissions'][$key]['description']['#wrapper_attributes']['title'] = $key; - } - } - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Adds mouse-over hints on the Modules page to display module base names. - * - * @see \Drupal\system\Form\ModulesListForm::buildForm() - * @see theme_system_modules_details() - */ -function devel_form_system_modules_alter(&$form, FormStateInterface $form_state) { - if (\Drupal::currentUser()->hasPermission('access devel information') && \Drupal::config('devel.settings')->get('raw_names', FALSE) && isset($form['modules']) && is_array($form['modules'])) { - foreach (Element::children($form['modules']) as $group) { - if (is_array($form['modules'][$group])) { - foreach (Element::children($form['modules'][$group]) as $key) { - if (isset($form['modules'][$group][$key]['name']['#markup'])) { - $form['modules'][$group][$key]['name']['#markup'] = '' . $form['modules'][$group][$key]['name']['#markup'] . ''; - } - } - } - } - } -} - -/** - * Implements hook_query_TAG_alter(). - * - * Makes debugging entity query much easier. - * - * Example usage: - * @code - * $query = \Drupal::entityQuery('node'); - * $query->condition('status', NODE_PUBLISHED); - * $query->addTag('debug'); - * $query->execute(); - * @endcode - */ -function devel_query_debug_alter(AlterableInterface $query) { - if (!$query->hasTag('debug-semaphore')) { - $query->addTag('debug-semaphore'); - dpq($query); - } -} diff --git a/sites/all/modules/contrib/dev/devel/devel.permissions.yml b/sites/all/modules/contrib/dev/devel/devel.permissions.yml deleted file mode 100644 index e32ad8c11..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.permissions.yml +++ /dev/null @@ -1,9 +0,0 @@ -access devel information: - description: 'View developer output like variable printouts, query log, etc.' - title: 'Access developer information' - restrict access: TRUE - -switch users: - title: 'Switch users' - description: 'Become any user on the site with just a click.' - restrict access: TRUE diff --git a/sites/all/modules/contrib/dev/devel/devel.routing.yml b/sites/all/modules/contrib/dev/devel/devel.routing.yml deleted file mode 100644 index e6c6804d8..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.routing.yml +++ /dev/null @@ -1,268 +0,0 @@ -devel.admin_settings: - path: '/admin/config/development/devel' - defaults: - _form: '\Drupal\devel\Form\SettingsForm' - _title: 'Devel settings' - requirements: - _permission: 'administer site configuration' - -devel.toolbar.settings_form: - path: '/admin/config/development/devel/toolbar' - defaults: - _form: '\Drupal\devel\Form\ToolbarSettingsForm' - _title: 'Devel Toolbar Settings' - requirements: - _permission: 'administer site configuration' - _module_dependencies: 'toolbar' - -devel.reinstall: - path: '/devel/reinstall' - defaults: - _form: '\Drupal\devel\Form\DevelReinstall' - _title: 'Reinstall modules' - options: - _admin_route: TRUE - requirements: - _permission: 'administer site configuration' - -devel.menu_rebuild: - path: '/devel/menu/reset' - defaults: - _form: '\Drupal\devel\Form\RouterRebuildConfirmForm' - _title: 'Rebuild router' - options: - _admin_route: TRUE - requirements: - _permission: 'administer site configuration' - -devel.configs_list: - path: '/devel/config/{filter}' - options: - _admin_route: TRUE - defaults: - _form: '\Drupal\devel\Form\ConfigsList' - _title: 'Config editor' - filter: '' - requirements: - _permission: 'administer site configuration' - -devel.config_edit: - path: '/devel/config/edit/{config_name}' - defaults: - _form: '\Drupal\devel\Form\ConfigEditor' - _title: 'Edit configuration object: @config_name' - options: - _admin_route: TRUE - requirements: - _permission: 'administer site configuration' - -devel.state_system_page: - path: '/devel/state' - defaults: - _controller: '\Drupal\devel\Controller\DevelController::stateSystemPage' - _title: 'State editor' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.system_state_edit: - path: '/devel/state/edit/{state_name}' - defaults: - _form: '\Drupal\devel\Form\SystemStateEdit' - _title: 'Edit state variable: @state_name' - options: - _admin_route: TRUE - requirements: - _permission: 'administer site configuration' - -devel.theme_registry: - path: '/devel/theme/registry' - defaults: - _controller: '\Drupal\devel\Controller\DevelController::themeRegistry' - _title: 'Theme registry' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.field_info_page: - path: '/devel/field/info' - defaults: - _controller: '\Drupal\devel\Controller\DevelController::fieldInfoPage' - _title: 'Field info' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.session: - path: '/devel/session' - defaults: - _controller: '\Drupal\devel\Controller\DevelController::session' - _title: 'Session viewer' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.switch: - path: '/devel/switch/{name}' - defaults: - _controller: '\Drupal\devel\Controller\SwitchUserController::switchUser' - _title: 'Switch user' - name: '' - options: - _admin_route: TRUE - requirements: - _permission: 'switch users' - _csrf_token: 'TRUE' - -devel.cache_clear: - path: '/devel/cache/clear' - defaults: - _controller: '\Drupal\devel\Controller\DevelController::cacheClear' - _title: 'Clear cache' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - _csrf_token: 'TRUE' - -devel.run_cron: - path: '/devel/run-cron' - defaults: - _controller: '\Drupal\system\CronController::runManually' - _title: 'Run cron' - options: - _admin_route: TRUE - requirements: - _permission: 'administer site configuration' - _csrf_token: 'TRUE' - -# Container info -devel.container_info.service: - path: '/devel/container/service' - defaults: - _controller: '\Drupal\devel\Controller\ContainerInfoController::serviceList' - _title: 'Container services' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.container_info.service.detail: - path: '/devel/container/service/{service_id}' - defaults: - _controller: '\Drupal\devel\Controller\ContainerInfoController::serviceDetail' - _title: 'Service @service_id detail' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.container_info.parameter: - path: '/devel/container/parameter' - defaults: - _controller: '\Drupal\devel\Controller\ContainerInfoController::parameterList' - _title: 'Container parameters' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.container_info.parameter.detail: - path: '/devel/container/parameter/{parameter_name}' - defaults: - _controller: '\Drupal\devel\Controller\ContainerInfoController::parameterDetail' - _title: 'Parameter @parameter_name value' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -# Route info -devel.route_info: - path: '/devel/routes' - defaults: - _controller: '\Drupal\devel\Controller\RouteInfoController::routeList' - _title: 'Routes' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.route_info.item: - path: '/devel/routes/item' - defaults: - _controller: '\Drupal\devel\Controller\RouteInfoController::routeDetail' - _title: 'Route detail' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -# Event info -devel.event_info: - path: '/devel/events' - defaults: - _controller: '\Drupal\devel\Controller\EventInfoController::eventList' - _title: 'Events' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -# Layouts info -devel.layout_info: - path: '/devel/layouts' - defaults: - _controller: '\Drupal\devel\Controller\LayoutInfoController::layoutInfoPage' - _title: 'Layouts' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - _module_dependencies: 'layout_discovery' - -# Element info -devel.elements_page: - path: '/devel/elements' - defaults: - _controller: '\Drupal\devel\Controller\ElementInfoController::elementList' - _title: 'Element Info' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.elements_page.detail: - path: '/devel/elements/{element_name}' - defaults: - _controller: '\Drupal\devel\Controller\ElementInfoController::elementDetail' - _title: 'Element @element_name' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -# Entity type info -devel.entity_info_page: - path: '/devel/entity/info' - defaults: - _controller: '\Drupal\devel\Controller\EntityTypeInfoController::entityTypeList' - _title: 'Entity info' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' - -devel.entity_info_page.detail: - path: '/devel/entity/info/{entity_type_id}' - defaults: - _controller: '\Drupal\devel\Controller\EntityTypeInfoController::entityTypeDetail' - _title: 'Entity type @entity_type_id' - options: - _admin_route: TRUE - requirements: - _permission: 'access devel information' diff --git a/sites/all/modules/contrib/dev/devel/devel.services.yml b/sites/all/modules/contrib/dev/devel/devel.services.yml deleted file mode 100644 index 2e74e1ad8..000000000 --- a/sites/all/modules/contrib/dev/devel/devel.services.yml +++ /dev/null @@ -1,32 +0,0 @@ -services: - devel.error_subscriber: - class: Drupal\devel\EventSubscriber\ErrorHandlerSubscriber - arguments: ['@current_user'] - tags: - - { name: event_subscriber } - - devel.theme_rebuild_subscriber: - class: Drupal\devel\EventSubscriber\ThemeInfoRebuildSubscriber - arguments: ['@config.factory', '@current_user', '@theme_handler'] - tags: - - { name: event_subscriber } - - devel.route_subscriber: - class: Drupal\devel\Routing\RouteSubscriber - arguments: ['@entity_type.manager'] - tags: - - { name: event_subscriber } - - plugin.manager.devel_dumper: - class: Drupal\devel\DevelDumperPluginManager - parent: default_plugin_manager - - devel.dumper: - class: Drupal\devel\DevelDumperManager - arguments: ['@config.factory', '@current_user', '@plugin.manager.devel_dumper'] - - devel.twig.debug_extension: - class: Drupal\devel\Twig\Extension\Debug - arguments: ['@devel.dumper'] - tags: - - { name: twig.extension } diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/README.txt b/sites/all/modules/contrib/dev/devel/devel_generate/README.txt deleted file mode 100644 index 1f8338963..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/README.txt +++ /dev/null @@ -1,44 +0,0 @@ -This module creates the "DevelGenerate" plugin type. - -All you need to do to provide a new instance for "DevelGenerate" plugin type -is to create your class extending "DevelGenerateBase" and following the next steps. - -1 - Declaring your plugin with annotations: - -/** - * Provides a ExampleDevelGenerate plugin. - * - * @DevelGenerate( - * id = "example", - * label = @Translation("example"), - * description = @Translation("Generate a given number of example elements. Optionally delete current example elements."), - * url = "example", - * permission = "administer example", - * settings = { - * "num" = 50, - * "kill" = FALSE, - * "another_property" = "default_value" - * } - * ) - */ - -2 - Implement "settingsForm" method to create a form using the properties from annotations. - -3 - Implement "handleDrushParams" method. It should return an array of values. - -4 - Implement "generateElements" method. You can write here your business logic -using the array of values. - -Notes: - -You can alter existing properties for every plugin implementing hook_devel_generate_info_alter. - -DevelGenerateBaseInterface details base wrapping methods that most DevelGenerate implementations -will want to directly inherit from Drupal\devel_generate\DevelGenerateBase. - -To give support for a new field type the field type base class should properly -implements \Drupal\Core\Field\FieldItemInterface::generateSampleValue(). -Devel Generate automatically uses the values returned by this method during the -generate process for generate placeholder field values. For more information -see: -https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21FieldItemInterface.php/function/FieldItemInterface::generateSampleValue diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/composer.json b/sites/all/modules/contrib/dev/devel/devel_generate/composer.json deleted file mode 100644 index 624589aad..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "drupal/devel_generate", - "description": "Generate dummy users, nodes, menus, taxonomy terms...", - "type": "drupal-module", - "homepage": "http://drupal.org/project/devel", - "authors": [ - { - "name": "Moshe Weitzman", - "email": "weitzman@tejasa.com", - "homepage": "https://github.com/weitzman", - "role": "Maintainer" - }, - { - "name": "Hans Salvisberg", - "email": "drupal@salvisberg.com", - "homepage": "https://www.drupal.org/u/salvis", - "role": "Maintainer" - }, - { - "name": "Luca Lusso", - "homepage": "https://www.drupal.org/u/lussoluca", - "role": "Maintainer" - }, - { - "name": "Marco (willzyx)", - "homepage": "https://www.drupal.org/u/willzyx", - "role": "Maintainer" - }, - { - "name": "See contributors", - "homepage": "https://www.drupal.org/node/3236/committers" - } - ], - "support": { - "issues": "http://drupal.org/project/devel", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/devel" - }, - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": {}, - "suggest": { - "drupal/realistic_dummy_content": "Generate realistic demo content with Devel's devel_generate module." - }, - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.batch.inc b/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.batch.inc deleted file mode 100644 index 2bfa690b8..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.batch.inc +++ /dev/null @@ -1,25 +0,0 @@ -$method($vars, $context); -} - -/** - * Common finish batch function available for - * every DevelGeneratePlugin. - */ -function devel_generate_batch_finished($success, $results, $operations) { - - if ($success) { - $message = t('Finished @num elements created successfully.', array('@num' => $results['num'])); - } - else { - $message = t('Finished with an error.'); - } - drupal_set_message($message); -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.info.yml b/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.info.yml deleted file mode 100644 index f90b08c80..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: 'Devel Generate' -description: 'Generate dummy users, nodes, menus, taxonomy terms...' -package: Development -# core: 8.x -tags: - - developer - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.module b/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.module deleted file mode 100644 index 3affb925b..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.module +++ /dev/null @@ -1,145 +0,0 @@ -getDefinitions(); - foreach ($devel_generate_plugins as $id => $plugin) { - $label = $plugin['label']; - $links["devel_generate.$id"] = array( - 'title' => "Generate $label", - 'parent' => 'system.admin_config_development', - 'description' => $plugin['description'], - 'route_name' => "devel_generate.$id", - ); - } -} - -/** - * Implements hook_entity_insert(). - * - * Inserts nodes properly based on generation options. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The base node created on submit. Inspects $node->devel_generate. - */ -function devel_generate_entity_insert(EntityInterface $entity) { - if ($entity->getEntityTypeId() != 'node' || !isset($entity->devel_generate)) { - return; - } - /** @var \Drupal\node\NodeInterface $entity */ - $results = $entity->devel_generate; - - if (!empty($results['max_comments'])) { - foreach ($entity->getFieldDefinitions() as $field_name => $field_definition) { - if ($field_definition->getType() == 'comment' && $entity->get($field_name)->status == CommentItemInterface::OPEN) { - // Add comments for each comment field on entity. - devel_generate_add_comments($entity, $field_definition, $results['users'], $results['max_comments'], $results['title_length']); - } - } - } - - // Add an url alias. Cannot happen before save because we don't know the nid. - if (!empty($results['add_alias'])) { - $path = array( - 'source' => '/node/' . $entity->id(), - 'alias' => '/node-' . $entity->id() . '-' . $entity->bundle(), - ); - \Drupal::service('path.alias_storage')->save($path['source'], $path['alias'], $entity->language()->getId()); - } - - // Add node statistics. - if (!empty($results['add_statistics']) && \Drupal::moduleHandler()->moduleExists('statistics')) { - devel_generate_add_statistics($entity); - } -} - -/** - * Create comments and add them to a node. - * - * @param \Drupal\node\NodeInterface $node - * Node to add comments to. - * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition - * The field storage definition. - * @param array $users - * Array of users to assign comment authors. - * @param int $max_comments - * Max number of comments to generate per node. - * @param int $title_length - * Max length of the title of the comments. - */ -function devel_generate_add_comments(NodeInterface $node, FieldDefinitionInterface $field_definition, $users, $max_comments, $title_length = 8) { - $parents = array(); - $field_name = $field_definition->getName(); - $num_comments = mt_rand(1, $max_comments); - for ($i = 1; $i <= $num_comments; $i++) { - switch ($i % 3) { - case 0: - // No parent. - case 1: - // Top level parent. - $parents = \Drupal::entityQuery('comment') - ->condition('pid', 0) - ->condition('entity_id', $node->id()) - ->condition('entity_type', 'node') - ->condition('field_name', $field_name) - ->range(0, 1) - ->execute(); - break; - case 2: - // Non top level parent. - $parents = \Drupal::entityQuery('comment') - ->condition('pid', 0, '>') - ->condition('entity_id', $node->id()) - ->condition('entity_type', 'node') - ->condition('field_name', $field_name) - ->range(0, 1) - ->execute(); - break; - } - $random = new Random(); - $stub = array( - 'entity_type' => $node->getEntityTypeId(), - 'entity_id' => $node->id(), - 'field_name' => $field_name, - 'name' => 'devel generate', - 'mail' => 'devel_generate@example.com', - 'timestamp' => mt_rand($node->getCreatedTime(), REQUEST_TIME), - 'subject' => substr($random->sentences(mt_rand(2, $title_length), TRUE), 0, 63), - 'uid' => $users[array_rand($users)], - 'langcode' => $node->language()->getId(), - ); - if ($parents) { - $stub['pid'] = current($parents); - } - $comment = entity_create('comment', $stub); - - //Populate all core fields on behalf of field.module - DevelGenerateBase::populateFields($comment); - $comment->save(); - } -} - -/** - * Generate statistics information for a node. - * - * @param \Drupal\node\NodeInterface $node - * A node object. - */ -function devel_generate_add_statistics(NodeInterface $node) { - $statistic = array( - 'nid' => $node->id(), - 'totalcount' => mt_rand(0, 500), - 'timestamp' => REQUEST_TIME - mt_rand(0, $node->getCreatedTime()), - ); - $statistic['daycount'] = mt_rand(0, $statistic['totalcount']); - db_insert('node_counter')->fields($statistic)->execute(); -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.permissions.yml b/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.permissions.yml deleted file mode 100644 index 10f9479e5..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.permissions.yml +++ /dev/null @@ -1,5 +0,0 @@ -administer devel_generate: - title: 'Administer devel_generate' - -permission_callbacks: - - \Drupal\devel_generate\DevelGeneratePermissions::permissions diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.routing.yml b/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.routing.yml deleted file mode 100644 index eeea66824..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.routing.yml +++ /dev/null @@ -1,2 +0,0 @@ -route_callbacks: - - '\Drupal\devel_generate\Routing\DevelGenerateRoutes::routes' \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.services.yml b/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.services.yml deleted file mode 100644 index 16025e1da..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/devel_generate.services.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - plugin.manager.develgenerate: - class: Drupal\devel_generate\DevelGeneratePluginManager - parent: default_plugin_manager diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/drush.services.yml b/sites/all/modules/contrib/dev/devel/devel_generate/drush.services.yml deleted file mode 100644 index e008b6c17..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/drush.services.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - develgenerate.command: - class: Drupal\devel_generate\Commands\DevelGenerateCommands - arguments: ['@plugin.manager.develgenerate'] - tags: - - { name: drush.command } - diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/drush/devel_generate.drush8.inc b/sites/all/modules/contrib/dev/devel/devel_generate/drush/devel_generate.drush8.inc deleted file mode 100644 index e28226d83..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/drush/devel_generate.drush8.inc +++ /dev/null @@ -1,196 +0,0 @@ - 'drush_devel_generate', - 'callback arguments' => array( - 'plugin_id' => 'user', - ), - 'description' => 'Create users.', - 'arguments' => array( - 'num' => 'Number of users to generate.', - ), - 'options' => array( - 'kill' => 'Delete all users before generating new ones.', - 'roles' => 'A comma delimited list of role IDs which should be granted to the new users. No need to specify authenticated user role.', - 'pass' => 'Specify a password to be set for all generated users.', - ), - 'aliases' => array('genu'), - ); - $items['generate-terms'] = array( - 'callback' => 'drush_devel_generate', - 'callback arguments' => array( - 'plugin_id' => 'term', - ), - 'description' => 'Create terms in specified vocabulary.', - 'arguments' => array( - 'machine_name' => 'Vocabulary machine name into which new terms will be inserted.', - 'num' => 'Number of terms to insert. Defaults to 10.', - ), - 'options' => array( - 'kill' => 'Delete all terms in specified vocabulary before generating.', - 'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 1000', - 'pipe' => 'Returns the list of generated terms, one per line.', - ), - 'aliases' => array('gent'), - - ); - $items['generate-vocabs'] = array( - 'callback' => 'drush_devel_generate', - 'callback arguments' => array( - 'plugin_id' => 'vocabulary', - ), - 'description' => 'Create vocabularies.', - 'arguments' => array( - 'num' => 'Number of vocabularies to create. Defaults to 1.', - ), - 'options' => array( - 'kill' => 'Delete all vocabularies before generating.', - 'pipe' => 'Returns the list of generated vocabularies, one per line.', - ), - 'aliases' => array('genv'), - ); - $items['generate-content'] = array( - 'callback' => 'drush_devel_generate', - 'callback arguments' => array( - 'plugin_id' => 'content', - ), - 'description' => 'Create content.', - 'drupal dependencies' => array('devel_generate'), - 'arguments' => array( - 'num' => 'Number of nodes to generate.', - 'max_comments' => 'Maximum number of comments to generate.', - ), - 'options' => array( - 'kill' => 'Delete all content before generating new content.', - 'types' => 'A comma delimited list of content types to create. Defaults to page,article.', - 'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 1000', - 'skip-fields' => 'A comma delimited list of fields to omit when generating random values', - 'languages' => 'A comma-separated list of language codes', - ), - 'aliases' => array('genc'), - ); - $items['generate-menus'] = array( - 'callback' => 'drush_devel_generate', - 'callback arguments' => array( - 'plugin_id' => 'menu', - ), - 'description' => 'Create menus and menu items.', - 'drupal dependencies' => array('devel_generate'), // Remove these once devel.module is moved down a directory. http://drupal.org/node/925246 - 'arguments' => array( - 'number_menus' => 'Number of menus to generate. Defaults to 2.', - 'number_links' => 'Number of links to generate. Defaults to 50.', - 'max_depth' => 'Max link depth. Defaults to 3', - 'max_width' => 'Max width of first level of links. Defaults to 8.', - ), - 'options' => array( - 'kill' => 'Delete all previously generated menus and links before generating new menus and links.', - 'pipe' => 'Returns the list of generated menus, one per line.', - ), - 'aliases' => array('genm'), - ); - return $items; -} - -/** - * Implements drush_hook_COMMAND_validate(). - */ -function drush_devel_generate_generate_users_validate() { - - //Array of "Callback arguments" and "command line args". - $params = func_get_args(); - _drush_plugin_validate($params); -} - -/** - * Implements drush_hook_COMMAND_validate(). - */ -function drush_devel_generate_generate_terms_validate() { - - //Array of "Callback arguments" and "command line args". - $params = func_get_args(); - _drush_plugin_validate($params); -} - -/** - * Implements drush_hook_COMMAND_validate(). - */ -function drush_devel_generate_generate_vocabs_validate() { - - //Array of "Callback arguments" and "command line args". - $params = func_get_args(); - _drush_plugin_validate($params); -} - -/** - * Implements drush_hook_COMMAND_validate(). - */ -function drush_devel_generate_generate_content_validate() { - - //Array of "Callback arguments" and "command line args". - $params = func_get_args(); - _drush_plugin_validate($params); -} - -/** - * Implements drush_hook_COMMAND_validate(). - */ -function drush_devel_generate_generate_menus_validate() { - - //Array of "Callback arguments" and "command line args". - $params = func_get_args(); - _drush_plugin_validate($params); -} - -/** - * Helper function which returns an array with a plugin instance - * for a given id and the validated values ready to be used by - * the generate() function of the plugin. - */ -function _drush_plugin_validate($params) { - - $instance_and_values = &drupal_static('drush_devel_generate_generate_validate'); - //Getting plugin_id and leaving the command line args - $plugin_id = array_shift($params); - - if (!isset($instance_and_values[$plugin_id])) { - - /** @var DevelGeneratePluginManager $manager */ - $manager = \Drupal::service('plugin.manager.develgenerate'); - - /** @var DevelGenerateBaseInterface $instance */ - $instance = $manager->createInstance($plugin_id, array()); - - //Plugin instance suit params in order to fit for generateElements - $values = $instance->validateDrushParams($params); - $instance_and_values[$plugin_id]['instance'] = $instance; - $instance_and_values[$plugin_id]['values'] = $values; - } - - return $instance_and_values[$plugin_id]; -} - -/** - * Command callback. Generate a number of elements. - */ -function drush_devel_generate() { - $params = func_get_args(); - $plugin_id = array_shift($params); - $instance_and_values = drupal_static('drush_devel_generate_generate_validate'); - - /** @var DevelGenerateBaseInterface $instance */ - $instance = $instance_and_values[$plugin_id]['instance']; - $values = $instance_and_values[$plugin_id]['values']; - $instance->generate($values); - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Annotation/DevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Annotation/DevelGenerate.php deleted file mode 100644 index 9a0ce2525..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Annotation/DevelGenerate.php +++ /dev/null @@ -1,86 +0,0 @@ -setManager($manager); - } - - /** - * @return \Drupal\devel_generate\DevelGenerateBaseInterface - */ - public function getManager() { - return $this->manager; - } - - /** - * @param \Drupal\devel_generate\DevelGenerateBaseInterface $manager - */ - public function setManager($manager) { - $this->manager = $manager; - } - - /** - * @return mixed - */ - public function getPluginInstance() { - return $this->pluginInstance; - } - - /** - * @param mixed $pluginInstance - */ - public function setPluginInstance($pluginInstance) { - $this->pluginInstance = $pluginInstance; - } - - /** - * @return array - */ - public function getParameters() { - return $this->parameters; - } - - /** - * @param array $parameters - */ - public function setParameters($parameters) { - $this->parameters = $parameters; - } - - /** - * Create users. - * - * @command devel-generate-users - * @pluginId user - * @param $num Number of users to generate. - * @option kill Delete all users before generating new ones. - * @option roles A comma delimited list of role IDs for new users. Don't specify 'authenticated'. - * @option pass Specify a password to be set for all generated users. - * @aliases genu - */ - public function users($num = 50, $options = ['kill' => FALSE, 'roles' => '']) { - // @todo pass $options to the plugins. - $this->generate(); - } - - /** - * Create terms in specified vocabulary. - * - * @command devel-generate-terms - * @pluginId term - * @param $machine_name Vocabulary machine name into which new terms will be inserted. - * @param $num Number of terms to generate. - * @option kill Delete all terms before generating new ones. - * @option feedback An integer representing interval for insertion rate logging. - * @validate-entity-load taxonomy_vocabulary machine_name - * @aliases gent - */ - public function terms($machine_name, $num = 50, $options = ['feedback' => 1000]) { - $this->generate(); - } - - /** - * Create vocabularies. - * - * @command devel-generate-vocabs - * @pluginId vocabulary - * @param $num Number of vocabularies to generate. - * @option kill Delete all vocabs before generating new ones. - * @aliases genv - * @validate-module-enabled taxonomy - */ - public function vocabs($num = 1, $options = ['kill' => FALSE]) { - $this->generate(); - } - - /** - * Create menus. - * - * @command devel-generate-menus - * @pluginId menu - * @param $number_menus Number of menus to generate. - * @param $number_links Number of links to generate. - * @param $max_depth Max link depth. - * @param $max_width Max width of first level of links. - * @option kill Delete all content before generating new content. - * @aliases genm - * @validate-module-enabled menu_link_content - */ - public function menus($number_menus = 2, $number_links = 50, $max_depth = 3, $max_width = 8, $options = ['kill' => FALSE]) { - $this->generate(); - } - - /** - * Create content. - * - * @command devel-generate-content - * @pluginId content - * @param $num Number of nodes to generate. - * @param $max_comments Maximum number of comments to generate. - * @option kill Delete all content before generating new content. - * @option types A comma delimited list of content types to create. Defaults to page,article. - * @option feedback An integer representing interval for insertion rate logging. - * @option skip-fields A comma delimited list of fields to omit when generating random values - * @option languages A comma-separated list of language codes - * @aliases genc - * @validate-module-enabled node - */ - public function content($num = 50, $max_comments = 0, $options = ['kill' => FALSE, 'types' => 'page,article', 'feedback' => 1000]) { - $this->generate(); - drush_backend_batch_process(); - } - - - /** - * @hook validate - * @param \Consolidation\AnnotatedCommand\CommandData $commandData - * @return \Consolidation\AnnotatedCommand\CommandError|null - */ - public function validate(CommandData $commandData) { - $manager = $this->getManager(); - $args = $commandData->input()->getArguments(); - $commandName = array_shift($args); - /** @var DevelGenerateBaseInterface $instance */ - $instance = $manager->createInstance($commandData->annotationData()->get('pluginId'), array()); - $this->setPluginInstance($instance); - $parameters = $instance->validateDrushParams($args, $commandData->input()->getOptions()); - $this->setParameters($parameters); - } - - public function generate() { - $instance = $this->getPluginInstance(); - $instance->generate($this->getParameters()); - } -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBase.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBase.php deleted file mode 100644 index 1d38a3520..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBase.php +++ /dev/null @@ -1,172 +0,0 @@ -settings)) { - $this->settings = $this->getDefaultSettings(); - } - return isset($this->settings[$key]) ? $this->settings[$key] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getDefaultSettings() { - $definition = $this->getPluginDefinition(); - return $definition['settings']; - } - - /** - * {@inheritdoc} - */ - public function getSettings() { - return $this->settings; - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - return array(); - } - - /** - * {@inheritdoc} - */ - function settingsFormValidate(array $form, FormStateInterface $form_state) { - // Validation is optional. - } - - /** - * {@inheritdoc} - */ - public function generate(array $values) { - $this->generateElements($values); - $this->setMessage('Generate process complete.'); - } - - /** - * Business logic relating with each DevelGenerate plugin - * - * @param array $values - * The input values from the settings form. - */ - protected function generateElements(array $values) { - - } - - /** - * Populate the fields on a given entity with sample values. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity to be enriched with sample field values. - */ - public static function populateFields(EntityInterface $entity) { - /** @var \Drupal\field\FieldConfigInterface[] $instances */ - $instances = entity_load_multiple_by_properties('field_config', array('entity_type' => $entity->getEntityType()->id(), 'bundle' => $entity->bundle())); - - if ($skips = function_exists('drush_get_option') ? drush_get_option('skip-fields', '') : @$_REQUEST['skip-fields']) { - foreach (explode(',', $skips) as $skip) { - unset($instances[$skip]); - } - } - - foreach ($instances as $instance) { - $field_storage = $instance->getFieldStorageDefinition(); - $max = $cardinality = $field_storage->getCardinality(); - if ($cardinality == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) { - // Just an arbitrary number for 'unlimited' - $max = rand(1, 3); - } - $field_name = $field_storage->getName(); - $entity->$field_name->generateSampleItems($max); - } - } - - /** - * {@inheritdoc} - */ - public function handleDrushParams($args) { - - } - - /** - * Set a message for either drush or the web interface. - * - * @param string $msg - * The message to display. - * @param string $type - * (optional) The message type, as defined by drupal_set_message(). Defaults - * to 'status' - */ - protected function setMessage($msg, $type = 'status') { - $function = 'drupal_set_message'; - if (function_exists('drush_log')) { - $function = 'drush_log'; - $msg = strip_tags($msg); - } - $function($msg, $type); - } - - /** - * Check if a given param is a number. - * - * @param mixed $number - * The parameter to check. - * - * @return bool - * TRUE if the parameter is a number, FALSE otherwise. - */ - public static function isNumber($number) { - if ($number == NULL) return FALSE; - if (!is_numeric($number)) return FALSE; - return TRUE; - } - - /** - * Returns the random data generator. - * - * @return \Drupal\Component\Utility\Random - * The random data generator. - */ - protected function getRandom() { - if (!$this->random) { - $this->random = new Random(); - } - return $this->random; - } - - protected function isDrush8() { - return function_exists('drush_drupal_load_autoloader'); - } -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBaseInterface.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBaseInterface.php deleted file mode 100644 index c2b814a2b..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGenerateBaseInterface.php +++ /dev/null @@ -1,77 +0,0 @@ -develGeneratePluginManager = $develGeneratePluginManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('plugin.manager.develgenerate')); - } - - /* - * A permissions callback. - * - * @see devel_generate.permissions.yml. - * - * @return array - */ - function permissions() { - $devel_generate_plugins = $this->develGeneratePluginManager->getDefinitions(); - foreach ($devel_generate_plugins as $plugin) { - - $permission = $plugin['permission']; - $permissions[$permission] = array( - 'title' => t($permission), - ); - } - -// $permissions = array( -// 'administer devel_generate' => array( -// 'title' => t('Administer devel generate'), -// ), -// ); - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGeneratePluginManager.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGeneratePluginManager.php deleted file mode 100644 index 626e6dce9..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/DevelGeneratePluginManager.php +++ /dev/null @@ -1,31 +0,0 @@ -alterInfo('devel_generate_info'); - $this->setCacheBackend($cache_backend, 'devel_generate_plugins'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Form/DevelGenerateForm.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Form/DevelGenerateForm.php deleted file mode 100644 index 72366b887..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Form/DevelGenerateForm.php +++ /dev/null @@ -1,114 +0,0 @@ -develGenerateManager = $devel_generate_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.develgenerate') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_generate_form_' . $this->getPluginIdFromRequest(); - } - - /** - * Returns the value of the param _plugin_id for the current request. - * - * @see \Drupal\devel_generate\Routing\DevelGenerateRouteSubscriber - */ - protected function getPluginIdFromRequest() { - $request = $this->getRequest(); - return $request->get('_plugin_id'); - } - - /** - * Returns a DevelGenerate plugin instance for a given plugin id. - * - * @param string $plugin_id - * The plugin_id for the plugin instance. - * - * @return \Drupal\devel_generate\DevelGenerateBaseInterface - * A DevelGenerate plugin instance. - */ - public function getPluginInstance($plugin_id) { - $instance = $this->develGenerateManager->createInstance($plugin_id, array()); - return $instance; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $plugin_id = $this->getPluginIdFromRequest(); - $instance = $this->getPluginInstance($plugin_id); - $form = $instance->settingsForm($form, $form_state); - $form['actions'] = ['#type' => 'actions']; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Generate'), - '#button_type' => 'primary', - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $plugin_id = $this->getPluginIdFromRequest(); - $instance = $this->getPluginInstance($plugin_id); - $instance->settingsFormValidate($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - try { - $plugin_id = $this->getPluginIdFromRequest(); - $instance = $this->getPluginInstance($plugin_id); - $instance->generate($form_state->getValues()); - } - catch (DevelGenerateException $e) { - $this->logger('DevelGenerate', $this->t('Failed to generate elements due to "%error".', array('%error' => $e->getMessage()))); - drupal_set_message($this->t('Failed to generate elements due to "%error".', array('%error' => $e->getMessage()))); - } - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php deleted file mode 100644 index 34e3e71a6..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php +++ /dev/null @@ -1,506 +0,0 @@ -moduleHandler = $module_handler; - $this->nodeStorage = $node_storage; - $this->nodeTypeStorage = $node_type_storage; - $this->commentManager = $comment_manager; - $this->languageManager = $language_manager; - $this->urlGenerator = $url_generator; - $this->dateFormatter = $date_formatter; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $entity_manager = $container->get('entity.manager'); - return new static( - $configuration, $plugin_id, $plugin_definition, - $entity_manager->getStorage('node'), - $entity_manager->getStorage('node_type'), - $container->get('module_handler'), - $container->has('comment.manager') ? $container->get('comment.manager') : NULL, - $container->get('language_manager'), - $container->get('url_generator'), - $container->get('date.formatter') - ); - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - $types = $this->nodeTypeStorage->loadMultiple(); - - if (empty($types)) { - $create_url = $this->urlGenerator->generateFromRoute('node.type_add'); - $this->setMessage($this->t('You do not have any content types that can be generated. Go create a new content type', array(':create-type' => $create_url)), 'error', FALSE); - return; - } - - $options = array(); - - foreach ($types as $type) { - $options[$type->id()] = array( - 'type' => array('#markup' => $type->label()), - ); - if ($this->commentManager) { - $comment_fields = $this->commentManager->getFields('node'); - $map = array($this->t('Hidden'), $this->t('Closed'), $this->t('Open')); - - $fields = array(); - foreach ($comment_fields as $field_name => $info) { - // Find all comment fields for the bundle. - if (in_array($type->id(), $info['bundles'])) { - $instance = FieldConfig::loadByName('node', $type->id(), $field_name); - $default_value = $instance->getDefaultValueLiteral(); - $default_mode = reset($default_value); - $fields[] = new FormattableMarkup('@field: @state', array( - '@field' => $instance->label(), - '@state' => $map[$default_mode['status']], - )); - } - } - // @todo Refactor display of comment fields. - if (!empty($fields)) { - $options[$type->id()]['comments'] = array( - 'data' => array( - '#theme' => 'item_list', - '#items' => $fields, - ), - ); - } - else { - $options[$type->id()]['comments'] = $this->t('No comment fields'); - } - } - } - - $header = array( - 'type' => $this->t('Content type'), - ); - if ($this->commentManager) { - $header['comments'] = array( - 'data' => $this->t('Comments'), - 'class' => array(RESPONSIVE_PRIORITY_MEDIUM), - ); - } - - $form['node_types'] = array( - '#type' => 'tableselect', - '#header' => $header, - '#options' => $options, - ); - - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Delete all content in these content types before generating new content.'), - '#default_value' => $this->getSetting('kill'), - ); - $form['num'] = array( - '#type' => 'number', - '#title' => $this->t('How many nodes would you like to generate?'), - '#default_value' => $this->getSetting('num'), - '#required' => TRUE, - '#min' => 0, - ); - - $options = array(1 => $this->t('Now')); - foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) { - $options[$interval] = $this->dateFormatter->formatInterval($interval, 1) . ' ' . $this->t('ago'); - } - $form['time_range'] = array( - '#type' => 'select', - '#title' => $this->t('How far back in time should the nodes be dated?'), - '#description' => $this->t('Node creation dates will be distributed randomly from the current time, back to the selected time.'), - '#options' => $options, - '#default_value' => 604800, - ); - - $form['max_comments'] = array( - '#type' => $this->moduleHandler->moduleExists('comment') ? 'number' : 'value', - '#title' => $this->t('Maximum number of comments per node.'), - '#description' => $this->t('You must also enable comments for the content types you are generating. Note that some nodes will randomly receive zero comments. Some will receive the max.'), - '#default_value' => $this->getSetting('max_comments'), - '#min' => 0, - '#access' => $this->moduleHandler->moduleExists('comment'), - ); - $form['title_length'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum number of words in titles'), - '#default_value' => $this->getSetting('title_length'), - '#required' => TRUE, - '#min' => 1, - '#max' => 255, - ); - $form['add_alias'] = array( - '#type' => 'checkbox', - '#disabled' => !$this->moduleHandler->moduleExists('path'), - '#description' => $this->t('Requires path.module'), - '#title' => $this->t('Add an url alias for each node.'), - '#default_value' => FALSE, - ); - $form['add_statistics'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Add statistics for each node (node_counter table).'), - '#default_value' => TRUE, - '#access' => $this->moduleHandler->moduleExists('statistics'), - ); - - $options = array(); - // We always need a language. - $languages = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL); - foreach ($languages as $langcode => $language) { - $options[$langcode] = $language->getName(); - } - - $form['add_language'] = array( - '#type' => 'select', - '#title' => $this->t('Set language on nodes'), - '#multiple' => TRUE, - '#description' => $this->t('Requires locale.module'), - '#options' => $options, - '#default_value' => array( - $this->languageManager->getDefaultLanguage()->getId(), - ), - ); - - $form['#redirect'] = FALSE; - - return $form; - } - - /** - * {@inheritdoc} - */ - function settingsFormValidate(array $form, FormStateInterface $form_state) { - if (!array_filter($form_state->getValue('node_types'))) { - $form_state->setErrorByName('node_types', $this->t('Please select at least one content type')); - } - } - - /** - * {@inheritdoc} - */ - protected function generateElements(array $values) { - if ($values['num'] <= 50 && $values['max_comments'] <= 10) { - $this->generateContent($values); - } - else { - $this->generateBatchContent($values); - } - } - - /** - * Method responsible for creating content when - * the number of elements is less than 50. - */ - private function generateContent($values) { - $values['node_types'] = array_filter($values['node_types']); - if (!empty($values['kill']) && $values['node_types']) { - $this->contentKill($values); - } - - if (!empty($values['node_types'])) { - // Generate nodes. - $this->develGenerateContentPreNode($values); - $start = time(); - for ($i = 1; $i <= $values['num']; $i++) { - $this->develGenerateContentAddNode($values); - if ($this->isDrush8() && function_exists('drush_log') && $i % drush_get_option('feedback', 1000) == 0) { - $now = time(); - drush_log(dt('Completed @feedback nodes (@rate nodes/min)', array('@feedback' => drush_get_option('feedback', 1000), '@rate' => (drush_get_option('feedback', 1000) * 60) / ($now - $start))), 'ok'); - $start = $now; - } - } - } - $this->setMessage($this->formatPlural($values['num'], '1 node created.', 'Finished creating @count nodes')); - } - - /** - * Method responsible for creating content when - * the number of elements is greater than 50. - */ - private function generateBatchContent($values) { - // Setup the batch operations and save the variables. - $operations[] = array('devel_generate_operation', array($this, 'batchContentPreNode', $values)); - - // Add the kill operation. - if ($values['kill']) { - $operations[] = array('devel_generate_operation', array($this, 'batchContentKill', $values)); - } - - // Add the operations to create the nodes. - for ($num = 0; $num < $values['num']; $num ++) { - $operations[] = array('devel_generate_operation', array($this, 'batchContentAddNode', $values)); - } - - // Set the batch. - $batch = array( - 'title' => $this->t('Generating Content'), - 'operations' => $operations, - 'finished' => 'devel_generate_batch_finished', - 'file' => drupal_get_path('module', 'devel_generate') . '/devel_generate.batch.inc', - ); - batch_set($batch); - } - - public function batchContentPreNode($vars, &$context) { - $context['results'] = $vars; - $context['results']['num'] = 0; - $this->develGenerateContentPreNode($context['results']); - } - - public function batchContentAddNode($vars, &$context) { - $this->develGenerateContentAddNode($context['results']); - $context['results']['num']++; - } - - public function batchContentKill($vars, &$context) { - $this->contentKill($context['results']); - } - - /** - * {@inheritdoc} - */ - public function validateDrushParams($args, $options = []) { - $add_language = $this->isDrush8() ? drush_get_option('languages') : $options['languages']; - if (!empty($add_language)) { - $add_language = explode(',', str_replace(' ', '', $add_language)); - // Intersect with the enabled languages to make sure the language args - // passed are actually enabled. - $values['values']['add_language'] = array_intersect($add_language, array_keys($this->languageManager->getLanguages(LanguageInterface::STATE_ALL))); - } - - $values['kill'] = $this->isDrush8() ? drush_get_option('kill') : $options['kill']; - $values['title_length'] = 6; - $values['num'] = array_shift($args); - $values['max_comments'] = array_shift($args); - $all_types = array_keys(node_type_get_names()); - $default_types = array_intersect(array('page', 'article'), $all_types); - if ($this->isDrush8()) { - $selected_types = _convert_csv_to_array(drush_get_option('types', $default_types)); - } - else { - $selected_types = StringUtils::csvToArray($options['types'] ?: $default_types); - } - - if (empty($selected_types)) { - throw new \Exception(dt('No content types available')); - } - - $values['node_types'] = array_combine($selected_types, $selected_types); - $node_types = array_filter($values['node_types']); - - if (!empty($values['kill']) && empty($node_types)) { - throw new \Exception(dt('Please provide content type (--types) in which you want to delete the content.')); - } - - // Checks for any missing content types before generating nodes. - if (array_diff($node_types, $all_types)) { - throw new \Exception(dt('One or more content types have been entered that don\'t exist on this site')); - } - - return $values; - } - - /** - * Deletes all nodes of given node types. - * - * @param array $values - * The input values from the settings form. - */ - protected function contentKill($values) { - $nids = $this->nodeStorage->getQuery() - ->condition('type', $values['node_types'], 'IN') - ->execute(); - - if (!empty($nids)) { - $nodes = $this->nodeStorage->loadMultiple($nids); - $this->nodeStorage->delete($nodes); - $this->setMessage($this->t('Deleted %count nodes.', array('%count' => count($nids)))); - } - } - - /** - * Return the same array passed as parameter - * but with an array of uids for the key 'users'. - */ - protected function develGenerateContentPreNode(&$results) { - // Get user id. - $users = $this->getUsers(); - $results['users'] = $users; - } - - /** - * Create one node. Used by both batch and non-batch code branches. - */ - protected function develGenerateContentAddNode(&$results) { - if (!isset($results['time_range'])) { - $results['time_range'] = 0; - } - $users = $results['users']; - - $node_type = array_rand(array_filter($results['node_types'])); - $uid = $users[array_rand($users)]; - - $node = $this->nodeStorage->create(array( - 'nid' => NULL, - 'type' => $node_type, - 'title' => $this->getRandom()->sentences(mt_rand(1, $results['title_length']), TRUE), - 'uid' => $uid, - 'revision' => mt_rand(0, 1), - 'status' => TRUE, - 'promote' => mt_rand(0, 1), - 'created' => REQUEST_TIME - mt_rand(0, $results['time_range']), - 'langcode' => $this->getLangcode($results), - )); - - // A flag to let hook_node_insert() implementations know that this is a - // generated node. - $node->devel_generate = $results; - - // Populate all fields with sample values. - $this->populateFields($node); - - // See devel_generate_node_insert() for actions that happen before and after - // this save. - $node->save(); - } - - /** - * Determine language based on $results. - */ - protected function getLangcode($results) { - if (isset($results['add_language'])) { - $langcodes = $results['add_language']; - $langcode = $langcodes[array_rand($langcodes)]; - } - else { - $langcode = $this->languageManager->getDefaultLanguage()->getId(); - } - return $langcode; - } - - /** - * Retrieve 50 uids from the database. - */ - protected function getUsers() { - $users = array(); - $result = db_query_range("SELECT uid FROM {users}", 0, 50); - foreach ($result as $record) { - $users[] = $record->uid; - } - return $users; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/MenuDevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/MenuDevelGenerate.php deleted file mode 100644 index 6ccacc295..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/MenuDevelGenerate.php +++ /dev/null @@ -1,405 +0,0 @@ -menuLinkTree = $menu_tree; - $this->menuStorage = $menu_storage; - $this->menuLinkContentStorage = $menu_link_storage; - $this->moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $entity_manager = $container->get('entity.manager'); - return new static( - $configuration, $plugin_id, $plugin_definition, - $container->get('menu.link_tree'), - $entity_manager->getStorage('menu'), - $entity_manager->getStorage('menu_link_content'), - $container->get('module_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - $menu_enabled = $this->moduleHandler->moduleExists('menu_ui'); - if ($menu_enabled) { - $menus = array('__new-menu__' => $this->t('Create new menu(s)')) + menu_ui_get_menus(); - } - else { - $menus = menu_list_system_menus(); - } - $form['existing_menus'] = array( - '#type' => 'checkboxes', - '#title' => $this->t('Generate links for these menus'), - '#options' => $menus, - '#default_value' => array('__new-menu__'), - '#required' => TRUE, - ); - if ($menu_enabled) { - $form['num_menus'] = array( - '#type' => 'number', - '#title' => $this->t('Number of new menus to create'), - '#default_value' => $this->getSetting('num_menus'), - '#min' => 0, - '#states' => array( - 'visible' => array( - ':input[name="existing_menus[__new-menu__]"]' => array('checked' => TRUE), - ), - ), - ); - } - $form['num_links'] = array( - '#type' => 'number', - '#title' => $this->t('Number of links to generate'), - '#default_value' => $this->getSetting('num_links'), - '#required' => TRUE, - '#min' => 0, - ); - $form['title_length'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum number of characters in menu and menu link names'), - '#description' => $this->t('The minimum length is 2.'), - '#default_value' => $this->getSetting('title_length'), - '#required' => TRUE, - '#min' => 2, - '#max' => 128, - ); - $form['link_types'] = array( - '#type' => 'checkboxes', - '#title' => $this->t('Types of links to generate'), - '#options' => array( - 'node' => $this->t('Nodes'), - 'front' => $this->t('Front page'), - 'external' => $this->t('External'), - ), - '#default_value' => array('node', 'front', 'external'), - '#required' => TRUE, - ); - $form['max_depth'] = array( - '#type' => 'select', - '#title' => $this->t('Maximum link depth'), - '#options' => range(0, $this->menuLinkTree->maxDepth()), - '#default_value' => floor($this->menuLinkTree->maxDepth() / 2), - '#required' => TRUE, - ); - unset($form['max_depth']['#options'][0]); - $form['max_width'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum menu width'), - '#default_value' => $this->getSetting('max_width'), - '#description' => $this->t('Limit the width of the generated menu\'s first level of links to a certain number of items.'), - '#required' => TRUE, - '#min' => 0, - ); - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Delete existing custom generated menus and menu links before generating new ones.'), - '#default_value' => $this->getSetting('kill'), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function generateElements(array $values) { - // If the create new menus checkbox is off, set the number of new menus to 0. - if (!isset($values['existing_menus']['__new-menu__']) || !$values['existing_menus']['__new-menu__']) { - $values['num_menus'] = 0; - } - else { - // Unset the aux menu to avoid attach menu new items. - unset($values['existing_menus']['__new-menu__']); - } - - // Delete custom menus. - if ($values['kill']) { - $this->deleteMenus(); - $this->setMessage($this->t('Deleted existing menus and links.')); - } - - // Generate new menus. - $new_menus = $this->generateMenus($values['num_menus'], $values['title_length']); - if (!empty($new_menus)) { - $this->setMessage($this->t('Created the following new menus: @menus', array('@menus' => implode(', ', $new_menus)))); - } - - // Generate new menu links. - $menus = $new_menus; - if (isset($values['existing_menus'])) { - $menus = $menus + $values['existing_menus']; - } - $new_links = $this->generateLinks($values['num_links'], $menus, $values['title_length'], $values['link_types'], $values['max_depth'], $values['max_width']); - $this->setMessage($this->t('Created @count new menu links.', array('@count' => count($new_links)))); - } - - /** - * {@inheritdoc} - */ - public function validateDrushParams($args, $options = []) { - - $link_types = array('node', 'front', 'external'); - $values = array( - 'num_menus' => array_shift($args), - 'num_links' => array_shift($args), - 'kill' => $this->isDrush8() ? drush_get_option('kill') : $options['kill'], - 'pipe' => $this->isDrush8() ? drush_get_option('pipe') : $options['pipe'], - 'link_types' => array_combine($link_types, $link_types), - ); - - $max_depth = array_shift($args); - $max_width = array_shift($args); - $values['max_depth'] = $max_depth ? $max_depth : 3; - $values['max_width'] = $max_width ? $max_width : 8; - $values['title_length'] = $this->getSetting('title_length'); - $values['existing_menus']['__new-menu__'] = TRUE; - - if ($this->isNumber($values['num_menus']) == FALSE) { - throw new \Exception(dt('Invalid number of menus')); - } - if ($this->isNumber($values['num_links']) == FALSE) { - throw new \Exception(dt('Invalid number of links')); - } - if ($this->isNumber($values['max_depth']) == FALSE || $values['max_depth'] > 9 || $values['max_depth'] < 1) { - throw new \Exception(dt('Invalid maximum link depth. Use a value between 1 and 9')); - } - if ($this->isNumber($values['max_width']) == FALSE || $values['max_width'] < 1) { - throw new \Exception(dt('Invalid maximum menu width. Use a positive numeric value.')); - } - - return $values; - } - - /** - * Deletes custom generated menus. - */ - protected function deleteMenus() { - if ($this->moduleHandler->moduleExists('menu_ui')) { - $menu_ids = array(); - foreach (menu_ui_get_menus(FALSE) as $menu => $menu_title) { - if (strpos($menu, 'devel-') === 0) { - $menu_ids[] = $menu; - } - } - - if ($menu_ids) { - $menus = $this->menuStorage->loadMultiple($menu_ids); - $this->menuStorage->delete($menus); - } - } - - // Delete menu links generated by devel. - $link_ids = $this->menuLinkContentStorage->getQuery() - ->condition('menu_name', 'devel', '<>') - ->condition('link__options', '%' . db_like('s:5:"devel";b:1') . '%', 'LIKE') - ->execute(); - - if ($link_ids) { - $links = $this->menuLinkContentStorage->loadMultiple($link_ids); - $this->menuLinkContentStorage->delete($links); - } - - } - - /** - * Generates new menus. - * - * @param int $num_menus - * Number of menus to create. - * @param int $title_length - * (optional) Maximum length per menu name. - * - * @return array - * Array containing the generated vocabularies id. - */ - protected function generateMenus($num_menus, $title_length = 12) { - $menus = array(); - - for ($i = 1; $i <= $num_menus; $i++) { - $name = $this->getRandom()->word(mt_rand(2, max(2, $title_length))); - - $menu = $this->menuStorage->create(array( - 'label' => $name, - 'id' => 'devel-' . Unicode::strtolower($name), - 'description' => $this->t('Description of @name', array('@name' => $name)), - )); - - $menu->save(); - $menus[$menu->id()] = $menu->label(); - } - - return $menus; - } - - /** - * Generates menu links in a tree structure. - */ - protected function generateLinks($num_links, $menus, $title_length, $link_types, $max_depth, $max_width) { - $links = array(); - $menus = array_keys(array_filter($menus)); - $link_types = array_keys(array_filter($link_types)); - - $nids = array(); - for ($i = 1; $i <= $num_links; $i++) { - // Pick a random menu. - $menu_name = $menus[array_rand($menus)]; - // Build up our link. - $link_title = $this->getRandom()->word(mt_rand(2, max(2, $title_length))); - $link = $this->menuLinkContentStorage->create(array( - 'menu_name' => $menu_name, - 'weight' => mt_rand(-50, 50), - 'title' => $link_title, - 'bundle' => 'menu_link_content', - 'description' => $this->t('Description of @title.', array('@title' => $link_title)), - )); - $link->link->options = array('devel' => TRUE); - - // For the first $max_width items, make first level links. - if ($i <= $max_width) { - $depth = 0; - } - else { - // Otherwise, get a random parent menu depth. - $depth = mt_rand(1, max(1, $max_depth - 1)); - } - // Get a random parent link from the proper depth. - do { - $parameters = new MenuTreeParameters(); - $parameters->setMinDepth($depth); - $parameters->setMaxDepth($depth); - $tree = $this->menuLinkTree->load($menu_name, $parameters); - - if ($tree) { - $link->parent = array_rand($tree); - } - $depth--; - } while (!$link->parent && $depth > 0); - - $link_type = array_rand($link_types); - switch ($link_types[$link_type]) { - case 'node': - // Grab a random node ID. - $select = db_select('node_field_data', 'n') - ->fields('n', array('nid', 'title')) - ->condition('n.status', 1) - ->range(0, 1) - ->orderRandom(); - // Don't put a node into the menu twice. - if (!empty($nids[$menu_name])) { - $select->condition('n.nid', $nids[$menu_name], 'NOT IN'); - } - $node = $select->execute()->fetchAssoc(); - if (isset($node['nid'])) { - $nids[$menu_name][] = $node['nid']; - $link->link->uri = 'entity:node/' . $node['nid']; - $link->title = $node['title']; - break; - } - - case 'external': - $link->link->uri = 'http://www.example.com/'; - break; - - case 'front': - $link->link->uri = 'internal:/'; - break; - - default: - $link->devel_link_type = $link_type; - break; - } - - $link->save(); - - $links[$link->id()] = $link->link_title; - } - - return $links; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php deleted file mode 100644 index 61e6dd411..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php +++ /dev/null @@ -1,258 +0,0 @@ -vocabularyStorage = $vocabulary_storage; - $this->termStorage = $term_storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $entity_manager = $container->get('entity.manager'); - return new static( - $configuration, $plugin_id, $plugin_definition, - $entity_manager->getStorage('taxonomy_vocabulary'), - $entity_manager->getStorage('taxonomy_term') - ); - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - $options = array(); - foreach ($this->vocabularyStorage->loadMultiple() as $vocabulary) { - $options[$vocabulary->id()] = $vocabulary->label(); - } - $form['vids'] = array( - '#type' => 'select', - '#multiple' => TRUE, - '#title' => $this->t('Vocabularies'), - '#required' => TRUE, - '#default_value' => 'tags', - '#options' => $options, - '#description' => $this->t('Restrict terms to these vocabularies.'), - ); - $form['num'] = array( - '#type' => 'number', - '#title' => $this->t('Number of terms?'), - '#default_value' => $this->getSetting('num'), - '#required' => TRUE, - '#min' => 0, - ); - $form['title_length'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum number of characters in term names'), - '#default_value' => $this->getSetting('title_length'), - '#required' => TRUE, - '#min' => 2, - '#max' => 255, - ); - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Delete existing terms in specified vocabularies before generating new terms.'), - '#default_value' => $this->getSetting('kill'), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function generateElements(array $values) { - if ($values['kill']) { - $this->deleteVocabularyTerms($values['vids']); - $this->setMessage($this->t('Deleted existing terms.')); - } - - $vocabs = $this->vocabularyStorage->loadMultiple($values['vids']); - $new_terms = $this->generateTerms($values['num'], $vocabs, $values['title_length']); - if (!empty($new_terms)) { - $this->setMessage($this->t('Created the following new terms: @terms', array('@terms' => implode(', ', $new_terms)))); - } - } - - /** - * Deletes all terms of given vocabularies. - * - * @param array $vids - * Array of vocabulary vid. - */ - protected function deleteVocabularyTerms($vids) { - $tids = $this->vocabularyStorage->getToplevelTids($vids); - $terms = $this->termStorage->loadMultiple($tids); - $this->termStorage->delete($terms); - } - - /** - * Generates taxonomy terms for a list of given vocabularies. - * - * @param int $records - * Number of terms to create in total. - * @param \Drupal\taxonomy\TermInterface[] $vocabs - * List of vocabularies to populate. - * @param int $maxlength - * (optional) Maximum length per term. - * - * @return array - * The list of names of the created terms. - */ - protected function generateTerms($records, $vocabs, $maxlength = 12) { - $terms = array(); - - // Insert new data: - $max = db_query('SELECT MAX(tid) FROM {taxonomy_term_data}')->fetchField(); - $start = time(); - for ($i = 1; $i <= $records; $i++) { - $name = $this->getRandom()->word(mt_rand(2, $maxlength)); - - $values = array( - 'name' => $name, - 'description' => 'description of ' . $name, - 'format' => filter_fallback_format(), - 'weight' => mt_rand(0, 10), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - ); - - switch ($i % 2) { - case 1: - $vocab = $vocabs[array_rand($vocabs)]; - $values['vid'] = $vocab->id(); - $values['parent'] = array(0); - break; - - default: - while (TRUE) { - // Keep trying to find a random parent. - $candidate = mt_rand(1, $max); - $query = db_select('taxonomy_term_data', 't'); - $parent = $query - ->fields('t', array('tid', 'vid')) - ->condition('t.vid', array_keys($vocabs), 'IN') - ->condition('t.tid', $candidate, '>=') - ->range(0, 1) - ->execute() - ->fetchAssoc(); - if ($parent['tid']) { - break; - } - } - $values['parent'] = array($parent['tid']); - // Slight speedup due to this property being set. - $values['vid'] = $parent['vid']; - break; - } - - $term = $this->termStorage->create($values); - - // Populate all fields with sample values. - $this->populateFields($term); - $term->save(); - - $max++; - - // Limit memory usage. Only report first 20 created terms. - if ($i < 20) { - $terms[] = $term->label(); - } - - unset($term); - } - - return $terms; - } - - /** - * {@inheritdoc} - */ - public function validateDrushParams($args, $options = []) { - $vocabulary_name = array_shift($args); - $number = array_shift($args); - - if ($number === NULL) { - $number = 10; - } - - if (!$vocabulary_name) { - throw new \Exception(dt('Please provide a vocabulary machine name.')); - } - - if (!$this->isNumber($number)) { - throw new \Exception(dt('Invalid number of terms: @num', array('@num' => $number))); - } - - // Try to convert machine name to a vocabulary id. - if (!$vocabulary = $this->vocabularyStorage->load($vocabulary_name)) { - throw new \Exception(dt('Invalid vocabulary name: @name', array('@name' => $vocabulary_name))); - } - - $values = [ - 'num' => $number, - 'kill' => $this->isDrush8() ? drush_get_option('kill') : $options['kill'], - 'title_length' => 12, - 'vids' => [$vocabulary->id()], - ]; - - return $values; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php deleted file mode 100644 index 4e7344b89..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/UserDevelGenerate.php +++ /dev/null @@ -1,204 +0,0 @@ -userStorage = $entity_storage; - $this->dateFormatter = $date_formatter; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, $plugin_id, $plugin_definition, - $container->get('entity.manager')->getStorage('user'), - $container->get('date.formatter') - ); - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - $form['num'] = array( - '#type' => 'number', - '#title' => $this->t('How many users would you like to generate?'), - '#default_value' => $this->getSetting('num'), - '#required' => TRUE, - '#min' => 0, - ); - - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Delete all users (except user id 1) before generating new users.'), - '#default_value' => $this->getSetting('kill'), - ); - - $options = user_role_names(TRUE); - unset($options[DRUPAL_AUTHENTICATED_RID]); - $form['roles'] = array( - '#type' => 'checkboxes', - '#title' => $this->t('Which roles should the users receive?'), - '#description' => $this->t('Users always receive the authenticated user role.'), - '#options' => $options, - ); - - $form['pass'] = array( - '#type' => 'textfield', - '#title' => $this->t('Password to be set'), - '#default_value' => $this->getSetting('pass'), - '#size' => 32, - '#description' => $this->t('Leave this field empty if you do not need to set a password'), - ); - - $options = array(1 => $this->t('Now')); - foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) { - $options[$interval] = $this->dateFormatter->formatInterval($interval, 1) . ' ' . $this->t('ago'); - } - $form['time_range'] = array( - '#type' => 'select', - '#title' => $this->t('How old should user accounts be?'), - '#description' => $this->t('User ages will be distributed randomly from the current time, back to the selected time.'), - '#options' => $options, - '#default_value' => 604800, - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - protected function generateElements(array $values) { - $num = $values['num']; - $kill = $values['kill']; - $pass = $values['pass']; - $age = $values['time_range']; - $roles = array_filter($values['roles']); - - if ($kill) { - $uids = $this->userStorage->getQuery() - ->condition('uid', 1, '>') - ->execute(); - $users = $this->userStorage->loadMultiple($uids); - $this->userStorage->delete($users); - - $this->setMessage($this->formatPlural(count($uids), '1 user deleted', '@count users deleted.')); - } - - if ($num > 0) { - $names = array(); - while (count($names) < $num) { - $name = $this->getRandom()->word(mt_rand(6, 12)); - $names[$name] = ''; - } - - if (empty($roles)) { - $roles = array(DRUPAL_AUTHENTICATED_RID); - } - foreach ($names as $name => $value) { - $account = $this->userStorage->create(array( - 'uid' => NULL, - 'name' => $name, - 'pass' => $pass, - 'mail' => $name . '@example.com', - 'status' => 1, - 'created' => REQUEST_TIME - mt_rand(0, $age), - 'roles' => array_values($roles), - // A flag to let hook_user_* know that this is a generated user. - 'devel_generate' => TRUE, - )); - - // Populate all fields with sample values. - $this->populateFields($account); - $account->save(); - } - } - $this->setMessage($this->t('@num_users created.', array('@num_users' => $this->formatPlural($num, '1 user', '@count users')))); - } - - /** - * {@inheritdoc} - */ - public function validateDrushParams($args, $options = []) { - $values = array( - 'num' => array_shift($args), - 'time_range' => 0, - ); - - if ($this->isDrush8()) { - $values += [ - 'roles' => explode(',', drush_get_option('roles', '')), - 'kill' => drush_get_option('kill'), - 'pass' => drush_get_option('pass', NULL), - ]; - } - else { - $values += [ - 'roles' => StringUtils::csvToArray($options['roles']), - 'kill' => $options['kill'], - 'pass' => $options['pass'], - ]; - } - return $values; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php deleted file mode 100644 index 1a037465a..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php +++ /dev/null @@ -1,175 +0,0 @@ -vocabularyStorage = $entity_storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, $plugin_id, $plugin_definition, - $container->get('entity.manager')->getStorage('taxonomy_vocabulary') - ); - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - $form['num'] = array( - '#type' => 'number', - '#title' => $this->t('Number of vocabularies?'), - '#default_value' => $this->getSetting('num'), - '#required' => TRUE, - '#min' => 0, - ); - $form['title_length'] = array( - '#type' => 'number', - '#title' => $this->t('Maximum number of characters in vocabulary names'), - '#default_value' => $this->getSetting('title_length'), - '#required' => TRUE, - '#min' => 2, - '#max' => 255, - ); - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Delete existing vocabularies before generating new ones.'), - '#default_value' => $this->getSetting('kill'), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function generateElements(array $values) { - if ($values['kill']) { - $this->deleteVocabularies(); - $this->setMessage($this->t('Deleted existing vocabularies.')); - } - - $new_vocs = $this->generateVocabularies($values['num'], $values['title_length']); - if (!empty($new_vocs)) { - $this->setMessage($this->t('Created the following new vocabularies: @vocs', array('@vocs' => implode(', ', $new_vocs)))); - } - } - - /** - * Deletes all vocabularies. - */ - protected function deleteVocabularies() { - $vocabularies = $this->vocabularyStorage->loadMultiple(); - $this->vocabularyStorage->delete($vocabularies); - } - - /** - * Generates vocabularies. - * - * @param int $records - * Number of vocabularies to create. - * @param int $maxlength - * (optional) Maximum length for vocabulary name. - * - * @return array - * Array containing the generated vocabularies id. - */ - protected function generateVocabularies($records, $maxlength = 12) { - $vocabularies = array(); - - // Insert new data: - for ($i = 1; $i <= $records; $i++) { - $name = $this->getRandom()->word(mt_rand(2, $maxlength)); - - $vocabulary = $this->vocabularyStorage->create(array( - 'name' => $name, - 'vid' => Unicode::strtolower($name), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - 'description' => "Description of $name", - 'hierarchy' => 1, - 'weight' => mt_rand(0, 10), - 'multiple' => 1, - 'required' => 0, - 'relations' => 1, - )); - - // Populate all fields with sample values. - $this->populateFields($vocabulary); - $vocabulary->save(); - - $vocabularies[] = $vocabulary->id(); - unset($vocabulary); - } - - return $vocabularies; - } - - /** - * {@inheritdoc} - */ - public function validateDrushParams($args, $options = []) { - $values = array( - 'num' => array_shift($args), - 'kill' => $this->isDrush8() ? drush_get_option('kill') : $options['kill'], - 'title_length' => 12, - ); - - if ($this->isNumber($values['num']) == FALSE) { - throw new \Exception(dt('Invalid number of vocabularies: @num.', array('@num' => $values['num']))); - } - - return $values; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Routing/DevelGenerateRoutes.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Routing/DevelGenerateRoutes.php deleted file mode 100644 index 6cf98d93b..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Routing/DevelGenerateRoutes.php +++ /dev/null @@ -1,57 +0,0 @@ -DevelGenerateManager = $devel_generate_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.develgenerate') - ); - } - - public function routes() { - $devel_generate_plugins = $this->DevelGenerateManager->getDefinitions(); - - $routes = array(); - foreach ($devel_generate_plugins as $id => $plugin) { - $label = $plugin['label']; - $type_url_str = str_replace('_', '-', $plugin['url']); - $routes["devel_generate.$id"] = new Route( - "admin/config/development/generate/$type_url_str", - array( - '_form' => '\Drupal\devel_generate\Form\DevelGenerateForm', - '_title' => "Generate $label", - '_plugin_id' => $id, - ), - array( - '_permission' => $plugin['permission'], - ) - ); - } - - return $routes; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/src/Tests/DevelGenerateTest.php b/sites/all/modules/contrib/dev/devel/devel_generate/src/Tests/DevelGenerateTest.php deleted file mode 100644 index 4782d6fbb..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/src/Tests/DevelGenerateTest.php +++ /dev/null @@ -1,175 +0,0 @@ -profile != 'standard') { - $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic Page')); - $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); - $this->addDefaultCommentField('node', 'article'); - } - - // Creating a vocabulary to associate taxonomy terms generated. - $this->vocabulary = entity_create('taxonomy_vocabulary', array( - 'name' => $this->randomMachineName(), - 'description' => $this->randomMachineName(), - 'vid' => Unicode::strtolower($this->randomMachineName()), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - 'weight' => mt_rand(0, 10), - )); - $this->vocabulary->save(); - - // Creates a field of an entity reference field storage on article. - $field_name = 'taxonomy_' . $this->vocabulary->id(); - - $handler_settings = array( - 'target_bundles' => array( - $this->vocabulary->id() => $this->vocabulary->id(), - ), - 'auto_create' => TRUE, - ); - $this->createEntityReferenceField('node', 'article', $field_name, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); - - entity_get_form_display('node', 'article', 'default') - ->setComponent($field_name, array( - 'type' => 'options_select', - )) - ->save(); - - entity_get_display('node', 'article', 'default') - ->setComponent($field_name, array( - 'type' => 'entity_reference_label', - )) - ->save(); - - $admin_user = $this->drupalCreateUser(array('administer devel_generate')); - $this->drupalLogin($admin_user); - } - - /** - * Tests generate commands - */ - public function testDevelGenerate() { - // Creating users. - $edit = array( - 'num' => 4, - ); - $this->drupalPostForm('admin/config/development/generate/user', $edit, t('Generate')); - $this->assertText(t('4 users created.')); - $this->assertText(t('Generate process complete.')); - - // Tests that if no content types are selected an error message is shown. - $edit = array( - 'num' => 4, - 'title_length' => 4, - ); - $this->drupalPostForm('admin/config/development/generate/content', $edit, t('Generate')); - $this->assertText(t('Please select at least one content type')); - - // Creating content. - // First we create a node in order to test the Delete content checkbox. - $this->drupalCreateNode(array('type' => 'article')); - - $edit = array( - 'num' => 4, - 'kill' => TRUE, - 'node_types[article]' => TRUE, - 'time_range' => 604800, - 'max_comments' => 3, - 'title_length' => 4, - 'add_alias' => 1, - ); - $this->drupalPostForm('admin/config/development/generate/content', $edit, t('Generate')); - $this->assertText(t('Deleted 1 nodes.')); - $this->assertText(t('Finished creating 4 nodes')); - $this->assertText(t('Generate process complete.')); - - // Tests that nodes have been created in the generation process. - $nodes = Node::loadMultiple(); - $this->assert(count($nodes) == 4, 'Nodes generated successfully.'); - - // Tests url alias for the generated nodes. - foreach ($nodes as $node) { - $alias = 'node-' . $node->id() . '-' . $node->bundle(); - $this->drupalGet($alias); - $this->assertResponse('200'); - $this->assertText($node->getTitle(), 'Generated url alias for the node works.'); - } - - // Creating terms. - $edit = array( - 'vids[]' => $this->vocabulary->id(), - 'num' => 5, - 'title_length' => 12, - ); - $this->drupalPostForm('admin/config/development/generate/term', $edit, t('Generate')); - $this->assertText(t('Created the following new terms: ')); - $this->assertText(t('Generate process complete.')); - - // Creating vocabularies. - $edit = array( - 'num' => 5, - 'title_length' => 12, - 'kill' => TRUE, - ); - $this->drupalPostForm('admin/config/development/generate/vocabs', $edit, t('Generate')); - $this->assertText(t('Created the following new vocabularies: ')); - $this->assertText(t('Generate process complete.')); - - // Creating menus. - $edit = array( - 'num_menus' => 5, - 'num_links' => 7, - 'title_length' => 12, - 'link_types[node]' => 1, - 'link_types[front]' => 1, - 'link_types[external]' => 1, - 'max_depth' => 4, - 'max_width' => 6, - 'kill' => 1, - ); - $this->drupalPostForm('admin/config/development/generate/menu', $edit, t('Generate')); - $this->assertText(t('Created the following new menus: ')); - $this->assertText(t('Created 7 new menu links')); - $this->assertText(t('Generate process complete.')); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/devel_generate_example.info.yml b/sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/devel_generate_example.info.yml deleted file mode 100644 index 4489d46a0..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/devel_generate_example.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Devel Generate Example' -type: module -description: 'Create an example of a Devel Generate plugin type for testing purposes.' -package: Development -# core: 8.x -configure: admin/config/development/generate -tags: - - developer - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php b/sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php deleted file mode 100644 index b322fb3a8..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/tests/modules/devel_generate_example/src/Plugin/DevelGenerate/ExampleDevelGenerate.php +++ /dev/null @@ -1,88 +0,0 @@ - 'textfield', - '#title' => $this->t('How many examples would you like to generate?'), - '#default_value' => $this->getSetting('num'), - '#size' => 10, - ); - - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Delete all examples before generating new examples.'), - '#default_value' => $this->getSetting('kill'), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - protected function generateElements(array $values) { - $num = $values['num']; - $kill = $values['kill']; - - if ($kill) { - $this->setMessage($this->t('Old examples have been deleted.')); - } - - //Creating user in order to demonstrate - // how to override default business login generation. - $edit = array( - 'uid' => NULL, - 'name' => 'example_devel_generate', - 'pass' => '', - 'mail' => 'example_devel_generate@example.com', - 'status' => 1, - 'created' => REQUEST_TIME, - 'roles' => '', - 'devel_generate' => TRUE // A flag to let hook_user_* know that this is a generated user. - ); - - $account = user_load_by_name('example_devel_generate'); - if (!$account) { - $account = entity_create('user', $edit); - } - - // Populate all fields with sample values. - $this->populateFields($account); - - $account->save(); - - $this->setMessage($this->t('@num_examples created.', array('@num_examples' => $this->formatPlural($num, '1 example', '@count examples')))); - } - - public function validateDrushParams($args) { - $values = array( - 'num' => array_shift($args), - 'kill' => drush_get_option('kill'), - ); - return $values; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/devel_generate/tests/src/DevelGenerateManagerTest.php b/sites/all/modules/contrib/dev/devel/devel_generate/tests/src/DevelGenerateManagerTest.php deleted file mode 100644 index 28e66e491..000000000 --- a/sites/all/modules/contrib/dev/devel/devel_generate/tests/src/DevelGenerateManagerTest.php +++ /dev/null @@ -1,93 +0,0 @@ - array( - 'id' => 'devel_generate_example', - 'class' => 'Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate', - 'url' => 'devel_generate_example', - ), - ); - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - // Mock a Discovery object to replace AnnotationClassDiscovery. - $this->discovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface'); - $this->discovery->expects($this->any()) - ->method('getDefinitions') - ->will($this->returnValue($this->definitions)); - - } - - /** - * Test creating an instance of the DevelGenerateManager. - */ - public function testCreateInstance() { - $namespaces = new \ArrayObject(array('Drupal\devel_generate_example' => realpath(dirname(__FILE__) . '/../../../modules/devel_generate_example/lib'))); - $cache_backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); - - $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); - $manager = new TestDevelGeneratePluginManager($namespaces, $cache_backend, $module_handler); - $manager->setDiscovery($this->discovery); - - $example_instance = $manager->createInstance('devel_generate_example'); - $plugin_def = $example_instance->getPluginDefinition(); - - $this->assertInstanceOf('Drupal\devel_generate_example\Plugin\DevelGenerate\ExampleDevelGenerate', $example_instance); - $this->assertArrayHasKey('url', $plugin_def); - $this->assertTrue($plugin_def['url'] == 'devel_generate_example'); - } - -} - -/** - * Provides a testing version of DevelGeneratePluginManager with an empty - * constructor. - */ -class TestDevelGeneratePluginManager extends DevelGeneratePluginManager { - /** - * Sets the discovery for the manager. - * - * @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery - * The discovery object. - */ - public function setDiscovery(DiscoveryInterface $discovery) { - $this->discovery = $discovery; - } -} diff --git a/sites/all/modules/contrib/dev/devel/drush.services.yml b/sites/all/modules/contrib/dev/devel/drush.services.yml deleted file mode 100644 index 1c8ea0bc5..000000000 --- a/sites/all/modules/contrib/dev/devel/drush.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - devel.command: - class: Drupal\devel\Commands\DevelCommands - arguments: ['@token', '@service_container', '@event_dispatcher', '@module_handler'] - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/dev/devel/drush/devel.drush8.inc b/sites/all/modules/contrib/dev/devel/drush/devel.drush8.inc deleted file mode 100644 index 651578d3e..000000000 --- a/sites/all/modules/contrib/dev/devel/drush/devel.drush8.inc +++ /dev/null @@ -1,276 +0,0 @@ - dt('Uninstall, and Install a list of projects.'), - 'drush dependencies' => array('pm'), - 'arguments' => array( - 'projects' => dt('A space-separated list of project names.'), - ), - 'allow-additional-options' => array('pm-uninstall', 'pm-enable'), - 'required-arguments' => 1, - 'aliases' => array('dre'), - ); - $items['fn-hook'] = array( - 'description' => 'List implementations of a given hook and explore the source of the selected one.', - 'arguments' => array( - 'hook' => 'The name of the hook to explore (e.g. "menu" for hook_menu()).' - ), - 'examples' => array( - 'fn-hook cron' => 'List implementations of hook_cron().', - ), - 'allow-additional-options' => array('fn-view'), - 'required-arguments' => 1, - 'aliases' => array('fnh', 'hook'), - ); - $items['fn-event'] = array( - 'description' => 'List implementations of a given event and explore source of specified one.', - 'arguments' => array( - 'event' => 'The name of the event to explore. If omitted, a list of events is shown.' - ), - 'examples' => array( - 'fn-event' => 'Pick a Kernel event, then pick an implementation, and then view its source code.', - 'fn-event kernel.terminate' => 'Pick a terminate subscribers and view its source code.', - ), - 'allow-additional-options' => array('fn-view'), - 'aliases' => array('fne', 'event'), - ); - $items['fn-view'] = array( - 'description' => 'Show the source of specified function or method.', - 'arguments' => array( - 'function' => 'The name of the function or method to view.', - ), - 'options' => array( - 'pipe' => 'Output just the filename of the function or method', - 'format' => 'Specify how the filename should be printed. Available placeholders are @startline, @endline and @file', - ), - 'examples' => array( - 'fn-view drupal_set_breadcrumb' => 'View the source code for function "drupal_set_breadcrumb"', - 'vi `drush --pipe fn-view user_access --format=\'+@startline @file\'`' => 'Edit the file that contains the function "user_access"', - 'fn-view NodeController::load' => 'View the source code for method load in the class NodeController' - ), - 'aliases' => array('fnv'), - 'required-arguments' => 1, - ); - $items['devel-token'] = array( - 'description' => dt('List available tokens'), - 'aliases' => array('token'), - //@todo support --format option for json, csv, etc. - ); - - $items['devel-container-services'] = array( - 'description' => 'Get a list of available container services.', - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - 'core' => array('8+'), - 'aliases' => array('dcs'), - 'options' => array( - 'format' => 'Format to output. Allowed values are: json, export, html.', - ), - 'arguments' => array( - 'prefix' => 'A prefix to filter the service list by.', - ), - 'examples' => array( - 'drush container-services' => 'Gets a list of all available container services', - 'drush container-services plugin.manager' => 'Get all services containing "plugin.manager"', - ), - 'outputformat' => array( - 'default' => 'list', - 'pipe-format' => 'export', - ), - ); - - $items['devel-generate-uuid'] = array( - 'description' => 'Generate a UUID.', - 'core' => array('8+'), - 'examples' => array( - "drush devel-generate-uuid" => "Outputs a Universally Unique IDentifier.", - ), - 'aliases' => array('uuid'), - 'outputformat' => array( - 'default' => 'string', - ), - ); - - return $items; -} - -/** - * A command callback. This is faster than 3 separate bootstraps. - */ -function drush_devel_reinstall() { - $projects = func_get_args(); - - $args = array_merge(array('pm-uninstall'), $projects); - call_user_func_array('drush_invoke', $args); - - $args = array_merge(array('pm-enable'), $projects); - call_user_func_array('drush_invoke', $args); -} - -/** - * Command handler. Show hook implementations. - */ -function drush_devel_fn_hook($hook) { - // Get implementations in the .install files as well. - include_once './core/includes/install.inc'; - drupal_load_updates(); - - if ($hook_implementations = \Drupal::moduleHandler()->getImplementations($hook)) { - if ($choice = drush_choice(array_combine($hook_implementations, $hook_implementations), 'Enter the number of the hook implementation you wish to view.')) { - return drush_devel_fn_view($choice . "_$hook"); - } - } - else { - drush_log(dt('No implementations.'), 'ok'); - } -} - -/** - * Command handler. Show hook implementations. - */ -function drush_devel_fn_event($event = NULL) { - $dispatcher = Drupal::service('event_dispatcher'); - if (empty($event)) { - $events = array('kernel.controller', 'kernel.exception', 'kernel.request', 'kernel.response', 'kernel.terminate', 'kernel.view'); - $events = array_combine($events, $events); - if (!$event = drush_choice($events, 'Enter the event you wish to explore.')) { - return drush_user_abort(); - } - } - if ($implementations = $dispatcher->getListeners($event)) { - foreach ($implementations as $implementation) { - $callable = get_class($implementation[0]) . '::' . $implementation[1]; - $choices[$callable] = $callable; - } - if ($choice = drush_choice($choices, 'Enter the number of the implementation you wish to view.')) { - return drush_devel_fn_view($choice); - } - } - else { - drush_log(dt('No implementations.'), 'ok'); - } -} - -/** - * Command handler. Show source code of specified function or method. - */ -function drush_devel_fn_view($function_name) { - // Get implementations in the .install files as well. - include_once './core/includes/install.inc'; - drupal_load_updates(); - - if (strpos($function_name, '::') === FALSE) { - if (!function_exists($function_name)) { - return drush_set_error(dt('Function not found')); - } - $reflect = new ReflectionFunction($function_name); - } - else { - list($class, $method) = explode('::', $function_name); - if (!method_exists($class, $method)) { - return drush_set_error(dt('Method not found')); - } - $reflect = new ReflectionMethod($class, $method); - } - $func_info = array('@file' => $reflect->getFileName(), '@startline' => $reflect->getStartLine(), '@endline' => $reflect->getEndLine()); - $format = drush_get_option('format', '@file'); - drush_print_pipe(dt($format, $func_info)); - drush_print(dt("// file: @file, lines @startline-@endline", $func_info)); - - _drush_devel_print_function($reflect->getFileName(), $reflect->getStartLine(), $reflect->getEndLine()); -} - -/** - * Command callback. List available tokens. - */ -function drush_devel_token() { - $rows[] = array(dt('Group'), dt('Token'), dt('Name')); - $all = \Drupal::token()->getInfo(); - foreach ($all['tokens'] as $group => $tokens) { - foreach ($tokens as $key => $token) { - $rows[] = array($group, $key, $token['name']); - } - } - drush_print_table($rows, TRUE); -} - -/** - * Command callback. Outputs a UUID. - * - * @return string - * A freshly generated UUID. - */ -function drush_devel_generate_uuid() { - $uuid = new Php(); - return $uuid->generate(); -} - -/** - * Print the specified function, including any - * doxygen-style comments that come before it. - */ -function _drush_devel_print_function($file, $start_line, $end_line) { - $line_num = 0; - $doxygen = NULL; - $fp = fopen( $file, 'r' ); - - while (!feof($fp) && ($line_num < ($start_line - 1))) { - $line = fgets($fp); - ++$line_num; - - if (substr($line,0,3) == '/**') { - $doxygen = $line; - } - elseif (isset($doxygen)) { - $doxygen .= $line; - if ($line_num + 1 == $start_line) { - drush_print(rtrim($doxygen)); - } - if (strstr($line, '*/') !== FALSE) { - $doxygen = NULL; - } - } - } - while (!feof($fp) && ($line_num < $end_line)) { - $line = fgets($fp); - ++$line_num; - drush_print(rtrim($line)); - } -} - -/** - * Command callback to list available container services. - */ -function drush_devel_container_services($prefix = NULL) { - $container = Drupal::getContainer(); - - if (empty($container)) { - return drush_set_error(dt('No container was found.')); - } - - // Get a list of all available service IDs. - $services = $container->getServiceIds(); - - // If there is a prefix, try to find matches. - if (isset($prefix)) { - $services = preg_grep("/$prefix/", $services); - } - - if (empty($services)) { - return drush_log(dt('No container services found.'), 'ok'); - } - - sort($services); - return $services; -} diff --git a/sites/all/modules/contrib/dev/devel/icons/bebebe/cog.svg b/sites/all/modules/contrib/dev/devel/icons/bebebe/cog.svg deleted file mode 100644 index 5f57a3922..000000000 --- a/sites/all/modules/contrib/dev/devel/icons/bebebe/cog.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/icons/ffffff/cog.svg b/sites/all/modules/contrib/dev/devel/icons/ffffff/cog.svg deleted file mode 100644 index 63b300e36..000000000 --- a/sites/all/modules/contrib/dev/devel/icons/ffffff/cog.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/README.txt b/sites/all/modules/contrib/dev/devel/kint/README.txt deleted file mode 100644 index 75b68b921..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/README.txt +++ /dev/null @@ -1,37 +0,0 @@ -WHAT IS IT? ------------ -Kint for PHP is a tool designed to present your debugging data in the absolutely -best way possible. - -In other words, it's var_dump() and debug_backtrace() on steroids. Easy to use, -but powerful and customizable. An essential addition to your development -toolbox. - -USAGE ------ -This module allows to use these aliases: - kint($data1, $data2, $data3, ...); - ksm($data1, $data2, $data3, ...) - kint_trace(); - -But to get the most out of Kint, you will want to use directly the Kint class: - kint_require(); - Kint::dump($data); - -Learn more about Kint: http://raveren.github.io/kint/ - - -The Kint class function dd() will not work as expected, because this alias -is already defined in devel.module for other purposes. - -CONTACTS --------- -Module author: - Alexander Danilenko - danilenko.dn@gmail.com - https://drupal.org/user/1072104 - -Kint author: - Rokas Šleinius a.k.a. Raveren - raveren@gmail.com - https://github.com/raveren \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint.info.yml b/sites/all/modules/contrib/dev/devel/kint/kint.info.yml deleted file mode 100644 index 5a9af5b29..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Devel Kint' -type: module -description: 'Wrapper for Kint debugging tool' -package: Development -# core: 8.x -tags: - - developer - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/kint/kint.module b/sites/all/modules/contrib/dev/devel/kint/kint.module deleted file mode 100644 index c8bef22e9..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint.module +++ /dev/null @@ -1,65 +0,0 @@ -hasPermission('access kint')) { - $args = func_get_args(); - if (PHP_SAPI === 'cli') { - s($args); - } - else { - \Kint::dump($args); - } - } -} - -/** - * Alias of Kint::trace(). - * - * Prints backtrace in Kint debug tool. - */ -function kint_trace() { - kint_require(); - if (\Drupal::currentUser()->hasPermission('access kint')) { - call_user_func_array(array('Kint', 'trace'), array()); - } -} - -/** - * Alias of Kint::kintLite(). - * - * Prints with lightweight formatting, using whitespace for formatting instead - * of HTML. - */ -function kint_lite() { - if (\Drupal::currentUser()->hasPermission('access kint')) { - $args = func_get_args(); - call_user_func_array('kintLite', $args); - } -} - -/** - * Prints passed argument(s) to the 'message' area of the page. - */ -function ksm() { - kint_require(); - if (\Drupal::currentUser()->hasPermission('access kint')) { - $args = func_get_args(); - $msg = @Kint::dump($args); - drupal_set_message(Markup::create($msg)); - } -} - -/** - * Load the Kint class. - */ -function kint_require() { - return require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'kint') . '/kint/Kint.class.php'; -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint.permissions.yml b/sites/all/modules/contrib/dev/devel/kint/kint.permissions.yml deleted file mode 100644 index fe28b8593..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -access kint: - description: 'View developer debug output.' - title: 'Access kint information' - restrict access: TRUE diff --git a/sites/all/modules/contrib/dev/devel/kint/kint.services.yml b/sites/all/modules/contrib/dev/devel/kint/kint.services.yml deleted file mode 100644 index 5ae75ae68..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - kint.twig.kint_extension: - class: Drupal\kint\Twig\KintExtension - tags: - - { name: twig.extension } diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/.gitignore b/sites/all/modules/contrib/dev/devel/kint/kint/.gitignore deleted file mode 100644 index 21a628423..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -/config.php -/.idea \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/Kint.class.php b/sites/all/modules/contrib/dev/devel/kint/kint/Kint.class.php deleted file mode 100644 index c15e3f419..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/Kint.class.php +++ /dev/null @@ -1,836 +0,0 @@ -= 0 ); - -require KINT_DIR . 'config.default.php'; -require KINT_DIR . 'inc/kintVariableData.class.php'; -require KINT_DIR . 'inc/kintParser.class.php'; -require KINT_DIR . 'inc/kintObject.class.php'; -require KINT_DIR . 'decorators/rich.php'; -require KINT_DIR . 'decorators/plain.php'; - -if ( is_readable( KINT_DIR . 'config.php' ) ) { - require KINT_DIR . 'config.php'; -} - -# init settings -if ( !empty( $GLOBALS['_kint_settings'] ) ) { - Kint::enabled( $GLOBALS['_kint_settings']['enabled'] ); - - foreach ( $GLOBALS['_kint_settings'] as $key => $val ) { - property_exists( 'Kint', $key ) and Kint::$$key = $val; - } - - unset( $GLOBALS['_kint_settings'], $key, $val ); -} - -class Kint -{ - // these are all public and 1:1 config array keys so you can switch them easily - private static $_enabledMode; # stores mode and active statuses - - public static $returnOutput; - public static $fileLinkFormat; - public static $displayCalledFrom; - public static $charEncodings; - public static $maxStrLength; - public static $appRootDirs; - public static $maxLevels; - public static $theme; - public static $expandedByDefault; - - public static $cliDetection; - public static $cliColors; - - const MODE_RICH = 'r'; - const MODE_WHITESPACE = 'w'; - const MODE_CLI = 'c'; - const MODE_PLAIN = 'p'; - - - public static $aliases = array( - 'methods' => array( - array( 'kint', 'dump' ), - array( 'kint', 'trace' ), - ), - 'functions' => array( - 'd', - 'dd', - 'ddd', - 's', - 'sd', - ) - ); - - private static $_firstRun = true; - - /** - * Enables or disables Kint, can globally enforce the rendering mode. If called without parameters, returns the - * current mode. - * - * @param mixed $forceMode - * null or void - return current mode - * false - disable (no output) - * true - enable and detect cli automatically - * Kint::MODE_* - enable and force selected mode disregarding detection and function - * shorthand (s()/d()), note that you can still override this - * with the "~" modifier - * - * @return mixed previously set value if a new one is passed - */ - public static function enabled( $forceMode = null ) - { - # act both as a setter... - if ( isset( $forceMode ) ) { - $before = self::$_enabledMode; - self::$_enabledMode = $forceMode; - - return $before; - } - - # ...and a getter - return self::$_enabledMode; - } - - /** - * Prints a debug backtrace, same as Kint::dump(1) - * - * @param array $trace [OPTIONAL] you can pass your own trace, otherwise, `debug_backtrace` will be called - * - * @return mixed - */ - public static function trace( $trace = null ) - { - if ( !self::enabled() ) return ''; - - return self::dump( isset( $trace ) ? $trace : debug_backtrace( true ) ); - } - - - /** - * Dump information about variables, accepts any number of parameters, supports modifiers: - * - * clean up any output before kint and place the dump at the top of page: - * - Kint::dump() - * ***** - * expand all nodes on display: - * ! Kint::dump() - * ***** - * dump variables disregarding their depth: - * + Kint::dump() - * ***** - * return output instead of displaying it: - * @ Kint::dump() - * ***** - * force output as plain text - * ~ Kint::dump() - * - * Modifiers are supported by all dump wrapper functions, including Kint::trace(). Space is optional. - * - * - * You can also use the following shorthand to display debug_backtrace(): - * Kint::dump( 1 ); - * - * Passing the result from debug_backtrace() to kint::dump() as a single parameter will display it as trace too: - * $trace = debug_backtrace( true ); - * Kint::dump( $trace ); - * Or simply: - * Kint::dump( debug_backtrace() ); - * - * - * @param mixed $data - * - * @return void|string - */ - public static function dump( $data = null ) - { - if ( !self::enabled() ) return ''; - - list( $names, $modifiers, $callee, $previousCaller, $miniTrace ) = self::_getCalleeInfo( - defined( 'DEBUG_BACKTRACE_IGNORE_ARGS' ) - ? debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ) - : debug_backtrace() - ); - $modeOldValue = self::enabled(); - $firstRunOldValue = self::$_firstRun; - - # process modifiers: @, +, !, ~ and - - if ( strpos( $modifiers, '-' ) !== false ) { - self::$_firstRun = true; - while ( ob_get_level() ) { - ob_end_clean(); - } - } - if ( strpos( $modifiers, '!' ) !== false ) { - $expandedByDefaultOldValue = self::$expandedByDefault; - self::$expandedByDefault = true; - } - if ( strpos( $modifiers, '+' ) !== false ) { - $maxLevelsOldValue = self::$maxLevels; - self::$maxLevels = false; - } - if ( strpos( $modifiers, '@' ) !== false ) { - $returnOldValue = self::$returnOutput; - self::$returnOutput = true; - self::$_firstRun = true; - } - if ( strpos( $modifiers, '~' ) !== false ) { - self::enabled( self::MODE_WHITESPACE ); - } - - # set mode for current run - $mode = self::enabled(); - if ( $mode === true ) { - $mode = PHP_SAPI === 'cli' - ? self::MODE_CLI - : self::MODE_RICH; - } - self::enabled( $mode ); - - $decorator = self::enabled() === self::MODE_RICH - ? 'Kint_Decorators_Rich' - : 'Kint_Decorators_Plain'; - - $output = ''; - if ( self::$_firstRun ) { - $output .= call_user_func( array( $decorator, 'init' ) ); - } - - - $trace = false; - if ( $names === array( null ) && func_num_args() === 1 && $data === 1 ) { # Kint::dump(1) shorthand - $trace = KINT_PHP53 ? debug_backtrace( true ) : debug_backtrace(); - } elseif ( func_num_args() === 1 && is_array( $data ) ) { - $trace = $data; # test if the single parameter is result of debug_backtrace() - } - $trace and $trace = self::_parseTrace( $trace ); - - - $output .= call_user_func( array( $decorator, 'wrapStart' ) ); - if ( $trace ) { - $output .= call_user_func( array( $decorator, 'decorateTrace' ), $trace ); - } else { - $data = func_num_args() === 0 - ? array( "[[no arguments passed]]" ) - : func_get_args(); - - foreach ( $data as $k => $argument ) { - kintParser::reset(); - # when the dump arguments take long to generate output, user might have changed the file and - # Kint might not parse the arguments correctly, so check if names are set and while the - # displayed names might be wrong, at least don't throw an error - $output .= call_user_func( - array( $decorator, 'decorate' ), - kintParser::factory( $argument, isset( $names[ $k ] ) ? $names[ $k ] : '' ) - ); - } - } - - $output .= call_user_func( array( $decorator, 'wrapEnd' ), $callee, $miniTrace, $previousCaller ); - - self::enabled( $modeOldValue ); - - self::$_firstRun = false; - if ( strpos( $modifiers, '~' ) !== false ) { - self::$_firstRun = $firstRunOldValue; - } else { - self::enabled( $modeOldValue ); - } - if ( strpos( $modifiers, '!' ) !== false ) { - self::$expandedByDefault = $expandedByDefaultOldValue; - } - if ( strpos( $modifiers, '+' ) !== false ) { - self::$maxLevels = $maxLevelsOldValue; - } - if ( strpos( $modifiers, '@' ) !== false ) { - self::$returnOutput = $returnOldValue; - self::$_firstRun = $firstRunOldValue; - return $output; - } - - if ( self::$returnOutput ) return $output; - - echo $output; - return ''; - } - - - /** - * generic path display callback, can be configured in the settings; purpose is to show relevant path info and hide - * as much of the path as possible. - * - * @param string $file - * - * @return string - */ - public static function shortenPath( $file ) - { - $file = str_replace( '\\', '/', $file ); - $shortenedName = $file; - $replaced = false; - if ( is_array( self::$appRootDirs ) ) foreach ( self::$appRootDirs as $path => $replaceString ) { - if ( empty( $path ) ) continue; - - $path = str_replace( '\\', '/', $path ); - - if ( strpos( $file, $path ) === 0 ) { - $shortenedName = $replaceString . substr( $file, strlen( $path ) ); - $replaced = true; - break; - } - } - - # fallback to find common path with Kint dir - if ( !$replaced ) { - $pathParts = explode( '/', str_replace( '\\', '/', KINT_DIR ) ); - $fileParts = explode( '/', $file ); - $i = 0; - foreach ( $fileParts as $i => $filePart ) { - if ( !isset( $pathParts[ $i ] ) || $pathParts[ $i ] !== $filePart ) break; - } - - $shortenedName = ( $i ? '.../' : '' ) . implode( '/', array_slice( $fileParts, $i ) ); - } - - return $shortenedName; - } - - public static function getIdeLink( $file, $line ) - { - return str_replace( array( '%f', '%l' ), array( $file, $line ), self::$fileLinkFormat ); - } - - /** - * trace helper, shows the place in code inline - * - * @param string $file full path to file - * @param int $lineNumber the line to display - * @param int $padding surrounding lines to show besides the main one - * - * @return bool|string - */ - private static function _showSource( $file, $lineNumber, $padding = 7 ) - { - if ( !$file OR !is_readable( $file ) ) { - # continuing will cause errors - return false; - } - - # open the file and set the line position - $file = fopen( $file, 'r' ); - $line = 0; - - # Set the reading range - $range = array( - 'start' => $lineNumber - $padding, - 'end' => $lineNumber + $padding - ); - - # set the zero-padding amount for line numbers - $format = '% ' . strlen( $range['end'] ) . 'd'; - - $source = ''; - while ( ( $row = fgets( $file ) ) !== false ) { - # increment the line number - if ( ++$line > $range['end'] ) { - break; - } - - if ( $line >= $range['start'] ) { - # make the row safe for output - $row = htmlspecialchars( $row, ENT_NOQUOTES, 'UTF-8' ); - - # trim whitespace and sanitize the row - $row = '' . sprintf( $format, $line ) . ' ' . $row; - - if ( $line === $lineNumber ) { - # apply highlighting to this row - $row = '
    ' . $row . '
    '; - } else { - $row = '
    ' . $row . '
    '; - } - - # add to the captured source - $source .= $row; - } - } - - # close the file - fclose( $file ); - - return $source; - } - - - /** - * returns parameter names that the function was passed, as well as any predefined symbols before function - * call (modifiers) - * - * @param array $trace - * - * @return array( $parameters, $modifier, $callee, $previousCaller ) - */ - private static function _getCalleeInfo( $trace ) - { - $previousCaller = array(); - $miniTrace = array(); - $prevStep = array(); - - # go from back of trace to find first occurrence of call to Kint or its wrappers - while ( $step = array_pop( $trace ) ) { - - if ( self::_stepIsInternal( $step ) ) { - $previousCaller = $prevStep; - break; - } elseif ( isset( $step['file'], $step['line'] ) ) { - unset( $step['object'], $step['args'] ); - array_unshift( $miniTrace, $step ); - } - - $prevStep = $step; - } - $callee = $step; - - if ( !isset( $callee['file'] ) || !is_readable( $callee['file'] ) ) return false; - - - # open the file and read it up to the position where the function call expression ended - $file = fopen( $callee['file'], 'r' ); - $line = 0; - $source = ''; - while ( ( $row = fgets( $file ) ) !== false ) { - if ( ++$line > $callee['line'] ) break; - $source .= $row; - } - fclose( $file ); - $source = self::_removeAllButCode( $source ); - - - if ( empty( $callee['class'] ) ) { - $codePattern = $callee['function']; - } else { - if ( $callee['type'] === '::' ) { - $codePattern = $callee['class'] . "\x07*" . $callee['type'] . "\x07*" . $callee['function'];; - } else /*if ( $callee['type'] === '->' )*/ { - $codePattern = ".*\x07*" . $callee['type'] . "\x07*" . $callee['function'];; - } - } - - // todo if more than one call in one line - not possible to determine variable names - // todo does not recognize string concat - # get the position of the last call to the function - preg_match_all( " - [ - # beginning of statement - [\x07{(] - - # search for modifiers (group 1) - ([-+!@~]*)? - - # spaces - \x07* - - # check if output is assigned to a variable (group 2) todo: does not detect concat - ( - \\$[a-z0-9_]+ # variable - \x07*\\.?=\x07* # assignment - )? - - # possibly a namespace symbol - \\\\? - - # spaces again - \x07* - - # main call to Kint - {$codePattern} - - # spaces everywhere - \x07* - - # find the character where kint's opening bracket resides (group 3) - (\\() - - ]ix", - $source, - $matches, - PREG_OFFSET_CAPTURE - ); - - $modifiers = end( $matches[1] ); - $assignment = end( $matches[2] ); - $bracket = end( $matches[3] ); - - $modifiers = $modifiers[0]; - if ( $assignment[1] !== -1 ) { - $modifiers .= '@'; - } - - $paramsString = preg_replace( "[\x07+]", ' ', substr( $source, $bracket[1] + 1 ) ); - # we now have a string like this: - # ); - - # remove everything in brackets and quotes, we don't need nested statements nor literal strings which would - # only complicate separating individual arguments - $c = strlen( $paramsString ); - $inString = $escaped = $openedBracket = $closingBracket = false; - $i = 0; - $inBrackets = 0; - $openedBrackets = array(); - - while ( $i < $c ) { - $letter = $paramsString[ $i ]; - - if ( !$inString ) { - if ( $letter === '\'' || $letter === '"' ) { - $inString = $letter; - } elseif ( $letter === '(' || $letter === '[' ) { - $inBrackets++; - $openedBrackets[] = $openedBracket = $letter; - $closingBracket = $openedBracket === '(' ? ')' : ']'; - } elseif ( $inBrackets && $letter === $closingBracket ) { - $inBrackets--; - array_pop( $openedBrackets ); - $openedBracket = end( $openedBrackets ); - $closingBracket = $openedBracket === '(' ? ')' : ']'; - } elseif ( !$inBrackets && $letter === ')' ) { - $paramsString = substr( $paramsString, 0, $i ); - break; - } - } elseif ( $letter === $inString && !$escaped ) { - $inString = false; - } - - # replace whatever was inside quotes or brackets with untypeable characters, we don't - # need that info. We'll later replace the whole string with '...' - if ( $inBrackets > 0 ) { - if ( $inBrackets > 1 || $letter !== $openedBracket ) { - $paramsString[ $i ] = "\x07"; - } - } - if ( $inString ) { - if ( $letter !== $inString || $escaped ) { - $paramsString[ $i ] = "\x07"; - } - } - - $escaped = !$escaped && ( $letter === '\\' ); - $i++; - } - - # by now we have an un-nested arguments list, lets make it to an array for processing further - $arguments = explode( ',', preg_replace( "[\x07+]", '...', $paramsString ) ); - - # test each argument whether it was passed literary or was it an expression or a variable name - $parameters = array(); - $blacklist = array( 'null', 'true', 'false', 'array(...)', 'array()', '"..."', '[...]', 'b"..."', ); - foreach ( $arguments as $argument ) { - $argument = trim( $argument ); - - if ( is_numeric( $argument ) - || in_array( str_replace( "'", '"', strtolower( $argument ) ), $blacklist, true ) - ) { - $parameters[] = null; - } else { - $parameters[] = $argument; - } - } - - return array( $parameters, $modifiers, $callee, $previousCaller, $miniTrace ); - } - - /** - * removes comments and zaps whitespace & true, T_INLINE_HTML => true, T_DOC_COMMENT => true - ); - $whiteSpaceTokens = array( - T_WHITESPACE => true, T_CLOSE_TAG => true, - T_OPEN_TAG => true, T_OPEN_TAG_WITH_ECHO => true, - ); - - $cleanedSource = ''; - foreach ( token_get_all( $source ) as $token ) { - if ( is_array( $token ) ) { - if ( isset( $commentTokens[ $token[0] ] ) ) continue; - - if ( isset( $whiteSpaceTokens[ $token[0] ] ) ) { - $token = "\x07"; - } else { - $token = $token[1]; - } - } elseif ( $token === ';' ) { - $token = "\x07"; - } - - $cleanedSource .= $token; - } - return $cleanedSource; - } - - /** - * returns whether current trace step belongs to Kint or its wrappers - * - * @param $step - * - * @return array - */ - private static function _stepIsInternal( $step ) - { - if ( isset( $step['class'] ) ) { - foreach ( self::$aliases['methods'] as $alias ) { - if ( $alias[0] === strtolower( $step['class'] ) && $alias[1] === strtolower( $step['function'] ) ) { - return true; - } - } - return false; - } else { - return in_array( strtolower( $step['function'] ), self::$aliases['functions'], true ); - } - } - - private static function _parseTrace( array $data ) - { - $trace = array(); - $traceFields = array( 'file', 'line', 'args', 'class' ); - $fileFound = false; # file element must exist in one of the steps - - # validate whether a trace was indeed passed - while ( $step = array_pop( $data ) ) { - if ( !is_array( $step ) || !isset( $step['function'] ) ) return false; - if ( !$fileFound && isset( $step['file'] ) && file_exists( $step['file'] ) ) { - $fileFound = true; - } - - $valid = false; - foreach ( $traceFields as $element ) { - if ( isset( $step[ $element ] ) ) { - $valid = true; - break; - } - } - if ( !$valid ) return false; - - if ( self::_stepIsInternal( $step ) ) { - $step = array( - 'file' => $step['file'], - 'line' => $step['line'], - 'function' => '', - ); - array_unshift( $trace, $step ); - break; - } - if ( $step['function'] !== 'spl_autoload_call' ) { # meaningless - array_unshift( $trace, $step ); - } - } - if ( !$fileFound ) return false; - - $output = array(); - foreach ( $trace as $step ) { - if ( isset( $step['file'] ) ) { - $file = $step['file']; - - if ( isset( $step['line'] ) ) { - $line = $step['line']; - # include the source of this step - if ( self::enabled() === self::MODE_RICH ) { - $source = self::_showSource( $file, $line ); - } - } - } - - $function = $step['function']; - - if ( in_array( $function, array( 'include', 'include_once', 'require', 'require_once' ) ) ) { - if ( empty( $step['args'] ) ) { - # no arguments - $args = array(); - } else { - # sanitize the included file path - $args = array( 'file' => self::shortenPath( $step['args'][0] ) ); - } - } elseif ( isset( $step['args'] ) ) { - if ( empty( $step['class'] ) && !function_exists( $function ) ) { - # introspection on closures or language constructs in a stack trace is impossible before PHP 5.3 - $params = null; - } else { - try { - if ( isset( $step['class'] ) ) { - if ( method_exists( $step['class'], $function ) ) { - $reflection = new ReflectionMethod( $step['class'], $function ); - } else if ( isset( $step['type'] ) && $step['type'] == '::' ) { - $reflection = new ReflectionMethod( $step['class'], '__callStatic' ); - } else { - $reflection = new ReflectionMethod( $step['class'], '__call' ); - } - } else { - $reflection = new ReflectionFunction( $function ); - } - - # get the function parameters - $params = $reflection->getParameters(); - } catch ( Exception $e ) { # avoid various PHP version incompatibilities - $params = null; - } - } - - $args = array(); - foreach ( $step['args'] as $i => $arg ) { - if ( isset( $params[ $i ] ) ) { - # assign the argument by the parameter name - $args[ $params[ $i ]->name ] = $arg; - } else { - # assign the argument by number - $args[ '#' . ( $i + 1 ) ] = $arg; - } - } - } - - if ( isset( $step['class'] ) ) { - # Class->method() or Class::method() - $function = $step['class'] . $step['type'] . $function; - } - - // todo it's possible to parse the object name out from the source! - $output[] = array( - 'function' => $function, - 'args' => isset( $args ) ? $args : null, - 'file' => isset( $file ) ? $file : null, - 'line' => isset( $line ) ? $line : null, - 'source' => isset( $source ) ? $source : null, - 'object' => isset( $step['object'] ) ? $step['object'] : null, - ); - - unset( $function, $args, $file, $line, $source ); - } - - return $output; - } -} - - -if ( !function_exists( 'd' ) ) { - /** - * Alias of Kint::dump() - * - * @return string - */ - function d() - { - if ( !Kint::enabled() ) return ''; - $_ = func_get_args(); - return call_user_func_array( array( 'Kint', 'dump' ), $_ ); - } -} - -if ( !function_exists( 'dd' ) ) { - /** - * Alias of Kint::dump() - * [!!!] IMPORTANT: execution will halt after call to this function - * - * @return string - * @deprecated - */ - function dd() - { - if ( !Kint::enabled() ) return ''; - - echo "
    Kint: dd() is being deprecated, please use ddd() instead
    \n"; - $_ = func_get_args(); - call_user_func_array( array( 'Kint', 'dump' ), $_ ); - die; - } -} - -if ( !function_exists( 'ddd' ) ) { - /** - * Alias of Kint::dump() - * [!!!] IMPORTANT: execution will halt after call to this function - * - * @return string - */ - function ddd() - { - if ( !Kint::enabled() ) return ''; - $_ = func_get_args(); - call_user_func_array( array( 'Kint', 'dump' ), $_ ); - die; - } -} - -if ( !function_exists( 's' ) ) { - /** - * Alias of Kint::dump(), however the output is in plain htmlescaped text and some minor visibility enhancements - * added. If run in CLI mode, output is pure whitespace. - * - * To force rendering mode without autodetecting anything: - * - * Kint::enabled( Kint::MODE_PLAIN ); - * Kint::dump( $variable ); - * - * [!!!] IMPORTANT: execution will halt after call to this function - * - * @return string - */ - function s() - { - $enabled = Kint::enabled(); - if ( !$enabled ) return ''; - - if ( $enabled === Kint::MODE_WHITESPACE ) { # if already in whitespace, don't elevate to plain - $restoreMode = Kint::MODE_WHITESPACE; - } else { - $restoreMode = Kint::enabled( # remove cli colors in cli mode; remove rich interface in HTML mode - PHP_SAPI === 'cli' ? Kint::MODE_WHITESPACE : Kint::MODE_PLAIN - ); - } - - $params = func_get_args(); - $dump = call_user_func_array( array( 'Kint', 'dump' ), $params ); - Kint::enabled( $restoreMode ); - return $dump; - } -} - -if ( !function_exists( 'sd' ) ) { - /** - * @see s() - * - * [!!!] IMPORTANT: execution will halt after call to this function - * - * @return string - */ - function sd() - { - $enabled = Kint::enabled(); - if ( !$enabled ) return ''; - - if ( $enabled !== Kint::MODE_WHITESPACE ) { - Kint::enabled( - PHP_SAPI === 'cli' ? Kint::MODE_WHITESPACE : Kint::MODE_PLAIN - ); - } - - $params = func_get_args(); - call_user_func_array( array( 'Kint', 'dump' ), $params ); - die; - } -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/LICENCE b/sites/all/modules/contrib/dev/devel/kint/kint/LICENCE deleted file mode 100644 index 936fe1f16..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/LICENCE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Rokas Šleinius (raveren@gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/README.md b/sites/all/modules/contrib/dev/devel/kint/kint/README.md deleted file mode 100644 index 74edcba11..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Kint - debugging helper for PHP developers - -[![Total Downloads](https://poser.pugx.org/raveren/kint/downloads.png)](https://packagist.org/packages/raveren/kint) - -> **New version** v1.0.0 is released with more than two years of active development - changes are too numerous to list, but there's CLI output and literally hundreds of improvements and additions. - -![Screenshot](http://raveren.github.com/kint/img/preview.png) - -## What am I looking at? - -At first glance Kint is just a pretty replacement for **[var_dump()](http://php.net/manual/en/function.var-dump.php)**, **[print_r()](http://php.net/manual/en/function.print-r.php)** and **[debug_backtrace()](http://php.net/manual/en/function.debug-backtrace.php)**. - -However, it's much, *much* more than that. Even the excellent `xdebug` var_dump improvements don't come close - you will eventually wonder how you developed without it. - -Just to list some of the most useful features: - - * The **variable name and place in code** where Kint was called from is displayed; - * You can **disable all Kint output easily and on the fly** - so you can even debug live systems without anyone knowing (even though you know you shouldn't be doing that!:). - * **CLI is detected** and formatted for automatically (but everything can be overridden on the fly) - if your setup supports it, the output is colored too: - ![Kint CLI output](http://i.imgur.com/6B9MCLw.png) - * **Debug backtraces** are finally fully readable, actually informative and a pleasure to the eye. - * Kint has been **in active development for more than six years** and is shipped with [Drupal 8](https://www.drupal.org/) by default as part of its devel suite. You can trust it not being abandoned or getting left behind in features. - * Variable content is **displayed in the most informative way** - and you *never, ever* miss anything! Kint guarantees you see every piece of physically available information about everything you are dumping*; - * in some cases, the content is truncated where it would otherwise be too large to view anyway - but the user is always made aware of that; - * Some variable content types have an alternative display - for example you will be able see `JSON` in its raw form - but also as an associative array: - ![Kint displays data intelligently](http://i.imgur.com/9P57Ror.png) - There are more than ten custom variable type displays inbuilt and more are added periodically. - - -## Installation and Usage - -One of the main goals of Kint is to be **zero setup**. - -[Download the archive](https://github.com/raveren/kint/releases/download/1.0.2/kint.zip) and simply -```php -');`) - so even if you accidentally leave a dump in production, no one will know. - * `sd()` and `ddd()` are shorthands for `s();die;` and `d();die;` respectively. - * **Important:** The older shorthand `dd()` is deprecated due to compatibility issues and will eventually be removed. Use the analogous `ddd()` instead. - * When looking at Kint output, press D on the keyboard and you will be able to traverse the tree with arrows and tab keys - and expand/collapse nodes with space or enter. - * Double clicking the `[+]` sign in the output will expand/collapse ALL nodes; triple clicking big blocks of text will select it all. - * Clicking the tiny arrows on the right of the output open it in a separate window where you can keep it for comparison. - * To catch output from Kint just assign it to a variablebeta -```php -$o = Kint::dump($GLOBALS); -// yes, the assignment is automatically detected, and $o -// now holds whatever was going to be printed otherwise. - -// it also supports modifiers (read on) for the variable: -~$o = Kint::dump($GLOBALS); // this output will be in whitespace -``` - * There are a couple of real-time modifiers you can use: - * `~d($var)` this call will output in plain text format. - * `+d($var)` will disregard depth level limits and output everything (careful, this can hang your browser on huge objects) - * `!d($var)` will show expanded rich output. - * `-d($var)` will attempt to `ob_clean` the previous output so if you're dumping something inside a HTML page, you will still see Kint output. - You can combine modifiers too: `~+d($var)` - * To force a specific dump output type just pass it to the `Kint::enabled()` method. Available options are: `Kint::MODE_RICH` (default), `Kint::MODE_PLAIN`, `Kint::MODE_WHITESPACE` and `Kint::MODE_CLI`: -```php -Kint::enabled(Kint::MODE_WHITESPACE); -$kintOutput = Kint::dump($GLOBALS); -// now $kintOutput can be written to a text log file and -// be perfectly readable from there -``` - * To change display theme, use `Kint::$theme = '';` where available options are: `'original'` (default), `'solarized'`, `'solarized-dark'` and `'aante-light'`. Here's an (outdated) preview: - ![Kint themes](http://raveren.github.io/kint/img/theme-preview.png) - * Kint also includes a naïve profiler you may find handy. It's for determining relatively which code blocks take longer than others: -```php -Kint::dump( microtime() ); // just pass microtime() -sleep( 1 ); -Kint::dump( microtime(), 'after sleep(1)' ); -sleep( 2 ); -ddd( microtime(), 'final call, after sleep(2)' ); -``` - ![Kint profiling feature](http://i.imgur.com/tmHUMW4.png) ----- - -[Visit the project page](http://raveren.github.com/kint/) for documentation, configuration, and more advanced usage examples. - -### Author - -**Rokas Šleinius** (Raveren) - -### License - -Licensed under the MIT License diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/composer.json b/sites/all/modules/contrib/dev/devel/kint/kint/composer.json deleted file mode 100644 index 78eb1b654..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "raveren/kint", - "description": "Kint - debugging helper for PHP developers", - "keywords": ["kint", "php", "debug"], - "type": "library", - "homepage": "https://github.com/raveren/kint", - "license": "MIT", - "authors": [ - { - "name": "Rokas Šleinius", - "homepage": "https://github.com/raveren" - }, - { - "name": "Contributors", - "homepage": "https://github.com/raveren/kint/contributors" - } - ], - "require": { - "php": ">=5.1.0" - }, - "autoload": { - "files": ["Kint.class.php"] - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/config.default.php b/sites/all/modules/contrib/dev/devel/kint/kint/config.default.php deleted file mode 100644 index 72f0a6933..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/config.default.php +++ /dev/null @@ -1,94 +0,0 @@ - '<ROOT>' ) - * - * [!] EXAMPLE (for Kohana framework): - * - * $_kintSettings['appRootDirs'] = array( - * APPPATH => 'APPPATH', // make sure the constants are already defined at the time of including this config file - * SYSPATH => 'SYSPATH', - * MODPATH => 'MODPATH', - * DOCROOT => 'DOCROOT', - * ); - * - * [!] EXAMPLE #2 (for a semi-universal approach) - * - * $_kintSettings['appRootDirs'] = array( - * realpath( __DIR__ . '/../../..' ) => 'ROOT', // go up as many levels as needed in the realpath() param - * ); - * - * $_kintSettings['fileLinkFormat'] = 'http://localhost:8091/?message=%f:%l'; - * - */ -$_kintSettings['appRootDirs'] = isset( $_SERVER['DOCUMENT_ROOT'] ) - ? array( $_SERVER['DOCUMENT_ROOT'] => '<ROOT>' ) - : array(); - - -/** @var int max length of string before it is truncated and displayed separately in full. Zero or false to disable */ -$_kintSettings['maxStrLength'] = 80; - -/** @var array possible alternative char encodings in order of probability, eg. array('windows-1251') */ -$_kintSettings['charEncodings'] = array( - 'UTF-8', - 'Windows-1252', # Western; includes iso-8859-1, replace this with windows-1251 if you have Russian code - 'euc-jp', # Japanese - - # all other charsets cannot be differentiated by PHP and/or are not supported by mb_* functions, - # I need a better means of detecting the codeset, no idea how though :( - - // 'iso-8859-13', # Baltic - // 'windows-1251', # Cyrillic - // 'windows-1250', # Central European - // 'shift_jis', # Japanese - // 'iso-2022-jp', # Japanese -); - - -/** @var int max array/object levels to go deep, if zero no limits are applied */ -$_kintSettings['maxLevels'] = 7; - - -/** @var string name of theme for rich view */ -$_kintSettings['theme'] = 'original'; - - -/** @var bool enable detection when Kint is command line. Formats output with whitespace only; does not HTML-escape it */ -$_kintSettings['cliDetection'] = true; - -/** @var bool in addition to above setting, enable detection when Kint is run in *UNIX* command line. - * Attempts to add coloring, but if seen as plain text, the color information is visible as gibberish - */ -$_kintSettings['cliColors'] = true; - - -unset( $_kintSettings ); \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/decorators/plain.php b/sites/all/modules/contrib/dev/devel/kint/kint/decorators/plain.php deleted file mode 100644 index 22ebd2ae9..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/decorators/plain.php +++ /dev/null @@ -1,335 +0,0 @@ - '1', 'dark' => '2', - 'italic' => '3', 'underline' => '4', - 'blink' => '5', 'reverse' => '7', - 'concealed' => '8', 'default' => '39', - - # colors - 'black' => '30', 'red' => '31', - 'green' => '32', 'yellow' => '33', - 'blue' => '34', 'magenta' => '35', - 'cyan' => '36', 'light_gray' => '37', - 'dark_gray' => '90', 'light_red' => '91', - 'light_green' => '92', 'light_yellow' => '93', - 'light_blue' => '94', 'light_magenta' => '95', - 'light_cyan' => '96', 'white' => '97', - - # backgrounds - 'bg_default' => '49', 'bg_black' => '40', - 'bg_red' => '41', 'bg_green' => '42', - 'bg_yellow' => '43', 'bg_blue' => '44', - 'bg_magenta' => '45', 'bg_cyan' => '46', - 'bg_light_gray' => '47', 'bg_dark_gray' => '100', - 'bg_light_red' => '101', 'bg_light_green' => '102', - 'bg_light_yellow' => '103', 'bg_light_blue' => '104', - 'bg_light_magenta' => '105', 'bg_light_cyan' => '106', - 'bg_white' => '107', - ); - private static $_utfSymbols = array( - '┌', '═', '┐', - '│', - '└', '─', '┘', - ); - private static $_winShellSymbols = array( - "\xda", "\xdc", "\xbf", - "\xb3", - "\xc0", "\xc4", "\xd9", - ); - private static $_htmlSymbols = array( - "┌", "▄", "┐", - "│", - "└", "─", "┘", - ); - - public static function decorate( kintVariableData $kintVar, $level = 0 ) - { - $output = ''; - if ( $level === 0 ) { - $name = $kintVar->name ? $kintVar->name : 'literal'; - $kintVar->name = null; - - $output .= self::_title( $name ); - } - - - $space = str_repeat( $s = ' ', $level ); - $output .= $space . self::_drawHeader( $kintVar ); - - - if ( $kintVar->extendedValue !== null ) { - $output .= ' ' . ( $kintVar->type === 'array' ? '[' : '(' ) . PHP_EOL; - - - if ( is_array( $kintVar->extendedValue ) ) { - foreach ( $kintVar->extendedValue as $v ) { - $output .= self::decorate( $v, $level + 1 ); - } - } elseif ( is_string( $kintVar->extendedValue ) ) { - $output .= $space . $s . $kintVar->extendedValue . PHP_EOL; # depth too great or similar - } else { - $output .= self::decorate( $kintVar->extendedValue, $level + 1 ); //it's kintVariableData - } - $output .= $space . ( $kintVar->type === 'array' ? ']' : ')' ) . PHP_EOL; - } else { - $output .= PHP_EOL; - } - - return $output; - } - - public static function decorateTrace( $traceData ) - { - $output = self::_title( 'TRACE' ); - $lastStep = count( $traceData ); - foreach ( $traceData as $stepNo => $step ) { - $title = str_pad( ++$stepNo . ': ', 4, ' ' ); - - $title .= self::_colorize( - ( isset( $step['file'] ) ? self::_buildCalleeString( $step ) : 'PHP internal call' ), - 'title' - ); - - if ( !empty( $step['function'] ) ) { - $title .= ' ' . $step['function']; - if ( isset( $step['args'] ) ) { - $title .= '('; - if ( empty( $step['args'] ) ) { - $title .= ')'; - } else { - } - $title .= PHP_EOL; - } - } - - $output .= $title; - - if ( !empty( $step['args'] ) ) { - $appendDollar = $step['function'] === '{closure}' ? '' : '$'; - - $i = 0; - foreach ( $step['args'] as $name => $argument ) { - $argument = kintParser::factory( - $argument, - $name ? $appendDollar . $name : '#' . ++$i - ); - $argument->operator = $name ? ' =' : ':'; - $maxLevels = Kint::$maxLevels; - if ( $maxLevels ) { - Kint::$maxLevels = $maxLevels + 2; - } - $output .= self::decorate( $argument, 2 ); - if ( $maxLevels ) { - Kint::$maxLevels = $maxLevels; - } - } - $output .= ' )' . PHP_EOL; - } - - if ( !empty( $step['object'] ) ) { - $output .= self::_colorize( - ' ' . self::_char( '─', 27 ) . ' Callee object ' . self::_char( '─', 34 ), - 'title' - ); - - $maxLevels = Kint::$maxLevels; - if ( $maxLevels ) { - # in cli the terminal window is filled too quickly to display huge objects - Kint::$maxLevels = Kint::enabled() === Kint::MODE_CLI - ? 1 - : $maxLevels + 1; - } - $output .= self::decorate( kintParser::factory( $step['object'] ), 1 ); - if ( $maxLevels ) { - Kint::$maxLevels = $maxLevels; - } - } - - if ( $stepNo !== $lastStep ) { - $output .= self::_colorize( self::_char( '─', 80 ), 'title' ); - } - } - - return $output; - } - - - private static function _colorize( $text, $type, $nlAfter = true ) - { - $nlAfter = $nlAfter ? PHP_EOL : ''; - - switch ( Kint::enabled() ) { - case Kint::MODE_PLAIN: - if ( !self::$_enableColors ) return $text . $nlAfter; - - switch ( $type ) { - case 'value': - $text = "{$text}"; - break; - case 'type': - $text = "{$text}"; - break; - case 'title': - $text = "{$text}"; - break; - } - - return $text . $nlAfter; - break; - case Kint::MODE_CLI: - if ( !self::$_enableColors ) return $text . $nlAfter; - - $optionsMap = array( - 'title' => "\x1b[36m", # cyan - 'type' => "\x1b[35;1m", # magenta bold - 'value' => "\x1b[32m", # green - ); - - return $optionsMap[ $type ] . $text . "\x1b[0m" . $nlAfter; - break; - case Kint::MODE_WHITESPACE: - default: - return $text . $nlAfter; - break; - } - } - - - private static function _char( $char, $repeat = null ) - { - switch ( Kint::enabled() ) { - case Kint::MODE_PLAIN: - $char = self::$_htmlSymbols[ array_search( $char, self::$_utfSymbols, true ) ]; - break; - case Kint::MODE_CLI: - $inWindowsShell = PHP_SAPI === 'cli' && DIRECTORY_SEPARATOR !== '/'; - if ( $inWindowsShell ) { - $char = self::$_winShellSymbols[ array_search( $char, self::$_utfSymbols, true ) ]; - } - break; - case Kint::MODE_WHITESPACE: - default: - break; - } - - return $repeat ? str_repeat( $char, $repeat ) : $char; - } - - private static function _title( $text ) - { - $escaped = kintParser::escape( $text ); - $lengthDifference = strlen( $escaped ) - strlen( $text ); - return - self::_colorize( - self::_char( '┌' ) . self::_char( '─', 78 ) . self::_char( '┐' ) . PHP_EOL - . self::_char( '│' ), - 'title', - false - ) - - . self::_colorize( str_pad( $escaped, 78 + $lengthDifference, ' ', STR_PAD_BOTH ), 'title', false ) - - . self::_colorize( self::_char( '│' ) . PHP_EOL - . self::_char( '└' ) . self::_char( '─', 78 ) . self::_char( '┘' ), - 'title' - ); - } - - public static function wrapStart() - { - if ( Kint::enabled() === Kint::MODE_PLAIN ) { - return '
    ';
    -		}
    -		return '';
    -	}
    -
    -	public static function wrapEnd( $callee, $miniTrace, $prevCaller )
    -	{
    -		$lastLine = self::_colorize( self::_char( "═", 80 ), 'title' );
    -		$lastChar = Kint::enabled() === Kint::MODE_PLAIN ? '
    ' : ''; - - - if ( !Kint::$displayCalledFrom ) return $lastLine . $lastChar; - - - return $lastLine . self::_colorize( 'Called from ' . self::_buildCalleeString( $callee ), 'title' ) . $lastChar; - } - - - private static function _drawHeader( kintVariableData $kintVar ) - { - $output = ''; - - if ( $kintVar->access ) { - $output .= ' ' . $kintVar->access; - } - - if ( $kintVar->name !== null && $kintVar->name !== '' ) { - $output .= ' ' . kintParser::escape( $kintVar->name ); - } - - if ( $kintVar->operator ) { - $output .= ' ' . $kintVar->operator; - } - - $output .= ' ' . self::_colorize( $kintVar->type, 'type', false ); - - if ( $kintVar->size !== null ) { - $output .= ' (' . $kintVar->size . ')'; - } - - - if ( $kintVar->value !== null && $kintVar->value !== '' ) { - $output .= ' ' . self::_colorize( - $kintVar->value, # escape shell - 'value', - false - ); - } - - return ltrim( $output ); - } - - private static function _buildCalleeString( $callee ) - { - if ( Kint::enabled() === Kint::MODE_CLI ) { // todo win/nix - return "+{$callee['line']} {$callee['file']}"; - } - - $url = Kint::getIdeLink( $callee['file'], $callee['line'] ); - $shortenedName = Kint::shortenPath( $callee['file'] ) . ':' . $callee['line']; - - if ( Kint::enabled() === Kint::MODE_PLAIN ) { - if ( strpos( $url, 'http://' ) === 0 ) { - $calleeInfo = "{$shortenedName}"; - } else { - $calleeInfo = "{$shortenedName}"; - } - } else { - $calleeInfo = $shortenedName; - } - - return $calleeInfo; - } - - public static function init() - { - self::$_enableColors = - Kint::$cliColors - && ( DIRECTORY_SEPARATOR === '/' || getenv( 'ANSICON' ) !== false || getenv( 'ConEmuANSI' ) === 'ON' ); - - return Kint::enabled() === Kint::MODE_PLAIN - ? '' - : ''; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/decorators/rich.php b/sites/all/modules/contrib/dev/devel/kint/kint/decorators/rich.php deleted file mode 100644 index bb6c97825..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/decorators/rich.php +++ /dev/null @@ -1,319 +0,0 @@ -'; - - $extendedPresent = $kintVar->extendedValue !== null || $kintVar->_alternatives !== null; - - if ( $extendedPresent ) { - $class = 'kint-parent'; - if ( Kint::$expandedByDefault ) { - $class .= ' kint-show'; - } - $output .= '
    '; - } else { - $output .= '
    '; - } - - if ( $extendedPresent ) { - $output .= ''; - } - - $output .= self::_drawHeader( $kintVar ) . $kintVar->value . '
    '; - - - if ( $extendedPresent ) { - $output .= '
    '; - } - - if ( isset( $kintVar->extendedValue ) ) { - - if ( is_array( $kintVar->extendedValue ) ) { - foreach ( $kintVar->extendedValue as $v ) { - $output .= self::decorate( $v ); - } - } elseif ( is_string( $kintVar->extendedValue ) ) { - $output .= '
    ' . $kintVar->extendedValue . '
    '; - } else { - $output .= self::decorate( $kintVar->extendedValue ); //it's kint's container - } - - } elseif ( isset( $kintVar->_alternatives ) ) { - $output .= "
      "; - - foreach ( $kintVar->_alternatives as $k => $var ) { - $active = $k === 0 ? ' class="kint-active-tab"' : ''; - $output .= "" . self::_drawHeader( $var, false ) . ''; - } - - $output .= "
      "; - - foreach ( $kintVar->_alternatives as $var ) { - $output .= "
    • "; - - $var = $var->value; - - if ( is_array( $var ) ) { - foreach ( $var as $v ) { - $output .= is_string( $v ) - ? '
      ' . $v . '
      ' - : self::decorate( $v ); - } - } elseif ( is_string( $var ) ) { - $output .= '
      ' . $var . '
      '; - } elseif ( isset( $var ) ) { - throw new Exception( - 'Kint has encountered an error, ' - . 'please paste this report to https://github.com/raveren/kint/issues
      ' - . 'Error encountered at ' . basename( __FILE__ ) . ':' . __LINE__ . '
      ' - . ' variables: ' - . htmlspecialchars( var_export( $kintVar->_alternatives, true ), ENT_QUOTES ) - ); - } - - $output .= "
    • "; - } - - $output .= "
    "; - } - if ( $extendedPresent ) { - $output .= '
    '; - } - - $output .= ''; - - return $output; - } - - public static function decorateTrace( $traceData ) - { - $output = '
    '; - - foreach ( $traceData as $i => $step ) { - $class = 'kint-parent'; - if ( Kint::$expandedByDefault ) { - $class .= ' kint-show'; - } - - $output .= '
    ' - . '' . ( $i + 1 ) . ' ' - . '' - . ''; - - if ( isset( $step['file'] ) ) { - $output .= self::_ideLink( $step['file'], $step['line'] ); - } else { - $output .= 'PHP internal call'; - } - - $output .= ''; - - $output .= $step['function']; - - if ( isset( $step['args'] ) ) { - $output .= '(' . implode( ', ', array_keys( $step['args'] ) ) . ')'; - } - $output .= '
    '; - $firstTab = ' class="kint-active-tab"'; - $output .= '
      '; - - if ( !empty( $step['source'] ) ) { - $output .= "Source"; - $firstTab = ''; - } - - if ( !empty( $step['args'] ) ) { - $output .= "Arguments"; - $firstTab = ''; - } - - if ( !empty( $step['object'] ) ) { - kintParser::reset(); - $calleeDump = kintParser::factory( $step['object'] ); - - $output .= "Callee object [{$calleeDump->type}]"; - } - - - $output .= '
      '; - - - if ( !empty( $step['source'] ) ) { - $output .= "
    • {$step['source']}
    • "; - } - - if ( !empty( $step['args'] ) ) { - $output .= "
    • "; - foreach ( $step['args'] as $k => $arg ) { - kintParser::reset(); - $output .= self::decorate( kintParser::factory( $arg, $k ) ); - } - $output .= "
    • "; - } - if ( !empty( $step['object'] ) ) { - $output .= "
    • " . self::decorate( $calleeDump ) . "
    • "; - } - - $output .= '
    '; - } - $output .= '
    '; - - return $output; - } - - - /** - * called for each dump, opens the html tag - * - * @param array $callee caller information taken from debug backtrace - * - * @return string - */ - public static function wrapStart() - { - return "
    "; - } - - - /** - * closes Kint::_wrapStart() started html tags and displays callee information - * - * @param array $callee caller information taken from debug backtrace - * @param array $miniTrace full path to kint call - * @param array $prevCaller previous caller information taken from debug backtrace - * - * @return string - */ - public static function wrapEnd( $callee, $miniTrace, $prevCaller ) - { - if ( !Kint::$displayCalledFrom ) { - return '
    '; - } - - $callingFunction = ''; - $calleeInfo = ''; - $traceDisplay = ''; - if ( isset( $prevCaller['class'] ) ) { - $callingFunction = $prevCaller['class']; - } - if ( isset( $prevCaller['type'] ) ) { - $callingFunction .= $prevCaller['type']; - } - if ( isset( $prevCaller['function'] ) - && !in_array( $prevCaller['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) - ) { - $callingFunction .= $prevCaller['function'] . '()'; - } - $callingFunction and $callingFunction = " [{$callingFunction}]"; - - - if ( isset( $callee['file'] ) ) { - $calleeInfo .= 'Called from ' . self::_ideLink( $callee['file'], $callee['line'] ); - } - - if ( !empty( $miniTrace ) ) { - $traceDisplay = '
      '; - foreach ( $miniTrace as $step ) { - $traceDisplay .= '
    1. ' . self::_ideLink( $step['file'], $step['line'] ); // closing tag not required - if ( isset( $step['function'] ) - && !in_array( $step['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) - ) { - $classString = ' ['; - if ( isset( $step['class'] ) ) { - $classString .= $step['class']; - } - if ( isset( $step['type'] ) ) { - $classString .= $step['type']; - } - $classString .= $step['function'] . '()]'; - $traceDisplay .= $classString; - } - } - $traceDisplay .= '
    '; - - $calleeInfo = '' . $calleeInfo; - } - - - return "
    " - . ' ' - . "{$calleeInfo}{$callingFunction}{$traceDisplay}" - . "
    "; - } - - - private static function _drawHeader( kintVariableData $kintVar, $verbose = true ) - { - $output = ''; - if ( $verbose ) { - if ( $kintVar->access !== null ) { - $output .= "" . $kintVar->access . " "; - } - - if ( $kintVar->name !== null && $kintVar->name !== '' ) { - $output .= "" . kintParser::escape( $kintVar->name ) . " "; - } - - if ( $kintVar->operator !== null ) { - $output .= $kintVar->operator . " "; - } - } - - if ( $kintVar->type !== null ) { - if ( $verbose ) { - $output .= ""; - } - - $output .= $kintVar->type; - - if ( $verbose ) { - $output .= ""; - } else { - $output .= " "; - } - } - - - if ( $kintVar->size !== null ) { - $output .= "(" . $kintVar->size . ") "; - } - - return $output; - } - - private static function _ideLink( $file, $line ) - { - $shortenedPath = Kint::shortenPath( $file ); - if ( !Kint::$fileLinkFormat ) return $shortenedPath . ':' . $line; - - $ideLink = Kint::getIdeLink( $file, $line ); - $class = ( strpos( $ideLink, 'http://' ) === 0 ) ? 'class="kint-ide-link" ' : ''; - return "{$shortenedPath}:{$line}"; - } - - - /** - * produces css and js required for display. May be called multiple times, will only produce output once per - * pageload or until `-` or `@` modifier is used - * - * @return string - */ - public static function init() - { - $baseDir = KINT_DIR . 'view/compiled/'; - - if ( !is_readable( $cssFile = $baseDir . Kint::$theme . '.css' ) ) { - $cssFile = $baseDir . 'original.css'; - } - - return - '' - . '\n"; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/examples/overview.php b/sites/all/modules/contrib/dev/devel/kint/kint/examples/overview.php deleted file mode 100644 index 70f5be919..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/examples/overview.php +++ /dev/null @@ -1,176 +0,0 @@ -additionalData = $data; } - - /** - * @return \DateTime date object - */ - public function getCreatedDate() { } - - /** - * @param \DateTime $date - */ - public function setCreatedDate( DateTime $date ) { $this->createdDate = $date; } - - /** - * Dummy method that triggers trace - */ - public function ensure() { Kint::trace(); } -} - -class UserManager -{ - private $user; - - /** - * Get user from manager - */ - public function getUser() { return $this->user; } - - /** - * Debug specific user - * - * @param \User $user - */ - public function debugUser( $user ) - { - $this->user = $user; - d( $this->getUser() ); - } - - /** - * Ensure user (triggers ensure() method on \User object that trace) - * - * @void - */ - public function ensureUser() { $this->user->ensure(); } -} - -$user = new User; -$user->setAdditionalData( array( - 'last_login' => new DateTime(), - 'current_unix_timestamp' => time(), - 'random_rgb_color_code' => '#FF9900', - 'impressions' => 60, - 'nickname' => 'Someuser', - ) -); -$user->setCreatedDate( new DateTime( '2013-10-10' ) ); -$userManager = new UserManager(); - -for ( $i = 1; $i < 6; $i++ ) { - $tabularData[] = array( - 'date' => "2013-01-0{$i}", - 'allowed' => $i % 3 == 0, - 'action' => "action {$i}", - 'clicks' => rand( 100, 50000 ), - 'impressions' => rand( 10000, 500000 ), - ); - - if ( $i % 2 == 0 ) { - unset( $tabularData[ $i - 1 ]['clicks'] ); - } -} - -$nestedArray = array(); - -for ( $i = 1; $i < 6; $i++ ) { - $nestedArray["user group {$i}"] = array( - "user {$i}" => array( - 'name' => "Name {$i}", - 'surname' => "Surname {$i}" - ), - - 'data' => array( - 'conversions' => rand( 100, 5000 ), - 'spent' => array( 'currency' => 'EUR', 'amount' => rand( 10000, 500000 ) ) - ), - ); -} -?> - - - Kint PHP debugging tool - overview - - -
    - - -

    Kint PHP debugging tool - overview

    -
    -

    Debug variables

    -debugUser( $user ); -d( $userManager, $tabularData ); -d( $nestedArray ); -?> -

    Trace

    -ensureUser(); ?> - - \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/inc/kintObject.class.php b/sites/all/modules/contrib/dev/devel/kint/kint/inc/kintObject.class.php deleted file mode 100644 index 63651237f..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/inc/kintObject.class.php +++ /dev/null @@ -1,19 +0,0 @@ - self::$_level, - 'objects' => self::$_objects, - ); - - self::$_level++; - - $varData = new kintVariableData; - $varData->name = $name; - - # first parse the variable based on its type - $varType = gettype( $variable ); - $varType === 'unknown type' and $varType = 'unknown'; # PHP 5.4 inconsistency - $methodName = '_parse_' . $varType; - - # objects can be presented in a different way altogether, INSTEAD, not ALONGSIDE the generic parser - if ( $varType === 'object' ) { - foreach ( self::$_objectParsers as $parserClass ) { - $className = 'Kint_Objects_' . $parserClass; - - /** @var $object KintObject */ - $object = new $className; - if ( ( $alternativeTabs = $object->parse( $variable ) ) !== false ) { - self::$_skipAlternatives = true; - $alternativeDisplay = new kintVariableData; - $alternativeDisplay->type = $object->name; - $alternativeDisplay->value = $object->value; - $alternativeDisplay->name = $name; - - foreach ( $alternativeTabs as $name => $values ) { - $alternative = kintParser::factory( $values ); - $alternative->type = $name; - if ( Kint::enabled() === Kint::MODE_RICH ) { - empty( $alternative->value ) and $alternative->value = $alternative->extendedValue; - $alternativeDisplay->_alternatives[] = $alternative; - } else { - $alternativeDisplay->extendedValue[] = $alternative; - } - } - - self::$_skipAlternatives = false; - self::$_level = $revert['level']; - self::$_objects = $revert['objects']; - return $alternativeDisplay; - } - } - } - - # base type parser returning false means "stop processing further": e.g. recursion - if ( self::$methodName( $variable, $varData ) === false ) { - self::$_level--; - return $varData; - } - - if ( Kint::enabled() === Kint::MODE_RICH && !self::$_skipAlternatives ) { - # if an alternative returns something that can be represented in an alternative way, don't :) - self::$_skipAlternatives = true; - - # now check whether the variable can be represented in a different way - foreach ( self::$_customDataTypes as $parserClass ) { - $className = 'Kint_Parsers_' . $parserClass; - - /** @var $parser kintParser */ - $parser = new $className; - $parser->name = $name; # the parser may overwrite the name value, so set it first - - if ( $parser->_parse( $variable ) !== false ) { - $varData->_alternatives[] = $parser; - } - } - - - # if alternatives exist, push extendedValue to their front and display it as one of alternatives - if ( !empty( $varData->_alternatives ) && isset( $varData->extendedValue ) ) { - $_ = new kintVariableData; - - $_->value = $varData->extendedValue; - $_->type = 'contents'; - $_->size = null; - - array_unshift( $varData->_alternatives, $_ ); - $varData->extendedValue = null; - } - - self::$_skipAlternatives = false; - } - - self::$_level = $revert['level']; - self::$_objects = $revert['objects']; - - if ( strlen( $varData->name ) > 80 ) { - $varData->name = - self::_substr( $varData->name, 0, 37 ) - . '...' - . self::_substr( $varData->name, -38, null ); - } - return $varData; - } - - private static function _checkDepth() - { - return Kint::$maxLevels != 0 && self::$_level >= Kint::$maxLevels; - } - - private static function _isArrayTabular( array $variable ) - { - if ( Kint::enabled() !== Kint::MODE_RICH ) return false; - - $arrayKeys = array(); - $keys = null; - $closeEnough = false; - foreach ( $variable as $row ) { - if ( !is_array( $row ) || empty( $row ) ) return false; - - foreach ( $row as $col ) { - if ( !empty( $col ) && !is_scalar( $col ) ) return false; // todo add tabular "tolerance" - } - - if ( isset( $keys ) && !$closeEnough ) { - # let's just see if the first two rows have same keys, that's faster and has the - # positive side effect of easily spotting missing keys in later rows - if ( $keys !== array_keys( $row ) ) return false; - - $closeEnough = true; - } else { - $keys = array_keys( $row ); - } - - $arrayKeys = array_unique( array_merge( $arrayKeys, $keys ) ); - } - - return $arrayKeys; - } - - private static function _decorateCell( kintVariableData $kintVar ) - { - if ( $kintVar->extendedValue !== null || !empty( $kintVar->_alternatives ) ) { - return '' . Kint_Decorators_Rich::decorate( $kintVar ) . ''; - } - - $output = 'value !== null ) { - $output .= ' title="' . $kintVar->type; - - if ( $kintVar->size !== null ) { - $output .= " (" . $kintVar->size . ")"; - } - - $output .= '">' . $kintVar->value; - } else { - $output .= '>'; - - if ( $kintVar->type !== 'NULL' ) { - $output .= '' . $kintVar->type; - - if ( $kintVar->size !== null ) { - $output .= "(" . $kintVar->size . ")"; - } - - $output .= ''; - } else { - $output .= 'NULL'; - } - } - - - return $output . ''; - } - - - public static function escape( $value, $encoding = null ) - { - if ( empty( $value ) ) return $value; - - if ( Kint::enabled() === Kint::MODE_CLI ) { - $value = str_replace( "\x1b", "\\x1b", $value ); - } - - if ( Kint::enabled() === Kint::MODE_CLI || Kint::enabled() === Kint::MODE_WHITESPACE ) return $value; - - $encoding or $encoding = self::_detectEncoding( $value ); - $value = htmlspecialchars( $value, ENT_NOQUOTES, $encoding === 'ASCII' ? 'UTF-8' : $encoding ); - - - if ( $encoding === 'UTF-8' ) { - // todo we could make the symbols hover-title show the code for the invisible symbol - # when possible force invisible characters to have some sort of display (experimental) - $value = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/u', '?', $value ); - } - - # this call converts all non-ASCII characters into html chars of format - if ( function_exists( 'mb_encode_numericentity' ) ) { - $value = mb_encode_numericentity( - $value, - array( 0x80, 0xffff, 0, 0xffff, ), - $encoding - ); - } - - return $value; - } - - - private static $_dealingWithGlobals = false; - - private static function _parse_array( &$variable, kintVariableData $variableData ) - { - isset( self::$_marker ) or self::$_marker = "\x00" . uniqid(); - - # naturally, $GLOBALS variable is an intertwined recursion nightmare, use black magic - $globalsDetector = false; - if ( array_key_exists( 'GLOBALS', $variable ) && is_array( $variable['GLOBALS'] ) ) { - $globalsDetector = "\x01" . uniqid(); - - $variable['GLOBALS'][ $globalsDetector ] = true; - if ( isset( $variable[ $globalsDetector ] ) ) { - unset( $variable[ $globalsDetector ] ); - self::$_dealingWithGlobals = true; - } else { - unset( $variable['GLOBALS'][ $globalsDetector ] ); - $globalsDetector = false; - } - } - - $variableData->type = 'array'; - $variableData->size = count( $variable ); - - if ( $variableData->size === 0 ) { - return; - } - if ( isset( $variable[ self::$_marker ] ) ) { # recursion; todo mayhaps show from where - if ( self::$_dealingWithGlobals ) { - $variableData->value = '*RECURSION*'; - } else { - unset( $variable[ self::$_marker ] ); - $variableData->value = self::$_marker; - } - return false; - } - if ( self::_checkDepth() ) { - $variableData->extendedValue = "*DEPTH TOO GREAT*"; - return false; - } - - $isSequential = self::_isSequential( $variable ); - - if ( $variableData->size > 1 && ( $arrayKeys = self::_isArrayTabular( $variable ) ) !== false ) { - $variable[ self::$_marker ] = true; # this must be AFTER _isArrayTabular - $firstRow = true; - $extendedValue = ''; - - foreach ( $variable as $rowIndex => & $row ) { - # display strings in their full length - self::$_placeFullStringInValue = true; - - if ( $rowIndex === self::$_marker ) continue; - - if ( isset( $row[ self::$_marker ] ) ) { - $variableData->value = "*RECURSION*"; - return false; - } - - - $extendedValue .= ''; - if ( $isSequential ) { - $output = ''; - } else { - $output = self::_decorateCell( kintParser::factory( $rowIndex ) ); - } - if ( $firstRow ) { - $extendedValue .= ''; - } - - # we iterate the known full set of keys from all rows in case some appeared at later rows, - # as we only check the first two to assume - foreach ( $arrayKeys as $key ) { - if ( $firstRow ) { - $extendedValue .= ''; - } - - if ( !array_key_exists( $key, $row ) ) { - $output .= ''; - continue; - } - - $var = kintParser::factory( $row[ $key ] ); - - if ( $var->value === self::$_marker ) { - $variableData->value = '*RECURSION*'; - return false; - } elseif ( $var->value === '*RECURSION*' ) { - $output .= ''; - } else { - $output .= self::_decorateCell( $var ); - } - unset( $var ); - } - - if ( $firstRow ) { - $extendedValue .= ''; - $firstRow = false; - } - - $extendedValue .= $output . ''; - } - self::$_placeFullStringInValue = false; - - $variableData->extendedValue = $extendedValue . '
    ' . '#' . ( $rowIndex + 1 ) . ' ' . self::escape( $key ) . '*RECURSION*
    '; - - } else { - $variable[ self::$_marker ] = true; - $extendedValue = array(); - - foreach ( $variable as $key => & $val ) { - if ( $key === self::$_marker ) continue; - - $output = kintParser::factory( $val ); - if ( $output->value === self::$_marker ) { - $variableData->value = "*RECURSION*"; // recursion occurred on a higher level, thus $this is recursion - return false; - } - if ( !$isSequential ) { - $output->operator = '=>'; - } - $output->name = $isSequential ? null : "'" . $key . "'"; - $extendedValue[] = $output; - } - $variableData->extendedValue = $extendedValue; - } - - if ( $globalsDetector ) { - self::$_dealingWithGlobals = false; - } - - unset( $variable[ self::$_marker ] ); - } - - - private static function _parse_object( &$variable, kintVariableData $variableData ) - { - if ( function_exists( 'spl_object_hash' ) ) { - $hash = spl_object_hash( $variable ); - } else { - ob_start(); - var_dump( $variable ); - preg_match( '[#(\d+)]', ob_get_clean(), $match ); - $hash = $match[1]; - } - - $castedArray = (array) $variable; - $variableData->type = get_class( $variable ); - $variableData->size = count( $castedArray ); - - if ( isset( self::$_objects[ $hash ] ) ) { - $variableData->value = '*RECURSION*'; - return false; - } - if ( self::_checkDepth() ) { - $variableData->extendedValue = "*DEPTH TOO GREAT*"; - return false; - } - - - # ArrayObject (and maybe ArrayIterator, did not try yet) unsurprisingly consist of mainly dark magic. - # What bothers me most, var_dump sees no problem with it, and ArrayObject also uses a custom, - # undocumented serialize function, so you can see the properties in internal functions, but - # can never iterate some of them if the flags are not STD_PROP_LIST. Fun stuff. - if ( $variableData->type === 'ArrayObject' || is_subclass_of( $variable, 'ArrayObject' ) ) { - $arrayObjectFlags = $variable->getFlags(); - $variable->setFlags( ArrayObject::STD_PROP_LIST ); - } - - self::$_objects[ $hash ] = true; // todo store reflectorObject here for alternatives cache - $reflector = new ReflectionObject( $variable ); - - # add link to definition of userland objects - if ( Kint::enabled() === Kint::MODE_RICH && Kint::$fileLinkFormat && $reflector->isUserDefined() ) { - $url = Kint::getIdeLink( $reflector->getFileName(), $reflector->getStartLine() ); - - $class = ( strpos( $url, 'http://' ) === 0 ) ? 'class="kint-ide-link" ' : ''; - $variableData->type = "{$variableData->type}"; - } - $variableData->size = 0; - - $extendedValue = array(); - $encountered = array(); - - # copy the object as an array as it provides more info than Reflection (depends) - foreach ( $castedArray as $key => $value ) { - /* casting object to array: - * integer properties are inaccessible; - * private variables have the class name prepended to the variable name; - * protected variables have a '*' prepended to the variable name. - * These prepended values have null bytes on either side. - * http://www.php.net/manual/en/language.types.array.php#language.types.array.casting - */ - if ( $key{0} === "\x00" ) { - - $access = $key{1} === "*" ? "protected" : "private"; - - // Remove the access level from the variable name - $key = substr( $key, strrpos( $key, "\x00" ) + 1 ); - } else { - $access = "public"; - } - - $encountered[ $key ] = true; - - $output = kintParser::factory( $value, self::escape( $key ) ); - $output->access = $access; - $output->operator = '->'; - $extendedValue[] = $output; - $variableData->size++; - } - - foreach ( $reflector->getProperties() as $property ) { - $name = $property->name; - if ( $property->isStatic() || isset( $encountered[ $name ] ) ) continue; - - if ( $property->isProtected() ) { - $property->setAccessible( true ); - $access = "protected"; - } elseif ( $property->isPrivate() ) { - $property->setAccessible( true ); - $access = "private"; - } else { - $access = "public"; - } - - $value = $property->getValue( $variable ); - - $output = kintParser::factory( $value, self::escape( $name ) ); - $output->access = $access; - $output->operator = '->'; - $extendedValue[] = $output; - $variableData->size++; - } - - if ( isset( $arrayObjectFlags ) ) { - $variable->setFlags( $arrayObjectFlags ); - } - - if ( $variableData->size ) { - $variableData->extendedValue = $extendedValue; - } - } - - - private static function _parse_boolean( &$variable, kintVariableData $variableData ) - { - $variableData->type = 'bool'; - $variableData->value = $variable ? 'TRUE' : 'FALSE'; - } - - private static function _parse_double( &$variable, kintVariableData $variableData ) - { - $variableData->type = 'float'; - $variableData->value = $variable; - } - - private static function _parse_integer( &$variable, kintVariableData $variableData ) - { - $variableData->type = 'integer'; - $variableData->value = $variable; - } - - private static function _parse_null( &$variable, kintVariableData $variableData ) - { - $variableData->type = 'NULL'; - } - - private static function _parse_resource( &$variable, kintVariableData $variableData ) - { - $resourceType = get_resource_type( $variable ); - $variableData->type = "resource ({$resourceType})"; - - if ( $resourceType === 'stream' && $meta = stream_get_meta_data( $variable ) ) { - - if ( isset( $meta['uri'] ) ) { - $file = $meta['uri']; - - if ( function_exists( 'stream_is_local' ) ) { - // Only exists on PHP >= 5.2.4 - if ( stream_is_local( $file ) ) { - $file = Kint::shortenPath( $file ); - } - } - - $variableData->value = $file; - } - } - } - - private static function _parse_string( &$variable, kintVariableData $variableData ) - { - $variableData->type = 'string'; - - $encoding = self::_detectEncoding( $variable ); - if ( $encoding !== 'ASCII' ) { - $variableData->type .= ' ' . $encoding; - } - - - $variableData->size = self::_strlen( $variable, $encoding ); - if ( Kint::enabled() !== Kint::MODE_RICH ) { - $variableData->value = '"' . self::escape( $variable, $encoding ) . '"'; - return; - } - - - if ( !self::$_placeFullStringInValue ) { - - $strippedString = preg_replace( '[\s+]', ' ', $variable ); - if ( Kint::$maxStrLength && $variableData->size > Kint::$maxStrLength ) { - - // encode and truncate - $variableData->value = '"' - . self::escape( self::_substr( $strippedString, 0, Kint::$maxStrLength, $encoding ), $encoding ) - . '…"'; - $variableData->extendedValue = self::escape( $variable, $encoding ); - - return; - } elseif ( $variable !== $strippedString ) { // omit no data from display - - $variableData->value = '"' . self::escape( $variable, $encoding ) . '"'; - $variableData->extendedValue = self::escape( $variable, $encoding ); - - return; - } - } - - $variableData->value = '"' . self::escape( $variable, $encoding ) . '"'; - } - - private static function _parse_unknown( &$variable, kintVariableData $variableData ) - { - $type = gettype( $variable ); - $variableData->type = "UNKNOWN" . ( !empty( $type ) ? " ({$type})" : '' ); - $variableData->value = var_export( $variable, true ); - } - -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/inc/kintVariableData.class.php b/sites/all/modules/contrib/dev/devel/kint/kint/inc/kintVariableData.class.php deleted file mode 100644 index 3ac567ed4..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/inc/kintVariableData.class.php +++ /dev/null @@ -1,102 +0,0 @@ -getMethods() as $method ) { - $params = array(); - - // Access type - $access = implode( ' ', Reflection::getModifierNames( $method->getModifiers() ) ); - - // Method parameters - foreach ( $method->getParameters() as $param ) { - $paramString = ''; - - if ( $param->isArray() ) { - $paramString .= 'array '; - } else { - try { - if ( $paramClassName = $param->getClass() ) { - $paramString .= $paramClassName->name . ' '; - } - } catch ( ReflectionException $e ) { - preg_match( '/\[\s\<\w+?>\s([\w]+)/s', $param->__toString(), $matches ); - $paramClassName = isset( $matches[1] ) ? $matches[1] : ''; - - $paramString .= ' UNDEFINED CLASS (' . $paramClassName . ') '; - } - } - - $paramString .= ( $param->isPassedByReference() ? '&' : '' ) . '$' . $param->getName(); - - if ( $param->isDefaultValueAvailable() ) { - if ( is_array( $param->getDefaultValue() ) ) { - $arrayValues = array(); - foreach ( $param->getDefaultValue() as $key => $value ) { - $arrayValues[] = $key . ' => ' . $value; - } - - $defaultValue = 'array(' . implode( ', ', $arrayValues ) . ')'; - } elseif ( $param->getDefaultValue() === null ) { - $defaultValue = 'NULL'; - } elseif ( $param->getDefaultValue() === false ) { - $defaultValue = 'false'; - } elseif ( $param->getDefaultValue() === true ) { - $defaultValue = 'true'; - } elseif ( $param->getDefaultValue() === '' ) { - $defaultValue = '""'; - } else { - $defaultValue = $param->getDefaultValue(); - } - - $paramString .= ' = ' . $defaultValue; - } - - $params[] = $paramString; - } - - $output = new kintVariableData; - - // Simple DocBlock parser, look for @return - if ( ( $docBlock = $method->getDocComment() ) ) { - $matches = array(); - if ( preg_match_all( '/@(\w+)\s+(.*)\r?\n/m', $docBlock, $matches ) ) { - $lines = array_combine( $matches[1], $matches[2] ); - if ( isset( $lines['return'] ) ) { - $output->operator = '->'; - # since we're outputting code, assumption that the string is utf8 is most likely correct - # and saves resources - $output->type = self::escape( $lines['return'], 'UTF-8' ); - } - } - } - - $output->name = ( $method->returnsReference() ? '&' : '' ) . $method->getName() . '(' - . implode( ', ', $params ) . ')'; - $output->access = $access; - - if ( is_string( $docBlock ) ) { - $lines = array(); - foreach ( explode( "\n", $docBlock ) as $line ) { - $line = trim( $line ); - - if ( in_array( $line, array( '/**', '/*', '*/' ) ) ) { - continue; - } elseif ( strpos( $line, '*' ) === 0 ) { - $line = substr( $line, 1 ); - } - - $lines[] = self::escape( trim( $line ), 'UTF-8' ); - } - - $output->extendedValue = implode( "\n", $lines ) . "\n\n"; - } - - $declaringClass = $method->getDeclaringClass(); - $declaringClassName = $declaringClass->getName(); - - if ( $declaringClassName !== $className ) { - $output->extendedValue .= "Inherited from {$declaringClassName}\n"; - } - - $fileName = Kint::shortenPath( $method->getFileName() ) . ':' . $method->getStartLine(); - $output->extendedValue .= "Defined in {$fileName}"; - - $sortName = $access . $method->getName(); - - if ( $method->isPrivate() ) { - $private[ $sortName ] = $output; - } elseif ( $method->isProtected() ) { - $protected[ $sortName ] = $output; - } else { - $public[ $sortName ] = $output; - } - } - - if ( !$private && !$protected && !$public ) { - self::$cache[ $className ] = false; - } - - ksort( $public ); - ksort( $protected ); - ksort( $private ); - - self::$cache[ $className ] = $public + $protected + $private; - } - - if ( count( self::$cache[ $className ] ) === 0 ) { - return false; - } - - $this->value = self::$cache[ $className ]; - $this->type = 'Available methods'; - $this->size = count( self::$cache[ $className ] ); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/classstatics.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/classstatics.php deleted file mode 100644 index cde23c650..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/classstatics.php +++ /dev/null @@ -1,49 +0,0 @@ -getProperties( ReflectionProperty::IS_STATIC ) as $property ) { - if ( $property->isPrivate() ) { - if ( !method_exists( $property, 'setAccessible' ) ) { - break; - } - $property->setAccessible( true ); - $access = "private"; - } elseif ( $property->isProtected() ) { - $property->setAccessible( true ); - $access = "protected"; - } else { - $access = 'public'; - } - - $_ = $property->getValue(); - $output = kintParser::factory( $_, '$' . $property->getName() ); - - $output->access = $access; - $output->operator = '::'; - $extendedValue[] = $output; - } - - foreach ( $reflection->getConstants() as $constant => $val ) { - $output = kintParser::factory( $val, $constant ); - - $output->access = 'constant'; - $output->operator = '::'; - $extendedValue[] = $output; - } - - if ( empty( $extendedValue ) ) return false; - - $this->value = $extendedValue; - $this->type = 'Static class properties'; - $this->size = count( $extendedValue ); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/color.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/color.php deleted file mode 100644 index 5ca44d88b..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/color.php +++ /dev/null @@ -1,400 +0,0 @@ -'#f0f8ff','antiquewhite'=>'#faebd7','aqua'=>'#00ffff','aquamarine'=>'#7fffd4','azure'=>'#f0ffff', - 'beige'=>'#f5f5dc','bisque'=>'#ffe4c4','black'=>'#000000','blanchedalmond'=>'#ffebcd','blue'=>'#0000ff', - 'blueviolet'=>'#8a2be2','brown'=>'#a52a2a','burlywood'=>'#deb887','cadetblue'=>'#5f9ea0','chartreuse'=>'#7fff00', - 'chocolate'=>'#d2691e','coral'=>'#ff7f50','cornflowerblue'=>'#6495ed','cornsilk'=>'#fff8dc','crimson'=>'#dc143c', - 'cyan'=>'#00ffff','darkblue'=>'#00008b','darkcyan'=>'#008b8b','darkgoldenrod'=>'#b8860b','darkgray'=>'#a9a9a9', - 'darkgrey'=>'#a9a9a9','darkgreen'=>'#006400','darkkhaki'=>'#bdb76b','darkmagenta'=>'#8b008b', - 'darkolivegreen'=>'#556b2f','darkorange'=>'#ff8c00','darkorchid'=>'#9932cc','darkred'=>'#8b0000', - 'darksalmon'=>'#e9967a','darkseagreen'=>'#8fbc8f','darkslateblue'=>'#483d8b','darkslategray'=>'#2f4f4f', - 'darkslategrey'=>'#2f4f4f','darkturquoise'=>'#00ced1','darkviolet'=>'#9400d3','deeppink'=>'#ff1493', - 'deepskyblue'=>'#00bfff','dimgray'=>'#696969','dimgrey'=>'#696969','dodgerblue'=>'#1e90ff', - 'firebrick'=>'#b22222','floralwhite'=>'#fffaf0','forestgreen'=>'#228b22','fuchsia'=>'#ff00ff', - 'gainsboro'=>'#dcdcdc','ghostwhite'=>'#f8f8ff','gold'=>'#ffd700','goldenrod'=>'#daa520','gray'=>'#808080', - 'grey'=>'#808080','green'=>'#008000','greenyellow'=>'#adff2f','honeydew'=>'#f0fff0','hotpink'=>'#ff69b4', - 'indianred'=>'#cd5c5c','indigo'=>'#4b0082','ivory'=>'#fffff0','khaki'=>'#f0e68c','lavender'=>'#e6e6fa', - 'lavenderblush'=>'#fff0f5','lawngreen'=>'#7cfc00','lemonchiffon'=>'#fffacd','lightblue'=>'#add8e6', - 'lightcoral'=>'#f08080','lightcyan'=>'#e0ffff','lightgoldenrodyellow'=>'#fafad2','lightgray'=>'#d3d3d3', - 'lightgrey'=>'#d3d3d3','lightgreen'=>'#90ee90','lightpink'=>'#ffb6c1','lightsalmon'=>'#ffa07a', - 'lightseagreen'=>'#20b2aa','lightskyblue'=>'#87cefa','lightslategray'=>'#778899','lightslategrey'=>'#778899', - 'lightsteelblue'=>'#b0c4de','lightyellow'=>'#ffffe0','lime'=>'#00ff00','limegreen'=>'#32cd32','linen'=>'#faf0e6', - 'magenta'=>'#ff00ff','maroon'=>'#800000','mediumaquamarine'=>'#66cdaa','mediumblue'=>'#0000cd', - 'mediumorchid'=>'#ba55d3','mediumpurple'=>'#9370d8','mediumseagreen'=>'#3cb371','mediumslateblue'=>'#7b68ee', - 'mediumspringgreen'=>'#00fa9a','mediumturquoise'=>'#48d1cc','mediumvioletred'=>'#c71585', - 'midnightblue'=>'#191970','mintcream'=>'#f5fffa','mistyrose'=>'#ffe4e1','moccasin'=>'#ffe4b5', - 'navajowhite'=>'#ffdead','navy'=>'#000080','oldlace'=>'#fdf5e6','olive'=>'#808000','olivedrab'=>'#6b8e23', - 'orange'=>'#ffa500','orangered'=>'#ff4500','orchid'=>'#da70d6','palegoldenrod'=>'#eee8aa','palegreen'=>'#98fb98', - 'paleturquoise'=>'#afeeee','palevioletred'=>'#d87093','papayawhip'=>'#ffefd5','peachpuff'=>'#ffdab9', - 'peru'=>'#cd853f','pink'=>'#ffc0cb','plum'=>'#dda0dd','powderblue'=>'#b0e0e6','purple'=>'#800080', - 'red'=>'#ff0000','rosybrown'=>'#bc8f8f','royalblue'=>'#4169e1','saddlebrown'=>'#8b4513','salmon'=>'#fa8072', - 'sandybrown'=>'#f4a460','seagreen'=>'#2e8b57','seashell'=>'#fff5ee','sienna'=>'#a0522d','silver'=>'#c0c0c0', - 'skyblue'=>'#87ceeb','slateblue'=>'#6a5acd','slategray'=>'#708090','slategrey'=>'#708090','snow'=>'#fffafa', - 'springgreen'=>'#00ff7f','steelblue'=>'#4682b4','tan'=>'#d2b48c','teal'=>'#008080','thistle'=>'#d8bfd8', - 'tomato'=>'#ff6347','turquoise'=>'#40e0d0','violet'=>'#ee82ee','wheat'=>'#f5deb3','white'=>'#ffffff', - 'whitesmoke'=>'#f5f5f5','yellow'=>'#ffff00','yellowgreen'=>'#9acd32' - ); - - - protected function _parse( & $variable ) - { - if ( !self::_fits( $variable ) ) return false; - - $this->type = 'CSS color'; - $variants = self::_convert( $variable ); - $this->value = - "
    {$variable}
    " - . "hex : {$variants['hex']}\n" - . "rgb : {$variants['rgb']}\n" - . ( isset( $variants['name'] ) ? "name: {$variants['name']}\n" : '' ) - . "hsl : {$variants['hsl']}"; - } - - - private static function _fits( $variable ) - { - if ( !is_string( $variable ) ) return false; - - $var = strtolower( trim( $variable ) ); - - return isset( self::$_css3Named[$var] ) - || preg_match( - '/^(?:#[0-9A-Fa-f]{3}|#[0-9A-Fa-f]{6}|(?:rgb|hsl)a?\s*\((?:\s*[0-9.%]+\s*,?){3,4}\))$/', - $var - ); - } - - private static function _convert( $color ) - { - $color = strtolower( $color ); - $decimalColors = array(); - $variants = array( - 'hex' => null, - 'rgb' => null, - 'name' => null, - 'hsl' => null, - ); - - if ( isset( self::$_css3Named[ $color ] ) ) { - $variants['name'] = $color; - $color = self::$_css3Named[ $color ]; - } - - if ( $color{0} === '#' ) { - $variants['hex'] = $color; - $color = substr( $color, 1 ); - if ( strlen( $color ) === 6 ) { - $colors = str_split( $color, 2 ); - } else { - $colors = array( - $color{0} . $color{0}, - $color{1} . $color{1}, - $color{2} . $color{2}, - ); - } - - $decimalColors = array_map( 'hexdec', $colors ); - } elseif ( substr( $color, 0, 3 ) === 'rgb' ) { - $variants['rgb'] = $color; - preg_match_all( '#([0-9.%]+)#', $color, $matches ); - $decimalColors = $matches[1]; - foreach ( $decimalColors as &$color ) { - if ( strpos( $color, '%' ) !== false ) { - $color = str_replace( '%', '', $color ) * 2.55; - } - } - - - } elseif ( substr( $color, 0, 3 ) === 'hsl' ) { - $variants['hsl'] = $color; - preg_match_all( '#([0-9.%]+)#', $color, $matches ); - - $colors = $matches[1]; - $colors[0] /= 360; - $colors[1] = str_replace( '%', '', $colors[1] ) / 100; - $colors[2] = str_replace( '%', '', $colors[2] ) / 100; - - $decimalColors = self::_HSLtoRGB( $colors ); - if ( isset( $colors[3] ) ) { - $decimalColors[] = $colors[3]; - } - } - - if ( isset( $decimalColors[3] ) ) { - $alpha = $decimalColors[3]; - unset( $decimalColors[3] ); - } else { - $alpha = null; - } - foreach ( $variants as $type => &$variant ) { - if ( isset( $variant ) ) continue; - - switch ( $type ) { - case 'hex': - $variant = '#'; - foreach ( $decimalColors as &$color ) { - $variant .= str_pad( dechex( $color ), 2, "0", STR_PAD_LEFT ); - } - $variant .= isset( $alpha ) ? ' (alpha omitted)' : ''; - break; - case 'rgb': - $rgb = $decimalColors; - if ( isset( $alpha ) ) { - $rgb[] = $alpha; - $a = 'a'; - } else { - $a = ''; - } - $variant = "rgb{$a}( " . implode( ', ', $rgb ) . " )"; - break; - case 'hsl': - $rgb = self::_RGBtoHSL( $decimalColors ); - if ( $rgb === null ) { - unset( $variants[ $type ] ); - break; - } - if ( isset( $alpha ) ) { - $rgb[] = $alpha; - $a = 'a'; - } else { - $a = ''; - } - - $variant = "hsl{$a}( " . implode( ', ', $rgb ) . " )"; - break; - case 'name': - // [!] name in initial variants array must go after hex - if ( ( $key = array_search( $variants['hex'], self::$_css3Named, true ) ) !== false ) { - $variant = $key; - } else { - unset( $variants[ $type ] ); - } - break; - } - - } - - return $variants; - } - - - private static function _HSLtoRGB( array $hsl ) - { - list( $h, $s, $l ) = $hsl; - $m2 = ( $l <= 0.5 ) ? $l * ( $s + 1 ) : $l + $s - $l * $s; - $m1 = $l * 2 - $m2; - return array( - round( self::_hue2rgb( $m1, $m2, $h + 0.33333 ) * 255 ), - round( self::_hue2rgb( $m1, $m2, $h ) * 255 ), - round( self::_hue2rgb( $m1, $m2, $h - 0.33333 ) * 255 ), - ); - } - - - /** - * Helper function for _color_hsl2rgb(). - */ - private static function _hue2rgb( $m1, $m2, $h ) - { - $h = ( $h < 0 ) ? $h + 1 : ( ( $h > 1 ) ? $h - 1 : $h ); - if ( $h * 6 < 1 ) return $m1 + ( $m2 - $m1 ) * $h * 6; - if ( $h * 2 < 1 ) return $m2; - if ( $h * 3 < 2 ) return $m1 + ( $m2 - $m1 ) * ( 0.66666 - $h ) * 6; - return $m1; - } - - - private static function _RGBtoHSL( array $rgb ) - { - list( $clrR, $clrG, $clrB ) = $rgb; - - $clrMin = min( $clrR, $clrG, $clrB ); - $clrMax = max( $clrR, $clrG, $clrB ); - $deltaMax = $clrMax - $clrMin; - - $L = ( $clrMax + $clrMin ) / 510; - - if ( 0 == $deltaMax ) { - $H = 0; - $S = 0; - } else { - if ( 0.5 > $L ) { - $S = $deltaMax / ( $clrMax + $clrMin ); - } else { - $S = $deltaMax / ( 510 - $clrMax - $clrMin ); - } - - if ( $clrMax == $clrR ) { - $H = ( $clrG - $clrB ) / ( 6.0 * $deltaMax ); - } else if ( $clrMax == $clrG ) { - $H = 1 / 3 + ( $clrB - $clrR ) / ( 6.0 * $deltaMax ); - } else { - $H = 2 / 3 + ( $clrR - $clrG ) / ( 6.0 * $deltaMax ); - } - - if ( 0 > $H ) $H += 1; - if ( 1 < $H ) $H -= 1; - } - return array( - round( $H * 360 ), - round( $S * 100 ) . '%', - round( $L * 100 ) . '%' - ); - - } -} - -/* ************* - * TEST DATA - * -dd(array( -'hsl(0, 100%,50%)', -'hsl(30, 100%,50%)', -'hsl(60, 100%,50%)', -'hsl(90, 100%,50%)', -'hsl(120,100%,50%)', -'hsl(150,100%,50%)', -'hsl(180,100%,50%)', -'hsl(210,100%,50%)', -'hsl(240,100%,50%)', -'hsl(270,100%,50%)', -'hsl(300,100%,50%)', -'hsl(330,100%,50%)', -'hsl(360,100%,50%)', -'hsl(120,100%,25%)', -'hsl(120,100%,50%)', -'hsl(120,100%,75%)', -'hsl(120,100%,50%)', -'hsl(120, 67%,50%)', -'hsl(120, 33%,50%)', -'hsl(120, 0%,50%)', -'hsl(120, 60%,70%)', -'#f03', -'#F03', -'#ff0033', -'#FF0033', -'rgb(255,0,51)', -'rgb(255, 0, 51)', -'rgb(100%,0%,20%)', -'rgb(100%, 0%, 20%)', -'hsla(240,100%,50%,0.05)', -'hsla(240,100%,50%, 0.4)', -'hsla(240,100%,50%, 0.7)', -'hsla(240,100%,50%, 1)', -'rgba(255,0,0,0.1)', -'rgba(255,0,0,0.4)', -'rgba(255,0,0,0.7)', -'rgba(255,0,0, 1)', -'black', -'silver', -'gray', -'white', -'maroon', -'red', -'purple', -'fuchsia', -'green', -'lime', -'olive', -'yellow', -'navy', -'blue', -'teal', -'aqua', -'orange', -'aliceblue', -'antiquewhite', -'aquamarine', -'azure', -'beige', -'bisque', -'blanchedalmond', -'blueviolet', -'brown', -'burlywood', -'cadetblue', -'chartreuse', -'chocolate', -'coral', -'cornflowerblue', -'cornsilk', -'crimson', -'darkblue', -'darkcyan', -'darkgoldenrod', -'darkgray', -'darkgreen', -'darkgrey', -'darkkhaki', -'darkmagenta', -'darkolivegreen', -'darkorange', -'darkorchid', -'darkred', -'darksalmon', -'darkseagreen', -'darkslateblue', -'darkslategray', -'darkslategrey', -'darkturquoise', -'darkviolet', -'deeppink', -'deepskyblue', -'dimgray', -'dimgrey', -'dodgerblue', -'firebrick', -'floralwhite', -'forestgreen', -'gainsboro', -'ghostwhite', -'gold', -'goldenrod', -'greenyellow', -'grey', -'honeydew', -'hotpink', -'indianred', -'indigo', -'ivory', -'khaki', -'lavender', -'lavenderblush', -'lawngreen', -'lemonchiffon', -'lightblue', -'lightcoral', -'lightcyan', -'lightgoldenrodyellow', -'lightgray', -'lightgreen', -'lightgrey', -'lightpink', -'lightsalmon', -'lightseagreen', -'lightskyblue', -'lightslategray', -'lightslategrey', -'lightsteelblue', -'lightyellow', -'limegreen', -'linen', -'mediumaquamarine', -'mediumblue', -'mediumorchid', -'mediumpurple', -'mediumseagreen', -'mediumslateblue', -'mediumspringgreen', -'mediumturquoise', -'mediumvioletred', -'midnightblue', -'mintcream', -'mistyrose', -'moccasin', -'navajowhite', -'oldlace', -'olivedrab', -));*/ \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/fspath.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/fspath.php deleted file mode 100644 index 0610391cd..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/fspath.php +++ /dev/null @@ -1,69 +0,0 @@ - 2048 - || preg_match( '[[:?<>"*|]]', $variable ) - || !@is_readable( $variable ) # f@#! PHP and its random warnings - ) return false; - - try { - $fileInfo = new SplFileInfo( $variable ); - $flags = array(); - $perms = $fileInfo->getPerms(); - - if ( ( $perms & 0xC000 ) === 0xC000 ) { - $type = 'File socket'; - $flags[] = 's'; - } elseif ( ( $perms & 0xA000 ) === 0xA000 ) { - $type = 'File symlink'; - $flags[] = 'l'; - } elseif ( ( $perms & 0x8000 ) === 0x8000 ) { - $type = 'File'; - $flags[] = '-'; - } elseif ( ( $perms & 0x6000 ) === 0x6000 ) { - $type = 'Block special file'; - $flags[] = 'b'; - } elseif ( ( $perms & 0x4000 ) === 0x4000 ) { - $type = 'Directory'; - $flags[] = 'd'; - } elseif ( ( $perms & 0x2000 ) === 0x2000 ) { - $type = 'Character special file'; - $flags[] = 'c'; - } elseif ( ( $perms & 0x1000 ) === 0x1000 ) { - $type = 'FIFO pipe file'; - $flags[] = 'p'; - } else { - $type = 'Unknown file'; - $flags[] = 'u'; - } - - // owner - $flags[] = ( ( $perms & 0x0100 ) ? 'r' : '-' ); - $flags[] = ( ( $perms & 0x0080 ) ? 'w' : '-' ); - $flags[] = ( ( $perms & 0x0040 ) ? ( ( $perms & 0x0800 ) ? 's' : 'x' ) : ( ( $perms & 0x0800 ) ? 'S' : '-' ) ); - - // group - $flags[] = ( ( $perms & 0x0020 ) ? 'r' : '-' ); - $flags[] = ( ( $perms & 0x0010 ) ? 'w' : '-' ); - $flags[] = ( ( $perms & 0x0008 ) ? ( ( $perms & 0x0400 ) ? 's' : 'x' ) : ( ( $perms & 0x0400 ) ? 'S' : '-' ) ); - - // world - $flags[] = ( ( $perms & 0x0004 ) ? 'r' : '-' ); - $flags[] = ( ( $perms & 0x0002 ) ? 'w' : '-' ); - $flags[] = ( ( $perms & 0x0001 ) ? ( ( $perms & 0x0200 ) ? 't' : 'x' ) : ( ( $perms & 0x0200 ) ? 'T' : '-' ) ); - - $this->type = $type; - $this->size = sprintf( '%.2fK', $fileInfo->getSize() / 1024 ); - $this->value = implode( $flags ); - - } catch ( Exception $e ) { - return false; - } - - } -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/json.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/json.php deleted file mode 100644 index f752a214c..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/json.php +++ /dev/null @@ -1,19 +0,0 @@ -value = kintParser::factory( $val )->extendedValue; - $this->type = 'JSON'; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/microtime.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/microtime.php deleted file mode 100644 index 2c5fe68fa..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/microtime.php +++ /dev/null @@ -1,60 +0,0 @@ -value = @date( 'Y-m-d H:i:s', $sec ) . '.' . substr( $usec, 2, 4 ); - - $numberOfCalls = count( self::$_times ); - if ( $numberOfCalls > 0 ) { # meh, faster than count($times) > 1 - $lap = $time - end( self::$_times ); - self::$_laps[] = $lap; - - $this->value .= "\nSINCE LAST CALL: " . round( $lap, 4 ) . 's.'; - if ( $numberOfCalls > 1 ) { - $this->value .= "\nSINCE START: " . round( $time - self::$_times[0], 4 ) . 's.'; - $this->value .= "\nAVERAGE DURATION: " - . round( array_sum( self::$_laps ) / $numberOfCalls, 4 ) . 's.'; - } - } - - $unit = array( 'B', 'KB', 'MB', 'GB', 'TB' ); - if ( KINT_PHP53 ) { - $this->value .= "\nMEMORY USAGE: " . $size . " bytes (" - . round( $size / pow( 1024, ( $i = floor( log( $size, 1024 ) ) ) ), 3 ) . ' ' . $unit[ $i ] . ")"; - } - - self::$_times[] = $time; - $this->type = 'Stats'; - } - - /* - function test() { - d( 'start', microtime() ); - for ( $i = 0; $i < 10; $i++ ) { - d( - $duration = mt_rand( 0, 200000 ), // the reported duration will be larger because of Kint overhead - usleep( $duration ), - microtime() - ); - } - dd( ); - } - */ -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/objectiterateable.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/objectiterateable.php deleted file mode 100644 index bbc0de070..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/objectiterateable.php +++ /dev/null @@ -1,22 +0,0 @@ -value = kintParser::factory( $arrayCopy )->extendedValue; - $this->type = 'Iterator contents'; - $this->size = count( $arrayCopy ); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/splobjectstorage.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/splobjectstorage.php deleted file mode 100644 index 69da91fd9..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/splobjectstorage.php +++ /dev/null @@ -1,24 +0,0 @@ -count(); - if ( $count === 0 ) return false; - - $variable->rewind(); - while ( $variable->valid() ) { - $current = $variable->current(); - $this->value[] = kintParser::factory( $current ); - $variable->next(); - } - - $this->type = 'Storage contents'; - $this->size = $count; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/timestamp.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/timestamp.php deleted file mode 100644 index d1a3ce323..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/timestamp.php +++ /dev/null @@ -1,29 +0,0 @@ -type = 'timestamp'; - # avoid dreaded "Timezone must be set" error - $this->value = @date( 'Y-m-d H:i:s', $var ); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/xml.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/xml.php deleted file mode 100644 index 63283a0fa..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/custom/xml.php +++ /dev/null @@ -1,25 +0,0 @@ -value = kintParser::factory( $xml )->extendedValue; - $this->type = 'XML'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/closure.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/closure.php deleted file mode 100644 index b050d3a70..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/closure.php +++ /dev/null @@ -1,47 +0,0 @@ -name = 'Closure'; - $reflection = new ReflectionFunction( $variable ); - $ret = array( - 'Parameters' => array() - ); - if ( $val = $reflection->getParameters() ) { - foreach ( $val as $parameter ) { - // todo http://php.net/manual/en/class.reflectionparameter.php - $ret['Parameters'][] = $parameter->name; - } - - } - if ( $val = $reflection->getStaticVariables() ) { - $ret['Uses'] = $val; - } - if ( method_exists($reflection, 'getClousureThis') && $val = $reflection->getClosureThis() ) { - $ret['Uses']['$this'] = $val; - } - if ( $val = $reflection->getFileName() ) { - $this->value = Kint::shortenPath( $val ) . ':' . $reflection->getStartLine(); - } - - return $ret; - } - - - public function isDefaultValueAvailable() - { - if ( PHP_VERSION_ID === 50316 ) { // PHP bug #62988 - try { - $this->getDefaultValue(); - return true; - } catch ( \ReflectionException $e ) { - return false; - } - } - return parent::isDefaultValueAvailable(); - } -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/smarty.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/smarty.php deleted file mode 100644 index 52b07505e..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/smarty.php +++ /dev/null @@ -1,35 +0,0 @@ -name = 'object Smarty (v' . substr( Smarty::SMARTY_VERSION, 7 ) . ')'; # trim 'Smarty-' - - $assigned = $globalAssigns = array(); - foreach ( $variable->tpl_vars as $name => $var ) { - $assigned[ $name ] = $var->value; - } - foreach ( Smarty::$global_tpl_vars as $name => $var ) { - if ( $name === 'SCRIPT_NAME' ) continue; - - $globalAssigns[ $name ] = $var->value; - } - - return array( - 'Assigned' => $assigned, - 'Assigned globally' => $globalAssigns, - 'Configuration' => array( - 'Compiled files stored in' => isset($variable->compile_dir) - ? $variable->compile_dir - : $variable->getCompileDir(), - ) - ); - - } -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/splfileinfo.php b/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/splfileinfo.php deleted file mode 100644 index 964dd6150..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/parsers/objects/splfileinfo.php +++ /dev/null @@ -1,70 +0,0 @@ -name = 'SplFileInfo'; - $this->value = $variable->getBasename(); - - - $flags = array(); - $perms = $variable->getPerms(); - - if ( ( $perms & 0xC000 ) === 0xC000 ) { - $type = 'File socket'; - $flags[] = 's'; - } elseif ( ( $perms & 0xA000 ) === 0xA000 ) { - $type = 'File symlink'; - $flags[] = 'l'; - } elseif ( ( $perms & 0x8000 ) === 0x8000 ) { - $type = 'File'; - $flags[] = '-'; - } elseif ( ( $perms & 0x6000 ) === 0x6000 ) { - $type = 'Block special file'; - $flags[] = 'b'; - } elseif ( ( $perms & 0x4000 ) === 0x4000 ) { - $type = 'Directory'; - $flags[] = 'd'; - } elseif ( ( $perms & 0x2000 ) === 0x2000 ) { - $type = 'Character special file'; - $flags[] = 'c'; - } elseif ( ( $perms & 0x1000 ) === 0x1000 ) { - $type = 'FIFO pipe file'; - $flags[] = 'p'; - } else { - $type = 'Unknown file'; - $flags[] = 'u'; - } - - // owner - $flags[] = ( ( $perms & 0x0100 ) ? 'r' : '-' ); - $flags[] = ( ( $perms & 0x0080 ) ? 'w' : '-' ); - $flags[] = ( ( $perms & 0x0040 ) ? ( ( $perms & 0x0800 ) ? 's' : 'x' ) : ( ( $perms & 0x0800 ) ? 'S' : '-' ) ); - - // group - $flags[] = ( ( $perms & 0x0020 ) ? 'r' : '-' ); - $flags[] = ( ( $perms & 0x0010 ) ? 'w' : '-' ); - $flags[] = ( ( $perms & 0x0008 ) ? ( ( $perms & 0x0400 ) ? 's' : 'x' ) : ( ( $perms & 0x0400 ) ? 'S' : '-' ) ); - - // world - $flags[] = ( ( $perms & 0x0004 ) ? 'r' : '-' ); - $flags[] = ( ( $perms & 0x0002 ) ? 'w' : '-' ); - $flags[] = ( ( $perms & 0x0001 ) ? ( ( $perms & 0x0200 ) ? 't' : 'x' ) : ( ( $perms & 0x0200 ) ? 'T' : '-' ) ); - - $size = sprintf( '%.2fK', $variable->getSize() / 1024 ); - $flags = implode( $flags ); - $path = $variable->getRealPath(); - - return array( - 'File information' => array( - 'Full path' => $path, - 'Type' => $type, - 'Size' => $size, - 'Flags' => $flags - ) - ); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/base.js b/sites/all/modules/contrib/dev/devel/kint/kint/view/base.js deleted file mode 100644 index 45de721ba..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/base.js +++ /dev/null @@ -1,437 +0,0 @@ -/** - java -jar compiler.jar --js $FileName$ --js_output_file ../inc/kint.js --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper "(function(){%output%})()" - */ - -if ( typeof kintInitialized === 'undefined' ) { - kintInitialized = 1; - var kint = { - visiblePluses : [], // all visible toggle carets - currentPlus : -1, // currently selected caret - - selectText : function( element ) { - var selection = window.getSelection(), - range = document.createRange(); - - range.selectNodeContents(element); - selection.removeAllRanges(); - selection.addRange(range); - }, - - each : function( selector, callback ) { - Array.prototype.slice.call(document.querySelectorAll(selector), 0).forEach(callback) - }, - - hasClass : function( target, className ) { - if ( !target.classList ) return false; - - if ( typeof className === 'undefined' ) { - className = 'kint-show'; - } - return target.classList.contains(className); - }, - - addClass : function( target, className ) { - if ( typeof className === 'undefined' ) { - className = 'kint-show'; - } - target.classList.add(className); - }, - - removeClass : function( target, className ) { - if ( typeof className === 'undefined' ) { - className = 'kint-show'; - } - target.classList.remove(className); - return target; - }, - - next : function( element ) { - do { - element = element.nextElementSibling; - } while ( element.nodeName.toLowerCase() !== 'dd' ); - - return element; - }, - - toggle : function( element, hide ) { - var parent = kint.next(element); - - if ( typeof hide === 'undefined' ) { - hide = kint.hasClass(element); - } - - if ( hide ) { - kint.removeClass(element); - } else { - kint.addClass(element); - } - - if ( parent.childNodes.length === 1 ) { - parent = parent.childNodes[0].childNodes[0]; // reuse variable cause I can - - // parent is checked in case of empty
     when array("\n") is dumped
    -				if ( parent && kint.hasClass(parent, 'kint-parent') ) {
    -					kint.toggle(parent, hide)
    -				}
    -			}
    -		},
    -
    -		toggleChildren : function( element, hide ) {
    -			var parent = kint.next(element)
    -				, nodes = parent.getElementsByClassName('kint-parent')
    -				, i = nodes.length;
    -
    -			if ( typeof hide === 'undefined' ) {
    -				hide = kint.hasClass(element);
    -			}
    -
    -			while ( i-- ) {
    -				kint.toggle(nodes[i], hide);
    -			}
    -			kint.toggle(element, hide);
    -		},
    -
    -		toggleAll : function( caret ) {
    -			var elements = document.getElementsByClassName('kint-parent')
    -				, i = elements.length
    -				, visible = kint.hasClass(caret.parentNode);
    -
    -			while ( i-- ) {
    -				kint.toggle(elements[i], visible);
    -			}
    -		},
    -
    -		switchTab : function( target ) {
    -			var lis, el = target, index = 0;
    -
    -			target.parentNode.getElementsByClassName('kint-active-tab')[0].className = '';
    -			target.className = 'kint-active-tab';
    -
    -			// take the index of clicked title tab and make the same n-th content tab visible
    -			while ( el = el.previousSibling ) el.nodeType === 1 && index++;
    -			lis = target.parentNode.nextSibling.childNodes;
    -			for ( var i = 0; i < lis.length; i++ ) {
    -				if ( i === index ) {
    -					lis[i].style.display = 'block';
    -
    -					if ( lis[i].childNodes.length === 1 ) {
    -						el = lis[i].childNodes[0].childNodes[0];
    -
    -						if ( kint.hasClass(el, 'kint-parent') ) {
    -							kint.toggle(el, false)
    -						}
    -					}
    -				} else {
    -					lis[i].style.display = 'none';
    -				}
    -			}
    -		},
    -
    -		isSibling : function( el ) {
    -			for ( ; ; ) {
    -				el = el.parentNode;
    -				if ( !el || kint.hasClass(el, 'kint') ) break;
    -			}
    -
    -			return !!el;
    -		},
    -
    -		fetchVisiblePluses : function() {
    -			kint.visiblePluses = [];
    -			kint.each('.kint nav, .kint-tabs>li:not(.kint-active-tab)', function( el ) {
    -				if ( el.offsetWidth !== 0 || el.offsetHeight !== 0 ) {
    -					kint.visiblePluses.push(el)
    -				}
    -			});
    -		},
    -
    -		openInNewWindow : function( kintContainer ) {
    -			var newWindow;
    -
    -			if ( newWindow = window.open() ) {
    -				newWindow.document.open();
    -				newWindow.document.write(
    -					''
    -					+ ''
    -					+ 'Kint (' + new Date().toISOString() + ')'
    -					+ ''
    -					+ document.getElementsByClassName('-kint-js')[0].outerHTML
    -					+ document.getElementsByClassName('-kint-css')[0].outerHTML
    -					+ ''
    -					+ ''
    -					+ ''
    -					+ '
    ' - + kintContainer.parentNode.outerHTML - + '
    ' - ); - newWindow.document.close(); - } - }, - - sortTable : function( table, column ) { - var tbody = table.tBodies[0]; - - var format = function( s ) { - var n = column === 1 ? s.replace(/^#/, '') : s; - if ( isNaN(n) ) { - return s.trim().toLocaleLowerCase(); - } else { - n = parseFloat(n); - return isNaN(n) ? s.trim() : n; - } - }; - - - [].slice.call(table.tBodies[0].rows) - .sort(function( a, b ) { - a = format(a.cells[column].textContent); - b = format(b.cells[column].textContent); - if ( a < b ) return -1; - if ( a > b ) return 1; - - return 0; - }) - .forEach(function( el ) { - tbody.appendChild(el); - }); - }, - - keyCallBacks : { - cleanup : function( i ) { - var focusedClass = 'kint-focused'; - var prevElement = document.querySelector('.' + focusedClass); - prevElement && kint.removeClass(prevElement, focusedClass); - - if ( i !== -1 ) { - var el = kint.visiblePluses[i]; - kint.addClass(el, focusedClass); - - - var offsetTop = function( el ) { - return el.offsetTop + ( el.offsetParent ? offsetTop(el.offsetParent) : 0 ); - }; - - var top = offsetTop(el) - (window.innerHeight / 2 ); - window.scrollTo(0, top); - } - - kint.currentPlus = i; - }, - - moveCursor : function( up, i ) { - // todo make the first VISIBLE plus active - if ( up ) { - if ( --i < 0 ) { - i = kint.visiblePluses.length - 1; - } - } else { - if ( ++i >= kint.visiblePluses.length ) { - i = 0; - } - } - - kint.keyCallBacks.cleanup(i); - return false; - } - } - }; - - window.addEventListener("click", function( e ) { - var target = e.target - , nodeName = target.nodeName.toLowerCase(); - - if ( !kint.isSibling(target) ) return; - - // auto-select name of variable - if ( nodeName === 'dfn' ) { - kint.selectText(target); - target = target.parentNode; - } else if ( nodeName === 'var' ) { // stupid workaround for misc elements - target = target.parentNode; // to not stop event from further propagating - nodeName = target.nodeName.toLowerCase() - } else if ( nodeName === 'th' ) { - if ( !e.ctrlKey ) { - kint.sortTable(target.parentNode.parentNode.parentNode, target.cellIndex) - } - return false; - } - - // switch tabs - if ( nodeName === 'li' && target.parentNode.className === 'kint-tabs' ) { - if ( target.className !== 'kint-active-tab' ) { - kint.switchTab(target); - if ( kint.currentPlus !== -1 ) kint.fetchVisiblePluses(); - } - return false; - } - - // handle clicks on the navigation caret - if ( nodeName === 'nav' ) { - // special case for nav in footer - if ( target.parentNode.nodeName.toLowerCase() === 'footer' ) { - target = target.parentNode; - if ( kint.hasClass(target) ) { - kint.removeClass(target) - } else { - kint.addClass(target) - } - } else { - // ensure doubleclick has different behaviour, see below - setTimeout(function() { - var timer = parseInt(target.kintTimer, 10); - if ( timer > 0 ) { - target.kintTimer--; - } else { - kint.toggleChildren(target.parentNode); //
    - if ( kint.currentPlus !== -1 ) kint.fetchVisiblePluses(); - } - }, 300); - } - - e.stopPropagation(); - return false; - } else if ( kint.hasClass(target, 'kint-parent') ) { - kint.toggle(target); - if ( kint.currentPlus !== -1 ) kint.fetchVisiblePluses(); - return false; - } else if ( kint.hasClass(target, 'kint-ide-link') ) { - e.preventDefault(); - var ajax = new XMLHttpRequest(); // add ajax call to contact editor but prevent link default action - ajax.open('GET', target.href); - ajax.send(null); - return false; - } else if ( kint.hasClass(target, 'kint-popup-trigger') ) { - var kintContainer = target.parentNode; - if ( kintContainer.nodeName.toLowerCase() === 'footer' ) { - kintContainer = kintContainer.previousSibling; - } else { - while ( kintContainer && !kint.hasClass(kintContainer, 'kint-parent') ) { - kintContainer = kintContainer.parentNode; - } - } - - kint.openInNewWindow(kintContainer); - } else if ( nodeName === 'pre' && e.detail === 3 ) { // triple click pre to select it all - kint.selectText(target); - } - }, false); - - window.addEventListener("dblclick", function( e ) { - var target = e.target; - if ( !kint.isSibling(target) ) return; - - if ( target.nodeName.toLowerCase() === 'nav' ) { - target.kintTimer = 2; - kint.toggleAll(target); - if ( kint.currentPlus !== -1 ) kint.fetchVisiblePluses(); - e.stopPropagation(); - } - }, false); - - // keyboard navigation - window.onkeydown = function( e ) { // direct assignment is used to have priority over ex FAYT - - // do nothing if alt/ctrl key is pressed or if we're actually typing somewhere - if ( e.target !== document.body || e.altKey || e.ctrlKey ) return; - - var keyCode = e.keyCode - , shiftKey = e.shiftKey - , i = kint.currentPlus; - - - if ( keyCode === 68 ) { // 'd' : toggles navigation on/off - if ( i === -1 ) { - kint.fetchVisiblePluses(); - return kint.keyCallBacks.moveCursor(false, i); - } else { - kint.keyCallBacks.cleanup(-1); - return false; - } - } else { - if ( i === -1 ) return; - - if ( keyCode === 9 ) { // TAB : moves up/down depending on shift key - return kint.keyCallBacks.moveCursor(shiftKey, i); - } else if ( keyCode === 38 ) { // ARROW UP : moves up - return kint.keyCallBacks.moveCursor(true, i); - } else if ( keyCode === 40 ) { // ARROW DOWN : down - return kint.keyCallBacks.moveCursor(false, i); - } - } - - - var kintNode = kint.visiblePluses[i]; - if ( kintNode.nodeName.toLowerCase() === 'li' ) { // we're on a trace tab - if ( keyCode === 32 || keyCode === 13 ) { // SPACE/ENTER - kint.switchTab(kintNode); - kint.fetchVisiblePluses(); - return kint.keyCallBacks.moveCursor(true, i); - } else if ( keyCode === 39 ) { // arrows - return kint.keyCallBacks.moveCursor(false, i); - } else if ( keyCode === 37 ) { - return kint.keyCallBacks.moveCursor(true, i); - } - } - - kintNode = kintNode.parentNode; // simple dump - if ( keyCode === 32 || keyCode === 13 ) { // SPACE/ENTER : toggles - kint.toggle(kintNode); - kint.fetchVisiblePluses(); - return false; - } else if ( keyCode === 39 || keyCode === 37 ) { // ARROW LEFT/RIGHT : respectively hides/shows and traverses - var visible = kint.hasClass(kintNode); - var hide = keyCode === 37; - - if ( visible ) { - kint.toggleChildren(kintNode, hide); // expand/collapse all children if immediate ones are showing - } else { - if ( hide ) { // LEFT - // traverse to parent and THEN hide - do {kintNode = kintNode.parentNode} while ( kintNode && kintNode.nodeName.toLowerCase() !== 'dd' ); - - if ( kintNode ) { - kintNode = kintNode.previousElementSibling; - - i = -1; - var parentPlus = kintNode.querySelector('nav'); - while ( parentPlus !== kint.visiblePluses[++i] ) {} - kint.keyCallBacks.cleanup(i) - } else { // we are at root - kintNode = kint.visiblePluses[i].parentNode; - } - } - kint.toggle(kintNode, hide); - } - kint.fetchVisiblePluses(); - return false; - } - }; - - window.addEventListener("load", function( e ) { // colorize microtime results relative to others - var elements = Array.prototype.slice.call(document.querySelectorAll('.kint-microtime'), 0); - elements.forEach(function( el ) { - var value = parseFloat(el.innerHTML) - , min = Infinity - , max = -Infinity - , ratio; - - elements.forEach(function( el ) { - var val = parseFloat(el.innerHTML); - - if ( min > val ) min = val; - if ( max < val ) max = val; - }); - - ratio = 1 - (value - min) / (max - min); - - el.style.background = 'hsl(' + Math.round(ratio * 120) + ',60%,70%)'; - }); - }); -} - -// debug purposes only, removed in minified source -function clg( i ) { - if ( !window.console )return; - var l = arguments.length, o = 0; - while ( o < l )console.log(arguments[o++]) -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/base.less b/sites/all/modules/contrib/dev/devel/kint/kint/view/base.less deleted file mode 100644 index 24c68f766..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/base.less +++ /dev/null @@ -1,413 +0,0 @@ -// -// VARIABLES FOR THEMES TO OVERRIDE -// -------------------------------------------------- - -@spacing : 4; - -// caret taken from solarized -@caret-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAMAAACO5hB7AAAA7VBMVEVYbnWToaH///9YbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnWToaFYbnVYbnWToaGToaFYbnWToaFYbnWToaFYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnWToaEeRtj1AAAATXRSTlMAAACLab0B7iP2R7CL9iPuaUewAb36F0/QnPoX0JxPYQaurepi6QV8FhV7MzFhM6586RYFMa3qYnsVBpNQ+ZGOGJ3PkM9QkZAY+Y6TnV7gnYsAAAEcSURBVHhebdHVbgMxEEBRu8sUZmqapBBoSuGUmWb+/3NayxtrLOe+Hck745XZgd6/eb3CVcKt7HmR+gKxlCGOETG5vFbOoahR6NxI5zHt6nuq+2dqnqfzzH3mfcz70vb8H6MJt5u6a96hS30E4PjEFgAEp2fKNojKUfVEOoS044ex7u3YPE/nmfvM+5j3pe17T9oe/77O41w+n4vnrbrwZxbTshVhvtx5Kb8vliRLRWmeSQSTjJq/El5x5fUXYmNN9hcQC5y4g/hGvVksNtT8451rns2IScb7mn567ll2GNpWr9YWfvQgzWsKs8HOA/m960g6rjTzA8HAV/NHwiOmPLwDKA/J/gggYsRVgFvqbr/fpWYv90zzZKKs9Qfx00Jx65oxLAAAAABJRU5ErkJggg=="); - -// -// SET UP HELPER VARIABLES -// -------------------------------------------------- - -@border: 1px solid @border-color; - -.selection() { - background : @border-color-hover; - color : @text-color; -} - -// -// BASE STYLES -// -------------------------------------------------- - -.kint::selection { .selection() } - -.kint::-moz-selection { .selection() } - -.kint::-webkit-selection { .selection() } - -.kint, -.kint::before, -.kint::after, -.kint *, -.kint *::before, -.kint *::after { - box-sizing : border-box; - border-radius : 0; - color : @text-color; - float : none !important; - font-family : Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; - line-height : 15px; - margin : 0; - padding : 0; - text-align : left; -} - -.kint { - font-size : 13px; - margin : @spacing * 2px 0; - overflow-x : auto; - white-space : nowrap; - - dt { - background : @main-background; - border : @border; - color : @text-color; - display : block; - font-weight : bold; - list-style : none outside none; - overflow : auto; - padding : @spacing * 1px; - - &:hover { - border-color : @border-color-hover; - } - - > var { - margin-right : 5px; - } - } - - > dl dl { - padding : 0 0 0 @spacing * 3px; - } - - // - // DROPDOWN CARET - // -------------------------------------------------- - - nav { - background : @caret-image no-repeat scroll 0 0 transparent; - cursor : pointer; - display : inline-block; - height : 15px; - width : 15px; - margin-right : 3px; - vertical-align : middle; - } - - dt.kint-parent:hover nav { - background-position : 0 -15px; - } - - dt.kint-parent.kint-show:hover > nav { - background-position : 0 -45px; - } - - dt.kint-show > nav { - background-position : 0 -30px; - } - - dt.kint-parent + dd { - display : none; - border-left : 1px dashed @border-color; - } - - dt.kint-parent.kint-show + dd { - display : block; - } - - // - // INDIVIDUAL ITEMS - // -------------------------------------------------- - - var, - var a { - color : @variable-type-color; - font-style : normal; - } - - dt:hover var, - dt:hover var a { - color : @variable-type-color-hover; - } - - dfn { - font-style : normal; - font-family : monospace; - color : @variable-name-color; - } - - pre { - color : @text-color; - margin : 0 0 0 @spacing * 3px; - padding : 5px; - overflow-y : hidden; - border-top : 0; - border : @border; - background : @main-background; - display : block; - word-break : normal; - } - - .kint-popup-trigger { - float : right !important; - cursor : pointer; - color : @border-color-hover; - - &:hover { - color : @border-color; - } - } - - dt.kint-parent > .kint-popup-trigger { - font-size : 13px; - } - - footer { - padding : 0 3px 3px; - font-size : 9px; - - > .kint-popup-trigger { - font-size : 12px; - } - - nav { - background-size : 10px; - height : 10px; - width : 10px; - - &:hover { - background-position : 0 -10px; - } - } - - > ol { - display : none; - margin-left : 32px; - } - - &.kint-show { - > ol { - display : block; - } - - nav { - background-position : 0 -20px; - - &:hover { - background-position : 0 -30px; - } - } - } - } - - a { - color : @text-color; - text-shadow : none; - - &:hover { - color : @variable-name-color; - border-bottom : 1px dotted @variable-name-color; - } - } - - // - // TABS - // -------------------------------------------------- - - ul { - list-style : none; - padding-left : @spacing * 3px; - - &:not(.kint-tabs) { - li { - border-left : 1px dashed @border-color; - - > dl { - border-left : none; - } - } - } - - &.kint-tabs { - margin : 0 0 0 @spacing * 3px; - padding-left : 0; - background : @main-background; - border : @border; - border-top : 0; - - li { - background : @secondary-background; - border : @border; - cursor : pointer; - display : inline-block; - height : @spacing * 6px; - margin : round(@spacing / 2) * 1px; - padding : 0 2px + round(@spacing * 2.5px); - vertical-align : top; - - &:hover, - &.kint-active-tab:hover { - border-color : @border-color-hover; - color : @variable-type-color-hover; - } - - &.kint-active-tab { - background : @main-background; - border-top : 0; - margin-top : -1px; - height : 27px; - line-height : 24px; - } - - &:not(.kint-active-tab) { - line-height : @spacing * 5px; - } - } - - li + li { - margin-left : 0 - } - } - - &:not(.kint-tabs) > li:not(:first-child) { - display : none; - } - } - - dt:hover + dd > ul > li.kint-active-tab { - border-color : @border-color-hover; - color : @variable-type-color-hover; - } -} - -// -// REPORT -// -------------------------------------------------- - -.kint-report { - border-collapse : collapse; - empty-cells : show; - border-spacing : 0; - - * { - font-size : 12px; - } - - dt { - background : none; - padding : (@spacing/2) * 1px; - - .kint-parent { - min-width : 100%; - overflow : hidden; - text-overflow : ellipsis; - white-space : nowrap; - } - } - - td, - th { - border : @border; - padding : (@spacing/2) * 1px; - vertical-align : center; - } - - th { - cursor : alias; - } - - td:first-child, - th { - font-weight : bold; - background : @secondary-background; - color : @variable-name-color; - } - - td { - background : @main-background; - white-space : pre; - - > dl { - padding : 0; - } - } - - pre { - border-top : 0; - border-right : 0; - } - - th:first-child { - background : none; - border : 0; - } - - td.kint-empty { - background : #d33682 !important; - } - - tr:hover { - > td { - box-shadow : 0 0 1px 0 @border-color-hover inset; - } - - var { - color : @variable-type-color-hover; - } - } - ul.kint-tabs li.kint-active-tab { - height : 20px; - line-height : 17px; - } -} - -// -// TRACE -// -------------------------------------------------- -.kint-trace { - .kint-source { - line-height : round(@spacing * 3.5) * 1px; - - span { - padding-right : 1px; - border-right : 3px inset @variable-type-color; - } - - .kint-highlight { - background : @secondary-background; - } - } - - .kint-parent { - > b { - min-width : 18px; - display : inline-block; - text-align : right; - color : @variable-name-color; - } - - > var { - > a { - color : @variable-type-color; - } - } - } -} - -// -// MISC -// -------------------------------------------------- - -// keyboard navigation caret -.kint-focused { - .keyboard-caret -} - -.kint-microtime, -.kint-color-preview { - box-shadow : 0 0 2px 0 #b6cedb; - height : 16px; - text-align : center; - text-shadow : -1px 0 #839496, 0 1px #839496, 1px 0 #839496, 0 -1px #839496; - width : 230px; - color : #fdf6e3; -} - -// mini trace -.kint footer li { - color : #ddd; -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/aante-light.css b/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/aante-light.css deleted file mode 100644 index b22faddc3..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/aante-light.css +++ /dev/null @@ -1,397 +0,0 @@ -/** - * @author Ante Aljinovic https://github.com/aljinovic - */ -.kint::selection { - background: #aaaaaa; - color: #1d1e1e; -} -.kint::-moz-selection { - background: #aaaaaa; - color: #1d1e1e; -} -.kint::-webkit-selection { - background: #aaaaaa; - color: #1d1e1e; -} -.kint, -.kint::before, -.kint::after, -.kint *, -.kint *::before, -.kint *::after { - box-sizing: border-box; - border-radius: 0; - color: #1d1e1e; - float: none !important; - font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; - line-height: 15px; - margin: 0; - padding: 0; - text-align: left; -} -.kint { - font-size: 13px; - margin: 8px 0; - overflow-x: auto; - white-space: nowrap; -} -.kint dt { - background: #f8f8f8; - border: 1px solid #d7d7d7; - color: #1d1e1e; - display: block; - font-weight: bold; - list-style: none outside none; - overflow: auto; - padding: 4px; -} -.kint dt:hover { - border-color: #aaaaaa; -} -.kint dt > var { - margin-right: 5px; -} -.kint > dl dl { - padding: 0 0 0 12px; -} -.kint nav { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAYAAAC5OOBJAAAAvklEQVR42mNgGMFAS0uLLSQk5HxoaOh/XDg4OLgdpwEBAQEGQAN+YtMIFH/i4ODAg9cFQNMbsWkOCgrKJMv5ID5Qipko/6M7PzAw0ImkAIQ5H0hvISv0gZpP+fn5qZAVfcBAkmEYBaNZcjRLjmbJUUCvqAIlDlAiASUWkjWDkiU0eTaSpBGUEZBy1E9QRiFWLzO2LEmU80GZHkcRhN/5oGIGVNzgKIbwOx9UwOErAIl2/igYzZKjWXI0S9IHAAASJijo0Ypj8AAAAABJRU5ErkJggg==") no-repeat scroll 0 0 transparent; - cursor: pointer; - display: inline-block; - height: 15px; - width: 15px; - margin-right: 3px; - vertical-align: middle; -} -.kint dt.kint-parent:hover nav { - background-position: 0 -15px; -} -.kint dt.kint-parent.kint-show:hover > nav { - background-position: 0 -45px; -} -.kint dt.kint-show > nav { - background-position: 0 -30px; -} -.kint dt.kint-parent + dd { - display: none; - border-left: 1px dashed #d7d7d7; -} -.kint dt.kint-parent.kint-show + dd { - display: block; -} -.kint var, -.kint var a { - color: #0066ff; - font-style: normal; -} -.kint dt:hover var, -.kint dt:hover var a { - color: #ff0000; -} -.kint dfn { - font-style: normal; - font-family: monospace; - color: #1d1e1e; -} -.kint pre { - color: #1d1e1e; - margin: 0 0 0 12px; - padding: 5px; - overflow-y: hidden; - border-top: 0; - border: 1px solid #d7d7d7; - background: #f8f8f8; - display: block; - word-break: normal; -} -.kint .kint-popup-trigger { - float: right !important; - cursor: pointer; - color: #aaaaaa; -} -.kint .kint-popup-trigger:hover { - color: #d7d7d7; -} -.kint dt.kint-parent > .kint-popup-trigger { - font-size: 13px; -} -.kint footer { - padding: 0 3px 3px; - font-size: 9px; -} -.kint footer > .kint-popup-trigger { - font-size: 12px; -} -.kint footer nav { - background-size: 10px; - height: 10px; - width: 10px; -} -.kint footer nav:hover { - background-position: 0 -10px; -} -.kint footer > ol { - display: none; - margin-left: 32px; -} -.kint footer.kint-show > ol { - display: block; -} -.kint footer.kint-show nav { - background-position: 0 -20px; -} -.kint footer.kint-show nav:hover { - background-position: 0 -30px; -} -.kint a { - color: #1d1e1e; - text-shadow: none; -} -.kint a:hover { - color: #1d1e1e; - border-bottom: 1px dotted #1d1e1e; -} -.kint ul { - list-style: none; - padding-left: 12px; -} -.kint ul:not(.kint-tabs) li { - border-left: 1px dashed #d7d7d7; -} -.kint ul:not(.kint-tabs) li > dl { - border-left: none; -} -.kint ul.kint-tabs { - margin: 0 0 0 12px; - padding-left: 0; - background: #f8f8f8; - border: 1px solid #d7d7d7; - border-top: 0; -} -.kint ul.kint-tabs li { - background: #f8f8f8; - border: 1px solid #d7d7d7; - cursor: pointer; - display: inline-block; - height: 24px; - margin: 2px; - padding: 0 12px; - vertical-align: top; -} -.kint ul.kint-tabs li:hover, -.kint ul.kint-tabs li.kint-active-tab:hover { - border-color: #aaaaaa; - color: #ff0000; -} -.kint ul.kint-tabs li.kint-active-tab { - background: #f8f8f8; - border-top: 0; - margin-top: -1px; - height: 27px; - line-height: 24px; -} -.kint ul.kint-tabs li:not(.kint-active-tab) { - line-height: 20px; -} -.kint ul.kint-tabs li + li { - margin-left: 0; -} -.kint ul:not(.kint-tabs) > li:not(:first-child) { - display: none; -} -.kint dt:hover + dd > ul > li.kint-active-tab { - border-color: #aaaaaa; - color: #ff0000; -} -.kint-report { - border-collapse: collapse; - empty-cells: show; - border-spacing: 0; -} -.kint-report * { - font-size: 12px; -} -.kint-report dt { - background: none; - padding: 2px; -} -.kint-report dt .kint-parent { - min-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.kint-report td, -.kint-report th { - border: 1px solid #d7d7d7; - padding: 2px; - vertical-align: center; -} -.kint-report th { - cursor: alias; -} -.kint-report td:first-child, -.kint-report th { - font-weight: bold; - background: #f8f8f8; - color: #1d1e1e; -} -.kint-report td { - background: #f8f8f8; - white-space: pre; -} -.kint-report td > dl { - padding: 0; -} -.kint-report pre { - border-top: 0; - border-right: 0; -} -.kint-report th:first-child { - background: none; - border: 0; -} -.kint-report td.kint-empty { - background: #d33682 !important; -} -.kint-report tr:hover > td { - box-shadow: 0 0 1px 0 #aaaaaa inset; -} -.kint-report tr:hover var { - color: #ff0000; -} -.kint-report ul.kint-tabs li.kint-active-tab { - height: 20px; - line-height: 17px; -} -.kint-trace .kint-source { - line-height: 14px; -} -.kint-trace .kint-source span { - padding-right: 1px; - border-right: 3px inset #0066ff; -} -.kint-trace .kint-source .kint-highlight { - background: #f8f8f8; -} -.kint-trace .kint-parent > b { - min-width: 18px; - display: inline-block; - text-align: right; - color: #1d1e1e; -} -.kint-trace .kint-parent > var > a { - color: #0066ff; -} -.kint-focused { - box-shadow: 0 0 3px 2px #ff0000; -} -.kint-microtime, -.kint-color-preview { - box-shadow: 0 0 2px 0 #b6cedb; - height: 16px; - text-align: center; - text-shadow: -1px 0 #839496, 0 1px #839496, 1px 0 #839496, 0 -1px #839496; - width: 230px; - color: #fdf6e3; -} -.kint footer li { - color: #ddd; -} -.kint dt { - font-weight: normal; -} -.kint dt.kint-parent { - margin-top: 4px; -} -.kint > dl { - background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, #ffffff 15px); -} -.kint dl dl { - margin-top: 4px; - padding-left: 25px; - border-left: none; -} -.kint > dl > dt { - background: #f8f8f8; -} -.kint ul { - margin: 0; - padding-left: 0; -} -.kint ul:not(.kint-tabs) > li { - border-left: 0; -} -.kint ul.kint-tabs { - background: #f8f8f8; - border: 1px solid #d7d7d7; - border-width: 0 1px 1px 1px; - padding: 4px 0 0 12px; - margin-left: -1px; - margin-top: -1px; -} -.kint ul.kint-tabs li, -.kint ul.kint-tabs li + li { - margin: 0 0 0 4px; -} -.kint ul.kint-tabs li { - border-bottom-width: 0; - height: 25px; -} -.kint ul.kint-tabs li:first-child { - margin-left: 0; -} -.kint ul.kint-tabs li.kint-active-tab { - border-top: 1px solid #d7d7d7; - background: #fff; - font-weight: bold; - padding-top: 0; - border-bottom: 1px solid #fff !important; - margin-bottom: -1px; -} -.kint ul.kint-tabs li.kint-active-tab:hover { - border-bottom: 1px solid #fff; -} -.kint ul > li > pre { - border: 1px solid #d7d7d7; -} -.kint dt:hover + dd > ul { - border-color: #aaaaaa; -} -.kint pre { - background: #fff; - margin-top: 4px; - margin-left: 25px; -} -.kint .kint-popup-trigger:hover { - color: #ff0000; -} -.kint .kint-source .kint-highlight { - background: #cfc; -} -.kint-report td { - background: #fff; -} -.kint-report td > dl { - padding: 0; - margin: 0; -} -.kint-report td > dl > dt.kint-parent { - margin: 0; -} -.kint-report td:first-child, -.kint-report td, -.kint-report th { - padding: 2px 4px; -} -.kint-report td.kint-empty { - background: #d7d7d7 !important; -} -.kint-report dd, -.kint-report dt { - background: #fff; -} -.kint-report tr:hover > td { - box-shadow: none; - background: #cfc; -} diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/kint.js b/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/kint.js deleted file mode 100644 index 119518824..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/kint.js +++ /dev/null @@ -1,10 +0,0 @@ -(function(){if("undefined"===typeof kintInitialized){kintInitialized=1;var e=[],f=-1,g=function(a){var b=window.getSelection(),c=document.createRange();c.selectNodeContents(a);b.removeAllRanges();b.addRange(c)},h=function(a){Array.prototype.slice.call(document.querySelectorAll(".kint nav, .kint-tabs>li:not(.kint-active-tab)"),0).forEach(a)},k=function(a,b){if(!a.classList)return!1;"undefined"===typeof b&&(b="kint-show");return a.classList.contains(b)},l=function(a,b){"undefined"===typeof b&&(b="kint-show");a.classList.add(b)}, -m=function(a,b){"undefined"===typeof b&&(b="kint-show");a.classList.remove(b)},n=function(a){do a=a.nextElementSibling;while("dd"!==a.nodeName.toLowerCase());return a},q=function(a,b){var c=n(a);"undefined"===typeof b&&(b=k(a));b?m(a):l(a);1===c.childNodes.length&&(c=c.childNodes[0].childNodes[0])&&k(c,"kint-parent")&&q(c,b)},r=function(a,b){var c=n(a).getElementsByClassName("kint-parent"),d=c.length;for("undefined"===typeof b&&(b=k(a));d--;)q(c[d],b);q(a,b)},s=function(a){var b=a,c=0;a.parentNode.getElementsByClassName("kint-active-tab")[0].className= -"";for(a.className="kint-active-tab";b=b.previousSibling;)1===b.nodeType&&c++;a=a.parentNode.nextSibling.childNodes;for(var d=0;dKint ("+(new Date).toISOString()+')'+document.getElementsByClassName("-kint-js")[0].outerHTML+document.getElementsByClassName("-kint-css")[0].outerHTML+'
    '+a.parentNode.outerHTML+"
    "),b.document.close()},w=function(a,b){function c(a){var c=1===b?a.replace(/^#/,""):a;if(isNaN(c))return a.trim().toLocaleLowerCase();c=parseFloat(c);return isNaN(c)? -a.trim():c}var d=a.tBodies[0];[].slice.call(a.tBodies[0].rows).sort(function(a,d){a=c(a.cells[b].textContent);d=c(d.cells[b].textContent);return ad?1:0}).forEach(function(a){d.appendChild(a)})},x=function(a){var b=document.querySelector(".kint-focused");b&&m(b,"kint-focused");if(-1!==a){b=e[a];l(b,"kint-focused");var c=function(a){return a.offsetTop+(a.offsetParent?c(a.offsetParent):0)};window.scrollTo(0,c(b)-window.innerHeight/2)}f=a},y=function(a,b){a?0>--b&&(b=e.length-1):++b>=e.length&& -(b=0);x(b);return!1};window.addEventListener("click",function(a){var b=a.target,c=b.nodeName.toLowerCase();if(t(b)){if("dfn"===c)g(b),b=b.parentNode;else if("var"===c)b=b.parentNode,c=b.nodeName.toLowerCase();else if("th"===c)return a.ctrlKey||w(b.parentNode.parentNode.parentNode,b.cellIndex),!1;if("li"===c&&"kint-tabs"===b.parentNode.className)return"kint-active-tab"!==b.className&&(s(b),-1!==f&&u()),!1;if("nav"===c)return"footer"===b.parentNode.nodeName.toLowerCase()?(b=b.parentNode,k(b)?m(b):l(b)): -setTimeout(function(){0a&&(d=a);pvar{margin-right:5px}.kint>dl dl{padding:0 0 0 12px}.kint nav{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAMAAACO5hB7AAAACVBMVEX///82b4tctzBls0NMAAAAQklEQVR42rWRIQ4AAAgCwf8/2qgER2BeuwJsgAqIzekMfMryPL9XQSkobE6vwKcsz/N7FfPvh09lnPf/b+7673+f0uHuAZ/EdkNQAAAAAElFTkSuQmCC") no-repeat scroll 0 0 transparent;cursor:pointer;display:inline-block;height:15px;width:15px;margin-right:3px;vertical-align:middle}.kint dt.kint-parent:hover nav{background-position:0 -15px}.kint dt.kint-parent.kint-show:hover>nav{background-position:0 -45px}.kint dt.kint-show>nav{background-position:0 -30px}.kint dt.kint-parent+dd{display:none;border-left:1px dashed #b6cedb}.kint dt.kint-parent.kint-show+dd{display:block}.kint var,.kint var a{color:#0092db;font-style:normal}.kint dt:hover var,.kint dt:hover var a{color:#5cb730}.kint dfn{font-style:normal;font-family:monospace;color:#1d1e1e}.kint pre{color:#1d1e1e;margin:0 0 0 12px;padding:5px;overflow-y:hidden;border-top:0;border:1px solid #b6cedb;background:#e0eaef;display:block;word-break:normal}.kint .kint-popup-trigger{float:right !important;cursor:pointer;color:#0092db}.kint .kint-popup-trigger:hover{color:#b6cedb}.kint dt.kint-parent>.kint-popup-trigger{font-size:13px}.kint footer{padding:0 3px 3px;font-size:9px}.kint footer>.kint-popup-trigger{font-size:12px}.kint footer nav{background-size:10px;height:10px;width:10px}.kint footer nav:hover{background-position:0 -10px}.kint footer>ol{display:none;margin-left:32px}.kint footer.kint-show>ol{display:block}.kint footer.kint-show nav{background-position:0 -20px}.kint footer.kint-show nav:hover{background-position:0 -30px}.kint a{color:#1d1e1e;text-shadow:none}.kint a:hover{color:#1d1e1e;border-bottom:1px dotted #1d1e1e}.kint ul{list-style:none;padding-left:12px}.kint ul:not(.kint-tabs) li{border-left:1px dashed #b6cedb}.kint ul:not(.kint-tabs) li>dl{border-left:none}.kint ul.kint-tabs{margin:0 0 0 12px;padding-left:0;background:#e0eaef;border:1px solid #b6cedb;border-top:0}.kint ul.kint-tabs li{background:#c1d4df;border:1px solid #b6cedb;cursor:pointer;display:inline-block;height:24px;margin:2px;padding:0 12px;vertical-align:top}.kint ul.kint-tabs li:hover,.kint ul.kint-tabs li.kint-active-tab:hover{border-color:#0092db;color:#5cb730}.kint ul.kint-tabs li.kint-active-tab{background:#e0eaef;border-top:0;margin-top:-1px;height:27px;line-height:24px}.kint ul.kint-tabs li:not(.kint-active-tab){line-height:20px}.kint ul.kint-tabs li+li{margin-left:0}.kint ul:not(.kint-tabs)>li:not(:first-child){display:none}.kint dt:hover+dd>ul>li.kint-active-tab{border-color:#0092db;color:#5cb730}.kint-report{border-collapse:collapse;empty-cells:show;border-spacing:0}.kint-report *{font-size:12px}.kint-report dt{background:none;padding:2px}.kint-report dt .kint-parent{min-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kint-report td,.kint-report th{border:1px solid #b6cedb;padding:2px;vertical-align:center}.kint-report th{cursor:alias}.kint-report td:first-child,.kint-report th{font-weight:bold;background:#c1d4df;color:#1d1e1e}.kint-report td{background:#e0eaef;white-space:pre}.kint-report td>dl{padding:0}.kint-report pre{border-top:0;border-right:0}.kint-report th:first-child{background:none;border:0}.kint-report td.kint-empty{background:#d33682 !important}.kint-report tr:hover>td{box-shadow:0 0 1px 0 #0092db inset}.kint-report tr:hover var{color:#5cb730}.kint-report ul.kint-tabs li.kint-active-tab{height:20px;line-height:17px}.kint-trace .kint-source{line-height:14px}.kint-trace .kint-source span{padding-right:1px;border-right:3px inset #0092db}.kint-trace .kint-source .kint-highlight{background:#c1d4df}.kint-trace .kint-parent>b{min-width:18px;display:inline-block;text-align:right;color:#1d1e1e}.kint-trace .kint-parent>var>a{color:#0092db}.kint-focused{box-shadow:0 0 3px 2px #5cb730}.kint-microtime,.kint-color-preview{box-shadow:0 0 2px 0 #b6cedb;height:16px;text-align:center;text-shadow:-1px 0 #839496,0 1px #839496,1px 0 #839496,0 -1px #839496;width:230px;color:#fdf6e3}.kint footer li{color:#ddd}.kint>dl>dt{background:linear-gradient(to bottom, #e3ecf0 0, #c0d4df 100%)}.kint ul.kint-tabs{background:linear-gradient(to bottom, #9dbed0 0, #b2ccda 100%)}.kint>dl:not(.kint-trace)>dd>ul.kint-tabs li{background:#e0eaef}.kint>dl:not(.kint-trace)>dd>ul.kint-tabs li.kint-active-tab{background:#c1d4df}.kint>dl.kint-trace>dt{background:linear-gradient(to bottom, #c0d4df 0, #e3ecf0 100%)}.kint .kint-source .kint-highlight{background:#f0eb96} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized-dark.css b/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized-dark.css deleted file mode 100644 index d7c68abaa..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized-dark.css +++ /dev/null @@ -1 +0,0 @@ -.kint::selection{background:#268bd2;color:#839496}.kint::-moz-selection{background:#268bd2;color:#839496}.kint::-webkit-selection{background:#268bd2;color:#839496}.kint,.kint::before,.kint::after,.kint *,.kint *::before,.kint *::after{box-sizing:border-box;border-radius:0;color:#839496;float:none !important;font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;line-height:15px;margin:0;padding:0;text-align:left}.kint{font-size:13px;margin:10px 0;overflow-x:auto;white-space:nowrap}.kint dt{background:#002b36;border:1px solid #586e75;color:#839496;display:block;font-weight:bold;list-style:none outside none;overflow:auto;padding:5px}.kint dt:hover{border-color:#268bd2}.kint dt>var{margin-right:5px}.kint>dl dl{padding:0 0 0 15px}.kint nav{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAMAAACO5hB7AAAA7VBMVEVYbnWToaH///9YbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnWToaFYbnVYbnWToaGToaFYbnWToaFYbnWToaFYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnWToaEeRtj1AAAATXRSTlMAAACLab0B7iP2R7CL9iPuaUewAb36F0/QnPoX0JxPYQaurepi6QV8FhV7MzFhM6586RYFMa3qYnsVBpNQ+ZGOGJ3PkM9QkZAY+Y6TnV7gnYsAAAEcSURBVHhebdHVbgMxEEBRu8sUZmqapBBoSuGUmWb+/3NayxtrLOe+Hck745XZgd6/eb3CVcKt7HmR+gKxlCGOETG5vFbOoahR6NxI5zHt6nuq+2dqnqfzzH3mfcz70vb8H6MJt5u6a96hS30E4PjEFgAEp2fKNojKUfVEOoS044ex7u3YPE/nmfvM+5j3pe17T9oe/77O41w+n4vnrbrwZxbTshVhvtx5Kb8vliRLRWmeSQSTjJq/El5x5fUXYmNN9hcQC5y4g/hGvVksNtT8451rns2IScb7mn567ll2GNpWr9YWfvQgzWsKs8HOA/m960g6rjTzA8HAV/NHwiOmPLwDKA/J/gggYsRVgFvqbr/fpWYv90zzZKKs9Qfx00Jx65oxLAAAAABJRU5ErkJggg==") no-repeat scroll 0 0 transparent;cursor:pointer;display:inline-block;height:15px;width:15px;margin-right:3px;vertical-align:middle}.kint dt.kint-parent:hover nav{background-position:0 -15px}.kint dt.kint-parent.kint-show:hover>nav{background-position:0 -45px}.kint dt.kint-show>nav{background-position:0 -30px}.kint dt.kint-parent+dd{display:none;border-left:1px dashed #586e75}.kint dt.kint-parent.kint-show+dd{display:block}.kint var,.kint var a{color:#268bd2;font-style:normal}.kint dt:hover var,.kint dt:hover var a{color:#2aa198}.kint dfn{font-style:normal;font-family:monospace;color:#93a1a1}.kint pre{color:#839496;margin:0 0 0 15px;padding:5px;overflow-y:hidden;border-top:0;border:1px solid #586e75;background:#002b36;display:block;word-break:normal}.kint .kint-popup-trigger{float:right !important;cursor:pointer;color:#268bd2}.kint .kint-popup-trigger:hover{color:#586e75}.kint dt.kint-parent>.kint-popup-trigger{font-size:13px}.kint footer{padding:0 3px 3px;font-size:9px}.kint footer>.kint-popup-trigger{font-size:12px}.kint footer nav{background-size:10px;height:10px;width:10px}.kint footer nav:hover{background-position:0 -10px}.kint footer>ol{display:none;margin-left:32px}.kint footer.kint-show>ol{display:block}.kint footer.kint-show nav{background-position:0 -20px}.kint footer.kint-show nav:hover{background-position:0 -30px}.kint a{color:#839496;text-shadow:none}.kint a:hover{color:#93a1a1;border-bottom:1px dotted #93a1a1}.kint ul{list-style:none;padding-left:15px}.kint ul:not(.kint-tabs) li{border-left:1px dashed #586e75}.kint ul:not(.kint-tabs) li>dl{border-left:none}.kint ul.kint-tabs{margin:0 0 0 15px;padding-left:0;background:#002b36;border:1px solid #586e75;border-top:0}.kint ul.kint-tabs li{background:#073642;border:1px solid #586e75;cursor:pointer;display:inline-block;height:30px;margin:3px;padding:0 15px;vertical-align:top}.kint ul.kint-tabs li:hover,.kint ul.kint-tabs li.kint-active-tab:hover{border-color:#268bd2;color:#2aa198}.kint ul.kint-tabs li.kint-active-tab{background:#002b36;border-top:0;margin-top:-1px;height:27px;line-height:24px}.kint ul.kint-tabs li:not(.kint-active-tab){line-height:25px}.kint ul.kint-tabs li+li{margin-left:0}.kint ul:not(.kint-tabs)>li:not(:first-child){display:none}.kint dt:hover+dd>ul>li.kint-active-tab{border-color:#268bd2;color:#2aa198}.kint-report{border-collapse:collapse;empty-cells:show;border-spacing:0}.kint-report *{font-size:12px}.kint-report dt{background:none;padding:2.5px}.kint-report dt .kint-parent{min-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kint-report td,.kint-report th{border:1px solid #586e75;padding:2.5px;vertical-align:top}.kint-report th{cursor:alias}.kint-report td{background:#002b36;white-space:pre}.kint-report td>dl{padding:0}.kint-report pre{border-top:0;border-right:0}.kint-report th:first-child{background:none;border:0}.kint-report td:first-child,.kint-report th{font-weight:bold;background:#073642;color:#93a1a1;padding:2.5px 0}.kint-report td.kint-empty{background:#d33682 !important}.kint-report tr:hover>td{box-shadow:0 0 1px 0 #268bd2 inset}.kint-report tr:hover var{color:#2aa198}.kint-report ul.kint-tabs li.kint-active-tab{height:20px;line-height:17px}.kint-trace .kint-source{line-height:18px}.kint-trace .kint-source span{padding-right:1px;border-right:3px inset #268bd2}.kint-trace .kint-source .kint-highlight{background:#073642}.kint-trace .kint-parent>b{min-width:18px;display:inline-block;text-align:right;color:#93a1a1}.kint-trace .kint-parent>var>a{color:#268bd2}.kint-focused{box-shadow:0 0 3px 2px #859900 inset;border-radius:7px}.kint-microtime,.kint-color-preview{box-shadow:0 0 2px 0 #b6cedb;height:16px;text-align:center;text-shadow:-1px 0 #839496,0 1px #839496,1px 0 #839496,0 -1px #839496;width:230px;color:#fdf6e3}.kint footer li{color:#ddd}body{background:#073642;color:#fff}.kint{background:#073642;box-shadow:0 0 5px 3px #073642}.kint>dl>dt,.kint ul.kint-tabs{box-shadow:4px 0 2px -3px #268bd2 inset}.kint ul.kint-tabs li.kint-active-tab{padding-top:7px;height:34px} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized.css b/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized.css deleted file mode 100644 index 118daf36b..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/compiled/solarized.css +++ /dev/null @@ -1 +0,0 @@ -.kint::selection{background:#268bd2;color:#657b83}.kint::-moz-selection{background:#268bd2;color:#657b83}.kint::-webkit-selection{background:#268bd2;color:#657b83}.kint,.kint::before,.kint::after,.kint *,.kint *::before,.kint *::after{box-sizing:border-box;border-radius:0;color:#657b83;float:none !important;font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;line-height:15px;margin:0;padding:0;text-align:left}.kint{font-size:13px;margin:10px 0;overflow-x:auto;white-space:nowrap}.kint dt{background:#fdf6e3;border:1px solid #93a1a1;color:#657b83;display:block;font-weight:bold;list-style:none outside none;overflow:auto;padding:5px}.kint dt:hover{border-color:#268bd2}.kint dt>var{margin-right:5px}.kint>dl dl{padding:0 0 0 15px}.kint nav{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAMAAACO5hB7AAAA7VBMVEVYbnWToaH///9YbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnWToaFYbnVYbnWToaGToaFYbnWToaFYbnWToaFYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnVYbnWToaGToaGToaGToaGToaGToaGToaGToaGToaFYbnWToaEeRtj1AAAATXRSTlMAAACLab0B7iP2R7CL9iPuaUewAb36F0/QnPoX0JxPYQaurepi6QV8FhV7MzFhM6586RYFMa3qYnsVBpNQ+ZGOGJ3PkM9QkZAY+Y6TnV7gnYsAAAEcSURBVHhebdHVbgMxEEBRu8sUZmqapBBoSuGUmWb+/3NayxtrLOe+Hck745XZgd6/eb3CVcKt7HmR+gKxlCGOETG5vFbOoahR6NxI5zHt6nuq+2dqnqfzzH3mfcz70vb8H6MJt5u6a96hS30E4PjEFgAEp2fKNojKUfVEOoS044ex7u3YPE/nmfvM+5j3pe17T9oe/77O41w+n4vnrbrwZxbTshVhvtx5Kb8vliRLRWmeSQSTjJq/El5x5fUXYmNN9hcQC5y4g/hGvVksNtT8451rns2IScb7mn567ll2GNpWr9YWfvQgzWsKs8HOA/m960g6rjTzA8HAV/NHwiOmPLwDKA/J/gggYsRVgFvqbr/fpWYv90zzZKKs9Qfx00Jx65oxLAAAAABJRU5ErkJggg==") no-repeat scroll 0 0 transparent;cursor:pointer;display:inline-block;height:15px;width:15px;margin-right:3px;vertical-align:middle}.kint dt.kint-parent:hover nav{background-position:0 -15px}.kint dt.kint-parent.kint-show:hover>nav{background-position:0 -45px}.kint dt.kint-show>nav{background-position:0 -30px}.kint dt.kint-parent+dd{display:none;border-left:1px dashed #93a1a1}.kint dt.kint-parent.kint-show+dd{display:block}.kint var,.kint var a{color:#268bd2;font-style:normal}.kint dt:hover var,.kint dt:hover var a{color:#2aa198}.kint dfn{font-style:normal;font-family:monospace;color:#586e75}.kint pre{color:#657b83;margin:0 0 0 15px;padding:5px;overflow-y:hidden;border-top:0;border:1px solid #93a1a1;background:#fdf6e3;display:block;word-break:normal}.kint .kint-popup-trigger{float:right !important;cursor:pointer;color:#268bd2}.kint .kint-popup-trigger:hover{color:#93a1a1}.kint dt.kint-parent>.kint-popup-trigger{font-size:13px}.kint footer{padding:0 3px 3px;font-size:9px}.kint footer>.kint-popup-trigger{font-size:12px}.kint footer nav{background-size:10px;height:10px;width:10px}.kint footer nav:hover{background-position:0 -10px}.kint footer>ol{display:none;margin-left:32px}.kint footer.kint-show>ol{display:block}.kint footer.kint-show nav{background-position:0 -20px}.kint footer.kint-show nav:hover{background-position:0 -30px}.kint a{color:#657b83;text-shadow:none}.kint a:hover{color:#586e75;border-bottom:1px dotted #586e75}.kint ul{list-style:none;padding-left:15px}.kint ul:not(.kint-tabs) li{border-left:1px dashed #93a1a1}.kint ul:not(.kint-tabs) li>dl{border-left:none}.kint ul.kint-tabs{margin:0 0 0 15px;padding-left:0;background:#fdf6e3;border:1px solid #93a1a1;border-top:0}.kint ul.kint-tabs li{background:#eee8d5;border:1px solid #93a1a1;cursor:pointer;display:inline-block;height:30px;margin:3px;padding:0 15px;vertical-align:top}.kint ul.kint-tabs li:hover,.kint ul.kint-tabs li.kint-active-tab:hover{border-color:#268bd2;color:#2aa198}.kint ul.kint-tabs li.kint-active-tab{background:#fdf6e3;border-top:0;margin-top:-1px;height:27px;line-height:24px}.kint ul.kint-tabs li:not(.kint-active-tab){line-height:25px}.kint ul.kint-tabs li+li{margin-left:0}.kint ul:not(.kint-tabs)>li:not(:first-child){display:none}.kint dt:hover+dd>ul>li.kint-active-tab{border-color:#268bd2;color:#2aa198}.kint-report{border-collapse:collapse;empty-cells:show;border-spacing:0}.kint-report *{font-size:12px}.kint-report dt{background:none;padding:2.5px}.kint-report dt .kint-parent{min-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kint-report td,.kint-report th{border:1px solid #93a1a1;padding:2.5px;vertical-align:top}.kint-report th{cursor:alias}.kint-report td{background:#fdf6e3;white-space:pre}.kint-report td>dl{padding:0}.kint-report pre{border-top:0;border-right:0}.kint-report th:first-child{background:none;border:0}.kint-report td:first-child,.kint-report th{font-weight:bold;background:#eee8d5;color:#586e75;padding:2.5px 0}.kint-report td.kint-empty{background:#d33682 !important}.kint-report tr:hover>td{box-shadow:0 0 1px 0 #268bd2 inset}.kint-report tr:hover var{color:#2aa198}.kint-report ul.kint-tabs li.kint-active-tab{height:20px;line-height:17px}.kint-trace .kint-source{line-height:18px}.kint-trace .kint-source span{padding-right:1px;border-right:3px inset #268bd2}.kint-trace .kint-source .kint-highlight{background:#eee8d5}.kint-trace .kint-parent>b{min-width:18px;display:inline-block;text-align:right;color:#586e75}.kint-trace .kint-parent>var>a{color:#268bd2}.kint-focused{box-shadow:0 0 3px 2px #859900 inset;border-radius:7px}.kint-microtime,.kint-color-preview{box-shadow:0 0 2px 0 #b6cedb;height:16px;text-align:center;text-shadow:-1px 0 #839496,0 1px #839496,1px 0 #839496,0 -1px #839496;width:230px;color:#fdf6e3}.kint footer li{color:#ddd}.kint>dl>dt,.kint ul.kint-tabs{box-shadow:4px 0 2px -3px #268bd2 inset}.kint ul.kint-tabs li.kint-active-tab{padding-top:7px;height:34px} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/aante-light.less b/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/aante-light.less deleted file mode 100644 index f342d757d..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/aante-light.less +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @author Ante Aljinovic https://github.com/aljinovic - */ -@import "../base"; - -@main-background: #f8f8f8; -@secondary-background : #f8f8f8; - -@text-color: #1d1e1e; -@variable-name-color: #1d1e1e; -@variable-type-color: #06f; -@variable-type-color-hover: #f00; - -@border-color: #d7d7d7; -@border-color-hover: #aaa; - -@caret-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAYAAAC5OOBJAAAAvklEQVR42mNgGMFAS0uLLSQk5HxoaOh/XDg4OLgdpwEBAQEGQAN+YtMIFH/i4ODAg9cFQNMbsWkOCgrKJMv5ID5Qipko/6M7PzAw0ImkAIQ5H0hvISv0gZpP+fn5qZAVfcBAkmEYBaNZcjRLjmbJUUCvqAIlDlAiASUWkjWDkiU0eTaSpBGUEZBy1E9QRiFWLzO2LEmU80GZHkcRhN/5oGIGVNzgKIbwOx9UwOErAIl2/igYzZKjWXI0S9IHAAASJijo0Ypj8AAAAABJRU5ErkJggg=="); - -.keyboard-caret() { - box-shadow : 0 0 3px 2px @variable-type-color-hover; -} - -.kint { - dt { - font-weight : normal; - - &.kint-parent { - margin-top : 4px; - } - } - - > dl { - background : linear-gradient(90deg, rgba(255,255,255,0) 0, #fff 15px); - } - - dl dl { - margin-top : 4px; - padding-left : 25px; - border-left : none; - } - - > dl > dt { - background : @secondary-background; - } - - // - // TABS - // -------------------------------------------------- - - ul { - margin : 0; - padding-left : 0; - - &:not(.kint-tabs) > li { - border-left : 0; - } - - &.kint-tabs { - background : @secondary-background; - border : @border; - border-width : 0 1px 1px 1px; - padding : 4px 0 0 12px; - margin-left : -1px; - margin-top : -1px; - - li, - li + li { - margin : 0 0 0 4px; - } - - li { - border-bottom-width : 0; - height : @spacing * 6px + 1px; - - - &:first-child { - margin-left : 0; - } - - &.kint-active-tab { - border-top : @border; - background : #fff; - font-weight : bold; - padding-top : 0; - border-bottom : 1px solid #fff !important; - margin-bottom : -1px; - } - - &.kint-active-tab:hover { - border-bottom : 1px solid #fff; - } - } - } - - > li > pre { - border : @border; - } - } - - dt:hover + dd > ul { - border-color : @border-color-hover; - } - - pre { - background : #fff; - margin-top : 4px; - margin-left : 25px; - } - - .kint-popup-trigger:hover { - color : @variable-type-color-hover; - } - - .kint-source .kint-highlight { - background : #cfc; - } -} - -// -// REPORT -// -------------------------------------------------- - -.kint-report { - td { - background : #fff; - - > dl { - padding : 0; - margin : 0; - > dt.kint-parent { - margin: 0; - } - } - } - - td:first-child, - td, - th { - padding : 2px 4px; - } - - td.kint-empty { - background : @border-color !important; - } - - dd, dt { - background: #fff; - } - - tr:hover > td { - box-shadow : none; - background : #cfc; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/original.less b/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/original.less deleted file mode 100644 index 839a9de47..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/original.less +++ /dev/null @@ -1,43 +0,0 @@ -@import "../base"; - -@main-background: #e0eaef; -@secondary-background: #c1d4df; - -@text-color: #1d1e1e; -@variable-name-color: #1d1e1e; -@variable-type-color: #0092db; -@variable-type-color-hover: #5cb730; - -@border-color: #b6cedb; -@border-color-hover: #0092db; - -@caret-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAA8CAMAAACO5hB7AAAACVBMVEX///82b4tctzBls0NMAAAAQklEQVR42rWRIQ4AAAgCwf8/2qgER2BeuwJsgAqIzekMfMryPL9XQSkobE6vwKcsz/N7FfPvh09lnPf/b+7673+f0uHuAZ/EdkNQAAAAAElFTkSuQmCC"); - -.keyboard-caret() { - box-shadow : 0 0 3px 2px #5cb730; -} - -.kint { - > dl > dt { - background : linear-gradient(to bottom, #e3ecf0 0, #c0d4df 100%); - } - - ul.kint-tabs { - background : linear-gradient(to bottom, #9dbed0 0px, #b2ccda 100%); - } - - & > dl:not(.kint-trace) > dd > ul.kint-tabs li { - background : @main-background; - &.kint-active-tab { - background : @secondary-background; - } - } - - & > dl.kint-trace > dt { - background : linear-gradient(to bottom, #c0d4df 0px, #e3ecf0 100%); - } - - .kint-source .kint-highlight { - background : #f0eb96; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized-dark.less b/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized-dark.less deleted file mode 100644 index f8467e13a..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized-dark.less +++ /dev/null @@ -1,39 +0,0 @@ -@import "../base"; - -@spacing : 5; - -@main-background: #002b36; // base 03 -@secondary-background : #073642; // base 02 - -@text-color: #839496; // base 0 -@variable-name-color: #93a1a1; // base 1 -@variable-type-color: #268bd2; // blue -@variable-type-color-hover: #2aa198; // cyan - -@border-color: #586e75; // base 01 -@border-color-hover: #268bd2; // blue - -.keyboard-caret() { - box-shadow : 0 0 3px 2px #859900 inset; // green - border-radius : 7px; -} - -body { - background : @secondary-background; - color : #fff; // for non-kint elements to remain at least semi-readable -} - -.kint { - background : @secondary-background; - box-shadow : 0 0 5px 3px @secondary-background; - - > dl > dt, - ul.kint-tabs { - box-shadow : 4px 0 2px -3px @variable-type-color inset; - } -} - -.kint ul.kint-tabs li.kint-active-tab { - padding-top: 7px; - height: 34px; -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized.less b/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized.less deleted file mode 100644 index ded8748ba..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/kint/view/themes/solarized.less +++ /dev/null @@ -1,29 +0,0 @@ -@import "../base"; - -@spacing : 5; - -@main-background: #fdf6e3; // base 3 -@secondary-background : #eee8d5; // base 2 - -@text-color: #657b83; // base 00 -@variable-name-color: #586e75; // base 01 -@variable-type-color: #268bd2; // blue -@variable-type-color-hover: #2aa198; // cyan - -@border-color: #93a1a1; // base 1 -@border-color-hover: #268bd2; // blue - -.keyboard-caret() { - box-shadow : 0 0 3px 2px #859900 inset; // green - border-radius : 7px; -} - -.kint > dl > dt, -.kint ul.kint-tabs { - box-shadow : 4px 0 2px -3px @variable-type-color inset; -} - -.kint ul.kint-tabs li.kint-active-tab { - padding-top: 7px; - height: 34px; -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/kint/src/Plugin/Devel/Dumper/Kint.php b/sites/all/modules/contrib/dev/devel/kint/src/Plugin/Devel/Dumper/Kint.php deleted file mode 100644 index 75d32996c..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/src/Plugin/Devel/Dumper/Kint.php +++ /dev/null @@ -1,51 +0,0 @@ -Kint debugging tool."), - * ) - */ -class Kint extends DevelDumperBase { - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - // @TODO find another solution for kint class inclusion! - kint_require(); - } - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - ob_start(); - \Kint::dump($input); - $dump = ob_get_clean(); - - // Kint does't allow to assign a title to the dump. Workaround to use the - // passed in name as dump title. - if ($name) { - $dump = preg_replace('/\$input/', $name, $dump, 1); - } - - return $this->setSafeMarkup($dump); - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return kint_require(); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/kint/src/Twig/KintExtension.php b/sites/all/modules/contrib/dev/devel/kint/src/Twig/KintExtension.php deleted file mode 100644 index 4f177f9bf..000000000 --- a/sites/all/modules/contrib/dev/devel/kint/src/Twig/KintExtension.php +++ /dev/null @@ -1,154 +0,0 @@ - array('html'), - 'needs_environment' => TRUE, - 'needs_context' => TRUE, - 'is_variadic' => TRUE, - )), - ); - } - - /** - * Provides Kint function to Twig templates. - * - * Handles 0, 1, or multiple arguments. - * - * Code derived from https://github.com/barelon/CgKintBundle. - * - * @param \Twig_Environment $env - * The twig environment instance. - * @param array $context - * An array of parameters passed to the template. - * @param array $args - * An array of parameters passed the function. - * - * @return string - * String representation of the input variables. - */ - public function kint(\Twig_Environment $env, array $context, array $args = []) { - // Don't do anything unless twig_debug is enabled. This reads from the Twig - // environment, not Drupal Settings, so a container rebuild is necessary - // when toggling twig_debug on and off. We can consider injecting Settings. - if (!$env->isDebug()) { - return; - } - kint_require(); - // Don't display where Kint was called from. - // @todo Can we add information about which template Kint was called from? - \Kint::$displayCalledFrom = FALSE; - - // No arguments passed to kint(), display full Twig context. - if (empty($args)) { - $kint_variable = array(); - foreach ($context as $key => $value) { - if (!$value instanceof \Twig_Template) { - $kint_variable[$key] = $value; - } - } - - $result = @\Kint::dump($kint_variable); - $output = str_replace('$kint_variable', 'Twig context', $result); - } - else { - // Try to get the names of variables from the Twig template. - $parameters = $this->getTwigFunctionParameters(); - - // If there is only one argument, pass to Kint without too much hassle. - if (count($args) == 1) { - $kint_variable = reset($args); - $variable_name = reset($parameters); - $result = @\Kint::dump($kint_variable); - // Replace $kint_variable with the name of the variable in the Twig - // template. - $output = str_replace('$kint_variable', $variable_name, $result); - } - else { - $kint_args = []; - // Build an array of variable to pass to Kint. - // @todo Can we just call_user_func_array while still retaining the - // variable names? - foreach ($args as $index => $arg) { - // Prepend a unique index to allow debugging the same variable more - // than once in the same Kint dump. - $name = !empty($parameters[$index]) ? $parameters[$index] : $index; - $kint_args['_index_' . $index . '_' . $name] = $arg; - } - - $result = @\Kint::dump($kint_args); - // Display a comma separated list of the variables contained in this group. - $output = str_replace('$kint_args', implode(', ', $parameters), $result); - // Remove unique indexes from output. - $output = preg_replace('/_index_([0-9]+)_/', '', $output); - } - } - - return $output; - } - - /** - * Gets the twig function parameters for the current invocation. - * - * @return array - * The detected twig function parameters. - */ - protected function getTwigFunctionParameters() { - $callee = NULL; - $template = NULL; - - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); - - foreach ($backtrace as $index => $trace) { - if (isset($trace['object']) && $trace['object'] instanceof \Twig_Template && 'Twig_Template' !== get_class($trace['object'])) { - $template = $trace['object']; - $callee = $backtrace[$index - 1]; - break; - } - } - - $parameters = []; - - /** @var \Twig_Template $template */ - if (NULL !== $template && NULL !== $callee) { - $line_number = $callee['line']; - $debug_infos = $template->getDebugInfo(); - - if (isset($debug_infos[$line_number])) { - $source_line = $debug_infos[$line_number]; - $source_file_name = $template->getTemplateName(); - - if (is_readable($source_file_name)) { - $source = file($source_file_name, FILE_IGNORE_NEW_LINES); - $line = $source[$source_line - 1]; - - preg_match('/kint\((.+)\)/', $line, $matches); - if (isset($matches[1])) { - $parameters = array_map('trim', explode(',', $matches[1])); - } - } - } - } - - return $parameters; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Annotation/DevelDumper.php b/sites/all/modules/contrib/dev/devel/src/Annotation/DevelDumper.php deleted file mode 100644 index 582aace5b..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Annotation/DevelDumper.php +++ /dev/null @@ -1,44 +0,0 @@ -token = $token; - $this->container = $container; - $this->eventDispatcher = $eventDispatcher; - $this->moduleHandler = $moduleHandler; - } - - /** - * @return \Drupal\Core\Extension\ModuleHandlerInterface - */ - public function getModuleHandler() { - return $this->moduleHandler; - } - - /** - * @return mixed - */ - public function getEventDispatcher() { - return $this->eventDispatcher; - } - - /** - * @return mixed - */ - public function getContainer() { - return $this->container; - } - - /** - * @return Token - */ - public function getToken() { - return $this->token; - } - - /** - * Uninstall, and Install modules. - - * @command devel:reinstall - * @param $modules A comma-separated list of module names. - * @aliases dre,devel-reinstall - * @allow-additional-options pm-uninstall,pm-enable - */ - public function reinstall($modules) { - $modules = StringUtils::csvToArray($modules); - - $modules_str = implode(',', $modules); - drush_invoke_process('@self', 'pm:uninstall', [$modules_str], []); - drush_invoke_process('@self', 'pm:enable', [$modules_str], []); - } - - /** - * List implementations of a given hook and optionally edit one. - * - * @command devel:hook - * @param $hook The name of the hook to explore. - * @param $implementation The name of the implementation to edit. Usually omitted. - * @usage devel-hook cron - * List implementations of hook_cron(). - * @aliases fnh,fn-hook,hook,devel-hook - * @optionset_get_editor - */ - function hook($hook, $implementation) { - // Get implementations in the .install files as well. - include_once './core/includes/install.inc'; - drupal_load_updates(); - $info = $this->codeLocate($implementation . "_$hook"); - $exec = drush_get_editor(); - drush_shell_exec_interactive($exec, $info['file']); - } - - /** - * @hook interact hook - */ - public function hookInteract(Input $input, Output $output) { - if (!$input->getArgument('implementation')) { - if ($hook_implementations = $this->getModuleHandler()->getImplementations($input->getArgument('hook'))) { - if (!$choice = $this->io()->choice('Enter the number of the hook implementation you wish to view.', array_combine($hook_implementations, $hook_implementations))) { - throw new UserAbortException(); - } - $input->setArgument('implementation', $choice); - } - else { - throw new \Exception(dt('No implementations')); - } - } - } - - /** - * List implementations of a given event and optionally edit one. - * - * @command devel:event - * @param $event The name of the event to explore. If omitted, a list of events is shown. - * @param $implementation The name of the implementation to show. Usually omitted. - * @usage devel-event - * Pick a Kernel event, then pick an implementation, and then view its source code. - * @usage devel-event kernel.terminate - * Pick a terminate subscribers implementation and view its source code. - * @aliases fne,fn-event,event - */ - function event($event, $implementation) { - $info= $this->codeLocate($implementation); - $exec = drush_get_editor(); - drush_shell_exec_interactive($exec, $info['file']); - } - - /** - * @hook interact devel:event - */ - public function interactEvent(Input $input, Output $output) { - $dispatcher = $this->getEventDispatcher(); - if (!$input->getArgument('event')) { - // @todo Expand this list. - $events = array('kernel.controller', 'kernel.exception', 'kernel.request', 'kernel.response', 'kernel.terminate', 'kernel.view'); - $events = array_combine($events, $events); - if (!$event = $this->io()->choice('Enter the event you wish to explore.', $events)) { - throw new UserAbortException(); - } - $input->setArgument('event', $event); - } - if ($implementations = $dispatcher->getListeners($event)) { - foreach ($implementations as $implementation) { - $callable = get_class($implementation[0]) . '::' . $implementation[1]; - $choices[$callable] = $callable; - } - if (!$choice = $this->io()->choice('Enter the number of the implementation you wish to view.', $choices)) { - throw new UserAbortException(); - } - $input->setArgument('implementation', $choice); - } - else { - throw new \Exception(dt('No implementations.')); - } - } - - /** - * List available tokens. - * - * @command devel:token - * @aliases token,devel-token - * @field-labels - * group: Group - * token: Token - * name: Name - * @default-fields group,token,name - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - */ - public function token($options = ['format' => 'table']) { - $all = $this->getToken()->getInfo(); - foreach ($all['tokens'] as $group => $tokens) { - foreach ($tokens as $key => $token) { - $rows[] = [ - 'group' => $group, - 'token' => $key, - 'name' => $token['name'], - ]; - } - } - return new RowsOfFields($rows); - } - - /** - * Generate a UUID. - * - * @command devel:uuid - * @aliases uuid,devel-uuid - * @usage drush devel-uuid - * Outputs a Universally Unique Identifier. - * - * @return string - */ - public function uuid() { - $uuid = new Php(); - return $uuid->generate(); - } - - - /** - * Get source code line for specified function or method. - */ - function codeLocate($function_name) { - // Get implementations in the .install files as well. - include_once './core/includes/install.inc'; - drupal_load_updates(); - - if (strpos($function_name, '::') === FALSE) { - if (!function_exists($function_name)) { - throw new \Exception(dt('Function not found')); - } - $reflect = new \ReflectionFunction($function_name); - } - else { - list($class, $method) = explode('::', $function_name); - if (!method_exists($class, $method)) { - throw new \Exception(dt('Method not found')); - } - $reflect = new \ReflectionMethod($class, $method); - } - return array('file' => $reflect->getFileName(), 'startline' => $reflect->getStartLine(), 'endline' => $reflect->getEndLine()); - - } - - /** - * Get a list of available container services. - * - * @command devel:services - * @param $prefix A prefix to filter the service list by. - * @aliases devel-container-services,dcs,devel-services - * @usage drush devel-services - * Gets a list of all available container services - * @usage drush dcs plugin.manager - * Get all services containing "plugin.manager" - * - * @return array - */ - public function services($prefix = NULL, $options = ['format' => 'yaml']) { - $container = $this->getContainer(); - - // Get a list of all available service IDs. - $services = $container->getServiceIds(); - - // If there is a prefix, try to find matches. - if (isset($prefix)) { - $services = preg_grep("/$prefix/", $services); - } - - if (empty($services)) { - throw new \Exception(dt('No container services found.')); - } - - sort($services); - return $services; - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/ContainerInfoController.php b/sites/all/modules/contrib/dev/devel/src/Controller/ContainerInfoController.php deleted file mode 100644 index eba5e2c88..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/ContainerInfoController.php +++ /dev/null @@ -1,274 +0,0 @@ -kernel = $drupalKernel; - $this->dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('kernel'), - $container->get('devel.dumper') - ); - } - - /** - * Builds the services overview page. - * - * @return array - * A render array as expected by the renderer. - */ - public function serviceList() { - $headers = [ - $this->t('ID'), - $this->t('Class'), - $this->t('Alias'), - $this->t('Operations'), - ]; - - $rows = []; - - if ($container = $this->kernel->getCachedContainerDefinition()) { - foreach ($container['services'] as $service_id => $definition) { - $service = unserialize($definition); - - $row['id'] = [ - 'data' => $service_id, - 'class' => 'table-filter-text-source', - ]; - $row['class'] = [ - 'data' => isset($service['class']) ? $service['class'] : '', - 'class' => 'table-filter-text-source', - ]; - $row['alias'] = [ - 'data' => array_search($service_id, $container['aliases']) ?: '', - 'class' => 'table-filter-text-source', - ]; - $row['operations']['data'] = [ - '#type' => 'operations', - '#links' => [ - 'devel' => [ - 'title' => $this->t('Devel'), - 'url' => Url::fromRoute('devel.container_info.service.detail', ['service_id' => $service_id]), - ], - ], - ]; - - $rows[$service_id] = $row; - } - - ksort($rows); - } - - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['table-filter', 'js-show'], - ], - ]; - $output['filters']['text'] = [ - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter service id, alias or class'), - '#attributes' => [ - 'class' => ['table-filter-text'], - 'data-table' => '.devel-filter-text', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the service id, service alias or class to filter by.'), - ], - ]; - $output['services'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#empty' => $this->t('No services found.'), - '#sticky' => TRUE, - '#attributes' => [ - 'class' => ['devel-service-list', 'devel-filter-text'], - ], - ]; - - return $output; - } - - /** - * Returns a render array representation of the service. - * - * @param string $service_id - * The ID of the service to retrieve. - * - * @return array - * A render array containing the service detail. - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * If the requested service is not defined. - */ - public function serviceDetail($service_id) { - $instance = $this->container->get($service_id, ContainerInterface::NULL_ON_INVALID_REFERENCE); - if ($instance === NULL) { - throw new NotFoundHttpException(); - } - - $output = []; - - if ($cached_definitions = $this->kernel->getCachedContainerDefinition()) { - // Tries to retrieve the service definition from the kernel's cached - // container definition. - if (isset($cached_definitions['services'][$service_id])) { - $definition = unserialize($cached_definitions['services'][$service_id]); - - // If the service has an alias add it to the definition. - if ($alias = array_search($service_id, $cached_definitions['aliases'])) { - $definition['alias'] = $alias; - } - - $output['definition'] = $this->dumper->exportAsRenderable($definition, $this->t('Computed Definition')); - } - } - - $output['instance'] = $this->dumper->exportAsRenderable($instance, $this->t('Instance')); - - return $output; - } - - /** - * Builds the parameters overview page. - * - * @return array - * A render array as expected by the renderer. - */ - public function parameterList() { - $headers = [ - $this->t('Name'), - $this->t('Operations'), - ]; - - $rows = []; - - if ($container = $this->kernel->getCachedContainerDefinition()) { - foreach ($container['parameters'] as $parameter_name => $definition) { - $row['name'] = [ - 'data' => $parameter_name, - 'class' => 'table-filter-text-source', - ]; - $row['operations']['data'] = [ - '#type' => 'operations', - '#links' => [ - 'devel' => [ - 'title' => $this->t('Devel'), - 'url' => Url::fromRoute('devel.container_info.parameter.detail', ['parameter_name' => $parameter_name]), - ], - ], - ]; - - $rows[$parameter_name] = $row; - } - - ksort($rows); - } - - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['table-filter', 'js-show'], - ], - ]; - $output['filters']['text'] = [ - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter parameter name'), - '#attributes' => [ - 'class' => ['table-filter-text'], - 'data-table' => '.devel-filter-text', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the parameter name to filter by.'), - ], - ]; - $output['parameters'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#empty' => $this->t('No parameters found.'), - '#sticky' => TRUE, - '#attributes' => [ - 'class' => ['devel-parameter-list', 'devel-filter-text'], - ], - ]; - - return $output; - } - - /** - * Returns a render array representation of the parameter value. - * - * @param string $parameter_name - * The name of the parameter to retrieve. - * - * @return array - * A render array containing the parameter value. - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * If the requested parameter is not defined. - */ - public function parameterDetail($parameter_name) { - try { - $parameter = $this->container->getParameter($parameter_name); - } - catch (ParameterNotFoundException $e) { - throw new NotFoundHttpException(); - } - - return $this->dumper->exportAsRenderable($parameter); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/DevelController.php b/sites/all/modules/contrib/dev/devel/src/Controller/DevelController.php deleted file mode 100644 index 2c3a7b4de..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/DevelController.php +++ /dev/null @@ -1,189 +0,0 @@ -dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('devel.dumper')); - } - - /** - * Clears all caches, then redirects to the previous page. - */ - public function cacheClear() { - drupal_flush_all_caches(); - drupal_set_message('Cache cleared.'); - return $this->redirect(''); - } - - public function themeRegistry() { - $hooks = theme_get_registry(); - ksort($hooks); - return $this->dumper->exportAsRenderable($hooks); - } - - /** - * Builds the fields info overview page. - * - * @return array - * Array of page elements to render. - */ - public function fieldInfoPage() { - $fields = FieldStorageConfig::loadMultiple(); - ksort($fields); - $output['fields'] = $this->dumper->exportAsRenderable($fields, $this->t('Fields')); - - $field_instances = FieldConfig::loadMultiple(); - ksort($field_instances); - $output['instances'] = $this->dumper->exportAsRenderable($field_instances, $this->t('Instances')); - - $bundles = \Drupal::service('entity_type.bundle.info')->getAllBundleInfo(); - ksort($bundles); - $output['bundles'] = $this->dumper->exportAsRenderable($bundles, $this->t('Bundles')); - - $field_types = \Drupal::service('plugin.manager.field.field_type')->getUiDefinitions(); - ksort($field_types); - $output['field_types'] = $this->dumper->exportAsRenderable($field_types, $this->t('Field types')); - - $formatter_types = \Drupal::service('plugin.manager.field.formatter')->getDefinitions(); - ksort($formatter_types); - $output['formatter_types'] = $this->dumper->exportAsRenderable($formatter_types, $this->t('Formatter types')); - - $widget_types = \Drupal::service('plugin.manager.field.widget')->getDefinitions(); - ksort($widget_types); - $output['widget_types'] = $this->dumper->exportAsRenderable($widget_types, $this->t('Widget types')); - - return $output; - } - - /** - * Builds the state variable overview page. - * - * @return array - * Array of page elements to render. - */ - public function stateSystemPage() { - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = array( - '#type' => 'container', - '#attributes' => array( - 'class' => array('table-filter', 'js-show'), - ), - ); - - $output['filters']['text'] = array( - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter state name'), - '#attributes' => array( - 'class' => array('table-filter-text'), - 'data-table' => '.devel-state-list', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the state name to filter by.'), - ), - ); - - $can_edit = $this->currentUser()->hasPermission('administer site configuration'); - - $header = array( - 'name' => $this->t('Name'), - 'value' => $this->t('Value'), - ); - - if ($can_edit) { - $header['edit'] = $this->t('Operations'); - } - - $rows = array(); - // State class doesn't have getAll method so we get all states from the - // KeyValueStorage. - foreach ($this->keyValue('state')->getAll() as $state_name => $state) { - $rows[$state_name] = array( - 'name' => array( - 'data' => $state_name, - 'class' => 'table-filter-text-source', - ), - 'value' => array( - 'data' => $this->dumper->export($state), - ), - ); - - if ($can_edit) { - $operations['edit'] = array( - 'title' => $this->t('Edit'), - 'url' => Url::fromRoute('devel.system_state_edit', array('state_name' => $state_name)), - ); - $rows[$state_name]['edit'] = array( - 'data' => array('#type' => 'operations', '#links' => $operations), - ); - } - } - - $output['states'] = array( - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('No state variables found.'), - '#attributes' => array( - 'class' => array('devel-state-list'), - ), - ); - - return $output; - } - - /** - * Builds the session overview page. - * - * @return array - * Array of page elements to render. - */ - public function session() { - $output['description'] = array( - '#markup' => '

    ' . $this->t('Here are the contents of your $_SESSION variable.') . '

    ', - ); - $output['session'] = array( - '#type' => 'table', - '#header' => array($this->t('Session name'), $this->t('Session ID')), - '#rows' => array(array(session_name(), session_id())), - '#empty' => $this->t('No session available.'), - ); - $output['data'] = $this->dumper->exportAsRenderable($_SESSION); - - return $output; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/ElementInfoController.php b/sites/all/modules/contrib/dev/devel/src/Controller/ElementInfoController.php deleted file mode 100644 index a0440c327..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/ElementInfoController.php +++ /dev/null @@ -1,162 +0,0 @@ -elementInfo = $element_info; - $this->dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('element_info'), - $container->get('devel.dumper') - ); - } - - /** - * Builds the element overview page. - * - * @return array - * A render array as expected by the renderer. - */ - public function elementList() { - $headers = [ - $this->t('Name'), - $this->t('Provider'), - $this->t('Class'), - $this->t('Operations'), - ]; - - $rows = []; - - foreach ($this->elementInfo->getDefinitions() as $element_type => $definition) { - $row['name'] = [ - 'data' => $element_type, - 'class' => 'table-filter-text-source', - ]; - $row['provider'] = [ - 'data' => $definition['provider'], - 'class' => 'table-filter-text-source', - ]; - $row['class'] = [ - 'data' => $definition['class'], - 'class' => 'table-filter-text-source', - ]; - $row['operations']['data'] = [ - '#type' => 'operations', - '#links' => [ - 'devel' => [ - 'title' => $this->t('Devel'), - 'url' => Url::fromRoute('devel.elements_page.detail', ['element_name' => $element_type]), - 'attributes' => [ - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - 'minHeight' => 500, - ]), - ], - ], - ], - ]; - - $rows[$element_type] = $row; - } - - ksort($rows); - - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['table-filter', 'js-show'], - ], - ]; - $output['filters']['text'] = [ - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter element id, provider or class'), - '#attributes' => [ - 'class' => ['table-filter-text'], - 'data-table' => '.devel-filter-text', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the element id, provider or class to filter by.'), - ], - ]; - $output['elements'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#empty' => $this->t('No elements found.'), - '#sticky' => TRUE, - '#attributes' => [ - 'class' => ['devel-element-list', 'devel-filter-text'], - ], - ]; - - return $output; - } - - /** - * Returns a render array representation of the element. - * - * @param string $element_name - * The name of the element to retrieve. - * - * @return array - * A render array containing the element. - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * If the requested element is not defined. - */ - public function elementDetail($element_name) { - if (!$element = $this->elementInfo->getDefinition($element_name, FALSE)) { - throw new NotFoundHttpException(); - } - - $element += $this->elementInfo->getInfo($element_name); - return $this->dumper->exportAsRenderable($element, $element_name); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/EntityDebugController.php b/sites/all/modules/contrib/dev/devel/src/Controller/EntityDebugController.php deleted file mode 100644 index 515a9fc39..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/EntityDebugController.php +++ /dev/null @@ -1,143 +0,0 @@ -dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('devel.dumper')); - } - - /** - * Returns the entity type definition of the current entity. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * A RouteMatch object. - * - * @return array - * Array of page elements to render. - */ - public function entityTypeDefinition(RouteMatchInterface $route_match) { - $output = []; - - $entity = $this->getEntityFromRouteMatch($route_match); - - if ($entity instanceof EntityInterface) { - $output = $this->dumper->exportAsRenderable($entity->getEntityType()); - } - - return $output; - } - - /** - * Returns the loaded structure of the current entity. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * A RouteMatch object. - * - * @return array - * Array of page elements to render. - */ - public function entityLoad(RouteMatchInterface $route_match) { - $output = []; - - $entity = $this->getEntityFromRouteMatch($route_match); - - if ($entity instanceof EntityInterface) { - // Field definitions are lazy loaded and are populated only when needed. - // By calling ::getFieldDefinitions() we are sure that field definitions - // are populated and available in the dump output. - // @see https://www.drupal.org/node/2311557 - if($entity instanceof FieldableEntityInterface) { - $entity->getFieldDefinitions(); - } - - $output = $this->dumper->exportAsRenderable($entity); - } - - return $output; - } - - /** - * Returns the render structure of the current entity. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * A RouteMatch object. - * - * @return array - * Array of page elements to render. - */ - public function entityRender(RouteMatchInterface $route_match) { - $output = []; - - $entity = $this->getEntityFromRouteMatch($route_match); - - if ($entity instanceof EntityInterface) { - $entity_type_id = $entity->getEntityTypeId(); - $view_hook = $entity_type_id . '_view'; - - $build = []; - // If module implements own {entity_type}_view() hook use it, otherwise - // fallback to the entity view builder if available. - if (function_exists($view_hook)) { - $build = $view_hook($entity); - } - elseif ($this->entityTypeManager()->hasHandler($entity_type_id, 'view_builder')) { - $build = $this->entityTypeManager()->getViewBuilder($entity_type_id)->view($entity); - } - - $output = $this->dumper->exportAsRenderable($build); - } - - return $output; - } - - /** - * Retrieves entity from route match. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * - * @return \Drupal\Core\Entity\EntityInterface|null - * The entity object as determined from the passed-in route match. - */ - protected function getEntityFromRouteMatch(RouteMatchInterface $route_match) { - $parameter_name = $route_match->getRouteObject()->getOption('_devel_entity_type_id'); - $entity = $route_match->getParameter($parameter_name); - return $entity; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/EntityTypeInfoController.php b/sites/all/modules/contrib/dev/devel/src/Controller/EntityTypeInfoController.php deleted file mode 100644 index f8bac6dc0..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/EntityTypeInfoController.php +++ /dev/null @@ -1,154 +0,0 @@ -dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('devel.dumper') - ); - } - - /** - * Builds the entity types overview page. - * - * @return array - * A render array as expected by the renderer. - */ - public function entityTypeList() { - $headers = [ - $this->t('ID'), - $this->t('Name'), - $this->t('Provider'), - $this->t('Class'), - $this->t('Operations'), - ]; - - $rows = []; - - foreach ($this->entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) { - $row['id'] = [ - 'data' => $entity_type->id(), - 'class' => 'table-filter-text-source', - ]; - $row['name'] = [ - 'data' => $entity_type->getLabel(), - 'class' => 'table-filter-text-source', - ]; - $row['provider'] = [ - 'data' => $entity_type->getProvider(), - 'class' => 'table-filter-text-source', - ]; - $row['class'] = [ - 'data' => $entity_type->getClass(), - 'class' => 'table-filter-text-source', - ]; - $row['operations']['data'] = [ - '#type' => 'operations', - '#links' => [ - 'devel' => [ - 'title' => $this->t('Devel'), - 'url' => Url::fromRoute('devel.entity_info_page.detail', ['entity_type_id' => $entity_type_id]), - 'attributes' => [ - 'class' => ['use-ajax'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - 'minHeight' => 500, - ]), - ], - ], - ], - ]; - - $rows[$entity_type_id] = $row; - } - - ksort($rows); - - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['table-filter', 'js-show'], - ], - ]; - $output['filters']['text'] = [ - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter entity type id, provider or class'), - '#attributes' => [ - 'class' => ['table-filter-text'], - 'data-table' => '.devel-filter-text', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the entity type id, provider or class to filter by.'), - ], - ]; - $output['entities'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#empty' => $this->t('No entity types found.'), - '#sticky' => TRUE, - '#attributes' => [ - 'class' => ['devel-entity-type-list', 'devel-filter-text'], - ], - ]; - - return $output; - } - - /** - * Returns a render array representation of the entity type. - * - * @param string $entity_type_id - * The name of the entity type to retrieve. - * - * @return array - * A render array containing the entity type. - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * If the requested entity type is not defined. - */ - public function entityTypeDetail($entity_type_id) { - if (!$entity_type = $this->entityTypeManager()->getDefinition($entity_type_id, FALSE)) { - throw new NotFoundHttpException(); - } - - return $this->dumper->exportAsRenderable($entity_type, $entity_type_id); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/EventInfoController.php b/sites/all/modules/contrib/dev/devel/src/Controller/EventInfoController.php deleted file mode 100644 index e8ea0cd64..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/EventInfoController.php +++ /dev/null @@ -1,136 +0,0 @@ -eventDispatcher = $event_dispatcher; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('event_dispatcher') - ); - } - - /** - * Builds the events overview page. - * - * @return array - * A render array as expected by the renderer. - */ - public function eventList() { - $headers = [ - 'name' => [ - 'data' => $this->t('Event Name'), - 'class' => 'visually-hidden', - ], - 'callable' => $this->t('Callable'), - 'priority' => $this->t('Priority'), - ]; - - $event_listeners = $this->eventDispatcher->getListeners(); - ksort($event_listeners); - - $rows = []; - - foreach ($event_listeners as $event_name => $listeners) { - - $rows[][] = [ - 'data' => $event_name, - 'class' => 'table-filter-text-source devel-event-name-header', - 'colspan' => '3', - 'header' => TRUE, - ]; - - foreach ($listeners as $priority => $listener) { - $row['name'] = [ - 'data' => $event_name, - 'class' => 'table-filter-text-source visually-hidden', - ]; - $row['class'] = [ - 'data' => $this->resolveCallableName($listener), - ]; - $row['priority'] = [ - 'data' => $priority, - ]; - $rows[] = $row; - } - } - - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['table-filter', 'js-show'], - ], - ]; - $output['filters']['name'] = [ - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter event name'), - '#attributes' => [ - 'class' => ['table-filter-text'], - 'data-table' => '.devel-filter-text', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the event name to filter by.'), - ], - ]; - $output['events'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#empty' => $this->t('No events found.'), - '#attributes' => [ - 'class' => ['devel-event-list', 'devel-filter-text'], - ], - ]; - - return $output; - } - - /** - * Helper function for resolve callable name. - * - * @param mixed $callable - * The for which resolve the name. Can be either the name of a function - * stored in a string variable, or an object and the name of a method - * within the object. - * - * @return string - * The resolved callable name or an empty string. - */ - protected function resolveCallableName($callable) { - if (is_callable($callable, TRUE, $callable_name)) { - return $callable_name; - } - return ''; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/LayoutInfoController.php b/sites/all/modules/contrib/dev/devel/src/Controller/LayoutInfoController.php deleted file mode 100644 index 4a2cff2c1..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/LayoutInfoController.php +++ /dev/null @@ -1,91 +0,0 @@ -layoutPluginManager = $pluginManagerLayout; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.core.layout') - ); - } - - /** - * Builds the Layout Info page. - * - * @return array - * Array of page elements to render. - */ - public function layoutInfoPage() { - $definedLayouts = []; - $layouts = $this->layoutPluginManager->getDefinitions(); - foreach ($layouts as $layout) { - // @todo Revisit once https://www.drupal.org/node/2660124 gets in, getting - // the image should be as simple as $layout->getIcon(). - $image = NULL; - if ($layout->getIconPath() != NULL) { - $image = [ - 'data' => [ - '#theme' => 'image', - '#uri' => $layout->getIconPath(), - '#alt' => $layout->getLabel(), - '#height' => '65', - ] - ]; - } - $definedLayouts[] = [ - $image, - $layout->getLabel(), - $layout->getDescription(), - $layout->getCategory(), - implode(', ', $layout->getRegionLabels()), - $layout->getProvider(), - ]; - } - - return [ - '#theme' => 'table', - '#header' => [ - $this->t('Icon'), - $this->t('Label'), - $this->t('Description'), - $this->t('Category'), - $this->t('Regions'), - $this->t('Provider'), - ], - '#rows' => $definedLayouts, - '#empty' => $this->t('No layouts available.'), - '#attributes' => [ - 'class' => ['devel-layout-list'], - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/RouteInfoController.php b/sites/all/modules/contrib/dev/devel/src/Controller/RouteInfoController.php deleted file mode 100644 index 45c9f6ded..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/RouteInfoController.php +++ /dev/null @@ -1,203 +0,0 @@ -routeProvider = $provider; - $this->router = $router; - $this->dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('router.route_provider'), - $container->get('router.no_access_checks'), - $container->get('devel.dumper') - ); - } - - /** - * Builds the routes overview page. - * - * @return array - * A render array as expected by the renderer. - */ - public function routeList() { - $headers = [ - $this->t('Route Name'), - $this->t('Path'), - $this->t('Allowed Methods'), - $this->t('Operations'), - ]; - - $rows = []; - - foreach ($this->routeProvider->getAllRoutes() as $route_name => $route) { - $row['name'] = [ - 'data' => $route_name, - 'class' => 'table-filter-text-source', - ]; - $row['path'] = [ - 'data' => $route->getPath(), - 'class' => 'table-filter-text-source', - ]; - $row['methods']['data'] = [ - '#theme' => 'item_list', - '#items' => $route->getMethods(), - '#empty' => $this->t('ANY'), - '#context' => ['list_style' => 'comma-list'], - ]; - - // We cannot resolve routes with dynamic parameters from route path. For - // these routes we pass the route name. - // @see ::routeItem() - if (strpos($route->getPath(), '{') !== FALSE) { - $parameters = ['query' => ['route_name' => $route_name]]; - } - else { - $parameters = ['query' => ['path' => $route->getPath()]]; - } - - $row['operations']['data'] = [ - '#type' => 'operations', - '#links' => [ - 'devel' => [ - 'title' => $this->t('Devel'), - 'url' => Url::fromRoute('devel.route_info.item', [], $parameters), - ], - ], - ]; - - $rows[] = $row; - } - - $output['#attached']['library'][] = 'system/drupal.system.modules'; - - $output['filters'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['table-filter', 'js-show'], - ], - ]; - $output['filters']['name'] = [ - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter route name or path'), - '#attributes' => [ - 'class' => ['table-filter-text'], - 'data-table' => '.devel-filter-text', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the route name or path to filter by.'), - ], - ]; - $output['routes'] = [ - '#type' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#empty' => $this->t('No routes found.'), - '#sticky' => TRUE, - '#attributes' => [ - 'class' => ['devel-route-list', 'devel-filter-text'], - ], - ]; - - return $output; - } - - /** - * Returns a render array representation of the route object. - * - * The method tries to resolve the route from the 'path' or the 'route_name' - * query string value if available. If no route is retrieved from the query - * string parameters it fallbacks to the current route. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * - * @return array - * A render array as expected by the renderer. - */ - public function routeDetail(Request $request, RouteMatchInterface $route_match) { - $route = NULL; - - // Get the route object from the path query string if available. - if ($path = $request->query->get('path')) { - try { - $route = $this->router->match($path); - } - catch (\Exception $e) { - drupal_set_message($this->t("Unable to load route for url '%url'", ['%url' => $path]), 'warning'); - } - } - - // Get the route object from the route name query string if available and - // the route is not retrieved by path. - if ($route === NULL && $route_name = $request->query->get('route_name')) { - try { - $route = $this->routeProvider->getRouteByName($route_name); - } - catch (\Exception $e) { - drupal_set_message($this->t("Unable to load route '%name'", ['%name' => $route_name]), 'warning'); - } - } - - // No route retrieved from path or name specified, get the current route. - if ($route === NULL) { - $route = $route_match->getRouteObject(); - } - - return $this->dumper->exportAsRenderable($route); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Controller/SwitchUserController.php b/sites/all/modules/contrib/dev/devel/src/Controller/SwitchUserController.php deleted file mode 100644 index e5da73c22..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Controller/SwitchUserController.php +++ /dev/null @@ -1,120 +0,0 @@ -account = $account; - $this->userStorage = $user_storage; - $this->moduleHandler = $module_handler; - $this->sessionManager = $session_manager; - $this->session = $session; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('current_user'), - $container->get('entity.manager')->getStorage('user'), - $container->get('module_handler'), - $container->get('session_manager'), - $container->get('session') - ); - } - - /** - * Switches to a different user. - * - * We don't call session_save_session() because we really want to change users. - * Usually unsafe! - * - * @param string $name - * The username to switch to, or NULL to log out. - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse - * A redirect response object. - * - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - public function switchUser($name = NULL) { - if (empty($name) || !($account = $this->userStorage->loadByProperties(['name' => $name]))) { - throw new AccessDeniedHttpException(); - } - $account = reset($account); - - // Call logout hooks when switching from original user. - $this->moduleHandler->invokeAll('user_logout', [$this->account]); - - // Regenerate the session ID to prevent against session fixation attacks. - $this->sessionManager->regenerate(); - - // Based off masquarade module as: - // https://www.drupal.org/node/218104 doesn't stick and instead only - // keeps context until redirect. - $this->account->setAccount($account); - $this->session->set('uid', $account->id()); - - // Call all login hooks when switching to masquerading user. - $this->moduleHandler->invokeAll('user_login', [$account]); - - return $this->redirect(''); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/DevelDumperBase.php b/sites/all/modules/contrib/dev/devel/src/DevelDumperBase.php deleted file mode 100644 index 5cfe70dd4..000000000 --- a/sites/all/modules/contrib/dev/devel/src/DevelDumperBase.php +++ /dev/null @@ -1,45 +0,0 @@ -export($input, $name); - } - - /** - * {@inheritdoc} - */ - public function exportAsRenderable($input, $name = NULL) { - return ['#markup' => $this->export($input, $name)]; - } - - /** - * Wrapper for \Drupal\Core\Render\Markup::create(). - * - * @param string $input - * The input string to mark as safe. - * - * @return string - * The unaltered input value. - */ - protected function setSafeMarkup($input) { - return FilteredMarkup::create($input); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/DevelDumperInterface.php b/sites/all/modules/contrib/dev/devel/src/DevelDumperInterface.php deleted file mode 100644 index 1236dd0be..000000000 --- a/sites/all/modules/contrib/dev/devel/src/DevelDumperInterface.php +++ /dev/null @@ -1,59 +0,0 @@ -config = $config_factory->get('devel.settings'); - $this->account = $account; - $this->dumperManager = $dumper_manager; - } - - /** - * Instances a new dumper plugin. - * - * @param string $plugin_id - * (optional) The plugin ID, defaults to NULL. - * - * @return \Drupal\devel\DevelDumperInterface - * Returns the devel dumper plugin instance. - */ - protected function createInstance($plugin_id = NULL) { - if (!$plugin_id || !$this->dumperManager->isPluginSupported($plugin_id)) { - $plugin_id = $this->config->get('devel_dumper'); - } - return $this->dumperManager->createInstance($plugin_id); - } - - /** - * {@inheritdoc} - */ - public function dump($input, $name = NULL, $plugin_id = NULL) { - if ($this->hasAccessToDevelInformation()) { - $this->createInstance($plugin_id)->dump($input, $name); - } - } - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL, $plugin_id = NULL) { - if ($this->hasAccessToDevelInformation()) { - return $this->createInstance($plugin_id)->export($input, $name); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function message($input, $name = NULL, $type = 'status', $plugin_id = NULL) { - if ($this->hasAccessToDevelInformation()) { - $output = $this->export($input, $name, $plugin_id); - drupal_set_message($output, $type, TRUE); - } - } - - /** - * {@inheritdoc} - */ - public function debug($input, $name = NULL, $plugin_id = NULL) { - $output = $this->createInstance($plugin_id)->export($input, $name) . "\n"; - // The temp directory does vary across multiple simpletest instances. - $file = file_directory_temp() . '/drupal_debug.txt'; - if (file_put_contents($file, $output, FILE_APPEND) === FALSE && $this->hasAccessToDevelInformation()) { - drupal_set_message($this->t('Devel was unable to write to %file.', ['%file' => $file]), 'error'); - return FALSE; - } - } - - /** - * {@inheritdoc} - */ - public function dumpOrExport($input, $name = NULL, $export = TRUE, $plugin_id = NULL) { - if ($this->hasAccessToDevelInformation()) { - $dumper = $this->createInstance($plugin_id); - if ($export) { - return $dumper->export($input, $name); - } - $dumper->dump($input, $name); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function exportAsRenderable($input, $name = NULL, $plugin_id = NULL) { - if ($this->hasAccessToDevelInformation()) { - return $this->createInstance($plugin_id)->exportAsRenderable($input, $name); - } - return []; - } - - /** - * Checks whether a user has access to devel information. - * - * @return bool - * TRUE if the user has the permission, FALSE otherwise. - */ - protected function hasAccessToDevelInformation() { - return $this->account && $this->account->hasPermission('access devel information'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/DevelDumperManagerInterface.php b/sites/all/modules/contrib/dev/devel/src/DevelDumperManagerInterface.php deleted file mode 100644 index 71ac6c531..000000000 --- a/sites/all/modules/contrib/dev/devel/src/DevelDumperManagerInterface.php +++ /dev/null @@ -1,102 +0,0 @@ -setCacheBackend($cache_backend, 'devel_dumper_plugins'); - $this->alterInfo('devel_dumper_info'); - } - - /** - * {@inheritdoc} - */ - public function processDefinition(&$definition, $plugin_id) { - parent::processDefinition($definition, $plugin_id); - - $definition['supported'] = (bool) call_user_func([$definition['class'], 'checkRequirements']); - } - - /** - * {@inheritdoc} - */ - public function isPluginSupported($plugin_id) { - $definition = $this->getDefinition($plugin_id, FALSE); - return $definition && $definition['supported']; - } - - /** - * {@inheritdoc} - */ - public function createInstance($plugin_id, array $configuration = []) { - if (!$this->isPluginSupported($plugin_id)) { - $plugin_id = $this->getFallbackPluginId($plugin_id); - } - return parent::createInstance($plugin_id, $configuration); - } - - /** - * {@inheritdoc} - */ - public function getFallbackPluginId($plugin_id, array $configuration = []) { - return 'default'; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/DevelDumperPluginManagerInterface.php b/sites/all/modules/contrib/dev/devel/src/DevelDumperPluginManagerInterface.php deleted file mode 100644 index 8f42ed2a3..000000000 --- a/sites/all/modules/contrib/dev/devel/src/DevelDumperPluginManagerInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -currentUser = $current_user; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('current_user') - ); - } - - /** - * Adds devel links to appropriate entity types. - * - * This is an alter hook bridge. - * - * @param \Drupal\Core\Entity\EntityTypeInterface[] $entity_types - * The master entity type list to alter. - * - * @see hook_entity_type_alter() - */ - public function entityTypeAlter(array &$entity_types) { - foreach ($entity_types as $entity_type_id => $entity_type) { - if (($entity_type->getFormClass('default') || $entity_type->getFormClass('edit')) && $entity_type->hasLinkTemplate('edit-form')) { - $entity_type->setLinkTemplate('devel-load', "/devel/$entity_type_id/{{$entity_type_id}}"); - } - if ($entity_type->hasViewBuilderClass() && $entity_type->hasLinkTemplate('canonical')) { - $entity_type->setLinkTemplate('devel-render', "/devel/$entity_type_id/{{$entity_type_id}}/render"); - } - if ($entity_type->hasLinkTemplate('devel-render') || $entity_type->hasLinkTemplate('devel-load')) { - $entity_type->setLinkTemplate('devel-definition', "/devel/$entity_type_id/{{$entity_type_id}}/definition"); - } - } - } - - /** - * Adds devel operations on entity that supports it. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity on which to define an operation. - * - * @return array - * An array of operation definitions. - * - * @see hook_entity_operation() - */ - public function entityOperation(EntityInterface $entity) { - $operations = []; - if ($this->currentUser->hasPermission('access devel information')) { - if ($entity->hasLinkTemplate('devel-load')) { - $operations['devel'] = [ - 'title' => $this->t('Devel'), - 'weight' => 100, - 'url' => $entity->toUrl('devel-load'), - ]; - } - elseif ($entity->hasLinkTemplate('devel-render')) { - $operations['devel'] = [ - 'title' => $this->t('Devel'), - 'weight' => 100, - 'url' => $entity->toUrl('devel-render'), - ]; - } - } - return $operations; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/EventSubscriber/ErrorHandlerSubscriber.php b/sites/all/modules/contrib/dev/devel/src/EventSubscriber/ErrorHandlerSubscriber.php deleted file mode 100644 index ee5ad21ba..000000000 --- a/sites/all/modules/contrib/dev/devel/src/EventSubscriber/ErrorHandlerSubscriber.php +++ /dev/null @@ -1,57 +0,0 @@ -account = $account; - } - - /** - * Register devel error handler. - * - * @param \Symfony\Component\EventDispatcher\Event $event - * The event to process. - */ - public function registerErrorHandler(Event $event = NULL) { - if ($this->account && $this->account->hasPermission('access devel information')) { - devel_set_handler(devel_get_handlers()); - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - // Runs as soon as possible in the request but after - // AuthenticationSubscriber (priority 300) because you need to access to - // the current user for determine whether register the devel error handler - // or not. - $events[KernelEvents::REQUEST][] = ['registerErrorHandler', 256]; - - return $events; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/EventSubscriber/ThemeInfoRebuildSubscriber.php b/sites/all/modules/contrib/dev/devel/src/EventSubscriber/ThemeInfoRebuildSubscriber.php deleted file mode 100644 index 32743f597..000000000 --- a/sites/all/modules/contrib/dev/devel/src/EventSubscriber/ThemeInfoRebuildSubscriber.php +++ /dev/null @@ -1,116 +0,0 @@ -config = $config->get('devel.settings'); - $this->account = $account; - $this->themeHandler = $theme_handler; - } - - /** - * Forces the system to rebuild the theme registry. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The event to process. - */ - public function rebuildThemeInfo(GetResponseEvent $event) { - if ($this->config->get('rebuild_theme')) { - // Update the theme registry. - drupal_theme_rebuild(); - // Refresh theme data. - $this->themeHandler->refreshInfo(); - // Resets the internal state of the theme handler and clear the 'system - // list' cache; this allow to properly register, if needed, PSR-4 - // namespaces for theme extensions after refreshing the info data. - $this->themeHandler->reset(); - // Notify the user that the theme info are rebuilt on every request. - $this->triggerWarningIfNeeded($event->getRequest()); - } - } - - /** - * Notifies the user that the theme info are rebuilt on every request. - * - * The warning message is shown only to users with adequate permissions and - * only once per session. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The request. - */ - protected function triggerWarningIfNeeded(Request $request) { - if ($this->account && $this->account->hasPermission('access devel information')) { - $session = $request->getSession(); - if ($session && !$session->has($this->notificationFlag)) { - $session->set($this->notificationFlag, TRUE); - $message = $this->t('The theme information is being rebuilt on every request. Remember to turn off this feature on production websites.', [':url' => Url::fromRoute('devel.admin_settings')->toString()]); - drupal_set_message($message, 'warning', TRUE); - } - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - // Set high priority value to start as early as possible. - $events[KernelEvents::REQUEST][] = ['rebuildThemeInfo', 256]; - return $events; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/ConfigEditor.php b/sites/all/modules/contrib/dev/devel/src/Form/ConfigEditor.php deleted file mode 100644 index 231298aac..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/ConfigEditor.php +++ /dev/null @@ -1,146 +0,0 @@ -config($config_name); - - if ($config === FALSE || $config->isNew()) { - drupal_set_message(t('Config @name does not exist in the system.', array('@name' => $config_name)), 'error'); - return; - } - - $data = $config->getOriginal(); - - if (empty($data)) { - drupal_set_message(t('Config @name exists but has no data.', array('@name' => $config_name)), 'warning'); - return; - } - - try { - $output = Yaml::encode($data); - } - catch (InvalidDataTypeException $e) { - drupal_set_message(t('Invalid data detected for @name : %error', array('@name' => $config_name, '%error' => $e->getMessage())), 'error'); - return; - } - - $form['current'] = array( - '#type' => 'details', - '#title' => $this->t('Current value for %variable', array('%variable' => $config_name)), - '#attributes' => array('class' => array('container-inline')), - ); - $form['current']['value'] = array( - '#type' => 'item', - '#markup' => dpr($output, TRUE), - ); - - $form['name'] = array( - '#type' => 'value', - '#value' => $config_name, - ); - $form['new'] = array( - '#type' => 'textarea', - '#title' => $this->t('New value'), - '#default_value' => $output, - '#rows' => 24, - '#required' => TRUE, - ); - - $form['actions'] = ['#type' => 'actions']; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - ]; - $form['actions']['cancel'] = array( - '#type' => 'link', - '#title' => $this->t('Cancel'), - '#url' => $this->buildCancelLinkUrl(), - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $value = $form_state->getValue('new'); - // try to parse the new provided value - try { - $parsed_value = Yaml::decode($value); - // Config::setData needs array for the new configuration and - // a simple string is valid YAML for any reason. - if (is_array($parsed_value)) { - $form_state->setValue('parsed_value', $parsed_value); - } - else { - $form_state->setErrorByName('new', $this->t('Invalid input')); - } - } - catch (InvalidDataTypeException $e) { - $form_state->setErrorByName('new', $this->t('Invalid input: %error', array('%error' => $e->getMessage()))); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - try { - $this->configFactory()->getEditable($values['name'])->setData($values['parsed_value'])->save(); - drupal_set_message($this->t('Configuration variable %variable was successfully saved.', array('%variable' => $values['name']))); - $this->logger('devel')->info('Configuration variable %variable was successfully saved.', array('%variable' => $values['name'])); - - $form_state->setRedirectUrl(Url::fromRoute('devel.configs_list')); - } - catch (\Exception $e) { - drupal_set_message($e->getMessage(), 'error'); - $this->logger('devel')->error('Error saving configuration variable %variable : %error.', array('%variable' => $values['name'], '%error' => $e->getMessage())); - } - } - - /** - * Builds the cancel link url for the form. - * - * @return Url - * Cancel url - */ - private function buildCancelLinkUrl() { - $query = $this->getRequest()->query; - - if ($query->has('destination')) { - $options = UrlHelper::parse($query->get('destination')); - $url = Url::fromUri('internal:/' . $options['path'], $options); - } - else { - $url = Url::fromRoute('devel.configs_list'); - } - - return $url; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/ConfigsList.php b/sites/all/modules/contrib/dev/devel/src/Form/ConfigsList.php deleted file mode 100644 index 0c01ca472..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/ConfigsList.php +++ /dev/null @@ -1,86 +0,0 @@ - 'details', - '#title' => t('Filter variables'), - '#attributes' => array('class' => array('container-inline')), - '#open' => isset($filter) && trim($filter) != '', - ); - $form['filter']['name'] = array( - '#type' => 'textfield', - '#title' => $this->t('Variable name'), - '#title_display' => 'invisible', - '#default_value' => $filter, - ); - $form['filter']['actions'] = ['#type' => 'actions']; - $form['filter']['actions']['show'] = [ - '#type' => 'submit', - '#value' => $this->t('Filter'), - ]; - - $header = array( - 'name' => array('data' => $this->t('Name')), - 'edit' => array('data' => $this->t('Operations')), - ); - - $rows = array(); - - $destination = $this->getDestinationArray(); - - // List all the variables filtered if any filter was provided. - $names = $this->configFactory()->listAll($filter); - - foreach ($names as $config_name) { - $operations['edit'] = array( - 'title' => $this->t('Edit'), - 'url' => Url::fromRoute('devel.config_edit', array('config_name' => $config_name)), - 'query' => $destination - ); - $rows[] = array( - 'name' => $config_name, - 'operation' => array('data' => array('#type' => 'operations', '#links' => $operations)), - ); - } - - $form['variables'] = array( - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('No variables found') - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $filter = $form_state->getValue('name'); - $form_state->setRedirectUrl(Url::FromRoute('devel.configs_list', array('filter' => Html::escape($filter)))); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/DevelReinstall.php b/sites/all/modules/contrib/dev/devel/src/Form/DevelReinstall.php deleted file mode 100644 index ee85c36ce..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/DevelReinstall.php +++ /dev/null @@ -1,154 +0,0 @@ -moduleInstaller = $module_installer; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('module_installer') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_reinstall_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get a list of all available modules. - $modules = system_rebuild_module_data(); - - $uninstallable = array_filter($modules, function ($module) use ($modules) { - return empty($modules[$module->getName()]->info['required']) && drupal_get_installed_schema_version($module->getName()) > SCHEMA_UNINSTALLED && $module->getName() !== 'devel'; - }); - - $form['filters'] = array( - '#type' => 'container', - '#attributes' => array( - 'class' => array('table-filter', 'js-show'), - ), - ); - $form['filters']['text'] = array( - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter module name'), - '#attributes' => array( - 'class' => array('table-filter-text'), - 'data-table' => '#devel-reinstall-form', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the module name or description to filter by.'), - ), - ); - - // Only build the rest of the form if there are any modules available to - // uninstall; - if (empty($uninstallable)) { - return $form; - } - - $header = array( - 'name' => $this->t('Name'), - 'description' => $this->t('Description'), - ); - - $rows = array(); - - foreach ($uninstallable as $module) { - $name = $module->info['name'] ? : $module->getName(); - - $rows[$module->getName()] = array( - 'name' => array( - 'data' => array( - '#type' => 'inline_template', - '#template' => '', - '#context' => array('module_name' => $name), - ) - ), - 'description' => array( - 'data' => $module->info['description'], - 'class' => array('description'), - ), - ); - } - - $form['reinstall'] = array( - '#type' => 'tableselect', - '#header' => $header, - '#options' => $rows, - '#js_select' => FALSE, - '#empty' => $this->t('No modules are available to uninstall.'), - ); - - $form['#attached']['library'][] = 'system/drupal.system.modules'; - - $form['actions'] = ['#type' => 'actions']; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Reinstall'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // Form submitted, but no modules selected. - if (!array_filter($form_state->getValue('reinstall'))) { - $form_state->setErrorByName('reinstall', $this->t('No modules selected.')); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - try { - $modules = $form_state->getValue('reinstall'); - $reinstall = array_keys(array_filter($modules)); - $this->moduleInstaller->uninstall($reinstall, FALSE); - $this->moduleInstaller->install($reinstall, FALSE); - drupal_set_message($this->t('Uninstalled and installed: %names.', array('%names' => implode(', ', $reinstall)))); - } - catch (\Exception $e) { - drupal_set_message($this->t('Unable to reinstall modules. Error: %error.', array('%error' => $e->getMessage())), 'error'); - } - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/RouterRebuildConfirmForm.php b/sites/all/modules/contrib/dev/devel/src/Form/RouterRebuildConfirmForm.php deleted file mode 100644 index a1daf8977..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/RouterRebuildConfirmForm.php +++ /dev/null @@ -1,86 +0,0 @@ -routeBuilder = $route_builder; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('router.builder') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_menu_rebuild'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to rebuild the router?'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url(''); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Rebuilds the routes information gathering all routing data from .routing.yml files and from classes which subscribe to the route build events. This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Rebuild'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->routeBuilder->rebuild(); - drupal_set_message($this->t('The router has been rebuilt.')); - $form_state->setRedirect(''); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/SettingsForm.php b/sites/all/modules/contrib/dev/devel/src/Form/SettingsForm.php deleted file mode 100644 index 71367be25..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/SettingsForm.php +++ /dev/null @@ -1,191 +0,0 @@ -dumperManager = $devel_dumper_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.devel_dumper') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_admin_settings_form'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return [ - 'devel.settings', - ]; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL) { - $current_url = Url::createFromRequest($request); - $devel_config = $this->config('devel.settings'); - - $form['page_alter'] = array('#type' => 'checkbox', - '#title' => t('Display $page array'), - '#default_value' => $devel_config->get('page_alter'), - '#description' => t('Display $page array from hook_page_attachments_alter() in the messages area of each page.'), - ); - $form['raw_names'] = array('#type' => 'checkbox', - '#title' => t('Display machine names of permissions and modules'), - '#default_value' => $devel_config->get('raw_names'), - '#description' => t('Display the language-independent machine names of the permissions in mouse-over hints on the Permissions page and the module base file names on the Permissions and Modules pages.', array(':permissions_url' => Url::fromRoute('user.admin_permissions')->toString(), ':modules_url' => Url::fromRoute('system.modules_list')->toString())), - ); - $form['rebuild_theme'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Rebuild the theme registry on every page load'), - '#description' => $this->t('New templates, theme overrides, and changes to the theme.info.yml need the theme registry to be rebuilt in order to appear on the site.'), - '#default_value' => $devel_config->get('rebuild_theme'), - ); - - $error_handlers = devel_get_handlers(); - $form['error_handlers'] = array( - '#type' => 'select', - '#title' => t('Error handlers'), - '#options' => array( - DEVEL_ERROR_HANDLER_NONE => t('None'), - DEVEL_ERROR_HANDLER_STANDARD => t('Standard Drupal'), - DEVEL_ERROR_HANDLER_BACKTRACE_DPM => t('Kint backtrace in the message area'), - DEVEL_ERROR_HANDLER_BACKTRACE_KINT => t('Kint backtrace above the rendered page'), - ), - '#multiple' => TRUE, - '#default_value' => empty($error_handlers) ? DEVEL_ERROR_HANDLER_NONE : $error_handlers, - '#description' => [ - [ - '#markup' => $this->t('Select the error handler(s) to use, in case you choose to show errors on screen.', [':choose' => $this->url('system.logging_settings')]) - ], - [ - '#theme' => 'item_list', - '#items' => [ - $this->t('None is a good option when stepping through the site in your debugger.'), - $this->t('Standard Drupal does not display all the information that is often needed to resolve an issue.'), - $this->t('Kint backtrace displays nice debug information when any type of error is noticed, but only to users with the %perm permission.', ['%perm' => t('Access developer information')]), - ], - ], - [ - '#markup' => $this->t('Depending on the situation, the theme, the size of the call stack and the arguments, etc., some handlers may not display their messages, or display them on the subsequent page. Select Standard Drupal and Kint backtrace above the rendered page to maximize your chances of not missing any messages.') . '
    ' . - $this->t('Demonstrate the current error handler(s):') . ' ' . - $this->l('notice', $current_url->setOption('query', ['demo' => 'notice'])) . ', ' . - $this->l('notice+warning', $current_url->setOption('query', ['demo' => 'warning'])). ', ' . - $this->l('notice+warning+error', $current_url->setOption('query', ['demo' => 'error'])) . ' (' . - $this->t('The presentation of the @error is determined by PHP.', ['@error' => 'error']) . ')' - ], - ], - ); - $form['error_handlers']['#size'] = count($form['error_handlers']['#options']); - if ($request->query->has('demo')) { - if ($request->getMethod() == 'GET') { - $this->demonstrateErrorHandlers($request->query->get('demo')); - } - $request->query->remove('demo'); - } - - $dumper = $devel_config->get('devel_dumper'); - $default = $this->dumperManager->isPluginSupported($dumper) ? $dumper : $this->dumperManager->getFallbackPluginId(NULL); - - $form['dumper'] = array( - '#type' => 'radios', - '#title' => $this->t('Variables Dumper'), - '#options' => [], - '#default_value' => $default, - '#description' => $this->t('Select the debugging tool used for formatting and displaying the variables inspected through the debug functions of Devel. You can enable the Kint module (shipped with Devel) and select the Kint debugging tool for an improved debugging experience. NOTE: Some of these plugins require external libraries for to be enabled. Learn how install external libraries with Composer.', [':url' => 'https://www.drupal.org/node/2404989', ':kint_install' => Url::fromRoute('system.modules_list')->toString()]), - ); - - foreach ($this->dumperManager->getDefinitions() as $id => $definition) { - $form['dumper']['#options'][$id] = $definition['label']; - - $supported = $this->dumperManager->isPluginSupported($id); - $form['dumper'][$id]['#disabled'] = !$supported; - - $form['dumper'][$id]['#description'] = [ - '#type' => 'inline_template', - '#template' => '{{ description }}{% if not supported %}
    {% trans %}Not available. You may need to install external dependencies for use this plugin.{% endtrans %}
    {% endif %}', - '#context' => [ - 'description' => $definition['description'], - 'supported' => $supported, - ] - ]; - } - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $this->config('devel.settings') - ->set('page_alter', $values['page_alter']) - ->set('raw_names', $values['raw_names']) - ->set('error_handlers', $values['error_handlers']) - ->set('rebuild_theme', $values['rebuild_theme']) - ->set('devel_dumper', $values['dumper']) - ->save(); - - parent::submitForm($form, $form_state); - } - - /** - * @param string $severity - */ - protected function demonstrateErrorHandlers($severity) { - switch ($severity) { - case 'notice': - $undefined = $undefined; - break; - case 'warning': - $undefined = $undefined; - 1/0; - break; - case 'error': - $undefined = $undefined; - 1/0; - devel_undefined_function(); - break; - } - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/SwitchUserForm.php b/sites/all/modules/contrib/dev/devel/src/Form/SwitchUserForm.php deleted file mode 100644 index 8fbb02345..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/SwitchUserForm.php +++ /dev/null @@ -1,108 +0,0 @@ -csrfToken = $csrf_token_generator; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('csrf_token') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_switchuser_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form['autocomplete'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['container-inline'], - ], - ]; - $form['autocomplete']['userid'] = [ - '#type' => 'entity_autocomplete', - '#title' => $this->t('Username'), - '#placeholder' => $this->t('Enter username'), - '#target_type' => 'user', - '#selection_settings' => [ - 'include_anonymous' => FALSE - ], - '#process_default_value' => FALSE, - '#maxlength' => USERNAME_MAX_LENGTH, - '#title_display' => 'invisible', - '#required' => TRUE, - '#size' => '28', - ]; - - $form['autocomplete']['actions'] = ['#type' => 'actions']; - $form['autocomplete']['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Switch'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - if (!$account = User::load($form_state->getValue('userid'))) { - $form_state->setErrorByName('userid', $this->t('Username not found')); - } - else { - $form_state->setValue('username', $account->getAccountName()); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // We cannot rely on automatic token creation, since the csrf seed changes - // after the redirect and the generated token is not more valid. - // TODO find another way to do this. - $url = Url::fromRoute('devel.switch', ['name' => $form_state->getValue('username')]); - $url->setOption('query', ['token' => $this->csrfToken->get($url->getInternalPath())]); - - $form_state->setRedirectUrl($url); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/SystemStateEdit.php b/sites/all/modules/contrib/dev/devel/src/Form/SystemStateEdit.php deleted file mode 100644 index e83c26091..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/SystemStateEdit.php +++ /dev/null @@ -1,189 +0,0 @@ -state = $state; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('state') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_state_system_edit_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $state_name = '') { - // Get the old value - $old_value = $this->state->get($state_name); - - if (!isset($old_value)) { - drupal_set_message(t('State @name does not exist in the system.', array('@name' => $state_name)), 'warning'); - return; - } - - // Only simple structures are allowed to be edited. - $disabled = !$this->checkObject($old_value); - - if ($disabled) { - drupal_set_message(t('Only simple structures are allowed to be edited. State @name contains objects.', array('@name' => $state_name)), 'warning'); - } - - // First we will show the user the content of the variable about to be edited. - $form['value'] = array( - '#type' => 'item', - '#title' => $this->t('Current value for %name', array('%name' => $state_name)), - '#markup' => kpr($old_value, TRUE), - ); - - $transport = 'plain'; - - if (!$disabled && is_array($old_value)) { - try { - $old_value = Yaml::encode($old_value); - $transport = 'yaml'; - } - catch (InvalidDataTypeException $e) { - drupal_set_message(t('Invalid data detected for @name : %error', array('@name' => $state_name, '%error' => $e->getMessage())), 'error'); - return; - } - } - - // Store in the form the name of the state variable - $form['state_name'] = array( - '#type' => 'value', - '#value' => $state_name, - ); - // Set the transport format for the new value. Values: - // - plain - // - yaml - $form['transport'] = array( - '#type' => 'value', - '#value' => $transport, - ); - - $form['new_value'] = array( - '#type' => 'textarea', - '#title' => $this->t('New value'), - '#default_value' => $disabled ? '' : $old_value, - '#disabled' => $disabled, - '#rows' => 15, - ); - - $form['actions'] = ['#type' => 'actions']; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save'), - '#disabled' => $disabled, - ]; - $form['actions']['cancel'] = [ - '#type' => 'link', - '#title' => $this->t('Cancel'), - '#url' => Url::fromRoute('devel.state_system_page') - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - - if ($values['transport'] == 'yaml') { - // try to parse the new provided value - try { - $parsed_value = Yaml::decode($values['new_value']); - $form_state->setValue('parsed_value', $parsed_value); - } - catch (InvalidDataTypeException $e) { - $form_state->setErrorByName('new_value', $this->t('Invalid input: %error', array('%error' => $e->getMessage()))); - } - } - else { - $form_state->setValue('parsed_value', $values['new_value']); - } - - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Save the state - $values = $form_state->getValues(); - $this->state->set($values['state_name'], $values['parsed_value']); - - $form_state->setRedirectUrl(Url::fromRoute('devel.state_system_page')); - - drupal_set_message($this->t('Variable %variable was successfully edited.', array('%variable' => $values['state_name']))); - $this->logger('devel')->info('Variable %variable was successfully edited.', array('%variable' => $values['state_name'])); - } - - /** - * Helper function to determine if a variable is or contains an object. - * - * @param $data - * Input data to check - * - * @return bool - * TRUE if the variable is not an object and does not contain one. - */ - protected function checkObject($data) { - if (is_object($data)) { - return FALSE; - } - if (is_array($data)) { - // If the current object is an array, then check recursively. - foreach ($data as $value) { - // If there is an object the whole container is "contaminated" - if (!$this->checkObject($value)) { - return FALSE; - } - } - } - - // All checks pass - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Form/ToolbarSettingsForm.php b/sites/all/modules/contrib/dev/devel/src/Form/ToolbarSettingsForm.php deleted file mode 100644 index d0e09fc7e..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Form/ToolbarSettingsForm.php +++ /dev/null @@ -1,118 +0,0 @@ -menuLinkTree = $menu_link_tree; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('menu.link_tree') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'devel_toolbar_settings_form'; - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return [ - 'devel.toolbar.settings', - ]; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('devel.toolbar.settings'); - - $form['toolbar_items'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Menu items always visible'), - '#options' => $this->getLinkLabels(), - '#default_value' => $config->get('toolbar_items') ?: [], - '#required' => TRUE, - '#description' => $this->t('Select the menu items always visible in devel toolbar tray. All the items not selected in this list will be visible only when the toolbar orientation is vertical.'), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $toolbar_items = array_keys(array_filter($values['toolbar_items'])); - - $this->config('devel.toolbar.settings') - ->set('toolbar_items', $toolbar_items) - ->save(); - - parent::submitForm($form, $form_state); - } - - /** - * Provides an array of available menu items. - * - * @return array - * Associative array of devel menu item labels keyed by plugin ID. - */ - protected function getLinkLabels() { - $options = []; - - $parameters = new MenuTreeParameters(); - $parameters->onlyEnabledLinks()->setTopLevelOnly(); - $tree = $this->menuLinkTree->load('devel', $parameters); - - foreach ($tree as $element) { - $link = $element->link; - $options[$link->getPluginId()] = $link->getTitle(); - } - - asort($options); - - return $options; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Block/SwitchUserBlock.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Block/SwitchUserBlock.php deleted file mode 100644 index c427fed44..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Block/SwitchUserBlock.php +++ /dev/null @@ -1,286 +0,0 @@ -formBuilder = $form_builder; - $this->currentUser = $current_user; - $this->userStorage = $user_storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('current_user'), - $container->get('entity.manager')->getStorage('user'), - $container->get('form_builder') - ); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'list_size' => 12, - 'include_anon' => FALSE, - 'show_form' => TRUE, - ]; - } - - /** - * {@inheritdoc} - */ - public function blockAccess(AccountInterface $account) { - return AccessResult::allowedIfHasPermission($account, 'switch users'); - } - - /** - * {@inheritdoc} - */ - public function blockForm($form, FormStateInterface $form_state) { - $anononymous = new AnonymousUserSession(); - $form['list_size'] = [ - '#type' => 'number', - '#title' => $this->t('Number of users to display in the list'), - '#default_value' => $this->configuration['list_size'], - '#min' => 1, - '#max' => 50, - ]; - $form['include_anon'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Include %anonymous', ['%anonymous' => $anononymous->getAccountName()]), - '#default_value' => $this->configuration['include_anon'], - ]; - $form['show_form'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Allow entering any user name'), - '#default_value' => $this->configuration['show_form'], - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function blockSubmit($form, FormStateInterface $form_state) { - $this->configuration['list_size'] = $form_state->getValue('list_size'); - $this->configuration['include_anon'] = $form_state->getValue('include_anon'); - $this->configuration['show_form'] = $form_state->getValue('show_form'); - } - - /** - * {@inheritdoc} - */ - public function getCacheMaxAge() { - return 0; - } - - /** - * {@inheritdoc} - */ - public function build() { - $build = []; - if ($accounts = $this->getUsers()) { - $build['devel_links'] = $this->buildUserList($accounts); - - if ($this->configuration['show_form']) { - $build['devel_form'] = $this->formBuilder->getForm('\Drupal\devel\Form\SwitchUserForm'); - } - } - - return $build; - } - - /** - * Provides the list of accounts that can be used for the user switch. - * - * Inactive users are omitted from all of the following db selects. Users - * with 'switch users' permission and anonymous user if include_anon property - * is set to TRUE, are prioritized. - * - * @return \Drupal\core\Session\AccountInterface[] - * List of accounts to be used for the switch. - */ - protected function getUsers() { - $list_size = $this->configuration['list_size']; - $include_anonymous = $this->configuration['include_anon']; - - $list_size = $include_anonymous ? $list_size - 1 : $list_size; - - // Users with 'switch users' permission are prioritized so - // we try to load first users with this permission. - $query = $this->userStorage->getQuery() - ->condition('uid', 0, '>') - ->condition('status', 0, '>') - ->sort('access', 'DESC') - ->range(0, $list_size); - - $roles = user_roles(TRUE, 'switch users'); - - if (!empty($roles) && !isset($roles[Role::AUTHENTICATED_ID])) { - $query->condition('roles', array_keys($roles), 'IN'); - } - - $user_ids = $query->execute(); - - // If we don't have enough users with 'switch users' permission, add - // uids until we hit $list_size. - if (count($user_ids) < $list_size) { - $query = $this->userStorage->getQuery() - ->condition('uid', 0, '>') - ->condition('status', 0, '>') - ->sort('access', 'DESC') - ->range(0, $list_size); - - // Excludes the prioritized user ids only if the previous query return - // some records. - if (!empty($user_ids)) { - $query->condition('uid', array_keys($user_ids), 'NOT IN'); - $query->range(0, $list_size - count($user_ids)); - } - - $user_ids += $query->execute(); - } - - $accounts = $this->userStorage->loadMultiple($user_ids); - - if ($include_anonymous) { - $anonymous = new AnonymousUserSession(); - $accounts[$anonymous->id()] = $anonymous; - } - - uasort($accounts, 'static::sortUserList'); - - return $accounts; - } - - /** - * Builds the user listing as renderable array. - * - * @param \Drupal\core\Session\AccountInterface[] $accounts - * The accounts to be rendered in the list. - * - * @return array - * A renderable array. - */ - protected function buildUserList(array $accounts) { - $links = []; - - foreach ($accounts as $account) { - $links[$account->id()] = [ - 'title' => $account->getDisplayName(), - 'url' => Url::fromRoute('devel.switch', ['name' => $account->getAccountName()]), - 'query' => $this->getDestinationArray(), - 'attributes' => [ - 'title' => $account->hasPermission('switch users') ? $this->t('This user can switch back.') : $this->t('Caution: this user will be unable to switch back.'), - ], - ]; - - if ($account->isAnonymous()) { - $links[$account->id()]['url'] = Url::fromRoute('user.logout'); - } - - if ($this->currentUser->id() === $account->id()) { - $links[$account->id()]['title'] = new FormattableMarkup('%user', ['%user' => $account->getDisplayName()]); - } - } - - return [ - '#theme' => 'links', - '#links' => $links, - '#attached' => ['library' => ['devel/devel']], - ]; - } - - /** - * Helper callback for uasort() to sort accounts by last access. - */ - public static function sortUserList(AccountInterface $a, AccountInterface $b) { - $a_access = (int) $a->getLastAccessedTime(); - $b_access = (int) $b->getLastAccessedTime(); - - if ($a_access === $b_access) { - return 0; - } - - // User never access to site. - if ($a_access === 0) { - return 1; - } - - return ($a_access > $b_access) ? -1 : 1; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Derivative/DevelLocalTask.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Derivative/DevelLocalTask.php deleted file mode 100644 index 1d3b1922b..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Derivative/DevelLocalTask.php +++ /dev/null @@ -1,106 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $this->derivatives = []; - - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - - $has_edit_path = $entity_type->hasLinkTemplate('devel-load'); - $has_canonical_path = $entity_type->hasLinkTemplate('devel-render'); - - if ($has_edit_path || $has_canonical_path) { - - $this->derivatives["$entity_type_id.devel_tab"] = [ - 'route_name' => "entity.$entity_type_id." . ($has_edit_path ? 'devel_load' : 'devel_render'), - 'title' => $this->t('Devel'), - 'base_route' => "entity.$entity_type_id." . ($has_canonical_path ? "canonical" : "edit_form"), - 'weight' => 100, - ]; - - $this->derivatives["$entity_type_id.devel_definition_tab"] = [ - 'route_name' => "entity.$entity_type_id.devel_definition", - 'title' => $this->t('Definition'), - 'parent_id' => "devel.entities:$entity_type_id.devel_tab", - 'weight' => 100, - ]; - - if ($has_canonical_path) { - $this->derivatives["$entity_type_id.devel_render_tab"] = [ - 'route_name' => "entity.$entity_type_id.devel_render", - 'weight' => 100, - 'title' => $this->t('Render'), - 'parent_id' => "devel.entities:$entity_type_id.devel_tab", - ]; - } - - if ($has_edit_path) { - $this->derivatives["$entity_type_id.devel_load_tab"] = [ - 'route_name' => "entity.$entity_type_id.devel_load", - 'weight' => 100, - 'title' => $this->t('Load'), - 'parent_id' => "devel.entities:$entity_type_id.devel_tab", - ]; - } - } - } - - foreach ($this->derivatives as &$entry) { - $entry += $base_plugin_definition; - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/ChromePhp.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/ChromePhp.php deleted file mode 100644 index df84cab27..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/ChromePhp.php +++ /dev/null @@ -1,40 +0,0 @@ -ChromePhp debugging tool.") - * ) - */ -class ChromePhp extends DevelDumperBase { - - /** - * {@inheritdoc} - */ - public function dump($input, $name = NULL) { - \ChromePhp::log($input); - } - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - $this->dump($input); - return $this->t('Dump was redirected to the console.'); - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return class_exists('ChromePhp', TRUE); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DoctrineDebug.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DoctrineDebug.php deleted file mode 100644 index 9df1aec5c..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DoctrineDebug.php +++ /dev/null @@ -1,69 +0,0 @@ -Doctrine debugging tool.") - * ) - */ -class DoctrineDebug extends DevelDumperBase { - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - $name = $name ? $name . ' => ' : ''; - $variable = Debug::export($input, 6); - - ob_start(); - print_r($variable); - $dump = ob_get_contents(); - ob_end_clean(); - - // Run Xss::filterAdmin on the resulting string to prevent - // cross-site-scripting (XSS) vulnerabilities. - $dump = Xss::filterAdmin($dump); - - $dump = '
    ' . $name . $dump . '
    '; - - return $this->setSafeMarkup($dump); - } - - /** - * {@inheritdoc} - */ - public function exportAsRenderable($input, $name = NULL) { - $output['container'] = [ - '#type' => 'details', - '#title' => $name ? : $this->t('Variable'), - '#attached' => [ - 'library' => ['devel/devel'] - ], - '#attributes' => [ - 'class' => ['container-inline', 'devel-dumper', 'devel-selectable'], - ], - 'export' => [ - '#markup' => $this->export($input), - ], - ]; - - return $output; - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DrupalVariable.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DrupalVariable.php deleted file mode 100644 index a1561e3e9..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/DrupalVariable.php +++ /dev/null @@ -1,61 +0,0 @@ -Drupal Variable class.") - * ) - */ -class DrupalVariable extends DevelDumperBase { - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - $name = $name ? $name . ' => ' : ''; - $dump = Variable::export($input); - // Run Xss::filterAdmin on the resulting string to prevent - // cross-site-scripting (XSS) vulnerabilities. - $dump = Xss::filterAdmin($dump); - $dump = '
    ' . $name . $dump . '
    '; - return $this->setSafeMarkup($dump); - } - - /** - * {@inheritdoc} - */ - public function exportAsRenderable($input, $name = NULL) { - $output['container'] = [ - '#type' => 'details', - '#title' => $name ? : $this->t('Variable'), - '#attached' => [ - 'library' => ['devel/devel'] - ], - '#attributes' => [ - 'class' => ['container-inline', 'devel-dumper', 'devel-selectable'], - ], - 'export' => [ - '#markup' => $this->export($input), - ], - ]; - - return $output; - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/FirePhp.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/FirePhp.php deleted file mode 100644 index 9140d00e6..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/FirePhp.php +++ /dev/null @@ -1,41 +0,0 @@ -FirePhp debugging tool.") - * ) - */ -class FirePhp extends DevelDumperBase { - - /** - * {@inheritdoc} - */ - public function dump($input, $name = NULL) { - $fb = new \FB(); - $fb->dump($name, $input); - } - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - $this->dump($input); - return $this->t('Dump was redirected to the console.'); - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return class_exists('FirePHP', TRUE); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/VarDumper.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/VarDumper.php deleted file mode 100644 index 59200fa1a..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Devel/Dumper/VarDumper.php +++ /dev/null @@ -1,47 +0,0 @@ -Symfony var-dumper debugging tool."), - * ) - * - */ -class VarDumper extends DevelDumperBase { - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - $cloner = new VarCloner(); - $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper(); - - $output = fopen('php://memory', 'r+b'); - $dumper->dump($cloner->cloneVar($input), $output); - $output = stream_get_contents($output, -1, 0); - - if ($name) { - $output = $name . ' => ' . $output; - } - - return $this->setSafeMarkup($output); - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return class_exists('Symfony\Component\VarDumper\Cloner\VarCloner', TRUE); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Mail/DevelMailLog.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Mail/DevelMailLog.php deleted file mode 100644 index 16cafc139..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Mail/DevelMailLog.php +++ /dev/null @@ -1,188 +0,0 @@ -config = $config_factory->get('devel.settings'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('config.factory') - ); - } - - /** - * {@inheritdoc} - */ - public function mail(array $message) { - $directory = $this->config->get('debug_mail_directory'); - - if (!$this->prepareDirectory($directory)) { - return FALSE; - } - - $pattern = $this->config->get('debug_mail_file_format'); - $filename = $this->replacePlaceholders($pattern, $message); - $output = $this->composeMessage($message); - - return (bool) file_put_contents($directory . '/' . $filename, $output); - } - - /** - * {@inheritdoc} - */ - public function format(array $message) { - // Join the body array into one string. - $message['body'] = implode("\n\n", $message['body']); - - // Convert any HTML to plain-text. - $message['body'] = MailFormatHelper::htmlToText($message['body']); - // Wrap the mail body for sending. - $message['body'] = MailFormatHelper::wrapMail($message['body']); - - return $message; - } - - /** - * Compose the output message. - * - * @param array $message - * A message array, as described in hook_mail_alter(). - * - * @return string - * The output message. - */ - protected function composeMessage($message) { - $mimeheaders = []; - $message['headers']['To'] = $message['to']; - foreach ($message['headers'] as $name => $value) { - $mimeheaders[] = $name . ': ' . Unicode::mimeHeaderEncode($value); - } - - $line_endings = Settings::get('mail_line_endings', PHP_EOL); - $output = join($line_endings, $mimeheaders) . $line_endings; - // 'Subject:' is a mail header and should not be translated. - $output .= 'Subject: ' . $message['subject'] . $line_endings; - // Blank line to separate headers from body. - $output .= $line_endings; - $output .= preg_replace('@\r?\n@', $line_endings, $message['body']); - return $output; - } - - /** - * Replaces placeholders with sanitized values in a string. - * - * @param $filename - * The string that contains the placeholders. The following placeholders - * are considered in the replacement: - * - %to: replaced by the email recipient value. - * - %subject: replaced by the email subject value. - * - %datetime: replaced by the current datetime in 'y-m-d_his' format. - * @param array $message - * A message array, as described in hook_mail_alter(). - * - * @return string - * The formatted string. - */ - protected function replacePlaceholders($filename, $message) { - $tokens = [ - '%to' => $message['to'], - '%subject' => $message['subject'], - '%datetime' => date('y-m-d_his'), - ]; - $filename = str_replace(array_keys($tokens), array_values($tokens), $filename); - return preg_replace('/[^a-zA-Z0-9_\-\.@]/', '_', $filename); - } - - /** - * Checks that the directory exists and is writable. - * Public directories will be protected by adding an .htaccess which - * indicates that the directory is private. - * - * @param $directory - * A string reference containing the name of a directory path or URI. - * - * @return bool - * TRUE if the directory exists (or was created), is writable and is - * protected (if it is public). FALSE otherwise. - */ - protected function prepareDirectory($directory) { - if (!file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) { - return FALSE; - } - if (0 === strpos($directory, 'public://')) { - return file_save_htaccess($directory); - } - - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Menu/DestinationMenuLink.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Menu/DestinationMenuLink.php deleted file mode 100644 index 4edf1c329..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Menu/DestinationMenuLink.php +++ /dev/null @@ -1,32 +0,0 @@ -')->toString(); - return $options; - } - - /** - * {@inheritdoc} - * - * @todo Make cacheable once https://www.drupal.org/node/2582797 lands. - */ - public function getCacheMaxAge() { - return 0; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Plugin/Menu/MenuItemMenuLink.php b/sites/all/modules/contrib/dev/devel/src/Plugin/Menu/MenuItemMenuLink.php deleted file mode 100644 index 1dd26e5a6..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Plugin/Menu/MenuItemMenuLink.php +++ /dev/null @@ -1,11 +0,0 @@ -')->getInternalPath(); - return $options; - } - - /** - * {@inheritdoc} - */ - public function getCacheMaxAge() { - return 0; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Render/FilteredMarkup.php b/sites/all/modules/contrib/dev/devel/src/Render/FilteredMarkup.php deleted file mode 100644 index d43c0d5d8..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Render/FilteredMarkup.php +++ /dev/null @@ -1,23 +0,0 @@ -entityTypeManager = $entity_manager; - } - - /** - * {@inheritdoc} - */ - protected function alterRoutes(RouteCollection $collection) { - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if ($route = $this->getEntityLoadRoute($entity_type)) { - $collection->add("entity.$entity_type_id.devel_load", $route); - } - if ($route = $this->getEntityRenderRoute($entity_type)) { - $collection->add("entity.$entity_type_id.devel_render", $route); - } - if ($route = $this->getEntityTypeDefinitionRoute($entity_type)) { - $collection->add("entity.$entity_type_id.devel_definition", $route); - } - } - } - - /** - * Gets the entity load route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getEntityLoadRoute(EntityTypeInterface $entity_type) { - if ($devel_load = $entity_type->getLinkTemplate('devel-load')) { - $entity_type_id = $entity_type->id(); - $route = new Route($devel_load); - $route - ->addDefaults([ - '_controller' => '\Drupal\devel\Controller\EntityDebugController::entityLoad', - '_title' => 'Devel Load', - ]) - ->addRequirements([ - '_permission' => 'access devel information', - ]) - ->setOption('_admin_route', TRUE) - ->setOption('_devel_entity_type_id', $entity_type_id) - ->setOption('parameters', [ - $entity_type_id => ['type' => 'entity:' . $entity_type_id], - ]); - - return $route; - } - } - - /** - * Gets the entity render route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getEntityRenderRoute(EntityTypeInterface $entity_type) { - if ($devel_render = $entity_type->getLinkTemplate('devel-render')) { - $entity_type_id = $entity_type->id(); - $route = new Route($devel_render); - $route - ->addDefaults([ - '_controller' => '\Drupal\devel\Controller\EntityDebugController::entityRender', - '_title' => 'Devel Render', - ]) - ->addRequirements([ - '_permission' => 'access devel information' - ]) - ->setOption('_admin_route', TRUE) - ->setOption('_devel_entity_type_id', $entity_type_id) - ->setOption('parameters', [ - $entity_type_id => ['type' => 'entity:' . $entity_type_id], - ]); - - return $route; - } - } - - /** - * Gets the entity type definition route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getEntityTypeDefinitionRoute(EntityTypeInterface $entity_type) { - if ($devel_definition = $entity_type->getLinkTemplate('devel-definition')) { - $entity_type_id = $entity_type->id(); - $route = new Route($devel_definition); - $route - ->addDefaults([ - '_controller' => '\Drupal\devel\Controller\EntityDebugController::entityTypeDefinition', - '_title' => 'Entity type definition', - ]) - ->addRequirements([ - '_permission' => 'access devel information' - ]) - ->setOption('_admin_route', TRUE) - ->setOption('_devel_entity_type_id', $entity_type_id) - ->setOption('parameters', [ - $entity_type_id => ['type' => 'entity:' . $entity_type_id], - ]); - - return $route; - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events = parent::getSubscribedEvents(); - $events[RoutingEvents::ALTER] = ['onAlterRoutes', 100]; - return $events; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/ToolbarHandler.php b/sites/all/modules/contrib/dev/devel/src/ToolbarHandler.php deleted file mode 100644 index 0d7cbcdf0..000000000 --- a/sites/all/modules/contrib/dev/devel/src/ToolbarHandler.php +++ /dev/null @@ -1,181 +0,0 @@ -menuLinkTree = $menu_link_tree; - $this->config = $config_factory->get('devel.toolbar.settings'); - $this->account = $account; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('toolbar.menu_tree'), - $container->get('config.factory'), - $container->get('current_user') - ); - } - - /** - * Hook bridge. - * - * @return array - * The devel toolbar items render array. - * - * @see hook_toolbar() - */ - public function toolbar() { - $items['devel'] = [ - '#cache' => [ - 'contexts' => ['user.permissions'], - ], - ]; - - if ($this->account->hasPermission('access devel information')) { - $items['devel'] += [ - '#type' => 'toolbar_item', - '#weight' => 999, - 'tab' => [ - '#type' => 'link', - '#title' => $this->t('Devel'), - '#url' => Url::fromRoute('devel.admin_settings'), - '#attributes' => [ - 'title' => $this->t('Development menu'), - 'class' => ['toolbar-icon', 'toolbar-icon-devel'], - ], - ], - 'tray' => [ - '#heading' => $this->t('Development menu'), - 'devel_menu' => [ - // Currently devel menu is uncacheable, so instead of poisoning the - // entire page cache we use a lazy builder. - // @see \Drupal\devel\Plugin\Menu\DestinationMenuLink - // @see \Drupal\devel\Plugin\Menu\RouteDetailMenuItem - '#lazy_builder' => [ToolbarHandler::class . ':lazyBuilder', []], - // Force the creation of the placeholder instead of rely on the - // automatical placeholdering or otherwise the page results - // uncacheable when max-age 0 is bubbled up. - '#create_placeholder' => TRUE, - ], - 'configuration' => [ - '#type' => 'link', - '#title' => $this->t('Configure'), - '#url' => Url::fromRoute('devel.toolbar.settings_form'), - '#options' => [ - 'attributes' => ['class' => ['edit-devel-toolbar']], - ], - ], - ], - '#attached' => [ - 'library' => 'devel/devel-toolbar', - ], - ]; - } - - return $items; - } - - /** - * Lazy builder callback for the devel menu toolbar. - * - * @return array - * The renderable array rapresentation of the devel menu. - */ - public function lazyBuilder() { - $parameters = new MenuTreeParameters(); - $parameters->onlyEnabledLinks()->setTopLevelOnly(); - - $tree = $this->menuLinkTree->load('devel', $parameters); - - $manipulators = [ - ['callable' => 'menu.default_tree_manipulators:checkAccess'], - ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'], - ['callable' => ToolbarHandler::class . ':processTree'], - ]; - $tree = $this->menuLinkTree->transform($tree, $manipulators); - - $build = $this->menuLinkTree->build($tree); - - CacheableMetadata::createFromRenderArray($build) - ->addCacheableDependency($this->config) - ->applyTo($build); - - return $build; - } - - /** - * Adds toolbar-specific attributes to the menu link tree. - * - * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree - * The menu link tree to manipulate. - * - * @return \Drupal\Core\Menu\MenuLinkTreeElement[] - * The manipulated menu link tree. - */ - public function processTree(array $tree) { - $visible_items = $this->config->get('toolbar_items') ?: []; - - foreach ($tree as $element) { - $plugin_id = $element->link->getPluginId(); - if (!in_array($plugin_id, $visible_items)) { - // Add a class that allow to hide the non prioritized menu items when - // the toolbar has horizontal orientation. - $element->options['attributes']['class'][] = 'toolbar-horizontal-item-hidden'; - } - } - - return $tree; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/src/Twig/Extension/Debug.php b/sites/all/modules/contrib/dev/devel/src/Twig/Extension/Debug.php deleted file mode 100644 index 9922e6106..000000000 --- a/sites/all/modules/contrib/dev/devel/src/Twig/Extension/Debug.php +++ /dev/null @@ -1,201 +0,0 @@ -dumper = $dumper; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'devel_debug'; - } - - /** - * {@inheritdoc} - */ - public function getFunctions() { - $functions = []; - - foreach (['devel_dump', 'kpr'] as $function) { - $functions[] = new \Twig_SimpleFunction($function, [$this, 'dump'], [ - 'is_safe' => ['html'], - 'needs_environment' => TRUE, - 'needs_context' => TRUE, - 'is_variadic' => TRUE, - ]); - } - - foreach (['devel_message', 'dpm', 'dsm'] as $function) { - $functions[] = new \Twig_SimpleFunction($function, [$this, 'message'], [ - 'is_safe' => ['html'], - 'needs_environment' => TRUE, - 'needs_context' => TRUE, - 'is_variadic' => TRUE, - ]); - } - - foreach (['devel_breakpoint'] as $function) { - $functions[] = new \Twig_SimpleFunction($function, [$this, 'breakpoint'], [ - 'needs_environment' => TRUE, - 'needs_context' => TRUE, - 'is_variadic' => TRUE, - ]); - } - - return $functions; - } - - /** - * Provides debug function to Twig templates. - * - * Handles 0, 1, or multiple arguments. - * - * @param \Twig_Environment $env - * The twig environment instance. - * @param array $context - * An array of parameters passed to the template. - * @param array $args - * An array of parameters passed the function. - * - * @return string - * String representation of the input variables. - * - * @see \Drupal\devel\DevelDumperManager::dump() - */ - public function dump(\Twig_Environment $env, array $context, array $args = []) { - if (!$env->isDebug()) { - return; - } - - ob_start(); - - // No arguments passed, display full Twig context. - if (empty($args)) { - $context_variables = $this->getContextVariables($context); - $this->dumper->dump($context_variables, 'Twig context'); - } - else { - foreach ($args as $variable) { - $this->dumper->dump($variable); - } - } - - return ob_get_clean(); - } - - /** - * Provides debug function to Twig templates. - * - * Handles 0, 1, or multiple arguments. - * - * @param \Twig_Environment $env - * The twig environment instance. - * @param array $context - * An array of parameters passed to the template. - * @param array $args - * An array of parameters passed the function. - * - * @return void - * - * @see \Drupal\devel\DevelDumperManager::message() - */ - public function message(\Twig_Environment $env, array $context, array $args = []) { - if (!$env->isDebug()) { - return; - } - - // No arguments passed, display full Twig context. - if (empty($args)) { - $context_variables = $this->getContextVariables($context); - $this->dumper->message($context_variables, 'Twig context'); - } - else { - foreach ($args as $variable) { - $this->dumper->message($variable); - } - } - - } - - /** - * Provides XDebug integration for Twig templates. - * - * To use this features simply put the following statement in the template - * of interest: - * - * @code - * {{ devel_breakpoint() }} - * @endcode - * - * When the template is evaluated is made a call to a dedicated method in - * devel twig debug extension in which is used xdebug_break(), that emits a - * breakpoint to the debug client (the debugger break on the specific line as - * if a normal file/line breakpoint was set on this line). - * In this way you'll be able to inspect any variables available in the - * template (environment, context, specific variables etc..) in your IDE. - * - * @param \Twig_Environment $env - * The twig environment instance. - * @param array $context - * An array of parameters passed to the template. - * @param array $args - * An array of parameters passed the function. - */ - public function breakpoint(\Twig_Environment $env, array $context, array $args = []) { - if (!$env->isDebug()) { - return; - } - - if (function_exists('xdebug_break')) { - xdebug_break(); - } - } - - /** - * Filters the Twig context variable. - * - * @param array $context - * The Twig context. - * - * @return array - * An array Twig context variables. - */ - protected function getContextVariables(array $context) { - $context_variables = []; - foreach ($context as $key => $value) { - if (!$value instanceof \Twig_Template) { - $context_variables[$key] = $value; - } - } - return $context_variables; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.info.yml b/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.info.yml deleted file mode 100644 index 67a4345b5..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: 'Devel dumper test module' -type: module -description: 'Test pluggable dumpers.' -package: Testing -# version: VERSION -# core: 8.x - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.libraries.yml b/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.libraries.yml deleted file mode 100644 index 8e8c2ad88..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.libraries.yml +++ /dev/null @@ -1,7 +0,0 @@ -devel_dumper_test: - version: 0 - css: - theme: - css/devel_dumper_test.css: {} - js: - js/devel_dumper_test.js: {} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.routing.yml b/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.routing.yml deleted file mode 100644 index 650b3370a..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/devel_dumper_test.routing.yml +++ /dev/null @@ -1,39 +0,0 @@ -devel_dumper_test.dump: - path: '/devel_dumper_test/dump' - defaults: - _controller: '\Drupal\devel_dumper_test\Controller\DumperTestController::dump' - _title: 'Devel Dumper Test' - requirements: - _permission: 'access devel information' - -devel_dumper_test.message: - path: '/devel_dumper_test/message' - defaults: - _controller: '\Drupal\devel_dumper_test\Controller\DumperTestController::message' - _title: 'Devel Dumper Test' - requirements: - _permission: 'access devel information' - -devel_dumper_test.export: - path: '/devel_dumper_test/export' - defaults: - _controller: '\Drupal\devel_dumper_test\Controller\DumperTestController::export' - _title: 'Devel Dumper Test' - requirements: - _permission: 'access devel information' - -devel_dumper_test.export_renderable: - path: '/devel_dumper_test/export_renderable' - defaults: - _controller: '\Drupal\devel_dumper_test\Controller\DumperTestController::exportRenderable' - _title: 'Devel Dumper Test' - requirements: - _permission: 'access devel information' - -devel_dumper_test.debug: - path: '/devel_dumper_test/debug' - defaults: - _controller: '\Drupal\devel_dumper_test\Controller\DumperTestController::debug' - _title: 'Devel Dumper Test' - requirements: - _access: 'TRUE' diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Controller/DumperTestController.php b/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Controller/DumperTestController.php deleted file mode 100644 index 2a78e6e37..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Controller/DumperTestController.php +++ /dev/null @@ -1,89 +0,0 @@ -dumper = $devel_dumper_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('devel.dumper') - ); - } - - /** - * @return array - */ - public function dump() { - $this->dumper->dump('Test output'); - - return [ - '#markup' => 'test', - ]; - } - - /** - * @return array - */ - public function message() { - $this->dumper->message('Test output'); - - return [ - '#markup' => 'test', - ]; - } - - /** - * @return array - */ - public function debug() { - $this->dumper->debug('Test output'); - - return [ - '#markup' => 'test', - ]; - } - - /** - * @return array - */ - public function export() { - return [ - '#markup' => $this->dumper->export('Test output'), - ]; - } - - /** - * @return array - */ - public function exportRenderable() { - return $this->dumper->exportAsRenderable('Test output'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/AvailableTestDumper.php b/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/AvailableTestDumper.php deleted file mode 100644 index b15f5673a..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/AvailableTestDumper.php +++ /dev/null @@ -1,60 +0,0 @@ -' . 'AvailableTestDumper::dump() ' . $input . '
    '; - echo $input; - } - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - // Add a predetermined string to $input to check if this dumper has been - // selected successfully. - $input = '
    ' . 'AvailableTestDumper::export() ' . $input . '
    '; - return $this->setSafeMarkup($input); - } - - /** - * {@inheritdoc} - */ - public function exportAsRenderable($input, $name = NULL) { - // Add a predetermined string to $input to check if this dumper has been - // selected successfully. - $input = '
    ' . 'AvailableTestDumper::exportAsRenderable() ' . $input . '
    '; - - return [ - '#attached' => [ - 'library' => ['devel_dumper_test/devel_dumper_test'] - ], - '#markup' => $this->setSafeMarkup($input), - ]; - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return TRUE; - } -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/NotAvailableTestDumper.php b/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/NotAvailableTestDumper.php deleted file mode 100644 index 2b0d886ee..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/NotAvailableTestDumper.php +++ /dev/null @@ -1,41 +0,0 @@ -' . $input . ''; - echo $input; - } - - /** - * {@inheritdoc} - */ - public function export($input, $name = NULL) { - $input = '
    ' . $input . '
    '; - return $this->setSafeMarkup($input); - } - - /** - * {@inheritdoc} - */ - public static function checkRequirements() { - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.info.yml b/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.info.yml deleted file mode 100644 index bf935fa8f..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Devel entity test module' -type: module -description: 'Provides entity types for Devel tests.' -package: Testing -# version: VERSION -# core: 8.x -dependencies: - - drupal:field - - drupal:text - - drupal:entity_test - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.links.task.yml b/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.links.task.yml deleted file mode 100644 index 052baa9c8..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.links.task.yml +++ /dev/null @@ -1,2 +0,0 @@ -devel_entity_test.local_tasks: - deriver: 'Drupal\devel_entity_test\Plugin\Derivative\DevelEntityTestLocalTasks' diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.module b/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.module deleted file mode 100644 index 4be887b29..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/devel_entity_test.module +++ /dev/null @@ -1,29 +0,0 @@ -getDefinitions(); - foreach ($entity_info as $entity_type => $info) { - if ($entity_info[$entity_type]->getProvider() == 'devel_entity_test_canonical' && !isset($view_modes[$entity_type])) { - $view_modes[$entity_type] = array( - 'full' => array( - 'label' => t('Full object'), - 'status' => TRUE, - 'cache' => TRUE, - ), - 'teaser' => array( - 'label' => t('Teaser'), - 'status' => TRUE, - 'cache' => TRUE, - ), - ); - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Entity/DevelEntityTestCanonical.php b/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Entity/DevelEntityTestCanonical.php deleted file mode 100644 index e7ed04f3f..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_entity_test/src/Entity/DevelEntityTestCanonical.php +++ /dev/null @@ -1,44 +0,0 @@ -derivatives = array(); - - $this->derivatives['devel_entity_test_canonical.canonical'] = array(); - $this->derivatives['devel_entity_test_canonical.canonical']['base_route'] = "entity.devel_entity_test_canonical.canonical"; - $this->derivatives['devel_entity_test_canonical.canonical']['route_name'] = "entity.devel_entity_test_canonical.canonical"; - $this->derivatives['devel_entity_test_canonical.canonical']['title'] = 'View'; - - $this->derivatives['devel_entity_test_edit.edit'] = array(); - $this->derivatives['devel_entity_test_edit.edit']['base_route'] = "entity.devel_entity_test_edit.edit_form"; - $this->derivatives['devel_entity_test_edit.edit']['route_name'] = "entity.devel_entity_test_edit.edit_form"; - $this->derivatives['devel_entity_test_edit.edit']['title'] = 'Edit'; - - return parent::getDerivativeDefinitions($base_plugin_definition); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.info.yml b/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.info.yml deleted file mode 100644 index be642aacd..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: 'Devel test module' -type: module -description: 'Support module for Devel testing.' -package: Testing -# version: VERSION -# core: 8.x - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.module b/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.module deleted file mode 100644 index e94fb715b..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/devel_test.module +++ /dev/null @@ -1,20 +0,0 @@ - $this->t('Simple page'), - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/src/Routing/TestRouteSubscriber.php b/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/src/Routing/TestRouteSubscriber.php deleted file mode 100644 index 1bf933281..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/modules/devel_test/src/Routing/TestRouteSubscriber.php +++ /dev/null @@ -1,20 +0,0 @@ -set('devel_test_route_rebuild','Router rebuild fired'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelContainerInfoTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelContainerInfoTest.php deleted file mode 100644 index c47d77378..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelContainerInfoTest.php +++ /dev/null @@ -1,261 +0,0 @@ -drupalPlaceBlock('local_tasks_block'); - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests container info menu link. - */ - public function testContainerInfoMenuLink() { - $this->drupalPlaceBlock('system_menu_block:devel'); - // Ensures that the events info link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('Container Info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/container/service'); - $this->assertSession()->pageTextContains('Container services'); - } - - /** - * Tests service list page. - */ - public function testServiceList() { - $this->drupalGet('/devel/container/service'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Container services'); - $this->assertContainerInfoLocalTasks(); - - $page = $this->getSession()->getPage(); - - // Ensures that the services table is found. - $table = $page->find('css', 'table.devel-service-list'); - $this->assertNotNull($table); - - // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(4, count($headers)); - - $expected_headers = ['ID', 'Class', 'Alias', 'Operations']; - $actual_headers = array_map(function ($element) { - return $element->getText(); - }, $headers); - $this->assertSame($expected_headers, $actual_headers); - - // Ensures that all the serivices are listed in the table. - $cached_definition = \Drupal::service('kernel')->getCachedContainerDefinition(); - $this->assertNotNull($cached_definition); - $rows = $table->findAll('css', 'tbody tr'); - $this->assertEquals(count($cached_definition['services']), count($rows)); - - // Tests the presence of some (arbitrarily chosen) services in the table. - $expected_services = [ - 'config.factory' => [ - 'class' => 'Drupal\Core\Config\ConfigFactory', - 'alias' => '', - ], - 'devel.route_subscriber' => [ - 'class' => 'Drupal\devel\Routing\RouteSubscriber', - 'alias' => '', - ], - 'plugin.manager.element_info' => [ - 'class' => 'Drupal\Core\Render\ElementInfoManager', - 'alias' => 'element_info', - ], - ]; - - foreach ($expected_services as $service_id => $expected) { - $row = $table->find('css', sprintf('tbody tr:contains("%s")', $service_id)); - $this->assertNotNull($row); - - /** @var $cells \Behat\Mink\Element\NodeElement[] */ - $cells = $row->findAll('css', 'td'); - $this->assertEquals(4, count($cells)); - - $cell_service_id = $cells[0]; - $this->assertEquals($service_id, $cell_service_id->getText()); - $this->assertTrue($cell_service_id->hasClass('table-filter-text-source')); - - $cell_class = $cells[1]; - $this->assertEquals($expected['class'], $cell_class->getText()); - $this->assertTrue($cell_class->hasClass('table-filter-text-source')); - - $cell_alias = $cells[2]; - $this->assertEquals($expected['alias'], $cell_alias->getText()); - $this->assertTrue($cell_class->hasClass('table-filter-text-source')); - - $cell_operations = $cells[3]; - $actual_href = $cell_operations->findLink('Devel')->getAttribute('href'); - $expected_href = Url::fromRoute('devel.container_info.service.detail', ['service_id' => $service_id])->toString(); - $this->assertEquals($expected_href, $actual_href); - } - - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/container/service'); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests service detail page. - */ - public function testServiceDetail() { - $service_id = 'devel.dumper'; - - // Ensures that the page works as expected. - $this->drupalGet("/devel/container/service/$service_id"); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains("Service $service_id detail"); - - // Ensures that the page returns a 404 error if the requested service is - // not defined. - $this->drupalGet('/devel/container/service/not.exists'); - $this->assertSession()->statusCodeEquals(404); - - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet("devel/container/service/$service_id"); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests parameter list page. - */ - public function testParameterList() { - // Ensures that the page works as expected. - $this->drupalGet('/devel/container/parameter'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Container parameters'); - $this->assertContainerInfoLocalTasks(); - - $page = $this->getSession()->getPage(); - - // Ensures that the parameters table is found. - $table = $page->find('css', 'table.devel-parameter-list'); - $this->assertNotNull($table); - - // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(2, count($headers)); - - $expected_headers = ['Name', 'Operations']; - $actual_headers = array_map(function ($element) { - return $element->getText(); - }, $headers); - $this->assertSame($expected_headers, $actual_headers); - - // Ensures that all the parameters are listed in the table. - $cached_definition = \Drupal::service('kernel')->getCachedContainerDefinition(); - $this->assertNotNull($cached_definition); - $rows = $table->findAll('css', 'tbody tr'); - $this->assertEquals(count($cached_definition['parameters']), count($rows)); - - // Tests the presence of some parameters in the table. - $expected_parameters = [ - 'container.modules', - 'cache_bins', - 'factory.keyvalue', - 'twig.config', - ]; - - foreach ($expected_parameters as $parameter_name) { - $row = $table->find('css', sprintf('tbody tr:contains("%s")', $parameter_name)); - $this->assertNotNull($row); - - /** @var $cells \Behat\Mink\Element\NodeElement[] */ - $cells = $row->findAll('css', 'td'); - $this->assertEquals(2, count($cells)); - - $cell_parameter_name = $cells[0]; - $this->assertEquals($parameter_name, $cell_parameter_name->getText()); - $this->assertTrue($cell_parameter_name->hasClass('table-filter-text-source')); - - $cell_operations = $cells[1]; - $actual_href = $cell_operations->findLink('Devel')->getAttribute('href'); - $expected_href = Url::fromRoute('devel.container_info.parameter.detail', ['parameter_name' => $parameter_name])->toString(); - $this->assertEquals($expected_href, $actual_href); - } - - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/container/service'); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests parameter detail page. - */ - public function testParameterDetail() { - $parameter_name = 'cache_bins'; - - // Ensures that the page works as expected. - $this->drupalGet("/devel/container/parameter/$parameter_name"); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains("Parameter $parameter_name value"); - - // Ensures that the page returns a 404 error if the requested parameter is - // not defined. - $this->drupalGet('/devel/container/parameter/not_exists'); - $this->assertSession()->statusCodeEquals(404); - - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet("devel/container/service/$parameter_name"); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Asserts that container info local tasks are present. - */ - protected function assertContainerInfoLocalTasks() { - $expected_local_tasks = [ - ['devel.container_info.service', []], - ['devel.container_info.parameter', []], - ]; - - $this->assertLocalTasks($expected_local_tasks); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelControllerTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelControllerTest.php deleted file mode 100644 index 0fc375afb..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelControllerTest.php +++ /dev/null @@ -1,122 +0,0 @@ -randomMachineName(); - $data = ['type' => 'entity_test', 'name' => $random_label]; - $this->entity = entity_create('entity_test', $data); - $this->entity->save(); - - // Create a test entity with only canonical route. - $random_label = $this->randomMachineName(); - $data = ['type' => 'devel_entity_test_canonical', 'name' => $random_label]; - $this->entity_canonical = entity_create('devel_entity_test_canonical', $data); - $this->entity_canonical->save(); - - // Create a test entity with only edit route. - $random_label = $this->randomMachineName(); - $data = ['type' => 'devel_entity_test_edit', 'name' => $random_label]; - $this->entity_edit = entity_create('devel_entity_test_edit', $data); - $this->entity_edit->save(); - - // Create a test entity with no routes. - $random_label = $this->randomMachineName(); - $data = ['type' => 'devel_entity_test_no_links', 'name' => $random_label]; - $this->entity_no_links = entity_create('devel_entity_test_no_links', $data); - $this->entity_no_links->save(); - - $this->drupalPlaceBlock('local_tasks_block'); - - $web_user = $this->drupalCreateUser([ - 'view test entity', - 'administer entity_test content', - 'access devel information', - ]); - $this->drupalLogin($web_user); - } - - function testRouteGeneration() { - // Test Devel load and render routes for entities with both route - // definitions. - $this->drupalGet('entity_test/' . $this->entity->id()); - $this->assertText('Devel', 'Devel tab is present'); - $this->drupalGet('devel/entity_test/' . $this->entity->id()); - $this->assertResponse(200); - $this->assertText('Definition', 'Devel definition tab is present'); - $this->assertText('Load', 'Devel load tab is present'); - $this->assertText('Render', 'Devel load tab is present'); - $this->assertLinkByHref('devel/entity_test/' . $this->entity->id() . '/render'); - $this->drupalGet('devel/entity_test/' . $this->entity->id() . '/render'); - $this->assertResponse(200); - $this->assertLinkByHref('devel/entity_test/' . $this->entity->id() . '/definition'); - $this->drupalGet('devel/entity_test/' . $this->entity->id() . '/definition'); - $this->assertResponse(200); - - // Test Devel load and render routes for entities with only canonical route - // definitions. - $this->drupalGet('devel_entity_test_canonical/' . $this->entity_canonical->id()); - $this->assertText('Devel', 'Devel tab is present'); - //TODO this fail since assertNoLinkByHref search by partial value. - //$this->assertNoLinkByHref('devel/devel_entity_test_canonical/' . $this->entity_canonical->id()); - $this->assertLinkByHref('devel/devel_entity_test_canonical/' . $this->entity_canonical->id() . '/render'); - $this->drupalGet('devel/devel_entity_test_canonical/' . $this->entity_canonical->id()); - $this->assertResponse(404); - $this->drupalGet('devel/devel_entity_test_canonical/' . $this->entity_canonical->id() . '/render'); - $this->assertResponse(200); - $this->assertLinkByHref('devel/devel_entity_test_canonical/' . $this->entity_canonical->id() . '/definition'); - $this->drupalGet('devel/devel_entity_test_canonical/' . $this->entity_canonical->id() . '/definition'); - $this->assertResponse(200); - - // Test Devel load and render routes for entities with only edit route - // definitions. - $this->drupalGet('devel_entity_test_edit/manage/' . $this->entity_edit->id()); - $this->assertText('Devel', 'Devel tab is present'); - $this->assertLinkByHref('devel/devel_entity_test_edit/' . $this->entity_edit->id()); - $this->assertNoLinkByHref('devel/devel_entity_test_edit/' . $this->entity_edit->id() . '/render'); - $this->assertNoLinkByHref('devel/devel_entity_test_edit/' . $this->entity_edit->id() . '/definition'); - $this->drupalGet('devel/devel_entity_test_edit/' . $this->entity_edit->id()); - $this->assertResponse(200); - $this->drupalGet('devel/devel_entity_test_edit/' . $this->entity_edit->id() . '/render'); - $this->assertResponse(404); - $this->drupalGet('devel/devel_entity_test_edit/' . $this->entity_edit->id() . '/definition'); - $this->assertResponse(200); - - // Test Devel load and render routes for entities with no route - // definitions. - $this->drupalGet('devel_entity_test_no_links/' . $this->entity_edit->id()); - $this->assertNoText('Devel', 'Devel tab is not present'); - $this->assertNoLinkByHref('devel/devel_entity_test_no_links/' . $this->entity_no_links->id()); - $this->assertNoLinkByHref('devel/devel_entity_test_no_links/' . $this->entity_no_links->id() . '/render'); - $this->assertNoLinkByHref('devel/devel_entity_test_no_links/' . $this->entity_no_links->id() . '/definition'); - $this->drupalGet('devel/devel_entity_test_no_links/' . $this->entity_no_links->id()); - $this->assertResponse(404); - $this->drupalGet('devel/devel_entity_test_no_links/' . $this->entity_no_links->id() . '/render'); - $this->assertResponse(404); - $this->drupalGet('devel/devel_entity_test_no_links/' . $this->entity_no_links->id() . '/definition'); - $this->assertResponse(404); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelDumperTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelDumperTest.php deleted file mode 100644 index d46a95c52..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelDumperTest.php +++ /dev/null @@ -1,165 +0,0 @@ -drupalCreateUser(['administer site configuration', 'access devel information']); - $this->drupalLogin($admin_user); - } - - /** - * Test dumpers configuration page. - */ - public function testDumpersConfiguration() { - $this->drupalGet('admin/config/development/devel'); - - // Ensures that the dumper input is present on the config page. - $this->assertSession()->fieldExists('dumper'); - - // Ensures that the 'default' dumper is enabled by default. - $this->assertSession()->checkboxChecked('edit-dumper-default'); - - // Ensures that all dumpers declared by devel are present on the config page - // and that only the available dumpers are selectable. - $dumpers = [ - 'default', - 'drupal_variable', - 'firephp', - 'chromephp', - 'var_dumper', - ]; - $available_dumpers = ['default', 'drupal_variable', 'var_dumper']; - - foreach ($dumpers as $dumper) { - $this->assertFieldByXPath('//input[@type="radio" and @name="dumper"]', $dumper); - if (in_array($dumper, $available_dumpers)) { - $this->assertFieldByXPath('//input[@name="dumper" and not(@disabled="disabled")]', $dumper); - } - else { - $this->assertFieldByXPath('//input[@name="dumper" and @disabled="disabled"]', $dumper); - } - } - - // Ensures that dumper plugins declared by other modules are present on the - // config page and that only the available dumpers are selectable. - $this->assertFieldByXPath('//input[@name="dumper"]', 'available_test_dumper'); - $this->assertSession()->pageTextContains('Available test dumper.'); - $this->assertSession()->pageTextContains('Drupal dumper for testing purposes (available).'); - $this->assertFieldByXPath('//input[@name="dumper" and not(@disabled="disabled")]', 'available_test_dumper', 'Available dumper input not is disabled.'); - - $this->assertFieldByXPath('//input[@name="dumper"]', 'not_available_test_dumper'); - $this->assertSession()->pageTextContains('Not available test dumper.'); - $this->assertSession()->pageTextContains('Drupal dumper for testing purposes (not available).Not available. You may need to install external dependencies for use this plugin.'); - $this->assertFieldByXPath('//input[@name="dumper" and @disabled="disabled"]', 'not_available_test_dumper', 'Non available dumper input is disabled.'); - - // Ensures that saving of the dumpers configuration works as expected. - $edit = [ - 'dumper' => 'drupal_variable', - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains(t('The configuration options have been saved.')); - - $config = \Drupal::config('devel.settings')->get('devel_dumper'); - $this->assertEquals('drupal_variable', $config, 'The configuration options have been properly saved'); - - // Ensure that if the chosen dumper is not available (e.g. the module that - // provide it is uninstalled) the 'default' dumper appears selected in the - // config page. - \Drupal::service('module_installer')->install(['kint']); - - $this->drupalGet('admin/config/development/devel'); - $this->assertFieldByXPath('//input[@name="dumper"]', 'kint'); - - $edit = [ - 'dumper' => 'kint', - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains(t('The configuration options have been saved.')); - - $config = \Drupal::config('devel.settings')->get('devel_dumper'); - $this->assertEquals('kint', $config, 'The configuration options have been properly saved'); - - \Drupal::service('module_installer')->uninstall(['kint']); - - $this->drupalGet('admin/config/development/devel'); - $this->assertNoFieldByXPath('//input[@name="dumper"]', 'kint'); - $this->assertSession()->checkboxChecked('edit-dumper-default'); - } - - /** - * Test variable is dumped in page. - */ - function testDumpersOutput() { - $edit = [ - 'dumper' => 'available_test_dumper', - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains(t('The configuration options have been saved.')); - - $this->drupalGet('devel_dumper_test/dump'); - $elements = $this->xpath('//body/pre[contains(text(), :message)]', [':message' => 'AvailableTestDumper::dump() Test output']); - $this->assertTrue(!empty($elements), 'Dumped message is present.'); - - $this->drupalGet('devel_dumper_test/message'); - $elements = $this->xpath('//div[contains(@class, "messages")]/pre[contains(text(), :message)]', [':message' => 'AvailableTestDumper::export() Test output']); - $this->assertTrue(!empty($elements), 'Dumped message is present.'); - - $this->drupalGet('devel_dumper_test/export'); - $elements = $this->xpath('//div[@class="layout-content"]//pre[contains(text(), :message)]', [':message' => 'AvailableTestDumper::export() Test output']); - $this->assertTrue(!empty($elements), 'Dumped message is present.'); - - $this->drupalGet('devel_dumper_test/export_renderable'); - $elements = $this->xpath('//div[@class="layout-content"]//pre[contains(text(), :message)]', [':message' => 'AvailableTestDumper::exportAsRenderable() Test output']); - $this->assertTrue(!empty($elements), 'Dumped message is present.'); - // Ensures that plugins can add libraries to the page when the - // ::exportAsRenderable() method is used. - $this->assertSession()->responseContains('devel_dumper_test/css/devel_dumper_test.css'); - $this->assertSession()->responseContains('devel_dumper_test/js/devel_dumper_test.js'); - - $debug_filename = file_directory_temp() . '/drupal_debug.txt'; - - $this->drupalGet('devel_dumper_test/debug'); - $file_content = file_get_contents($debug_filename); - $expected = <<AvailableTestDumper::export() Test output - -EOF; - $this->assertEquals($file_content, $expected, 'Dumped message is present.'); - - // Ensures that the DevelDumperManager::debug() is not access checked and - // that the dump is written in the debug file even if the user has not the - // 'access devel information' permission. - file_put_contents($debug_filename, ''); - $this->drupalLogout(); - $this->drupalGet('devel_dumper_test/debug'); - $file_content = file_get_contents($debug_filename); - $expected = <<AvailableTestDumper::export() Test output - -EOF; - $this->assertEquals($file_content, $expected, 'Dumped message is present.'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelElementInfoTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelElementInfoTest.php deleted file mode 100644 index 2698e24da..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelElementInfoTest.php +++ /dev/null @@ -1,151 +0,0 @@ -drupalPlaceBlock('system_menu_block:devel'); - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests element info menu link. - */ - public function testElementInfoMenuLink() { - $this->drupalPlaceBlock('system_menu_block:devel'); - // Ensures that the element info link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('Element Info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/elements'); - $this->assertSession()->pageTextContains('Element Info'); - } - - /** - * Tests element list page. - */ - public function testElementList() { - $this->drupalGet('/devel/elements'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Element Info'); - - $page = $this->getSession()->getPage(); - - // Ensures that the element list table is found. - $table = $page->find('css', 'table.devel-element-list'); - $this->assertNotNull($table); - - // Ensures that the expected table headers are found. - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(4, count($headers)); - - $expected_headers = ['Name', 'Provider', 'Class', 'Operations']; - $actual_headers = array_map(function (NodeElement $element) { - return $element->getText(); - }, $headers); - $this->assertSame($expected_headers, $actual_headers); - - // Tests the presence of some (arbitrarily chosen) elements in the table. - $expected_elements = [ - 'button' => [ - 'class' => 'Drupal\Core\Render\Element\Button', - 'provider' => 'core', - ], - 'form' => [ - 'class' => 'Drupal\Core\Render\Element\Form', - 'provider' => 'core', - ], - 'html' => [ - 'class' => 'Drupal\Core\Render\Element\Html', - 'provider' => 'core', - ], - ]; - - foreach ($expected_elements as $element_name => $element) { - $row = $table->find('css', sprintf('tbody tr:contains("%s")', $element_name)); - $this->assertNotNull($row); - - /** @var $cells \Behat\Mink\Element\NodeElement[] */ - $cells = $row->findAll('css', 'td'); - $this->assertEquals(4, count($cells)); - - $cell = $cells[0]; - $this->assertEquals($element_name, $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[1]; - $this->assertEquals($element['provider'], $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[2]; - $this->assertEquals($element['class'], $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[3]; - $actual_href = $cell->findLink('Devel')->getAttribute('href'); - $expected_href = Url::fromRoute('devel.elements_page.detail', ['element_name' => $element_name])->toString(); - $this->assertEquals($expected_href, $actual_href); - } - - // Ensures that the page is accessible only to the users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/elements'); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests element detail page. - */ - public function testElementDetail() { - $element_name = 'button'; - - // Ensures that the page works as expected. - $this->drupalGet("/devel/elements/$element_name"); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains("Element $element_name"); - - // Ensures that the page returns a 404 error if the requested element is - // not defined. - $this->drupalGet('/devel/elements/not_exists'); - $this->assertSession()->statusCodeEquals(404); - - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet("/devel/elements/$element_name"); - $this->assertSession()->statusCodeEquals(403); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEntityTypeInfoTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEntityTypeInfoTest.php deleted file mode 100644 index 3a708e515..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEntityTypeInfoTest.php +++ /dev/null @@ -1,158 +0,0 @@ -drupalPlaceBlock('system_menu_block:devel'); - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests entity info menu link. - */ - public function testEntityInfoMenuLink() { - $this->drupalPlaceBlock('system_menu_block:devel'); - // Ensures that the entity type info link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('Entity Info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/entity/info'); - $this->assertSession()->pageTextContains('Entity Info'); - } - - /** - * Tests entity type list page. - */ - public function testEntityTypeList() { - $this->drupalGet('/devel/entity/info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Entity Info'); - - $page = $this->getSession()->getPage(); - - // Ensures that the entity type list table is found. - $table = $page->find('css', 'table.devel-entity-type-list'); - $this->assertNotNull($table); - - // Ensures that the expected table headers are found. - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(5, count($headers)); - - $expected_headers = ['ID', 'Name', 'Provider', 'Class', 'Operations']; - $actual_headers = array_map(function (NodeElement $element) { - return $element->getText(); - }, $headers); - $this->assertSame($expected_headers, $actual_headers); - - // Tests the presence of some (arbitrarily chosen) entity types in the table. - $expected_types = [ - 'date_format' => [ - 'name' => 'Date format', - 'class' => 'Drupal\Core\Datetime\Entity\DateFormat', - 'provider' => 'core', - ], - 'block' => [ - 'name' => 'Block', - 'class' => 'Drupal\block\Entity\Block', - 'provider' => 'block', - ], - 'entity_view_mode' => [ - 'name' => 'View mode', - 'class' => 'Drupal\Core\Entity\Entity\EntityViewMode', - 'provider' => 'core', - ], - ]; - - foreach ($expected_types as $entity_type_id => $entity_type) { - $row = $table->find('css', sprintf('tbody tr:contains("%s")', $entity_type_id)); - $this->assertNotNull($row); - - /** @var $cells \Behat\Mink\Element\NodeElement[] */ - $cells = $row->findAll('css', 'td'); - $this->assertEquals(5, count($cells)); - - $cell = $cells[0]; - $this->assertEquals($entity_type_id, $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[1]; - $this->assertEquals($entity_type['name'], $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[2]; - $this->assertEquals($entity_type['provider'], $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[3]; - $this->assertEquals($entity_type['class'], $cell->getText()); - $this->assertTrue($cell->hasClass('table-filter-text-source')); - - $cell = $cells[4]; - $actual_href = $cell->findLink('Devel')->getAttribute('href'); - $expected_href = Url::fromRoute('devel.entity_info_page.detail', ['entity_type_id' => $entity_type_id])->toString(); - $this->assertEquals($expected_href, $actual_href); - } - - // Ensures that the page is accessible only to the users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/entity/info'); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests entity type detail page. - */ - public function testEntityTypeDetail() { - $entity_type_id = 'date_format'; - - // Ensures that the page works as expected. - $this->drupalGet("/devel/entity/info/$entity_type_id"); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains("Entity type $entity_type_id"); - - // Ensures that the page returns a 404 error if the requested entity type is - // not defined. - $this->drupalGet('/devel/entity/info/not_exists'); - $this->assertSession()->statusCodeEquals(404); - - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet("/devel/entity/info/$entity_type_id"); - $this->assertSession()->statusCodeEquals(403); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelErrorHandlerTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelErrorHandlerTest.php deleted file mode 100644 index 9c942821c..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelErrorHandlerTest.php +++ /dev/null @@ -1,161 +0,0 @@ - 'Notice', - '@message' => 'Undefined variable: undefined', - '%function' => 'Drupal\devel\Form\SettingsForm->demonstrateErrorHandlers()', - ]); - - $expected_warning = new FormattableMarkup('%type: @message in %function (line ', [ - '%type' => 'Warning', - '@message' => 'Division by zero', - '%function' => 'Drupal\devel\Form\SettingsForm->demonstrateErrorHandlers()', - ]); - - $config = $this->config('system.logging'); - $config->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save(); - - $admin_user = $this->drupalCreateUser(['administer site configuration', 'access devel information']); - $this->drupalLogin($admin_user); - - // Ensures that the error handler config is present on the config page and - // by default the standard error handler is selected. - $error_handlers = \Drupal::config('devel.settings')->get('error_handlers'); - $this->assertEquals($error_handlers, [DEVEL_ERROR_HANDLER_STANDARD => DEVEL_ERROR_HANDLER_STANDARD]); - $this->drupalGet('admin/config/development/devel'); - $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_STANDARD); - - // Ensures that selecting the DEVEL_ERROR_HANDLER_NONE option no error - // (raw or message) is shown on the site in case of php errors. - $edit = [ - 'error_handlers[]' => DEVEL_ERROR_HANDLER_NONE, - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains('The configuration options have been saved.'); - - $error_handlers = \Drupal::config('devel.settings')->get('error_handlers'); - $this->assertEquals($error_handlers, [DEVEL_ERROR_HANDLER_NONE => DEVEL_ERROR_HANDLER_NONE]); - $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_NONE); - - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseNotContains($expected_notice); - $this->assertSession()->responseNotContains($expected_warning); - $this->assertSession()->elementNotExists('css', $messages_selector); - - // Ensures that selecting the DEVEL_ERROR_HANDLER_BACKTRACE_KINT option a - // backtrace above the rendered page is shown on the site in case of php - // errors. - $edit = [ - 'error_handlers[]' => DEVEL_ERROR_HANDLER_BACKTRACE_KINT, - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains('The configuration options have been saved.'); - - $error_handlers = \Drupal::config('devel.settings')->get('error_handlers'); - $this->assertEquals($error_handlers, [DEVEL_ERROR_HANDLER_BACKTRACE_KINT => DEVEL_ERROR_HANDLER_BACKTRACE_KINT]); - $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_BACKTRACE_KINT); - - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->elementNotExists('css', $messages_selector); - - // Ensures that selecting the DEVEL_ERROR_HANDLER_BACKTRACE_DPM option a - // backtrace in the message area is shown on the site in case of php errors. - $edit = [ - 'error_handlers[]' => DEVEL_ERROR_HANDLER_BACKTRACE_DPM, - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains('The configuration options have been saved.'); - - $error_handlers = \Drupal::config('devel.settings')->get('error_handlers'); - $this->assertEquals($error_handlers, [DEVEL_ERROR_HANDLER_BACKTRACE_DPM => DEVEL_ERROR_HANDLER_BACKTRACE_DPM]); - $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_BACKTRACE_DPM); - - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseContains($expected_notice); - $this->assertSession()->responseContains($expected_warning); - $this->assertSession()->elementContains('css', $messages_selector, $expected_notice); - $this->assertSession()->elementContains('css', $messages_selector, $expected_warning); - - // Ensures that when multiple handlers are selected, the output produced by - // every handler is shown on the site in case of php errors. - $edit = [ - 'error_handlers[]' => [ - DEVEL_ERROR_HANDLER_BACKTRACE_KINT => DEVEL_ERROR_HANDLER_BACKTRACE_KINT, - DEVEL_ERROR_HANDLER_BACKTRACE_DPM => DEVEL_ERROR_HANDLER_BACKTRACE_DPM, - ], - ]; - $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains('The configuration options have been saved.'); - - $error_handlers = \Drupal::config('devel.settings')->get('error_handlers'); - $this->assertEquals($error_handlers, [ - DEVEL_ERROR_HANDLER_BACKTRACE_KINT => DEVEL_ERROR_HANDLER_BACKTRACE_KINT, - DEVEL_ERROR_HANDLER_BACKTRACE_DPM => DEVEL_ERROR_HANDLER_BACKTRACE_DPM, - ]); - $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_BACKTRACE_KINT); - $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_BACKTRACE_DPM); - - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseContains($expected_notice); - $this->assertSession()->responseContains($expected_warning); - $this->assertSession()->elementContains('css', $messages_selector, $expected_notice); - $this->assertSession()->elementContains('css', $messages_selector, $expected_warning); - - // Ensures that setting the error reporting to all the output produced by - // handlers is shown on the site in case of php errors. - $config->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save(); - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseContains($expected_notice); - $this->assertSession()->responseContains($expected_warning); - $this->assertSession()->elementContains('css', $messages_selector, $expected_notice); - $this->assertSession()->elementContains('css', $messages_selector, $expected_warning); - - // Ensures that setting the error reporting to some the output produced by - // handlers is shown on the site in case of php errors. - $config->set('error_level', ERROR_REPORTING_DISPLAY_SOME)->save(); - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseContains($expected_notice); - $this->assertSession()->responseContains($expected_warning); - $this->assertSession()->elementContains('css', $messages_selector, $expected_notice); - $this->assertSession()->elementContains('css', $messages_selector, $expected_warning); - - // Ensures that setting the error reporting to none the output produced by - // handlers is not shown on the site in case of php errors. - $config->set('error_level', ERROR_REPORTING_HIDE)->save(); - $this->clickLink('notice+warning'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseNotContains($expected_notice); - $this->assertSession()->responseNotContains($expected_warning); - $this->assertSession()->elementNotExists('css', $messages_selector); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEventInfoTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEventInfoTest.php deleted file mode 100644 index d33458b19..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelEventInfoTest.php +++ /dev/null @@ -1,135 +0,0 @@ -drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests event info menu link. - */ - public function testEventsInfoMenuLink() { - $this->drupalPlaceBlock('system_menu_block:devel'); - // Ensures that the events info link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('Events Info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/events'); - $this->assertSession()->pageTextContains('Events'); - } - - /** - * Tests event info page. - */ - public function testEventList() { - $event_dispatcher = \Drupal::service('event_dispatcher'); - - $this->drupalGet('/devel/events'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Events'); - - $page = $this->getSession()->getPage(); - - // Ensures that the event table is found. - $table = $page->find('css', 'table.devel-event-list'); - $this->assertNotNull($table); - - // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(3, count($headers)); - - $expected_headers = ['Event Name', 'Callable', 'Priority']; - $actual_headers = array_map(function ($element) { - return $element->getText(); - }, $headers); - $this->assertSame($expected_headers, $actual_headers); - - // Ensures that all the events are listed in the table. - $events = $event_dispatcher->getListeners(); - $event_header_row = $table->findAll('css', 'tbody tr th.devel-event-name-header'); - $this->assertEquals(count($events), count($event_header_row)); - - // Tests the presence of some (arbitrarily chosen) events and related - // listeners in the table. The event items are tested dynamically so no - // test failures are expected if listeners change. - $expected_events = [ - 'config.delete', - 'kernel.request', - 'routing.route_alter', - ]; - - foreach ($expected_events as $event_name) { - $listeners = $event_dispatcher->getListeners($event_name); - - // Ensures that the event header is present in the table. - $event_header_row = $table->findAll('css', sprintf('tbody tr th:contains("%s")', $event_name)); - $this->assertNotNull($event_header_row); - $this->assertEquals(1, count($event_header_row)); - - // Ensures that all the event listener are listed in the table. - /** @var $event_rows \Behat\Mink\Element\NodeElement[] */ - $event_rows = $table->findAll('css', sprintf('tbody tr:contains("%s")', $event_name)); - // Remove the header row. - array_shift($event_rows); - $this->assertEquals(count($listeners), count($event_rows)); - - foreach ($listeners as $index => $listener) { - /** @var $cells \Behat\Mink\Element\NodeElement[] */ - $cells = $event_rows[$index]->findAll('css', 'td'); - $this->assertEquals(3, count($cells)); - - $cell_event_name = $cells[0]; - $this->assertEquals($event_name, $cell_event_name->getText()); - $this->assertTrue($cell_event_name->hasClass('table-filter-text-source')); - $this->assertTrue($cell_event_name->hasClass('visually-hidden')); - - $cell_callable = $cells[1]; - is_callable($listener, TRUE, $callable_name); - $this->assertEquals($callable_name, $cell_callable->getText()); - - $cell_methods = $cells[2]; - $this->assertEquals($index, $cell_methods->getText()); - } - } - - // Ensures that the page is accessible only to the users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/events'); - $this->assertSession()->statusCodeEquals(403); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelLayoutInfoTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelLayoutInfoTest.php deleted file mode 100644 index 6277de192..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelLayoutInfoTest.php +++ /dev/null @@ -1,151 +0,0 @@ -markTestSkipped('Devel Layout Info Tests only available on version 8.3.x+.'); - } - - parent::setUp(); - - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests layout info menu link. - */ - public function testLayoutsInfoMenuLink() { - $this->drupalPlaceBlock('system_menu_block:devel'); - // Ensures that the layout info link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('Layouts Info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/layouts'); - $this->assertSession()->pageTextContains('Layout'); - } - - /** - * Tests layout info page. - */ - public function testLayoutList() { - $this->drupalGet('/devel/layouts'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Layouts'); - - $page = $this->getSession()->getPage(); - - // Ensures that the layout table is found. - $table = $page->find('css', 'table.devel-layout-list'); - $this->assertNotNull($table); - - // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(6, count($headers)); - - $expected_headers = ['Icon', 'Label', 'Description', 'Category', 'Regions', 'Provider']; - $actual_headers = array_map(function ($element) { - return $element->getText(); - }, $headers); - $this->assertSame($expected_headers, $actual_headers); - - // Ensures that all the layouts are listed in the table. - $layout_manager = \Drupal::service('plugin.manager.core.layout'); - $layouts = $layout_manager->getDefinitions(); - $table_rows = $table->findAll('css', 'tbody tr'); - $this->assertEquals(count($layouts), count($table_rows)); - - $index = 0; - foreach ($layouts as $layout) { - $cells = $table_rows[$index]->findAll('css', 'td'); - $this->assertEquals(6, count($cells)); - - $cell_layout_icon = $cells[0]; - if (empty($layout->getIconPath())) { - // @todo test that the icon path image is set correctly - } - else { - $this->assertNull($cell_layout_icon->getText()); - } - - $cell_layout_label = $cells[1]; - $this->assertEquals($cell_layout_label->getText(), $layout->getLabel()); - - $cell_layout_description = $cells[2]; - $this->assertEquals($cell_layout_description->getText(), $layout->getDescription()); - - $cell_layout_category = $cells[3]; - $this->assertEquals($cell_layout_category->getText(), $layout->getCategory()); - - $cell_layout_regions = $cells[4]; - $this->assertEquals($cell_layout_regions->getText(), implode(', ', $layout->getRegionLabels())); - - $cell_layout_provider = $cells[5]; - $this->assertEquals($cell_layout_provider->getText(), $layout->getProvider()); - - $index++; - } - - // Ensures that the page is accessible only to the users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/layouts'); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests the dependency with layout_discovery module. - */ - public function testLayoutDiscoveryDependency() { - $this->container->get('module_installer')->uninstall(['layout_discovery']); - $this->drupalPlaceBlock('system_menu_block:devel'); - - // Ensures that the layout info link is not present on the devel menu. - $this->drupalGet(''); - $this->assertSession()->linkNotExists('Layouts Info'); - - // Ensures that the layouts info page is not available. - $this->drupalGet('/devel/layouts'); - $this->assertSession()->statusCodeEquals(404); - - // Check a few other devel pages to verify devel module stil works. - $this->drupalGet('/devel/events'); - $this->assertSession()->statusCodeEquals(200); - $this->drupalGet('devel/routes'); - $this->assertSession()->statusCodeEquals(200); - $this->drupalGet('/devel/container/service'); - $this->assertSession()->statusCodeEquals(200); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelMenuLinksTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelMenuLinksTest.php deleted file mode 100644 index e806453ad..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelMenuLinksTest.php +++ /dev/null @@ -1,109 +0,0 @@ -drupalPlaceBlock('system_menu_block:devel'); - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information', 'administer site configuration']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests CSFR protected links. - */ - public function testCsrfProtectedLinks() { - // Ensure CSRF link are not accessible directly. - $this->drupalGet('devel/run-cron'); - $this->assertResponse(403); - $this->drupalGet('devel/cache/clear'); - $this->assertResponse(403); - - // Ensure clear cache link works properly. - $this->assertLink('Cache clear'); - $this->clickLink('Cache clear'); - $this->assertText('Cache cleared.'); - - // Ensure run cron link works properly. - $this->assertLink('Run cron'); - $this->clickLink('Run cron'); - $this->assertText('Cron ran successfully.'); - - // Ensure CSRF protected links work properly after change session. - $this->drupalLogout(); - $this->drupalLogin($this->develUser); - - $this->assertLink('Cache clear'); - $this->clickLink('Cache clear'); - $this->assertText('Cache cleared.'); - - $this->assertLink('Run cron'); - $this->clickLink('Run cron'); - $this->assertText('Cron ran successfully.'); - } - - /** - * Tests redirect destination links. - */ - public function testRedirectDestinationLinks() { - // By default, in the testing profile, front page is the user canonical URI. - // For better testing do not use the default frontpage. - $url = Url::fromRoute('devel.simple_page'); - $destination = Url::fromRoute('devel.simple_page', [], ['absolute' => FALSE]); - - $this->drupalGet($url); - $this->assertLink(t('Reinstall Modules')); - $this->clickLink(t('Reinstall Modules')); - $this->assertUrl('devel/reinstall', ['query' => ['destination' => $destination->toString()]]); - - $this->drupalGet($url); - $this->assertLink(t('Rebuild Menu')); - $this->clickLink(t('Rebuild Menu')); - $this->assertUrl('devel/menu/reset', ['query' => ['destination' => $destination->toString()]]); - - $this->drupalGet($url); - $this->assertLink(t('Cache clear')); - $this->clickLink(t('Cache clear')); - $this->assertText('Cache cleared.'); - $this->assertUrl($url); - - $this->drupalGet($url); - $this->assertLink(t('Run cron')); - $this->clickLink(t('Run cron')); - $this->assertText(t('Cron ran successfully.')); - $this->assertUrl($url); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelModulesReinstallTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelModulesReinstallTest.php deleted file mode 100644 index 5068f2cab..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelModulesReinstallTest.php +++ /dev/null @@ -1,60 +0,0 @@ -drupalCreateUser(['administer site configuration']); - $this->drupalLogin($web_user); - } - - /** - * Reinstall modules. - */ - public function testDevelReinstallModules() { - // Minimal profile enables only dblog, block and node. - $modules = ['dblog', 'block']; - - // Needed for compare correctly the message. - sort($modules); - - $this->drupalGet('devel/reinstall'); - - // Prepare field data in an associative array - $edit = []; - foreach ($modules as $module) { - $edit["reinstall[$module]"] = TRUE; - } - - $this->drupalPostForm('devel/reinstall', $edit, t('Reinstall')); - $this->assertText(t('Uninstalled and installed: @names.', ['@names' => implode(', ', $modules)])); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRequirementsTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRequirementsTest.php deleted file mode 100644 index 876a5ff4f..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRequirementsTest.php +++ /dev/null @@ -1,33 +0,0 @@ -drupalCreateUser(['administer site configuration']); - $this->drupalLogin($admin_user); - - $this->drupalGet('admin/reports/status'); - $this->assertSession()->statusCodeEquals(200); - - $this->assertSession()->pageTextContains('Devel module enabled'); - $this->assertSession()->pageTextContains('The Devel module provides access to internal debugging information; therefore it\'s recommended to disable this module on sites in production.'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouteInfoTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouteInfoTest.php deleted file mode 100644 index bdd1d115f..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouteInfoTest.php +++ /dev/null @@ -1,197 +0,0 @@ -drupalPlaceBlock('system_menu_block:devel'); - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->drupalLogin($this->develUser); - } - - /** - * Tests routes info. - */ - public function testRouteList() { - // Ensures that the routes info link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('Routes Info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/routes'); - $this->assertSession()->pageTextContains('Routes'); - - $page = $this->getSession()->getPage(); - - // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ - $headers = $page->findAll('css', 'table.devel-route-list thead th'); - $this->assertEquals(4, count($headers)); - - $expected_items = ['Route Name', 'Path', 'Allowed Methods', 'Operations']; - foreach ($headers as $key => $element) { - $this->assertSame($element->getText(), $expected_items[$key]); - } - - // Ensures that all the routes are listed in the table. - $routes = \Drupal::service('router.route_provider')->getAllRoutes(); - $rows = $page->findAll('css', 'table.devel-route-list tbody tr'); - $this->assertEquals(count($routes), count($rows)); - - // Tests the presence of some (arbitrarily chosen) routes in the table. - $expected_routes = [ - '' => [ - 'path' => '/', - 'methods' => ['GET', 'POST'], - 'dynamic' => FALSE, - ], - 'user.login' => [ - 'path' => '/user/login', - 'methods' => ['GET', 'POST'], - 'dynamic' => FALSE, - ], - 'entity.user.canonical' => [ - 'path' => '/user/{user}', - 'methods' => ['GET', 'POST'], - 'dynamic' => TRUE, - ], - 'entity.user.devel_load' => [ - 'path' => '/devel/user/{user}', - 'methods' => ['ANY'], - 'dynamic' => TRUE, - ], - ]; - - foreach ($expected_routes as $route_name => $expected) { - $row = $page->find('css', sprintf('table.devel-route-list tbody tr:contains("%s")', $route_name)); - $this->assertNotNull($row); - - /** @var $cells \Behat\Mink\Element\NodeElement[] */ - $cells = $row->findAll('css', 'td'); - $this->assertEquals(4, count($cells)); - - $cell_route_name = $cells[0]; - $this->assertEquals($route_name, $cell_route_name->getText()); - $this->assertTrue($cell_route_name->hasClass('table-filter-text-source')); - - $cell_path = $cells[1]; - $this->assertEquals($expected['path'], $cell_path->getText()); - $this->assertTrue($cell_path->hasClass('table-filter-text-source')); - - $cell_methods = $cells[2]; - $this->assertEquals(implode('', $expected['methods']), $cell_methods->getText()); - - $cell_operations = $cells[3]; - $actual_href = $cell_operations->findLink('Devel')->getAttribute('href'); - if ($expected['dynamic']) { - $parameters = ['query' => ['route_name' => $route_name]]; - } - else { - $parameters = ['query' => ['path' => $expected['path']]]; - } - $expected_href = Url::fromRoute('devel.route_info.item', [], $parameters)->toString(); - $this->assertEquals($expected_href, $actual_href); - } - - // Ensures that the page is accessible only to the users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/routes'); - $this->assertSession()->statusCodeEquals(403); - } - - /** - * Tests route detail page. - */ - public function testRouteDetail() { - $expected_title = 'Route detail'; - $xpath_warning_messages = '//div[contains(@class, "messages--warning")]'; - - // Ensures that devel route detail link in the menu works properly. - $url = $this->develUser->toUrl(); - $path = '/' . $url->getInternalPath(); - - $this->drupalGet($url); - $this->clickLink('Current route info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains($expected_title); - $expected_url = Url::fromRoute('devel.route_info.item', [], ['query' => ['path' => $path]]); - $this->assertSession()->addressEquals($expected_url); - $this->assertSession()->elementNotExists('xpath', $xpath_warning_messages); - - // Ensures that devel route detail works properly even when dynamic cache - // is enabled. - $url = Url::fromRoute('devel.simple_page'); - $path = '/' . $url->getInternalPath(); - - $this->drupalGet($url); - $this->clickLink('Current route info'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains($expected_title); - $expected_url = Url::fromRoute('devel.route_info.item', [], ['query' => ['path' => $path]]); - $this->assertSession()->addressEquals($expected_url); - $this->assertSession()->elementNotExists('xpath', $xpath_warning_messages); - - // Ensures that if a non existent path is passed as input, a warning - // message is shown. - $this->drupalGet('devel/routes/item', ['query' => ['path' => '/undefined']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains($expected_title); - $this->assertSession()->elementExists('xpath', $xpath_warning_messages); - - // Ensures that the route detail page works properly when a valid route - // name input is passed. - $this->drupalGet('devel/routes/item', ['query' => ['route_name' => 'devel.simple_page']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains($expected_title); - $this->assertSession()->elementNotExists('xpath', $xpath_warning_messages); - - // Ensures that if a non existent route name is passed as input a warning - // message is shown. - $this->drupalGet('devel/routes/item', ['query' => ['route_name' => 'not.exists']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains($expected_title); - $this->assertSession()->elementExists('xpath', $xpath_warning_messages); - - // Ensures that if no 'path' nor 'name' query string is passed as input, - // devel route detail page does not return errors. - $this->drupalGet('devel/routes/item'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains($expected_title); - - // Ensures that the page is accessible ony to the users with the adequate - // permissions. - $this->drupalLogout(); - $this->drupalGet('devel/routes/item'); - $this->assertSession()->statusCodeEquals(403); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouterRebuildTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouterRebuildTest.php deleted file mode 100644 index 58436a896..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelRouterRebuildTest.php +++ /dev/null @@ -1,46 +0,0 @@ -set('devel_test_route_rebuild', NULL); - - $this->drupalGet('devel/menu/reset'); - $this->assertSession()->statusCodeEquals(403); - - $web_user = $this->drupalCreateUser(['administer site configuration']); - $this->drupalLogin($web_user); - - $this->drupalGet('devel/menu/reset'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Are you sure you want to rebuild the router?'); - $route_rebuild_state = \Drupal::state()->get('devel_test_route_rebuild'); - $this->assertEmpty($route_rebuild_state); - - $this->drupalPostForm('devel/menu/reset', [], t('Rebuild')); - $this->assertSession()->pageTextContains('The router has been rebuilt.'); - $route_rebuild_state = \Drupal::state()->get('devel_test_route_rebuild'); - $this->assertEquals('Router rebuild fired', $route_rebuild_state); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelStateEditorTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelStateEditorTest.php deleted file mode 100644 index aa6538c1a..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelStateEditorTest.php +++ /dev/null @@ -1,209 +0,0 @@ -state = $this->container->get('state'); - - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser(['access devel information']); - $this->adminUser = $this->drupalCreateUser(['access devel information', 'administer site configuration']); - } - - /** - * Tests state editor menu link. - */ - public function testStateEditMenuLink() { - $this->drupalPlaceBlock('system_menu_block:devel'); - $this->drupalLogin($this->develUser); - // Ensures that the state editor link is present on the devel menu and that - // it points to the correct page. - $this->drupalGet(''); - $this->clickLink('State editor'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->addressEquals('/devel/state'); - $this->assertSession()->pageTextContains('State editor'); - } - - /** - * Tests state listing. - */ - public function testStateListing() { - $table_selector = 'table.devel-state-list'; - - // Ensure that state listing page is accessible only by users with the - // adequate permissions. - $this->drupalGet('devel/state'); - $this->assertSession()->statusCodeEquals(403); - - $this->drupalLogin($this->develUser); - $this->drupalGet('devel/state'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('State editor'); - - // Ensure that the state variables table is visible. - $table = $this->assertSession()->elementExists('css', $table_selector); - - // Ensure that all state variables are listed in the table. - $states = \Drupal::keyValue('state')->getAll(); - $rows = $table->findAll('css', 'tbody tr'); - $this->assertEquals(count($rows), count($states), 'All states are listed in the table.'); - - // Ensure that the added state variables are listed in the table. - $this->state->set('devel.simple', 'Hello!'); - $this->drupalGet('devel/state'); - $table = $this->assertSession()->elementExists('css', $table_selector); - $this->assertSession()->elementExists('css', sprintf('tbody td:contains("%s")', 'devel.simple'), $table); - - // Ensure that the operations column and the actions buttons are not - // available for user without 'administer site configuration' permission. - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(count($headers), 2, 'Correct number of table header cells found.'); - $this->assertElementsTextEquals($headers, ['Name', 'Value']); - $this->assertSession()->elementNotExists('css', 'ul.dropbutton li a', $table); - - // Ensure that the operations column and the actions buttons are - // available for user with 'administer site configuration' permission. - $this->drupalLogin($this->adminUser); - $this->drupalGet('devel/state'); - - $table = $this->assertSession()->elementExists('css', $table_selector); - $headers = $table->findAll('css', 'thead th'); - $this->assertEquals(count($headers), 3, 'Correct number of table header cells found.'); - $this->assertElementsTextEquals($headers, ['Name', 'Value', 'Operations']); - $this->assertSession()->elementExists('css', 'ul.dropbutton li a', $table); - - // Test that the edit button works properly. - $this->clickLink('Edit'); - $this->assertSession()->statusCodeEquals(200); - } - - /** - * Tests state edit. - */ - public function testStateEdit() { - // Create some state variables for the test. - $this->state->set('devel.simple', 0); - $this->state->set('devel.array', ['devel' => 'value']); - $this->state->set('devel.object', $this->randomObject()); - - // Ensure that state edit form is accessible only by users with the - // adequate permissions. - $this->drupalLogin($this->develUser); - $this->drupalGet('devel/state/edit/devel.simple'); - $this->assertSession()->statusCodeEquals(403); - - $this->drupalLogin($this->adminUser); - - // Ensure that accessing an un-existent state variable cause a warning - // message. - $this->drupalGet('devel/state/edit/devel.unknown'); - $this->assertSession()->pageTextContains(strtr('State @name does not exist in the system.', ['@name' => 'devel.unknown'])); - - // Ensure that state variables that contain simple type can be edited and - // saved. - $this->drupalGet('devel/state/edit/devel.simple'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains(strtr('Edit state variable: @name', ['@name' => 'devel.simple'])); - $input = $this->assertSession()->fieldExists('edit-new-value'); - $this->assertFalse($input->hasAttribute('disabled')); - $button = $this->assertSession()->buttonExists('edit-submit'); - $this->assertFalse($button->hasAttribute('disabled')); - - $edit = ['new_value' => 1]; - $this->drupalPostForm('devel/state/edit/devel.simple', $edit, 'Save'); - $this->assertSession()->pageTextContains(strtr('Variable @name was successfully edited.', ['@name' => 'devel.simple'])); - $this->assertEquals(1, $this->state->get('devel.simple')); - - // Ensure that state variables that contain array can be edited and saved - // and the new value is properly validated. - $this->drupalGet('devel/state/edit/devel.array'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains(strtr('Edit state variable: @name', ['@name' => 'devel.array'])); - $input = $this->assertSession()->fieldExists('edit-new-value'); - $this->assertFalse($input->hasAttribute('disabled')); - $button = $this->assertSession()->buttonExists('edit-submit'); - $this->assertFalse($button->hasAttribute('disabled')); - - // Try to save an invalid yaml input. - $edit = ['new_value' => 'devel: \'value updated']; - $this->drupalPostForm('devel/state/edit/devel.array', $edit, 'Save'); - $this->assertSession()->pageTextContains('Invalid input:'); - - $edit = ['new_value' => 'devel: \'value updated\'']; - $this->drupalPostForm('devel/state/edit/devel.array', $edit, 'Save'); - $this->assertSession()->pageTextContains(strtr('Variable @name was successfully edited.', ['@name' => 'devel.array'])); - $this->assertEquals(['devel' => 'value updated'], $this->state->get('devel.array')); - - // Ensure that state variables that contain objects cannot be edited. - $this->drupalGet('devel/state/edit/devel.object'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains(strtr('Edit state variable: @name', ['@name' => 'devel.object'])); - $this->assertSession()->pageTextContains(strtr('Only simple structures are allowed to be edited. State @name contains objects.', ['@name' => 'devel.object'])); - $this->assertSession()->fieldDisabled('edit-new-value'); - $button = $this->assertSession()->buttonExists('edit-submit'); - $this->assertTrue($button->hasAttribute('disabled')); - - // Ensure that the cancel link works as expected. - $this->clickLink('Cancel'); - $this->assertSession()->addressEquals('devel/state'); - } - - /** - * Checks that the passed in elements have the expected text. - * - * @param \Behat\Mink\Element\NodeElement[] $elements - * The elements for which check the text. - * @param array $expected_elements_text - * The expected text for the passed in elements. - */ - protected function assertElementsTextEquals(array $elements, array $expected_elements_text) { - $actual_text = array_map(function (NodeElement $element) { - return $element->getText(); - }, $elements); - $this->assertSame($expected_elements_text, $actual_text); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelSwitchUserTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelSwitchUserTest.php deleted file mode 100644 index a0c89daa9..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelSwitchUserTest.php +++ /dev/null @@ -1,313 +0,0 @@ -block = $this->drupalPlaceBlock('devel_switch_user', ['id' => 'switch-user']); - - $this->develUser = $this->drupalCreateUser(['access devel information', 'switch users']); - $this->switchUser = $this->drupalCreateUser(['switch users']); - $this->webUser = $this->drupalCreateUser(); - } - - /** - * Tests switch user. - */ - public function testSwitchUser() { - $this->drupalLogin($this->webUser); - - $this->drupalGet(''); - $this->assertNoText($this->block->label(), 'Block title was not found.'); - - // Ensure that a token is required to switch user. - $this->drupalGet('/devel/switch/' . $this->webUser->getDisplayName()); - $this->assertResponse(403); - - $this->drupalLogin($this->develUser); - - $this->drupalGet(''); - $this->assertText($this->block->label(), 'Block title was found.'); - - // Ensure that if name in not passed the controller returns access denied. - $this->drupalGet('/devel/switch'); - $this->assertResponse(403); - - // Ensure that a token is required to switch user. - $this->drupalGet('/devel/switch/' . $this->switchUser->getDisplayName()); - $this->assertResponse(403); - - // Switch to another user account. - $this->drupalGet('/user/' . $this->switchUser->id()); - $this->clickLink($this->switchUser->getDisplayName()); - $this->assertSessionByUid($this->switchUser->id()); - $this->assertNoSessionByUid($this->develUser->id()); - - // Switch back to initial account. - $this->clickLink($this->develUser->getDisplayName()); - $this->assertNoSessionByUid($this->switchUser->id()); - $this->assertSessionByUid($this->develUser->id()); - - // Use the search form to switch to another account. - $edit = ['userid' => $this->switchUser->getDisplayName()]; - $this->drupalPostForm(NULL, $edit, t('Switch')); - $this->assertSessionByUid($this->switchUser->id()); - $this->assertNoSessionByUid($this->develUser->id()); - } - - /** - * Tests the switch user block configuration. - */ - public function testSwitchUserBlockConfiguration() { - $anonymous = \Drupal::config('user.settings')->get('anonymous'); - - // Create some users for the test. - for ($i = 0; $i < 12; $i++) { - $this->drupalCreateUser(); - } - - $this->drupalLogin($this->develUser); - - $this->drupalGet(''); - $this->assertText($this->block->label(), 'Block title was found.'); - - // Ensure that block default configuration is effectively used. The block - // default configuration is the following: - // - list_size : 12 - // - include_anon : FALSE - // - show_form : TRUE - $this->assertSwitchUserSearchForm(); - $this->assertSwitchUserListCount(12); - $this->assertSwitchUserListNoContainsUser($anonymous); - - // Ensure that changing the list_size configuration property the number of - // user displayed in the list change. - $this->setBlockConfiguration('list_size', 4); - $this->drupalGet(''); - $this->assertSwitchUserListCount(4); - - // Ensure that changing the include_anon configuration property the - // anonymous user is displayed in the list. - $this->setBlockConfiguration('include_anon', TRUE); - $this->drupalGet(''); - $this->assertSwitchUserListContainsUser($anonymous); - - // Ensure that changing the show_form configuration property the - // form is not displayed. - $this->setBlockConfiguration('show_form', FALSE); - $this->drupalGet(''); - $this->assertSwitchUserNoSearchForm(); - } - - /** - * Test the user list items. - */ - public function testSwitchUserListItems() { - $anonymous = \Drupal::config('user.settings')->get('anonymous'); - - $this->setBlockConfiguration('list_size', 2); - - // Login as web user so we are sure that this account is prioritized - // in the list if not enougth user with 'switch users' permission are - // present. - $this->drupalLogin($this->webUser); - - $this->drupalLogin($this->develUser); - $this->drupalGet(''); - - // Ensure that user with 'switch users' permission are prioritized. - $this->assertSwitchUserListCount(2); - $this->assertSwitchUserListContainsUser($this->develUser->getDisplayName()); - $this->assertSwitchUserListContainsUser($this->switchUser->getDisplayName()); - - // Ensure that blocked users are not shown in the list. - $this->switchUser->set('status', 0)->save(); - $this->drupalGet(''); - $this->assertSwitchUserListCount(2); - $this->assertSwitchUserListContainsUser($this->develUser->getDisplayName()); - $this->assertSwitchUserListContainsUser($this->webUser->getDisplayName()); - $this->assertSwitchUserListNoContainsUser($this->switchUser->getDisplayName()); - - // Ensure that anonymous user are prioritized if include_anon is set to true. - $this->setBlockConfiguration('include_anon', TRUE); - $this->drupalGet(''); - $this->assertSwitchUserListCount(2); - $this->assertSwitchUserListContainsUser($this->develUser->getDisplayName()); - $this->assertSwitchUserListContainsUser($anonymous); - - // Ensure that the switch user block works properly even if no prioritized - // users are found (special handling for user 1). - $this->drupalLogout(); - $this->develUser->delete(); - - $this->drupalLogin($this->rootUser); - $this->drupalGet(''); - $this->assertSwitchUserListCount(2); - $this->assertSwitchUserListContainsUser($this->rootUser->getDisplayName()); - $this->assertSwitchUserListContainsUser($anonymous); - - // Ensure that the switch user block works properly even if no roles have - // the 'switch users' permission associated (special handling for user 1). - $roles = user_roles(TRUE, 'switch users'); - \Drupal::entityTypeManager()->getStorage('user_role')->delete($roles); - - $this->drupalGet(''); - $this->assertSwitchUserListCount(2); - $this->assertSwitchUserListContainsUser($this->rootUser->getDisplayName()); - $this->assertSwitchUserListContainsUser($anonymous); - } - - /** - * Helper function for verify the number of items shown in the user list. - * - * @param int $number - * The expected numer of items. - */ - public function assertSwitchUserListCount($number) { - $result = $this->xpath('//div[@id=:block]//ul/li/a', [':block' => 'block-switch-user']); - $this->assert(count($result) == $number, 'The number of users shown in switch user is correct.'); - } - - /** - * Helper function for verify if the user list contains a username. - * - * @param string $username - * The username to check. - */ - public function assertSwitchUserListContainsUser($username) { - $result = $this->xpath('//div[@id=:block]//ul/li/a[normalize-space()=:user]', [':block' => 'block-switch-user', ':user' => $username]); - $this->assert(count($result) > 0, new FormattableMarkup('User "%user" is included in the switch user list.', ['%user' => $username])); - } - - /** - * Helper function for verify if the user list not contains a username. - * - * @param string $username - * The username to check. - */ - public function assertSwitchUserListNoContainsUser($username) { - $result = $this->xpath('//div[@id=:block]//ul/li/a[normalize-space()=:user]', [':block' => 'block-switch-user', ':user' => $username]); - $this->assert(count($result) == 0, new FormattableMarkup('User "%user" is not included in the switch user list.', ['%user' => $username])); - } - - /** - * Helper function for verify if the search form is shown. - */ - public function assertSwitchUserSearchForm() { - $result = $this->xpath('//div[@id=:block]//form[contains(@class, :form)]', [':block' => 'block-switch-user', ':form' => 'devel-switchuser-form']); - $this->assert(count($result) > 0, 'The search form is shown.'); - } - - /** - * Helper function for verify if the search form is not shown. - */ - public function assertSwitchUserNoSearchForm() { - $result = $this->xpath('//div[@id=:block]//form[contains(@class, :form)]', [':block' => 'block-switch-user', ':form' => 'devel-switchuser-form']); - $this->assert(count($result) == 0, 'The search form is not shown.'); - } - - /** - * Protected helper method to set the test block's configuration. - */ - protected function setBlockConfiguration($key, $value) { - $block = $this->block->getPlugin(); - $block->setConfigurationValue($key, $value); - $this->block->save(); - } - - /** - * Asserts that there is a session for a given user ID. - * - * Based off masquarade module. - * - * @param int $uid - * The user ID for which to find a session record. - * - * TODO find a cleaner way to do this check. - */ - protected function assertSessionByUid($uid) { - $query = \Drupal::database()->select('sessions'); - $query->fields('sessions', ['uid']); - $query->condition('uid', $uid); - $result = $query->execute()->fetchAll(); - - if (empty($result)) { - $this->fail(new FormattableMarkup('No session found for uid @uid', ['@uid' => $uid])); - } - elseif (count($result) > 1) { - // If there is more than one session, then that must be unexpected. - $this->fail("Found more than 1 session for uid $uid."); - } - else { - $this->pass("Found session for uid $uid."); - } - } - - /** - * Asserts that no session exists for a given uid. - * - * Based off masquarade module. - * - * @param int $uid - * The user ID to assert. - * - * TODO find a cleaner way to do this check. - */ - protected function assertNoSessionByUid($uid) { - $query = \Drupal::database()->select('sessions'); - $query->fields('sessions', ['uid']); - $query->condition('uid', $uid); - $result = $query->execute()->fetchAll(); - $this->assert(empty($result), "No session for uid $uid found."); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelToolbarTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelToolbarTest.php deleted file mode 100644 index e348bc557..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelToolbarTest.php +++ /dev/null @@ -1,266 +0,0 @@ -drupalPlaceBlock('local_tasks_block'); - $this->drupalPlaceBlock('page_title_block'); - - $this->develUser = $this->drupalCreateUser([ - 'administer site configuration', - 'access devel information', - 'access toolbar', - ]); - $this->toolbarUser = $this->drupalCreateUser([ - 'access toolbar', - ]); - } - - /** - * Tests configuration form. - */ - public function testConfigurationForm() { - // Ensures that the page is accessible ony to users with the adequate - // permissions. - $this->drupalGet('admin/config/development/devel/toolbar'); - $this->assertSession()->statusCodeEquals(403); - - // Ensures that the config page is accessible for users with the adequate - // permissions and exists the Devel toolbar local task. - $this->drupalLogin($this->develUser); - $this->drupalGet('admin/config/development/devel/toolbar'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->elementExists('css', '.tabs .primary a:contains("Toolbar Settings")'); - $this->assertSession()->pageTextContains('Devel Toolbar Settings'); - - // Ensures and that all devel menu links are listed in the configuration - // page. - foreach ($this->getMenuLinkInfos() as $link) { - $this->assertSession()->fieldExists(sprintf('toolbar_items[%s]', $link['id'])); - } - - // Ensures and that the default configuration items are selected by - // default. - foreach ($this->defaultToolbarItems as $item) { - $this->assertSession()->checkboxChecked(sprintf('toolbar_items[%s]', $item)); - } - - // Ensures that the configuration save works as expected. - $edit = [ - 'toolbar_items[devel.event_info]' => 'devel.event_info', - 'toolbar_items[devel.theme_registry]' => 'devel.theme_registry', - ]; - $this->drupalPostForm('admin/config/development/devel/toolbar', $edit, t('Save configuration')); - $this->assertSession()->pageTextContains('The configuration options have been saved.'); - - $expected_items = array_merge($this->defaultToolbarItems, ['devel.event_info', 'devel.theme_registry']); - sort($expected_items); - $config_items = \Drupal::config('devel.toolbar.settings')->get('toolbar_items'); - sort($config_items); - - $this->assertEquals($expected_items, $config_items); - } - - /** - * Tests cache metadata headers. - */ - public function testCacheHeaders() { - // Disable user toolbar tab so we can test properly if the devel toolbar - // implementation interferes with the page cacheability. - \Drupal::service('module_installer')->install(['toolbar_disable_user_toolbar']); - - // The menu is not loaded for users without the adequate permission, - // so no cache tags for configuration are added. - $this->drupalLogin($this->toolbarUser); - $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:devel.toolbar.settings'); - $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:system.menu.devel'); - - // Make sure that the configuration cache tags are present for users with - // the adequate permission. - $this->drupalLogin($this->develUser); - $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:devel.toolbar.settings'); - $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.menu.devel'); - - // The Devel toolbar implementation should not interfere with the page - // cacheability, so you expect a MISS value in the X-Drupal-Dynamic-Cache - // header the first time. - $this->assertSession()->responseHeaderContains('X-Drupal-Dynamic-Cache', 'MISS'); - - // Triggers a page reload and verify that the page is served from the - // cache. - $this->drupalGet(''); - $this->assertSession()->responseHeaderContains('X-Drupal-Dynamic-Cache', 'HIT'); - } - - /** - * Tests toolbar integration. - */ - public function testToolbarIntegration() { - $library_css_url = 'devel/css/devel.toolbar.css'; - $toolbar_selector = '#toolbar-bar .toolbar-tab'; - $toolbar_tab_selector = '#toolbar-bar .toolbar-tab a.toolbar-icon-devel'; - $toolbar_tray_selector = '#toolbar-bar .toolbar-tab #toolbar-item-devel-tray'; - - // Ensures that devel toolbar item is accessible only for user with the - // adequate permissions. - $this->drupalGet(''); - $this->assertSession()->responseNotContains($library_css_url); - $this->assertSession()->elementNotExists('css', $toolbar_selector); - $this->assertSession()->elementNotExists('css', $toolbar_tab_selector); - - $this->drupalLogin($this->toolbarUser); - $this->assertSession()->responseNotContains($library_css_url); - $this->assertSession()->elementExists('css', $toolbar_selector); - $this->assertSession()->elementNotExists('css', $toolbar_tab_selector); - - $this->drupalLogin($this->develUser); - $this->assertSession()->responseContains($library_css_url); - $this->assertSession()->elementExists('css', $toolbar_selector); - $this->assertSession()->elementExists('css', $toolbar_tab_selector); - $this->assertSession()->elementTextContains('css', $toolbar_tab_selector, 'Devel'); - - // Ensures that the configure link in the toolbar is present and point to - // the correct page. - $this->clickLink('Configure'); - $this->assertSession()->addressEquals('admin/config/development/devel/toolbar'); - - // Ensures that the toolbar tray contains the all the menu links. To the - // links not marked as always visible will be assigned a css class that - // allow to hide they when the toolbar has horizontal orientation. - $this->drupalGet(''); - $toolbar_tray = $this->assertSession()->elementExists('css', $toolbar_tray_selector); - - $devel_menu_items = $this->getMenuLinkInfos(); - $toolbar_items = $toolbar_tray->findAll('css', 'ul.toolbar-menu a'); - $this->assertCount(count($devel_menu_items), $toolbar_items); - - foreach ($devel_menu_items as $link) { - $item_selector = sprintf('ul.toolbar-menu a:contains("%s")', $link['title']); - $item = $this->assertSession()->elementExists('css', $item_selector, $toolbar_tray); - // TODO: find a more correct way to test link url. - $this->assertContains(strtok($link['url'], '?'), $item->getAttribute('href')); - - $not_visible = !in_array($link['id'], $this->defaultToolbarItems); - $this->assertTrue($not_visible === $item->hasClass('toolbar-horizontal-item-hidden')); - } - - // Ensures that changing the toolbar settings configuration the changes are - // immediately visible. - $saved_items = $this->config('devel.toolbar.settings')->get('toolbar_items'); - $saved_items[] = 'devel.event_info'; - - $this->config('devel.toolbar.settings') - ->set('toolbar_items', $saved_items) - ->save(); - - $this->drupalGet(''); - $toolbar_tray = $this->assertSession()->elementExists('css', $toolbar_tray_selector); - $item = $this->assertSession()->elementExists('css', sprintf('ul.toolbar-menu a:contains("%s")', 'Events Info'), $toolbar_tray); - $this->assertFalse($item->hasClass('toolbar-horizontal-item-hidden')); - - // Ensures that disabling a menu link it will not more shown in the toolbar - // and that the changes are immediately visible. - $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - $menu_link_manager->updateDefinition('devel.event_info', ['enabled' => FALSE]); - - $this->drupalGet(''); - $toolbar_tray = $this->assertSession()->elementExists('css', $toolbar_tray_selector); - $this->assertSession()->elementNotExists('css', sprintf('ul.toolbar-menu a:contains("%s")', 'Events Info'), $toolbar_tray); - } - - /** - * Tests devel when toolbar module is not installed. - */ - public function testToolbarModuleNotInstalled() { - // Ensures that when toolbar module is not installed all works properly. - \Drupal::service('module_installer')->uninstall(['toolbar']); - - $this->drupalLogin($this->develUser); - - // Toolbar settings page should respond with 404. - $this->drupalGet('admin/config/development/devel/toolbar'); - $this->assertSession()->statusCodeEquals(404); - - // Primary local task should not contains toolbar tab. - $this->drupalGet('admin/config/development/devel'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->elementNotExists('css', '.tabs .primary a:contains("Toolbar Settings")'); - - // Toolbar setting config and devel menu cache tags sholud not present. - $this->drupalGet(''); - $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:devel.toolbar.settings'); - $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:system.menu.devel'); - } - - /** - * Helper function for retrieve the menu link informations. - * - * @return array - * An array containing the menu link informations. - */ - protected function getMenuLinkInfos() { - $parameters = new MenuTreeParameters(); - $parameters->onlyEnabledLinks()->setTopLevelOnly(); - $tree = \Drupal::menuTree()->load('devel', $parameters); - - $links = []; - foreach ($tree as $element) { - $links[] = [ - 'id' => $element->link->getPluginId(), - 'title' => $element->link->getTitle(), - 'url' => $element->link->getUrlObject()->toString(), - ]; - } - return $links; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelWebAssertHelper.php b/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelWebAssertHelper.php deleted file mode 100644 index 01f37708e..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Functional/DevelWebAssertHelper.php +++ /dev/null @@ -1,34 +0,0 @@ -xpath('//*[contains(@class, :class)]//a', [':class' => $type_class]); - $this->assertTrue(count($elements), 'Local tasks found.'); - foreach ($routes as $index => $route_info) { - list($route_name, $route_parameters) = $route_info; - $expected = Url::fromRoute($route_name, $route_parameters)->toString(); - $this->assertEquals($expected, $elements[$index]->getAttribute('href')); - } - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelDumperTestTrait.php b/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelDumperTestTrait.php deleted file mode 100644 index ff80cf179..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelDumperTestTrait.php +++ /dev/null @@ -1,127 +0,0 @@ -getDumperExportDump($data, $name); - $this->assertEqual(rtrim($dump), $output, $message); - } - - /** - * Asserts that a haystack contains the dump export output. - * - * Use \Drupal\devel\DevelDumperManager::export(). - * - * @param $haystack - * The string that contains the dump output to test. - * @param $data - * The variable to dump. - * @param null $name - * (optional) The label to output before variable, defaults to NULL. - * @param string $message - * (optional) A message to display with the assertion. - */ - public function assertContainsDumpExport($haystack, $data, $name = NULL, $message = '') { - $output = $this->getDumperExportDump($data, $name); - $this->assertContains($output, (string) $haystack, $message); - } - - /** - * Asserts that the string passed in input is equals to the string - * representation of a variable obtained dumping the data. - * - * Use \Drupal\devel\DevelDumperManager::dump(). - * - * @param $dump - * The string that contains the dump output to test. - * @param $data - * The variable to dump. - * @param null $name - * (optional) The label to output before variable, defaults to NULL. - * @param string $message - * (optional) A message to display with the assertion. - */ - public function assertDumpEquals($dump, $data, $name = NULL, $message = '') { - $output = $this->getDumperDump($data, $name); - $this->assertEqual(rtrim($dump), $output, $message); - } - - /** - * Asserts that a haystack contains the dump output. - * - * Use \Drupal\devel\DevelDumperManager::dump(). - * - * @param $haystack - * The string that contains the dump output to test. - * @param $data - * The variable to dump. - * @param null $name - * (optional) The label to output before variable, defaults to NULL. - * @param string $message - * (optional) A message to display with the assertion. - */ - public function assertContainsDump($haystack, $data, $name = NULL, $message = '') { - $output = $this->getDumperDump($data, $name); - $this->assertContains($output, (string) $haystack, $message); - } - - /** - * Returns a string representation of a variable. - * - * @param mixed $input - * The variable to dump. - * @param string $name - * (optional) The label to output before variable, defaults to NULL. - * - * @return string - * String representation of a variable. - * - * @see \Drupal\devel\DevelDumperManager::export() - */ - private function getDumperExportDump($input, $name = NULL) { - $output = \Drupal::service('devel.dumper')->export($input, $name); - return rtrim($output); - } - - /** - * Returns a string representation of a variable. - * - * @param mixed $input - * The variable to dump. - * @param string $name - * (optional) The label to output before variable, defaults to NULL. - * - * @return string - * String representation of a variable. - * - * @see \Drupal\devel\DevelDumperManager::dump() - */ - private function getDumperDump($input, $name = NULL) { - ob_start(); - \Drupal::service('devel.dumper')->dump($input, $name); - $output = ob_get_contents(); - ob_end_clean(); - return rtrim($output); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelEnforcedDependenciesTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelEnforcedDependenciesTest.php deleted file mode 100644 index b67965b25..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelEnforcedDependenciesTest.php +++ /dev/null @@ -1,80 +0,0 @@ -installEntitySchema('user'); - $this->installConfig('devel'); - // For uninstall to work. - $this->installSchema('user', ['users_data']); - } - - /** - * Tests devel menu enforced dependencies. - */ - public function testMenuEnforcedDependencies() { - /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */ - $config_manager = $this->container->get('config.manager'); - - // Ensure that the Devel menu has explicit enforced dependencies on devel - // module. - $menu = Menu::load('devel'); - $this->assertEquals(['enforced' => ['module' => ['devel']]], $menu->get('dependencies')); - - // Creates an instance of devel menu block so you can test if enforced - // dependencies work properly with it. - $block_id = strtolower($this->randomMachineName(8)); - - $block = Block::create([ - 'plugin' => 'system_menu_block:devel', - 'region' => 'sidebar_first', - 'id' => $block_id, - 'theme' => $this->config('system.theme')->get('default'), - 'label' => $this->randomMachineName(8), - 'visibility' => array(), - 'weight' => 0, - ]); - $block->save(); - - // Ensure that the menu and block instance depend on devel module. - $dependents = $config_manager->findConfigEntityDependents('module', ['devel']); - $this->assertTrue(isset($dependents['system.menu.devel'])); - $this->assertTrue(isset($dependents['block.block.' . $block_id])); - - $this->container->get('module_installer')->uninstall(['devel']); - - // Ensure that the menu and block instance are deleted when the dependency - // is uninstalled. - $this->assertNull(Menu::load('devel')); - $this->assertNull(Block::load($block_id)); - - // Ensure that no config entities depend on devel once uninstalled. - $dependents = $config_manager->findConfigEntityDependents('module', ['devel']); - $this->assertFalse(isset($dependents['system.menu.devel'])); - $this->assertFalse(isset($dependents['block.block.' . $block_id])); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelMailLogTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelMailLogTest.php deleted file mode 100644 index ebaa2fb4d..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelMailLogTest.php +++ /dev/null @@ -1,202 +0,0 @@ -installSchema('system', 'mail'); - $this->installConfig(['system', 'devel']); - - // Configure system.site mail settings. - $this->config('system.site')->set('mail', 'devel-test@example.com')->save(); - - $this->mailManager = $this->container->get('plugin.manager.mail'); - } - - /** - * Tests devel_mail_log plugin as default mail backend. - */ - public function testDevelMailLogDefaultBackend() { - // Configure devel_mail_log as default mail backends. - $this->setDevelMailLogAsDefaultBackend(); - - // Ensures that devel_mail_log is the default mail plugin . - $mail_backend = $this->mailManager->getInstance(['module' => 'default', 'key' => 'default']); - $this->assertInstanceOf(DevelMailLog::class, $mail_backend); - - $mail_backend = $this->mailManager->getInstance(['module' => 'somemodule', 'key' => 'default']); - $this->assertInstanceOf(DevelMailLog::class, $mail_backend); - } - - /** - * Tests devel_mail_log plugin with multiple mail backend. - */ - public function testDevelMailLogMultipleBackend() { - // Configure test_mail_collector as default mail backend. - $this->config('system.mail') - ->set('interface.default', 'test_mail_collector') - ->save(); - - // Configure devel_mail_log as a module-specific mail backend. - $this->config('system.mail') - ->set('interface.somemodule', 'devel_mail_log') - ->save(); - - // Ensures that devel_mail_log is not the default mail plugin. - $mail_backend = $this->mailManager->getInstance(['module' => 'default', 'key' => 'default']); - $this->assertInstanceOf(TestMailCollector::class, $mail_backend); - - // Ensures that devel_mail_log is used as mail backend only for the - // specified module. - $mail_backend = $this->mailManager->getInstance(['module' => 'somemodule', 'key' => 'default']); - $this->assertInstanceOf(DevelMailLog::class, $mail_backend); - } - - /** - * Tests devel_mail_log default settings. - */ - public function testDevelMailDefaultSettings() { - $config = \Drupal::config('devel.settings'); - $this->assertEquals('temporary://devel-mails', $config->get('debug_mail_directory')); - $this->assertEquals('%to-%subject-%datetime.mail.txt', $config->get('debug_mail_file_format')); - } - - /** - * Tests devel mail log output. - */ - public function testDevelMailLogOutput() { - $config = \Drupal::config('devel.settings'); - - // Parameters used for send the email. - $mail = [ - 'module' => 'devel_test', - 'key' => 'devel_mail_log', - 'to' => 'drupal@example.com', - 'reply' => 'replyto@example.com', - 'lang' => \Drupal::languageManager()->getCurrentLanguage(), - ]; - - // Parameters used for compose the email in devel_test module. - // @see devel_test_mail() - $params = [ - 'subject' => 'Devel mail log subject', - 'body' => 'Devel mail log body', - 'headers' => [ - 'from' => 'postmaster@example.com', - 'additional' => [ - 'X-stupid' => 'dumb', - ], - ], - ]; - - // Configure devel_mail_log as default mail backends. - $this->setDevelMailLogAsDefaultBackend(); - - // Changes the default filename pattern removing the dynamic date - // placeholder for a more predictable filename output. - $random = $this->randomMachineName(); - $filename_pattern = '%to-%subject-' . $random . '.mail.txt'; - $this->config('devel.settings') - ->set('debug_mail_file_format', $filename_pattern) - ->save(); - - $expected_filename = 'drupal@example.com-Devel_mail_log_subject-' . $random . '.mail.txt'; - $expected_output = <<get('debug_mail_directory'); - $expected_file_path = $default_output_directory . '/' . $expected_filename; - - $this->mailManager->mail($mail['module'], $mail['key'], $mail['to'], $mail['lang'], $params, $mail['reply']); - $this->assertFileExists($expected_file_path); - $this->assertStringEqualsFile($expected_file_path, $expected_output); - - // Ensures that even changing the default output directory devel_mail_log - // works as expected. - $changed_output_directory = 'temporary://my-folder'; - $expected_file_path = $changed_output_directory . '/' . $expected_filename; - $this->config('devel.settings') - ->set('debug_mail_directory', $changed_output_directory) - ->save(); - - $result = $this->mailManager->mail($mail['module'], $mail['key'], $mail['to'], $mail['lang'], $params, $mail['reply']); - $this->assertSame(TRUE, $result['result']); - $this->assertFileExists($expected_file_path); - $this->assertStringEqualsFile($expected_file_path, $expected_output); - - // Ensures that if the default output directory is a public directory it - // will be protected by adding an .htaccess. - $public_output_directory = 'public://my-folder'; - $expected_file_path = $public_output_directory . '/' . $expected_filename; - $this->config('devel.settings') - ->set('debug_mail_directory', $public_output_directory) - ->save(); - - $this->mailManager->mail($mail['module'], $mail['key'], $mail['to'], $mail['lang'], $params, $mail['reply']); - $this->assertFileExists($expected_file_path); - $this->assertStringEqualsFile($expected_file_path, $expected_output); - $this->assertFileExists($public_output_directory . '/.htaccess'); - } - - /** - * Configure devel_mail_log as default mail backend. - */ - private function setDevelMailLogAsDefaultBackend() { - // TODO can this be avoided? - // KernelTestBase enforce the usage of 'test_mail_collector' plugin for - // collect the mails. Since we need to test devel mail plugin we manually - // configure the mail implementation to use 'devel_mail_log'. - $GLOBALS['config']['system.mail']['interface']['default'] = 'devel_mail_log'; - - // Configure devel_mail_log as default mail backend. - $this->config('system.mail') - ->set('interface.default', 'devel_mail_log') - ->save(); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelQueryDebugTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelQueryDebugTest.php deleted file mode 100644 index 8e83fbc35..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelQueryDebugTest.php +++ /dev/null @@ -1,127 +0,0 @@ -installSchema('system', 'sequences'); - $this->installConfig(['system', 'devel']); - $this->installEntitySchema('user'); - - $devel_role = Role::create([ - 'id' => 'admin', - 'permissions' => ['access devel information'], - ]); - $devel_role->save(); - - $this->develUser = User::create([ - 'name' => $this->randomMachineName(), - 'roles' => [$devel_role->id()], - ]); - $this->develUser->save(); - } - - /** - * Tests devel_query_debug_alter() for select queries. - */ - public function testSelectQueryDebugTag() { - // Clear the messages stack. - $this->getDrupalMessages(); - - // Ensures that no debug message is shown to user without the adequate - // permissions. - $query = \Drupal::database()->select('users', 'u'); - $query->fields('u', ['uid']); - $query->addTag('debug'); - $query->execute(); - - $messages = $this->getDrupalMessages(); - $this->assertEmpty($messages); - - // Ensures that the SQL debug message is shown to user with the adequate - // permissions. We expect only one status message containing the SQL for - // the debugged query. - \Drupal::currentUser()->setAccount($this->develUser); - $expected_message = "SELECT u.uid AS uid\nFROM\n{users} u"; - - $query = \Drupal::database()->select('users', 'u'); - $query->fields('u', ['uid']); - $query->addTag('debug'); - $query->execute(); - - $messages = $this->getDrupalMessages(); - $this->assertTrue(!empty($messages['status'])); - $this->assertCount(1, $messages['status']); - $this->assertEquals(strip_tags($messages['status'][0]), $expected_message); - } - - /** - * Tests devel_query_debug_alter() for entity queries. - */ - public function testEntityQueryDebugTag() { - // Clear the messages stack. - $this->getDrupalMessages(); - - // Ensures that no debug message is shown to user without the adequate - // permissions. - $query = \Drupal::entityQuery('user'); - $query->addTag('debug'); - $query->execute(); - - $messages = $this->getDrupalMessages(); - $this->assertEmpty($messages); - - // Ensures that the SQL debug message is shown to user with the adequate - // permissions. We expect only one status message containing the SQL for - // the debugged entity query. - \Drupal::currentUser()->setAccount($this->develUser); - $expected_message = "SELECT base_table.uid AS uid, base_table.uid AS base_table_uid\nFROM\n{users} base_table"; - - $query = \Drupal::entityQuery('user'); - $query->addTag('debug'); - $query->execute(); - - $messages = $this->getDrupalMessages(); - $this->assertTrue(!empty($messages['status'])); - $this->assertCount(1, $messages['status']); - $this->assertEquals(strip_tags($messages['status'][0]), $expected_message); - } - - /** - * Retrieves the drupal messages. - * - * @return array - * The messages - */ - protected function getDrupalMessages() { - return drupal_get_messages(); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelTwigExtensionTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelTwigExtensionTest.php deleted file mode 100644 index 349ab09fc..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Kernel/DevelTwigExtensionTest.php +++ /dev/null @@ -1,203 +0,0 @@ -installEntitySchema('user'); - $this->installSchema('system', 'sequences'); - - $devel_role = Role::create([ - 'id' => 'admin', - 'permissions' => ['access devel information'], - ]); - $devel_role->save(); - - $this->develUser = User::create([ - 'name' => $this->randomMachineName(), - 'roles' => [$devel_role->id()], - ]); - $this->develUser->save(); - } - - /** - * {@inheritdoc} - */ - public function register(ContainerBuilder $container) { - parent::register($container); - - $parameters = $container->getParameter('twig.config'); - $parameters['debug'] = TRUE; - $container->setParameter('twig.config', $parameters); - } - - /** - * Tests that Twig extension loads appropriately. - */ - public function testTwigExtensionLoaded() { - $twig_service = \Drupal::service('twig'); - $extension = $twig_service->getExtension(Debug::class); - $this->assertEquals(get_class($extension), Debug::class, 'Debug Extension loaded successfully.'); - } - - /** - * Tests that the Twig dump functions are registered properly. - */ - public function testDumpFunctionsRegistered() { - /** @var \Twig_SimpleFunction[] $functions */ - $functions = \Drupal::service('twig')->getFunctions(); - - $dump_functions = ['devel_dump', 'kpr']; - $message_functions = ['devel_message', 'dpm', 'dsm']; - $registered_functions = $dump_functions + $message_functions; - - foreach ($registered_functions as $name) { - $function = $functions[$name]; - $this->assertTrue($function instanceof \Twig_SimpleFunction); - $this->assertEquals($function->getName(), $name); - $this->assertTrue($function->needsContext()); - $this->assertTrue($function->needsEnvironment()); - $this->assertTrue($function->isVariadic()); - - is_callable($function->getCallable(), TRUE, $callable); - if (in_array($name, $dump_functions)) { - $this->assertEquals($callable, 'Drupal\devel\Twig\Extension\Debug::dump'); - } - else { - $this->assertEquals($callable, 'Drupal\devel\Twig\Extension\Debug::message'); - } - } - } - - /** - * Tests that the Twig function for XDebug integration is registered properly. - */ - public function testXDebugIntegrationFunctionsRegistered() { - /** @var \Twig_SimpleFunction $function */ - $function = \Drupal::service('twig')->getFunction('devel_breakpoint'); - $this->assertTrue($function instanceof \Twig_SimpleFunction); - $this->assertEquals($function->getName(), 'devel_breakpoint'); - $this->assertTrue($function->needsContext()); - $this->assertTrue($function->needsEnvironment()); - $this->assertTrue($function->isVariadic()); - is_callable($function->getCallable(), TRUE, $callable); - $this->assertEquals($callable, 'Drupal\devel\Twig\Extension\Debug::breakpoint'); - } - - /** - * Tests that the Twig extension's dump functions produce the expected output. - */ - public function testDumpFunctions() { - $template = 'test-with-context {{ twig_string }} {{ twig_array.first }} {{ twig_array.second }}{{ devel_dump() }}'; - $expected_template_output = 'test-with-context context! first value second value'; - - $context = [ - 'twig_string' => 'context!', - 'twig_array' => [ - 'first' => 'first value', - 'second' => 'second value', - ], - 'twig_object' => new \stdClass(), - ]; - - /** @var \Drupal\Core\Template\TwigEnvironment $environment */ - $environment = \Drupal::service('twig'); - - // Ensures that the twig extension does nothing if the current - // user has not the adequate permission. - $this->assertTrue($environment->isDebug()); - $this->assertEquals($environment->renderInline($template, $context), $expected_template_output); - - \Drupal::currentUser()->setAccount($this->develUser); - - // Ensures that if no argument is passed to the function the twig context is - // dumped. - $output = (string) $environment->renderInline($template, $context); - $this->assertContains($expected_template_output, $output); - $this->assertContainsDump($output, $context, 'Twig context'); - - // Ensures that if an argument is passed to the function it is dumped. - $template = 'test-with-context {{ twig_string }} {{ twig_array.first }} {{ twig_array.second }}{{ devel_dump(twig_array) }}'; - $output = (string) $environment->renderInline($template, $context); - $this->assertContains($expected_template_output, $output); - $this->assertContainsDump($output, $context['twig_array']); - - // Ensures that if more than one argument is passed the function works - // properly and every argument is dumped separately. - $template = 'test-with-context {{ twig_string }} {{ twig_array.first }} {{ twig_array.second }}{{ devel_dump(twig_string, twig_array.first, twig_array, twig_object) }}'; - $output = (string) $environment->renderInline($template, $context); - $this->assertContains($expected_template_output, $output); - $this->assertContainsDump($output, $context['twig_string']); - $this->assertContainsDump($output, $context['twig_array']['first']); - $this->assertContainsDump($output, $context['twig_array']); - $this->assertContainsDump($output, $context['twig_object']); - - // Clear messages. - drupal_get_messages(); - - $retrieve_message = function ($messages, $index) { - return isset($messages['status'][$index]) ? (string) $messages['status'][$index] : NULL; - }; - - // Ensures that if no argument is passed to the function the twig context is - // dumped. - $template = 'test-with-context {{ twig_string }} {{ twig_array.first }} {{ twig_array.second }}{{ devel_message() }}'; - $output = (string) $environment->renderInline($template, $context); - $this->assertContains($expected_template_output, $output); - $messages = drupal_get_messages(); - $this->assertDumpExportEquals($retrieve_message($messages, 0), $context, 'Twig context'); - - // Ensures that if an argument is passed to the function it is dumped. - $template = 'test-with-context {{ twig_string }} {{ twig_array.first }} {{ twig_array.second }}{{ devel_message(twig_array) }}'; - $output = (string) $environment->renderInline($template, $context); - $this->assertContains($expected_template_output, $output); - $messages = drupal_get_messages(); - $this->assertDumpExportEquals($retrieve_message($messages, 0), $context['twig_array']); - - // Ensures that if more than one argument is passed to the function works - // properly and every argument is dumped separately. - $template = 'test-with-context {{ twig_string }} {{ twig_array.first }} {{ twig_array.second }}{{ devel_message(twig_string, twig_array.first, twig_array, twig_object) }}'; - $output = (string) $environment->renderInline($template, $context); - $this->assertContains($expected_template_output, $output); - $messages = drupal_get_messages(); - $this->assertDumpExportEquals($retrieve_message($messages, 0), $context['twig_string']); - $this->assertDumpExportEquals($retrieve_message($messages, 1), $context['twig_array']['first']); - $this->assertDumpExportEquals($retrieve_message($messages, 2), $context['twig_array']); - $this->assertDumpExportEquals($retrieve_message($messages, 3), $context['twig_object']); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Unish/DevelDrushTest.php b/sites/all/modules/contrib/dev/devel/tests/src/Unish/DevelDrushTest.php deleted file mode 100644 index 42981445c..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Unish/DevelDrushTest.php +++ /dev/null @@ -1,31 +0,0 @@ -setUpDrupal(1, true); - $this->drush('pm:enable', ['devel']); - } - - /** - * Test devel:services command. - */ - public function testServices() { - $this->drush('devel:services'); - $output = $this->getOutput(); - $this->assertContains('account_switcher', $output); - } - -} - diff --git a/sites/all/modules/contrib/dev/devel/tests/src/Unish/README.md b/sites/all/modules/contrib/dev/devel/tests/src/Unish/README.md deleted file mode 100644 index debe184f1..000000000 --- a/sites/all/modules/contrib/dev/devel/tests/src/Unish/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Running Unish Tests -=================== - -Follow instructions provided by [Drush test README.md](https://github.com/drush-ops/drush/blob/master/tests/README.md) in order to test Unish test cases provided by contrib modules. - -See: https://github.com/drush-ops/drush/blob/master/tests/README.md \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/README.md b/sites/all/modules/contrib/dev/devel/webprofiler/README.md deleted file mode 100644 index af78b41ab..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/README.md +++ /dev/null @@ -1,92 +0,0 @@ -!! README.md is a work in progress !! - -# Dependencies - -- d3.js: Webprofiler module requires D3 library 3.x (not 4.x) to render data. - -- highlight.js: Webprofiler module requires highlight 9.7.x library to syntax highlight collected queries. - -## Install using Composer (recommended) - -If you use Composer to manage dependencies, edit `/composer.json` as follows. - -1\. Run `composer require --prefer-dist composer/installers` to ensure that you have the `composer/installers` package installed. This package facilitates the installation of packages into directories other than `/vendor` (e.g. `/libraries`) using Composer. - -2\. Add the following to the "installer-paths" section of `composer.json`: - -``` -"libraries/{$name}": ["type:drupal-library"], -``` - -3\. Add the following to the "repositories" section of `composer.json`: - -``` -"d3": { - "type": "package", - "package": { - "name": "d3/d3", - "version": "v3.5.17", - "type": "drupal-library", - "dist": { - "url": "https://github.com/d3/d3/archive/v3.5.17.zip", - "type": "zip" - } - } -}, -"highlightjs": { - "type": "package", - "package": { - "name": "components/highlightjs", - "version": "9.7.0", - "type": "drupal-library", - "dist": { - "url": "https://github.com/components/highlightjs/archive/9.7.0.zip", - "type": "zip" - } - } -} -``` -4\. Run `composer require --prefer-dist d3/d3:3.5.* components/highlightjs:9.7.*` - you should find that new directories have been created -under `/libraries` - -## Install manually - -- d3.js: - - - Create a `/libraries/d3/` directory below your Drupal root directory - - Download https://d3js.org/d3.v3.min.js - - Rename it to `/libraries/d3/d3.min.js` - - For further details on how to obtain D3.js, see https://github.com/d3/d3/ - -- highlight.js: - - - Create `/libraries/highlightjs/` directory below your Drupal root directory - - Download the library and CSS from http://highlightjs.org into it - -# IDE link - -Each class name discovered while profiling (controller class, event class) is specially linked to open the class in -an IDE. You can configure the URLs for these links to work for your IDE. - -## Sublime text (2 and 3) - macOS -See https://github.com/dhoulb/subl - -## Textmate -Use txmt://open?url=file://@file&line=@line - -## PhpStorm 8+ -Use phpstorm://open?file=@file&line=@line - -# Timeline - -It is also possible to collect the time needed to instantiate every single service used in a request. - -Add the following two lines to `settings.php` (or, even better, to `settings.local.php`): - -``` -$class_loader->addPsr4('Drupal\\webprofiler\\', [ __DIR__ . '/../../modules/contrib/devel/webprofiler/src']); -$settings['container_base_class'] = '\Drupal\webprofiler\DependencyInjection\TraceableContainer'; -``` - -Check if the path from the Webprofiler module in your `settings.php` file matches the location of the installed Webprofiler module in your project. diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/composer.json b/sites/all/modules/contrib/dev/devel/webprofiler/composer.json deleted file mode 100644 index 4ab96f758..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/composer.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "drupal/webprofiler", - "description": "Drupal Web Profiler.", - "type": "drupal-module", - "authors": [ - { - "name": "Luca Lusso", - "email": "lussoluca@gmail.com", - "homepage": "https://github.com/lussoluca", - "role": "Maintainer" - } - ], - "license": "GPL-2.0+", - "require": {} -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/config/install/webprofiler.config.yml b/sites/all/modules/contrib/dev/devel/webprofiler/config/install/webprofiler.config.yml deleted file mode 100644 index 5e8127433..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/config/install/webprofiler.config.yml +++ /dev/null @@ -1,28 +0,0 @@ -purge_on_cache_clear: true -storage: profiler.database_storage -exclude: "/contextual/*\r\n/toolbar/*\r\n/edit/*\r\n*.js\r\n*.css" -ide_link: "txmt://open?url=file://@file&line=@line" -ide_link_remote: "" -ide_link_local: "" -active_toolbar_items: - devel: devel - assets: assets - blocks: blocks - cache: cache - database: database - drupal_extension: drupal_extension - forms: forms - performance_timing: performance_timing - php_config: php_config - request: request - time: time - user: user - views: views - config: '0' - events: '0' - http: '0' - routing: '0' - services: '0' - state: '0' -query_sort: source -query_highlight: 5 diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/config/schema/webprofiler.schema.yml b/sites/all/modules/contrib/dev/devel/webprofiler/config/schema/webprofiler.schema.yml deleted file mode 100644 index 1adc2f166..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/config/schema/webprofiler.schema.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Schema for the configuration files of the Webprofiler module. -webprofiler.config: - type: config_object - label: 'Webprofiler configuration' - mapping: - purge_on_cache_clear: - type: boolean - label: 'Purge profiles on cache clear' - storage: - type: string - label: 'Storage implementation' - exclude: - type: string - label: 'Paths to exclude' - active_toolbar_items: - type: sequence - label: 'Active toolbar items' - sequence: - - type: string - label: 'Toolbar item' - ide_link: - type: string - label: 'IDE link' - ide_link_remote: - type: string - label: 'IDE link remote path' - ide_link_local: - type: string - label: 'IDE link local path' - query_sort: - type: string - label: 'Sort query log' - query_highlight: - type: integer - label: 'Slow query highlighting' diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console.services.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console.services.yml deleted file mode 100644 index fc662e47d..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console.services.yml +++ /dev/null @@ -1,14 +0,0 @@ -services: - webprofiler.list: - class: Drupal\webprofiler\Command\ListCommand - tags: - - { name: drupal.command } - lazy: true - webprofiler.export: - class: Drupal\webprofiler\Command\ExportCommand - tags: - - { name: drupal.command } - webprofiler.benchmark: - class: Drupal\webprofiler\Command\BenchmarkCommand - tags: - - { name: drupal.command } diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.benchmark.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.benchmark.yml deleted file mode 100644 index 3f6da3629..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.benchmark.yml +++ /dev/null @@ -1,20 +0,0 @@ -description: Benchmark an url. -arguments: - url: Url to benchmark. -options: - runs: Number of runs. - file: Save results as file. - cache-rebuild: Rebuild cache before start benchmark. -messages: - not_git: Not in a git repository. - error_login: Impossibile to login in the user. -progress: - cache_rebuild: Rebuilding cache... - login: Login user... - get: Http request... - compute_avg: Compute average... - compute_median: Compute median... - compute_95percentile: Compute 95 percentile... - git_hash: Compute GIT hash... - yaml: Generate output... - done: Done. diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.export.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.export.yml deleted file mode 100644 index e11c8d7dd..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.export.yml +++ /dev/null @@ -1,15 +0,0 @@ -description: Exports Webprofiler profile/s to file. -arguments: - id: Profile id. -options: - directory: Destination directory to store exported file/s. -messages: - success: Succesfully exported to %s - exported_count: Exported %s profiles - error_writing: Error writing file %s - error_no_profile: No profile with id %s -progress: - exporting: Exporting profiles... - archive: Create archive... - delete_tmp: Delete temp files... - done: Done. diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.list.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.list.yml deleted file mode 100644 index c8cb699a3..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/en/webprofiler.list.yml +++ /dev/null @@ -1,14 +0,0 @@ -description: Lists Webprofiler profiles. -options: - ip: Filter by IP. - url: Filter by URL. - method: Filter by HTTP method. - limit: Limit printed profiles. -rows: - time: D, m/d/Y - H:i:s -header: - token: Token - ip: IP - method: Method - url: URL - time: Time diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.benchmark.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.benchmark.yml deleted file mode 100644 index 8ed902ebb..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.benchmark.yml +++ /dev/null @@ -1,20 +0,0 @@ -description: Benchmark una URL. -arguments: - url: Url para efectuar un benchmark. -options: - runs: Número de ejecuciones. - file: Guardar los resultados en un archivo. - cache-rebuild: Reconstruir cache antes de iniciar el benchmark. -messages: - not_git: No en un repositorio git. - error_login: Error ingresando al sistema. -progress: - cache_rebuild: Reconstruyendo cache... - login: Ingresando al sistema... - get: Solicitud Http... - compute_avg: Calculando promedio... - compute_median: Calculando media... - compute_95percentile: Calculando percentile 95... - git_hash: Calculando GIT hash... - yaml: Generando salida... - done: Terminado. diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.export.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.export.yml deleted file mode 100644 index d7ca92011..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.export.yml +++ /dev/null @@ -1,15 +0,0 @@ -description: Exportar Webprofiler perfil(es) a un archivo. -arguments: - id: Profile id. -options: - directory: Directorio de destiono para almacenar archivo(s) exportados. -messages: - success: Satisfactoriamente exportado en %s - exported_count: Exportados %s perfiles - error_writing: Error escribiendo el archivo %s - error_no_profile: No fue encontrado un perfil con id %s -progress: - exporting: Exportando perfiles... - archive: Creando archivos... - delete_tmp: Borrando archivos temporales... - done: Terminado. diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.list.yml b/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.list.yml deleted file mode 100644 index e4635aef1..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/console/translations/es/webprofiler.list.yml +++ /dev/null @@ -1,14 +0,0 @@ -description: Listar perfiles Webprofiler. -options: - ip: Filtrar por IP. - url: Filtrar por URL. - method: Filtrar por método HTTP. - limit: Limitar perfiles a mostrar. -rows: - time: D, d/m/Y - H:i:s -header: - token: Token - ip: IP - method: Método - url: URL - time: Fecha diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/css/app/dashboard.css b/sites/all/modules/contrib/dev/devel/webprofiler/css/app/dashboard.css deleted file mode 100644 index dfa517a38..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/css/app/dashboard.css +++ /dev/null @@ -1,582 +0,0 @@ -/* base themes */ -#webrofiler { - overflow: hidden; - font-size: 1em; - line-height: 1.2; - color: rgba(0, 0, 0, 0.7); - background-color: #ffffff; } - #webrofiler * { - box-sizing: border-box; } - -#webprofiler { - /* - - overview example - -
      -
    • - - - - - - - */ - /* - - general element template - - will be implemented in the next dashboard relase - - this HTML will contain the preview of any single card present inside the dashboard - - - -
      -

      - - -
      -
      text -
      text - - */ } - #webprofiler .tabs:after, #webprofiler .tabs__tabs:after, #webprofiler .tabs__panels:after, #webprofiler .tabs__panel:after, #webprofiler .resume:after, #webprofiler .collectors:after, #webprofiler .panel:after, #webprofiler .panel__toolbar:after, #webprofiler .panel__container:after, #webprofiler .panel__expand-header:after, #webprofiler .panel__expand-content:after, #webprofiler .app__bar:after, #webprofiler .app__container:after, #webprofiler .modal__bar:after, #webprofiler .modal__content:after { - content: ' '; - display: block; - clear: both; } - #webprofiler .panel__container, #webprofiler .ui--red, #webprofiler .ui--pink, #webprofiler .ui--purple, #webprofiler .ui--deepPurple, #webprofiler .ui--indigo, #webprofiler .ui--blue, #webprofiler .ui--lightBlue, #webprofiler .ui--cyan, #webprofiler .ui--teal, #webprofiler .ui--green, #webprofiler .ui--lightGreen, #webprofiler .ui--lime, #webprofiler .ui--yellow, #webprofiler .ui--amber, #webprofiler .ui--orange, #webprofiler .ui--deepOrange, #webprofiler .ui--brown, #webprofiler .ui--gray, #webprofiler .ui--blueGray, #webprofiler .modal__container { - box-shadow: 0 2px 4px -2px #000000; - margin-bottom: 40px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 2px; - overflow: hidden; } - #webprofiler .ui--red .app__title, #webprofiler .ui--pink .app__title, #webprofiler .ui--purple .app__title, #webprofiler .ui--deepPurple .app__title, #webprofiler .ui--blue .app__title, #webprofiler .ui--lightBlue .app__title, #webprofiler .ui--cyan .app__title, #webprofiler .ui--green .app__title, #webprofiler .ui--lightGreen .app__title, #webprofiler .ui--lime .app__title, #webprofiler .ui--yellow .app__title, #webprofiler .ui--amber .app__title, #webprofiler .ui--orange .app__title, #webprofiler .ui--deepOrange .app__title, #webprofiler .ui--brown .app__title { - color: white; } - #webprofiler .ui--indigo .app__title, #webprofiler .ui--teal .app__title, #webprofiler .ui--gray .app__title, #webprofiler .ui--blueGray .app__title, #webprofiler .modal__title { - color: rgba(0, 0, 0, 0.87); } - #webprofiler .ui--red .app__main-data, #webprofiler .ui--pink .app__main-data, #webprofiler .ui--purple .app__main-data, #webprofiler .ui--deepPurple .app__main-data, #webprofiler .ui--indigo .app__main-data, #webprofiler .ui--blue .app__main-data, #webprofiler .ui--lightBlue .app__main-data, #webprofiler .ui--cyan .app__main-data, #webprofiler .ui--teal .app__main-data, #webprofiler .ui--green .app__main-data, #webprofiler .ui--lightGreen .app__main-data, #webprofiler .ui--lime .app__main-data, #webprofiler .ui--yellow .app__main-data, #webprofiler .ui--amber .app__main-data, #webprofiler .ui--orange .app__main-data, #webprofiler .ui--deepOrange .app__main-data, #webprofiler .ui--brown .app__main-data, #webprofiler .ui--gray .app__main-data, #webprofiler .ui--blueGray .app__main-data, #webprofiler .modal__content { - color: rgba(0, 0, 0, 0.7); } - #webprofiler .ui--red .app__secondary-data, #webprofiler .ui--pink .app__secondary-data, #webprofiler .ui--purple .app__secondary-data, #webprofiler .ui--deepPurple .app__secondary-data, #webprofiler .ui--indigo .app__secondary-data, #webprofiler .ui--blue .app__secondary-data, #webprofiler .ui--lightBlue .app__secondary-data, #webprofiler .ui--cyan .app__secondary-data, #webprofiler .ui--teal .app__secondary-data, #webprofiler .ui--green .app__secondary-data, #webprofiler .ui--lightGreen .app__secondary-data, #webprofiler .ui--lime .app__secondary-data, #webprofiler .ui--yellow .app__secondary-data, #webprofiler .ui--amber .app__secondary-data, #webprofiler .ui--orange .app__secondary-data, #webprofiler .ui--deepOrange .app__secondary-data, #webprofiler .ui--brown .app__secondary-data, #webprofiler .ui--gray .app__secondary-data, #webprofiler .ui--blueGray .app__secondary-data { - color: rgba(0, 0, 0, 0.3); } - #webprofiler a { - color: #2979ff; } - #webprofiler a:hover { - color: #2962ff; - text-decoration: none; } - #webprofiler .list--unstyled { - margin: 0; - list-style-type: none; - padding: 0; } - #webprofiler .list--unstyled > li { - display: block; - padding: 0 8px; } - #webprofiler .list--inline { - margin: 0; - list-style-type: none; - padding: 0; } - #webprofiler .list--inline > li { - display: inline-block; - padding: 8px; } - #webprofiler .list--level-0 li { - padding: 0 0 0 0; } - #webprofiler .list--level-1 li { - padding: 0 0 0 8px; } - #webprofiler .list--level-3 li { - padding: 0 0 0 16px; } - #webprofiler pre { - padding: 16px; } - #webprofiler pre, #webprofiler code { - white-space: normal; - word-break: break-all; - word-break: break-word; - font-size: 14px; - background-color: #f5f5f5; } - #webprofiler .list-item--bold { - font-weight: bold; - } - #webprofiler code.code--json { - white-space: pre-wrap; } - #webprofiler thead { - white-space: nowrap; } - #webprofiler thead th { - background-color: transparent; } - #webprofiler th { - font-size: 12px; - color: rgba(0, 0, 0, 0.54); - border: none; } - #webprofiler td { - word-break: break-all; - font-size: 13px; - color: rgba(0, 0, 0, 0.87); } - #webprofiler tr { - border-bottom: 1px solid rgba(0, 0, 0, 0.18); } - #webprofiler tr:hover { - background-color: #eeeeee; } - #webprofiler td, #webprofiler th { - padding: 16px 24px; - min-height: 46px; - text-transform: none; - vertical-align: top; } - #webprofiler .table--compact { - table-layout: fixed; } - #webprofiler .table--compact td, #webprofiler .table--compact th { - word-spacing: 99em; } - #webprofiler .table--fixed { - table-layout: fixed; } - #webprofiler .table--duo th:first-child, - #webprofiler .table--duo td:first-child { - width: 35%; } - #webprofiler .table--trio th:first-child, - #webprofiler .table--trio td:first-child { - width: 80%; } - #webprofiler .table--trio th:nth-child(2), - #webprofiler .table--trio td:nth-child(2), - #webprofiler .table--trio th:nth-child(3), - #webprofiler .table--trio td:nth-child(3) { - width: 10%; } - #webprofiler [class*="button"] { - display: block; - color: #2979ff; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 2px; - border: none; - text-transform: uppercase; - font-size: 16px; - text-align: center; - padding: 16px; - margin: 8px; - cursor: pointer; - min-width: 42px; } - #webprofiler .button--flat { - background-color: transparent; } - #webprofiler .button--flat:hover { - background-color: #eeeeee; } - #webprofiler .button--flat:active, #webprofiler .button--flat:focus { - background-color: #bdbdbd; } - #webprofiler .tabs { - position: relative; - margin: -16px 0 16px 0; } - #webprofiler .tabs a { - display: inline; } - #webprofiler .tabs__radio { - display: none; } - #webprofiler .tabs__tabs { - margin: 0 -16px 16px -16px; - text-transform: uppercase; - height: 48px; - background-color: #f5f5f5; } - #webprofiler .tabs__tabs > li { - padding: 0; } - #webprofiler .tabs__label { - border-bottom: 5px solid transparent; - text-align: center; - line-height: 48px; - min-width: 160px; - display: inline-block; - margin: -5px 0 0 0; } - #webprofiler .tabs__panel { - display: none; - width: 100%; } - #webprofiler .tabs__radio:checked:nth-child(1) ~ .tabs__panels .tabs__panel:nth-child(1) { - display: block; } - #webprofiler .tabs__radio:checked:nth-child(2) ~ .tabs__panels .tabs__panel:nth-child(2) { - display: block; } - #webprofiler .tabs__radio:checked:nth-child(3) ~ .tabs__panels .tabs__panel:nth-child(3) { - display: block; } - #webprofiler .tabs__radio:checked:nth-child(1) ~ .tabs__tabs li:nth-child(1) .tabs__label { - border-bottom-color: #2962ff; } - #webprofiler .tabs__radio:checked:nth-child(2) ~ .tabs__tabs li:nth-child(2) .tabs__label { - border-bottom-color: #2962ff; } - #webprofiler .tabs__radio:checked:nth-child(3) ~ .tabs__tabs li:nth-child(3) .tabs__label { - border-bottom-color: #2962ff; } - #webprofiler .overview { - display: table-cell; - width: 20%; - vertical-align: top; - font-size: 1.2em; - line-height: 2em; - background: #ffffff; } - #webprofiler .overview__list { - padding: 0; - margin: -1px -1px 0 0; - list-style-type: none; - border-top: 1px solid rgba(0, 0, 0, 0.18); } - #webprofiler .overview__link { - position: relative; - display: block; - padding: 0 0 0 72px; - border-right: 5px solid transparent; } - #webprofiler .overview__link:after { - content: ''; - display: block; - position: absolute; - bottom: 0; - right: -5px; - left: 72px; - border-bottom: 1px solid rgba(0, 0, 0, 0.18); } - #webprofiler .overview__icon { - position: absolute; - top: 16px; - left: 16px; } - #webprofiler .overview__title { - display: block; - font-size: 16px; - line-height: 22px; - padding-top: 16px; - padding-bottom: 16px; - padding-right: 11px; } - #webprofiler .overview__subtitle { - display: block; - font-size: 14px; - line-height: 20px; - padding-bottom: 16px; - padding-right: 11px; - margin-top: -16px; } - #webprofiler .is--selected .overview__link { - color: #000000; - background-color: #f5f5f5; - border-right-color: #2962ff; } - #webprofiler .overview__link:hover { - color: #000000; - background-color: #82b1ff; } - #webprofiler .resume { - position: relative; - background-color: #e0e0e0; - border-bottom: 1px solid rgba(0, 0, 0, 0.18); - border-left: 1px solid rgba(0, 0, 0, 0.18); - padding: 16px 16px 0 16px; - margin-left: 20%; } - #webprofiler .resume__title { - display: block; - font-size: 24px; - line-height: 32px; } - #webprofiler .resume__subtitle, - #webprofiler .resume__time { - display: block; - font-size: 16px; - line-height: 24px; } - #webprofiler .resume__time { - margin-bottom: 52px; } - #webprofiler .resume__button { - position: absolute; - bottom: 0; - right: 16px; } - #webprofiler .collectors { - display: table; - width: 100%; } - #webprofiler .details { - display: table-cell; - overflow: hidden; - padding: 16px; - border-left: 1px solid rgba(0, 0, 0, 0.18); } - #webprofiler .details__title { - border-bottom: 1px solid #ccc; - padding-bottom: 5px; } - #webprofiler .details svg { - max-width: 100%; } - #webprofiler [class*='panel__filter--'] { - display: inline-block; - padding: 32px 16px 0 16px; - position: relative; } - #webprofiler .panel { - margin: 0 0 20px; - padding: 0; - background: #fafafa; - border: none; } - #webprofiler .panel select, - #webprofiler .panel input[type="text"] { - min-width: 165px; - font-size: 16px; - background-color: #fafafa; - border-color: transparent; - border-width: 0; - border-bottom: 2px solid #ffffff; - padding: 8px 0; - margin-bottom: 8px; } - #webprofiler .panel select:focus, - #webprofiler .panel input[type="text"]:focus { - outline: none; - border-bottom-color: #2979ff; } - #webprofiler .panel select:focus + label, - #webprofiler .panel input[type="text"]:focus + label { - color: #2979ff; } - #webprofiler .panel select { - min-width: 165px; - padding-right: 24px; - border-radius: 0; - background: url(../../images/caret-down.svg) no-repeat 99% 63%; - -moz-appearance: none; } - #webprofiler .panel select:hover { - box-shadow: none; } - #webprofiler .panel__title { - font-size: 24px; - line-height: 1; - background-color: #f5f5f5; - text-transform: none; - padding: 16px; - margin: -16px -16px 16px -16px; } - #webprofiler .panel__toolbar { - background-color: #fafafa; - margin: -16px -16px 16px -16px; } - #webprofiler .panel__filter-action { - display: inline-block; } - #webprofiler .panel__filter-label { - display: block; - position: absolute; - top: 0; - margin-top: 16px; } - #webprofiler .panel__container { - background-color: #ffffff; - position: relative; - padding: 16px; } - #webprofiler .panel__expand-content { - display: none; } - #webprofiler .is--open .panel__expand-content { - display: block; } - #webprofiler .is--hightlighted { - border-right: 10px solid #aa00ff; - padding-right: 6px; } - #webprofiler .is--hidden { - display: none; } - #webprofiler .app { - overflow: hidden; - position: relative; - display: block; - cursor: pointer; } - #webprofiler .app__bar { - padding: 16px; } - #webprofiler .app__title { - margin: 8px 32px 0 0; - font-weight: normal; } - #webprofiler .app__icon { - float: right; - height: 32px; - width: 32px; } - #webprofiler .app__container { - padding: 16px; } - #webprofiler .app__main-data { - font-size: 24px; - padding-bottom: 16px; } - #webprofiler .app__secondary-data { - font-size: 14px; - padding-bottom: 16px; - margin-top: -8px; } - #webprofiler .ui--red .app__bar { - background-color: #ff1744; } - #webprofiler .ui--red .app__container { - background-color: #ff8a80; } - #webprofiler .ui--pink .app__bar { - background-color: #f50057; } - #webprofiler .ui--pink .app__container { - background-color: #ff80ab; } - #webprofiler .ui--purple .app__bar { - background-color: #d500f9; } - #webprofiler .ui--purple .app__container { - background-color: #ea80fc; } - #webprofiler .ui--deepPurple .app__bar { - background-color: #651fff; } - #webprofiler .ui--deepPurple .app__container { - background-color: #b388ff; } - #webprofiler .ui--indigo .app__bar { - background-color: #3d5afe; } - #webprofiler .ui--indigo .app__container { - background-color: #8c9eff; } - #webprofiler .ui--blue .app__bar { - background-color: #2979ff; } - #webprofiler .ui--blue .app__container { - background-color: #82b1ff; } - #webprofiler .ui--lightBlue .app__bar { - background-color: #00b0ff; } - #webprofiler .ui--lightBlue .app__container { - background-color: #80d8ff; } - #webprofiler .ui--cyan .app__bar { - background-color: #00e5ff; } - #webprofiler .ui--cyan .app__container { - background-color: #84ffff; } - #webprofiler .ui--teal .app__bar { - background-color: #ade9b6; } - #webprofiler .ui--teal .app__container { - background-color: #a7ffeb; } - #webprofiler .ui--green .app__bar { - background-color: #00e676; } - #webprofiler .ui--green .app__container { - background-color: #b9f6ca; } - #webprofiler .ui--lightGreen .app__bar { - background-color: #76ff03; } - #webprofiler .ui--lightGreen .app__container { - background-color: #ccff90; } - #webprofiler .ui--lime .app__bar { - background-color: #c6ff00; } - #webprofiler .ui--lime .app__container { - background-color: #f4ff81; } - #webprofiler .ui--yellow .app__bar { - background-color: #ffea00; } - #webprofiler .ui--yellow .app__container { - background-color: #ffff8d; } - #webprofiler .ui--amber .app__bar { - background-color: #ffc400; } - #webprofiler .ui--amber .app__container { - background-color: #ffe57f; } - #webprofiler .ui--orange .app__bar { - background-color: #ff9100; } - #webprofiler .ui--orange .app__container { - background-color: #ffd180; } - #webprofiler .ui--deepOrange .app__bar { - background-color: #ff3d00; } - #webprofiler .ui--deepOrange .app__container { - background-color: #ff9e80; } - #webprofiler .ui--brown .app__bar { - background-color: #8d6e63; } - #webprofiler .ui--brown .app__container { - background-color: #d7ccc8; } - #webprofiler .ui--gray .app__bar { - background-color: #bdbdbd; } - #webprofiler .ui--gray .app__container { - background-color: #f5f5f5; } - #webprofiler .ui--blueGray .app__bar { - background-color: #bdbdbd; } - #webprofiler .ui--blueGray .app__container { - background-color: #f5f5f5; } - #webprofiler .loader--fixed { - position: fixed; - right: 0; - top: 50%; - width: 80%; - height: 100px; - zoom: 1.7; - text-align: center; } - #webprofiler .loader__circle { - animation: rotate 2s linear infinite; - height: 100px; - position: relative; - width: 100px; } - #webprofiler .loader__path { - stroke-dasharray: 1, 200; - stroke-dashoffset: 0; - animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; - stroke-linecap: round; } -@keyframes rotate { - 100% { - transform: rotate(360deg); } } -@keyframes dash { - 0% { - stroke-dasharray: 1, 200; - stroke-dashoffset: 0; } - 50% { - stroke-dasharray: 89, 200; - stroke-dashoffset: -35; } - 100% { - stroke-dasharray: 89, 200; - stroke-dashoffset: -124; } } -@keyframes color { - 100%, 0% { - stroke: #ff1744; } - 40% { - stroke: #2979ff; } - 66% { - stroke: #00e676; } - 80%, 90% { - stroke: #ffea00; } } - #webprofiler .loader--linear { - height: 3px; - background-color: #ffea00; - position: absolute; - top: 0; - left: 0; - right: 0; } - #webprofiler .loader__bar { - content: ""; - display: inline; - position: absolute; - width: 0; - height: 100%; - left: 50%; - text-align: center; } - #webprofiler .loader__bar:nth-child(1) { - background-color: #ff1744; - animation: loading 3s linear infinite; } - #webprofiler .loader__bar:nth-child(2) { - background-color: #2979ff; - animation: loading 3s linear 1s infinite; } - #webprofiler .loader__bar:nth-child(3) { - background-color: #00e676; - animation: loading 3s linear 2s infinite; } -@keyframes loading { - from { - left: 50%; - width: 0; - z-index: 100; } - 33.3333% { - left: 0; - width: 100%; - z-index: 10; } - to { - left: 0; - width: 100%; } } - #webprofiler .modal { - background-color: rgba(0, 0, 0, 0.87); - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; } - #webprofiler .modal__container { - border-top-right-radius: 2px; - border-top-left-radius: 2px; - box-shadow: 0 2px 4px -2px #000000; - background-color: #ffffff; - position: relative; - width: 33%; - min-width: 350px; - margin: 0 auto; - margin-top: 15%; } - #webprofiler .modal__bar { - padding: 16px; } - #webprofiler .modal__content { - padding: 16px; - font-size: 14px; } - #webprofiler .modal__title { - margin: 8px 32px 0 0; - font-weight: normal; - font-size: 24px; } - #webprofiler .modal__main-data { - font-size: 24px; - padding-bottom: 16px; } - #webprofiler .modal textarea { - white-space: normal; - word-break: break-all; - word-break: break-word; - font-size: 14px; - background-color: #f5f5f5; - max-width: 100%; - height: 320px; - width: 100%; - padding: 16px; - box-sizing: border-box; - border: none; } - #webprofiler .t--heading, #webprofiler .tabs__radio:checked:nth-child(1) ~ .tabs__tabs li:nth-child(1) .tabs__label, #webprofiler .tabs__radio:checked:nth-child(2) ~ .tabs__tabs li:nth-child(2) .tabs__label, #webprofiler .tabs__radio:checked:nth-child(3) ~ .tabs__tabs li:nth-child(3) .tabs__label, #webprofiler .overview__title, #webprofiler .resume__title, #webprofiler .panel select, - #webprofiler .panel input[type="text"], #webprofiler .panel__title { - color: black; } - #webprofiler .t--notice, #webprofiler .tabs__label, #webprofiler .overview__subtitle, #webprofiler .resume__subtitle, - #webprofiler .resume__time, #webprofiler .panel__filter-label { - color: rgba(0, 0, 0, 0.3); } - #webprofiler .l-card { - width: 32%; - margin-left: 1%; - margin-right: 1%; - float: left; } - #webprofiler .l-card:nth-child(3n + 1) { - margin-left: 0; } - #webprofiler .l-card:nth-child(3n) { - margin-right: 0; } - #webprofiler .l-left { - float: left; } - #webprofiler .l-right { - float: right; } - #webprofiler .h--word-broken { - word-break: break-all; } - #webprofiler .h--word-intact { - word-break: normal; } - -/*# sourceMappingURL=dashboard.css.map */ diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/css/timeline.css b/sites/all/modules/contrib/dev/devel/webprofiler/css/timeline.css deleted file mode 100644 index f7623106f..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/css/timeline.css +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Timeline - */ - -.timeline__legends { - font-size: 12px; - line-height: 1.5em; -} - -.timeline__legends span { - border-left-width: 10px; - border-left-style: solid; - padding: 0 10px 0 5px; -} - -.timeline__legends--default { - border-left-color: #E91E63; -} - -.timeline__legends--section { - border-left-color: #3F51B5; -} - -.timeline__legends--event_listener { - border-left-color: #00BCD4; -} - -.timeline__legends--event_listener_loading { - border-left-color: #8BC34A; -} - -.timeline__legends--template { - border-left-color: #FFC107; -} - -.timeline__legends--service { - border-left-color: #795548; -} - -text { - font-size: 12px; - line-height: 20px; - height: 22px; - fill: rgba(0, 0, 0, 0.87); -} -#timeline { - background: white; - margin: 10px 0; - width: 100%; - position: relative; - padding: 0 0 40px 0; -} -.timeline__row, -.timeline__scale--x, -.timeline__label rect { - stroke: rgba(0, 0, 0, 0.18); -} -.timeline__row{ - fill: transparent; -} -.timeline__label rect { - fill: white; -} -.timeline__period--default { - fill: #E91E63; -} -.timeline__period--service { - fill: #795548; -} -.timeline__period--section { - fill: #3F51B5; -} -.timeline__period--event_listener { - fill: #00BCD4; -} -.timeline__period--event_listener_loading { - fill: #8BC34A; -} -.timeline__period--template { - fill: #FFC107; -} -.timeline__period-trigger{ - fill: transparent; -} -.tooltip{ - position: absolute; - padding: 8px; - background: rgb(0,0,0); - background: rgba(0, 0, 0, 0.87); - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - width: 175px; - text-align: center; - display: none; - color: white; -} -.tooltip__title{ - display: block; -} -.tooltip__content{ - display: block; -} -.axis{ - stroke-width: 2px; - fill: none; -} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/images/caret-down.svg b/sites/all/modules/contrib/dev/devel/webprofiler/images/caret-down.svg deleted file mode 100644 index 4e48c8c98..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/images/caret-down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/collections/collectors.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/collections/collectors.js deleted file mode 100644 index ed26836f3..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/collections/collectors.js +++ /dev/null @@ -1,35 +0,0 @@ -(function ($, Drupal, drupalSettings, Backbone) { - - "use strict"; - - Drupal.webprofiler.collectors.Collectors = Backbone.Collection.extend({ - model: Drupal.webprofiler.models.Collector, - - url: Drupal.url('admin/reports/profiler/view/' + drupalSettings.webprofiler.token + '/collectors'), - - /** - * Unselect all models. - */ - resetSelected: function () { - this.each(function (model) { - model.set({"selected": false}); - }); - }, - - /** - * Select a specific model from the collection. - * - * @param id - * @returns {*} - */ - selectByID: function (id) { - this.resetSelected(); - var collector = this.get(id); - collector.set({"selected": true}); - - return collector.id; - } - }); - -}(jQuery, Drupal, drupalSettings, Backbone)); - diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/helpers.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/helpers.js deleted file mode 100644 index caa8bdb4e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/helpers.js +++ /dev/null @@ -1,107 +0,0 @@ -(function (drupalSettings) { - - Drupal.webprofiler.helpers = (function () { - - "use strict"; - - var escapeRx = function escapeRegExp(string) { - return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); - }, - - repl = function replaceAll(string, find, replace) { - if (typeof string != 'string') { - return ''; - } - return string.replace(new RegExp(escapeRx(find), 'g'), replace); - }, - - shortLink = function (clazz) { - if (!clazz) { - return null; - } - clazz = repl(clazz, '/', '\\'); - var parts = clazz.split("\\"), result = [], size = (parts.length - 1); - - _.each(parts, function (item, key) { - if (key < size) { - result.push(item.substring(0, 1)); - } else { - result.push(item); - } - }); - return result.join("\\"); - }, - - abbr = function (clazz) { - if (!clazz) { - return null; - } - - return '' + shortLink(clazz) + ''; - }, - - ideLink = function (file, line) { - if (!file) { - return null; - } - - line = line || 0; - - file = file.replace(drupalSettings.webprofiler.ide_link_remote, drupalSettings.webprofiler.ide_link_local); - - return drupalSettings.webprofiler.ide_link.replace("@file", file).replace("@line", line); - }, - - classLink = function (data) { - var link = ideLink(data['file'], data['line']), clazz = abbr(data['class']), method = data['method'], output = ''; - - output = clazz; - if (method) { - output += '::' + method; - } - - if (link) { - output = '' + output + ''; - } - - return output; - }, - - printTime = function (data, unit) { - unit = unit || 'ms'; - data = Math.round((data + 0.00001) * 100) / 100; - return data + ' ' + unit; - }, - - frm = function (obj, level) { - level = level || 0; - var str = '
        ', prop; - if (typeof obj != 'object') { - return obj; - } - for (prop in obj) { - if (isInt(prop)) { - str += '
      • ' + frm(obj[prop], level + 1) + '
      • '; - } else { - str += '
      • ' + prop + ': ' + frm(obj[prop], level + 1) + '
      • '; - } - } - return str + '
      '; - }, - - isInt = function (value) { - var x; - return isNaN(value) ? !1 : (x = parseFloat(value), (0 | x) === x); - }; - - return { - frm: frm, - ideLink: ideLink, - shortLink: shortLink, - classLink: classLink, - printTime: printTime - } - - })(); - -}(drupalSettings)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/main.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/main.js deleted file mode 100644 index d5d71cd42..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/main.js +++ /dev/null @@ -1,105 +0,0 @@ -(function ($, Drupal, Backbone) { - - "use strict"; - - /** - * Define namespaces. - */ - Drupal.webprofiler = { - views: {}, - models: {}, - collectors: {}, - routers: {} - }; - - Drupal.behaviors.webprofiler = { - attach: function (context) { - var el, - elz, - key, - sel, - value, - select, - selector, - unselected, - filter = [], - - livefilter = function (e) { - el = $(e).attr('id').replace('edit-', ''); - value = $(e).val(); - filter[el] = value.replace('/', '\/'); - selector = []; - unselected = []; - - for (key in filter) { - if (filter[key].length > 0 && filter[key] != ' ') { - select = filter[key].split(' ').filter(Boolean); - for (sel in select) { - selector.push('[data-wp-' + key + ' *= ' + select[sel].toLowerCase() + ']'); - unselected.push('[data-wp-' + key + ']:not([data-wp-' + key + ' *= ' + select[sel].toLowerCase() + '])'); - } - } - else { - selector.push('[data-wp-' + key + ']'); - } - } - for (elz in unselected) { - $(unselected[elz]).addClass('is--hidden'); - } - $(selector.join('')).removeClass('is--hidden'); - }, - - modalFill = function(t,c){ - $('.modal__title').html(t); - $('.modal__main-data').html(c); - }, - - clipboard = function (e, t) { - var clip = e.parent().find(t).get(0), - title = 'Original Code', - content = ''; - - modalFill(title,content); - $('.modal').show(); - }; - - $(context).find('#collectors').once('webprofiler').each(function () { - new Drupal.webprofiler.routers.CollectorsRouter({el: $('#collectors')}); - Backbone.history.start({ - pushState: false - }); - }); - - $(context).find('.js--modal-close').each(function () { - $(this).on('click', function () { - $('.js--modal').hide(); - }); - }); - - $(context).find('.js--live-filter').each(function () { - $(this).on('keyup', function () { - livefilter($(this)); - }); - $(this).on('change', function () { - livefilter($(this)); - }); - }); - - $(context).find('.js--panel-toggle').once('js--panel-toggle').each(function () { - $(this).on('click', function () { - $(this).parent().parent().toggleClass('is--open'); - }); - }); - - $(context).find('.js--clipboard-trigger').once('js--clipboard-trigger').each(function () { - $(this).on('click', function () { - clipboard($(this), '.js--clipboard-target') - } - ); - }); - } - }; - -}(jQuery, Drupal, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/models/collector.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/models/collector.js deleted file mode 100644 index 483033c47..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/models/collector.js +++ /dev/null @@ -1,15 +0,0 @@ -(function ($, Drupal, drupalSettings, Backbone) { - - "use strict"; - - Drupal.webprofiler.models.Collector = Backbone.Model.extend({ - idAttribute: 'name', - urlRoot: Drupal.url('admin/reports/profiler/view/' + drupalSettings.webprofiler.token + '/collectors'), - defaults: { - name: "default", - data: [], - selected: false - } - }); - -}(jQuery, Drupal, drupalSettings, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/routers/collectors.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/routers/collectors.js deleted file mode 100644 index 876f2387e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/routers/collectors.js +++ /dev/null @@ -1,48 +0,0 @@ -(function ($, Drupal, drupalSettings, Backbone) { - - "use strict"; - - var collectors = new Drupal.webprofiler.collectors.Collectors(drupalSettings.webprofiler.collectors); - - Drupal.webprofiler.routers.CollectorsRouter = Backbone.Router.extend({ - routes: { - ':id': 'selectCollector' - }, - - /** - * - * @param id - */ - selectCollector: function (id) { - var collectors = this.collectors, layout = this.layout; - - //collectors.resetSelected(); - collectors.selectByID(id); - - var collector = collectors.get(id); - - if (collector.get('data').length != 0) { - layout.setDetails(collector); - } else { - var deferred = collectors.get(id).fetch(); - deferred.done(function () { - layout.setDetails(collector); - }); - } - }, - - /** - * - * @param options - */ - initialize: function (options) { - this.collectors = collectors; - this.layout = Drupal.webprofiler.views.Layout.getInstance({ - el: options.el, - router: this - }); - this.layout.render(); - } - }); - -}(jQuery, Drupal, drupalSettings, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collector.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collector.js deleted file mode 100644 index 955a36e1b..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collector.js +++ /dev/null @@ -1,29 +0,0 @@ -(function ($, Drupal, Backbone) { - - "use strict"; - - Drupal.webprofiler.views.CollectorView = Backbone.View.extend({ - tagName: 'li', - template: _.template($("script#collector").html()), - - /** - * - */ - initialize: function () { - _.bindAll(this, "render"); - this.listenTo(this.model, 'change:selected', this.render); - }, - - /** - * - * @returns {Drupal.webprofiler.views.CollectorView} - */ - render: function () { - this.$el.html(this.template(this.model.toJSON())); - this.$el.toggleClass('is--selected', this.model.get('selected')); - return this; - } - - }); - -}(jQuery, Drupal, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collectorsList.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collectorsList.js deleted file mode 100644 index 8628371cb..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/collectorsList.js +++ /dev/null @@ -1,21 +0,0 @@ -(function ($, Drupal, Backbone) { - - "use strict"; - - Drupal.webprofiler.views.CollectorsList = Backbone.View.extend({ - tagName: 'section', - - /** - * - * @returns {Drupal.webprofiler.views.CollectorsList} - */ - render: function () { - var collectorsView = this.collection.map(function (collector) { - return (new Drupal.webprofiler.views.CollectorView({model: collector})).render().el; - }); - this.$el.html(collectorsView); - return this; - } - }); - -}(jQuery, Drupal, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/details.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/details.js deleted file mode 100644 index 709f17ea7..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/details.js +++ /dev/null @@ -1,20 +0,0 @@ -(function ($, Drupal, Backbone) { - - "use strict"; - - Drupal.webprofiler.views.DetailsView = Backbone.View.extend({ - el: '#details', - - /** - * - * @returns {Drupal.webprofiler.views.DetailsView} - */ - render: function () { - var template = _.template($("script#" + this.model.get('name')).html()); - - this.$el.html(template(this.model.toJSON())); - return this; - } - }); - -}(jQuery, Drupal, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/layout.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/layout.js deleted file mode 100644 index 6168b3430..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/app/views/layout.js +++ /dev/null @@ -1,83 +0,0 @@ -(function ($, Drupal, drupalSettings, Backbone) { - - "use strict"; - - Drupal.webprofiler.views.Layout = Backbone.View.extend({ - template: _.template( - '
      ' + - '
        ' + - '
        ' + - '
        ' + - 'Choose a collector.' + - '
        ' - ), - - /** - * - * @returns {Drupal.webprofiler.views.Layout} - */ - render: function () { - this.$el.html(this.template()); - - if(this.currentDetails) { - this.currentDetails.setElement(this.$('#details')).render(); - } - - this.overview.setElement(this.$('#overview ul')).render(); - return this; - }, - - /** - * - * @param options - */ - initialize: function (options) { - options.router.collectors.on('request', this.beginSync); - options.router.collectors.on('sync', this.finishSync); - - this.overview = new Drupal.webprofiler.views.CollectorsList({ - collection: options.router.collectors, - router: options.router - }); - }, - - /** - * - * @param collector - */ - setDetails: function (collector) { - if (this.currentDetails) this.currentDetails.remove(); - this.currentDetails = new Drupal.webprofiler.views.DetailsView({model: collector}); - this.render(); - Drupal.attachBehaviors(/*this.$el, drupalSettings*/); - }, - - /** - * - */ - beginSync: function () { - $('.loader--fixed').fadeIn({duration: 100}); - }, - - /** - * - */ - finishSync: function () { - $('.loader--fixed').fadeOut({duration: 100}); - } - }); - - var instance; - Drupal.webprofiler.views.Layout.getInstance = function (options) { - if (!instance) { - instance = new Drupal.webprofiler.views.Layout({ - el: options.el, - router: options.router, - collection: options.router.collectors - }); - } - - return instance; - } - -}(jQuery, Drupal, drupalSettings, Backbone)); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/database.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/database.js deleted file mode 100644 index 5f5043079..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/database.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file - * Database panel app. - */ -(function ($, Drupal, drupalSettings) { - - "use strict"; - - Drupal.behaviors.webprofiler_database = { - attach: function (context) { - $(context).find('.js--explain-trigger').once('js--explain-trigger').each(function () { - - $(this).on('click', function () { - var position = $(this).attr('data-wp-queryPosition'), - wrapper = $(this).parent().parent().find('.js--explain-target'), - loader = $(this).parent().parent().find('.js--loader'); - - if (wrapper.html().length === 0) { - - var url = Drupal.url('admin/reports/profiler/database_explain/' + drupalSettings.webprofiler.token + '/' + position); - - loader.show(); - - $.getJSON(url, function (data) { - _.templateSettings.variable = 'rc'; - var template = _.template( - $("#wp-query-explain-template").html() - ); - wrapper.html(template(data)); - loader.hide(); - delete _.templateSettings.variable; - }); - } - wrapper.toggle(); - - }); - }); - - $(context).find('.js--code-toggle').once('js--code-toggle').each(function () { - $(this).on('click', function () { - $(this).parent().find('.js--code-target').find('code').toggleClass('is--hidden'); - }); - }); - - $(context).find('.js--code-toggle--global').once('js--code-toggle--global').each(function () { - $(this).on('click', function () { - - if($(this).hasClass('js--placeholder-visible')){ - $('.js--placeholder-query').addClass('is--hidden'); - $('.js--original-query').removeClass('is--hidden'); - - }else{ - $('.js--placeholder-query').removeClass('is--hidden'); - $('.js--original-query').addClass('is--hidden'); - } - $(this).toggleClass('js--placeholder-visible'); - }); - }); - - if (typeof hljs != "undefined") { - $('code.sql').each(function (i, block) { - hljs.highlightBlock(block); - }); - } - } - } -}) -(jQuery, Drupal, drupalSettings); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/js/timeline.js b/sites/all/modules/contrib/dev/devel/webprofiler/js/timeline.js deleted file mode 100644 index f550e080e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/js/timeline.js +++ /dev/null @@ -1,223 +0,0 @@ -/** - * @file - * Timeline panel app. - */ -(function ($, Drupal, drupalSettings, d3) { - - 'use strict'; - - Drupal.behaviors.webprofiler_timeline = { - attach: function (context) { - if (typeof d3 != 'undefined') { - - // data - var data = drupalSettings.webprofiler.time.events; - var parts = []; - var dataL = data.length; - var perL; - var labelW = []; - var rowW; - var scalePadding; - var endTime = parseInt(data[(dataL - 1)].endtime); - var roundTime = Math.ceil(endTime / 1000) * 1000; - var endScale; - - for (var j = 0; j < dataL; j++) { - perL = data[j].periods.length; - for (var k = 0; k < perL; k++) { - parts.push({ - lane: j, - category: data[j].category, - memory: data[j].memory, - name: data[j].name, - start: data[j].periods[k].start, - end: data[j].periods[k].end - }); - } - } - - var tooltipCtrl = function (d, i) { - tooltip.html('memory usage: ' + d.memory + '' + - '' + parseInt(d.start) + 'ms ~ ' + parseInt(d.end) + 'ms'); - tooltip - .style('display', 'block') - .style('left', (d3.event.layerX - 87) + 'px') - .style('top', ((d.lane + 1) * 22) + 'px') - .style('opacity', .9); - }; - - var xscale = d3.scale.linear().domain([0, roundTime]).range([0, 1000]); - d3.select('#timeline').append('svg').attr('height', (dataL + 1) * 22 + 'px').attr('width', '100%').attr('class', 'timeline__canvas'); - - // tooltips - var tooltip = d3.select('#timeline') - .append('div') - .attr('class', 'tooltip'); - - - // Add a rectangle for every data element. - d3.select('.timeline__canvas') - .append('g') - .attr('class', 'timeline__rows') - .attr('x', 0) - .attr('y', 0) - .selectAll('g') - .data(data) - .enter() - .append('rect') - .attr('class', 'timeline__row') - .attr('x', 0) - .attr('y', function (d, i) { - return (i * 22); - }) - .attr('height', 22) - .attr('width', '100%') - .each(function () { - rowW = this.getBoundingClientRect().width; - }); - - // scale - var scale = d3.select('.timeline__canvas') - .append('g') - .attr('class', 'timeline__scale') - .attr('id', 'timeline__scale') - .attr('x', 0) - .attr('y', 0) - .selectAll('g') - .data(data) - .enter() - .append('a') - .attr('xlink:href', function (d) { - return Drupal.webprofiler.helpers.ideLink(d.link); - }) - .attr('class', function (d) { - return 'timeline__label ' + d.category; - }) - .attr('x', xscale(5)) - .attr('y', function (d, i) { - return (((i + 1) * 22) - 5); - }); - - scale.append('title') - .text(function (d) { - return d.name; - }); - - scale.append('text') - .attr('x', xscale(5)) - .attr('y', function (d, i) { - return (((i + 1) * 22) - 5); - }) - .text(function (d) { - return Drupal.webprofiler.helpers.shortLink(d.name); - }) - .each(function (d) { - labelW.push(this.getBoundingClientRect().width); - }); - - scalePadding = Math.max.apply(null, labelW) + 10; - - scale.insert('rect', 'title') - .attr('x', 0) - .attr('y', function (d, i) { - return (i * 22); - }) - .attr('height', 22) - .attr('stroke', 'transparent') - .attr('strokw-width', 1) - .attr('width', scalePadding); - - // times - var events = d3.select('.timeline__canvas') - .insert('g', '.timeline__scale') - .attr('class', 'timeline__parts') - .attr('x', 0) - .attr('y', 0) - .selectAll('g') - .data(parts) - .enter(); - - events.append('rect').attr('class', function (d) { - return 'timeline__period--' + d.category; - }) - .attr('x', function (d) { - return xscale(parseInt(d.start)) + scalePadding; - }) - .attr('y', function (d) { - return d.lane * 22; - }) - .attr('height', 22) - .attr('width', function (d) { - return xscale(Math.max(parseInt(d.end - d.start), 1)); - }); - - events.append('rect') - .attr('class', function (d) { - return 'timeline__period-trigger'; - }) - .attr('x', function (d) { - return xscale(parseInt(d.start)) + scalePadding - 5; - }) - .attr('y', function (d) { - return d.lane * 22; - }) - .attr('height', 22) - .attr('width', function (d) { - return xscale(Math.max(parseInt(d.end - d.start), 1)) + 11; - }) - .on('mouseover', function (d, i) { - tooltipCtrl(d, i); - }) - .on('mouseout', function (d) { - tooltip - .style('display', 'none'); - }); - - // Draw X-axis grid lines - d3.select('.timeline__parts').insert('g', '.timeline__parts') - .selectAll('line') - .data(xscale.ticks(10)) - .enter() - .append('line') - .attr('class', 'timeline__scale--x') - .attr('x1', xscale) - .attr('x2', xscale) - .attr('y1', 0) - .attr('y2', data.length * 22) - .attr('transform', 'translate( ' + scalePadding + ' , 0)'); - - var xAxis = d3.svg.axis().scale(xscale).ticks(10).orient('bottom').tickFormat(function (d) { - return d + ' ms'; - }); - - d3.select('.timeline__parts').insert('g', '.timeline__parts') - .attr('class', 'axis') - .attr('transform', 'translate(' + scalePadding + ', ' + dataL * 22 + ')') - .call(xAxis); - - endScale = xscale(endTime) - rowW - parseInt(scalePadding); - - if (parseInt(xscale(endTime)) > (rowW - parseInt(scalePadding))) { - d3.select('.timeline__canvas') - .call( - d3.behavior.zoom() - .scaleExtent([1, 1]) - .x(xscale) - .on('zoom', function () { - - var t = d3.event.translate; - var tx = t[0]; - - tx = tx > 0 ? 0 : tx; - - tx = tx < endScale ? endScale : tx; - - d3.select('.timeline__parts').attr('transform', 'translate( ' + tx + ' , 0)'); - })); - } - - } - } - }; - -})(jQuery, Drupal, drupalSettings, d3); diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Access/AccessManagerWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Access/AccessManagerWrapper.php deleted file mode 100644 index 5de834f7a..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Access/AccessManagerWrapper.php +++ /dev/null @@ -1,83 +0,0 @@ -currentUser; - } - $route = $route_match->getRouteObject(); - $checks = $route->getOption('_access_checks') ?: array(); - - // Filter out checks which require the incoming request. - if (!isset($request)) { - $checks = array_diff($checks, $this->checkProvider->getChecksNeedRequest()); - } - - $result = AccessResult::neutral(); - if (!empty($checks)) { - $arguments_resolver = $this->argumentsResolverFactory->getArgumentsResolver($route_match, $account, $request); - - if (!$checks) { - return AccessResult::neutral(); - } - $result = AccessResult::allowed(); - foreach ($checks as $service_id) { - $result = $result->andIf($this->performCheck($service_id, $arguments_resolver, $request)); - } - } - return $return_as_object ? $result : $result->isAllowed(); - } - - /** - * {@inheritdoc} - */ - protected function performCheck($service_id, ArgumentsResolverInterface $arguments_resolver, Request $request = NULL) { - $callable = $this->checkProvider->loadCheck($service_id); - $arguments = $arguments_resolver->getArguments($callable); - /** @var \Drupal\Core\Access\AccessResultInterface $service_access **/ - $service_access = call_user_func_array($callable, $arguments); - - if (!$service_access instanceof AccessResultInterface) { - throw new AccessException("Access error in $service_id. Access services must return an object that implements AccessResultInterface."); - } - - if($request) { - $this->dataCollector->addAccessCheck($service_id, $callable, $request); - } - - return $service_access; - } - - /** - * @param \Drupal\webprofiler\DataCollector\RequestDataCollector $dataCollector - */ - public function setDataCollector(RequestDataCollector $dataCollector) { - $this->dataCollector = $dataCollector; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/CssCollectionRendererWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/CssCollectionRendererWrapper.php deleted file mode 100644 index cf13ac688..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/CssCollectionRendererWrapper.php +++ /dev/null @@ -1,40 +0,0 @@ -assetCollectionRenderer = $assetCollectionRenderer; - $this->dataCollector = $dataCollector; - } - - /** - * {@inheritdoc} - */ - public function render(array $css_assets) { - $this->dataCollector->addCssAsset($css_assets); - - return $this->assetCollectionRenderer->render($css_assets); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/JsCollectionRendererWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/JsCollectionRendererWrapper.php deleted file mode 100644 index dd7596a67..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Asset/JsCollectionRendererWrapper.php +++ /dev/null @@ -1,40 +0,0 @@ -assetCollectionRenderer = $assetCollectionRenderer; - $this->dataCollector = $dataCollector; - } - - /** - * {@inheritdoc} - */ - public function render(array $js_assets) { - $this->dataCollector->addJsAsset($js_assets); - - return $this->assetCollectionRenderer->render($js_assets); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheBackendWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheBackendWrapper.php deleted file mode 100644 index 4050b4103..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheBackendWrapper.php +++ /dev/null @@ -1,176 +0,0 @@ -cacheDataCollector = $cacheDataCollector; - $this->cacheBackend = $cacheBackend; - $this->bin = $bin; - } - - /** - * {@inheritdoc} - */ - public function get($cid, $allow_invalid = FALSE) { - $cache = $this->cacheBackend->get($cid, $allow_invalid); - - if ($cache) { - $cacheCopy = new \stdClass(); - $cacheCopy->cid = $cache->cid; - $cacheCopy->expire = $cache->expire; - $cacheCopy->tags = $cache->tags; - - $this->cacheDataCollector->registerCacheHit($this->bin, $cacheCopy); - } - else { - $this->cacheDataCollector->registerCacheMiss($this->bin, $cid); - } - - return $cache; - } - - /** - * {@inheritdoc} - */ - public function getMultiple(&$cids, $allow_invalid = FALSE) { - $cidsCopy = $cids; - $cache = $this->cacheBackend->getMultiple($cids, $allow_invalid); - - foreach ($cidsCopy as $cid) { - if (in_array($cid, $cids)) { - $this->cacheDataCollector->registerCacheMiss($this->bin, $cid); - } - else { - $cacheCopy = new \stdClass(); - $cacheCopy->cid = $cache[$cid]->cid; - $cacheCopy->expire = $cache[$cid]->expire; - $cacheCopy->tags = $cache[$cid]->tags; - - $this->cacheDataCollector->registerCacheHit($this->bin, $cacheCopy); - } - } - - return $cache; - } - - /** - * {@inheritdoc} - */ - public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) { - return $this->cacheBackend->set($cid, $data, $expire, $tags); - } - - /** - * {@inheritdoc} - */ - public function setMultiple(array $items) { - return $this->cacheBackend->setMultiple($items); - } - - /** - * {@inheritdoc} - */ - public function delete($cid) { - return $this->cacheBackend->delete($cid); - } - - /** - * {@inheritdoc} - */ - public function deleteMultiple(array $cids) { - return $this->cacheBackend->deleteMultiple($cids); - } - - /** - * {@inheritdoc} - */ - public function deleteAll() { - return $this->cacheBackend->deleteAll(); - } - - /** - * {@inheritdoc} - */ - public function invalidate($cid) { - return $this->cacheBackend->invalidate($cid); - } - - /** - * {@inheritdoc} - */ - public function invalidateMultiple(array $cids) { - return $this->cacheBackend->invalidateMultiple($cids); - } - - /** - * {@inheritdoc} - */ - public function invalidateTags(array $tags) { - if ($this->cacheBackend instanceof CacheTagsInvalidatorInterface) { - $this->cacheBackend->invalidateTags($tags); - } - } - - /** - * {@inheritdoc} - */ - public function invalidateAll() { - return $this->cacheBackend->invalidateAll(); - } - - /** - * {@inheritdoc} - */ - public function garbageCollection() { - return $this->cacheBackend->garbageCollection(); - } - - /** - * {@inheritdoc} - */ - public function removeBin() { - return $this->cacheBackend->removeBin(); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheFactoryWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheFactoryWrapper.php deleted file mode 100644 index d37e8941b..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Cache/CacheFactoryWrapper.php +++ /dev/null @@ -1,62 +0,0 @@ -cacheFactory = $cache_factory; - $this->cacheDataCollector = $cacheDataCollector; - } - - /** - * {@inheritdoc} - */ - public function get($bin) { - if (!isset($this->cacheBackends[$bin])) { - $cache_backend = $this->cacheFactory->get($bin); - $this->cacheBackends[$bin] = new CacheBackendWrapper($this->cacheDataCollector, $cache_backend, $bin); - } - return $this->cacheBackends[$bin]; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkCommand.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkCommand.php deleted file mode 100644 index c33905b8b..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkCommand.php +++ /dev/null @@ -1,311 +0,0 @@ -setName('webprofiler:benchmark') - ->setDescription($this->trans('commands.webprofiler.benchmark.description')) - ->addArgument('url', InputArgument::REQUIRED, $this->trans('commands.webprofiler.benchmark.arguments.url')) - ->addOption('runs', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.benchmark.options.runs'), 100) - ->addOption('file', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.benchmark.options.file')) - ->addOption('cache-rebuild', 'cr', InputOption::VALUE_NONE, $this->trans('commands.webprofiler.benchmark.options.cache_rebuild')); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - $runs = $input->getOption('runs'); - $file = $input->getOption('file'); - $cache_rebuild = $input->getOption('cache-rebuild'); - - // http://username:password@hostname/ - $url = $input->getArgument('url'); - $url_components = parse_url($url); - $login = isset($url_components['user']) && isset($url_components['pass']); - - $steps = 3; - - if ($cache_rebuild) { - $steps++; - } - - if ($login) { - $steps++; - } - - /** @var \Drupal\Core\Http\Client $client */ - $client = $this->container->get('http_client'); - - $progress = new ProgressBar($output, $runs + $steps); - $progress->setFormat(' %current%/%max% [%bar%] %percent:3s%% %message%'); - - if ($cache_rebuild) { - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.cache_rebuild')); - $this->RebuildCache(); - $progress->advance(); - } - - if ($login) { - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.login')); - $login_url = "{$url_components['scheme']}://{$url_components['host']}/user/login"; - - // Enable cookies storage. - $cookieJar = new CookieJar(); - $client->setDefaultOption('cookies', $cookieJar); - - // Retrieve a form_build_id using the DomCrawler component. - $response = $client->get($login_url)->getBody()->getContents(); - $crawler = new Crawler($response); - $form_build_id = $crawler->filter('#user-login-form input[name=form_build_id]') - ->attr('value'); - $op = $crawler->filter('#user-login-form input[name=op]')->attr('value'); - - // Login a user. - $response = $client->post($login_url, [ - 'body' => [ - 'name' => $url_components['user'], - 'pass' => $url_components['pass'], - 'form_build_id' => $form_build_id, - 'form_id' => 'user_login_form', - 'op' => $op, - ] - ]); - $progress->advance(); - - if ($response->getStatusCode() != 200) { - throw new \Exception($this->trans('commands.webprofiler.benchmark.messages.error_login')); - } - } - - $datas = []; - for ($i = 0; $i < $runs; $i++) { - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.get')); - $datas[] = $this->getData($client, $url); - $progress->advance(); - } - - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.compute_avg')); - $avg = $this->computeAvg($datas); - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.compute_median')); - $median = $this->computePercentile($datas, 50); - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.compute_95percentile')); - $percentile95 = $this->computePercentile($datas, 95); - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.git_hash')); - $gitHash = $this->getGitHash(); - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.yaml')); - $yaml = $this->generateYaml($gitHash, $runs, $url, $avg, $median, $percentile95); - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.benchmark.progress.done')); - $progress->finish(); - $output->writeln(''); - - if ($file) { - file_put_contents($file, $yaml); - } - else { - $output->writeln($yaml); - } - - } - - /** - * @param \GuzzleHttp\ClientInterface $client - * @param $url - * - * @return array - */ - private function getData(ClientInterface $client, $url) { - /** @var \GuzzleHttp\Message\ResponseInterface $response */ - $response = $client->get($url); - - $token = $response->getHeader('X-Debug-Token'); - - /** @var \Drupal\webprofiler\Profiler\Profiler $profiler */ - $profiler = $this->container->get('profiler'); - - /** @var \Symfony\Component\HttpKernel\Profiler\Profile $profile */ - $profile = $profiler->loadProfile($token); - - /** @var \Drupal\webprofiler\DataCollector\TimeDataCollector $timeDataCollector */ - $timeDataCollector = $profile->getCollector('time'); - - return new BenchmarkData( - $token, - $timeDataCollector->getMemory(), - $timeDataCollector->getDuration()); - } - - /** - * @param \Drupal\webprofiler\Command\BenchmarkData[] $datas - * - * @return \Drupal\webprofiler\Command\BenchmarkData - */ - private function computeAvg($datas) { - $profiles = count($datas); - $totalTime = 0; - $totalMemory = 0; - - foreach ($datas as $data) { - $totalTime += $data->getTime(); - $totalMemory += $data->getMemory(); - } - - return new BenchmarkData(NULL, $totalMemory / $profiles, $totalTime / $profiles); - } - - /** - * Computes percentile using The Nearest Rank method. - * - * @param \Drupal\webprofiler\Command\BenchmarkData[] $datas - * @param $percentile - * - * @return \Drupal\webprofiler\Command\BenchmarkData - * - * @throws \Exception - */ - private function computePercentile($datas, $percentile) { - if ($percentile < 0 || $percentile > 100) { - throw new \Exception('Percentile has to be between 0 and 100'); - } - - $profiles = count($datas); - - $n = ceil((($percentile / 100) * $profiles)); - $index = (int) $n - 1; - - $orderedTime = $datas; - $this->getOrderedDatas($orderedTime, 'Time'); - - $orderedMemory = $datas; - $this->getOrderedDatas($orderedMemory, 'Memory'); - - return new BenchmarkData(NULL, $orderedMemory[$index]->getMemory(), $orderedTime[$index]->getTime()); - } - - /** - * @return string - */ - private function getGitHash() { - try { - $process = new Process('git rev-parse HEAD'); - $process->setTimeout(3600); - $process->run(); - $git_hash = $process->getOutput(); - } catch (\Exception $e) { - $git_hash = $this->trans('commands.webprofiler.benchmark.messages.not_git'); - } - - return $git_hash; - } - - /** - * @param \Drupal\webprofiler\Command\BenchmarkData[] $datas - * @param $string - * - * @return array - */ - private function getOrderedDatas(&$datas, $string) { - usort($datas, function ($a, $b) use ($string) { - $method = 'get' . $string; - if ($a->{$method} > $b->{$method}) { - return 1; - } - if ($a->{$method} < $b->{$method}) { - return -1; - } - return 0; - }); - } - - /** - * Rebuilds Drupal cache. - */ - protected function RebuildCache() { - require_once DRUPAL_ROOT . '/core/includes/utility.inc'; - $kernelHelper = $this->getHelper('kernel'); - $classLoader = $kernelHelper->getClassLoader(); - $request = $kernelHelper->getRequest(); - drupal_rebuild($classLoader, $request); - } - - /** - * @param $gitHash - * @param $runs - * @param $url - * @param \Drupal\webprofiler\Command\BenchmarkData $avg - * @param \Drupal\webprofiler\Command\BenchmarkData $median - * @param \Drupal\webprofiler\Command\BenchmarkData $percentile95 - * - * @return string - */ - private function generateYaml($gitHash, $runs, $url, BenchmarkData $avg, BenchmarkData $median, BenchmarkData $percentile95) { - $yaml = Yaml::dump([ - 'date' => date($this->trans('commands.webprofiler.list.rows.time'), time()), - 'git_commit' => $gitHash, - 'number_of_runs' => $runs, - 'url' => $url, - 'results' => [ - 'average' => [ - 'time' => sprintf('%.0f ms', $avg->getTime()), - 'memory' => sprintf('%.1f MB', $avg->getMemory() / 1024 / 1024), - ], - 'median' => [ - 'time' => sprintf('%.0f ms', $median->getTime()), - 'memory' => sprintf('%.1f MB', $median->getMemory() / 1024 / 1024), - ], - '95_percentile' => [ - 'time' => sprintf('%.0f ms', $percentile95->getTime()), - 'memory' => sprintf('%.1f MB', $percentile95->getMemory() / 1024 / 1024), - ], - ], - ]); - return $yaml; - } - - /** - * {@inheritdoc} - */ - public function showMessage($output, $message, $type = 'info') { - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkData.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkData.php deleted file mode 100644 index e587c90ed..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/BenchmarkData.php +++ /dev/null @@ -1,57 +0,0 @@ -token = $token; - $this->memory = $memory; - $this->time = $time; - } - - /** - * @return mixed - */ - public function getToken() { - return $this->token; - } - - /** - * @return mixed - */ - public function getMemory() { - return $this->memory; - } - - /** - * @return mixed - */ - public function getTime() { - return $this->time; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ExportCommand.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ExportCommand.php deleted file mode 100644 index 20c1e4164..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ExportCommand.php +++ /dev/null @@ -1,160 +0,0 @@ -setName('webprofiler:export') - ->setDescription($this->trans('commands.webprofiler.export.description')) - ->addArgument('id', InputArgument::OPTIONAL, $this->trans('commands.webprofiler.export.arguments.id')) - ->addOption('directory', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.export.options.directory'), '/tmp'); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - $id = $input->getArgument('id'); - $directory = $input->getOption('directory'); - - /** @var \Drupal\webprofiler\Profiler\Profiler $profiler */ - $profiler = $this->container->get('profiler'); - - try { - if ($id) { - $this->filename = $this->exportSingle($profiler, $id, $directory); - } - else { - $this->filename = $this->exportAll($profiler, $directory, $output); - } - - } catch (\Exception $e) { - $output->writeln('' . $e->getMessage() . ''); - } - } - - /** - * Exports a single profile. - * - * @param \Drupal\webprofiler\Profiler\Profiler $profiler - * @param int $id - * @param string $directory - * - * @return string - * - * @throws \Exception - */ - private function exportSingle(Profiler $profiler, $id, $directory) { - $profile = $profiler->loadProfile($id); - if ($profile) { - $data = $profiler->export($profile); - - $filename = $directory . DIRECTORY_SEPARATOR . $id . '.txt'; - if (file_put_contents($filename, $data) === FALSE) { - throw new \Exception(sprintf( - $this->trans('commands.webprofiler.export.messages.error_writing'), - $filename)); - } - } - else { - throw new \Exception(sprintf( - $this->trans('commands.webprofiler.export.messages.error_no_profile'), - $id)); - } - - return $filename; - } - - /** - * Exports all stored profiles (cap limit at 1000 items). - * - * @param \Drupal\webprofiler\Profiler\Profiler $profiler - * @param string $directory - * @param \Symfony\Component\Console\Output\OutputInterface $output - * - * @return string - */ - private function exportAll(Profiler $profiler, $directory, $output) { - $filename = $directory . DIRECTORY_SEPARATOR . 'profiles_' . time() . '.tar.gz'; - $archiver = new ArchiveTar($filename, 'gz'); - $profiles = $profiler->find(NULL, NULL, 1000, NULL, '', ''); - $progress = new ProgressBar($output, count($profiles) + 2); - $progress->setFormat(' %current%/%max% [%bar%] %percent:3s%% %message%'); - - $files = []; - $progress->start(); - $progress->setMessage($this->trans('commands.webprofiler.export.progress.exporting')); - foreach ($profiles as $profile) { - $data = $profiler->export($profiler->loadProfile($profile['token'])); - $profileFilename = $directory . "/{$profile['token']}.txt"; - file_put_contents($profileFilename, $data); - $files[] = $profileFilename; - $progress->advance(); - } - - $progress->setMessage($this->trans('commands.webprofiler.export.progress.archive')); - $archiver->createModify($files, '', $directory); - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.export.progress.delete_tmp')); - foreach ($files as $file) { - unlink($file); - } - $progress->advance(); - - $progress->setMessage($this->trans('commands.webprofiler.export.progress.done')); - $progress->finish(); - $output->writeln(''); - - $output->writeln(sprintf( - $this->trans('commands.webprofiler.export.messages.exported_count'), - count($profiles))); - - return $filename; - } - - /** - * {@inheritdoc} - */ - public function showMessage($output, $message, $type = 'info') { - if (!$this->filename) { - return; - } - - $completeMessageKey = 'commands.webprofiler.export.messages.success'; - $completeMessage = sprintf($this->trans($completeMessageKey), $this->filename); - - if ($completeMessage != $completeMessageKey) { - parent::showMessage($output, $completeMessage); - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ListCommand.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ListCommand.php deleted file mode 100644 index 29f4d8fe7..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Command/ListCommand.php +++ /dev/null @@ -1,82 +0,0 @@ -setName('webprofiler:list') - ->setDescription($this->trans('commands.webprofiler.list.description')) - ->addOption('ip', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.list.options.ip'), NULL) - ->addOption('url', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.list.options.url'), NULL) - ->addOption('method', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.list.options.method'), NULL) - ->addOption('limit', NULL, InputOption::VALUE_REQUIRED, $this->trans('commands.webprofiler.list.options.limit'), 10); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) { - $ip = $input->getOption('ip'); - $url = $input->getOption('url'); - $method = $input->getOption('method'); - $limit = $input->getOption('limit'); - - /** @var \Drupal\webprofiler\Profiler\Profiler $profiler */ - $profiler = $this->container->get('profiler'); - $profiles = $profiler->find($ip, $url, $limit, $method, '', ''); - - $rows = []; - foreach ($profiles as $profile) { - $row = []; - - $row[] = $profile['token']; - $row[] = $profile['ip']; - $row[] = $profile['method']; - $row[] = $profile['url']; - $row[] = date($this->trans('commands.webprofiler.list.rows.time'), $profile['time']); - - $rows[] = $row; - } - - $table = new Table($output); - $table - ->setHeaders([ - $this->trans('commands.webprofiler.list.header.token'), - $this->trans('commands.webprofiler.list.header.ip'), - $this->trans('commands.webprofiler.list.header.method'), - $this->trans('commands.webprofiler.list.header.url'), - $this->trans('commands.webprofiler.list.header.time'), - ]) - ->setRows($rows); - $table->render(); - } - - /** - * {@inheritdoc} - */ - public function showMessage($output, $message, $type = 'info') { - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/DecoratorPass.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/DecoratorPass.php deleted file mode 100644 index e460b2200..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/DecoratorPass.php +++ /dev/null @@ -1,33 +0,0 @@ -findDefinition('plugin.manager.mail'); - $definition->setPublic(FALSE); - $container->setDefinition('webprofiler.debug.plugin.manager.mail.default', $definition); - $container->register('plugin.manager.mail', 'Drupal\webprofiler\Mail\MailManagerWrapper') - ->addArgument(new Reference('container.namespaces')) - ->addArgument(new Reference('cache.discovery')) - ->addArgument(new Reference('module_handler')) - ->addArgument(new Reference('config.factory')) - ->addArgument(new Reference('logger.factory')) - ->addArgument(new Reference('string_translation')) - ->addArgument(new Reference('webprofiler.debug.plugin.manager.mail.default')) - ->addArgument(new Reference('webprofiler.mail')) - ->setProperty('_serviceId', 'plugin.manager.mail'); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ProfilerPass.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ProfilerPass.php deleted file mode 100644 index 10b8d24e7..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ProfilerPass.php +++ /dev/null @@ -1,64 +0,0 @@ -hasDefinition('profiler')) { - return; - } - - $definition = $container->getDefinition('profiler'); - - $collectors = new \SplPriorityQueue(); - $order = PHP_INT_MAX; - foreach ($container->findTaggedServiceIds('data_collector') as $id => $attributes) { - $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; - $template = NULL; - - if (isset($attributes[0]['template'])) { - if (!isset($attributes[0]['id'])) { - throw new \InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template', $id)); - } - if (!isset($attributes[0]['title'])) { - throw new \InvalidArgumentException(sprintf('Data collector service "%s" must have a title attribute', $id)); - } - - $template = [ - $attributes[0]['id'], - $attributes[0]['template'], - $attributes[0]['title'] - ]; - } - - $collectors->insert([$id, $template], [-$priority, --$order]); - } - - $templates = []; - foreach ($collectors as $collector) { - $definition->addMethodCall('add', [new Reference($collector[0])]); - $templates[$collector[0]] = $collector[1]; - } - - $container->setParameter('data_collector.templates', $templates); - - // set parameter to store the public folder path - $path = 'file:' . DRUPAL_ROOT . '/' . PublicStream::basePath() . '/profiler'; - $container->setParameter('data_collector.storage', $path); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ServicePass.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ServicePass.php deleted file mode 100644 index 4928418c6..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/ServicePass.php +++ /dev/null @@ -1,108 +0,0 @@ -hasDefinition('webprofiler.services')) { - return; - } - - $definition = $container->getDefinition('webprofiler.services'); - $graph = $container->getCompiler()->getServiceReferenceGraph(); - - $definition->addMethodCall('setServices', [$this->extractData($container, $graph)]); - } - - /** - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - * @param \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph $graph - * - * @return array - */ - private function extractData(ContainerBuilder $container, ServiceReferenceGraph $graph) { - $data = []; - - foreach ($container->getDefinitions() as $id => $definition) { - $inEdges = []; - $outEdges = []; - - if ($graph->hasNode($id)) { - $node = $graph->getNode($id); - - /** @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge $edge */ - foreach ($node->getInEdges() as $edge) { - /** @var \Symfony\Component\DependencyInjection\Reference $edgeValue */ - $edgeValue = $edge->getValue(); - - $inEdges[] = [ - 'id' => $edge->getSourceNode()->getId(), - 'invalidBehavior' => $edgeValue ? $edgeValue->getInvalidBehavior() : NULL, - ]; - } - - - /** @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge $edge */ - foreach ($node->getOutEdges() as $edge) { - /** @var \Symfony\Component\DependencyInjection\Reference $edgeValue */ - $edgeValue = $edge->getValue(); - - $outEdges[] = [ - 'id' => $edge->getDestNode()->getId(), - 'invalidBehavior' => $edgeValue ? $edgeValue->getInvalidBehavior() : NULL, - ]; - } - } - - if ($definition instanceof Definition) { - $class = $definition->getClass(); - - try { - $reflectedClass = new \ReflectionClass($class); - $file = $reflectedClass->getFileName(); - } catch (\ReflectionException $e) { - $file = NULL; - } - - $tags = $definition->getTags(); - $public = $definition->isPublic(); - $synthetic = $definition->isSynthetic(); - } - else { - $id = $definition->__toString(); - $class = NULL; - $file = NULL; - $tags = []; - $public = NULL; - $synthetic = NULL; - } - - $data[$id] = [ - 'inEdges' => $inEdges, - 'outEdges' => $outEdges, - 'value' => [ - 'class' => $class, - 'file' => $file, - 'id' => $id, - 'tags' => $tags, - 'public' => $public, - 'synthetic' => $synthetic, - ], - ]; - } - - return $data; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/StoragePass.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/StoragePass.php deleted file mode 100644 index 8b26e63f4..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Compiler/StoragePass.php +++ /dev/null @@ -1,32 +0,0 @@ -hasDefinition('profiler.storage_manager')) { - return; - } - - $definition = $container->getDefinition('profiler.storage_manager'); - - foreach ($container->findTaggedServiceIds('webprofiler_storage') as $id => $attributes) { - $definition->addMethodCall('addStorage', [ - $id, - $attributes[0]['title'], - new Reference($id) - ]); - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Config/ConfigFactoryWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Config/ConfigFactoryWrapper.php deleted file mode 100644 index 1f4b75eb6..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Config/ConfigFactoryWrapper.php +++ /dev/null @@ -1,44 +0,0 @@ -dataCollector->addConfigName($name); - return $result; - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $names) { - $result = parent::loadMultiple($names); - foreach (array_keys($result) as $name) { - $this->dataCollector->addConfigName($name); - } - return $result; - } - - /** - * @param \Drupal\webprofiler\DataCollector\ConfigDataCollector $dataCollector - */ - public function setDataCollector(ConfigDataCollector $dataCollector) { - $this->dataCollector = $dataCollector; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DashboardController.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DashboardController.php deleted file mode 100644 index 2b1d93ef1..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DashboardController.php +++ /dev/null @@ -1,243 +0,0 @@ -get('profiler'), - $container->get('router'), - $container->get('template_manager'), - $container->get('date.formatter'), - $container->get('profiler.storage_manager') - ); - } - - /** - * Constructs a new WebprofilerController. - * - * @param \Drupal\webprofiler\Profiler\Profiler $profiler - * @param \Symfony\Component\Routing\RouterInterface $router - * @param \Drupal\webprofiler\Profiler\TemplateManager $templateManager - * @param \Drupal\Core\Datetime\DateFormatter $date - * @param \Drupal\webprofiler\Profiler\ProfilerStorageManager $storageManager - */ - public function __construct(Profiler $profiler, RouterInterface $router, TemplateManager $templateManager, DateFormatter $date, ProfilerStorageManager $storageManager) { - $this->profiler = $profiler; - $this->router = $router; - $this->templateManager = $templateManager; - $this->date = $date; - $this->storageManager = $storageManager; - } - - /** - * Generates the dashboard page. - * - * @param Profile $profile - * - * @return array - */ - public function dashboardAction(Profile $profile) { - $this->profiler->disable(); - - $templateManager = $this->templateManager; - $templates = $templateManager->getTemplates($profile); - - $panels = []; - $libraries = ['webprofiler/dashboard']; - $drupalSettings = [ - 'webprofiler' => [ - 'token' => $profile->getToken(), - 'ide_link' => $this->config('webprofiler.config')->get('ide_link'), - 'ide_link_remote' => $this->config('webprofiler.config')->get('ide_link_remote'), - 'ide_link_local' => $this->config('webprofiler.config')->get('ide_link_local'), - 'collectors' => [], - ], - ]; - - foreach ($templates as $name => $template) { - /** @var DrupalDataCollectorInterface $collector */ - $collector = $profile->getCollector($name); - - if ($collector->hasPanel()) { - $rendered = $template->renderBlock('panel', [ - 'token' => $profile->getToken(), - 'name' => $name, - ]); - - $panels[] = [ - '#theme' => 'webprofiler_panel', - '#panel' => $rendered, - ]; - - $drupalSettings['webprofiler']['collectors'][] = [ - 'id' => $name, - 'name' => $name, - 'label' => $collector->getTitle(), - 'summary' => $collector->getPanelSummary(), - 'icon' => $collector->getIcon(), - ]; - - $libraries = array_merge($libraries, $collector->getLibraries()); - $drupalSettings['webprofiler'] += $collector->getDrupalSettings(); - } - } - - $build = []; - $build['panels'] = [ - '#theme' => 'webprofiler_dashboard', - '#profile' => $profile, - '#panels' => $panels, - '#spinner_path' => '/' . $this->moduleHandler() - ->getModule('webprofiler') - ->getPath() . '/images/searching.gif', - '#attached' => [ - 'drupalSettings' => $drupalSettings, - 'library' => $libraries, - ], - ]; - - return $build; - } - - /** - * Generates the list page. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * - * @return array - */ - public function listAction(Request $request) { - $limit = $request->get('limit', 10); - $this->profiler->disable(); - - $ip = $request->query->get('ip'); - $method = $request->query->get('method'); - $url = $request->query->get('url'); - - $profiles = $this->profiler->find($ip, $url, $limit, $method, '', ''); - - $rows = []; - if (count($profiles)) { - foreach ($profiles as $profile) { - $row = []; - $row[] = $this->l($profile['token'], new Url('webprofiler.dashboard', ['profile' => $profile['token']])); - $row[] = $profile['ip']; - $row[] = $profile['method']; - $row[] = $profile['url']; - $row[] = $this->date->format($profile['time']); - - $rows[] = $row; - } - } - else { - $rows[] = [ - [ - 'data' => $this->t('No profiles found'), - 'colspan' => 6, - ], - ]; - } - - $build = []; - - $storage_id = $this->config('webprofiler.config')->get('storage'); - $storage = $this->storageManager->getStorage($storage_id); - - $build['resume'] = [ - '#type' => 'inline_template', - '#template' => '

        {{ message }}

        ', - '#context' => [ - 'message' => $this->t('Profiles stored with %storage service.', ['%storage' => $storage['title']]), - ], - ]; - - $build['filters'] = $this->formBuilder() - ->getForm('Drupal\\webprofiler\\Form\\ProfilesFilterForm'); - - $build['table'] = [ - '#type' => 'table', - '#rows' => $rows, - '#header' => [ - $this->t('Token'), - [ - 'data' => $this->t('Ip'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - [ - 'data' => $this->t('Method'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - $this->t('Url'), - [ - 'data' => $this->t('Time'), - 'class' => [RESPONSIVE_PRIORITY_MEDIUM], - ], - ], - '#sticky' => TRUE, - ]; - - return $build; - } - - /** - * Exposes collector's data as JSON. - * - * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile - * @param $collector - * - * @return \Symfony\Component\HttpFoundation\JsonResponse - */ - public function restCollectorAction(Profile $profile, $collector) { - $this->profiler->disable(); - - $data = $profile->getCollector($collector)->getData(); - - return new JsonResponse(['data' => $data]); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DatabaseController.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DatabaseController.php deleted file mode 100644 index f6a5b95e3..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/DatabaseController.php +++ /dev/null @@ -1,95 +0,0 @@ -get('profiler'), - $container->get('database') - ); - } - - /** - * Constructs a new WebprofilerController. - * - * @param \Symfony\Component\HttpKernel\Profiler\Profiler $profiler - * @param \Drupal\Core\Database\Connection $database - */ - public function __construct(Profiler $profiler, Connection $database) { - $this->profiler = $profiler; - $this->database = $database; - } - - /** - * @param Profile $profile - * @param int $qid - * - * @return JsonResponse - */ - public function explainAction(Profile $profile, $qid) { - $query = $this->getQuery($profile, $qid); - - $data = []; - $result = $this->database->query('EXPLAIN ' . $query['query'], (array) $query['args']) - ->fetchAllAssoc('table'); - $i = 1; - foreach ($result as $row) { - foreach ($row as $key => $value) { - $data[$i][$key] = $value; - } - $i++; - } - - return new JsonResponse(['data' => $data]); - } - - /** - * @param $profile ->getToken() - * @param int $qid - * - * @return array - */ - private function getQuery(Profile $profile, $qid) { - $this->profiler->disable(); - $token = $profile->getToken(); - - if (!$profile = $this->profiler->loadProfile($token)) { - throw new NotFoundHttpException($this->t('Token @token does not exist.', ['@token' => $token])); - } - - /** @var DatabaseDataCollector $databaseCollector */ - $databaseCollector = $profile->getCollector('database'); - - $queries = $databaseCollector->getQueries(); - $query = $queries[$qid]; - - return $query; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/ToolbarController.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/ToolbarController.php deleted file mode 100644 index b79a18278..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Controller/ToolbarController.php +++ /dev/null @@ -1,110 +0,0 @@ -get('profiler'), - $container->get('template_manager'), - $container->get('renderer') - ); - } - - /** - * Constructs a new WebprofilerController. - * - * @param \Drupal\webprofiler\Profiler\Profiler $profiler - * @param \Drupal\webprofiler\Profiler\TemplateManager $templateManager - * @param \Drupal\Core\Render\RendererInterface $renderer - */ - public function __construct(Profiler $profiler, TemplateManager $templateManager, RendererInterface $renderer) { - $this->profiler = $profiler; - $this->templateManager = $templateManager; - $this->renderer = $renderer; - } - - /** - * Generates the toolbar. - * - * @param Profile $profile - * - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Exception - */ - public function toolbarAction(Profile $profile) { - $this->profiler->disable(); - - $templates = $this->templateManager->getTemplates($profile); - - $rendered = ''; - foreach ($templates as $name => $template) { - $rendered .= $template->renderBlock('toolbar', [ - 'collector' => $profile->getcollector($name), - 'token' => $profile->getToken(), - 'name' => $name - ]); - } - - $toolbar = [ - '#theme' => 'webprofiler_toolbar', - '#toolbar' => $rendered, - '#token' => $profile->getToken(), - ]; - - return new Response($this->renderer->render($toolbar)); - } - - /** - * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile - * @param \Symfony\Component\HttpFoundation\Request $request - * - * @return \Symfony\Component\HttpFoundation\JsonResponse - */ - public function savePerformanceTimingAction(Profile $profile, Request $request) { - $this->profiler->disable(); - - $data = Json::decode($request->getContent()); - - /** @var $collector */ - $collector = $profile->getCollector('performance_timing'); - $collector->setData($data); - $this->profiler->updateProfile($profile); - - return new JsonResponse(['success' => TRUE]); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/AssetsDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/AssetsDataCollector.php deleted file mode 100644 index 7eabac8ff..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/AssetsDataCollector.php +++ /dev/null @@ -1,107 +0,0 @@ -root = $root; - - $this->data['js'] = []; - $this->data['css'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data['assets']['installation_path'] = $this->root . '/'; - } - - /** - * @param $jsAsset - */ - public function addJsAsset($jsAsset) { - $this->data['js'] = NestedArray::mergeDeepArray([ - $jsAsset, - $this->data['js'] - ]); - } - - /** - * @param $cssAsset - */ - public function addCssAsset($cssAsset) { - $this->data['css'] = NestedArray::mergeDeepArray([ - $cssAsset, - $this->data['css'] - ]); - } - - /** - * Twig callback to return the amount of CSS files. - */ - public function getCssCount() { - return count($this->data['css']); - } - - /** - * Twig callback to return the amount of JS files. - */ - public function getJsCount() { - return count($this->data['js']) - 1; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'assets'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Assets'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Total: @count', ['@count' => ($this->getCssCount() + $this->getJsCount())]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxQUE0NEI2NTlCQTkxMUUzQkFDRjg2NUVCQ0NFNTcwQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxQUE0NEI2NjlCQTkxMUUzQkFDRjg2NUVCQ0NFNTcwQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFBQTQ0QjYzOUJBOTExRTNCQUNGODY1RUJDQ0U1NzBCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFBQTQ0QjY0OUJBOTExRTNCQUNGODY1RUJDQ0U1NzBCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+C1mVdgAAAktJREFUeNrUlk+I6VEUx48/4SVKpkgiCywkK8ksWVhYSFm9hYXFqxfbt2KnLJS9hbKQhZXtFMVmUrKYkZmslPxLSvnvYZx37+2NTDPP03ss5tTpcu/xued77rm/Hw4iwqWNC1cwzv8CPlJ6lUypfSf+k256Ad8R/0HlL4l/uWCSL5zfO/xTLTkczrvx9aDwU7QUX61Ww/Pz88WAdrv9Oplyzz0UPp8PIpEIzrnWJ6EUJBAI2DgYDOD+/h7EYjFwuadz4X80SUFCoRB6vR6Mx2Mwm82QTqfh4eEBNBoN3NzcgFQqhdVqBbvd7s+ZUlkUJpFIoN1uQyQSAYvFAqlUiq2Xy2VwuVwQCoXAZrNBMpmE6XTK4nk83lsqOX0ki0h2xUajgYFAAJVKJRoMBoxGo9hqtXA4HCKNq1ar+Pj4iMFgEFUqFer1egyHw9jv93GxWDCOyWTCA5RaLBZjd9jhcGCz2cRXKxQKqNVqcTQaHeZKpRLqdDoWf3d3h6QMB+hB/nK5BL/fD4lEAsiPmUSfzwf1eh1qtRoYjUaQy+WQz+eBbAoej4fVN5PJgNVqZfV9J586lUBtMplgLpdDEoyktuj1ejEej7M1p9OJbrcbi8UirtdrNjebzQ6MN/KPfT6f436/Z3XudDp4e3uLlUqFQej37XbL5B7DjqEfthQBAgGzfpTJZJDNZpn0zWbDRgI/eQlOdjGFU1coFIfHGu3Lv90qbrfbXRFpJ4POAVGjh/r09PRCP38l3r3Q62RA/NtV3qb8T/Nn4irQXwIMANMNuV/Q8qbhAAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/BlocksDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/BlocksDataCollector.php deleted file mode 100644 index a6f2e7a84..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/BlocksDataCollector.php +++ /dev/null @@ -1,149 +0,0 @@ -entityManager = $entityManager; - - $this->data['blocks']['loaded'] = []; - $this->data['blocks']['rendered'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $storage = $this->entityManager->getStorage('block'); - - $loaded = $this->entityManager->getLoaded('config', 'block'); - $rendered = $this->entityManager->getRendered('block'); - - if ($loaded) { - $this->data['blocks']['loaded'] = $this->getBlocksData($loaded, $storage); - - } - - if ($rendered) { - $this->data['blocks']['rendered'] = $this->getBlocksData($rendered, $storage); - } - } - - /** - * @return array - */ - public function getRenderedBlocks() { - return $this->data['blocks']['rendered']; - } - - /** - * @return int - */ - public function getRenderedBlocksCount() { - return count($this->getRenderedBlocks()); - } - - /** - * @return array - */ - public function getLoadedBlocks() { - return $this->data['blocks']['loaded']; - } - - /** - * @return int - */ - public function getLoadedBlocksCount() { - return count($this->getLoadedBlocks()); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'blocks'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Blocks'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Loaded: @loaded, rendered: @rendered', [ - '@loaded' => $this->getLoadedBlocksCount(), - '@rendered' => $this->getRenderedBlocksCount() - ]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowNDgwMTE3NDA3MjA2ODExOEY2MkNCNjI0NDY3NzkwRCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowQjg5OTA4OEYwQTgxMUUzQkJDRThFQjA5Q0E1REFCRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowQjg5OTA4N0YwQTgxMUUzQkJDRThFQjA5Q0E1REFCRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgTWFjaW50b3NoIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDM4MDExNzQwNzIwNjgxMTg3MUZDQ0I0RjY1RTlEM0IiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDQ4MDExNzQwNzIwNjgxMThGNjJDQjYyNDQ2Nzc5MEQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz68h+kGAAAAWElEQVR42mL8//8/A7UBEwMNwAg3lAVEODg4UCW2Dhw4wDgapgyMtEj8eCMKFPCkyI1GFCJMiUnQVDUUX0SNllK4wxRf+JAdUeQUfaMRRd+ib4SHKUCAAQAMcyf8vLAstgAAAABJRU5ErkJggg=='; - } - - /** - * @param $decorator - * @param $storage - * - * @return array - */ - private function getBlocksData(EntityDecorator $decorator, EntityStorageInterface $storage) { - $blocks = []; - - /** @var \Drupal\block\BlockInterface $block */ - foreach ($decorator->getEntities() as $block) { - /** @var Block $entity */ - if (null !== $block && $entity = $storage->load($block->get('id'))) { - - $route = ''; - if ($entity->hasLinkTemplate('edit-form')) { - $route = $entity->toUrl('edit-form')->toString(); - } - - $id = $block->get('id'); - $blocks[$id] = [ - 'id' => $id, - 'region' => $block->getRegion(), - 'status' => $block->get('status'), - 'theme' => $block->getTheme(), - 'plugin' => $block->get('plugin'), - 'settings' => $block->get('settings'), - 'route' => $route, - ]; - } - } - - return $blocks; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/CacheDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/CacheDataCollector.php deleted file mode 100644 index 57371e879..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/CacheDataCollector.php +++ /dev/null @@ -1,172 +0,0 @@ -data['total'][CacheDataCollector::WEBPROFILER_CACHE_HIT] = 0; - $this->data['total'][CacheDataCollector::WEBPROFILER_CACHE_MISS] = 0; - $this->data['cache'] = []; - } - - /** - * Registers a cache get on a specific cache bin. - * - * @param $cache - */ - public function registerCacheHit($bin, $cache) { - $current = isset($this->data['cache'][$bin][$cache->cid]) ? $this->data['cache'][$bin][$cache->cid] : NULL; - - if (!$current) { - $current = $cache; - $current->{CacheDataCollector::WEBPROFILER_CACHE_HIT} = 0; - $current->{CacheDataCollector::WEBPROFILER_CACHE_MISS} = 0; - $this->data['cache'][$bin][$cache->cid] = $current; - } - - $current->{CacheDataCollector::WEBPROFILER_CACHE_HIT}++; - $this->data['total'][CacheDataCollector::WEBPROFILER_CACHE_HIT]++; - } - - /** - * Registers a cache get on a specific cache bin. - * - * @param $bin - * @param $cid - */ - public function registerCacheMiss($bin, $cid) { - $current = isset($this->data['cache'][$bin][$cid]) ? - $this->data['cache'][$bin][$cid] : NULL; - - if (!$current) { - $current = new \StdClass(); - $current->{CacheDataCollector::WEBPROFILER_CACHE_HIT} = 0; - $current->{CacheDataCollector::WEBPROFILER_CACHE_MISS} = 0; - $this->data['cache'][$bin][$cid] = $current; - } - - $current->{CacheDataCollector::WEBPROFILER_CACHE_MISS}++; - $this->data['total'][CacheDataCollector::WEBPROFILER_CACHE_MISS]++; - } - - /** - * Callback to return the total amount of requested cache CIDS. - * - * @param string $type - * - * @return int - */ - public function getCacheCidsCount($type) { - return $this->data['total'][$type]; - } - - /** - * Callback to return the total amount of hit cache CIDS. - * - * @return int - */ - public function getCacheHitsCount() { - return $this->getCacheCidsCount(CacheDataCollector::WEBPROFILER_CACHE_HIT); - } - - /** - * Callback to return the total amount of miss cache CIDS. - * - * @return int - */ - public function getCacheMissesCount() { - return $this->getCacheCidsCount(CacheDataCollector::WEBPROFILER_CACHE_MISS); - } - - /** - * Callback to return the total amount of hit cache CIDs keyed by bin. - * - * @param $type - * - * @return array - */ - public function cacheCids($type) { - $hits = []; - foreach ($this->data['cache'] as $bin => $caches) { - $hits[$bin] = 0; - foreach ($caches as $cid => $cache) { - $hits[$bin] += $cache->{$type}; - } - } - - return $hits; - } - - /** - * Callback to return hit cache CIDs keyed by bin. - * - * @return array - */ - public function getCacheHits() { - return $this->cacheCids(CacheDataCollector::WEBPROFILER_CACHE_HIT); - } - - /** - * Callback to return miss cache CIDs keyed by bin. - * - * @return array - */ - public function getCacheMisses() { - return $this->cacheCids(CacheDataCollector::WEBPROFILER_CACHE_MISS); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'cache'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Cache'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Hit: @cache_hit, miss: @cache_miss', [ - '@cache_hit' => $this->getCacheCidsCount(CacheDataCollector::WEBPROFILER_CACHE_HIT), - '@cache_miss' => $this->getCacheCidsCount(CacheDataCollector::WEBPROFILER_CACHE_MISS), - ]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAcCAYAAABh2p9gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2Njc3QTVEQTkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2Njc3QTVEQjkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRGQTVBQzYxOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRGQTVBQzYyOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+BsBwAAAAAJtJREFUeNpi/P//PwM1ARMDlcEIMdDBweEZjM0IihSgwEx8Gg4cOJCOrhGHOimqe5kF2QVYvDITl0vQvQwTo4oLkS1gQrPpPwiTEBkY6pnwKJ5JyOskJRvkcMUVxjgjhRhDsUUGSQZu3rwZb1j6+voyjhYOI9VAFmKTBTC3oMsTbyAx+RndAqxejo2NJdmL6HoYR6vRwWcgQIABAOn0PsqqgQzcAAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ConfigDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ConfigDataCollector.php deleted file mode 100644 index 21f11075d..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ConfigDataCollector.php +++ /dev/null @@ -1,68 +0,0 @@ -data['config_names'][$name] = isset($this->data['config_names'][$name]) ? $this->data['config_names'][$name] + 1 : 1; - } - - /** - * Callback to display the config names. - */ - public function getConfigNames() { - return $this->data['config_names']; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'config'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Config'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Total: @count', ['@count' => count($this->getConfigNames())]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2Njc3QTVFMjkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2Njc3QTVFMzkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjY2NzdBNUUwOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY2NzdBNUUxOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+f0Re8gAAA3RJREFUeNrsVk9ME1kY/82fTqfQf5ROW2gpuKCioHbdEDeBxITdxE08eOHkiQOr8cZhNx7k4MGDmpAQxTtHPBgPXjCbeLDE/XtglSUGGyhxgBYLdNpSOu3MPN+MwUSQP1HUZONv8st7897M9833fb837zGEEHwusPiM+P86AxjmEqVKSfaBGuWvlHgf6cUUb9+65WhsbPzo706n0/j5wgWddgOUK1vSKEnSvjgyEQwGQW1xtBv+4jXjc7kcBgcH981gJpPZ3tmnjoa7NgOSXwYK2U+bRu76y73XLBaLIRQKvXe8paVlZ0c35L2ncWho6K3B/v5+JBIJOJ3Ot+PmfV9fnzWvcyJWpeNQ/O0oH7oILhK7Q4cnKR9RjlEWrCVtF0Xy/alTW5z19PRgbGwMo6OjlmHToekolUpheHgYhYL1Pso2F+a+OQd/cwTftdlRH9QhujPGconJx5/VyRMvpD+IWrxCa5bmeJ6/GolEtjibmppCuVyGz+dDd3e3ZTwajWJgYMAatyJiBcyGf0J7pwcdzQEcbktBnW8Fr3NMXcOSeLRpKSCw2cD0tNgEQ3+0q0DGx8ettre3FyMjI+/MrYhReKMcgpII1jePdZVBWQXcBxJYfOFGzsjjYGsyErYvdkLJnN1V+hMTE1Zrpm+jv4FVxoemhjISyWqsKi68JDWwcSUsPhWQSQBSdA4Lz+vh92j18rRyZs/rbLMjE0WaTSJlsab+h1LqNES7BqLpYB2vIPwYx/zjNqwlDsBR8VaRwlzzrs42FGlGtgWaBiVZjzLngVChNYQBGATas5OoKCvQSB6k4x64uXYGTwyW322dmao01WgqczNEujMRRYSjqhUOhwAbz4Klu4nB8yhyEtZyPEqh36BquSLYzpltBdLV1WWJwmzN6EzZb4aPUZCfVRHyeiA53Qi6XKhzuxGurUFD8Qz8Xga1BQ+y8SNLEKoe8jupcEOJ26HWSGN5VYYiJ3Ei9i14GpaNezOn8gIcjISn/3Sks8n2PyFqDzhd1y/XeL02URQ/4ExhwFOSMbtux0qxgoDHBb+7GiLPG9l8ce2vyYI8nQjHMXn/Fzy+uWzu1Ofpeze32/D29scVgLpjwMEfSrSVUe1PoUK/Yib+N/69+zuy8gJ9apGxzgcfCkLMmjspq3b4qZsH03XKPPP1kLofeC3AAMaxXzYck+ZeAAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DatabaseDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DatabaseDataCollector.php deleted file mode 100644 index ddfbab3c0..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DatabaseDataCollector.php +++ /dev/null @@ -1,264 +0,0 @@ -database = $database; - $this->configFactory = $configFactory; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $connections = []; - foreach (Database::getAllConnectionInfo() as $key => $info) { - try { - $database = Database::getConnection('default', $key); - - if ($database->getLogger()) { - $connections[$key] = $database->getLogger()->get('webprofiler'); - } - } catch(\Exception $e) { - // There was some error during database connection, maybe a stale - // configuration in settings.php or wrong values used for a migration. - } - } - - $this->data['connections'] = array_keys($connections); - - $data = []; - foreach ($connections as $key => $queries) { - foreach ($queries as $query) { - // Remove caller args. - unset($query['caller']['args']); - - // Remove query args element if empty. - if (isset($query['args']) && empty($query['args'])) { - unset($query['args']); - } - - // Save time in milliseconds. - $query['time'] = $query['time'] * 1000; - $query['database'] = $key; - $data[] = $query; - } - } - - $querySort = $this->configFactory->get('webprofiler.config') - ->get('query_sort'); - if ('duration' === $querySort) { - usort( - $data, [ - "Drupal\\webprofiler\\DataCollector\\DatabaseDataCollector", - "orderQueryByTime", - ] - ); - } - - $this->data['queries'] = $data; - - $options = $this->database->getConnectionOptions(); - - // Remove password for security. - unset($options['password']); - - $this->data['database'] = $options; - } - - /** - * @return array - */ - public function getDatabase() { - return $this->data['database']; - } - - /** - * @return int - */ - public function getQueryCount() { - return count($this->data['queries']); - } - - /** - * @return array - */ - public function getQueries() { - return $this->data['queries']; - } - - /** - * Returns the total execution time. - * - * @return float - */ - public function getTime() { - $time = 0; - - foreach ($this->data['queries'] as $query) { - $time += $query['time']; - } - - return $time; - } - - /** - * Returns a color based on the number of executed queries. - * - * @return string - */ - public function getColorCode() { - if ($this->getQueryCount() < 100) { - return 'green'; - } - if ($this->getQueryCount() < 200) { - return 'yellow'; - } - - return 'red'; - } - - /** - * Returns the configured query highlight threshold. - * - * @return int - */ - public function getQueryHighlightThreshold() { - // When a profile is loaded from storage this object is deserialized and - // no constructor is called so we cannot use dependency injection. - return \Drupal::config('webprofiler.config')->get('query_highlight'); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'database'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Database'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Executed queries: @count', ['@count' => $this->getQueryCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAcCAYAAABh2p9gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQRJREFUeNpi/P//PwM1ARMDlcGogZQDlpMnT7pxc3NbA9nhQKxOpL5rQLwJiPeBsI6Ozl+YBOOOHTv+AOllQNwtLS39F2owKYZ/gRq8G4i3ggxEToggWzvc3d2Pk+1lNL4fFAs6ODi8JzdS7mMRVyDVoAMHDsANdAPiOCC+jCQvQKqBQB/BDbwBxK5AHA3E/kB8nKJkA8TMQBwLxaBIKQbi70AvTADSBiSadwFXpCikpKQU8PDwkGTaly9fHFigkaKIJid4584dkiMFFI6jkTJII0WVmpHCAixZQEXWYhDeuXMnyLsVlEQKI45qFBQZ8eRECi4DBaAlDqle/8A48ip6gAADANdQY88Uc0oGAAAAAElFTkSuQmCC'; - } - - /** - * {@inheritdoc} - */ - public function getLibraries() { - return [ - 'webprofiler/database', - ]; - } - - /** - * {@inheritdoc} - */ - public function getData() { - $data = $this->data; - - $conn = Database::getConnection(); - foreach ($data['queries'] as &$query) { - $explain = TRUE; - $type = 'select'; - - if (strpos($query['query'], 'INSERT') !== FALSE) { - $explain = FALSE; - $type = 'insert'; - } - - if (strpos($query['query'], 'UPDATE') !== FALSE) { - $explain = FALSE; - $type = 'update'; - } - - if (strpos($query['query'], 'CREATE') !== FALSE) { - $explain = FALSE; - $type = 'create'; - } - - if (strpos($query['query'], 'DELETE') !== FALSE) { - $explain = FALSE; - $type = 'delete'; - } - - $query['explain'] = $explain; - $query['type'] = $type; - - $quoted = []; - - if (isset($query['args'])) { - foreach ((array) $query['args'] as $key => $val) { - $quoted[$key] = is_null($val) ? 'NULL' : $conn->quote($val); - } - } - - $query['query_args'] = strtr($query['query'], $quoted); - } - - $data['query_highlight_threshold'] = $this->getQueryHighlightThreshold(); - - return $data; - } - - /** - * @param $a - * @param $b - * - * @return int - */ - private function orderQueryByTime($a, $b) { - $at = $a['time']; - $bt = $b['time']; - - if ($at == $bt) { - return 0; - } - return ($at < $bt) ? 1 : -1; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DevelDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DevelDataCollector.php deleted file mode 100644 index 3c554acea..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DevelDataCollector.php +++ /dev/null @@ -1,103 +0,0 @@ -data['original_url'] = $request->getPathInfo(); - } - - /** - * @return string - */ - public function getLinks() { - return $this->develMenuLinks($this->data['original_url']); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'devel'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Development'); - } - - /** - * {@inheritdoc} - */ - public function hasPanel() { - return FALSE; - } - - /** - * Returns the collector icon in base64 format. - * - * @return string - * The collector icon. - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAcCAYAAABlL09dAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2RTdCREU2NUVFQUUxMUU1QTc4Q0Q0OEU5RUY0N0YwMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2RTdCREU2NkVFQUUxMUU1QTc4Q0Q0OEU5RUY0N0YwMyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjZFN0JERTYzRUVBRTExRTVBNzhDRDQ4RTlFRjQ3RjAzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjZFN0JERTY0RUVBRTExRTVBNzhDRDQ4RTlFRjQ3RjAzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+6sNOKAAAAPVJREFUeNpi/P//PwMtABMDjcCowbQ3mNHe3h6XnBUQTwJiTRzy14E4+8CBAyexSbLgsZQbiI2BOBCH/HqoGgZSDYaBDXjk/uMzuBaLzeVI7FV4DN7n4OAAojvRxL+CwvgnkMFG5bj7BUoVv4lUfBWIrxGp9jcoKM4DsQABhZ+A2BPqs61AzEVA/XuQwT1AzElA4Q8g/gJN951EBN13kMFLgJiHgMJvQCwNxOxAvJwIg7+wEBnGv4D4M1TtLyIMBocxMQUyKExnAzEzEHMQof4/C5GxDHJh4qAp3VhpYC4rKCieAbEQlQ1+yzhamY4aTD+DAQIMAFv+MFaJEyYhAAAAAElFTkSuQmCC'; - } - - /** - * @param string $original_url - * - * @return array Array containing Devel Menu links - * Array containing Devel Menu links - */ - protected function develMenuLinks($original_url) { - // We cannot use injected services here because at this point this - // class is deserialized from a storage and not constructed. - $menuLinkTreeService = \Drupal::service('menu.link_tree'); - $rendererService = \Drupal::service('renderer'); - - $parameters = new MenuTreeParameters(); - $parameters->setMaxDepth(1)->onlyEnabledLinks(); - $tree = $menuLinkTreeService->load('devel', $parameters); - - $manipulators = array( - array('callable' => 'menu.default_tree_manipulators:checkAccess'), - array('callable' => 'menu.default_tree_manipulators:generateIndexAndSort'), - ); - $tree = $menuLinkTreeService->transform($tree, $manipulators); - - $links = array(); - - foreach ($tree as $item) { - /** @var DestinationMenuLink $link */ - $link = $item->link; - $renderable = Link::fromTextAndUrl($link->getTitle(), $link->getUrlObject()) - ->toRenderable(); - $rendered = $rendererService->renderPlain($renderable); - $linkString = preg_replace('/\/profiler\/(.*)&/', $original_url . '&', $rendered); - $links[] = Markup::create($linkString);; - } - - return $links; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollector.php deleted file mode 100644 index 63ec647fa..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollector.php +++ /dev/null @@ -1,134 +0,0 @@ -redirectDestination = $redirectDestination; - $this->urlGenerator = $urlGenerator; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data['version'] = Drupal::VERSION; - $this->data['profile'] = drupal_get_profile(); - $this->data['config_url'] = (new Drupal\Core\Url('webprofiler.settings', [], ['query' => $this->redirectDestination->getAsArray()]))->toString(); - - try { - $process = new Process("git log -1 --pretty=format:'%H - %s (%ci)' --abbrev-commit"); - $process->setTimeout(3600); - $process->mustRun(); - $this->data['git_commit'] = $process->getOutput(); - - $process = new Process("git log -1 --pretty=format:'%h' --abbrev-commit"); - $process->setTimeout(3600); - $process->mustRun(); - $this->data['abbr_git_commit'] = $process->getOutput(); - } catch (ProcessFailedException $e) { - $this->data['git_commit'] = $this->data['git_commit_abbr'] = NULL; - } catch (RuntimeException $e) { - $this->data['git_commit'] = $this->data['git_commit_abbr'] = NULL; - } - } - - /** - * @return string - */ - public function getVersion() { - return $this->data['version']; - } - - /** - * @return string - */ - public function getProfile() { - return $this->data['profile']; - } - - /** - * @return string - */ - public function getConfigUrl() { - return $this->data['config_url']; - } - - /** - * @return string - */ - public function getGitCommit() { - return $this->data['git_commit']; - } - - /** - * @return string - */ - public function getAbbrGitCommit() { - return $this->data['abbr_git_commit']; - } - - /** - * Returns the name of the collector. - * - * @return string The collector name - * - * @api - */ - public function getName() { - return 'drupal'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Drupal'); - } - - /** - * {@inheritdoc} - */ - public function hasPanel() { - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCRDU5MUVDNzVGRTkxMUUzODdBMEJDOEZFRjA2QUY5MiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCRDU5MUVDODVGRTkxMUUzODdBMEJDOEZFRjA2QUY5MiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkJENTkxRUM1NUZFOTExRTM4N0EwQkM4RkVGMDZBRjkyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkJENTkxRUM2NUZFOTExRTM4N0EwQkM4RkVGMDZBRjkyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+iYsuIgAAAiNJREFUeNq8lj3KwkAQhhOxUPAnoIgWQiysbFLYG2/gEVJaegQ9QfQECh4g3kA9QbxBLMQ2KaxE2G/ffG5Yl/ytiguDJBn32Z15d2dUQojy0wGgDHQwGFjj8Vh7hxFyZIHNZtOt1+uuDPRtYK/Xs4rFIpyJDFQaiIm73a7NYMyq1arf7/dnWWApIN3VHBPzINHwHX5J4FxAKg6j0Wh4aSDREGb8TxqIXJVKJSIDY1Yul30RmgqE87swHkrDq2cCkYNareZ9AmPWarX2mUAk/hswZrgkUoGyIsm7y1ggDachnrNPrVKpEKSJBxZYnC+Xi/l4PL56T99uN/y8KDYCUpj2i2JRzONkWZYyGo0UXdeV4/GobDYb5Xw+J/obxv+mTqdT8rWTpND1ek3ihm3bRNO0F188O44T+UwmE+TQjBXNcDiciLD5fE7Shuu6xDTN0JdGgfi+//J9v98nA6EmqIoHYsJPxuFwIOKxiERDVxNQ4I4PNw1Ram6DIFAWiwUWG5uv+/2+E98V+IdOp7OiZzF6pitMhC2XyxDEfOKg1+t1ldnTtNtthxcB8sAGcgQRUbWGufM8LxQPfJBv3n+73Tq5qgVyibqWdYsASOUfLYyJJ679yKyHadDZbBYqkn8HMHaO3ydMl674rI8RayOACKUo/+l0SuAf12ZI9TRYLSZCJYk76GgbnyA9TxOlMpiqqrnuQhxk7igd8raJbKi/bvX/BBgANANSieJk+XMAAAAASUVORK5CYII='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollectorTrait.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollectorTrait.php deleted file mode 100644 index 8fdede4f9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/DrupalDataCollectorTrait.php +++ /dev/null @@ -1,120 +0,0 @@ -data = array(); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function hasPanel() { - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function getLibraries() { - return []; - } - - /** - * {@inheritdoc} - */ - public function getDrupalSettings() { - return []; - } - - /** - * @return mixed - */ - public function getData() { - return $this->data; - } - - /** - * @param $class - * @param $method - * - * @return array - */ - public function getMethodData($class, $method) { - $class = is_object($class) ? get_class($class) : $class; - $data = []; - - try { - $reflectedMethod = new \ReflectionMethod($class, $method); - - $data = [ - 'class' => $class, - 'method' => $method, - 'file' => $reflectedMethod->getFilename(), - 'line' => $reflectedMethod->getStartLine(), - ]; - } catch (\ReflectionException $re) { - // TODO: handle the exception. - } finally { - return $data; - } - } - - /** - * @param $value - * - * @return int|string - */ - private function convertToBytes($value) { - if ('-1' === $value) { - return -1; - } - - $value = strtolower($value); - $max = strtolower(ltrim($value, '+')); - if (0 === strpos($max, '0x')) { - $max = intval($max, 16); - } - elseif (0 === strpos($max, '0')) { - $max = intval($max, 8); - } - else { - $max = intval($max); - } - - switch (substr($value, -1)) { - case 't': - $max *= 1024; - break; - - case 'g': - $max *= 1024; - break; - - case 'm': - $max *= 1024; - break; - - case 'k': - $max *= 1024; - break; - } - - return $max; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/EventsDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/EventsDataCollector.php deleted file mode 100644 index 6374ca962..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/EventsDataCollector.php +++ /dev/null @@ -1,144 +0,0 @@ -eventDispatcher = $event_dispatcher; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data = [ - 'called_listeners' => [], - 'called_listeners_count' => 0, - 'not_called_listeners' => [], - 'not_called_listeners_count' => 0, - ]; - } - - /** - * {@inheritdoc} - */ - public function lateCollect() { - if ($this->eventDispatcher instanceof EventDispatcherTraceableInterface) { - $countCalled = 0; - $calledListeners = $this->eventDispatcher->getCalledListeners(); - foreach ($calledListeners as &$events) { - foreach ($events as &$priority) { - foreach ($priority as &$listener) { - $countCalled++; - $listener['clazz'] = $this->getMethodData($listener['class'], $listener['method']); - } - } - } - - $countNotCalled = 0; - $notCalledListeners = $this->eventDispatcher->getNotCalledListeners(); - foreach ($notCalledListeners as $events) { - foreach ($events as $priority) { - foreach ($priority as $listener) { - $countNotCalled++; - } - } - } - - $this->data = [ - 'called_listeners' => $calledListeners, - 'called_listeners_count' => $countCalled, - 'not_called_listeners' => $notCalledListeners, - 'not_called_listeners_count' => $countNotCalled, - ]; - } - } - - /** - * @return array - */ - public function getCalledListeners() { - return $this->data['called_listeners']; - } - - /** - * @return array - */ - public function getNotCalledListeners() { - return $this->data['not_called_listeners']; - } - - /** - * @return int - */ - public function getCalledListenersCount() { - return $this->data['called_listeners_count']; - } - - /** - * @return int - */ - public function getNotCalledListenersCount() { - return $this->data['not_called_listeners_count']; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'events'; - } - - /** - * @return mixed - */ - public function getData() { - return $this->data; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Events'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Called listeners: @listeners', ['@listeners' => $this->getCalledListenersCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFJJREFUeNrkVVlIY2cY/RMTE81NMkkajUs1OBqkiVsjjAtStGrtSGyFjOjAQNVCKRb66ot9KrjgQx+FUgTBKkURbIfighWl4r6h44pajcZEo3ESTeKS9PzB2AyNZaD1qRcOem+S83/f+c53Lsvj8ZD/+mKTB7gehJTj+2d9fZ1MTk6S0NBQSW9vb97e3t7jmpqaXzIzM185HA7vd4KDg8nGxoaysbGxVCwWm/V6/aDL5TKlpKSQpKSkv5NyuVxyc3Mj7e7u/jw2NjYxJyfnMDIykmGz2UQgEBAWi0XcbjeRSqWhZWVl4v39fXVXV5cqNzf3exxmCNj+9fU1MzQ09JVWq32sUqmMu7u7QhwiDwoKIoeHh2R7e5twOByCwcrQhUShUJjz8vJkw8PDX5+fn8sDkvb3938YHR39rlAoNBoMBgGqtWxubnJRKbu9vZ20trZSQoJnvKioKMvZ2Rn/6urKmpqayvT19ekCks7NzaUnJyeboK0kPj7+cGZmJprH4zGnp6duEBFUTg4ODqjmIfPz87GQxoRnori4ODOKUPuTsnw+RRvPGIYJMZvNDNplYmJiLvPz839oamoSj4yMfAJNuRqN5mV9ff0fOPDF1NSUAt85lclkDkjnys7O/vGOlZLeQgjIgUggnmqHqmMqKip+z8jI8MAFnpKSkpXZ2dn38JkIUAFRQNjt/R2Xv09twBFwAGwClunp6efLy8tZdFgUW1tbiaOjo1/is9fUhcA+YL69fzvzSyQSEQZHfBJBT4J2Bf9qo9Rq9bxcLndeXl4STJrA8B4Mc/atN4pesAk5OTkh1PB0exYXF/kWi4UTFhZG+Hw+wZQJ5BDR7fEPIroYASu9uLggJpOJYO2I0+kkqI47Njb2MdzAKS4uXisvL5/FurIGBgaeYoDS1dVVsrKyQpaWlghsF7hS2IJERER4T4U/qckT4ccP6BYplco+rOcxqn0fZFqj0fgkLS3tV18m0EICktJV9F101xcWFj5Cu+HQ1YGNoeSXWGErpv8IwVOSlZXVh7xw0zy4V1MY3/uXWgetMzB8EZUHw7lKSEjgQ0MONLei2kcTExN5R0dHMehshw7x3umLRKI7YDhaDOSJ18hstq2qquobLMG30DKYkuzs7KggTa5Pf4p/rJReSCud1WplEBYuSMGrra39FG1ywsPDgwsLC+0YFoMAKi0qKupA5c57K0V1XjsdHx+/g6mXUksVFBS8wmF23FeMj48/w7PXiLsxePcG65qPDNCsra15XRCQFNP1AgRPMaA4aOvp6OjQ2O12cVtb20vE389YAHFLS0sO2vbYbLYQHKRHShEEy5ul+kIAe02Q5vy6urouTNyDV8VNT0/PBGzzxW1wRIHsM7T+W3V1tROvEE9lZeUCKlVgSfyD6S9SGsKdnZ1pOp3OkJ6efj04OPgTnmsAlv8PACXa/Q4L4UByuZqbm/UNDQ1vkLL+3+/9ByH9U4ABADscgvUMKuLiAAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ExtensionDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ExtensionDataCollector.php deleted file mode 100644 index bdf08f4f5..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ExtensionDataCollector.php +++ /dev/null @@ -1,156 +0,0 @@ -moduleHandler = $module_handler; - $this->themeHandler = $theme_handler; - $this->root = $root; - - $this->data['drupal_extension']['modules'] = []; - $this->data['drupal_extension']['themes'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $modules = $this->moduleHandler->getModuleList(); - $themes = $this->themeHandler->listInfo(); - - $this->data['drupal_extension']['count'] = count($modules) + count($themes); - $this->data['drupal_extension']['modules'] = $modules; - $this->data['drupal_extension']['themes'] = $themes; - $this->data['drupal_extension']['installation_path'] = $this->root . '/'; - } - - /** - * Returns the total number of active extensions. - * - * @return int - */ - public function getExtensionsCount() { - return isset($this->data['drupal_extension']['count']) ? $this->data['drupal_extension']['count'] : 0; - } - - /** - * Returns the total number of active modules. - * - * @return int - */ - public function getModulesCount() { - return count($this->data['drupal_extension']['modules']); - } - - /** - * Returns the total number of active themes. - * - * @return int - */ - public function getThemesCount() { - return count($this->data['drupal_extension']['themes']); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'drupal_extension'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Extensions'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Total: @extensions', ['@extensions' => $this->getExtensionsCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAcCAYAAABh2p9gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RkE1QUM1RjkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RkE1QUM2MDkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRGQTVBQzVEOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRGQTVBQzVFOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+7LqYtwAAAUBJREFUeNpi/P//PwM1ARMDlcGogYPQQBYQ4eDgQIza/SClQNwIxA3okgcOHCDZhRVAfA6I64F4EjW8fBLqwn1AnAvE8aQaqAc1QAZJ7DMQRwPxayDuAGIBYgwUAeL1QHwWGm6XgLgUSf4FEPcAsQQQ+xBjICh8AmARBgSCQNwFxEFIatYCMagQcEHXzGhvb09s6bAdiL2gbHYg/oEm/x8Y00ykRAofEvsvzlgGmsoIpIWBWBaIlYD4Bg61B5DY/ED8HRrjIH2yINchh+E7IH4CxPeBuAAam8jgBBD3IfEtgZgTiPdC9T1BySloYCcQ20DTmTg0tuegWVICjZSNWLMeFgBKKsU45EDi9kA8H4ivEmsgNsAKxEXQBH0TiMtwFg5EgvnQXHIFmibfUGrgeaghTdBIxAoYR2u9EWAgQIABAKKeRzEX0gXIAAAAAElFTkSuQmCC'; - } - - /** - * {@inheritdoc} - */ - public function getData() { - $data = $this->data; - - // Copy protected properties over public ones to - // let json_encode to find them. - $this->copyToPublic($data['drupal_extension']['modules']); - $this->copyToPublic($data['drupal_extension']['themes']); - - return $data; - } - - /** - * Copies protected properties to public ones. - * - * @param \Drupal\Core\Extension\Extension[] $extensions - */ - private function copyToPublic($extensions) { - foreach ($extensions as &$extension) { - $extension->public_type = $extension->getType(); - $extension->public_name = $extension->getName(); - $extension->public_path = $extension->getPath(); - $extension->public_pathname = $extension->getPathname(); - $extension->public_filename = $extension->getFilename(); - $extension->public_extension_pathname = $extension->getExtensionPathname(); - $extension->public_extension_filename = $extension->getExtensionFilename(); - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/FormsDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/FormsDataCollector.php deleted file mode 100644 index a6a1b4046..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/FormsDataCollector.php +++ /dev/null @@ -1,81 +0,0 @@ -formBuilder = $formBuilder; - - $this->data['forms'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data['forms'] = $this->formBuilder->getBuildForm(); - } - - /** - * @return array - */ - public function getForms() { - return (!empty($this->data['forms']) && is_array($this->data['forms'])) ? $this->data['forms'] : []; - } - - /** - * @return int - */ - public function getFormsCount() { - return count($this->getForms()); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'forms'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Forms'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Rendered: @forms', ['@forms' => $this->getFormsCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAcCAYAAABh2p9gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RkE1QUM1QjkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RkE1QUM1QzkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRGQTVBQzU5OTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRGQTVBQzVBOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+I7130QAAAKRJREFUeNrsVVsKxCAMzIgH8897eDHxGP55LX+0RmjpYxHdyrLsNl9iknEyExA5Z5oZgibH9wPKVlJrnVNKRwZCkPceQ4AhhOpUjJFaeaXUBRjssrW2FvDZGINS2GV9AQb3rpvCvZWhc24rKpdDmp17P2MKjzIFEAD16vdDi73Xbx2/pelZItnz6oiusneB32b4is0Iw8eUfzBlOiCef/l2LAIMAGACWQCJ5bXFAAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/HttpDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/HttpDataCollector.php deleted file mode 100644 index 85440831b..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/HttpDataCollector.php +++ /dev/null @@ -1,175 +0,0 @@ -middleware = $middleware; - - $this->data['completed'] = []; - $this->data['failed'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $completed = $this->middleware->getCompletedRequests(); - $failed = $this->middleware->getFailedRequests(); - - foreach ($completed as $data) { - /** @var \GuzzleHttp\Psr7\Request $request */ - $request = $data['request']; - /** @var \GuzzleHttp\Psr7\Response $response */ - $response = $data['response']; - /** @var \GuzzleHttp\TransferStats $stats */ - $stats = $request->stats; - - $uri = $request->getUri(); - $this->data['completed'][] = [ - 'request' => [ - 'method' => $request->getMethod(), - 'uri' => [ - 'schema' => $uri->getScheme(), - 'host' => $uri->getHost(), - 'port' => $uri->getPort(), - 'path' => $uri->getPath(), - 'query' => $uri->getQuery(), - 'fragment' => $uri->getFragment(), - ], - 'headers' => $request->getHeaders(), - 'protocol' => $request->getProtocolVersion(), - 'request_target' => $request->getRequestTarget(), - 'stats' => [ - 'transferTime' => $stats->getTransferTime(), - 'handlerStats' => $stats->getHandlerStats(), - ], - ], - 'response' => [ - 'phrase' => $response->getReasonPhrase(), - 'status' => $response->getStatusCode(), - 'headers' => $response->getHeaders(), - 'protocol' => $response->getProtocolVersion(), - ], - ]; - } - - foreach ($failed as $data) { - /** @var \GuzzleHttp\Psr7\Request $request */ - $request = $data['request']; - /** @var \GuzzleHttp\Psr7\Response $response */ - $response = $data['response']; - - $uri = $request->getUri(); - $failureData = [ - 'request' => [ - 'method' => $request->getMethod(), - 'uri' => [ - 'schema' => $uri->getScheme(), - 'host' => $uri->getHost(), - 'port' => $uri->getPort(), - 'path' => $uri->getPath(), - 'query' => $uri->getQuery(), - 'fragment' => $uri->getFragment(), - ], - 'headers' => $request->getHeaders(), - 'protocol' => $request->getProtocolVersion(), - 'request_target' => $request->getRequestTarget(), - ], - ]; - - if ($response) { - $failureData['response'] = [ - 'phrase' => $response->getReasonPhrase(), - 'status' => $response->getStatusCode(), - 'headers' => $response->getHeaders(), - 'protocol' => $response->getProtocolVersion(), - ]; - } - - $this->data['failed'][] = $failureData; - } - } - - /** - * @return int - */ - public function getCompletedRequestsCount() { - return count($this->getCompletedRequests()); - } - - /** - * @return array - */ - public function getCompletedRequests() { - return $this->data['completed']; - } - - /** - * @return int - */ - public function getFailedRequestsCount() { - return count($this->getFailedRequests()); - } - - /** - * @return array - */ - public function getFailedRequests() { - return $this->data['failed']; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'http'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Http'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t( - 'Completed @completed, error @error', [ - '@completed' => $this->getCompletedRequestsCount(), - '@error' => $this->getFailedRequestsCount(), - ] - ); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAATlJREFUeNrsleERgjAMha0TdISOwAZ2BEZghI7ABo7AOQFuwAjoBLgBblBbfb0LudByp/4jdw+PNnxtkqYq7/3h13Y8/MF26B9spfo6yAX1QSa6EY2Y0xLrzROgddAMOcgLmuFbhDqyG00W8Rm1JWgEWCG0oQBuJKjGigNUs/xWUJdJheZQJzhZFGkgKWkw1mM8bmTCvOPQcSVXrTA+Ydc0kujXJGg6p5VwrG5BJzb2CLriN9kT74afUylPloQ+kdDPELXpg1qGvwbtURwjFGkkC8RIZw6d2QeO7MII81wRbDm0Z068Zf0G1bxQl8z1UH1zoQwk9NRZdkPoHt+KbZoqa+HYZS4T3iimdEvRDrIF4KIRclBNjk+uSB2/eBJUvR9KSek26BZHOit2zl3oqkV91P6//3N7CTAAIIc/qj2gy4gAAAAASUVORK5CYII='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/MailDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/MailDataCollector.php deleted file mode 100644 index 79551502d..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/MailDataCollector.php +++ /dev/null @@ -1,99 +0,0 @@ -messages = []; - } - - /** - * Collects data for the given Request and Response. - * - * @param Request $request A Request instance - * @param Response $response A Response instance - * @param \Exception $exception An Exception instance - * - * @api - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data['mail'] = $this->messages; - } - - /** - * @param $message - * @param \Drupal\Core\Mail\MailInterface $mail - */ - public function addMessage($message, MailInterface $mail) { - $class = get_class($mail); - $method = $this->getMethodData($class, 'mail'); - - $this->messages[] = [ - 'message' => $message, - 'method' => $method, - ]; - } - - /** - * @return int - */ - public function getMailSent() { - return count($this->data['mail']); - } - - /** - * Returns the name of the collector. - * - * @return string The collector name - * - * @api - */ - public function getName() { - return 'mail'; - } - - /** - * Returns the datacollector title. - * - * @return string - * The datacollector title. - */ - public function getTitle() { - return $this->t('Mail'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Total: @count', ['@count' => $this->getMailSent()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABcAAAAcCAYAAACK7SRjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0NEOTU1MjM0OThFMTFFMDg3NzJBNTE2ODgwQzMxMzQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0NEOTU1MjQ0OThFMTFFMDg3NzJBNTE2ODgwQzMxMzQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMEQ5OTQ5QzQ5OEMxMUUwODc3MkE1MTY4ODBDMzEzNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3Q0Q5NTUyMjQ5OEUxMUUwODc3MkE1MTY4ODBDMzEzNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpkRnSAAAAJ0SURBVHjaYvz//z8DrQATAw3BqOFYAaO9vT1FBhw4cGCAXA5MipxBQUHT3r17l0AVAxkZ/wkLC89as2ZNIcjlYkALXKnlWqBZTH/+/PEDmQsynLW/v3+NoaHhN2oYDjJn8uTJK4BMNpDhPwsLCwOKiop2+fn5vafEYC8vrw8gc/Lz8wOB3B8gw/nev38vn5WV5eTg4LA/Ly/vESsrK2npmYmJITU19SnQ8L0gc4DxpwgyF2S4EEjB58+f+crLy31YWFjOt7S0XBYUFPxHjMEcHBz/6+rqboqJiZ0qKSnxBpkDlRICGc4MU/j792+2CRMm+L18+fLSxIkTDykoKPzBZ7CoqOi/np6eE8rKylvb29v9fvz4wYEkzYKRzjk5OX/LyMjcnDRpEkjjdisrK6wRraOj8wvokAMLFy788ejRoxcaGhrPCWai4ODgB8DUE3/mzBknYMToASNoMzAfvEVW4+Tk9LmhoWFbTU2NwunTpx2BjiiMjo6+hm4WCzJHUlLyz+vXrxkfP36sDOI/ffpUPikpibe7u3sLsJjQW7VqlSrQxe+Avjmanp7u9PbtWzGQOmCCkARmmu/m5uYfT548yY/V5UpKSl+2b9+uiiz26dMnIWBSDTp27NgdYGrYCIzwE7m5uR4wg2Hg/PnzSsDI/QlKOcjZ3wGUBLm5uf+DwLdv38gub4AG/xcSEvr35s0bZmCB5sgCE/z69SsjyDJKMtG/f/8YQQYD8wkoGf8H51AbG5sH1CpbQBnQ09PzBiiHgoIFFHlBQGwLxLxUMP8dqJgH4k3gIhfIkAKVYkDMTmmhCHIxEL8A4peMo02L4WU4QIABANxZAoDIQDv3AAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PerformanceTimingDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PerformanceTimingDataCollector.php deleted file mode 100644 index 6a5e699f7..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PerformanceTimingDataCollector.php +++ /dev/null @@ -1,83 +0,0 @@ -data['performance'] = $data; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'performance_timing'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Performance Timing'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - if (isset($this->data['performance'])) { - $performanceData = new PerformanceTimingData($this->data['performance']); - return $this->t('TTFB: @ttfb', ['@ttfb' => sprintf('%.0f ms', $performanceData->getTtfbTiming())]); - } - - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpi/P//PwO1ARMDDcCooUPEUEYi1AgAcQIQ+0P5H4B4IxAvwKaYmCSqAMT7gbgBajhMrB8qLkCsoQFQQ0CuOw/EBjgsLIAajmEouvdBhukD8UQgdkASwwXuA7EhNEhwuvQ8iXHSj2Q53FBY7BtADVxIoqEfoQYnYJPEF3bEROZ6WDDBvO+ALcCxJCsBAmpA4SuA7P2PBDQUEOGTDTA1TNCYs6dCRgIlxQswQ0GMB0A8nwgv4gqa+VCXgpMWC1QiEerF9WgaDmJJp/OhkUNIHUHQgJ4ecQHkiMKXXALQIowqpdR8pJi/AA0qvC4lFsyHYqK8zzhaRQ8NQwECDABNaU12xhTp2QAAAABJRU5ErkJggg=='; - } - - /** - * {@inheritdoc} - */ - public function getData() { - $data = $this->data; - - if (isset($this->data['performance'])) { - $performanceData = new PerformanceTimingData($this->data['performance']); - $data['performance']['computed']['DNS lookup time'] = $performanceData->getDNSTiming(); - $data['performance']['computed']['TCP handshake time'] = $performanceData->getTCPTiming(); - $data['performance']['computed']['Time to first byte'] = $performanceData->getTtfbTiming(); - $data['performance']['computed']['Data download time'] = $performanceData->getDataTiming(); - $data['performance']['computed']['DOM building time'] = $performanceData->getDomTiming(); - } - - return $data; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PhpConfigDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PhpConfigDataCollector.php deleted file mode 100644 index d959a4818..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/PhpConfigDataCollector.php +++ /dev/null @@ -1,163 +0,0 @@ -data = [ - 'token' => $response->headers->get('X-Debug-Token'), - 'php_version' => PHP_VERSION, - 'xdebug_enabled' => extension_loaded('xdebug'), - 'xhprof_enabled' => extension_loaded('xhprof'), - 'eaccel_enabled' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'), - 'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'), - 'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'), - 'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'), - 'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'), - 'sapi_name' => php_sapi_name() - ]; - } - - /** - * Gets the token. - * - * @return string The token - */ - public function getToken() { - return $this->data['token']; - } - - /** - * Gets the PHP version. - * - * @return string The PHP version - */ - public function getPhpVersion() { - return $this->data['php_version']; - } - - /** - * Returns true if the XDebug is enabled. - * - * @return Boolean true if XDebug is enabled, false otherwise - */ - public function hasXDebug() { - return $this->data['xdebug_enabled']; - } - - /** - * Returns true if the XHProf is enabled. - * - * @return Boolean true if XHProf is enabled, false otherwise - */ - public function hasXHProf() { - return $this->data['xhprof_enabled']; - } - - /** - * Returns true if EAccelerator is enabled. - * - * @return Boolean true if EAccelerator is enabled, false otherwise - */ - public function hasEAccelerator() { - return $this->data['eaccel_enabled']; - } - - /** - * Returns true if APC is enabled. - * - * @return Boolean true if APC is enabled, false otherwise - */ - public function hasApc() { - return $this->data['apc_enabled']; - } - - /** - * Returns true if Zend OPcache is enabled - * - * @return Boolean true if Zend OPcache is enabled, false otherwise - */ - public function hasZendOpcache() { - return $this->data['zend_opcache_enabled']; - } - - /** - * Returns true if XCache is enabled. - * - * @return Boolean true if XCache is enabled, false otherwise - */ - public function hasXCache() { - return $this->data['xcache_enabled']; - } - - /** - * Returns true if WinCache is enabled. - * - * @return Boolean true if WinCache is enabled, false otherwise - */ - public function hasWinCache() { - return $this->data['wincache_enabled']; - } - - /** - * Returns true if any accelerator is enabled. - * - * @return Boolean true if any accelerator is enabled, false otherwise - */ - public function hasAccelerator() { - return $this->hasApc() || $this->hasZendOpcache() || $this->hasEAccelerator() || $this->hasXCache() || $this->hasWinCache(); - } - - /** - * Gets the PHP SAPI name. - * - * @return string The environment - */ - public function getSapiName() { - return $this->data['sapi_name']; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('PHP Config'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('PHP: @version', ['@version' => $this->getPhpVersion()]); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'php_config'; - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAMAAAC5xgRsAAAAZlBMVEX///////////////////////////////////////////////////////////////////////////////////////////+ZmZmZmZlISEhJSUmdnZ1HR0fR0dFZWVlpaWlfX18/Pz+puygPAAAAIXRSTlMACwwlJygpLzIzNjs8QEtMUmd6e32AucDBw8fIydTm6u5l8MjvAAAAo0lEQVR42r2P2Q6CMBBFL6XsZRGRfZv//0nbDBNEE19MnJeTc5ILKf58ahiUwzy/AJpIWwREwQnEXRdbGCLjrO+djWRvVMiJcigxB7viGogxDdJpSmHEmCVPS7YczJvgUu+CS30IvtbNYZMvsGVo2mVpG/kbm4auiCpdcC3YPCAhSpAdUzaAn6qPKZtUT6ZSzb4bi2hdo9MQ1nX4ASjfV+/4/Z40pyCHrNTbIgAAAABJRU5ErkJggg=='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RequestDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RequestDataCollector.php deleted file mode 100644 index a23d54075..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RequestDataCollector.php +++ /dev/null @@ -1,113 +0,0 @@ -controllerResolver = $controllerResolver; - $this->accessCheck = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - parent::collect($request, $response, $exception); - - $controller = $this->controllerResolver->getController($request); - - $this->data['controller'] = $this->getMethodData($controller[0], $controller[1]); - $this->data['access_check'] = $this->accessCheck; - } - - /** - * @param $service_id - * @param $callable - * @param \Symfony\Component\HttpFoundation\Request $request - * - */ - public function addAccessCheck($service_id, $callable, Request $request) { - $this->accessCheck[$request->getPathInfo()][] = [ - 'service_id' => $service_id, - 'callable' => $this->getMethodData($callable[0], $callable[1]), - ]; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Request'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->data['status_code'] . ' ' . $this->data['status_text']; - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAQAAADYBBcfAAACvElEQVR42tVTbUhTYRTerDCnKVoUUr/KCZmypA9Koet0bXNLJ5XazDJ/WFaCUY0pExRZXxYiJgsxWWjkaL+yK+po1gjyR2QfmqWxtBmaBtqWGnabT++c11Fu4l/P4VzOPc95zoHznsNZodIbLDdRcKnc1Bu8DAK45ZsOnykQNMopsNooLxCknb0cDq5vml9FtHiIgpBR0R6iihYyFMTDt2Lg56ObPkI6TMGXSof1EV67IqCwisJSWliFAG/E0CfFIiebdNypcxi/1zgyFiIiZ3sJQr0RQx5frLa6k7SOKRo3oMFNR5t62h2rttKXEOKFqDCxtXNmmBokO2KKTlp3IdWuT2dYRNGKwEXEBCcL172G5FG0aIxC0kR9PBTVH1kkwQn+IqJnCE33EalVzT9GJQS1tAdD3CKicJYFrxqx7W2ejCEdZy1FiC5tZxHhLJKOZaRdQJAyV/YAvDliySALHxmxR4Hqe2iwvaOR/CEuZYJFSgYhVbZRkA8KGdEktrqnqra90NndCdkt77fjIHIhexOrfO6O3bbbOj/rqu5IptgyR3sU93QbOYhquZK4MCDp0Ina/PLsu5JvbCTRaapUdUmIV/RzoMdsk/0hWRNdAvKOmvqlN0drsJbJf1P4YsQ5lGrJeuosiOUgbOC8cto3LfOXTdVd7BqZsQKbse+0jUL6WPcesqs4MNSUTQAxGjwFiC8m3yzmqwHJBWYKBJ9WNqW/dHkpU/osch1Yj5RJfXPfSEe/2UPsN490NPfZG5CKyJmcV5ayHyzy7BMqsXfuHhGK/cjAIeSpR92gehR55D8TcQhDEKJwytBJ4fr4NULvrEM8NszfJPyxDoHYAQ1oPCWmIX4gifmDS/DV2DKeb25FHWr76yEG7/9L4YFPeiQQ4/8LkgJ8Et+NncTCsYqzXAEXa7CWdPZzGWdlyV+vST0JanfPvwAAAABJRU5ErkJggg=='; - } - - /** - * @return array|string - */ - public function getData() { - // Drupal 8.5+ uses Symfony 3.4.x that changes the way the Request data are - // collected. Data is altered with \Symfony\Component\HttpKernel\DataCollector\DataCollector::cloneVar. - // The stored data (of type \Symfony\Component\VarDumper\Cloner\Data) is - // suitable to be converted to a string by a Dumper (\Symfony\Component\VarDumper\Dumper\DataDumperInterface). - // In our implementation however we need that data as an array, to be later - // converted in a json response by a REST endpoint. We need to refactor the - // whole way Web Profiler works to allow that. At the moment we just - // retrieve the raw Data value and do some string manipulation to clean the - // output a bit. - - $data = $this->data->getValue(TRUE); - unset($data['request_attributes']['_route_params']); - unset($data['request_attributes']['_access_result']); - - $route_object = []; - foreach($data['request_attributes']['_route_object'] as $key => $result) { - $key = str_replace("\0", '', $key); - $key = str_replace('Symfony\Component\Routing\Route', 'Symfony\Component\Routing\Route::', $key); - $route_object[$key] = $result; - } - $data['request_attributes']['_route_object'] = $route_object; - - return $data; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RoutingDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RoutingDataCollector.php deleted file mode 100644 index e892b9a34..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/RoutingDataCollector.php +++ /dev/null @@ -1,91 +0,0 @@ -routeProvider = $routeProvider; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data['routing'] = []; - foreach ($this->routeProvider->getAllRoutes() as $route_name => $route) { - // @TODO Find a better visual representation. - $this->data['routing'][] = [ - 'name' => $route_name, - 'path' => $route->getPath(), - ]; - } - } - - /** - * @return int - */ - public function getRoutesCount() { - return count($this->routing()); - } - - /** - * Twig callback for displaying the routes. - */ - public function routing() { - return $this->data['routing']; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Routing'); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'routing'; - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Defined routes: @route', ['@route' => $this->getRoutesCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPxJREFUeNrkVsERREAQ7D0koXwlIAISkIGXvwAkoJSfHITg5SMUVR4eMuCxZ1xxV+5uuTL30lV8bPX09PSuFVJKcOOGP+DipLrrusoFdV1Lz/NgmiaKosC0XrAopYT0fc/f/jAMa41Pj23bkrpi9bRpGmRZ9lRKFSzLkl9UHMI4jijLcuaaSZMkQdd1fNMn5r0EHIFhGEjTlDenYRjCcZyHUnqRwXEcz77sYepM+Z1yTOEXZEFVVYcUba2iItsNcbr9IAiw5HMd1CJZtU1VpG3bIooi3gPF933keY43pb9gb1Bskdrap58luMjvRNO04wcK18RfIa59mbgLMAASuWsKAyoEhgAAAABJRU5ErkJggg=='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ServicesDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ServicesDataCollector.php deleted file mode 100644 index ef653f805..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ServicesDataCollector.php +++ /dev/null @@ -1,162 +0,0 @@ -container = $container; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - if ($this->getServicesCount()) { - - $tracedData = []; - if ($this->container instanceof TraceableContainer) { - $tracedData = $this->container->getTracedData(); - } - - foreach (array_keys($this->getServices()) as $id) { - $this->data['services'][$id]['initialized'] = ($this->container->initialized($id)) ? TRUE : FALSE; - $this->data['services'][$id]['time'] = isset($tracedData[$id]) ? $tracedData[$id] : NULL; - } - } - } - - /** - * @param $services - */ - public function setServices($services) { - $this->data['services'] = $services; - } - - /** - * @return array - */ - public function getServices() { - return $this->data['services']; - } - - /** - * @return int - */ - public function getServicesCount() { - return count($this->getServices()); - } - - /** - * @return array - */ - public function getInitializedServices() { - return array_filter($this->getServices(), function($item) { - return $item['initialized']; - }); - } - - /** - * @return int - */ - public function getInitializedServicesCount() { - return count($this->getInitializedServices()); - } - - /** - * @return array - */ - public function getInitializedServicesWithoutWebprofiler() { - return array_filter($this->getInitializedServices(), function($item) { - return strpos($item['value']['id'], 'webprofiler') !== 0; - }); - } - - /** - * @return int - */ - public function getInitializedServicesWithoutWebprofilerCount() { - return count($this->getInitializedServicesWithoutWebprofiler()); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'services'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Services'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Initialized: @count', [ - '@count' => $this->getInitializedServicesCount(), - ]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQVJREFUeNrkVe0NgjAQBeMAdYO6AWxQNtANGEFHcALZANyADegGsIFsIBvgu6Q/LtWmxdTEjyYvd6Hw8t5de6TzPCex1yp5w/pz0rVrQymVIXSAACqt9TGG0p0hpHWIZb9lebWENOXn1FgWbL8GJHACNHs+ohyjlxSEZPEcKGYC6SbEvljgUHzEOR3IXiiB6YOTlLqdo1Y54tZHDLIauCHtETtn962P6EUVqhhi0gelIJEEk1MjMg9Py9xol/0SuBqFva/DULY3ZSqQF767v8TyZKv83tFXWVaEufsUG+DCr2nwQLGOlGQNizZPy3fMU16K5uV5+qQEpFTC+hCN9Pd/0XcBBgBxwVqjDkAznAAAAABJRU5ErkJggg=='; - } - - /** - * @return array - */ - public function getData() { - $data = $this->data; - - $http_middleware = array_filter($data['services'], function($service) { - return isset($service['value']['tags']['http_middleware']); - }); - - foreach ($http_middleware as &$service) { - $service['value']['handle_method'] = $this->getMethodData($service['value']['class'], 'handle'); - } - - uasort($http_middleware, function ($a, $b) { - $va = $a['value']['tags']['http_middleware'][0]['priority']; - $vb = $b['value']['tags']['http_middleware'][0]['priority']; - - if ($va == $vb) { - return 0; - } - return ($va > $vb) ? -1 : 1; - }); - - $data['http_middleware'] = $http_middleware; - - return $data; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/StateDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/StateDataCollector.php deleted file mode 100644 index 20bab443e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/StateDataCollector.php +++ /dev/null @@ -1,65 +0,0 @@ -data['state_get'][$key] = isset($this->data['state_get'][$key]) ? $this->data['state_get'][$key] + 1 : 1; - } - - /** - * Twig callback to show all requested state keys. - */ - public function getStateKeysCount() { - return count($this->data['state_get']); - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('State'); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'state'; - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Total: @variables', ['@variables' => $this->getStateKeysCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2Njc3QTVERTkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2Njc3QTVERjkxNkMxMUUzQjA3OUEzQTNEMUVGMjVDOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjY2NzdBNURDOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY2NzdBNUREOTE2QzExRTNCMDc5QTNBM0QxRUYyNUM4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+tji6wwAAAUFJREFUeNpi/P//PwO1ARMDDcDQMZSBgZExE4h/AvF/KuA/QFzKCCS+TZ40iVNeXp5i9718+ZIhNS3tL5OoqChVDAQBcXFxBqBZzDQJU0Z2Do7/FubmVDPwzNmzwymdhoSEgDEM8PDwgPkJCQk49bDgMxCkEWQAyKAXL14wXLhwgWHChAlguTVr1pBnKMiwgoICsEEgC+7cuQPGHR0deH3HzMLC0iAjI4NV8tSpUwzv3r1jYGNjY3BycoJbgg88e/6cuIg6cuQImAZ5n2qx7+HhAaZtbGzArqXYUJCBIAwKR1jMq6ioMBgYGJAeURUVFWCNsHAERRAsKYFofJGF01CQIaBktGPHDjANAjU1NWBXg8IWX/gOobz/8+fP7x8/fqSKYV++fGH4+vXrX1B1EgXET6hUnTwH4jTG0Xqf6gAgwABnDJn0eW/JMwAAAABJRU5ErkJggg=='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ThemeDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ThemeDataCollector.php deleted file mode 100644 index 717cfdfd6..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ThemeDataCollector.php +++ /dev/null @@ -1,257 +0,0 @@ -themeManager = $themeManager; - $this->themeNegotiator = $themeNegotiator; - $this->profile = $profile; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $activeTheme = $this->themeManager->getActiveTheme(); - - $this->data['activeTheme'] = [ - 'name' => $activeTheme->getName(), - 'path' => $activeTheme->getPath(), - 'engine' => $activeTheme->getEngine(), - 'owner' => $activeTheme->getOwner(), - 'baseThemes' => $activeTheme->getBaseThemes(), - 'extension' => $activeTheme->getExtension(), - 'styleSheetsRemove' => $activeTheme->getStyleSheetsRemove(), - 'libraries' => $activeTheme->getLibraries(), - 'regions' => $activeTheme->getRegions(), - ]; - - if ($this->themeNegotiator instanceof ThemeNegotiatorWrapper) { - $this->data['negotiator'] = [ - 'class' => $this->getMethodData($this->themeNegotiator->getNegotiator(), 'determineActiveTheme'), - 'id' => $this->themeNegotiator->getNegotiator()->_serviceId, - ]; - } - } - - /** - * {@inheritdoc} - */ - public function lateCollect() { - $this->data['twig'] = serialize($this->profile); - } - - /** - * @return string - */ - public function getActiveTheme() { - return $this->data['activeTheme']; - } - - /** - * @return array - */ - public function getThemeNegotiator() { - return $this->data['negotiator']; - } - - /** - * @return int - */ - public function getTime() { - return $this->getProfile()->getDuration() * 1000; - } - - /** - * @return mixed - */ - public function getTemplateCount() { - return $this->getComputedData('template_count'); - } - - /** - * @return mixed - */ - public function getTemplates() { - return $this->getComputedData('templates'); - } - - /** - * @return mixed - */ - public function getBlockCount() { - return $this->getComputedData('block_count'); - } - - /** - * @return mixed - */ - public function getMacroCount() { - return $this->getComputedData('macro_count'); - } - - /** - * @return \Twig_Markup - */ - public function getHtmlCallGraph() { - $dumper = new HtmlDumper(); - - return new \Twig_Markup($dumper->dump($this->getProfile()), 'UTF-8'); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'theme'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Theme'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Name: @name', ['@name' => $this->getActiveTheme()['name']]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlVJREFUeNrMlk1IVFEUx53K6AOjUBQri6SihQiRziaRQegDlKJFBCpSiZtoE4hWtFFRwcCVBqEWfaAE7SoXajXLQoRcFAUSaBgUJQxKYUrT78D/wevx3psaE7rw49x377ln7vl4500kmUxm/OuxJmMVxrqwzVgsth5xHKogCnthCd7BU7gdj8envOciQe5j8CyiFQq0tAgDsA+OaG0eLmF4INQoxrYg+iEXhqEGiqGBw/3SGUeU6MgC61mBMUU5GzEKJ6ES5S5knbbXui/jmv8MjCkGMxEPFbsFyAeL1y6pXEenSO4fctlIhCXqqtmGj5ADcblZoX1z8aLn/Es475soDhcyfwt3LPDK8jPYFlIcZrCCEH0LqlP7NXN/CCUL/CvmkynKcczPoNv9Y5LXuHVC2Y6mMFoetOG4/0kl9LfDquMyN076ue/I11ANHSqVH0pgLUz7GK2HjUHuf1DGm/jVYZVYJeILz5163oy46Tn/GL5r396yc+hXOzcckiyVQp7CsVNvmI2DHoODcMFcR6eZ+RO4747pJuYjcFilssMM6vB7+Or8IGMWWjDWx7ntzHvglCWZtfbf3n0UtiJ6FVO/8QbuQh+H59C37nUD9sAj1k6ENZQylctuJWsGJswDDibY32C3gitKsCUwyt7nlK0vpMc2Wh/Q4zIcxeDztDu/QjSoPmujzWswZef3GLRXuV2xPa3u/yDwjfoDgxE1nP1aquOG91b64StWlp0xtaKvKbfMUS1maukWvEj7a6pxBg6oL1iddnsbSFox/S/+TKyK0V8CDABrCdI/1oTqiQAAAABJRU5ErkJggg=='; - } - - /** - * @return array - */ - public function getData() { - $data = $this->data; - - $data['twig'] = [ - 'callgraph' => (string) $this->getHtmlCallGraph(), - 'render_time' => $this->getTime(), - 'template_count' => $this->getTemplateCount(), - 'templates' => $this->getTemplates(), - 'block_count' => $this->getBlockCount(), - 'macro_count' => $this->getMacroCount(), - ]; - - return $data; - } - - /** - * @return mixed|\Twig_Profiler_Profile - */ - private function getProfile() { - if (NULL === $this->profile) { - $this->profile = unserialize($this->data['twig']); - } - - return $this->profile; - } - - /** - * @param $index - * - * @return mixed - */ - private function getComputedData($index) { - if (NULL === $this->computed) { - $this->computed = $this->computeData($this->getProfile()); - } - - return $this->computed[$index]; - } - - /** - * @param \Twig_Profiler_Profile $profile - * - * @return array - */ - private function computeData(\Twig_Profiler_Profile $profile) { - $data = [ - 'template_count' => 0, - 'block_count' => 0, - 'macro_count' => 0, - ]; - - $templates = []; - foreach ($profile as $p) { - $d = $this->computeData($p); - - $data['template_count'] += ($p->isTemplate() ? 1 : 0) + $d['template_count']; - $data['block_count'] += ($p->isBlock() ? 1 : 0) + $d['block_count']; - $data['macro_count'] += ($p->isMacro() ? 1 : 0) + $d['macro_count']; - - if ($p->isTemplate()) { - if (!isset($templates[$p->getTemplate()])) { - $templates[$p->getTemplate()] = 1; - } - else { - $templates[$p->getTemplate()]++; - } - } - - foreach ($d['templates'] as $template => $count) { - if (!isset($templates[$template])) { - $templates[$template] = $count; - } - else { - $templates[$template] += $count; - } - } - } - $data['templates'] = $templates; - - return $data; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TimeDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TimeDataCollector.php deleted file mode 100644 index d2aa0442d..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TimeDataCollector.php +++ /dev/null @@ -1,157 +0,0 @@ -data['memory_limit'] = $this->convertToBytes(ini_get('memory_limit')); - $this->updateMemoryUsage(); - } - - /** - * {@inheritdoc} - */ - public function lateCollect() { - parent::lateCollect(); - - $this->updateMemoryUsage(); - } - - /** - * Gets the memory. - * - * @return int - * The memory - */ - public function getMemory() { - return $this->data['memory']; - } - - /** - * Gets the PHP memory limit. - * - * @return int - * The memory limit - */ - public function getMemoryLimit() { - return $this->data['memory_limit']; - } - - /** - * Updates the memory usage data. - */ - public function updateMemoryUsage() { - $this->data['memory'] = memory_get_peak_usage(TRUE); - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Timeline'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Duration: @duration', ['@duration' => sprintf('%.0f ms', $this->getDuration())]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAcCAYAAABoMT8aAAABqUlEQVR42t2Vv0sCYRyHX9OmEhsMx/YKGlwLQ69DTEUSBJEQEy5J3FRc/BsuiFqEIIcQIRo6ysUhoaBBWhoaGoJwiMJLglRKrs8bXgienmkQdPDAwX2f57j3fhFJkkbiPwTK5bIiFoul3kmPud8MqKMewDXpwuGww+12n9hsNhFnlijYf/Z4PDmO45Yxo+10ZFGTyWRMEItU6AdCx7lczkgd6n7J2Wx2xm63P6jJMk6n80YQBBN1aUDv9XqvlAbbm2LE7/cLODRB0un0VveAeoDC8/waCQQC18MGQqHQOcEKvw8bcLlcL6TfYnVtCrGRAlartUUYhmn1jKg/E3USjUYfhw3E4/F7ks/nz4YNFIvFQ/ogbUYikdefyqlU6gnuOg2YK5XKvs/n+xhUDgaDTVEUt+HO04ABOBA5isViDTU5kUi81Wq1AzhWMEkDGmAEq2C3UCjcYXGauDvfEsuyUjKZbJRKpVvM8IABU9SVX+cxYABmwIE9cFqtVi9xtgvsC2AHbIAFoKey0gdlHEyDObAEWLACFsEsMALdIJ80+dK0bTS95v7+v/AJnis0eO906QwAAAAASUVORK5CYII='; - } - - /** - * {@inheritdoc} - */ - public function getLibraries() { - return [ - 'webprofiler/timeline', - ]; - } - - /** - * {@inheritdoc} - */ - public function getDrupalSettings() { - /** @var StopwatchEvent[] $collectedEvents */ - $collectedEvents = $this->getEvents(); - - if (!empty($collectedEvents)) { - $sectionPeriods = $collectedEvents['__section__']->getPeriods(); - $endTime = end($sectionPeriods)->getEndTime(); - $events = []; - - foreach ($collectedEvents as $key => $collectedEvent) { - if ('__section__' != $key) { - $periods = []; - foreach ($collectedEvent->getPeriods() as $period) { - $periods[] = [ - 'start' => sprintf("%F", $period->getStartTime()), - 'end' => sprintf("%F", $period->getEndTime()), - ]; - } - - $events[] = [ - "name" => $key, - "category" => $collectedEvent->getCategory(), - "origin" => sprintf("%F", $collectedEvent->getOrigin()), - "starttime" => sprintf("%F", $collectedEvent->getStartTime()), - "endtime" => sprintf("%F", $collectedEvent->getEndTime()), - "duration" => sprintf("%F", $collectedEvent->getDuration()), - "memory" => sprintf("%.1F", $collectedEvent->getMemory() / 1024 / 1024), - "periods" => $periods, - ]; - } - } - - return ['time' => ['events' => $events, 'endtime' => $endTime]]; - } - else { - return ['time' => ['events' => [], 'endtime' => 0]]; - } - } - - /** - * @return array - */ - public function getData() { - $data = $this->data; - - $data['duration'] = $this->getDuration(); - $data['initTime'] = $this->getInitTime(); - - return $data; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TranslationsDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TranslationsDataCollector.php deleted file mode 100644 index 23b49eab6..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/TranslationsDataCollector.php +++ /dev/null @@ -1,99 +0,0 @@ -translation = $translation; - $this->urlGenerator = $urlGenerator; - - $this->data['translations']['translated'] = []; - $this->data['translations']['untranslated'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - if($this->translation instanceof TranslationManagerWrapper) { - /** \Drupal\webprofiler\StringTranslation\TranslationManagerWrapper $this->translation */ - $this->data['translations']['translated'] = $this->translation->getTranslated(); - $this->data['translations']['untranslated'] = $this->translation->getUntranslated(); - } - $this->data['user_interface_translations_path'] = $this->urlGenerator->generateFromRoute('locale.translate_page'); - } - - /** - * @return int - */ - public function getTranslatedCount() { - return count($this->data['translations']['translated']); - } - - /** - * @return int - */ - public function getUntranslatedCount() { - return count($this->data['translations']['untranslated']); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'translations'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Translations'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Translated: @translated, untranslated: @untranslated', [ - '@translated' => $this->getTranslatedCount(), - '@untranslated' => $this->getUntranslatedCount() - ]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgpJREFUeNrUVrFuwjAQPUcZiAQDQ6WEbgwwMCJVqhjgBxhYGSvEDzBkZYSBH+ADoFJHlg4MdIMKxiLBXKAbUmEm9bPiyAREEgRDTzqZ2Mfzu7tnJ8xxHLq1aXQHuwsos2078p9arVYg0yL3CXcnwCdubKDp3F+5myFin9xYK0xNzQiZm1c3KpVKUb1ep2QyebvuFwoFSqfTlM/nbweay+VoOBxeDar7JwC03W49UO5fs9nsZTwef8qYUqkUjSmAYrGYqKlhGFSpVH45oBFFdkdM0RjUst1uC7Z45ofjWdO0t8Ph8CDjyuUyZTIZ6na7tNvtTmSn+2s5n88FIMwdPzhgUWYBA2A2mxVjIpEQarEsiwaDAS2XSxPH9OI1xVNnbmo0Go28eTDkAOL3YrGg/X4v1tfr9WmjLplsULVaFawbjYbHkjfzqPsr7o9RwJE2HOkifbAGS1ljdL/G/ScsWK/XE+NmsxGMkW6/3xfgWMMIpu9hLgkEN5tNDwClgAoADjAYRszr8m7kD2gGU5uh1hEjmoGUUU/oGLVEXaVhA2yoKYAwRwFx/Ezj8bjHEIYaSgVgDptNp1NiePG5QCfS4qyZXANop9MR7JANWAFA6hWgWEcmqqTYOWBVl0jZf0ViU+hUNk0AyVf0ObYK0+8IslupF8qlkxVWdoipsaCPiaBr7uwr+t98ofwJMADuIP9IDjFbLwAAAABJRU5ErkJggg=='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/UserDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/UserDataCollector.php deleted file mode 100644 index e2b7a1015..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/UserDataCollector.php +++ /dev/null @@ -1,141 +0,0 @@ -currentUser = $currentUser; - $this->entityManager = $entityManager; - $this->configFactory = $configFactory; - $this->providerCollector = $providerCollector; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $this->data['name'] = $this->currentUser->getDisplayName(); - $this->data['authenticated'] = $this->currentUser->isAuthenticated(); - - $this->data['roles'] = []; - $storage = $this->entityManager->getStorage('user_role'); - foreach ($this->currentUser->getRoles() as $role) { - $entity = $storage->load($role); - $this->data['roles'][] = $entity->label(); - } - - foreach ($this->providerCollector->getSortedProviders() as $provider_id => $provider) { - if ($provider->applies($request)) { - $this->data['provider'] = $provider_id; - } - } - - $this->data['anonymous'] = $this->configFactory->get('user.settings') - ->get('anonymous'); - } - - /** - * @return \Drupal\Core\Session\AccountInterface - */ - public function getUserName() { - return $this->data['name']; - } - - /** - * @return bool - */ - public function getAuthenticated() { - return $this->data['authenticated']; - } - - /** - * @return array - */ - public function getRoles() { - return $this->data['roles']; - } - - /** - * @return string - */ - public function getProvider() { - return $this->data['provider']; - } - - /** - * @return string - */ - public function getAnonymous() { - return $this->data['anonymous']; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'user'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('User'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->getUserName(); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAC70lEQVR42u2V3UtTYRzHu+mFwCwK+gO6CEryPlg7yiYx50vDqUwjFIZDSYUk2ZTmCysHvg9ZVggOQZiRScsR4VwXTjEwdKZWk8o6gd5UOt0mbev7g/PAkLONIOkiBx+25/v89vuc85zn2Q5Fo9F95UDwnwhS5HK5TyqVRv8m1JN6k+AiC+fn54cwbgFNIrTQ/J9IqDcJJDGBHsgDgYBSq9W6ysvLPf39/SSUUU7zsQ1yc3MjmN90OBzfRkZG1umzQqGIxPSTkIBjgdDkaGNjoza2kcFgUCE/QvMsq6io2PV6vQu1tbV8Xl7etkql2qqvr/+MbDE/Pz8s9OP2Cjhwwmw29+4R3Kec1WZnZ4fn5uamc3Jyttra2qbH8ero6JgdHh5+CvFHq9X6JZHgzODgoCVW0NPTY0N+ltU2Nzdv4GqXsYSrPp+vDw80aLFYxru6uhyQ/rDb7a8TCVJDodB1jUazTVlxcXGQ5/mbyE+z2u7u7veY38BVT3Z2djopm5qa6isrK/tQWVn5qb29fSGR4DC4PDAwMEsZHuArjGnyGKutq6v7ajQaF6urq9/MzMz0QuSemJiwQDwGkR0POhhXgILjNTU1TaWlpTxlOp1uyWQyaUjMajMzM8Nut/tJQUHBOpZppbCwkM/KytrBznuL9xDVxBMo8KXHYnu6qKjIivmrbIy67x6Px4Yd58W672ApfzY0NCyNjo7OZmRkiAv8fr+O47iwmABXtoXaG3uykF6vX7bZbF6cgZWqqiqezYkKcNtmjO+CF2AyhufgjsvlMiU7vXEF+4C4ALf9CwdrlVAqlcFkTdRqdQSHLUDgBEeSCrArAsiGwENs0XfJBE6ncxm1D8Aj/B6tigkkJSUlmxSwLYhMDeRsyyUCd+lHrWxtbe2aTCbbZTn1ZD92F0Cr8GBfgnsgDZwDt8EzMBmHMXBLqD0PDMAh9Gql3iRIESQSIAXp4CRIBZeEjIvDFZAm1J4C6UK9ROiZcvCn/+8FvwHtDdJEaRY+oQAAAABJRU5ErkJggg=='; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ViewsDataCollector.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ViewsDataCollector.php deleted file mode 100644 index 64706f72f..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DataCollector/ViewsDataCollector.php +++ /dev/null @@ -1,118 +0,0 @@ -entityManager = $entityManager; - $this->view_executable_factory = $view_executable_factory; - - $this->data['views'] = []; - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Exception $exception = NULL) { - $views = $this->view_executable_factory->getViews(); - $storage = $this->entityManager->getStorage('view'); - - /** @var TraceableViewExecutable $view */ - foreach ($views as $view) { - if ($view->executed) { - $data = [ - 'id' => $view->storage->id(), - 'current_display' => $view->current_display, - 'build_time' => $view->getBuildTime(), - 'execute_time' => $view->getExecuteTime(), - 'render_time' => $view->getRenderTime(), - ]; - - $entity = $storage->load($view->storage->id()); - if ($entity->hasLinkTemplate('edit-display-form')) { - $route = $entity->toUrl('edit-display-form'); - $route->setRouteParameter('display_id', $view->current_display); - $data['route'] = $route->toString(); - } - - $this->data['views'][] = $data; - } - } - -// TODO: also use those data. -// $loaded = $this->entityManager->getLoaded('view'); -// -// if ($loaded) { -// /** @var \Drupal\webprofiler\Entity\EntityStorageDecorator $views */ -// foreach ($loaded->getEntities() as $views) { -// $this->data['views'][] = array( -// 'id' => $views->get('id'), -// ); -// } -// } - } - - /** - * @return int - */ - public function getViewsCount() { - return count($this->data['views']); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'views'; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Views'); - } - - /** - * {@inheritdoc} - */ - public function getPanelSummary() { - return $this->t('Total: @count', ['@count' => $this->getViewsCount()]); - } - - /** - * {@inheritdoc} - */ - public function getIcon() { - return 'iVBORw0KGgoAAAANSUhEUgAAABUAAAAcCAYAAACOGPReAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowNDgwMTE3NDA3MjA2ODExOEY2MkNCNjI0NDY3NzkwRCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNEVFREM2NkQ4MUMxMUUzQkMwRUNBMkQwMzE4QjVBMyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNEVFREM2NUQ4MUMxMUUzQkMwRUNBMkQwMzE4QjVBMyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgTWFjaW50b3NoIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDQ4MDExNzQwNzIwNjgxMThGNjJDQjYyNDQ2Nzc5MEQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDQ4MDExNzQwNzIwNjgxMThGNjJDQjYyNDQ2Nzc5MEQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6vqYfFAAAAXUlEQVR42mL8//8/A7UBEwMNwKih1AcsIGLz5s1USwK+vr6MLMgcSg2EOW6IhSkycHR0BHth//79jMh8fACmlr4uRbcVnT8apqNhOhqmAxZR1CyoGUfrfaoDgAADAA4QNs9x67RnAAAAAElFTkSuQmCC'; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Decorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Decorator.php deleted file mode 100644 index 270117d1e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Decorator.php +++ /dev/null @@ -1,94 +0,0 @@ -object = $object; - } - - /** - * Return the original (i.e. non decorated) object. - * - * @return mixed - * The original object. - */ - public function getOriginalObject() { - $object = $this->object; - while ($object instanceof Decorator) { - $object = $object->getOriginalObject(); - } - return $object; - } - - /** - * Returns true if $method is a PHP callable. - * - * @param string $method - * The method name. - * @param bool $checkSelf - * - * @return bool|mixed - */ - public function isCallable($method, $checkSelf = FALSE) { - //Check the original object - $object = $this->getOriginalObject(); - if (is_callable([$object, $method])) { - return $object; - } - // Check Decorators. - $object = $checkSelf ? $this : $this->object; - while ($object instanceof Decorator) { - if (is_callable([$object, $method])) { - return $object; - } - $object = $this->object; - } - return FALSE; - } - - /** - * @param $method - * @param $args - * - * @return mixed - * - * @throws \Exception - */ - public function __call($method, $args) { - if ($object = $this->isCallable($method)) { - return call_user_func_array([$object, $method], $args); - } - throw new \Exception( - 'Undefined method - ' . get_class($this->getOriginalObject()) . '::' . $method - ); - } - - /** - * @param $property - * - * @return null - */ - public function __get($property) { - $object = $this->getOriginalObject(); - if (property_exists($object, $property)) { - return $object->$property; - } - return NULL; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DependencyInjection/TraceableContainer.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DependencyInjection/TraceableContainer.php deleted file mode 100644 index adea886e7..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DependencyInjection/TraceableContainer.php +++ /dev/null @@ -1,66 +0,0 @@ -stopwatch && $this->has('stopwatch')) { - $this->stopwatch = parent::get('stopwatch'); - $this->stopwatch->openSection(); - $this->hasStopwatch = TRUE; - } - - if ('stopwatch' === $id) { - return $this->stopwatch; - } - - Timer::start($id); - if ($this->hasStopwatch) { - $e = $this->stopwatch->start($id, 'service'); - } - - $service = parent::get($id, $invalidBehavior); - - $this->tracedData[$id] = Timer::stop($id); - if ($this->hasStopwatch && $e->isStarted()) { - $e->stop(); - } - - return $service; - } - - /** - * @return array - */ - public function getTracedData() { - return $this->tracedData; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/DrupalDataCollectorInterface.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/DrupalDataCollectorInterface.php deleted file mode 100644 index 8a02b353f..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/DrupalDataCollectorInterface.php +++ /dev/null @@ -1,67 +0,0 @@ -entities = []; - } - - /** - * {@inheritdoc} - */ - public function resetCache(array $ids = NULL) { - $this->getOriginalObject()->resetCache($ids); - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $ids = NULL) { - $entities = $this->getOriginalObject()->loadMultiple($ids); - - $this->entities = array_merge($this->entities, $entities); - - return $entities; - } - - /** - * {@inheritdoc} - */ - public function load($id) { - $entity = $this->getOriginalObject()->load($id); - - $this->entities[$id] = $entity; - - return $entity; - } - - /** - * {@inheritdoc} - */ - public function loadUnchanged($id) { - return $this->getOriginalObject()->loadUnchanged($id); - } - - /** - * {@inheritdoc} - */ - public function loadRevision($revision_id) { - return $this->getOriginalObject()->loadRevision($revision_id); - } - - /** - * {@inheritdoc} - */ - public function deleteRevision($revision_id) { - $this->getOriginalObject()->deleteRevision($revision_id); - } - - /** - * {@inheritdoc} - */ - public function loadByProperties(array $values = []) { - $entities = $this->getOriginalObject()->loadByProperties($values); - - $this->entities = array_merge($this->entities, $entities); - - return $entities; - } - - /** - * {@inheritdoc} - */ - public function create(array $values = []) { - return $this->getOriginalObject()->create($values); - } - - /** - * {@inheritdoc} - */ - public function delete(array $entities) { - $this->getOriginalObject()->delete($entities); - } - - /** - * {@inheritdoc} - */ - public function save(EntityInterface $entity) { - return $this->getOriginalObject()->save($entity); - } - - /** - * {@inheritdoc} - */ - public function hasData() { - return $this->getOriginalObject()->hasData(); - } - - /** - * {@inheritdoc} - */ - public function getQuery($conjunction = 'AND') { - return $this->getOriginalObject()->getQuery($conjunction); - } - - /** - * {@inheritdoc} - */ - public function getEntityTypeId() { - return $this->getOriginalObject()->getEntityTypeId(); - } - - /** - * {@inheritdoc} - */ - public function getEntityType() { - return $this->getOriginalObject()->getEntityType(); - } - - /** - * {@inheritdoc} - */ - public static function getIDFromConfigName($config_name, $config_prefix) { - return substr($config_name, strlen($config_prefix . '.')); - } - - /** - * {@inheritdoc} - */ - public function createFromStorageRecord(array $values) { - return $this->getOriginalObject()->createFromStorageRecord($values); - } - - /** - * {@inheritdoc} - */ - public function updateFromStorageRecord(ConfigEntityInterface $entity, array $values) { - return $this->getOriginalObject() - ->updateFromStorageRecord($entity, $values); - } - - /** - * {@inheritdoc} - */ - public function getAggregateQuery($conjunction = 'AND') { - return $this->getOriginalObject()->getAggregateQuery($conjunction); - } - - /** - * {@inheritdoc} - */ - public function loadOverrideFree($id) { - return $this->getOriginalObject()->loadOverrideFree($id); - } - - /** - * {@inheritdoc} - */ - public function loadMultipleOverrideFree(array $ids = NULL) { - return $this->getOriginalObject()->loadMultipleOverrideFree($ids); - } - - /** - * {@inheritdoc} - */ - public function importCreate($name, Config $new_config, Config $old_config) { - $this->getOriginalObject()->importCreate($name, $new_config, $old_config); - } - - /** - * {@inheritdoc} - */ - public function importUpdate($name, Config $new_config, Config $old_config) { - $this->getOriginalObject()->importUpdate($name, $new_config, $old_config); - } - - /** - * {@inheritdoc} - */ - public function importDelete($name, Config $new_config, Config $old_config) { - $this->getOriginalObject()->importDelete($name, $new_config, $old_config); - } - - /** - * {@inheritdoc} - */ - public function importRename($old_name, Config $new_config, Config $old_config) { - $this->getOriginalObject()->importRename($old_name, $new_config, $old_config); - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('config.factory'), - $container->get('uuid'), - $container->get('language_manager') - ); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php deleted file mode 100644 index a075b29ee..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php +++ /dev/null @@ -1,33 +0,0 @@ -getOriginalObject()->setReplacementId($name, $replacement); - } - - /** - * {@inheritdoc} - */ - public function getReplacementId($name) { - return $this->getOriginalObject()->getReplacementId($name); - } - - /** - * {@inheritdoc} - */ - public function clearReplacementId($name) { - return $this->getOriginalObject()->clearReplacementId($name); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/RoleStorageDecorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/RoleStorageDecorator.php deleted file mode 100644 index ede1e502a..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/RoleStorageDecorator.php +++ /dev/null @@ -1,19 +0,0 @@ -getOriginalObject()->isPermissionInRoles($permission, $rids); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ShortcutSetStorageDecorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ShortcutSetStorageDecorator.php deleted file mode 100644 index 7248ba1ce..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/ShortcutSetStorageDecorator.php +++ /dev/null @@ -1,56 +0,0 @@ -getOriginalObject()->assignUser($shortcut_set, $account); - } - - /** - * {@inheritdoc} - */ - public function unassignUser($account) { - return $this->getOriginalObject()->unassignUser($account); - } - - /** - * {@inheritdoc} - */ - public function deleteAssignedShortcutSets(ShortcutSetInterface $entity) { - $this->getOriginalObject()->deleteAssignedShortcutSets($entity); - } - - /** - * {@inheritdoc} - */ - public function getAssignedToUser($account) { - return $this->getOriginalObject()->getAssignedToUser($account); - } - - /** - * {@inheritdoc} - */ - public function countAssignedUsers(ShortcutSetInterface $shortcut_set) { - return $this->getOriginalObject()->countAssignedUsers($shortcut_set); - } - - /** - * {@inheritdoc} - */ - public function getDefaultSet(AccountInterface $account) { - return $this->getOriginalObject()->getDefaultSet($account); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/VocabularyStorageDecorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/VocabularyStorageDecorator.php deleted file mode 100644 index 6c40134e2..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/Decorators/Config/VocabularyStorageDecorator.php +++ /dev/null @@ -1,19 +0,0 @@ -getOriginalObject()->getToplevelTids($vids); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityDecorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityDecorator.php deleted file mode 100644 index 3ec186db9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityDecorator.php +++ /dev/null @@ -1,24 +0,0 @@ -entities; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityManagerWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityManagerWrapper.php deleted file mode 100644 index 357971021..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityManagerWrapper.php +++ /dev/null @@ -1,243 +0,0 @@ -entityManager = $entityManager; - } - - /** - * {@inheritdoc} - */ - public function getStorage($entity_type) { - /** @var ConfigEntityStorageInterface $handler */ - $handler = $this->getHandler($entity_type, 'storage'); - $type = ($handler instanceof ConfigEntityStorageInterface) ? 'config' : 'content'; - - if (!isset($this->loaded[$type][$entity_type])) { - $handler = $this->getStorageDecorator($entity_type, $handler); - $this->loaded[$type][$entity_type] = $handler; - } - else { - $handler = $this->loaded[$type][$entity_type]; - } - - return $handler; - } - - /** - * {@inheritdoc} - */ - public function getViewBuilder($entity_type) { - /** @var EntityViewBuilderInterface $handler */ - $handler = $this->getHandler($entity_type, 'view_builder'); - - if ($handler instanceof EntityViewBuilderInterface) { - if (!isset($this->rendered[$entity_type])) { - $handler = new EntityViewBuilderDecorator($handler); - $this->rendered[$entity_type] = $handler; - } - else { - $handler = $this->rendered[$entity_type]; - } - } - - return $handler; - } - - /** - * @param $entity_type - * @param $handler - * - * @return \Drupal\webprofiler\Entity\EntityDecorator - */ - private function getStorageDecorator($entity_type, $handler) { - if ($handler instanceof ConfigEntityStorageInterface) { - switch ($entity_type) { - case 'taxonomy_vocabulary': - return new VocabularyStorageDecorator($handler); - break; - case 'user_role': - return new RoleStorageDecorator($handler); - break; - case 'shortcut_set': - return new ShortcutSetStorageDecorator($handler); - break; - case 'image_style': - return new ImageStyleStorageDecorator($handler); - break; - default: - return new ConfigEntityStorageDecorator($handler); - break; - } - } - return $handler; - } - - /** - * @param $type - * @param $entity_type - * - * @return array - */ - public function getLoaded($type, $entity_type) { - return isset($this->loaded[$type][$entity_type]) ? $this->loaded[$type][$entity_type] : NULL; - } - - /** - * @param $entity_type - * - * @return array - */ - public function getRendered( $entity_type) { - return isset($this->rendered[$entity_type]) ? $this->rendered[$entity_type] : NULL; - } - - /** - * {@inheritdoc} - */ - public function useCaches($use_caches = FALSE) { - $this->entityManager->useCaches($use_caches); - } - - /** - * {@inheritdoc} - */ - public function hasDefinition($plugin_id) { - return $this->entityManager->hasDefinition($plugin_id); - } - - /** - * {@inheritdoc} - */ - public function getAccessControlHandler($entity_type) { - return $this->entityManager->getAccessControlHandler($entity_type); - } - - /** - * {@inheritdoc} - */ - public function clearCachedDefinitions() { - $this->entityManager->clearCachedDefinitions(); - } - - /** - * {@inheritdoc} - */ - public function getListBuilder($entity_type) { - return $this->entityManager->getListBuilder($entity_type); - } - - /** - * {@inheritdoc} - */ - public function getFormObject($entity_type, $operation) { - return $this->entityManager->getFormObject($entity_type, $operation); - } - - /** - * {@inheritdoc} - */ - public function getRouteProviders($entity_type) { - return $this->entityManager->getRouteProviders($entity_type); - } - - /** - * {@inheritdoc} - */ - public function hasHandler($entity_type, $handler_type) { - return $this->entityManager->hasHandler($entity_type, $handler_type); - } - - /** - * {@inheritdoc} - */ - public function getHandler($entity_type, $handler_type) { - return $this->entityManager->getHandler($entity_type, $handler_type); - } - - /** - * {@inheritdoc} - */ - public function createHandlerInstance( - $class, - EntityTypeInterface $definition = NULL - ) { - return $this->entityManager->createHandlerInstance($class, $definition); - } - - /** - * {@inheritdoc} - */ - public function getDefinition($entity_type_id, $exception_on_invalid = TRUE) { - return $this->entityManager->getDefinition( - $entity_type_id, - $exception_on_invalid - ); - } - - /** - * {@inheritdoc} - */ - public function getDefinitions() { - return $this->entityManager->getDefinitions(); - } - - /** - * {@inheritdoc} - */ - public function createInstance($plugin_id, array $configuration = []) { - return $this->entityManager->createInstance($plugin_id, $configuration); - } - - /** - * {@inheritdoc} - */ - public function getInstance(array $options) { - return $this->entityManager->getInstance($options); - } - - /** - * {@inheritdoc} - */ - public function setContainer(ContainerInterface $container = NULL) { - $this->entityManager->setContainer($container); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityViewBuilderDecorator.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityViewBuilderDecorator.php deleted file mode 100644 index 0b201ac0d..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Entity/EntityViewBuilderDecorator.php +++ /dev/null @@ -1,92 +0,0 @@ -entities = []; - } - - /** - * {@inheritdoc} - */ - public function buildComponents(array &$build, array $entities, array $displays, $view_mode, $langcode = NULL) { - $this->getOriginalObject() - ->buildComponents($build, $entities, $displays, $view_mode, $langcode); - } - - /** - * {@inheritdoc} - */ - public function view(EntityInterface $entity, $view_mode = 'full', $langcode = NULL) { - $this->entities[] = $entity; - - return $this->getOriginalObject()->view($entity, $view_mode, $langcode); - } - - /** - * {@inheritdoc} - */ - public function viewMultiple(array $entities = [], $view_mode = 'full', $langcode = NULL) { - $this->entities = array_merge($this->entities, $entities); - - return $this->getOriginalObject() - ->viewMultiple($entities, $view_mode, $langcode); - } - - /** - * {@inheritdoc} - */ - public function resetCache(array $entities = NULL) { - $this->getOriginalObject()->resetCache($entities); - } - - /** - * {@inheritdoc} - */ - public function viewField(FieldItemListInterface $items, $display_options = []) { - return $this->getOriginalObject()->viewField($items, $display_options); - } - - /** - * {@inheritdoc} - */ - public function viewFieldItem(FieldItemInterface $item, $display_options = []) { - return $this->getOriginalObject()->viewFieldItem($item, $display_options); - } - - /** - * {@inheritdoc} - */ - public function getCacheTags() { - return $this->getOriginalObject()->getCacheTag(); - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity.manager'), - $container->get('language_manager') - ); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/EventDispatcher/EventDispatcherTraceableInterface.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/EventDispatcher/EventDispatcherTraceableInterface.php deleted file mode 100644 index dbad15153..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/EventDispatcher/EventDispatcherTraceableInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -notCalledListeners = $listeners; - } - - /** - * {@inheritdoc} - */ - public function addListener($event_name, $listener, $priority = 0) { - parent::addListener($event_name, $listener, $priority); - $this->notCalledListeners[$event_name][$priority][] = ['callable' => $listener]; - } - - /** - * {@inheritdoc} - */ - public function dispatch($event_name, Event $event = NULL) { - if ($event === NULL) { - $event = new Event(); - } - - $this->preDispatch($event_name, $event); - $e = $this->stopwatch->start($event_name, 'section'); - - if (isset($this->listeners[$event_name])) { - // Sort listeners if necessary. - if (isset($this->unsorted[$event_name])) { - krsort($this->listeners[$event_name]); - unset($this->unsorted[$event_name]); - } - - // Invoke listeners and resolve callables if necessary. - foreach ($this->listeners[$event_name] as $priority => &$definitions) { - foreach ($definitions as $key => &$definition) { - if (!isset($definition['callable'])) { - $definition['callable'] = [ - $this->container->get($definition['service'][0]), - $definition['service'][1], - ]; - } - - $definition['callable']($event, $event_name, $this); - - $this->addCalledListener($definition, $event_name, $priority); - - if ($event->isPropagationStopped()) { - return $event; - } - } - } - } - - if ($e->isStarted()) { - $e->stop(); - } - - $this->postDispatch($event_name, $event); - - return $event; - } - - /** - * {@inheritdoc} - */ - public function getCalledListeners() { - return $this->calledListeners; - } - - /** - * {@inheritdoc} - */ - public function getNotCalledListeners() { - return $this->notCalledListeners; - } - - /** - * @param \Drupal\webprofiler\Stopwatch $stopwatch - */ - public function setStopwatch(Stopwatch $stopwatch) { - $this->stopwatch = $stopwatch; - } - - /** - * Called before dispatching the event. - * - * @param string $eventName The event name - * @param Event $event The event - */ - protected function preDispatch($eventName, Event $event) { - switch ($eventName) { - case KernelEvents::VIEW: - case KernelEvents::RESPONSE: - // stop only if a controller has been executed - if ($this->stopwatch->isStarted('controller')) { - $this->stopwatch->stop('controller'); - } - break; - } - } - - /** - * Called after dispatching the event. - * - * @param string $eventName The event name - * @param Event $event The event - */ - protected function postDispatch($eventName, Event $event) { - switch ($eventName) { - case KernelEvents::CONTROLLER: - $this->stopwatch->start('controller', 'section'); - break; - case KernelEvents::RESPONSE: - $token = $event->getResponse()->headers->get('X-Debug-Token'); - try { - $this->stopwatch->stopSection($token); - } - catch (\LogicException $e) { - } - break; - case KernelEvents::TERMINATE: - // In the special case described in the `preDispatch` method above, the `$token` section - // does not exist, then closing it throws an exception which must be caught. - $token = $event->getResponse()->headers->get('X-Debug-Token'); - try { - $this->stopwatch->stopSection($token); - } - catch (\LogicException $e) { - } - break; - } - } - - /** - * @param $definition - * @param $event_name - * @param $priority - */ - private function addCalledListener($definition, $event_name, $priority) { - if ($this->isClosure($definition['callable'])) { - $this->calledListeners[$event_name][$priority][] = [ - 'class' => 'Closure', - 'method' => '', - ]; - } - else { - $this->calledListeners[$event_name][$priority][] = [ - 'class' => get_class($definition['callable'][0]), - 'method' => $definition['callable'][1], - ]; - } - - foreach ($this->notCalledListeners[$event_name][$priority] as $key => $listener) { - if (isset($listener['service'])) { - if ($listener['service'][0] == $definition['service'][0] && $listener['service'][1] == $definition['service'][1]) { - unset($this->notCalledListeners[$event_name][$priority][$key]); - } - } - else { - if ($this->isClosure($listener['callable'])) { - if (is_callable($listener['callable'], TRUE, $listenerCallableName) && is_callable($definition['callable'], TRUE, $definitionCallableName)) { - if ($listenerCallableName == $definitionCallableName) { - unset($this->notCalledListeners[$event_name][$priority][$key]); - } - } - } - else { - if (get_class($listener['callable'][0]) == get_class($definition['callable'][0]) && $listener['callable'][1] == $definition['callable'][1]) { - unset($this->notCalledListeners[$event_name][$priority][$key]); - } - } - } - - } - } - - private function isClosure($t) { - return is_object($t) && ($t instanceof \Closure); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/ProfilerSubscriber.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/ProfilerSubscriber.php deleted file mode 100644 index d3f3124fc..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/ProfilerSubscriber.php +++ /dev/null @@ -1,118 +0,0 @@ -profiler = $profiler; - $this->matcher = $matcher; - $this->onlyException = (bool) $onlyException; - $this->onlyMasterRequests = (bool) $onlyMasterRequests; - $this->profiles = new \SplObjectStorage(); - $this->parents = new \SplObjectStorage(); - $this->requestStack = $requestStack; - } - - /** - * Handles the onKernelException event. - */ - public function onKernelException(GetResponseForExceptionEvent $event) { - if ($this->onlyMasterRequests && !$event->isMasterRequest()) { - return; - } - - $this->exception = $event->getException(); - } - - /** - * Handles the onKernelResponse event. - */ - public function onKernelResponse(FilterResponseEvent $event) { - $master = $event->isMasterRequest(); - if ($this->onlyMasterRequests && !$master) { - return; - } - - if ($this->onlyException && NULL === $this->exception) { - return; - } - - $request = $event->getRequest(); - $exception = $this->exception; - $this->exception = NULL; - - if (NULL !== $this->matcher && !$this->matcher->matches($request)) { - return; - } - - if (!$profile = $this->profiler->collect($request, $event->getResponse(), $exception)) { - return; - } - - $this->profiles[$request] = $profile; - - $this->parents[$request] = $this->requestStack->getParentRequest(); - } - - public function onKernelFinishRequest(FinishRequestEvent $event) { - // attach children to parents - foreach ($this->profiles as $request) { - if (NULL !== $parentRequest = $this->parents[$request]) { - if (isset($this->profiles[$parentRequest])) { - $this->profiles[$parentRequest]->addChild($this->profiles[$request]); - } - } - } - - // save profiles - foreach ($this->profiles as $request) { - $this->profiler->saveProfile($this->profiles[$request]); - } - - $this->profiles = new \SplObjectStorage(); - $this->parents = new \SplObjectStorage(); - } - - public static function getSubscribedEvents() { - return [ - KernelEvents::RESPONSE => ['onKernelResponse', -100], - KernelEvents::EXCEPTION => 'onKernelException', - KernelEvents::FINISH_REQUEST => ['onKernelFinishRequest', -1024], - ]; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/WebprofilerEventSubscriber.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/WebprofilerEventSubscriber.php deleted file mode 100644 index 46a42a17c..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/EventSubscriber/WebprofilerEventSubscriber.php +++ /dev/null @@ -1,97 +0,0 @@ -currentUser = $currentUser; - $this->urlGenerator = $urlGenerator; - $this->renderer = $renderer; - } - - /** - * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event - */ - public function onKernelResponse(FilterResponseEvent $event) { - $response = $event->getResponse(); - $request = $event->getRequest(); - - if ($response->headers->has('X-Debug-Token') && NULL !== $this->urlGenerator) { - $response->headers->set( - 'X-Debug-Token-Link', - $this->urlGenerator->generate('webprofiler.dashboard', ['profile' => $response->headers->get('X-Debug-Token')]) - ); - } - - // do not capture redirects or modify XML HTTP Requests - if ($request->isXmlHttpRequest()) { - return; - } - - if ($this->currentUser->hasPermission('view webprofiler toolbar')) { - $this->injectToolbar($response); - } - } - - /** - * @param \Symfony\Component\HttpFoundation\Response $response - */ - protected function injectToolbar(Response $response) { - $content = $response->getContent(); - $pos = mb_strripos($content, ''); - - if (FALSE !== $pos) { - if ($token = $response->headers->get('X-Debug-Token')) { - $loader = [ - '#theme' => 'webprofiler_loader', - '#token' => $token, - '#profiler_url' => $this->urlGenerator->generate('webprofiler.toolbar', ['profile' => $token]), - ]; - - $content = mb_substr($content, 0, $pos) . $this->renderer->renderRoot($loader) . mb_substr($content, $pos); - $response->setContent($content); - } - } - } - - /** - * @return array - */ - public static function getSubscribedEvents() { - return [ - KernelEvents::RESPONSE => ['onKernelResponse', -128], - ]; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ConfigForm.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ConfigForm.php deleted file mode 100644 index d95582b7c..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ConfigForm.php +++ /dev/null @@ -1,238 +0,0 @@ -get('config.factory'), - $container->get('profiler'), - $container->get('profiler.storage_manager'), - $container->getParameter('data_collector.templates') - ); - } - - /** - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * @param Profiler $profiler - * @param \Drupal\webprofiler\Profiler\ProfilerStorageManager $storageManager - * @param array $templates - */ - public function __construct(ConfigFactoryInterface $config_factory, Profiler $profiler, ProfilerStorageManager $storageManager, $templates) { - parent::__construct($config_factory); - - $this->profiler = $profiler; - $this->templates = $templates; - $this->storageManager = $storageManager; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'webprofiler_config'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('webprofiler.config'); - - $form['purge_on_cache_clear'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Purge on cache clear'), - '#description' => $this->t('Deletes all profiler files during cache clear.'), - '#default_value' => $config->get('purge_on_cache_clear'), - ]; - - $storages = $this->storageManager->getStorages(); - - $form['storage'] = [ - '#type' => 'select', - '#title' => $this->t('Storage backend'), - '#description' => $this->t('Choose were to store profiler data.'), - '#options' => $storages, - '#default_value' => $config->get('storage'), - ]; - - $form['exclude'] = [ - '#type' => 'textarea', - '#title' => $this->t('Exclude'), - '#default_value' => $config->get('exclude'), - '#description' => $this->t('Paths to exclude for profiling. One path per line.'), - ]; - - $form['active_toolbar_items'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Active toolbar items'), - '#options' => $this->getCollectors(), - '#description' => $this->t('Choose which items to show into the toolbar.'), - '#default_value' => $config->get('active_toolbar_items'), - ]; - - $form['ide_settings'] = [ - '#type' => 'details', - '#title' => $this->t('IDE settings'), - '#open' => FALSE, - ]; - - $form['ide_settings']['ide_link'] = [ - '#type' => 'textfield', - '#title' => $this->t('IDE link'), - '#description' => $this->t('IDE link for open files.'), - '#default_value' => $config->get('ide_link'), - ]; - - $form['ide_settings']['ide_link_remote'] = [ - '#type' => 'textfield', - '#title' => $this->t('IDE link remote path'), - '#description' => $this->t('The path of the remote docroot. Leave blank if the docroot is on the same machine of the IDE. No trailing slash.'), - '#default_value' => $config->get('ide_link_remote'), - ]; - - $form['ide_settings']['ide_link_local'] = [ - '#type' => 'textfield', - '#title' => $this->t('IDE link local path'), - '#description' => $this->t('The path of the local docroot. Leave blank if the docroot is on the same machine of IDE. No trailing slash.'), - '#default_value' => $config->get('ide_link_local'), - ]; - - $form['database'] = [ - '#type' => 'details', - '#title' => $this->t('Database settings'), - '#open' => FALSE, - '#states' => array( - 'visible' => array( - array( - 'input[name="active_toolbar_items[database]"]' => array('checked' => TRUE), - ), - ), - ), - ]; - - $form['database']['query_sort'] = [ - '#type' => 'radios', - '#title' => $this->t('Sort query log'), - '#options' => ['source' => 'by source', 'duration' => 'by duration'], - '#description' => $this->t('The query table can be sorted in the order that the queries were executed or by descending duration.'), - '#default_value' => $config->get('query_sort'), - ]; - - $form['database']['query_highlight'] = [ - '#type' => 'number', - '#title' => $this->t('Slow query highlighting'), - '#description' => $this->t('Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibly inefficient query, or a candidate for caching.'), - '#default_value' => $config->get('query_highlight'), - '#min' => 0, - ]; - - $storageId = $this->config('webprofiler.config')->get('storage'); - $storage = $this->storageManager->getStorage($storageId); - - $form['purge'] = [ - '#type' => 'details', - '#title' => $this->t('Purge profiles'), - '#open' => FALSE, - ]; - - $form['purge']['actions'] = ['#type' => 'actions']; - $form['purge']['actions']['purge'] = [ - '#type' => 'submit', - '#value' => $this->t('Purge'), - '#submit' => [[$this, 'purge']], - ]; - - $form['purge']['purge-help'] = [ - '#type' => 'inline_template', - '#template' => '
        {{ message }}
        ', - '#context' => [ - 'message' => $this->t('Purge %storage profiles.', ['%storage' => $storage['title']]), - ], - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config('webprofiler.config') - ->set('purge_on_cache_clear', $form_state->getValue('purge_on_cache_clear')) - ->set('storage', $form_state->getValue('storage')) - ->set('exclude', $form_state->getValue('exclude')) - ->set('active_toolbar_items', $form_state->getValue('active_toolbar_items')) - ->set('ide_link', $form_state->getValue('ide_link')) - ->set('ide_link_remote', $form_state->getValue('ide_link_remote')) - ->set('ide_link_local', $form_state->getValue('ide_link_local')) - ->set('query_sort', $form_state->getValue('query_sort')) - ->set('query_highlight', $form_state->getValue('query_highlight')) - ->save(); - - parent::submitForm($form, $form_state); - } - - /** - * Purges profiles. - */ - public function purge(array &$form, FormStateInterface $form_state) { - $this->profiler->purge(); - drupal_set_message($this->t('Profiles purged')); - } - - /** - * @return array - */ - private function getCollectors() { - $options = []; - foreach ($this->templates as $template) { - // drupal collector should not be disabled - if ($template[0] != 'drupal') { - $options[$template[0]] = $template[2]; - } - } - - asort($options); - - return $options; - } - - /** - * {@inheritdoc} - */ - public function getEditableConfigNames() { - return [ - 'webprofiler.config', - ]; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/FormBuilderWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/FormBuilderWrapper.php deleted file mode 100644 index 48064b801..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/FormBuilderWrapper.php +++ /dev/null @@ -1,61 +0,0 @@ -buildForms; - } - - /** - * {@inheritdoc} - */ - public function prepareForm($form_id, &$form, FormStateInterface &$form_state) { - parent::prepareForm($form_id, $form, $form_state); - - if (!$this->buildForms) { - $this->buildForms = []; - } - - $elements = []; - foreach ($form as $key => $value) { - if (strpos($key, '#') !== 0) { - $elements[$key]['#title'] = isset($value['#title']) ? $value['#title'] : NULL; - $elements[$key]['#access'] = isset($value['#access']) ? $value['#access'] : NULL; - $elements[$key]['#type'] = isset($value['#type']) ? $value['#type'] : NULL; - } - } - - $buildInfo = $form_state->getBuildInfo(); - - $class = get_class($buildInfo['callback_object']); - $method = new \ReflectionMethod($class, 'buildForm'); - - $this->buildForms[$buildInfo['form_id']] = [ - 'class' => [ - 'class' => $class, - 'method' => 'buildForm', - 'file' => $method->getFilename(), - 'line' => $method->getStartLine(), - ], - 'form' => $elements, - ]; - - return $form; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ProfilesFilterForm.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ProfilesFilterForm.php deleted file mode 100644 index 88d85eed0..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Form/ProfilesFilterForm.php +++ /dev/null @@ -1,86 +0,0 @@ - 'textfield', - '#title' => $this->t('IP'), - '#size' => 30, - '#default_value' => $this->getRequest()->query->get('ip'), - '#prefix' => '
        ', - ]; - - $form['url'] = [ - '#type' => 'textfield', - '#title' => $this->t('Url'), - '#size' => 30, - '#default_value' => $this->getRequest()->query->get('url'), - ]; - - $form['method'] = [ - '#type' => 'select', - '#title' => $this->t('Method'), - '#options' => ['GET' => 'GET', 'POST' => 'POST'], - '#default_value' => $this->getRequest()->query->get('method'), - ]; - - $limits = [10, 50, 100]; - $form['limit'] = [ - '#type' => 'select', - '#title' => $this->t('Limit'), - '#options' => array_combine($limits, $limits), - '#default_value' => $this->getRequest()->query->get('limit'), - ]; - - $form['actions'] = ['#type' => 'actions']; - $form['actions']['filter'] = [ - '#type' => 'submit', - '#value' => t('Filter'), - '#attributes' => ['class' => ['button--primary']], - '#suffix' => '
        ', - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $ip = $form_state->getValue('ip');// ['values']['ip']; - $url = $form_state->getValue('url'); - $method = $form_state->getValue('method'); - $limit = $form_state->getValue('limit'); - - $url = new Url('webprofiler.admin_list', [], [ - 'query' => [ - 'ip' => $ip, - 'url' => $url, - 'method' => $method, - 'limit' => $limit, - ] - ]); - - $form_state->setRedirectUrl($url); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Frontend/PerformanceTimingData.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Frontend/PerformanceTimingData.php deleted file mode 100644 index da5565cac..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Frontend/PerformanceTimingData.php +++ /dev/null @@ -1,81 +0,0 @@ -data = $data; - } - - /** - * @return int - */ - public function getDNSTiming() { - if (isset($this->data['domainLookupEnd']) && isset($this->data['domainLookupStart'])) { - return $this->data['domainLookupEnd'] - $this->data['domainLookupStart']; - } - else { - return 0; - } - } - - /** - * @return int - */ - public function getTCPTiming() { - if (isset($this->data['connectEnd']) && isset($this->data['connectStart'])) { - return $this->data['connectEnd'] - $this->data['connectStart']; - } - else { - return 0; - } - } - - /** - * @return int - */ - public function getTtfbTiming() { - if (isset($this->data['responseStart']) && isset($this->data['connectEnd'])) { - return $this->data['responseStart'] - $this->data['connectEnd']; - } - else { - return 0; - } - } - - /** - * @return int - */ - public function getDataTiming() { - if (isset($this->data['responseEnd']) && isset($this->data['responseStart'])) { - return $this->data['responseEnd'] - $this->data['responseStart']; - } - else { - return 0; - } - } - - /** - * @return int - */ - public function getDomTiming() { - if (isset($this->data['loadEventStart']) && isset($this->data['responseEnd'])) { - return $this->data['loadEventStart'] - $this->data['responseEnd']; - } - else { - return 0; - } - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortener.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortener.php deleted file mode 100644 index 204de3281..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortener.php +++ /dev/null @@ -1,34 +0,0 @@ - $part) { - if ($key < $size) { - $result[] = substr($part, 0, 1); - } - else { - $result[] = $part; - } - } - - return new FormattableMarkup("@short", [ - '@class' => $class, - '@short' => implode('\\', $result) - ]); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortenerInterface.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortenerInterface.php deleted file mode 100644 index e1b2af504..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/ClassShortenerInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -config_factory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function generateLink($file, $line) { - $ide_link = $this->config_factory->get('webprofiler.config') - ->get('ide_link'); - $ide_link_remote = $this->config_factory->get('webprofiler.config') - ->get('ide_link_remote'); - $ide_link_local = $this->config_factory->get('webprofiler.config') - ->get('ide_link_local'); - - $file = str_replace($ide_link_remote, $ide_link_local, $file); - - return new FormattableMarkup($ide_link, ['@file' => $file, '@line' => $line]); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/IdeLinkGeneratorInterface.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/IdeLinkGeneratorInterface.php deleted file mode 100644 index 062620847..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Helper/IdeLinkGeneratorInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -completedRequests = []; - $this->failedRequests = []; - } - - /** - * {@inheritdoc} - */ - public function __invoke() { - return function ($handler) { - return function (RequestInterface $request, array $options) use ($handler) { - - // If on_stats callback is already set then save it - // and call it after ours. - if (isset($options['on_stats'])) { - $next = $options['on_stats']; - } - else { - $next = function(TransferStats $stats) {}; - } - - $options['on_stats'] = function (TransferStats $stats) use ($request, $next) { - $request->stats = $stats; - $next($stats); - }; - - return $handler($request, $options)->then( - function ($response) use ($request) { - - $this->completedRequests[] = [ - 'request' => $request, - 'response' => $response, - ]; - - return $response; - }, - function ($reason) use ($request) { - $response = $reason instanceof RequestException - ? $reason->getResponse() - : null; - - $this->failedRequests[] = [ - 'request' => $request, - 'response' => $response, - 'message' => $reason->getMessage(), - ]; - - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - }; - }; - } - - /** - * @return array - */ - public function getCompletedRequests() { - return $this->completedRequests; - } - - /** - * @return array - */ - public function getFailedRequests() { - return $this->failedRequests; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Mail/MailManagerWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Mail/MailManagerWrapper.php deleted file mode 100644 index 2689510d7..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Mail/MailManagerWrapper.php +++ /dev/null @@ -1,104 +0,0 @@ -alterInfo('mail_backend_info'); - $this->setCacheBackend($cache_backend, 'mail_backend_plugins'); - $this->configFactory = $config_factory; - $this->loggerFactory = $logger_factory; - $this->stringTranslation = $string_translation; - $this->dataCollector = $dataCollector; - $this->mailManager = $mailManager; - } - - /** - * {@inheritdoc} - */ - public function mail($module, $key, $to, $langcode, $params = array(), $reply = NULL, $send = TRUE) { - $message = $this->mailManager->mail($module, $key, $to, $langcode, $params, $reply, $send); - - $instance = $this->mailManager->getInstance(['module' => $module, 'key' => $key]); - $this->dataCollector->addMessage($message, $instance); - - return $message; - } - - /** - * {@inheritdoc} - * - * Must call getInstance on the decorated MailManager. - * @see https://www.drupal.org/node/2625554 - */ - public function getInstance(array $options) { - return $this->mailManager->getInstance($options); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/DatabaseProfilerStorage.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/DatabaseProfilerStorage.php deleted file mode 100644 index d86045da8..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/DatabaseProfilerStorage.php +++ /dev/null @@ -1,158 +0,0 @@ -database = $database; - } - - /** - * {@inheritdoc} - */ - public function find($ip, $url, $limit, $method, $start = NULL, $end = NULL) { - $select = $this->database->select('webprofiler', 'wp', ['fetch' => \PDO::FETCH_ASSOC]); - - if (NULL === $start) { - $start = 0; - } - - if (NULL === $end) { - $end = time(); - } - - if ($ip = preg_replace('/[^\d\.]/', '', $ip)) { - $select->condition('ip', '%' . $this->database->escapeLike($ip) . '%', 'LIKE'); - } - - if ($url) { - $select->condition('url', '%' . $this->database->escapeLike(addcslashes($url, '%_\\')) . '%', 'LIKE'); - } - - if ($method) { - $select->condition('method', $method); - } - - if (!empty($start)) { - $select->condition('time', $start, '>='); - } - - if (!empty($end)) { - $select->condition('time', $end, '<='); - } - - $select->fields('wp', [ - 'token', - 'ip', - 'method', - 'url', - 'time', - 'parent', - 'status_code' - ]); - $select->orderBy('time', 'DESC'); - $select->range(0, $limit); - return $select->execute() - ->fetchAllAssoc('token'); - } - - /** - * {@inheritdoc} - */ - public function read($token) { - $record = $this->database->select('webprofiler', 'w') - ->fields('w') - ->condition('token', $token) - ->execute() - ->fetch(); - if (isset($record->data)) { - return $this->createProfileFromData($token, $record); - } - } - - /** - * {@inheritdoc} - */ - public function write(Profile $profile) { - $args = [ - 'token' => $profile->getToken(), - 'parent' => $profile->getParentToken(), - 'data' => base64_encode(serialize($profile->getCollectors())), - 'ip' => $profile->getIp(), - 'method' => $profile->getMethod(), - 'url' => $profile->getUrl(), - 'time' => $profile->getTime(), - 'created_at' => time(), - 'status_code' => $profile->getStatusCode(), - ]; - - try { - $query = $this->database->select('webprofiler', 'w') - ->fields('w', ['token']); - $query->condition('token', $profile->getToken()); - $count = $query->countQuery()->execute()->fetchAssoc(); - - if ($count['expression']) { - $this->database->update('webprofiler') - ->fields($args) - ->condition('token', $profile->getToken()) - ->execute(); - } - else { - $this->database->insert('webprofiler')->fields($args)->execute(); - } - - $status = TRUE; - } catch (\Exception $e) { - $status = FALSE; - } - - return $status; - } - - /** - * {@inheritdoc} - */ - public function purge() { - $this->database->truncate('webprofiler')->execute(); - } - - /** - * @param string $token - * @param $data - * - * @return Profile - */ - private function createProfileFromData($token, $data) { - $profile = new Profile($token); - $profile->setIp($data->ip); - $profile->setMethod($data->method); - $profile->setUrl($data->url); - $profile->setTime($data->time); - $profile->setCollectors(unserialize(base64_decode($data->data))); - $profile->setStatusCode($data->status_code); - - return $profile; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/FileProfilerStorage.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/FileProfilerStorage.php deleted file mode 100644 index 7eb63aca9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/FileProfilerStorage.php +++ /dev/null @@ -1,24 +0,0 @@ -setIp($data['ip']); - $profile->setMethod($data['method']); - $profile->setUrl($data['url']); - $profile->setTime($data['time']); - $profile->setCollectors($data['data']); - $profile->setStatusCode($data['status_code']); - - return $profile; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/Profiler.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/Profiler.php deleted file mode 100644 index 438dcb4e0..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/Profiler.php +++ /dev/null @@ -1,77 +0,0 @@ -localStorage = $storage; - $this->localLogger = $logger; - - $this->config = $config; - $this->activeToolbarItems = $this->config->get('webprofiler.config') - ->get('active_toolbar_items'); - } - - /** - * {@inheritdoc} - */ - public function add(DataCollectorInterface $collector) { - // drupal collector should not be disabled - if ($collector->getName() == 'drupal') { - parent::add($collector); - } - else { - if ($this->activeToolbarItems && array_key_exists($collector->getName(), $this->activeToolbarItems) && $this->activeToolbarItems[$collector->getName()] !== '0') { - parent::add($collector); - } - } - } - - /** - * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile - * - * @return bool - */ - public function updateProfile(Profile $profile) { - if (!($ret = $this->localStorage->write($profile)) && NULL !== $this->localLogger) { - $this->localLogger->warning('Unable to store the profiler information.'); - } - - return $ret; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageFactory.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageFactory.php deleted file mode 100644 index 5ba154528..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageFactory.php +++ /dev/null @@ -1,26 +0,0 @@ -get('webprofiler.config') - ->get('storage') ?: 'profiler.database_storage'; - - return $container->get($storage); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageManager.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageManager.php deleted file mode 100644 index fcd3683dc..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/ProfilerStorageManager.php +++ /dev/null @@ -1,52 +0,0 @@ -storages as $id => $storage) { - $output[$id] = $storage['title']; - } - - return $output; - } - - /** - * @param $id - * - * @return array - */ - public function getStorage($id) { - return $this->storages[$id]; - } - - /** - * @param $id - * @param $title - * @param \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface $storage - */ - public function addStorage($id, $title, ProfilerStorageInterface $storage) { - $this->storages[$id] = [ - 'title' => $title, - 'class' => $storage, - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/TemplateManager.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/TemplateManager.php deleted file mode 100644 index 87aa68539..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Profiler/TemplateManager.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Drupal\webprofiler\Profiler; - -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\HttpKernel\Profiler\Profiler as SymfonyProfiler; -use Symfony\Component\HttpKernel\Profiler\Profile; - -/** - * Profiler Templates Manager - */ -class TemplateManager { - - /** - * @var \Twig_Environment - */ - protected $twig; - - /** - * @var \Twig_Loader_Chain - */ - protected $twigLoader; - - /** - * @var array - */ - protected $templates; - - /** - * @var \Symfony\Component\HttpKernel\Profiler\Profiler - */ - protected $profiler; - - /** - * Constructor. - * - * @param SymfonyProfiler $profiler - * @param \Twig_Environment $twig - * @param \Twig_Loader_Chain $twigLoader - * @param array $templates - */ - public function __construct(SymfonyProfiler $profiler, \Twig_Environment $twig, \Twig_Loader_Chain $twigLoader, array $templates) { - $this->profiler = $profiler; - $this->twig = $twig; - $this->twigLoader = $twigLoader; - $this->templates = $templates; - } - - /** - * Gets the template name for a given panel. - * - * @param Profile $profile - * @param string $panel - * - * @return mixed - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - */ - public function getName(Profile $profile, $panel) { - $templates = $this->getNames($profile); - - if (!isset($templates[$panel])) { - throw new NotFoundHttpException(sprintf('Panel "%s" is not registered in profiler or is not present in viewed profile.', $panel)); - } - - return $templates[$panel]; - } - - /** - * Gets the templates for a given profile. - * - * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile - * - * @return array - */ - public function getTemplates(Profile $profile) { - $templates = $this->getNames($profile); - foreach ($templates as $name => $template) { - $templates[$name] = $this->twig->loadTemplate($template); - } - - return $templates; - } - - /** - * Gets template names of templates that are present in the viewed profile. - * - * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile - * - * @return array - * - * @throws \UnexpectedValueException - */ - protected function getNames(Profile $profile) { - $templates = []; - - foreach ($this->templates as $arguments) { - if (NULL === $arguments) { - continue; - } - - list($name, $template) = $arguments; - - if (!$this->profiler->has($name) || !$profile->hasCollector($name)) { - continue; - } - - if ('.html.twig' === substr($template, -10)) { - $template = substr($template, 0, -10); - } - - if (!$this->twigLoader->exists($template . '.html.twig')) { - throw new \UnexpectedValueException(sprintf('The profiler template "%s.html.twig" for data collector "%s" does not exist.', $template, $name)); - } - - $templates[$name] = $template . '.html.twig'; - } - - return $templates; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/ProxyClass/Command/ListCommand.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/ProxyClass/Command/ListCommand.php deleted file mode 100644 index e8e22c844..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/ProxyClass/Command/ListCommand.php +++ /dev/null @@ -1,325 +0,0 @@ -container = $container; - $this->drupalProxyOriginalServiceId = $drupal_proxy_original_service_id; - } - - /** - * Lazy loads the real service from the container. - * - * @return object - * Returns the constructed real service. - */ - protected function lazyLoadItself() { - if (!isset($this->service)) { - $this->service = $this->container->get($this->drupalProxyOriginalServiceId); - } - - return $this->service; - } - - /** - * {@inheritdoc} - */ - public function showMessage($output, $message, $type = 'info') { - return $this->lazyLoadItself()->showMessage($output, $message, $type); - } - - /** - * {@inheritdoc} - */ - public function ignoreValidationErrors() { - return $this->lazyLoadItself()->ignoreValidationErrors(); - } - - /** - * {@inheritdoc} - */ - public function setApplication(\Symfony\Component\Console\Application $application = NULL) { - return $this->lazyLoadItself()->setApplication($application); - } - - /** - * {@inheritdoc} - */ - public function setHelperSet(\Symfony\Component\Console\Helper\HelperSet $helperSet) { - return $this->lazyLoadItself()->setHelperSet($helperSet); - } - - /** - * {@inheritdoc} - */ - public function getHelperSet() { - return $this->lazyLoadItself()->getHelperSet(); - } - - /** - * {@inheritdoc} - */ - public function getApplication() { - return $this->lazyLoadItself()->getApplication(); - } - - /** - * {@inheritdoc} - */ - public function isEnabled() { - return $this->lazyLoadItself()->isEnabled(); - } - - /** - * {@inheritdoc} - */ - public function run(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) { - return $this->lazyLoadItself()->run($input, $output); - } - - /** - * {@inheritdoc} - */ - public function setCode(callable $code) { - return $this->lazyLoadItself()->setCode($code); - } - - /** - * {@inheritdoc} - */ - public function mergeApplicationDefinition($mergeArgs = TRUE) { - return $this->lazyLoadItself()->mergeApplicationDefinition($mergeArgs); - } - - /** - * {@inheritdoc} - */ - public function setDefinition($definition) { - return $this->lazyLoadItself()->setDefinition($definition); - } - - /** - * {@inheritdoc} - */ - public function getDefinition() { - return $this->lazyLoadItself()->getDefinition(); - } - - /** - * {@inheritdoc} - */ - public function getNativeDefinition() { - return $this->lazyLoadItself()->getNativeDefinition(); - } - - /** - * {@inheritdoc} - */ - public function addArgument($name, $mode = NULL, $description = '', $default = NULL) { - return $this->lazyLoadItself() - ->addArgument($name, $mode, $description, $default); - } - - /** - * {@inheritdoc} - */ - public function addOption($name, $shortcut = NULL, $mode = NULL, $description = '', $default = NULL) { - return $this->lazyLoadItself() - ->addOption($name, $shortcut, $mode, $description, $default); - } - - /** - * {@inheritdoc} - */ - public function setName($name) { - return $this->lazyLoadItself()->setName($name); - } - - /** - * {@inheritdoc} - */ - public function setProcessTitle($title) { - return $this->lazyLoadItself()->setProcessTitle($title); - } - - /** - * {@inheritdoc} - */ - public function getName() { - return $this->lazyLoadItself()->getName(); - } - - /** - * {@inheritdoc} - */ - public function setHidden($hidden) { - return $this->lazyLoadItself()->setHidden($hidden); - } - - /** - * {@inheritdoc} - */ - public function isHidden() { - return $this->lazyLoadItself()->isHidden(); - } - - /** - * {@inheritdoc} - */ - public function setDescription($description) { - return $this->lazyLoadItself()->setDescription($description); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->lazyLoadItself()->getDescription(); - } - - /** - * {@inheritdoc} - */ - public function setHelp($help) { - return $this->lazyLoadItself()->setHelp($help); - } - - /** - * {@inheritdoc} - */ - public function getHelp() { - return $this->lazyLoadItself()->getHelp(); - } - - /** - * {@inheritdoc} - */ - public function getProcessedHelp() { - return $this->lazyLoadItself()->getProcessedHelp(); - } - - /** - * {@inheritdoc} - */ - public function setAliases($aliases) { - return $this->lazyLoadItself()->setAliases($aliases); - } - - /** - * {@inheritdoc} - */ - public function getAliases() { - return $this->lazyLoadItself()->getAliases(); - } - - /** - * {@inheritdoc} - */ - public function getSynopsis($short = FALSE) { - return $this->lazyLoadItself()->getSynopsis($short); - } - - /** - * {@inheritdoc} - */ - public function addUsage($usage) { - return $this->lazyLoadItself()->addUsage($usage); - } - - /** - * {@inheritdoc} - */ - public function getUsages() { - return $this->lazyLoadItself()->getUsages(); - } - - /** - * {@inheritdoc} - */ - public function getHelper($name) { - return $this->lazyLoadItself()->getHelper($name); - } - - /** - * {@inheritdoc} - */ - public function setContainer($container) { - return $this->lazyLoadItself()->setContainer($container); - } - - /** - * {@inheritdoc} - */ - public function has($key) { - return $this->lazyLoadItself()->has($key); - } - - /** - * {@inheritdoc} - */ - public function get($key) { - return $this->lazyLoadItself()->get($key); - } - - /** - * {@inheritdoc} - */ - public function setTranslator($translator) { - return $this->lazyLoadItself()->setTranslator($translator); - } - - /** - * {@inheritdoc} - */ - public function trans($key) { - return $this->lazyLoadItself()->trans($key); - } - - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php deleted file mode 100644 index 17087cc84..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/RequestMatcher/WebprofilerRequestMatcher.php +++ /dev/null @@ -1,50 +0,0 @@ -configFactory = $configFactory; - $this->pathMatcher = $pathMatcher; - } - - /** - * {@inheritdoc} - */ - public function matches(Request $request) { - $path = $request->getPathInfo(); - - $patterns = $this->configFactory->get('webprofiler.config')->get('exclude'); - - // never add Webprofiler to phpinfo page. - $patterns .= "\r\n/admin/reports/status/php"; - - // never add Webprofiler to uninstall confirm page. - $patterns .= "\r\n/admin/modules/uninstall/*"; - - return !$this->pathMatcher->matchPath($path, $patterns); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Routing/TokenConverter.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Routing/TokenConverter.php deleted file mode 100644 index a8496103d..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Routing/TokenConverter.php +++ /dev/null @@ -1,46 +0,0 @@ -loadProfile($value); - - if (NULL === $profile) { - return NULL; - } - - return $profile; - } - - /** - * {@inheritdoc} - */ - public function applies($definition, $name, Route $route) { - if (!empty($definition['type']) && $definition['type'] === 'webprofiler:token') { - return TRUE; - } - return FALSE; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php deleted file mode 100644 index dac9198e4..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php +++ /dev/null @@ -1,41 +0,0 @@ -httpKernel = $http_kernel; - } - - /** - * {@inheritdoc} - */ - public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) { - foreach (Database::getAllConnectionInfo() as $key => $info) { - Database::startLog('webprofiler', $key); - } - return $this->httpKernel->handle($request, $type, $catch); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/State/StateWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/State/StateWrapper.php deleted file mode 100644 index 23f930ad4..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/State/StateWrapper.php +++ /dev/null @@ -1,125 +0,0 @@ -state = $state; - $this->dataCollector = $dataCollector; - } - - /** - * {@inheritdoc} - */ - public function get($key, $default = NULL) { - $this->dataCollector->addState($key); - - return $this->state->get($key, $default); - } - - /** - * {@inheritdoc} - */ - public function getMultiple(array $keys) { - foreach ($keys as $key) { - $this->dataCollector->addState($key); - } - - return $this->state->getMultiple($keys); - } - - /** - * {@inheritdoc} - */ - public function set($key, $value) { - $this->state->set($key, $value); - } - - /** - * {@inheritdoc} - */ - public function setMultiple(array $data) { - $this->state->setMultiple($data); - } - - /** - * {@inheritdoc} - */ - public function delete($key) { - $this->state->delete($key); - } - - /** - * {@inheritdoc} - */ - public function deleteMultiple(array $keys) { - $this->state->deleteMultiple($keys); - } - - /** - * {@inheritdoc} - */ - public function resetCache() { - $this->state->resetCache(); - } - - /** - * {@inheritdoc} - */ - protected function resolveCacheMiss($key) { - return $this->state->resolveCacheMiss($key); - } - - /** - * {@inheritdoc} - */ - public function destruct() { - $this->updateCache(); - } - - /** - * Passes through all non-tracked calls onto the decorated object. - * - * @param string $method - * The called method. - * @param mixed $args - * The passed in arguments. - * - * @return mixed - * The return argument of the call. - */ - public function __call($method, $args) { - return call_user_func_array([$this->state, $method], $args); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Stopwatch.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Stopwatch.php deleted file mode 100644 index 35714bffa..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Stopwatch.php +++ /dev/null @@ -1,543 +0,0 @@ -sections = $this->activeSections = ['__root__' => new Section('__root__')]; - } - - /** - * Creates a new section or re-opens an existing section. - * - * @param string|null $id The id of the session to re-open, null to create a new one - * - * @throws \LogicException When the section to re-open is not reachable - */ - public function openSection($id = NULL) { - $current = end($this->activeSections); - - if (NULL !== $id && NULL === $current->get($id)) { - throw new \LogicException(sprintf('The section "%s" has been started at an other level and can not be opened.', $id)); - } - - $this->start('__section__.child', 'section'); - $this->activeSections[] = $current->open($id); - $this->start('__section__'); - } - - /** - * Stops the last started section. - * - * The id parameter is used to retrieve the events from this section. - * - * @see getSectionEvents - * - * @param string $id The identifier of the section - * - * @throws \LogicException When there's no started section to be stopped - */ - public function stopSection($id) { - $this->stop('__section__'); - - if (1 == count($this->activeSections)) { - throw new \LogicException('There is no started section to stop.'); - } - - $this->sections[$id] = array_pop($this->activeSections)->setId($id); - $this->stop('__section__.child'); - } - - /** - * Starts an event. - * - * @param string $name The event name - * @param string $category The event category - * - * @return StopwatchEvent A StopwatchEvent instance - */ - public function start($name, $category = NULL) { - return end($this->activeSections)->startEvent($name, $category); - } - - /** - * Checks if the event was started - * - * @param string $name The event name - * - * @return bool - */ - public function isStarted($name) { - return end($this->activeSections)->isEventStarted($name); - } - - /** - * Stops an event. - * - * @param string $name The event name - * - * @return StopwatchEvent A StopwatchEvent instance - */ - public function stop($name) { - return end($this->activeSections)->stopEvent($name); - } - - /** - * Stops then restarts an event. - * - * @param string $name The event name - * - * @return StopwatchEvent A StopwatchEvent instance - */ - public function lap($name) { - return end($this->activeSections)->stopEvent($name)->start(); - } - - /** - * Gets all events for a given section. - * - * @param string $id A section identifier - * - * @return StopwatchEvent[] An array of StopwatchEvent instances - */ - public function getSectionEvents($id) { - return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : []; - } - } - - - /** - * @internal This class is for internal usage only - * - * @author Fabien Potencier - */ - class Section { - /** - * @var StopwatchEvent[] - */ - private $events = []; - - /** - * @var null|float - */ - private $origin; - - /** - * @var string - */ - private $id; - - /** - * @var Section[] - */ - private $children = []; - - /** - * Constructor. - * - * @param float|null $origin Set the origin of the events in this section, use null to set their origin to their start time - */ - public function __construct($origin = NULL) { - $this->origin = is_numeric($origin) ? $origin : NULL; - } - - /** - * Returns the child section. - * - * @param string $id The child section identifier - * - * @return Section|null The child section or null when none found - */ - public function get($id) { - foreach ($this->children as $child) { - if ($id === $child->getId()) { - return $child; - } - } - - return NULL; - } - - /** - * Creates or re-opens a child section. - * - * @param string|null $id null to create a new section, the identifier to re-open an existing one. - * - * @return Section A child section - */ - public function open($id) { - if (NULL === $session = $this->get($id)) { - $session = $this->children[] = new self(microtime(TRUE) * 1000); - } - - return $session; - } - - /** - * @return string The identifier of the section - */ - public function getId() { - return $this->id; - } - - /** - * Sets the session identifier. - * - * @param string $id The session identifier - * - * @return Section The current section - */ - public function setId($id) { - $this->id = $id; - - return $this; - } - - /** - * Starts an event. - * - * @param string $name The event name - * @param string $category The event category - * - * @return StopwatchEvent The event - */ - public function startEvent($name, $category) { - if (!isset($this->events[$name])) { - $this->events[$name] = new StopwatchEvent($this->origin ?: microtime(TRUE) * 1000, $category); - } - - return $this->events[$name]->start(); - } - - /** - * Checks if the event was started - * - * @param string $name The event name - * - * @return bool - */ - public function isEventStarted($name) { - return isset($this->events[$name]) && $this->events[$name]->isStarted(); - } - - /** - * Stops an event. - * - * @param string $name The event name - * - * @return StopwatchEvent The event - * - * @throws \LogicException When the event has not been started - */ - public function stopEvent($name) { - if (!isset($this->events[$name])) { - throw new \LogicException(sprintf('Event "%s" is not started.', $name)); - } - - return $this->events[$name]->stop(); - } - - /** - * Stops then restarts an event. - * - * @param string $name The event name - * - * @return StopwatchEvent The event - * - * @throws \LogicException When the event has not been started - */ - public function lap($name) { - return $this->stopEvent($name)->start(); - } - - /** - * Returns the events from this section. - * - * @return StopwatchEvent[] An array of StopwatchEvent instances - */ - public function getEvents() { - return $this->events; - } - } - - /** - * Class StopwatchEvent - */ - class StopwatchEvent { - /** - * @var StopwatchPeriod[] - */ - private $periods = []; - - /** - * @var float - */ - private $origin; - - /** - * @var string - */ - private $category; - - /** - * @var float[] - */ - private $started = []; - - /** - * Constructor. - * - * @param float $origin The origin time in milliseconds - * @param string|null $category The event category or null to use the default - * - * @throws \InvalidArgumentException When the raw time is not valid - */ - public function __construct($origin, $category = NULL) { - $this->origin = $this->formatTime($origin); - $this->category = is_string($category) ? $category : 'default'; - } - - /** - * Gets the category. - * - * @return string The category - */ - public function getCategory() { - return $this->category; - } - - /** - * Gets the origin. - * - * @return float The origin in milliseconds - */ - public function getOrigin() { - return $this->origin; - } - - /** - * Starts a new event period. - * - * @return StopwatchEvent The event - */ - public function start() { - $this->started[] = $this->getNow(); - - return $this; - } - - /** - * Stops the last started event period. - * - * @throws \LogicException When start wasn't called before stopping - * - * @return StopwatchEvent The event - * - * @throws \LogicException When stop() is called without a matching call to start() - */ - public function stop() { - if (!count($this->started)) { - throw new \LogicException('stop() called but start() has not been called before.'); - } - - $this->periods[] = new StopwatchPeriod(array_pop($this->started), $this->getNow()); - - return $this; - } - - /** - * Checks if the event was started - * - * @return bool - */ - public function isStarted() { - return !empty($this->started); - } - - /** - * Stops the current period and then starts a new one. - * - * @return StopwatchEvent The event - */ - public function lap() { - return $this->stop()->start(); - } - - /** - * Stops all non already stopped periods. - */ - public function ensureStopped() { - while (count($this->started)) { - $this->stop(); - } - } - - /** - * Gets all event periods. - * - * @return StopwatchPeriod[] An array of StopwatchPeriod instances - */ - public function getPeriods() { - return $this->periods; - } - - /** - * Gets the relative time of the start of the first period. - * - * @return integer The time (in milliseconds) - */ - public function getStartTime() { - return isset($this->periods[0]) ? $this->periods[0]->getStartTime() : 0; - } - - /** - * Gets the relative time of the end of the last period. - * - * @return integer The time (in milliseconds) - */ - public function getEndTime() { - return ($count = count($this->periods)) ? $this->periods[$count - 1]->getEndTime() : 0; - } - - /** - * Gets the duration of the events (including all periods). - * - * @return integer The duration (in milliseconds) - */ - public function getDuration() { - $total = 0; - foreach ($this->periods as $period) { - $total += $period->getDuration(); - } - - return $total; - } - - /** - * Gets the max memory usage of all periods. - * - * @return integer The memory usage (in bytes) - */ - public function getMemory() { - $memory = 0; - foreach ($this->periods as $period) { - if ($period->getMemory() > $memory) { - $memory = $period->getMemory(); - } - } - - return $memory; - } - - /** - * Return the current time relative to origin. - * - * @return float Time in ms - */ - protected function getNow() { - return $this->formatTime(microtime(TRUE) * 1000 - $this->origin); - } - - /** - * Formats a time. - * - * @param integer|float $time A raw time - * - * @return float The formatted time - * - * @throws \InvalidArgumentException When the raw time is not valid - */ - private function formatTime($time) { - if (!is_numeric($time)) { - throw new \InvalidArgumentException('The time must be a numerical value'); - } - - return round($time, 1); - } - } - - /** - * Class StopwatchPeriod - */ - class StopwatchPeriod { - private $start; - private $end; - private $memory; - - /** - * Constructor. - * - * @param integer $start The relative time of the start of the period (in milliseconds) - * @param integer $end The relative time of the end of the period (in milliseconds) - */ - public function __construct($start, $end) { - $this->start = (integer) $start; - $this->end = (integer) $end; - $this->memory = memory_get_usage(TRUE); - } - - /** - * Gets the relative time of the start of the period. - * - * @return integer The time (in milliseconds) - */ - public function getStartTime() { - return $this->start; - } - - /** - * Gets the relative time of the end of the period. - * - * @return integer The time (in milliseconds) - */ - public function getEndTime() { - return $this->end; - } - - /** - * Gets the time spent in this period. - * - * @return integer The period duration (in milliseconds) - */ - public function getDuration() { - return $this->end - $this->start; - } - - /** - * Gets the memory usage. - * - * @return integer The memory usage (in bytes) - */ - public function getMemory() { - return $this->memory; - } - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/StringTranslation/TranslationManagerWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/StringTranslation/TranslationManagerWrapper.php deleted file mode 100644 index 7967646ae..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/StringTranslation/TranslationManagerWrapper.php +++ /dev/null @@ -1,69 +0,0 @@ -translationManager = $translationManager; - } - - /** - * {@inheritdoc} - */ - protected function doTranslate($string, array $options = array()) { - // Merge in defaults. - if (empty($options['langcode'])) { - $options['langcode'] = $this->defaultLangcode; - } - if (empty($options['context'])) { - $options['context'] = ''; - } - $translation = $this->getStringTranslation($options['langcode'], $string, $options['context']); - - if($translation) { - $this->translated[$string] = $translation; - } else { - $this->untranslated[$string] = $string; - } - - return $translation === FALSE ? $string : $translation; - } - - /** - * @return array - */ - public function getTranslated() { - return $this->translated; - } - - /** - * @return array - */ - public function getUntranslated() { - return $this->untranslated; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Theme/ThemeNegotiatorWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Theme/ThemeNegotiatorWrapper.php deleted file mode 100644 index 8a96b08df..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Theme/ThemeNegotiatorWrapper.php +++ /dev/null @@ -1,80 +0,0 @@ -classResolver; - $negotiators = $this->negotiators; - } else { - $classResolver = \Drupal::classResolver(); - $negotiators = $this->getSortedNegotiators(); - } - - foreach ($negotiators as $negotiator_id) { - if (property_exists($this, 'classResolver')) { - $negotiator = $classResolver->getInstanceFromDefinition($negotiator_id); - } else { - $negotiator = $negotiator_id; - } - - if ($negotiator->applies($route_match)) { - $theme = $negotiator->determineActiveTheme($route_match); - if ($theme !== NULL && $this->themeAccess->checkAccess($theme)) { - $this->negotiator = $negotiator; - return $theme; - } - } - } - } - - /** - * @return \Drupal\Core\Theme\ThemeNegotiatorInterface - */ - public function getNegotiator() { - return $this->negotiator; - } - - /** - * Returns the sorted array of theme negotiators. - * - * @return array|\Drupal\Core\Theme\ThemeNegotiatorInterface[] - * An array of theme negotiator objects. - * - * TODO: remove this method when we decide to drop Drupal 8.3.x support. - */ - protected function getSortedNegotiators() { - if (!isset($this->sortedNegotiators)) { - // Sort the negotiators according to priority. - krsort($this->negotiators); - // Merge nested negotiators from $this->negotiators into - // $this->sortedNegotiators. - $this->sortedNegotiators = []; - foreach ($this->negotiators as $builders) { - $this->sortedNegotiators = array_merge($this->sortedNegotiators, $builders); - } - } - return $this->sortedNegotiators; - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Dumper/HtmlDumper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Dumper/HtmlDumper.php deleted file mode 100644 index 7b3ac02b0..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Dumper/HtmlDumper.php +++ /dev/null @@ -1,35 +0,0 @@ - '#dfd', - 'macro' => '#ddf', - 'template' => '#ffd', - 'big' => '#d44', - ); - - /** - * {@inheritdoc} - */ - public function dump(\Twig_Profiler_Profile $profile) { - return '
        ' . parent::dump($profile) . '
        '; - } - - protected function formatTemplate(\Twig_Profiler_Profile $profile, $prefix) { - return sprintf('%s└ %s', $prefix, self::$colors['template'], $profile->getTemplate()); - } - - protected function formatNonTemplate(\Twig_Profiler_Profile $profile, $prefix) { - return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); - } - - protected function formatTime(\Twig_Profiler_Profile $profile, $percent) { - return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Extension/ProfilerExtension.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Extension/ProfilerExtension.php deleted file mode 100644 index ed598e4db..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Twig/Extension/ProfilerExtension.php +++ /dev/null @@ -1,93 +0,0 @@ -ideLink = $ideLink; - $this->classShortener = $classShortener; - - $this->stopwatch = $stopwatch; - $this->events = new \SplObjectStorage(); - } - - /** - * {@inheritdoc} - */ - public function enter(\Twig_Profiler_Profile $profile) { - if ($this->stopwatch && $profile->isTemplate()) { - $this->events[$profile] = $this->stopwatch->start($profile->getName(), 'template'); - } - - parent::enter($profile); - } - - /** - * {@inheritdoc} - */ - public function leave(\Twig_Profiler_Profile $profile) { - parent::leave($profile); - - if ($this->stopwatch && $profile->isTemplate()) { - $this->events[$profile]->stop(); - unset($this->events[$profile]); - } - } - - /** - * {@inheritdoc} - */ - public function getFunctions() { - return [ - new \Twig_SimpleFunction('abbr', [$this, 'getAbbr']), - new \Twig_SimpleFunction('idelink', [$this, 'getIdeLink']), - ]; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'native_profiler'; - } - - /** - * @param $class - * - * @return string - */ - public function getAbbr($class) { - return $this->classShortener->shortenClass($class); - } - - /** - * @param $file - * @param $line - * - * @return string - */ - public function getIdeLink($file, $line) { - return $this->ideLink->generateLink($file, $line); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Views/TraceableViewExecutable.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Views/TraceableViewExecutable.php deleted file mode 100644 index afd6e3917..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Views/TraceableViewExecutable.php +++ /dev/null @@ -1,156 +0,0 @@ -build_time; - } - - /** - * Gets the execute time. - * - * @return float - */ - public function getExecuteTime() { - return property_exists($this, 'execute_time') ? $this->execute_time : 0.0; - } - - /** - * Gets the render time. - * - * @return float - */ - public function getRenderTime() { - return $this->render_time; - } - - /** - * {@inheritdoc} - */ - public function render($display_id = NULL) { - $start = microtime(TRUE); - - $this->execute($display_id); - - // Check to see if the build failed. - if (!empty($this->build_info['fail'])) { - return; - } - if (!empty($this->build_info['denied'])) { - return; - } - - /** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginInterface $exposed_form */ - $exposed_form = $this->display_handler->getPlugin('exposed_form'); - $exposed_form->preRender($this->result); - - $module_handler = \Drupal::moduleHandler(); - - // @TODO In the longrun, it would be great to execute a view without - // the theme system at all. See https://www.drupal.org/node/2322623. - $active_theme = \Drupal::theme()->getActiveTheme(); - $themes = array_keys($active_theme->getBaseThemes()); - $themes[] = $active_theme->getName(); - - // Check for already-cached output. - /** @var \Drupal\views\Plugin\views\cache\CachePluginBase $cache */ - if (!empty($this->live_preview)) { - $cache = Views::pluginManager('cache')->createInstance('none'); - } - else { - $cache = $this->display_handler->getPlugin('cache'); - } - - // Run preRender for the pager as it might change the result. - if (!empty($this->pager)) { - $this->pager->preRender($this->result); - } - - // Initialize the style plugin. - $this->initStyle(); - - if (!isset($this->response)) { - // Set the response so other parts can alter it. - $this->response = new Response('', 200); - } - - // Give field handlers the opportunity to perform additional queries - // using the entire resultset prior to rendering. - if ($this->style_plugin->usesFields()) { - foreach ($this->field as $id => $handler) { - if (!empty($this->field[$id])) { - $this->field[$id]->preRender($this->result); - } - } - } - - $this->style_plugin->preRender($this->result); - - // Let each area handler have access to the result set. - $areas = ['header', 'footer']; - // Only call preRender() on the empty handlers if the result is empty. - if (empty($this->result)) { - $areas[] = 'empty'; - } - foreach ($areas as $area) { - foreach ($this->{$area} as $handler) { - $handler->preRender($this->result); - } - } - - // Let modules modify the view just prior to rendering it. - $module_handler->invokeAll('views_pre_render', [$this]); - - // Let the themes play too, because pre render is a very themey thing. - foreach ($themes as $theme_name) { - $function = $theme_name . '_views_pre_render'; - if (function_exists($function)) { - $function($this); - } - } - - $this->display_handler->output = $this->display_handler->render(); - - $exposed_form->postRender($this->display_handler->output); - - $cache->postRender($this->display_handler->output); - - // Let modules modify the view output after it is rendered. - $module_handler->invokeAll('views_post_render', [ - $this, - &$this->display_handler->output, - $cache - ]); - - // Let the themes play too, because post render is a very themey thing. - foreach ($themes as $theme_name) { - $function = $theme_name . '_views_post_render'; - if (function_exists($function)) { - $function($this, $this->display_handler->output, $cache); - } - } - - $this->render_time = microtime(TRUE) - $start; - - return $this->display_handler->output; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/Views/ViewExecutableFactoryWrapper.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/Views/ViewExecutableFactoryWrapper.php deleted file mode 100644 index 6aa363fad..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/Views/ViewExecutableFactoryWrapper.php +++ /dev/null @@ -1,47 +0,0 @@ -views = []; - } - - /** - * {@inheritdoc} - */ - public function get(ViewEntityInterface $view) { - $view_executable = new TraceableViewExecutable($view, $this->user, $this->viewsData, $this->routeProvider); - $view_executable->setRequest($this->requestStack->getCurrentRequest()); - $this->views[] = $view_executable; - - return $view_executable; - } - - /** - * @return TraceableViewExecutable - */ - public function getViews() { - return $this->views; - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/src/WebprofilerServiceProvider.php b/sites/all/modules/contrib/dev/devel/webprofiler/src/WebprofilerServiceProvider.php deleted file mode 100644 index 3ba1ff068..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/src/WebprofilerServiceProvider.php +++ /dev/null @@ -1,117 +0,0 @@ -addCompilerPass(new ProfilerPass()); - - // Add a compiler pass to discover all available storage backend. - $container->addCompilerPass(new StoragePass()); - - $container->addCompilerPass(new ServicePass(), PassConfig::TYPE_AFTER_REMOVING); - $container->addCompilerPass(new DecoratorPass(), PassConfig::TYPE_AFTER_REMOVING); - - $modules = $container->getParameter('container.modules'); - - // Add ViewsDataCollector only if Views module is enabled. - if (isset($modules['views'])) { - $container->register('webprofiler.views', 'Drupal\webprofiler\DataCollector\ViewsDataCollector') - ->addArgument(new Reference(('views.executable'))) - ->addArgument(new Reference(('entity.manager'))) - ->addTag('data_collector', [ - 'template' => '@webprofiler/Collector/views.html.twig', - 'id' => 'views', - 'title' => 'Views', - 'priority' => 75, - ]); - } - - // Add BlockDataCollector only if Block module is enabled. - if (isset($modules['block'])) { - $container->register('webprofiler.blocks', 'Drupal\webprofiler\DataCollector\BlocksDataCollector') - ->addArgument(new Reference(('entity_type.manager'))) - ->addTag('data_collector', [ - 'template' => '@webprofiler/Collector/blocks.html.twig', - 'id' => 'blocks', - 'title' => 'Blocks', - 'priority' => 78, - ]); - } - - // Add TranslationsDataCollector only if Locale module is enabled. - if (isset($modules['locale'])) { - $container->register('webprofiler.translations', 'Drupal\webprofiler\DataCollector\TranslationsDataCollector') - ->addArgument(new Reference(('string_translation'))) - ->addArgument(new Reference(('url_generator'))) - ->addTag('data_collector', [ - 'template' => '@webprofiler/Collector/translations.html.twig', - 'id' => 'translations', - 'title' => 'Translations', - 'priority' => 210, - ]); - } - } - - /** - * {@inheritdoc} - */ - public function alter(ContainerBuilder $container) { - $modules = $container->getParameter('container.modules'); - - // Alter the views.executable service only if Views module is enabled. - if (isset($modules['views'])) { - $container->getDefinition('views.executable') - ->setClass('Drupal\webprofiler\Views\ViewExecutableFactoryWrapper'); - } - - // Replace the regular form_builder service with a traceable one. - $container->getDefinition('form_builder') - ->setClass('Drupal\webprofiler\Form\FormBuilderWrapper'); - - // Replace the regular access_manager service with a traceable one. - $container->getDefinition('access_manager') - ->setClass('Drupal\webprofiler\Access\AccessManagerWrapper') - ->addMethodCall('setDataCollector', [new Reference('webprofiler.request')]); - - // Replace the regular theme.negotiator service with a traceable one. - $container->getDefinition('theme.negotiator') - ->setClass('Drupal\webprofiler\Theme\ThemeNegotiatorWrapper'); - - // Replace the regular config.factory service with a traceable one. - $container->getDefinition('config.factory') - ->setClass('Drupal\webprofiler\Config\ConfigFactoryWrapper') - ->addMethodCall('setDataCollector', [new Reference('webprofiler.config')]); - - // Replace the regular string_translation service with a traceable one. - $container->getDefinition('string_translation') - ->setClass('Drupal\webprofiler\StringTranslation\TranslationManagerWrapper'); - - // Replace the regular event_dispatcher service with a traceable one. - $container->getDefinition('event_dispatcher') - ->setClass('Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher') - ->addMethodCall('setStopwatch', [new Reference('stopwatch')]); - - $container->getDefinition('http_kernel.basic') - ->replaceArgument(1, new Reference('webprofiler.debug.controller_resolver')); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/assets.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/assets.html.twig deleted file mode 100644 index d53754140..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/assets.html.twig +++ /dev/null @@ -1,133 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Assets'|t }} - {{ collector.getcsscount + collector.getjscount }} - - {% endset %} - {% set text %} - -
        - CSS - {{ collector.getcsscount }} -
        -
        - JS - {{ collector.getjscount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/blocks.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/blocks.html.twig deleted file mode 100644 index 4146f2749..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/blocks.html.twig +++ /dev/null @@ -1,113 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Blocks'|t }} - {{ collector.renderedBlocksCount }} - - {% endset %} - {% set text %} - -
        - {{ 'Loaded'|t }} - {{ collector.loadedBlocksCount }} -
        -
        - {{ 'Rendered'|t }} - {{ collector.renderedBlocksCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/cache.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/cache.html.twig deleted file mode 100644 index 61539b6e3..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/cache.html.twig +++ /dev/null @@ -1,63 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Cache'|t }} - {{ collector.getCacheHitsCount }} - / {{ collector.getCacheMissesCount }} - - {% endset %} - {% set text %} - - {% for bin, cids in collector.getCacheHits %} -
        - {{ bin }} - {{ cids }} -
        - {% endfor %} - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/config.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/config.html.twig deleted file mode 100644 index 954ea5f12..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/config.html.twig +++ /dev/null @@ -1,37 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Config'|t }} - {{ collector.getConfigNames|length }} - - {% endset %} - {% set text %} -
        - {{ 'Config get'|t }} - {{ collector.getConfigNames|length }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/database.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/database.html.twig deleted file mode 100644 index f07b7f1fd..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/database.html.twig +++ /dev/null @@ -1,168 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Database'|t }} - {{ collector.querycount }} - {% if collector.querycount > 0 %} - in {{ '%0.2f ms'|format(collector.time) }} - {% endif %} - - {% endset %} - {% set text %} -
        - {{ 'DB Queries'|t }} - {{ collector.querycount }} -
        -
        - {{ 'Query time'|t }} - {{ '%0.2f ms'|format(collector.time) }} -
        -
        - {{ 'Default database'|t }} - {{ collector.database.driver }}://{{ collector.database.host }}:{{ collector.database.port }} - /{{ collector.database.database }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/devel.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/devel.html.twig deleted file mode 100644 index 7b6ba3a24..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/devel.html.twig +++ /dev/null @@ -1,24 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ collector.title }} - - {% endset %} - - {% set text %} - {% spaceless %} - {% for item in collector.links %} -
        - {{ item }} -
        - {% endfor %} - {% endspaceless %} - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/drupal.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/drupal.html.twig deleted file mode 100644 index 1c1dc48bc..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/drupal.html.twig +++ /dev/null @@ -1,66 +0,0 @@ -{% block toolbar %} - {% set icon %} - - Drupal - - {{ collector.version }} - - - {% endset %} - {% set text %} - {% spaceless %} -
        - {{ 'Drupal version'|t }} - {{ collector.version }} -
        -
        - {{ 'Installed profile'|t }} - {{ collector.profile }} -
        - - {% if collector.getGitCommit %} -
        - {{ 'Git commit'|t }} - {{ collector.getAbbrGitCommit }} -
        - {% endif %} - - - -
        - - - {% endspaceless %} - {% endset %} - - {% if link %} - {% set icon %} - {{ icon }} - {% endset %} - {% endif %} -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} - diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/events.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/events.html.twig deleted file mode 100644 index 2794fec98..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/events.html.twig +++ /dev/null @@ -1,88 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Events'|t }} - {{ collector.getCalledListenersCount }} - - {% endset %} - - {% set text %} -
        - {{ 'Called'|t }} - {{ collector.getCalledListenersCount }} -
        - -
        - {{ 'Not called'|t }} - {{ collector.getNotCalledListenersCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/extensions.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/extensions.html.twig deleted file mode 100644 index 987a9feeb..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/extensions.html.twig +++ /dev/null @@ -1,95 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Extensions'|t }} - {{ collector.getExtensionsCount }} - - {% endset %} - {% set text %} -
        - {{ 'Active Modules'|t }} - {{ collector.getModulesCount }} -
        -
        - {{ 'Active Themes'|t }} - {{ collector.getThemesCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/forms.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/forms.html.twig deleted file mode 100644 index a602f4558..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/forms.html.twig +++ /dev/null @@ -1,67 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Forms'|t }} - {{ collector.getFormsCount }} - - {% endset %} - {% set text %} - {% spaceless %} -
        - {% for keys, form in collector.getForms %} - {{ keys }} - - {% endfor %} -
        - {% endspaceless %} - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/http.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/http.html.twig deleted file mode 100644 index ea7ad0496..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/http.html.twig +++ /dev/null @@ -1,77 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Http'|t }} - {{ collector.completedRequestsCount }} - - {% endset %} - {% set text %} -
        - {{ 'Completed'|t }} - {{ collector.completedRequestsCount }} -
        -
        - {{ 'Failed'|t }} - {{ collector.failedRequestsCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/mail.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/mail.html.twig deleted file mode 100644 index 3b34062b6..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/mail.html.twig +++ /dev/null @@ -1,76 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Mail'|t }} - {{ collector.mailsent }} - - {% endset %} - {% set text %} -
        - Mail sent - {{ collector.mailsent }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/performance_timing.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/performance_timing.html.twig deleted file mode 100644 index 5e8cf41c9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/performance_timing.html.twig +++ /dev/null @@ -1,76 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Performance Timing'|t }} - - - {% endset %} - {% set text %} - -
        - {{ 'DNS lookup'|t }} - -
        -
        - {{ 'TCP handshake'|t }} - -
        -
        - {{ 'TTFB' }} - -
        -
        - {{ 'Data download'|t }} - -
        -
        - {{ 'DOM building'|t }} - -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        - - -{% endblock %} - -{% block panel %} - -{% endblock %} \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/php_config.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/php_config.html.twig deleted file mode 100644 index c91f9f321..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/php_config.html.twig +++ /dev/null @@ -1,52 +0,0 @@ -{% block toolbar %} - {# PHP Information #} - {% set icon %} - - {{ 'PHP config'|t }} - - {% endset %} - {% set text %} - {% spaceless %} - -
        - {{ 'PHP Extensions'|t }} - xdebug - accel -
        -
        - {{ 'PHP SAPI'|t }} - {{ collector.sapiName }} -
        -
        - Token - {{ token }} -
        - {% endspaceless %} - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/request.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/request.html.twig deleted file mode 100644 index b57a85419..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/request.html.twig +++ /dev/null @@ -1,216 +0,0 @@ -{% block toolbar %} - {% set request_handler %} - {{ abbr(collector.controller.class)|raw }} - ::{{ collector.controller.method }} - {% endset %} - - {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %} - - {% set request_route = collector.route ? collector.route : 'NONE' %} - - {% set icon %} - - {{ 'Request'|t }} - {{ collector.statuscode }} - - {% endset %} - - {% set text %} - {% spaceless %} -
        - {{ 'Status'|t }} - {{ collector.statuscode }} {{ collector.statustext }} -
        -
        - {{ 'Controller'|t }} - {{ request_handler }} -
        -
        - {{ 'Route name'|t }} - {{ request_route }} -
        - {% endspaceless %} - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/routing.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/routing.html.twig deleted file mode 100644 index 76700112a..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/routing.html.twig +++ /dev/null @@ -1,50 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Routing'|t }} - {{ collector.getRoutesCount }} - - - {% endset %} - - {% set text %} -
        - {{ 'Routes'|t }} - {{ collector.getRoutesCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/services.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/services.html.twig deleted file mode 100644 index dab3e55dd..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/services.html.twig +++ /dev/null @@ -1,149 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Services'|t }} - {{ collector.getInitializedServicesCount }} - - {% endset %} - {% set text %} -
        - {{ 'Initialized'|t }} - {{ collector.getInitializedServicesCount }} ({{ collector.getInitializedServicesWithoutWebprofilerCount }} - ) -
        -
        - {{ 'Available'|t }} - {{ collector.getServicesCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/state.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/state.html.twig deleted file mode 100644 index e19b13baf..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/state.html.twig +++ /dev/null @@ -1,36 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'State'|t }} - {{ collector.getStateKeysCount }} - - {% endset %} - {% set text %} -
        - {{ 'State get'|t }} - {{ collector.getStateKeysCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/theme.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/theme.html.twig deleted file mode 100644 index 66fa5fdfe..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/theme.html.twig +++ /dev/null @@ -1,147 +0,0 @@ -{% block toolbar %} - {% set negotiator %} - {{ abbr(collector.themeNegotiator.class.class)|raw }} - ::{{ collector.themeNegotiator.class.method }} - {% endset %} - {% set time = collector.templatecount ? '%0.0f ms'|format(collector.time) : 'n/a' %} - {% set icon %} - - {{ 'Theme'|t }} - {{ collector.activeTheme.name }} - - {% endset %} - {% set text %} - -
        - {{ 'Name'|t }} - {{ collector.activeTheme.name }} -
        -
        - {{ 'Engine'|t }} - {{ collector.activeTheme.engine }} -
        -
        - {{ 'Negotiator'|t }} - {{ negotiator }} -
        -
        - {{ 'Render Time'|t }} - {{ time }} -
        -
        - {{ 'Template Calls'|t }} - {{ collector.templatecount }} -
        -
        - {{ 'Block Calls'|t }} - {{ collector.blockcount }} -
        -
        - {{ 'Macro Calls'|t }} - {{ collector.macrocount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/time.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/time.html.twig deleted file mode 100644 index 9aeb76a37..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/time.html.twig +++ /dev/null @@ -1,59 +0,0 @@ -{% block toolbar %} - {% set duration = collector.events|length ? '%.0f ms'|format(collector.duration) : 'n/a' %} - {% set memory = '%.1f MB'|format(collector.memory / 1024 / 1024) %} - {% set total_memory = collector.memoryLimit == -1 ? '∞' : '%.1f MB'|format(collector.memoryLimit / 1024)|escape %} - {% set icon %} - - {{ 'Timeline'|t }} - {{ duration }} / {{ memory }} - - {% endset %} - {% set text %} -
        - {{ 'Total time'|t }} - {{ duration }} -
        -
        - {{ 'Memory'|t }} - {{ memory }} / {{ total_memory }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/translations.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/translations.html.twig deleted file mode 100644 index 08683ba91..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/translations.html.twig +++ /dev/null @@ -1,85 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Translations'|t }} - {{ collector.untranslatedCount }} - - {% endset %} - {% set text %} -
        - {{ 'Translated'|t }} - {{ collector.translatedCount }} -
        -
        - {{ 'Untranslated'|t }} - {{ collector.untranslatedCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/user.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/user.html.twig deleted file mode 100644 index ef369975e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/user.html.twig +++ /dev/null @@ -1,63 +0,0 @@ -{% block toolbar %} - {% set color_code = (collector.authenticated) ? 'green' : 'red' %} - {% set icon %} - - {{ 'User'|t }} - - {% if collector.authenticated %} - {{ collector.username }} - {% endif %} - - - {% endset %} - {% set text %} - {% if collector.authenticated %} -
        - {{ 'Logged in as'|t }} - {{ collector.username }} -
        -
        - {{ 'Roles'|t }} - {{ collector.roles|join(', ') }} -
        -
        - {{ 'Authenticated by'|t }} - {{ collector.provider }} -
        - {% else %} - {{ collector.anonymous }} - {% endif %} - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/views.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/views.html.twig deleted file mode 100644 index 5409cc9b5..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Collector/views.html.twig +++ /dev/null @@ -1,58 +0,0 @@ -{% block toolbar %} - {% set icon %} - - {{ 'Views'|t }} - {{ collector.getViewsCount }} - - {% endset %} - {% set text %} - -
        - {{ 'Views'|t }} - {{ collector.getViewsCount }} -
        - {% endset %} - -
        -
        {{ icon|default('') }}
        -
        {{ text|default('') }}
        -
        -{% endblock %} - -{% block panel %} - -{% endblock %} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_dashboard.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_dashboard.html.twig deleted file mode 100644 index be4fb68c9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_dashboard.html.twig +++ /dev/null @@ -1,57 +0,0 @@ -{% set resume %} -
        - - {{ profile.method|upper }} - {% if profile.method|upper in ['GET', 'HEAD'] %} - {{ profile.url }} - {% else %} - {{ profile.url }} - {% endif %} - - - by {{ profile.ip }} at {{ profile.time|date('r') }} - - - {{ 'View latest'|t }} -
        -{% endset %} - -
        - - {{ resume }} - -
        -
        - - - - - - {{ panels }} - - -
        diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_loader.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_loader.html.twig deleted file mode 100644 index ad8da9bd0..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_loader.html.twig +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_panel.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_panel.html.twig deleted file mode 100644 index b06daff3f..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_panel.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ panel|raw }} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.css.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.css.twig deleted file mode 100644 index fccb64b0f..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.css.twig +++ /dev/null @@ -1,311 +0,0 @@ -.sf-minitoolbar { -display: none; - -position: fixed; -bottom: 0; -right: 0; - -padding: 5px 5px 0; - -background-color: #f7f7f7; -background-image: -moz-linear-gradient(top, #e4e4e4, #ffffff); -background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); -background-image: -o-linear-gradient(top, #e4e4e4, #ffffff); -background: linear-gradient(top, #e4e4e4, #ffffff); - -border-radius: 16px 0 0 0; - -z-index: 6000000; -} - -.sf-toolbarreset { -position: fixed; -background-color: #f7f7f7; -left: 0; -right: 0; -height: 38px; -margin: 0; -padding: 0 40px 0 0; -z-index: 6000000; -font: 11px Verdana, Arial, sans-serif; -text-align: left; -color: #2f2f2f; - -background-image: -moz-linear-gradient(top, #e4e4e4, #ffffff); -background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); -background-image: -o-linear-gradient(top, #e4e4e4, #ffffff); -background: linear-gradient(top, #e4e4e4, #ffffff); - -bottom: 0; -border-top: 1px solid #bbb; -} -.sf-toolbarreset abbr { -border-bottom: 1px dotted #000000; -} -.sf-toolbarreset span, -.sf-toolbarreset div { -font-size: 11px; -} -.sf-toolbarreset img { -width: auto; -display: inline; -} - -.sf-toolbarreset .hide-button { -display: block; -position: absolute; -top: 0; -right: 0; -width: 40px; -height: 40px; -cursor: pointer; -background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAllBMVEXDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PExMTPz8/Q0NDR0dHT09Pb29vc3Nzf39/h4eHi4uLj4+P6+vr7+/v8/Pz9/f3///+Nh2QuAAAAIXRSTlMABgwPGBswMzk8QktRV4SKjZOWmaKlq7TAxszb3urt+fy1vNEpAAAAiklEQVQIHUXBBxKCQBREwRFzDqjoGh+C2YV//8u5Sll2S0E/dof1tKdKM6GyqCto7PjZRJIS/mbSELgXOSd/BzpKIH1ZefVWpDDTHsi8mZVnwImPi5ndCLbaAZk3M58Bay0h9VbeSvMpjDUAHj4jL55AW1rxN5fU2PLjIgVRzNdxVFOlGzvnJi0Fb1XNGBHA9uQOAAAAAElFTkSuQmCC'); -background-repeat: no-repeat; -background-position: 13px 11px; -} -.sf-toolbarreset a { -color: #000 !important; -border: none; -} - -.sf-toolbar-block { -white-space: nowrap; -color: #2f2f2f; -display: block; -min-height: 28px; -border-right: 1px solid #e4e4e4; -padding: 0; -float: left; -cursor: default; -} - -.sf-toolbar-block span { -display: inline-block; -} - -.sf-toolbar-block .sf-toolbar-info-piece { -line-height: 19px; -margin-bottom: 5px; -} - -.sf-toolbar-block .sf-toolbar-info-piece .sf-toolbar-status { -padding: 0px 5px; -border-radius: 5px; -margin-bottom: 0px; -vertical-align: top; -} - -.sf-toolbar-block .sf-toolbar-info-piece:last-child { -margin-bottom: 0; -} - -.sf-toolbar-block .sf-toolbar-info-piece a, -.sf-toolbar-block .sf-toolbar-info-piece abbr { -color: #2f2f2f; -} - -.sf-toolbar-block .sf-toolbar-info-piece b { -display: inline-block; -width: 150px; -vertical-align: top; -} - -.sf-toolbar-block .sf-toolbar-info-with-next-pointer:after { -content: ' :: '; -color: #999; -} - -.sf-toolbar-block .sf-toolbar-info-with-delimiter { -border-right: 1px solid #999; -padding-right: 5px; -margin-right: 5px; -} - -.sf-toolbar-block .sf-toolbar-info { -display: none; -position: absolute; -background-color: #fff; -border: 1px solid #bbb; -padding: 9px 0; -margin-left: -1px; - -bottom: 38px; -border-bottom-width: 0; -border-bottom: 1px solid #bbb; -border-radius: 4px 4px 0 0; -} - -.sf-toolbarreset > div:last-of-type .sf-toolbar-info { -right: -1px; -} - -.sf-toolbar-block .sf-toolbar-info:empty { -visibility: hidden; -} - -.sf-toolbar-block .sf-toolbar-status { -display: inline-block; -color: #fff; -background-color: #666; -padding: 3px 6px; -border-radius: 3px; -margin-bottom: 2px; -vertical-align: middle; -min-width: 6px; -min-height: 13px; -} - -.sf-toolbar-block .sf-toolbar-status abbr { -color: #fff; -border-bottom: 1px dotted black; -} - -.sf-toolbar-block .sf-toolbar-status-green { -background-color: #759e1a; -} - -.sf-toolbar-block .sf-toolbar-status-red { -background-color: #a33; -} - -.sf-toolbar-block .sf-toolbar-status-yellow { -background-color: #ffcc00; -color: #000; -} - -.sf-toolbar-block .sf-toolbar-status-black { -background-color: #000; -} - -.sf-toolbar-block .sf-toolbar-icon { -display: block; -} - -.sf-toolbar-block .sf-toolbar-icon > a, -.sf-toolbar-block .sf-toolbar-icon > span { -display: block; -font-weight: normal; -text-decoration: none; -margin: 0; -padding: 5px 6px; -min-width: 20px; -text-align: center; -vertical-align: middle; -} - -.sf-toolbar-block .sf-toolbar-icon > a, -.sf-toolbar-block .sf-toolbar-icon > a:link -.sf-toolbar-block .sf-toolbar-icon > a:hover { -color: black !important; -} - -.sf-toolbar-block .sf-toolbar-icon > a[href]:after { -content: ""; -} - -.sf-toolbar-block .sf-toolbar-icon img { -border-width: 0; -vertical-align: middle; -} - -.sf-toolbar-block .sf-toolbar-icon img + span { -margin-left: 0; -margin-top: 2px; -} - -.sf-toolbar-block .sf-toolbar-icon .sf-toolbar-status { -border-radius: 12px; -border-bottom-left-radius: 0; -margin-top: 0; -} - -.sf-toolbar-block .sf-toolbar-info-method { -cursor: hand; -} - -.sf-toolbar-block .sf-toolbar-info-method[onclick=""] { -border-bottom: none; -cursor: inherit; -} - -.sf-toolbar-info-php {} -.sf-toolbar-info-php-ext {} - -.sf-toolbar-info-php-ext .sf-toolbar-status { -margin-left: 2px; -} - -.sf-toolbar-info-php-ext .sf-toolbar-status:first-child { -margin-left: 0; -} - -.sf-toolbar-block a .sf-toolbar-info-piece-additional, -.sf-toolbar-block a .sf-toolbar-info-piece-additional-detail { -display: inline-block; -} - -.sf-toolbar-block a .sf-toolbar-info-piece-additional:empty, -.sf-toolbar-block a .sf-toolbar-info-piece-additional-detail:empty { -display: none; -} - -.sf-toolbarreset:hover { -box-shadow: rgba(0, 0, 0, 0.3) 0 0 50px; -} - -.sf-toolbar-block:hover { -box-shadow: rgba(0, 0, 0, 0.35) 0 0 5px; -border-right: none; -margin-right: 1px; -position: relative; -} - -.sf-toolbar-block:hover .sf-toolbar-icon { -background-color: #fff; -border-top: 1px dotted #DDD; -position: relative; -margin-top: -1px; -z-index: 10002; -} - -.sf-toolbar-block:hover .sf-toolbar-info { -display: block; -min-width: -webkit-calc(100% + 2px); -min-width: calc(100% + 2px); -z-index: 10001; -box-sizing: border-box; -padding: 9px; -line-height: 19px; -} - -/***** Media query *****/ -@media screen and (max-width: 779px) { -.sf-toolbar-block .sf-toolbar-icon > * > :first-child ~ * { -display: none; -} - -.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional, -.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional-detail { -display: none !important; -} -} - -@media screen and (max-width: 1179px) { -.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional { -display: none; -} -} - -@media screen and (max-width: 1439px) { -.sf-toolbar-block .sf-toolbar-icon > * > .sf-toolbar-info-piece-additional-detail { -display: none; -} -} - -/***** Media query print: Do not print the Toolbar. *****/ -@media print { -.sf-toolbar { -display: none; -visibility: hidden; -} -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.html.twig b/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.html.twig deleted file mode 100644 index f452aec02..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/templates/Profiler/webprofiler_toolbar.html.twig +++ /dev/null @@ -1,35 +0,0 @@ - - -
        - -
        - {{ toolbar|raw }} - - -
        diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php b/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php deleted file mode 100644 index 84c7d820f..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php +++ /dev/null @@ -1,79 +0,0 @@ -getEditable('system.site')->set('page.front', '/node')->save(TRUE); - } - - /** - * Tests if the toolbar appears on front page. - */ - public function testToolbarOnFrontPage() { - $this->loginForToolbar(); - - $this->drupalGet(''); - - $this->waitForToolbar(); - - $assert = $this->assertSession(); - $assert->pageTextContains(\Drupal::VERSION); - $assert->pageTextContains('Configure Webprofiler'); - $assert->pageTextContains('View latest reports'); - $assert->pageTextContains('Drupal Documentation'); - $assert->pageTextContains('Get involved!'); - } - - /** - * Tests the toolbar report page. - */ - public function testToolbarReportPage() { - $this->loginForDashboard(); - - $this->drupalGet(''); - - $token = $this->waitForToolbar(); - - $this->drupalGet('admin/reports/profiler/list'); - - $assert = $this->assertSession(); - $assert->pageTextContains($token); - } - - /** - * Tests the toolbar not appears on excluded path. - */ - public function testToolbarNotAppearsOnExcludedPath() { - $this->loginForDashboard(); - - $this->drupalGet('admin/config/development/devel'); - $token = $this->waitForToolbar(); - $assert = $this->assertSession(); - $assert->pageTextContains($token); - $assert->pageTextContains('Configure Webprofiler'); - - $this->config('webprofiler.config') - ->set('exclude', '/admin/config/development/devel') - ->save(); - $this->drupalGet('admin/config/development/devel'); - $this->assertSession()->pageTextNotContains('sf-toolbar'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php b/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php deleted file mode 100644 index b38a1f21e..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php +++ /dev/null @@ -1,80 +0,0 @@ -getSession(); - $token = $this->getToken(); - $page = $session->getPage(); - - $toolbar = $page->findById('webprofiler' . $token); - $this->assertTrue($toolbar->hasClass('sf-toolbar'), 'Toolbar loader is present in page'); - - $session->wait(1000, 'null !== document.getElementById(\'sfToolbarMainContent-' . $token . '\')'); - - return $token; - } - - /** - * Return the Webprofiler token. - * - * @return null|string - * The page token - */ - protected function getToken() { - $token = $this->getSession()->getResponseHeader('X-Debug-Token'); - - if (NULL === $token) { - throw new PHPUnit_Framework_AssertionFailedError(); - } - - return $token; - } - - /** - * Login with a user that can see the toolbar. - */ - protected function loginForToolbar() { - $admin_user = $this->drupalCreateUser( - [ - 'view webprofiler toolbar', - ] - ); - $this->drupalLogin($admin_user); - } - - /** - * Login with a user that can see the toolbar and the dashboard. - */ - protected function loginForDashboard() { - $admin_user = $this->drupalCreateUser( - [ - 'view webprofiler toolbar', - 'access webprofiler', - ] - ); - $this->drupalLogin($admin_user); - } - - /** - * Flush cache. - */ - protected function flushCache() { - $module_handler = \Drupal::moduleHandler(); - $module_handler->invokeAll('cache_flush'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Kernel/DecoratorTest.php b/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Kernel/DecoratorTest.php deleted file mode 100644 index a557c08f4..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Kernel/DecoratorTest.php +++ /dev/null @@ -1,65 +0,0 @@ -container->get($service); - - $this->assertInstanceOf($original, $entityTypeManagerOriginal); - - $this->container->get('module_installer')->install(['webprofiler']); - - $entityTypeManagerDecorated = $this->container->get($service); - - $this->assertInstanceOf($decorated, $entityTypeManagerDecorated); - } - - /** - * DataProvider for testEntityTypeDecorator. - * - * @return array - * The array of values to run tests on. - */ - public function decorators() { - return array( - array('entity_type.manager', 'Drupal\Core\Entity\EntityTypeManager', 'Drupal\webprofiler\Entity\EntityManagerWrapper'), - array('cache_factory', 'Drupal\Core\Cache\MemoryBackendFactory', 'Drupal\webprofiler\Cache\CacheFactoryWrapper'), - array('asset.css.collection_renderer', 'Drupal\Core\Asset\CssCollectionRenderer', 'Drupal\webprofiler\Asset\CssCollectionRendererWrapper'), - array('asset.js.collection_renderer', 'Drupal\Core\Asset\JsCollectionRenderer', 'Drupal\webprofiler\Asset\JsCollectionRendererWrapper'), - array('state', 'Drupal\Core\State\State', 'Drupal\webprofiler\State\StateWrapper'), - array('views.executable', 'Drupal\views\ViewExecutableFactory', 'Drupal\webprofiler\Views\ViewExecutableFactoryWrapper'), - array('form_builder', 'Drupal\Core\Form\FormBuilder', 'Drupal\webprofiler\Form\FormBuilderWrapper'), - array('access_manager', 'Drupal\Core\Access\AccessManager', 'Drupal\webprofiler\Access\AccessManagerWrapper'), - array('theme.negotiator', 'Drupal\Core\Theme\ThemeNegotiator', 'Drupal\webprofiler\Theme\ThemeNegotiatorWrapper'), - array('config.factory', 'Drupal\Core\Config\ConfigFactory', 'Drupal\webprofiler\Config\ConfigFactoryWrapper'), - array('string_translation', 'Drupal\Core\StringTranslation\TranslationManager', 'Drupal\webprofiler\StringTranslation\TranslationManagerWrapper'), - ); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/AssetsDataCollectorTest.php b/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/AssetsDataCollectorTest.php deleted file mode 100644 index 37d6ac3ee..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/AssetsDataCollectorTest.php +++ /dev/null @@ -1,68 +0,0 @@ -assetDataCollector = new AssetsDataCollector(AssetsDataCollectorTest::ROOT); - $this->assetCollectionRendererInterface = $this->getMock('Drupal\Core\Asset\AssetCollectionRendererInterface'); - } - - /** - * Tests the Assets data collector. - */ - public function testCSS() { - $css = [ - 'core/assets/vendor/normalize-css/normalize.css' => [ - 'weight' => -219.944, - 'group' => 0, - 'type' => 'file', - 'data' => 'core\/assets\/vendor\/normalize-css\/normalize.css', - 'version' => '3.0.3', - 'media' => 'all', - 'preprocess' => TRUE, - 'browsers' => [ - 'IE' => TRUE, - '!IE' => TRUE, - ], - ], - ]; - - $cssCollectionRendererWrapper = new CssCollectionRendererWrapper($this->assetCollectionRendererInterface, $this->assetDataCollector); - $cssCollectionRendererWrapper->render($css); - - $this->assertEquals(1, $this->assetDataCollector->getCssCount()); - - $this->assetDataCollector->collect($this->request, $this->response, $this->exception); - - $data = $this->assetDataCollector->getData(); - $this->assertEquals(AssetsDataCollectorTest::ROOT . '/', $data['assets']['installation_path']); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/CacheDataCollectorTest.php b/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/CacheDataCollectorTest.php deleted file mode 100644 index d51e604dd..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/CacheDataCollectorTest.php +++ /dev/null @@ -1,69 +0,0 @@ -cacheDataCollector = new CacheDataCollector(); - $this->cacheBackendInterface = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); - } - - /** - * Tests the collection of a cache miss. - */ - public function testCacheCollectorMiss() { - $this->cacheBackendInterface->expects($this->once()) - ->method('get') - ->will($this->returnValue(FALSE)); - - $cacheBackendWrapper = new CacheBackendWrapper($this->cacheDataCollector, $this->cacheBackendInterface, 'default'); - $cache = $cacheBackendWrapper->get('cache_id'); - - $this->assertFalse($cache); - - $this->assertEquals(1, $this->cacheDataCollector->getCacheMissesCount()); - } - - /** - * Tests the collection of a cache hit. - */ - public function testCacheCollectorHit() { - $cache = new \stdClass(); - $cache->cid = 'cache_id'; - $cache->expire = 1; - $cache->tags = ['tag1', 'tag2']; - $this->cacheBackendInterface->expects($this->once()) - ->method('get') - ->will($this->returnValue($cache)); - - $cacheBackendWrapper = new CacheBackendWrapper($this->cacheDataCollector, $this->cacheBackendInterface, 'default'); - $cache2 = $cacheBackendWrapper->get('cache_id'); - - $this->assertNotNull($cache2); - - $this->assertEquals(1, $this->cacheDataCollector->getCacheHitsCount()); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/DataCollectorBaseTest.php b/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/DataCollectorBaseTest.php deleted file mode 100644 index 8d62e7809..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/tests/src/Unit/DataCollector/DataCollectorBaseTest.php +++ /dev/null @@ -1,40 +0,0 @@ -request = $this->getMock('Symfony\Component\HttpFoundation\Request'); - $this->response = $this->getMock('Symfony\Component\HttpFoundation\Response'); - $this->exception = $this->getMock('Exception'); - } - -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.info.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.info.yml deleted file mode 100644 index 1940a74ec..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Web Profiler -type: module -description: 'Drupal Web Profiler.' -package: Development -# core: 8.x -configure: webprofiler.settings -tags: - - developer -dependencies: - - devel:devel - -# Information added by Drupal.org packaging script on 2019-01-29 -version: '8.x-2.0' -core: '8.x' -project: 'devel' -datestamp: 1548799386 diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.install b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.install deleted file mode 100644 index e9828ed92..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.install +++ /dev/null @@ -1,188 +0,0 @@ - 'Webprofiler profiles storage.', - 'fields' => [ - 'token' => [ - 'description' => 'Profile token.', - 'type' => 'varchar', - 'length' => 6, - 'not null' => TRUE, - ], - 'data' => [ - 'description' => 'Profile data.', - 'type' => 'text', - 'size' => 'big', - 'not null' => TRUE, - ], - 'ip' => [ - 'description' => 'Request IP.', - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ], - 'method' => [ - 'description' => 'Request method.', - 'type' => 'varchar', - 'length' => 6, - 'not null' => TRUE, - ], - 'url' => [ - 'description' => 'Requested URL.', - 'type' => 'varchar', - 'length' => 2048, - 'not null' => TRUE, - ], - 'time' => [ - 'description' => 'Request time.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'parent' => [ - 'description' => 'Profile parent.', - 'type' => 'varchar', - 'length' => 6, - 'not null' => FALSE, - ], - 'created_at' => [ - 'description' => 'Profile created time.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'status_code' => [ - 'description' => 'Profile status code.', - 'type' => 'int', - 'size' => 'small', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - ], - 'indexes' => [ - 'created_at' => ['created_at'], - 'ip' => ['ip'], - 'method' => ['method'], - 'parent' => ['parent'], - ], - 'primary key' => ['token'], - ]; - - return $schema; -} - -/** - * Implements hook_requirements(). - */ -function webprofiler_requirements($phase) { - $requirements = []; - - if ('runtime' == $phase) { - $has_d3 = _webprofiler_verify_library('webprofiler', 'd3'); - $requirements['d3js'] = [ - 'title' => t('D3.js library'), - 'value' => $has_d3 ? t('Enabled') : t('Not found'), - ]; - - if (!$has_d3) { - $requirements['d3js']['severity'] = REQUIREMENT_WARNING; - $requirements['d3js']['description'] = [ - '#prefix' => ' ', - '#markup' => t('Webprofiler module requires D3.js library to properly render data. Composer based install recommended, see README.md file for instructions.'), - ]; - } - - $has_highlight = _webprofiler_verify_library('webprofiler', 'highlightjs'); - $requirements['highlightjs'] = [ - 'title' => t('highlight.js library'), - 'value' => $has_highlight ? t('Enabled') : t('Not found'), - ]; - - if (!$has_highlight) { - $requirements['highlightjs']['severity'] = REQUIREMENT_WARNING; - $requirements['highlightjs']['description'] = [ - '#prefix' => ' ', - '#markup' => t('Webprofiler module requires highlight.js library to syntax highlight collected queries. Composer based install recommended, see README.md file for instructions.'), - ]; - } - } - - return $requirements; -} - -/** - * Verify that the library files exist. - * - * @param string $extension - * The name of the extension that registered a library. - * @param string $name - * The name of a registered library to retrieve. - * - * @return bool - * TRUE if all files of this library exists, FALSE otherwise - * - * @see https://drupal.org/node/2231385 - */ -function _webprofiler_verify_library($extension, $name) { - /** @var Drupal\Core\Asset\LibraryDiscovery $library_discovery */ - $library_discovery = \Drupal::service('library.discovery'); - $library = $library_discovery->getLibraryByName($extension, $name); - - $exist = TRUE; - if ($library['js']) { - foreach ($library['js'] as $js) { - if ($js['type'] == 'file') { - if (!file_exists(DRUPAL_ROOT . '/' . $js['data'])) { - $exist = FALSE; - } - } - } - } - - if ($library['css']) { - foreach ($library['css'] as $css) { - if ($css['type'] == 'file') { - if (!file_exists(DRUPAL_ROOT . '/' . $css['data'])) { - $exist = FALSE; - } - } - } - } - - if ($library['dependencies']) { - foreach ($library['dependencies'] as $dependency) { - $parts = explode('/', $dependency); - $exist = _webprofiler_verify_library($parts[0], $parts[1]); - } - } - - return $exist; -} - -/** - * Add a status_code column to the webprofiler table. - */ -function webprofiler_update_8001() { - $database = \Drupal::database(); - $schema = $database->schema(); - - $spec = array( - 'description' => 'Profile status code.', - 'type' => 'int', - 'size' => 'small', - 'unsigned' => TRUE, - 'not null' => TRUE, - ); - $schema->addField('webprofiler', 'status_code', $spec); -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.libraries.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.libraries.yml deleted file mode 100644 index f99c62818..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.libraries.yml +++ /dev/null @@ -1,63 +0,0 @@ -d3: - remote: https://github.com/d3/d3 - version: 3.5.17 - license: - name: BSD-3 - url: https://github.com/d3/d3/blob/master/LICENSE - gpl-compatible: true - js: - /libraries/d3/d3.min.js: {} -highlightjs: - remote: https://github.com/isagalaev/highlight.js - version: 9.7.0 - license: - name: BSD-3 - url: https://github.com/isagalaev/highlight.js/blob/master/LICENSE - gpl-compatible: true - js: - /libraries/highlightjs/highlight.pack.js: {} - css: - component: - /libraries/highlightjs/styles/idea.css: {} -dashboard: - version: 2.0 - js: - js/app/main.js: {} - js/app/helpers.js: {} - js/app/models/collector.js: {} - js/app/collections/collectors.js: {} - js/app/views/collector.js: {} - js/app/views/collectorsList.js: {} - js/app/views/layout.js: {} - js/app/views/details.js: {} - js/app/routers/collectors.js: {} - css: - component: - css/app/dashboard.css: {} - dependencies: - - core/jquery - - core/jquery.once - - core/drupal - - core/drupalSettings - - core/backbone -database: - version: 2.0 - js: - js/database.js: {} - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - webprofiler/highlightjs -timeline: - version: 2.0 - js: - js/timeline.js: {} - css: - component: - css/timeline.css: {} - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - webprofiler/d3 diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.menu.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.menu.yml deleted file mode 100644 index b2d4a7307..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -webprofiler.admin_list: - title: 'Webprofiler' - description: 'List saved profiles.' - route_name: webprofiler.admin_list - parent: system.admin_reports diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.task.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.task.yml deleted file mode 100644 index 741eb15a9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.links.task.yml +++ /dev/null @@ -1,9 +0,0 @@ -webprofiler.settings: - title: 'Webprofiler' - route_name: webprofiler.settings - base_route: devel.admin_settings - weight: 10 -webprofiler.dashboard: - title: 'dashboard' - route_name: webprofiler.dashboard - base_route: webprofiler.dashboard diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.make.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.make.yml deleted file mode 100644 index 1f5d0682b..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.make.yml +++ /dev/null @@ -1,12 +0,0 @@ -core: "8.x" -api: 2 - -libraries: - highlightjs: - download: - type: "git" - url: "https://github.com/isagalaev/highlight.js.git" - d3: - download: - type: "git" - url: "https://github.com/d3/d3.git" diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.module b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.module deleted file mode 100644 index 01e9b95f1..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.module +++ /dev/null @@ -1,51 +0,0 @@ - [ - 'template' => 'Profiler/webprofiler_loader', - 'variables' => ['token' => NULL, 'profiler_url' => NULL], - ], - 'webprofiler_toolbar' => [ - 'template' => 'Profiler/webprofiler_toolbar', - 'variables' => [ - 'token' => NULL, - 'toolbar' => NULL, - ], - ], - 'webprofiler_panel' => [ - 'template' => 'Profiler/webprofiler_panel', - 'variables' => [ - 'panel' => NULL, - ], - ], - 'webprofiler_dashboard' => [ - 'template' => 'Profiler/webprofiler_dashboard', - 'variables' => [ - 'profile' => [], - 'panels' => [], - 'spinner_path' => NULL, - ], - ], - ]; -} - -/** - * Implements hook_cache_flush(). - */ -function webprofiler_cache_flush() { - $config = \Drupal::configFactory()->get('webprofiler.config'); - - if ($config->get('purge_on_cache_clear')) { - $profiler = \Drupal::service('profiler'); - $profiler->purge(); - } -} diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.permissions.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.permissions.yml deleted file mode 100644 index b39752527..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.permissions.yml +++ /dev/null @@ -1,7 +0,0 @@ -'access webprofiler': - title: 'Access webprofiler' - description: 'Access webprofiler collected data.' - 'restrict access': TRUE -'view webprofiler toolbar': - title: 'View webprofiler toolbar' - description: 'View webprofiler toolbar.' diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.routing.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.routing.yml deleted file mode 100644 index 11543ecb9..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.routing.yml +++ /dev/null @@ -1,81 +0,0 @@ -# toolbar -webprofiler.toolbar: - path: '/profiler/{profile}' - defaults: - _controller: '\Drupal\webprofiler\Controller\ToolbarController::toolbarAction' - options: - parameters: - profile: - type: 'webprofiler:token' - requirements: - _permission: 'view webprofiler toolbar' - -# save frontend data -webprofiler.frontend.save: - path: '/admin/reports/profiler/frontend/{profile}/save' - defaults: - _controller: '\Drupal\webprofiler\Controller\ToolbarController::savePerformanceTimingAction' - _title: 'Save performance timing data' - options: - parameters: - profile: - type: 'webprofiler:token' - methods: [POST] - requirements: - _permission: 'view webprofiler toolbar' - -# view profile -webprofiler.dashboard: - path: '/admin/reports/profiler/view/{profile}' - defaults: - _controller: '\Drupal\webprofiler\Controller\DashboardController::dashboardAction' - _title: 'Webprofiler' - options: - parameters: - profile: - type: 'webprofiler:token' - requirements: - _permission: 'access webprofiler' - -# list stored profiles -webprofiler.admin_list: - path: '/admin/reports/profiler/list' - defaults: - _controller: '\Drupal\webprofiler\Controller\DashboardController::listAction' - _title: 'Webprofiler' - requirements: - _permission: 'access webprofiler' - -webprofiler.rest.collector: - path: '/admin/reports/profiler/view/{profile}/collectors/{collector}' - defaults: - _controller: '\Drupal\webprofiler\Controller\DashboardController::restCollectorAction' - _title: 'Webprofiler' - options: - parameters: - profile: - type: 'webprofiler:token' - requirements: - _permission: 'access webprofiler' - -# get query explain -webprofiler.database.explain: - path: '/admin/reports/profiler/database_explain/{profile}/{qid}' - defaults: - _controller: '\Drupal\webprofiler\Controller\DatabaseController::explainAction' - _title: 'Query explain' - options: - parameters: - profile: - type: 'webprofiler:token' - requirements: - _permission: 'access webprofiler' - -# configure webprofiler -webprofiler.settings: - path: '/admin/config/development/devel/webprofiler' - defaults: - _form: 'Drupal\webprofiler\Form\ConfigForm' - _title: 'Webprofiler settings' - requirements: - _permission: 'access webprofiler' diff --git a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.services.yml b/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.services.yml deleted file mode 100644 index 50527926a..000000000 --- a/sites/all/modules/contrib/dev/devel/webprofiler/webprofiler.services.yml +++ /dev/null @@ -1,262 +0,0 @@ -parameters: - webprofiler.only_exceptions: false - webprofiler.only_master_requests: false - -services: - -# profiler services - logger.channel.webprofiler: - class: Drupal\Core\Logger\LoggerChannel - factory: logger.factory:get - arguments: ['webprofiler'] - - profiler.file_storage: - class: Drupal\webprofiler\Profiler\FileProfilerStorage - arguments: ['%data_collector.storage%'] - tags: - - { name: webprofiler_storage, title: 'File storage' } - - profiler.database_storage: - class: Drupal\webprofiler\Profiler\DatabaseProfilerStorage - arguments: ['@database'] - tags: - - { name: webprofiler_storage, title: 'Database storage' } - - profiler.storage_manager: - class: Drupal\webprofiler\Profiler\ProfilerStorageManager - - profiler.storage: - class: Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface - factory: Drupal\webprofiler\Profiler\ProfilerStorageFactory::getProfilerStorage - arguments: ['@config.factory', '@service_container'] - - profiler: - class: Drupal\webprofiler\Profiler\Profiler - arguments: ['@profiler.storage', '@logger.channel.webprofiler', '@config.factory'] - -# template manager - template_manager: - class: Drupal\webprofiler\Profiler\TemplateManager - arguments: ['@profiler', '@twig', '@twig.loader', '%data_collector.templates%'] - -# request matcher - webprofiler.matcher: - class: Drupal\webprofiler\RequestMatcher\WebprofilerRequestMatcher - arguments: ['@config.factory', '@path.matcher'] - -# event subscribers - webprofiler.profiler_listener: - class: Drupal\webprofiler\EventSubscriber\ProfilerSubscriber - arguments: ['@profiler', '@request_stack', '@?webprofiler.matcher', '%webprofiler.only_exceptions%', '%webprofiler.only_master_requests%'] - tags: - - { name: event_subscriber } - - webprofiler.webprofiler_event_subscriber: - class: Drupal\webprofiler\EventSubscriber\WebprofilerEventSubscriber - arguments: ['@current_user', '@url_generator', '@renderer'] - tags: - - { name: event_subscriber } - -# twig profiler - twig.profile: - class: Twig_Profiler_Profile - - twig.extension.profiler: - class: Drupal\webprofiler\Twig\Extension\ProfilerExtension - arguments: ['@twig.profile', '@stopwatch', '@webprofiler.ide_link_generator', '@webprofiler.class_shortener'] - tags: - - { name: twig.extension, priority: 100 } - -# datacollector services - webprofiler.drupal: - class: Drupal\webprofiler\DataCollector\DrupalDataCollector - arguments: ['@redirect.destination', '@url_generator'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/drupal.html.twig', id: 'drupal', title: 'Drupal', priority: 10 } - - webprofiler.devel: - class: Drupal\webprofiler\DataCollector\DevelDataCollector - arguments: ['@menu.link_tree'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/devel.html.twig', id: 'devel', title: 'Devel', priority: 15 } - - webprofiler.php_config: - class: Drupal\webprofiler\DataCollector\PhpConfigDataCollector - tags: - - { name: data_collector, template: '@webprofiler/Collector/php_config.html.twig', id: 'php_config', title: 'PHP Config', priority: 20 } - - webprofiler.request: - class: Drupal\webprofiler\DataCollector\RequestDataCollector - arguments: ['@controller_resolver'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/request.html.twig', id: 'request', title: 'Request', priority: 30 } - - { name: event_subscriber } - - webprofiler.time: - class: Drupal\webprofiler\DataCollector\TimeDataCollector - arguments: [NULL, '@stopwatch'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/time.html.twig', id: 'time', title: 'Timeline', priority: 40 } - - webprofiler.performance_timing: - class: Drupal\webprofiler\DataCollector\PerformanceTimingDataCollector - tags: - - { name: data_collector, template: '@webprofiler/Collector/performance_timing.html.twig', id: 'performance_timing', title: 'Performance Timing', priority: 50 } - - webprofiler.database: - class: Drupal\webprofiler\DataCollector\DatabaseDataCollector - arguments: ['@database', '@config.factory'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/database.html.twig', id: 'database', title: 'Database', priority: 60 } - - webprofiler.user: - class: Drupal\webprofiler\DataCollector\UserDataCollector - arguments: ['@current_user', '@entity.manager', '@config.factory', '@authentication_collector'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/user.html.twig', id: 'user', title: 'User', priority: 70 } - - webprofiler.forms: - class: Drupal\webprofiler\DataCollector\FormsDataCollector - arguments: ['@form_builder'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/forms.html.twig', id: 'forms', title: 'Forms', priority: 80 } - - webprofiler.drupal_extensions: - class: Drupal\webprofiler\DataCollector\ExtensionDataCollector - arguments: ['@module_handler', '@theme_handler', '@app.root'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/extensions.html.twig', id: 'drupal_extension', title: 'Extensions', priority: 90 } - - webprofiler.routing: - class: Drupal\webprofiler\DataCollector\RoutingDataCollector - arguments: ['@router.route_provider'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/routing.html.twig', id: 'routing', title: 'Routing', priority: 100 } - - webprofiler.cache: - class: Drupal\webprofiler\DataCollector\CacheDataCollector - tags: - - { name: data_collector, template: '@webprofiler/Collector/cache.html.twig', id: 'cache', title: 'Cache', priority: 110 } - - webprofiler.assets: - class: Drupal\webprofiler\DataCollector\AssetsDataCollector - arguments: ['@app.root'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/assets.html.twig', id: 'assets', title: 'Assets', priority: 120} - - webprofiler.config: - class: Drupal\webprofiler\DataCollector\ConfigDataCollector - tags: - - { name: data_collector, template: '@webprofiler/Collector/config.html.twig', id: 'config', title: 'Config', priority: 130 } - - webprofiler.state: - class: Drupal\webprofiler\DataCollector\StateDataCollector - tags: - - { name: data_collector, template: '@webprofiler/Collector/state.html.twig', id: 'state', title: 'State', priority: 140 } - - webprofiler.events: - class: Drupal\webprofiler\DataCollector\EventsDataCollector - arguments: ['@event_dispatcher'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/events.html.twig', id: 'events', title: 'Events', priority: 150 } - - webprofiler.services: - class: Drupal\webprofiler\DataCollector\ServicesDataCollector - arguments: ['@service_container'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/services.html.twig', id: 'services', title: 'Services', priority: 160 } - - webprofiler.http: - class: Drupal\webprofiler\DataCollector\HttpDataCollector - arguments: ['@http_client_middleware.webprofiler'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/http.html.twig', id: 'http', title: 'Http', priority: 170 } - - webprofiler.theme: - class: Drupal\webprofiler\DataCollector\ThemeDataCollector - arguments: ['@theme.manager', '@theme.negotiator', '@twig.profile'] - tags: - - { name: data_collector, template: '@webprofiler/Collector/theme.html.twig', id: 'theme', title: 'Theme', priority: 180 } - - webprofiler.mail: - class: Drupal\webprofiler\DataCollector\MailDataCollector - tags: - - { name: data_collector, template: '@webprofiler/Collector/mail.html.twig', id: 'mail', title: 'Mail', priority: 190 } - -# debug services - stopwatch: - class: Drupal\webprofiler\Stopwatch - - webprofiler.debug.plugin.manager.mail.default: - class: Drupal\Core\Mail\MailManager - arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@config.factory', '@logger.factory', '@string_translation', '@renderer'] - - webprofiler.debug.controller_resolver: - class: Symfony\Component\HttpKernel\Controller\TraceableControllerResolver - arguments: ['@controller_resolver', '@stopwatch'] - - webprofiler.debug.cache_factory: - class: Drupal\webprofiler\Cache\CacheFactoryWrapper - public: false - decorates: cache_factory - arguments: ['@webprofiler.debug.cache_factory.inner', '@webprofiler.cache'] - properties: - _serviceId: 'cache_factory' - - webprofiler.debug.asset.css.collection_renderer: - class: Drupal\webprofiler\Asset\CssCollectionRendererWrapper - public: false - decorates: asset.css.collection_renderer - arguments: ['@webprofiler.debug.asset.css.collection_renderer.inner', '@webprofiler.assets'] - properties: - _serviceId: 'asset.css.collection_renderer' - - webprofiler.debug.asset.js.collection_renderer: - class: Drupal\webprofiler\Asset\JsCollectionRendererWrapper - public: false - decorates: asset.js.collection_renderer - arguments: ['@webprofiler.debug.asset.js.collection_renderer.inner', '@webprofiler.assets'] - properties: - _serviceId: 'asset.js.collection_renderer' - - webprofiler.debug.entity_type.manager: - class: Drupal\webprofiler\Entity\EntityManagerWrapper - public: false - decorates: entity_type.manager - arguments: ['@webprofiler.debug.entity_type.manager.inner'] - properties: - _serviceId: 'entity_type.manager' - - webprofiler.debug.state: - class: Drupal\webprofiler\State\StateWrapper - public: false - decorates: state - arguments: ['@webprofiler.debug.state.inner', '@webprofiler.state'] - properties: - _serviceId: 'state' - -# middleware - http_middleware.webprofiler: - class: Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware - tags: - - { name: http_middleware, priority: 350 } - - http_client_middleware.webprofiler: - class: Drupal\webprofiler\Http\HttpClientMiddleware - tags: - - { name: http_client_middleware } - -# parameter converter service for profile token - webprofiler.token_converter: - class: Drupal\webprofiler\Routing\TokenConverter - tags: - - { name: paramconverter } - -# IDE link generator service - webprofiler.ide_link_generator: - class: Drupal\webprofiler\Helper\IdeLinkGenerator - arguments: ['@config.factory'] - -# class shortener service - webprofiler.class_shortener: - class: Drupal\webprofiler\Helper\ClassShortener diff --git a/sites/all/modules/contrib/dev/entity/.travis.yml b/sites/all/modules/contrib/dev/entity/.travis.yml deleted file mode 100644 index e48d5d7d3..000000000 --- a/sites/all/modules/contrib/dev/entity/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -language: php -sudo: false - -php: - - 5.5 - - 5.6 - - 7 - - hhvm - -matrix: - allow_failures: - # We cannot use hhvm-nightly since that does not work in Travis CI's old - # Ubuntu 12.04. - - php: hhvm - # Don't wait for the allowed failures to build. - fast_finish: true - -mysql: - database: entity - username: root - encoding: utf8 - -before_script: - # Remove Xdebug as we don't need it and it causes - # PHP Fatal error: Maximum function nesting level of '256' reached. - # We also don't care if that file exists or not on PHP 7. - - phpenv config-rm xdebug.ini || true - - # Remember the current entity test directory for later use in the Drupal - # installation. - - TESTDIR=$(pwd) - # Navigate out of module directory to prevent blown stack by recursive module - # lookup. - - cd .. - - # Create database. - - mysql -e 'create database entity' - # Export database variable for kernel tests. - - export SIMPLETEST_DB=mysql://root:@127.0.0.1/entity - # Download Drupal 8 core. - - travis_retry git clone --branch 8.5.x --depth 1 http://git.drupal.org/project/drupal.git - - cd drupal - - composer self-update - - composer install -n - - # Reference entity in build site. - - ln -s $TESTDIR modules/entity - - # Start a web server on port 8888, run in the background; wait for - # initialization. - - nohup php -S localhost:8888 > /dev/null 2>&1 & - - # Export web server URL for browser tests. - - export SIMPLETEST_BASE_URL=http://localhost:8888 - -script: - # Run the PHPUnit tests which also include the kernel tests. - - ./vendor/phpunit/phpunit/phpunit -c ./core/phpunit.xml.dist --verbose ./modules/entity diff --git a/sites/all/modules/contrib/dev/entity/LICENSE.txt b/sites/all/modules/contrib/dev/entity/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/entity/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/entity/README.txt b/sites/all/modules/contrib/dev/entity/README.txt deleted file mode 100644 index c43f96ccd..000000000 --- a/sites/all/modules/contrib/dev/entity/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -Entity API module ------------------ - -Provides improvements and extensions to the Drupal 8 Entity system. -Acts as a staging ground for Drupal core, with each core minor release (8.5, 8.6, 8.7) -receiving a portion of this module's functionality. - -Current functionality: -- Local action providers (core issue: #2976861) -- Permission providers (core issue: #2809177) -- Query access API (Change record: https://www.drupal.org/node/3002038, core issue: #777578) -- Bundle plugin API (plugin-based entity bundles, currently not proposed for core inclusion) -- A generic UI for revisions (WIP, see #2625122) diff --git a/sites/all/modules/contrib/dev/entity/composer.json b/sites/all/modules/contrib/dev/entity/composer.json deleted file mode 100644 index ab1420aef..000000000 --- a/sites/all/modules/contrib/dev/entity/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "drupal/entity", - "type": "drupal-module", - "description": "Provides expanded entity APIs, which will be moved to Drupal core one day.", - "homepage": "http://drupal.org/project/entity", - "license": "GPL-2.0+", - "require": { - "drupal/core": "^8.6" - } -} diff --git a/sites/all/modules/contrib/dev/entity/config/schema/entity.schema.yml b/sites/all/modules/contrib/dev/entity/config/schema/entity.schema.yml deleted file mode 100644 index b3c192358..000000000 --- a/sites/all/modules/contrib/dev/entity/config/schema/entity.schema.yml +++ /dev/null @@ -1,11 +0,0 @@ -action.configuration.entity_delete_action:*: - type: action_configuration_default - label: 'Delete entity configuration' - -views.field.rendered_entity: - type: views_field - label: 'Rendered entity' - mapping: - view_mode: - type: string - label: 'View mode' diff --git a/sites/all/modules/contrib/dev/entity/entity.info.yml b/sites/all/modules/contrib/dev/entity/entity.info.yml deleted file mode 100644 index 473f3ed38..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Entity -description: Provides expanded entity APIs, which will be moved to Drupal core one day. -type: module -# core: 8.x -dependencies: - - drupal:system (>=8.6.0) - -# Information added by Drupal.org packaging script on 2018-10-11 -version: '8.x-1.0-rc1' -core: '8.x' -project: 'entity' -datestamp: 1539272605 diff --git a/sites/all/modules/contrib/dev/entity/entity.links.action.yml b/sites/all/modules/contrib/dev/entity/entity.links.action.yml deleted file mode 100644 index 5e02edcd7..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.links.action.yml +++ /dev/null @@ -1,2 +0,0 @@ -entity.entity_actions: - deriver: Drupal\entity\Plugin\Derivative\EntityActionsDeriver diff --git a/sites/all/modules/contrib/dev/entity/entity.links.task.yml b/sites/all/modules/contrib/dev/entity/entity.links.task.yml deleted file mode 100644 index 8116ae326..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.links.task.yml +++ /dev/null @@ -1,3 +0,0 @@ -entity.revisions_overview: - deriver: 'Drupal\entity\Plugin\Derivative\RevisionsOverviewDeriver' - weight: 100 diff --git a/sites/all/modules/contrib/dev/entity/entity.module b/sites/all/modules/contrib/dev/entity/entity.module deleted file mode 100644 index 546f32278..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.module +++ /dev/null @@ -1,120 +0,0 @@ -getDefinitions(); - $entity_types = array_filter($entity_types, function (EntityTypeInterface $entity_type) { - return $entity_type->hasHandlerClass('bundle_plugin'); - }); - - return $entity_types; -} - -/** - * Implements hook_entity_type_build(). - */ -function entity_entity_type_build(array &$entity_types) { - foreach ($entity_types as $entity_type) { - if ($entity_type->get('bundle_plugin_type')) { - $entity_type->setHandlerClass('bundle_plugin', BundlePluginHandler::class); - } - } -} - -/** - * Implements hook_entity_bundle_info(). - */ -function entity_entity_bundle_info() { - $bundles = []; - foreach (entity_get_bundle_plugin_entity_types() as $entity_type) { - /** @var \Drupal\entity\BundlePlugin\BundlePluginHandler $bundle_handler */ - $bundle_handler = \Drupal::entityTypeManager()->getHandler($entity_type->id(), 'bundle_plugin'); - $bundles[$entity_type->id()] = $bundle_handler->getBundleInfo(); - } - return $bundles; -} - -/** - * Implements hook_entity_field_storage_info(). - */ -function entity_entity_field_storage_info(EntityTypeInterface $entity_type) { - if ($entity_type->hasHandlerClass('bundle_plugin')) { - /** @var \Drupal\entity\BundlePlugin\BundlePluginHandler $bundle_handler */ - $bundle_handler = \Drupal::entityTypeManager()->getHandler($entity_type->id(), 'bundle_plugin'); - return $bundle_handler->getFieldStorageDefinitions(); - } -} - -/** - * Implements hook_entity_bundle_field_info(). - */ -function entity_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle) { - if ($entity_type->hasHandlerClass('bundle_plugin')) { - /** @var \Drupal\entity\BundlePlugin\BundlePluginHandler $bundle_handler */ - $bundle_handler = \Drupal::entityTypeManager()->getHandler($entity_type->id(), 'bundle_plugin'); - return $bundle_handler->getFieldDefinitions($bundle); - } -} - -/** - * Implements hook_modules_installed(). - */ -function entity_modules_installed($modules) { - foreach (entity_get_bundle_plugin_entity_types() as $entity_type) { - \Drupal::service('entity.bundle_plugin_installer')->installBundles($entity_type, $modules); - } -} - -/** - * Implements hook_module_preuninstall(). - */ -function entity_module_preuninstall($module) { - foreach (entity_get_bundle_plugin_entity_types() as $entity_type) { - \Drupal::service('entity.bundle_plugin_installer')->uninstallBundles($entity_type, [$module]); - } -} - -/** - * Implements hook_query_TAG_alter(). - */ -function entity_query_entity_query_alter(SelectInterface $query) { - $entity_type_id = $query->getMetaData('entity_type'); - if ($query->hasTag($entity_type_id . '_access')) { - $entity_type_manager = \Drupal::entityTypeManager(); - $entity_type = $entity_type_manager->getDefinition($entity_type_id); - - \Drupal::service('class_resolver') - ->getInstanceFromDefinition(EntityQueryAlter::class) - ->alter($query, $entity_type); - } -} - -/** - * Implements hook_views_query_alter(). - */ -function entity_views_query_alter(ViewExecutable $view, QueryPluginBase $query) { - if ($query instanceof Sql) { - \Drupal::service('class_resolver') - ->getInstanceFromDefinition(ViewsQueryAlter::class) - ->alter($query, $view); - } -} diff --git a/sites/all/modules/contrib/dev/entity/entity.permissions.yml b/sites/all/modules/contrib/dev/entity/entity.permissions.yml deleted file mode 100644 index 1676e880b..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -permission_callbacks: - - \Drupal\entity\EntityPermissions::buildPermissions diff --git a/sites/all/modules/contrib/dev/entity/entity.services.yml b/sites/all/modules/contrib/dev/entity/entity.services.yml deleted file mode 100644 index 3e690d122..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.services.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - access_checker.entity_revision: - class: \Drupal\entity\Access\EntityRevisionRouteAccessChecker - arguments: ['@entity_type.manager', '@current_route_match'] - tags: - - { name: access_check, applies_to: _entity_access_revision } - - entity.bundle_plugin_installer: - class: Drupal\entity\BundlePlugin\BundlePluginInstaller - arguments: ['@entity_type.manager', '@entity_bundle.listener', '@field_storage_definition.listener', '@field_definition.listener'] - - entity.bundle_plugin.uninstall_validator: - class: \Drupal\entity\BundlePlugin\BundlePluginUninstallValidator - tags: - - { name: module_install.uninstall_validator } - arguments: ['@entity_type.manager', '@string_translation'] diff --git a/sites/all/modules/contrib/dev/entity/entity.views.inc b/sites/all/modules/contrib/dev/entity/entity.views.inc deleted file mode 100644 index 3074175c6..000000000 --- a/sites/all/modules/contrib/dev/entity/entity.views.inc +++ /dev/null @@ -1,32 +0,0 @@ -getDefinitions(); - $entity_types = array_filter($entity_types, function (EntityTypeInterface $entity_type) { - return $entity_type->entityClassImplements(ContentEntityInterface::class); - }); - - $data = []; - foreach ($entity_types as $entity_type) { - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */ - $base_table = $entity_type->getBaseTable() ?: $entity_type->id(); - - if ($entity_type->hasViewBuilderClass()) { - $data[$base_table]['rendered_entity'] = [ - 'field' => [ - 'title' => t('Rendered entity'), - 'help' => t('Renders an entity in a view mode.'), - 'id' => 'rendered_entity', - ], - ]; - } - } - - return $data; -} diff --git a/sites/all/modules/contrib/dev/entity/src/Access/EntityRevisionRouteAccessChecker.php b/sites/all/modules/contrib/dev/entity/src/Access/EntityRevisionRouteAccessChecker.php deleted file mode 100644 index 799af140b..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Access/EntityRevisionRouteAccessChecker.php +++ /dev/null @@ -1,175 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->routeMatch = $route_match; - } - - /** - * {@inheritdoc} - */ - public function access(Route $route, AccountInterface $account, RouteMatchInterface $route_match = NULL) { - if (empty($route_match)) { - $route_match = $this->routeMatch; - } - - $operation = $route->getRequirement('_entity_access_revision'); - list($entity_type_id, $operation) = explode('.', $operation, 2); - - if ($operation === 'list') { - $_entity = $route_match->getParameter($entity_type_id); - return AccessResult::allowedIf($this->checkAccess($_entity, $account, $operation))->cachePerPermissions(); - } - else { - $_entity_revision = $route_match->getParameter($entity_type_id . '_revision'); - return AccessResult::allowedIf($_entity_revision && $this->checkAccess($_entity_revision, $account, $operation))->cachePerPermissions(); - } - } - - /** - * Performs access checks. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity for which to check access. - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to check access. - * @param string $operation - * The entity operation. Usually one of 'view', 'view label', 'update' or - * 'delete'. - * - * @return bool - * The access result. - */ - protected function checkAccess(ContentEntityInterface $entity, AccountInterface $account, $operation = 'view') { - $entity_type = $entity->getEntityType(); - $entity_type_id = $entity->getEntityTypeId(); - $entity_access = $this->entityTypeManager->getAccessControlHandler($entity_type_id); - - /** @var \Drupal\Core\Entity\EntityStorageInterface $entity_storage */ - $entity_storage = $this->entityTypeManager->getStorage($entity_type_id); - - $map = [ - 'view' => "view all $entity_type_id revisions", - 'list' => "view all $entity_type_id revisions", - 'update' => "revert all $entity_type_id revisions", - 'delete' => "delete all $entity_type_id revisions", - ]; - $bundle = $entity->bundle(); - $type_map = [ - 'view' => "view $entity_type_id $bundle revisions", - 'list' => "view $entity_type_id $bundle revisions", - 'update' => "revert $entity_type_id $bundle revisions", - 'delete' => "delete $entity_type_id $bundle revisions", - ]; - - if (!$entity || !isset($map[$operation]) || !isset($type_map[$operation])) { - // If there was no node to check against, or the $op was not one of the - // supported ones, we return access denied. - return FALSE; - } - - // Statically cache access by revision ID, language code, user account ID, - // and operation. - $langcode = $entity->language()->getId(); - $cid = $entity->getRevisionId() . ':' . $langcode . ':' . $account->id() . ':' . $operation; - - if (!isset($this->accessCache[$cid])) { - $admin_permission = $entity_type->getAdminPermission(); - - // Perform basic permission checks first. - if (!$account->hasPermission($map[$operation]) && !$account->hasPermission($type_map[$operation]) && ($admin_permission && !$account->hasPermission($admin_permission))) { - $this->accessCache[$cid] = FALSE; - return FALSE; - } - - if (($admin_permission = $entity_type->getAdminPermission()) && $account->hasPermission($admin_permission)) { - $this->accessCache[$cid] = TRUE; - } - else { - // Entity access handlers are generally not aware of the "list" operation. - $operation = $operation == 'list' ? 'view' : $operation; - // First check the access to the default revision and finally, if the - // node passed in is not the default revision then access to that, too. - $this->accessCache[$cid] = $entity_access->access($entity_storage->load($entity->id()), $operation, $account) && ($entity->isDefaultRevision() || $entity_access->access($entity, $operation, $account)); - } - } - - return $this->accessCache[$cid]; - } - - /** - * Counts the number of revisions in the default language. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity. - * @param \Drupal\Core\Entity\EntityStorageInterface $entity_storage - * The entity storage. - * - * @return int - * The number of revisions in the default language. - */ - protected function countDefaultLanguageRevisions(ContentEntityInterface $entity, EntityStorageInterface $entity_storage) { - $entity_type = $entity->getEntityType(); - $count = $entity_storage->getQuery() - ->allRevisions() - ->condition($entity_type->getKey('id'), $entity->id()) - ->condition($entity_type->getKey('default_langcode'), 1) - ->count() - ->execute(); - return $count; - } - - /** - * Resets the access cache. - * - * @return $this - */ - public function resetAccessCache() { - $this->accessCache = []; - return $this; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/BundleEntityAccessControlHandler.php b/sites/all/modules/contrib/dev/entity/src/BundleEntityAccessControlHandler.php deleted file mode 100644 index be9bba591..000000000 --- a/sites/all/modules/contrib/dev/entity/src/BundleEntityAccessControlHandler.php +++ /dev/null @@ -1,49 +0,0 @@ -id(); - $entity_type_id = $this->entityType->getBundleOf(); - $permissions = [ - "administer $entity_type_id", - // View permissions provided by EntityPermissionProvider. - "view $entity_type_id", - "view $bundle $entity_type_id", - // View permissions provided by UncacheableEntityPermissionProvider. - "view own $entity_type_id", - "view any $entity_type_id", - "view own $bundle $entity_type_id", - "view any $bundle $entity_type_id", - ]; - - return AccessResult::allowedIfHasPermissions($account, $permissions, 'OR'); - } - else { - return parent::checkAccess($entity, $operation, $account); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/BundleFieldDefinition.php b/sites/all/modules/contrib/dev/entity/src/BundleFieldDefinition.php deleted file mode 100644 index 9da74c87b..000000000 --- a/sites/all/modules/contrib/dev/entity/src/BundleFieldDefinition.php +++ /dev/null @@ -1,27 +0,0 @@ -entityType = $entity_type; - $this->pluginManager = $plugin_manager; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('plugin.manager.' . $entity_type->get('bundle_plugin_type')) - ); - } - - /** - * {@inheritdoc} - */ - public function getBundleInfo() { - $bundles = []; - foreach ($this->pluginManager->getDefinitions() as $plugin_id => $definition) { - $bundles[$plugin_id] = [ - 'label' => $definition['label'], - 'description' => isset($definition['description']) ? $definition['description'] : '', - 'translatable' => $this->entityType->isTranslatable(), - 'provider' => $definition['provider'], - ]; - } - return $bundles; - } - - /** - * {@inheritdoc} - */ - public function getFieldStorageDefinitions() { - $definitions = []; - foreach (array_keys($this->pluginManager->getDefinitions()) as $plugin_id) { - /** @var \Drupal\entity\BundlePlugin\BundlePluginInterface $plugin */ - $plugin = $this->pluginManager->createInstance($plugin_id); - $definitions += $plugin->buildFieldDefinitions(); - } - // Ensure the presence of required keys which aren't set by the plugin. - foreach ($definitions as $field_name => $definition) { - $definition->setName($field_name); - $definition->setTargetEntityTypeId($this->entityType->id()); - $definitions[$field_name] = $definition; - } - - return $definitions; - } - - /** - * {@inheritdoc} - */ - public function getFieldDefinitions($bundle) { - /** @var \Drupal\entity\BundlePlugin\BundlePluginInterface $plugin */ - $plugin = $this->pluginManager->createInstance($bundle); - $definitions = $plugin->buildFieldDefinitions(); - // Ensure the presence of required keys which aren't set by the plugin. - foreach ($definitions as $field_name => $definition) { - $definition->setName($field_name); - $definition->setTargetEntityTypeId($this->entityType->id()); - $definition->setTargetBundle($bundle); - $definitions[$field_name] = $definition; - } - - return $definitions; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginHandlerInterface.php b/sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginHandlerInterface.php deleted file mode 100644 index 5702fb58c..000000000 --- a/sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginHandlerInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityBundleListener = $entity_bundle_listener; - $this->fieldStorageDefinitionListener = $field_storage_definition_listener; - $this->fieldDefinitionListener = $field_definition_listener; - } - - /** - * {@inheritdoc} - */ - public function installBundles(EntityTypeInterface $entity_type, array $modules) { - $bundle_handler = $this->entityTypeManager->getHandler($entity_type->id(), 'bundle_plugin'); - $bundles = array_filter($bundle_handler->getBundleInfo(), function ($bundle_info) use ($modules) { - return in_array($bundle_info['provider'], $modules, TRUE); - }); - foreach (array_keys($bundles) as $bundle) { - $this->entityBundleListener->onBundleCreate($bundle, $entity_type->id()); - foreach ($bundle_handler->getFieldDefinitions($bundle) as $definition) { - $this->fieldStorageDefinitionListener->onFieldStorageDefinitionCreate($definition); - $this->fieldDefinitionListener->onFieldDefinitionCreate($definition); - } - } - } - - /** - * {@inheritdoc} - */ - public function uninstallBundles(EntityTypeInterface $entity_type, array $modules) { - $bundle_handler = $this->entityTypeManager->getHandler($entity_type->id(), 'bundle_plugin'); - $bundles = array_filter($bundle_handler->getBundleInfo(), function ($bundle_info) use ($modules) { - return in_array($bundle_info['provider'], $modules, TRUE); - }); - foreach (array_keys($bundles) as $bundle) { - $this->entityBundleListener->onBundleDelete($bundle, $entity_type->id()); - foreach ($bundle_handler->getFieldDefinitions($bundle) as $definition) { - $this->fieldDefinitionListener->onFieldDefinitionDelete($definition); - $this->fieldStorageDefinitionListener->onFieldStorageDefinitionDelete($definition); - } - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginInstallerInterface.php b/sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginInstallerInterface.php deleted file mode 100644 index afeacee48..000000000 --- a/sites/all/modules/contrib/dev/entity/src/BundlePlugin/BundlePluginInstallerInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public function validate($module) { - $reasons = []; - - foreach (entity_get_bundle_plugin_entity_types() as $entity_type) { - /** @var \Drupal\entity\BundlePlugin\BundlePluginHandler $bundle_handler */ - $bundle_handler = $this->entityTypeManager->getHandler($entity_type->id(), 'bundle_plugin'); - $bundles = $bundle_handler->getBundleInfo(); - - // We find all bundles which have to be removed due to the uninstallation. - $bundles_filtered_by_module = array_filter($bundles, function ($bundle_info) use ($module) { - return $module === $bundle_info['provider']; - }); - - if (!empty($bundles_filtered_by_module)) { - $bundle_keys_with_content = array_filter(array_keys($bundles_filtered_by_module), function ($bundle) use ($entity_type) { - $result = $this->entityTypeManager->getStorage($entity_type->id())->getQuery() - ->condition($entity_type->getKey('bundle'), $bundle) - ->range(0, 1) - ->execute(); - return !empty($result); - }); - - $bundles_with_content = array_intersect_key($bundles_filtered_by_module, array_flip($bundle_keys_with_content)); - - foreach ($bundles_with_content as $bundle) { - $reasons[] = $this->t('There is data for the bundle @bundle on the entity type @entity_type. Please remove all content before uninstalling the module.', [ - '@bundle' => $bundle['label'], - '@entity_type' => $entity_type->getLabel(), - ]); - } - } - } - - return $reasons; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Controller/RevisionControllerTrait.php b/sites/all/modules/contrib/dev/entity/src/Controller/RevisionControllerTrait.php deleted file mode 100644 index 6be025a6e..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Controller/RevisionControllerTrait.php +++ /dev/null @@ -1,192 +0,0 @@ -getEntityType(); - $result = $this->entityTypeManager()->getStorage($entity_type->id())->getQuery() - ->allRevisions() - ->condition($entity_type->getKey('id'), $entity->id()) - ->sort($entity_type->getKey('revision'), 'DESC') - ->execute(); - return array_keys($result); - } - - /** - * Generates an overview table of older revisions of an entity. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * An entity object. - * - * @return array - * A render array. - */ - protected function revisionOverview(ContentEntityInterface $entity) { - $langcode = $this->languageManager() - ->getCurrentLanguage(LanguageInterface::TYPE_CONTENT) - ->getId(); - /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $entity_storage */ - $entity_storage = $this->entityTypeManager()->getStorage($entity->getEntityTypeId()); - $revision_ids = $this->revisionIds($entity); - $entity_revisions = $entity_storage->loadMultipleRevisions($revision_ids); - - $header = [$this->t('Revision'), $this->t('Operations')]; - $rows = []; - foreach ($entity_revisions as $revision) { - $row = []; - /** @var \Drupal\Core\Entity\ContentEntityInterface $revision */ - if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) { - $row[] = $this->getRevisionDescription($revision, $revision->isDefaultRevision()); - - if ($revision->isDefaultRevision()) { - $row[] = [ - 'data' => [ - '#prefix' => '', - '#markup' => $this->t('Current revision'), - '#suffix' => '', - ], - ]; - foreach ($row as &$current) { - $current['class'] = ['revision-current']; - } - } - else { - $links = $this->getOperationLinks($revision); - $row[] = [ - 'data' => [ - '#type' => 'operations', - '#links' => $links, - ], - ]; - } - } - - $rows[] = $row; - } - - $build[$entity->getEntityTypeId() . '_revisions_table'] = [ - '#theme' => 'table', - '#rows' => $rows, - '#header' => $header, - ]; - - // We have no clue about caching yet. - $build['#cache']['max-age'] = 0; - - return $build; - } - - /** - * Get the links of the operations for an entity revision. - * - * @param \Drupal\Core\Entity\EntityInterface $entity_revision - * The entity to build the revision links for. - * - * @return array - * The operation links. - */ - protected function getOperationLinks(EntityInterface $entity_revision) { - $links = []; - if ($this->hasRevertRevisionAccess($entity_revision)) { - $links['revert'] = $this->buildRevertRevisionLink($entity_revision); - } - - if ($this->hasDeleteRevisionAccess($entity_revision)) { - $links['delete'] = $this->buildDeleteRevisionLink($entity_revision); - } - - return array_filter($links); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Controller/RevisionOverviewController.php b/sites/all/modules/contrib/dev/entity/src/Controller/RevisionOverviewController.php deleted file mode 100644 index 495b6a040..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Controller/RevisionOverviewController.php +++ /dev/null @@ -1,160 +0,0 @@ -dateFormatter = $date_formatter; - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('date.formatter'), $container->get('renderer')); - } - - /** - * {@inheritdoc} - */ - protected function hasDeleteRevisionAccess(EntityInterface $entity) { - return $this->currentUser()->hasPermission("delete all {$entity->id()} revisions"); - } - - /** - * {@inheritdoc} - */ - protected function buildRevertRevisionLink(EntityInterface $entity_revision) { - if ($entity_revision->hasLinkTemplate('revision-revert-form')) { - return [ - 'title' => t('Revert'), - 'url' => $entity_revision->toUrl('revision-revert-form'), - ]; - } - } - - /** - * {@inheritdoc} - */ - protected function buildDeleteRevisionLink(EntityInterface $entity_revision) { - if ($entity_revision->hasLinkTemplate('revision-delete-form')) { - return [ - 'title' => t('Delete'), - 'url' => $entity_revision->toUrl('revision-delete-form'), - ]; - } - } - - /** - * Generates an overview table of older revisions of an entity. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * - * @return array - * A render array. - */ - public function revisionOverviewController(RouteMatchInterface $route_match) { - return $this->revisionOverview($route_match->getParameter($route_match->getRouteObject()->getOption('entity_type_id'))); - } - - /** - * {@inheritdoc} - */ - protected function getRevisionDescription(ContentEntityInterface $revision, $is_default = FALSE) { - /** @var \Drupal\Core\Entity\ContentEntityInterface|\Drupal\user\EntityOwnerInterface|\Drupal\Core\Entity\RevisionLogInterface $revision */ - if ($revision instanceof RevisionLogInterface) { - // Use revision link to link to revisions that are not active. - $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short'); - $link = $revision->toLink($date, 'revision'); - - // @todo: Simplify this when https://www.drupal.org/node/2334319 lands. - $username = [ - '#theme' => 'username', - '#account' => $revision->getRevisionUser(), - ]; - $username = $this->renderer->render($username); - } - else { - $link = $revision->toLink($revision->label(), 'revision'); - $username = ''; - - } - - $markup = ''; - if ($revision instanceof RevisionLogInterface) { - $markup = $revision->getRevisionLogMessage(); - } - - if ($username) { - $template = '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}

        {{ message }}

        {% endif %}'; - } - else { - $template = '{% trans %} {{ date }} {% endtrans %}{% if message %}

        {{ message }}

        {% endif %}'; - } - - $column = [ - 'data' => [ - '#type' => 'inline_template', - '#template' => $template, - '#context' => [ - 'date' => $link->toString(), - 'username' => $username, - 'message' => ['#markup' => $markup, '#allowed_tags' => Xss::getHtmlTagList()], - ], - ], - ]; - return $column; - } - - /** - * {@inheritdoc} - */ - protected function hasRevertRevisionAccess(EntityInterface $entity) { - return AccessResult::allowedIfHasPermission($this->currentUser(), "revert all {$entity->getEntityTypeId()} revisions")->orIf( - AccessResult::allowedIfHasPermission($this->currentUser(), "revert {$entity->bundle()} {$entity->getEntityTypeId()} revisions") - ); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Entity/RevisionableEntityBundleInterface.php b/sites/all/modules/contrib/dev/entity/src/Entity/RevisionableEntityBundleInterface.php deleted file mode 100644 index 18d392a06..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Entity/RevisionableEntityBundleInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -hasHandlerClass('permission_provider') || !is_a($entity_type->getHandlerClass('permission_provider'), EntityPermissionProvider::class, TRUE)) { - throw new \Exception('\Drupal\entity\EntityAccessControlHandler requires the \Drupal\entity\EntityPermissionProvider permission provider.'); - } - } - - /** - * {@inheritdoc} - */ - protected function checkEntityOwnerPermissions(EntityInterface $entity, $operation, AccountInterface $account) { - /** @var \Drupal\user\EntityOwnerInterface $entity */ - if ($operation === 'view') { - if ($entity instanceof EntityPublishedInterface && !$entity->isPublished()) { - if ($account->id() != $entity->getOwnerId()) { - // There's no permission for viewing other user's unpublished entity. - return AccessResult::neutral()->cachePerUser(); - } - - $permissions = [ - "view own unpublished {$entity->getEntityTypeId()}", - ]; - $result = AccessResult::allowedIfHasPermissions($account, $permissions)->cachePerUser(); - } - else { - $result = AccessResult::allowedIfHasPermissions($account, [ - "view {$entity->getEntityTypeId()}", - "view {$entity->bundle()} {$entity->getEntityTypeId()}", - ], 'OR'); - } - } - else { - $result = parent::checkEntityOwnerPermissions($entity, $operation, $account); - } - - return $result; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/EntityAccessControlHandlerBase.php b/sites/all/modules/contrib/dev/entity/src/EntityAccessControlHandlerBase.php deleted file mode 100644 index c0a63c7cb..000000000 --- a/sites/all/modules/contrib/dev/entity/src/EntityAccessControlHandlerBase.php +++ /dev/null @@ -1,115 +0,0 @@ -prepareUser($account); - /** @var \Drupal\Core\Access\AccessResult $result */ - $result = parent::checkAccess($entity, $operation, $account); - - if ($result->isNeutral()) { - if ($entity instanceof EntityOwnerInterface) { - $result = $this->checkEntityOwnerPermissions($entity, $operation, $account); - } - else { - $result = $this->checkEntityPermissions($entity, $operation, $account); - } - } - - // Ensure that access is evaluated again when the entity changes. - return $result->addCacheableDependency($entity); - } - - /** - * Checks the entity operation and bundle permissions. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity for which to check access. - * @param string $operation - * The entity operation. Usually one of 'view', 'view label', 'update' or - * 'delete'. - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to check access. - * - * @return \Drupal\Core\Access\AccessResultInterface - * The access result. - */ - protected function checkEntityPermissions(EntityInterface $entity, $operation, AccountInterface $account) { - $permissions = [ - "$operation {$entity->getEntityTypeId()}", - "$operation {$entity->bundle()} {$entity->getEntityTypeId()}", - ]; - - return AccessResult::allowedIfHasPermissions($account, $permissions, 'OR'); - } - - /** - * Checks the entity operation and bundle permissions, with owners. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity for which to check access. - * @param string $operation - * The entity operation. Usually one of 'view', 'view label', 'update' or - * 'delete'. - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to check access. - * - * @return \Drupal\Core\Access\AccessResultInterface - * The access result. - */ - protected function checkEntityOwnerPermissions(EntityInterface $entity, $operation, AccountInterface $account) { - /** @var \Drupal\user\EntityOwnerInterface $entity */ - if ($account->id() == $entity->getOwnerId()) { - $permissions = [ - "$operation own {$entity->getEntityTypeId()}", - "$operation any {$entity->getEntityTypeId()}", - "$operation own {$entity->bundle()} {$entity->getEntityTypeId()}", - "$operation any {$entity->bundle()} {$entity->getEntityTypeId()}", - ]; - } - else { - $permissions = [ - "$operation any {$entity->getEntityTypeId()}", - "$operation any {$entity->bundle()} {$entity->getEntityTypeId()}", - ]; - } - $result = AccessResult::allowedIfHasPermissions($account, $permissions, 'OR')->cachePerUser(); - - return $result; - } - - /** - * {@inheritdoc} - */ - protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { - $result = parent::checkCreateAccess($account, $context, $entity_bundle); - if ($result->isNeutral()) { - $permissions = [ - 'administer ' . $this->entityTypeId, - 'create ' . $this->entityTypeId, - ]; - if ($entity_bundle) { - $permissions[] = 'create ' . $entity_bundle . ' ' . $this->entityTypeId; - } - - $result = AccessResult::allowedIfHasPermissions($account, $permissions, 'OR'); - } - - return $result; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/EntityPermissionProvider.php b/sites/all/modules/contrib/dev/entity/src/EntityPermissionProvider.php deleted file mode 100644 index 70e791e47..000000000 --- a/sites/all/modules/contrib/dev/entity/src/EntityPermissionProvider.php +++ /dev/null @@ -1,95 +0,0 @@ -id(); - $plural_label = $entity_type->getPluralLabel(); - - $permissions["view {$entity_type_id}"] = [ - 'title' => $this->t('View @type', [ - '@type' => $plural_label, - ]), - ]; - - return $permissions; - } - - /** - * Builds permissions for the bundle granularity. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return array - * The permissions. - */ - protected function buildBundlePermissions(EntityTypeInterface $entity_type) { - $permissions = parent::buildBundlePermissions($entity_type); - $entity_type_id = $entity_type->id(); - $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id); - $plural_label = $entity_type->getPluralLabel(); - - $permissions["view {$entity_type_id}"] = [ - 'title' => $this->t('View @type', [ - '@type' => $plural_label, - ]), - ]; - foreach ($bundles as $bundle_name => $bundle_info) { - $permissions["view {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: View @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - } - - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderBase.php b/sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderBase.php deleted file mode 100644 index c48e45634..000000000 --- a/sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderBase.php +++ /dev/null @@ -1,233 +0,0 @@ -entityTypeBundleInfo = $entity_type_bundle_info; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $container->get('entity_type.bundle.info') - ); - } - - /** - * {@inheritdoc} - */ - public function buildPermissions(EntityTypeInterface $entity_type) { - $entity_type_id = $entity_type->id(); - $has_owner = $entity_type->entityClassImplements(EntityOwnerInterface::class); - $plural_label = $entity_type->getPluralLabel(); - - $permissions = []; - $permissions["administer {$entity_type_id}"] = [ - 'title' => $this->t('Administer @type', ['@type' => $plural_label]), - 'restrict access' => TRUE, - ]; - if ($entity_type->hasLinkTemplate('collection')) { - $permissions["access {$entity_type_id} overview"] = [ - 'title' => $this->t('Access the @type overview page', ['@type' => $plural_label]), - ]; - } - if ($has_owner && $entity_type->entityClassImplements(EntityPublishedInterface::class)) { - $permissions["view own unpublished {$entity_type_id}"] = [ - 'title' => $this->t('View own unpublished @type', [ - '@type' => $plural_label, - ]), - ]; - } - - // Generate the other permissions based on granularity. - if ($entity_type->getPermissionGranularity() === 'entity_type') { - $permissions += $this->buildEntityTypePermissions($entity_type); - } - else { - $permissions += $this->buildBundlePermissions($entity_type); - } - - return $this->processPermissions($permissions, $entity_type); - } - - /** - * Adds the provider and converts the titles to strings to allow sorting. - * - * @param array $permissions - * The array of permissions. - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return array - * An array of processed permissions. - */ - protected function processPermissions(array $permissions, EntityTypeInterface $entity_type) { - foreach ($permissions as $name => $permission) { - // Permissions are grouped by provider on admin/people/permissions. - $permissions[$name]['provider'] = $entity_type->getProvider(); - // TranslatableMarkup objects don't sort properly. - $permissions[$name]['title'] = (string) $permission['title']; - } - return $permissions; - } - - /** - * Builds permissions for the entity_type granularity. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return array - * The permissions. - */ - protected function buildEntityTypePermissions(EntityTypeInterface $entity_type) { - $entity_type_id = $entity_type->id(); - $has_owner = $entity_type->entityClassImplements(EntityOwnerInterface::class); - $singular_label = $entity_type->getSingularLabel(); - $plural_label = $entity_type->getPluralLabel(); - - $permissions = []; - $permissions["create {$entity_type_id}"] = [ - 'title' => $this->t('Create @type', [ - '@type' => $plural_label, - ]), - ]; - if ($has_owner) { - $permissions["update any {$entity_type_id}"] = [ - 'title' => $this->t('Update any @type', [ - '@type' => $singular_label, - ]), - ]; - $permissions["update own {$entity_type_id}"] = [ - 'title' => $this->t('Update own @type', [ - '@type' => $plural_label, - ]), - ]; - $permissions["delete any {$entity_type_id}"] = [ - 'title' => $this->t('Delete any @type', [ - '@type' => $singular_label, - ]), - ]; - $permissions["delete own {$entity_type_id}"] = [ - 'title' => $this->t('Delete own @type', [ - '@type' => $plural_label, - ]), - ]; - } - else { - $permissions["update {$entity_type_id}"] = [ - 'title' => $this->t('Update @type', [ - '@type' => $plural_label, - ]), - ]; - $permissions["delete {$entity_type_id}"] = [ - 'title' => $this->t('Delete @type', [ - '@type' => $plural_label, - ]), - ]; - } - - return $permissions; - } - - /** - * Builds permissions for the bundle granularity. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return array - * The permissions. - */ - protected function buildBundlePermissions(EntityTypeInterface $entity_type) { - $entity_type_id = $entity_type->id(); - $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id); - $has_owner = $entity_type->entityClassImplements(EntityOwnerInterface::class); - $singular_label = $entity_type->getSingularLabel(); - $plural_label = $entity_type->getPluralLabel(); - - $permissions = []; - foreach ($bundles as $bundle_name => $bundle_info) { - $permissions["create {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Create @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - - if ($has_owner) { - $permissions["update any {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Update any @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $singular_label, - ]), - ]; - $permissions["update own {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Update own @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - $permissions["delete any {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Delete any @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $singular_label, - ]), - ]; - $permissions["delete own {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Delete own @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - } - else { - $permissions["update {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Update @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - $permissions["delete {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: Delete @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - } - } - - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderInterface.php b/sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderInterface.php deleted file mode 100644 index 50f3ccaa9..000000000 --- a/sites/all/modules/contrib/dev/entity/src/EntityPermissionProviderInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager') - ); - } - - /** - * Builds a list of permissions for the participating entity types. - * - * @return array - * The permissions. - */ - public function buildPermissions() { - $permissions = []; - /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */ - foreach ($this->entityTypeManager->getDefinitions() as $entity_type) { - if ($entity_type->hasHandlerClass('permission_provider')) { - $permission_provider_class = $entity_type->getHandlerClass('permission_provider'); - $permission_provider = $this->entityTypeManager->createHandlerInstance($permission_provider_class, $entity_type); - $permissions += $permission_provider->buildPermissions($entity_type); - } - } - - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/EntityViewBuilder.php b/sites/all/modules/contrib/dev/entity/src/EntityViewBuilder.php deleted file mode 100644 index 1efe0ebe6..000000000 --- a/sites/all/modules/contrib/dev/entity/src/EntityViewBuilder.php +++ /dev/null @@ -1,17 +0,0 @@ -dateFormatter = $date_formatter; - $this->bundleInformation = $bundle_information; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('date.formatter'), - $container->get('entity_type.bundle.info') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'entity_revision_revert_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - if ($this->revision instanceof RevisionLogInterface) { - return $this->t('Are you sure you want to revert to the revision from %revision-date?', ['%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); - } - return $this->t('Are you sure you want to revert the revision?'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - if ($this->revision->getEntityType()->hasLinkTemplate('version-history')) { - return $this->revision->toUrl('version-history'); - } - return $this->revision->toUrl(); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return t('Revert'); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return ''; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $_entity_revision = NULL, Request $request = NULL) { - $this->revision = $_entity_revision; - $form = parent::buildForm($form, $form_state); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // The revision timestamp will be updated when the revision is saved. Keep - // the original one for the confirmation message. - $this->revision = $this->prepareRevision($this->revision); - if ($this->revision instanceof RevisionLogInterface) { - $original_revision_timestamp = $this->revision->getRevisionCreationTime(); - - $this->revision->setRevisionLogMessage($this->t('Copy of the revision from %date.', ['%date' => $this->dateFormatter->format($original_revision_timestamp)])); - $this->messenger()->addStatus(t('@type %title has been reverted to the revision from %revision-date.', [ - '@type' => $this->getBundleLabel($this->revision), - '%title' => $this->revision->label(), - '%revision-date' => $this->dateFormatter->format($original_revision_timestamp), - ])); - } - else { - $this->messenger()->addStatus(t('@type %title has been reverted', [ - '@type' => $this->getBundleLabel($this->revision), - '%title' => $this->revision->label(), - ])); - } - - $this->revision->save(); - - $this->logger('content')->notice('@type: reverted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]); - $form_state->setRedirect( - "entity.{$this->revision->getEntityTypeId()}.version_history", - [$this->revision->getEntityTypeId() => $this->revision->id()] - ); - } - - /** - * Prepares a revision to be reverted. - * - * @param \Drupal\Core\Entity\RevisionableInterface $revision - * The revision to be reverted. - * - * @return \Drupal\Core\Entity\RevisionableInterface - * The prepared revision ready to be stored. - */ - protected function prepareRevision(RevisionableInterface $revision) { - $revision->setNewRevision(); - $revision->isDefaultRevision(TRUE); - - return $revision; - } - - /** - * Returns a bundle label. - * - * @param \Drupal\Core\Entity\RevisionableInterface $revision - * The entity revision. - * - * @return string - */ - protected function getBundleLabel(RevisionableInterface $revision) { - /** @var \Drupal\Core\Entity\EntityInterface|\Drupal\Core\Entity\RevisionableInterface $revision */ - $bundle_info = $this->bundleInformation->getBundleInfo($revision->getEntityTypeId()); - return $bundle_info[$revision->bundle()]['label']; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Form/RevisionableContentEntityForm.php b/sites/all/modules/contrib/dev/entity/src/Form/RevisionableContentEntityForm.php deleted file mode 100644 index 6e7d8c7f4..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Form/RevisionableContentEntityForm.php +++ /dev/null @@ -1,165 +0,0 @@ -getBundleEntity(); - - // Set up default values, if required. - if (!$this->entity->isNew()) { - $this->entity->setRevisionLogMessage(NULL); - } - - if ($bundle_entity instanceof RevisionableEntityBundleInterface) { - // Always use the default revision setting. - $this->entity->setNewRevision($bundle_entity && $bundle_entity->shouldCreateNewRevision()); - } - } - - /** - * Gets the bundle entity of the current entity. - * - * @return \Drupal\Core\Entity\EntityInterface|null - * The bundle entity, or NULL if there is none. - */ - protected function getBundleEntity() { - if ($this->entity->getEntityType()->getBundleEntityType()) { - $bundle_key = $this->entity->getEntityType()->getKey('bundle'); - return $this->entity->{$bundle_key}->referencedEntities()[0]; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $entity_type = $this->entity->getEntityType(); - $bundle_entity = $this->getBundleEntity(); - $account = $this->currentUser(); - - if ($this->operation == 'edit') { - $form['#title'] = $this->t('Edit %bundle_label @label', [ - '%bundle_label' => $bundle_entity ? $bundle_entity->label() : '', - '@label' => $this->entity->label(), - ]); - } - - $form['advanced'] = [ - '#type' => 'vertical_tabs', - '#weight' => 99, - ]; - - // Add a log field if the "Create new revision" option is checked, or if the - // current user has the ability to check that option. - // @todo Could we autogenerate this form by using some widget on the - // revision info field. - $form['revision_information'] = [ - '#type' => 'details', - '#title' => $this->t('Revision information'), - // Open by default when "Create new revision" is checked. - '#open' => $this->entity->isNewRevision(), - '#group' => 'advanced', - '#weight' => 20, - '#access' => $this->entity->isNewRevision() || $account->hasPermission($entity_type->get('admin_permission')), - ]; - - $form['revision_information']['revision'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Create new revision'), - '#default_value' => $this->entity->isNewRevision(), - '#access' => $account->hasPermission($entity_type->get('admin_permission')), - ]; - - // Check the revision log checkbox when the log textarea is filled in. - // This must not happen if "Create new revision" is enabled by default, - // since the state would auto-disable the checkbox otherwise. - if (!$this->entity->isNewRevision()) { - $form['revision_information']['revision']['#states'] = [ - 'checked' => [ - 'textarea[name="revision_log"]' => ['empty' => FALSE], - ], - ]; - } - - $form['revision_information']['revision_log'] = [ - '#type' => 'textarea', - '#title' => $this->t('Revision log message'), - '#rows' => 4, - '#default_value' => $this->entity->getRevisionLogMessage(), - '#description' => $this->t('Briefly describe the changes you have made.'), - ]; - - return parent::form($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - // Save as a new revision if requested to do so. - if (!$form_state->isValueEmpty('revision')) { - $this->entity->setNewRevision(); - } - - $insert = $this->entity->isNew(); - $this->entity->save(); - $context = ['@type' => $this->entity->bundle(), '%info' => $this->entity->label()]; - $logger = $this->logger('content'); - $bundle_entity = $this->getBundleEntity(); - $t_args = ['@type' => $bundle_entity ? $bundle_entity->label() : 'None', '%info' => $this->entity->label()]; - - if ($insert) { - $logger->notice('@type: added %info.', $context); - drupal_set_message($this->t('@type %info has been created.', $t_args)); - } - else { - $logger->notice('@type: updated %info.', $context); - drupal_set_message($this->t('@type %info has been updated.', $t_args)); - } - - if ($this->entity->id()) { - $form_state->setValue('id', $this->entity->id()); - $form_state->set('id', $this->entity->id()); - - if ($this->entity->getEntityType()->hasLinkTemplate('collection')) { - $form_state->setRedirectUrl($this->entity->toUrl('collection')); - } - else { - $form_state->setRedirectUrl($this->entity->toUrl('canonical')); - } - } - else { - // In the unlikely case something went wrong on save, the entity will be - // rebuilt and entity form redisplayed. - drupal_set_message($this->t('The entity could not be saved.'), 'error'); - $form_state->setRebuild(); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Menu/EntityAddLocalAction.php b/sites/all/modules/contrib/dev/entity/src/Menu/EntityAddLocalAction.php deleted file mode 100644 index 8b7a04e7a..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Menu/EntityAddLocalAction.php +++ /dev/null @@ -1,81 +0,0 @@ -entityType = $entity_type; - $this->setStringTranslation($string_translation); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - /* @var \Drupal\Core\Entity\EntityTypeManagerInterface */ - $entity_type_manager = $container->get('entity_type.manager'); - // The plugin ID is of the form - // "entity.entity_actions:entity.$entity_type_id.collection". - // @see entity.links.action.yml - // @see \Drupal\entity\Menu\EntityCollectionLocalActionProvider::buildLocalActions() - list(, $derivate_id) = explode(':', $plugin_id); - list(, $entity_type_id, ) = explode('.', $derivate_id); - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('router.route_provider'), - $entity_type_manager->getDefinition($entity_type_id), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getTitle(Request $request = NULL) { - return (string) $this->t('Add @entity', [ - '@entity' => (string) $this->entityType->getSingularLabel(), - ]); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Menu/EntityCollectionLocalActionProvider.php b/sites/all/modules/contrib/dev/entity/src/Menu/EntityCollectionLocalActionProvider.php deleted file mode 100644 index 4ddd554f6..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Menu/EntityCollectionLocalActionProvider.php +++ /dev/null @@ -1,47 +0,0 @@ -hasLinkTemplate('collection')) { - $entity_type_id = $entity_type->id(); - - if ($entity_type->hasLinkTemplate('add-page')) { - $route_name = "entity.$entity_type_id.add_page"; - } - elseif ($entity_type->hasLinkTemplate('add-form')) { - $route_name = "entity.$entity_type_id.add_form"; - } - - if (isset($route_name)) { - $actions[$route_name] = [ - // The title is translated at runtime by EntityAddLocalAction. - /* @see \Drupal\entity\Menu\EntityAddLocalAction::getTitle() */ - 'title' => 'Add ' . $entity_type->getSingularLabel(), - 'route_name' => $route_name, - 'options' => [ - // Redirect back to the collection after form submission. - 'query' => [ - 'destination' => $entity_type->getLinkTemplate('collection'), - ], - ], - 'appears_on' => ["entity.$entity_type_id.collection"], - 'class' => EntityAddLocalAction::class, - ]; - } - } - return $actions; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Menu/EntityLocalActionProviderInterface.php b/sites/all/modules/contrib/dev/entity/src/Menu/EntityLocalActionProviderInterface.php deleted file mode 100644 index bba16c328..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Menu/EntityLocalActionProviderInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static($container->get('entity_type.manager')); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - if (empty($this->derivatives)) { - $definitions = []; - foreach ($this->getParticipatingEntityTypes() as $entity_type_id => $entity_type) { - $definition = $base_plugin_definition; - $definition['label'] = t('Delete @entity_type (Deprecated)', ['@entity_type' => $entity_type->getSingularLabel()]); - $definition['type'] = $entity_type_id; - $definition['confirm_form_route_name'] = 'entity.' . $entity_type_id . '.delete_multiple_form'; - $definitions[$entity_type_id] = $definition; - } - $this->derivatives = $definitions; - } - - return parent::getDerivativeDefinitions($base_plugin_definition); - } - - /** - * Gets a list of participating entity types. - * - * The list consists of all content entity types with a delete-multiple-form - * link template. - * - * @return \Drupal\Core\Entity\EntityTypeInterface[] - * The participating entity types, keyed by entity type id. - */ - protected function getParticipatingEntityTypes() { - $entity_types = $this->entityTypeManager->getDefinitions(); - $entity_types = array_filter($entity_types, function (EntityTypeInterface $entity_type) { - // Core requires a "delete-multiple-confirm" form to be declared as well, - // if it's missing, it's safe to assume that the entity type is still - // relying on previous Entity API contrib behavior. - return $entity_type->hasLinkTemplate('delete-multiple-form') && !$entity_type->hasHandlerClass('form', 'delete-multiple-confirm'); - }); - - return $entity_types; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/EntityActionsDeriver.php b/sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/EntityActionsDeriver.php deleted file mode 100644 index 568ad7e87..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/EntityActionsDeriver.php +++ /dev/null @@ -1,58 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static($container->get('entity_type.manager')); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - if (!$this->derivatives) { - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - $handlers = $entity_type->getHandlerClasses(); - if (isset($handlers['local_action_provider'])) { - foreach ($handlers['local_action_provider'] as $class) { - /** @var \Drupal\entity\Menu\EntityLocalActionProviderInterface $handler */ - $handler = $this->entityTypeManager->createHandlerInstance($class, $entity_type); - $this->derivatives += $handler->buildLocalActions($entity_type); - } - } - } - } - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/RevisionsOverviewDeriver.php b/sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/RevisionsOverviewDeriver.php deleted file mode 100644 index b00b8ceb4..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Plugin/Derivative/RevisionsOverviewDeriver.php +++ /dev/null @@ -1,68 +0,0 @@ -entityTypeManager = $entityTypeManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $exclude = ['node']; - - $this->derivatives = []; - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if (in_array($entity_type_id, $exclude)) { - continue; - } - - if (!$entity_type->hasLinkTemplate('version-history')) { - continue; - } - - $this->derivatives[$entity_type_id] = [ - 'route_name' => "entity.$entity_type_id.version_history", - 'title' => t('Revisions'), - 'base_route' => "entity.$entity_type_id.canonical", - 'weight' => 20, - ] + $base_plugin_definition; - } - - return parent::getDerivativeDefinitions($base_plugin_definition); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/Condition.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/Condition.php deleted file mode 100644 index ef1f630c3..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/Condition.php +++ /dev/null @@ -1,113 +0,0 @@ -', '<', '<=', '>', '>=', 'BETWEEN', 'NOT BETWEEN', - 'IN', 'NOT IN', 'IS NULL', 'IS NOT NULL', - ]; - - /** - * The field. - * - * @var string - */ - protected $field; - - /** - * The value. - * - * @var mixed - */ - protected $value; - - /** - * The operator. - * - * @var string - */ - protected $operator; - - /** - * Constructs a new Condition object. - * - * @param string $field - * The field, with an optional column name. E.g: 'uid', 'address.locality'. - * @param mixed $value - * The value. - * @param string $operator - * The operator. - * Possible values: =, <>, <, <=, >, >=, BETWEEN, NOT BETWEEN, - * IN, NOT IN, IS NULL, IS NOT NULL. - */ - public function __construct($field, $value, $operator = NULL) { - // Provide a default based on the data type of the value. - if (!isset($operator)) { - $operator = is_array($value) ? 'IN' : '='; - } - // Validate the selected operator. - if (!in_array($operator, self::$supportedOperators)) { - throw new \InvalidArgumentException(sprintf('Unrecognized operator "%s".', $operator)); - } - - $this->field = $field; - $this->value = $value; - $this->operator = $operator; - } - - /** - * {@inheritdoc} - */ - public function getField() { - return $this->field; - } - - /** - * {@inheritdoc} - */ - public function getValue() { - return $this->value; - } - - /** - * {@inheritdoc} - */ - public function getOperator() { - return $this->operator; - } - - /** - * Gets the string representation of the condition. - * - * Used for debugging purposes. - * - * @return string - * The string representation of the condition. - */ - public function __toString() { - if (in_array($this->operator, ['IS NULL', 'IS NOT NULL'])) { - return "{$this->field} {$this->operator}"; - } - else { - if (is_array($this->value)) { - $value = "['" . implode("', '", $this->value) . "']"; - } - else { - $value = "'" . $this->value . "'"; - } - - return "{$this->field} {$this->operator} $value"; - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/ConditionGroup.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/ConditionGroup.php deleted file mode 100644 index 094feb109..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/ConditionGroup.php +++ /dev/null @@ -1,227 +0,0 @@ -addCondition('type', ['article', 'page']); - * $condition_group->addCondition('uid', '1'); - * - * // Filter by node type or status. - * $condition_group = new ConditionGroup('OR'); - * $condition_group->addCondition('type', ['article', 'page']); - * $condition_group->addCondition('status', '1', '<>'); - * - * // Nested condition groups: node type AND (uid OR status). - * $condition_group = new ConditionGroup(); - * $condition_group->addCondition('type', ['article', 'page']); - * $condition_group->addCondition((new ConditionGroup('OR')) - * ->addCondition('uid', 1) - * ->addCondition('status', '1') - * ); - * @endcode - */ -final class ConditionGroup implements \Countable, RefinableCacheableDependencyInterface { - - use RefinableCacheableDependencyTrait; - - /** - * The conjunction. - * - * @var string - */ - protected $conjunction; - - /** - * The conditions. - * - * @var \Drupal\entity\QueryAccess\Condition[]|\Drupal\entity\QueryAccess\ConditionGroup[] - */ - protected $conditions = []; - - /** - * Whether the condition group is always FALSE. - * - * @var bool - */ - protected $alwaysFalse = FALSE; - - /** - * Constructs a new ConditionGroup object. - * - * @param string $conjunction - * The conjunction. - */ - public function __construct($conjunction = 'AND') { - $this->conjunction = $conjunction; - } - - /** - * Gets the conjunction. - * - * @return string - * The conjunction. Possible values: AND, OR. - */ - public function getConjunction() { - return $this->conjunction; - } - - /** - * Gets all conditions and nested condition groups. - * - * @return \Drupal\entity\QueryAccess\Condition[]|\Drupal\entity\QueryAccess\ConditionGroup[] - * The conditions, where each one is either a Condition or a nested - * ConditionGroup. Returned by reference, to allow callers to replace - * or remove conditions. - */ - public function &getConditions() { - return $this->conditions; - } - - /** - * Adds a condition. - * - * @param string|\Drupal\entity\QueryAccess\ConditionGroup $field - * Either a condition group (for nested AND/OR conditions), or a - * field name with an optional column name. E.g: 'uid', 'address.locality'. - * @param mixed $value - * The value. - * @param string $operator - * The operator. - * Possible values: =, <>, <, <=, >, >=, BETWEEN, NOT BETWEEN, - * IN, NOT IN, IS NULL, IS NOT NULL. - * - * @return $this - */ - public function addCondition($field, $value = NULL, $operator = NULL) { - if ($field instanceof ConditionGroup) { - if ($field->count() === 1) { - // The condition group only has a single condition, merge it. - $this->conditions[] = reset($field->getConditions()); - $this->addCacheTags($field->getCacheTags()); - $this->addCacheContexts($field->getCacheContexts()); - $this->mergeCacheMaxAge($field->getCacheMaxAge()); - } - elseif ($field->count() > 1) { - $this->conditions[] = $field; - } - } - else { - $this->conditions[] = new Condition($field, $value, $operator); - } - - return $this; - } - - /** - * Gets whether the condition group is always FALSE. - * - * Used when the user doesn't have access to any entities, to ensure that a - * query returns no results. - * - * @return bool - * Whether the condition group is always FALSE. - */ - public function isAlwaysFalse() { - return $this->alwaysFalse; - } - - /** - * Sets whether the condition group should always be FALSE. - * - * @param bool $always_false - * Whether the condition group should always be FALSE. - * - * @return $this - */ - public function alwaysFalse($always_false = TRUE) { - $this->alwaysFalse = $always_false; - return $this; - } - - /** - * Clones the contained conditions when the condition group is cloned. - */ - public function __clone() { - foreach ($this->conditions as $i => $condition) { - $this->conditions[$i] = clone $condition; - } - } - - /** - * Gets the string representation of the condition group. - * - * @return string - * The string representation of the condition group. - */ - public function __toString() { - // Special case for a single, nested condition group: - if (count($this->conditions) == 1) { - return (string) reset($this->conditions); - } - $lines = []; - foreach ($this->conditions as $condition) { - $lines[] = str_replace("\n", "\n ", (string) $condition); - } - return $lines ? "(\n " . implode("\n {$this->conjunction}\n ", $lines) . "\n)" : ''; - } - - /** - * {@inheritdoc} - */ - public function count() { - return count($this->conditions); - } - - /** - * {@inheritdoc} - */ - public function getCacheTags() { - $tags = $this->cacheTags; - foreach ($this->conditions as $condition) { - if ($condition instanceof ConditionGroup) { - $tags = array_merge($tags, $condition->getCacheTags()); - } - } - return Cache::mergeTags($tags, []); - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - $cache_contexts = $this->cacheContexts; - foreach ($this->conditions as $condition) { - if ($condition instanceof ConditionGroup) { - $cache_contexts = array_merge($cache_contexts, $condition->getCacheContexts()); - } - } - return Cache::mergeContexts($cache_contexts); - } - - /** - * {@inheritdoc} - */ - public function getCacheMaxAge() { - $max_age = $this->cacheMaxAge; - foreach ($this->conditions as $condition) { - if ($condition instanceof ConditionGroup) { - $max_age = Cache::mergeMaxAges($max_age, $condition->getCacheMaxAge()); - } - } - return $max_age; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/EntityQueryAlter.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/EntityQueryAlter.php deleted file mode 100644 index 25c7395c8..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/EntityQueryAlter.php +++ /dev/null @@ -1,181 +0,0 @@ -entityFieldManager = $entity_field_manager; - $this->entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - $this->requestStack = $request_stack; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_field.manager'), - $container->get('entity_type.manager'), - $container->get('renderer'), - $container->get('request_stack') - ); - } - - /** - * Alters the select query for the given entity type. - * - * @param \Drupal\Core\Database\Query\SelectInterface $query - * The select query. - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - */ - public function alter(SelectInterface $query, EntityTypeInterface $entity_type) { - if (!$entity_type->hasHandlerClass('query_access')) { - return; - } - $entity_type_id = $entity_type->id(); - $storage = $this->entityTypeManager->getStorage($entity_type_id); - if (!$storage instanceof SqlContentEntityStorage) { - return; - } - - /** @var \Drupal\entity\QueryAccess\QueryAccessHandlerInterface $query_access */ - $query_access = $this->entityTypeManager->getHandler($entity_type_id, 'query_access'); - $conditions = $query_access->getConditions('view'); - if ($conditions->isAlwaysFalse()) { - $query->where('1 = 0'); - } - elseif (count($conditions)) { - $sql_conditions = $this->mapConditions($conditions, $query); - $query->condition($sql_conditions); - } - - $this->applyCacheability(CacheableMetadata::createFromObject($conditions)); - } - - /** - * Maps an entity type's access conditions to SQL conditions. - * - * @param \Drupal\entity\QueryAccess\ConditionGroup $conditions - * The access conditions. - * @param \Drupal\Core\Database\Query\SelectInterface $query - * The SQL query. - * @param bool $nested_inside_or - * Whether the access conditions are nested inside an OR condition. - * - * @return \Drupal\Core\Database\Query\ConditionInterface - * The SQL conditions. - */ - protected function mapConditions(ConditionGroup $conditions, SelectInterface $query, $nested_inside_or = FALSE) { - $sql_condition = $query->conditionGroupFactory($conditions->getConjunction()); - $tables = new Tables($query); - $nested_inside_or = $nested_inside_or || $conditions->getConjunction() == 'OR'; - foreach ($conditions->getConditions() as $condition) { - if ($condition instanceof ConditionGroup) { - $nested_sql_conditions = $this->mapConditions($condition, $query, $nested_inside_or); - $sql_condition->condition($nested_sql_conditions); - } - else { - // Access conditions don't specify a langcode. - $langcode = NULL; - $type = $nested_inside_or || $condition->getOperator() === 'IS NULL' ? 'LEFT' : 'INNER'; - $sql_field = $tables->addField($condition->getField(), $type, $langcode); - $value = $condition->getValue(); - $operator = $condition->getOperator(); - // Using LIKE/NOT LIKE ensures a case insensitive comparison. - // @see \Drupal\Core\Entity\Query\Sql\Condition::translateCondition(). - $case_sensitive = $tables->isFieldCaseSensitive($condition->getField()); - $operator_map = [ - '=' => 'LIKE', - '<>' => 'NOT LIKE', - ]; - if (!$case_sensitive && isset($operator_map[$operator])) { - $operator = $operator_map[$operator]; - $value = $query->escapeLike($value); - } - - $sql_condition->condition($sql_field, $value, $operator); - } - } - - return $sql_condition; - } - - /** - * Applies the cacheablity metadata to the current request. - * - * @param \Drupal\Core\Cache\CacheableMetadata $cacheable_metadata - * The cacheability metadata. - */ - protected function applyCacheability(CacheableMetadata $cacheable_metadata) { - $request = $this->requestStack->getCurrentRequest(); - if ($request->isMethodCacheable() && $this->renderer->hasRenderContext()) { - $build = []; - $cacheable_metadata->applyTo($build); - $this->renderer->render($build); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessEvent.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessEvent.php deleted file mode 100644 index 979010bfb..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessEvent.php +++ /dev/null @@ -1,92 +0,0 @@ -conditions = $conditions; - $this->operation = $operation; - $this->account = $account; - } - - /** - * Gets the conditions. - * - * If $conditions->isAlwaysFalse() is TRUE, the user doesn't have access to - * any entities, and the query is expected to return no results. - * This can be reversed by calling $conditions->alwaysFalse(FALSE). - * - * If $conditions->isAlwaysFalse() is FALSE, and the condition group is - * empty (count is 0), the user has full access, and the query doesn't - * need to be restricted. - * - * @return \Drupal\entity\QueryAccess\ConditionGroup - * The conditions. - */ - public function getConditions() { - return $this->conditions; - } - - /** - * Gets the operation. - * - * @return string - * The operation. Usually one of "view", "update" or "delete". - */ - public function getOperation() { - return $this->operation; - } - - /** - * Gets the user for which to restrict access. - * - * @return \Drupal\Core\Session\AccountInterface - * The user. - */ - public function getAccount() { - return $this->account; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandler.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandler.php deleted file mode 100644 index f9ec51c4c..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandler.php +++ /dev/null @@ -1,27 +0,0 @@ -buildEntityConditions($operation, $account); - } - - return parent::buildEntityOwnerConditions($operation, $account); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerBase.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerBase.php deleted file mode 100644 index aaa131539..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerBase.php +++ /dev/null @@ -1,268 +0,0 @@ -entityType = $entity_type; - $this->bundleInfo = $bundle_info; - $this->eventDispatcher = $event_dispatcher; - $this->currentUser = $current_user; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity_type.bundle.info'), - $container->get('event_dispatcher'), - $container->get('current_user') - ); - } - - /** - * {@inheritdoc} - */ - public function getConditions($operation, AccountInterface $account = NULL) { - $account = $account ?: $this->currentUser; - $entity_type_id = $this->entityType->id(); - $conditions = $this->buildConditions($operation, $account); - - // Allow other modules to modify the conditions before they are used. - $event = new QueryAccessEvent($conditions, $operation, $account); - $this->eventDispatcher->dispatch("entity.query_access.{$entity_type_id}", $event); - - return $conditions; - } - - /** - * Builds the conditions for the given operation and user. - * - * @param string $operation - * The access operation. Usually one of "view", "update" or "delete". - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to restrict access. - * - * @return \Drupal\entity\QueryAccess\ConditionGroup - * The conditions. - */ - public function buildConditions($operation, AccountInterface $account) { - $entity_type_id = $this->entityType->id(); - $has_owner = $this->entityType->entityClassImplements(EntityOwnerInterface::class); - - if ($account->hasPermission("administer {$entity_type_id}")) { - // The user has full access to all operations, no conditions needed. - $conditions = new ConditionGroup('OR'); - $conditions->addCacheContexts(['user.permissions']); - return $conditions; - } - - if ($has_owner) { - $entity_conditions = $this->buildEntityOwnerConditions($operation, $account); - } - else { - $entity_conditions = $this->buildEntityConditions($operation, $account); - } - - $conditions = NULL; - if ($operation == 'view' && $this->entityType->entityClassImplements(EntityPublishedInterface::class)) { - $uid_key = $this->entityType->getKey('uid'); - $published_key = $this->entityType->getKey('published'); - $published_conditions = NULL; - $unpublished_conditions = NULL; - - if ($entity_conditions) { - // Restrict the existing conditions to published entities only. - $published_conditions = new ConditionGroup('AND'); - $published_conditions->addCacheContexts(['user.permissions']); - $published_conditions->addCondition($entity_conditions); - $published_conditions->addCondition($published_key, '1'); - } - if ($has_owner && $account->hasPermission("view own unpublished $entity_type_id")) { - $unpublished_conditions = new ConditionGroup('AND'); - $unpublished_conditions->addCacheContexts(['user']); - $unpublished_conditions->addCondition($uid_key, $account->id()); - $unpublished_conditions->addCondition($published_key, '0'); - } - - if ($published_conditions && $unpublished_conditions) { - $conditions = new ConditionGroup('OR'); - $conditions->addCondition($published_conditions); - $conditions->addCondition($unpublished_conditions); - } - elseif ($published_conditions) { - $conditions = $published_conditions; - } - elseif ($unpublished_conditions) { - $conditions = $unpublished_conditions; - } - } - else { - $conditions = $entity_conditions; - } - - if (!$conditions) { - // The user doesn't have access to any entities. - // Falsify the query to ensure no results are returned. - $conditions = new ConditionGroup('OR'); - $conditions->addCacheContexts(['user.permissions']); - $conditions->alwaysFalse(); - } - - return $conditions; - } - - /** - * Builds the conditions for entities that have an owner. - * - * @param string $operation - * The access operation. Usually one of "view", "update" or "delete". - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to restrict access. - * - * @return \Drupal\entity\QueryAccess\ConditionGroup|null - * The conditions, or NULL if the user doesn't have access to any entity. - */ - protected function buildEntityOwnerConditions($operation, AccountInterface $account) { - $entity_type_id = $this->entityType->id(); - $uid_key = $this->entityType->getKey('uid'); - $bundle_key = $this->entityType->getKey('bundle'); - - $conditions = new ConditionGroup('OR'); - $conditions->addCacheContexts(['user.permissions']); - // Any $entity_type permission. - if ($account->hasPermission("$operation any $entity_type_id")) { - // The user has full access, no conditions needed. - return $conditions; - } - - // Own $entity_type permission. - if ($account->hasPermission("$operation own $entity_type_id")) { - $conditions->addCacheContexts(['user']); - $conditions->addCondition($uid_key, $account->id()); - } - - $bundles = array_keys($this->bundleInfo->getBundleInfo($entity_type_id)); - $bundles_with_any_permission = []; - $bundles_with_own_permission = []; - foreach ($bundles as $bundle) { - if ($account->hasPermission("$operation any $bundle $entity_type_id")) { - $bundles_with_any_permission[] = $bundle; - } - if ($account->hasPermission("$operation own $bundle $entity_type_id")) { - $bundles_with_own_permission[] = $bundle; - } - } - // Any $bundle permission. - if ($bundles_with_any_permission) { - $conditions->addCondition($bundle_key, $bundles_with_any_permission); - } - // Own $bundle permission. - if ($bundles_with_own_permission) { - $conditions->addCacheContexts(['user']); - $conditions->addCondition((new ConditionGroup('AND')) - ->addCondition($uid_key, $account->id()) - ->addCondition($bundle_key, $bundles_with_own_permission) - ); - } - - return $conditions->count() ? $conditions : NULL; - } - - /** - * Builds the conditions for entities that do not have an owner. - * - * @param string $operation - * The access operation. Usually one of "view", "update" or "delete". - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to restrict access. - * - * @return \Drupal\entity\QueryAccess\ConditionGroup|null - * The conditions, or NULL if the user doesn't have access to any entity. - */ - protected function buildEntityConditions($operation, AccountInterface $account) { - $entity_type_id = $this->entityType->id(); - $bundle_key = $this->entityType->getKey('bundle'); - - $conditions = new ConditionGroup('OR'); - $conditions->addCacheContexts(['user.permissions']); - // The $entity_type permission. - if ($account->hasPermission("$operation $entity_type_id")) { - // The user has full access, no conditions needed. - return $conditions; - } - - $bundles = array_keys($this->bundleInfo->getBundleInfo($entity_type_id)); - $bundles_with_any_permission = []; - foreach ($bundles as $bundle) { - if ($account->hasPermission("$operation $bundle $entity_type_id")) { - $bundles_with_any_permission[] = $bundle; - } - } - // The $bundle permission. - if ($bundles_with_any_permission) { - $conditions->addCondition($bundle_key, $bundles_with_any_permission); - } - - return $conditions->count() ? $conditions : NULL; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerInterface.php b/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerInterface.php deleted file mode 100644 index 15d455a62..000000000 --- a/sites/all/modules/contrib/dev/entity/src/QueryAccess/QueryAccessHandlerInterface.php +++ /dev/null @@ -1,41 +0,0 @@ -connection = $connection; - $this->entityFieldManager = $entity_field_manager; - $this->entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - $this->requestStack = $request_stack; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('database'), - $container->get('entity_field.manager'), - $container->get('entity_type.manager'), - $container->get('renderer'), - $container->get('request_stack') - ); - } - - /** - * Alters the given views query. - * - * @param \Drupal\views\Plugin\views\query\Sql $query - * The views query. - * @param \Drupal\views\ViewExecutable $view - * The view. - */ - public function alter(Sql $query, ViewExecutable $view) { - $table_info = $query->getEntityTableInfo(); - $base_table = reset($table_info); - if (empty($base_table['entity_type']) || $base_table['relationship_id'] != 'none') { - return; - } - $entity_type_id = $base_table['entity_type']; - $entity_type = $this->entityTypeManager->getDefinition($entity_type_id); - if (!$entity_type->hasHandlerClass('query_access')) { - return; - } - $storage = $this->entityTypeManager->getStorage($entity_type_id); - if (!$storage instanceof SqlContentEntityStorage) { - return; - } - - /** @var \Drupal\entity\QueryAccess\QueryAccessHandlerInterface $query_access */ - $query_access = $this->entityTypeManager->getHandler($entity_type_id, 'query_access'); - $conditions = $query_access->getConditions('view'); - if ($conditions->isAlwaysFalse()) { - $query->addWhereExpression(0, '1 = 0'); - } - elseif (count($conditions)) { - // Store the data table, in case mapConditions() needs to join it in. - $base_table['data_table'] = $entity_type->getDataTable(); - $field_storage_definitions = $this->entityFieldManager->getFieldStorageDefinitions($entity_type_id); - /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */ - $table_mapping = $storage->getTableMapping(); - $sql_conditions = $this->mapConditions($conditions, $query, $base_table, $field_storage_definitions, $table_mapping); - $query->addWhere(0, $sql_conditions); - } - - $this->applyCacheability(CacheableMetadata::createFromObject($conditions)); - } - - /** - * Maps an entity type's access conditions to views SQL conditions. - * - * @param \Drupal\entity\QueryAccess\ConditionGroup $conditions - * The access conditions. - * @param \Drupal\views\Plugin\views\query\Sql $query - * The views query. - * @param array $base_table - * The base table information. - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $field_storage_definitions - * The field storage definitions. - * @param \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping - * The table mapping. - * - * @return \Drupal\Core\Database\Query\ConditionInterface - * The SQL conditions. - */ - protected function mapConditions(ConditionGroup $conditions, Sql $query, array $base_table, array $field_storage_definitions, DefaultTableMapping $table_mapping) { - $sql_condition = new SqlCondition($conditions->getConjunction()); - foreach ($conditions->getConditions() as $condition) { - if ($condition instanceof ConditionGroup) { - $nested_sql_conditions = $this->mapConditions($condition, $query, $base_table, $field_storage_definitions, $table_mapping); - $sql_condition->condition($nested_sql_conditions); - } - else { - $field = $condition->getField(); - $property_name = NULL; - if (strpos($field, '.') !== FALSE) { - list($field, $property_name) = explode('.', $field); - } - // Skip unknown fields. - if (!isset($field_storage_definitions[$field])) { - continue; - } - $field_storage_definition = $field_storage_definitions[$field]; - if (!$property_name) { - $property_name = $field_storage_definition->getMainPropertyName(); - } - - $column = $table_mapping->getFieldColumnName($field_storage_definition, $property_name); - if ($table_mapping->requiresDedicatedTableStorage($field_storage_definitions[$field])) { - if ($base_table['revision']) { - $dedicated_table = $table_mapping->getDedicatedRevisionTableName($field_storage_definition); - } - else { - $dedicated_table = $table_mapping->getDedicatedDataTableName($field_storage_definition); - } - // Views defaults to LEFT JOIN. For simplicity, we don't try to - // use an INNER JOIN when it's safe to do so (AND conjunctions). - $alias = $query->ensureTable($dedicated_table); - } - elseif ($base_table['revision'] && !$field_storage_definition->isRevisionable()) { - // Workaround for #2652652, which causes $query->ensureTable() - // to not work in this case, due to a missing relationship. - if ($data_table = $query->getTableInfo($base_table['data_table'])) { - $alias = $data_table['alias']; - } - else { - $configuration = [ - 'type' => 'INNER', - 'table' => $base_table['data_table'], - 'field' => 'id', - 'left_table' => $base_table['alias'], - 'left_field' => 'id', - ]; - /** @var \Drupal\Views\Plugin\views\join\JoinPluginBase $join */ - $join = Views::pluginManager('join')->createInstance('standard', $configuration); - $alias = $query->addRelationship($base_table['data_table'], $join, $data_table); - } - } - else { - $alias = $base_table['alias']; - } - - $value = $condition->getValue(); - $operator = $condition->getOperator(); - // Using LIKE/NOT LIKE ensures a case insensitive comparison. - // @see \Drupal\Core\Entity\Query\Sql\Condition::translateCondition(). - $property_definitions = $field_storage_definition->getPropertyDefinitions(); - $case_sensitive = $property_definitions[$property_name]->getSetting('case_sensitive'); - $operator_map = [ - '=' => 'LIKE', - '<>' => 'NOT LIKE', - ]; - if (!$case_sensitive && isset($operator_map[$operator])) { - $operator = $operator_map[$operator]; - $value = $this->connection->escapeLike($value); - } - - $sql_condition->condition("$alias.$column", $value, $operator); - } - } - - return $sql_condition; - } - - /** - * Applies the cacheablity metadata to the current request. - * - * @param \Drupal\Core\Cache\CacheableMetadata $cacheable_metadata - * The cacheability metadata. - */ - protected function applyCacheability(CacheableMetadata $cacheable_metadata) { - $request = $this->requestStack->getCurrentRequest(); - if ($request->isMethodCacheable() && $this->renderer->hasRenderContext()) { - $build = []; - $cacheable_metadata->applyTo($build); - $this->renderer->render($build); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Revision/RevisionableContentEntityBase.php b/sites/all/modules/contrib/dev/entity/src/Revision/RevisionableContentEntityBase.php deleted file mode 100644 index f6dc11cb3..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Revision/RevisionableContentEntityBase.php +++ /dev/null @@ -1,25 +0,0 @@ -getEntityType()->getLinkTemplate($rel), $this->getEntityTypeId() . '_revision') !== FALSE) { - $uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId(); - } - - return $uri_route_parameters; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Routing/AdminHtmlRouteProvider.php b/sites/all/modules/contrib/dev/entity/src/Routing/AdminHtmlRouteProvider.php deleted file mode 100644 index 7ef2f6e18..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Routing/AdminHtmlRouteProvider.php +++ /dev/null @@ -1,26 +0,0 @@ -hasHandlerClass('permission_provider')) { - $admin_permission = $entity_type->getAdminPermission(); - $overview_permission = "access {$entity_type->id()} overview"; - $route->setRequirement('_permission', "$admin_permission+$overview_permission"); - } - return $route; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Routing/DefaultHtmlRouteProvider.php b/sites/all/modules/contrib/dev/entity/src/Routing/DefaultHtmlRouteProvider.php deleted file mode 100644 index 06a350400..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Routing/DefaultHtmlRouteProvider.php +++ /dev/null @@ -1,26 +0,0 @@ -hasHandlerClass('permission_provider')) { - $admin_permission = $entity_type->getAdminPermission(); - $overview_permission = "access {$entity_type->id()} overview"; - $route->setRequirement('_permission', "$admin_permission+$overview_permission"); - } - return $route; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Routing/DeleteMultipleRouteProvider.php b/sites/all/modules/contrib/dev/entity/src/Routing/DeleteMultipleRouteProvider.php deleted file mode 100644 index 7fb95481a..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Routing/DeleteMultipleRouteProvider.php +++ /dev/null @@ -1,54 +0,0 @@ -deleteMultipleFormRoute($entity_type)) { - $routes->add('entity.' . $entity_type->id() . '.delete_multiple_form', $route); - } - - return $routes; - } - - /** - * Returns the delete multiple form route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function deleteMultipleFormRoute(EntityTypeInterface $entity_type) { - // Core requires a "delete-multiple-confirm" form to be declared as well, - // if it's missing, it's safe to assume that the entity type is still - // relying on previous Entity API contrib behavior. - if ($entity_type->hasLinkTemplate('delete-multiple-form') && !$entity_type->hasHandlerClass('form', 'delete-multiple-confirm')) { - $route = new Route($entity_type->getLinkTemplate('delete-multiple-form')); - $route->setDefault('_form', '\Drupal\entity\Form\DeleteMultipleForm'); - $route->setDefault('entity_type_id', $entity_type->id()); - $route->setRequirement('_entity_delete_multiple_access', $entity_type->id()); - - return $route; - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/Routing/RevisionRouteProvider.php b/sites/all/modules/contrib/dev/entity/src/Routing/RevisionRouteProvider.php deleted file mode 100644 index e3412958c..000000000 --- a/sites/all/modules/contrib/dev/entity/src/Routing/RevisionRouteProvider.php +++ /dev/null @@ -1,127 +0,0 @@ -id(); - if ($view_route = $this->getRevisionViewRoute($entity_type)) { - $collection->add("entity.$entity_type_id.revision", $view_route); - } - if ($view_route = $this->getRevisionRevertRoute($entity_type)) { - $collection->add("entity.$entity_type_id.revision_revert_form", $view_route); - } - - if ($view_route = $this->getRevisionHistoryRoute($entity_type)) { - $collection->add("entity.$entity_type_id.version_history", $view_route); - } - - return $collection; - } - - /** - * Gets the entity revision view route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getRevisionViewRoute(EntityTypeInterface $entity_type) { - if ($entity_type->hasLinkTemplate('revision')) { - $entity_type_id = $entity_type->id(); - $route = new Route($entity_type->getLinkTemplate('revision')); - $route->addDefaults([ - '_controller' => '\Drupal\Core\Entity\Controller\EntityViewController::viewRevision', - '_title_callback' => '\Drupal\Core\Entity\Controller\EntityController::title', - ]); - $route->addRequirements([ - '_entity_access_revision' => "$entity_type_id.view", - ]); - $route->setOption('parameters', [ - $entity_type->id() => [ - 'type' => 'entity:' . $entity_type->id(), - ], - $entity_type->id() . '_revision' => [ - 'type' => 'entity_revision:' . $entity_type->id(), - ], - ]); - return $route; - } - } - - /** - * Gets the entity revision revert route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getRevisionRevertRoute(EntityTypeInterface $entity_type) { - if ($entity_type->hasLinkTemplate('revision-revert-form')) { - $entity_type_id = $entity_type->id(); - $route = new Route($entity_type->getLinkTemplate('revision-revert-form')); - $route->addDefaults([ - '_form' => '\Drupal\entity\Form\RevisionRevertForm', - 'title' => 'Revert to earlier revision', - ]); - $route->addRequirements([ - '_entity_access_revision' => "$entity_type_id.update", - ]); - $route->setOption('parameters', [ - $entity_type->id() => [ - 'type' => 'entity:' . $entity_type->id(), - ], - $entity_type->id() . '_revision' => [ - 'type' => 'entity_revision:' . $entity_type->id(), - ], - ]); - return $route; - } - } - - /** - * Gets the entity revision version history route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getRevisionHistoryRoute($entity_type) { - if ($entity_type->hasLinkTemplate('version-history')) { - $entity_type_id = $entity_type->id(); - $route = new Route($entity_type->getLinkTemplate('version-history')); - $route->addDefaults([ - '_controller' => '\Drupal\entity\Controller\RevisionOverviewController::revisionOverviewController', - '_title' => 'Revisions', - ]); - $route->setRequirement('_entity_access_revision', "$entity_type_id.list"); - $route->setOption('entity_type_id', $entity_type->id()); - $route->setOption('parameters', [ - $entity_type->id() => [ - 'type' => 'entity:' . $entity_type->id(), - ], - ]); - return $route; - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/UncacheableEntityAccessControlHandler.php b/sites/all/modules/contrib/dev/entity/src/UncacheableEntityAccessControlHandler.php deleted file mode 100644 index a53724bed..000000000 --- a/sites/all/modules/contrib/dev/entity/src/UncacheableEntityAccessControlHandler.php +++ /dev/null @@ -1,54 +0,0 @@ -hasHandlerClass('permission_provider') || !is_a($entity_type->getHandlerClass('permission_provider'), UncacheableEntityPermissionProvider::class, TRUE)) { - throw new \Exception('\Drupal\entity\UncacheableEntityAccessControlHandler requires the \Drupal\entity\UncacheableEntityPermissionProvider permission provider.'); - } - } - - /** - * {@inheritdoc} - */ - protected function checkEntityOwnerPermissions(EntityInterface $entity, $operation, AccountInterface $account) { - /** @var \Drupal\user\EntityOwnerInterface $entity */ - if ($operation === 'view' && $entity instanceof EntityPublishedInterface && !$entity->isPublished()) { - if ($account->id() != $entity->getOwnerId()) { - // There's no permission for viewing other user's unpublished entity. - return AccessResult::neutral()->cachePerUser(); - } - - $permissions = [ - "view own unpublished {$entity->getEntityTypeId()}", - ]; - $result = AccessResult::allowedIfHasPermissions($account, $permissions)->cachePerUser(); - } - else { - $result = parent::checkEntityOwnerPermissions($entity, $operation, $account); - } - - return $result; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/src/UncacheableEntityPermissionProvider.php b/sites/all/modules/contrib/dev/entity/src/UncacheableEntityPermissionProvider.php deleted file mode 100644 index 1b25b2ad2..000000000 --- a/sites/all/modules/contrib/dev/entity/src/UncacheableEntityPermissionProvider.php +++ /dev/null @@ -1,145 +0,0 @@ -id(); - $has_owner = $entity_type->entityClassImplements(EntityOwnerInterface::class); - $plural_label = $entity_type->getPluralLabel(); - - if ($has_owner) { - $permissions["view any {$entity_type_id}"] = [ - 'title' => $this->t('View any @type', [ - '@type' => $plural_label, - ]), - ]; - $permissions["view own {$entity_type_id}"] = [ - 'title' => $this->t('View own @type', [ - '@type' => $plural_label, - ]), - ]; - } - else { - $permissions["view {$entity_type_id}"] = [ - 'title' => $this->t('View @type', [ - '@type' => $plural_label, - ]), - ]; - } - - return $permissions; - } - - /** - * Builds permissions for the bundle granularity. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return array - * The permissions. - */ - protected function buildBundlePermissions(EntityTypeInterface $entity_type) { - $permissions = parent::buildBundlePermissions($entity_type); - $entity_type_id = $entity_type->id(); - $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id); - $has_owner = $entity_type->entityClassImplements(EntityOwnerInterface::class); - $plural_label = $entity_type->getPluralLabel(); - - if ($has_owner) { - $permissions["view any {$entity_type_id}"] = [ - 'title' => $this->t('View any @type', [ - '@type' => $plural_label, - ]), - ]; - $permissions["view own {$entity_type_id}"] = [ - 'title' => $this->t('View own @type', [ - '@type' => $plural_label, - ]), - ]; - } - else { - $permissions["view {$entity_type_id}"] = [ - 'title' => $this->t('View @type', [ - '@type' => $plural_label, - ]), - ]; - } - - foreach ($bundles as $bundle_name => $bundle_info) { - if ($has_owner) { - $permissions["view any {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: View any @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - $permissions["view own {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: View own @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - } - else { - $permissions["view {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: View @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $plural_label, - ]), - ]; - } - } - - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/entity_module_bundle_plugin_examples_test.info.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/entity_module_bundle_plugin_examples_test.info.yml deleted file mode 100644 index 0bc69c5c2..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/entity_module_bundle_plugin_examples_test.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Entity bundle plugin examples test' -type: module -description: 'Module for testing bundle plugins.' -package: Testing -# core: 8.x -dependencies: - - entity - -# Information added by Drupal.org packaging script on 2018-10-11 -version: '8.x-1.0-rc1' -core: '8.x' -project: 'entity' -datestamp: 1539272605 diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/src/Plugin/BundlePluginTest/Second.php b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/src/Plugin/BundlePluginTest/Second.php deleted file mode 100644 index a047b6e81..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_examples_test/src/Plugin/BundlePluginTest/Second.php +++ /dev/null @@ -1,31 +0,0 @@ -setLabel(t('Email')) - ->setRequired(TRUE); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.info.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.info.yml deleted file mode 100644 index 654a84203..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Entity bundle plugin test' -type: module -description: 'Module for testing bundle plugins.' -package: Testing -# core: 8.x -dependencies: - - entity - -# Information added by Drupal.org packaging script on 2018-10-11 -version: '8.x-1.0-rc1' -core: '8.x' -project: 'entity' -datestamp: 1539272605 diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.services.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.services.yml deleted file mode 100644 index ead5cd39d..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/entity_module_bundle_plugin_test.services.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - plugin.manager.bundle_plugin_test: - class: Drupal\entity_module_bundle_plugin_test\BundlePluginTestManager - parent: default_plugin_manager diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Annotation/BundlePluginTest.php b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Annotation/BundlePluginTest.php deleted file mode 100644 index f09f70eb2..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Annotation/BundlePluginTest.php +++ /dev/null @@ -1,34 +0,0 @@ -alterInfo('bundle_plugin_test_info'); - $this->setCacheBackend($cache_backend, 'bundle_plugin_test_plugins'); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Entity/EntityTestBundlePlugin.php b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Entity/EntityTestBundlePlugin.php deleted file mode 100644 index 1c75a477a..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_bundle_plugin_test/src/Entity/EntityTestBundlePlugin.php +++ /dev/null @@ -1,27 +0,0 @@ -setLabel(t('Email')) - ->setRequired(TRUE); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.first.assigned.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.first.assigned.yml deleted file mode 100644 index 9e9c57738..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.first.assigned.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.entity_test_enhanced.assigned -id: entity_test_enhanced.first.assigned -field_name: assigned -entity_type: entity_test_enhanced -bundle: first -label: Assigned -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.second.assigned.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.second.assigned.yml deleted file mode 100644 index fb259e3f6..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.field.entity_test_enhanced.second.assigned.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.entity_test_enhanced.assigned -id: entity_test_enhanced.second.assigned -field_name: assigned -entity_type: entity_test_enhanced -bundle: second -label: Assigned -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.storage.entity_test_enhanced.assigned.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.storage.entity_test_enhanced.assigned.yml deleted file mode 100644 index 3669b5181..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/install/field.storage.entity_test_enhanced.assigned.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - entity_module_test -id: entity_test_enhanced.assigned -field_name: assigned -entity_type: entity_test_enhanced -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: true -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced.yml deleted file mode 100644 index ab0ecf500..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced.yml +++ /dev/null @@ -1,170 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - entity_module_test -id: entity_test_enhanced -label: 'Enhanced entities' -module: views -description: '' -tag: '' -base_table: entity_test_enhanced_field_data -base_field: id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - table: entity_test_enhanced_field_data - field: name - id: name - entity_type: null - entity_field: name - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: { } - sorts: - id: - id: id - table: entity_test_enhanced_field_data - field: id - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: entity_test_enhanced - entity_field: id - plugin_id: standard - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - tags: { } diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_revisions.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_revisions.yml deleted file mode 100644 index 98def8a6e..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_revisions.yml +++ /dev/null @@ -1,170 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - entity_module_test -id: entity_test_enhanced_revisions -label: 'Enhanced entities (Revisions)' -module: views -description: '' -tag: '' -base_table: entity_test_enhanced_field_revision -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - table: entity_test_enhanced_field_revision - field: name - id: name - entity_type: null - entity_field: name - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: { } - sorts: - vid: - id: vid - table: entity_test_enhanced_field_revision - field: vid - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: entity_test_enhanced - entity_field: vid - plugin_id: standard - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - tags: { } diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner.yml deleted file mode 100644 index fcee646c2..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner.yml +++ /dev/null @@ -1,170 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - entity_module_test -id: entity_test_enhanced_with_owner -label: 'Enhanced entities with an owner' -module: views -description: '' -tag: '' -base_table: entity_test_enhanced_with_owner_field_data -base_field: id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - table: entity_test_enhanced_with_owner_field_data - field: name - id: name - entity_type: null - entity_field: name - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: { } - sorts: - id: - id: id - table: entity_test_enhanced_with_owner_field_data - field: id - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: entity_test_enhanced_with_owner - entity_field: id - plugin_id: standard - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - tags: { } diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner_revisions.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner_revisions.yml deleted file mode 100644 index 6e3c7e933..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/config/optional/views.view.entity_test_enhanced_with_owner_revisions.yml +++ /dev/null @@ -1,170 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - entity_module_test -id: entity_test_enhanced_with_owner_revisions -label: 'Enhanced entities with an owner (Revisions)' -module: views -description: '' -tag: '' -base_table: entity_test_enhanced_with_owner_field_revision -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - table: entity_test_enhanced_with_owner_field_revision - field: name - id: name - entity_type: null - entity_field: name - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: { } - sorts: - vid: - id: vid - table: entity_test_enhanced_with_owner_field_revision - field: vid - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: entity_test_enhanced_with_owner - entity_field: vid - plugin_id: standard - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - tags: { } diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.info.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.info.yml deleted file mode 100644 index 3446a3e0b..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Entity test -type: module -package: Testing -# core: 8.x -dependencies: - - field - -# Information added by Drupal.org packaging script on 2018-10-11 -version: '8.x-1.0-rc1' -core: '8.x' -project: 'entity' -datestamp: 1539272605 diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.links.task.yml b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.links.task.yml deleted file mode 100644 index e306c10c9..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.links.task.yml +++ /dev/null @@ -1,9 +0,0 @@ -entity.entity_test_enhanced.canonical: - title: View - route_name: entity.entity_test_enhanced.canonical - base_route: entity.entity_test_enhanced.canonical - -entity.entity_module_test.edit_form: - title: Edit - route_name: entity.entity_test_enhanced.edit_form - base_route: entity.entity_test_enhanced.canonical diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.module b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.module deleted file mode 100644 index bcd14929a..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/entity_module_test.module +++ /dev/null @@ -1,15 +0,0 @@ -setLabel('Name') - ->setRevisionable(TRUE) - ->setDisplayOptions('view', [ - 'label' => 'hidden', - 'type' => 'string', - 'weight' => -5, - ]); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/Entity/EnhancedEntityWithOwner.php b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/Entity/EnhancedEntityWithOwner.php deleted file mode 100644 index 214fb21bf..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/Entity/EnhancedEntityWithOwner.php +++ /dev/null @@ -1,145 +0,0 @@ -get('user_id')->entity; - } - - /** - * {@inheritdoc} - */ - public function getOwnerId() { - return $this->get('user_id')->target_id; - } - - /** - * {@inheritdoc} - */ - public function setOwnerId($uid) { - $this->set('user_id', $uid); - return $this; - } - - /** - * {@inheritdoc} - */ - public function setOwner(UserInterface $account) { - $this->set('user_id', $account->id()); - return $this; - } - - /** - * {@inheritdoc} - */ - public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { - $fields = parent::baseFieldDefinitions($entity_type); - $fields += static::publishedBaseFieldDefinitions($entity_type); - - $fields['name'] = BaseFieldDefinition::create('string') - ->setLabel('Name') - ->setRevisionable(TRUE) - ->setDisplayOptions('view', [ - 'label' => 'hidden', - 'type' => 'string', - 'weight' => -5, - ]); - - $fields['user_id'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('User ID')) - ->setDescription(t('The ID of the associated user.')) - ->setSetting('target_type', 'user') - ->setSetting('handler', 'default') - // Default EntityTest entities to have the root user as the owner, to - // simplify testing. - ->setDefaultValue([0 => ['target_id' => 1]]) - ->setTranslatable(TRUE) - ->setDisplayOptions('form', [ - 'type' => 'entity_reference_autocomplete', - 'weight' => -1, - 'settings' => [ - 'match_operator' => 'CONTAINS', - 'size' => '60', - 'placeholder' => '', - ], - ]); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/EventSubscriber/QueryAccessSubscriber.php b/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/EventSubscriber/QueryAccessSubscriber.php deleted file mode 100644 index 5f7ffb607..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/modules/entity_module_test/src/EventSubscriber/QueryAccessSubscriber.php +++ /dev/null @@ -1,58 +0,0 @@ - 'onQueryAccess', - ]; - } - - /** - * Modifies the access conditions based on the current user. - * - * This is just a convenient example for testing. A real subscriber would - * ignore the account and extend the conditions to cover additional factors, - * such as a custom entity field. - * - * @param \Drupal\entity\QueryAccess\QueryAccessEvent $event - * The event. - */ - public function onQueryAccess(QueryAccessEvent $event) { - $conditions = $event->getConditions(); - $email = $event->getAccount()->getEmail(); - - if ($email == 'user1@example.com') { - // This user should not have access to any entities. - $conditions->alwaysFalse(); - } - elseif ($email == 'user2@example.com') { - // This user should have access to entities with the IDs 1, 2, and 3. - // The query access handler might have already set ->alwaysFalse() - // due to the user not having any other access, so we make sure - // to undo it with $conditions->alwaysFalse(TRUE). - $conditions->alwaysFalse(FALSE); - $conditions->addCondition('id', ['1', '2', '3']); - } - elseif ($email == 'user3@example.com') { - // This user should only have access to entities assigned to "marketing", - // or unassigned entities. - $conditions->alwaysFalse(FALSE); - $conditions->addCondition((new ConditionGroup('OR')) - ->addCondition('assigned', NULL, 'IS NULL') - // Confirm that explicitly specifying the property name works. - ->addCondition('assigned.value', 'marketing') - ); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Functional/CollectionRouteAccessTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Functional/CollectionRouteAccessTest.php deleted file mode 100644 index 2e7772b2a..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Functional/CollectionRouteAccessTest.php +++ /dev/null @@ -1,71 +0,0 @@ -placeBlock('local_tasks_block'); - $this->placeBlock('system_breadcrumb_block'); - } - - /** - * Test the collection route access. - */ - public function testCollectionRouteAccess() { - $entity = EnhancedEntity::create([ - 'name' => 'rev 1', - 'type' => 'default', - ]); - $entity->save(); - - // User without any relevant permissions. - $account = $this->drupalCreateUser(['access administration pages']); - $this->drupalLogin($account); - - $this->drupalGet($entity->toUrl('collection')); - $this->assertSession()->statusCodeEquals(403); - - // User with "access overview" permissions. - $account = $this->drupalCreateUser(['access entity_test_enhanced overview']); - $this->drupalLogin($account); - - $this->drupalGet($entity->toUrl('collection')); - $this->assertSession()->statusCodeEquals(200); - - // User with full administration permissions. - $account = $this->drupalCreateUser(['administer entity_test_enhanced']); - $this->drupalLogin($account); - - $this->drupalGet($entity->toUrl('collection')); - $this->assertSession()->statusCodeEquals(200); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Functional/DeleteMultipleFormTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Functional/DeleteMultipleFormTest.php deleted file mode 100644 index aaf70c60e..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Functional/DeleteMultipleFormTest.php +++ /dev/null @@ -1,76 +0,0 @@ -account = $this->drupalCreateUser(['administer entity_test_enhanced']); - $this->drupalLogin($this->account); - } - - /** - * Tests the add page. - */ - public function testForm() { - $entities = []; - $selection = []; - for ($i = 0; $i < 2; $i++) { - $entity = EnhancedEntity::create([ - 'type' => 'default', - ]); - $entity->save(); - $entities[$entity->id()] = $entity; - - $langcode = $entity->language()->getId(); - $selection[$entity->id()][$langcode] = $langcode; - } - // Add the selection to the tempstore just like DeleteAction would. - $tempstore = \Drupal::service('tempstore.private')->get('entity_delete_multiple_confirm'); - $tempstore->set($this->account->id() . ':entity_test_enhanced', $selection); - - $this->drupalGet('/entity_test_enhanced/delete'); - $assert = $this->assertSession(); - $assert->statusCodeEquals(200); - $assert->elementTextContains('css', '.page-title', 'Are you sure you want to delete these enhanced entities?'); - $delete_button = $this->getSession()->getPage()->findButton('Delete'); - $delete_button->click(); - $assert = $this->assertSession(); - $assert->addressEquals('/entity_test_enhanced'); - $assert->responseContains('Deleted 2 items.'); - - \Drupal::entityTypeManager()->getStorage('entity_test_enhanced')->resetCache(); - $remaining_entities = EnhancedEntity::loadMultiple(array_keys($selection)); - $this->assertEmpty($remaining_entities); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Functional/Menu/EntityLocalActionTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Functional/Menu/EntityLocalActionTest.php deleted file mode 100644 index ca4e1192e..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Functional/Menu/EntityLocalActionTest.php +++ /dev/null @@ -1,44 +0,0 @@ -drupalPlaceBlock('local_actions_block'); - - $account = $this->drupalCreateUser(['administer entity_test_enhanced']); - $this->drupalLogin($account); - } - - /** - * Tests the local action on the collection is provided correctly. - */ - public function testCollectionLocalAction() { - $this->drupalGet('/entity_test_enhanced'); - $this->assertSession()->linkByHrefExists('/entity_test_enhanced/add?destination=/entity_test_enhanced'); - $this->assertSession()->linkExists('Add enhanced entity'); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Functional/RevisionRouteAccessTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Functional/RevisionRouteAccessTest.php deleted file mode 100644 index c40a8303b..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Functional/RevisionRouteAccessTest.php +++ /dev/null @@ -1,91 +0,0 @@ -placeBlock('local_tasks_block'); - $this->placeBlock('system_breadcrumb_block'); - - $this->account = $this->drupalCreateUser([ - 'administer entity_test_enhanced', - 'view all entity_test_enhanced revisions', - ]); - - $this->drupalLogin($this->account); - } - - /** - * Test enhanced entity revision routes access. - */ - public function testRevisionRouteAccess() { - $entity = EnhancedEntity::create([ - 'name' => 'rev 1', - 'type' => 'default', - ]); - $entity->save(); - - $revision = clone $entity; - $revision->name->value = 'rev 2'; - $revision->setNewRevision(TRUE); - $revision->isDefaultRevision(FALSE); - $revision->save(); - - $this->drupalGet('/entity_test_enhanced/1/revisions'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseContains('Revisions'); - $collection_link = $this->getSession()->getPage()->findLink('Enhanced entities'); - $collection_link->click(); - $this->assertSession()->addressEquals('/entity_test_enhanced'); - $this->assertSession()->responseContains('Edit'); - $edit_link = $this->getSession()->getPage()->findLink('Edit'); - $edit_link->click(); - $this->assertSession()->addressEquals('/entity_test_enhanced/1/edit'); - // Check if we have revision tab link on edit page. - $this->getSession()->getPage()->findLink('Revisions')->click(); - $this->assertSession()->addressEquals('/entity_test_enhanced/1/revisions'); - $this->drupalGet('/entity_test_enhanced/1/revisions/2/view'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->responseContains('rev 2'); - $revisions_link = $this->getSession()->getPage()->findLink('Revisions'); - $revisions_link->click(); - $this->assertSession()->addressEquals('/entity_test_enhanced/1/revisions'); - $this->assertSession()->statusCodeEquals(200); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/BundlePluginTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/BundlePluginTest.php deleted file mode 100644 index eeeb92384..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/BundlePluginTest.php +++ /dev/null @@ -1,146 +0,0 @@ -installSchema('system', 'router'); - - // Install the modules properly. Putting them into static::$modules doesn't trigger the install - // hooks, like hook_modules_installed, so entity_modules_installed is not triggered(). - /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */ - $module_installer = \Drupal::service('module_installer'); - $module_installer->install(['entity_module_bundle_plugin_test', 'entity_module_bundle_plugin_examples_test']); - } - - /** - * Tests the bundle plugins. - */ - public function testPluginBundles() { - $bundled_entity_types = entity_get_bundle_plugin_entity_types(); - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */ - $entity_type = $bundled_entity_types['entity_test_bundle_plugin']; - $this->assertEquals('entity_test_bundle_plugin', $entity_type->id()); - $this->assertTrue($entity_type->hasHandlerClass('bundle_plugin')); - - /** @var \Drupal\Core\Entity\EntityTypeBundleInfo $entity_type_bundle_info */ - $entity_type_bundle_info = \Drupal::service('entity_type.bundle.info'); - $bundle_info = $entity_type_bundle_info->getBundleInfo('entity_test_bundle_plugin'); - $this->assertEquals(2, count($bundle_info)); - $this->assertArrayHasKey('first', $bundle_info); - $this->assertArrayHasKey('second', $bundle_info); - $this->assertEquals('First', $bundle_info['first']['label']); - $this->assertEquals('Some description', $bundle_info['first']['description']); - - /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager */ - $entity_field_manager = \Drupal::service('entity_field.manager'); - $field_storage_definitions = $entity_field_manager->getFieldStorageDefinitions('entity_test_bundle_plugin'); - $this->assertArrayHasKey('first_mail', $field_storage_definitions); - $this->assertArrayHasKey('second_mail', $field_storage_definitions); - $first_field_definitions = $entity_field_manager->getFieldDefinitions('entity_test_bundle_plugin', 'first'); - $this->assertArrayHasKey('first_mail', $first_field_definitions); - $this->assertArrayNotHasKey('second_mail', $first_field_definitions); - $second_field_definitions = $entity_field_manager->getFieldDefinitions('entity_test_bundle_plugin', 'second'); - $this->assertArrayNotHasKey('first_mail', $second_field_definitions); - $this->assertArrayHasKey('second_mail', $second_field_definitions); - - $first_entity = EntityTestBundlePlugin::create([ - 'type' => 'first', - 'first_mail' => 'admin@test.com', - ]); - $first_entity->save(); - $first_entity = EntityTestBundlePlugin::load($first_entity->id()); - $this->assertEquals('admin@test.com', $first_entity->first_mail->value); - - $second_entity = EntityTestBundlePlugin::create([ - 'type' => 'second', - 'second_mail' => 'admin@example.com', - ]); - $second_entity->save(); - $second_entity = EntityTestBundlePlugin::load($second_entity->id()); - $this->assertEquals('admin@example.com', $second_entity->second_mail->value); - - // Also test entity queries. - $result = \Drupal::entityTypeManager()->getStorage('entity_test_bundle_plugin') - ->getQuery() - ->condition('second_mail', 'admin@example.com') - ->execute(); - $this->assertEquals([$second_entity->id() => $second_entity->id()], $result); - - $result = \Drupal::entityTypeManager()->getStorage('entity_test_bundle_plugin') - ->getQuery() - ->condition('type', 'first') - ->execute(); - $this->assertEquals([$first_entity->id() => $first_entity->id()], $result); - - } - - /** - * Tests the uninstallation for a bundle provided by a module. - */ - public function testBundlePluginModuleUninstallation() { - /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */ - $module_installer = \Drupal::service('module_installer'); - - // One should be possible to uninstall without any actual content. - $violations = $module_installer->validateUninstall(['entity_module_bundle_plugin_examples_test']); - $this->assertEmpty($violations); - - $first_entity = EntityTestBundlePlugin::create([ - 'type' => 'first', - 'first_mail' => 'admin@test.com', - ]); - $first_entity->save(); - $second_entity = EntityTestBundlePlugin::create([ - 'type' => 'second', - 'second_mail' => 'admin@example.com', - ]); - $second_entity->save(); - - $violations = $module_installer->validateUninstall(['entity_module_bundle_plugin_examples_test']); - $this->assertCount(1, $violations); - $this->assertCount(1, $violations['entity_module_bundle_plugin_examples_test']); - $this->assertEquals('There is data for the bundle Second on the entity type Entity test bundle plugin. Please remove all content before uninstalling the module.', $violations['entity_module_bundle_plugin_examples_test'][0]); - - $second_entity->delete(); - - // The first entity is defined by entity_module_bundle_plugin_test, so it should be possible - // to uninstall the module providing the second bundle plugin. - $violations = $module_installer->validateUninstall(['entity_module_bundle_plugin_examples_test']); - $this->assertEmpty($violations); - - $module_installer->uninstall(['entity_module_bundle_plugin_examples_test']); - - // The first entity is provided by entity_module_bundle_plugin_test which we cannot uninstall, - // until all the entities are deleted. - $violations = $module_installer->validateUninstall(['entity_module_bundle_plugin_test']); - $this->assertNotEmpty($violations); - - $first_entity->delete(); - $violations = $module_installer->validateUninstall(['entity_module_bundle_plugin_test']); - $this->assertEmpty($violations); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/DeleteActionTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/DeleteActionTest.php deleted file mode 100644 index 1f2f35a0c..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/DeleteActionTest.php +++ /dev/null @@ -1,78 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('entity_test_enhanced'); - $this->installSchema('system', ['key_value_expire', 'sequences']); - - $this->user = User::create([ - 'name' => 'username', - 'status' => 1, - ]); - $this->user->save(); - \Drupal::service('current_user')->setAccount($this->user); - } - - public function testAction() { - /** @var \Drupal\system\ActionConfigEntityInterface $action */ - $action = Action::create([ - 'id' => 'enhanced_entity_delete_action', - 'label' => 'Delete enhanced entity', - 'plugin' => 'entity_delete_action:entity_test_enhanced', - ]); - $status = $action->save(); - $this->assertEquals(SAVED_NEW, $status); - $this->assertInstanceOf(DeleteAction::class, $action->getPlugin()); - - $entities = []; - for ($i = 0; $i < 2; $i++) { - $entity = EnhancedEntity::create([ - 'type' => 'default', - ]); - $entity->save(); - $entities[$entity->id()] = $entity; - } - - $action->execute($entities); - // Confirm that the entity ids and langcodes are now in the tempstore. - $tempstore = \Drupal::service('tempstore.private')->get('entity_delete_multiple_confirm'); - $selection = $tempstore->get($this->user->id() . ':entity_test_enhanced'); - $this->assertEquals(array_keys($entities), array_keys($selection)); - $this->assertEquals([['en' => 'en'], ['en' => 'en']], array_values($selection)); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/ConditionGroupTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/ConditionGroupTest.php deleted file mode 100644 index 34dc09cea..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/ConditionGroupTest.php +++ /dev/null @@ -1,106 +0,0 @@ -addCondition('uid', '2'); - $this->assertEquals('AND', $condition_group->getConjunction()); - $expected_conditions = [ - new Condition('uid', '2'), - ]; - $this->assertEquals($expected_conditions, $condition_group->getConditions()); - $this->assertEquals(1, $condition_group->count()); - $this->assertEquals("uid = '2'", $condition_group->__toString()); - - $condition_group = new ConditionGroup('OR'); - $condition_group->addCondition('type', ['article', 'page']); - $condition_group->addCondition('status', '1', '<>'); - $this->assertEquals('OR', $condition_group->getConjunction()); - $expected_conditions = [ - new Condition('type', ['article', 'page']), - new Condition('status', '1', '<>'), - ]; - $expected_lines = [ - "(", - " type IN ['article', 'page']", - " OR", - " status <> '1'", - ")", - ]; - $this->assertEquals($expected_conditions, $condition_group->getConditions()); - $this->assertEquals(2, $condition_group->count()); - $this->assertEquals(implode("\n", $expected_lines), $condition_group->__toString()); - - // Nested condition group with a single condition. - $condition_group = new ConditionGroup(); - $condition_group->addCondition('type', ['article', 'page']); - $condition_group->addCondition((new ConditionGroup('AND')) - ->addCondition('status', '1') - ); - $expected_conditions = [ - new Condition('type', ['article', 'page']), - new Condition('status', '1'), - ]; - $expected_lines = [ - "(", - " type IN ['article', 'page']", - " AND", - " status = '1'", - ")", - ]; - $this->assertEquals($expected_conditions, $condition_group->getConditions()); - $this->assertEquals('AND', $condition_group->getConjunction()); - $this->assertEquals(2, $condition_group->count()); - $this->assertEquals(implode("\n", $expected_lines), $condition_group->__toString()); - - // Nested condition group with multiple conditions. - $condition_group = new ConditionGroup(); - $condition_group->addCondition('type', ['article', 'page']); - $nested_condition_group = new ConditionGroup('OR'); - $nested_condition_group->addCondition('uid', '1'); - $nested_condition_group->addCondition('status', '1'); - $condition_group->addCondition($nested_condition_group); - $expected_conditions = [ - new Condition('type', ['article', 'page']), - $nested_condition_group, - ]; - $expected_lines = [ - "(", - " type IN ['article', 'page']", - " AND", - " (", - " uid = '1'", - " OR", - " status = '1'", - " )", - ")", - ]; - $this->assertEquals($expected_conditions, $condition_group->getConditions()); - $this->assertEquals('AND', $condition_group->getConjunction()); - $this->assertEquals(2, $condition_group->count()); - $this->assertEquals(implode("\n", $expected_lines), $condition_group->__toString()); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessEventTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessEventTest.php deleted file mode 100644 index 8ecef3b17..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessEventTest.php +++ /dev/null @@ -1,62 +0,0 @@ -installEntitySchema('entity_test_enhanced'); - - // Create uid: 1 here so that it's skipped in test cases. - $admin_user = $this->createUser(); - - $entity_type_manager = $this->container->get('entity_type.manager'); - $entity_type = $entity_type_manager->getDefinition('entity_test_enhanced'); - $this->handler = QueryAccessHandler::createInstance($this->container, $entity_type); - } - - /** - * Tests the event. - */ - public function testEvent() { - // By default, the first user should have full access, and the second - // user should have no access. The QueryAccessSubscriber flips that. - $first_user = $this->createUser(['mail' => 'user1@example.com'], ['administer entity_test_enhanced']); - $second_user = $this->createUser(['mail' => 'user2@example.com']); - - $conditions = $this->handler->getConditions('view', $first_user); - $this->assertTrue($conditions->isAlwaysFalse()); - - $conditions = $this->handler->getConditions('view', $second_user); - $this->assertFalse($conditions->isAlwaysFalse()); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessHandlerTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessHandlerTest.php deleted file mode 100644 index 6ac3e6c15..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessHandlerTest.php +++ /dev/null @@ -1,137 +0,0 @@ -installEntitySchema('entity_test_enhanced'); - - // Create uid: 1 here so that it's skipped in test cases. - $admin_user = $this->createUser(); - - $entity_type_manager = $this->container->get('entity_type.manager'); - $entity_type = $entity_type_manager->getDefinition('entity_test_enhanced'); - $this->handler = QueryAccessHandler::createInstance($this->container, $entity_type); - } - - /** - * @covers ::getConditions - */ - public function testNoAccess() { - foreach (['view', 'update', 'delete'] as $operation) { - $user = $this->createUser([], ['access content']); - $conditions = $this->handler->getConditions($operation, $user); - $this->assertEquals(0, $conditions->count()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertTrue($conditions->isAlwaysFalse()); - } - } - - /** - * @covers ::getConditions - */ - public function testAdmin() { - foreach (['view', 'update', 'delete'] as $operation) { - $user = $this->createUser([], ['administer entity_test_enhanced']); - $conditions = $this->handler->getConditions($operation, $user); - $this->assertEquals(0, $conditions->count()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - } - } - - /** - * @covers ::getConditions - */ - public function testView() { - // Entity type permission. - $user = $this->createUser([], ['view entity_test_enhanced']); - $conditions = $this->handler->getConditions('view', $user); - $expected_conditions = [ - new Condition('status', '1'), - ]; - $this->assertEquals(1, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Bundle permission. - $user = $this->createUser([], ['view first entity_test_enhanced']); - $conditions = $this->handler->getConditions('view', $user); - $expected_conditions = [ - new Condition('type', ['first']), - new Condition('status', '1'), - ]; - $this->assertEquals('AND', $conditions->getConjunction()); - $this->assertEquals(2, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - } - - /** - * @covers ::getConditions - */ - public function testUpdateDelete() { - foreach (['update', 'delete'] as $operation) { - // Entity type permission. - $user = $this->createUser([], ["$operation entity_test_enhanced"]); - $conditions = $this->handler->getConditions($operation, $user); - $this->assertEquals(0, $conditions->count()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Bundle permission. - $user = $this->createUser([], [ - "$operation first entity_test_enhanced", - "$operation second entity_test_enhanced", - ]); - $conditions = $this->handler->getConditions($operation, $user); - $expected_conditions = [ - new Condition('type', ['first', 'second']), - ]; - $this->assertEquals('OR', $conditions->getConjunction()); - $this->assertEquals(1, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessTest.php deleted file mode 100644 index 068e62af5..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/QueryAccessTest.php +++ /dev/null @@ -1,343 +0,0 @@ -installEntitySchema('entity_test_enhanced'); - $this->installConfig(['entity_module_test']); - - // Create uid: 1 here so that it's skipped in test cases. - $admin_user = $this->createUser(); - - $first_entity = EnhancedEntity::create([ - 'type' => 'first', - 'label' => 'First', - 'status' => 1, - ]); - $first_entity->save(); - - $first_entity->set('name', 'First!'); - $first_entity->set('status', 0); - $first_entity->setNewRevision(TRUE); - $first_entity->save(); - - $second_entity = EnhancedEntity::create([ - 'type' => 'first', - 'label' => 'Second', - 'status' => 0, - ]); - $second_entity->save(); - - $second_entity->set('name', 'Second!'); - $second_entity->set('status', 1); - $second_entity->setNewRevision(TRUE); - $second_entity->save(); - - $third_entity = EnhancedEntity::create([ - 'type' => 'second', - 'label' => 'Third', - 'status' => 1, - ]); - $third_entity->save(); - - $third_entity->set('name', 'Third!'); - $third_entity->setNewRevision(TRUE); - $third_entity->save(); - - $this->entities = [$first_entity, $second_entity, $third_entity]; - $this->storage = \Drupal::entityTypeManager()->getStorage('entity_test_enhanced'); - } - - /** - * Tests EntityQuery filtering. - */ - public function testEntityQuery() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced']); - \Drupal::currentUser()->setAccount($admin_user); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[0]->id(), - $this->entities[1]->id(), - $this->entities[2]->id(), - ], array_values($result)); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->execute(); - $this->assertEmpty($result); - - // View (published-only). - $user = $this->createUser([], ['view entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[1]->id(), - $this->entities[2]->id(), - ], array_values($result)); - - // View $bundle (published-only). - $user = $this->createUser([], ['view first entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[1]->id(), - ], array_values($result)); - } - - /** - * Tests EntityQuery filtering when all revisions are queried. - */ - public function testEntityQueryWithRevisions() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced']); - \Drupal::currentUser()->setAccount($admin_user); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '2' => $this->entities[0]->id(), - '3' => $this->entities[1]->id(), - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - '6' => $this->entities[2]->id(), - ], $result); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->execute(); - $this->assertEmpty($result); - - // View (published-only). - $user = $this->createUser([], ['view entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - '6' => $this->entities[2]->id(), - ], $result); - - // View $bundle (published-only). - $user = $this->createUser([], ['view first entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '4' => $this->entities[1]->id(), - ], $result); - } - - /** - * Tests Views filtering. - */ - public function testViews() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced']); - \Drupal::currentUser()->setAccount($admin_user); - - $view = Views::getView('entity_test_enhanced'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[0]->id()], - ['id' => $this->entities[1]->id()], - ['id' => $this->entities[2]->id()], - ], ['id' => 'id']); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced'); - $view->execute(); - $this->assertIdenticalResultset($view, []); - - // View (published-only). - $user = $this->createUser([], ['view entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[1]->id()], - ['id' => $this->entities[2]->id()], - ], ['id' => 'id']); - - // View $bundle (published-only). - $user = $this->createUser([], ['view first entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[1]->id()], - ], ['id' => 'id']); - } - - /** - * Tests Views filtering when all revisions are queried. - */ - public function testViewsWithRevisions() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced']); - \Drupal::currentUser()->setAccount($admin_user); - - $view = Views::getView('entity_test_enhanced_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '2', 'id' => $this->entities[0]->id()], - ['vid' => '3', 'id' => $this->entities[1]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ['vid' => '6', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced'); - $view->execute(); - $this->assertIdenticalResultset($view, []); - - // View (published-only). - $user = $this->createUser([], ['view entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ['vid' => '6', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - - // View $bundle (published-only). - $user = $this->createUser([], ['view first entity_test_enhanced']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ], ['vid' => 'vid']); - } - - /** - * Tests filtering based on a configurable field. - * - * QueryAccessSubscriber adds a condition that ensures that the field value - * is either empty or matches "marketing". - * - * @see \Drupal\entity_module_test\EventSubscriber\QueryAccessSubscriber - */ - public function testConfigurableField() { - $this->entities[0]->set('assigned', 'marketing'); - $this->entities[0]->save(); - // The field is case sensitive, so the third entity should be ignored. - $this->entities[2]->set('assigned', 'MarKeTing'); - $this->entities[2]->save(); - $user = $this->createUser([ - 'mail' => 'user3@example.com', - ], ['access content']); - \Drupal::currentUser()->setAccount($user); - - // EntityQuery. - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[0]->id(), - $this->entities[1]->id(), - ], array_values($result)); - - // EntityQuery with revisions. - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '2' => $this->entities[0]->id(), - '3' => $this->entities[1]->id(), - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - ], $result); - - // View. - $view = Views::getView('entity_test_enhanced'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[0]->id()], - ['id' => $this->entities[1]->id()], - ], ['id' => 'id']); - - // View with revisions. - $view = Views::getView('entity_test_enhanced_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '2', 'id' => $this->entities[0]->id()], - ['vid' => '3', 'id' => $this->entities[1]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessHandlerTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessHandlerTest.php deleted file mode 100644 index 761a1f7a6..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessHandlerTest.php +++ /dev/null @@ -1,203 +0,0 @@ -installEntitySchema('entity_test_enhanced_with_owner'); - - // Create uid: 1 here so that it's skipped in test cases. - $admin_user = $this->createUser(); - - $entity_type_manager = $this->container->get('entity_type.manager'); - $entity_type = $entity_type_manager->getDefinition('entity_test_enhanced_with_owner'); - $this->handler = UncacheableQueryAccessHandler::createInstance($this->container, $entity_type); - } - - /** - * @covers ::getConditions - */ - public function testNoAccess() { - foreach (['view', 'update', 'delete'] as $operation) { - $user = $this->createUser([], ['access content']); - $conditions = $this->handler->getConditions($operation, $user); - $this->assertEquals(0, $conditions->count()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertTrue($conditions->isAlwaysFalse()); - } - } - - /** - * @covers ::getConditions - */ - public function testAdmin() { - foreach (['view', 'update', 'delete'] as $operation) { - $user = $this->createUser([], ['administer entity_test_enhanced_with_owner']); - $conditions = $this->handler->getConditions($operation, $user); - $this->assertEquals(0, $conditions->count()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - } - } - - /** - * @covers ::getConditions - */ - public function testView() { - // Any permission. - $user = $this->createUser([], ['view any entity_test_enhanced_with_owner']); - $conditions = $this->handler->getConditions('view', $user); - $expected_conditions = [ - new Condition('status', '1'), - ]; - $this->assertEquals(1, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Own permission. - $user = $this->createUser([], ['view own entity_test_enhanced_with_owner']); - $conditions = $this->handler->getConditions('view', $user); - $expected_conditions = [ - new Condition('user_id', $user->id()), - new Condition('status', '1'), - ]; - $this->assertEquals('AND', $conditions->getConjunction()); - $this->assertEquals(2, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user', 'user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Any permission for the first bundle, own permission for the second. - $user = $this->createUser([], [ - 'view any first entity_test_enhanced_with_owner', - 'view own second entity_test_enhanced_with_owner', - ]); - $conditions = $this->handler->getConditions('view', $user); - $expected_conditions = [ - (new ConditionGroup('OR')) - ->addCacheContexts(['user', 'user.permissions']) - ->addCondition('type', ['first']) - ->addCondition((new ConditionGroup('AND')) - ->addCondition('user_id', $user->id()) - ->addCondition('type', ['second']) - ), - new Condition('status', '1'), - ]; - $this->assertEquals('AND', $conditions->getConjunction()); - $this->assertEquals(2, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user', 'user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // View own unpublished permission. - $user = $this->createUser([], ['view own unpublished entity_test_enhanced_with_owner']); - $conditions = $this->handler->buildConditions('view', $user); - $expected_conditions = [ - new Condition('user_id', $user->id()), - new Condition('status', '0'), - ]; - $this->assertEquals(2, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Both view any and view own unpublished permissions. - $user = $this->createUser([], [ - 'view any entity_test_enhanced_with_owner', - 'view own unpublished entity_test_enhanced_with_owner', - ]); - $conditions = $this->handler->buildConditions('view', $user); - $expected_conditions = [ - new Condition('status', '1'), - (new ConditionGroup('AND')) - ->addCondition('user_id', $user->id()) - ->addCondition('status', '0') - ->addCacheContexts(['user']), - ]; - $this->assertEquals(2, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user', 'user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - } - - /** - * @covers ::getConditions - */ - public function testUpdateDelete() { - foreach (['update', 'delete'] as $operation) { - // Any permission. - $user = $this->createUser([], ["$operation any entity_test_enhanced_with_owner"]); - $conditions = $this->handler->getConditions($operation, $user); - $this->assertEquals(0, $conditions->count()); - $this->assertEquals(['user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Own permission. - $user = $this->createUser([], ["$operation own entity_test_enhanced_with_owner"]); - $conditions = $this->handler->getConditions($operation, $user); - $expected_conditions = [ - new Condition('user_id', $user->id()), - ]; - $this->assertEquals(1, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user', 'user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - - // Any permission for the first bundle, own permission for the second. - $user = $this->createUser([], [ - "$operation any first entity_test_enhanced_with_owner", - "$operation own second entity_test_enhanced_with_owner", - ]); - $conditions = $this->handler->getConditions($operation, $user); - $expected_conditions = [ - new Condition('type', ['first']), - (new ConditionGroup('AND')) - ->addCondition('user_id', $user->id()) - ->addCondition('type', ['second']), - ]; - $this->assertEquals('OR', $conditions->getConjunction()); - $this->assertEquals(2, $conditions->count()); - $this->assertEquals($expected_conditions, $conditions->getConditions()); - $this->assertEquals(['user', 'user.permissions'], $conditions->getCacheContexts()); - $this->assertFalse($conditions->isAlwaysFalse()); - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessTest.php deleted file mode 100644 index bcd0d3585..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/QueryAccess/UncacheableQueryAccessTest.php +++ /dev/null @@ -1,511 +0,0 @@ -installEntitySchema('entity_test_enhanced_with_owner'); - $this->installConfig(['entity_module_test']); - - // Create uid: 1 here so that it's skipped in test cases. - $admin_user = $this->createUser(); - - $first_entity = EnhancedEntityWithOwner::create([ - 'type' => 'first', - 'name' => 'First', - 'status' => 1, - ]); - $first_entity->save(); - - $first_entity->set('name', 'First!'); - $first_entity->set('status', 0); - $first_entity->setNewRevision(TRUE); - $first_entity->save(); - - $second_entity = EnhancedEntityWithOwner::create([ - 'type' => 'first', - 'name' => 'Second', - 'status' => 0, - ]); - $second_entity->save(); - - $second_entity->set('name', 'Second!'); - $second_entity->set('status', 1); - $second_entity->setNewRevision(TRUE); - $second_entity->save(); - - $third_entity = EnhancedEntityWithOwner::create([ - 'type' => 'second', - 'name' => 'Third', - 'status' => 1, - ]); - $third_entity->save(); - - $third_entity->set('name', 'Third!'); - $third_entity->setNewRevision(TRUE); - $third_entity->save(); - - $this->entities = [$first_entity, $second_entity, $third_entity]; - $this->storage = \Drupal::entityTypeManager()->getStorage('entity_test_enhanced_with_owner'); - } - - /** - * Tests EntityQuery filtering. - */ - public function testEntityQuery() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($admin_user); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[0]->id(), - $this->entities[1]->id(), - $this->entities[2]->id(), - ], array_values($result)); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->execute(); - $this->assertEmpty($result); - - // View own (published-only). - $user = $this->createUser([], ['view own entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[1]->id(), - ], array_values($result)); - - // View any (published-only). - $user = $this->createUser([], ['view any entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[1]->id(), - $this->entities[2]->id(), - ], array_values($result)); - - // View own unpublished. - $user = $this->createUser([], ['view own unpublished entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[0]->id(), - ], array_values($result)); - - // View own unpublished + view any (published-only). - $user = $this->createUser([], [ - 'view own unpublished entity_test_enhanced_with_owner', - 'view any entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[0]->id(), - $this->entities[1]->id(), - $this->entities[2]->id(), - ], array_values($result)); - - // View own $first_bundle + View any $second_bundle. - $user = $this->createUser([], [ - 'view own first entity_test_enhanced_with_owner', - 'view any second entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $result = $this->storage->getQuery()->sort('id')->execute(); - $this->assertEquals([ - $this->entities[1]->id(), - $this->entities[2]->id(), - ], array_values($result)); - } - - /** - * Tests EntityQuery filtering when all revisions are queried. - */ - public function testEntityQueryWithRevisions() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($admin_user); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '2' => $this->entities[0]->id(), - '3' => $this->entities[1]->id(), - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - '6' => $this->entities[2]->id(), - ], $result); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->allRevisions()->execute(); - $this->assertEmpty($result); - - // View own (published-only). - $user = $this->createUser([], ['view own entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - // The user_id field is not revisionable, which means that updating it - // will modify both revisions for each entity. - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '4' => $this->entities[1]->id(), - ], $result); - - // View any (published-only). - $user = $this->createUser([], ['view any entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - '6' => $this->entities[2]->id(), - ], $result); - - // View own unpublished. - $user = $this->createUser([], ['view own unpublished entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '2' => $this->entities[0]->id(), - '3' => $this->entities[1]->id(), - ], $result); - - // View own unpublished + view any (published-only). - $user = $this->createUser([], [ - 'view own unpublished entity_test_enhanced_with_owner', - 'view any entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '1' => $this->entities[0]->id(), - '2' => $this->entities[0]->id(), - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - '6' => $this->entities[2]->id(), - ], $result); - - // View own $first_bundle + View any $second_bundle. - $user = $this->createUser([], [ - 'view own first entity_test_enhanced_with_owner', - 'view any second entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $result = $this->storage->getQuery()->allRevisions()->sort('id')->execute(); - $this->assertEquals([ - '4' => $this->entities[1]->id(), - '5' => $this->entities[2]->id(), - '6' => $this->entities[2]->id(), - ], $result); - } - - /** - * Tests Views filtering. - */ - public function testViews() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($admin_user); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[0]->id()], - ['id' => $this->entities[1]->id()], - ['id' => $this->entities[2]->id()], - ], ['id' => 'id']); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, []); - - // View own (published-only). - $user = $this->createUser([], ['view own entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[1]->id()], - ], ['id' => 'id']); - - // View any (published-only). - $user = $this->createUser([], ['view any entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[1]->id()], - ['id' => $this->entities[2]->id()], - ], ['id' => 'id']); - - // View own unpublished. - $user = $this->createUser([], ['view own unpublished entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[0]->id()], - ], ['id' => 'id']); - - // View own unpublished + view any (published-only). - $user = $this->createUser([], [ - 'view own unpublished entity_test_enhanced_with_owner', - 'view any entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[0]->id()], - ['id' => $this->entities[1]->id()], - ['id' => $this->entities[2]->id()], - ], ['id' => 'id']); - - // View own $first_bundle + View any $second_bundle. - $user = $this->createUser([], [ - 'view own first entity_test_enhanced_with_owner', - 'view any second entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['id' => $this->entities[1]->id()], - ['id' => $this->entities[2]->id()], - ], ['id' => 'id']); - } - - /** - * Tests Views filtering when all revisions are queried. - */ - public function testViewsWithRevisions() { - // Admin permission, full access. - $admin_user = $this->createUser([], ['administer entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($admin_user); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '2', 'id' => $this->entities[0]->id()], - ['vid' => '3', 'id' => $this->entities[1]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ['vid' => '6', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - - // No view permissions, no access. - $user = $this->createUser([], ['access content']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, []); - - // View own (published-only). - $user = $this->createUser([], ['view own entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ], ['vid' => 'vid']); - - // View any (published-only). - $user = $this->createUser([], ['view any entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ['vid' => '6', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - - // View own unpublished. - $user = $this->createUser([], ['view own unpublished entity_test_enhanced_with_owner']); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '2', 'id' => $this->entities[0]->id()], - ['vid' => '3', 'id' => $this->entities[1]->id()], - ], ['vid' => 'vid']); - - // View own unpublished + view any (published-only). - $user = $this->createUser([], [ - 'view own unpublished entity_test_enhanced_with_owner', - 'view any entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[0]->set('user_id', $user->id()); - $this->entities[0]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '1', 'id' => $this->entities[0]->id()], - ['vid' => '2', 'id' => $this->entities[0]->id()], - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ['vid' => '6', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - - // View own $first_bundle + View any $second_bundle. - $user = $this->createUser([], [ - 'view own first entity_test_enhanced_with_owner', - 'view any second entity_test_enhanced_with_owner', - ]); - \Drupal::currentUser()->setAccount($user); - - $this->entities[1]->set('user_id', $user->id()); - $this->entities[1]->save(); - - $view = Views::getView('entity_test_enhanced_with_owner_revisions'); - $view->execute(); - $this->assertIdenticalResultset($view, [ - ['vid' => '4', 'id' => $this->entities[1]->id()], - ['vid' => '5', 'id' => $this->entities[2]->id()], - ['vid' => '6', 'id' => $this->entities[2]->id()], - ], ['vid' => 'vid']); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionBasicUITest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionBasicUITest.php deleted file mode 100644 index 8d70bd2a8..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionBasicUITest.php +++ /dev/null @@ -1,185 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('entity_test_enhanced'); - $this->installSchema('system', 'router'); - $this->installConfig(['system']); - - \Drupal::service('router.builder')->rebuild(); - } - - /** - * Tests the revision history controller. - */ - public function testRevisionHistory() { - $entity = EnhancedEntity::create([ - 'name' => 'rev 1', - 'type' => 'default', - ]); - $entity->save(); - - $revision = clone $entity; - $revision->name->value = 'rev 2'; - $revision->setNewRevision(TRUE); - $revision->isDefaultRevision(FALSE); - $revision->save(); - - /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel */ - $http_kernel = \Drupal::service('http_kernel'); - $request = Request::create($revision->toUrl('version-history')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(403, $response->getStatusCode()); - - $role_admin = Role::create(['id' => 'test_role_admin']); - $role_admin->grantPermission('administer entity_test_enhanced'); - $role_admin->save(); - - $role = Role::create(['id' => 'test_role']); - $role->grantPermission('view all entity_test_enhanced revisions'); - $role->grantPermission('administer entity_test_enhanced'); - $role->save(); - - $user_admin = User::create([ - 'name' => 'Test user admin', - ]); - $user_admin->addRole($role_admin->id()); - \Drupal::service('account_switcher')->switchTo($user_admin); - - $request = Request::create($revision->toUrl('version-history')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(200, $response->getStatusCode()); - - $user = User::create([ - 'name' => 'Test user', - ]); - $user->addRole($role->id()); - \Drupal::service('account_switcher')->switchTo($user); - - $request = Request::create($revision->toUrl('version-history')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(200, $response->getStatusCode()); - - // This ensures that the default revision is still the first revision. - $this->assertTrue(strpos($response->getContent(), 'entity_test_enhanced/1/revisions/2/view') !== FALSE); - $this->assertTrue(strpos($response->getContent(), 'entity_test_enhanced/1') !== FALSE); - - // Publish a new revision. - $revision = clone $entity; - $revision->name->value = 'rev 3'; - $revision->setNewRevision(TRUE); - $revision->isDefaultRevision(TRUE); - $revision->save(); - - $request = Request::create($revision->toUrl('version-history')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(200, $response->getStatusCode()); - - // The first revision row should now include a revert link. - $this->assertTrue(strpos($response->getContent(), 'entity_test_enhanced/1/revisions/1/revert') !== FALSE); - } - - public function testRevisionView() { - $entity = EnhancedEntity::create([ - 'name' => 'rev 1', - 'type' => 'default', - ]); - $entity->save(); - - $revision = clone $entity; - $revision->name->value = 'rev 2'; - $revision->setNewRevision(TRUE); - $revision->isDefaultRevision(FALSE); - $revision->save(); - - /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel */ - $http_kernel = \Drupal::service('http_kernel'); - $request = Request::create($revision->toUrl('revision')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(403, $response->getStatusCode()); - - $role_admin = Role::create(['id' => 'test_role_admin']); - $role_admin->grantPermission('administer entity_test_enhanced'); - $role_admin->save(); - - $role = Role::create(['id' => 'test_role']); - $role->grantPermission('view all entity_test_enhanced revisions'); - $role->grantPermission('administer entity_test_enhanced'); - $role->save(); - - $user_admin = User::create([ - 'name' => 'Test user admin', - ]); - $user_admin->addRole($role_admin->id()); - \Drupal::service('account_switcher')->switchTo($user_admin); - - $request = Request::create($revision->toUrl('version-history')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(200, $response->getStatusCode()); - - $user = User::create([ - 'name' => 'Test user', - ]); - $user->addRole($role->id()); - \Drupal::service('account_switcher')->switchTo($user); - - $request = Request::create($revision->toUrl('revision')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertNotContains('rev 1', $response->getContent()); - $this->assertContains('rev 2', $response->getContent()); - } - - public function testRevisionRevert() { - $entity = EnhancedEntity::create([ - 'name' => 'rev 1', - 'type' => 'entity_test_enhance', - ]); - $entity->save(); - $entity->name->value = 'rev 2'; - $entity->setNewRevision(TRUE); - $entity->isDefaultRevision(TRUE); - $entity->save(); - - $role = Role::create(['id' => 'test_role']); - $role->grantPermission('administer entity_test_enhanced'); - $role->grantPermission('revert all entity_test_enhanced revisions'); - $role->save(); - - $user = User::create([ - 'name' => 'Test user', - ]); - $user->addRole($role->id()); - \Drupal::service('account_switcher')->switchTo($user); - - /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel */ - $http_kernel = \Drupal::service('http_kernel'); - $request = Request::create($entity->toUrl('revision-revert-form')->toString()); - $response = $http_kernel->handle($request); - $this->assertEquals(200, $response->getStatusCode()); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionOverviewIntegrationTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionOverviewIntegrationTest.php deleted file mode 100644 index bc28c24e5..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Kernel/RevisionOverviewIntegrationTest.php +++ /dev/null @@ -1,53 +0,0 @@ -installSchema('system', 'router'); - - \Drupal::service('router.builder')->rebuild(); - } - - public function testIntegration() { - /** @var \Drupal\Core\Menu\LocalTaskManagerInterface $local_tasks_manager */ - $local_tasks_manager = \Drupal::service('plugin.manager.menu.local_task'); - - $tasks = $local_tasks_manager->getDefinitions(); - $this->assertArrayHasKey('entity.revisions_overview:entity_test_enhanced', $tasks); - $this->assertArrayNotHasKey('entity.revisions_overview:node', $tasks, 'Node should have been excluded because it provides their own'); - - $this->assertEquals('entity.entity_test_enhanced.version_history', $tasks['entity.revisions_overview:entity_test_enhanced']['route_name']); - $this->assertEquals('entity.entity_test_enhanced.canonical', $tasks['entity.revisions_overview:entity_test_enhanced']['base_route']); - - /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */ - $route_provider = \Drupal::service('router.route_provider'); - - $route = $route_provider->getRouteByName('entity.entity_test_enhanced.version_history'); - $this->assertInstanceOf(Route::class, $route); - $this->assertEquals('\Drupal\entity\Controller\RevisionOverviewController::revisionOverviewController', $route->getDefault('_controller')); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Unit/BundleEntityAccessControlHandlerTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Unit/BundleEntityAccessControlHandlerTest.php deleted file mode 100644 index 0126d4465..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Unit/BundleEntityAccessControlHandlerTest.php +++ /dev/null @@ -1,115 +0,0 @@ -prophesize(ModuleHandlerInterface::class); - $module_handler->invokeAll(Argument::any(), Argument::any())->willReturn([]); - $cache_contexts_manager = $this->prophesize(CacheContextsManager::class); - $cache_contexts_manager->assertValidTokens(Argument::any())->willReturn(TRUE); - - $container = new ContainerBuilder(); - $container->set('module_handler', $module_handler->reveal()); - $container->set('cache_contexts_manager', $cache_contexts_manager->reveal()); - \Drupal::setContainer($container); - } - - /** - * @covers ::checkAccess - * - * @dataProvider accessProvider - */ - public function testAccess(EntityInterface $entity, $operation, $account, $allowed) { - $handler = new BundleEntityAccessControlHandler($entity->getEntityType()); - $handler->setStringTranslation($this->getStringTranslationStub()); - $result = $handler->access($entity, $operation, $account); - $this->assertEquals($allowed, $result); - } - - /** - * Data provider for testAccess(). - * - * @return array - * A list of testAccess method arguments. - */ - public function accessProvider() { - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->id()->willReturn('green_entity_bundle'); - $entity_type->getBundleOf()->willReturn('green_entity'); - $entity_type->getAdminPermission()->willReturn('administer green_entity'); - $entity_type = $entity_type->reveal(); - - $entity = $this->prophesize(ConfigEntityInterface::class); - $entity->getEntityType()->willReturn($entity_type); - $entity->getEntityTypeId()->willReturn('green_entity_bundle'); - $entity->id()->willReturn('default'); - $entity->uuid()->willReturn('fake uuid'); - $entity->language()->willReturn(new Language(['id' => LanguageInterface::LANGCODE_NOT_SPECIFIED])); - - // User with no access. - $user = $this->buildMockUser(1, 'access content'); - $data[] = [$entity->reveal(), 'view label', $user->reveal(), FALSE]; - - // Permissions which grant "view label" access. - $permissions = [ - 'administer green_entity', - 'view green_entity', - 'view default green_entity', - 'view own green_entity', - 'view any green_entity', - 'view own default green_entity', - 'view any default green_entity', - ]; - foreach ($permissions as $index => $permission) { - $user = $this->buildMockUser(10 + $index, $permission); - $data[] = [$entity->reveal(), 'view label', $user->reveal(), TRUE]; - } - - return $data; - } - - /** - * Builds a mock user. - * - * @param int $uid - * The user ID. - * @param string $permission - * The permission to grant. - * - * @return \Prophecy\Prophecy\ObjectProphecy - * The user mock. - */ - protected function buildMockUser($uid, $permission) { - $account = $this->prophesize(AccountInterface::class); - $account->id()->willReturn($uid); - $account->hasPermission($permission)->willReturn(TRUE); - $account->hasPermission(Argument::any())->willReturn(FALSE); - - return $account; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityAccessControlHandlerTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityAccessControlHandlerTest.php deleted file mode 100644 index dbae5dc41..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityAccessControlHandlerTest.php +++ /dev/null @@ -1,249 +0,0 @@ -prophesize(ModuleHandlerInterface::class); - $module_handler->invokeAll(Argument::any(), Argument::any())->willReturn([]); - $cache_contexts_manager = $this->prophesize(CacheContextsManager::class); - $cache_contexts_manager->assertValidTokens(Argument::any())->willReturn(TRUE); - - $container = new ContainerBuilder(); - $container->set('module_handler', $module_handler->reveal()); - $container->set('cache_contexts_manager', $cache_contexts_manager->reveal()); - \Drupal::setContainer($container); - } - - /** - * @covers ::checkAccess - * @covers ::checkEntityPermissions - * @covers ::checkEntityOwnerPermissions - * @covers ::checkCreateAccess - * - * @dataProvider accessProvider - */ - public function testAccess(EntityInterface $entity, $operation, $account, $allowed) { - $handler = new EntityAccessControlHandler($entity->getEntityType()); - $handler->setStringTranslation($this->getStringTranslationStub()); - $result = $handler->access($entity, $operation, $account); - $this->assertEquals($allowed, $result); - } - - /** - * @covers ::checkCreateAccess - * - * @dataProvider createAccessProvider - */ - public function testCreateAccess(EntityTypeInterface $entity_type, $bundle, $account, $allowed) { - $handler = new EntityAccessControlHandler($entity_type); - $handler->setStringTranslation($this->getStringTranslationStub()); - $result = $handler->createAccess($bundle, $account); - $this->assertEquals($allowed, $result); - } - - /** - * Data provider for testAccess(). - * - * @return array - * A list of testAccess method arguments. - */ - public function accessProvider() { - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->id()->willReturn('green_entity'); - $entity_type->getAdminPermission()->willReturn('administer green_entity'); - $entity_type->hasHandlerClass('permission_provider')->willReturn(TRUE); - $entity_type->getHandlerClass('permission_provider')->willReturn(EntityPermissionProvider::class); - $entity = $this->buildMockEntity($entity_type->reveal(), 6); - - $data = []; - // Admin permission. - $admin_user = $this->buildMockUser(5, 'administer green_entity'); - $data[] = [$entity->reveal(), 'view', $admin_user->reveal(), TRUE]; - $data[] = [$entity->reveal(), 'update', $admin_user->reveal(), TRUE]; - $data[] = [$entity->reveal(), 'delete', $admin_user->reveal(), TRUE]; - - // View, Update, delete permissions, entity without an owner. - $second_entity = $this->buildMockEntity($entity_type->reveal()); - foreach (['view', 'update', 'delete'] as $operation) { - $first_user = $this->buildMockUser(6, $operation . ' green_entity'); - $second_user = $this->buildMockUser(7, 'access content'); - - $data[] = [$second_entity->reveal(), $operation, $first_user->reveal(), TRUE]; - $data[] = [$second_entity->reveal(), $operation, $second_user->reveal(), FALSE]; - } - - // Update and delete permissions. - foreach (['update', 'delete'] as $operation) { - // Owner, non-owner, user with "any" permission. - $first_user = $this->buildMockUser(6, $operation . ' own green_entity'); - $second_user = $this->buildMockUser(7, $operation . ' own green_entity'); - $third_user = $this->buildMockUser(8, $operation . ' any green_entity'); - - $data[] = [$entity->reveal(), $operation, $first_user->reveal(), TRUE]; - $data[] = [$entity->reveal(), $operation, $second_user->reveal(), FALSE]; - $data[] = [$entity->reveal(), $operation, $third_user->reveal(), TRUE]; - } - - // View permissions. - $first_user = $this->buildMockUser(9, 'view green_entity'); - $second_user = $this->buildMockUser(10, 'view first green_entity'); - $third_user = $this->buildMockUser(14, 'view own unpublished green_entity'); - $fourth_user = $this->buildMockUser(14, 'access content'); - - $first_entity = $this->buildMockEntity($entity_type->reveal(), 1, 'first'); - $second_entity = $this->buildMockEntity($entity_type->reveal(), 1, 'second'); - $third_entity = $this->buildMockEntity($entity_type->reveal(), 14, 'first', FALSE); - - // The first user can view the two published entities. - $data[] = [$first_entity->reveal(), 'view', $first_user->reveal(), TRUE]; - $data[] = [$second_entity->reveal(), 'view', $first_user->reveal(), TRUE]; - $data[] = [$third_entity->reveal(), 'view', $first_user->reveal(), FALSE]; - - // The second user can only view published entities of bundle "first". - $data[] = [$first_entity->reveal(), 'view', $second_user->reveal(), TRUE]; - $data[] = [$second_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - $data[] = [$third_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - - // The third user can view their own unpublished entity. - $data[] = [$first_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$second_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$third_entity->reveal(), 'view', $third_user->reveal(), TRUE]; - - // The fourth user can't view anything. - $data[] = [$first_entity->reveal(), 'view', $fourth_user->reveal(), FALSE]; - $data[] = [$second_entity->reveal(), 'view', $fourth_user->reveal(), FALSE]; - $data[] = [$third_entity->reveal(), 'view', $fourth_user->reveal(), FALSE]; - - return $data; - } - - /** - * Data provider for testCreateAccess(). - * - * @return array - * A list of testCreateAccess method arguments. - */ - public function createAccessProvider() { - $data = []; - - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->id()->willReturn('green_entity'); - $entity_type->getAdminPermission()->willReturn('administer green_entity'); - $entity_type->hasHandlerClass('permission_provider')->willReturn(TRUE); - $entity_type->getHandlerClass('permission_provider')->willReturn(EntityPermissionProvider::class); - - // User with the admin permission. - $account = $this->buildMockUser('6', 'administer green_entity'); - $data[] = [$entity_type->reveal(), NULL, $account->reveal(), TRUE]; - - // Ordinary user. - $account = $this->buildMockUser('6', 'create green_entity'); - $data[] = [$entity_type->reveal(), NULL, $account->reveal(), TRUE]; - - // Ordinary user, entity with a bundle. - $account = $this->buildMockUser('6', 'create first_bundle green_entity'); - $data[] = [$entity_type->reveal(), 'first_bundle', $account->reveal(), TRUE]; - - // User with no permissions. - $account = $this->buildMockUser('6', 'access content'); - $data[] = [$entity_type->reveal(), NULL, $account->reveal(), FALSE]; - - return $data; - } - - /** - * Builds a mock entity. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * @param string $owner_id - * The owner ID. - * @param string $bundle - * The bundle. - * @param bool $published - * Whether the entity is published. - * - * @return \Prophecy\Prophecy\ObjectProphecy - * The entity mock. - */ - protected function buildMockEntity(EntityTypeInterface $entity_type, $owner_id = NULL, $bundle = NULL, $published = NULL) { - $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED; - $entity = $this->prophesize(ContentEntityInterface::class); - if (isset($published)) { - $entity->willImplement(EntityPublishedInterface::class); - } - if ($owner_id) { - $entity->willImplement(EntityOwnerInterface::class); - } - if (isset($published)) { - $entity->isPublished()->willReturn($published); - } - if ($owner_id) { - $entity->getOwnerId()->willReturn($owner_id); - } - - $entity->bundle()->willReturn($bundle ?: $entity_type->id()); - $entity->isNew()->willReturn(FALSE); - $entity->uuid()->willReturn('fake uuid'); - $entity->id()->willReturn('fake id'); - $entity->getRevisionId()->willReturn(NULL); - $entity->language()->willReturn(new Language(['id' => $langcode])); - $entity->getEntityTypeId()->willReturn($entity_type->id()); - $entity->getEntityType()->willReturn($entity_type); - $entity->getCacheContexts()->willReturn([]); - $entity->getCacheTags()->willReturn([]); - $entity->getCacheMaxAge()->willReturn(Cache::PERMANENT); - - return $entity; - } - - /** - * Builds a mock user. - * - * @param int $uid - * The user ID. - * @param string $permission - * The permission to grant. - * - * @return \Prophecy\Prophecy\ObjectProphecy - * The user mock. - */ - protected function buildMockUser($uid, $permission) { - $account = $this->prophesize(AccountInterface::class); - $account->id()->willReturn($uid); - $account->hasPermission($permission)->willReturn(TRUE); - $account->hasPermission(Argument::any())->willReturn(FALSE); - - return $account; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityPermissionProviderTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityPermissionProviderTest.php deleted file mode 100644 index 9bb8842c3..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Unit/EntityPermissionProviderTest.php +++ /dev/null @@ -1,185 +0,0 @@ -prophesize(EntityTypeBundleInfoInterface::class); - $entity_type_bundle_info->getBundleInfo('white_entity')->willReturn([ - 'first' => ['label' => 'First'], - 'second' => ['label' => 'Second'], - ]); - $entity_type_bundle_info->getBundleInfo('black_entity')->willReturn([ - 'third' => ['label' => 'Third'], - ]); - $entity_type_bundle_info->getBundleInfo('pink_entity')->willReturn([ - 'third' => ['label' => 'Third'], - ]); - $this->permissionProvider = new EntityPermissionProvider($entity_type_bundle_info->reveal()); - $this->permissionProvider->setStringTranslation($this->getStringTranslationStub()); - } - - /** - * @covers ::buildPermissions - * - * @dataProvider entityTypeProvider - */ - public function testBuildPermissions(EntityTypeInterface $entity_type, array $expected_permissions) { - $permissions = $this->permissionProvider->buildPermissions($entity_type); - $this->assertEquals(array_keys($expected_permissions), array_keys($permissions)); - foreach ($permissions as $name => $permission) { - $this->assertEquals('entity_module_test', $permission['provider']); - $this->assertEquals($expected_permissions[$name], $permission['title']); - } - } - - /** - * Data provider for testBuildPermissions(). - * - * @return array - * A list of testBuildPermissions method arguments. - */ - public function entityTypeProvider() { - $data = []; - // Content entity type. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('green_entity'); - $entity_type->getSingularLabel()->willReturn('green entity'); - $entity_type->getPluralLabel()->willReturn('green entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(FALSE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(FALSE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('entity_type'); - $expected_permissions = [ - 'administer green_entity' => 'Administer green entities', - 'create green_entity' => 'Create green entities', - 'update green_entity' => 'Update green entities', - 'delete green_entity' => 'Delete green entities', - 'view green_entity' => 'View green entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with owner. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('blue_entity'); - $entity_type->getSingularLabel()->willReturn('blue entity'); - $entity_type->getPluralLabel()->willReturn('blue entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(TRUE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('entity_type'); - $expected_permissions = [ - 'administer blue_entity' => 'Administer blue entities', - 'access blue_entity overview' => 'Access the blue entities overview page', - 'create blue_entity' => 'Create blue entities', - 'update any blue_entity' => 'Update any blue entity', - 'update own blue_entity' => 'Update own blue entities', - 'delete any blue_entity' => 'Delete any blue entity', - 'delete own blue_entity' => 'Delete own blue entities', - 'view blue_entity' => 'View blue entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with bundles. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('white_entity'); - $entity_type->getSingularLabel()->willReturn('white entity'); - $entity_type->getPluralLabel()->willReturn('white entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(FALSE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('bundle'); - $expected_permissions = [ - 'administer white_entity' => 'Administer white entities', - 'access white_entity overview' => 'Access the white entities overview page', - 'create first white_entity' => 'First: Create white entities', - 'update first white_entity' => 'First: Update white entities', - 'delete first white_entity' => 'First: Delete white entities', - 'create second white_entity' => 'Second: Create white entities', - 'update second white_entity' => 'Second: Update white entities', - 'delete second white_entity' => 'Second: Delete white entities', - 'view white_entity' => 'View white entities', - 'view first white_entity' => 'First: View white entities', - 'view second white_entity' => 'Second: View white entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with bundles and owner. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('black_entity'); - $entity_type->getSingularLabel()->willReturn('black entity'); - $entity_type->getPluralLabel()->willReturn('black entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(TRUE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('bundle'); - $expected_permissions = [ - 'administer black_entity' => 'Administer black entities', - 'access black_entity overview' => 'Access the black entities overview page', - 'create third black_entity' => 'Third: Create black entities', - 'update any third black_entity' => 'Third: Update any black entity', - 'update own third black_entity' => 'Third: Update own black entities', - 'delete any third black_entity' => 'Third: Delete any black entity', - 'delete own third black_entity' => 'Third: Delete own black entities', - 'view black_entity' => 'View black entities', - 'view third black_entity' => 'Third: View black entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with bundles and owner and entity published. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('pink_entity'); - $entity_type->getSingularLabel()->willReturn('pink entity'); - $entity_type->getPluralLabel()->willReturn('pink entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(TRUE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(TRUE); - $entity_type->getPermissionGranularity()->willReturn('bundle'); - $expected_permissions = [ - 'administer pink_entity' => 'Administer pink entities', - 'access pink_entity overview' => 'Access the pink entities overview page', - 'view own unpublished pink_entity' => 'View own unpublished pink entities', - 'create third pink_entity' => 'Third: Create pink entities', - 'update any third pink_entity' => 'Third: Update any pink entity', - 'update own third pink_entity' => 'Third: Update own pink entities', - 'delete any third pink_entity' => 'Third: Delete any pink entity', - 'delete own third pink_entity' => 'Third: Delete own pink entities', - 'view pink_entity' => 'View pink entities', - 'view third pink_entity' => 'Third: View pink entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - return $data; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Unit/QueryAccess/ConditionTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Unit/QueryAccess/ConditionTest.php deleted file mode 100644 index 6d73aebaa..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Unit/QueryAccess/ConditionTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals('uid', $condition->getField()); - $this->assertEquals('2', $condition->getValue()); - $this->assertEquals('=', $condition->getOperator()); - $this->assertEquals("uid = '2'", $condition->__toString()); - - $condition = new Condition('type', ['article', 'page']); - $this->assertEquals('type', $condition->getField()); - $this->assertEquals(['article', 'page'], $condition->getValue()); - $this->assertEquals('IN', $condition->getOperator()); - $this->assertEquals("type IN ['article', 'page']", $condition->__toString()); - - $condition = new Condition('title', NULL, 'IS NULL'); - $this->assertEquals('title', $condition->getField()); - $this->assertEquals(NULL, $condition->getValue()); - $this->assertEquals('IS NULL', $condition->getOperator()); - $this->assertEquals("title IS NULL", $condition->__toString()); - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php deleted file mode 100644 index 1cc84676d..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php +++ /dev/null @@ -1,253 +0,0 @@ -prophesize(ModuleHandlerInterface::class); - $module_handler->invokeAll(Argument::any(), Argument::any())->willReturn([]); - $cache_contexts_manager = $this->prophesize(CacheContextsManager::class); - $cache_contexts_manager->assertValidTokens(Argument::any())->willReturn(TRUE); - - $container = new ContainerBuilder(); - $container->set('module_handler', $module_handler->reveal()); - $container->set('cache_contexts_manager', $cache_contexts_manager->reveal()); - \Drupal::setContainer($container); - } - - /** - * @covers ::checkAccess - * @covers ::checkEntityPermissions - * @covers ::checkEntityOwnerPermissions - * @covers ::checkCreateAccess - * - * @dataProvider accessProvider - */ - public function testAccess(EntityInterface $entity, $operation, $account, $allowed) { - $handler = new UncacheableEntityAccessControlHandler($entity->getEntityType()); - $handler->setStringTranslation($this->getStringTranslationStub()); - $result = $handler->access($entity, $operation, $account); - $this->assertEquals($allowed, $result); - } - - /** - * @covers ::checkCreateAccess - * - * @dataProvider createAccessProvider - */ - public function testCreateAccess(EntityTypeInterface $entity_type, $bundle, $account, $allowed) { - $handler = new UncacheableEntityAccessControlHandler($entity_type); - $handler->setStringTranslation($this->getStringTranslationStub()); - $result = $handler->createAccess($bundle, $account); - $this->assertEquals($allowed, $result); - } - - /** - * Data provider for testAccess(). - * - * @return array - * A list of testAccess method arguments. - */ - public function accessProvider() { - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->id()->willReturn('green_entity'); - $entity_type->getAdminPermission()->willReturn('administer green_entity'); - $entity_type->hasHandlerClass('permission_provider')->willReturn(TRUE); - $entity_type->getHandlerClass('permission_provider')->willReturn(UncacheableEntityPermissionProvider::class); - $entity = $this->buildMockEntity($entity_type->reveal(), 6); - - $data = []; - // Admin permission. - $admin_user = $this->buildMockUser(5, 'administer green_entity'); - $data[] = [$entity->reveal(), 'view', $admin_user->reveal(), TRUE]; - $data[] = [$entity->reveal(), 'update', $admin_user->reveal(), TRUE]; - $data[] = [$entity->reveal(), 'delete', $admin_user->reveal(), TRUE]; - - // View, update, delete permissions, entity without an owner. - $second_entity = $this->buildMockEntity($entity_type->reveal()); - foreach (['view', 'update', 'delete'] as $operation) { - $first_user = $this->buildMockUser(6, $operation . ' green_entity'); - $second_user = $this->buildMockUser(7, 'access content'); - - $data[] = [$second_entity->reveal(), $operation, $first_user->reveal(), TRUE]; - $data[] = [$second_entity->reveal(), $operation, $second_user->reveal(), FALSE]; - } - - // View, update, delete permissions. - foreach (['view', 'update', 'delete'] as $operation) { - // Owner, non-owner, user with "any" permission. - $first_user = $this->buildMockUser(6, $operation . ' own green_entity'); - $second_user = $this->buildMockUser(7, $operation . ' own green_entity'); - $third_user = $this->buildMockUser(8, $operation . ' any green_entity'); - - $data[] = [$entity->reveal(), $operation, $first_user->reveal(), TRUE]; - $data[] = [$entity->reveal(), $operation, $second_user->reveal(), FALSE]; - $data[] = [$entity->reveal(), $operation, $third_user->reveal(), TRUE]; - } - - // Per bundle and unpublished view permissions. - $first_user = $this->buildMockUser(11, 'view any first green_entity'); - $second_user = $this->buildMockUser(12, 'view own first green_entity'); - $third_user = $this->buildMockUser(13, 'view own unpublished green_entity'); - - $first_entity = $this->buildMockEntity($entity_type->reveal(), 9999, 'first'); - $second_entity = $this->buildMockEntity($entity_type->reveal(), 12, 'first'); - $third_entity = $this->buildMockEntity($entity_type->reveal(), 9999, 'second'); - $fourth_entity = $this->buildMockEntity($entity_type->reveal(), 10, 'second'); - $fifth_entity = $this->buildMockEntity($entity_type->reveal(), 13, 'first', FALSE); - - // The first user can view the two entities of bundle "first". - $data[] = [$first_entity->reveal(), 'view', $first_user->reveal(), TRUE]; - $data[] = [$second_entity->reveal(), 'view', $first_user->reveal(), TRUE]; - $data[] = [$third_entity->reveal(), 'view', $first_user->reveal(), FALSE]; - $data[] = [$fourth_entity->reveal(), 'view', $first_user->reveal(), FALSE]; - $data[] = [$fifth_entity->reveal(), 'view', $first_user->reveal(), FALSE]; - - // The second user can view their own entity of bundle "first". - $data[] = [$first_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - $data[] = [$second_entity->reveal(), 'view', $second_user->reveal(), TRUE]; - $data[] = [$third_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - $data[] = [$fourth_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - $data[] = [$fourth_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - $data[] = [$fifth_entity->reveal(), 'view', $second_user->reveal(), FALSE]; - - // The third user can only view their own unpublished entity. - $data[] = [$first_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$second_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$third_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$fourth_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$fourth_entity->reveal(), 'view', $third_user->reveal(), FALSE]; - $data[] = [$fifth_entity->reveal(), 'view', $third_user->reveal(), TRUE]; - - return $data; - } - - /** - * Data provider for testCreateAccess(). - * - * @return array - * A list of testCreateAccess method arguments. - */ - public function createAccessProvider() { - $data = []; - - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->id()->willReturn('green_entity'); - $entity_type->getAdminPermission()->willReturn('administer green_entity'); - $entity_type->hasHandlerClass('permission_provider')->willReturn(TRUE); - $entity_type->getHandlerClass('permission_provider')->willReturn(UncacheableEntityPermissionProvider::class); - - // User with the admin permission. - $account = $this->buildMockUser('6', 'administer green_entity'); - $data[] = [$entity_type->reveal(), NULL, $account->reveal(), TRUE]; - - // Ordinary user. - $account = $this->buildMockUser('6', 'create green_entity'); - $data[] = [$entity_type->reveal(), NULL, $account->reveal(), TRUE]; - - // Ordinary user, entity with a bundle. - $account = $this->buildMockUser('6', 'create first_bundle green_entity'); - $data[] = [$entity_type->reveal(), 'first_bundle', $account->reveal(), TRUE]; - - // User with no permissions. - $account = $this->buildMockUser('6', 'access content'); - $data[] = [$entity_type->reveal(), NULL, $account->reveal(), FALSE]; - - return $data; - } - - /** - * Builds a mock entity. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * @param string $owner_id - * The owner ID. - * @param string $bundle - * The bundle. - * @param bool $published - * Whether the entity is published. - * - * @return \Prophecy\Prophecy\ObjectProphecy - * The entity mock. - */ - protected function buildMockEntity(EntityTypeInterface $entity_type, $owner_id = NULL, $bundle = NULL, $published = NULL) { - $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED; - $entity = $this->prophesize(ContentEntityInterface::class); - if (isset($published)) { - $entity->willImplement(EntityPublishedInterface::class); - } - if ($owner_id) { - $entity->willImplement(EntityOwnerInterface::class); - } - if (isset($published)) { - $entity->isPublished()->willReturn($published); - } - if ($owner_id) { - $entity->getOwnerId()->willReturn($owner_id); - } - - $entity->bundle()->willReturn($bundle ?: $entity_type->id()); - $entity->isNew()->willReturn(FALSE); - $entity->uuid()->willReturn('fake uuid'); - $entity->id()->willReturn('fake id'); - $entity->getRevisionId()->willReturn(NULL); - $entity->language()->willReturn(new Language(['id' => $langcode])); - $entity->getEntityTypeId()->willReturn($entity_type->id()); - $entity->getEntityType()->willReturn($entity_type); - $entity->getCacheContexts()->willReturn([]); - $entity->getCacheTags()->willReturn([]); - $entity->getCacheMaxAge()->willReturn(Cache::PERMANENT); - - return $entity; - } - - /** - * Builds a mock user. - * - * @param int $uid - * The user ID. - * @param string $permission - * The permission to grant. - * - * @return \Prophecy\Prophecy\ObjectProphecy - * The user mock. - */ - protected function buildMockUser($uid, $permission) { - $account = $this->prophesize(AccountInterface::class); - $account->id()->willReturn($uid); - $account->hasPermission($permission)->willReturn(TRUE); - $account->hasPermission(Argument::any())->willReturn(FALSE); - - return $account; - } - -} diff --git a/sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityPermissionProviderTest.php b/sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityPermissionProviderTest.php deleted file mode 100644 index 45cf0fd5e..000000000 --- a/sites/all/modules/contrib/dev/entity/tests/src/Unit/UncacheableEntityPermissionProviderTest.php +++ /dev/null @@ -1,190 +0,0 @@ -prophesize(EntityTypeBundleInfoInterface::class); - $entity_type_bundle_info->getBundleInfo('white_entity')->willReturn([ - 'first' => ['label' => 'First'], - 'second' => ['label' => 'Second'], - ]); - $entity_type_bundle_info->getBundleInfo('black_entity')->willReturn([ - 'third' => ['label' => 'Third'], - ]); - $entity_type_bundle_info->getBundleInfo('pink_entity')->willReturn([ - 'third' => ['label' => 'Third'], - ]); - $this->permissionProvider = new UncacheableEntityPermissionProvider($entity_type_bundle_info->reveal()); - $this->permissionProvider->setStringTranslation($this->getStringTranslationStub()); - } - - /** - * @covers ::buildPermissions - * - * @dataProvider entityTypeProvider - */ - public function testBuildPermissions(EntityTypeInterface $entity_type, array $expected_permissions) { - $permissions = $this->permissionProvider->buildPermissions($entity_type); - $this->assertEquals(array_keys($expected_permissions), array_keys($permissions)); - foreach ($permissions as $name => $permission) { - $this->assertEquals('entity_module_test', $permission['provider']); - $this->assertEquals($expected_permissions[$name], $permission['title']); - } - } - - /** - * Data provider for testBuildPermissions(). - * - * @return array - * A list of testBuildPermissions method arguments. - */ - public function entityTypeProvider() { - $data = []; - // Content entity type. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('green_entity'); - $entity_type->getSingularLabel()->willReturn('green entity'); - $entity_type->getPluralLabel()->willReturn('green entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(FALSE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(FALSE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('entity_type'); - $expected_permissions = [ - 'administer green_entity' => 'Administer green entities', - 'create green_entity' => 'Create green entities', - 'update green_entity' => 'Update green entities', - 'delete green_entity' => 'Delete green entities', - 'view green_entity' => 'View green entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with owner. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('blue_entity'); - $entity_type->getSingularLabel()->willReturn('blue entity'); - $entity_type->getPluralLabel()->willReturn('blue entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(TRUE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('entity_type'); - $expected_permissions = [ - 'administer blue_entity' => 'Administer blue entities', - 'access blue_entity overview' => 'Access the blue entities overview page', - 'create blue_entity' => 'Create blue entities', - 'update any blue_entity' => 'Update any blue entity', - 'update own blue_entity' => 'Update own blue entities', - 'delete any blue_entity' => 'Delete any blue entity', - 'delete own blue_entity' => 'Delete own blue entities', - 'view any blue_entity' => 'View any blue entities', - 'view own blue_entity' => 'View own blue entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with bundles. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('white_entity'); - $entity_type->getSingularLabel()->willReturn('white entity'); - $entity_type->getPluralLabel()->willReturn('white entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(FALSE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('bundle'); - $expected_permissions = [ - 'administer white_entity' => 'Administer white entities', - 'access white_entity overview' => 'Access the white entities overview page', - 'create first white_entity' => 'First: Create white entities', - 'update first white_entity' => 'First: Update white entities', - 'delete first white_entity' => 'First: Delete white entities', - 'create second white_entity' => 'Second: Create white entities', - 'update second white_entity' => 'Second: Update white entities', - 'delete second white_entity' => 'Second: Delete white entities', - 'view white_entity' => 'View white entities', - 'view first white_entity' => 'First: View white entities', - 'view second white_entity' => 'Second: View white entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with bundles and owner. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('black_entity'); - $entity_type->getSingularLabel()->willReturn('black entity'); - $entity_type->getPluralLabel()->willReturn('black entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(TRUE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(FALSE); - $entity_type->getPermissionGranularity()->willReturn('bundle'); - $expected_permissions = [ - 'administer black_entity' => 'Administer black entities', - 'access black_entity overview' => 'Access the black entities overview page', - 'create third black_entity' => 'Third: Create black entities', - 'update any third black_entity' => 'Third: Update any black entity', - 'update own third black_entity' => 'Third: Update own black entities', - 'delete any third black_entity' => 'Third: Delete any black entity', - 'delete own third black_entity' => 'Third: Delete own black entities', - 'view any black_entity' => 'View any black entities', - 'view own black_entity' => 'View own black entities', - 'view any third black_entity' => 'Third: View any black entities', - 'view own third black_entity' => 'Third: View own black entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - // Content entity type with bundles and owner and entity published. - $entity_type = $this->prophesize(ContentEntityTypeInterface::class); - $entity_type->getProvider()->willReturn('entity_module_test'); - $entity_type->id()->willReturn('pink_entity'); - $entity_type->getSingularLabel()->willReturn('pink entity'); - $entity_type->getPluralLabel()->willReturn('pink entities'); - $entity_type->hasLinkTemplate('collection')->willReturn(TRUE); - $entity_type->entityClassImplements(EntityOwnerInterface::class)->willReturn(TRUE); - $entity_type->entityClassImplements(EntityPublishedInterface::class)->willReturn(TRUE); - $entity_type->getPermissionGranularity()->willReturn('bundle'); - $expected_permissions = [ - 'administer pink_entity' => 'Administer pink entities', - 'access pink_entity overview' => 'Access the pink entities overview page', - 'view own unpublished pink_entity' => 'View own unpublished pink entities', - 'create third pink_entity' => 'Third: Create pink entities', - 'update any third pink_entity' => 'Third: Update any pink entity', - 'update own third pink_entity' => 'Third: Update own pink entities', - 'delete any third pink_entity' => 'Third: Delete any pink entity', - 'delete own third pink_entity' => 'Third: Delete own pink entities', - 'view any pink_entity' => 'View any pink entities', - 'view own pink_entity' => 'View own pink entities', - 'view any third pink_entity' => 'Third: View any pink entities', - 'view own third pink_entity' => 'Third: View own pink entities', - ]; - $data[] = [$entity_type->reveal(), $expected_permissions]; - - return $data; - } - -} diff --git a/sites/all/modules/contrib/dev/entity_delete/LICENSE.txt b/sites/all/modules/contrib/dev/entity_delete/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/entity_delete/README.txt b/sites/all/modules/contrib/dev/entity_delete/README.txt deleted file mode 100644 index ede712b0d..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/README.txt +++ /dev/null @@ -1,20 +0,0 @@ --- SUMMARY -- -Entity Delete module is for deleting content of any entity types in bulk. - --- INSTALLATION -- -STEP 1: Download and extract module to /module directory (/module/contrib if - using separate for custom and contrib). -STEP 2: For enabling navigate to /admin/modules and select 'Entity Delete' - and click on install. - ---WORKING -- -For deleting content in a bulk need to navigate to - admin/config/entity-delete - -Select the Entity type for which you need to delete all available content. - -Eg: If you select Entity type as node(Content in drop down), will get another -drop down to select content type. If you wish to delete all existing node -you can select 'All' else the any specific type. -Once selection is done just hit submit it will ask for confirmation, once -confirm it will delete all the entity based on existing selection. \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/entity_delete/config/install/entity_delete.entitydeleteconfirmation.yml b/sites/all/modules/contrib/dev/entity_delete/config/install/entity_delete.entitydeleteconfirmation.yml deleted file mode 100644 index 580011981..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/config/install/entity_delete.entitydeleteconfirmation.yml +++ /dev/null @@ -1,3 +0,0 @@ -entity_delete: - delete: "Delete" - cancel: "Cancel" diff --git a/sites/all/modules/contrib/dev/entity_delete/entity_delete.info.yml b/sites/all/modules/contrib/dev/entity_delete/entity_delete.info.yml deleted file mode 100644 index 69a63bd60..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/entity_delete.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Entity Delete -type: module -description: This module provide option to delete Entity in bulk. -# core: 8.x -package: Custom - -# Information added by Drupal.org packaging script on 2017-01-04 -version: '8.x-1.2' -core: '8.x' -project: 'entity_delete' -datestamp: 1483543746 diff --git a/sites/all/modules/contrib/dev/entity_delete/entity_delete.links.menu.yml b/sites/all/modules/contrib/dev/entity_delete/entity_delete.links.menu.yml deleted file mode 100755 index a299eb329..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/entity_delete.links.menu.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Entity Delete menu items definition -entity_delete.entity_delete_bulk: - title: 'Entity Delete' - route_name: entity_delete.entity_delete_bulk - description: 'Entity Delete' - parent: system.admin_config - weight: 99 - diff --git a/sites/all/modules/contrib/dev/entity_delete/entity_delete.routing.yml b/sites/all/modules/contrib/dev/entity_delete/entity_delete.routing.yml deleted file mode 100755 index 068a3de20..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/entity_delete.routing.yml +++ /dev/null @@ -1,15 +0,0 @@ -entity_delete.entity_delete_bulk: - path: '/admin/config/entity-delete' - defaults: - _form: '\Drupal\entity_delete\Form\EntityDeleteForm' - _title: 'Entity Delete' - requirements: - _permission: 'access content' - -entity_delete.entity_delete_confirmation: - path: '/admin/config/entity-delete/confirm' - defaults: - _form: '\Drupal\entity_delete\Form\EntityDeleteConfirmationForm' - _title: 'Entity Delete' - requirements: - _permission: 'access content' \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/entity_delete/src/DeleteEntity.php b/sites/all/modules/contrib/dev/entity_delete/src/DeleteEntity.php deleted file mode 100755 index 1203bae36..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/src/DeleteEntity.php +++ /dev/null @@ -1,29 +0,0 @@ - $count, ":highest_row" => $total_count)); - entity_delete_multiple($entity, $delete_ids); - $context['results']['entity'] = $entity; - $context['results']['bundle'] = $bundle; - $context['results']['count'] = $total_count; - } - function deleteEntityFinishedCallback($success, $results, $operations) { - if ($success) { - if ($results['bundle'] == 'all') { - $message = t('Successfully deleted @num @entity(s).', array('@num' => $results['count'], '@entity' => $results['entity'])); - } - else{ - $message = t('Successfully deleted @num @entity(s) with @bundle.', array('@num' => $results['count'], - '@entity' => $results['entity'], '@bundle' => $results['bundle'])); - } - } - else { - $message = t('Finished with an error.'); - } - drupal_set_message($message); - } -} diff --git a/sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteConfirmationForm.php b/sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteConfirmationForm.php deleted file mode 100644 index 402e21846..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteConfirmationForm.php +++ /dev/null @@ -1,131 +0,0 @@ - $this->t('

        Are you sure you want to delete?


        ') - ]; - $form['delete'] = array( - '#type' => 'submit', - '#value' => 'Confirm', - ); - $form['cancel'] = array( - '#type' => 'submit', - '#value' => 'Cancel', - ); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $query = \Drupal::request()->query; - $entity_type = $query->get('entity_type'); - $bundle = $query->get('bundle'); - - if($form_state->getValue('op') == 'Cancel'){ - $form_state->setRedirect('entity_delete.entity_delete_bulk'); - } - else{ - $success_message = FALSE; - // To delete log entries. - if ($entity_type == 'watchdog' && $bundle == 'all') { - $conn = Database::getConnection(); - $truncate = $conn->truncate('watchdog'); - $truncate->execute(); - drupal_set_message($this->t('Log Entries Cleared Successfully')); - } - else { - $bundle_type = ''; - if ($entity_type == 'users') { - $entity_type = 'user'; - } - else { - if ($entity_type == 'file_managed') { - $entity_type = 'file'; - } - } - // Build entity query. - $entity_query = \Drupal::entityQuery($entity_type); - $batch = array( - 'title' => $this->t('Deleting ' . $entity_type . '...'), - 'error_message' => $this->t('Error!'), //Error Message - 'finished' => '\Drupal\entity_delete\DeleteEntity::deleteEntityFinishedCallback', - ); - // To delete User(s) - if ($entity_type == 'user') { - $entity_query->condition('uid', array(0, 1), 'NOT IN'); - } - // To delete Remaining entities. - else { - // Get entity bundle - $exclude_entities = ['file', 'comment', 'user', 'watchdog']; - if (!in_array($entity_type, $exclude_entities)) { - $manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type_load = $manager->getEntityType($entity_type); - $entity_keys = $entity_type_load->getKeys(); - $bundle_type = $entity_keys['bundle']; - if ($bundle_type) { - if ($bundle != 'all') { - $entity_query->condition($bundle_type, $bundle); - } - } - } - } - $entity_ids = $entity_query->execute(); - if (count($entity_ids) > 0) { - // Chunk entity ids. - $batch_ids = array_chunk($entity_ids, 25); - $count_ids = 0; - foreach ($batch_ids as $delete_ids) { - $count_ids += count($delete_ids); - $batch['operations'][] = array( - '\Drupal\entity_delete\DeleteEntity::deleteEntity', - array($delete_ids, $count_ids, count($entity_ids), $entity_type, $bundle) - ); - } - batch_set($batch); - $success_message = TRUE; - } - if ($success_message) { - $form_state->setRedirect('entity_delete.entity_delete_bulk'); - } - else { - drupal_set_message($this->t('no @entity(s) found to delete.', array( - '@bundle' => $bundle, - '@entity' => $entity_type - )), 'warning'); - $form_state->setRedirect('entity_delete.entity_delete_bulk'); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteForm.php b/sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteForm.php deleted file mode 100755 index 10981ab2a..000000000 --- a/sites/all/modules/contrib/dev/entity_delete/src/Form/EntityDeleteForm.php +++ /dev/null @@ -1,149 +0,0 @@ -wizardManager = $wizard_manager; - } - - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.views.wizard') - ); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form['displays'] = array(); - $input = &$form_state->getUserInput(); - $wrapper = 'entity-wrapper'; - // Create the part of the form that allows the user to select the basic - // properties of what the entity to delete. - $form['displays']['show'] = [ - '#type' => 'fieldset', - '#title' => t('Entity Delete Settings'), - '#tree' => TRUE, - '#attributes' => ['class' => ['container-inline']], - ]; - $wizard_plugins = $this->wizardManager->getDefinitions(); - $options = array(); - foreach ($wizard_plugins as $key => $wizard) { - $key = preg_replace('/^standard:/', '', $key); - #### Commerce Change keys #### - $key = str_replace('_value_field_data', '', $key); - $key = str_replace('_field_data', '', $key); - #### Commerce Change Key Ends #### - $key = str_replace('_field_data', '', $key); - //$exclude_keys = ['block_content_field_data','block_content_field_revision','file_managed','profile_revision','node_revision']; - // Include Entity Keys which to delete. - //$include_keys = ['comment','watchdog','node','users','taxonomy_term','commerce_line_item', 'commerce_product', 'commerce_order', 'commerce_product_attribute', 'commerce_product_variation', 'profile', 'commerce_store']; - if (!strpos($key, 'revision') !== FALSE) { - $options[$key] = $wizard['title']; - } - } - $form['displays']['show']['wizard_key'] = [ - '#type' => 'select', - '#title' => $this->t('Select Entity Type'), - '#options' => $options, - '#empty_option' => $this->t('-select-'), - '#size' => 1, - '#required' => TRUE, - '#ajax' => [ - 'callback' => [$this, 'ajaxCallChangeEntity'], - 'wrapper' => $wrapper, - ] - ]; - $type_options = ['all' => $this->t('All')]; - $form['displays']['show']['type'] = [ - '#type' => 'select', - '#title' => $this->t('of type'), - '#options' => $type_options, - '#prefix' => '
        ', - '#suffix' => '
        ' - ]; - if (isset($input['show']['wizard_key']) && ($input['show']['wizard_key'] != 'comment')) { - $default_bundles = entity_get_bundles($input['show']['wizard_key']); - // If the current base table support bundles and has more than one (like user). - if (!empty($default_bundles)) { - // Get all bundles and their human readable names. - foreach ($default_bundles as $type => $bundle) { - $type_options[$type] = $bundle['label']; - } - $form['displays']['show']['type']['#options'] = $type_options; - } - } - $form['displays']['show']['comment_message'] = [ - '#type' => 'fieldset', - '#markup' => $this->t('
        Note: bundle. (not supported in comment entity types) Refer this How to use EntityFieldQuery.
        '), - '#states' => array( - 'visible' => array( - 'select[name="show[wizard_key]"]' => array('value' => 'comment'), - ), - ), - ]; - $form['message'] = [ - '#markup' => $this->t('Note: Use ENTITY DELETE only to delete Comment, Content, Log Entries, Taxonomy, User(s).
        '), - ]; - if (\Drupal::moduleHandler()->moduleExists('commerce')) { - $form['commerce_message'] = [ - '#markup' => $this->t('
        And Also supports Commerce - Line Item, Product, Order, Product Attribute, Product Variation, Profile, Store
        '), - ]; - } - $form['submit'] = [ - '#type' => 'submit', - '#value' => 'Delete', - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function ajaxCallChangeEntity(array &$form, FormStateInterface $form_state) { - return $form['displays']['show']['type']; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Get $form_state values. - $values = $form_state->getValues(); - // Entity type. - $entity_type = $values['show']['wizard_key']; - // Get bundle. - $bundle = $values['show']['type']; - $form_state->setRedirect('entity_delete.entity_delete_confirmation', array('entity_type' => $entity_type, 'bundle' => $bundle)); - - } -} diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/LICENSE.txt b/sites/all/modules/contrib/dev/mobile_js_redirect/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/README.txt b/sites/all/modules/contrib/dev/mobile_js_redirect/README.txt deleted file mode 100644 index 65243a7fc..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -This is a simple module that adds a JS in the HTML head to perform a redirect -from a desktop site URL to a mobile one or the other way around. This is -useful when Varnish or any other reverse proxy cache is being used to cache -your site and keep a mobile vs desktop redirect working. - -Install this module like any other module and set the "Desktop site URL" and -"Mobile site URL" for this to work. - -To be able to access the administrative area or avoid redirection at any point, -use the query string below: - -?stopredirect=true - -URL settings - /admin/config/system/mobile_js_redirect diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/js/mobile_js_redirect.js b/sites/all/modules/contrib/dev/mobile_js_redirect/js/mobile_js_redirect.js deleted file mode 100644 index 7afe89c0c..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/js/mobile_js_redirect.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file - * Client-side Javascript routine for Mobile JS Redirect module. - */ - -var mobile_pattern = new RegExp(mobile_js_redirect_devices_regexp, 'i'); -var mobile = (mobile_pattern.test(navigator.userAgent.toLowerCase())); - -// Both of these variables have to be set for this mechanism to work. -// If this plugin is being used by a Drupal Gardens site, we can simply -// set these variables manually and upload this file to the site. -var target_url = mobile_js_redirect_target_url; -var mobile_url = mobile_js_redirect_mobile_url; -var desktop_url = mobile_js_redirect_desktop_url; - -// Check whether the noRedirect flag is set. -var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); -var no_redirect = false; -var secure = (window.location.protocol == "https:") ? true : false; -for (var i = 0; i < hashes.length; i++) { - var hash = hashes[i].split('='); - if (hash[0] != null && hash[0] == 'stopredirect' && hash[1] != null && hash[1] == 'true') { - no_redirect = true; - // Add session cookie to stop future redirect. - jQuery.cookie('mobile_js_redirect.stopredirect', 1, { path: '/', secure: secure }); - break; - } - else if (jQuery.cookie('mobile_js_redirect.stopredirect') == 1) { - no_redirect = true; - } -} - -if (mobile_url != null && desktop_url != null && !no_redirect) { - // Remove protocol and path. - var regex = /[\/:?#]/; - var url_parts = target_url.replace('http://', '').replace('https://', '').split(regex); - - if (mobile && window.location.hostname == url_parts[0]) { - // The device is mobile but the URL is desktop, so redirect. - document.location = mobile_url; - } - else if (!mobile && window.location.hostname == url_parts[0]) { - // The device is desktop but the URL is mobile, so redirect. - document.location = desktop_url; - } -} diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.info.yml b/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.info.yml deleted file mode 100644 index 32ae77f5c..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Mobile JS Redirect' -type: module -description: 'Client-side redirect based on the user-agent string.' -# core: 8.x -configure: 'admin/config/system/mobile_js_redirect' - -# Information added by Drupal.org packaging script on 2016-11-30 -version: '8.x-1.0-beta1' -core: '8.x' -project: 'mobile_js_redirect' -datestamp: 1480536188 diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.libraries.yml b/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.libraries.yml deleted file mode 100644 index c64108260..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.libraries.yml +++ /dev/null @@ -1,7 +0,0 @@ -mobile-js-redirect-js: - version: 1.x - js: - js/mobile_js_redirect.js: {} - dependencies: - - core/jquery - - core/jquery.cookie diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.links.menu.yml b/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.links.menu.yml deleted file mode 100755 index e89ed648b..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -system.mobile_js_redirect_admin: - title: 'Mobile JS Redirect' - parent: system.admin_config_system - description: 'Manage the Mobile JS Redirect Settings.' - route_name: mobile_js_redirect.admin_form - weight: 30 diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.module b/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.module deleted file mode 100755 index d9873f11c..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.module +++ /dev/null @@ -1,90 +0,0 @@ - 'html_tag', - '#tag' => 'script', - '#value' => mobile_js_get_urls(), - ], - 'mobile-js-redirect-js', - ]; -} - -/** - * Get URLs for use on JS file. - */ -function mobile_js_get_urls() { - - global $base_root; - $urls = \Drupal::config('mobile_js_redirect.settings')->get('mobile_js_redirect_urls'); - $current_url = $base_root . \Drupal::request()->getRequestUri(); - $current_devices_list = (!empty(\Drupal::config('mobile_js_redirect.settings')->get('mobile_js_redirect_regexp_devices_list'))) ? \Drupal::config('mobile_js_redirect.settings')->get('mobile_js_redirect_regexp_devices_list') : MOBILE_JS_REDIRECT_REGEXP_DEVICES_LIST; - $devices_list = Html::escape($current_devices_list); - - // Set default values. - $javascript = "var mobile_js_redirect_target_url = '';"; - $javascript .= "var mobile_js_redirect_desktop_url = '';"; - $javascript .= "var mobile_js_redirect_mobile_url = '';"; - - $urls_arr = explode(PHP_EOL, $urls); - - foreach ($urls_arr as $value) { - - $url_line = explode('|', $value); - $last_char = substr($url_line[0], -1); - - if ($last_char == '*') { - $trated_url = substr($url_line[0], 0, -1); - if (strpos($current_url, $trated_url) !== FALSE) { - $javascript = mobile_js_update_urls($url_line); - break; - } - } - - if ($url_line[0] == $current_url || $url_line[0] . '/' == $current_url) { - $javascript = mobile_js_update_urls($url_line); - break; - } - } - $javascript .= "var mobile_js_redirect_devices_regexp = '$devices_list';"; - - return $javascript; -} - -/** - * Update URL values. - */ -function mobile_js_update_urls($url_array) { - $target_url = (!empty($url_array[0])) ? $url_array[0] : ''; - $last_char = substr($url_array[0], -1); - - if ($last_char == '*') { - $target_url = substr($url_array[0], 0, -1); - } - - $url_desktop = (!empty($url_array[1])) ? $url_array[1] : ''; - $url_mobile = (!empty($url_array[2])) ? $url_array[2] : ''; - - $javascript = "var mobile_js_redirect_target_url = '$target_url';"; - $javascript .= "var mobile_js_redirect_desktop_url = '$url_desktop';"; - $javascript .= "var mobile_js_redirect_mobile_url = '$url_mobile';"; - - return $javascript; -} diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.routing.yml b/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.routing.yml deleted file mode 100755 index 2ce385634..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/mobile_js_redirect.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -mobile_js_redirect.admin_form: - path: '/admin/config/system/mobile_js_redirect' - defaults: - _title: 'Mobile JS Redirect Settings' - _form: '\Drupal\mobile_js_redirect\Form\MobileJsRedirectAdminForm' - requirements: - _permission: 'administer site configuration' diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/src/Form/MobileJsRedirectAdminForm.php b/sites/all/modules/contrib/dev/mobile_js_redirect/src/Form/MobileJsRedirectAdminForm.php deleted file mode 100755 index 82f28c5bf..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/src/Form/MobileJsRedirectAdminForm.php +++ /dev/null @@ -1,87 +0,0 @@ -config('mobile_js_redirect.settings'); - $form['site_urls'] = array( - '#type' => 'fieldset', - '#title' => t('Site URLs'), - '#description' => t('Mobile and Desktop sites URLs - Please read the instructions below the textarea.'), - ); - - $form['site_urls']['mobile_js_redirect_urls'] = array( - '#type' => 'textarea', - '#description' => t('- Put each group of urls on a line separated by | character (pipe) without spaces like: TARGET URL|DESKTOP URL|MOBILE URL.
        - You can use the * character (asterisk) as a wildcard on target url.
        - If you wont redirect one of these (desktop or mobile) leave blank.
        - The redirect occurrs on the first "true" match.'), - '#default_value' => $config->get('mobile_js_redirect_urls'), - '#attributes' => array('placeholder' => array('Target URL|Desktop URL|Mobile URL')), - '#size' => 10, - '#resizable' => FALSE, - ); - - $form['devices_list'] = array( - '#type' => 'fieldset', - '#title' => t('Devices List'), - '#description' => t('Enter list of User Agent device names which should be recognized as mobile devices.
        The default list Devices List is: iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm'), - ); - - $form['devices_list']['mobile_js_redirect_regexp_devices_list'] = array( - '#type' => 'textfield', - '#description' => t('Use | for separation.'), - '#default_value' => (!empty($config->get('mobile_js_redirect_regexp_devices_list'))) ? $config->get('mobile_js_redirect_regexp_devices_list') : MOBILE_JS_REDIRECT_REGEXP_DEVICES_LIST, - ); - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - if (empty($form_state->getValue('mobile_js_redirect_regexp_devices_list'))) { - $form_state->setErrorByName('mobile_js_redirect_regexp_devices_list', $this->t('The device list is empty. Please fill the Device list to continue.')); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('mobile_js_redirect.settings'); - foreach ($form_state->getValues() as $key => $value) { - if (strpos($key, 'mobile_js_redirect_') !== FALSE) { - $config->set($key, $value); - } - } - - $config->save(); - - drupal_set_message($this->t('Mobile Js Redirect configuration has been saved.')); - } - -} diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/src/Tests/MobileJsRedirectTests.php b/sites/all/modules/contrib/dev/mobile_js_redirect/src/Tests/MobileJsRedirectTests.php deleted file mode 100644 index 8082d0eaa..000000000 --- a/sites/all/modules/contrib/dev/mobile_js_redirect/src/Tests/MobileJsRedirectTests.php +++ /dev/null @@ -1,89 +0,0 @@ -user = $this->DrupalCreateUser(array( - 'administer site configuration', - )); - } - - /** - * {@inheritdoc} - */ - public function testMobileJsRedirectPageExists() { - - $this->drupalLogin($this->user); - - // Generator test: - $this->drupalGet('admin/config/system/mobile_js_redirect'); - $this->assertResponse(200); - } - - /** - * {@inheritdoc} - */ - public function testConfigForm() { - - // Test form structure. - $this->drupalLogin($this->user); - $this->drupalGet('admin/config/system/mobile_js_redirect'); - $this->assertResponse(200); - $config = $this->config('mobile_js_redirect.settings'); - $this->assertFieldByName( - 'mobile_js_redirect_urls', - $config->get('mobile_js_redirect_urls'), - 'Page title field has the default value' - ); - $this->assertFieldByName( - 'mobile_js_redirect_regexp_devices_list', - $config->get('mobile_js_redirect_regexp_devices_list'), - 'Page title field has the default value' - ); - - $this->drupalPostForm(NULL, array( - 'mobile_js_redirect_urls' => 'targetexample|desktopredirect|mobileredirect', - 'mobile_js_redirect_regexp_devices_list' => 'iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm', - ), t('Save configuration')); - - $this->drupalGet('admin/config/system/mobile_js_redirect'); - $this->assertResponse(200); - $this->assertFieldByName( - 'mobile_js_redirect_urls', - 'targetexample|desktopredirect|mobileredirect', - 'URLs text is OK.' - ); - $this->assertFieldByName( - 'mobile_js_redirect_regexp_devices_list', - 'iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm', - 'Devices List text is OK.' - ); - } - -} diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/LICENSE.txt b/sites/all/modules/contrib/dev/module_missing_message_fixer/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/README.txt b/sites/all/modules/contrib/dev/module_missing_message_fixer/README.txt deleted file mode 100644 index e745e6480..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/README.txt +++ /dev/null @@ -1,61 +0,0 @@ - -CONTENTS OF THIS FILE ---------------------- - -* Introduction -* Requirements -* Installation -* Configuration -* Maintainers - -INTRODUCTION ------------- - -The Module Missing Message Fixer module displays a list of missing modules that appear in the message log after the -Drupal 7.50 release and provides an interface to fix the entries. This module was designed in sn effort to help those -people who didnt want to run SQL commands directly. - -* For a full description of the module, visit https://www.drupal.org/project/module_missing_message_fixer -* To submit bug reports and feature suggestions, or to track changes -visit https://www.drupal.org/project/issues/module_missing_message_fixer - - -REQUIREMENTS ------------- - -This module requires no additional modules outside of Drupal core. - - -INSTALLATION ------------- - -Install the Module Missing Message Fixer module as you would normally install a contributed Drupal module. Visit -https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 -for further information. - - -CONFIGURATION -------------- - -Through the UI interface: -1. Enable the Module Missing Message Fixer module. -2. Ensure that you have the proper permissions by navigating to Administration > People > Permissions and selecting -the checkbox. -3. Navigate to Administration > Configuration > System > Missing Module Message Fixer. Select the missing modules you -would like to fix and select the "Remove These Errors!" tab. The module will now go through and remove the "ghost records" from the systems table. -Through Drush: -1. $ drush en module_missing_message_fixer -2. $ drush module-missing-message-fixer-list OR $ drush mmmfl. This will generate a list of missing modules. -3. $ drush module-missing-message-fixer-fix machine_name_of_module (or --all) OR -$ drush mmmff machine_name_of_module (or --all). This will fix the missing modules entities. - -For more information visit https://www.drupal.org/node/2487215 - - -MAINTAINERS ------------ - -* John Ouellet (labboy0276) - https://www.drupal.org/u/labboy0276 - -Supporting organization: -* Kalamuna - https://www.drupal.org/kalamuna diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/composer.json b/sites/all/modules/contrib/dev/module_missing_message_fixer/composer.json deleted file mode 100644 index 436aa647d..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "drupal/module_missing_message_fixer", - "description": "This module displays a list of missing modules that appear on your site and lets you fix the entries", - "type": "drupal-module", - "keywords": ["Drupal"], - "license": "GPL-2.0+", - "homepage": "https://www.drupal.org/project/module_missing_message_fixer", - "authors": [ - { - "name": "See contributors", - "homepage": "https://www.drupal.org/node/2951176/committers", - "role": "Developer" - } - ], - "minimum-stability": "dev", - "prefer-stable": true, - "support": { - "issues": "https://www.drupal.org/project/issues/module_missing_message_fixer", - "source": "http://cgit.drupalcode.org/module_missing_message_fixer" - }, - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/drush.services.yml b/sites/all/modules/contrib/dev/module_missing_message_fixer/drush.services.yml deleted file mode 100644 index 64fd165d8..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/drush.services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - module_missing_message_fixer.fix: - class: \Drupal\module_missing_message_fixer\Commands\MmmfFixCommand - arguments: ['@module_missing_message_fixer.fixer', '@database', '@config.factory'] - tags: - - { name: drush.command } - module_missing_message_fixer.list: - class: \Drupal\module_missing_message_fixer\Commands\MmmfListCommand - arguments: ['@module_missing_message_fixer.fixer'] - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/includes/module_missing_message_fixer.drush.inc b/sites/all/modules/contrib/dev/module_missing_message_fixer/includes/module_missing_message_fixer.drush.inc deleted file mode 100644 index 52631eb0b..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/includes/module_missing_message_fixer.drush.inc +++ /dev/null @@ -1,107 +0,0 @@ - dt('Returns a list of modules that have missing messages.'), - 'aliases' => [ - 'mmmfl', - ], - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - ]; - $items['module-missing-message-fixer-fix'] = [ - 'description' => dt('Fixes modules that have missing messages.'), - 'aliases' => [ - 'mmmff', - ], - 'arguments' => [ - 'name' => 'The name of the module to fix.', - ], - 'options' => [ - 'all' => dt('Fixes all module missing messages'), - ], - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, - ]; - return $items; -} - -/** - * Drush command. - * - * Displays a list of modules that have missing messages. - */ -function drush_module_missing_message_fixer_list() { - \Drupal::service('module_missing_message_fixer.fixer')->checkModules(); -} - -/** - * Drush command. - * - * @param string $name - * The name of the module to fix messages for. - */ -function drush_module_missing_message_fixer_fix($name = NULL) { - $modules = []; - $rows = \Drupal::service('module_missing_message_fixer.fixer') - ->checkModules(TRUE); - - if (drush_get_option('all') !== NULL) { - if (!empty($rows)) { - foreach ($rows as $row) { - $modules[] = $row['name']; - } - } - } - elseif ($name !== NULL) { - // If this exists in the table. - if (strpos(json_encode($rows), $name)) { - $modules[] = $name; - } - else { - drush_log(dt('Module ' . $name . ' was not found.'), 'error'); - } - } - else { - drush_log(dt('Missing input, provide module name or run with --all'), 'error'); - } - // Delete if there is no modules. - if (count($modules) > 0) { - $query = \Drupal::database()->delete('key_value'); - $query->condition('collection', 'system.schema'); - $query->condition('name', $modules, 'IN'); - $query->execute(); - - if (drush_get_option('all') !== NULL) { - drush_log(dt('All missing references have been removed.'), 'success'); - } - elseif ($name !== NULL) { - if (in_array($name, $modules, TRUE)) { - drush_log(dt('Reference to ' . $name . ' (if found) has been removed.'), 'success'); - } - } - } -} diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.info.yml b/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.info.yml deleted file mode 100644 index f5b759105..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Module Missing Message Fixer' -description: 'This module displays a list of missing modules that appear on your site and lets you fix the entries.' -package: Administration -# core: 8.x -type: module - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-1.0-beta2' -core: '8.x' -project: 'module_missing_message_fixer' -datestamp: 1546878787 diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.links.menu.yml b/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.links.menu.yml deleted file mode 100644 index 36db213b0..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -module_missing_message_fixer.form: - route_name: module_missing_message_fixer.form - title: 'Missing Module Message Fixer' - description: 'This module display a list of missing module that appear after the Drupal 7.50 release and lets you fix the entries.' - parent: system.admin_config_system diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.module b/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.module deleted file mode 100644 index d7fba30d1..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/module_missing_message_fixer.module +++ /dev/null @@ -1,6 +0,0 @@ -fixer = $mmmf; - $this->connection = $connection; - $this->configFactory = $config_factory; - } - - /** - * Fixes the missing modules. - * - * @param string $name - * The name of the module to fix messages for. - * @param array $options - * The all flag option. - * - * @command module-missing-message-fixer:fix - * - * @option all Fixes all module missing messages. - * - * @usage drush module-missing-message-fixer:fix stuff - * Fixes the stuff module. - * @usage drush module-missing-message-fixer:fix stuff --all - * Fixes all the modules. - * - * @aliases mmmff - */ - public function fixCommand($name = NULL, array $options = ['all' => NULL]) { - $modules = []; - $rows = $this->fixer->checkModules(TRUE); - if ($options['all'] !== NULL) { - if (!empty($rows)) { - foreach ($rows as $row) { - $modules[] = $row['name']; - - // Clean up old migrate configuration. - $like = $this->connection->escapeLike($row['name'] . '.'); - $config_names = $this->connection->select('config', 'c') - ->fields('c', ['name']) - ->condition('name', $like . '%', 'LIKE') - ->execute() - ->fetchAll(); - - // Delete each config using configFactory. - foreach ($config_names as $config_name) { - $this->configFactory->getEditable($config_name->name)->delete(); - } - - // Reminds users to export config. - if (!empty($config_name)) { - $this->output()->writeln(dt("Don't forget to export your config")); - } - } - } - } - elseif ($name !== NULL) { - // If this exists in the table. - if (strpos(json_encode($rows), $name)) { - $modules[] = $name; - } - else { - $this->output()->writeln(dt('Module ' . $name . ' was not found.'), 'error'); - } - } - else { - $this->output()->writeln(dt('Missing input, provide module name or run with --all'), 'error'); - } - // Delete if there is no modules. - if (count($modules) > 0) { - $query = $this->connection->delete('key_value'); - $query->condition('collection', 'system.schema'); - $query->condition('name', $modules, 'IN'); - $query->execute(); - - if (drush_get_option('all') !== NULL) { - $this->output()->writeln(dt('All missing references have been removed.'), 'success'); - } - elseif ($name !== NULL) { - if (in_array($name, $modules, TRUE)) { - $this->output()->writeln(dt('Reference to ' . $name . ' (if found) has been removed.'), 'success'); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/src/Commands/MmmfListCommand.php b/sites/all/modules/contrib/dev/module_missing_message_fixer/src/Commands/MmmfListCommand.php deleted file mode 100644 index 377f98db3..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/src/Commands/MmmfListCommand.php +++ /dev/null @@ -1,59 +0,0 @@ -fixer = $mmmf; - } - - /** - * Returns a list of modules that have missing messages. - * - * @command module-missing-message-fixer:list - * - * @usage drush module-missing-message-fixer:list - * Returns a list of modules that have missing messages. - * - * @aliases mmmfl - * - * @field-labels - * name: Name - * type: Type - */ - public function listCommand() { - $rows = $this->fixer->getTableRows(); - if (count($rows) > 0) { - $table[] = $this->fixer->getTableHeader(); - foreach ($rows as $row) { - $table[] = $row; - } - return new RowsOfFields($table); - } - $this->output()->writeln('No Missing Modules Found!!!'); - } - -} diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/src/Form/ModuleMissingMessageFixerForm.php b/sites/all/modules/contrib/dev/module_missing_message_fixer/src/Form/ModuleMissingMessageFixerForm.php deleted file mode 100644 index 7d98ed1f4..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/src/Form/ModuleMissingMessageFixerForm.php +++ /dev/null @@ -1,158 +0,0 @@ -connection = $connection; - $this->configFactory = $config_factory; - $this->messenger = $messenger; - $this->mmmf = $mmmf; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('database'), - $container->get('config.factory'), - $container->get('messenger'), - $container->get('module_missing_message_fixer.fixer') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'module_missing_message_fixer_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - // Fancy title string. - $title = $this->t('This list comes from the system table and is checked against the drupal_get_filename() function. See this issue for more information.', [ - '@link' => 'https://www.drupal.org/node/2487215', - ]); - - // Title. - $form['title'] = [ - '#type' => 'item', - '#markup' => '

        ' . $title . '

        ', - ]; - - // Fancy submit buttons to win this. - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Remove These Errors!'), - ]; - - // Set the tables select to make this more granular. - $form['table'] = [ - '#type' => 'tableselect', - '#header' => $this->mmmf->getTableHeader(), - '#options' => $this->mmmf->getTableRows(), - '#empty' => $this->t('No Missing Modules Found!!!'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $modules = []; - // Go through each record and add it to the array to win. - foreach ($form_state->getValue(['table']) as $module) { - if ($module) { - $modules[] = $module; - - // Clean up old migrate configuration. - $like = $this->connection->escapeLike($module . '.'); - $config_names = $this->connection->select('config', 'c') - ->fields('c', ['name']) - ->condition('name', $like . '%', 'LIKE') - ->execute() - ->fetchAll(); - - // Delete each config using configFactory. - foreach ($config_names as $config_name) { - $this->configFactory->getEditable($config_name->name)->delete(); - } - - // Reminds users to export config. - if (!empty($config_name)) { - $this->messenger->addWarning("Don't forget to export your config"); - } - } - } - - // Delete if there is no modules. - if (count($modules) > 0) { - $query = $this->connection->delete('key_value'); - $query->condition('collection', 'system.schema'); - $query->condition('name', $modules, 'IN'); - $query->execute(); - } - } - -} diff --git a/sites/all/modules/contrib/dev/module_missing_message_fixer/src/ModuleMissingMessageFixer.php b/sites/all/modules/contrib/dev/module_missing_message_fixer/src/ModuleMissingMessageFixer.php deleted file mode 100644 index 5199680fb..000000000 --- a/sites/all/modules/contrib/dev/module_missing_message_fixer/src/ModuleMissingMessageFixer.php +++ /dev/null @@ -1,175 +0,0 @@ -connection = $connection; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public function create(ContainerInterface $container) { - return new static( - $container->get('database'), - $container->get('messenger') - ); - } - - /** - * Helper function to check for modules to fix. - * - * @param bool $return - * If we are to return to rows or just print the list. - * - * @return string|null - * The printed output. - */ - public function checkModules($return = FALSE) { - - if ($return) { - return $this->getTableRows(); - } - - $rows = []; - - // Use a key for the head row that is not a valid module name. - $rows['*HEAD*'] = ModuleMissingMessageFixer::getTableHeader(); - $rows += ModuleMissingMessageFixer::getTableRows(); - - // Print Table here instead of in the hook_command. - $output = count($rows) > 1 ? - drush_format_table($rows, TRUE) : 'No Missing Modules Found!!!'; - drush_print($output); - - return NULL; - } - - /** - * Set the table headers for the ui and drush. - * - * @return string[] - * Format: $[$column_key] = $cell - */ - public function getTableHeader() { - return [ - 'name' => 'Name', - 'type' => 'Type', - ]; - } - - /** - * Produces one table row for each missing module. - * - * The table rows are suitable for drush and for the admin UI. - * - * @return array[] - * Format: $[$extension_name][$column_key] = $cell - */ - public function getTableRows() { - // Initalize vars. - $rows = []; - - // Grab all the modules in the system table. - $results = $this->connection->select('key_value', 'k') - ->fields('k', ['name']) - ->condition('collection', 'system.schema') - ->execute() - ->fetchAll(); - - // Go through the query and check the missing modules. - // Plus do our checks to see what's wrong. - foreach ($results as $record) { - - if ($record->name === 'default') { - continue; - } - - // Grab the checker. - $filename = drupal_get_filename('module', $record->name); - - if ($filename === NULL) { - // Report this module in the table. - $rows[$record->name] = [ - 'name' => $record->name, - 'type' => 'module', - ]; - continue; - } - - $message = NULL; - $replacements = [ - '@name' => $record->name, - '@type' => 'module', - '@file' => $filename, - ]; - if (!file_exists($filename)) { - // This case is unexpected, because drupal_get_filename() should take care - // of it already. - $message = 'The file @file for @name @type is missing.'; - } - elseif (!is_readable($filename)) { - // This case is unexpected, because drupal_get_filename() should take care - // of it already. - $message = 'The file @file for @name @type is not readable.'; - } - else { - // Verify if *.info file exists. - // See https://www.drupal.org/node/2789993#comment-12306555 - $info_filename = dirname($filename) . '/' . $record->name . '.info.yml'; - $replacements['@info_file'] = $info_filename; - if (!file_exists($info_filename)) { - $message = 'The *.info.yml file @info_file for @name @type is missing.'; - - } - elseif (!is_readable($info_filename)) { - $message = 'The *.info.yml file @info_file for @name @type is not readable.'; - } - } - - if ($message !== NULL) { - // This case should never occur. - $this->messenger->addWarning( - t($message, $replacements), - FALSE); - } - } - - return $rows; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/.gitignore b/sites/all/modules/contrib/dev/redis/.gitignore deleted file mode 100644 index a48738a76..000000000 --- a/sites/all/modules/contrib/dev/redis/.gitignore +++ /dev/null @@ -1 +0,0 @@ -predis diff --git a/sites/all/modules/contrib/dev/redis/.travis-before-script.sh b/sites/all/modules/contrib/dev/redis/.travis-before-script.sh deleted file mode 100644 index 94f0b72c8..000000000 --- a/sites/all/modules/contrib/dev/redis/.travis-before-script.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e $DRUPAL_TI_DEBUG - -# Ensure the right Drupal version is installed. -# Note: This function is re-entrant. -drupal_ti_ensure_drupal - -# Add needed dependencies. -cd "$DRUPAL_TI_DRUPAL_DIR" - -# Download predis -composer require predis/predis - - -# These variables come from environments/drupal-*.sh -mkdir -p "$DRUPAL_TI_MODULES_PATH" -cd "$DRUPAL_TI_MODULES_PATH" - -#Enable php-redis -echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/redis/.travis.yml b/sites/all/modules/contrib/dev/redis/.travis.yml deleted file mode 100644 index bb194fa15..000000000 --- a/sites/all/modules/contrib/dev/redis/.travis.yml +++ /dev/null @@ -1,116 +0,0 @@ -# @file -# .travis.yml - Drupal for Travis CI Integration -# -# Template provided by https://github.com/LionsAd/drupal_ti. -# -# Based for simpletest upon: -# https://github.com/sonnym/travis-ci-drupal-module-example - -language: php - -php: - - 5.5 - - 5.6 - - 7 - -matrix: - fast_finish: true - -env: - global: - # add composer's global bin directory to the path - # see: https://github.com/drush-ops/drush#install---composer - - PATH="$PATH:$HOME/.composer/vendor/bin" - - # Configuration variables. - - DRUPAL_TI_MODULE_NAME="redis" - - DRUPAL_TI_SIMPLETEST_GROUP="redis" - - # Define runners and environment vars to include before and after the - # main runners / environment vars. - #- DRUPAL_TI_SCRIPT_DIR_BEFORE="./.drupal_ti/before" - #- DRUPAL_TI_SCRIPT_DIR_AFTER="./drupal_ti/after" - - # The environment to use, supported are: drupal-7, drupal-8 - - DRUPAL_TI_ENVIRONMENT="drupal-8" - - # Drupal specific variables. - - DRUPAL_TI_DB="drupal_travis_db" - - DRUPAL_TI_DB_URL="mysql://root:@127.0.0.1/drupal_travis_db" - # Note: Do not add a trailing slash here. - - DRUPAL_TI_WEBSERVER_URL="http://127.0.0.1" - - DRUPAL_TI_WEBSERVER_PORT="8080" - - # Simpletest specific commandline arguments, the DRUPAL_TI_SIMPLETEST_GROUP is appended at the end. - - DRUPAL_TI_SIMPLETEST_ARGS="--verbose --color --concurrency 4 --url $DRUPAL_TI_WEBSERVER_URL:$DRUPAL_TI_WEBSERVER_PORT" - - # === Behat specific variables. - # This is relative to $TRAVIS_BUILD_DIR - - DRUPAL_TI_BEHAT_DIR="./tests/behat" - # These arguments are passed to the bin/behat command. - - DRUPAL_TI_BEHAT_ARGS="" - # Specify the filename of the behat.yml with the $DRUPAL_TI_DRUPAL_DIR variables. - - DRUPAL_TI_BEHAT_YML="behat.yml.dist" - # This is used to setup Xvfb. - - DRUPAL_TI_BEHAT_SCREENSIZE_COLOR="1280x1024x16" - # The version of seleniumthat should be used. - - DRUPAL_TI_BEHAT_SELENIUM_VERSION="2.44" - # Set DRUPAL_TI_BEHAT_DRIVER to "selenium" to use "firefox" or "chrome" here. - - DRUPAL_TI_BEHAT_DRIVER="phantomjs" - - DRUPAL_TI_BEHAT_BROWSER="firefox" - - # Set Drupal version in which to run tests. - - DRUPAL_TI_CORE_BRANCH="8.6.x" - - # PHPUnit specific commandline arguments. - - DRUPAL_TI_PHPUNIT_ARGS="--verbose --debug" - # Specifying the phpunit-core src/ directory is useful when e.g. a vendor/ - # directory is present in the module directory, which phpunit would then - # try to find tests in. This option is relative to $TRAVIS_BUILD_DIR. - #- DRUPAL_TI_PHPUNIT_CORE_SRC_DIRECTORY="./tests/src" - - # Code coverage via coveralls.io - - DRUPAL_TI_COVERAGE="satooshi/php-coveralls:0.6.*" - # This needs to match your .coveralls.yml file. - - DRUPAL_TI_COVERAGE_FILE="build/logs/clover.xml" - - # Debug options - #- DRUPAL_TI_DEBUG="-x -v" - # Set to "all" to output all files, set to e.g. "xvfb selenium" or "selenium", - # etc. to only output those channels. - #- DRUPAL_TI_DEBUG_FILE_OUTPUT="selenium xvfb webserver" - - # [[[ SELECT ANY OR MORE OPTIONS ]]] - #- DRUPAL_TI_RUNNERS="phpunit" - #- DRUPAL_TI_RUNNERS="simpletest" - #- DRUPAL_TI_RUNNERS="behat" - - DRUPAL_TI_RUNNERS="phpunit-core" - matrix: - - REDIS_INTERFACE=PhpRedis - - REDIS_INTERFACE=Predis - -# This will create the database -mysql: - database: drupal_travis_db - username: root - encoding: utf8 - -services: - - redis-server - -before_install: - - composer global require "lionsad/drupal_ti:dev-master#396d11d200005eb68491d24170da0a98ae7f51b3" - - drupal-ti before_install - -install: - - drupal-ti install - -before_script: - - drupal-ti --include .travis-before-script.sh - - drupal-ti before_script - -script: - - drupal-ti script - -after_script: - - drupal-ti after_script diff --git a/sites/all/modules/contrib/dev/redis/LICENSE.txt b/sites/all/modules/contrib/dev/redis/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/redis/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/redis/README.PhpRedis.txt b/sites/all/modules/contrib/dev/redis/README.PhpRedis.txt deleted file mode 100644 index 178458c4b..000000000 --- a/sites/all/modules/contrib/dev/redis/README.PhpRedis.txt +++ /dev/null @@ -1,52 +0,0 @@ -PhpRedis cache backend -====================== - -This client, for now, is only able to use the PhpRedis extension. - -Get PhpRedis ------------- - -You can download this library at: - - https://github.com/nicolasff/phpredis - -This is PHP extension, too recent for being packaged in most distribution, you -will probably need to compile it yourself. - -Default behavior is to connect via tcp://localhost:6379 but you might want to -connect differently. - -Use the Sentinel high availability mode ---------------------------------------- - -Redis can provide a master/slave mode with sentinels server monitoring them. -More information about setting it : https://redis.io/topics/sentinel. - -This mode needs the following settings: - -Modify the host as follow: - // Sentinels instances list with hostname:port format. - $settings['redis.connection']['host'] = ['1.2.3.4:5000','1.2.3.5:5000','1.2.3.6:5000']; - -Add the new instance setting: - - // Redis instance name. - $settings['redis.connection']['instance'] = 'instance_name'; - -Connect via UNIX socket ------------------------ - -Just add this line to your settings.php file: - - $conf['redis_cache_socket'] = '/tmp/redis.sock'; - -Don't forget to change the path depending on your operating system and Redis -server configuration. - -Connect to a remote host and database -------------------------------------- - -See README.md file. - -For this particular implementation, host settings are overridden by the -UNIX socket parameter. diff --git a/sites/all/modules/contrib/dev/redis/README.Predis.txt b/sites/all/modules/contrib/dev/redis/README.Predis.txt deleted file mode 100644 index 09bbbcefb..000000000 --- a/sites/all/modules/contrib/dev/redis/README.Predis.txt +++ /dev/null @@ -1,37 +0,0 @@ -Predis cache backend -==================== - -Using Predis for the Drupal 8 version of this module is still experimental. - -Get Predis ----------- - -Predis can be installed to the vendor directory using composer like so: - -composer require nrk/predis - - -Configuration of module for use with Predis ----------------------------- - -There is not much different to configure about Predis. -Adding this to settings.php should suffice for basic usage: - -$settings['redis.connection']['interface'] = 'Predis'; -$settings['redis.connection']['host'] = '1.2.3.4'; // Your Redis instance hostname. -$settings['cache']['default'] = 'cache.backend.redis'; - -To add more magic with a primary/replica setup you can use a config like this: - -$settings['redis.connection']['interface'] = 'Predis'; // Use predis library. -$settings['redis.connection']['replication'] = TRUE; // Turns on replication. -$settings['redis.connection']['replication.host'][1]['host'] = '1.2.3.4'; // Your Redis instance hostname. -$settings['redis.connection']['replication.host'][1]['port'] = '6379'; // Only required if using non-standard port. -$settings['redis.connection']['replication.host'][1]['role'] = 'primary'; // The redis instance role. -$settings['redis.connection']['replication.host'][2]['host'] = '1.2.3.5'; -$settings['redis.connection']['replication.host'][2]['port'] = '6379'; -$settings['redis.connection']['replication.host'][2]['role'] = 'replica'; -$settings['redis.connection']['replication.host'][3]['host'] = '1.2.3.6'; -$settings['redis.connection']['replication.host'][3]['port'] = '6379'; -$settings['redis.connection']['replication.host'][3]['role'] = 'replica'; -$settings['cache']['default'] = 'cache.backend.redis'; \ No newline at end of file diff --git a/sites/all/modules/contrib/dev/redis/README.md b/sites/all/modules/contrib/dev/redis/README.md deleted file mode 100644 index 1648bb0db..000000000 --- a/sites/all/modules/contrib/dev/redis/README.md +++ /dev/null @@ -1,338 +0,0 @@ -Redis backends -==================== - -This package provides two different Redis backends. If you want to use -Redis as cache backend, you have to choose one of the two, but you cannot use -both at the same time. - -PhpRedis --------- - -This implementation uses the PhpRedis PHP extension. In order to use it, you -will need to compile the extension yourself. - -Predis ------- - -Support for the Predis PHP library is experimental, but feel free to try it out. -You can install the required library using composer. Check out the README.Predis.txt file -for more information. - -Important notice ----------------- - -This module requires at least Redis 2.4, additionally, the lock backend -requires Redis 2.6 to support millisecond timeouts and atomic lock operations. - -Getting started -=============== - -Quick setup ------------ - -Here is a simple yet working easy way to setup the module. - -This method will allow Drupal to use Redis for all caches. - - $settings['redis.connection']['interface'] = 'PhpRedis'; // Can be "Predis". - $settings['redis.connection']['host'] = '1.2.3.4'; // Your Redis instance hostname. - $settings['cache']['default'] = 'cache.backend.redis'; - -To use some Predis goodness, including a redis primary/replica setup you can use a config like this. - - $settings['redis.connection']['interface'] = 'Predis'; // Use predis library. - $settings['redis.connection']['replication'] = TRUE; // Turns on replication. - $settings['redis.connection']['replication.host'][1]['host'] = '1.2.3.4'; // Your Redis instance hostname. - $settings['redis.connection']['replication.host'][1]['port'] = '6379'; // Only required if using non-standard port. - $settings['redis.connection']['replication.host'][1]['role'] = 'primary'; // The redis instance role. - $settings['redis.connection']['replication.host'][2]['host'] = '1.2.3.5'; - $settings['redis.connection']['replication.host'][2]['port'] = '6379'; - $settings['redis.connection']['replication.host'][2]['role'] = 'replica'; - $settings['redis.connection']['replication.host'][3]['host'] = '1.2.3.6'; - $settings['redis.connection']['replication.host'][3]['port'] = '6379'; - $settings['redis.connection']['replication.host'][3]['role'] = 'replica'; - $settings['cache']['default'] = 'cache.backend.redis'; - -Either include the default example.services.yml from the module, which will -replace all supported backend services (that currently includes the cache tags -checksum service and the lock backends, check the file for the current list) -or copy the service definitions into a site specific services.yml. - - $settings['container_yamls'][] = 'modules/redis/example.services.yml'; - -Note that for any of this, the redis module must be enabled. See next chapters -for more information. - -Is there any cache bins that should *never* go into Redis? ----------------------------------------------------------- - -TL;DR: No. - -Redis has been maturing a lot over time, and will apply different sensible -settings for different bins; It's today very stable. - -Advanced configuration -====================== - -Choose the Redis client library to use --------------------------------------- - -Note: This is not yet supported, only the PhpRedis interface is available. - -Add into your settings.php file: - - $settings['redis.connection']['interface'] = 'PhpRedis'; - -You can replace 'PhpRedis' with 'Predis', depending on the library you chose. - - -Tell Drupal to use the cache backend ------------------------------------- - -Usual cache backend configuration, as follows, to add into your settings.php -file like any other backend: - - # Use for all bins otherwise specified. - $settings['cache']['default'] = 'cache.backend.redis'; - - # Use this to only use it for specific cache bins. - $settings['cache']['bins']['render'] = 'cache.backend.redis'; - -Tell Drupal to use the lock backend ------------------------------------ - -See the provided example.services.yml file on how to override the lock services. - -Tell Drupal to use the queue backend ------------------------------------- - -This module provides reliable and non-reliable queue implementations. Depending -on which is to be use you need to choose "queue.redis" or "queue.redis_reliable" -as a service name. - -When you have configured basic information (host, library, ... - see Quick setup) -add this to your settings.php file: - - # Use for all queues unless otherwise specified for a specific queue. - $settings['queue_default'] = 'queue.redis'; - - # Or if you want to use reliable queue implementation. - $settings['queue_default'] = 'queue.redis_reliable'; - - - # Use this to only use Redis for a specific queue (aggregator_feeds in this case). - $settings['queue_service_aggregator_feeds'] = 'queue.redis'; - - # Or if you want to use reliable queue implementation. - $settings['queue_service_aggregator_feeds'] = 'queue.redis_reliable'; - - -Common settings -=============== - -Connect to a remote host ------------------------- - -If your Redis instance is remote, you can use this syntax: - - $settings['redis.connection']['interface'] = 'PhpRedis'; // Can be "Predis". - $settings['redis.connection']['host'] = '1.2.3.4'; // Your Redis instance hostname. - $settings['redis.connection']['port'] = '6379'; // Redis port - -Port is optional, default is 6379 (default Redis port). - -Using a specific database -------------------------- - -Per default, Redis ships the database "0". All default connections will be use -this one if nothing is specified. - -Depending on you OS or OS distribution, you might have numerous database. To -use one in particular, just add to your settings.php file: - - $settings['redis.connection']['base'] = 12; - -Connection to a password protected instance -------------------------------------------- - -If you are using a password protected instance, specify the password this way: - - $settings['redis.connection']['password'] = "mypassword"; - -Depending on the backend, using a wrong auth will behave differently: - - - Predis will throw an exception and make Drupal fail during early boostrap. - - - PhpRedis will make Redis calls silent and creates some PHP warnings, thus - Drupal will behave as if it was running with a null cache backend (no cache - at all). - -Prefixing site cache entries (avoiding sites name collision) ------------------------------------------------------------- - -If you need to differentiate multiple sites using the same Redis instance and -database, you will need to specify a prefix for your site cache entries. - -Cache prefix configuration attempts to use a unified variable across contrib -backends that support this feature. This variable name is 'cache_prefix'. - -This variable is polymorphic, the simplest version is to provide a raw string -that will be the default prefix for all cache bins: - - $settings['cache_prefix'] = 'mysite_'; - -Alternatively, to provide the same functionality, you can provide the variable -as an array: - - $settings['cache_prefix']['default'] = 'mysite_'; - -This allows you to provide different prefix depending on the bin name. Common -usage is that each key inside the 'cache_prefix' array is a bin name, the value -the associated prefix. If the value is FALSE, then no prefix is -used for this bin. - -The 'default' meta bin name is provided to define the default prefix for non -specified bins. It behaves like the other names, which means that an explicit -FALSE will order the backend not to provide any prefix for any non specified -bin. - -Here is a complex sample: - - // Default behavior for all bins, prefix is 'mysite_'. - $settings['cache_prefix']['default'] = 'mysite_'; - - // Set no prefix explicitely for 'cache' and 'cache_bootstrap' bins. - $settings['cache_prefix']['cache'] = FALSE; - $settings['cache_prefix']['cache_bootstrap'] = FALSE; - - // Set another prefix for 'cache_menu' bin. - $settings['cache_prefix']['cache_menu'] = 'menumysite_'; - -Note that if you don't specify the default behavior, the Redis module will -attempt to use the HTTP_HOST variable in order to provide a multisite safe -default behavior. Notice that this is not failsafe, in such environment you -are strongly advised to set at least an explicit default prefix. - -Note that this last notice is Redis only specific, because per default Redis -server will not namespace data, thus sharing an instance for multiple sites -will create conflicts. This is not true for every contributed backends. - -Flush mode ----------- - -@todo: Update for Drupal 8 - -Redis allows to set a time-to-live at the key level, which frees us from -handling the garbage collection at clear() calls; Unfortunately Drupal never -explicitely clears single cached pages or blocks. If you didn't configure the -"cache_lifetime" core variable, its value is "0" which means that temporary -items never expire: in this specific case, we need to adopt a different -behavior than leting Redis handling the TTL by itself; This is why we have -three different implementations of the flush algorithm you can use: - - * 0: Never flush temporary: leave Redis handling the TTL; This mode is - not compatible for the "page" and "block" bins but is the default for - all others. - - * 1: Keep a copy of temporary items identifiers in a SET and flush them - accordingly to spec (DatabaseCache default backend mimic behavior): - this is the default for "page" and "block" bin if you don't change the - configuration. - - * 2: Flush everything including permanent or valid items on clear() calls: - this behavior mimics the pre-1.0 releases of this module. Use it only - if you experience backward compatibility problems on a production - environement - at the cost of potential performance issues; All other - users should ignore this parameter. - -You can configure a default flush mode which will override the sensible -provided defaults by setting the 'redis_flush_mode' variable. - - // For example this is the safer mode. - $conf['redis_flush_mode'] = 1; - -But you may also want to change the behavior for only a few bins. - - // This will put mode 0 on "bootstrap" bin. - $conf['redis_flush_mode_cache_bootstrap'] = 0; - - // And mode 2 to "page" bin. - $conf['redis_flush_mode_cache_page'] = 2; - -Note that you must prefix your bins with "cache" as the Drupal 7 bin naming -convention requires it. - -Keep in mind that defaults will provide the best balance between performance -and safety for most sites; Non advanced users should ever change them. - -Default lifetime for permanent items ------------------------------------- - -@todo: Update for Drupal 8 - -Redis when reaching its maximum memory limit will stop writing data in its -storage engine: this is a feature that avoid the Redis server crashing when -there is no memory left on the machine. - -As a workaround, Redis can be configured as a LRU cache for both volatile or -permanent items, which means it can behave like Memcache; Problem is that if -you use Redis as a permanent storage for other business matters than this -module you cannot possibly configure it to drop permanent items or you'll -loose data. - -This workaround allows you to explicity set a very long or configured default -lifetime for CACHE_PERMANENT items (that would normally be permanent) which -will mark them as being volatile in Redis storage engine: this then allows you -to configure a LRU behavior for volatile keys without engaging the permenent -business stuff in a dangerous LRU mechanism; Cache items even if permament will -be dropped when unused using this. - -Per default the TTL for permanent items will set to safe-enough value which is -one year; No matter how Redis will be configured default configuration or lazy -admin will inherit from a safe module behavior with zero-conf. - -For advanturous people, you can manage the TTL on a per bin basis and change -the default one: - - // Make CACHE_PERMANENT items being permanent once again - // 0 is a special value usable for all bins to explicitely tell the - // cache items will not be volatile in Redis. - $conf['redis_perm_ttl'] = 0; - - // Make them being volatile with a default lifetime of 1 year. - $conf['redis_perm_ttl'] = "1 year"; - - // You can override on a per-bin basis; - // For example make cached field values live only 3 monthes: - $conf['redis_perm_ttl_cache_field'] = "3 months"; - - // But you can also put a timestamp in there; In this case the - // value must be a STRICTLY TYPED integer: - $conf['redis_perm_ttl_cache_field'] = 2592000; // 30 days. - -Time interval string will be parsed using DateInterval::createFromDateString -please refer to its documentation: - - http://www.php.net/manual/en/dateinterval.createfromdatestring.php - -Last but not least please be aware that this setting affects the -CACHE_PERMANENT ONLY; All other use cases (CACHE_TEMPORARY or user set TTL -on single cache entries) will continue to behave as documented in Drupal core -cache backend documentation. - -Lock backends -------------- - -@todo: Update for Drupal 8 - -Both implementations provides a Redis lock backend. Redis lock backend proved to -be faster than the default SQL based one when using both servers on the same box. - -Both backends, thanks to the Redis WATCH, MULTI and EXEC commands provides a -real race condition free mutexes if you use Redis >= 2.1.0. - -Testing -======= - -I did not find any hint about making tests being configurable, so per default -the tested Redis server must always be on localhost with default configuration. diff --git a/sites/all/modules/contrib/dev/redis/composer.json b/sites/all/modules/contrib/dev/redis/composer.json deleted file mode 100644 index ff18a35a0..000000000 --- a/sites/all/modules/contrib/dev/redis/composer.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "drupal/redis", - "type": "drupal-module", - "suggest": { - "predis/predis": "^1.1.1" - }, - "license": "GPL-2.0", - "autoload": { - "psr-4": { - "Drupal\\redis\\": "src" - } - } -} diff --git a/sites/all/modules/contrib/dev/redis/example.services.yml b/sites/all/modules/contrib/dev/redis/example.services.yml deleted file mode 100644 index 74a05f66e..000000000 --- a/sites/all/modules/contrib/dev/redis/example.services.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This file contains example services overrides. -# -# Enable with this line in settings.php -# $settings['container_yamls'][] = 'modules/redis/example.services.yml'; -# -# Or copy & paste the desired services into sites/default/services.yml. -# -# Note that the redis module must be enabled for this to work. - -services: - # Cache tag checksum backend. Used by redis and most other cache backend - # to deal with cache tag invalidations. - cache_tags.invalidator.checksum: - class: Drupal\redis\Cache\RedisCacheTagsChecksum - arguments: ['@redis.factory'] - tags: - - { name: cache_tags_invalidator } - - # Replaces the default lock backend with a redis implementation. - lock: - class: Drupal\Core\Lock\LockBackendInterface - factory: ['@redis.lock.factory', get] - - # Replaces the default persistent lock backend with a redis implementation. - lock.persistent: - class: Drupal\Core\Lock\LockBackendInterface - factory: ['@redis.lock.factory', get] - arguments: [true] - - # Replaces the default flood backend with a redis implementation. - flood: - class: Drupal\Core\Flood\FloodInterface - factory: ['@redis.flood.factory', get] diff --git a/sites/all/modules/contrib/dev/redis/redis.info.yml b/sites/all/modules/contrib/dev/redis/redis.info.yml deleted file mode 100644 index 64991bd8d..000000000 --- a/sites/all/modules/contrib/dev/redis/redis.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Redis -description: Provide a module placeholder, for using as dependency for module that needs Redis. -package: Performance -type: module -# core: 8.x -configure: redis.admin_display - -# Information added by Drupal.org packaging script on 2018-11-07 -version: '8.x-1.1' -core: '8.x' -project: 'redis' -datestamp: 1541600592 diff --git a/sites/all/modules/contrib/dev/redis/redis.install b/sites/all/modules/contrib/dev/redis/redis.install deleted file mode 100644 index 3730606bf..000000000 --- a/sites/all/modules/contrib/dev/redis/redis.install +++ /dev/null @@ -1,40 +0,0 @@ - "Redis", - 'value' => t("Connected, using the @name client.", ['@name' => ClientFactory::getClientName()]), - 'severity' => REQUIREMENT_OK, - ]; - } - else { - $requirements['redis'] = [ - 'title' => "Redis", - 'value' => t("Not connected."), - 'severity' => REQUIREMENT_WARNING, - 'description' => t("No Redis client connected, this module is useless thereof. Ensure that you enabled module using it or disable it."), - ]; - } - - return $requirements; -} diff --git a/sites/all/modules/contrib/dev/redis/redis.module b/sites/all/modules/contrib/dev/redis/redis.module deleted file mode 100644 index a4d7db8e5..000000000 --- a/sites/all/modules/contrib/dev/redis/redis.module +++ /dev/null @@ -1,28 +0,0 @@ -' . t("Current connected client uses the @name library.", ['@name' => ClientFactory::getClientName()]) . '

        '; - } - else { - $messages = '

        ' . t('No redis connection configured.') . '

        '; - } - return $messages; - } -} diff --git a/sites/all/modules/contrib/dev/redis/redis.services.yml b/sites/all/modules/contrib/dev/redis/redis.services.yml deleted file mode 100644 index c7308ab72..000000000 --- a/sites/all/modules/contrib/dev/redis/redis.services.yml +++ /dev/null @@ -1,18 +0,0 @@ -services: - cache.backend.redis: - class: Drupal\redis\Cache\CacheBackendFactory - arguments: ['@redis.factory', '@cache_tags.invalidator.checksum', '@serialization.phpserialize'] - redis.factory: - class: Drupal\redis\ClientFactory - redis.lock.factory: - class: Drupal\redis\Lock\LockFactory - arguments: ['@redis.factory'] - redis.flood.factory: - class: Drupal\redis\Flood\FloodFactory - arguments: ['@redis.factory', '@request_stack'] - queue.redis_reliable: - class: Drupal\redis\Queue\ReliableQueueRedisFactory - arguments: ['@redis.factory', '@settings'] - queue.redis: - class: Drupal\redis\Queue\QueueRedisFactory - arguments: ['@redis.factory', '@settings'] diff --git a/sites/all/modules/contrib/dev/redis/src/Cache/CacheBackendFactory.php b/sites/all/modules/contrib/dev/redis/src/Cache/CacheBackendFactory.php deleted file mode 100644 index 4efa1c650..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Cache/CacheBackendFactory.php +++ /dev/null @@ -1,70 +0,0 @@ -clientFactory = $client_factory; - $this->checksumProvider = $checksum_provider; - $this->serializer = $serializer; - } - - /** - * {@inheritdoc} - */ - public function get($bin) { - if (!isset($this->bins[$bin])) { - $class_name = $this->clientFactory->getClass(ClientFactory::REDIS_IMPL_CACHE); - $this->bins[$bin] = new $class_name($bin, $this->clientFactory->getClient(), $this->checksumProvider, $this->serializer); - } - return $this->bins[$bin]; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Cache/CacheBase.php b/sites/all/modules/contrib/dev/redis/src/Cache/CacheBase.php deleted file mode 100644 index 6daf590ac..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Cache/CacheBase.php +++ /dev/null @@ -1,379 +0,0 @@ -permTtl; - } - - /** - * CacheBase constructor. - * @param $bin - * The cache bin for which the object is created. - * @param \Drupal\Component\Serialization\SerializationInterface $serializer - * The serialization class to use. - */ - public function __construct($bin, SerializationInterface $serializer) { - $this->bin = $bin; - $this->serializer = $serializer; - $this->setPermTtl(); - } - - /** - * {@inheritdoc} - */ - public function get($cid, $allow_invalid = FALSE) { - $cids = [$cid]; - $cache = $this->getMultiple($cids, $allow_invalid); - return reset($cache); - } - - /** - * {@inheritdoc} - */ - public function setMultiple(array $items) { - foreach ($items as $cid => $item) { - $this->set($cid, $item['data'], isset($item['expire']) ? $item['expire'] : CacheBackendInterface::CACHE_PERMANENT, isset($item['tags']) ? $item['tags'] : []); - } - } - - /** - * {@inheritdoc} - */ - public function delete($cid) { - $this->deleteMultiple([$cid]); - } - - /** - * {@inheritdoc} - */ - public function removeBin() { - $this->deleteAll(); - } - - /** - * {@inheritdoc} - */ - public function invalidate($cid) { - $this->invalidateMultiple([$cid]); - } - - /** - * Return the key for the given cache key. - */ - public function getKey($cid = NULL) { - if (NULL === $cid) { - return $this->getPrefix() . ':' . $this->bin; - } - else { - return $this->getPrefix() . ':' . $this->bin . ':' . $cid; - } - } - - /** - * Calculate the correct expiration time. - * - * @param int $expire - * The expiration time provided for the cache set. - * - * @return int - * The default expiration if expire is PERMANENT or higher than the default. - * May return negative values if the item is already expired. - */ - protected function getExpiration($expire) { - if ($expire == Cache::PERMANENT || $expire > $this->permTtl) { - return $this->permTtl; - } - return $expire - REQUEST_TIME; - } - - /** - * Return the key for the tag used to specify the bin of cache-entries. - */ - protected function getTagForBin() { - return 'x-redis-bin:' . $this->bin; - } - - /** - * Set the minimum TTL (unit testing only). - */ - public function setMinTtl($ttl) { - $this->minTtl = $ttl; - } - - /** - * Set the permanent TTL. - */ - public function setPermTtl($ttl = NULL) { - if (isset($ttl)) { - $this->permTtl = $ttl; - } - else { - // Attempt to set from settings. - if (($settings = Settings::get('redis.settings', [])) && isset($settings['perm_ttl_' . $this->bin])) { - $ttl = $settings['perm_ttl_' . $this->bin]; - if ($ttl === (int) $ttl) { - $this->permTtl = $ttl; - } - else { - if ($iv = DateInterval::createFromDateString($ttl)) { - // http://stackoverflow.com/questions/14277611/convert-dateinterval-object-to-seconds-in-php - $this->permTtl = ($iv->y * 31536000 + $iv->m * 2592000 + $iv->days * 86400 + $iv->h * 3600 + $iv->i * 60 + $iv->s); - } - else { - // Log error about invalid ttl. - trigger_error(sprintf("Parsed TTL '%s' has an invalid value: switching to default", $ttl)); - $this->permTtl = self::LIFETIME_PERM_DEFAULT; - } - - } - } - } - } - - /** - * Prepares a cached item. - * - * Checks that items are either permanent or did not expire, and unserializes - * data as appropriate. - * - * @param array $values - * The hash returned from redis or false. - * @param bool $allow_invalid - * If FALSE, the method returns FALSE if the cache item is not valid. - * - * @return mixed|false - * The item with data unserialized as appropriate and a property indicating - * whether the item is valid, or FALSE if there is no valid item to load. - */ - protected function expandEntry(array $values, $allow_invalid) { - // Check for entry being valid. - if (empty($values['cid'])) { - return FALSE; - } - - $cache = (object) $values; - - $cache->tags = explode(' ', $cache->tags); - - // Check expire time, allow to have a cache invalidated explicitly, don't - // check if already invalid. - if ($cache->valid) { - $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= REQUEST_TIME; - - // Check if invalidateTags() has been called with any of the items's tags. - if ($cache->valid && !$this->checksumProvider->isValid($cache->checksum, $cache->tags)) { - $cache->valid = FALSE; - } - } - - // Ensure the entry does not predate the last delete all time. - $last_delete_timestamp = $this->getLastDeleteAll(); - if ($last_delete_timestamp && ((float)$values['created']) < $last_delete_timestamp) { - return FALSE; - } - - if (!$allow_invalid && !$cache->valid) { - return FALSE; - } - - if ($cache->serialized) { - $cache->data = $this->serializer->decode($cache->data); - } - - return $cache; - } - - /** - * Create cache entry. - * - * @param string $cid - * @param mixed $data - * @param int $expire - * @param string[] $tags - * - * @return array - */ - protected function createEntryHash($cid, $data, $expire = Cache::PERMANENT, array $tags) { - // Always add a cache tag for the current bin, so that we can use that for - // invalidateAll(). - $tags[] = $this->getTagForBin(); - assert(Inspector::assertAllStrings($tags), 'Cache Tags must be strings.'); - $hash = [ - 'cid' => $cid, - 'created' => round(microtime(TRUE), 3), - 'expire' => $expire, - 'tags' => implode(' ', $tags), - 'valid' => 1, - 'checksum' => $this->checksumProvider->getCurrentChecksum($tags), - ]; - - // Let Redis handle the data types itself. - if (!is_string($data)) { - $hash['data'] = $this->serializer->encode($data); - $hash['serialized'] = 1; - } - else { - $hash['data'] = $data; - $hash['serialized'] = 0; - } - - return $hash; - } - /** - * {@inheritdoc} - */ - public function invalidateMultiple(array $cids) { - // Loop over all cache items, they are stored as a hash, so we can access - // the valid flag directly, only write if it exists and is not 0. - foreach ($cids as $cid) { - $key = $this->getKey($cid); - if ($this->client->hGet($key, 'valid')) { - $this->client->hSet($key, 'valid', 0); - } - } - } - - /** - * {@inheritdoc} - */ - public function invalidateAll() { - // To invalidate the whole bin, we invalidate a special tag for this bin. - $this->checksumProvider->invalidateTags([$this->getTagForBin()]); - } - - /** - * {@inheritdoc} - */ - public function garbageCollection() { - // @todo Do we need to do anything here? - } - - /** - * Returns the last delete all timestamp. - * - * @return float - * The last delete timestamp as a timestamp with a millisecond precision. - */ - protected function getLastDeleteAll() { - // Cache the last delete all timestamp. - if ($this->lastDeleteAll === NULL) { - $this->lastDeleteAll = (float) $this->client->get($this->getKey(static::LAST_DELETE_ALL_KEY)); - } - return $this->lastDeleteAll; - } - - /** - * {@inheritdoc} - */ - public function deleteAll() { - // The last delete timestamp is in milliseconds, ensure that no cache - // was written in the same millisecond. - // @todo This is needed to make the tests pass, is this safe enough for real - // usage? - usleep(1000); - $this->lastDeleteAll = round(microtime(TRUE), 3); - $this->client->set($this->getKey(static::LAST_DELETE_ALL_KEY), $this->lastDeleteAll); - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Cache/PhpRedis.php b/sites/all/modules/contrib/dev/redis/src/Cache/PhpRedis.php deleted file mode 100644 index cb30d6055..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Cache/PhpRedis.php +++ /dev/null @@ -1,111 +0,0 @@ -client = $client; - $this->checksumProvider = $checksum_provider; - } - - /** - * {@inheritdoc} - */ - public function getMultiple(&$cids, $allow_invalid = FALSE) { - // Avoid an error when there are no cache ids. - if (empty($cids)) { - return []; - } - - $return = []; - - // Build the list of keys to fetch. - $keys = array_map([$this, 'getKey'], $cids); - - // Optimize for the common case when only a single cache entry needs to - // be fetched, no pipeline is needed then. - if (count($keys) > 1) { - $pipe = $this->client->multi(\Redis::PIPELINE); - foreach ($keys as $key) { - $pipe->hgetall($key); - } - $result = $pipe->exec(); - } - else { - $result = [$this->client->hGetAll(reset($keys))]; - } - - // Loop over the cid values to ensure numeric indexes. - foreach (array_values($cids) as $index => $key) { - // Check if a valid result was returned from Redis. - if (isset($result[$index]) && is_array($result[$index])) { - // Check expiration and invalidation and convert into an object. - $item = $this->expandEntry($result[$index], $allow_invalid); - if ($item) { - $return[$item->cid] = $item; - } - } - } - - // Remove fetched cids from the list. - $cids = array_diff($cids, array_keys($return)); - - return $return; - } - - /** - * {@inheritdoc} - */ - public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) { - - $ttl = $this->getExpiration($expire); - - $key = $this->getKey($cid); - - // If the item is already expired, delete it. - if ($ttl <= 0) { - $this->delete($key); - } - - // Build the cache item and save it as a hash array. - $entry = $this->createEntryHash($cid, $data, $expire, $tags); - $pipe = $this->client->multi(\REdis::PIPELINE); - $pipe->hMset($key, $entry); - $pipe->expire($key, $ttl); - $pipe->exec(); - } - - /** - * {@inheritdoc} - */ - public function deleteMultiple(array $cids) { - $keys = array_map([$this, 'getKey'], $cids); - $this->client->del($keys); - } - - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Cache/Predis.php b/sites/all/modules/contrib/dev/redis/src/Cache/Predis.php deleted file mode 100644 index 6ccd7817a..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Cache/Predis.php +++ /dev/null @@ -1,113 +0,0 @@ -client = $client; - $this->checksumProvider = $checksum_provider; - } - - /** - * {@inheritdoc} - */ - public function getMultiple(&$cids, $allow_invalid = FALSE) { - // Avoid an error when there are no cache ids. - if (empty($cids)) { - return []; - } - - $return = []; - - // Build the list of keys to fetch. - $keys = array_map([$this, 'getKey'], $cids); - - // Optimize for the common case when only a single cache entry needs to - // be fetched, no pipeline is needed then. - if (count($keys) > 1) { - $pipe = $this->client->pipeline(); - foreach ($keys as $key) { - $pipe->hgetall($key); - } - $result = $pipe->execute(); - } - else { - $result = [$this->client->hGetAll(reset($keys))]; - } - - // Loop over the cid values to ensure numeric indexes. - foreach (array_values($cids) as $index => $key) { - // Check if a valid result was returned from Redis. - if (isset($result[$index]) && is_array($result[$index])) { - // Check expiration and invalidation and convert into an object. - $item = $this->expandEntry($result[$index], $allow_invalid); - if ($item) { - $return[$item->cid] = $item; - } - } - } - - // Remove fetched cids from the list. - $cids = array_diff($cids, array_keys($return)); - - return $return; - } - - /** - * {@inheritdoc} - */ - public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) { - - $ttl = $this->getExpiration($expire); - - $key = $this->getKey($cid); - - // If the item is already expired, delete it. - if ($ttl <= 0) { - $this->delete($key); - } - - // Build the cache item and save it as a hash array. - $entry = $this->createEntryHash($cid, $data, $expire, $tags); - $pipe = $this->client->pipeline(); - $pipe->hmset($key, $entry); - $pipe->expire($key, $ttl); - $pipe->execute(); - } - - /** - * {@inheritdoc} - */ - public function deleteMultiple(array $cids) { - if (!empty($cids)) { - $keys = array_map([$this, 'getKey'], $cids); - $this->client->del($keys); - } - } - - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Cache/RedisCacheTagsChecksum.php b/sites/all/modules/contrib/dev/redis/src/Cache/RedisCacheTagsChecksum.php deleted file mode 100644 index 9992a2f50..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Cache/RedisCacheTagsChecksum.php +++ /dev/null @@ -1,150 +0,0 @@ -client = $factory->getClient(); - $this->clientType = $factory->getClientName(); - } - - /** - * {@inheritdoc} - */ - public function invalidateTags(array $tags) { - $keys_to_increment = []; - foreach ($tags as $tag) { - // Only invalidate tags once per request unless they are written again. - if (isset($this->invalidatedTags[$tag])) { - continue; - } - $this->invalidatedTags[$tag] = TRUE; - unset($this->tagCache[$tag]); - $keys_to_increment[] = $this->getTagKey($tag); - } - if ($keys_to_increment) { - - // We want to differentiate between PhpRedis and Redis clients. - if ($this->clientType === 'PhpRedis') { - $multi = $this->client->multi(\Redis::PIPELINE); - foreach ($keys_to_increment as $key) { - $multi->incr($key); - } - $multi->exec(); - } - elseif ($this->clientType === 'Predis') { - - $pipe = $this->client->pipeline(); - foreach ($keys_to_increment as $key) { - $pipe->incr($key); - } - $pipe->execute(); - } - } - - } - - /** - * {@inheritdoc} - */ - public function getCurrentChecksum(array $tags) { - // Remove tags that were already invalidated during this request from the - // static caches so that another invalidation can occur later in the same - // request. Without that, written cache items would not be invalidated - // correctly. - foreach ($tags as $tag) { - unset($this->invalidatedTags[$tag]); - } - return $this->calculateChecksum($tags); - } - - /** - * {@inheritdoc} - */ - public function isValid($checksum, array $tags) { - return $checksum == $this->calculateChecksum($tags); - } - - /** - * {@inheritdoc} - */ - public function calculateChecksum(array $tags) { - $checksum = 0; - - $fetch = array_values(array_diff($tags, array_keys($this->tagCache))); - if ($fetch) { - $keys = array_map([$this, 'getTagKey'], $fetch); - foreach ($this->client->mget($keys) as $index => $invalidations) { - $this->tagCache[$fetch[$index]] = $invalidations ?: 0; - } - } - - foreach ($tags as $tag) { - $checksum += $this->tagCache[$tag]; - } - - return $checksum; - } - - /** - * {@inheritdoc} - */ - public function reset() { - $this->tagCache = []; - $this->invalidatedTags = []; - } - - /** - * Return the key for the given cache tag. - * - * @param string $tag - * The cache tag. - * - * @return string - * The prefixed cache tag. - */ - protected function getTagKey($tag) { - return $this->getPrefix() . ':cachetags:' . $tag; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Client/PhpRedis.php b/sites/all/modules/contrib/dev/redis/src/Client/PhpRedis.php deleted file mode 100644 index 147d2c78d..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Client/PhpRedis.php +++ /dev/null @@ -1,97 +0,0 @@ -askForMaster($client, $host, $password); - if (is_array($ip_host)) { - list($host, $port) = $ip_host; - } - } - - $client->connect($host, $port); - - if (isset($password)) { - $client->auth($password); - } - - if (isset($base)) { - $client->select($base); - } - - // Do not allow PhpRedis serialize itself data, we are going to do it - // ourself. This will ensure less memory footprint on Redis size when - // we will attempt to store small values. - $client->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_NONE); - - return $client; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return 'PhpRedis'; - } - - /** - * Connect to sentinels to get Redis master instance. - * - * Just asking one sentinels after another until given the master location. - * More info about this mode at https://redis.io/topics/sentinel. - * - * @param \Redis $client - * The PhpRedis client. - * @param array $sentinels - * An array of the sentinels' ip:port. - * @param string $password - * An optional Sentinels' password. - * - * @return mixed - * An array with ip & port of the Master instance or NULL. - */ - protected function askForMaster(\Redis $client, array $sentinels = [], $password = NULL) { - - $ip_port = NULL; - $settings = Settings::get('redis.connection', []); - $settings += ['instance' => NULL]; - - if ($settings['instance']) { - foreach ($sentinels as $sentinel) { - list($host, $port) = explode(':', $sentinel); - // 0.5s timeout. - $client->connect($host, $port, 0.5); - - if (isset($password)) { - $client->auth($password); - } - - if ($client->isConnected()) { - $ip_port = $client->rawcommand('SENTINEL', 'get-master-addr-by-name', $settings['instance']); - if ($ip_port) { - break; - } - } - $client->close(); - } - } - return $ip_port; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Client/Predis.php b/sites/all/modules/contrib/dev/redis/src/Client/Predis.php deleted file mode 100644 index 747d73a46..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Client/Predis.php +++ /dev/null @@ -1,61 +0,0 @@ - $password, - 'host' => $host, - 'port' => $port, - 'database' => $base - ]; - - foreach ($connectionInfo as $key => $value) { - if (!isset($value)) { - unset($connectionInfo[$key]); - } - } - - // I'm not sure why but the error handler is driven crazy if timezone - // is not set at this point. - // Hopefully Drupal will restore the right one this once the current - // account has logged in. - date_default_timezone_set(@date_default_timezone_get()); - - // If we are passed in an array of $replicationHosts, we should attempt a clustered client connection. - if ($replicationHosts !== NULL) { - $parameters = []; - - foreach ($replicationHosts as $replicationHost) { - // Configure master. - if ($replicationHost['role'] === 'primary') { - $parameters[] = 'tcp://' . $replicationHost['host'] . ':' . $replicationHost['port'] . '?alias=master'; - } - else { - $parameters[] = 'tcp://' . $replicationHost['host'] . ':' . $replicationHost['port']; - } - } - - $options = ['replication' => true]; - $client = new Client($parameters, $options); - } - else { - $client = new Client($connectionInfo); - } - return $client; - - } - - public function getName() { - return 'Predis'; - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/ClientFactory.php b/sites/all/modules/contrib/dev/redis/src/ClientFactory.php deleted file mode 100644 index cddabd96e..000000000 --- a/sites/all/modules/contrib/dev/redis/src/ClientFactory.php +++ /dev/null @@ -1,215 +0,0 @@ -getName(); - } - - /** - * Get client singleton. - */ - public static function getClient() { - if (!isset(self::$_client)) { - $settings = Settings::get('redis.connection', []); - $settings += [ - 'host' => self::REDIS_DEFAULT_HOST, - 'port' => self::REDIS_DEFAULT_PORT, - 'base' => self::REDIS_DEFAULT_BASE, - 'password' => self::REDIS_DEFAULT_PASSWORD, - ]; - - // If using replication, lets create the client appropriately. - if (isset($settings['replication']) && $settings['replication'] === TRUE) { - foreach ($settings['replication.host'] as $key => $replicationHost) { - if (!isset($replicationHost['port'])) { - $settings['replication.host'][$key]['port'] = self::REDIS_DEFAULT_PORT; - } - } - - self::$_client = self::getClientInterface()->getClient( - $settings['host'], - $settings['port'], - $settings['base'], - $settings['password'], - $settings['replication.host']); - } - else { - self::$_client = self::getClientInterface()->getClient( - $settings['host'], - $settings['port'], - $settings['base'], - $settings['password']); - } - } - - return self::$_client; - } - - /** - * Get specific class implementing the current client usage for the specific - * asked core subsystem. - * - * @param string $system - * One of the ClientFactory::IMPL_* constant. - * @param string $clientName - * Client name, if fixed. - * - * @return string - * Class name, if found. - * - * @throws \Exception - * If not found. - */ - public static function getClass($system, $clientName = NULL) { - $className = $system . ($clientName ?: self::getClientName()); - - if (!class_exists($className)) { - throw new \Exception($className . " does not exists"); - } - - return $className; - } - - /** - * For unit testing only reset internals. - */ - static public function reset() { - self::$_clientInterface = null; - self::$_client = null; - } -} - diff --git a/sites/all/modules/contrib/dev/redis/src/ClientInterface.php b/sites/all/modules/contrib/dev/redis/src/ClientInterface.php deleted file mode 100644 index 982dd75cf..000000000 --- a/sites/all/modules/contrib/dev/redis/src/ClientInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -clientFactory = $client_factory; - $this->requestStack = $request_stack; - } - - /** - * Get actual flood backend. - * - * @return \Drupal\Core\Flood\FloodInterface - * Return flood instance. - */ - public function get() { - $class_name = $this->clientFactory->getClass(ClientFactory::REDIS_IMPL_FLOOD); - return new $class_name($this->clientFactory, $this->requestStack); - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Flood/PhpRedis.php b/sites/all/modules/contrib/dev/redis/src/Flood/PhpRedis.php deleted file mode 100644 index 06a36047c..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Flood/PhpRedis.php +++ /dev/null @@ -1,95 +0,0 @@ -client = $client_factory->getClient(); - $this->requestStack = $request_stack; - } - - /** - * {@inheritdoc} - */ - public function register($name, $window = 3600, $identifier = NULL) { - if (!isset($identifier)) { - $identifier = $this->requestStack->getCurrentRequest()->getClientIp(); - } - - $key = $this->getPrefix() . ':flood:' . $name . ':' . $identifier; - - // Add a key for the event to the sorted set, the score is timestamp, so we - // can count them easily. - $this->client->zAdd($key, $_SERVER['REQUEST_TIME'] + $window, microtime(TRUE)); - // Set or update the expiration for the sorted set, it will be removed if - // the newest entry expired. - $this->client->expire($key, $_SERVER['REQUEST_TIME'] + $window); - } - - /** - * {@inheritdoc} - */ - public function clear($name, $identifier = NULL) { - if (!isset($identifier)) { - $identifier = $this->requestStack->getCurrentRequest()->getClientIp(); - } - - $key = $this->getPrefix() . ':flood:' . $name . ':' . $identifier; - $this->client->del($key); - } - - /** - * {@inheritdoc} - */ - public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL) { - if (!isset($identifier)) { - $identifier = $this->requestStack->getCurrentRequest()->getClientIp(); - } - - $key = $this->getPrefix() . ':flood:' . $name . ':' . $identifier; - - // Count the in the last $window seconds. - $number = $this->client->zCount($key, $_SERVER['REQUEST_TIME'], 'inf'); - return ($number < $threshold); - } - - /** - * {@inheritdoc} - */ - public function garbageCollection() { - // No garbage collection necessary. - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Flood/Predis.php b/sites/all/modules/contrib/dev/redis/src/Flood/Predis.php deleted file mode 100644 index de28b0496..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Flood/Predis.php +++ /dev/null @@ -1,95 +0,0 @@ -client = $client_factory->getClient(); - $this->requestStack = $request_stack; - } - - /** - * {@inheritdoc} - */ - public function register($name, $window = 3600, $identifier = NULL) { - if (!isset($identifier)) { - $identifier = $this->requestStack->getCurrentRequest()->getClientIp(); - } - - $key = $this->getPrefix() . ':flood:' . $name . ':' . $identifier; - - // Add a key for the event to the sorted set, the score is timestamp, so we - // can count them easily. - $this->client->zAdd($key, $_SERVER['REQUEST_TIME'] + $window, microtime(TRUE)); - // Set or update the expiration for the sorted set, it will be removed if - // the newest entry expired. - $this->client->expire($key, $_SERVER['REQUEST_TIME'] + $window); - } - - /** - * {@inheritdoc} - */ - public function clear($name, $identifier = NULL) { - if (!isset($identifier)) { - $identifier = $this->requestStack->getCurrentRequest()->getClientIp(); - } - - $key = $this->getPrefix() . ':flood:' . $name . ':' . $identifier; - $this->client->del($key); - } - - /** - * {@inheritdoc} - */ - public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL) { - if (!isset($identifier)) { - $identifier = $this->requestStack->getCurrentRequest()->getClientIp(); - } - - $key = $this->getPrefix() . ':flood:' . $name . ':' . $identifier; - - // Count the in the last $window seconds. - $number = $this->client->zCount($key, $_SERVER['REQUEST_TIME'], 'inf'); - return ($number < $threshold); - } - - /** - * {@inheritdoc} - */ - public function garbageCollection() { - // No garbage collection necessary. - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Lock/LockFactory.php b/sites/all/modules/contrib/dev/redis/src/Lock/LockFactory.php deleted file mode 100644 index 6e8c8b184..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Lock/LockFactory.php +++ /dev/null @@ -1,37 +0,0 @@ -clientFactory = $client_factory; - } - - /** - * Get actual lock backend. - * - * @param bool $persistent - * (optional) Whether to return a persistent lock implementation or not. - * - * @return \Drupal\Core\Lock\LockBackendInterface - * Return lock backend instance. - */ - public function get($persistent = FALSE) { - $class_name = $this->clientFactory->getClass($persistent ? ClientFactory::REDIS_IMPL_PERSISTENT_LOCK : ClientFactory::REDIS_IMPL_LOCK); - return new $class_name($this->clientFactory); - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Lock/PhpRedis.php b/sites/all/modules/contrib/dev/redis/src/Lock/PhpRedis.php deleted file mode 100644 index 593875a8d..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Lock/PhpRedis.php +++ /dev/null @@ -1,144 +0,0 @@ -client = $factory->getClient(); - // __destruct() is causing problems with garbage collections, register a - // shutdown function instead. - drupal_register_shutdown_function([$this, 'releaseAll']); - } - - /** - * Generate a redis key name for the current lock name. - * - * @param string $name - * Lock name. - * - * @return string - * The redis key for the given lock. - */ - protected function getKey($name) { - return $this->getPrefix() . ':lock:' . $name; - } - - /** - * {@inheritdoc} - */ - public function acquire($name, $timeout = 30.0) { - $key = $this->getKey($name); - $id = $this->getLockId(); - - // Insure that the timeout is at least 1 ms. - $timeout = max($timeout, 0.001); - - // If we already have the lock, check for his owner and attempt a new EXPIRE - // command on it. - if (isset($this->locks[$name])) { - - // Create a new transaction, for atomicity. - $this->client->watch($key); - - // Global tells us we are the owner, but in real life it could have expired - // and another process could have taken it, check that. - if ($this->client->get($key) != $id) { - // Explicit UNWATCH we are not going to run the MULTI/EXEC block. - $this->client->unwatch(); - unset($this->locks[$name]); - return FALSE; - } - - $result = $this->client->multi() - ->psetex($key, (int) ($timeout * 1000), $id) - ->exec(); - - // If the set failed, someone else wrote the key, we failed to acquire - // the lock. - if (FALSE === $result) { - unset($this->locks[$name]); - // Explicit transaction release which also frees the WATCH'ed key. - $this->client->discard(); - return FALSE; - } - - return ($this->locks[$name] = TRUE); - } - else { - // Use a SET with microsecond expiration and the NX flag, which will only - // succeed if the key does not exist yet. - $result = $this->client->set($key, $id, ['nx', 'px' => (int) ($timeout * 1000)]); - - // If the result is FALSE, we failed to acquire the lock. - if (FALSE === $result) { - return FALSE; - } - - // Register the lock. - return ($this->locks[$name] = TRUE); - } - } - - /** - * {@inheritdoc} - */ - public function lockMayBeAvailable($name) { - $key = $this->getKey($name); - $value = $this->client->get($key); - - return $value === FALSE || $value === NULL; - } - - /** - * {@inheritdoc} - */ - public function release($name) { - $key = $this->getKey($name); - $id = $this->getLockId(); - - unset($this->locks[$name]); - - // Ensure the lock deletion is an atomic transaction. If another thread - // manages to removes all lock, we can not alter it anymore else we will - // release the lock for the other thread and cause race conditions. - $this->client->watch($key); - - if ($this->client->get($key) == $id) { - $this->client->multi(); - $this->client->delete($key); - $this->client->exec(); - } - else { - $this->client->unwatch(); - } - } - - /** - * {@inheritdoc} - */ - public function releaseAll($lock_id = NULL) { - // We can afford to deal with a slow algorithm here, this should not happen - // on normal run because we should have removed manually all our locks. - foreach ($this->locks as $name => $foo) { - $this->release($name); - } - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Lock/Predis.php b/sites/all/modules/contrib/dev/redis/src/Lock/Predis.php deleted file mode 100644 index 01d183062..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Lock/Predis.php +++ /dev/null @@ -1,133 +0,0 @@ -client = $factory->getClient(); - // __destruct() is causing problems with garbage collections, register a - // shutdown function instead. - drupal_register_shutdown_function([$this, 'releaseAll']); - } - - /** - * Generate a redis key name for the current lock name. - * - * @param string $name - * Lock name. - * - * @return string - * The redis key for the given lock. - */ - protected function getKey($name) { - return $this->getPrefix() . ':lock:' . $name; - } - - public function acquire($name, $timeout = 30.0) { - $key = $this->getKey($name); - $id = $this->getLockId(); - - // Insure that the timeout is at least 1 ms. - $timeout = max($timeout, 0.001); - - // If we already have the lock, check for his owner and attempt a new EXPIRE - // command on it. - if (isset($this->locks[$name])) { - - // Create a new transaction, for atomicity. - $this->client->watch($key); - - // Global tells us we are the owner, but in real life it could have expired - // and another process could have taken it, check that. - if ($this->client->get($key) != $id) { - // Explicit UNWATCH we are not going to run the MULTI/EXEC block. - $this->client->unwatch(); - unset($this->locks[$name]); - return FALSE; - } - - $result = $this->client->pipeline() - ->psetex($key, (int) ($timeout * 1000), $id) - ->exec(); - - // If the set failed, someone else wrote the key, we failed to acquire - // the lock. - if (FALSE === $result) { - unset($this->locks[$name]); - // Explicit transaction release which also frees the WATCH'ed key. - $this->client->discard(); - return FALSE; - } - - return ($this->locks[$name] = TRUE); - } - else { - // Use a SET with microsecond expiration and the NX flag, which will only - // succeed if the key does not exist yet. - $result = $this->client->set($key, $id, 'nx', 'px', (int) ($timeout * 1000)); - - // If the result is FALSE or NULL, we failed to acquire the lock. - if (FALSE === $result || NULL === $result) { - return FALSE; - } - - // Register the lock. - return ($this->locks[$name] = TRUE); - } - } - - public function lockMayBeAvailable($name) { - $key = $this->getKey($name); - $value = $this->client->get($key); - - return $value === FALSE || $value === NULL; - } - - public function release($name) { - $key = $this->getKey($name); - $id = $this->getLockId(); - - unset($this->locks[$name]); - - // Ensure the lock deletion is an atomic transaction. If another thread - // manages to removes all lock, we can not alter it anymore else we will - // release the lock for the other thread and cause race conditions. - $this->client->watch($key); - - if ($this->client->get($key) == $id) { - $pipe = $this->client->pipeline(); - $pipe->del([$key]); - $pipe->execute(); - } - else { - $this->client->unwatch(); - } - } - - public function releaseAll($lock_id = NULL) { - // We can afford to deal with a slow algorithm here, this should not happen - // on normal run because we should have removed manually all our locks. - foreach ($this->locks as $name => $foo) { - $this->release($name); - } - } -} - diff --git a/sites/all/modules/contrib/dev/redis/src/PersistentLock/PhpRedis.php b/sites/all/modules/contrib/dev/redis/src/PersistentLock/PhpRedis.php deleted file mode 100644 index 9805f7236..000000000 --- a/sites/all/modules/contrib/dev/redis/src/PersistentLock/PhpRedis.php +++ /dev/null @@ -1,26 +0,0 @@ -client = $factory->getClient(); - // Set the lockId to a fixed string to make the lock ID the same across - // multiple requests. The lock ID is used as a page token to relate all the - // locks set during a request to each other. - // @see \Drupal\Core\Lock\LockBackendInterface::getLockId() - $this->lockId = 'persistent'; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/PersistentLock/Predis.php b/sites/all/modules/contrib/dev/redis/src/PersistentLock/Predis.php deleted file mode 100644 index 79252e77e..000000000 --- a/sites/all/modules/contrib/dev/redis/src/PersistentLock/Predis.php +++ /dev/null @@ -1,26 +0,0 @@ -client = $factory->getClient(); - // Set the lockId to a fixed string to make the lock ID the same across - // multiple requests. The lock ID is used as a page token to relate all the - // locks set during a request to each other. - // @see \Drupal\Core\Lock\LockBackendInterface::getLockId() - $this->lockId = 'persistent'; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/PhpRedis.php b/sites/all/modules/contrib/dev/redis/src/Queue/PhpRedis.php deleted file mode 100644 index 530be0dfb..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/PhpRedis.php +++ /dev/null @@ -1,148 +0,0 @@ -client = $client; - } - - /** - * {@inheritdoc} - */ - public function createItem($data) { - $record = new \stdClass(); - $record->data = $data; - $record->qid = $this->incrementId(); - // We cannot rely on REQUEST_TIME because many items might be created - // by a single request which takes longer than 1 second. - $record->timestamp = time(); - - if (!$this->client->hsetnx($this->availableItems, $record->qid, serialize($record))) { - return FALSE; - } - - $start_len = $this->client->lLen($this->availableListKey); - if ($start_len < $this->client->lpush($this->availableListKey, $record->qid)) { - return $record->qid; - } - - return FALSE; - } - - /** - * Gets next serial ID for Redis queue items. - * - * @return int - * Next serial ID for Redis queue item. - */ - protected function incrementId() { - return $this->client->incr($this->incrementCounterKey); - } - - /** - * {@inheritdoc} - */ - public function numberOfItems() { - return $this->client->lLen($this->availableListKey); - } - - /** - * {@inheritdoc} - */ - public function claimItem($lease_time = 30) { - // Is it OK to do garbage collection here (we need to loop list of claimed - // items)? - $this->garbageCollection(); - $item = FALSE; - - if ($this->reserveTimeout !== NULL) { - // A blocking version of claimItem to be used with long-running queue workers. - $qid = $this->client->brpoplpush($this->availableListKey, $this->claimedListKey, $this->reserveTimeout); - } - else { - $qid = $this->client->rpoplpush($this->availableListKey, $this->claimedListKey); - } - - if ($qid) { - $job = $this->client->hget($this->availableItems, $qid); - if ($job) { - $item = unserialize($job); - $this->client->setex($this->leasedKeyPrefix . $item->qid, $lease_time, '1'); - } - } - - return $item; - } - - /** - * {@inheritdoc} - */ - public function releaseItem($item) { - $this->client->lrem($this->claimedListKey, $item->qid, -1); - $this->client->lpush($this->availableListKey, $item->qid); - } - - /** - * {@inheritdoc} - */ - public function deleteItem($item) { - $this->client->lrem($this->claimedListKey, $item->qid, -1); - $this->client->hdel($this->availableItems, $item->qid); - } - - /** - * {@inheritdoc} - */ - public function deleteQueue() { - $keys_to_remove = [ - $this->claimedListKey, - $this->availableListKey, - $this->availableItems, - $this->incrementCounterKey - ]; - - foreach ($this->client->keys($this->leasedKeyPrefix . '*') as $key) { - $keys_to_remove[] = $key; - } - - $this->client->del($keys_to_remove); - } - - /** - * Automatically release items, that have been claimed and exceeded lease time. - */ - protected function garbageCollection() { - foreach ($this->client->lrange($this->claimedListKey, 0, -1) as $qid) { - if (!$this->client->exists($this->leasedKeyPrefix . $qid)) { - // The lease expired for this ID. - $this->client->lrem($this->claimedListKey, $qid, -1); - $this->client->lpush($this->availableListKey, $qid); - } - } - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/Predis.php b/sites/all/modules/contrib/dev/redis/src/Queue/Predis.php deleted file mode 100644 index 4eec38e8c..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/Predis.php +++ /dev/null @@ -1,152 +0,0 @@ -client = $client; - } - - /** - * {@inheritdoc} - */ - public function createItem($data) { - // TODO: Fixme - $record = new \stdClass(); - $record->data = $data; - $record->qid = $this->incrementId(); - // We cannot rely on REQUEST_TIME because many items might be created - // by a single request which takes longer than 1 second. - $record->timestamp = time(); - - if (!$this->client->hsetnx($this->availableItems, $record->qid, serialize($record))) { - return FALSE; - } - - $start_len = $this->client->lLen($this->availableListKey); - if ($start_len < $this->client->lpush($this->availableListKey, $record->qid)) { - return $record->qid; - } - } - - /** - * Gets next serial ID for Redis queue items. - * - * @return int - * Next serial ID for Redis queue item. - */ - protected function incrementId() { - // TODO: Fixme - return $this->client->incr($this->incrementCounterKey); - } - - /** - * {@inheritdoc} - */ - public function numberOfItems() { - // TODO: Fixme - return $this->client->lLen($this->availableListKey); - } - - /** - * {@inheritdoc} - */ - public function claimItem($lease_time = 30) { - // Is it OK to do garbage collection here (we need to loop list of claimed - // items)? - $this->garbageCollection(); - $item = FALSE; - - if ($this->reserveTimeout !== NULL) { - // A blocking version of claimItem to be used with long-running queue workers. - $qid = $this->client->brpoplpush($this->availableListKey, $this->claimedListKey, $this->reserveTimeout); - } - else { - $qid = $this->client->rpoplpush($this->availableListKey, $this->claimedListKey); - } - - if ($qid) { - $job = $this->client->hget($this->availableItems, $qid); - if ($job) { - $item = unserialize($job); - $this->client->setex($this->leasedKeyPrefix . $item->qid, $lease_time, '1'); - } - } - - return $item; - } - - /** - * {@inheritdoc} - */ - public function releaseItem($item) { - // TODO: Fixme - $this->client->lrem($this->claimedListKey, $item->qid, -1); - $this->client->lpush($this->availableListKey, $item->qid); - } - - /** - * {@inheritdoc} - */ - public function deleteItem($item) { - // TODO: Fixme - $this->client->lrem($this->claimedListKey, $item->qid, -1); - $this->client->hdel($this->availableItems, $item->qid); - } - - /** - * {@inheritdoc} - */ - public function deleteQueue() { - // TODO: Fixme - $keys_to_remove = [ - $this->claimedListKey, - $this->availableListKey, - $this->availableItems, - $this->incrementCounterKey - ]; - - foreach ($this->client->keys($this->leasedKeyPrefix . '*') as $key) { - $keys_to_remove[] = $key; - } - - $this->client->del($keys_to_remove); - } - - /** - * Automatically release items, that have been claimed and exceeded lease time. - */ - protected function garbageCollection() { - foreach ($this->client->lrange($this->claimedListKey, 0, -1) as $qid) { - if (!$this->client->exists($this->leasedKeyPrefix . $qid)) { - // The lease expired for this ID. - $this->client->lrem($this->claimedListKey, $qid, -1); - $this->client->lpush($this->availableListKey, $qid); - } - } - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/QueueBase.php b/sites/all/modules/contrib/dev/redis/src/Queue/QueueBase.php deleted file mode 100644 index a09148e0c..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/QueueBase.php +++ /dev/null @@ -1,96 +0,0 @@ -name = $name; - $this->reserveTimeout = $settings['reserve_timeout']; - $this->availableListKey = static::KEY_PREFIX . $name . ':avail'; - $this->availableItems = static::KEY_PREFIX . $name . ':items'; - $this->claimedListKey = static::KEY_PREFIX . $name . ':claimed'; - $this->leasedKeyPrefix = static::KEY_PREFIX . $name . ':lease:'; - $this->incrementCounterKey = static::KEY_PREFIX . $name . ':counter'; - } - - /** - * {@inheritdoc} - */ - public function createQueue() { - // Nothing to do here. - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/QueueRedisFactory.php b/sites/all/modules/contrib/dev/redis/src/Queue/QueueRedisFactory.php deleted file mode 100644 index aabc1b79f..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/QueueRedisFactory.php +++ /dev/null @@ -1,56 +0,0 @@ -clientFactory = $client_factory; - $this->settings = $settings; - } - - /** - * Constructs a new queue object for a given name. - * - * @param string $name - * The name of the collection holding key and value pairs. - * - * @return \Drupal\Core\Queue\DatabaseQueue - * A key/value store implementation for the given $collection. - */ - public function get($name) { - $settings = $this->settings->get('redis_queue_' . $name, ['reserve_timeout' => NULL]); - $class_name = $this->clientFactory->getClass(static::CLASS_NAMESPACE); - return new $class_name($name, $settings, $this->clientFactory->getClient()); - } - -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/ReliablePhpRedis.php b/sites/all/modules/contrib/dev/redis/src/Queue/ReliablePhpRedis.php deleted file mode 100644 index 76eb17810..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/ReliablePhpRedis.php +++ /dev/null @@ -1,153 +0,0 @@ -client = $client; - } - - /** - * {@inheritdoc} - */ - public function createItem($data) { - $record = new \stdClass(); - $record->data = $data; - $record->qid = $this->incrementId(); - // We cannot rely on REQUEST_TIME because many items might be created - // by a single request which takes longer than 1 second. - $record->timestamp = time(); - - $result = $this->client->multi() - ->hsetnx($this->availableItems, $record->qid, serialize($record)) - ->lLen($this->availableListKey) - ->lpush($this->availableListKey, $record->qid) - ->exec(); - - $success = $result[0] && $result[2] > $result[1]; - - return $success ? $record->qid : FALSE; - } - - /** - * Gets next serial ID for Redis queue items. - * - * @return int - * Next serial ID for Redis queue item. - */ - protected function incrementId() { - return $this->client->incr($this->incrementCounterKey); - } - - /** - * {@inheritdoc} - */ - public function numberOfItems() { - return $this->client->lLen($this->availableListKey); - } - - /** - * {@inheritdoc} - */ - public function claimItem($lease_time = 30) { - // Is it OK to do garbage collection here (we need to loop list of claimed - // items)? - $this->garbageCollection(); - $item = FALSE; - - if ($this->reserveTimeout !== NULL) { - // A blocking version of claimItem to be used with long-running queue workers. - $qid = $this->client->brpoplpush($this->availableListKey, $this->claimedListKey, $this->reserveTimeout); - } - else { - $qid = $this->client->rpoplpush($this->availableListKey, $this->claimedListKey); - } - - if ($qid) { - $job = $this->client->hget($this->availableItems, $qid); - if ($job) { - $item = unserialize($job); - $this->client->setex($this->leasedKeyPrefix . $item->qid, $lease_time, '1'); - } - } - - return $item; - } - - /** - * {@inheritdoc} - */ - public function releaseItem($item) { - $this->client->multi() - ->lrem($this->claimedListKey, $item->qid, -1) - ->lpush($this->availableListKey, $item->qid) - ->exec(); - } - - /** - * {@inheritdoc} - */ - public function deleteItem($item) { - $this->client->multi() - ->lrem($this->claimedListKey, $item->qid, -1) - ->hdel($this->availableItems, $item->qid) - ->exec(); - } - - /** - * {@inheritdoc} - */ - public function deleteQueue() { - $keys_to_remove = [ - $this->claimedListKey, - $this->availableListKey, - $this->availableItems, - $this->incrementCounterKey - ]; - - foreach ($this->client->keys($this->leasedKeyPrefix . '*') as $key) { - $keys_to_remove[] = $key; - } - - $this->client->del($keys_to_remove); - } - - /** - * Automatically release items, that have been claimed and exceeded lease time. - */ - protected function garbageCollection() { - foreach ($this->client->lrange($this->claimedListKey, 0, -1) as $qid) { - if (!$this->client->exists($this->leasedKeyPrefix . $qid)) { - // The lease expired for this ID. - $this->client->multi() - ->lrem($this->claimedListKey, $qid, -1) - ->lpush($this->availableListKey, $qid) - ->exec(); - } - } - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/ReliablePredis.php b/sites/all/modules/contrib/dev/redis/src/Queue/ReliablePredis.php deleted file mode 100644 index 7458b745b..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/ReliablePredis.php +++ /dev/null @@ -1,156 +0,0 @@ -client = $client; - } - - /** - * {@inheritdoc} - */ - public function createItem($data) { - $record = new \stdClass(); - $record->data = $data; - $record->qid = $this->incrementId(); - // We cannot rely on REQUEST_TIME because many items might be created - // by a single request which takes longer than 1 second. - $record->timestamp = time(); - - $pipe = $this->client->pipeline(); - $pipe->hsetnx($this->availableItems, $record->qid, serialize($record)); - $pipe->lLen($this->availableListKey); - $pipe->lpush($this->availableListKey, $record->qid); - $result = $pipe->execute(); - - $success = $result[0] && $result[2] > $result[1]; - - return $success ? $record->qid : FALSE; - } - - /** - * Gets next serial ID for Redis queue items. - * - * @return int - * Next serial ID for Redis queue item. - */ - protected function incrementId() { - // TODO: Fixme - return $this->client->incr($this->incrementCounterKey); - } - - /** - * {@inheritdoc} - */ - public function numberOfItems() { - // TODO: Fixme - return $this->client->lLen($this->availableListKey); - } - - /** - * {@inheritdoc} - */ - public function claimItem($lease_time = 30) { - // Is it OK to do garbage collection here (we need to loop list of claimed - // items)? - $this->garbageCollection(); - $item = FALSE; - - if ($this->reserveTimeout !== NULL) { - // A blocking version of claimItem to be used with long-running queue workers. - $qid = $this->client->brpoplpush($this->availableListKey, $this->claimedListKey, $this->reserveTimeout); - } - else { - $qid = $this->client->rpoplpush($this->availableListKey, $this->claimedListKey); - } - - if ($qid) { - $job = $this->client->hget($this->availableItems, $qid); - if ($job) { - $item = unserialize($job); - $this->client->setex($this->leasedKeyPrefix . $item->qid, $lease_time, '1'); - } - } - - return $item; - } - - /** - * {@inheritdoc} - */ - public function releaseItem($item) { - // TODO: Fixme - $this->client->pipeline() - ->lrem($this->claimedListKey, $item->qid, -1) - ->lpush($this->availableListKey, $item->qid) - ->exec(); - } - - /** - * {@inheritdoc} - */ - public function deleteItem($item) { - // TODO: Fixme - $this->client->pipeline() - ->lrem($this->claimedListKey, $item->qid, -1) - ->hdel($this->availableItems, $item->qid) - ->exec(); - } - - /** - * {@inheritdoc} - */ - public function deleteQueue() { - // TODO: Fixme - $keys_to_remove = [ - $this->claimedListKey, - $this->availableListKey, - $this->availableItems, - $this->incrementCounterKey - ]; - - foreach ($this->client->keys($this->leasedKeyPrefix . '*') as $key) { - $keys_to_remove[] = $key; - } - - $this->client->del($keys_to_remove); - } - - /** - * Automatically release items, that have been claimed and exceeded lease time. - */ - protected function garbageCollection() { - foreach ($this->client->lrange($this->claimedListKey, 0, -1) as $qid) { - if (!$this->client->exists($this->leasedKeyPrefix . $qid)) { - // The lease expired for this ID. - $this->client->lrem($this->claimedListKey, $qid, -1); - $this->client->lpush($this->availableListKey, $qid); - } - } - } -} diff --git a/sites/all/modules/contrib/dev/redis/src/Queue/ReliableQueueBase.php b/sites/all/modules/contrib/dev/redis/src/Queue/ReliableQueueBase.php deleted file mode 100644 index f8caba2a0..000000000 --- a/sites/all/modules/contrib/dev/redis/src/Queue/ReliableQueueBase.php +++ /dev/null @@ -1,14 +0,0 @@ -prefix = $prefix; - } - - /** - * Get prefix - * - * @return string - */ - protected function getPrefix() { - if (!isset($this->prefix)) { - $this->prefix = $this->getDefaultPrefix(); - } - return $this->prefix; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Functional/Lock/RedisLockFunctionalTest.php b/sites/all/modules/contrib/dev/redis/tests/src/Functional/Lock/RedisLockFunctionalTest.php deleted file mode 100644 index 14f38157e..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Functional/Lock/RedisLockFunctionalTest.php +++ /dev/null @@ -1,89 +0,0 @@ -siteDirectory . '/settings.php'; - chmod($filename, 0666); - $contents = file_get_contents($filename); - $redis_interface = self::getRedisInterfaceEnv(); - $module_path = drupal_get_path('module', 'redis'); - $contents .= "\n\n" . "\$settings['container_yamls'][] = '$module_path/example.services.yml';"; - $contents .= "\n\n" . '$settings["redis.connection"]["interface"] = \'' . $redis_interface . '\';'; - file_put_contents($filename, $contents); - $settings = Settings::getAll(); - $settings['container_yamls'][] = $module_path . '/example.services.yml'; - $settings['redis.connection']['interface'] = $redis_interface; - new Settings($settings); - OpCodeCache::invalidate(DRUPAL_ROOT . '/' . $filename); - - $this->rebuildContainer(); - - // Get database schema. - $db_schema = Database::getConnection()->schema(); - // Make sure that the semaphore table isn't used. - $db_schema->dropTable('semaphore'); - } - - /** - * {@inheritdoc} - */ - public function testLockAcquire() { - $redis_interface = self::getRedisInterfaceEnv(); - $lock = $this->container->get('lock'); - $this->assertInstanceOf('\Drupal\redis\Lock\\' . $redis_interface, $lock); - - // Verify that a lock that has never been acquired is marked as available. - // @todo Remove this line when #3002640 lands. - // @see https://www.drupal.org/project/drupal/issues/3002640 - $this->assertTrue($lock->lockMayBeAvailable('system_test_lock_acquire')); - - parent::testLockAcquire(); - } - - /** - * {@inheritdoc} - */ - public function testPersistentLock() { - $redis_interface = self::getRedisInterfaceEnv(); - $persistent_lock = $this->container->get('lock.persistent'); - $this->assertInstanceOf('\Drupal\redis\PersistentLock\\' . $redis_interface, $persistent_lock); - - // Verify that a lock that has never been acquired is marked as available. - // @todo Remove this line when #3002640 lands. - // @see https://www.drupal.org/project/drupal/issues/3002640 - $this->assertTrue($persistent_lock->lockMayBeAvailable('lock1')); - - parent::testPersistentLock(); - } - -} diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Functional/WebTest.php b/sites/all/modules/contrib/dev/redis/tests/src/Functional/WebTest.php deleted file mode 100644 index e49dfa347..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Functional/WebTest.php +++ /dev/null @@ -1,192 +0,0 @@ -drupalPlaceBlock('system_breadcrumb_block'); - $this->drupalPlaceBlock('local_tasks_block'); - - // Set in-memory settings. - $settings = Settings::getAll(); - - // Get REDIS_INTERFACE env variable. - $redis_interface = self::getRedisInterfaceEnv(); - $settings['redis.connection']['interface'] = $redis_interface; - - $settings['cache'] = [ - 'default' => 'cache.backend.redis', - ]; - - $settings['container_yamls'][] = drupal_get_path('module', 'redis') . '/example.services.yml'; - - $settings['bootstrap_container_definition'] = [ - 'parameters' => [], - 'services' => [ - 'redis.factory' => [ - 'class' => 'Drupal\redis\ClientFactory', - ], - 'cache.backend.redis' => [ - 'class' => 'Drupal\redis\Cache\CacheBackendFactory', - 'arguments' => ['@redis.factory', '@cache_tags_provider.container', '@serialization.phpserialize'], - ], - 'cache.container' => [ - 'class' => '\Drupal\redis\Cache\PhpRedis', - 'factory' => ['@cache.backend.redis', 'get'], - 'arguments' => ['container'], - ], - 'cache_tags_provider.container' => [ - 'class' => 'Drupal\redis\Cache\RedisCacheTagsChecksum', - 'arguments' => ['@redis.factory'], - ], - 'serialization.phpserialize' => [ - 'class' => 'Drupal\Component\Serialization\PhpSerialize', - ], - ], - ]; - new Settings($settings); - - // Write the containers_yaml update by hand, since writeSettings() doesn't - // support some of the definitions. - $filename = $this->siteDirectory . '/settings.php'; - chmod($filename, 0666); - $contents = file_get_contents($filename); - - // Add the container_yaml and cache definition. - $contents .= "\n\n" . '$settings["container_yamls"][] = "' . drupal_get_path('module', 'redis') . '/example.services.yml";'; - $contents .= "\n\n" . '$settings["cache"] = ' . var_export($settings['cache'], TRUE) . ';'; - - // Add the classloader. - $contents .= "\n\n" . '$class_loader->addPsr4(\'Drupal\\\\redis\\\\\', \'' . drupal_get_path('module', 'redis') . '/src\');'; - - // Add the bootstrap container definition. - $contents .= "\n\n" . '$settings["bootstrap_container_definition"] = ' . var_export($settings['bootstrap_container_definition'], TRUE) . ';'; - - file_put_contents($filename, $contents); - OpCodeCache::invalidate(DRUPAL_ROOT . '/' . $filename); - - // Reset the cache factory. - $this->container->set('cache.factory', NULL); - $this->rebuildContainer(); - - // Get database schema. - $db_schema = Database::getConnection()->schema(); - - // Make sure that the cache and lock tables aren't used. - $db_schema->dropTable('cache_default'); - $db_schema->dropTable('cache_render'); - $db_schema->dropTable('cache_config'); - $db_schema->dropTable('cache_container'); - $db_schema->dropTable('cachetags'); - $db_schema->dropTable('semaphore'); - $db_schema->dropTable('flood'); - } - - /** - * Tests enabling modules and creating configuration. - */ - public function testModuleInstallation() { - $admin_user = $this->createUser([], NULL, TRUE); - $this->drupalLogin($admin_user); - - // Enable a few modules. - $edit["modules[node][enable]"] = TRUE; - $edit["modules[views][enable]"] = TRUE; - $edit["modules[field_ui][enable]"] = TRUE; - $edit["modules[text][enable]"] = TRUE; - $this->drupalPostForm('admin/modules', $edit, t('Install')); - $this->drupalPostForm(NULL, [], t('Continue')); - - $assert = $this->assertSession(); - - // The order of the modules is not guaranteed, so just assert that they are - // all listed. - $assert->elementTextContains('css', '.messages--status', '6 modules have been enabled'); - $assert->elementTextContains('css', '.messages--status', 'Field UI'); - $assert->elementTextContains('css', '.messages--status', 'Node'); - $assert->elementTextContains('css', '.messages--status', 'Text'); - $assert->elementTextContains('css', '.messages--status', 'Views'); - $assert->elementTextContains('css', '.messages--status', 'Field'); - $assert->elementTextContains('css', '.messages--status', 'Filter'); - $assert->checkboxChecked('edit-modules-field-ui-enable'); - - // Create a node type with a field. - $edit = [ - 'name' => $this->randomString(), - 'type' => $node_type = mb_strtolower($this->randomMachineName()), - ]; - $this->drupalPostForm('admin/structure/types/add', $edit, t('Save and manage fields')); - $field_name = mb_strtolower($this->randomMachineName()); - $this->fieldUIAddNewField('admin/structure/types/manage/' . $node_type, $field_name, NULL, 'text'); - - // Create a node, check display, edit, verify that it has been updated. - $edit = [ - 'title[0][value]' => $this->randomMachineName(), - 'body[0][value]' => $this->randomMachineName(), - 'field_' . $field_name . '[0][value]' => $this->randomMachineName(), - ]; - $this->drupalPostForm('node/add/' . $node_type, $edit, t('Save')); - - // Test the output as anonymous user. - $this->drupalLogout(); - $this->drupalGet('node'); - $this->assertSession()->responseContains($edit['title[0][value]']); - - $this->drupalLogin($admin_user); - $this->drupalGet('node'); - $this->clickLink($edit['title[0][value]']); - $this->assertSession()->responseContains($edit['body[0][value]']); - $this->clickLink(t('Edit')); - $update = [ - 'title[0][value]' => $this->randomMachineName(), - ]; - $this->drupalPostForm(NULL, $update, t('Save')); - $this->assertSession()->responseContains($update['title[0][value]']); - $this->drupalGet('node'); - $this->assertSession()->responseContains($update['title[0][value]']); - - $this->drupalLogout(); - $this->drupalGet('node'); - $this->clickLink($update['title[0][value]']); - $this->assertSession()->responseContains($edit['body[0][value]']); - - // Get database schema. - $db_schema = Database::getConnection()->schema(); - $this->assertFalse($db_schema->tableExists('cache_default')); - $this->assertFalse($db_schema->tableExists('cache_render')); - $this->assertFalse($db_schema->tableExists('cache_config')); - $this->assertFalse($db_schema->tableExists('cache_container')); - $this->assertFalse($db_schema->tableExists('cachetags')); - $this->assertFalse($db_schema->tableExists('semaphore')); - $this->assertFalse($db_schema->tableExists('flood')); - } - -} diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisCacheTest.php b/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisCacheTest.php deleted file mode 100644 index 8668be316..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisCacheTest.php +++ /dev/null @@ -1,49 +0,0 @@ -has('redis.factory')) { - $container->register('cache_tags.invalidator.checksum', 'Drupal\redis\Cache\RedisCacheTagsChecksum') - ->addArgument(new Reference('redis.factory')) - ->addTag('cache_tags_invalidator'); - } - } - - /** - * Creates a new instance of PhpRedis cache backend. - * - * @return \Drupal\redis\Cache\PhpRedis - * A new PhpRedis cache backend. - */ - protected function createCacheBackend($bin) { - $cache = \Drupal::service('cache.backend.redis')->get($bin); - $cache->setMinTtl(10); - return $cache; - } - -} diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisFloodTest.php b/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisFloodTest.php deleted file mode 100644 index 62dd41603..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisFloodTest.php +++ /dev/null @@ -1,58 +0,0 @@ -assertTrue($flood->isAllowed($name, $threshold)); - - // Register event. - $flood->register($name, $window); - - // The event is still allowed. - $this->assertTrue($flood->isAllowed($name, $threshold)); - - $flood->register($name, $window); - - // Verify event is not allowed. - $this->assertFalse($flood->isAllowed($name, $threshold)); - - // "Sleep" two seconds, then the event is allowed again. - $_SERVER['REQUEST_TIME'] += 2; - $this->assertTrue($flood->isAllowed($name, $threshold)); - - } - -} diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisLockTest.php b/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisLockTest.php deleted file mode 100644 index f3a9a8e8a..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisLockTest.php +++ /dev/null @@ -1,66 +0,0 @@ -register('lock', LockBackendInterface::class) - ->setFactory([new Reference('redis.lock.factory'), 'get']); - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->lock = $this->container->get('lock'); - } - - /** - * {@inheritdoc} - */ - public function testBackendLockRelease() { - $redis_interface = self::getRedisInterfaceEnv(); - // Verify that the correct lock backend is being instantiated by the - // factory. - $this->assertInstanceOf('\Drupal\redis\Lock\\' . $redis_interface, $this->lock); - - // Verify that a lock that has never been acquired is marked as available. - // @todo Remove this line when #3002640 lands. - // @see https://www.drupal.org/project/drupal/issues/3002640 - $this->assertTrue($this->lock->lockMayBeAvailable('lock_a')); - - parent::testBackendLockRelease(); - } - -} diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisQueueTest.php b/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisQueueTest.php deleted file mode 100644 index 78110049a..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Kernel/RedisQueueTest.php +++ /dev/null @@ -1,95 +0,0 @@ - NULL]; - $class_name = $client_factory->getClass(ClientFactory::REDIS_IMPL_QUEUE); - - /** @var \Drupal\Core\Queue\QueueInterface $queue1 */ - $queue1 = new $class_name($this->randomMachineName(), $settings, $client_factory->getClient()); - $queue1->createQueue(); - - /** @var \Drupal\Core\Queue\QueueInterface $queue2 */ - $queue2 = new $class_name($this->randomMachineName(), $settings, $client_factory->getClient()); - $queue2->createQueue(); - - $this->runQueueTest($queue1, $queue2); - $queue1->deleteQueue(); - $queue2->deleteQueue(); - - $class_name = $client_factory->getClass(ClientFactory::REDIS_IMPL_RELIABLE_QUEUE); - - /** @var \Drupal\Core\Queue\QueueInterface $queue1 */ - $queue1 = new $class_name($this->randomMachineName(), $settings, $client_factory->getClient()); - $queue1->createQueue(); - - /** @var \Drupal\Core\Queue\QueueInterface $queue2 */ - $queue2 = new $class_name($this->randomMachineName(), $settings, $client_factory->getClient()); - $queue2->createQueue(); - - $this->runQueueTest($queue1, $queue2); - } - - /** - * Tests Redis blocking queue. - */ - public function testRedisBlockingQueue() { - self::setUpSettings(); - // Create two queues. - $client_factory = \Drupal::service('redis.factory'); - $settings = ['reserve_timeout' => 30]; - $class_name = $client_factory->getClass(ClientFactory::REDIS_IMPL_QUEUE); - - /** @var \Drupal\Core\Queue\QueueInterface $queue1 */ - $queue1 = new $class_name($this->randomMachineName(), $settings, $client_factory->getClient()); - $queue1->createQueue(); - - /** @var \Drupal\Core\Queue\QueueInterface $queue2 */ - $queue2 = new $class_name($this->randomMachineName(), $settings, $client_factory->getClient()); - $queue2->createQueue(); - - $this->runQueueTest($queue1, $queue2); - } - - /** - * Overrides \Drupal\system\Tests\Queue\QueueTestQueueTest::testSystemQueue(). - * - * We override tests from core class we extend to prevent them from running. - */ - public function testSystemQueue() {} - - /** - * Overrides \Drupal\system\Tests\Queue\QueueTestQueueTest::testMemoryQueue(). - * - * We override tests from core class we extend to prevent them from running. - */ - public function testMemoryQueue() {} - -} - diff --git a/sites/all/modules/contrib/dev/redis/tests/src/Traits/RedisTestInterfaceTrait.php b/sites/all/modules/contrib/dev/redis/tests/src/Traits/RedisTestInterfaceTrait.php deleted file mode 100644 index 092b8c73e..000000000 --- a/sites/all/modules/contrib/dev/redis/tests/src/Traits/RedisTestInterfaceTrait.php +++ /dev/null @@ -1,36 +0,0 @@ -> ~/.ssh/config - # LAMP package installation (mysql is already started) - - sudo apt-get update - - sudo apt-get install apache2 libapache2-mod-fastcgi - # enable php-fpm, travis does not support any other method with php and apache - - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - - sudo a2enmod rewrite actions fastcgi alias - - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - # Make sure the apache root is in our wanted directory - - echo "$(curl -fsSL https://gist.githubusercontent.com/nickveenhof/11386315/raw/b8abaf9304fe12b5cc7752d39c29c1edae8ac2e6/gistfile1.txt)" | sed -e "s,PATH,$TRAVIS_BUILD_DIR/../drupal,g" | sudo tee /etc/apache2/sites-available/default > /dev/null - # Set sendmail so drush doesn't throw an error during site install. - - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'` - # Forward the errors to the syslog so we can print them - - echo "error_log=syslog" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'` - # Get latest drupal 8 core - - cd $TRAVIS_BUILD_DIR/.. - - git clone --depth 1 --branch 8.0.x http://git.drupal.org/project/drupal.git - # Restart apache and test it - - sudo service apache2 restart - - curl -v "http://localhost" - # Re-enable when trying to get CodeSniffer doesn't return a 403 anymore. - #- composer global require drupal/coder:\>7 - -before_script: - - cd $TRAVIS_BUILD_DIR/../drupal - # Update drupal core - - git pull origin 8.0.x - # Install the site - - drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes - - drush en --yes simpletest - - drush cr - - phpenv rehash - -script: - # go to our Drupal module directory - - mkdir $TRAVIS_BUILD_DIR/../drupal/modules/token - - cp -R $TRAVIS_BUILD_DIR/* $TRAVIS_BUILD_DIR/../drupal/modules/token/ - # go to our Drupal main directory - - cd $TRAVIS_BUILD_DIR/../drupal - - ls -la $TRAVIS_BUILD_DIR/../drupal/sites/default - # Run the tests - - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost "token" | tee /tmp/test.txt; TEST_EXIT=${PIPESTATUS[0]} - - echo $TEST_EXIT - # Check if we had fails in the run-tests.sh script - # Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\ - # is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a - # bit. - # Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors. - - TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(PHP Fatal error)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$? - - echo $TEST_OUTPUT - - cd $TRAVIS_BUILD_DIR/../drupal/core - - ./vendor/bin/phpunit --verbose --debug ../modules/token/; TEST_PHPUNIT=$? - - echo $TEST_PHPUNIT - # if the TEST_EXIT status is 0 AND the TEST_OUTPUT status is also 0 it means we succeeded, in all other cases we - # failed. - # Re-enable when trying to get CodeSniffer doesn't return a 403 anymore. - #- /home/travis/.composer/vendor/bin/phpcs --standard=/home/travis/.composer/vendor/drupal/coder/coder_sniffer/Drupal --extensions=php,inc,test,module,install --ignore=css/ $TRAVIS_BUILD_DIR/../drupal/modules/search_api - - php -i | grep 'php.ini' - - sudo cat /var/log/apache2/error.log - - sudo cat /var/log/syslog | grep 'php' | cat # Suppress grep exit status 1 - # Exit the build - - if [ $TEST_EXIT -eq 0 ] && [ $TEST_OUTPUT -eq 0 ] && [ $TEST_PHPUNIT -eq 0 ]; then exit 0; else exit 1; fi diff --git a/sites/all/modules/contrib/dev/token/LICENSE.txt b/sites/all/modules/contrib/dev/token/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/dev/token/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/dev/token/README.md b/sites/all/modules/contrib/dev/token/README.md deleted file mode 100755 index c2f8d04c8..000000000 --- a/sites/all/modules/contrib/dev/token/README.md +++ /dev/null @@ -1,52 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Recommended modules - * Installation - * Configuration - * Troubleshooting - * Maintainers - -INTRODUCTION ------------- - - Provides common and resuable token UI elements and missing core tokens. - - * For a full description of the module, visit the project page: - https://drupal.org/project/token - - * To submit bug reports and feature suggestions, or to track changes: - https://drupal.org/project/issues/token - -RECOMMENDED MODULES -------------------- - - * No extra module is required. - -INSTALLATION ------------- - - * Install as usual, see - https://www.drupal.org/docs/8/extending-drupal-8/installing-contributed-modules-find-import-enable-configure-drupal-8 for further - information. - -CONFIGURATION -------------- - - * No configuration is needed. - -TROUBLESHOOTING ---------------- - - * Token module doesn't provide any visible functions to the user on its own, it - just provides token handling services for other modules. - - -MAINTAINERS ------------ - -Current maintainers: - - * Dave Reid (https://drupal.org/user/53892) - * Sascha Grossenbacher (Berdir) (https://www.drupal.org/user/214652) diff --git a/sites/all/modules/contrib/dev/token/css/jquery.treetable.css b/sites/all/modules/contrib/dev/token/css/jquery.treetable.css deleted file mode 100644 index 4e95bfd3a..000000000 --- a/sites/all/modules/contrib/dev/token/css/jquery.treetable.css +++ /dev/null @@ -1,28 +0,0 @@ -table.treetable span.indenter { - display: inline-block; - margin: 0; - padding: 0; - text-align: right; - - /* Disable text selection of nodes (for better D&D UX) */ - user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -o-user-select: none; - -webkit-user-select: none; - - /* Force content-box box model for indenter (Bootstrap compatibility) */ - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - - width: 19px; -} - -table.treetable span.indenter a { - background-position: left center; - background-repeat: no-repeat; - display: inline-block; - text-decoration: none; - width: 19px; -} diff --git a/sites/all/modules/contrib/dev/token/css/token.css b/sites/all/modules/contrib/dev/token/css/token.css deleted file mode 100644 index ca201b8ac..000000000 --- a/sites/all/modules/contrib/dev/token/css/token.css +++ /dev/null @@ -1,32 +0,0 @@ -.token-tree-dialog { - border: 1px solid #6b6b6b; - border-radius: 5px 5px 0 0; - box-shadow: 0 0 10px #6b6b6b; -} - -.token-tree { - font-size: 0.85em; - margin-left: 19px; -} - -.ui-dialog-content .token-tree { - margin-left: 0; -} - -.token-tree td, .token-tree th { - padding-top: 0; - padding-bottom: 0; -} - -.token-group { - font-weight: bold; -} - -.js .token-group { - font-weight: normal; -} - -/* Prevent the token columns from being wrapped. */ -.token-tree td.token-key { - white-space: nowrap; -} diff --git a/sites/all/modules/contrib/dev/token/css/token.treetable.theme.css b/sites/all/modules/contrib/dev/token/css/token.treetable.theme.css deleted file mode 100644 index a93c557f0..000000000 --- a/sites/all/modules/contrib/dev/token/css/token.treetable.theme.css +++ /dev/null @@ -1,50 +0,0 @@ -table.treetable { -} - -table.treetable caption { -} - -table.treetable thead { -} - -table.treetable thead tr th { -} - -table.treetable tbody tr td { - cursor: default; -} - -table.treetable span { - background-position: center left; - background-repeat: no-repeat; - padding: .2em 0 .2em 1.5em; -} - -table.treetable tr.collapsed span.indenter a { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHlJREFUeNrcU1sNgDAQ6wgmcAM2MICGGlg1gJnNzWQcvwQGy1j4oUl/7tH0mpwzM7SgQyO+EZAUWh2MkkzSWhJwuRAlHYsJwEwyvs1gABDuzqoJcTw5qxaIJN0bgQRgIjnlmn1heSO5PE6Y2YXe+5Cr5+h++gs12AcAS6FS+7YOsj4AAAAASUVORK5CYII=); -} - -table.treetable tr.expanded span.indenter a { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHFJREFUeNpi/P//PwMlgImBQsA44C6gvhfa29v3MzAwOODRc6CystIRbxi0t7fjDJjKykpGYrwwi1hxnLHQ3t7+jIGBQRJJ6HllZaUUKYEYRYBPOB0gBShKwKGA////48VtbW3/8clTnBIH3gCKkzJgAGvBX0dDm0sCAAAAAElFTkSuQmCC); -} - -table.treetable tr.branch { - background-color: #f9f9f9; -} - -table.treetable tr.selected { - background-color: #3875d7; - color: #fff; -} - -table.treetable tr span.indenter { - margin-left: -19px; -} -table.treetable tr span.indenter a { - outline: none; /* Expander shows outline after upgrading to 3.0 (#141) */ -} - -table.treetable tr.accept { - background-color: #a3bce4; - color: #fff -} diff --git a/sites/all/modules/contrib/dev/token/js/jquery.treetable.js b/sites/all/modules/contrib/dev/token/js/jquery.treetable.js deleted file mode 100644 index ac9d90ac3..000000000 --- a/sites/all/modules/contrib/dev/token/js/jquery.treetable.js +++ /dev/null @@ -1,629 +0,0 @@ -/* - * jQuery treetable Plugin 3.2.0 - * http://ludo.cubicphuse.nl/jquery-treetable - * - * Copyright 2013, Ludo van den Boom - * Dual licensed under the MIT or GPL Version 2 licenses. - */ -(function($) { - var Node, Tree, methods; - - Node = (function() { - function Node(row, tree, settings) { - var parentId; - - this.row = row; - this.tree = tree; - this.settings = settings; - - // TODO Ensure id/parentId is always a string (not int) - this.id = this.row.data(this.settings.nodeIdAttr); - - // TODO Move this to a setParentId function? - parentId = this.row.data(this.settings.parentIdAttr); - if (parentId != null && parentId !== "") { - this.parentId = parentId; - } - - this.treeCell = $(this.row.children(this.settings.columnElType)[this.settings.column]); - this.expander = $(this.settings.expanderTemplate); - this.indenter = $(this.settings.indenterTemplate); - this.children = []; - this.initialized = false; - this.treeCell.prepend(this.indenter); - } - - Node.prototype.addChild = function(child) { - return this.children.push(child); - }; - - Node.prototype.ancestors = function() { - var ancestors, node; - node = this; - ancestors = []; - while (node = node.parentNode()) { - ancestors.push(node); - } - return ancestors; - }; - - Node.prototype.collapse = function() { - if (this.collapsed()) { - return this; - } - - this.row.removeClass("expanded").addClass("collapsed"); - - this._hideChildren(); - this.expander.attr("title", this.settings.stringExpand); - - if (this.initialized && this.settings.onNodeCollapse != null) { - this.settings.onNodeCollapse.apply(this); - } - - return this; - }; - - Node.prototype.collapsed = function() { - return this.row.hasClass("collapsed"); - }; - - // TODO destroy: remove event handlers, expander, indenter, etc. - - Node.prototype.expand = function() { - if (this.expanded()) { - return this; - } - - this.row.removeClass("collapsed").addClass("expanded"); - - if (this.initialized && this.settings.onNodeExpand != null) { - this.settings.onNodeExpand.apply(this); - } - - if ($(this.row).is(":visible")) { - this._showChildren(); - } - - this.expander.attr("title", this.settings.stringCollapse); - - return this; - }; - - Node.prototype.expanded = function() { - return this.row.hasClass("expanded"); - }; - - Node.prototype.hide = function() { - this._hideChildren(); - this.row.hide(); - return this; - }; - - Node.prototype.isBranchNode = function() { - if(this.children.length > 0 || this.row.data(this.settings.branchAttr) === true) { - return true; - } else { - return false; - } - }; - - Node.prototype.updateBranchLeafClass = function(){ - this.row.removeClass('branch'); - this.row.removeClass('leaf'); - this.row.addClass(this.isBranchNode() ? 'branch' : 'leaf'); - }; - - Node.prototype.level = function() { - return this.ancestors().length; - }; - - Node.prototype.parentNode = function() { - if (this.parentId != null) { - return this.tree[this.parentId]; - } else { - return null; - } - }; - - Node.prototype.removeChild = function(child) { - var i = $.inArray(child, this.children); - return this.children.splice(i, 1) - }; - - Node.prototype.render = function() { - var handler, - settings = this.settings, - target; - - if (settings.expandable === true && this.isBranchNode()) { - handler = function(e) { - $(this).parents("table").treetable("node", $(this).parents("tr").data(settings.nodeIdAttr)).toggle(); - return e.preventDefault(); - }; - - this.indenter.html(this.expander); - target = settings.clickableNodeNames === true ? this.treeCell : this.expander; - - target.off("click.treetable").on("click.treetable", handler); - target.off("keydown.treetable").on("keydown.treetable", function(e) { - if (e.keyCode == 13) { - handler.apply(this, [e]); - } - }); - } - - this.indenter[0].style.paddingLeft = "" + (this.level() * settings.indent) + "px"; - - return this; - }; - - Node.prototype.reveal = function() { - if (this.parentId != null) { - this.parentNode().reveal(); - } - return this.expand(); - }; - - Node.prototype.setParent = function(node) { - if (this.parentId != null) { - this.tree[this.parentId].removeChild(this); - } - this.parentId = node.id; - this.row.data(this.settings.parentIdAttr, node.id); - return node.addChild(this); - }; - - Node.prototype.show = function() { - if (!this.initialized) { - this._initialize(); - } - this.row.show(); - if (this.expanded()) { - this._showChildren(); - } - return this; - }; - - Node.prototype.toggle = function() { - if (this.expanded()) { - this.collapse(); - } else { - this.expand(); - } - return this; - }; - - Node.prototype._hideChildren = function() { - var child, _i, _len, _ref, _results; - _ref = this.children; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - child = _ref[_i]; - _results.push(child.hide()); - } - return _results; - }; - - Node.prototype._initialize = function() { - var settings = this.settings; - - this.render(); - - if (settings.expandable === true && settings.initialState === "collapsed") { - this.collapse(); - } else { - this.expand(); - } - - if (settings.onNodeInitialized != null) { - settings.onNodeInitialized.apply(this); - } - - return this.initialized = true; - }; - - Node.prototype._showChildren = function() { - var child, _i, _len, _ref, _results; - _ref = this.children; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - child = _ref[_i]; - _results.push(child.show()); - } - return _results; - }; - - return Node; - })(); - - Tree = (function() { - function Tree(table, settings) { - this.table = table; - this.settings = settings; - this.tree = {}; - - // Cache the nodes and roots in simple arrays for quick access/iteration - this.nodes = []; - this.roots = []; - } - - Tree.prototype.collapseAll = function() { - var node, _i, _len, _ref, _results; - _ref = this.nodes; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - _results.push(node.collapse()); - } - return _results; - }; - - Tree.prototype.expandAll = function() { - var node, _i, _len, _ref, _results; - _ref = this.nodes; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - _results.push(node.expand()); - } - return _results; - }; - - Tree.prototype.findLastNode = function (node) { - if (node.children.length > 0) { - return this.findLastNode(node.children[node.children.length - 1]); - } else { - return node; - } - }; - - Tree.prototype.loadRows = function(rows) { - var node, row, i; - - if (rows != null) { - for (i = 0; i < rows.length; i++) { - row = $(rows[i]); - - if (row.data(this.settings.nodeIdAttr) != null) { - node = new Node(row, this.tree, this.settings); - this.nodes.push(node); - this.tree[node.id] = node; - - if (node.parentId != null && this.tree[node.parentId]) { - this.tree[node.parentId].addChild(node); - } else { - this.roots.push(node); - } - } - } - } - - for (i = 0; i < this.nodes.length; i++) { - node = this.nodes[i].updateBranchLeafClass(); - } - - return this; - }; - - Tree.prototype.move = function(node, destination) { - // Conditions: - // 1: +node+ should not be inserted as a child of +node+ itself. - // 2: +destination+ should not be the same as +node+'s current parent (this - // prevents +node+ from being moved to the same location where it already - // is). - // 3: +node+ should not be inserted in a location in a branch if this would - // result in +node+ being an ancestor of itself. - var nodeParent = node.parentNode(); - if (node !== destination && destination.id !== node.parentId && $.inArray(node, destination.ancestors()) === -1) { - node.setParent(destination); - this._moveRows(node, destination); - - // Re-render parentNode if this is its first child node, and therefore - // doesn't have the expander yet. - if (node.parentNode().children.length === 1) { - node.parentNode().render(); - } - } - - if(nodeParent){ - nodeParent.updateBranchLeafClass(); - } - if(node.parentNode()){ - node.parentNode().updateBranchLeafClass(); - } - node.updateBranchLeafClass(); - return this; - }; - - Tree.prototype.removeNode = function(node) { - // Recursively remove all descendants of +node+ - this.unloadBranch(node); - - // Remove node from DOM () - node.row.remove(); - - // Remove node from parent children list - if (node.parentId != null) { - node.parentNode().removeChild(node); - } - - // Clean up Tree object (so Node objects are GC-ed) - delete this.tree[node.id]; - this.nodes.splice($.inArray(node, this.nodes), 1); - - return this; - } - - Tree.prototype.render = function() { - var root, _i, _len, _ref; - _ref = this.roots; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - root = _ref[_i]; - - // Naming is confusing (show/render). I do not call render on node from - // here. - root.show(); - } - return this; - }; - - Tree.prototype.sortBranch = function(node, sortFun) { - // First sort internal array of children - node.children.sort(sortFun); - - // Next render rows in correct order on page - this._sortChildRows(node); - - return this; - }; - - Tree.prototype.unloadBranch = function(node) { - // Use a copy of the children array to not have other functions interfere - // with this function if they manipulate the children array - // (eg removeNode). - var children = node.children.slice(0), - i; - - for (i = 0; i < children.length; i++) { - this.removeNode(children[i]); - } - - // Reset node's collection of children - node.children = []; - - node.updateBranchLeafClass(); - - return this; - }; - - Tree.prototype._moveRows = function(node, destination) { - var children = node.children, i; - - node.row.insertAfter(destination.row); - node.render(); - - // Loop backwards through children to have them end up on UI in correct - // order (see #112) - for (i = children.length - 1; i >= 0; i--) { - this._moveRows(children[i], node); - } - }; - - // Special _moveRows case, move children to itself to force sorting - Tree.prototype._sortChildRows = function(parentNode) { - return this._moveRows(parentNode, parentNode); - }; - - return Tree; - })(); - - // jQuery Plugin - methods = { - init: function(options, force) { - var settings; - - settings = $.extend({ - branchAttr: "ttBranch", - clickableNodeNames: false, - column: 0, - columnElType: "td", // i.e. 'td', 'th' or 'td,th' - expandable: false, - expanderTemplate: " ", - indent: 19, - indenterTemplate: "", - initialState: "collapsed", - nodeIdAttr: "ttId", // maps to data-tt-id - parentIdAttr: "ttParentId", // maps to data-tt-parent-id - stringExpand: "Expand", - stringCollapse: "Collapse", - - // Events - onInitialized: null, - onNodeCollapse: null, - onNodeExpand: null, - onNodeInitialized: null - }, options); - - return this.each(function() { - var el = $(this), tree; - - if (force || el.data("treetable") === undefined) { - tree = new Tree(this, settings); - tree.loadRows(this.rows).render(); - - el.addClass("treetable").data("treetable", tree); - - if (settings.onInitialized != null) { - settings.onInitialized.apply(tree); - } - } - - return el; - }); - }, - - destroy: function() { - return this.each(function() { - return $(this).removeData("treetable").removeClass("treetable"); - }); - }, - - collapseAll: function() { - this.data("treetable").collapseAll(); - return this; - }, - - collapseNode: function(id) { - var node = this.data("treetable").tree[id]; - - if (node) { - node.collapse(); - } else { - throw new Error("Unknown node '" + id + "'"); - } - - return this; - }, - - expandAll: function() { - this.data("treetable").expandAll(); - return this; - }, - - expandNode: function(id) { - var node = this.data("treetable").tree[id]; - - if (node) { - if (!node.initialized) { - node._initialize(); - } - - node.expand(); - } else { - throw new Error("Unknown node '" + id + "'"); - } - - return this; - }, - - loadBranch: function(node, rows) { - var settings = this.data("treetable").settings, - tree = this.data("treetable").tree; - - // TODO Switch to $.parseHTML - rows = $(rows); - - if (node == null) { // Inserting new root nodes - this.append(rows); - } else { - var lastNode = this.data("treetable").findLastNode(node); - rows.insertAfter(lastNode.row); - } - - this.data("treetable").loadRows(rows); - - // Make sure nodes are properly initialized - rows.filter("tr").each(function() { - tree[$(this).data(settings.nodeIdAttr)].show(); - }); - - if (node != null) { - // Re-render parent to ensure expander icon is shown (#79) - node.render().expand(); - } - - return this; - }, - - move: function(nodeId, destinationId) { - var destination, node; - - node = this.data("treetable").tree[nodeId]; - destination = this.data("treetable").tree[destinationId]; - this.data("treetable").move(node, destination); - - return this; - }, - - node: function(id) { - return this.data("treetable").tree[id]; - }, - - removeNode: function(id) { - var node = this.data("treetable").tree[id]; - - if (node) { - this.data("treetable").removeNode(node); - } else { - throw new Error("Unknown node '" + id + "'"); - } - - return this; - }, - - reveal: function(id) { - var node = this.data("treetable").tree[id]; - - if (node) { - node.reveal(); - } else { - throw new Error("Unknown node '" + id + "'"); - } - - return this; - }, - - sortBranch: function(node, columnOrFunction) { - var settings = this.data("treetable").settings, - prepValue, - sortFun; - - columnOrFunction = columnOrFunction || settings.column; - sortFun = columnOrFunction; - - if ($.isNumeric(columnOrFunction)) { - sortFun = function(a, b) { - var extractValue, valA, valB; - - extractValue = function(node) { - var val = node.row.find("td:eq(" + columnOrFunction + ")").text(); - // Ignore trailing/leading whitespace and use uppercase values for - // case insensitive ordering - return $.trim(val).toUpperCase(); - } - - valA = extractValue(a); - valB = extractValue(b); - - if (valA < valB) return -1; - if (valA > valB) return 1; - return 0; - }; - } - - this.data("treetable").sortBranch(node, sortFun); - return this; - }, - - unloadBranch: function(node) { - this.data("treetable").unloadBranch(node); - return this; - } - }; - - $.fn.treetable = function(method) { - if (methods[method]) { - return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); - } else if (typeof method === 'object' || !method) { - return methods.init.apply(this, arguments); - } else { - return $.error("Method " + method + " does not exist on jQuery.treetable"); - } - }; - - // Expose classes to world - this.TreeTable || (this.TreeTable = {}); - this.TreeTable.Node = Node; - this.TreeTable.Tree = Tree; -})(jQuery); diff --git a/sites/all/modules/contrib/dev/token/js/token.js b/sites/all/modules/contrib/dev/token/js/token.js deleted file mode 100644 index 3a41d6259..000000000 --- a/sites/all/modules/contrib/dev/token/js/token.js +++ /dev/null @@ -1,93 +0,0 @@ - -(function ($, Drupal, drupalSettings) { - - 'use strict'; - - Drupal.behaviors.tokenTree = { - attach: function (context, settings) { - $('table.token-tree', context).once('token-tree').each(function () { - $(this).treetable({ expandable: true }); - }); - } - }; - - Drupal.behaviors.tokenInsert = { - attach: function (context, settings) { - // Keep track of which textfield was last selected/focused. - $('textarea, input[type="text"]', context).focus(function () { - drupalSettings.tokenFocusedField = this; - }); - - $('.token-click-insert .token-key', context).once('token-click-insert').each(function () { - var newThis = $('' + $(this).html() + '').click(function () { - var content = this.text; - - // Always work in normal text areas that currently have focus. - if (drupalSettings.tokenFocusedField && (drupalSettings.tokenFocusedField.tokenDialogFocus || drupalSettings.tokenFocusedField.tokenHasFocus)) { - insertAtCursor(drupalSettings.tokenFocusedField, content); - } - // Direct tinyMCE support. - else if (typeof(tinyMCE) != 'undefined' && tinyMCE.activeEditor) { - tinyMCE.activeEditor.execCommand('mceInsertContent', false, content); - } - // Direct CKEditor support. Only works if the field currently has focus, - // which is unusual since the dialog is open. - else if (typeof(CKEDITOR) != 'undefined' && CKEDITOR.currentInstance) { - CKEDITOR.currentInstance.insertHtml(content); - } - // Direct CodeMirror support. - else if (typeof(CodeMirror) != 'undefined' && drupalSettings.tokenFocusedField && $(drupalSettings.tokenFocusedField).parents('.CodeMirror').length) { - var editor = $(drupalSettings.tokenFocusedField).parents('.CodeMirror')[0].CodeMirror; - editor.replaceSelection(content); - editor.focus(); - } - // WYSIWYG support, should work in all editors if available. - else if (Drupal.wysiwyg && Drupal.wysiwyg.activeId) { - Drupal.wysiwyg.instances[Drupal.wysiwyg.activeId].insert(content) - } - // CKeditor module support. - else if (typeof(CKEDITOR) != 'undefined' && typeof(Drupal.ckeditorActiveId) != 'undefined') { - CKEDITOR.instances[Drupal.ckeditorActiveId].insertHtml(content); - } - else if (drupalSettings.tokenFocusedField) { - insertAtCursor(drupalSettings.tokenFocusedField, content); - } - else { - alert(Drupal.t('First click a text field to insert your tokens into.')); - } - - return false; - }); - $(this).html(newThis); - }); - - function insertAtCursor(editor, content) { - // Record the current scroll position. - var scroll = editor.scrollTop; - - // IE support. - if (document.selection) { - editor.focus(); - var sel = document.selection.createRange(); - sel.text = content; - } - - // Mozilla/Firefox/Netscape 7+ support. - else if (editor.selectionStart || editor.selectionStart == '0') { - var startPos = editor.selectionStart; - var endPos = editor.selectionEnd; - editor.value = editor.value.substring(0, startPos) + content + editor.value.substring(endPos, editor.value.length); - } - - // Fallback, just add to the end of the content. - else { - editor.value += content; - } - - // Ensure the textarea does not unexpectedly scroll. - editor.scrollTop = scroll; - } - } - }; - -})(jQuery, Drupal, drupalSettings); diff --git a/sites/all/modules/contrib/dev/token/src/Controller/TokenAutocompleteController.php b/sites/all/modules/contrib/dev/token/src/Controller/TokenAutocompleteController.php deleted file mode 100644 index 979f832a4..000000000 --- a/sites/all/modules/contrib/dev/token/src/Controller/TokenAutocompleteController.php +++ /dev/null @@ -1,77 +0,0 @@ -treeBuilder = $tree_builder; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('token.tree_builder') - ); - } - - /** - * Retrieves suggestions for block category autocompletion. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The current request. - * @param string $token_type - * The token type. - * @param string $filter - * The autocomplete filter. - * - * @return \Symfony\Component\HttpFoundation\JsonResponse - * A JSON response containing autocomplete suggestions. - */ - public function autocomplete($token_type, $filter, Request $request) { - $filter = substr($filter, strrpos($filter, '[')); - - $matches = []; - - if (!mb_strlen($filter)) { - $matches["[{$token_type}:"] = 0; - } - else { - $depth = max(1, substr_count($filter, ':')); - $tree = $this->treeBuilder->buildTree($token_type, ['flat' => TRUE, 'depth' => $depth]); - foreach (array_keys($tree) as $token) { - if (strpos($token, $filter) === 0) { - $matches[$token] = levenshtein($token, $filter); - if (isset($tree[$token]['children'])) { - $token = rtrim($token, ':]') . ':'; - $matches[$token] = levenshtein($token, $filter); - } - } - } - } - - asort($matches); - - $keys = array_keys($matches); - $matches = array_combine($keys, $keys); - - return new JsonResponse($matches); - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Controller/TokenCacheController.php b/sites/all/modules/contrib/dev/token/src/Controller/TokenCacheController.php deleted file mode 100644 index 7f758d335..000000000 --- a/sites/all/modules/contrib/dev/token/src/Controller/TokenCacheController.php +++ /dev/null @@ -1,21 +0,0 @@ -messenger()->addMessage($this->t('Token registry caches cleared.')); - return $this->redirect(''); - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Controller/TokenDevelController.php b/sites/all/modules/contrib/dev/token/src/Controller/TokenDevelController.php deleted file mode 100644 index 332bad251..000000000 --- a/sites/all/modules/contrib/dev/token/src/Controller/TokenDevelController.php +++ /dev/null @@ -1,109 +0,0 @@ -treeBuilder = $tree_builder; - $this->entityMapper = $entity_mapper; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('token.tree_builder'), - $container->get('token.entity_mapper') - ); - } - - /** - * Prints the loaded structure of the current entity. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * A RouteMatch object. - * - * @return array - * Array of page elements to render. - */ - public function entityTokens(RouteMatchInterface $route_match) { - $output = []; - - $parameter_name = $route_match->getRouteObject()->getOption('_token_entity_type_id'); - $entity = $route_match->getParameter($parameter_name); - - if ($entity && $entity instanceof EntityInterface) { - $output = $this->renderTokenTree($entity); - } - - return $output; - } - - /** - * Render the token tree for the specified entity. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity for which the token tree should be rendered. - * - * @return array - * Render array of the token tree for the $entity. - * - * @see static::entityLoad - */ - protected function renderTokenTree(EntityInterface $entity) { - $this->moduleHandler()->loadInclude('token', 'pages.inc'); - $entity_type = $entity->getEntityTypeId(); - - $token_type = $this->entityMapper->getTokenTypeForEntityType($entity_type); - $options = [ - 'flat' => TRUE, - 'values' => TRUE, - 'data' => [$token_type => $entity], - ]; - - $token_tree = [ - $token_type => [ - 'tokens' => $this->treeBuilder->buildTree($token_type, $options), - ], - ]; -// foreach ($tree as $token => $token_info) { -// if (!isset($token_info['value']) && !empty($token_info['parent']) && !isset($tree[$token_info['parent']]['value'])) { -// continue; -// } -// } - - $build['tokens'] = [ - '#type' => 'token_tree_table', - '#show_restricted' => FALSE, - '#show_nested' => FALSE, - '#skip_empty_values' => TRUE, - '#token_tree' => $token_tree, - '#columns' => ['token', 'value'], - '#empty' => $this->t('No tokens available.'), - ]; - - return $build; - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Controller/TokenTreeController.php b/sites/all/modules/contrib/dev/token/src/Controller/TokenTreeController.php deleted file mode 100644 index 3edf40229..000000000 --- a/sites/all/modules/contrib/dev/token/src/Controller/TokenTreeController.php +++ /dev/null @@ -1,67 +0,0 @@ -treeBuilder = $tree_builder; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('token.tree_builder') - ); - } - - /** - * Page callback to output a token tree as an empty page. - */ - function outputTree(Request $request) { - $options = $request->query->has('options') ? Json::decode($request->query->get('options')) : []; - - // The option token_types may only be an array OR 'all'. If it is not set, - // we assume that only global token types are requested. - $token_types = !empty($options['token_types']) ? $options['token_types'] : []; - if ($token_types == 'all') { - $build = $this->treeBuilder->buildAllRenderable($options); - } - else { - $build = $this->treeBuilder->buildRenderable($token_types, $options); - } - - $build['#cache']['contexts'][] = 'url.query_args:options'; - $build['#title'] = $this->t('Available tokens'); - - // If this is an AJAX/modal request, add a wrapping div to the contents so - // that Drupal.behaviors.tokenTree and Drupal.behaviors.tokenAttach can - // stil find the elements they need to. - // @see https://www.drupal.org/project/token/issues/2994671 - // @see https://www.drupal.org/node/2940704 - // @see http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - if ($request->isXmlHttpRequest()) { - $build['#prefix'] = '
        '; - $build['#suffix'] = '
        '; - } - - return $build; - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Element/TokenTreeTable.php b/sites/all/modules/contrib/dev/token/src/Element/TokenTreeTable.php deleted file mode 100644 index 6de9c95d3..000000000 --- a/sites/all/modules/contrib/dev/token/src/Element/TokenTreeTable.php +++ /dev/null @@ -1,155 +0,0 @@ - '-', '_' => '-', '/' => '-', '[' => '-', ']' => '', ':' => '--', '?' => '', '<' => '-', '>' => '-']; - - /** - * {@inheritdoc} - */ - public function getInfo() { - $class = get_class($this); - return [ - '#header' => [], - '#rows' => [], - '#token_tree' => [], - '#columns' => ['name', 'token', 'description'], - '#empty' => '', - '#show_restricted' => FALSE, - '#show_nested' => FALSE, - '#skip_empty_values' => FALSE, - '#click_insert' => TRUE, - '#sticky' => FALSE, - '#responsive' => TRUE, - '#input' => FALSE, - '#pre_render' => [ - [$class, 'preRenderTokenTree'], - [$class, 'preRenderTable'], - ], - '#theme' => 'table__token_tree', - '#attached' => [ - 'library' => [ - 'token/token', - ], - ], - ]; - } - - /** - * Pre-render the token tree to transform rows in the token tree. - * - * @param array $element - * - * @return array - * The processed element. - */ - public static function preRenderTokenTree($element) { - $multiple_token_types = count($element['#token_tree']) > 1; - foreach ($element['#token_tree'] as $token_type => $type_info) { - // Do not show nested tokens. - if (!empty($type_info['nested']) && empty($element['#show_nested'])) { - continue; - } - - if ($multiple_token_types) { - $row = static::formatRow($token_type, $type_info, $element['#columns'], TRUE); - $element['#rows'][] = $row; - } - - foreach ($type_info['tokens'] as $token => $token_info) { - if (!empty($token_info['restricted']) && empty($element['#show_restricted'])) { - continue; - } - if ($element['#skip_empty_values'] && empty($token_info['value']) && !empty($token_info['parent']) && !isset($tree[$token_info['parent']]['value'])) { - continue; - } - if ($multiple_token_types && !isset($token_info['parent'])) { - $token_info['parent'] = $token_type; - } - $row = static::formatRow($token, $token_info, $element['#columns']); - $element['#rows'][] = $row; - } - } - - if (!empty($element['#rows'])) { - $element['#attached']['library'][] = 'token/jquery.treeTable'; - } - - // Fill headers if one is not specified. - if (empty($element['#header'])) { - $column_map = [ - 'name' => t('Name'), - 'token' => t('Token'), - 'value' => t('Value'), - 'description' => t('Description'), - ]; - foreach ($element['#columns'] as $col) { - $element['#header'][] = $column_map[$col]; - } - } - - $element['#attributes']['class'][] = 'token-tree'; - - if ($element['#click_insert']) { - $element['#caption'] = t('Click a token to insert it into the field you\'ve last clicked.'); - $element['#attributes']['class'][] = 'token-click-insert'; - } - - return $element; - } - - protected static function cleanCssIdentifier($id) { - return 'token-' . Html::cleanCssIdentifier(trim($id, '[]'), static::$cssFilter); - } - - protected static function formatRow($token, $token_info, $columns, $is_group = FALSE) { - $row = [ - 'id' => static::cleanCssIdentifier($token), - 'data-tt-id' => static::cleanCssIdentifier($token), - 'class' => [], - 'data' => [], - ]; - - foreach ($columns as $col) { - switch ($col) { - case 'name': - $row['data'][$col] = $token_info['name']; - break; - - case 'token': - $row['data'][$col]['data'] = $token; - $row['data'][$col]['class'][] = 'token-key'; - break; - - case 'description': - $row['data'][$col] = isset($token_info['description']) ? $token_info['description'] : ''; - break; - - case 'value': - $row['data'][$col] = !$is_group && isset($token_info['value']) ? $token_info['value'] : ''; - break; - } - } - - if ($is_group) { - // This is a token type/group. - $row['class'][] = 'token-group'; - } - elseif (!empty($token_info['parent'])) { - $row['data-tt-parent-id'] = static::cleanCssIdentifier($token_info['parent']); - unset($row['parent']); - } - - return $row; - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Plugin/Derivative/DevelLocalTask.php b/sites/all/modules/contrib/dev/token/src/Plugin/Derivative/DevelLocalTask.php deleted file mode 100644 index 5b22e8440..000000000 --- a/sites/all/modules/contrib/dev/token/src/Plugin/Derivative/DevelLocalTask.php +++ /dev/null @@ -1,56 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $this->derivatives = []; - - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->hasLinkTemplate('token-devel')) { - $this->derivatives["$entity_type_id.token_devel_tab"] = [ - 'route_name' => "entity.$entity_type_id.token_devel", - 'weight' => 110, - 'title' => $this->t('Tokens'), - 'parent_id' => "devel.entities:$entity_type_id.devel_tab", - ]; - } - } - - foreach ($this->derivatives as &$entry) { - $entry += $base_plugin_definition; - } - - return $this->derivatives; - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Routing/RouteSubscriber.php b/sites/all/modules/contrib/dev/token/src/Routing/RouteSubscriber.php deleted file mode 100644 index b856f43e6..000000000 --- a/sites/all/modules/contrib/dev/token/src/Routing/RouteSubscriber.php +++ /dev/null @@ -1,75 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - protected function alterRoutes(RouteCollection $collection) { - foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) { - if ($devel_render = $entity_type->getLinkTemplate('token-devel')) { - $options = [ - '_admin_route' => TRUE, - '_token_entity_type_id' => $entity_type_id, - 'parameters' => [ - $entity_type_id => [ - 'type' => 'entity:' . $entity_type_id, - ], - ], - ]; - - $route = new Route( - $devel_render, - [ - '_controller' => '\Drupal\token\Controller\TokenDevelController::entityTokens', - '_title' => 'Devel Tokens', - ], - [ - '_permission' => 'access devel information', - '_module_dependencies' => 'devel', - ], - $options - ); - - $collection->add("entity.$entity_type_id.token_devel", $route); - } - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events = parent::getSubscribedEvents(); - $events[RoutingEvents::ALTER] = array('onAlterRoutes', 100); - return $events; - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenBlockTest.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenBlockTest.php deleted file mode 100644 index 55de3b988..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenBlockTest.php +++ /dev/null @@ -1,73 +0,0 @@ -admin_user = $this->drupalCreateUser(['access content', 'administer blocks']); - $this->drupalLogin($this->admin_user); - } - - public function testBlockTitleTokens() { - $label = 'tokenblock'; - $bundle = BlockContentType::create([ - 'id' => $label, - 'label' => $label, - 'revision' => FALSE - ]); - $bundle->save(); - - $block_content = BlockContent::create([ - 'type' => $label, - 'label' => '[current-page:title] block title', - 'info' => 'Test token title block', - 'body[value]' => 'This is the test token title block.', - ]); - $block_content->save(); - - $block = $this->drupalPlaceBlock('block_content:' . $block_content->uuid(), [ - 'label' => '[user:name]', - ]); - $this->drupalGet($block->toUrl()); - // Ensure that the link to available tokens is present and correctly - // positioned. - $this->assertLink('Browse available tokens.'); - $this->assertText('This field supports tokens. Browse available tokens.'); - $this->drupalPostForm(NULL, [], t('Save block')); - // Ensure token validation is working on the block. - $this->assertText('Title is using the following invalid tokens: [user:name].'); - - // Create the block for real now with a valid title. - $settings = $block->get('settings'); - $settings['label'] = '[current-page:title] block title'; - $block->set('settings', $settings); - $block->save(); - - // Ensure that tokens are not double-escaped when output as a block title. - $this->drupalCreateContentType(['type' => 'page']); - $node = $this->drupalCreateNode(['title' => "Site's first node"]); - $this->drupalGet('node/' . $node->id()); - // The apostraphe should only be escaped once. - $this->assertRaw("Site's first node block title"); - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenCurrentPageTest.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenCurrentPageTest.php deleted file mode 100644 index 096c24bc4..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenCurrentPageTest.php +++ /dev/null @@ -1,66 +0,0 @@ - t('Log in'), - '[current-page:url]' => Url::fromRoute('user.login', [], ['absolute' => TRUE])->toString(), - '[current-page:url:absolute]' => Url::fromRoute('user.login', [], ['absolute' => TRUE])->toString(), - '[current-page:url:relative]' => Url::fromRoute('user.login')->toString(), - '[current-page:url:path]' => '/user/login', - '[current-page:url:args:value:0]' => 'user', - '[current-page:url:args:value:1]' => 'login', - '[current-page:url:args:value:2]' => NULL, - '[current-page:url:unaliased]' => Url::fromRoute('user.login', [], ['absolute' => TRUE, 'alias' => TRUE])->toString(), - '[current-page:page-number]' => 1, - '[current-page:query:foo]' => NULL, - '[current-page:query:bar]' => NULL, - // Deprecated tokens - '[current-page:arg:0]' => 'user', - '[current-page:arg:1]' => 'login', - '[current-page:arg:2]' => NULL, - ]; - $this->assertPageTokens('user/login', $tokens); - - $this->drupalCreateContentType(['type' => 'page']); - $node = $this->drupalCreateNode(['title' => 'Node title', 'path' => ['alias' => '/node-alias']]); - $tokens = [ - '[current-page:title]' => 'Node title', - '[current-page:url]' => $node->toUrl('canonical', ['absolute' => TRUE])->toString(), - '[current-page:url:absolute]' => $node->toUrl('canonical', ['absolute' => TRUE])->toString(), - '[current-page:url:relative]' => $node->toUrl()->toString(), - '[current-page:url:alias]' => '/node-alias', - '[current-page:url:args:value:0]' => 'node-alias', - '[current-page:url:args:value:1]' => NULL, - '[current-page:url:unaliased]' => $node->toUrl('canonical', ['absolute' => TRUE, 'alias' => TRUE])->toString(), - '[current-page:url:unaliased:args:value:0]' => 'node', - '[current-page:url:unaliased:args:value:1]' => $node->id(), - '[current-page:url:unaliased:args:value:2]' => NULL, - '[current-page:page-number]' => 1, - '[current-page:query:foo]' => 'bar', - '[current-page:query:bar]' => NULL, - // Deprecated tokens - '[current-page:arg:0]' => 'node', - '[current-page:arg:1]' => 1, - '[current-page:arg:2]' => NULL, - ]; - $this->assertPageTokens("/node/{$node->id()}", $tokens, [], ['url_options' => ['query' => ['foo' => 'bar']]]); - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenFieldUiTest.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenFieldUiTest.php deleted file mode 100644 index f72295f21..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenFieldUiTest.php +++ /dev/null @@ -1,282 +0,0 @@ -adminUser = $this->drupalCreateUser(['administer content types', 'administer node fields']); - $this->drupalLogin($this->adminUser); - - $node_type = NodeType::create([ - 'type' => 'article', - 'name' => 'Article', - 'description' => "Use articles for time-sensitive content like news, press releases or blog posts.", - ]); - $node_type->save(); - - FieldStorageConfig::create([ - 'field_name' => 'field_body', - 'entity_type' => 'node', - 'type' => 'text_with_summary', - ])->save(); - FieldConfig::create([ - 'field_name' => 'field_body', - 'label' => 'Body', - 'entity_type' => 'node', - 'bundle' => 'article', - ])->save(); - FieldStorageConfig::create([ - 'field_name' => 'field_image', - 'entity_type' => 'node', - 'type' => 'image', - ])->save(); - FieldConfig::create([ - 'field_name' => 'field_image', - 'label' => 'Image', - 'entity_type' => 'node', - 'bundle' => 'article', - ])->save(); - FieldStorageConfig::create([ - 'field_name' => 'field_image_2', - 'entity_type' => 'node', - 'type' => 'image', - ])->save(); - FieldConfig::create([ - 'field_name' => 'field_image_2', - 'label' => 'Image 2', - 'entity_type' => 'node', - 'bundle' => 'article', - ])->save(); - FieldStorageConfig::create([ - 'field_name' => 'multivalued_field_image', - 'entity_type' => 'node', - 'type' => 'image', - ])->save(); - FieldConfig::create([ - 'field_name' => 'multivalued_field_image', - 'label' => 'Multivalued field image', - 'entity_type' => 'node', - 'bundle' => 'article', - ])->save(); - - entity_get_form_display('node', 'article', 'default') - ->setComponent('field_body', [ - 'type' => 'text_textarea_with_summary', - 'settings' => [ - 'rows' => '9', - 'summary_rows' => '3', - ], - 'weight' => 5, - ]) - ->save(); - } - - public function testFileFieldUi() { - $this->drupalGet('admin/structure/types/manage/article/fields/node.article.field_image'); - - // Ensure the 'Browse available tokens' link is present and correct. - $this->assertLink('Browse available tokens.'); - $this->assertLinkByHref('token/tree'); - - // Ensure that the default file directory value validates correctly. - $this->drupalPostForm(NULL, [], t('Save settings')); - $this->assertText(t('Saved Image configuration.')); - } - - public function testFieldDescriptionTokens() { - $edit = [ - 'description' => 'The site is called [site:name].', - ]; - $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.field_body', $edit, 'Save settings'); - - $this->drupalGet('node/add/article'); - $this->assertText('The site is called Drupal.'); - } - - /** - * Test that tokens are correctly provided and replaced for the image fields. - */ - public function testImageFieldTokens() { - // Generate 2 different test images. - file_unmanaged_copy(\Drupal::root() . '/core/misc/druplicon.png', 'public://example1.png'); - file_unmanaged_copy(\Drupal::root() . '/core/misc/loading.gif', 'public://example2.gif'); - - // Resize the test images so that they will be scaled down during token - // replacement. - $image1 = \Drupal::service('image.factory')->get('public://example1.png'); - $image1->resize(500, 500); - $image1->save(); - $image2 = \Drupal::service('image.factory')->get('public://example2.gif'); - $image2->resize(500, 500); - $image2->save(); - - /** @var \Drupal\file\Entity\File $image1 */ - $image1 = File::create(['uri' => 'public://example1.png']); - $image1->save(); - /** @var \Drupal\file\Entity\File $image2 */ - $image2 = File::create(['uri' => 'public://example2.gif']); - $image2->save(); - - $node = Node::create([ - 'title' => 'Test node title', - 'type' => 'article', - 'field_image' => [ - [ - 'target_id' => $image1->id(), - ], - ], - 'field_image_2' => [ - [ - 'target_id' => $image2->id(), - ], - ], - 'multivalued_field_image' => [ - ['target_id' => $image1->id()], - ['target_id' => $image2->id()], - ], - ]); - $node->save(); - - // Obtain the file size and dimension of the images that will be scaled - // down during token replacement by applying the styles here. - $style_thumbnail = ImageStyle::load('thumbnail'); - $style_thumbnail->createDerivative('public://example1.png', 'public://styles/thumbnail/public/example1-test.png'); - $style_thumbnail->createDerivative('public://example2.gif', 'public://styles/thumbnail/public/example2-test.gif'); - $image_1_thumbnail = \Drupal::service('image.factory')->get('public://styles/thumbnail/public/example1-test.png'); - $image_2_thumbnail = \Drupal::service('image.factory')->get('public://styles/thumbnail/public/example2-test.gif'); - $style_medium = ImageStyle::load('medium'); - $style_medium->createDerivative('public://example1.png', 'public://styles/medium/public/example1-test.png'); - $style_medium->createDerivative('public://example2.gif', 'public://styles/medium/public/example2-test.gif'); - $image_1_medium = \Drupal::service('image.factory')->get('public://styles/medium/public/example1-test.png'); - $image_2_medium = \Drupal::service('image.factory')->get('public://styles/medium/public/example2-test.gif'); - $style_large = ImageStyle::load('large'); - $style_large->createDerivative('public://example1.png', 'public://styles/large/public/example1-test.png'); - $style_large->createDerivative('public://example2.gif', 'public://styles/large/public/example2-test.gif'); - $image_1_large = \Drupal::service('image.factory')->get('public://styles/large/public/example1-test.png'); - $image_2_large = \Drupal::service('image.factory')->get('public://styles/large/public/example2-test.gif'); - - // Delete the image derivatives, to make sure they are re-created. - unlink('public://styles/thumbnail/public/example1-test.png'); - unlink('public://styles/medium/public/example1-test.png'); - unlink('public://styles/large/public/example1-test.png'); - unlink('public://styles/thumbnail/public/example2-test.gif'); - unlink('public://styles/medium/public/example2-test.gif'); - unlink('public://styles/large/public/example2-test.gif'); - - $tokens = [ - // field_image - 'field_image:thumbnail:mimetype' => 'image/png', - 'field_image:medium:mimetype' => 'image/png', - 'field_image:large:mimetype' => 'image/png', - 'field_image:thumbnail:filesize' => $image_1_thumbnail->getFileSize(), - 'field_image:medium:filesize' => $image_1_medium->getFileSize(), - 'field_image:large:filesize' => $image_1_large->getFileSize(), - 'field_image:thumbnail:height' => '100', - 'field_image:medium:height' => '220', - 'field_image:large:height' => '480', - 'field_image:thumbnail:width' => '100', - 'field_image:medium:width' => '220', - 'field_image:large:width' => '480', - 'field_image:thumbnail:uri' => 'public://styles/thumbnail/public/example1.png', - 'field_image:medium:uri' => 'public://styles/medium/public/example1.png', - 'field_image:large:uri' => 'public://styles/large/public/example1.png', - 'field_image:thumbnail:url' => $style_thumbnail->buildUrl('public://example1.png'), - 'field_image:medium:url' => $style_medium->buildUrl('public://example1.png'), - 'field_image:large:url' => $style_large->buildUrl('public://example1.png'), - 'field_image:thumbnail' => $style_thumbnail->buildUrl('public://example1.png'), - 'field_image:medium' => $style_medium->buildUrl('public://example1.png'), - 'field_image:large' => $style_large->buildUrl('public://example1.png'), - // field_image_2 - 'field_image_2:thumbnail:mimetype' => 'image/gif', - 'field_image_2:medium:mimetype' => 'image/gif', - 'field_image_2:large:mimetype' => 'image/gif', - 'field_image_2:thumbnail:filesize' => $image_2_thumbnail->getFileSize(), - 'field_image_2:medium:filesize' => $image_2_medium->getFileSize(), - 'field_image_2:large:filesize' => $image_2_large->getFileSize(), - 'field_image_2:thumbnail:height' => '100', - 'field_image_2:medium:height' => '220', - 'field_image_2:large:height' => '480', - 'field_image_2:thumbnail:width' => '100', - 'field_image_2:medium:width' => '220', - 'field_image_2:large:width' => '480', - 'field_image_2:thumbnail:uri' => 'public://styles/thumbnail/public/example2.gif', - 'field_image_2:medium:uri' => 'public://styles/medium/public/example2.gif', - 'field_image_2:large:uri' => 'public://styles/large/public/example2.gif', - 'field_image_2:thumbnail:url' => $style_thumbnail->buildUrl('public://example2.gif'), - 'field_image_2:medium:url' => $style_medium->buildUrl('public://example2.gif'), - 'field_image_2:large:url' => $style_large->buildUrl('public://example2.gif'), - 'field_image_2:thumbnail' => $style_thumbnail->buildUrl('public://example2.gif'), - 'field_image_2:medium' => $style_medium->buildUrl('public://example2.gif'), - 'field_image_2:large' => $style_large->buildUrl('public://example2.gif'), - // multivalued_field_image:0, test for thumbnail image style only. - 'multivalued_field_image:0:thumbnail:mimetype' => 'image/png', - 'multivalued_field_image:0:thumbnail:filesize' => $image_1_thumbnail->getFileSize(), - 'multivalued_field_image:0:thumbnail:height' => '100', - 'multivalued_field_image:0:thumbnail:width' => '100', - 'multivalued_field_image:0:thumbnail:uri' => 'public://styles/thumbnail/public/example1.png', - 'multivalued_field_image:0:thumbnail:url' => $style_thumbnail->buildUrl('public://example1.png'), - 'multivalued_field_image:0:thumbnail' => $style_thumbnail->buildUrl('public://example1.png'), - // multivalued_field_image:1, test for medium image style only. - 'multivalued_field_image:1:medium:mimetype' => 'image/gif', - 'multivalued_field_image:1:medium:filesize' => $image_2_medium->getFileSize(), - 'multivalued_field_image:1:medium:height' => '220', - 'multivalued_field_image:1:medium:width' => '220', - 'multivalued_field_image:1:medium:uri' => 'public://styles/medium/public/example2.gif', - 'multivalued_field_image:1:medium:url' => $style_medium->buildUrl('public://example2.gif'), - 'multivalued_field_image:1:medium' => $style_medium->buildUrl('public://example2.gif'), - ]; - $this->assertTokens('node', ['node' => $node], $tokens); - - /** @var \Drupal\token\Token $token_service */ - $token_service = \Drupal::service('token'); - - // Test one of the image style's token info for cardinality 1 image field. - $token_info = $token_service->getTokenInfo('node-field_image', 'thumbnail'); - $this->assertEqual('Thumbnail (100×100)', $token_info['name']); - $this->assertEqual('Represents the image in the given image style.', $token_info['description']); - - // Test one of the image style's token info for a multivalued image field. - $token_info = $token_service->getTokenInfo('node-multivalued_field_image', 'medium'); - $this->assertEqual('Medium (220×220)', $token_info['name']); - $this->assertEqual('Represents the image in the given image style.', $token_info['description']); - - // Test few of the image styles' properties token info. - $token_info = $token_service->getTokenInfo('image_with_image_style', 'mimetype'); - $this->assertEqual('MIME type', $token_info['name']); - $this->assertEqual('The MIME type (image/png, image/bmp, etc.) of the image.', $token_info['description']); - - $token_info = $token_service->getTokenInfo('image_with_image_style', 'filesize'); - $this->assertEqual('File size', $token_info['name']); - $this->assertEqual('The file size of the image.', $token_info['description']); - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenMenuTest.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenMenuTest.php deleted file mode 100644 index 1b2eda091..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenMenuTest.php +++ /dev/null @@ -1,459 +0,0 @@ -drupalCreateContentType(['type' => 'page']); - // Add a menu. - $menu = Menu::create([ - 'id' => 'main-menu', - 'label' => 'Main menu', - 'description' => 'The Main menu is used on many sites to show the major sections of the site, often in a top navigation bar.', - ]); - $menu->save(); - - // Place the menu block. - $this->drupalPlaceBlock('system_menu_block:main-menu'); - - // Add a root link. - /** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $root_link */ - $root_link = MenuLinkContent::create([ - 'link' => ['uri' => 'internal:/admin'], - 'title' => 'Administration', - 'menu_name' => 'main-menu', - ]); - $root_link->save(); - - // Add another link with the root link as the parent. - /** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $parent_link */ - $parent_link = MenuLinkContent::create([ - 'link' => ['uri' => 'internal:/admin/config'], - 'title' => 'Configuration', - 'menu_name' => 'main-menu', - 'parent' => $root_link->getPluginId(), - ]); - $parent_link->save(); - - // Test menu link tokens. - $tokens = [ - 'id' => $parent_link->getPluginId(), - 'title' => 'Configuration', - 'menu' => 'Main menu', - 'menu:name' => 'Main menu', - 'menu:machine-name' => $menu->id(), - 'menu:description' => 'The Main menu is used on many sites to show the major sections of the site, often in a top navigation bar.', - 'menu:menu-link-count' => '2', - 'menu:edit-url' => Url::fromRoute('entity.menu.edit_form', ['menu' => 'main-menu'], ['absolute' => TRUE])->toString(), - 'url' => Url::fromRoute('system.admin_config', [], ['absolute' => TRUE])->toString(), - 'url:absolute' => Url::fromRoute('system.admin_config', [], ['absolute' => TRUE])->toString(), - 'url:relative' => Url::fromRoute('system.admin_config', [], ['absolute' => FALSE])->toString(), - 'url:path' => '/admin/config', - 'url:alias' => '/admin/config', - 'edit-url' => Url::fromRoute('entity.menu_link_content.canonical', ['menu_link_content' => $parent_link->id()], ['absolute' => TRUE])->toString(), - 'parent' => 'Administration', - 'parent:id' => $root_link->getPluginId(), - 'parent:title' => 'Administration', - 'parent:menu' => 'Main menu', - 'parent:parent' => NULL, - 'parents' => 'Administration', - 'parents:count' => 1, - 'parents:keys' => $root_link->getPluginId(), - 'root' => 'Administration', - 'root:id' => $root_link->getPluginId(), - 'root:parent' => NULL, - 'root:root' => NULL, - ]; - $this->assertTokens('menu-link', ['menu-link' => $parent_link], $tokens); - - // Add a node. - $node = $this->drupalCreateNode(); - - // Allow main menu for this node type. - //$this->config('menu.entity.node.' . $node->getType())->set('available_menus', ['main-menu'])->save(); - - // Add a node menu link. - /** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $node_link */ - $node_link = MenuLinkContent::create([ - 'link' => ['uri' => 'entity:node/' . $node->id()], - 'title' => 'Node link', - 'parent' => $parent_link->getPluginId(), - 'menu_name' => 'main-menu', - ]); - $node_link->save(); - - // Test [node:menu] tokens. - $tokens = [ - 'menu-link' => 'Node link', - 'menu-link:id' => $node_link->getPluginId(), - 'menu-link:title' => 'Node link', - 'menu-link:menu' => 'Main menu', - 'menu-link:url' => $node->toUrl('canonical', ['absolute' => TRUE])->toString(), - 'menu-link:url:path' => '/node/' . $node->id(), - 'menu-link:edit-url' => $node_link->url('edit-form', ['absolute' => TRUE]), - 'menu-link:parent' => 'Configuration', - 'menu-link:parent:id' => $parent_link->getPluginId(), - 'menu-link:parents' => 'Administration, Configuration', - 'menu-link:parents:count' => 2, - 'menu-link:parents:keys' => $root_link->getPluginId() . ', ' . $parent_link->getPluginId(), - 'menu-link:root' => 'Administration', - 'menu-link:root:id' => $root_link->getPluginId(), - ]; - $this->assertTokens('node', ['node' => $node], $tokens); - - // Reload the node which will not have $node->menu defined and re-test. - $loaded_node = Node::load($node->id()); - $this->assertTokens('node', ['node' => $loaded_node], $tokens); - - // Regression test for http://drupal.org/node/1317926 to ensure the - // original node object is not changed when calling menu_node_prepare(). - $this->assertTrue(!isset($loaded_node->menu), t('The $node->menu property was not modified during token replacement.'), 'Regression'); - - // Now add a node with a menu-link from the UI and ensure it works. - $this->drupalLogin($this->drupalCreateUser([ - 'create page content', - 'edit any page content', - 'administer menu', - 'administer nodes', - 'administer content types', - 'access administration pages', - ])); - // Setup node type menu options. - $edit = [ - 'menu_options[main-menu]' => 1, - 'menu_options[main]' => 1, - 'menu_parent' => 'main-menu:', - ]; - $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type')); - - // Use a menu-link token in the body. - $this->drupalGet('node/add/page'); - $this->drupalPostForm(NULL, [ - // This should get replaced on save. - // @see token_module_test_node_presave() - 'title[0][value]' => 'Node menu title test', - 'body[0][value]' => 'This is a [node:menu-link:title] token to the menu link title', - 'menu[enabled]' => 1, - 'menu[title]' => 'Test preview', - ], t('Save')); - $node = $this->drupalGetNodeByTitle('Node menu title test'); - $this->assertEqual('This is a Test preview token to the menu link title', $node->body->value); - - // Disable the menu link, save the node and verify that the menu link is - // no longer displayed. - $link = menu_ui_get_menu_link_defaults($node); - $this->drupalPostForm('admin/structure/menu/manage/main-menu', ['links[menu_plugin_id:' . $link['id'] . '][enabled]' => FALSE], t('Save')); - $this->assertText('Menu Main menu has been updated.'); - $this->drupalPostForm('node/' . $node->id() . '/edit', [], t('Save')); - $this->assertNoLink('Test preview'); - - // Now test a parent link and token. - $this->drupalGet('node/add/page'); - // Make sure that the previous node save didn't result in two menu-links - // being created by the computed menu-link ER field. - // @see token_entity_base_field_info() - // @see token_node_menu_link_submit() - $selects = $this->cssSelect('select[name="menu[menu_parent]"]'); - $select = reset($selects); - $options = $this->getAllOptions($select); - // Filter to items with title containing 'Test preview'. - $options = array_filter($options, function (\SimpleXMLElement $item) { - return strpos((string) $item[0], 'Test preview') !== FALSE; - }); - $this->assertEqual(1, count($options)); - $this->drupalPostForm(NULL, [ - 'title[0][value]' => 'Node menu title parent path test', - 'body[0][value]' => 'This is a [node:menu-link:parent:url:path] token to the menu link parent', - 'menu[enabled]' => 1, - 'menu[title]' => 'Child link', - 'menu[menu_parent]' => 'main-menu:' . $parent_link->getPluginId(), - ], t('Save')); - $node = $this->drupalGetNodeByTitle('Node menu title parent path test'); - $this->assertEqual('This is a /admin/config token to the menu link parent', $node->body->value); - - // Now edit the node and update the parent and title. - $this->drupalPostForm('node/' . $node->id() . '/edit', [ - 'menu[menu_parent]' => 'main-menu:' . $node_link->getPluginId(), - 'title[0][value]' => 'Node menu title edit parent path test', - 'body[0][value]' => 'This is a [node:menu-link:parent:url:path] token to the menu link parent', - ], t('Save')); - $node = $this->drupalGetNodeByTitle('Node menu title edit parent path test', TRUE); - $this->assertEqual(sprintf('This is a /node/%d token to the menu link parent', $loaded_node->id()), $node->body->value); - - // Make sure that the previous node edit didn't result in two menu-links - // being created by the computed menu-link ER field. - // @see token_entity_base_field_info() - // @see token_node_menu_link_submit() - $this->drupalGet('node/add/page'); - $selects = $this->cssSelect('select[name="menu[menu_parent]"]'); - $select = reset($selects); - $options = $this->getAllOptions($select); - // Filter to items with title containing 'Test preview'. - $options = array_filter($options, function (\SimpleXMLElement $item) { - return strpos((string) $item[0], 'Child link') !== FALSE; - }); - $this->assertEqual(1, count($options)); - - // Now add a new node with no menu. - $this->drupalGet('node/add/page'); - $this->drupalPostForm(NULL, [ - 'title[0][value]' => 'Node menu adding menu later test', - 'body[0][value]' => 'Going to add a menu link on edit', - 'menu[enabled]' => 0, - ], t('Save')); - $node = $this->drupalGetNodeByTitle('Node menu adding menu later test'); - // Now edit it and add a menu item. - $this->drupalGet('node/' . $node->id() . '/edit'); - $this->drupalPostForm(NULL, [ - 'title[0][value]' => 'Node menu adding menu later test', - 'body[0][value]' => 'This is a [node:menu-link:parent:url:path] token to the menu link parent', - 'menu[enabled]' => 1, - 'menu[title]' => 'Child link', - 'menu[menu_parent]' => 'main-menu:' . $parent_link->getPluginId(), - ], t('Save')); - $node = $this->drupalGetNodeByTitle('Node menu adding menu later test', TRUE); - $this->assertEqual('This is a /admin/config token to the menu link parent', $node->body->value); - // And make sure the menu link exists with the right URI. - $link = menu_ui_get_menu_link_defaults($node); - $this->assertTrue(!empty($link['entity_id'])); - $query = \Drupal::entityQuery('menu_link_content') - ->condition('link.uri', 'entity:node/' . $node->id()) - ->sort('id', 'ASC') - ->range(0, 1); - $result = $query->execute(); - $this->assertTrue($result); - - // Create a node with a menu link and create 2 menu links linking to this - // node after. Verify that the menu link provided by the node has priority. - $node_title = $this->randomMachineName(); - $edit = [ - 'title[0][value]' => $node_title, - 'menu[enabled]' => 1, - 'menu[title]' => 'menu link provided by node', - ]; - $this->drupalPostForm('node/add/page', $edit, t('Save')); - $this->assertText('page ' . $node_title . ' has been created'); - $node = $this->drupalGetNodeByTitle($node_title); - - $menu_ui_link1 = MenuLinkContent::create([ - 'link' => ['uri' => 'entity:node/' . $node->id()], - 'title' => 'menu link 1 provided by menu ui', - 'menu_name' => 'main-menu', - ]); - $menu_ui_link1->save(); - - $menu_ui_link2 = MenuLinkContent::create([ - 'link' => ['uri' => 'entity:node/' . $node->id()], - 'title' => 'menu link 2 provided by menu ui', - 'menu_name' => 'main-menu', - ]); - $menu_ui_link2->save(); - - $tokens = [ - 'menu-link' => 'menu link provided by node', - 'menu-link:title' => 'menu link provided by node', - ]; - $this->assertTokens('node', ['node' => $node], $tokens); - } - - /** - * Tests that the module doesn't affect integrity of the menu, when - * translating them and that menu links tokens are correct. - */ - function testMultilingualMenu() { - // Place the menu block. - $this->drupalPlaceBlock('system_menu_block:main'); - - // Add a second language. - $language = ConfigurableLanguage::create([ - 'id' => 'de', - 'label' => 'German', - ]); - $language->save(); - - // Create the article content type. - $node_type = NodeType::create([ - 'type' => 'article', - ]); - $node_type->save(); - - $permissions = [ - 'access administration pages', - 'administer content translation', - 'administer content types', - 'administer languages', - 'create content translations', - 'create article content', - 'edit any article content', - 'translate any entity', - 'administer menu', - ]; - $this->drupalLogin($this->drupalCreateUser($permissions)); - - // Enable translation for articles and menu links. - $this->drupalGet('admin/config/regional/content-language'); - $edit = [ - 'entity_types[node]' => TRUE, - 'entity_types[menu_link_content]' => TRUE, - 'settings[node][article][translatable]' => TRUE, - 'settings[node][article][fields][title]' => TRUE, - 'settings[menu_link_content][menu_link_content][translatable]' => TRUE, - ]; - $this->drupalPostForm(NULL, $edit, t('Save configuration')); - $this->assertText('Settings successfully updated.'); - - // Create an english node with an english menu. - $this->drupalGet('/node/add/article'); - $edit = [ - 'title[0][value]' => 'English test node with menu', - 'menu[enabled]' => TRUE, - 'menu[title]' => 'English menu title', - ]; - $this->drupalPostForm('/node/add/article', $edit, t('Save')); - $this->assertText('English test node with menu has been created.'); - - // Add a german translation. - $this->drupalGet('node/1/translations'); - $this->clickLink('Add'); - $edit = [ - 'title[0][value]' => 'German test node with menu', - 'menu[enabled]' => TRUE, - 'menu[title]' => 'German menu title', - ]; - $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); - $this->assertText('German test node with menu has been updated.'); - - // Verify that the menu links are correct. - $this->drupalGet('node/1'); - $this->assertLink('English menu title'); - $this->drupalGet('de/node/1'); - $this->assertLink('German menu title'); - - // Verify that tokens are correct. - $node = Node::load(1); - $this->assertTokens('node', ['node' => $node], ['menu-link' => 'English menu title']); - $this->assertTokens('node', ['node' => $node], [ - 'menu-link' => 'German menu title', - 'menu-link:title' => 'German menu title', - ], ['langcode' => 'de']); - - // Get the menu link and create a child menu link to assert parent and root - // tokens. - $url = $node->toUrl(); - /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */ - $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - $links = $menu_link_manager->loadLinksByRoute($url->getRouteName(), $url->getRouteParameters()); - $link = reset($links); - - $base_options = [ - 'provider' => 'menu_test', - 'menu_name' => 'menu_test', - ]; - $child_1 = $base_options + [ - 'title' => 'child_1 title EN', - 'link' => ['uri' => 'internal:/menu-test/hierarchy/parent/child_1'], - 'parent' => $link->getPluginId(), - 'langcode' => 'en', - ]; - $child_1 = MenuLinkContent::create($child_1); - $child_1->save(); - - // Add the german translation. - $child_1->addTranslation('de', ['title' => 'child_1 title DE'] + $child_1->toArray()); - $child_1->save(); - - $this->assertTokens('menu-link', ['menu-link' => $child_1], [ - 'title' => 'child_1 title EN', - 'parents' => 'English menu title', - 'root' => 'English menu title', - ]); - $this->assertTokens('menu-link', ['menu-link' => $child_1], [ - 'title' => 'child_1 title DE', - 'parents' => 'German menu title', - 'root' => 'German menu title', - ], ['langcode' => 'de']); - } - - /** - * Tests menu link parents token. - */ - public function testMenuLinkParentsToken() { - // Create a menu with a simple link hierarchy : - // - parent - // - child-1 - // - child-1-1 - Menu::create([ - 'id' => 'menu_test', - 'label' => 'Test menu', - ])->save(); - $base_options = [ - 'provider' => 'menu_test', - 'menu_name' => 'menu_test', - ]; - $parent = $base_options + [ - 'title' => 'parent title', - 'link' => ['uri' => 'internal:/menu-test/hierarchy/parent'], - ]; - $parent = MenuLinkContent::create($parent); - $parent->save(); - $child_1 = $base_options + [ - 'title' => 'child_1 title', - 'link' => ['uri' => 'internal:/menu-test/hierarchy/parent/child_1'], - 'parent' => $parent->getPluginId(), - ]; - $child_1 = MenuLinkContent::create($child_1); - $child_1->save(); - $child_1_1 = $base_options + [ - 'title' => 'child_1_1 title', - 'link' => ['uri' => 'internal:/menu-test/hierarchy/parent/child_1/child_1_1'], - 'parent' => $child_1->getPluginId(), - ]; - $child_1_1 = MenuLinkContent::create($child_1_1); - $child_1_1->save(); - - $this->assertTokens('menu-link', ['menu-link' => $child_1_1], ['parents' => 'parent title, child_1 title']); - - // Change the parent of child_1_1 to 'parent' at the entity level. - $child_1_1->parent->value = $parent->getPluginId(); - $child_1_1->save(); - - $this->assertTokens('menu-link', ['menu-link' => $child_1_1], ['parents' => 'parent title']); - - // Change the parent of child_1_1 to 'main', at the entity level. - $child_1_1->parent->value = ''; - $child_1_1->save(); - - // The token shouldn't have been generated; the menu link has no parent. - $this->assertNoTokens('menu-link', ['menu-link' => $child_1_1], ['parents']); - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenTestBase.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenTestBase.php deleted file mode 100644 index 814ba776f..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenTestBase.php +++ /dev/null @@ -1,21 +0,0 @@ -assertTokens($type, $data, [$token => $expected], $options); - } - - function assertTokens($type, array $data, array $tokens, array $options = []) { - $input = $this->mapTokenNames($type, array_keys($tokens)); - $bubbleable_metadata = new BubbleableMetadata(); - $replacements = \Drupal::token()->generate($type, $input, $data, $options, $bubbleable_metadata); - foreach ($tokens as $name => $expected) { - $token = $input[$name]; - if (!isset($expected)) { - $this->assertTrue(!isset($replacements[$token]), t("Token value for @token was not generated.", ['@type' => $type, '@token' => $token])); - } - elseif (!isset($replacements[$token])) { - $this->fail(t("Token value for @token was not generated.", ['@type' => $type, '@token' => $token])); - } - elseif (!empty($options['regex'])) { - $this->assertTrue(preg_match('/^' . $expected . '$/', $replacements[$token]), t("Token value for @token was '@actual', matching regular expression pattern '@expected'.", ['@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected])); - } - else { - $this->assertEqual($replacements[$token], $expected, t("Token value for @token was '@actual', expected value '@expected'.", ['@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected])); - } - } - - return $replacements; - } - - function mapTokenNames($type, array $tokens = []) { - $return = []; - foreach ($tokens as $token) { - $return[$token] = "[$type:$token]"; - } - return $return; - } - - function assertNoTokens($type, array $data, array $tokens, array $options = []) { - $input = $this->mapTokenNames($type, $tokens); - $bubbleable_metadata = new BubbleableMetadata(); - $replacements = \Drupal::token()->generate($type, $input, $data, $options, $bubbleable_metadata); - foreach ($tokens as $name) { - $token = $input[$name]; - $this->assertTrue(!isset($replacements[$token]), t("Token value for @token was not generated.", ['@type' => $type, '@token' => $token])); - } - } - - function saveAlias($source, $alias, $language = Language::LANGCODE_NOT_SPECIFIED) { - $alias = [ - 'source' => $source, - 'alias' => $alias, - 'language' => $language, - ]; - \Drupal::service('path.alias_storage')->save($alias['source'], $alias['alias']); - return $alias; - } - - function saveEntityAlias($entity_type, EntityInterface $entity, $alias, $language = Language::LANGCODE_NOT_SPECIFIED) { - $uri = $entity->toUrl()->toArray(); - return $this->saveAlias($uri['path'], $alias, $language); - } - - /** - * Make a page request and test for token generation. - */ - function assertPageTokens($url, array $tokens, array $data = [], array $options = []) { - if (empty($tokens)) { - return TRUE; - } - - $token_page_tokens = [ - 'tokens' => $tokens, - 'data' => $data, - 'options' => $options, - ]; - \Drupal::state()->set('token_page_tokens', $token_page_tokens); - - $options += ['url_options' => []]; - $this->drupalGet($url, $options['url_options']); - $this->refreshVariables(); - $result = \Drupal::state()->get('token_page_tokens', []); - - if (!isset($result['values']) || !is_array($result['values'])) { - return $this->fail('Failed to generate tokens.'); - } - - foreach ($tokens as $token => $expected) { - if (!isset($expected)) { - $this->assertTrue(!isset($result['values'][$token]) || $result['values'][$token] === $token, t("Token value for @token was not generated.", ['@token' => $token])); - } - elseif (!isset($result['values'][$token])) { - $this->fail(t('Failed to generate token @token.', ['@token' => $token])); - } - else { - $this->assertIdentical($result['values'][$token], (string) $expected, t("Token value for @token was '@actual', expected value '@expected'.", ['@token' => $token, '@actual' => $result['values'][$token], '@expected' => $expected])); - } - } - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenURLTest.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenURLTest.php deleted file mode 100644 index 0a3bed0fc..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenURLTest.php +++ /dev/null @@ -1,51 +0,0 @@ -saveAlias('/node/1', '/first-node'); - } - - function testURLTokens() { - $url = new Url('entity.node.canonical', ['node' => 1]); - $tokens = [ - 'absolute' => $url->setAbsolute()->toString(), - 'relative' => $url->setAbsolute(FALSE)->toString(), - 'path' => '/first-node', - 'brief' => preg_replace(['!^https?://!', '!/$!'], '', $url->setAbsolute()->toString()), - 'args:value:0' => 'first-node', - 'args:value:1' => NULL, - 'args:value:N' => NULL, - 'unaliased' => $url->setAbsolute()->setOption('alias', TRUE)->toString(), - 'unaliased:relative' => $url->setAbsolute(FALSE)->setOption('alias', TRUE)->toString(), - 'unaliased:path' => '/node/1', - 'unaliased:brief' => preg_replace(['!^https?://!', '!/$!'], '', $url->setAbsolute()->setOption('alias', TRUE)->toString()), - 'unaliased:args:value:0' => 'node', - 'unaliased:args:value:1' => '1', - 'unaliased:args:value:2' => NULL, - // Deprecated tokens. - 'alias' => '/first-node', - ]; - $this->assertTokens('url', ['url' => new Url('entity.node.canonical', ['node' => 1])], $tokens); - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/TokenUserTest.php b/sites/all/modules/contrib/dev/token/src/Tests/TokenUserTest.php deleted file mode 100644 index cb3203470..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/TokenUserTest.php +++ /dev/null @@ -1,127 +0,0 @@ -account = $this->drupalCreateUser([ - 'administer users', - 'administer account settings', - 'access content', - ]); - $this->drupalLogin($this->account); - } - - /** - * Tests the user releated tokens. - */ - public function testUserTokens() { - // Enable user pictures. - \Drupal::state()->set('user_pictures', 1); - \Drupal::state()->set('user_picture_file_size', ''); - - // Set up the pictures directory. - $picture_path = file_default_scheme() . '://' . \Drupal::state()->get('user_picture_path', 'pictures'); - if (!file_prepare_directory($picture_path, FILE_CREATE_DIRECTORY)) { - $this->fail('Could not create directory ' . $picture_path . '.'); - } - - // Add a user picture to the account. - $image = current($this->drupalGetTestFiles('image')); - $edit = ['files[user_picture_0]' => \Drupal::service('file_system')->realpath($image->uri)]; - $this->drupalPostForm('user/' . $this->account->id() . '/edit', $edit, t('Save')); - - $storage = \Drupal::entityTypeManager()->getStorage('user'); - - // Load actual user data from database. - $storage->resetCache(); - $this->account = $storage->load($this->account->id()); - $this->assertTrue(!empty($this->account->user_picture->target_id), 'User picture uploaded.'); - - $picture = [ - '#theme' => 'user_picture', - '#account' => $this->account, - ]; - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - $user_tokens = [ - 'picture' => $renderer->renderPlain($picture), - 'picture:fid' => $this->account->user_picture->target_id, - 'picture:size-raw' => 125, - 'ip-address' => NULL, - 'roles' => implode(', ', $this->account->getRoles()), - ]; - $this->assertTokens('user', ['user' => $this->account], $user_tokens); - - // Remove the simpletest-created user role. - $roles = $this->account->getRoles(); - $this->account->removeRole(end($roles)); - $this->account->save(); - - // Remove the user picture field and reload the user. - FieldStorageConfig::loadByName('user', 'user_picture')->delete(); - $storage->resetCache(); - $this->account = $storage->load($this->account->id()); - - $user_tokens = [ - 'picture' => NULL, - 'picture:fid' => NULL, - 'ip-address' => NULL, - 'roles' => 'authenticated', - 'roles:keys' => AccountInterface::AUTHENTICATED_ROLE, - ]; - $this->assertTokens('user', ['user' => $this->account], $user_tokens); - - // The ip address token should work for the current user token type. - $tokens = [ - 'ip-address' => \Drupal::request()->getClientIp(), - ]; - $this->assertTokens('current-user', [], $tokens); - - $anonymous = new AnonymousUserSession(); - $tokens = [ - 'roles' => 'anonymous', - 'roles:keys' => AccountInterface::ANONYMOUS_ROLE, - ]; - $this->assertTokens('user', ['user' => $anonymous], $tokens); - } - - /** - * Test user account settings. - */ - public function testUserAccountSettings() { - $this->drupalGet('admin/config/people/accounts'); - $this->assertText('The list of available tokens that can be used in e-mails is provided below.'); - $this->assertLink('Browse available tokens.'); - $this->assertLinkByHref('token/tree'); - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/Tree/AutocompleteTest.php b/sites/all/modules/contrib/dev/token/src/Tests/Tree/AutocompleteTest.php deleted file mode 100644 index 30b3ea416..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/Tree/AutocompleteTest.php +++ /dev/null @@ -1,61 +0,0 @@ -drupalGetJSON($url); - - $this->assertTrue(isset($response['[node:nid]'])); - $this->assertTrue(isset($response['[node:author]'])); - $this->assertTrue(isset($response['[node:url]'])); - $this->assertTrue(isset($response['[node:url:'])); - - $url = $url_prefix . 'Title of [node:url:'; - $response = $this->drupalGetJSON($url); - - $this->assertTrue(isset($response['[node:url:path]'])); - $this->assertTrue(isset($response['[node:url:absolute]'])); - } - - /** - * Tests autocomplete for user tokens. - */ - public function testUserAutocomplete() { - $url_prefix = "token/autocomplete/user/"; - - $url = $url_prefix . 'Name of the [us'; - $response = $this->drupalGetJSON($url); - - $this->assertTrue(isset($response['[user:uid]'])); - $this->assertTrue(isset($response['[user:original]'])); - $this->assertTrue(isset($response['[user:url]'])); - $this->assertTrue(isset($response['[user:url:'])); - - $url = $url_prefix . 'Title of [user:original:'; - $response = $this->drupalGetJSON($url); - - $this->assertTrue(isset($response['[user:original:uid]'])); - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/Tree/HelpPageTest.php b/sites/all/modules/contrib/dev/token/src/Tests/Tree/HelpPageTest.php deleted file mode 100644 index a957e3235..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/Tree/HelpPageTest.php +++ /dev/null @@ -1,69 +0,0 @@ -account = $this->drupalCreateUser(['access administration pages']); - $this->drupalLogin($this->account); - } - - /** - * Tests the token browser on the token help page. - */ - public function testHelpPageTree() { - $this->drupalGet('admin/help/token'); - $this->assertText('The list of the currently available tokens on this site are shown below.'); - - $this->assertTokenGroup('Current date'); - $this->assertTokenGroup('Site information'); - - $this->assertTokenInTree('[current-date:html_date]', 'current-date'); - $this->assertTokenInTree('[current-date:html_week]', 'current-date'); - $this->assertTokenInTree('[date:html_date]', 'date'); - $this->assertTokenInTree('[date:html_week]', 'date'); - - $this->assertTokenInTree('[current-user:account-name]', 'current-user'); - $this->assertTokenInTree('[user:account-name]', 'user'); - - $this->assertTokenInTree('[current-page:url:unaliased]', 'current-page--url'); - $this->assertTokenInTree('[current-page:url:unaliased:args]', 'current-page--url--unaliased'); - $this->assertTokenInTree('[user:original:account-name]', 'user--original'); - - // Assert some of the restricted tokens to ensure they are shown. - $this->assertTokenInTree('[user:one-time-login-url]', 'user'); - $this->assertTokenInTree('[user:original:cancel-url]', 'user--original'); - - // The Array token is marked as nested, so it should not show up as a top - // level token, only nested under another token. For instance, user:roles - // is of type Array and tokens of type Array have 'nested' setting true. - $this->assertTokenNotGroup('Array'); - $this->assertTokenNotGroup('user:roles'); - $this->assertTokenInTree('[user:roles]', 'user'); - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/Tree/TokenTreeTestTrait.php b/sites/all/modules/contrib/dev/token/src/Tests/Tree/TokenTreeTestTrait.php deleted file mode 100644 index dc70a23b8..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/Tree/TokenTreeTestTrait.php +++ /dev/null @@ -1,131 +0,0 @@ -xpath('//tr[contains(@class, "token-group")]/td[1]'); - return array_map(function ($item) { - return (string) $item; - }, $groups); - } - - /** - * Check to see if the specified token group is present in the token browser. - * - * @param string $token_group - * The name of the token group. - * @param string $message - * (optional) A message to display with the assertion. - * @param string $group - * (optional) The group this message is in, which is displayed in a column - * in test output. - */ - protected function assertTokenGroup($token_group, $message = '', $group = 'Other') { - $groups = $this->getTokenGroups(); - - if (!$message) { - $message = "Token group $token_group found."; - } - - $this->assertTrue(in_array($token_group, $groups), $message, $group); - } - - /** - * Check to see if the specified token group is not present in the token - * browser. - * - * @param string $token_group - * The name of the token group. - * @param string $message - * (optional) A message to display with the assertion. - * @param string $group - * (optional) The group this message is not in, which is displayed in a - * column in test output. - */ - protected function assertTokenNotGroup($token_group, $message = '', $group = 'Other') { - $groups = $this->getTokenGroups(); - - if (!$message) { - $message = "Token group $token_group not found."; - } - - $this->assertFalse(in_array($token_group, $groups), $message, $group); - } - - /** - * Check to see if the specified token is present in the token browser. - * - * @param $token - * The token name with the surrounding square brackets []. - * @param string $parent - * (optional) The parent CSS identifier of this token. - * @param string $message - * (optional) A message to display with the assertion. - * @param string $group - * (optional) The group this message is in, which is displayed in a column - * in test output. - */ - protected function assertTokenInTree($token, $parent = '', $message = '', $group = 'Other') { - $xpath = $this->getXpathForTokenInTree($token, $parent); - - if (!$message) { - $message = "Token $token found."; - } - - $this->assertIdentical(1, count($this->xpath($xpath)), $message, $group); - } - - /** - * Check to see if the specified token is present in the token browser. - * - * @param $token - * The token name with the surrounding square brackets []. - * @param string $parent - * (optional) The parent CSS identifier of this token. - * @param string $message - * (optional) A message to display with the assertion. - * @param string $group - * (optional) The group this message is in, which is displayed in a column - * in test output. - */ - protected function assertTokenNotInTree($token, $parent = '', $message = '', $group = 'Other') { - $xpath = $this->getXpathForTokenInTree($token, $parent); - - if (!$message) { - $message = "Token $token not found."; - } - - $this->assertIdentical(0, count($this->xpath($xpath)), $message, $group); - } - - /** - * Get xpath to check for token in tree. - * - * @param $token - * The token name with the surrounding square brackets []. - * @param string $parent - * (optional) The parent CSS identifier of this token. - * - * @return string - * The xpath to check for the token and parent. - */ - protected function getXpathForTokenInTree($token, $parent = '') { - $xpath = "//tr"; - if ($parent) { - $xpath .= '[@data-tt-parent-id="token-' . $parent . '"]'; - } - $xpath .= '/td[contains(@class, "token-key") and text() = "' . $token . '"]'; - return $xpath; - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Tests/Tree/TreeTest.php b/sites/all/modules/contrib/dev/token/src/Tests/Tree/TreeTest.php deleted file mode 100644 index 7c7243476..000000000 --- a/sites/all/modules/contrib/dev/token/src/Tests/Tree/TreeTest.php +++ /dev/null @@ -1,148 +0,0 @@ -account = $this->drupalCreateUser(['administer account settings']); - $this->drupalLogin($this->account); - } - - /** - * Test various tokens that are possible on the site. - */ - public function testAllTokens() { - $this->drupalGet($this->getTokenTreeUrl(['token_types' => 'all'])); - - $this->assertTokenGroup('Current date'); - $this->assertTokenGroup('Site information'); - - $this->assertTokenInTree('[current-date:html_date]', 'current-date'); - $this->assertTokenInTree('[current-date:html_week]', 'current-date'); - $this->assertTokenInTree('[date:html_date]', 'date'); - $this->assertTokenInTree('[date:html_week]', 'date'); - - $this->assertTokenInTree('[current-user:account-name]', 'current-user'); - $this->assertTokenInTree('[user:account-name]', 'user'); - - $this->assertTokenInTree('[current-page:url:unaliased]', 'current-page--url'); - $this->assertTokenInTree('[current-page:url:unaliased:args]', 'current-page--url--unaliased'); - $this->assertTokenInTree('[user:original:account-name]', 'user--original'); - } - - /** - * Test various tokens that are possible on the site. - */ - public function testGlobalTokens() { - $this->drupalGet($this->getTokenTreeUrl()); - - $this->assertTokenGroup('Current date'); - $this->assertTokenGroup('Site information'); - - // Assert that non-global tokens are not listed. - $this->assertTokenNotInTree('[user:account-name]', 'user'); - $this->assertTokenNotInTree('[user:original:account-name]', 'user--original'); - - // Assert some of the global tokens, just to be sure. - $this->assertTokenInTree('[current-date:html_date]', 'current-date'); - $this->assertTokenInTree('[current-date:html_week]', 'current-date'); - - $this->assertTokenInTree('[current-user:account-name]', 'current-user'); - - $this->assertTokenInTree('[current-page:url:unaliased]', 'current-page--url'); - $this->assertTokenInTree('[current-page:url:unaliased:args]', 'current-page--url--unaliased'); - } - - /** - * Tests if the token browser displays the user tokens. - */ - public function testUserTokens() { - $this->drupalGet($this->getTokenTreeUrl(['token_types' => ['user']])); - - $this->assertTokenGroup('Users'); - - $this->assertTokenInTree('[user:account-name]', 'user'); - $this->assertTokenInTree('[user:original:account-name]', 'user--original'); - - // Assert some of the restricted tokens to ensure they are not shown. - $this->assertTokenNotInTree('[user:one-time-login-url]', 'user'); - $this->assertTokenNotInTree('[user:original:cancel-url]', 'user--original'); - - // Request with show_restricted set to TRUE to show restricted tokens and - // check for them. - $this->drupalGet($this->getTokenTreeUrl(['token_types' => ['user'], 'show_restricted' => TRUE])); - $this->assertEqual('MISS', $this->drupalGetHeader('x-drupal-dynamic-cache'), 'Cache was not hit'); - $this->assertTokenInTree('[user:one-time-login-url]', 'user'); - $this->assertTokenInTree('[user:original:cancel-url]', 'user--original'); - } - - /** - * Tests if the token browser displays the node tokens. - */ - public function testNodeTokens() { - $this->drupalGet($this->getTokenTreeUrl(['token_types' => ['node']])); - - $this->assertTokenGroup('Nodes'); - - $this->assertTokenInTree('[node:body]', 'node'); - $this->assertTokenInTree('[node:author:original:account-name]', 'node--author--original'); - } - - /** - * Get the URL for the token tree based on the specified options. - * - * The token tree route's URL requires CSRF and cannot be generated in the - * test code. The CSRF token generated using the test runner's session is - * different from the session inside the test environment. This is why the - * link has to be generated inside the environment. - * - * This function calls a page in token_module_test module which generates the - * link and the token. This then replaces the options query parameter with the - * specified options. - * - * The page also uses a title callback to set title to a render array, which - * allows us to test if [current-page:title] works properly. - * - * @param array $options - * The options for the token tree browser. - * - * @return string - * The complete URL of the token tree browser with the CSRF token. - */ - protected function getTokenTreeUrl($options = []) { - $this->drupalGet('token_module_test/browse'); - $this->assertTitle('Available Tokens | Drupal'); - $links = $this->xpath('//a[contains(@href, :href)]/@href', [':href' => 'token/tree']); - $link = $this->getAbsoluteUrl((string) current($links)); - if (!empty($options)) { - $options = Json::encode($options); - $link = str_replace('options=%5B%5D', 'options=' . urlencode($options), $link); - } - return $link; - } -} diff --git a/sites/all/modules/contrib/dev/token/src/Token.php b/sites/all/modules/contrib/dev/token/src/Token.php deleted file mode 100644 index b75af5ab2..000000000 --- a/sites/all/modules/contrib/dev/token/src/Token.php +++ /dev/null @@ -1,213 +0,0 @@ -tokenInfo)) { - $cache_id = 'token_info_sorted:' . $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId(); - $cache = $this->cache->get($cache_id); - if ($cache) { - $this->tokenInfo = $cache->data; - } - else { - $token_info = $this->moduleHandler->invokeAll('token_info'); - $this->moduleHandler->alter('token_info', $token_info); - - foreach (array_keys($token_info['types']) as $type_key) { - if (isset($token_info['types'][$type_key]['type'])) { - $base_type = $token_info['types'][$type_key]['type']; - // If this token type extends another token type, then merge in - // the base token type's tokens. - if (isset($token_info['tokens'][$base_type])) { - $token_info['tokens'] += [$type_key => []]; - $token_info['tokens'][$type_key] += $token_info['tokens'][$base_type]; - } - } - else { - // Add a 'type' value to each token type information. - $token_info['types'][$type_key]['type'] = $type_key; - } - } - - // Pre-sort tokens. - $by_name = $this->prepareMultisort($token_info['types']); - array_multisort($by_name, SORT_ASC, SORT_NATURAL | SORT_FLAG_CASE, $token_info['types']); - foreach (array_keys($token_info['tokens']) as $type) { - $by_name = $this->prepareMultisort($token_info['tokens'][$type]); - array_multisort($by_name, SORT_ASC, SORT_NATURAL | SORT_FLAG_CASE, $token_info['tokens'][$type]); - } - - $this->tokenInfo = $token_info; - $this->cache->set($cache_id, $this->tokenInfo, CacheBackendInterface::CACHE_PERMANENT, [ - static::TOKEN_INFO_CACHE_TAG, - ]); - } - } - - return $this->tokenInfo; - } - - /** - * Extracts data from the token data for use in array_multisort(). - * - * @param array $token_info - * List of tokens or token types, each element must have a name key. - * - * @return string[] - * List of the names keyed by the token key. - */ - protected function prepareMultisort($token_info) { - $by_name = []; - foreach ($token_info as $key => $token_info_element) { - $by_name[$key] = $token_info_element['name']; - } - return $by_name; - } - - /** - * {@inheritdoc} - */ - public function getTokenInfo($token_type, $token) { - if (empty($this->tokenInfo)) { - $this->getInfo(); - } - - return isset($this->tokenInfo['tokens'][$token_type][$token]) ? $this->tokenInfo['tokens'][$token_type][$token] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getTypeInfo($token_type) { - if (empty($this->tokenInfo)) { - $this->getInfo(); - } - - return isset($this->tokenInfo['types'][$token_type]) ? $this->tokenInfo['types'][$token_type] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getGlobalTokenTypes() { - if (empty($this->globalTokenTypes)) { - $token_info = $this->getInfo(); - foreach ($token_info['types'] as $type => $type_info) { - // If the token types has not specified that 'needs-data' => TRUE, then - // it is a global token type that will always be replaced in any context. - if (empty($type_info['needs-data'])) { - $this->globalTokenTypes[] = $type; - } - } - } - - return $this->globalTokenTypes; - } - - /** - * {@inheritdoc} - */ - function getInvalidTokens($type, $tokens) { - $token_info = $this->getInfo(); - $invalid_tokens = []; - - foreach ($tokens as $token => $full_token) { - if (isset($token_info['tokens'][$type][$token])) { - continue; - } - - // Split token up if it has chains. - $parts = explode(':', $token, 2); - - if (!isset($token_info['tokens'][$type][$parts[0]])) { - // This is an invalid token (not defined). - $invalid_tokens[] = $full_token; - } - elseif (count($parts) == 2) { - $sub_token_info = $token_info['tokens'][$type][$parts[0]]; - if (!empty($sub_token_info['dynamic'])) { - // If this token has been flagged as a dynamic token, skip it. - continue; - } - elseif (empty($sub_token_info['type'])) { - // If the token has chains, but does not support it, it is invalid. - $invalid_tokens[] = $full_token; - } - else { - // Recursively check the chained tokens. - $sub_tokens = $this->findWithPrefix([$token => $full_token], $parts[0]); - $invalid_tokens = array_merge($invalid_tokens, $this->getInvalidTokens($sub_token_info['type'], $sub_tokens)); - } - } - } - - return $invalid_tokens; - } - - /** - * {@inheritdoc} - */ - public function getInvalidTokensByContext($value, array $valid_types = []) { - if (in_array('all', $valid_types)) { - $info = $this->getInfo(); - $valid_types = array_keys($info['types']); - } - else { - // Add the token types that are always valid in global context. - $valid_types = array_merge($valid_types, $this->getGlobalTokenTypes()); - } - - $invalid_tokens = []; - $value_tokens = is_string($value) ? $this->scan($value) : $value; - - foreach ($value_tokens as $type => $tokens) { - if (!in_array($type, $valid_types)) { - // If the token type is not a valid context, its tokens are invalid. - $invalid_tokens = array_merge($invalid_tokens, array_values($tokens)); - } - else { - // Check each individual token for validity. - $invalid_tokens = array_merge($invalid_tokens, $this->getInvalidTokens($type, $tokens)); - } - } - - array_unique($invalid_tokens); - return $invalid_tokens; - } - - /** - * {@inheritdoc} - */ - public function resetInfo() { - parent::resetInfo(); - $this->globalTokenTypes = NULL; - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/TokenEntityMapper.php b/sites/all/modules/contrib/dev/token/src/TokenEntityMapper.php deleted file mode 100644 index 051df8f6a..000000000 --- a/sites/all/modules/contrib/dev/token/src/TokenEntityMapper.php +++ /dev/null @@ -1,82 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - public function getEntityTypeMappings() { - if (empty($this->entityMappings)) { - foreach ($this->entityTypeManager->getDefinitions() as $entity_type => $info) { - $this->entityMappings[$entity_type] = $info->get('token_type') ?: $entity_type; - } - // Allow modules to alter the mapping array. - $this->moduleHandler->alter('token_entity_mapping', $this->entityMappings); - } - - return $this->entityMappings; - } - - /** - * {@inheritdoc} - */ - function getEntityTypeForTokenType($token_type, $fallback = FALSE) { - if (empty($this->entityMappings)) { - $this->getEntityTypeMappings(); - } - - $return = array_search($token_type, $this->entityMappings); - return $return !== FALSE ? $return : ($fallback ? $token_type : FALSE); - } - - /** - * {@inheritdoc} - */ - function getTokenTypeForEntityType($entity_type, $fallback = FALSE) { - if (empty($this->entityMappings)) { - $this->getEntityTypeMappings(); - } - - return isset($this->entityMappings[$entity_type]) ? $this->entityMappings[$entity_type] : ($fallback ? $entity_type : FALSE); - } - - /** - * {@inheritdoc} - */ - public function resetInfo() { - $this->entityMappings = NULL; - } - -} diff --git a/sites/all/modules/contrib/dev/token/src/TokenEntityMapperInterface.php b/sites/all/modules/contrib/dev/token/src/TokenEntityMapperInterface.php deleted file mode 100644 index 5eb038ecb..000000000 --- a/sites/all/modules/contrib/dev/token/src/TokenEntityMapperInterface.php +++ /dev/null @@ -1,53 +0,0 @@ -getDefinition('token'); - $definition->setClass('\Drupal\token\Token'); - } -} diff --git a/sites/all/modules/contrib/dev/token/src/TreeBuilder.php b/sites/all/modules/contrib/dev/token/src/TreeBuilder.php deleted file mode 100644 index 8e58ba330..000000000 --- a/sites/all/modules/contrib/dev/token/src/TreeBuilder.php +++ /dev/null @@ -1,267 +0,0 @@ -tokenService = $token_service; - $this->entityMapper = $entity_mapper; - $this->cacheBackend = $cache_backend; - $this->languageManager = $language_manager; - } - - /** - * {@inheritdoc} - */ - public function buildRenderable(array $token_types, array $options = []) { - // Set default options. - $options += [ - 'global_types' => TRUE, - 'click_insert' => TRUE, - 'show_restricted' => FALSE, - 'show_nested' => FALSE, - 'recursion_limit' => 3, - ]; - - $info = $this->tokenService->getInfo(); - if ($options['global_types']) { - $token_types = array_merge($token_types, $this->tokenService->getGlobalTokenTypes()); - } - - $element = [ - /*'#cache' => [ - 'cid' => 'tree-rendered:' . hash('sha256', serialize(['token_types' => $token_types, 'global_types' => NULL] + $variables)), - 'tags' => [Token::TOKEN_INFO_CACHE_TAG], - ],*/ - ]; - - // @todo Find a way to use the render cache for this. - /*if ($cached_output = token_render_cache_get($element)) { - return $cached_output; - }*/ - - $tree_options = [ - 'flat' => TRUE, - 'restricted' => $options['show_restricted'], - 'nested' => $options['show_nested'], - 'depth' => $options['recursion_limit'], - ]; - - $token_tree = []; - foreach ($info['types'] as $type => $type_info) { - if (!in_array($type, $token_types)) { - continue; - } - - $token_tree[$type] = $type_info; - $token_tree[$type]['tokens'] = $this->buildTree($type, $tree_options); - } - - $element += [ - '#type' => 'token_tree_table', - '#token_tree' => $token_tree, - '#show_restricted' => $options['show_restricted'], - '#show_nested' => $options['show_nested'], - '#click_insert' => $options['click_insert'], - '#columns' => ['name', 'token', 'description'], - '#empty' => t('No tokens available'), - ]; - - return $element; - } - - /** - * {@inheritdoc} - */ - public function buildAllRenderable(array $options = []) { - $info = $this->tokenService->getInfo(); - $token_types = array_keys($info['types']); - - // Disable merging in global types as we will be adding in all token types - // explicitly. There is no difference in leaving this set to TRUE except for - // an additional method call which is unnecessary. - $options['global_types'] = FALSE; - return $this->buildRenderable($token_types, $options); - } - - /** - * {@inheritdoc} - */ - public function buildTree($token_type, array $options = []) { - $options += [ - 'restricted' => FALSE, - 'depth' => 4, - 'data' => [], - 'values' => FALSE, - 'flat' => FALSE, - ]; - - // Do not allow past the maximum token information depth. - $options['depth'] = min($options['depth'], static::MAX_DEPTH); - - // If $token_type is an entity, make sure we are using the actual token type. - if ($entity_token_type = $this->entityMapper->getTokenTypeForEntityType($token_type)) { - $token_type = $entity_token_type; - } - - $langcode = $this->languageManager->getCurrentLanguage()->getId(); - $tree_cid = "token_tree:{$token_type}:{$langcode}:{$options['depth']}"; - - // If we do not have this base tree in the static cache, check the cache - // otherwise generate and store it in the cache. - if (!isset($this->builtTrees[$tree_cid])) { - if ($cache = $this->cacheBackend->get($tree_cid)) { - $this->builtTrees[$tree_cid] = $cache->data; - } - else { - $options['parents'] = []; - $this->builtTrees[$tree_cid] = $this->getTokenData($token_type, $options); - $this->cacheBackend->set($tree_cid, $this->builtTrees[$tree_cid], Cache::PERMANENT, [Token::TOKEN_INFO_CACHE_TAG]); - } - } - - $tree = $this->builtTrees[$tree_cid]; - - // If the user has requested a flat tree, convert it. - if (!empty($options['flat'])) { - $tree = $this->flattenTree($tree); - } - - // Fill in token values. - if (!empty($options['values'])) { - $token_values = []; - foreach ($tree as $token => $token_info) { - if (!empty($token_info['dynamic']) || !empty($token_info['restricted'])) { - continue; - } - elseif (!isset($token_info['value'])) { - $token_values[$token_info['token']] = $token; - } - } - if (!empty($token_values)) { - $token_values = $this->tokenService->generate($token_type, $token_values, $options['data'], [], new BubbleableMetadata()); - foreach ($token_values as $token => $replacement) { - $tree[$token]['value'] = $replacement; - } - } - } - - return $tree; - } - - /** - * {@inheritdoc} - */ - public function flattenTree(array $tree) { - $result = []; - foreach ($tree as $token => $token_info) { - $result[$token] = $token_info; - if (isset($token_info['children']) && is_array($token_info['children'])) { - $result += $this->flattenTree($token_info['children']); - } - } - return $result; - } - - /** - * Generate a token tree. - * - * @param string $token_type - * The token type. - * @param array $options - * An associative array of additional options. See documentation for - * TreeBuilderInterface::buildTree() for more information. - * - * @return array - * The token data for the specified $token_type. - * - * @internal - */ - protected function getTokenData($token_type, array $options) { - $options += [ - 'parents' => [], - ]; - - $info = $this->tokenService->getInfo(); - if ($options['depth'] <= 0 || !isset($info['types'][$token_type]) || !isset($info['tokens'][$token_type])) { - return []; - } - - $tree = []; - foreach ($info['tokens'][$token_type] as $token => $token_info) { - // Build the raw token string. - $token_parents = $options['parents']; - if (empty($token_parents)) { - // If the parents array is currently empty, assume the token type is its - // parent. - $token_parents[] = $token_type; - } - elseif (in_array($token, array_slice($token_parents, 1), TRUE)) { - // Prevent duplicate recursive tokens. For example, this will prevent - // the tree from generating the following tokens or deeper: - // [comment:parent:parent] - // [comment:parent:root:parent] - continue; - } - - $token_parents[] = $token; - if (!empty($token_info['dynamic'])) { - $token_parents[] = '?'; - } - $raw_token = '[' . implode(':', $token_parents) . ']'; - $tree[$raw_token] = $token_info; - $tree[$raw_token]['raw token'] = $raw_token; - - // Add the token's real name (leave out the base token type). - $tree[$raw_token]['token'] = implode(':', array_slice($token_parents, 1)); - - // Add the token's parent as its raw token value. - if (!empty($options['parents'])) { - $tree[$raw_token]['parent'] = '[' . implode(':', $options['parents']) . ']'; - } - - // Fetch the child tokens. - if (!empty($token_info['type'])) { - $child_options = $options; - $child_options['depth']--; - $child_options['parents'] = $token_parents; - $tree[$raw_token]['children'] = $this->getTokenData($token_info['type'], $child_options); - } - } - - return $tree; - } -} diff --git a/sites/all/modules/contrib/dev/token/src/TreeBuilderInterface.php b/sites/all/modules/contrib/dev/token/src/TreeBuilderInterface.php deleted file mode 100644 index c4212c215..000000000 --- a/sites/all/modules/contrib/dev/token/src/TreeBuilderInterface.php +++ /dev/null @@ -1,79 +0,0 @@ - \Drupal::token()->replace('[current-page:title]'), - '#type' => 'markup', - ]; - return $build; - } - - /** - * Title callback for the page outputting a link. - * - * We are using a title callback instead of directly defining the title in the - * routing YML file. This is so that we could return an array instead of a - * simple string. This allows us to test if [current-page:title] works with - * render arrays and other objects as titles. - */ - public function getTitle() { - return [ - '#type' => 'markup', - '#markup' => 'Available Tokens', - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/test_views/views.view.token_views_test.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/test_views/views.view.token_views_test.yml deleted file mode 100644 index eeb150b0d..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/test_views/views.view.token_views_test.yml +++ /dev/null @@ -1,130 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user -id: token_views_test -label: token_views_test -module: views -description: '' -tag: '' -base_table: users_field_data -base_field: uid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: some - options: - items_per_page: 5 - offset: 0 - style: - type: default - row: - type: fields - options: - default_field_elements: true - inline: { } - separator: '' - hide_empty: false - fields: - name: - id: name - table: users_field_data - field: name - entity_type: user - entity_field: name - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: user_name - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: { } - sorts: { } - title: token_views_test - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - tags: { } - block_1: - display_plugin: block - id: block_1 - display_title: Block - position: 1 - display_options: - display_extenders: { } diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.info.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.info.yml deleted file mode 100644 index 037918b02..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -type: module -name: Token Module Test -description: Testing module for token functionality. -package: Testing -# core: 8.x -hidden: TRUE - -# Information added by Drupal.org packaging script on 2018-09-21 -version: '8.x-1.5' -core: '8.x' -project: 'token' -datestamp: 1537557488 diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.module b/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.module deleted file mode 100644 index c022b6575..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.module +++ /dev/null @@ -1,33 +0,0 @@ -get('token_page_tokens', [])) { - $debug += ['tokens' => [], 'data' => [], 'options' => []]; - foreach (array_keys($debug['tokens']) as $token) { - $debug['values'][$token] = \Drupal::token()->replace($token, $debug['data'], $debug['options']); - } - \Drupal::state()->set('token_page_tokens', $debug); - } -} - -/** - * Implements hook_ENTITY_TYPE_presave for Node entities. - */ -function token_module_test_node_presave(NodeInterface $node) { - // Transform tokens in the body. - // @see \Drupal\token\Tests\TokenMenuTest::testMenuTokens() - if ($node->hasField('body')) { - $node->body->value = \Drupal::token() - ->replace($node->body->value, ['node' => $node]); - } -} diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.routing.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.routing.yml deleted file mode 100644 index fb99f1c9a..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -token_module_test.browse: - path: '/token_module_test/browse' - defaults: - _controller: '\Drupal\token_module_test\Controller\TokenTreeBrowseController::outputLink' - _title_callback: '\Drupal\token_module_test\Controller\TokenTreeBrowseController::getTitle' - requirements: - _access: 'TRUE' diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.tokens.inc b/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.tokens.inc deleted file mode 100644 index 3adf45781..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_module_test/token_module_test.tokens.inc +++ /dev/null @@ -1,13 +0,0 @@ - t('A test token with colons in the name'), - 'description' => NULL, - ]; - - return $info; -} diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/core.entity_form_display.user.user.default.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/core.entity_form_display.user.user.default.yml deleted file mode 100644 index a30d01253..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/core.entity_form_display.user.user.default.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: de -status: true -dependencies: - module: - - image - - user -id: user.user.default -targetEntityType: user -bundle: user -mode: default -content: - account: - weight: -10 - user_picture: - type: image_image - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - weight: -1 - timezone: - weight: 6 -hidden: { } diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.field.user.user.user_picture.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.field.user.user.user_picture.yml deleted file mode 100644 index 45f6e82b7..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.field.user.user.user_picture.yml +++ /dev/null @@ -1,31 +0,0 @@ -id: user.user.user_picture -status: true -langcode: en -entity_type: user -bundle: user -field_name: user_picture -label: Picture -description: 'Your virtual face or picture.' -required: false -default_value: { } -default_value_function: '' -settings: - file_extensions: 'png gif jpg jpeg' - file_directory: pictures - max_filesize: '30 KB' - alt_field: false - title_field: false - max_resolution: 85x85 - min_resolution: '' - default_image: - uuid: null - alt: '' - title: '' - width: null - height: null - alt_field_required: false - title_field_required: false -field_type: image -dependencies: - config: - - field.storage.user.user_picture diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.storage.user.user_picture.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.storage.user.user_picture.yml deleted file mode 100644 index 01d093967..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/config/install/field.storage.user.user_picture.yml +++ /dev/null @@ -1,25 +0,0 @@ -id: user.user_picture -status: true -langcode: en -field_name: user_picture -entity_type: user -type: image -settings: - uri_scheme: public - default_image: - uuid: null - alt: '' - title: '' - width: null - height: null -module: image -locked: false -cardinality: 1 -translatable: false -indexes: - target_id: - - target_id -dependencies: - module: - - image - - user diff --git a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/token_user_picture.info.yml b/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/token_user_picture.info.yml deleted file mode 100644 index 131f85028..000000000 --- a/sites/all/modules/contrib/dev/token/tests/modules/token_user_picture/token_user_picture.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -type: module -name: Token User picture -description: Testing module that provides user pictures field. -package: Testing -# core: 8.x -hidden: TRUE -dependencies: - - image - -# Information added by Drupal.org packaging script on 2018-09-21 -version: '8.x-1.5' -core: '8.x' -project: 'token' -datestamp: 1537557488 diff --git a/sites/all/modules/contrib/dev/token/tests/src/Functional/UrlTest.php b/sites/all/modules/contrib/dev/token/tests/src/Functional/UrlTest.php deleted file mode 100644 index 0ae2788d8..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Functional/UrlTest.php +++ /dev/null @@ -1,137 +0,0 @@ - 'article', 'name' => 'Article']); - $node_type->save(); - - $this->node1 = Node::create([ - 'type' => 'article', - 'title' => 'Test Node 1', - ]); - $this->node1->save(); - - $this->node2 = Node::create([ - 'type' => 'article', - 'title' => 'Test Node 2', - ]); - $this->node2->save(); - - } - - /** - * Creates a block with token for title and tests cache contexts. - * - * @throws \Behat\Mink\Exception\ElementHtmlException - * @throws \Drupal\Core\Entity\EntityStorageException - */ - public function testBlockUrlTokenReplacement() { - - $node1_url = $this->node1->toUrl(); - $node2_url = $this->node2->toUrl(); - - // Using a @dataprovider causes repeated database installations and takes a - // very long time. - $tests = []; - $tests[] = [ - 'token' => 'prefix_[current-page:url:path]_suffix', - 'expected1' => 'prefix_/' . $node1_url->getInternalPath() . '_suffix', - 'expected2' => 'prefix_/' . $node2_url->getInternalPath() . '_suffix', - // A path can only be generated from a routed path. - 'expected3' => 'prefix_/_suffix', - ]; - $tests[] = [ - 'token' => 'prefix_[current-page:url]_suffix', - 'expected1' => 'prefix_' . $node1_url->setAbsolute()->toString() . '_suffix', - 'expected2' => 'prefix_' . $node2_url->setAbsolute()->toString() . '_suffix', - 'expected3' => 'prefix_' . $this->getAbsoluteUrl('does-not-exist') . '_suffix', - ]; - - // Place a standard block and use a token in the label. - $edit = [ - 'id' => 'token_url_test_block', - 'label' => 'label', - 'label_display' => TRUE, - ]; - $this->placeBlock('system_powered_by_block', $edit); - $block = Block::load('token_url_test_block'); - - $assert_session = $this->assertSession(); - - foreach ($tests as $test) { - // Set the block label. - $block->getPlugin()->setConfigurationValue('label', $test['token']); - $block->save(); - - // Go to the first node page and test that the token is correct. - $this->drupalGet($node1_url); - $assert_session->elementContains('css', '#block-token-url-test-block', $test['expected1']); - - // Go to the second node page and check that the block title has changed. - $this->drupalGet($node2_url); - $assert_session->elementContains('css', '#block-token-url-test-block', $test['expected2']); - - // Test the current page url on a 404 page. - $this->drupalGet('does-not-exist'); - $assert_session->statusCodeEquals(404); - $assert_session->elementContains('css', '#block-token-url-test-block', $test['expected3']); - } - - - // Can't do this test in the for loop above, it's too different. - $block->getPlugin()->setConfigurationValue('label', 'prefix_[current-page:query:unicorns]_suffix'); - $block->save(); - - // Test the parameter token. - $this->drupalGet($node1_url->setOption('query', ['unicorns' => 'fluffy'])); - $this->assertCacheContext('url.query_args'); - $assert_session->elementContains('css', '#block-token-url-test-block', 'prefix_fluffy_suffix'); - - // Change the parameter on the same page. - $this->drupalGet($node1_url->setOption('query', ['unicorns' => 'dead'])); - $assert_session->elementContains('css', '#block-token-url-test-block', 'prefix_dead_suffix'); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/ArrayTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/ArrayTest.php deleted file mode 100644 index d484835b5..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/ArrayTest.php +++ /dev/null @@ -1,61 +0,0 @@ - 'a', 1 => 'b', 2 => 'c', 4 => 'd']; - $tokens = [ - 'first' => 'a', - 'last' => 'd', - 'value:0' => 'a', - 'value:2' => 'c', - 'count' => 4, - 'keys' => '0, 1, 2, 4', - 'keys:value:3' => '4', - 'keys:join' => '0124', - 'reversed' => 'd, c, b, a', - 'reversed:keys' => '4, 2, 1, 0', - 'join:/' => 'a/b/c/d', - 'join' => 'abcd', - 'join:, ' => 'a, b, c, d', - 'join: ' => 'a b c d', - ]; - $this->assertTokens('array', ['array' => $array], $tokens); - - // Test a mixed simple and render array. - // 2 => c, 0 => a, 4 => d, 1 => b - $array = [ - '#property' => 'value', - 0 => 'a', - 1 => ['#markup' => 'b', '#weight' => 0.01], - 2 => ['#markup' => 'c', '#weight' => -10], - 4 => ['#markup' => 'd', '#weight' => 0], - ]; - $tokens = [ - 'first' => 'c', - 'last' => 'b', - 'value:0' => 'a', - 'value:2' => 'c', - 'count' => 4, - 'keys' => '2, 0, 4, 1', - 'keys:value:3' => '1', - 'keys:join' => '2041', - 'reversed' => 'b, d, a, c', - 'reversed:keys' => '1, 4, 0, 2', - 'join:/' => 'c/a/d/b', - 'join' => 'cadb', - 'join:, ' => 'c, a, d, b', - 'join: ' => 'c a d b', - ]; - $this->assertTokens('array', ['array' => $array], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/BookTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/BookTest.php deleted file mode 100644 index 215fdb54e..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/BookTest.php +++ /dev/null @@ -1,108 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('node'); - $this->installSchema('book', ['book']); - $this->installSchema('node', ['node_access']); - $this->installConfig(['node', 'book', 'field']); - } - - function testBookTokens() { - $book = Node::create([ - 'type' => 'book', - 'title' => 'Book Main Page', - 'book' => ['bid' => 'new'], - ]); - $book->save(); - - $page1 = Node::create([ - 'type' => 'book', - 'title' => '1st Page', - 'book' => ['bid' => $book->id(), 'pid' => $book->id()], - ]); - $page1->save(); - - $page2 = Node::create([ - 'type' => 'book', - 'title' => '2nd Page', - 'book' => ['bid' => $book->id(), 'pid' => $page1->id()], - ]); - $page2->save(); - - $book_title = $book->getTitle(); - - $tokens = [ - 'nid' => $book->id(), - 'title' => $book_title, - 'book:title' => $book_title, - 'book:root' => $book_title, - 'book:root:nid' => $book->id(), - 'book:root:title' => $book_title, - 'book:root:url' => Url::fromRoute('entity.node.canonical', ['node' => $book->id()], ['absolute' => TRUE])->toString(), - 'book:root:content-type' => 'Book page', - 'book:parent' => null, - 'book:parents' => null, - ]; - $this->assertTokens('node', ['node' => $book], $tokens); - - $tokens = [ - 'nid' => $page1->id(), - 'title' => $page1->getTitle(), - 'book:title' => $book_title, - 'book:root' => $book_title, - 'book:root:nid' => $book->id(), - 'book:root:title' => $book_title, - 'book:root:url' => Url::fromRoute('entity.node.canonical', ['node' => $book->id()], ['absolute' => TRUE])->toString(), - 'book:root:content-type' => 'Book page', - 'book:parent:nid' => $book->id(), - 'book:parent:title' => $book_title, - 'book:parent:url' => Url::fromRoute('entity.node.canonical', ['node' => $book->id()], ['absolute' => TRUE])->toString(), - 'book:parents:count' => 1, - 'book:parents:join:/' => $book_title, - ]; - $this->assertTokens('node', ['node' => $page1], $tokens); - - $tokens = [ - 'nid' => $page2->id(), - 'title' => $page2->getTitle(), - 'book:title' => $book_title, - 'book:root' => $book_title, - 'book:root:nid' => $book->id(), - 'book:root:title' => $book_title, - 'book:root:url' => Url::fromRoute('entity.node.canonical', ['node' => $book->id()], ['absolute' => TRUE])->toString(), - 'book:root:content-type' => 'Book page', - 'book:parent:nid' => $page1->id(), - 'book:parent:title' => $page1->getTitle(), - 'book:parent:url' => Url::fromRoute('entity.node.canonical', ['node' => $page1->id()], ['absolute' => TRUE])->toString(), - 'book:parents:count' => 2, - 'book:parents:join:/' => $book_title . '/' . $page1->getTitle(), - ]; - $this->assertTokens('node', ['node' => $page2], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/CommentTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/CommentTest.php deleted file mode 100644 index 63232c11f..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/CommentTest.php +++ /dev/null @@ -1,101 +0,0 @@ -installEntitySchema('node'); - $this->installEntitySchema('user'); - $this->installEntitySchema('comment'); - $this->installSchema('comment', ['comment_entity_statistics']); - - $node_type = NodeType::create(['type' => 'page', 'name' => t('Page')]); - $node_type->save(); - - $this->installConfig(['comment']); - - $this->addDefaultCommentField('node', 'page'); - } - - function testCommentTokens() { - $node = Node::create([ - 'type' => 'page', - 'title' => $this->randomMachineName() - ]); - $node->save(); - - $parent_comment = Comment::create([ - 'entity_id' => $node->id(), - 'entity_type' => 'node', - 'field_name' => 'comment', - 'name' => 'anonymous user', - 'mail' => 'anonymous@example.com', - 'subject' => $this->randomMachineName(), - 'body' => $this->randomMachineName(), - ]); - $parent_comment->save(); - - // Fix http://example.com/index.php/comment/1 fails 'url:path' test. - $parent_comment_path = $parent_comment->url(); - - $tokens = [ - 'url' => $parent_comment->toUrl('canonical', ['fragment' => "comment-{$parent_comment->id()}"])->setAbsolute()->toString(), - 'url:absolute' => $parent_comment->toUrl('canonical', ['fragment' => "comment-{$parent_comment->id()}"])->setAbsolute()->toString(), - 'url:relative' => $parent_comment->toUrl('canonical', ['fragment' => "comment-{$parent_comment->id()}"])->toString(), - 'url:path' => $parent_comment_path, - 'parent:url:absolute' => NULL, - ]; - $this->assertTokens('comment', ['comment' => $parent_comment], $tokens); - - $comment = Comment::create([ - 'entity_id' => $node->id(), - 'pid' => $parent_comment->id(), - 'entity_type' => 'node', - 'field_name' => 'comment', - 'name' => 'anonymous user', - 'mail' => 'anonymous@example.com', - 'subject' => $this->randomMachineName(), - 'body' => $this->randomMachineName(), - ]); - $comment->save(); - - // Fix http://example.com/index.php/comment/1 fails 'url:path' test. - $comment_path = Url::fromRoute('entity.comment.canonical', ['comment' => $comment->id()])->toString(); - - $tokens = [ - 'url' => $comment->toUrl('canonical', ['fragment' => "comment-{$comment->id()}"])->setAbsolute()->toString(), - 'url:absolute' => $comment->toUrl('canonical', ['fragment' => "comment-{$comment->id()}"])->setAbsolute()->toString(), - 'url:relative' => $comment->toUrl('canonical', ['fragment' => "comment-{$comment->id()}"])->toString(), - 'url:path' => $comment_path, - 'parent:url:absolute' => $parent_comment->toUrl('canonical', ['fragment' => "comment-{$parent_comment->id()}"])->setAbsolute()->toString(), - ]; - $this->assertTokens('comment', ['comment' => $comment], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/DateTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/DateTest.php deleted file mode 100644 index c120e1109..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/DateTest.php +++ /dev/null @@ -1,36 +0,0 @@ -installConfig(['system', 'token_module_test']); - } - - function testDateTokens() { - $tokens = [ - 'token_module_test' => '1984', - 'invalid_format' => NULL, - ]; - - $this->assertTokens('date', ['date' => 453859200], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/EntityTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/EntityTest.php deleted file mode 100644 index caf575bc6..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/EntityTest.php +++ /dev/null @@ -1,106 +0,0 @@ - 'Tags', - 'vid' => 'tags', - ]); - $vocabulary->save(); - - $this->installEntitySchema('taxonomy_term'); - $this->installEntitySchema('user'); - $this->installEntitySchema('node'); - - $this->vocab = $vocabulary; - } - - function testEntityMapping() { - /** @var \Drupal\token\TokenEntityMapperInterface $mapper */ - $mapper = \Drupal::service('token.entity_mapper'); - $this->assertIdentical($mapper->getEntityTypeForTokenType('node'), 'node'); - $this->assertIdentical($mapper->getEntityTypeForTokenType('term'), 'taxonomy_term'); - $this->assertIdentical($mapper->getEntityTypeForTokenType('vocabulary'), 'taxonomy_vocabulary'); - $this->assertIdentical($mapper->getEntityTypeForTokenType('invalid'), FALSE); - $this->assertIdentical($mapper->getEntityTypeForTokenType('invalid', TRUE), 'invalid'); - $this->assertIdentical($mapper->getTokenTypeForEntityType('node'), 'node'); - $this->assertIdentical($mapper->getTokenTypeForEntityType('taxonomy_term'), 'term'); - $this->assertIdentical($mapper->getTokenTypeForEntityType('taxonomy_vocabulary'), 'vocabulary'); - $this->assertIdentical($mapper->getTokenTypeForEntityType('invalid'), FALSE); - $this->assertIdentical($mapper->getTokenTypeForEntityType('invalid', TRUE), 'invalid'); - - // Test that when we send the mis-matched entity type into - // Drupal\Core\Utility\Token::replace() that we still get the tokens - // replaced. - $vocabulary = Vocabulary::load('tags'); - $term = $this->addTerm($vocabulary); - $this->assertIdentical(\Drupal::token()->replace('[vocabulary:name]', ['taxonomy_vocabulary' => $vocabulary]), $vocabulary->label()); - $this->assertIdentical(\Drupal::token()->replace('[term:name][term:vocabulary:name]', ['taxonomy_term' => $term]), $term->label() . $vocabulary->label()); - } - - function addTerm(VocabularyInterface $vocabulary, array $term = []) { - $term += [ - 'name' => mb_strtolower($this->randomMachineName(5)), - 'vid' => $vocabulary->id(), - ]; - $term = Term::create($term); - $term->save(); - return $term; - } - - /** - * Test the [entity:original:*] tokens. - */ - function testEntityOriginal() { - $node = Node::create(['type' => 'page', 'title' => 'Original title']); - $node->save(); - - $tokens = [ - 'nid' => $node->id(), - 'title' => 'Original title', - 'original' => NULL, - 'original:nid' => NULL, - ]; - $this->assertTokens('node', ['node' => $node], $tokens); - - // Emulate the original entity property that would be available from - // node_save() and change the title for the node. - $node->original = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($node->id()); - $node->title = 'New title'; - - $tokens = [ - 'nid' => $node->id(), - 'title' => 'New title', - 'original' => 'Original title', - 'original:nid' => $node->id(), - ]; - $this->assertTokens('node', ['node' => $node], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/FieldTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/FieldTest.php deleted file mode 100644 index 1d0b2de70..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/FieldTest.php +++ /dev/null @@ -1,731 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('node'); - $this->installEntitySchema('taxonomy_term'); - - // Create the article content type with a text field. - $node_type = NodeType::create([ - 'type' => 'article', - ]); - $node_type->save(); - - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'test_field', - 'entity_type' => 'node', - 'type' => 'text', - ]); - $field_storage->save(); - - $field = FieldConfig::create([ - 'field_name' => 'test_field', - 'entity_type' => 'node', - 'bundle' => 'article', - 'label' => 'Test field', - ]); - $field->save(); - - // Create a reference field with the same name on user. - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'test_field', - 'entity_type' => 'user', - 'type' => 'entity_reference', - ]); - $field_storage->save(); - - $field = FieldConfig::create([ - 'field_name' => 'test_field', - 'entity_type' => 'user', - 'bundle' => 'user', - 'label' => 'Test field', - ]); - $field->save(); - - $this->testFormat = FilterFormat::create([ - 'format' => 'test', - 'weight' => 1, - 'filters' => [ - 'filter_html_escape' => ['status' => TRUE], - ], - ]); - $this->testFormat->save(); - - // Create a multi-value list_string field. - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'test_list', - 'entity_type' => 'node', - 'type' => 'list_string', - 'cardinality' => 2, - 'settings' => [ - 'allowed_values' => [ - 'key1' => 'value1', - 'key2' => 'value2', - ] - ], - ]); - $field_storage->save(); - - $this->field = FieldConfig::create([ - 'field_name' => 'test_list', - 'entity_type' => 'node', - 'bundle' => 'article', - ])->save(); - - // Add an untranslatable node reference field. - FieldStorageConfig::create([ - 'field_name' => 'test_reference', - 'type' => 'entity_reference', - 'entity_type' => 'node', - 'settings' => [ - 'target_type' => 'node', - ], - 'translatable' => FALSE, - ])->save(); - FieldConfig::create([ - 'field_name' => 'test_reference', - 'entity_type' => 'node', - 'bundle' => 'article', - 'label' => 'Test reference', - ])->save(); - - // Add an untranslatable taxonomy term reference field. - $this->vocabulary = $this->createVocabulary(); - - FieldStorageConfig::create([ - 'field_name' => 'test_term_reference', - 'type' => 'entity_reference', - 'entity_type' => 'node', - 'settings' => [ - 'target_type' => 'taxonomy_term', - ], - 'translatable' => FALSE, - ])->save(); - FieldConfig::create([ - 'field_name' => 'test_term_reference', - 'entity_type' => 'node', - 'bundle' => 'article', - 'label' => 'Test term reference', - 'settings' => [ - 'handler' => 'default:taxonomy_term', - 'handler_settings' => [ - 'target_bundles' => [ - $this->vocabulary->id() => $this->vocabulary->id(), - ], - ], - ], - ])->save(); - - // Add a field to terms of the created vocabulary. - $storage = FieldStorageConfig::create([ - 'field_name' => 'term_field', - 'entity_type' => 'taxonomy_term', - 'type' => 'text', - ]); - $storage->save(); - $field = FieldConfig::create([ - 'field_name' => 'term_field', - 'entity_type' => 'taxonomy_term', - 'bundle' => $this->vocabulary->id(), - ]); - $field->save(); - - // Add a second language. - $language = ConfigurableLanguage::create([ - 'id' => 'de', - 'label' => 'German', - ]); - $language->save(); - - // Add a datetime field. - $field_datetime_storage = FieldStorageConfig::create([ - 'field_name' => 'field_datetime', - 'type' => 'datetime', - 'entity_type' => 'node', - 'settings' => ['datetime_type' => DateTimeItem::DATETIME_TYPE_DATETIME], - 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, - ]); - $field_datetime_storage->save(); - $field_datetime = FieldConfig::create([ - 'field_storage' => $field_datetime_storage, - 'bundle' => 'article', - ]); - $field_datetime->save(); - - // Add a daterange field. - $field_daterange_storage = FieldStorageConfig::create([ - 'field_name' => 'field_daterange', - 'type' => 'daterange', - 'entity_type' => 'node', - 'settings' => ['datetime_type' => DateRangeItem::DATETIME_TYPE_DATETIME], - 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, - ]); - $field_daterange_storage->save(); - $field_daterange = FieldConfig::create([ - 'field_storage' => $field_daterange_storage, - 'bundle' => 'article', - ]); - $field_daterange->save(); - } - - /** - * Tests [entity:field_name] tokens. - */ - public function testEntityFieldTokens() { - // Create a node with a value in its fields and test its tokens. - $entity = Node::create([ - 'title' => 'Test node title', - 'type' => 'article', - 'test_field' => [ - 'value' => 'foo', - 'format' => $this->testFormat->id(), - ], - 'test_list' => [ - 'value1', - 'value2', - ], - ]); - $entity->save(); - $this->assertTokens('node', ['node' => $entity], [ - 'test_field' => Markup::create('foo'), - 'test_field:0' => Markup::create('foo'), - 'test_field:0:value' => 'foo', - 'test_field:value' => 'foo', - 'test_field:0:format' => $this->testFormat->id(), - 'test_field:format' => $this->testFormat->id(), - 'test_list:0' => Markup::create('value1'), - 'test_list:1' => Markup::create('value2'), - 'test_list:0:value' => Markup::create('value1'), - 'test_list:value' => Markup::create('value1'), - 'test_list:1:value' => Markup::create('value2'), - ]); - - // Verify that no third token was generated for the list_string field. - $this->assertNoTokens('node', ['node' => $entity], [ - 'test_list:2', - 'test_list:2:value', - ]); - - // Test the test_list token metadata. - $tokenService = \Drupal::service('token'); - $token_info = $tokenService->getTokenInfo('node', 'test_list'); - $this->assertEqual($token_info['name'], 'test_list'); - $this->assertEqual($token_info['module'], 'token'); - $this->assertEqual($token_info['type'], 'list'); - $typeInfo = $tokenService->getTypeInfo('list'); - $this->assertEqual($typeInfo['name'], 'List of test_list values'); - $this->assertEqual($typeInfo['type'], 'list'); - - // Create a node type that does not have test_field field. - $node_type = NodeType::create([ - 'type' => 'page', - ]); - $node_type->save(); - - $node_without_test_field = Node::create([ - 'title' => 'Node without test_field', - 'type' => 'page', - ]); - $node_without_test_field->save(); - - // Ensure that trying to generate tokens for a non-existing field does not - // throw an exception. - $this->assertNoTokens('node', ['node' => $node_without_test_field], ['test_field']); - - // Create a node without a value in the text field and test its token. - $entity = Node::create([ - 'title' => 'Test node title', - 'type' => 'article', - ]); - $entity->save(); - - $this->assertNoTokens('node', ['node' => $entity], [ - 'test_field', - ]); - } - - /** - * Tests the token metadata for a field token. - */ - public function testFieldTokenInfo() { - /** @var \Drupal\token\Token $tokenService */ - $tokenService = \Drupal::service('token'); - - // Test the token info of the text field of the artcle content type. - $token_info = $tokenService->getTokenInfo('node', 'test_field'); - $this->assertEqual($token_info['name'], 'Test field', 'The token info name is correct.'); - $this->assertEqual($token_info['description'], 'Text (formatted) field.', 'The token info description is correct.'); - $this->assertEqual($token_info['module'], 'token', 'The token info module is correct.'); - - // Now create two more content types that share the field but the last - // of them sets a different label. This should show an alternative label - // at the token info. - $node_type = NodeType::create([ - 'type' => 'article2', - ]); - $node_type->save(); - $field = FieldConfig::create([ - 'field_name' => 'test_field', - 'entity_type' => 'node', - 'bundle' => 'article2', - 'label' => 'Test field', - ]); - $field->save(); - - $node_type = NodeType::create([ - 'type' => 'article3', - ]); - $node_type->save(); - $field = FieldConfig::create([ - 'field_name' => 'test_field', - 'entity_type' => 'node', - 'bundle' => 'article3', - 'label' => 'Different test field', - ]); - $field->save(); - - $token_info = $tokenService->getTokenInfo('node', 'test_field'); - $this->assertEqual($token_info['name'], 'Test field', 'The token info name is correct.'); - $this->assertEqual((string) $token_info['description'], 'Text (formatted) field. Also known as Different test field.', 'When a field is used in several bundles with different labels, this is noted at the token info description.'); - $this->assertEqual($token_info['module'], 'token', 'The token info module is correct.'); - $this->assertEqual($token_info['type'], 'node-test_field', 'The field property token info type is correct.'); - - // Test field property token info. - $token_info = $tokenService->getTokenInfo('node-test_field', 'value'); - $this->assertEqual($token_info['name'], 'Text', 'The field property token info name is correct.'); - // This particular field property description happens to be empty. - $this->assertEqual((string) $token_info['description'], '', 'The field property token info description is correct.'); - $this->assertEqual($token_info['module'], 'token', 'The field property token info module is correct.'); - } - - /** - * Test tokens on node with the token view mode overriding default formatters. - */ - public function testTokenViewMode() { - $value = 'A really long string that should be trimmed by the special formatter on token view we are going to have.'; - - // The formatter we are going to use will eventually call Unicode::strlen. - // This expects that the Unicode has already been explicitly checked, which - // happens in DrupalKernel. But since that doesn't run in kernel tests, we - // explicitly call this here. - Unicode::check(); - - // Create a node with a value in the text field and test its token. - $entity = Node::create([ - 'title' => 'Test node title', - 'type' => 'article', - 'test_field' => [ - 'value' => $value, - 'format' => $this->testFormat->id(), - ], - ]); - $entity->save(); - - $this->assertTokens('node', ['node' => $entity], [ - 'test_field' => Markup::create($value), - ]); - - // Now, create a token view mode which sets a different format for - // test_field. When replacing tokens, this formatter should be picked over - // the default formatter for the field type. - // @see field_tokens(). - $view_mode = EntityViewMode::create([ - 'id' => 'node.token', - 'targetEntityType' => 'node', - ]); - $view_mode->save(); - $entity_display = entity_get_display('node', 'article', 'token'); - $entity_display->setComponent('test_field', [ - 'type' => 'text_trimmed', - 'settings' => [ - 'trim_length' => 50, - ] - ]); - $entity_display->save(); - - $this->assertTokens('node', ['node' => $entity], [ - 'test_field' => Markup::create(substr($value, 0, 50)), - ]); - } - - /** - * Test that tokens are properly created for an entity's base fields. - */ - public function testBaseFieldTokens() { - // Create a new contact_message entity and verify that tokens are generated - // for its base fields. The contact_message entity type is used because it - // provides no tokens by default. - $contact_form = ContactForm::create([ - 'id' => 'form_id', - ]); - $contact_form->save(); - - $entity = Message::create([ - 'contact_form' => 'form_id', - 'uuid' => '123', - 'langcode' => 'en', - 'name' => 'Test name', - 'mail' => 'Test mail', - 'subject' => 'Test subject', - 'message' => 'Test message', - 'copy' => FALSE, - ]); - $entity->save(); - $this->assertTokens('contact_message', ['contact_message' => $entity], [ - 'uuid' => Markup::create('123'), - 'langcode' => Markup::create('English'), - 'name' => Markup::create('Test name'), - 'mail' => Markup::create('Test mail'), - 'subject' => Markup::create('Test subject'), - 'message' => Markup::create('Test message'), - 'copy' => 'Off', - ]); - - // Test the metadata of one of the tokens. - $tokenService = \Drupal::service('token'); - $token_info = $tokenService->getTokenInfo('contact_message', 'subject'); - $this->assertEquals($token_info['name'], 'Subject'); - $this->assertEquals($token_info['description'], 'Text (plain) field.'); - $this->assertEquals($token_info['module'], 'token'); - - // Verify that node entity type doesn't have a uid token. - $this->assertNull($tokenService->getTokenInfo('node', 'uid')); - } - - /* - * Tests chaining entity reference tokens. - */ - public function testEntityReferenceTokens() { - $reference = Node::create([ - 'title' => 'Test node to reference', - 'type' => 'article', - 'test_field' => [ - 'value' => 'foo', - 'format' => $this->testFormat->id(), - ] - ]); - $reference->save(); - $term_reference_field_value = $this->randomString(); - $term_reference = $this->createTerm($this->vocabulary, [ - 'name' => 'Term to reference', - 'term_field' => [ - 'value' => $term_reference_field_value, - 'format' => $this->testFormat->id(), - ], - ]); - $entity = Node::create([ - 'title' => 'Test entity reference', - 'type' => 'article', - 'test_reference' => ['target_id' => $reference->id()], - 'test_term_reference' => ['target_id' => $term_reference->id()], - ]); - $entity->save(); - - $this->assertTokens('node', ['node' => $entity], [ - 'test_reference:entity:title' => Markup::create('Test node to reference'), - 'test_reference:entity:test_field' => Markup::create('foo'), - 'test_term_reference:entity:term_field' => Html::escape($term_reference_field_value), - 'test_reference:target_id' => $reference->id(), - 'test_term_reference:target_id' => $term_reference->id(), - 'test_term_reference:entity:url:path' => '/' . $term_reference->toUrl('canonical')->getInternalPath(), - // Expects the entity's label to be returned for :entity tokens. - 'test_reference:entity' => $reference->label(), - 'test_term_reference:entity' => $term_reference->label(), - ]); - - // Test some non existent tokens. - $this->assertNoTokens('node', ['node' => $entity], [ - 'test_reference:1:title', - 'test_reference:entity:does_not_exist', - 'test_reference:does_not:exist', - 'test_term_reference:does_not_exist', - 'test_term_reference:does:not:exist', - 'test_term_reference:does_not_exist:0', - 'non_existing_field:entity:title', - ]); - - /** @var \Drupal\token\Token $token_service */ - $token_service = \Drupal::service('token'); - - $token_info = $token_service->getTokenInfo('node', 'test_reference'); - $this->assertEquals('Test reference', $token_info['name']); - $this->assertEquals('Entity reference field.', (string) $token_info['description']); - $this->assertEquals('token', $token_info['module']); - $this->assertEquals('node-test_reference', $token_info['type']); - - // Test target_id field property token info. - $token_info = $token_service->getTokenInfo('node-test_reference', 'target_id'); - $this->assertEquals('Content ID', $token_info['name']); - $this->assertEquals('token', $token_info['module']); - $this->assertEquals('token', $token_info['module']); - - // Test entity field property token info. - $token_info = $token_service->getTokenInfo('node-test_reference', 'entity'); - $this->assertEquals('Content', $token_info['name']); - $this->assertEquals('The referenced entity', $token_info['description']); - $this->assertEquals('token', $token_info['module']); - $this->assertEquals('node', $token_info['type']); - - // Test entity field property token info of the term reference. - $token_info = $token_service->getTokenInfo('node-test_term_reference', 'entity'); - $this->assertEquals('Taxonomy term', $token_info['name']); - $this->assertEquals('The referenced entity', $token_info['description']); - $this->assertEquals('token', $token_info['module']); - $this->assertEquals('term', $token_info['type']); - - } - - /** - * Tests support for cardinality > 1 for entity reference tokens. - */ - public function testEntityReferenceTokensCardinality() { - /** @var \Drupal\field\FieldStorageConfigInterface $storage */ - $storage = FieldStorageConfig::load('node.test_term_reference'); - $storage->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); - $storage->save(); - - // Add a few terms. - $terms = []; - $terms_value = []; - foreach (range(1, 3) as $i) { - $terms_value[$i] = $this->randomString(); - $terms[$i] = $this->createTerm($this->vocabulary, [ - 'name' => $this->randomString(), - 'term_field' => [ - 'value' => $terms_value[$i], - 'format' => $this->testFormat->id(), - ], - ]); - } - - $entity = Node::create([ - 'title' => 'Test multivalue chained tokens', - 'type' => 'article', - 'test_term_reference' => [ - ['target_id' => $terms[1]->id()], - ['target_id' => $terms[2]->id()], - ['target_id' => $terms[3]->id()], - ], - ]); - $entity->save(); - - $this->assertTokens('node', ['node' => $entity], [ - 'test_term_reference:0:entity:term_field' => Html::escape($terms[1]->term_field->value), - 'test_term_reference:1:entity:term_field' => Html::escape($terms[2]->term_field->value), - 'test_term_reference:2:entity:term_field' => Html::escape($terms[3]->term_field->value), - 'test_term_reference:0:target_id' => $terms[1]->id(), - 'test_term_reference:1:target_id' => $terms[2]->id(), - 'test_term_reference:2:target_id' => $terms[3]->id(), - // Expects the entity's label to be returned for :entity tokens. - 'test_term_reference:0:entity' => $terms[1]->label(), - 'test_term_reference:1:entity' => $terms[2]->label(), - 'test_term_reference:2:entity' => $terms[3]->label(), - // To make sure tokens without an explicit delta can also be replaced in - // the same token replacement call. - 'test_term_reference:entity:term_field' => Html::escape($terms[1]->term_field->value), - 'test_term_reference:target_id' => $terms[1]->id(), - ]); - - // Test some non existent tokens. - $this->assertNoTokens('node', ['node' => $entity], [ - 'test_term_reference:3:term_field', - 'test_term_reference:0:does_not_exist', - 'test_term_reference:1:does:not:exist', - 'test_term_reference:1:2:does_not_exist', - ]); - } - - /** - * Test tokens for multilingual fields and entities. - */ - public function testMultilingualFields() { - // Create an english term and add a german translation for it. - $term = $this->createTerm($this->vocabulary, [ - 'name' => 'english-test-term', - 'langcode' => 'en', - 'term_field' => [ - 'value' => 'english-term-field-value', - 'format' => $this->testFormat->id(), - ], - ]); - $term->addTranslation('de', [ - 'name' => 'german-test-term', - 'term_field' => [ - 'value' => 'german-term-field-value', - 'format' => $this->testFormat->id(), - ], - ])->save(); - $german_term = $term->getTranslation('de'); - - // Create an english node, add a german translation for it and add the - // english term to the english node's entity reference field and the - // german term to the german's entity reference field. - $node = Node::create([ - 'title' => 'english-node-title', - 'type' => 'article', - 'test_term_reference' => [ - 'target_id' => $term->id(), - ], - 'test_field' => [ - 'value' => 'test-english-field', - 'format' => $this->testFormat->id(), - ], - ]); - $node->addTranslation('de', [ - 'title' => 'german-node-title', - 'test_term_reference' => [ - 'target_id' => $german_term->id(), - ], - 'test_field' => [ - 'value' => 'test-german-field', - 'format' => $this->testFormat->id(), - ], - ])->save(); - - // Verify the :title token of the english node and the :name token of the - // english term it refers to. Also verify the value of the term's field. - $this->assertTokens('node', ['node' => $node], [ - 'title' => 'english-node-title', - 'test_term_reference:entity:name' => 'english-test-term', - 'test_term_reference:entity:term_field:value' => 'english-term-field-value', - 'test_term_reference:entity:term_field' => 'english-term-field-value', - 'test_field' => 'test-english-field', - 'test_field:value' => 'test-english-field', - ]); - - // Same test for the german node and its german term. - $german_node = $node->getTranslation('de'); - $this->assertTokens('node', ['node' => $german_node], [ - 'title' => 'german-node-title', - 'test_term_reference:entity:name' => 'german-test-term', - 'test_term_reference:entity:term_field:value' => 'german-term-field-value', - 'test_term_reference:entity:term_field' => 'german-term-field-value', - 'test_field' => 'test-german-field', - 'test_field:value' => 'test-german-field', - ]); - - // If the langcode is specified, it should have priority over the node's - // active language. - $tokens = [ - 'test_field' => 'test-german-field', - 'test_field:value' => 'test-german-field', - 'test_term_reference:entity:term_field' => 'german-term-field-value', - 'test_term_reference:entity:term_field:value' => 'german-term-field-value', - ]; - $this->assertTokens('node', ['node' => $node], $tokens, ['langcode' => 'de']); - } - - /** - * Tests support for a datetime fields. - */ - public function testDatetimeFieldTokens() { - - $node = Node::create([ - 'title' => 'Node for datetime field', - 'type' => 'article', - ]); - - $node->set('field_datetime', ['1925-09-28T00:00:00', '1930-10-28T00:00:00'])->save(); - $this->assertTokens('node', ['node' => $node], [ - 'field_datetime:date:custom:Y' => '1925', - 'field_datetime:date:html_month' => '1925-09', - 'field_datetime:date' => $node->get('field_datetime')->date->getTimestamp(), - 'field_datetime:0:date:custom:Y' => '1925', - 'field_datetime:0:date:html_month' => '1925-09', - 'field_datetime:0:date' => $node->get('field_datetime')->date->getTimestamp(), - 'field_datetime:1:date:custom:Y' => '1930', - 'field_datetime:1:date:html_month' => '1930-10', - 'field_datetime:1:date' => $node->get('field_datetime')->get(1)->date->getTimestamp(), - ]); - } - - /** - * Tests support for a daterange fields. - */ - public function testDatetimeRangeFieldTokens() { - - /** @var \Drupal\node\NodeInterface $node */ - $node = Node::create([ - 'title' => 'Node for daterange field', - 'type' => 'article', - ]); - - $node->get('field_daterange')->value = '2013-12-22T00:00:00'; - $node->get('field_daterange')->end_value = '2016-08-26T00:00:00'; - $node->get('field_daterange')->appendItem([ - 'value' => '2014-08-22T00:00:00', - 'end_value' => '2017-12-20T00:00:00', - ]); - $node->get('field_daterange')->value = '2013-12-22T00:00:00'; - $node->get('field_daterange')->end_value = '2016-08-26T00:00:00'; - $node->save(); - $this->assertTokens('node', ['node' => $node], [ - 'field_daterange:start_date:html_month' => '2013-12', - 'field_daterange:start_date:custom:Y' => '2013', - 'field_daterange:end_date:custom:Y' => '2016', - 'field_daterange:start_date' => $node->get('field_daterange')->start_date->getTimestamp(), - 'field_daterange:0:start_date:html_month' => '2013-12', - 'field_daterange:0:start_date:custom:Y' => '2013', - 'field_daterange:0:end_date:custom:Y' => '2016', - 'field_daterange:0:start_date' => $node->get('field_daterange')->start_date->getTimestamp(), - 'field_daterange:1:start_date:html_month' => '2014-08', - 'field_daterange:1:start_date:custom:Y' => '2014', - 'field_daterange:1:end_date:custom:Y' => '2017', - 'field_daterange:1:end_date' => $node->get('field_daterange')->get(1)->end_date->getTimestamp(), - ]); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/FileTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/FileTest.php deleted file mode 100644 index 6cfa98875..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/FileTest.php +++ /dev/null @@ -1,57 +0,0 @@ -installEntitySchema('file'); - } - - function testFileTokens() { - // Create a test file object. - $file = File::create([ - 'fid' => 1, - 'filename' => 'test.png', - 'filesize' => 100, - 'uri' => 'public://images/test.png', - 'filemime' => 'image/png', - ]); - - $tokens = [ - 'basename' => 'test.png', - 'extension' => 'png', - 'size-raw' => 100, - ]; - $this->assertTokens('file', ['file' => $file], $tokens); - - // Test a file with no extension and a fake name. - $file->filename = 'Test PNG image'; - $file->uri = 'public://images/test'; - - $tokens = [ - 'basename' => 'test', - 'extension' => '', - 'size-raw' => 100, - ]; - $this->assertTokens('file', ['file' => $file], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/KernelTestBase.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/KernelTestBase.php deleted file mode 100644 index a9657f638..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/KernelTestBase.php +++ /dev/null @@ -1,33 +0,0 @@ -installSchema('system', ['router', 'url_alias']); - \Drupal::service('router.builder')->rebuild(); - $this->installConfig(['system']); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/NodeTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/NodeTest.php deleted file mode 100644 index 846961a4d..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/NodeTest.php +++ /dev/null @@ -1,100 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('node'); - - $node_type = NodeType::create([ - 'type' => 'page', - 'name' => 'Basic page', - 'description' => "Use basic pages for your static content, such as an 'About us' page.", - ]); - $node_type->save(); - $node_type = NodeType::create([ - 'type' => 'article', - 'name' => 'Article', - 'description' => "Use articles for time-sensitive content like news, press releases or blog posts.", - ]); - $node_type->save(); - } - - function testNodeTokens() { - $page = Node::create([ - 'type' => 'page', - 'title' => 'Source Title', - 'revision_log' => $this->randomMachineName(), - 'path' => ['alias' => '/content/source-node'] - ]); - $page->save(); - $tokens = [ - 'log' => $page->revision_log->value, - 'url:path' => '/content/source-node', - 'url:absolute' => Url::fromRoute('entity.node.canonical', ['node' => $page->id()], ['absolute' => TRUE])->toString(), - 'url:relative' => Url::fromRoute('entity.node.canonical', ['node' => $page->id()], ['absolute' => FALSE])->toString(), - 'url:unaliased:path' => "/node/{$page->id()}", - 'content-type' => 'Basic page', - 'content-type:name' => 'Basic page', - 'content-type:machine-name' => 'page', - 'content-type:description' => "Use basic pages for your static content, such as an 'About us' page.", - 'content-type:node-count' => 1, - 'content-type:edit-url' => Url::fromRoute('entity.node_type.edit_form', ['node_type' => 'page'], ['absolute' => TRUE])->toString(), - 'source:title' => 'Source Title', - // Deprecated tokens. - 'type' => 'page', - 'type-name' => 'Basic page', - 'url:alias' => '/content/source-node', - ]; - $this->assertTokens('node', ['node' => $page], $tokens); - - $article = Node::create([ - 'type' => 'article', - 'title' => 'Source Title', - ]); - $article->save(); - $tokens = [ - 'log' => '', - 'url:path' => "/node/{$article->id()}", - 'url:absolute' => Url::fromRoute('entity.node.canonical', ['node' => $article->id()], ['absolute' => TRUE])->toString(), - 'url:relative' => Url::fromRoute('entity.node.canonical', ['node' => $article->id()], ['absolute' => FALSE])->toString(), - 'url:unaliased:path' => "/node/{$article->id()}", - 'content-type' => 'Article', - 'content-type:name' => 'Article', - 'content-type:machine-name' => 'article', - 'content-type:description' => "Use articles for time-sensitive content like news, press releases or blog posts.", - 'content-type:node-count' => 1, - 'content-type:edit-url' => Url::fromRoute('entity.node_type.edit_form', ['node_type' => 'article'], ['absolute' => TRUE])->toString(), - 'source:title' => 'Source Title', - // Deprecated tokens. - 'type' => 'article', - 'type-name' => 'Article', - 'url:alias' => "/node/{$article->id()}", - ]; - $this->assertTokens('node', ['node' => $article], $tokens); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/RandomTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/RandomTest.php deleted file mode 100644 index 5162846ce..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/RandomTest.php +++ /dev/null @@ -1,28 +0,0 @@ - '[0-9]{1,}', - 'hash:md5' => '[0-9a-f]{32}', - 'hash:sha1' => '[0-9a-f]{40}', - 'hash:sha256' => '[0-9a-f]{64}', - 'hash:invalid-algo' => NULL, - ]; - - $first_set = $this->assertTokens('random', [], $tokens, ['regex' => TRUE]); - $second_set = $this->assertTokens('random', [], $tokens, ['regex' => TRUE]); - foreach ($first_set as $token => $value) { - $this->assertNotIdentical($first_set[$token], $second_set[$token]); - } - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/TaxonomyTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/TaxonomyTest.php deleted file mode 100644 index abc99ea4d..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/TaxonomyTest.php +++ /dev/null @@ -1,154 +0,0 @@ -installEntitySchema('taxonomy_term'); - - // Create the default tags vocabulary. - $vocabulary = Vocabulary::create([ - 'name' => 'Tags', - 'vid' => 'tags', - ]); - $vocabulary->save(); - $this->vocab = $vocabulary; - } - - /** - * Test the additional taxonomy term tokens. - */ - function testTaxonomyTokens() { - $root_term = $this->addTerm($this->vocab, ['name' => 'Root term', 'path' => ['alias' => '/root-term']]); - $tokens = [ - 'url' => Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $root_term->id()], ['absolute' => TRUE])->toString(), - 'url:absolute' => Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $root_term->id()], ['absolute' => TRUE])->toString(), - 'url:relative' => Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $root_term->id()], ['absolute' => FALSE])->toString(), - 'url:path' => '/root-term', - 'url:unaliased:path' => "/taxonomy/term/{$root_term->id()}", - 'edit-url' => Url::fromRoute('entity.taxonomy_term.edit_form', ['taxonomy_term' => $root_term->id()], ['absolute' => TRUE])->toString(), - 'parents' => NULL, - 'parents:count' => NULL, - 'parents:keys' => NULL, - 'root' => NULL, - // Deprecated tokens - 'url:alias' => '/root-term', - ]; - $this->assertTokens('term', ['term' => $root_term], $tokens); - - $parent_term = $this->addTerm($this->vocab, ['name' => 'Parent term', 'parent' => $root_term->id()]); - $tokens = [ - 'url' => Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $parent_term->id()], ['absolute' => TRUE])->toString(), - 'url:absolute' => Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $parent_term->id()], ['absolute' => TRUE])->toString(), - 'url:relative' => Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $parent_term->id()], ['absolute' => FALSE])->toString(), - 'url:path' => "/taxonomy/term/{$parent_term->id()}", - 'url:unaliased:path' => "/taxonomy/term/{$parent_term->id()}", - 'edit-url' => Url::fromRoute('entity.taxonomy_term.edit_form', ['taxonomy_term' => $parent_term->id()], ['absolute' => TRUE])->toString(), - 'parents' => 'Root term', - 'parents:count' => 1, - 'parents:keys' => $root_term->id(), - 'root' => $root_term->label(), - 'root:tid' => $root_term->id(), - // Deprecated tokens - 'url:alias' => "/taxonomy/term/{$parent_term->id()}", - ]; - $this->assertTokens('term', ['term' => $parent_term], $tokens); - - $term = $this->addTerm($this->vocab, ['name' => 'Test term', 'parent' => $parent_term->id()]); - $tokens = [ - 'parents' => 'Root term, Parent term', - 'parents:count' => 2, - 'parents:keys' => implode(', ', [$root_term->id(), $parent_term->id()]), - ]; - $this->assertTokens('term', ['term' => $term], $tokens); - } - - /** - * Test the additional vocabulary tokens. - */ - function testVocabularyTokens() { - $vocabulary = $this->vocab; - $tokens = [ - 'machine-name' => 'tags', - 'edit-url' => Url::fromRoute('entity.taxonomy_vocabulary.edit_form', ['taxonomy_vocabulary' => $vocabulary->id()], ['absolute' => TRUE])->toString(), - ]; - $this->assertTokens('vocabulary', ['vocabulary' => $vocabulary], $tokens); - } - - function addVocabulary(array $vocabulary = []) { - $vocabulary += [ - 'name' => mb_strtolower($this->randomMachineName(5)), - 'nodes' => ['article' => 'article'], - ]; - $vocabulary = Vocabulary::create($vocabulary)->save(); - return $vocabulary; - } - - function addTerm($vocabulary, array $term = []) { - $term += [ - 'name' => mb_strtolower($this->randomMachineName(5)), - 'vid' => $vocabulary->id(), - ]; - $term = Term::create($term); - $term->save(); - return $term; - } - - /** - * Test the multilingual terms. - */ - function testMultilingualTerms() { - // Add a second language. - $language = ConfigurableLanguage::createFromLangcode('de'); - $language->save(); - - // Create an english parent term and add a german translation for it. - $parent_term = $this->addTerm($this->vocab, [ - 'name' => 'english-parent-term', - 'langcode' => 'en', - ]); - $parent_term->addTranslation('de', [ - 'name' => 'german-parent-term', - ])->save(); - - // Create a term related to the parent term. - $child_term = $this->addTerm($this->vocab, [ - 'name' => 'english-child-term', - 'langcode' => 'en', - 'parent' => $parent_term->id(), - ]); - $child_term->addTranslation('de', [ - 'name' => 'german-child-term', - ])->save(); - - // Expect the parent term to be in the specified language. - $this->assertTokens('term', ['term' => $child_term], ['parents' => 'german-parent-term'], ['langcode' => 'de']); - $this->assertTokens('term', ['term' => $child_term], ['root' => 'german-parent-term'], ['langcode' => 'de']); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/UnitTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/UnitTest.php deleted file mode 100644 index c031e6bfb..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/UnitTest.php +++ /dev/null @@ -1,120 +0,0 @@ -tokenService = \Drupal::token(); - } - - /** - * Test invalid tokens. - */ - public function testGetInvalidTokens() { - $tests = []; - $tests[] = [ - 'valid tokens' => [ - '[node:title]', - '[node:created:short]', - '[node:created:custom:invalid]', - '[node:created:custom:mm-YYYY]', - '[node:colons:in:name]', - '[site:name]', - '[site:slogan]', - '[current-date:short]', - '[current-user:uid]', - '[current-user:ip-address]', - ], - 'invalid tokens' => [ - '[node:title:invalid]', - '[node:created:invalid]', - '[node:created:short:invalid]', - '[node:colons:in:name:invalid]', - '[invalid:title]', - '[site:invalid]', - '[user:ip-address]', - '[user:uid]', - '[comment:cid]', - // Deprecated tokens - '[node:tnid]', - '[node:type]', - '[node:type-name]', - '[date:short]', - ], - 'types' => ['node'], - ]; - $tests[] = [ - 'valid tokens' => [ - '[node:title]', - '[node:created:short]', - '[node:created:custom:invalid]', - '[node:created:custom:mm-YYYY]', - '[node:colons:in:name]', - '[site:name]', - '[site:slogan]', - '[user:uid]', - '[current-date:short]', - '[current-user:uid]', - ], - 'invalid tokens' => [ - '[node:title:invalid]', - '[node:created:invalid]', - '[node:created:short:invalid]', - '[node:colons:in:name:invalid]', - '[invalid:title]', - '[site:invalid]', - '[user:ip-address]', - '[comment:cid]', - // Deprecated tokens - '[node:tnid]', - '[node:type]', - '[node:type-name]', - ], - 'types' => ['all'], - ]; - - foreach ($tests as $test) { - $tokens = array_merge($test['valid tokens'], $test['invalid tokens']); - shuffle($tokens); - - $invalid_tokens = $this->tokenService->getInvalidTokensByContext(implode(' ', $tokens), $test['types']); - - sort($invalid_tokens); - sort($test['invalid tokens']); - $this->assertEqual($invalid_tokens, $test['invalid tokens'], 'Invalid tokens detected properly: ' . implode(', ', $invalid_tokens)); - } - } - - /** - * Test that tokens are generated only for content entities. - */ - public function testContentEntityOnlyTokens() { - // Verify that type and token info for a config entity is not generated. - $this->assertNull($this->tokenService->getTokenInfo('user_role', 'original')); - $this->assertNull($this->tokenService->getTokenInfo('user_role', 'url')); - $this->assertNull($this->tokenService->getTypeInfo('user_role')); - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/UrlTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/UrlTest.php deleted file mode 100644 index 1464095d0..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/UrlTest.php +++ /dev/null @@ -1,88 +0,0 @@ -token = $this->container->get('token'); - $this->requestStack = $this->container->get('request_stack'); - $this->currentRouteMatch = $this->container->get('current_route_match'); - } - - /** - * Test the url token replacements for current requests. - * - * The method ::expectedCurrentRequestUrlResults() is not declared - * as a regular data provider, because it might use services from - * the global Drupal container, which is not initialized yet during - * the invocation of data providers. - */ - public function testCurrentRequestUrls() { - foreach ($this->expectedCurrentRequestUrlResults() as $data_set) { - list ($request, $text, $data, $options, $expected_output) = $data_set; - // Set the request as the current one. - $this->requestStack->pop(); - $this->requestStack->push($request); - $this->currentRouteMatch->resetRouteMatch(); - - $this->assertEquals($expected_output, $this->token->replace($text, $data, $options)); - } - } - - /** - * Provides a list of results to expect for ::testRequestUrls(). - * - * Each data set of this array holds the following order: - * - The request object to test for. - * - The input text as string. - * - The token data as array. - * - Further options for the token replacement as array. - * - The output to expect after token replacement. - * - * @return array - * The list of results to expect. - */ - public function expectedCurrentRequestUrlResults() { - return [ - [Request::createFromGlobals(), '[current-page:url]', [], [], Url::createFromRequest(Request::createFromGlobals())->setAbsolute()->toString()], - [Request::create('/should-not-exist'), '[current-page:url:path]', [], [], '/'], - [Request::create('/https://drupal.org/'), '[current-page:url:absolute]', [], [], '[current-page:url:absolute]'], - [Request::create('/https://drupal.org/'), '[current-page:url:absolute]', [], ['clear' => TRUE], ''], - ]; - } - -} diff --git a/sites/all/modules/contrib/dev/token/tests/src/Kernel/ViewsTest.php b/sites/all/modules/contrib/dev/token/tests/src/Kernel/ViewsTest.php deleted file mode 100644 index 884e4fcb4..000000000 --- a/sites/all/modules/contrib/dev/token/tests/src/Kernel/ViewsTest.php +++ /dev/null @@ -1,50 +0,0 @@ -installEntitySchema('user'); - ViewTestData::createTestViews(get_class($this), ['token_module_test']); - } - - /** - * Tests path token replacements generated from a view without a path. - */ - public function testTokenReplacementNoPath() { - $token_handler = \Drupal::token(); - $view = Views::getView('token_views_test'); - $view->setDisplay('block_1'); - $view->execute(); - - $this->assertSame('', $token_handler->replace('[view:url]', ['view' => $view]), 'Token [view:url] is empty for views without path.'); - } - -} diff --git a/sites/all/modules/contrib/dev/token/token.drush.inc b/sites/all/modules/contrib/dev/token/token.drush.inc deleted file mode 100644 index b31b8d764..000000000 --- a/sites/all/modules/contrib/dev/token/token.drush.inc +++ /dev/null @@ -1,20 +0,0 @@ -= 8.5) - -# Information added by Drupal.org packaging script on 2018-09-21 -version: '8.x-1.5' -core: '8.x' -project: 'token' -datestamp: 1537557488 diff --git a/sites/all/modules/contrib/dev/token/token.install b/sites/all/modules/contrib/dev/token/token.install deleted file mode 100644 index 39af20004..000000000 --- a/sites/all/modules/contrib/dev/token/token.install +++ /dev/null @@ -1,316 +0,0 @@ - $problem) { - if (!empty($problem['problems'])) { - $problems = array_unique($problem['problems']); - - $build = [ - '#theme' => 'item_list', - '#items' => $problems, - ]; - - $requirements['token-' . $problem_key] = [ - 'title' => $problem['label'], - 'value' => \Drupal::service('renderer')->renderPlain($build), - 'severity' => $problem['severity'], - ]; - } - } - } - - return $requirements; -} - -/** - * Implements hook_install(). - */ -function token_install() { - // Create a token view mode for each entity type. - $info = \Drupal::entityTypeManager()->getDefinitions(); - foreach ($info as $entity_type => $entity_type_info) { - // We're only interested in entity types with a view builder. - if (!$entity_type_info->getViewBuilderClass()) { - continue; - } - // Try to find a token view mode for that entity type. - $storage = \Drupal::entityTypeManager()->getStorage('entity_view_mode'); - // Add a token view mode if it does not already exist. - if (!$storage->load("$entity_type.token")) { - $storage->create([ - 'targetEntityType' => $entity_type, - 'id' => "$entity_type.token", - 'status' => TRUE, - 'label' => t('Token'), - ])->save(); - } - } -} - -/** - * Build a list of Drupal 6 tokens and their Drupal 7 token names. - */ -function _token_upgrade_token_list() { - $tokens = [ - // Global tokens - 'user-name' => 'current-user:name', - 'user-id' => 'current-user:id', - 'user-mail' => 'current-user:mail', - 'site-url' => 'site:url', - 'site-name' => 'site:name', - 'site-slogan' => 'site:slogan', - 'site-mission' => 'site:mission', - 'site-mail' => 'site:mail', - 'site-date' => 'date:short', - //'site-date-' => '', // Date tokens expanded below - 'current-page-path' => 'current-page:path', - 'current-page-url' => 'current-page:url', - 'page-number' => 'current-page:page-number', - - // Comment tokens - 'comment-cid' => 'comment:cid', - 'comment-nid' => 'comment:node:nid', - 'comment-title' => 'comment:title', - 'comment-body' => 'comment:body', - 'comment-author-name' => 'comment:author:name', - 'comment-author-mail' => 'comment:author:mail', - //'comment-body-format' => '', - //'comment-' => '', // Date tokens expanded below - 'comment-node-title' => 'comment:node', - - // Node tokens - 'nid' => 'node:nid', - 'type' => 'node:type', - 'type-name' => 'node:type-name', - 'language' => 'node:language', - 'title' => 'node:title', - 'author-uid' => 'node:author:uid', - 'author-name' => 'node:author:name', - 'author-mail' => 'node:author:mail', - 'node_comment_count' => 'node:comment-count', - 'unread_comment_count' => 'node:comment-count-new', - 'log' => 'node:log', - //'' => '', // Date tokens expanded below - //'mod-' => '', // Date tokens expanded below - 'menupath' => 'node:menu-link:parent:path][node:menu-link', - 'menu' => 'node:menu-link:menu-name', - 'menu-link-title' => 'node:menu-link', - 'menu-link-mlid' => 'node:menu-link:mlid', - 'menu-link-plid' => 'node:menu-link:parent:mlid', - //'term' => 'node:term', - //'term-id' => 'node:term:tid', - //'vocab' => 'node:term:vocabulary', - //'vocab-id' => 'node:term:vocabulary:vid', - - // Book tokens - //'book' => 'node:book', - //'book_id' => 'node:book:bid', - //'bookpath' => 'node:book:path', - - // Taxonomy tokens - 'tid' => 'term:tid', - 'cat' => 'term:name', - 'cat-description' => 'term:description', - 'vid' => 'term:vocabulary:vid', - 'vocab' => 'term:vocabulary', - 'vocab-description' => 'term:vocabulary:description', - - // User tokens - 'user' => 'user:name', - 'uid' => 'user:uid', - 'mail' => 'user:mail', - 'reg-date' => 'user:created', - 'reg-since' => 'user:created:since', - //'user-created' => '', // Date tokens expanded below - 'log-date' => 'user:last-login', - 'log-since' => 'user:last-login:since', - //'user-last-login' => '', // Date tokens expanded below - //'date-in-tz' => '', - 'account-url' => 'user:url', - 'account-edit' => 'user:edit-url', - ]; - - // Account for date tokens which need to be expanded. - $tokens += _token_upgrade_token_date_list('site-', 'site:date'); - $tokens += _token_upgrade_token_date_list('', 'node:created'); - $tokens += _token_upgrade_token_date_list('mod-', 'node:changed'); - //$tokens += _token_upgrade_token_date_list('node-revision-', 'node:changed'); - $tokens += _token_upgrade_token_date_list('comment-', 'comment:created'); - $tokens += _token_upgrade_token_date_list('user-register-', 'user:created'); - $tokens += _token_upgrade_token_date_list('user-last-login-', 'user:last-login'); - - return $tokens; -} - -/** - * Build a list of Drupal 6 date tokens and their Drupal 7 token names. - */ -function _token_upgrade_token_date_list($old_token, $new_token) { - $tokens = []; - $formats = [ - 'yyyy' => 'Y', - 'yy' => 'y', - 'month' => 'F', - 'mon' => 'M', - 'mm' => 'm', - 'm' => 'n', - 'ww' => 'W', - 'date' => 'N', - 'day' => 'l', - 'ddd' => 'D', - 'dd' => 'd', - 'd' => 'j', - ]; - foreach ($formats as $token_format => $date_format) { - $tokens[$old_token . $token_format] = "$new_token:custom:$date_format"; - } - $tokens[$old_token . 'raw'] = "$new_token:raw"; - $tokens[$old_token . 'since'] = "$new_token:since"; - return $tokens; -} - -/** - * Update a string containing Drupal 6 style tokens to Drupal 7 style tokens. - * - * @param $text - * A string containing tokens. - * @param $updates - * An optional array of Drupal 7 tokens keyed by their Drupal 6 token name. - * The default tokens will be merged into this array. Note neither the old - * or new token names should include the surrounding bracket ([ and ]) - * characters. - * @return - * A string with the tokens upgraded - * - * @see _token_upgrade_token_list() - */ -function token_update_token_text($text, $updates = [], $leading = '[', $trailing = ']') { - $updates += _token_upgrade_token_list(); - $regex = '/' . preg_quote($leading, '/') . '([^\s]*)' . preg_quote($trailing, '/') . '/'; - preg_match_all($regex, $text, $matches); - - foreach ($matches[1] as $index => $old_token) { - if (isset($updates[$old_token])) { - $new_token = $updates[$old_token]; - $text = str_replace("{$leading}{$old_token}{$trailing}", "[$new_token]", $text); - // Also replace any tokens that have a -raw suffix. - $text = str_replace("{$leading}{$old_token}-raw{$trailing}", "[$new_token]", $text); - } - } - - return $text; -} - -/** - * Get token problems. - */ -function token_get_token_problems() { - // @todo Improve the duplicate checking to report which modules are the offenders. - //$token_info = []; - //foreach (module_implements('token_info') as $module) { - // $module_token_info = module_invoke($module, 'token_info'); - // if (in_array($module, _token_core_supported_modules())) { - // $module .= '/token'; - // } - // if (isset($module_token_info['types'])) { - // if (is_array($module_token_info['types'])) { - // foreach (array_keys($module_token_info['types']) as $type) { - // if (is_array($module_token_info['types'][$type])) { - // $module_token_info['types'][$type] += ['module' => $module]; - // } - // } - // } - // } - // if (isset($module_token_info['tokens'])) { - // if (is_array($module_token_info['tokens'])) { - // - // } - // } - // if (is_array($module_token_info)) { - // $token_info = array_merge_recursive($token_info, $module_token_info); - // } - //} - - $token_info = \Drupal::token()->getInfo(); - $token_problems = [ - 'not-array' => [ - 'label' => t('Tokens or token types not defined as arrays'), - 'severity' => REQUIREMENT_ERROR, - ], - 'missing-info' => [ - 'label' => t('Tokens or token types missing name property'), - 'severity' => REQUIREMENT_WARNING, - ], - 'type-no-tokens' => [ - 'label' => t('Token types do not have any tokens defined'), - 'severity' => REQUIREMENT_INFO, - ], - 'tokens-no-type' => [ - 'label' => t('Token types are not defined but have tokens'), - 'severity' => REQUIREMENT_INFO, - ], - 'duplicate' => [ - 'label' => t('Token or token types are defined by multiple modules'), - 'severity' => REQUIREMENT_ERROR, - ], - ]; - - // Check token types for problems. - foreach ($token_info['types'] as $type => $type_info) { - $real_type = !empty($type_info['type']) ? $type_info['type'] : $type; - if (!is_array($type_info)) { - $token_problems['not-array']['problems'][] = "\$info['types']['$type']"; - continue; - } - elseif (!isset($type_info['name'])) { - $token_problems['missing-info']['problems'][] = "\$info['types']['$type']"; - } - elseif (is_array($type_info['name'])) { - $token_problems['duplicate']['problems'][] = "\$info['types']['$type']"; - } - elseif (empty($token_info['tokens'][$real_type])) { - $token_problems['type-no-tokens']['problems'][] = "\$info['types']['$real_type']"; - } - } - - // Check tokens for problems. - foreach ($token_info['tokens'] as $type => $tokens) { - if (!is_array($tokens)) { - $token_problems['not-array']['problems'][] = "\$info['tokens']['$type']"; - continue; - } - else { - foreach (array_keys($tokens) as $token) { - if (!is_array($tokens[$token])) { - $token_problems['not-array']['problems'][] = "\$info['tokens']['$type']['$token']"; - continue; - } - elseif (!isset($tokens[$token]['name'])) { - $token_problems['missing-info']['problems'][] = "\$info['tokens']['$type']['$token']"; - } - elseif (is_array($tokens[$token]['name'])) { - $token_problems['duplicate']['problems'][] = "\$info['tokens']['$type']['$token']"; - } - } - } - if (!isset($token_info['types'][$type])) { - $token_problems['tokens-no-type']['problems'][] = "\$info['types']['$type']"; - } - } - - return $token_problems; -} diff --git a/sites/all/modules/contrib/dev/token/token.libraries.yml b/sites/all/modules/contrib/dev/token/token.libraries.yml deleted file mode 100644 index 5c7ca14d1..000000000 --- a/sites/all/modules/contrib/dev/token/token.libraries.yml +++ /dev/null @@ -1,25 +0,0 @@ -jquery.treeTable: - remote: 'http://plugins.jquery.com/treetable/' - version: 3.2.0 - license: - name: MIT - url: https://github.com/ludo/jquery-treetable/blob/3.2.0/MIT-LICENSE.txt - gpl-compatible: true - js: - js/jquery.treetable.js: {} - css: - component: - css/jquery.treetable.css: {} - css/token.treetable.theme.css: {} - dependencies: - - core/jquery -token: - version: VERSION - js: - js/token.js: {} - css: - component: - css/token.css: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/dev/token/token.links.task.yml b/sites/all/modules/contrib/dev/token/token.links.task.yml deleted file mode 100644 index e89ce1624..000000000 --- a/sites/all/modules/contrib/dev/token/token.links.task.yml +++ /dev/null @@ -1,3 +0,0 @@ -token.devel_entities: - class: \Drupal\Core\Menu\LocalTaskDefault - deriver: \Drupal\token\Plugin\Derivative\DevelLocalTask diff --git a/sites/all/modules/contrib/dev/token/token.module b/sites/all/modules/contrib/dev/token/token.module deleted file mode 100644 index 0d4f2cea1..000000000 --- a/sites/all/modules/contrib/dev/token/token.module +++ /dev/null @@ -1,793 +0,0 @@ -buildAllRenderable([ - 'click_insert' => FALSE, - 'show_restricted' => TRUE, - 'show_nested' => FALSE, - ]); - $output = '

        ' . t('About') . '

        '; - $output .= '

        ' . t('The Token module provides a user interface for the site token system. It also adds some additional tokens that are used extensively during site development. Tokens are specially formatted chunks of text that serve as placeholders for a dynamically generated value. For more information, covering both the token system and the additional tools provided by the Token module, see the online documentation.', [':online' => 'https://www.drupal.org/documentation/modules/token', ':project' => 'https://www.drupal.org/project/token']) . '

        '; - $output .= '

        ' . t('Uses') . '

        '; - $output .= '

        ' . t('Your website uses a shared token system for exposing and using placeholder tokens and their appropriate replacement values. This allows for any module to provide placeholder tokens for strings without having to reinvent the wheel. It also ensures consistency in the syntax used for tokens, making the system as a whole easier for end users to use.') . '

        '; - $output .= '
        '; - $output .= '
        ' . t('The list of the currently available tokens on this site are shown below.') . '
        '; - $output .= '
        ' . \Drupal::service('renderer')->render($token_tree) . '
        '; - $output .= '
        '; - return $output; - } -} - -/** - * Return an array of the core modules supported by token.module. - */ -function _token_core_supported_modules() { - return ['book', 'field', 'menu_ui']; -} - -/** - * Implements hook_theme(). - */ -function token_theme() { - $info['token_tree_link'] = [ - 'variables' => [ - 'token_types' => [], - 'global_types' => TRUE, - 'click_insert' => TRUE, - 'show_restricted' => FALSE, - 'show_nested' => FALSE, - 'recursion_limit' => 3, - 'text' => NULL, - 'options' => [], - ], - 'file' => 'token.pages.inc', - ]; - - return $info; -} - -/** - * Implements hook_block_view_alter(). - */ -function token_block_view_alter(&$build, BlockPluginInterface $block) { - if (isset($build['#configuration'])) { - $label = $build['#configuration']['label']; - if ($label != '') { - // The label is automatically escaped, avoid escaping it twice. - // @todo https://www.drupal.org/node/2580723 will add a method or option - // to the token API to do this, use that when available. - $bubbleable_metadata = BubbleableMetadata::createFromRenderArray($build); - $build['#configuration']['label'] = PlainTextOutput::renderFromHtml(\Drupal::token()->replace($label, [], [], $bubbleable_metadata)); - $bubbleable_metadata->applyTo($build); - } - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function token_form_block_form_alter(&$form, FormStateInterface $form_state) { - $token_tree = [ - '#theme' => 'token_tree_link', - '#token_types' => [], - ]; - $rendered_token_tree = \Drupal::service('renderer')->render($token_tree); - $form['settings']['label']['#description'] = t('This field supports tokens. @browse_tokens_link', [ - '@browse_tokens_link' => $rendered_token_tree, - ]); - $form['settings']['label']['#element_validate'][] = 'token_element_validate'; - $form['settings']['label'] += ['#token_types' => []]; -} - -/** - * Implements hook_field_info_alter(). - */ -function token_field_info_alter(&$info) { - $defaults = [ - 'taxonomy_term_reference' => 'taxonomy_term_reference_plain', - 'number_integer' => 'number_unformatted', - 'number_decimal' => 'number_unformatted', - 'number_float' => 'number_unformatted', - 'file' => 'file_url_plain', - 'image' => 'file_url_plain', - 'text' => 'text_default', - 'text_long' => 'text_default', - 'text_with_summary' => 'text_default', - 'list_integer' => 'list_default', - 'list_float' => 'list_default', - 'list_string' => 'list_default', - 'list_boolean' => 'list_default', - ]; - foreach ($defaults as $field_type => $default_token_formatter) { - if (isset($info[$field_type])) { - $info[$field_type] += ['default_token_formatter' => $default_token_formatter]; - } - } -} - -/** - * Implements hook_date_format_insert(). - */ -function token_date_format_insert() { - token_clear_cache(); -} - -/** - * Implements hook_date_format_delete(). - */ -function token_date_format_delete() { - token_clear_cache(); -} - -/** - * Implements hook_field_storage_config_presave(). - */ -function token_field_config_presave($instance) { - token_clear_cache(); -} - -/** - * Implements hook_field_storage_config_delete(). - */ -function token_field_config_delete($instance) { - token_clear_cache(); -} - -/** - * Clear token caches and static variables. - */ -function token_clear_cache() { - \Drupal::token()->resetInfo(); - \Drupal::service('token.entity_mapper')->resetInfo(); - drupal_static_reset('token_menu_link_load_all_parents'); - drupal_static_reset('token_book_link_load'); -} - -/** - * Implements hook_entity_type_alter(). - * - * Because some token types to do not match their entity type names, we have to - * map them to the proper type. This is purely for other modules' benefit. - * - * @see \Drupal\token\TokenEntityMapperInterface::getEntityTypeMappings() - * @see http://drupal.org/node/737726 - */ -function token_entity_type_alter(array &$entity_types) { - $devel_exists = \Drupal::moduleHandler()->moduleExists('devel'); - /* @var $entity_types EntityTypeInterface[] */ - foreach ($entity_types as $entity_type_id => $entity_type) { - if (!$entity_type->get('token_type')) { - // Fill in default token types for entities. - switch ($entity_type_id) { - case 'taxonomy_term': - case 'taxonomy_vocabulary': - // Stupid taxonomy token types... - $entity_type->set('token_type', str_replace('taxonomy_', '', $entity_type_id)); - break; - - default: - // By default the token type is the same as the entity type. - $entity_type->set('token_type', $entity_type_id); - break; - } - } - - if ($devel_exists - && $entity_type->hasViewBuilderClass() - && ($canonical = $entity_type->getLinkTemplate('canonical')) - && !$entity_type->hasLinkTemplate('token-devel')) { - $entity_type->setLinkTemplate('token-devel', $canonical . '/devel/token'); - } - } -} - -/** - * Implements hook_entity_view_modes_info(). - */ - -/** - * Implements hook_module_implements_alter(). - * - * Adds missing token support for core modules. - */ -function token_module_implements_alter(&$implementations, $hook) { - \Drupal::moduleHandler()->loadInclude('token', 'inc', 'token.tokens'); - - if ($hook == 'tokens' || $hook == 'token_info' || $hook == 'token_info_alter' || $hook == 'tokens_alter') { - foreach (_token_core_supported_modules() as $module) { - if (\Drupal::moduleHandler()->moduleExists($module) && function_exists($module . '_' . $hook)) { - $implementations[$module] = TRUE; - } - } - // Move token.module to get included first since it is responsible for - // other modules. - if (isset($implementations['token'])) { - unset($implementations['token']); - $implementations = array_merge(['token' => 'tokens'], $implementations); - } - } -} - -/** - * Return the module responsible for a token. - * - * @param string $type - * The token type. - * @param string $name - * The token name. - * - * @return mixed - * The value of $info['tokens'][$type][$name]['module'] from token info, or - * NULL if the value does not exist. - */ -function _token_module($type, $name) { - $token_info = \Drupal::token()->getTokenInfo($type, $name); - return isset($token_info['module']) ? $token_info['module'] : NULL; -} - -/** - * Validate a form element that should have tokens in it. - * - * Form elements that want to add this validation should have the #token_types - * parameter defined. - * - * For example: - * @code - * $form['my_node_text_element'] = [ - * '#type' => 'textfield', - * '#title' => t('Some text to token-ize that has a node context.'), - * '#default_value' => 'The title of this node is [node:title].', - * '#element_validate' => ['token_element_validate'], - * '#token_types' => ['node'], - * '#min_tokens' => 1, - * '#max_tokens' => 10, - * ]; - * @endcode - */ -function token_element_validate($element, FormStateInterface $form_state) { - $value = isset($element['#value']) ? $element['#value'] : $element['#default_value']; - - if (!mb_strlen($value)) { - // Empty value needs no further validation since the element should depend - // on using the '#required' FAPI property. - return $element; - } - - $tokens = \Drupal::token()->scan($value); - $title = empty($element['#title']) ? $element['#parents'][0] : $element['#title']; - - // Validate if an element must have a minimum number of tokens. - if (isset($element['#min_tokens']) && count($tokens) < $element['#min_tokens']) { - $error = \Drupal::translation()->formatPlural($element['#min_tokens'], '%name must contain at least one token.', '%name must contain at least @count tokens.', ['%name' => $title]); - $form_state->setError($element, $error); - } - - // Validate if an element must have a maximum number of tokens. - if (isset($element['#max_tokens']) && count($tokens) > $element['#max_tokens']) { - $error = \Drupal::translation()->formatPlural($element['#max_tokens'], '%name must contain at most one token.', '%name must contain at most @count tokens.', ['%name' => $title]); - $form_state->setError($element, $error); - } - - // Check if the field defines specific token types. - if (isset($element['#token_types'])) { - $invalid_tokens = \Drupal::token()->getInvalidTokensByContext($tokens, $element['#token_types']); - if ($invalid_tokens) { - $form_state->setError($element, t('%name is using the following invalid tokens: @invalid-tokens.', ['%name' => $title, '@invalid-tokens' => implode(', ', $invalid_tokens)])); - } - } - - return $element; -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function token_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state) { - $field_config = $form_state->getFormObject()->getEntity(); - $field_storage = $field_config->getFieldStorageDefinition(); - if ($field_storage->isLocked()) { - return; - } - $field_type = $field_storage->getType(); - if (($field_type == 'file' || $field_type == 'image') && isset($form['settings']['file_directory'])) { - // GAH! We can only support global tokens in the upload file directory path. - $form['settings']['file_directory']['#element_validate'][] = 'token_element_validate'; - // Date support needs to be implicitly added, as while technically it's not - // a global token, it is a not only used but is the default value. - // https://www.drupal.org/node/2642160 - $form['settings']['file_directory'] += ['#token_types' => ['date']]; - $form['settings']['file_directory']['#description'] .= ' ' . t('This field supports tokens.'); - } - - // Note that the description is tokenized via token_field_widget_form_alter(). - $form['description']['#element_validate'][] = 'token_element_validate'; - $form['description'] += ['#token_types' => []]; - - $form['token_tree'] = [ - '#theme' => 'token_tree_link', - '#token_types' => [], - '#weight' => $form['description']['#weight'] + 0.5, - ]; -} - -/** - * Implements hook_form_BASE_FORM_ID_alter(). - * - * Alters the configure action form to add token context validation and - * adds the token tree for a better token UI and selection. - */ -function token_form_action_form_alter(&$form, $form_state) { - if (isset($form['plugin'])) { - switch ($form['plugin']['#value']) { - case 'action_message_action': - case 'action_send_email_action': - case 'action_goto_action': - $form['token_tree'] = [ - '#theme' => 'token_tree_link', - '#token_types' => 'all', - '#weight' => 100, - ]; - $form['actions']['#weight'] = 101; - // @todo Add token validation to the action fields that can use tokens. - break; - } - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Alters the user e-mail fields to add token context validation and - * adds the token tree for a better token UI and selection. - */ -function token_form_user_admin_settings_alter(&$form, FormStateInterface $form_state) { - $email_token_help = t('Available variables are: [site:name], [site:url], [user:display-name], [user:account-name], [user:mail], [site:login-url], [site:url-brief], [user:edit-url], [user:one-time-login-url], [user:cancel-url].'); - - foreach (Element::children($form) as $key) { - $element = &$form[$key]; - - // Remove the crummy default token help text. - if (!empty($element['#description'])) { - $element['#description'] = trim(str_replace($email_token_help, t('The list of available tokens that can be used in e-mails is provided below.'), $element['#description'])); - } - - switch ($key) { - case 'email_admin_created': - case 'email_pending_approval': - case 'email_no_approval_required': - case 'email_password_reset': - case 'email_cancel_confirm': - // Do nothing, but allow execution to continue. - break; - - case 'email_activated': - case 'email_blocked': - case 'email_canceled': - // These fieldsets have their e-mail elements inside a 'settings' - // sub-element, so switch to that element instead. - $element = &$form[$key]['settings']; - break; - - default: - continue 2; - } - - foreach (Element::children($element) as $sub_key) { - if (!isset($element[$sub_key]['#type'])) { - continue; - } - elseif ($element[$sub_key]['#type'] == 'textfield' && substr($sub_key, -8) === '_subject') { - // Add validation to subject textfields. - $element[$sub_key]['#element_validate'][] = 'token_element_validate'; - $element[$sub_key] += ['#token_types' => ['user']]; - } - elseif ($element[$sub_key]['#type'] == 'textarea' && substr($sub_key, -5) === '_body') { - // Add validation to body textareas. - $element[$sub_key]['#element_validate'][] = 'token_element_validate'; - $element[$sub_key] += ['#token_types' => ['user']]; - } - } - } - - // Add the token tree UI. - $form['email']['token_tree'] = [ - '#theme' => 'token_tree_link', - '#token_types' => ['user'], - '#show_restricted' => TRUE, - '#show_nested' => FALSE, - '#weight' => 90, - ]; -} - -/** - * Prepare a string for use as a valid token name. - * - * @param $name - * The token name to clean. - * @return - * The cleaned token name. - */ -function token_clean_token_name($name) { - static $names = []; - - if (!isset($names[$name])) { - $cleaned_name = strtr($name, [' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '']); - $cleaned_name = preg_replace('/[^\w\-]/i', '', $cleaned_name); - $cleaned_name = trim($cleaned_name, '-'); - $names[$name] = $cleaned_name; - } - - return $names[$name]; -} - -/** - * Do not use this function yet. Its API has not been finalized. - */ -function token_render_array(array $array, array $options = []) { - $rendered = []; - - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - - foreach (token_element_children($array) as $key) { - $value = $array[$key]; - $rendered[] = is_array($value) ? $renderer->renderPlain($value) : (string) $value; - } - $join = isset($options['join']) ? $options['join'] : ', '; - return implode($join, $rendered); -} - -/** - * Do not use this function yet. Its API has not been finalized. - */ -function token_render_array_value($value, array $options = []) { - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - - $rendered = is_array($value) ? $renderer->renderPlain($value) : (string) $value; - return $rendered; -} - -/** - * Copy of drupal_render_cache_get() that does not care about request method. - */ -function token_render_cache_get($elements) { - if (!$cid = drupal_render_cid_create($elements)) { - return FALSE; - } - $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'render'; - - if (!empty($cid) && $cache = \Drupal::cache($bin)->get($cid)) { - // Add additional libraries, JavaScript, CSS and other data attached - // to this element. - if (isset($cache->data['#attached'])) { - drupal_process_attached($cache->data); - } - // Return the rendered output. - return $cache->data['#markup']; - } - return FALSE; -} - -/** - * Coyp of drupal_render_cache_set() that does not care about request method. - */ -function token_render_cache_set(&$markup, $elements) { - // This should only run of drupal_render_cache_set() did not. - if (in_array(\Drupal::request()->server->get('REQUEST_METHOD'), ['GET', 'HEAD'])) { - return FALSE; - } - - $original_method = \Drupal::request()->server->get('REQUEST_METHOD'); - \Drupal::request()->server->set('REQUEST_METHOD', 'GET'); - drupal_render_cache_set($markup, $elements); - \Drupal::request()->server->set('REQUEST_METHOD', $original_method); -} - -/** - * Loads menu link titles for all purents of a menu link plugin ID. - * - * @param string $plugin_id - * The menu link plugin ID. - * @param string $langcode - * The language code. - * - * @return string[] - * List of menu link parent titles. - */ -function token_menu_link_load_all_parents($plugin_id, $langcode) { - $cache = &drupal_static(__FUNCTION__, []); - - if (!isset($cache[$plugin_id][$langcode])) { - $cache[$plugin_id][$langcode] = []; - /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */ - $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - $parent_ids = $menu_link_manager->getParentIds($plugin_id); - // Remove the current plugin ID from the parents. - unset($parent_ids[$plugin_id]); - foreach ($parent_ids as $parent_id) { - $parent = $menu_link_manager->createInstance($parent_id); - $cache[$plugin_id][$langcode] = [$parent_id => token_menu_link_translated_title($parent, $langcode)] + $cache[$plugin_id][$langcode]; - } - } - - return $cache[$plugin_id][$langcode]; -} - -/** - * Returns the translated link of a menu title. - * - * If the underlying entity is a content menu item, load it to get the - * translated menu item title. - * - * @todo Remove this when there is a better way to get a translated menu - * item title in core: https://www.drupal.org/node/2795143 - * - * @param \Drupal\Core\Menu\MenuLinkInterface $menu_link - * The menu link. - * @param string|null $langcode - * (optional) The langcode, defaults to the current language. - * - * @return string - * The menu link title. - */ -function token_menu_link_translated_title(MenuLinkInterface $menu_link, $langcode = NULL) { - $metadata = $menu_link->getMetaData(); - if (isset($metadata['entity_id']) && $menu_link->getProvider() == 'menu_link_content') { - /** @var \Drupal\menu_link_content\MenuLinkContentInterface $entity */ - $entity = \Drupal::entityTypeManager()->getStorage('menu_link_content')->load($metadata['entity_id']); - $entity = \Drupal::service('entity.repository')->getTranslationFromContext($entity, $langcode); - return $entity->getTitle(); - } - return $menu_link->getTitle(); -} - -/** - * Loads all the parents of the term in the specified language. - * - * @param int $tid - * The term id. - * @param string $langcode - * The language code. - * - * @return string[] - * The term parents collection. - */ -function token_taxonomy_term_load_all_parents($tid, $langcode) { - $cache = &drupal_static(__FUNCTION__, []); - - if (!is_numeric($tid)) { - return []; - } - - if (!isset($cache[$langcode][$tid])) { - $cache[$langcode][$tid] = []; - /** @var \Drupal\taxonomy\TermStorageInterface $term_storage */ - $term_storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term'); - $parents = $term_storage->loadAllParents($tid); - // Remove this term from the array. - array_shift($parents); - $parents = array_reverse($parents); - foreach ($parents as $term) { - $translation = \Drupal::service('entity.repository')->getTranslationFromContext($term, $langcode); - $cache[$langcode][$tid][$term->id()] = $translation->label(); - } - } - - return $cache[$langcode][$tid]; -} - -function token_element_children(&$elements, $sort = FALSE) { - // Do not attempt to sort elements which have already been sorted. - $sort = isset($elements['#sorted']) ? !$elements['#sorted'] : $sort; - - // Filter out properties from the element, leaving only children. - $children = []; - $sortable = FALSE; - foreach ($elements as $key => $value) { - if ($key === '' || $key[0] !== '#') { - $children[$key] = $value; - if (is_array($value) && isset($value['#weight'])) { - $sortable = TRUE; - } - } - } - // Sort the children if necessary. - if ($sort && $sortable) { - uasort($children, 'Drupal\Component\Utility\SortArray::sortByWeightProperty'); - // Put the sorted children back into $elements in the correct order, to - // preserve sorting if the same element is passed through - // element_children() twice. - foreach ($children as $key => $child) { - unset($elements[$key]); - $elements[$key] = $child; - } - $elements['#sorted'] = TRUE; - } - - return array_keys($children); -} - -/** - * Loads all the parents of the book page. - * - * @param array $book - * The book data. The 'nid' key points to the current page of the book. - * The 'p1' ... 'p9' keys point to parents of the page, if they exist, with 'p1' - * pointing to the book itself and the last defined pX to the current page. - * - * @return string[] - * List of node titles of the book parents. - */ -function token_book_load_all_parents(array $book) { - $cache = &drupal_static(__FUNCTION__, []); - - if (empty($book['nid'])) { - return []; - } - $nid = $book['nid']; - - if (!isset($cache[$nid])) { - $cache[$nid] = []; - $i = 1; - while ($book["p$i"] != $nid) { - $cache[$nid][] = Node::load($book["p$i"])->getTitle(); - $i++; - } - } - - return $cache[$nid]; -} - -/** - * Implements hook_entity_base_field_info(). - */ -function token_entity_base_field_info(EntityTypeInterface $entity_type) { - // We add a pseudo entity-reference field to track the menu entry created - // from the node add/edit form so that tokens generated at that time that - // reference the menu link can access the yet to be saved menu link. - // @todo Revisit when https://www.drupal.org/node/2315773 is resolved. - if ($entity_type->id() === 'node' && \Drupal::moduleHandler()->moduleExists('menu_ui')) { - $fields['menu_link'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Menu link')) - ->setDescription(t('Computed menu link for the node (only available during node saving).')) - ->setRevisionable(TRUE) - ->setSetting('target_type', 'menu_link_content') - ->setTranslatable(TRUE) - ->setDisplayOptions('view', [ - 'label' => 'hidden', - 'region' => 'hidden', - ]) - ->setComputed(TRUE) - ->setDisplayOptions('form', [ - 'region' => 'hidden', - ]); - - return $fields; - } - return []; -} - -/** - * Implements hook_form_BASE_FORM_ID_alter() for node_form. - * - * Populates menu_link field on nodes from the menu item on unsaved nodes. - * - * @see menu_ui_form_node_form_submit() - * @see token_entity_base_field_info() - */ -function token_form_node_form_alter(&$form, FormStateInterface $form_state) { - if (!\Drupal::moduleHandler()->moduleExists('menu_ui')) { - return; - } - /** @var \Drupal\node\NodeForm $form_object */ - if (!\Drupal::currentUser()->hasPermission('administer menu')) { - // We're only interested in when the node is unsaved and the editor has - // permission to create new menu links. - return; - } - $form['#entity_builders'][] = 'token_node_menu_link_submit'; -} - -/** - * Entity builder. - */ -function token_node_menu_link_submit($entity_type, NodeInterface $node, &$form, FormStateInterface $form_state) { - // Entity builders run twice, once during validation and again during - // submission, so we only run this code after validation has been performed. - if (!$form_state->isValueEmpty('menu') && $form_state->getTemporaryValue('entity_validated')) { - $values = $form_state->getValue('menu'); - if (!empty($values['enabled']) && trim($values['title'])) { - if (!empty($values['menu_parent'])) { - list($menu_name, $parent) = explode(':', $values['menu_parent'], 2); - $values['menu_name'] = $menu_name; - $values['parent'] = $parent; - } - // Construct an unsaved entity. - if ($entity_id = $form_state->getValue(['menu', 'entity_id'])) { - // Use the existing menu_link_content entity. - $entity = MenuLinkContent::load($entity_id); - // If the loaded MenuLinkContent doesn't have a translation for the - // Node's active langcode, create a new translation. - if ($entity->isTranslatable()) { - if (!$entity->hasTranslation($node->language()->getId())) { - $entity = $entity->addTranslation($node->language()->getId(), $entity->toArray()); - } - else { - $entity = $entity->getTranslation($node->language()->getId()); - } - } - } - else { - if ($node->isNew()) { - // Create a new menu_link_content entity. - $entity = MenuLinkContent::create([ - // Lets just reference the UUID for now, the link is not important for - // token generation. - 'link' => ['uri' => 'internal:/node/' . $node->uuid()], - 'langcode' => $node->language()->getId(), - ]); - } - else { - // Create a new menu_link_content entity. - $entity = MenuLinkContent::create([ - 'link' => ['uri' => 'entity:node/' . $node->id()], - 'langcode' => $node->language()->getId(), - ]); - } - } - $entity->title->value = trim($values['title']); - $entity->description->value = trim($values['description']); - $entity->menu_name->value = $values['menu_name']; - $entity->parent->value = $values['parent']; - $entity->weight->value = isset($values['weight']) ? $values['weight'] : 0; - $entity->save(); - $node->menu_link = $entity; - // Leave this for _menu_ui_node_save() to pick up so we don't end up with - // duplicate menu-links. - $form_state->setValue(['menu', 'entity_id'], $entity->id()); - } - } -} - -/** - * Implements hook_ENTITY_TYPE_insert for node entities. - */ -function token_node_insert(NodeInterface $node) { - if ($node->hasField('menu_link') && $menu_link = $node->menu_link->entity) { - // Update the menu-link to point to the now saved node. - $menu_link->link = 'entity:node/' . $node->id(); - $menu_link->save(); - } -} - -/** - * Implements hook_ENTITY_TYPE_presave() for menu_link_content. - */ -function token_menu_link_content_presave(MenuLinkContentInterface $menu_link_content) { - drupal_static_reset('token_menu_link_load_all_parents'); -} diff --git a/sites/all/modules/contrib/dev/token/token.pages.inc b/sites/all/modules/contrib/dev/token/token.pages.inc deleted file mode 100644 index 0e417343d..000000000 --- a/sites/all/modules/contrib/dev/token/token.pages.inc +++ /dev/null @@ -1,61 +0,0 @@ - [], - 'global_types' => TRUE, - 'click_insert' => TRUE, - 'show_restricted' => FALSE, - 'show_nested' => FALSE, - 'recursion_limit' => 3, - ]; - $query_options = array_intersect_key($variables, $tree_variables); - $query_options = DiffArray::diffAssocRecursive($query_options, $tree_variables); - if (!isset($variables['options']['query']['options'])) { - $variables['options']['query']['options'] = []; - } - $variables['options']['query']['options'] += $query_options; - - // Because PHP converts query strings with arrays into a different syntax on - // the next request, the options have to be encoded with JSON in the query - // string so that we can reliably decode it for token comparison. - $variables['options']['query']['options'] = Json::encode($variables['options']['query']['options']); - - // Set the token tree to open in a separate window. - $variables['options']['attributes'] += [ - 'data-dialog-type' => 'dialog', - 'data-dialog-options' => json_encode([ - 'dialogClass' => 'token-tree-dialog', - 'width' => 600, - 'height' => 400, - 'position' => ['my' => 'right bottom', 'at' => 'right-10 bottom-10'], - 'draggable' => TRUE, - 'autoResize' => FALSE, - ]), - ]; - - $variables['link'] = Link::createFromRoute($variables['text'], 'token.tree', [], $variables['options'])->toRenderable(); - $variables['url'] = new Url('token.tree', [], $variables['options']); - $variables['attributes'] = $variables['options']['attributes']; -} diff --git a/sites/all/modules/contrib/dev/token/token.routing.yml b/sites/all/modules/contrib/dev/token/token.routing.yml deleted file mode 100644 index f2105aeaf..000000000 --- a/sites/all/modules/contrib/dev/token/token.routing.yml +++ /dev/null @@ -1,22 +0,0 @@ -token.tree: - path: '/token/tree' - defaults: - _controller: '\Drupal\token\Controller\TokenTreeController::outputTree' - requirements: - _csrf_token: 'TRUE' - -token.autocomplete: - path: '/token/autocomplete/{token_type}/{filter}' - defaults: - _controller: '\Drupal\token\Controller\TokenAutocompleteController::autocomplete' - requirements: - _access: 'TRUE' - -token.flush_cache: - path: '/token/flush-cache' - defaults: - _controller: '\Drupal\token\Controller\TokenCacheController::flush' - requirements: - _permission: 'flush caches' - _csrf_token: 'TRUE' - _module_dependencies: 'admin_menu' diff --git a/sites/all/modules/contrib/dev/token/token.services.yml b/sites/all/modules/contrib/dev/token/token.services.yml deleted file mode 100644 index f6011aa6b..000000000 --- a/sites/all/modules/contrib/dev/token/token.services.yml +++ /dev/null @@ -1,12 +0,0 @@ -services: - token.entity_mapper: - class: Drupal\token\TokenEntityMapper - arguments: ['@entity_type.manager', '@module_handler'] - token.tree_builder: - class: Drupal\token\TreeBuilder - arguments: ['@token', '@token.entity_mapper', '@cache.data', '@language_manager'] - token.route_subscriber: - class: Drupal\token\Routing\RouteSubscriber - arguments: ['@entity_type.manager', '@module_handler'] - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/dev/token/token.tokens.inc b/sites/all/modules/contrib/dev/token/token.tokens.inc deleted file mode 100644 index 7ee429107..000000000 --- a/sites/all/modules/contrib/dev/token/token.tokens.inc +++ /dev/null @@ -1,1786 +0,0 @@ - t('Current date'), - 'description' => t('Tokens related to the current date and time.'), - 'type' => 'date', - ]; - - // Add a 'dynamic' key to any tokens that have chained but dynamic tokens. - $info['tokens']['date']['custom']['dynamic'] = TRUE; - - // The [file:size] may not always return in kilobytes. - // @todo Remove when http://drupal.org/node/1193044 is fixed. - if (!empty($info['tokens']['file']['size'])) { - $info['tokens']['file']['size']['description'] = t('The size of the file.'); - } - - // Remove deprecated tokens from being listed. - unset($info['tokens']['node']['tnid']); - unset($info['tokens']['node']['type']); - unset($info['tokens']['node']['type-name']); - - // Support 'url' type tokens for core tokens. - if (isset($info['tokens']['comment']['url']) && \Drupal::moduleHandler()->moduleExists('comment')) { - $info['tokens']['comment']['url']['type'] = 'url'; - } - if (isset($info['tokens']['node']['url']) && \Drupal::moduleHandler()->moduleExists('node')) { - $info['tokens']['node']['url']['type'] = 'url'; - } - if (isset($info['tokens']['term']['url']) && \Drupal::moduleHandler()->moduleExists('taxonomy')) { - $info['tokens']['term']['url']['type'] = 'url'; - } - $info['tokens']['user']['url']['type'] = 'url'; - - // Add [token:url] tokens for any URI-able entities. - $entities = \Drupal::entityTypeManager()->getDefinitions(); - foreach ($entities as $entity => $entity_info) { - // Do not generate tokens if the entity doesn't define a token type or is - // not a content entity. - if (!$entity_info->get('token_type') || (!$entity_info instanceof ContentEntityTypeInterface)) { - continue; - } - - $token_type = $entity_info->get('token_type'); - if (!isset($info['types'][$token_type]) || !isset($info['tokens'][$token_type])) { - // Define tokens for entity type's without their own integration. - $info['types'][$entity_info->id()] = [ - 'name' => $entity_info->getLabel(), - 'needs-data' => $entity_info->id(), - 'module' => 'token', - ]; - } - - // Add [entity:url] tokens if they do not already exist. - // @todo Support entity:label - if (!isset($info['tokens'][$token_type]['url'])) { - $info['tokens'][$token_type]['url'] = [ - 'name' => t('URL'), - 'description' => t('The URL of the @entity.', ['@entity' => mb_strtolower($entity_info->getLabel())]), - 'module' => 'token', - 'type' => 'url', - ]; - } - - // Add [entity:original] tokens if they do not already exist. - if (!isset($info['tokens'][$token_type]['original'])) { - $info['tokens'][$token_type]['original'] = [ - 'name' => t('Original @entity', ['@entity' => mb_strtolower($entity_info->getLabel())]), - 'description' => t('The original @entity data if the @entity is being updated or saved.', ['@entity' => mb_strtolower($entity_info->getLabel())]), - 'module' => 'token', - 'type' => $token_type, - ]; - } - } - - // Add support for custom date formats. - // @todo Remove when http://drupal.org/node/1173706 is fixed. - $date_format_types = \Drupal::entityTypeManager()->getStorage('date_format')->loadMultiple(); - foreach ($date_format_types as $date_format_type => $date_format_type_info) { - /* @var \Drupal\system\Entity\DateFormat $date_format_type_info */ - if (!isset($info['tokens']['date'][$date_format_type])) { - $info['tokens']['date'][$date_format_type] = [ - 'name' => Html::escape($date_format_type_info->label()), - 'description' => t("A date in '@type' format. (%date)", ['@type' => $date_format_type, '%date' => \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), $date_format_type)]), - 'module' => 'token', - ]; - } - } -} - -/** - * Implements hook_token_info(). - */ -function token_token_info() { - // Node tokens. - $info['tokens']['node']['source'] = [ - 'name' => t('Translation source node'), - 'description' => t("The source node for this current node's translation set."), - 'type' => 'node', - ]; - $info['tokens']['node']['log'] = [ - 'name' => t('Revision log message'), - 'description' => t('The explanation of the most recent changes made to the node.'), - ]; - $info['tokens']['node']['content-type'] = [ - 'name' => t('Content type'), - 'description' => t('The content type of the node.'), - 'type' => 'content-type', - ]; - - // Content type tokens. - $info['types']['content-type'] = [ - 'name' => t('Content types'), - 'description' => t('Tokens related to content types.'), - 'needs-data' => 'node_type', - ]; - $info['tokens']['content-type']['name'] = [ - 'name' => t('Name'), - 'description' => t('The name of the content type.'), - ]; - $info['tokens']['content-type']['machine-name'] = [ - 'name' => t('Machine-readable name'), - 'description' => t('The unique machine-readable name of the content type.'), - ]; - $info['tokens']['content-type']['description'] = [ - 'name' => t('Description'), - 'description' => t('The optional description of the content type.'), - ]; - $info['tokens']['content-type']['node-count'] = [ - 'name' => t('Node count'), - 'description' => t('The number of nodes belonging to the content type.'), - ]; - $info['tokens']['content-type']['edit-url'] = [ - 'name' => t('Edit URL'), - 'description' => t("The URL of the content type's edit page."), - // 'type' => 'url', - ]; - - // Taxonomy term and vocabulary tokens. - if (\Drupal::moduleHandler()->moduleExists('taxonomy')) { - $info['tokens']['term']['edit-url'] = [ - 'name' => t('Edit URL'), - 'description' => t("The URL of the taxonomy term's edit page."), - // 'type' => 'url', - ]; - $info['tokens']['term']['parents'] = [ - 'name' => t('Parents'), - 'description' => t("An array of all the term's parents, starting with the root."), - 'type' => 'array', - ]; - $info['tokens']['term']['root'] = [ - 'name' => t('Root term'), - 'description' => t("The root term of the taxonomy term."), - 'type' => 'term', - ]; - - $info['tokens']['vocabulary']['machine-name'] = [ - 'name' => t('Machine-readable name'), - 'description' => t('The unique machine-readable name of the vocabulary.'), - ]; - $info['tokens']['vocabulary']['edit-url'] = [ - 'name' => t('Edit URL'), - 'description' => t("The URL of the vocabulary's edit page."), - // 'type' => 'url', - ]; - } - - // File tokens. - $info['tokens']['file']['basename'] = [ - 'name' => t('Base name'), - 'description' => t('The base name of the file.'), - ]; - $info['tokens']['file']['extension'] = [ - 'name' => t('Extension'), - 'description' => t('The extension of the file.'), - ]; - $info['tokens']['file']['size-raw'] = [ - 'name' => t('File byte size'), - 'description' => t('The size of the file, in bytes.'), - ]; - - // User tokens. - // Add information on the restricted user tokens. - $info['tokens']['user']['cancel-url'] = [ - 'name' => t('Account cancellation URL'), - 'description' => t('The URL of the confirm delete page for the user account.'), - 'restricted' => TRUE, - // 'type' => 'url', - ]; - $info['tokens']['user']['one-time-login-url'] = [ - 'name' => t('One-time login URL'), - 'description' => t('The URL of the one-time login page for the user account.'), - 'restricted' => TRUE, - // 'type' => 'url', - ]; - $info['tokens']['user']['roles'] = [ - 'name' => t('Roles'), - 'description' => t('The user roles associated with the user account.'), - 'type' => 'array', - ]; - - // Current user tokens. - $info['tokens']['current-user']['ip-address'] = [ - 'name' => t('IP address'), - 'description' => t('The IP address of the current user.'), - ]; - - // Menu link tokens (work regardless if menu module is enabled or not). - $info['types']['menu-link'] = [ - 'name' => t('Menu links'), - 'description' => t('Tokens related to menu links.'), - 'needs-data' => 'menu-link', - ]; - $info['tokens']['menu-link']['mlid'] = [ - 'name' => t('Link ID'), - 'description' => t('The unique ID of the menu link.'), - ]; - $info['tokens']['menu-link']['title'] = [ - 'name' => t('Title'), - 'description' => t('The title of the menu link.'), - ]; - $info['tokens']['menu-link']['url'] = [ - 'name' => t('URL'), - 'description' => t('The URL of the menu link.'), - 'type' => 'url', - ]; - $info['tokens']['menu-link']['parent'] = [ - 'name' => t('Parent'), - 'description' => t("The menu link's parent."), - 'type' => 'menu-link', - ]; - $info['tokens']['menu-link']['parents'] = [ - 'name' => t('Parents'), - 'description' => t("An array of all the menu link's parents, starting with the root."), - 'type' => 'array', - ]; - $info['tokens']['menu-link']['root'] = [ - 'name' => t('Root'), - 'description' => t("The menu link's root."), - 'type' => 'menu-link', - ]; - - // Current page tokens. - $info['types']['current-page'] = [ - 'name' => t('Current page'), - 'description' => t('Tokens related to the current page request.'), - ]; - $info['tokens']['current-page']['title'] = [ - 'name' => t('Title'), - 'description' => t('The title of the current page.'), - ]; - $info['tokens']['current-page']['url'] = [ - 'name' => t('URL'), - 'description' => t('The URL of the current page.'), - 'type' => 'url', - ]; - $info['tokens']['current-page']['page-number'] = [ - 'name' => t('Page number'), - 'description' => t('The page number of the current page when viewing paged lists.'), - ]; - $info['tokens']['current-page']['query'] = [ - 'name' => t('Query string value'), - 'description' => t('The value of a specific query string field of the current page.'), - 'dynamic' => TRUE, - ]; - - // URL tokens. - $info['types']['url'] = [ - 'name' => t('URL'), - 'description' => t('Tokens related to URLs.'), - 'needs-data' => 'path', - ]; - $info['tokens']['url']['path'] = [ - 'name' => t('Path'), - 'description' => t('The path component of the URL.'), - ]; - $info['tokens']['url']['relative'] = [ - 'name' => t('Relative URL'), - 'description' => t('The relative URL.'), - ]; - $info['tokens']['url']['absolute'] = [ - 'name' => t('Absolute URL'), - 'description' => t('The absolute URL.'), - ]; - $info['tokens']['url']['brief'] = [ - 'name' => t('Brief URL'), - 'description' => t('The URL without the protocol and trailing backslash.'), - ]; - $info['tokens']['url']['unaliased'] = [ - 'name' => t('Unaliased URL'), - 'description' => t('The unaliased URL.'), - 'type' => 'url', - ]; - $info['tokens']['url']['args'] = [ - 'name' => t('Arguments'), - 'description' => t("The specific argument of the current page (e.g. 'arg:1' on the page 'node/1' returns '1')."), - 'type' => 'array', - ]; - - // Array tokens. - $info['types']['array'] = [ - 'name' => t('Array'), - 'description' => t('Tokens related to arrays of strings.'), - 'needs-data' => 'array', - 'nested' => TRUE, - ]; - $info['tokens']['array']['first'] = [ - 'name' => t('First'), - 'description' => t('The first element of the array.'), - ]; - $info['tokens']['array']['last'] = [ - 'name' => t('Last'), - 'description' => t('The last element of the array.'), - ]; - $info['tokens']['array']['count'] = [ - 'name' => t('Count'), - 'description' => t('The number of elements in the array.'), - ]; - $info['tokens']['array']['reversed'] = [ - 'name' => t('Reversed'), - 'description' => t('The array reversed.'), - 'type' => 'array', - ]; - $info['tokens']['array']['keys'] = [ - 'name' => t('Keys'), - 'description' => t('The array of keys of the array.'), - 'type' => 'array', - ]; - $info['tokens']['array']['join'] = [ - 'name' => t('Imploded'), - 'description' => t('The values of the array joined together with a custom string in-between each value.'), - 'dynamic' => TRUE, - ]; - $info['tokens']['array']['value'] = [ - 'name' => t('Value'), - 'description' => t('The specific value of the array.'), - 'dynamic' => TRUE, - ]; - - // Random tokens. - $info['types']['random'] = [ - 'name' => t('Random'), - 'description' => t('Tokens related to random data.'), - ]; - $info['tokens']['random']['number'] = [ - 'name' => t('Number'), - 'description' => t('A random number from 0 to @max.', ['@max' => mt_getrandmax()]), - ]; - $info['tokens']['random']['hash'] = [ - 'name' => t('Hash'), - 'description' => t('A random hash. The possible hashing algorithms are: @hash-algos.', ['@hash-algos' => implode(', ', hash_algos())]), - 'dynamic' => TRUE, - ]; - - // Define image_with_image_style token type. - if (\Drupal::moduleHandler()->moduleExists('image')) { - $info['types']['image_with_image_style'] = [ - 'name' => t('Image with image style'), - 'needs-data' => 'image_with_image_style', - 'module' => 'token', - 'nested' => TRUE, - ]; - - // Provide tokens for the ImageStyle attributes. - $info['tokens']['image_with_image_style']['mimetype'] = [ - 'name' => t('MIME type'), - 'description' => t('The MIME type (image/png, image/bmp, etc.) of the image.'), - ]; - $info['tokens']['image_with_image_style']['filesize'] = [ - 'name' => t('File size'), - 'description' => t('The file size of the image.'), - ]; - $info['tokens']['image_with_image_style']['height'] = [ - 'name' => t('Height'), - 'description' => t('The height the image, in pixels.'), - ]; - $info['tokens']['image_with_image_style']['width'] = [ - 'name' => t('Width'), - 'description' => t('The width of the image, in pixels.'), - ]; - $info['tokens']['image_with_image_style']['uri'] = [ - 'name' => t('URI'), - 'description' => t('The URI to the image.'), - ]; - $info['tokens']['image_with_image_style']['url'] = [ - 'name' => t('URL'), - 'description' => t('The URL to the image.'), - ]; - } - - return $info; -} - -/** - * Implements hook_tokens(). - */ -function token_tokens($type, array $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) { - $replacements = []; - $language_manager = \Drupal::languageManager(); - $url_options = ['absolute' => TRUE]; - if (isset($options['langcode'])) { - $url_options['language'] = $language_manager->getLanguage($options['langcode']); - $langcode = $options['langcode']; - } - else { - $langcode = $language_manager->getCurrentLanguage()->getId(); - } - - // Date tokens. - if ($type == 'date') { - $date = !empty($data['date']) ? $data['date'] : \Drupal::time()->getRequestTime(); - - // @todo Remove when http://drupal.org/node/1173706 is fixed. - $date_format_types = \Drupal::entityTypeManager()->getStorage('date_format')->loadMultiple(); - foreach ($tokens as $name => $original) { - if (isset($date_format_types[$name]) && _token_module('date', $name) == 'token') { - $replacements[$original] = \Drupal::service('date.formatter')->format($date, $name, '', NULL, $langcode); - } - } - } - - // Current date tokens. - // @todo Remove when http://drupal.org/node/943028 is fixed. - if ($type == 'current-date') { - $replacements += \Drupal::token()->generate('date', $tokens, ['date' => \Drupal::time()->getRequestTime()], $options, $bubbleable_metadata); - } - - // Comment tokens. - if ($type == 'comment' && !empty($data['comment'])) { - /* @var \Drupal\comment\CommentInterface $comment */ - $comment = $data['comment']; - - // Chained token relationships. - if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url'))) { - // Add fragment to url options. - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $comment->toUrl('canonical', ['fragment' => "comment-{$comment->id()}"])], $options, $bubbleable_metadata); - } - } - - // Node tokens. - if ($type == 'node' && !empty($data['node'])) { - /* @var \Drupal\node\NodeInterface $node */ - $node = $data['node']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'log': - $replacements[$original] = (string) $node->revision_log->value; - break; - - case 'content-type': - $type_name = \Drupal::entityTypeManager()->getStorage('node_type')->load($node->getType())->label(); - $replacements[$original] = $type_name; - break; - } - } - - // Chained token relationships. - if (($parent_tokens = \Drupal::token()->findWithPrefix($tokens, 'source')) && $source_node = $node->getUntranslated()) { - $replacements += \Drupal::token()->generate('node', $parent_tokens, ['node' => $source_node], $options, $bubbleable_metadata); - } - if (($node_type_tokens = \Drupal::token()->findWithPrefix($tokens, 'content-type')) && $node_type = NodeType::load($node->bundle())) { - $replacements += \Drupal::token()->generate('content-type', $node_type_tokens, ['node_type' => $node_type], $options, $bubbleable_metadata); - } - if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url'))) { - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $node->toUrl()], $options, $bubbleable_metadata); - } - } - - // Content type tokens. - if ($type == 'content-type' && !empty($data['node_type'])) { - /* @var \Drupal\node\NodeTypeInterface $node_type */ - $node_type = $data['node_type']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'name': - $replacements[$original] = $node_type->label(); - break; - - case 'machine-name': - $replacements[$original] = $node_type->id(); - break; - - case 'description': - $replacements[$original] = $node_type->getDescription(); - break; - - case 'node-count': - $count = \Drupal::entityQueryAggregate('node') - ->aggregate('nid', 'COUNT') - ->condition('type', $node_type->id()) - ->execute(); - $replacements[$original] = (int) $count; - break; - - case 'edit-url': - $replacements[$original] = $node_type->toUrl('edit-form', $url_options)->toString(); - break; - } - } - } - - // Taxonomy term tokens. - if ($type == 'term' && !empty($data['term'])) { - /* @var \Drupal\taxonomy\TermInterface $term */ - $term = $data['term']; - - /** @var \Drupal\taxonomy\TermStorageInterface $term_storage */ - $term_storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term'); - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'edit-url': - $replacements[$original] = Url::fromRoute('entity.taxonomy_term.edit_form', ['taxonomy_term' => $term->id()], $url_options)->toString(); - break; - - case 'parents': - if ($parents = token_taxonomy_term_load_all_parents($term->id(), $langcode)) { - $replacements[$original] = token_render_array($parents, $options); - } - break; - - case 'root': - $parents = $term_storage->loadAllParents($term->id()); - $root_term = end($parents); - if ($root_term->id() != $term->id()) { - $root_term = \Drupal::service('entity.repository')->getTranslationFromContext($root_term, $langcode); - $replacements[$original] = $root_term->label(); - } - break; - } - } - - // Chained token relationships. - if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url'))) { - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $term->toUrl()], $options, $bubbleable_metadata); - } - // [term:parents:*] chained tokens. - if ($parents_tokens = \Drupal::token()->findWithPrefix($tokens, 'parents')) { - if ($parents = token_taxonomy_term_load_all_parents($term->id(), $langcode)) { - $replacements += \Drupal::token()->generate('array', $parents_tokens, ['array' => $parents], $options, $bubbleable_metadata); - } - } - if ($root_tokens = \Drupal::token()->findWithPrefix($tokens, 'root')) { - $parents = $term_storage->loadAllParents($term->id()); - $root_term = end($parents); - if ($root_term->tid != $term->id()) { - $replacements += \Drupal::token()->generate('term', $root_tokens, ['term' => $root_term], $options, $bubbleable_metadata); - } - } - } - - // Vocabulary tokens. - if ($type == 'vocabulary' && !empty($data['vocabulary'])) { - $vocabulary = $data['vocabulary']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'machine-name': - $replacements[$original] = $vocabulary->id(); - break; - - case 'edit-url': - $replacements[$original] = Url::fromRoute('entity.taxonomy_vocabulary.edit_form', ['taxonomy_vocabulary' => $vocabulary->id()], $url_options)->toString(); - break; - } - } - } - - // File tokens. - if ($type == 'file' && !empty($data['file'])) { - $file = $data['file']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'basename': - $basename = pathinfo($file->uri->value, PATHINFO_BASENAME); - $replacements[$original] = $basename; - break; - - case 'extension': - $extension = pathinfo($file->uri->value, PATHINFO_EXTENSION); - $replacements[$original] = $extension; - break; - - case 'size-raw': - $replacements[$original] = (int) $file->filesize->value; - break; - } - } - } - - // User tokens. - if ($type == 'user' && !empty($data['user'])) { - /* @var \Drupal\user\UserInterface $account */ - $account = $data['user']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'picture': - if ($account instanceof UserInterface && $account->hasField('user_picture')) { - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - $output = [ - '#theme' => 'user_picture', - '#account' => $account, - ]; - $replacements[$original] = $renderer->renderPlain($output); - } - break; - - case 'roles': - $roles = $account->getRoles(); - $roles_names = array_combine($roles, $roles); - $replacements[$original] = token_render_array($roles_names, $options); - break; - } - } - - // Chained token relationships. - if ($account instanceof UserInterface && $account->hasField('user_picture') && ($picture_tokens = \Drupal::token()->findWithPrefix($tokens, 'picture'))) { - $replacements += \Drupal::token()->generate('file', $picture_tokens, ['file' => $account->user_picture->entity], $options, $bubbleable_metadata); - } - if ($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url')) { - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $account->toUrl()], $options, $bubbleable_metadata); - } - if ($role_tokens = \Drupal::token()->findWithPrefix($tokens, 'roles')) { - $roles = $account->getRoles(); - $roles_names = array_combine($roles, $roles); - $replacements += \Drupal::token()->generate('array', $role_tokens, ['array' => $roles_names], $options, $bubbleable_metadata); - } - } - - // Current user tokens. - if ($type == 'current-user') { - foreach ($tokens as $name => $original) { - switch ($name) { - case 'ip-address': - $ip = \Drupal::request()->getClientIp(); - $replacements[$original] = $ip; - break; - } - } - } - - // Menu link tokens. - if ($type == 'menu-link' && !empty($data['menu-link'])) { - /** @var \Drupal\Core\Menu\MenuLinkInterface $link */ - $link = $data['menu-link']; - /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */ - $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - - if ($link instanceof MenuLinkContentInterface) { - $link = $menu_link_manager->createInstance($link->getPluginId()); - } - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'id': - $replacements[$original] = $link->getPluginId(); - break; - - case 'title': - $replacements[$original] = token_menu_link_translated_title($link, $langcode); - break; - - case 'url': - $replacements[$original] = $link->getUrlObject()->setAbsolute()->toString(); - break; - - case 'parent': - /** @var \Drupal\Core\Menu\MenuLinkInterface $parent */ - if ($link->getParent() && $parent = $menu_link_manager->createInstance($link->getParent())) { - $replacements[$original] = token_menu_link_translated_title($parent, $langcode); - } - break; - - case 'parents': - if ($parents = token_menu_link_load_all_parents($link->getPluginId(), $langcode)) { - $replacements[$original] = token_render_array($parents, $options); - } - break; - - case 'root'; - if ($link->getParent() && $parent_ids = array_keys(token_menu_link_load_all_parents($link->getPluginId(), $langcode))) { - $root = $menu_link_manager->createInstance(array_shift($parent_ids)); - $replacements[$original] = token_menu_link_translated_title($root, $langcode); - } - break; - } - } - - // Chained token relationships. - /** @var \Drupal\Core\Menu\MenuLinkInterface $parent */ - if ($link->getParent() && ($parent_tokens = \Drupal::token()->findWithPrefix($tokens, 'parent')) && $parent = $menu_link_manager->createInstance($link->getParent())) { - $replacements += \Drupal::token()->generate('menu-link', $parent_tokens, ['menu-link' => $parent], $options, $bubbleable_metadata); - } - // [menu-link:parents:*] chained tokens. - if ($parents_tokens = \Drupal::token()->findWithPrefix($tokens, 'parents')) { - if ($parents = token_menu_link_load_all_parents($link->getPluginId(), $langcode)) { - $replacements += \Drupal::token()->generate('array', $parents_tokens, ['array' => $parents], $options, $bubbleable_metadata); - } - } - if (($root_tokens = \Drupal::token()->findWithPrefix($tokens, 'root')) && $link->getParent() && $parent_ids = array_keys(token_menu_link_load_all_parents($link->getPluginId(), $langcode))) { - $root = $menu_link_manager->createInstance(array_shift($parent_ids)); - $replacements += \Drupal::token()->generate('menu-link', $root_tokens, ['menu-link' => $root], $options, $bubbleable_metadata); - } - if ($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url')) { - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $link->getUrlObject()], $options, $bubbleable_metadata); - } - - } - - // Current page tokens. - if ($type == 'current-page') { - $request = \Drupal::request(); - foreach ($tokens as $name => $original) { - switch ($name) { - case 'title': - $route = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT); - if ($route) { - $title = \Drupal::service('title_resolver')->getTitle($request, $route); - $replacements[$original] = token_render_array_value($title); - } - break; - - case 'url': - $bubbleable_metadata->addCacheContexts(['url.path']); - try { - $url = Url::createFromRequest($request)->setOptions($url_options); - } - catch (\Exception $e) { - // Url::createFromRequest() can fail, e.g. on 404 pages. - // Fall back and try again with Url::fromUserInput(). - try { - $url = Url::fromUserInput($request->getPathInfo(), $url_options); - } - catch (\Exception $e) { - // Instantiation would fail again on malformed urls. - } - } - if (isset($url)) { - $replacements[$original] = $url->toString(); - } - break; - - case 'page-number': - if ($page = $request->query->get('page')) { - // @see PagerDefault::execute() - $pager_page_array = explode(',', $page); - $page = $pager_page_array[0]; - } - $replacements[$original] = (int) $page + 1; - break; - } - } - - // @deprecated - // [current-page:arg] dynamic tokens. - if ($arg_tokens = \Drupal::token()->findWithPrefix($tokens, 'arg')) { - $path = ltrim(\Drupal::service('path.current')->getPath(), '/'); - // Make sure its a system path. - $path = \Drupal::service('path.alias_manager')->getPathByAlias($path); - foreach ($arg_tokens as $name => $original) { - $parts = explode('/', $path); - if (is_numeric($name) && isset($parts[$name])) { - $replacements[$original] = $parts[$name]; - } - } - } - - // [current-page:query] dynamic tokens. - if ($query_tokens = \Drupal::token()->findWithPrefix($tokens, 'query')) { - $bubbleable_metadata->addCacheContexts(['url.query_args']); - foreach ($query_tokens as $name => $original) { - if (\Drupal::request()->query->has($name)) { - $value = \Drupal::request()->query->get($name); - $replacements[$original] = $value; - } - } - } - - // Chained token relationships. - if ($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url')) { - $url = NULL; - try { - $url = Url::createFromRequest($request)->setOptions($url_options); - } - catch (\Exception $e) { - // Url::createFromRequest() can fail, e.g. on 404 pages. - // Fall back and try again with Url::fromUserInput(). - try { - $url = Url::fromUserInput($request->getPathInfo(), $url_options); - } - catch (\Exception $e) { - // Instantiation would fail again on malformed urls. - } - } - // Add cache contexts to ensure this token functions on a per-path basis - $bubbleable_metadata->addCacheContexts(['url.path']); - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $url], $options, $bubbleable_metadata); - } - } - - // URL tokens. - if ($type == 'url' && !empty($data['url'])) { - /** @var \Drupal\Core\Url $url */ - $url = $data['url']; - // To retrieve the correct path, modify a copy of the Url object. - $path_url = clone $url; - $path = '/'; - // Ensure the URL is routed to avoid throwing an exception. - if ($url->isRouted()) { - $path .= $path_url->setAbsolute(FALSE)->setOption('fragment', NULL)->getInternalPath(); - } - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'path': - $value = !($url->getOption('alias')) ? \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode) : $path; - $replacements[$original] = $value; - break; - - case 'alias': - // @deprecated - $alias = \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode); - $replacements[$original] = $alias; - break; - - case 'absolute': - $replacements[$original] = $url->setAbsolute()->toString(); - break; - - case 'relative': - $replacements[$original] = $url->setAbsolute(FALSE)->toString(); - break; - - case 'brief': - $replacements[$original] = preg_replace(['!^https?://!', '!/$!'], '', $url->setAbsolute()->toString()); - break; - - case 'unaliased': - $unaliased = clone $url; - $replacements[$original] = $unaliased->setAbsolute()->setOption('alias', TRUE)->toString(); - break; - - case 'args': - $value = !($url->getOption('alias')) ? \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode) : $path; - $replacements[$original] = token_render_array(explode('/', $value), $options); - break; - } - } - - // [url:args:*] chained tokens. - if ($arg_tokens = \Drupal::token()->findWithPrefix($tokens, 'args')) { - $value = !($url->getOption('alias')) ? \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode) : $path; - $replacements += \Drupal::token()->generate('array', $arg_tokens, ['array' => explode('/', ltrim($value, '/'))], $options, $bubbleable_metadata); - } - - // [url:unaliased:*] chained tokens. - if ($unaliased_tokens = \Drupal::token()->findWithPrefix($tokens, 'unaliased')) { - $url->setOption('alias', TRUE); - $replacements += \Drupal::token()->generate('url', $unaliased_tokens, ['url' => $url], $options, $bubbleable_metadata); - } - } - - // Entity tokens. - if (!empty($data[$type]) && $entity_type = \Drupal::service('token.entity_mapper')->getEntityTypeForTokenType($type)) { - /* @var \Drupal\Core\Entity\EntityInterface $entity */ - $entity = $data[$type]; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'url': - if (_token_module($type, 'url') === 'token' && !$entity->isNew() && $entity->hasLinkTemplate('canonical')) { - $replacements[$original] = $entity->toUrl('canonical')->toString(); - } - break; - - case 'original': - if (_token_module($type, 'original') == 'token' && !empty($entity->original)) { - $label = $entity->original->label(); - $replacements[$original] = $label; - } - break; - } - } - - // [entity:url:*] chained tokens. - if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url')) && _token_module($type, 'url') == 'token') { - $replacements += \Drupal::token()->generate('url', $url_tokens, ['url' => $entity->toUrl()], $options, $bubbleable_metadata); - } - - // [entity:original:*] chained tokens. - if (($original_tokens = \Drupal::token()->findWithPrefix($tokens, 'original')) && _token_module($type, 'original') == 'token' && !empty($entity->original)) { - $replacements += \Drupal::token()->generate($type, $original_tokens, [$type => $entity->original], $options, $bubbleable_metadata); - } - - // Pass through to an generic 'entity' token type generation. - $entity_data = [ - 'entity_type' => $entity_type, - 'entity' => $entity, - 'token_type' => $type, - ]; - // @todo Investigate passing through more data like everything from entity_extract_ids(). - $replacements += \Drupal::token()->generate('entity', $tokens, $entity_data, $options, $bubbleable_metadata); - } - - // Array tokens. - if ($type == 'array' && !empty($data['array']) && is_array($data['array'])) { - $array = $data['array']; - - $sort = isset($options['array sort']) ? $options['array sort'] : TRUE; - $keys = token_element_children($array, $sort); - - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'first': - $value = $array[$keys[0]]; - $value = is_array($value) ? $renderer->renderPlain($value) : (string) $value; - $replacements[$original] = $value; - break; - - case 'last': - $value = $array[$keys[count($keys) - 1]]; - $value = is_array($value) ? $renderer->renderPlain($value) : (string) $value; - $replacements[$original] = $value; - break; - - case 'count': - $replacements[$original] = count($keys); - break; - - case 'keys': - $replacements[$original] = token_render_array($keys, $options); - break; - - case 'reversed': - $reversed = array_reverse($array, TRUE); - $replacements[$original] = token_render_array($reversed, $options); - break; - - case 'join': - $replacements[$original] = token_render_array($array, ['join' => ''] + $options); - break; - } - } - - // [array:value:*] dynamic tokens. - if ($value_tokens = \Drupal::token()->findWithPrefix($tokens, 'value')) { - foreach ($value_tokens as $key => $original) { - if ($key[0] !== '#' && isset($array[$key])) { - $replacements[$original] = token_render_array_value($array[$key], $options); - } - } - } - - // [array:join:*] dynamic tokens. - if ($join_tokens = \Drupal::token()->findWithPrefix($tokens, 'join')) { - foreach ($join_tokens as $join => $original) { - $replacements[$original] = token_render_array($array, ['join' => $join] + $options); - } - } - - // [array:keys:*] chained tokens. - if ($key_tokens = \Drupal::token()->findWithPrefix($tokens, 'keys')) { - $replacements += \Drupal::token()->generate('array', $key_tokens, ['array' => $keys], $options, $bubbleable_metadata); - } - - // [array:reversed:*] chained tokens. - if ($reversed_tokens = \Drupal::token()->findWithPrefix($tokens, 'reversed')) { - $replacements += \Drupal::token()->generate('array', $reversed_tokens, ['array' => array_reverse($array, TRUE)], ['array sort' => FALSE] + $options, $bubbleable_metadata); - } - - // @todo Handle if the array values are not strings and could be chained. - } - - // Random tokens. - if ($type == 'random') { - foreach ($tokens as $name => $original) { - switch ($name) { - case 'number': - $replacements[$original] = mt_rand(); - break; - } - } - - // [custom:hash:*] dynamic token. - if ($hash_tokens = \Drupal::token()->findWithPrefix($tokens, 'hash')) { - $algos = hash_algos(); - foreach ($hash_tokens as $name => $original) { - if (in_array($name, $algos)) { - $replacements[$original] = hash($name, Crypt::randomBytes(55)); - } - } - } - } - - // If $type is a token type, $data[$type] is empty but $data[$entity_type] is - // not, re-run token replacements. - if (empty($data[$type]) && ($entity_type = \Drupal::service('token.entity_mapper')->getEntityTypeForTokenType($type)) && $entity_type != $type && !empty($data[$entity_type]) && empty($options['recursive'])) { - $data[$type] = $data[$entity_type]; - $options['recursive'] = TRUE; - $replacements += \Drupal::moduleHandler()->invokeAll('tokens', [$type, $tokens, $data, $options, $bubbleable_metadata]); - } - - // If the token type specifics a 'needs-data' value, and the value is not - // present in $data, then throw an error. - if (!empty($GLOBALS['drupal_test_info']['test_run_id'])) { - // Only check when tests are running. - $type_info = \Drupal::token()->getTypeInfo($type); - if (!empty($type_info['needs-data']) && !isset($data[$type_info['needs-data']])) { - trigger_error(t('Attempting to perform token replacement for token type %type without required data', ['%type' => $type]), E_USER_WARNING); - } - } - - return $replacements; -} - -/** - * Implements hook_token_info() on behalf of book.module. - */ -function book_token_info() { - $info['types']['book'] = [ - 'name' => t('Book'), - 'description' => t('Tokens related to books.'), - 'needs-data' => 'book', - ]; - - $info['tokens']['book']['title'] = [ - 'name' => t('Title'), - 'description' => t('Title of the book.'), - ]; - $info['tokens']['book']['author'] = [ - 'name' => t('Author'), - 'description' => t('The author of the book.'), - 'type' => 'user', - ]; - $info['tokens']['book']['root'] = [ - 'name' => t('Root'), - 'description' => t('Top level of the book.'), - 'type' => 'node', - ]; - $info['tokens']['book']['parent'] = [ - 'name' => t('Parent'), - 'description' => t('Parent of the current page.'), - 'type' => 'node', - ]; - $info['tokens']['book']['parents'] = [ - 'name' => t('Parents'), - 'description' => t("An array of all the node's parents, starting with the root."), - 'type' => 'array', - ]; - - $info['tokens']['node']['book'] = [ - 'name' => t('Book'), - 'description' => t('The book page associated with the node.'), - 'type' => 'book', - ]; - return $info; -} - -/** - * Implements hook_tokens() on behalf of book.module. - */ -function book_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) { - $replacements = []; - - // Node tokens. - if ($type == 'node' && !empty($data['node'])) { - $book = $data['node']->book; - - if (!empty($book['bid'])) { - if ($book_tokens = \Drupal::token()->findWithPrefix($tokens, 'book')) { - $child_node = Node::load($book['nid']); - $replacements += \Drupal::token()->generate('book', $book_tokens, ['book' => $child_node], $options, $bubbleable_metadata); - } - } - } - // Book tokens. - elseif ($type == 'book' && !empty($data['book'])) { - $book = $data['book']->book; - - if (!empty($book['bid'])) { - $book_node = Node::load($book['bid']); - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'root': - case 'title': - $replacements[$original] = $book_node->getTitle(); - break; - - case 'parent': - if (!empty($book['pid'])) { - $parent_node = Node::load($book['pid']); - $replacements[$original] = $parent_node->getTitle(); - } - break; - - case 'parents': - if ($parents = token_book_load_all_parents($book)) { - $replacements[$original] = token_render_array($parents, $options); - } - break; - } - } - - if ($book_tokens = \Drupal::token()->findWithPrefix($tokens, 'author')) { - $replacements += \Drupal::token()->generate('user', $book_tokens, ['user' => $book_node->getOwner()], $options, $bubbleable_metadata); - } - if ($book_tokens = \Drupal::token()->findWithPrefix($tokens, 'root')) { - $replacements += \Drupal::token()->generate('node', $book_tokens, ['node' => $book_node], $options, $bubbleable_metadata); - } - if (!empty($book['pid']) && $book_tokens = \Drupal::token()->findWithPrefix($tokens, 'parent')) { - $parent_node = Node::load($book['pid']); - $replacements += \Drupal::token()->generate('node', $book_tokens, ['node' => $parent_node], $options, $bubbleable_metadata); - } - if ($book_tokens = \Drupal::token()->findWithPrefix($tokens, 'parents')) { - $parents = token_book_load_all_parents($book); - $replacements += \Drupal::token()->generate('array', $book_tokens, ['array' => $parents], $options, $bubbleable_metadata); - } - } - } - - return $replacements; -} - -/** - * Implements hook_token_info() on behalf of menu_ui.module. - */ -function menu_ui_token_info() { - // Menu tokens. - $info['types']['menu'] = [ - 'name' => t('Menus'), - 'description' => t('Tokens related to menus.'), - 'needs-data' => 'menu', - ]; - $info['tokens']['menu']['name'] = [ - 'name' => t('Name'), - 'description' => t("The name of the menu."), - ]; - $info['tokens']['menu']['machine-name'] = [ - 'name' => t('Machine-readable name'), - 'description' => t("The unique machine-readable name of the menu."), - ]; - $info['tokens']['menu']['description'] = [ - 'name' => t('Description'), - 'description' => t('The optional description of the menu.'), - ]; - $info['tokens']['menu']['menu-link-count'] = [ - 'name' => t('Menu link count'), - 'description' => t('The number of menu links belonging to the menu.'), - ]; - $info['tokens']['menu']['edit-url'] = [ - 'name' => t('Edit URL'), - 'description' => t("The URL of the menu's edit page."), - ]; - - $info['tokens']['menu-link']['menu'] = [ - 'name' => t('Menu'), - 'description' => t('The menu of the menu link.'), - 'type' => 'menu', - ]; - $info['tokens']['menu-link']['edit-url'] = [ - 'name' => t('Edit URL'), - 'description' => t("The URL of the menu link's edit page."), - ]; - $info['tokens']['node']['menu-link'] = [ - 'name' => t('Menu link'), - 'description' => t("The menu link for this node."), - 'type' => 'menu-link', - ]; - - return $info; -} - -/** - * Implements hook_tokens() on behalf of menu_ui.module. - */ -function menu_ui_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) { - $replacements = []; - - /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */ - $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - - $url_options = ['absolute' => TRUE]; - if (isset($options['langcode'])) { - $url_options['language'] = \Drupal::languageManager()->getLanguage($options['langcode']); - $langcode = $options['langcode']; - } - else { - $langcode = NULL; - } - - // Node tokens. - if ($type == 'node' && !empty($data['node'])) { - /** @var \Drupal\node\NodeInterface $node */ - $node = $data['node']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'menu-link': - // On node-form save we populate a calculated field with a menu_link - // references. - // @see token_node_menu_link_submit() - if ($node->getFieldDefinition('menu_link') && $menu_link = $node->menu_link->entity) { - /** @var \Drupal\menu_link_content\MenuLinkContentInterface $menu_link */ - $replacements[$original] = $menu_link->getTitle(); - } - else { - $url = $node->toUrl(); - if ($links = $menu_link_manager->loadLinksByRoute($url->getRouteName(), $url->getRouteParameters())) { - $link = _token_menu_link_best_match($node, $links); - $replacements[$original] = token_menu_link_translated_title($link, $langcode); - } - } - break; - } - - // Chained token relationships. - if ($menu_tokens = \Drupal::token()->findWithPrefix($tokens, 'menu-link')) { - if ($node->getFieldDefinition('menu_link') && $menu_link = $node->menu_link->entity) { - /** @var \Drupal\menu_link_content\MenuLinkContentInterface $menu_link */ - $replacements += \Drupal::token()->generate('menu-link', $menu_tokens, ['menu-link' => $menu_link], $options, $bubbleable_metadata); - } - else { - $url = $node->toUrl(); - if ($links = $menu_link_manager->loadLinksByRoute($url->getRouteName(), $url->getRouteParameters())) { - $link = _token_menu_link_best_match($node, $links); - $replacements += \Drupal::token()->generate('menu-link', $menu_tokens, ['menu-link' => $link], $options, $bubbleable_metadata); - } - } - } - } - } - - // Menu link tokens. - if ($type == 'menu-link' && !empty($data['menu-link'])) { - /** @var \Drupal\Core\Menu\MenuLinkInterface $link */ - $link = $data['menu-link']; - - if ($link instanceof MenuLinkContentInterface) { - $link = $menu_link_manager->createInstance($link->getPluginId()); - } - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'menu': - if ($menu = Menu::load($link->getMenuName())) { - $replacements[$original] = $menu->label(); - } - break; - - case 'edit-url': - $replacements[$original] = $link->getEditRoute()->setOptions($url_options)->toString(); - break; - } - } - - // Chained token relationships. - if (($menu_tokens = \Drupal::token()->findWithPrefix($tokens, 'menu')) && $menu = Menu::load($link->getMenuName())) { - $replacements += \Drupal::token()->generate('menu', $menu_tokens, ['menu' => $menu], $options, $bubbleable_metadata); - } - } - - // Menu tokens. - if ($type == 'menu' && !empty($data['menu'])) { - /** @var \Drupal\system\MenuInterface $menu */ - $menu = $data['menu']; - - foreach ($tokens as $name => $original) { - switch ($name) { - case 'name': - $replacements[$original] = $menu->label(); - break; - - case 'machine-name': - $replacements[$original] = $menu->id(); - break; - - case 'description': - $replacements[$original] = $menu->getDescription(); - break; - - case 'menu-link-count': - $replacements[$original] = $menu_link_manager->countMenuLinks($menu->id()); - break; - - case 'edit-url': - $replacements[$original] = Url::fromRoute('entity.menu.edit_form', ['menu' => $menu->id()], $url_options)->toString(); - break; - } - } - } - - return $replacements; -} - -/** - * Returns a best matched link for a given node. - * - * If the url exists in multiple menus, default to the one set on the node - * itself. - * - * @param \Drupal\node\NodeInterface $node - * The node to look up the default menu settings from. - * @param array $links - * An array of instances keyed by plugin ID. - * - * @return \Drupal\Core\Menu\MenuLinkInterface - * A Link instance. - */ -function _token_menu_link_best_match(NodeInterface $node, array $links) { - // Get the menu ui defaults so we can determine what menu was - // selected for this node. This ensures that if the node was added - // to the menu via the node UI, we use that as a default. If it - // was not added via the node UI then grab the first in the - // retrieved array. - $defaults = menu_ui_get_menu_link_defaults($node); - if (isset($defaults['id']) && isset($links[$defaults['id']])) { - $link = $links[$defaults['id']]; - } - else { - $link = reset($links); - } - return $link; -} - -/** - * Implements hook_token_info_alter() on behalf of field.module. - * - * We use hook_token_info_alter() rather than hook_token_info() as other - * modules may already have defined some field tokens. - */ -function field_token_info_alter(&$info) { - $type_info = \Drupal::service('plugin.manager.field.field_type')->getDefinitions(); - - // Attach field tokens to their respecitve entity tokens. - foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) { - if (!$entity_type->isSubclassOf('\Drupal\Core\Entity\ContentEntityInterface')) { - continue; - } - - // Make sure a token type exists for this entity. - $token_type = \Drupal::service('token.entity_mapper')->getTokenTypeForEntityType($entity_type_id); - if (empty($token_type) || !isset($info['types'][$token_type])) { - continue; - } - - $fields = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($entity_type_id); - foreach ($fields as $field_name => $field) { - /** @var \Drupal\field\FieldStorageConfigInterface $field */ - - // Ensure the token implements FieldStorageConfigInterface or is defined - // in token module. - $provider = ''; - if (isset($info['types'][$token_type]['module'])) { - $provider = $info['types'][$token_type]['module']; - } - if (!($field instanceof FieldStorageConfigInterface) && $provider != 'token') { - continue; - } - - // If a token already exists for this field, then don't add it. - if (isset($info['tokens'][$token_type][$field_name])) { - continue; - } - - if ($token_type == 'comment' && $field_name == 'comment_body') { - // Core provides the comment field as [comment:body]. - continue; - } - - // Do not define the token type if the field has no properties. - if (!$field->getPropertyDefinitions()) { - continue; - } - - // Generate a description for the token. - $labels = _token_field_label($entity_type_id, $field_name); - $label = array_shift($labels); - $params['@type'] = $type_info[$field->getType()]['label']; - if (!empty($labels)) { - $params['%labels'] = implode(', ', $labels); - $description = t('@type field. Also known as %labels.', $params); - } - else { - $description = t('@type field.', $params); - } - - $cardinality = $field->getCardinality(); - $cardinality = ($cardinality == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED || $cardinality > 3) ? 3 : $cardinality; - $field_token_name = $token_type . '-' . $field_name; - $info['tokens'][$token_type][$field_name] = [ - 'name' => Html::escape($label), - 'description' => $description, - 'module' => 'token', - // For multivalue fields the field token is a list type. - 'type' => $cardinality > 1 ? "list<$field_token_name>" : $field_token_name, - ]; - - // Field token type. - $info['types'][$field_token_name] = [ - 'name' => Html::escape($label), - 'description' => t('@label tokens.', ['@label' => Html::escape($label)]), - 'needs-data' => $field_token_name, - 'nested' => TRUE, - ]; - // Field list token type. - if ($cardinality > 1) { - $info['types']["list<$field_token_name>"] = [ - 'name' => t('List of @type values', ['@type' => Html::escape($label)]), - 'description' => t('Tokens for lists of @type values.', ['@type' => Html::escape($label)]), - 'needs-data' => "list<$field_token_name>", - 'nested' => TRUE, - ]; - } - - // Show a different token for each field delta. - if ($cardinality > 1) { - for ($delta = 0; $delta < $cardinality; $delta++) { - $info['tokens']["list<$field_token_name>"][$delta] = [ - 'name' => t('@type type with delta @delta', ['@type' => Html::escape($label), '@delta' => $delta]), - 'module' => 'token', - 'type' => $field_token_name, - ]; - } - } - - // Property tokens. - foreach ($field->getPropertyDefinitions() as $property => $property_definition) { - if (is_subclass_of($property_definition->getClass(), 'Drupal\Core\TypedData\PrimitiveInterface')) { - $info['tokens'][$field_token_name][$property] = [ - 'name' => $property_definition->getLabel(), - 'description' => $property_definition->getDescription(), - 'module' => 'token', - ]; - } - elseif (($property_definition instanceof DataReferenceDefinitionInterface) && ($property_definition->getTargetDefinition() instanceof EntityDataDefinitionInterface)) { - $referenced_entity_type = $property_definition->getTargetDefinition()->getEntityTypeId(); - $referenced_token_type = \Drupal::service('token.entity_mapper')->getTokenTypeForEntityType($referenced_entity_type); - $info['tokens'][$field_token_name][$property] = [ - 'name' => $property_definition->getLabel(), - 'description' => $property_definition->getDescription(), - 'module' => 'token', - 'type' => $referenced_token_type, - ]; - } - } - // Provide image_with_image_style tokens for image fields. - if ($field->getType() == 'image') { - $image_styles = image_style_options(FALSE); - foreach ($image_styles as $style => $description) { - $info['tokens'][$field_token_name][$style] = [ - 'name' => $description, - 'description' => t('Represents the image in the given image style.'), - 'type' => 'image_with_image_style', - ]; - } - } - // Provide format token for datetime fields. - if ($field->getType() == 'datetime') { - $info['tokens'][$field_token_name]['date'] = $info['tokens'][$field_token_name]['value']; - $info['tokens'][$field_token_name]['date']['name'] .= ' ' . t('format'); - $info['tokens'][$field_token_name]['date']['type'] = 'date'; - } - if ($field->getType() == 'daterange' || $field->getType() == 'date_recur') { - $info['tokens'][$field_token_name]['start_date'] = $info['tokens'][$field_token_name]['value']; - $info['tokens'][$field_token_name]['start_date']['name'] .= ' ' . t('format'); - $info['tokens'][$field_token_name]['start_date']['type'] = 'date'; - $info['tokens'][$field_token_name]['end_date'] = $info['tokens'][$field_token_name]['end_value']; - $info['tokens'][$field_token_name]['end_date']['name'] .= ' ' . t('format'); - $info['tokens'][$field_token_name]['end_date']['type'] = 'date'; - } - } - } -} - -/** - * Returns the label of a certain field. - * - * Therefore it looks up in all bundles to find the most used instance. - * - * Based on views_entity_field_label(). - * - * @todo Resync this method with views_entity_field_label(). - */ -function _token_field_label($entity_type, $field_name) { - $labels = []; - // Count the amount of instances per label per field. - foreach (array_keys(\Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type)) as $bundle) { - $bundle_instances = \Drupal::service('entity_field.manager')->getFieldDefinitions($entity_type, $bundle); - if (isset($bundle_instances[$field_name])) { - $instance = $bundle_instances[$field_name]; - $label = (string) $instance->getLabel(); - $labels[$label] = isset($labels[$label]) ? ++$labels[$label] : 1; - } - } - - if (empty($labels)) { - return [$field_name]; - } - - // Sort the field labels by it most used label and return the labels. - arsort($labels); - return array_keys($labels); -} - -/** - * Implements hook_tokens() on behalf of field.module. - */ -function field_tokens($type, $tokens, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata) { - $replacements = []; - $langcode = isset($options['langcode']) ? $options['langcode'] : NULL; - // Entity tokens. - if ($type == 'entity' && !empty($data['entity_type']) && !empty($data['entity']) && !empty($data['token_type'])) { - /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = $data['entity']; - if (!($entity instanceof ContentEntityInterface)) { - return $replacements; - } - - if (!isset($options['langcode'])) { - // Set the active language in $options, so that it is passed along. - $langcode = $options['langcode'] = $entity->language()->getId(); - } - // Obtain the entity with the correct language. - $entity = \Drupal::service('entity.repository')->getTranslationFromContext($entity, $langcode); - - $view_mode_name = $entity->getEntityTypeId() . '.' . $entity->bundle() . '.token'; - $view_display = \Drupal::entityTypeManager()->getStorage('entity_view_display')->load($view_mode_name); - $token_view_display = (!empty($view_display) && $view_display->status()); - foreach ($tokens as $name => $original) { - // For the [entity:field_name] token. - if (strpos($name, ':') === FALSE) { - $field_name = $name; - $token_name = $name; - } - // For [entity:field_name:0], [entity:field_name:0:value] and - // [entity:field_name:value] tokens. - else { - list($field_name, $delta) = explode(':', $name, 2); - if (!is_numeric($delta)) { - unset($delta); - } - $token_name = $field_name; - } - // Ensure the entity has the requested field and that the token for it is - // defined by token.module. - if (!$entity->hasField($field_name) || _token_module($data['token_type'], $token_name) != 'token') { - continue; - } - - $display_options = 'token'; - // Do not continue if the field is empty. - if ($entity->get($field_name)->isEmpty()) { - continue; - } - // Handle [entity:field_name] and [entity:field_name:0] tokens. - if ($field_name === $name || isset($delta)) { - if (!$token_view_display) { - // We don't have the token view display and should fall back on - // default formatters. If the field has specified a specific formatter - // to be used by default with tokens, use that, otherwise use the - // default formatter. - /** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */ - $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); - $field_type_definition = $field_type_manager->getDefinition($entity->getFieldDefinition($field_name)->getType()); - $display_options = [ - 'type' => !empty($field_type_definition['default_token_formatter']) ? $field_type_definition['default_token_formatter'] : $field_type_definition['default_formatter'], - 'label' => 'hidden', - ]; - } - - // Render only one delta. - if (isset($delta)) { - if ($field_delta = $entity->{$field_name}[$delta]) { - $field_output = $field_delta->view($display_options); - } - // If no such delta exists, let's not replace the token. - else { - continue; - } - } - // Render the whole field (with all deltas). - else { - $field_output = $entity->$field_name->view($display_options); - // If we are displaying all field items we need this #pre_render - // callback. - $field_output['#pre_render'][] = 'token_pre_render_field_token'; - } - $field_output['#token_options'] = $options; - $replacements[$original] = \Drupal::service('renderer')->renderPlain($field_output); - } - // Handle [entity:field_name:value] and [entity:field_name:0:value] - // tokens. - elseif ($field_tokens = \Drupal::token()->findWithPrefix($tokens, $field_name)) { - $property_token_data = [ - 'field_property' => TRUE, - $data['entity_type'] . '-' . $field_name => $entity->$field_name, - 'field_name' => $data['entity_type'] . '-' . $field_name, - ]; - $replacements += \Drupal::token()->generate($field_name, $field_tokens, $property_token_data, $options, $bubbleable_metadata); - } - } - - // Remove the cloned object from memory. - unset($entity); - } - elseif (!empty($data['field_property'])) { - foreach ($tokens as $token => $original) { - $filtered_tokens = $tokens; - $delta = 0; - $parts = explode(':', $token); - if (is_numeric($parts[0])) { - if (count($parts) > 1) { - $delta = $parts[0]; - $property_name = $parts[1]; - // Pre-filter the tokens to select those with the correct delta. - $filtered_tokens = \Drupal::token()->findWithPrefix($tokens, $delta); - // Remove the delta to unify between having and not having one. - array_shift($parts); - } - else { - // Token is fieldname:delta, which is invalid. - continue; - } - } - else { - $property_name = $parts[0]; - } - - if (isset($data[$data['field_name']][$delta])) { - $field_item = $data[$data['field_name']][$delta]; - } - else { - // The field has no such delta, abort replacement. - continue; - } - - if (isset($field_item->$property_name) && ($field_item->$property_name instanceof FieldableEntityInterface)) { - // Entity reference field. - $entity = $field_item->$property_name; - // Obtain the referenced entity with the correct language. - $entity = \Drupal::service('entity.repository')->getTranslationFromContext($entity, $langcode); - - if (count($parts) > 1) { - $field_tokens = \Drupal::token()->findWithPrefix($filtered_tokens, $property_name); - $token_type = \Drupal::service('token.entity_mapper')->getTokenTypeForEntityType($entity->getEntityTypeId(), TRUE); - $replacements += \Drupal::token()->generate($token_type, $field_tokens, [$token_type => $entity], $options, $bubbleable_metadata); - } - else { - $replacements[$original] = $entity->label(); - } - } - elseif (($field_item->getFieldDefinition()->getType() == 'image') && ($style = ImageStyle::load($property_name))) { - // Handle [node:field_name:image_style:property] tokens and multivalued - // [node:field_name:delta:image_style:property] tokens. If the token is - // of the form [node:field_name:image_style], provide the URL as a - // replacement. - $property_name = isset($parts[1]) ? $parts[1] : 'url'; - $entity = $field_item->entity; - if (!empty($field_item->entity)) { - $original_uri = $entity->getFileUri(); - - // Only generate the image derivative if needed. - if ($property_name === 'width' || $property_name === 'height') { - $dimensions = [ - 'width' => $field_item->width, - 'height' => $field_item->height, - ]; - $style->transformDimensions($dimensions, $original_uri); - $replacements[$original] = $dimensions[$property_name]; - } - elseif ($property_name === 'uri') { - $replacements[$original] = $style->buildUri($original_uri); - } - elseif ($property_name === 'url') { - $replacements[$original] = $style->buildUrl($original_uri); - } - else { - // Generate the image derivative, if it doesn't already exist. - $derivative_uri = $style->buildUri($original_uri); - $derivative_exists = TRUE; - if (!file_exists($derivative_uri)) { - $derivative_exists = $style->createDerivative($original_uri, $derivative_uri); - } - if ($derivative_exists) { - $image = \Drupal::service('image.factory')->get($derivative_uri); - // Provide the replacement. - switch ($property_name) { - case 'mimetype': - $replacements[$original] = $image->getMimeType(); - break; - - case 'filesize': - $replacements[$original] = $image->getFileSize(); - break; - } - } - } - } - } - elseif (in_array($field_item->getFieldDefinition()->getType(), ['datetime', 'daterange', 'date_recur']) && in_array($property_name, ['date', 'start_date', 'end_date']) && !empty($field_item->$property_name)) { - $timestamp = $field_item->{$property_name}->getTimestamp(); - // If the token is an exact match for the property or the delta and the - // property, use the timestamp as-is. - if ($property_name == $token || "$delta:$property_name" == $token) { - $replacements[$original] = $timestamp; - } - else { - $date_tokens = \Drupal::token()->findWithPrefix($filtered_tokens, $property_name); - $replacements += \Drupal::token()->generate('date', $date_tokens, ['date' => $timestamp], $options, $bubbleable_metadata); - } - } - else { - $replacements[$original] = $field_item->$property_name; - } - } - } - return $replacements; -} - -/** - * Pre-render callback for field output used with tokens. - */ -function token_pre_render_field_token($elements) { - // Remove the field theme hook, attachments, and JavaScript states. - unset($elements['#theme']); - unset($elements['#states']); - unset($elements['#attached']); - - // Prevent multi-value fields from appearing smooshed together by appending - // a join suffix to all but the last value. - $deltas = Element::getVisibleChildren($elements); - $count = count($deltas); - if ($count > 1) { - $join = isset($elements['#token_options']['join']) ? $elements['#token_options']['join'] : ", "; - foreach ($deltas as $index => $delta) { - // Do not add a suffix to the last item. - if ($index < ($count - 1)) { - $elements[$delta] += ['#suffix' => $join]; - } - } - } - return $elements; -} diff --git a/sites/all/modules/contrib/fields/addtoany/LICENSE.txt b/sites/all/modules/contrib/fields/addtoany/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/fields/addtoany/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/fields/addtoany/README.txt b/sites/all/modules/contrib/fields/addtoany/README.txt deleted file mode 100644 index ea71fb836..000000000 --- a/sites/all/modules/contrib/fields/addtoany/README.txt +++ /dev/null @@ -1,53 +0,0 @@ - -CONTENTS OF THIS FILE ---------------------- - - * Introduction - * Configuration - * Features - * More information - -INTRODUCTION ------------- - -The AddToAny module provides share buttons for Drupal. Sharing icons and -features are maintained by AddToAny, the universal sharing platform. - -By default, the module places share buttons below node content. - -CONFIGURATION -------------- - -To configure AddToAny, go to: -Administration > Configuration > Web services > AddToAny. - -Explore AddToAny's documentation for the Drupal module: -https://www.addtoany.com/buttons/customize/drupal - -FEATURES --------- - -The module strives to remain lightweight & efficient while integrating with -core Drupal features and major contributed modules such as: - - * Blocks - * Views - * Display Suite (contributed) - -AddToAny core is optimized to load asynchronously, and many sharing and social -media features come from AddToAny core including: - - * Universal share menus - * Share counters - * Share templates - * Custom icons - * Automatic Google Analytics integration - * Event tracking (useful for integration with other analytics software) - * Link tracking using bit.ly, goo.gl, and custom URL shorteners - * Automatic localization (over 50 languages) - -MORE INFORMATION ----------------- - - * AddToAny's official website: - https://www.addtoany.com/ diff --git a/sites/all/modules/contrib/fields/addtoany/addtoany.api.php b/sites/all/modules/contrib/fields/addtoany/addtoany.api.php deleted file mode 100644 index a031140d7..000000000 --- a/sites/all/modules/contrib/fields/addtoany/addtoany.api.php +++ /dev/null @@ -1,21 +0,0 @@ -AddToAny platform.' -package: Other -# core: 8.x -dependencies: - - drupal:node -configure: addtoany.admin_settings - -# Information added by Drupal.org packaging script on 2018-07-03 -version: '8.x-1.10' -core: '8.x' -project: 'addtoany' -datestamp: 1530656924 diff --git a/sites/all/modules/contrib/fields/addtoany/addtoany.install b/sites/all/modules/contrib/fields/addtoany/addtoany.install deleted file mode 100644 index 2af3f917f..000000000 --- a/sites/all/modules/contrib/fields/addtoany/addtoany.install +++ /dev/null @@ -1,132 +0,0 @@ - ['default', 'teaser'], - 'page' => ['default', 'teaser'], - ]; - // Get the config entity storage handler. - $storage = \Drupal::entityTypeManager()->getStorage('entity_view_display'); - foreach ($node_enable_by_default as $bundle => $viewmodes) { - // Set a default weight per node type. - $display_weight = ($bundle == 'article') ? 5 : 101; - - foreach ($viewmodes as $viewmode) { - // Get the config entity for this bundle and view mode. - $display = $storage->load('node.' . $bundle . '.' . $viewmode); - // Enable the AddToAny extra field and save the config. - if (!empty($display)) { - $display->setComponent('addtoany', ['weight' => $display_weight])->save(); - } - } - } -} - -/** - * Migrate global placement settings to settings per view mode. - */ -function addtoany_update_8101(&$sandbox) { - $config_factory = \Drupal::configFactory(); - - // Gather the settings we need to migrate. - $addtoany_settings = $config_factory->getEditable('addtoany.settings'); - $node_types = $addtoany_settings->getOriginal('nodetypes'); - $display_in_teasers = $addtoany_settings->getOriginal('display_in_teasers'); - $display_in_nodecont = $addtoany_settings->getOriginal('display_in_nodecont'); - $display_weight = $addtoany_settings->getOriginal('display_weight'); - $new_display_weight = $display_weight; - - // The entity display repository stores which view modes are enabled. - $entity_display_repository = \Drupal::getContainer()->get('entity_display.repository'); - - // Check if AddToAny is currently shown on at least one node type. - if (!empty($node_types) && $display_in_nodecont) { - - // Loop over the AddToAny-enabled node types. - foreach ($node_types as $bundle) { - // Get enabled view modes. - $view_modes = $entity_display_repository->getViewModeOptionsByBundle('node', $bundle); - - // If the teaser view mode is enabled but the old settings excluded it, - // take it out. - if (!empty($view_modes['teaser']) && $display_in_teasers == FALSE) { - unset($view_modes['teaser']); - } - - // Check if the old default weight was set. - if ($display_weight == 10) { - // Set the new default weight per node type. - $new_display_weight = ($bundle == 'article') ? 5 : 101; - } - - // Loop over the view modes and apply new settings to match the old. - foreach ($view_modes as $view_mode => $view_mode_info) { - $display = EntityViewDisplay::load('node.' . $bundle . '.' . $view_mode); - $display->setComponent('addtoany', ['weight' => $new_display_weight])->save(); - } - } - } - - // Convert Display Suite fields to regular "extra fields". - if (\Drupal::moduleHandler()->moduleExists('ds')) { - // The DsField implementation only supported node entities. - $all_node_types = NodeType::loadMultiple(); - - foreach ($all_node_types as $node_type) { - // Get enabled view modes. - $view_modes = $entity_display_repository->getViewModeOptionsByBundle('node', $node_type->id()); - - // Loop over the view modes and apply new settings to match the old. - foreach ($view_modes as $view_mode => $view_mode_info) { - // Get the entity view display config entity. - $display = EntityViewDisplay::load('node.' . $node_type->id() . '.' . $view_mode); - - // Check if this view mode uses Display Suite fields and if the Display - // Suite AddToAny field ("addtoany_field") was enabled. - $ds_fields = $display->getThirdPartySetting('ds', 'fields'); - if (!empty($ds_fields) && isset($ds_fields['addtoany_field'])) { - // Remove the DS field, add the extra field. - unset($ds_fields['addtoany_field']); - $display->setComponent('addtoany'); - // Keep the rest of the DS fields. - $display->setThirdPartySetting('ds', 'fields', $ds_fields); - - // Find where the DS field was placed and put the AddToAny extra field - // in its place. - $ds_regions = $display->getThirdPartySetting('ds', 'regions'); - foreach ($ds_regions as $label => $ds_region_fields) { - $key = array_search('addtoany_field', $ds_region_fields); - if ($key !== FALSE) { - $ds_regions[$label][$key] = 'addtoany'; - } - } - // Apply the altered region settings. - $display->setThirdPartySetting('ds', 'regions', $ds_regions); - - // Save the view mode. - $display->save(); - } - } - } - } - - // Finally, clean up no longer used settings. - $addtoany_settings->clear('nodetypes') - ->clear('display_in_teasers') - ->clear('display_in_nodecont') - ->clear('display_weight') - ->save(); -} diff --git a/sites/all/modules/contrib/fields/addtoany/addtoany.libraries.yml b/sites/all/modules/contrib/fields/addtoany/addtoany.libraries.yml deleted file mode 100644 index d1c469f3b..000000000 --- a/sites/all/modules/contrib/fields/addtoany/addtoany.libraries.yml +++ /dev/null @@ -1,21 +0,0 @@ -addtoany: - version: VERSION - js: - https://static.addtoany.com/menu/page.js: { attributes: { async: true }, type: external, minified: true } - js/addtoany.js: {} - css: - theme: - css/addtoany.css: {} - dependencies: - - core/drupal - -addtoany.admin: - version: VERSION - js: - js/addtoany.admin.js: {} - css: - theme: - css/addtoany.admin.css: {} - dependencies: - - core/jquery - - core/drupal diff --git a/sites/all/modules/contrib/fields/addtoany/addtoany.links.menu.yml b/sites/all/modules/contrib/fields/addtoany/addtoany.links.menu.yml deleted file mode 100644 index 4a899948c..000000000 --- a/sites/all/modules/contrib/fields/addtoany/addtoany.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -addtoany.admin_settings: - title: 'AddToAny' - parent: system.admin_config_services - description: 'Configure AddToAny share buttons.' - route_name: addtoany.admin_settings diff --git a/sites/all/modules/contrib/fields/addtoany/addtoany.links.task.yml b/sites/all/modules/contrib/fields/addtoany/addtoany.links.task.yml deleted file mode 100644 index f43d4b0f5..000000000 --- a/sites/all/modules/contrib/fields/addtoany/addtoany.links.task.yml +++ /dev/null @@ -1,4 +0,0 @@ -addtoany.admin_settings_tab: - route_name: addtoany.admin_settings - title: Settings - base_route: addtoany.admin_settings diff --git a/sites/all/modules/contrib/fields/addtoany/addtoany.module b/sites/all/modules/contrib/fields/addtoany/addtoany.module deleted file mode 100644 index da490ea64..000000000 --- a/sites/all/modules/contrib/fields/addtoany/addtoany.module +++ /dev/null @@ -1,280 +0,0 @@ - [ - 'variables' => [ - 'addtoany_html' => FALSE, - 'link_url' => FALSE, - 'link_title' => FALSE, - 'buttons_size' => FALSE, - 'button_setting' => FALSE, - 'button_image' => FALSE, - 'universal_button_placement' => FALSE, - 'entity_type' => '', - 'bundle' => '', - ], - ], - ]; -} - -/** - * Implements hook_theme_suggestions_HOOK(). - */ -function addtoany_theme_suggestions_addtoany_standard(array $variables) { - $suggestion = 'addtoany_standard__'; - $suggestions = []; - - if (!empty($variables['entity_type'])) { - $suggestion .= $variables['entity_type']; - $suggestions[] = $suggestion; - } - - if (!empty($variables['entity_type']) && !empty($variables['bundle'])) { - $suggestion .= '__' . $variables['bundle']; - $suggestions[] = $suggestion; - } - - return $suggestions; -} - -/** - * Implements hook_entity_extra_field_info(). - */ -function addtoany_entity_extra_field_info() { - $extra = []; - $entityTypes = AddToAnySettingsForm::getContentEntities(); - $config = Drupal::config('addtoany.settings'); - - // Allow modules to alter the entity types. - \Drupal::moduleHandler()->alter('addtoany_entity_types', $entityTypes); - - foreach ($entityTypes as $type) { - $entityTypeId = $type->id(); - $isAllowed = $config->get("entities.{$entityTypeId}"); - if ($isAllowed) { - $bundles = Drupal::service('entity_type.bundle.info')->getBundleInfo($entityTypeId); - foreach ($bundles as $bundle => $bundle_data) { - $extra[$entityTypeId][$bundle]['display']['addtoany'] = [ - 'label' => t('AddToAny'), - 'description' => t('Share buttons by AddToAny'), - 'weight' => 5, - 'visible' => FALSE, - ]; - } - } - } - - return $extra; -} - -/** - * Implements hook_ENTITY_TYPE_view(). - */ -function addtoany_entity_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) { - if ($display->getComponent('addtoany')) { - $config = Drupal::config('addtoany.settings'); - $isAllowed = $config->get("entities.{$entity->getEntityTypeId()}"); - if ($isAllowed) { - $data = addtoany_create_entity_data($entity); - $build['addtoany'] = [ - '#addtoany_html' => \Drupal::token()->replace($data['addtoany_html'], ['node' => $entity]), - '#link_url' => $data['link_url'], - '#link_title' => $data['link_title'], - '#button_setting' => $data['button_setting'], - '#button_image' => $data['button_image'], - '#universal_button_placement' => $data['universal_button_placement'], - '#buttons_size' => $data['buttons_size'], - '#entity_type' => $entity->getEntityType()->id(), - '#bundle' => $entity->bundle(), - '#theme' => 'addtoany_standard', - ]; - } - } -} - -/** - * Implements hook_page_attachments(). - */ -function addtoany_page_attachments(&$page) { - $config = \Drupal::config('addtoany.settings'); - - // Initial JavaScript. - $additional_js = $config->get('additional_js'); - - if (\Drupal::moduleHandler()->moduleExists('token')) { - $node = \Drupal::routeMatch()->getParameter('node'); - $data = []; - if ($node) { - if (is_numeric($node)) { - $node = Node::load($node); - } - $data = ['node' => $node]; - $additional_js = \Drupal::token()->replace($additional_js, $data); - } - } - - $javascript_header = 'window.a2a_config=window.a2a_config||{};' - . 'a2a_config.callbacks=[];a2a_config.overlays=[];' - . 'a2a_config.templates={};' - . (($config->get('no_3p')) ? 'a2a_config.no_3p=1;' : '') - . $additional_js; - - // Add AddToAny initial JS config. - $page['#attached']['html_head'][] = [ - // The data. - [ - // Add a '; - $message['body'][] = t('Test email body.'); - } - - // This has an XSS test for the body field. - elseif ($key == 'maillog_body_xss_test') { - $message['subject'] = t('Test email subject'); - $message['body'][] = ''; - } -} diff --git a/sites/all/modules/contrib/mail/maillog/tests/src/Kernel/MailTest.php b/sites/all/modules/contrib/mail/maillog/tests/src/Kernel/MailTest.php deleted file mode 100644 index 313707d9e..000000000 --- a/sites/all/modules/contrib/mail/maillog/tests/src/Kernel/MailTest.php +++ /dev/null @@ -1,98 +0,0 @@ -installSchema('maillog', 'maillog'); - $this->installConfig(['system', 'maillog']); - // The system.site.mail setting goes into the From header of outgoing mails. - $this->config('system.site')->set('mail', 'simpletest@example.com')->save(); - - // Use the maillog mail plugin. - $GLOBALS['config']['system.mail']['interface']['default'] = 'maillog'; - - // Disables E-Mail Sending, only tracking. - $this->config('maillog.settings') - ->set('send', FALSE) - ->save(); - } - - /** - * Tests logging mail with maillog module. - */ - public function testLogging() { - $language = \Drupal::languageManager()->getCurrentLanguage(); - - // Send an email. - $from_email = 'simpletest@example.com'; - $reply_email = 'someone_else@example.com'; - \Drupal::service('plugin.manager.mail')->mail('simpletest', 'from_test', 'from_test@example.com', $language, array(), $reply_email); - - // Compare the maillog db entry with the sent mail. - $logged_email = $this->getLatestMaillogEntry(); - $this->assertTrue(is_array($logged_email), 'Email is captured.'); - $this->assertEqual($from_email, $logged_email['header_from'], 'Email is sent correctly.'); - $this->assertEqual($reply_email, $logged_email['header_all']['Reply-to'], 'Message is sent with correct reply address.'); - } - - /** - * Gets the latest Maillog entry. - * - * @return array - * Maillog entry - */ - protected function getLatestMaillogEntry() { - $query = 'SELECT idmaillog, header_from, header_to, header_reply_to, header_all, subject, body FROM {maillog} ORDER BY idmaillog DESC'; - $result = \Drupal::database()->queryRange($query, 0, 1); - - if ($maillog = $result->fetchAssoc()) { - // Unserialize values. - $maillog['header_all'] = unserialize($maillog['header_all']); - } - return $maillog; - } - - /** - * Confirm what happens with long subject lines. - */ - public function testLongSubject() { - // Send an email. - $from_email = 'from_test@example.com'; - $to_email = 'to_test@example.com'; - \Drupal::service('plugin.manager.mail')->mail('maillog_test', 'maillog_long_subject_test', $to_email, 'en', [], $from_email); - - // Compare the maillog db entry with the sent mail. - $logged_email = $this->getLatestMaillogEntry(); - $this->assertTrue(!empty($logged_email), 'The test email was captured.'); - - // The original subject line, as copied from maillog_test_mail(). - $subject = str_repeat(t('Test email subject@space', ['@space' => ' ']), 20); - - // Duplicate the string trimming. - $subject_trimmed = Unicode::substr($subject, 0, 255); - self::assertEquals($subject_trimmed, $logged_email['subject'], 'Email subject was trimmed correctly.'); - self::assertNotEquals($subject, $logged_email['subject'], 'Email subject is not untrimmed.'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/LICENSE.txt b/sites/all/modules/contrib/migrate/migrate_plus/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/migrate/migrate_plus/README.txt b/sites/all/modules/contrib/migrate/migrate_plus/README.txt deleted file mode 100644 index 9738be925..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/README.txt +++ /dev/null @@ -1,77 +0,0 @@ -The migrate_plus module extends the core migration system with API enhancements -and additional functionality, as well as providing practical examples. - -Extensions to base API -====================== -* A Migration configuration entity is provided, enabling persistance of dynamic - migration configuration. -* A MigrationGroup configuration entity is provided, which enables migrations to - be organized in groups, and to maintain shared configuration in one place. -* A MigrateEvents::PREPARE_ROW event is provided to dispatch - hook_migrate_prepare_row() invocations as events. -* A SourcePluginExtension class is provided, enabling one to define fields and - IDs for a source plugin via configuration rather than requiring PHP code. - -Plugin types -============ -migrate_plus provides the following plugin types, for use with the url source -plugin. - -* A data_parser type, for parsing different formats on behalf of the url source - plugin. -* A data_fetcher type, for fetching data to feed into a data_parser plugin. -* An authentication type, for adding authentication headers with the http - data_fetcher plugin. - -Plugins -======= - -Process -------- -* The entity_lookup process plugin allows you to populate references to entities - which already exist in Drupal, whether they were migrated or not. -* The entity_generate process plugin extends entity_lookup to also create the - desired entity when it doesn't already exist. -* The file_blob process plugin supports creating file entities from blob data. -* The merge process plugin allows the merging of multiple arrays into a single - field. -* The skip_on_value process plugin allows you to skip a row, or a given field, - for specific source values. - -Source ------- -* A url source plugin is provided, implementing a common structure for - file-based data providers. - -Data parsers ------------- -* The xml parser plugin uses PHP's XMLReader interface to incrementally parse - XML files. This should be used for XML sources which are potentially very - large. -* The simple_xml parser plugin uses PHP's SimpleXML interface to fully parse - XML files. This should be used for XML sources where you need to be able to - use complex xpaths for your item selectors, or have to access elements outside - of the current item element via xpaths. -* The json parser plugin supports JSON sources. -* The soap parser plugin supports SOAP sources. - -Data fetchers -------------- -* The file fetcher plugin works for most URLs regardless of protocol, as well as - local filesystems. -* The http fetcher plugin provides the ability to add headers to an HTTP - request (particularly through authentication plugins). - -Authentication --------------- -* The basic authentication plugin provides HTTP Basic authentication. -* The digest authentication plugin provides HTTP Digest authentication. -* The oauth2 authentication plugin provides OAuth2 authentication over HTTP. - -Examples -======== -* The migrate_example submodule provides a fully functional and runnable -example migration scenario demonstrating the basic concepts and most common -techniques for SQL-based migrations. -* The migrate_example_advanced submodule provides examples of migration from -different kinds of sources, as well as less common techniques. diff --git a/sites/all/modules/contrib/migrate/migrate_plus/composer.json b/sites/all/modules/contrib/migrate/migrate_plus/composer.json deleted file mode 100644 index 54070eda9..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/composer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "drupal/migrate_plus", - "description": "Enhancements to core migration support.", - "type": "drupal-module", - "license": "GPL-2.0+", - "homepage": "https://www.drupal.org/project/migrate_plus", - "authors": [ - { - "name": "Mike Ryan", - "homepage":"https://www.drupal.org/u/mikeryan", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/migrate_plus", - "irc": "irc://irc.freenode.org/drupal-migrate", - "source": "https://cgit.drupalcode.org/migrate_plus" - }, - "minimum-stability": "dev", - "suggest": { - "sainsburys/guzzle-oauth2-plugin": "3.0 required for the OAuth2 authentication plugin", - "ext-soap": "*" - } -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.data_types.schema.yml b/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.data_types.schema.yml deleted file mode 100644 index 92e8288ec..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.data_types.schema.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Basic data types for Migrate. - -migrate_plugin: - type: mapping - mapping: - plugin: - type: string - label: 'Plugin' -migrate_destination: - type: migrate_plugin - label: 'Destination' - mapping: - overwrite_properties: - type: sequence - label: 'Properties to overwrite' - sequence: - type: string - label: 'Property' - -migrate_source: - type: migrate_plugin - label: 'Source' - mapping: - constants: - type: ignore - label: 'Constants' - ids: - type: ignore - label: 'Source IDs schema definition for migrate mapping table' - urls: - type: sequence - label: 'URLs from which to fetch' - sequence: - type: string - data_fetcher_plugin: - type: string - label: 'Fetcher plugin' - data_parser_plugin: - type: string - label: 'Parser plugin' - fields: - type: ignore - label: Mapping of field names to selectors - function: - type: string - label: 'Function to call on the service' - parameters: - type: ignore - label: 'Parameters to pass to function on the service' - response_type: - type: string - label: 'Type of response; XML string, object or array' - item_selector: - type: string - label: 'XPath selector' - -migrate_process: - type: migrate_plugin - label: 'Process' - -# Base schema for migrate source plugins that extend -# \Drupal\migrate\Plugin\migrate\source\SqlBase. -migrate_source_sql: - type: migrate_source - mapping: - target: - type: string - label: 'The migration database target' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.destination.schema.yml b/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.destination.schema.yml deleted file mode 100644 index c76e59d5d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.destination.schema.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Schema for the migrate destination plugins. - -migrate_plus.destination.*: - type: migrate_destination - label: 'Default destination' - mapping: - no_stub: - type: boolean - label: 'Whether stubbing is allowed.' - default: false - default_bundle: - type: string - label: 'The default bundle for content entity destinations.' - -migrate_plus.destination.config: - type: migrate_destination - label: 'Config' - mapping: - config_name: - type: string - label: 'Configuration name' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.process.schema.yml b/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.process.schema.yml deleted file mode 100644 index 7b90a3d4e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.process.schema.yml +++ /dev/null @@ -1,145 +0,0 @@ -# Schema for the migrate process plugins. - -migrate_plus.process.*: - type: migrate_process - label: 'Default process' - -migrate_plus.process.callback: - type: migrate_process - label: 'Callback process' - mapping: - callback: - type: string - label: 'Callback' - -migrate_plus.process.concat: - type: migrate_process - label: 'Concat process' - mapping: - delimiter: - type: string - label: 'Delimiter' - -migrate_plus.process.dedupe_entity: - type: migrate_process - label: 'Dedupe Entity process' - mapping: - entity_type: - type: string - label: 'Entity type' - field: - type: string - label: 'Field name' - postfix: - type: string - label: 'Postfix' - start: - type: integer - label: 'Start' - length: - type: integer - label: 'Length' - -migrate_plus.process.explode: - type: migrate_process - label: 'Explode process' - mapping: - delimiter: - type: string - label: 'Delimiter' - limit: - type: integer - label: 'Limit' - -migrate_plus.process.extract: - type: migrate_process - label: 'Extract process' - mapping: - default: - type: string - label: 'Default value' - -migrate_plus.process.flatten: - type: migrate_process - label: 'Flatten process' - -migrate_plus.process.get: - type: migrate_process - label: 'Get process' - mapping: - source: - type: string - label: 'Source key' - -migrate_plus.process.sub_process: - type: migrate_process - label: 'Sub process' - mapping: - process: - type: ignore - label: 'Process' - key: - type: string - label: 'Key' - -migrate_plus.process.machine_name: - type: migrate_process - label: 'Machine name process' - -migrate_plus.process.migration: - type: migrate_process - label: 'Migration process' - mapping: - migration: - type: sequence - label: 'Migration' - source: - type: sequence - label: 'Source keys' - source_ids: - type: string - label: 'Source IDs' - stub_id: - type: string - label: 'Stub ID' - -migrate_plus.process.route: - type: migrate_process - label: 'Route process' - -migrate_plus.process.skip_on_empty: - type: migrate_process - label: 'Skip on Empty' - -migrate_plus.process.skip_row_if_not_set: - type: migrate_process - label: 'Skip Row process if not set' - mapping: - index: - type: integer - label: 'Index' - -migrate_plus.process.static_map: - type: migrate_process - label: 'Static Map' - mapping: - map: - type: sequence - label: 'Map' - default_value: - type: string - label: 'Default value' - bypass: - type: boolean - label: 'Bypass lookup' - -migrate_plus.process.default_value: - type: migrate_process - label: 'Default value' - mapping: - strict: - type: boolean - label: 'Strict type check' - default_value: - type: string - label: 'Default value' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.schema.yml b/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.schema.yml deleted file mode 100644 index 33dc2e6e1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.schema.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Schema for the configuration files of the Migrate Plus module. - -migrate_plus.migration.*: - type: config_entity - label: 'Migration' - mapping: - id: - type: string - label: 'ID' - class: - type: string - label: 'Class' - field_plugin_method: - type: string - label: 'Field Plugin Method' - cck_plugin_method: - type: string - label: 'BC layer for Field Plugin Method' - migration_tags: - type: sequence - label: 'Migration Tags' - sequence: - type: string - label: 'Tag' - migration_group: - type: string - label: 'Group' - label: - type: label - label: 'Label' - source: - type: ignore - label: 'Source' - process: - type: ignore - label: 'Process' - destination: - type: ignore - label: 'Destination' - migration_dependencies: - type: mapping - label: 'Dependencies' - mapping: - required: - type: sequence - label: 'Required dependencies' - sequence: - type: string - label: 'Dependency' - optional: - type: sequence - label: 'Optional dependencies' - sequence: - type: string - label: 'Dependency' - -migrate_plus.migration_group.*: - type: config_entity - label: 'Migration Group' - mapping: - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - description: - type: string - label: 'Description' - source_type: - type: string - label: 'Source type' - module: - type: string - label: 'Dependent module' - shared_configuration: - type: ignore - label: 'Shared migration configuration' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.source.schema.yml b/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.source.schema.yml deleted file mode 100644 index 4117ea410..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/config/schema/migrate_plus.source.schema.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Schema for the migrate source plugins. - -migrate_plus.source.*: - type: migrate_source - label: 'Default source' - -migrate_plus.source.empty: - type: migrate_source_sql - label: 'Empty source' - mapping: - provider: - type: string - label: 'Provider' - -migrate_plus.source.embedded_data: - type: migrate_source - label: 'Embedded data source' - mapping: - data_rows: - type: sequence - label: 'Data rows' - sequence: - type: ignore - label: 'Data row' - ids: - type: sequence - label: 'Unique key' - sequence: - type: mapping - label: 'Key column' - mapping: - type: - type: string - label: 'Column type' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/drupalci.yml b/sites/all/modules/contrib/migrate/migrate_plus/drupalci.yml deleted file mode 100644 index 7286c3ba5..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/drupalci.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Learn to make one for your own drupal.org project: -# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing -build: - assessment: - validate_codebase: - phplint: - container_composer: - phpcs: - # phpcs will use core's specified version of Coder. - sniff-all-files: true - halt-on-fail: true - testing: - # run_tests task is executed several times in order of performance speeds. - # halt-on-fail can be set on the run_tests tasks in order to fail fast. - # suppress-deprecations is false in order to be alerted to usages of - # deprecated code. - run_tests.standard: - types: 'Simpletest,PHPUnit-Unit,PHPUnit-Kernel,PHPUnit-Functional' - testgroups: '--all' - suppress-deprecations: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/README.txt b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/README.txt deleted file mode 100644 index 431e22e9b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/README.txt +++ /dev/null @@ -1,111 +0,0 @@ -INTRODUCTION ------------- -The migrate_example module demonstrates how to implement custom migrations -for Drupal 8. It includes a group of "beer" migrations demonstrating a complete -simple migration scenario. - -THE BEER SITE -------------- -In this scenario, we have a beer aficionado site which stores its data in MySQL -tables - there are content items for each beer on the site, user accounts with -profile data, categories to classify the beers, and user-generated comments on -the beers. We want to convert this site to Drupal with just a few modifications -to the basic structure. - -To make the example as simple as to run as possible, the source data is placed -in tables directly in your Drupal database - in most real-world scenarios, your -source data will be in an external database. The migrate_example_setup submodule -creates and populates these tables, as well as configuring your Drupal 8 site -(creating a node type, vocabulary, fields, etc.) to receive the data. - -STRUCTURE ---------- -There are two primary components to this example: - -1. Migration configuration, in the migrations and config/install directories. - These YAML files describe the migration process and provide the mappings from - the source data to Drupal's destination entities. The difference between the - two possible directories: - - a. Files in the migrations directory provide configuration directly for the - migration plugins. The filenames are of the form .yml. This - approach is recommended when your migration configuration is fully hardcoded - and does not need to be overridden (e.g., you don't need to change the URL to - a source web service through an admin UI). While developing migrations, - changes to these files require at most a 'drush cr' to load your changes. - - b. Files in the config/install directory provide migration configuration as - configuration entities, and have names of the form - migrate_plus.migration..yml ("migration" because they define - entities of the "migration" type, and "migrate_plus" because that is the - module which implements the "migration" type). Migrations defined in this way - may have their configuration modified (in particular, through a web UI) by - loading the configuration entity, modifying its configuration, and saving the - entity. When developing, to get edits to the .yml files in config/install to - take effect in active configuration, use the config_devel module. - - Configuration in either type of file is identical - the only differences are - the directories and filenames. - -2. Source plugins, in src/Plugin/migrate/source. These are referenced from the - configuration files, and provide the source data to the migration processing - pipeline, as well as manipulating that data where necessary to put it into - a canonical form for migrations. - -UNDERSTANDING THE MIGRATIONS ----------------------------- -The YAML and PHP files are copiously documented in-line. To best understand -the concepts described in a more-or-less narrative form, it is recommended you -read the files in the following order: - -1. migrate_plus.migration_group.beer.yml -2. migrate_plus.migration.beer_term.yml -3. BeerTerm.php -4. migrate_plus.migration.beer_user.yml -5. BeerUser.php -6. migrate_plus.migration.beer_node.yml -7. BeerNode.php -8. beer_comment.yml -9. BeerComment.php - -RUNNING THE MIGRATIONS ----------------------- -The migrate_tools module (https://www.drupal.org/project/migrate_tools) provides -the tools you need to perform migration processes. At this time, the web UI only -provides status information - to perform migration operations, you need to use -the drush commands. - -# Enable the tools and the example module if you haven't already. -drush en -y migrate_tools,migrate_example - -# Look at the migrations. Just look at them. Notice that they are displayed in -# the order they will be run, which reflects their dependencies. For example, -# because the node migration references the imported terms and users, it must -# run after those migrations have been run. -drush ms # Abbreviation for migrate-status - -# Run the import operation for all the beer migrations. -drush mi --group=beer # Abbreviation for migrate-import - -# Look at what you've done! Also, visit the site and see the imported content, -# user accounts, etc. -drush ms - -# Look at the duplicate username message. -drush mmsg beer_user # Abbreviation for migrate-messages - -# Run the rollback operation for all the migrations (removing all the imported -# content, user accounts, etc.). Note that it will rollback the migrations in -# the opposite order as they were imported. -drush mr --group=beer # Abbreviation for migrate-rollback - -# You can import specific migrations. -drush mi beer_term,beer_user -# At this point, go look at your content listing - you'll see beer nodes named -# "Stub", generated from the user's favbeers references. - -drush mi beer_node,beer_comment -# Refresh your content listing - the stub nodes have been filled with real beer! - -# You can rollback specific migrations. -drush mr beer_comment,beer_node diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml deleted file mode 100644 index 7494d1f40..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Migration configuration for beer content. -id: beer_node -label: Beers of the world -migration_group: beer -migration_tags: - - example -source: - plugin: beer_node -destination: - plugin: entity:node -process: - # Hardcode the destination node type (bundle) as 'migrate_example_beer'. - type: - plugin: default_value - default_value: migrate_example_beer - title: name - nid: bid - uid: - plugin: migration_lookup - migration: beer_user - source: aid - sticky: - plugin: default_value - default_value: 0 - field_migrate_example_country: countries - field_migrate_example_beer_style: - plugin: migration_lookup - migration: beer_term - source: terms - # Some Drupal fields may have multiple components we may want to set - # separately. For example, text fields may have summaries (teasers) in - # addition to the full text value. We use / to separate the field name from - # the internal field value being set, and put it in quotes because / is a - # YAML special character. - 'body/value': body - 'body/summary': excerpt -# Our beer nodes have references to terms and users, so we want those to be -# imported first. We make that dependency explicit here - by putting those -# migrations under the 'required' key, we ensure that the tools will prevent -# us from running the beer_node migration unless the beer_term and beer_user -# migrations are complete (although we can override the dependency check by -# passing --force to the drush migrate-import command). We can also add -# 'optional' dependencies - these affect the order in which migrations are -# displayed, and run by default, but does not force you run them in that -# order. -# The general rule of thumb is that any migrations referenced by migration -# process plugins should be required here. -migration_dependencies: - required: - - beer_term - - beer_user -dependencies: - enforced: - module: - - migrate_example diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_term.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_term.yml deleted file mode 100644 index c091b63d7..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_term.yml +++ /dev/null @@ -1,91 +0,0 @@ -# A "migration" is, in technical terms, a plugin whose configuration describes -# how to read source data, process it (generally by mapping source fields to -# destination fields), and write it to Drupal. - -# The machine name for a migration, used to uniquely identify it. -id: beer_term - -# A human-friendly description of the migration. -label: Migrate style categories from the source database to taxonomy terms - -# The machine name of the group containing this migration (which contains shared -# configuration to be merged with our own configuration here). -migration_group: beer - -# The category or tag for the migration. -migration_tags: - - example - -# Every migration must have a source plugin, which controls the delivery of our -# source data. In this case, our source plugin has the name "beer_term", which -# Drupal resolves to the PHP class defined in -# src/Plugin/migrate/source/BeerTerm.php. -source: - plugin: beer_term - -# Every migration must also have a destination plugin, which handles writing -# the migrated data in the appropriate form for that particular kind of data. -# Most Drupal content is an "entity" of one type or another, and we need to -# specify what entity type we are populating (in this case, taxonomy terms). -# Unlike the source plugin (which is specific to our particular scenario), this -# destination plugin is implemented in Drupal itself. -destination: - plugin: entity:taxonomy_term - -# Here's the meat of the migration - the processing pipeline. This describes how -# each destination field is to be populated based on the source data. For each -# destination field, one or more process plugins may be invoked. -process: - # The simplest process plugin is named 'get' - it is the default plugin, so - # does not need to be explicitly named. It simply copies the source value - # (the 'style' field from the source database in this case) to the destination - # field (the taxonomy term 'name' field). You can see we simply copy the - # source 'details' field to destination 'description' field in the same way. - name: style - description: details - - # Here is a new plugin - default_value. In its simplest usage here, it is used - # to hard-code a destination value, the vid (vocabulary ID) our taxonomy terms - # should be assigned to. It's important to note that while above the right - # side of the mappings was a source field name, here the right side of the - # 'default_value:' line is an actual value. - vid: - plugin: default_value - default_value: migrate_example_beer_styles - - # Here's another new plugin - migration. When importing data from another - # system, typically the unique identifiers for items on the destination side - # are not the same as the identifiers were on the source side. For example, in - # our style data the term names are the unique identifiers for each term, - # while in Drupal each term is assigned a unique integer term ID (tid). When - # any such items are referenced in Drupal, the reference needs to be - # translated from the old ID ('ale') to the new ID (1). The migration - # framework keeps track of the relationships between source and destination - # IDs in map tables, and the migration plugin is the means of performing a - # lookup in those map tables during processing. - parent: - plugin: migration_lookup - # Here we reference the migration whose map table we're performing a lookup - # against. You'll note that in this case we're actually referencing this - # migration itself, since category parents are imported by the same - # migration. This works best when we're sure the parents are imported - # before the children, and in this case our source plugin is guaranteeing - # that. - migration: beer_term - # 'style_parent' is the parent reference field from the source data. The - # result of this plugin is that the destination 'parent' field is populated - # with the Drupal term ID of the referenced style (or NULL if style_parent - # was empty). - source: style_parent - -# We'll learn more about dependencies in beer_node - here, we leave them empty. -migration_dependencies: {} - -# By default, configuration entities (like this migration) are not automatically -# removed when the migration which installed them is uninstalled. To have your -# migrations uninstalled with your migration module, add an enforced dependency -# on your module. -dependencies: - enforced: - module: - - migrate_example diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_user.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_user.yml deleted file mode 100644 index d31b7253e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_user.yml +++ /dev/null @@ -1,107 +0,0 @@ -# Migration configuration for user accounts. We've described most of what goes -# into migration configuration in migrate_plus.migration.beer_term.yml, so won't -# repeat that here. -id: beer_user -label: Beer Drinkers of the world -migration_group: beer -migration_tags: - - example -source: - plugin: beer_user -destination: - plugin: entity:user -process: - pass: password - mail: email - init: email - status: status - roles: - plugin: default_value - default_value: 2 - - # Here's a new process plugin - dedupe_entity. Our source site allowed there - # to be multiple user accounts with the same username, but Drupal wants - # usernames to be unique. This plugin allows us to automatically generate - # unique usernames when we detect collisions. - name: - plugin: dedupe_entity - # The name of the source field containing the username. - source: username - # These next two settings identify the destination-side field to check for - # duplicates. They say "see if the incoming 'name' matches any existing - # 'name' field in any 'user' entity". - entity_type: user - field: name - # Finally, this specifies a string to use between the original value and the - # sequence number appended to make the value unique. Thus, the first 'alice' - # account gets the name 'alice' in Drupal, and the second one gets the name - # 'alice_1'. - postfix: _ - - # Another new process plugin - callback. This allows us to filter an incoming - # source value through an arbitrary PHP function. The function called must - # have one required argument. - created: - plugin: callback - # The 'registered' timestamp in the source data is a string of the form - # 'yyyy-mm-dd hh:mm:ss', but Drupal wants a UNIX timestamp for 'created'. - source: registered - callable: strtotime - - # Our source data only has a single timestamp value, 'registered', which we - # want to use for all four of Drupal's user timestamp fields. We could - # duplicate the callback plugin we used for 'created' above - but we have a - # shortcut. Putting an @ sign at the beginning of the source value indicates - # that it is to be interpreted as a *destination* field name instead of a - # *source* field name. Thus, if a value we need in more than one place - # requires some processing beyond simply copying it directly, we can perform - # that processing a single time and use the result in multiple places. - changed: '@created' - access: '@created' - login: '@created' - - # Yet another new process plugin - static_map. We're making a transformation - # in how we represent gender data - formerly it was integer values 0 for male - # and 1 for female, but in our modern Drupal site we will be making this a - # free-form text field, so we want to replace the obscure integers with - # simple strings. - field_migrate_example_gender: - plugin: static_map - # Specify the source field we're reading (containing 0's and 1's). - source: sex - # Tell it to transform 0 to 'Male', and 1 to 'Female'. - map: - 0: Male - 1: Female - # If the input is missing, leave the field empty. Without this, an empty - # or invalid source value would cause the user record to be skipped - # entirely. - bypass: true - - # This looks like a simple migration process plugin, but there's magic - # happening here. We import nodes after terms and users, because they have - # references to terms and users, so of course the terms and users must be - # migrated first - right? However, the favbeers field is a reference to the - # beer nodes which haven't yet been migrated - we have a circular relationship - # between users and nodes. The way the migration system resolves this - # situation is by creating "stubs". In this case, because no beer nodes have - # been created, each time a beer is looked up against the beer_node migration - # nothing is found, and by default the migration process plugin creates an - # empty stub node as a placeholder so the favbeers reference field has - # something to point to. The stub is recorded in the beer_node map table, so - # when that migration runs it knows that each incoming beer should overwrite - # its stub instead of creating a new node. - field_migrate_example_favbeers: - plugin: migration_lookup - source: beers - migration: beer_node - -migration_dependencies: {} - -# When a module is creating a custom content type it needs to add an -# enforced dependency to itself, otherwise the content type will persist -# after the module is disabled. See: https://www.drupal.org/node/2629516. -dependencies: - enforced: - module: - - migrate_example diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration_group.beer.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration_group.beer.yml deleted file mode 100644 index 7d802d3a9..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/config/install/migrate_plus.migration_group.beer.yml +++ /dev/null @@ -1,38 +0,0 @@ -# A "migration group" is - surprise! - a group of migrations. It is used to -# group migrations for display by our tools, and to perform operations on a -# specific set of migrations. It can also be used to hold any configuration -# common to those migrations, so it doesn't have to be duplicated in each one. - -# The machine name of the group, by which it is referenced in individual -# migrations. -id: beer - -# A human-friendly label for the group. -label: Beer Imports - -# More information about the group. -description: A few simple beer-related imports, to demonstrate how to implement migrations. - -# Short description of the type of source, e.g. "Drupal 6" or "WordPress". -source_type: Custom tables - -# Here we add any default configuration settings to be shared among all -# migrations in the group. For this example, the source tables are in the -# Drupal (default) database, but usually if your source data is in a -# database it will be external. -shared_configuration: - # Specifying 'source' here means that this configuration will be merged into - # the 'source' configuration of each migration. - source: - # A better practice for real-world migrations would be to add a database - # connection to your external database in settings.php and reference its - # key here. - key: default - -# As with the migration configuration (see beer_term), we add an enforced -# dependency so the migration_group configuration will be removed on module -# uninstall. -dependencies: - enforced: - module: - - migrate_example diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example.info.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example.info.yml deleted file mode 100644 index 4d87e172f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -type: module -name: Migrate Example -description: 'Examples of how Drupal 8 migration compares to previous versions.' -package: Examples -# core: 8.x -dependencies: - - drupal:migrate - - migrate_plus:migrate_example_setup - - migrate_plus:migrate_plus - - drupal:menu_ui - - drupal:path - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/comment.type.node_comments.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/comment.type.node_comments.yml deleted file mode 100644 index 07629a81a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/comment.type.node_comments.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: node_comments -label: 'Node comments' -target_entity_type_id: node -description: '' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.comment.node_comments.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.comment.node_comments.default.yml deleted file mode 100644 index fc6a78e41..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.comment.node_comments.default.yml +++ /dev/null @@ -1,30 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.node_comments - - field.field.comment.node_comments.comment_body - module: - - text -id: comment.node_comments.default -targetEntityType: comment -bundle: node_comments -mode: default -content: - author: - weight: -2 - comment_body: - type: text_textarea - weight: 11 - settings: - rows: 5 - placeholder: '' - third_party_settings: { } - subject: - type: string_textfield - weight: 10 - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.node.migrate_example_beer.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.node.migrate_example_beer.default.yml deleted file mode 100644 index 306af0e3f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_form_display.node.migrate_example_beer.default.yml +++ /dev/null @@ -1,87 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_beer.body - - field.field.node.migrate_example_beer.field_comments - - field.field.node.migrate_example_beer.field_migrate_example_beer_style - - field.field.node.migrate_example_beer.field_migrate_example_country - - field.field.node.migrate_example_beer.field_migrate_example_image - - node.type.migrate_example_beer - module: - - comment - - image - - text -id: node.migrate_example_beer.default -targetEntityType: node -bundle: migrate_example_beer -mode: default -content: - body: - type: text_textarea_with_summary - weight: 6 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 2 - settings: { } - third_party_settings: { } - field_comments: - weight: 10 - settings: { } - third_party_settings: { } - type: comment_default - field_migrate_example_beer_style: - weight: 7 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - field_migrate_example_country: - weight: 8 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - field_migrate_example_image: - weight: 9 - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - type: image_image - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 3 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 4 - third_party_settings: { } - title: - type: string_textfield - weight: 0 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 1 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.comment.node_comments.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.comment.node_comments.default.yml deleted file mode 100644 index 38e2b4339..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.comment.node_comments.default.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.node_comments - - field.field.comment.node_comments.comment_body - module: - - text -id: comment.node_comments.default -targetEntityType: comment -bundle: node_comments -mode: default -content: - comment_body: - label: hidden - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - links: - weight: 100 -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.default.yml deleted file mode 100644 index 3a751080d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.default.yml +++ /dev/null @@ -1,60 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_beer.body - - field.field.node.migrate_example_beer.field_comments - - field.field.node.migrate_example_beer.field_migrate_example_beer_style - - field.field.node.migrate_example_beer.field_migrate_example_country - - field.field.node.migrate_example_beer.field_migrate_example_image - - node.type.migrate_example_beer - module: - - comment - - image - - text - - user -id: node.migrate_example_beer.default -targetEntityType: node -bundle: migrate_example_beer -mode: default -content: - body: - label: hidden - type: text_default - weight: 2 - settings: { } - third_party_settings: { } - field_comments: - weight: 5 - label: above - settings: - pager_id: 0 - third_party_settings: { } - type: comment_default - field_migrate_example_beer_style: - weight: 3 - label: above - settings: - link: true - third_party_settings: { } - type: entity_reference_label - field_migrate_example_country: - weight: 4 - label: above - settings: - link_to_entity: false - third_party_settings: { } - type: string - field_migrate_example_image: - weight: 1 - label: above - settings: - image_style: '' - image_link: '' - third_party_settings: { } - type: image - links: - weight: 0 - settings: { } - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.teaser.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.teaser.yml deleted file mode 100644 index dfc388bd2..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/core.entity_view_display.node.migrate_example_beer.teaser.yml +++ /dev/null @@ -1,35 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.migrate_example_beer.body - - field.field.node.migrate_example_beer.field_comments - - field.field.node.migrate_example_beer.field_migrate_example_beer_style - - field.field.node.migrate_example_beer.field_migrate_example_country - - field.field.node.migrate_example_beer.field_migrate_example_image - - node.type.migrate_example_beer - module: - - text - - user -id: node.migrate_example_beer.teaser -targetEntityType: node -bundle: migrate_example_beer -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 1 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 0 - settings: { } - third_party_settings: { } -hidden: - field_comments: true - field_migrate_example_beer_style: true - field_migrate_example_country: true - field_migrate_example_image: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.comment.node_comments.comment_body.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.comment.node_comments.comment_body.yml deleted file mode 100644 index 844c7965a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.comment.node_comments.comment_body.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.node_comments - - field.storage.comment.comment_body - module: - - text -id: comment.node_comments.comment_body -field_name: comment_body -entity_type: comment -bundle: node_comments -label: Comment -description: '' -required: true -translatable: true -default_value: { } -default_value_callback: '' -settings: { } -field_type: text_long diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.body.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.body.yml deleted file mode 100644 index 6e54441f0..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.body.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.migrate_example_beer - module: - - text -id: node.migrate_example_beer.body -field_name: body -entity_type: node -bundle: migrate_example_beer -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_comments.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_comments.yml deleted file mode 100644 index 04a9900a1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_comments.yml +++ /dev/null @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_comments - - node.type.migrate_example_beer - module: - - comment -id: node.migrate_example_beer.field_comments -field_name: field_comments -entity_type: node -bundle: migrate_example_beer -label: Comments -description: '' -required: false -translatable: false -default_value: - - - status: 2 - cid: 0 - last_comment_timestamp: 0 - last_comment_name: null - last_comment_uid: 0 - comment_count: 0 -default_value_callback: '' -settings: - default_mode: 1 - per_page: 50 - anonymous: 0 - form_location: true - preview: 1 -field_type: comment diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_beer_style.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_beer_style.yml deleted file mode 100644 index a5cb27ae6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_beer_style.yml +++ /dev/null @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_beer_style - - node.type.migrate_example_beer - - taxonomy.vocabulary.migrate_example_beer_styles -id: node.migrate_example_beer.field_migrate_example_beer_style -field_name: field_migrate_example_beer_style -entity_type: node -bundle: migrate_example_beer -label: 'Migrate Example Beer Styles' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_beer_styles: migrate_example_beer_styles - sort: - field: _none - auto_create: false -field_type: entity_reference diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_country.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_country.yml deleted file mode 100644 index 4a0a525a7..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_country.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_country - - node.type.migrate_example_beer -id: node.migrate_example_beer.field_migrate_example_country -field_name: field_migrate_example_country -entity_type: node -bundle: migrate_example_beer -label: Countries -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_image.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_image.yml deleted file mode 100644 index 5337e4e96..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.node.migrate_example_beer.field_migrate_example_image.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_image - - node.type.migrate_example_beer - module: - - image -id: node.migrate_example_beer.field_migrate_example_image -field_name: field_migrate_example_image -entity_type: node -bundle: migrate_example_beer -label: Image -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: '' - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - alt_field_required: false - title_field: false - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_favbeers.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_favbeers.yml deleted file mode 100644 index b85f3b62f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_favbeers.yml +++ /dev/null @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.user.field_migrate_example_favbeers - - node.type.migrate_example_beer - module: - - user -id: user.user.field_migrate_example_favbeers -field_name: field_migrate_example_favbeers -entity_type: user -bundle: user -label: 'Favorite Beers' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:node' - handler_settings: - target_bundles: - migrate_example_beer: migrate_example_beer - sort: - field: title - direction: ASC -field_type: entity_reference diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_gender.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_gender.yml deleted file mode 100644 index c3dff123d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.field.user.user.field_migrate_example_gender.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.user.field_migrate_example_gender - module: - - user -id: user.user.field_migrate_example_gender -field_name: field_migrate_example_gender -entity_type: user -bundle: user -label: Gender -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_comments.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_comments.yml deleted file mode 100644 index fd01476fe..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_comments.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - comment - - node -id: node.field_comments -field_name: field_comments -entity_type: node -type: comment -settings: - comment_type: node_comments -module: comment -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_beer_style.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_beer_style.yml deleted file mode 100644 index 9a037d7d6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_beer_style.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_beer_style -field_name: field_migrate_example_beer_style -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_country.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_country.yml deleted file mode 100644 index 7f2ca7603..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_country.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_migrate_example_country -field_name: field_migrate_example_country -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_image.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_image.yml deleted file mode 100644 index db02f1626..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.node.field_migrate_example_image.yml +++ /dev/null @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_migrate_example_image -field_name: field_migrate_example_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_favbeers.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_favbeers.yml deleted file mode 100644 index 54bbe12c5..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_favbeers.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user -id: user.field_migrate_example_favbeers -field_name: field_migrate_example_favbeers -entity_type: user -type: entity_reference -settings: - target_type: node -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_gender.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_gender.yml deleted file mode 100644 index 34fcc9032..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/field.storage.user.field_migrate_example_gender.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user -id: user.field_migrate_example_gender -field_name: field_migrate_example_gender -entity_type: user -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/node.type.migrate_example_beer.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/node.type.migrate_example_beer.yml deleted file mode 100644 index 24c2e1da5..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/node.type.migrate_example_beer.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -name: Beer -type: migrate_example_beer -description: 'Beer is what we drink.' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/taxonomy.vocabulary.migrate_example_beer_styles.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/taxonomy.vocabulary.migrate_example_beer_styles.yml deleted file mode 100644 index afad4b0dd..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/config/install/taxonomy.vocabulary.migrate_example_beer_styles.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Beer Styles' -vid: migrate_example_beer_styles -description: 'Use tags to group beers on similar topics into categories.' -hierarchy: 0 -weight: 0 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.info.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.info.yml deleted file mode 100644 index 1b9d0d402..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.info.yml +++ /dev/null @@ -1,18 +0,0 @@ -type: module -name: Migrate Example Setup -description: 'Separate site configuration for the example from the actual migration.' -package: Migration -# core: 8.x -hidden: 1 -dependencies: - - drupal:comment - - drupal:image - - drupal:text - - drupal:options - - drupal:taxonomy - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.install b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.install deleted file mode 100644 index e0a5fe65f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrate_example_setup/migrate_example_setup.install +++ /dev/null @@ -1,502 +0,0 @@ - 'Beers of the world.', - 'fields' => [ - 'bid' => [ - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Beer ID.', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ], - 'body' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Full description of the beer.', - ], - 'excerpt' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Abstract for this beer.', - ], - 'countries' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Countries of origin. Multiple values, delimited by pipe', - ], - 'aid' => [ - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Account Id of the author.', - ], - 'image' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image path', - ], - 'image_alt' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image ALT', - ], - 'image_title' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image title', - ], - 'image_description' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image description', - ], - ], - 'primary key' => ['bid'], - ]; -} - -/** - * The hook_schema definition for topic. - * - * @return array - * The schema definition. - */ -function migrate_example_beer_schema_topic() { - return [ - 'description' => 'Categories', - 'fields' => [ - 'style' => [ - 'type' => 'varchar_ascii', - 'length' => 255, - 'not null' => TRUE, - ], - 'details' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ], - 'style_parent' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Parent topic, if any', - ], - 'region' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Region first associated with this style', - ], - 'hoppiness' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Relative hoppiness of the beer', - ], - ], - 'primary key' => ['style'], - ]; -} - -/** - * The hook_schema definition for topic node. - * - * @return array - * The schema definition. - */ -function migrate_example_beer_schema_topic_node() { - return [ - 'description' => 'Beers topic pairs.', - 'fields' => [ - 'bid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Beer ID.', - ], - 'style' => [ - 'type' => 'varchar_ascii', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Topic name', - ], - ], - 'primary key' => ['style', 'bid'], - ]; -} - -/** - * The hook_schema definition for comment. - * - * @return array - * The schema definition. - */ -function migrate_example_beer_schema_comment() { - return [ - 'description' => 'Beers comments.', - 'fields' => [ - 'cid' => [ - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Comment ID.', - ], - 'bid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Beer ID that is being commented upon', - ], - 'cid_parent' => [ - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Parent comment ID in case of comment replies.', - ], - 'subject' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment subject', - ], - 'body' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment body', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment name (if anon)', - ], - 'mail' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment email (if anon)', - ], - 'aid' => [ - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Account ID (if any).', - ], - ], - 'primary key' => ['cid'], - ]; -} - -/** - * The hook_schema definition for account. - * - * @return array - * The schema definition. - */ -function migrate_example_beer_schema_account() { - return [ - 'description' => 'Beers accounts.', - 'fields' => [ - 'aid' => [ - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Account ID', - ], - 'status' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Blocked_Allowed', - ], - 'registered' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Registration date', - ], - 'username' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account name (for login)', - ], - 'nickname' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account name (for display)', - ], - 'password' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account password (raw)', - ], - 'email' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account email', - ], - 'sex' => [ - 'type' => 'int', - 'not null' => FALSE, - 'description' => 'Gender (0 for male, 1 for female)', - ], - 'beers' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Favorite Beers', - ], - ], - 'primary key' => ['aid'], - ]; -} - -/** - * Populate node table. - */ -function migrate_example_beer_data_node() { - $fields = [ - 'bid', - 'name', - 'body', - 'excerpt', - 'countries', - 'aid', - 'image', - 'image_alt', - 'image_title', - 'image_description', - ]; - $query = \Drupal::database()->insert('migrate_example_beer_node') - ->fields($fields); - // Use high bid numbers to avoid overwriting an existing node id. - $data = [ - // Comes with migrate_example project. - [ - 99999999, - 'Heineken', - 'Blab Blah Blah Green', - 'Green', - 'Netherlands|Belgium', - 0, - 'heineken.jpg', - 'Heinekin alt', - 'Heinekin title', - 'Heinekin description', - ], - [ - 99999998, - 'Miller Lite', - 'We love Miller Brewing', - 'Tasteless', - 'USA|Canada', - 1, - NULL, - NULL, - NULL, - NULL, - ], - [ - 99999997, - 'Boddington', - 'English occasionally get something right', - 'A treat', - 'United Kingdom', - 1, - NULL, - NULL, - NULL, - NULL, - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate account table. - * - * Note that alice has duplicate username. Exercises dedupe_entity plugin. - * TODO duplicate email also. - */ -function migrate_example_beer_data_account() { - $fields = [ - 'status', - 'registered', - 'username', - 'nickname', - 'password', - 'email', - 'sex', - 'beers', - ]; - $query = \Drupal::database()->insert('migrate_example_beer_account') - ->fields($fields); - $data = [ - [ - 1, - '2010-03-30 10:31:05', - 'alice', - 'alice in beerland', - 'alicepass', - 'alice@example.com', - '1', - '99999999|99999998|99999997', - ], - [ - 1, - '2010-04-04 10:31:05', - 'alice', - 'alice in aleland', - 'alicepass', - 'alice2@example.com', - '1', - '99999999|99999998|99999997', - ], - [ - 0, - '2007-03-15 10:31:05', - 'bob', - 'rebob', - 'bobpass', - 'bob@example.com', - '0', - '99999999|99999997', - ], - [ - 1, - '2004-02-29 10:31:05', - 'charlie', - 'charlie chocolate', - 'mykids', - 'charlie@example.com', - '0', - '99999999|99999998', - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate comment table. - */ -function migrate_example_beer_data_comment() { - $fields = ['bid', 'cid_parent', 'subject', 'body', 'name', 'mail', 'aid']; - $query = \Drupal::database()->insert('migrate_example_beer_comment') - ->fields($fields); - $data = [ - [99999998, NULL, 'im first', 'full body', 'alice', 'alice@example.com', 0], - [99999998, NULL, 'im second', 'aromatic', 'alice', 'alice@example.com', 0], - [99999999, NULL, 'im parent', 'malty', 'alice', 'alice@example.com', 0], - [99999999, 1, 'im child', 'cold body', 'bob', NULL, 1], - [ - 99999999, - 4, - 'im grandchild', - 'bitter body', - 'charlie@example.com', - NULL, - 1, - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate topic table. - */ -function migrate_example_beer_data_topic() { - $fields = ['style', 'details', 'style_parent', 'region', 'hoppiness']; - $query = \Drupal::database()->insert('migrate_example_beer_topic') - ->fields($fields); - $data = [ - ['ale', 'traditional', NULL, 'Medieval British Isles', 'Medium'], - ['red ale', 'colorful', 'ale', NULL, NULL], - [ - 'pilsner', - 'refreshing', - NULL, - 'Pilsen, Bohemia (now Czech Republic)', - 'Low', - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate topic node table. - */ -function migrate_example_beer_data_topic_node() { - $fields = ['bid', 'style']; - $query = \Drupal::database()->insert('migrate_example_beer_topic_node') - ->fields($fields); - $data = [ - [99999999, 'pilsner'], - [99999999, 'red ale'], - [99999998, 'red ale'], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrations/beer_comment.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrations/beer_comment.yml deleted file mode 100644 index 3540ab69d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/migrations/beer_comment.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Migration configuration for beer comments. No new concepts here. -id: beer_comment -label: Comments on beers -migration_group: beer -source: - plugin: beer_comment -destination: - plugin: entity:comment -process: - pid: - plugin: migration_lookup - migration: beer_comment - source: cid_parent - entity_id: - plugin: migration_lookup - migration: beer_node - source: bid - entity_type: - plugin: default_value - default_value: node - field_name: - plugin: default_value - default_value: field_comments - comment_type: - plugin: default_value - default_value: node_comments - subject: subject - uid: - plugin: migration_lookup - migration: beer_user - source: aid - name: name - mail: mail - status: - plugin: default_value - default_value: 1 - 'comment_body/value': body -migration_dependencies: - required: - - beer_node - - beer_user -dependencies: - enforced: - module: - - migrate_example diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerComment.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerComment.php deleted file mode 100644 index b5d446a3f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerComment.php +++ /dev/null @@ -1,65 +0,0 @@ -select('migrate_example_beer_comment', 'mec') - ->fields('mec', $fields) - ->orderBy('cid_parent', 'ASC'); - return $query; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'cid' => $this->t('Comment ID'), - 'cid_parent' => $this->t('Parent comment ID in case of comment replies'), - 'name' => $this->t('Comment name (if anon)'), - 'mail' => $this->t('Comment email (if anon)'), - 'aid' => $this->t('Account ID (if any)'), - 'bid' => $this->t('Beer ID that is being commented upon'), - 'subject' => $this->t('Comment subject'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return [ - 'cid' => [ - 'type' => 'integer', - 'alias' => 'mec', - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerNode.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerNode.php deleted file mode 100644 index 40ac4df29..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerNode.php +++ /dev/null @@ -1,105 +0,0 @@ -select('migrate_example_beer_node', 'b') - ->fields('b', $fields); - return $query; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'bid' => $this->t('Beer ID'), - 'name' => $this->t('Name of beer'), - 'body' => $this->t('Full description of the beer'), - 'excerpt' => $this->t('Abstract for this beer'), - 'aid' => $this->t('Account ID of the author'), - 'countries' => $this->t('Countries of origin. Multiple values, delimited by pipe'), - 'image' => $this->t('Image path'), - 'image_alt' => $this->t('Image ALT'), - 'image_title' => $this->t('Image title'), - 'image_description' => $this->t('Image description'), - // Note that this field is not part of the query above - it is populated - // by prepareRow() below. You should document all source properties that - // are available for mapping after prepareRow() is called. - 'terms' => $this->t('Applicable styles'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return [ - 'bid' => [ - 'type' => 'integer', - 'alias' => 'b', - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - // As explained above, we need to pull the style relationships into our - // source row here, as an array of 'style' values (the unique ID for - // the beer_term migration). - $terms = $this->select('migrate_example_beer_topic_node', 'bt') - ->fields('bt', ['style']) - ->condition('bid', $row->getSourceProperty('bid')) - ->execute() - ->fetchCol(); - $row->setSourceProperty('terms', $terms); - - // As we did for favorite beers in the user migration, we need to explode - // the multi-value country names. - if ($value = $row->getSourceProperty('countries')) { - $row->setSourceProperty('countries', explode('|', $value)); - } - return parent::prepareRow($row); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerTerm.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerTerm.php deleted file mode 100644 index 5eb3e70f3..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerTerm.php +++ /dev/null @@ -1,84 +0,0 @@ -select() call - this ensures - // that the query is executed against the database configured for this - // source plugin. - $fields = ['style', 'details', 'style_parent', 'region', 'hoppiness']; - return $this->select('migrate_example_beer_topic', 'met') - ->fields('met', $fields) - // We sort this way to ensure parent terms are imported first. - ->orderBy('style_parent', 'ASC'); - } - - /** - * {@inheritdoc} - */ - public function fields() { - // This method simply documents the available source fields provided by the - // source plugin, for use by front-end tools. It returns an array keyed by - // field/column name, with the value being a translated string explaining - // to humans what the field represents. - $fields = [ - 'style' => $this->t('Beer style'), - 'details' => $this->t('Style details'), - 'style_parent' => $this->t('Parent style'), - // These values are not currently migrated - it's OK to skip fields you - // don't need. - 'region' => $this->t('Region the style is associated with'), - 'hoppiness' => $this->t('Hoppiness of the style'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - // This method indicates what field(s) from the source row uniquely identify - // that source row, and what their types are. This is critical information - // for managing the migration. The keys of the returned array are the field - // names from the query which comprise the unique identifier. The values are - // arrays indicating the type of the field, used for creating compatible - // columns in the map tables that track processed items. - return [ - 'style' => [ - 'type' => 'string', - // 'alias' is the alias for the table containing 'style' in the query - // defined above. Optional in this case, but necessary if the same - // column may occur in multiple tables in a join. - 'alias' => 'met', - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerUser.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerUser.php deleted file mode 100644 index 398f87c69..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example/src/Plugin/migrate/source/BeerUser.php +++ /dev/null @@ -1,90 +0,0 @@ -select('migrate_example_beer_account', 'mea') - ->fields('mea', $fields); - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'aid' => $this->t('Account ID'), - 'status' => $this->t('Blocked/Allowed'), - 'registered' => $this->t('Registered date'), - 'username' => $this->t('Account name (for login)'), - 'nickname' => $this->t('Account name (for display)'), - 'password' => $this->t('Account password (raw)'), - 'email' => $this->t('Account email'), - 'sex' => $this->t('Gender'), - 'beers' => $this->t('Favorite beers, pipe-separated'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return [ - 'aid' => [ - 'type' => 'integer', - 'alias' => 'mea', - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function prepareRow(Row $row) { - // A prepareRow() is the most common place to perform custom run-time - // processing that isn't handled by an existing process plugin. It is called - // when the raw data has been pulled from the source, and provides the - // opportunity to modify or add to that data, creating the canonical set of - // source data that will be fed into the processing pipeline. - // In our particular case, the list of a user's favorite beers is a pipe- - // separated list of beer IDs. The processing pipeline deals with arrays - // representing multi-value fields naturally, so we want to explode that - // string to an array of individual beer IDs. - if ($value = $row->getSourceProperty('beers')) { - $row->setSourceProperty('beers', explode('|', $value)); - } - // Always call your parent! Essential processing is performed in the base - // class. Be mindful that prepareRow() returns a boolean status - if FALSE - // that indicates that the item being processed should be skipped. Unless - // we're deciding to skip an item ourselves, let the parent class decide. - return parent::prepareRow($row); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/README.txt b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/README.txt deleted file mode 100644 index 8d5a25d80..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/README.txt +++ /dev/null @@ -1,58 +0,0 @@ -INTRODUCTION ------------- -The migrate_example_advanced module demonstrates some techniques for Drupal 8 -migrations beyond the basics in migrate_example. It includes a group of -migrations with a wine theme. - -SETUP ------ -To demonstrate XML migrations as realistically as possible, the setup module -provides the source data as REST services. So the migrations' references to these -services can be set up accurately, if you install migrate_example_advanced via -drush be sure to use the --uri parameter, e.g. - -drush en -y migrate_example_advanced --uri=http://d8.local:8083/ - -THE WINE SITE -------------- -In this scenario, we have a wine aficionado site which stores data in SQL tables -as well is pulling in additional data from XML services. - -To make the example as simple as to run as possible, the SQL data is placed in -tables directly in your Drupal database - in most real-world scenarios, your -source data will be in an external database. The migrate_example_advanced_setup -submodule creates and populates these tables, as well as configuring your Drupal -8 site (creating node types, vocabularies, fields, etc.) to receive the data, -and providing service endpoints for XML data. - -STRUCTURE ---------- -As with most custom migrations, there are two primary components to this -example: - -1. Migration configuration, in the config/install directory. These YAML files - describe the migration process and provide the mappings from the source data - to Drupal's destination entities. - -2. Source plugins, in src/Plugin/migrate/source. These are referenced from the - configuration files, and provide the source data to the migration processing - pipeline, as well as manipulating that data where necessary to put it into - a canonical form for migrations. - -UNDERSTANDING THE MIGRATIONS ----------------------------- -Basic techniques demonstrated in the migrate_example module are not rehashed -here - it is expected that if you are learning Drupal 8 migration, you will -study and understand those examples first, and use migrate_example_advanced to -learn about specific techniques beyond those basics. This example doesn't have -the narrative form of migrate_example - it's more of a grab-bag demonstrating -varous features, and is more of a reference for, say, copying the code to set -up an XML migration. An index of things demonstrated by this module: - -Multiple vocabularies populated in one migration ------------------------------------------------- -See migrate_plus.migration.wine_terms.yml. - -Importing from XML services ---------------------------- -See migrate_plus.migration.wine_role_xml.yml. diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.weather_soap.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.weather_soap.yml deleted file mode 100755 index 328bcca84..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.weather_soap.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This migration demonstrates importing from SOAP/WSDL. -id: weather_soap -label: SOAP service providing weather. -migration_group: wine -migration_tags: - - advanced example -source: - # We use the SOAP parser source plugin. - plugin: url - data_fetcher_plugin: http # Ignored - SoapClient does the fetching. - data_parser_plugin: soap - # URL of a WSDL endpoint. - urls: - - http://www.webservicex.net/globalweather.asmx?WSDL - # The function to call on the service, and the parameters to pass. See - # http://www.webservicex.net/New/Home/ServiceDetail/56 for the XML structure - # of this feed - how CountryName is passed within the GetCitiesByCountry - # XML element. - function: GetCitiesByCountry - parameters: - CountryName: Spain - # Responses may be returned as an XML string, an object, or an array - specify - # the type of response here. - response_type: xml - # Looking at the XML response at http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry, - # we see that the data items we want are within . - item_selector: /NewDataSet/Table - # For each field, 'name' is the source property name to be used in the process - # steps below, 'label' is optional (to document the property), and selector - # is an xpath (-like, for array and object returns) string relative to the - # item_selector for retrieving that data value. - fields: - - - name: Country - label: Country - selector: Country - - - name: City - label: City - selector: City - # 'ids' tells us what source property ('City') holds the unique identifying - # value for each imported item, and what schema type to use to hold that - # value in the migration map an message tables. - ids: - City: - type: string -process: - vid: - plugin: default_value - default_value: migrate_example_wine_varieties - name: City -destination: - plugin: entity:taxonomy_term -migration_dependencies: - required: {} - optional: {} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.yml deleted file mode 100755 index d7d3953af..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.yml +++ /dev/null @@ -1,58 +0,0 @@ -# This migration demonstrates importing from a monolithic JSON file. -id: wine_role_json -label: JSON feed of roles (positions) -migration_group: wine -migration_tags: - - advanced example -source: - # We use the JSON source plugin. - plugin: url - data_fetcher_plugin: http - data_parser_plugin: json - # The data_parser normally limits the fields passed on to the source plugin - # to fields configured to be used as part of the migration. To support more - # dynamic migrations, the JSON data parser supports including the original - # data for the current row. Simply include the 'include_raw_data' flag set - # to `true` to enable this. This option is disabled by default to minimize - # memory footprint for migrations that do not need this capability. - # include_raw_data: true - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: - - /migrate_example_advanced_position?_format=json - # An xpath-like selector corresponding to the items to be imported. - item_selector: position - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_selector. - fields: - - - name: machine_name - label: 'Unique position identifier' - selector: sourceid - - - name: friendly_name - label: 'Position name' - selector: name - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - machine_name: - type: string -process: - # Note that the source field names here (machine_name and friendly_name) were - # defined by the 'fields' configuration for the source plugin above. - id: machine_name - label: friendly_name -destination: - plugin: entity:user_role -migration_dependencies: {} -dependencies: - enforced: - module: - - migrate_example_advanced diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_xml.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_xml.yml deleted file mode 100755 index b5032a4f1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_xml.yml +++ /dev/null @@ -1,54 +0,0 @@ -# This migration demonstrates importing from a monolithic XML file. -id: wine_role_xml -label: XML feed of roles (positions) -migration_group: wine -migration_tags: - - advanced example -source: - # We use the XML data parser plugin. - plugin: url - data_fetcher_plugin: http - data_parser_plugin: xml - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: - - /migrate_example_advanced_position?_format=xml - # Visit the URL above (relative to your site root) and look at it. You can see - # that is the outer element, and each item we want to import is a - # element. The item_xpath value is the xpath to use to query the - # desired elements. - item_selector: /response/position - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_xpath. - fields: - - - name: machine_name - label: 'Unique position identifier' - selector: sourceid - - - name: friendly_name - label: 'Position name' - selector: name - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - machine_name: - type: string -process: - # Note that the source field names here (machine_name and friendly_name) were - # defined by the 'fields' configuration for the source plugin above. - id: machine_name - label: friendly_name -destination: - plugin: entity:user_role -migration_dependencies: {} -dependencies: - enforced: - module: - - migrate_example_advanced diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml deleted file mode 100644 index 56eb27386..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml +++ /dev/null @@ -1,39 +0,0 @@ -id: wine_terms -label: Migrate all categories into Drupal taxonomy terms -migration_group: wine -migration_tags: - - advanced example -source: - plugin: wine_term -destination: - plugin: entity:taxonomy_term -process: - name: name - description: details - # Usually, one wants to have a separate migration for each entity_type/bundle - # combination - e.g., separate migrations for articles and blog posts, as - # opposed to a single monolithic node migration. This affords maximum - # control - the ability to import just one bundle at a time, and most - # importantly to have distinct field mappings (because different node types - # usually have different fields). In this case, though, because all of the - # vocabularies we're importing come from a common table, and on the Drupal - # side there are no distinct custom fields, we are able to import them all in - # one migration. The static_map tells the migration in which vocabulary to - # place each term, based on the incoming 'type' column. - vid: - plugin: static_map - source: type - map: - best_with: migrate_example_wine_best_with - region: migrate_example_wine_regions - variety: migrate_example_wine_varieties - parent: - plugin: migration_lookup - migration: wine_terms - source: category_parent - weight: ordering -migration_dependencies: {} -dependencies: - enforced: - module: - - migrate_example_advanced diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_multi_xml.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_multi_xml.yml deleted file mode 100755 index a501a7e75..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_variety_multi_xml.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This migration demonstrates importing from multiple XML files. -id: wine_variety_multi_xml -label: XML feed of varieties -migration_group: wine -migration_tags: - - advanced example -source: - # We use the XML source plugin. - plugin: url - data_fetcher_plugin: http - data_parser_plugin: xml - # Normally, this is one or more fully-qualified URLs or file paths. Because - # we can't hardcode your local URL, we provide a relative path here which - # hook_install() will rewrite to a full URL for the current site. - urls: - - /migrate_example_advanced_variety_multiple/red?_format=xml - - /migrate_example_advanced_variety_multiple/white?_format=xml - # Visit the URL above (relative to your site root) and look at it. You can see - # that is the outer element, and each item we want to import is a - # element. The item_xpath value is the xpath to use to query the - # desired elements. - item_selector: /response/variety - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_xpath. - fields: - - - name: category_name - label: Name - selector: name - - - name: category_details - label: Details - selector: details - - - name: category_parent - label: 'Unique position identifier' - selector: parent - - - name: category_attributes - label: 'List of variety attributes' - selector: attributes - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - category_name: - type: string -process: - vid: - plugin: default_value - default_value: migrate_example_wine_varieties - name: category_name - description: category_details - parent: - plugin: migration_lookup - migration: wine_terms - source: category_parent - field_variety_attributes: category_attributes -destination: - plugin: entity:taxonomy_term -migration_dependencies: - required: - - wine_terms -dependencies: - enforced: - module: - - migrate_example_advanced diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration_group.wine.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration_group.wine.yml deleted file mode 100644 index 5a14bf29b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration_group.wine.yml +++ /dev/null @@ -1,11 +0,0 @@ -id: wine -label: Wine Imports -description: A few wine-related imports, demonstrating some more advanced migration techniques. -source_type: Custom tables and XML -shared_configuration: - source: - key: default -dependencies: - enforced: - module: - - migrate_example_advanced diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0001.xml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0001.xml deleted file mode 100644 index a78c02bf0..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0001.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Lolonis Winery - Makers of Ladybug Red - 3 - Redwood Valley - diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0002.xml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0002.xml deleted file mode 100644 index 380113b92..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/0002.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Château Latour - Makers of grand vin Chateau Latour, Les Forts de Latour and Pauillac - 3 - Bordeaux - diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index.xml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index.xml deleted file mode 100644 index 28053984e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 0001 - diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index2.xml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index2.xml deleted file mode 100644 index 9dfa50022..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/data/index2.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 0002 - diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.info.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.info.yml deleted file mode 100644 index b18ee5a45..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -type: module -name: Migrate Example (Advanced) -description: 'Specialized examples of Drupal 8 migration.' -package: Examples -# core: 8.x -dependencies: - - drupal:migrate - - migrate_plus:migrate_example_advanced_setup - - migrate_plus:migrate_plus - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.install b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.install deleted file mode 100644 index 2023bdee1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced.install +++ /dev/null @@ -1,58 +0,0 @@ -get('source'); - $request = \Drupal::request(); - $urls = []; - foreach ($source['urls'] as $url) { - $urls[] = 'http://' . $request->getHttpHost() . $url; - } - $source['urls'] = $urls; - $wine_role_xml_migration->set('source', $source); - $wine_role_xml_migration->save(); - } - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $wine_role_json_migration */ - $wine_role_json_migration = Migration::load('wine_role_json'); - if ($wine_role_json_migration) { - $source = $wine_role_json_migration->get('source'); - $request = \Drupal::request(); - $urls = []; - foreach ($source['urls'] as $url) { - $urls[] = 'http://' . $request->getHttpHost() . $url; - } - $source['urls'] = $urls; - $wine_role_json_migration->set('source', $source); - $wine_role_json_migration->save(); - } - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $wine_variety_multi_xml_migration */ - $wine_variety_multi_xml_migration = Migration::load('wine_variety_multi_xml'); - if ($wine_variety_multi_xml_migration) { - $source = $wine_variety_multi_xml_migration->get('source'); - $request = \Drupal::request(); - $urls = []; - foreach ($source['urls'] as $url) { - $urls[] = 'http://' . $request->getHttpHost() . $url; - } - $source['urls'] = $urls; - $wine_variety_multi_xml_migration->set('source', $source); - $wine_variety_multi_xml_migration->save(); - } -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/comment.type.migrate_example_advanced_comment.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/comment.type.migrate_example_advanced_comment.yml deleted file mode 100644 index ba582793d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/comment.type.migrate_example_advanced_comment.yml +++ /dev/null @@ -1,7 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: migrate_example_advanced_comment -label: 'Node comments' -target_entity_type_id: node -description: '' diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.comment.migrate_example_advanced_comment.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.comment.migrate_example_advanced_comment.default.yml deleted file mode 100644 index 518664e2b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.comment.migrate_example_advanced_comment.default.yml +++ /dev/null @@ -1,30 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.migrate_example_advanced_comment - - field.field.comment.migrate_example_advanced_comment.comment_body - module: - - text -id: comment.migrate_example_advanced_comment.default -targetEntityType: comment -bundle: migrate_example_advanced_comment -mode: default -content: - author: - weight: -2 - comment_body: - type: text_textarea - weight: 11 - settings: - rows: 5 - placeholder: '' - third_party_settings: { } - subject: - type: string_textfield - weight: 10 - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_producer.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_producer.default.yml deleted file mode 100644 index 89df7690e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_producer.default.yml +++ /dev/null @@ -1,69 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_producer.body - - field.field.node.migrate_example_producer.field_migrate_example_wine_regio - - node.type.migrate_example_producer - module: - - path - - text -id: node.migrate_example_producer.default -targetEntityType: node -bundle: migrate_example_producer -mode: default -content: - body: - type: text_textarea_with_summary - weight: 31 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 10 - settings: { } - third_party_settings: { } - field_migrate_example_wine_regio: - weight: 32 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - path: - type: path - weight: 30 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - third_party_settings: { } - title: - type: string_textfield - weight: -5 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_wine.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_wine.default.yml deleted file mode 100644 index 0ef5edb66..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.node.migrate_example_wine.default.yml +++ /dev/null @@ -1,117 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_wine.body - - field.field.node.migrate_example_wine.field_migrate_example_comments - - field.field.node.migrate_example_wine.field_migrate_example_adv_image - - field.field.node.migrate_example_wine.field_migrate_example_top_vintag - - field.field.node.migrate_example_wine.field_migrate_example_wine_best - - field.field.node.migrate_example_wine.field_migrate_example_wine_ratin - - field.field.node.migrate_example_wine.field_migrate_example_wine_regio - - field.field.node.migrate_example_wine.field_migrate_example_wine_var - - node.type.migrate_example_wine - module: - - comment - - image - - path - - text -id: node.migrate_example_wine.default -targetEntityType: node -bundle: migrate_example_wine -mode: default -content: - body: - type: text_textarea_with_summary - weight: 31 - settings: - rows: 9 - summary_rows: 3 - placeholder: '' - third_party_settings: { } - created: - type: datetime_timestamp - weight: 10 - settings: { } - third_party_settings: { } - field_migrate_example_comments: - weight: 38 - settings: { } - third_party_settings: { } - type: comment_default - field_migrate_example_adv_image: - weight: 35 - settings: - progress_indicator: throbber - preview_image_style: thumbnail - third_party_settings: { } - type: image_image - field_migrate_example_top_vintag: - weight: 37 - settings: - placeholder: '' - third_party_settings: { } - type: number - field_migrate_example_wine_best: - weight: 34 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete_tags - field_migrate_example_wine_ratin: - weight: 36 - settings: - placeholder: '' - third_party_settings: { } - type: number - field_migrate_example_wine_regio: - weight: 33 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - field_migrate_example_wine_var: - weight: 32 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - path: - type: path - weight: 30 - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - third_party_settings: { } - title: - type: string_textfield - weight: -5 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.taxonomy_term.migrate_example_wine_varieties.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.taxonomy_term.migrate_example_wine_varieties.default.yml deleted file mode 100644 index 32bd69244..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_form_display.taxonomy_term.migrate_example_wine_varieties.default.yml +++ /dev/null @@ -1,41 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes - - taxonomy.vocabulary.migrate_example_wine_varieties - module: - - path - - text -id: taxonomy_term.migrate_example_wine_varieties.default -targetEntityType: taxonomy_term -bundle: migrate_example_wine_varieties -mode: default -content: - description: - type: text_textarea - weight: 1 - settings: - placeholder: '' - rows: 5 - third_party_settings: { } - field_variety_attributes: - type: string_textfield - weight: 3 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - name: - type: string_textfield - weight: 0 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - path: - type: path - weight: 2 - settings: { } - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.comment.migrate_example_advanced_comment.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.comment.migrate_example_advanced_comment.default.yml deleted file mode 100644 index b4b97f7de..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.comment.migrate_example_advanced_comment.default.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.migrate_example_advanced_comment - - field.field.comment.migrate_example_advanced_comment.comment_body - module: - - text -id: comment.migrate_example_advanced_comment.default -targetEntityType: comment -bundle: migrate_example_advanced_comment -mode: default -content: - comment_body: - label: hidden - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - links: - weight: 100 -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.default.yml deleted file mode 100644 index 90c620b9c..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.default.yml +++ /dev/null @@ -1,33 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_producer.body - - field.field.node.migrate_example_producer.field_migrate_example_wine_regio - - node.type.migrate_example_producer - module: - - text - - user -id: node.migrate_example_producer.default -targetEntityType: node -bundle: migrate_example_producer -mode: default -content: - body: - label: hidden - type: text_default - weight: 101 - settings: { } - third_party_settings: { } - field_migrate_example_wine_regio: - weight: 102 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - links: - weight: 100 - settings: { } - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.teaser.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.teaser.yml deleted file mode 100644 index ec5fcd544..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_producer.teaser.yml +++ /dev/null @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.migrate_example_producer.body - - field.field.node.migrate_example_producer.field_migrate_example_wine_regio - - node.type.migrate_example_producer - module: - - text - - user -id: node.migrate_example_producer.teaser -targetEntityType: node -bundle: migrate_example_producer -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 101 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 100 -hidden: - field_migrate_example_wine_regio: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.default.yml deleted file mode 100644 index 57ad1155e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.default.yml +++ /dev/null @@ -1,88 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.migrate_example_wine.body - - field.field.node.migrate_example_wine.field_migrate_example_comments - - field.field.node.migrate_example_wine.field_migrate_example_adv_image - - field.field.node.migrate_example_wine.field_migrate_example_top_vintag - - field.field.node.migrate_example_wine.field_migrate_example_wine_best - - field.field.node.migrate_example_wine.field_migrate_example_wine_ratin - - field.field.node.migrate_example_wine.field_migrate_example_wine_regio - - field.field.node.migrate_example_wine.field_migrate_example_wine_var - - node.type.migrate_example_wine - module: - - comment - - image - - text - - user -id: node.migrate_example_wine.default -targetEntityType: node -bundle: migrate_example_wine -mode: default -content: - body: - label: hidden - type: text_default - weight: 101 - settings: { } - third_party_settings: { } - field_migrate_example_comments: - weight: 108 - label: hidden - settings: - pager_id: 0 - third_party_settings: { } - type: comment_default - field_migrate_example_adv_image: - weight: 105 - label: hidden - settings: - image_style: '' - image_link: '' - third_party_settings: { } - type: image - field_migrate_example_top_vintag: - weight: 107 - label: inline - settings: - thousand_separator: '' - prefix_suffix: true - third_party_settings: { } - type: number_integer - field_migrate_example_wine_best: - weight: 104 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - field_migrate_example_wine_ratin: - weight: 106 - label: inline - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - field_migrate_example_wine_regio: - weight: 103 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - field_migrate_example_wine_var: - weight: 102 - label: inline - settings: - link: true - third_party_settings: { } - type: entity_reference_label - links: - weight: 100 - settings: { } - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.teaser.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.teaser.yml deleted file mode 100644 index 85874f7c9..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.node.migrate_example_wine.teaser.yml +++ /dev/null @@ -1,39 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.migrate_example_wine.body - - field.field.node.migrate_example_wine.field_migrate_example_comments - - field.field.node.migrate_example_wine.field_migrate_example_adv_image - - field.field.node.migrate_example_wine.field_migrate_example_top_vintag - - field.field.node.migrate_example_wine.field_migrate_example_wine_best - - field.field.node.migrate_example_wine.field_migrate_example_wine_ratin - - field.field.node.migrate_example_wine.field_migrate_example_wine_regio - - field.field.node.migrate_example_wine.field_migrate_example_wine_var - - node.type.migrate_example_wine - module: - - text - - user -id: node.migrate_example_wine.teaser -targetEntityType: node -bundle: migrate_example_wine -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 101 - settings: - trim_length: 600 - third_party_settings: { } - links: - weight: 100 -hidden: - field_migrate_example_comments: true - field_migrate_example_adv_image: true - field_migrate_example_top_vintag: true - field_migrate_example_wine_best: true - field_migrate_example_wine_ratin: true - field_migrate_example_wine_regio: true - field_migrate_example_wine_var: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.taxonomy_term.migrate_example_wine_varieties.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.taxonomy_term.migrate_example_wine_varieties.default.yml deleted file mode 100644 index b475708a7..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/core.entity_view_display.taxonomy_term.migrate_example_wine_varieties.default.yml +++ /dev/null @@ -1,27 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes - - taxonomy.vocabulary.migrate_example_wine_varieties - module: - - text -id: taxonomy_term.migrate_example_wine_varieties.default -targetEntityType: taxonomy_term -bundle: migrate_example_wine_varieties -mode: default -content: - description: - label: hidden - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - field_variety_attributes: - type: string - weight: 0 - label: inline - settings: - link_to_entity: false - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.comment.migrate_example_advanced_comment.comment_body.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.comment.migrate_example_advanced_comment.comment_body.yml deleted file mode 100644 index 456d6230f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.comment.migrate_example_advanced_comment.comment_body.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - comment.type.migrate_example_advanced_comment - - field.storage.comment.comment_body - module: - - text -id: comment.migrate_example_advanced_comment.comment_body -field_name: comment_body -entity_type: comment -bundle: migrate_example_advanced_comment -label: Comment -description: '' -required: true -translatable: true -default_value: { } -default_value_callback: '' -settings: { } -field_type: text_long diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.body.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.body.yml deleted file mode 100644 index 4ddb0abd5..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.body.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.migrate_example_producer - module: - - text -id: node.migrate_example_producer.body -field_name: body -entity_type: node -bundle: migrate_example_producer -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.field_migrate_example_wine_regio.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.field_migrate_example_wine_regio.yml deleted file mode 100644 index fa8b92a41..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_producer.field_migrate_example_wine_regio.yml +++ /dev/null @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_regio - - node.type.migrate_example_producer - - taxonomy.vocabulary.migrate_example_wine_regions -id: node.migrate_example_producer.field_migrate_example_wine_regio -field_name: field_migrate_example_wine_regio -entity_type: node -bundle: migrate_example_producer -label: 'Migrate Example Wine Regions' -description: 'Select the region this wine comes from' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_regions: migrate_example_wine_regions - sort: - field: _none - auto_create: false -field_type: entity_reference diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.body.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.body.yml deleted file mode 100644 index b8c0cff34..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.body.yml +++ /dev/null @@ -1,21 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.body - - node.type.migrate_example_wine - module: - - text -id: node.migrate_example_wine.body -field_name: body -entity_type: node -bundle: migrate_example_wine -label: Body -description: '' -required: false -translatable: true -default_value: { } -default_value_callback: '' -settings: - display_summary: true -field_type: text_with_summary diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_adv_image.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_adv_image.yml deleted file mode 100644 index 8933c38dc..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_adv_image.yml +++ /dev/null @@ -1,37 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_adv_image - - node.type.migrate_example_wine - module: - - image -id: node.migrate_example_wine.field_migrate_example_adv_image -field_name: field_migrate_example_adv_image -entity_type: node -bundle: migrate_example_wine -label: Image -description: 'Upload an image to go with this wine.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: field/migrate_example/image - file_extensions: 'png gif jpg jpeg' - max_filesize: '' - max_resolution: '' - min_resolution: '' - alt_field: true - alt_field_required: false - title_field: false - title_field_required: false - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - handler: 'default:file' - handler_settings: { } -field_type: image diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_comments.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_comments.yml deleted file mode 100644 index f50dcd772..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_comments.yml +++ /dev/null @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_comments - - node.type.migrate_example_wine - module: - - comment -id: node.migrate_example_wine.field_migrate_example_comments -field_name: field_migrate_example_comments -entity_type: node -bundle: migrate_example_wine -label: Comments -description: '' -required: false -translatable: false -default_value: - - - status: 2 - cid: 0 - last_comment_timestamp: 0 - last_comment_name: null - last_comment_uid: 0 - comment_count: 0 -default_value_callback: '' -settings: - default_mode: 1 - per_page: 50 - anonymous: 0 - form_location: true - preview: 1 -field_type: comment diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_top_vintag.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_top_vintag.yml deleted file mode 100644 index 5b95bb5e0..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_top_vintag.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_top_vintag - - node.type.migrate_example_wine -id: node.migrate_example_wine.field_migrate_example_top_vintag -field_name: field_migrate_example_top_vintag -entity_type: node -bundle: migrate_example_wine -label: 'Recommended vintages' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: integer diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_best.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_best.yml deleted file mode 100644 index 224fa66df..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_best.yml +++ /dev/null @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_best - - node.type.migrate_example_wine - - taxonomy.vocabulary.migrate_example_wine_best_with -id: node.migrate_example_wine.field_migrate_example_wine_best -field_name: field_migrate_example_wine_best -entity_type: node -bundle: migrate_example_wine -label: 'Migrate Example Wine Best With' -description: 'Enter any foods this wine may be paired with, separated by commas' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_best_with: migrate_example_wine_best_with - sort: - field: _none - auto_create: false -field_type: entity_reference diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_ratin.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_ratin.yml deleted file mode 100644 index 5841eae0f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_ratin.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_ratin - - node.type.migrate_example_wine -id: node.migrate_example_wine.field_migrate_example_wine_ratin -field_name: field_migrate_example_wine_ratin -entity_type: node -bundle: migrate_example_wine -label: Rating -description: 'Rating on a 1-100 scale' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: !!float 1 - max: !!float 100 - prefix: '' - suffix: '' -field_type: decimal diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_regio.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_regio.yml deleted file mode 100644 index 67b3534f5..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_regio.yml +++ /dev/null @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_regio - - node.type.migrate_example_wine - - taxonomy.vocabulary.migrate_example_wine_regions -id: node.migrate_example_wine.field_migrate_example_wine_regio -field_name: field_migrate_example_wine_regio -entity_type: node -bundle: migrate_example_wine -label: 'Migrate Example Wine Regions' -description: 'Select the region this wine comes from' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_regions: migrate_example_wine_regions - sort: - field: _none - auto_create: false -field_type: entity_reference diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_var.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_var.yml deleted file mode 100644 index 28b81942d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.node.migrate_example_wine.field_migrate_example_wine_var.yml +++ /dev/null @@ -1,26 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_migrate_example_wine_var - - node.type.migrate_example_wine - - taxonomy.vocabulary.migrate_example_wine_varieties -id: node.migrate_example_wine.field_migrate_example_wine_var -field_name: field_migrate_example_wine_var -entity_type: node -bundle: migrate_example_wine -label: 'Migrate Example Wine Varieties' -description: 'Select the variety of this wine' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - migrate_example_wine_varieties: migrate_example_wine_varieties - sort: - field: _none - auto_create: false -field_type: entity_reference diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes.yml deleted file mode 100644 index 7164459f8..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.field.taxonomy_term.migrate_example_wine_varieties.field_variety_attributes.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.taxonomy_term.field_variety_attributes - - taxonomy.vocabulary.migrate_example_wine_varieties -id: taxonomy_term.migrate_example_wine_varieties.field_variety_attributes -field_name: field_variety_attributes -entity_type: taxonomy_term -bundle: migrate_example_wine_varieties -label: Attributes -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_adv_image.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_adv_image.yml deleted file mode 100644 index 62fc9b090..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_adv_image.yml +++ /dev/null @@ -1,29 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - file - - image - - node -id: node.field_migrate_example_adv_image -field_name: field_migrate_example_adv_image -entity_type: node -type: image -settings: - uri_scheme: public - default_image: - uuid: '' - alt: '' - title: '' - width: null - height: null - target_type: file - display_field: false - display_default: false -module: image -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_comments.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_comments.yml deleted file mode 100644 index 1d7b9f10a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_comments.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - comment - - node -id: node.field_migrate_example_comments -field_name: field_migrate_example_comments -entity_type: node -type: comment -settings: - comment_type: migrate_example_advanced_comment -module: comment -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_top_vintag.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_top_vintag.yml deleted file mode 100644 index 86b0c27b2..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_top_vintag.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_migrate_example_top_vintag -field_name: field_migrate_example_top_vintag -entity_type: node -type: integer -settings: - unsigned: false - size: normal -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_best.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_best.yml deleted file mode 100644 index 9026e5881..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_best.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_wine_best -field_name: field_migrate_example_wine_best -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_ratin.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_ratin.yml deleted file mode 100644 index fc3dbe9c7..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_ratin.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_migrate_example_wine_ratin -field_name: field_migrate_example_wine_ratin -entity_type: node -type: decimal -settings: - precision: 10 - scale: 0 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_regio.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_regio.yml deleted file mode 100644 index 3b2b16339..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_regio.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_wine_regio -field_name: field_migrate_example_wine_regio -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_var.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_var.yml deleted file mode 100644 index cca7a39fc..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.node.field_migrate_example_wine_var.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_migrate_example_wine_var -field_name: field_migrate_example_wine_var -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.taxonomy_term.field_variety_attributes.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.taxonomy_term.field_variety_attributes.yml deleted file mode 100644 index e5db23f20..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/field.storage.taxonomy_term.field_variety_attributes.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - taxonomy -id: taxonomy_term.field_variety_attributes -field_name: field_variety_attributes -entity_type: taxonomy_term -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: -1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_producer.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_producer.yml deleted file mode 100644 index 4d78fee87..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_producer.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Wine Producer' -type: migrate_example_producer -description: 'Wineries, vineyards, and large producers.' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_wine.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_wine.yml deleted file mode 100644 index 6f442d5e6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/node.type.migrate_example_wine.yml +++ /dev/null @@ -1,10 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: Wine -type: migrate_example_wine -description: 'Wine is what we drink.' -help: '' -new_revision: false -preview_mode: 1 -display_submitted: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_position.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_position.yml deleted file mode 100644 index 6a79fc90f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_position.yml +++ /dev/null @@ -1,10 +0,0 @@ -id: migrate_example_advanced_position -plugin_id: 'migrate_example_advanced_position' -granularity: method -configuration: - GET: - supported_formats: - - json - - xml - supported_auth: - - cookie diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_items.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_items.yml deleted file mode 100644 index bf2518a5f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_items.yml +++ /dev/null @@ -1,10 +0,0 @@ -id: migrate_example_advanced_variety_items -plugin_id: 'migrate_example_advanced_variety_items' -granularity: method -configuration: - GET: - supported_formats: - - json - - xml - supported_auth: - - cookie diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_list.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_list.yml deleted file mode 100644 index f19dc60fe..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_list.yml +++ /dev/null @@ -1,10 +0,0 @@ -id: migrate_example_advanced_variety_list -plugin_id: 'migrate_example_advanced_variety_list' -granularity: method -configuration: - GET: - supported_formats: - - json - - xml - supported_auth: - - cookie diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_multiple.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_multiple.yml deleted file mode 100644 index c8960369f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/rest.resource.migrate_example_advanced_variety_multiple.yml +++ /dev/null @@ -1,10 +0,0 @@ -id: migrate_example_advanced_variety_multiple -plugin_id: 'migrate_example_advanced_variety_multiple' -granularity: method -configuration: - GET: - supported_formats: - - json - - xml - supported_auth: - - cookie diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_best_with.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_best_with.yml deleted file mode 100644 index 51cb1c93e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_best_with.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Wine Best With' -vid: migrate_example_wine_best_with -description: 'Foods the wine goes best with' -hierarchy: 0 -weight: 0 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_regions.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_regions.yml deleted file mode 100644 index 9ebbadfcd..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_regions.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Wine Regions' -vid: migrate_example_wine_regions -description: 'Wine regions' -hierarchy: 0 -weight: 0 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_varieties.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_varieties.yml deleted file mode 100644 index ca12aca5f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/config/install/taxonomy.vocabulary.migrate_example_wine_varieties.yml +++ /dev/null @@ -1,8 +0,0 @@ -langcode: en -status: true -dependencies: { } -name: 'Migrate Example Wine Varieties' -vid: migrate_example_wine_varieties -description: 'Wine varieties' -hierarchy: 0 -weight: 0 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml deleted file mode 100644 index 97334d36a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.info.yml +++ /dev/null @@ -1,18 +0,0 @@ -type: module -name: Migrate Advanced Example Setup -description: 'Separate site configuration for the example from the actual migration.' -package: Migration -# core: 8.x -hidden: 1 -dependencies: - - drupal:comment - - drupal:image - - drupal:text - - drupal:taxonomy - - drupal:rest - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install deleted file mode 100644 index 6fd5f7926..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/migrate_example_advanced_setup.install +++ /dev/null @@ -1,1222 +0,0 @@ - 'Wines of the world', - 'fields' => [ - 'wineid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine ID', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ], - 'body' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Full description of the wine.', - ], - 'excerpt' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Abstract for this wine.', - ], - 'accountid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'ID of the author.', - ], - 'posted' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Original creation date', - ], - 'last_changed' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Last change date', - ], - 'variety' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine variety', - ], - 'region' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine region', - ], - 'rating' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Rating (100-point scale)', - ], - ], - 'primary key' => ['wineid'], - ]; -} - -/** - * The hook_schema definition for updates. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_updates() { - return [ - 'description' => 'Updated wine ratings', - 'fields' => [ - 'wineid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine ID', - ], - 'rating' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Rating (100-point scale)', - ], - ], - 'primary key' => ['wineid'], - ]; -} - -/** - * The hook_schema definition for producer. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_producer() { - return [ - 'description' => 'Wine producers of the world', - 'fields' => [ - 'producerid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Producer ID', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ], - 'body' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Full description of the producer.', - ], - 'excerpt' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Abstract for this producer.', - ], - 'accountid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Account ID of the author.', - ], - ], - 'primary key' => ['producerid'], - ]; -} - -/** - * The hook_schema definition for categories. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_categories() { - return [ - 'description' => 'Categories', - 'fields' => [ - 'categoryid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'description' => 'Category ID', - ], - 'type' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Type of category: variety, region, best_with', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ], - 'details' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ], - 'category_parent' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Parent category, if any', - ], - 'ordering' => [ - 'type' => 'int', - 'unsigned' => FALSE, - 'not null' => FALSE, - 'description' => 'Order in which to display categories', - ], - ], - 'primary key' => ['categoryid'], - ]; -} - -/** - * The hook_schema definition for vintages. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_vintages() { - return [ - 'description' => 'Wine vintages', - 'fields' => [ - 'wineid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Wine ID', - ], - 'vintage' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Vintage (year)', - ], - ], - 'primary key' => ['wineid', 'vintage'], - ]; -} - -/** - * The hook_schema definition for variety updates. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_variety_updates() { - return [ - 'description' => 'Variety updates', - 'fields' => [ - 'categoryid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'unsigned' => TRUE, - 'description' => 'Category ID', - ], - 'details' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ], - ], - 'primary key' => ['categoryid'], - ]; -} - -/** - * The hook_schema definition for category wine. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_category_wine() { - return [ - 'description' => 'Wine category assignments', - 'fields' => [ - 'wineid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Wine ID', - ], - 'categoryid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Category ID', - ], - ], - 'primary key' => ['categoryid', 'wineid'], - ]; -} - -/** - * The hook_schema definition for category producer. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_category_producer() { - return [ - 'description' => 'Producer category assignments', - 'fields' => [ - 'producerid' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Producer ID', - ], - 'categoryid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Category ID', - ], - ], - 'primary key' => ['categoryid', 'producerid'], - ]; -} - -/** - * The hook_schema definition for comment. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_comment() { - return [ - 'description' => 'Wine comments', - 'fields' => [ - 'commentid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Comment ID', - ], - 'wineid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Wine ID that is being commented upon', - ], - 'comment_parent' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Parent comment ID in case of comment replies.', - ], - 'subject' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment subject', - ], - 'body' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment body', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment name (if anon)', - ], - 'mail' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment email (if anon)', - ], - 'accountid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Account ID (if any).', - ], - 'commenthost' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'IP/domain of host posted from', - ], - 'userpage' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'User homepage', - ], - 'posted' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Date comment posted', - ], - 'lastchanged' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Date comment last changed', - ], - ], - 'primary key' => ['commentid'], - ]; -} - -/** - * The hook_schema definition for comment updates. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_comment_updates() { - return [ - 'description' => 'Wine comment updates', - 'fields' => [ - 'commentid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Comment ID', - ], - 'subject' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Comment subject', - ], - ], - 'primary key' => ['commentid'], - ]; -} - -/** - * The hook_schema definition for account. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_account() { - return [ - 'description' => 'Wine accounts.', - 'fields' => [ - 'accountid' => [ - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Account ID', - ], - 'status' => [ - 'type' => 'int', - 'not null' => TRUE, - 'description' => 'Blocked_Allowed', - ], - 'posted' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Registration date', - ], - 'last_access' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Last access date', - ], - 'last_login' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Last login date', - ], - 'name' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account name (for login)', - ], - 'sex' => [ - 'type' => 'char', - 'length' => 1, - 'not null' => FALSE, - 'description' => 'Gender', - ], - 'password' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account password (raw)', - ], - 'mail' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Account email', - ], - 'original_mail' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Original account email', - ], - 'sig' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Signature for comments', - ], - 'imageid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Image ID', - ], - 'positions' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Positions held', - ], - ], - 'primary key' => ['accountid'], - ]; -} - -/** - * The hook_schema definition for account updates. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_account_updates() { - return [ - 'description' => 'Wine account updates', - 'fields' => [ - 'accountid' => [ - 'type' => 'serial', - 'not null' => TRUE, - 'description' => 'Account ID', - ], - 'sex' => [ - 'type' => 'char', - 'length' => 1, - 'not null' => FALSE, - 'description' => 'Gender', - ], - ], - 'primary key' => ['accountid'], - ]; -} - -/** - * The hook_schema definition for blobs. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_blobs() { - return [ - 'description' => 'Wine blobs to be migrated to file entities', - 'fields' => [ - 'imageid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Image ID', - ], - 'imageblob' => [ - 'type' => 'blob', - 'size' => 'normal', - 'description' => 'binary image data', - ], - ], - 'primary key' => ['imageid'], - ]; -} - -/** - * The hook_schema definition for files. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_files() { - return [ - 'description' => 'Wine and account files', - 'fields' => [ - 'imageid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Image ID', - ], - 'url' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'Image URL', - ], - 'image_alt' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image alt', - ], - 'image_title' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - 'description' => 'Image title', - ], - 'wineid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => FALSE, - 'description' => 'Wine node this is associated with', - ], - ], - 'primary key' => ['imageid'], - ]; -} - -/** - * The hook_schema definition for table source. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_table_source() { - return [ - 'description' => 'Source data to go into a custom Drupal table', - 'fields' => [ - 'fooid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Primary key', - ], - 'field1' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'First field', - ], - 'field2' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Second field', - ], - ], - 'primary key' => ['fooid'], - ]; -} - -/** - * The hook_schema definition for table destination. - * - * @return array - * The schema definition. - */ -function migrate_example_advanced_schema_table_dest() { - return [ - 'description' => 'Custom Drupal table to receive source data directly', - 'fields' => [ - 'recordid' => [ - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Primary key', - ], - 'drupal_text' => [ - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'description' => 'First field', - ], - 'drupal_int' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'description' => 'Second field', - ], - ], - 'primary key' => ['recordid'], - ]; -} - -/** - * Populate wine table. - */ -function migrate_example_advanced_data_wine() { - $fields = [ - 'wineid', - 'name', - 'body', - 'excerpt', - 'accountid', - 'posted', - 'last_changed', - 'variety', - 'region', - 'rating', - ]; - $query = \Drupal::database()->insert('migrate_example_wine') - ->fields($fields); - $data = [ - [ - 1, - 'Montes Classic Cabernet Sauvignon', - 'Intense ruby-red color', - 'Great!', - 9, - strtotime('2010-01-02 03:04:05'), - strtotime('2010-03-04 05:06:07'), - 25, - 17, - 95, - ], - [ - 2, - 'Archeo Ruggero di Tasso Nero d\'Avola', - 'Lots of berry character', - 'Pair with red sauced dishes', - 3, - strtotime('2010-09-03 18:23:58'), - strtotime('2010-09-03 18:23:58'), - 26, - 2, - 85, - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate updates table. - */ -function migrate_example_advanced_data_updates() { - $fields = ['wineid', 'rating']; - $query = \Drupal::database()->insert('migrate_example_advanced_updates') - ->fields($fields); - $data = [ - [1, 93], - [2, NULL], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate producer table. - */ -function migrate_example_advanced_data_producer() { - $fields = ['producerid', 'name', 'body', 'excerpt', 'accountid']; - $query = \Drupal::database()->insert('migrate_example_advanced_producer') - ->fields($fields); - $data = [ - [1, 'Montes', 'Fine Chilean winery', 'Great!', 9], - [2, 'Archeo', 'Sicilia!', NULL, 3], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate account table. - */ -function migrate_example_advanced_data_account() { - $fields = [ - 'accountid', - 'status', - 'posted', - 'last_access', - 'last_login', - 'name', - 'sex', - 'password', - 'mail', - 'original_mail', - 'sig', - 'imageid', - 'positions', - ]; - $query = \Drupal::database()->insert('migrate_example_advanced_account') - ->fields($fields); - $data = [ - [ - 1, - 1, - '2010-03-30 10:31:05', - '2010-04-30 18:25:24', - '2010-04-30 14:01:02', - 'darren', - 'M', - 'dpass', - 'ddarren@example.com', - 'darren@example.com', - 'All about the Australians', - NULL, - '5', - ], - [ - 3, - 0, - '2007-03-15 10:31:05', - '2007-06-10 04:11:38', - '2007-06-10 04:11:38', - 'emily', - 'F', - 'insecure', - 'emily@example.com', - 'emily@example.com', - 'Sommelier to the stars', - NULL, - '18', - ], - [ - 9, - 1, - '2004-02-29 10:31:05', - '2004-02-29 10:31:05', - '2004-02-29 10:31:05', - 'fonzie', - NULL, - 'bike', - 'thefonz@example.com', - 'arthur@example.com', - 'Aaay!', - 1, - '5,18', - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate account updates table. - */ -function migrate_example_advanced_data_account_updates() { - $fields = ['accountid', 'sex']; - $query = \Drupal::database()->insert('migrate_example_advanced_account_updates') - ->fields($fields); - $data = [ - [1, NULL], - [3, 'M'], - [9, 'F'], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate comment table. - */ -function migrate_example_advanced_data_comment() { - $fields = [ - 'commentid', - 'wineid', - 'comment_parent', - 'subject', - 'body', - 'name', - 'mail', - 'accountid', - 'commenthost', - 'userpage', - 'posted', - 'lastchanged', - ]; - $query = \Drupal::database()->insert('migrate_example_advanced_comment') - ->fields($fields); - $data = [ - [ - 1, - 1, - NULL, - 'im first', - 'Tasty', - 'grace', - 'grace@example.com', - 0, - '123.456.78.9', - 'http:://grace.example.com/', - strtotime('2010-01-02 03:04:05'), - strtotime('2010-04-05 06:07:08'), - ], - [ - 2, - 1, - NULL, - 'im second', - 'Delicious', - 'horace', - 'horace@example.com', - 0, - 'example.com', - NULL, - strtotime('2010-02-02 03:04:05'), - strtotime('2010-05-05 06:07:08'), - ], - [ - 3, - 1, - NULL, - 'im parent', - 'Don\'t care for it', - 'irene', - 'irene@example.com', - 0, - '254.0.2.5', - 'http:://www.example.com/irene', - strtotime('2010-03-02 03:04:05'), - strtotime('2010-03-02 03:04:05'), - ], - [ - 4, - 1, - 3, - 'im child', - 'But it\'s so good!', - 'emily', - NULL, - 3, - '58.29.126.1', - 'http:://www.wine.com/', - strtotime('2010-01-02 03:04:05'), - strtotime('2010-01-02 03:04:05'), - ], - [ - 5, - 1, - 4, - 'im grandchild', - 'Right on, Emily!', - 'thefonz@example.com', - NULL, - 9, - '123.456.78.9', - NULL, - strtotime('2010-06-02 03:04:05'), - strtotime('2010-06-02 03:04:05'), - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate comment updates table. - */ -function migrate_example_advanced_data_comment_updates() { - $fields = ['commentid', 'subject']; - $query = \Drupal::database()->insert('migrate_example_advanced_comment_updates') - ->fields($fields); - $data = [ - [1, 'I am first'], - [2, 'I am second'], - [3, 'I am parent'], - [4, ''], - [5, 'I am Spartacus'], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate categories table. - */ -function migrate_example_advanced_data_categories() { - $fields = [ - 'categoryid', - 'type', - 'name', - 'category_parent', - 'details', - 'ordering', - ]; - $query = \Drupal::database()->insert('migrate_example_advanced_categories') - ->fields($fields); - $data = [ - [ - 1, - 'variety', - 'White wine', - NULL, - 'White wines are generally simpler and sweeter than red', - 3, - ], - [ - 3, - 'variety', - 'Red wine', - NULL, - 'Red wines are generally more complex and "dry" than white', - 1, - ], - [8, 'variety', 'Riesling', 1, 'Associated with Germany', 2], - [9, 'variety', 'Chardonnay', 1, 'One of the most popular whites', 1], - [13, 'variety', 'Merlot', 3, 'Very drinkable', 4], - [14, 'variety', 'Syrah', 3, 'A.k.a. shiraz', -3], - [25, 'variety', 'Cabernet Sauvignon', 3, 'A basic', -5], - [26, 'variety', "Nero d'Avola", 3, 'Sicilian specialty', 2], - [2, 'region', 'Italy', NULL, 'Largest producer of wine', 5], - [11, 'region', 'Tuscany', 2, NULL, 2], - [18, 'region', 'Chianti', 11, NULL, -1], - [19, 'region', 'Elba', 11, NULL, 5], - [4, 'region', 'France', NULL, 'C\'est bon', 6], - [5, 'region', 'Bordeaux', 4, NULL, 1], - [6, 'region', 'Barsac', 5, NULL, 3], - [7, 'region', 'Pomerol', 5, NULL, 2], - [16, 'region', 'Chile', NULL, NULL, 3], - [17, 'region', 'Colchagua Valley', 16, NULL, 1], - [20, 'region', 'California', NULL, NULL, 5], - [21, 'region', 'Redwood Valley', 20, NULL, 1], - [10, 'best_with', 'Beef', NULL, NULL, 5], - [12, 'best_with', 'Pork', NULL, NULL, -3], - [15, 'best_with', 'Chicken', NULL, NULL, -5], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate vintages table. - */ -function migrate_example_advanced_data_vintages() { - $fields = ['wineid', 'vintage']; - $query = \Drupal::database()->insert('migrate_example_advanced_vintages') - ->fields($fields); - $data = [ - [1, 2006], - [1, 2007], - [2, 2001], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate variety updates table. - */ -function migrate_example_advanced_data_variety_updates() { - $fields = ['categoryid', 'details']; - $query = \Drupal::database()->insert('migrate_example_advanced_variety_updates') - ->fields($fields); - $data = [ - [1, 'White wines are simpler and sweeter than red'], - [3, 'Red wines are generally more complex and dry than white'], - [8, 'Usually associated with Germany'], - [9, NULL], - [13, 'Common, very drinakable'], - [14, 'AKA Shiraz'], - [25, 'Basic'], - [26, 'A specialty of Sicily'], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate category wine table. - */ -function migrate_example_advanced_data_category_wine() { - $fields = ['wineid', 'categoryid']; - $query = \Drupal::database()->insert('migrate_example_advanced_category_wine') - ->fields($fields); - $data = [ - [1, 12], - [1, 15], - [2, 10], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate category producer table. - */ -function migrate_example_advanced_data_category_producer() { - $fields = ['producerid', 'categoryid']; - $query = \Drupal::database()->insert('migrate_example_advanced_category_producer') - ->fields($fields); - $data = [ - [1, 17], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate files table. - */ -function migrate_example_advanced_data_files() { - $fields = ['imageid', 'url', 'image_alt', 'image_title', 'wineid']; - $query = \Drupal::database()->insert('migrate_example_advanced_files') - ->fields($fields); - $data = [ - [ - 1, - 'http://placekitten.com/200/200', - NULL, - NULL, - NULL, - ], - [ - 2, - 'http://cyrve.com/files/penguin.jpeg', - 'Penguin alt', - 'Penguin title', - 1, - ], - [3, 'http://cyrve.com/files/rioja.jpeg', 'Rioja alt', 'Rioja title', 2], - [ - 4, - 'http://cyrve.com/files/boutisse_0.jpeg', - 'Boutisse alt', - 'Boutisse title', - 2, - ], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate blobs table. - */ -function migrate_example_advanced_data_blobs() { - $blob = file_get_contents('core/misc/druplicon.png'); - $fields = ['imageid', 'imageblob']; - $query = \Drupal::database()->insert('migrate_example_advanced_blobs') - ->fields($fields); - $data = [ - [1, $blob], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} - -/** - * Populate table source table. - */ -function migrate_example_advanced_data_table_source() { - $fields = ['fooid', 'field1', 'field2']; - $query = \Drupal::database()->insert('migrate_example_advanced_table_source') - ->fields($fields); - $data = [ - [3, 'Some sample data', 58], - [15, 'Whatever', 2], - [646, 'More sample data', 34989], - ]; - foreach ($data as $row) { - $query->values(array_combine($fields, $row)); - } - $query->execute(); -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/PositionResource.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/PositionResource.php deleted file mode 100644 index 20fe34aad..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/PositionResource.php +++ /dev/null @@ -1,44 +0,0 @@ - 'wine_taster', 'name' => 'Wine Taster']; - $position2 = ['sourceid' => 'vintner', 'name' => 'Vintner']; - $data = ['position' => [$position1, $position2]]; - - $response = new ResourceResponse($data, 200); - return $response; - } - - /** - * {@inheritdoc} - */ - public function permissions() { - // Remove permissions so the resource is available to all. - return []; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php deleted file mode 100644 index 670134c34..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyItems.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'name' => 'Retsina', - // The categoryid for 'white'. - 'parent' => 1, - 'details' => 'Greek', - ], - 'trebbiano' => [ - 'name' => 'Trebbiano', - // The categoryid for 'white'. - 'parent' => 1, - 'details' => 'Italian', - ], - 'valpolicella' => [ - 'name' => 'Valpolicella', - // The categoryid for 'red'. - 'parent' => 3, - 'details' => 'Italian Venoto region', - ], - 'bardolino' => [ - 'name' => 'Bardolino', - // The categoryid for 'red'. - 'parent' => 3, - 'details' => 'Italian Venoto region', - ], - ]; - if (isset($varieties[$variety])) { - $data = ['variety' => $varieties[$variety]]; - } - else { - $data = []; - } - - $response = new ResourceResponse($data, 200); - return $response; - } - - /** - * {@inheritdoc} - */ - public function permissions() { - // Remove permissions so the resource is available to all. - return []; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php deleted file mode 100644 index bb4bb60cb..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php +++ /dev/null @@ -1,42 +0,0 @@ - 'Amarone', - // The categoryid for 'red'. - 'parent' => 3, - 'details' => 'Italian Venoto region', - 'attributes' => [ - 'rich', - 'aromatic', - ], - ]; - $data['variety'][] = [ - 'name' => 'Barbaresco', - // The categoryid for 'red'. - 'parent' => 3, - 'details' => 'Italian Piedmont region', - 'attributes' => [ - 'smoky', - 'earthy', - ], - ]; - } - if (strtolower($type) != 'red') { - $data['variety'][] = [ - 'name' => 'Kir', - // The categoryid for 'white'. - 'parent' => 1, - 'details' => 'French Burgundy region', - 'attributes' => [], - ]; - $data['variety'][] = [ - 'name' => 'Pinot Grigio', - // The categoryid for 'white'. - 'parent' => 1, - 'details' => 'From the northeast of Italy', - 'attributes' => [ - 'fruity', - 'medium-bodied', - 'slightly sweet', - ], - ]; - } - - $response = new ResourceResponse($data, 200); - return $response; - } - - /** - * {@inheritdoc} - */ - public function permissions() { - // Remove permissions so the resource is available to all. - return []; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php b/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php deleted file mode 100644 index 3d3d235dd..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_example_advanced/src/Plugin/migrate/source/WineTerm.php +++ /dev/null @@ -1,57 +0,0 @@ -select('migrate_example_advanced_categories', 'wc') - ->fields('wc', $fields) - // This sort assures that parents are saved before children. - ->orderBy('category_parent', 'ASC'); - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = [ - 'categoryid' => $this->t('Unique ID of the category'), - 'type' => $this->t('Category type corresponding to Drupal vocabularies'), - 'name' => $this->t('Category name'), - 'details' => $this->t('Description of the category'), - 'category_parent' => $this->t('ID of the parent category'), - 'ordering' => $this->t('Order in which to display this category'), - ]; - - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return ['categoryid' => ['type' => 'integer']]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/README.md b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/README.md deleted file mode 100644 index 4736b985a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/README.md +++ /dev/null @@ -1,22 +0,0 @@ -A demonstration of a simple import of a JSON file. - -REQUIREMENTS -============ -You need the contrib modules Migrate Plus and Migrate Tools. -To make the products.json file available for import, the file will be copied -from the artifacts folder to your sites/default/files folder. - -USAGE -===== -Enable the module, check status, import all products and rollback with Drush -drush en migrate_json_example -drush migrate-status -drush migrate-import product -drush migrate-rollback product - -See config/optional/migrate_plus.migration.product.yml for details about the -migration. - -Thanks to Jeff Geerling and Christophe for the original code: -- https://www.jeffgeerling.com/blog/2016/migrate-custom-json-feed-drupal-8-migrate-source-json -- https://colorfield.be/blog/drupal-8-json-custom-migration diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/artifacts/products.json b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/artifacts/products.json deleted file mode 100644 index def2ddf29..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/artifacts/products.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "product": [ - { - "upc": "11111", - "name": "Widget", - "description": "Helpful for many things.", - "price": "14.99" - }, - { - "upc": "22222", - "name": "Sprocket", - "description": "Helpful for things needing sprockets.", - "price": "8.99" - } - ] -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_form_display.node.product.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_form_display.node.product.default.yml deleted file mode 100644 index 7faa1a2b2..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_form_display.node.product.default.yml +++ /dev/null @@ -1,88 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.product.field_description - - field.field.node.product.field_price - - field.field.node.product.field_upc - - node.type.product - module: - - path -id: node.product.default -targetEntityType: node -bundle: product -mode: default -content: - created: - type: datetime_timestamp - weight: 10 - region: content - settings: { } - third_party_settings: { } - field_description: - weight: 123 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - field_price: - weight: 124 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_upc: - weight: 122 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - path: - type: path - weight: 30 - region: content - settings: { } - third_party_settings: { } - promote: - type: boolean_checkbox - settings: - display_label: true - weight: 15 - region: content - third_party_settings: { } - status: - type: boolean_checkbox - settings: - display_label: true - weight: 120 - region: content - third_party_settings: { } - sticky: - type: boolean_checkbox - settings: - display_label: true - weight: 16 - region: content - third_party_settings: { } - title: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - region: content - third_party_settings: { } -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_view_display.node.product.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_view_display.node.product.default.yml deleted file mode 100644 index 9e7a9f23c..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/core.entity_view_display.node.product.default.yml +++ /dev/null @@ -1,49 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.node.product.field_description - - field.field.node.product.field_price - - field.field.node.product.field_upc - - node.type.product - module: - - user -id: node.product.default -targetEntityType: node -bundle: product -mode: default -content: - field_description: - weight: 103 - label: above - settings: - link_to_entity: false - third_party_settings: { } - type: string - region: content - field_price: - weight: 104 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_upc: - weight: 102 - label: above - settings: - thousand_separator: '' - prefix_suffix: true - third_party_settings: { } - type: number_integer - region: content - links: - weight: 100 - settings: { } - third_party_settings: { } - region: content -hidden: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_description.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_description.yml deleted file mode 100644 index 7bbbd8419..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_description.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_description - - node.type.product -id: node.product.field_description -field_name: field_description -entity_type: node -bundle: product -label: Description -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_price.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_price.yml deleted file mode 100644 index df23a84ae..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_price.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_price - - node.type.product -id: node.product.field_price -field_name: field_price -entity_type: node -bundle: product -label: Price -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: float diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_upc.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_upc.yml deleted file mode 100644 index ef0a28ec4..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.field.node.product.field_upc.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_upc - - node.type.product -id: node.product.field_upc -field_name: field_upc -entity_type: node -bundle: product -label: UPC -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: integer diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_description.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_description.yml deleted file mode 100644 index a5c39580d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_description.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_description -field_name: field_description -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_price.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_price.yml deleted file mode 100644 index 090acad3d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_price.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_price -field_name: field_price -entity_type: node -type: float -settings: { } -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_upc.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_upc.yml deleted file mode 100644 index 149b11da1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/field.storage.node.field_upc.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: node.field_upc -field_name: field_upc -entity_type: node -type: integer -settings: - unsigned: false - size: normal -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/migrate_plus.migration.product.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/migrate_plus.migration.product.yml deleted file mode 100644 index 166072494..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/migrate_plus.migration.product.yml +++ /dev/null @@ -1,81 +0,0 @@ -# This migration demonstrates a simple import from a JSON file. -id: product -label: JSON feed of Products -migration_group: Product -migration_tags: - - json example -source: - # We use the JSON source plugin. - plugin: url - # In this example we get data from a local file, to get data from a URL - # define http as data_fetcher_plugin. - # data_fetcher_plugin: http - data_fetcher_plugin: file - data_parser_plugin: json - # The data_parser normally limits the fields passed on to the source plugin - # to fields configured to be used as part of the migration. To support more - # dynamic migrations, the JSON data parser supports including the original - # data for the current row. Simply include the 'include_raw_data' flag set - # to `true` to enable this. This option is disabled by default to minimize - # memory footprint for migrations that do not need this capability. - # include_raw_data: true - # Flags whether to track changes to incoming data. If TRUE, we will maintain - # hashed source rows to determine whether incoming data has changed. - # track_changes: true - # Copy the example JSON file in artifacts folder to sites/default/files folder. - urls: - - 'public://migrate_json_example/products.json' - # An xpath-like selector corresponding to the items to be imported. - item_selector: product - # Under 'fields', we list the data items to be imported. The first level keys - # are the source field names we want to populate (the names to be used as - # sources in the process configuration below). For each field we're importing, - # we provide a label (optional - this is for display in migration tools) and - # an xpath for retrieving that value. It's important to note that this xpath - # is relative to the elements retrieved by item_selector. - fields: - - - name: upc - label: 'Unique product identifier' - selector: upc - - - name: name - label: 'Product name' - selector: name - - - name: description - label: 'Product description' - selector: description - - - name: price - label: 'Product price' - selector: price - # Under 'ids', we identify source fields populated above which will uniquely - # identify each imported item. The 'type' makes sure the migration map table - # uses the proper schema type for stored the IDs. - ids: - upc: - type: integer -process: - # Note that the source field names here (name, description and price) were - # defined by the 'fields' configuration for the source plugin above. - type: - plugin: default_value - default_value: product - title: name - field_upc: upc - field_description: description - field_price: price - sticky: - plugin: default_value - default_value: 0 - uid: - plugin: default_value - default_value: 0 -destination: - plugin: 'entity:node' -migration_dependencies: { } -dependencies: - enforced: - module: - - migrate_json_example diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/node.type.product.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/node.type.product.yml deleted file mode 100644 index 18d8499de..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/config/optional/node.type.product.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - menu_ui -third_party_settings: - menu_ui: - available_menus: - - main - parent: 'main:' -name: Product -type: product -description: '' -help: '' -new_revision: true -preview_mode: 1 -display_submitted: true diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.info.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.info.yml deleted file mode 100644 index 31b9d8cde..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -type: module -name: Migrate JSON Example -description: 'Simple JSON Migration example' -package: Examples -# core: 8.x -dependencies: - - drupal:migrate - - migrate_plus:migrate_plus - - migrate_tools:migrate_tools - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.install b/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.install deleted file mode 100644 index b10e368d3..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_json_example/migrate_json_example.install +++ /dev/null @@ -1,20 +0,0 @@ -=8.3) - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.install b/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.install deleted file mode 100644 index 815b9876e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.install +++ /dev/null @@ -1,38 +0,0 @@ -select('config', 'c') - ->fields('c', ['name', 'data']) - ->condition('name', 'migrate.migration.%', 'LIKE') - ->execute(); - foreach ($migration_config as $migration) { - $data = unserialize($migration->data); - if (isset($data['third_party_settings']['migrate_plus']['migration_group'])) { - $data['migration_group'] = $data['third_party_settings']['migrate_plus']['migration_group']; - unset($data['third_party_settings']['migrate_plus']); - if (empty($data['third_party_settings'])) { - unset($data['third_party_settings']); - } - $new_name = str_replace('migrate.migration.', 'migrate_plus.migration.', $migration->name); - $database->update('config') - ->fields([ - 'name' => $new_name, - 'data' => serialize($data), - ]) - ->condition('name', $migration->name) - ->execute(); - } - } -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.module b/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.module deleted file mode 100644 index 0dbddc473..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.module +++ /dev/null @@ -1,87 +0,0 @@ - $migration) { - // Add the default class where empty. - if (empty($migration['class'])) { - $migrations[$id]['class'] = 'Drupal\migrate\Plugin\Migration'; - } - - // For derived configuration entity-based migrations, strip the deriver - // prefix so we can reference migrations by the IDs they specify (i.e., - // the migration that specifies "id: temp" can be referenced as "temp" - // rather than "migration_config_deriver:temp"). - $prefix = 'migration_config_deriver:'; - if (strpos($id, $prefix) === 0) { - $new_id = substr($id, strlen($prefix)); - $migrations[$new_id] = $migrations[$id]; - unset($migrations[$id]); - $id = $new_id; - } - - // Integrate shared group configuration into the migration. - if (empty($migration['migration_group'])) { - $migration['migration_group'] = 'default'; - } - $group = MigrationGroup::load($migration['migration_group']); - if (empty($group)) { - // If the specified group does not exist, create it. Provide a little more - // for the 'default' group. - $group_properties = []; - $group_properties['id'] = $migration['migration_group']; - if ($migration['migration_group'] == 'default') { - $group_properties['label'] = 'Default'; - $group_properties['description'] = 'A container for any migrations not explicitly assigned to a group.'; - } - else { - $group_properties['label'] = $group_properties['id']; - $group_properties['description'] = ''; - } - $group = MigrationGroup::create($group_properties); - $group->save(); - } - $shared_configuration = $group->get('shared_configuration'); - if (empty($shared_configuration)) { - continue; - } - foreach ($shared_configuration as $key => $group_value) { - $migration_value = $migration[$key]; - // Where both the migration and the group provide arrays, replace - // recursively (so each key collision is resolved in favor of the - // migration). - if (is_array($migration_value) && is_array($group_value)) { - $merged_values = array_replace_recursive($group_value, $migration_value); - $migrations[$id][$key] = $merged_values; - } - // Where the group provides a value the migration doesn't, use the group - // value. - elseif (is_null($migration_value)) { - $migrations[$id][$key] = $group_value; - } - // Otherwise, the existing migration value overrides the group value. - } - } -} - -/** - * Implements hook_migrate_prepare_row(). - */ -function migrate_plus_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) { - \Drupal::service('event_dispatcher')->dispatch(MigrateEvents::PREPARE_ROW, new MigratePrepareRowEvent($row, $source, $migration)); -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.services.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.services.yml deleted file mode 100644 index 2ca3363c1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrate_plus.services.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - plugin.manager.migrate_plus.authentication: - class: Drupal\migrate_plus\AuthenticationPluginManager - parent: default_plugin_manager - plugin.manager.migrate_plus.data_fetcher: - class: Drupal\migrate_plus\DataFetcherPluginManager - parent: default_plugin_manager - plugin.manager.migrate_plus.data_parser: - class: Drupal\migrate_plus\DataParserPluginManager - parent: default_plugin_manager diff --git a/sites/all/modules/contrib/migrate/migrate_plus/migrations/migration_config_deriver.yml b/sites/all/modules/contrib/migrate/migrate_plus/migrations/migration_config_deriver.yml deleted file mode 100644 index 9fc597e7d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/migrations/migration_config_deriver.yml +++ /dev/null @@ -1,6 +0,0 @@ -id: migration_config_deriver -deriver: Drupal\migrate_plus\Plugin\MigrationConfigDeriver -# @todo: Remove if/when https://www.drupal.org/node/2797421 is fixed. -# Unused source configuration must be added to prevent errors. -source: - plugin: embedded_data diff --git a/sites/all/modules/contrib/migrate/migrate_plus/phpcs.xml b/sites/all/modules/contrib/migrate/migrate_plus/phpcs.xml deleted file mode 100644 index a18054efb..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/phpcs.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - Drupal 8 coding standards - - . - - - - ./vendor/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - - - - - - - - - - - - - - - - diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Annotation/Authentication.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Annotation/Authentication.php deleted file mode 100644 index 5b63e1af8..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Annotation/Authentication.php +++ /dev/null @@ -1,37 +0,0 @@ -alterInfo('authentication_info'); - $this->setCacheBackend($cache_backend, 'migrate_plus_plugins_authentication'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/DataFetcherPluginBase.php b/sites/all/modules/contrib/migrate/migrate_plus/src/DataFetcherPluginBase.php deleted file mode 100644 index 9e413fe10..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/DataFetcherPluginBase.php +++ /dev/null @@ -1,32 +0,0 @@ -alterInfo('data_fetcher_info'); - $this->setCacheBackend($cache_backend, 'migrate_plus_plugins_data_fetcher'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginBase.php b/sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginBase.php deleted file mode 100644 index c74c6c53a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginBase.php +++ /dev/null @@ -1,221 +0,0 @@ -urls = $configuration['urls']; - $this->itemSelector = $configuration['item_selector']; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition); - } - - /** - * Returns the initialized data fetcher plugin. - * - * @return \Drupal\migrate_plus\DataFetcherPluginInterface - * The data fetcher plugin. - */ - public function getDataFetcherPlugin() { - if (!isset($this->dataFetcherPlugin)) { - $this->dataFetcherPlugin = \Drupal::service('plugin.manager.migrate_plus.data_fetcher')->createInstance($this->configuration['data_fetcher_plugin'], $this->configuration); - } - return $this->dataFetcherPlugin; - } - - /** - * {@inheritdoc} - */ - public function rewind() { - $this->activeUrl = NULL; - $this->next(); - } - - /** - * Implementation of Iterator::next(). - */ - public function next() { - $this->currentItem = $this->currentId = NULL; - if (is_null($this->activeUrl)) { - if (!$this->nextSource()) { - // No data to import. - return; - } - } - // At this point, we have a valid open source url, try to fetch a row from - // it. - $this->fetchNextRow(); - // If there was no valid row there, try the next url (if any). - if (is_null($this->currentItem)) { - while ($this->nextSource()) { - $this->fetchNextRow(); - if ($this->valid()) { - break; - } - } - } - if ($this->valid()) { - foreach ($this->configuration['ids'] as $id_field_name => $id_info) { - $this->currentId[$id_field_name] = $this->currentItem[$id_field_name]; - } - } - } - - /** - * Opens the specified URL. - * - * @param string $url - * URL to open. - * - * @return bool - * TRUE if the URL was successfully opened, FALSE otherwise. - */ - abstract protected function openSourceUrl($url); - - /** - * Retrieves the next row of data. populating currentItem. - * - * Retrieves from the open source URL. - */ - abstract protected function fetchNextRow(); - - /** - * Advances the data parser to the next source url. - * - * @return bool - * TRUE if a valid source URL was opened - */ - protected function nextSource() { - while ($this->activeUrl === NULL || (count($this->urls) - 1) > $this->activeUrl) { - if (is_null($this->activeUrl)) { - $this->activeUrl = 0; - } - else { - // Increment the activeUrl so we try to load the next source. - $this->activeUrl = $this->activeUrl + 1; - if ($this->activeUrl >= count($this->urls)) { - return FALSE; - } - } - - if ($this->openSourceUrl($this->urls[$this->activeUrl])) { - // We have a valid source. - return TRUE; - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function current() { - return $this->currentItem; - } - - /** - * {@inheritdoc} - */ - public function key() { - return $this->currentId; - } - - /** - * {@inheritdoc} - */ - public function valid() { - return !empty($this->currentItem); - } - - /** - * {@inheritdoc} - */ - public function count() { - $count = 0; - foreach ($this as $item) { - $count++; - } - return $count; - } - - /** - * Return the selectors used to populate each configured field. - * - * @return string[] - * Array of selectors, keyed by field name. - */ - protected function fieldSelectors() { - $fields = []; - foreach ($this->configuration['fields'] as $field_info) { - if (isset($field_info['selector'])) { - $fields[$field_info['name']] = $field_info['selector']; - } - } - return $fields; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginInterface.php b/sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginInterface.php deleted file mode 100644 index 838ca9d36..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/DataParserPluginInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -alterInfo('data_parser_info'); - $this->setCacheBackend($cache_backend, 'migrate_plus_plugins_data_parser'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/Migration.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/Migration.php deleted file mode 100644 index 64992cd7c..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/Migration.php +++ /dev/null @@ -1,98 +0,0 @@ -createInstance($plugin_id); - $entity_array['id'] = $new_plugin_id; - $entity_array['migration_tags'] = $migration_plugin->get('migration_tags'); - $entity_array['label'] = $migration_plugin->label(); - $entity_array['source'] = $migration_plugin->getSourceConfiguration(); - $entity_array['destination'] = $migration_plugin->getDestinationConfiguration(); - $entity_array['process'] = $migration_plugin->getProcess(); - $entity_array['migration_dependencies'] = $migration_plugin->getMigrationDependencies(); - $migration_entity = static::create($entity_array); - return $migration_entity; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroup.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroup.php deleted file mode 100644 index 96845b031..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroup.php +++ /dev/null @@ -1,85 +0,0 @@ -condition('migration_group', $this->id()); - $names = $query->execute(); - - // Order the migrations according to their dependencies. - /** @var MigrationInterface[] $migrations */ - $migrations = \Drupal::entityTypeManager()->getStorage('migration')->loadMultiple($names); - - // Delete in reverse order, so dependencies are never violated. - $migrations = array_reverse($migrations); - - foreach ($migrations as $migration) { - $migration->delete(); - } - - // Finally, delete the group itself. - parent::delete(); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - parent::calculateDependencies(); - // Make sure we save any explicit module dependencies. - if ($provider = $this->get('module')) { - $this->addDependency('module', $provider); - } - return $this->dependencies; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroupInterface.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroupInterface.php deleted file mode 100644 index 9dde2f2e4..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Entity/MigrationGroupInterface.php +++ /dev/null @@ -1,12 +0,0 @@ -row = $row; - $this->source = $source; - $this->migration = $migration; - } - - /** - * Gets the row object. - * - * @return \Drupal\migrate\Row - * The row object about to be imported. - */ - public function getRow() { - return $this->row; - } - - /** - * Gets the source plugin. - * - * @return \Drupal\migrate\Plugin\MigrateSourceInterface - * The source plugin firing the event. - */ - public function getSource() { - return $this->source; - } - - /** - * Gets the migration plugin. - * - * @return \Drupal\migrate\Plugin\MigrationInterface - * The migration entity being imported. - */ - public function getMigration() { - return $this->migration; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/MigrationConfigDeriver.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/MigrationConfigDeriver.php deleted file mode 100644 index d66892128..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/MigrationConfigDeriver.php +++ /dev/null @@ -1,32 +0,0 @@ -derivatives = []; - $migrations = Migration::loadMultiple(); - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */ - foreach ($migrations as $id => $migration) { - if (!$migration->status()) { - continue; - } - - $this->derivatives[$id] = $migration->toArray(); - } - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/destination/Table.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/destination/Table.php deleted file mode 100755 index f04d9f66d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/destination/Table.php +++ /dev/null @@ -1,143 +0,0 @@ -dbConnection = $connection; - $this->tableName = $configuration['table_name']; - $this->idFields = $configuration['id_fields']; - $this->fields = isset($configuration['fields']) ? $configuration['fields'] : []; - $this->supportsRollback = TRUE; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { - $db_key = !empty($configuration['database_key']) ? $configuration['database_key'] : NULL; - - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $migration, - Database::getConnection('default', $db_key) - ); - } - - /** - * {@inheritdoc} - */ - public function getIds() { - if (empty($this->idFields)) { - throw new MigrateException('Id fields are required for a table destination'); - } - return $this->idFields; - } - - /** - * {@inheritdoc} - */ - public function fields(MigrationInterface $migration = NULL) { - return $this->fields; - } - - /** - * {@inheritdoc} - */ - public function import(Row $row, array $old_destination_id_values = []) { - $id = $row->getSourceIdValues(); - if (count($id) != count($this->idFields)) { - throw new MigrateSkipProcessException('All the id fields are required for a table migration.'); - } - - $values = $row->getDestination(); - - if ($this->fields) { - $values = array_intersect_key($values, $this->fields); - } - - $status = $this->dbConnection->merge($this->tableName) - ->key($id) - ->fields($values) - ->execute(); - - return $status ? $id : NULL; - } - - /** - * {@inheritdoc} - */ - public function rollback(array $destination_identifier) { - $delete = $this->dbConnection->delete($this->tableName); - foreach ($destination_identifier as $field => $value) { - $delete->condition($field, $value); - } - $delete->execute(); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/ArrayPop.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/ArrayPop.php deleted file mode 100644 index d4749caff..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/ArrayPop.php +++ /dev/null @@ -1,44 +0,0 @@ -getProcessPlugin = $migratePluginManager->createInstance('get', ['source' => $configuration['values']]); - } - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition, MigrationInterface $migration = NULL) { - return new static( - $configuration, - $pluginId, - $pluginDefinition, - $migration, - $container->get('entity.manager'), - $container->get('plugin.manager.entity_reference_selection'), - $container->get('plugin.manager.migrate.process') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrateExecutable, Row $row, $destinationProperty) { - $this->row = $row; - $this->migrateExecutable = $migrateExecutable; - // Creates an entity if the lookup determines it doesn't exist. - if (!($result = parent::transform($value, $migrateExecutable, $row, $destinationProperty))) { - $result = $this->generateEntity($value); - } - - return $result; - } - - /** - * Generates an entity for a given value. - * - * @param string $value - * Value to use in creation of the entity. - * - * @return int|string - * The entity id of the generated entity. - */ - protected function generateEntity($value) { - if (!empty($value)) { - $entity = $this->entityManager - ->getStorage($this->lookupEntityType) - ->create($this->entity($value)); - $entity->save(); - - return $entity->id(); - } - } - - /** - * Fabricate an entity. - * - * This is intended to be extended by implementing classes to provide for more - * dynamic default values, rather than just static ones. - * - * @param mixed $value - * Primary value to use in creation of the entity. - * - * @return array - * Entity value array. - */ - protected function entity($value) { - $entity_values = [$this->lookupValueKey => $value]; - - if ($this->lookupBundleKey) { - $entity_values[$this->lookupBundleKey] = $this->lookupBundle; - } - - // Gather any static default values for properties/fields. - if (isset($this->configuration['default_values']) && is_array($this->configuration['default_values'])) { - foreach ($this->configuration['default_values'] as $key => $value) { - $entity_values[$key] = $value; - } - } - // Gather any additional properties/fields. - if (isset($this->configuration['values']) && is_array($this->configuration['values'])) { - foreach ($this->configuration['values'] as $key => $property) { - $source_value = $this->getProcessPlugin->transform(NULL, $this->migrateExecutable, $this->row, $property); - $entity_values[$key] = $source_value; - } - } - - return $entity_values; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/EntityLookup.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/EntityLookup.php deleted file mode 100644 index 7ed4e84d2..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/EntityLookup.php +++ /dev/null @@ -1,300 +0,0 @@ -migration = $migration; - $this->entityManager = $entityManager; - $this->selectionPluginManager = $selectionPluginManager; - $pluginIdParts = explode(':', $this->migration->getDestinationPlugin()->getPluginId()); - $this->destinationEntityType = empty($pluginIdParts[1]) ? NULL : $pluginIdParts[1]; - $this->destinationBundleKey = $this->destinationEntityType ? $this->entityManager->getDefinition($this->destinationEntityType)->getKey('bundle') : NULL; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition, MigrationInterface $migration = NULL) { - return new static( - $configuration, - $pluginId, - $pluginDefinition, - $migration, - $container->get('entity.manager'), - $container->get('plugin.manager.entity_reference_selection') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrateExecutable, Row $row, $destinationProperty) { - // If the source data is an empty array, return the same. - if (gettype($value) === 'array' && count($value) === 0) { - return []; - } - - // In case of subfields ('field_reference/target_id'), extract the field - // name only. - $parts = explode('/', $destinationProperty); - $destinationProperty = reset($parts); - $this->determineLookupProperties($destinationProperty); - - $this->destinationProperty = isset($this->configuration['destination_field']) ? $this->configuration['destination_field'] : NULL; - - return $this->query($value); - } - - /** - * Determine the lookup properties from config or target field configuration. - * - * @param string $destinationProperty - * The destination property currently worked on. This is only used together - * with the $row above. - */ - protected function determineLookupProperties($destinationProperty) { - if (!empty($this->configuration['value_key'])) { - $this->lookupValueKey = $this->configuration['value_key']; - } - if (!empty($this->configuration['bundle_key'])) { - $this->lookupBundleKey = $this->configuration['bundle_key']; - } - if (!empty($this->configuration['bundle'])) { - $this->lookupBundle = $this->configuration['bundle']; - } - if (!empty($this->configuration['entity_type'])) { - $this->lookupEntityType = $this->configuration['entity_type']; - } - - if (empty($this->lookupValueKey) || empty($this->lookupBundleKey) || empty($this->lookupBundle) || empty($this->lookupEntityType)) { - // See if we can introspect the lookup properties from destination field. - if (!empty($this->migration->getProcess()[$this->destinationBundleKey][0]['default_value'])) { - $destinationEntityBundle = $this->migration->getProcess()[$this->destinationBundleKey][0]['default_value']; - $fieldConfig = $this->entityManager->getFieldDefinitions($this->destinationEntityType, $destinationEntityBundle)[$destinationProperty]->getConfig($destinationEntityBundle); - switch ($fieldConfig->getType()) { - case 'entity_reference': - if (empty($this->lookupBundle)) { - $handlerSettings = $fieldConfig->getSetting('handler_settings'); - $bundles = array_filter((array) $handlerSettings['target_bundles']); - if (count($bundles) == 1) { - $this->lookupBundle = reset($bundles); - } - // This was added in 8.1.x is not supported in 8.0.x. - elseif (!empty($handlerSettings['auto_create']) && !empty($handlerSettings['auto_create_bundle'])) { - $this->lookupBundle = reset($handlerSettings['auto_create_bundle']); - } - } - - // Make an assumption that if the selection handler can target more - // than one type of entity that we will use the first entity type. - $this->lookupEntityType = $this->lookupEntityType ?: reset($this->selectionPluginManager->createInstance($fieldConfig->getSetting('handler'))->getPluginDefinition()['entity_types']); - $this->lookupValueKey = $this->lookupValueKey ?: $this->entityManager->getDefinition($this->lookupEntityType)->getKey('label'); - $this->lookupBundleKey = $this->lookupBundleKey ?: $this->entityManager->getDefinition($this->lookupEntityType)->getKey('bundle'); - break; - - case 'file': - case 'image': - $this->lookupEntityType = 'file'; - $this->lookupValueKey = $this->lookupValueKey ?: 'uri'; - break; - - default: - throw new MigrateException(sprintf('Destination field type %s is not a recognized reference type.', $fieldConfig->getType())); - } - } - } - - // If there aren't enough lookup properties available by now, then bail. - if (empty($this->lookupValueKey)) { - throw new MigrateException('The entity_lookup plugin requires a value_key, none located.'); - } - if (!empty($this->lookupBundleKey) && empty($this->lookupBundle)) { - throw new MigrateException('The entity_lookup plugin found no bundle but destination entity requires one.'); - } - if (empty($this->lookupEntityType)) { - throw new MigrateException('The entity_lookup plugin requires a entity_type, none located.'); - } - } - - /** - * Checks for the existence of some value. - * - * @param mixed $value - * The value to query. - * - * @return mixed|null - * Entity id if the queried entity exists. Otherwise NULL. - */ - protected function query($value) { - // Entity queries typically are case-insensitive. Therefore, we need to - // handle case sensitive filtering as a post-query step. By default, it - // filters case insensitive. Change to true if that is not the desired - // outcome. - $ignoreCase = !empty($this->configuration['ignore_case']) ?: FALSE; - - $multiple = is_array($value); - - $query = $this->entityManager->getStorage($this->lookupEntityType) - ->getQuery() - ->condition($this->lookupValueKey, $value, $multiple ? 'IN' : NULL); - // Sqlite and possibly others returns data in a non-deterministic order. - // Make it deterministic. - if ($multiple) { - $query->sort($this->lookupValueKey, 'DESC'); - } - - if ($this->lookupBundleKey) { - $query->condition($this->lookupBundleKey, $this->lookupBundle); - } - $results = $query->execute(); - - if (empty($results)) { - return NULL; - } - - // By default do a case-sensitive comparison. - if (!$ignoreCase) { - // Returns the entity's identifier. - foreach ($results as $k => $identifier) { - $entity = $this->entityManager->getStorage($this->lookupEntityType)->load($identifier); - $result_value = $entity instanceof ConfigEntityInterface ? $entity->get($this->lookupValueKey) : $entity->get($this->lookupValueKey)->value; - if (($multiple && !in_array($result_value, $value, TRUE)) || (!$multiple && $result_value !== $value)) { - unset($results[$k]); - } - } - } - - if ($multiple && !empty($this->destinationProperty)) { - array_walk($results, function (&$value) { - $value = [$this->destinationProperty => $value]; - }); - } - - return $multiple ? array_values($results) : reset($results); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/FileBlob.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/FileBlob.php deleted file mode 100644 index 22341b6bc..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/FileBlob.php +++ /dev/null @@ -1,155 +0,0 @@ - FALSE, - ]; - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->fileSystem = $file_system; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('file_system') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - // If we're stubbing a file entity, return a URI of NULL so it will get - // stubbed by the general process. - if ($row->isStub()) { - return NULL; - } - list($destination, $blob) = $value; - - // Determine if we going to overwrite existing files or not touch them. - $replace = $this->getOverwriteMode(); - - // Attempt to save the file to avoid calling file_prepare_directory() any - // more than absolutely necessary. - if ($this->putFile($destination, $blob, $replace)) { - return $destination; - } - $dir = $this->getDirectory($destination); - if (!file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) { - throw new MigrateSkipProcessException("Could not create directory '$dir'"); - } - if ($this->putFile($destination, $blob, $replace)) { - return $destination; - } - throw new MigrateSkipProcessException("Blob data could not be copied to $destination."); - } - - /** - * Try to save the file. - * - * @param string $destination - * The destination path or URI. - * @param string $blob - * The base64 encoded file contents. - * @param int $replace - * (optional) FILE_EXISTS_REPLACE (default) or FILE_EXISTS_ERROR, depending - * on the configuration. - * - * @return bool|string - * File path on success, FALSE on failure. - */ - protected function putFile($destination, $blob, $replace = FILE_EXISTS_REPLACE) { - if ($path = file_destination($destination, $replace)) { - if (file_put_contents($path, $blob)) { - return $path; - } - else { - return FALSE; - } - } - - // File was already copied. - return $destination; - } - - /** - * Determines how to handle file conflicts. - * - * @return int - * Either FILE_EXISTS_REPLACE (default) or FILE_EXISTS_ERROR, depending on - * the configuration. - */ - protected function getOverwriteMode() { - if (!empty($this->configuration['reuse'])) { - return FILE_EXISTS_ERROR; - } - - return FILE_EXISTS_REPLACE; - } - - /** - * Returns the directory component of a URI or path. - * - * For URIs like public://foo.txt, the full physical path of public:// - * will be returned, since a scheme by itself will trip up certain file - * API functions (such as file_prepare_directory()). - * - * @param string $uri - * The URI or path. - * - * @return string|false - * The directory component of the path or URI, or FALSE if it could not - * be determined. - */ - protected function getDirectory($uri) { - $dir = $this->fileSystem->dirname($uri); - if (substr($dir, -3) == '://') { - return $this->fileSystem->realpath($dir); - } - return $dir; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Merge.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Merge.php deleted file mode 100644 index d6b32bbc0..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Merge.php +++ /dev/null @@ -1,68 +0,0 @@ - $item) { - if (!is_array($item)) { - throw new MigrateException(sprintf('Merge process failed for destination property (%s): index (%s) in the source value is not an array that can be merged.', $destination_property, $i)); - } - $new_value = array_merge($new_value, $item); - } - return $new_value; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/MultipleValues.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/MultipleValues.php deleted file mode 100644 index be6779a12..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/MultipleValues.php +++ /dev/null @@ -1,58 +0,0 @@ -configuration['value']) && !array_key_exists('value', $this->configuration)) { - throw new MigrateException('Skip on value plugin is missing value configuration.'); - } - - if (is_array($this->configuration['value'])) { - $value_in_array = FALSE; - $not_equals = isset($this->configuration['not_equals']); - - foreach ($this->configuration['value'] as $skipValue) { - $value_in_array |= $this->compareValue($value, $skipValue); - } - - if (($not_equals && !$value_in_array) || (!$not_equals && $value_in_array)) { - throw new MigrateSkipRowException(); - } - } - elseif ($this->compareValue($value, $this->configuration['value'], !isset($this->configuration['not_equals']))) { - throw new MigrateSkipRowException(); - } - - return $value; - } - - /** - * {@inheritdoc} - */ - public function process($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - if (empty($this->configuration['value']) && !array_key_exists('value', $this->configuration)) { - throw new MigrateException('Skip on value plugin is missing value configuration.'); - } - - if (is_array($this->configuration['value'])) { - $value_in_array = FALSE; - $not_equals = isset($this->configuration['not_equals']); - - foreach ($this->configuration['value'] as $skipValue) { - $value_in_array |= $this->compareValue($value, $skipValue); - } - - if (($not_equals && !$value_in_array) || (!$not_equals && $value_in_array)) { - throw new MigrateSkipProcessException(); - } - } - elseif ($this->compareValue($value, $this->configuration['value'], !isset($this->configuration['not_equals']))) { - throw new MigrateSkipProcessException(); - } - - return $value; - } - - /** - * Compare values to see if they are equal. - * - * @param mixed $value - * Actual value. - * @param mixed $skipValue - * Value to compare against. - * @param bool $equal - * Compare as equal or not equal. - * - * @return bool - * True if the compare successfully, FALSE otherwise. - */ - protected function compareValue($value, $skipValue, $equal = TRUE) { - if ($equal) { - return (string) $value == (string) $skipValue; - } - - return (string) $value != (string) $skipValue; - - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/StrReplace.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/StrReplace.php deleted file mode 100644 index dcff096b8..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/StrReplace.php +++ /dev/null @@ -1,113 +0,0 @@ -configuration['search'])) { - throw new MigrateException('"search" must be configured.'); - } - if (!isset($this->configuration['replace'])) { - throw new MigrateException('"replace" must be configured.'); - } - $this->multiple = is_array($value); - $this->configuration += [ - 'case_insensitive' => FALSE, - 'regex' => FALSE, - ]; - $function = "str_replace"; - if ($this->configuration['case_insensitive']) { - $function = 'str_ireplace'; - } - if ($this->configuration['regex']) { - $function = 'preg_replace'; - } - return $function($this->configuration['search'], $this->configuration['replace'], $value); - } - - /** - * {@inheritdoc} - */ - public function multiple() { - return $this->multiple; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Transliteration.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Transliteration.php deleted file mode 100644 index 217869e20..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/process/Transliteration.php +++ /dev/null @@ -1,83 +0,0 @@ -transliteration = $transliteration; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('transliteration') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - return $this->transliteration->transliterate($value, LanguageInterface::LANGCODE_DEFAULT, '_'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/SourcePluginExtension.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/SourcePluginExtension.php deleted file mode 100644 index 19ca6a9a2..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/SourcePluginExtension.php +++ /dev/null @@ -1,60 +0,0 @@ -fields = $configuration['fields']; - $this->ids = $configuration['ids']; - } - - /** - * {@inheritdoc} - */ - public function fields() { - $fields = []; - foreach ($this->fields as $field_info) { - $fields[$field_info['name']] = isset($field_info['label']) ? $field_info['label'] : $field_info['name']; - } - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getIds() { - return $this->ids; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/Url.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/Url.php deleted file mode 100644 index 242223b61..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate/source/Url.php +++ /dev/null @@ -1,78 +0,0 @@ -sourceUrls = $configuration['urls']; - } - - /** - * Return a string representing the source URLs. - * - * @return string - * Comma-separated list of URLs being imported. - */ - public function __toString() { - // This could cause a problem when using a lot of urls, may need to hash. - $urls = implode(', ', $this->sourceUrls); - return $urls; - } - - /** - * Returns the initialized data parser plugin. - * - * @return \Drupal\migrate_plus\DataParserPluginInterface - * The data parser plugin. - */ - public function getDataParserPlugin() { - if (!isset($this->dataParserPlugin)) { - $this->dataParserPlugin = \Drupal::service('plugin.manager.migrate_plus.data_parser')->createInstance($this->configuration['data_parser_plugin'], $this->configuration); - } - return $this->dataParserPlugin; - } - - /** - * Creates and returns a filtered Iterator over the documents. - * - * @return \Iterator - * An iterator over the documents providing source rows that match the - * configured item_selector. - */ - protected function initializeIterator() { - return $this->getDataParserPlugin(); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Basic.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Basic.php deleted file mode 100755 index f1ca69ab6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Basic.php +++ /dev/null @@ -1,30 +0,0 @@ - [ - $this->configuration['username'], - $this->configuration['password'], - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Digest.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Digest.php deleted file mode 100755 index 246653430..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/Digest.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - $this->configuration['username'], - $this->configuration['password'], - 'digest', - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/OAuth2.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/OAuth2.php deleted file mode 100755 index 116314d6b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/authentication/OAuth2.php +++ /dev/null @@ -1,69 +0,0 @@ - $handlerStack, - 'base_uri' => $this->configuration['base_uri'], - 'auth' => 'oauth2', - ]); - - switch ($this->configuration['grant_type']) { - case 'authorization_code': - $grant_type = new AuthorizationCode($client, $this->configuration); - break; - case 'client_credentials': - $grant_type = new ClientCredentials($client, $this->configuration); - break; - case 'urn:ietf:params:oauth:grant-type:jwt-bearer': - $grant_type = new JwtBearer($client, $this->configuration); - break; - case 'password': - $grant_type = new PasswordCredentials($client, $this->configuration); - break; - case 'refresh_token': - $grant_type = new RefreshToken($client, $this->configuration); - break; - default: - throw new MigrateException("Unrecognized grant_type {$this->configuration['grant_type']}."); - break; - } - $middleware = new OAuthMiddleware($client, $grant_type); - - return [ - 'headers' => [ - 'Authorization' => 'Bearer ' . $middleware->getAccessToken()->getToken(), - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/File.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/File.php deleted file mode 100644 index 33e3cae5c..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/File.php +++ /dev/null @@ -1,52 +0,0 @@ -getResponse($url); - return $response; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/Http.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/Http.php deleted file mode 100755 index db4c423a6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_fetcher/Http.php +++ /dev/null @@ -1,121 +0,0 @@ -httpClient = \Drupal::httpClient(); - - // Ensure there is a 'headers' key in the configuration. - $configuration += ['headers' => []]; - $this->setRequestHeaders($configuration['headers']); - } - - /** - * Returns the initialized authentication plugin. - * - * @return \Drupal\migrate_plus\AuthenticationPluginInterface - * The authentication plugin. - */ - public function getAuthenticationPlugin() { - if (!isset($this->authenticationPlugin)) { - $this->authenticationPlugin = \Drupal::service('plugin.manager.migrate_plus.authentication')->createInstance($this->configuration['authentication']['plugin'], $this->configuration['authentication']); - } - return $this->authenticationPlugin; - } - - /** - * {@inheritdoc} - */ - public function setRequestHeaders(array $headers) { - $this->headers = $headers; - } - - /** - * {@inheritdoc} - */ - public function getRequestHeaders() { - return !empty($this->headers) ? $this->headers : []; - } - - /** - * {@inheritdoc} - */ - public function getResponse($url) { - try { - $options = ['headers' => $this->getRequestHeaders()]; - if (!empty($this->configuration['authentication'])) { - $options = array_merge($options, $this->getAuthenticationPlugin()->getAuthenticationOptions()); - } - $response = $this->httpClient->get($url, $options); - if (empty($response)) { - throw new MigrateException('No response at ' . $url . '.'); - } - } - catch (RequestException $e) { - throw new MigrateException('Error message: ' . $e->getMessage() . ' at ' . $url . '.'); - } - return $response; - } - - /** - * {@inheritdoc} - */ - public function getResponseContent($url) { - $response = $this->getResponse($url); - return $response->getBody(); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Json.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Json.php deleted file mode 100755 index 7ef4467d0..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Json.php +++ /dev/null @@ -1,131 +0,0 @@ -getDataFetcherPlugin()->getResponseContent($url); - - // Convert objects to associative arrays. - $source_data = json_decode($response, TRUE); - - // If json_decode() has returned NULL, it might be that the data isn't - // valid utf8 - see http://php.net/manual/en/function.json-decode.php#86997. - if (is_null($source_data)) { - $utf8response = utf8_encode($response); - $source_data = json_decode($utf8response, TRUE); - } - - // Backwards-compatibility for depth selection. - if (is_int($this->itemSelector)) { - return $this->selectByDepth($source_data); - } - - // Otherwise, we're using xpath-like selectors. - $selectors = explode('/', trim($this->itemSelector, '/')); - foreach ($selectors as $selector) { - if (!empty($selector)) { - $source_data = $source_data[$selector]; - } - } - return $source_data; - } - - /** - * Get the source data for reading. - * - * @param array $raw_data - * Raw data from the JSON feed. - * - * @return array - * Selected items at the requested depth of the JSON feed. - */ - protected function selectByDepth(array $raw_data) { - // Return the results in a recursive iterator that can traverse - // multidimensional arrays. - $iterator = new \RecursiveIteratorIterator( - new \RecursiveArrayIterator($raw_data), - \RecursiveIteratorIterator::SELF_FIRST); - $items = []; - // Backwards-compatibility - an integer item_selector is interpreted as a - // depth. When there is an array of items at the expected depth, pull that - // array out as a distinct item. - $identifierDepth = $this->itemSelector; - $iterator->rewind(); - while ($iterator->valid()) { - $item = $iterator->current(); - if (is_array($item) && $iterator->getDepth() == $identifierDepth) { - $items[] = $item; - } - $iterator->next(); - } - return $items; - } - - /** - * {@inheritdoc} - */ - protected function openSourceUrl($url) { - // (Re)open the provided URL. - $source_data = $this->getSourceData($url); - $this->iterator = new \ArrayIterator($source_data); - return TRUE; - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $current = $this->iterator->current(); - if ($current) { - foreach ($this->fieldSelectors() as $field_name => $selector) { - $field_data = $current; - $field_selectors = explode('/', trim($selector, '/')); - foreach ($field_selectors as $field_selector) { - if (is_array($field_data) && array_key_exists($field_selector, $field_data)) { - $field_data = $field_data[$field_selector]; - } - else { - $field_data = ''; - } - } - $this->currentItem[$field_name] = $field_data; - } - if (!empty($this->configuration['include_raw_data'])) { - $this->currentItem['raw'] = $current; - } - $this->iterator->next(); - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/SimpleXml.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/SimpleXml.php deleted file mode 100644 index 8a58d8b07..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/SimpleXml.php +++ /dev/null @@ -1,87 +0,0 @@ -getDataFetcherPlugin()->getResponseContent($url); - $xml = simplexml_load_string($xml_data); - $this->registerNamespaces($xml); - $xpath = $this->configuration['item_selector']; - $this->matches = $xml->xpath($xpath); - foreach (libxml_get_errors() as $error) { - $error_string = self::parseLibXmlError($error); - throw new MigrateException($error_string); - } - return TRUE; - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $target_element = array_shift($this->matches); - - // If we've found the desired element, populate the currentItem and - // currentId with its data. - if ($target_element !== FALSE && !is_null($target_element)) { - foreach ($this->fieldSelectors() as $field_name => $xpath) { - foreach ($target_element->xpath($xpath) as $value) { - if ($value->children() && !trim((string) $value)) { - $this->currentItem[$field_name] = $value; - } - else { - $this->currentItem[$field_name][] = (string) $value; - } - } - } - // Reduce single-value results to scalars. - foreach ($this->currentItem as $field_name => $values) { - if (is_array($values) && count($values) == 1) { - $this->currentItem[$field_name] = reset($values); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Soap.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Soap.php deleted file mode 100755 index 7f8c694e2..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Soap.php +++ /dev/null @@ -1,130 +0,0 @@ -function = $configuration['function']; - $this->parameters = $configuration['parameters']; - $this->responseType = $configuration['response_type']; - } - - /** - * {@inheritdoc} - * - * @throws \SoapFault - * If there's an error in a SOAP call. - * @throws \Drupal\migrate\MigrateException - * If we can't resolve the SOAP function or its response property. - */ - protected function openSourceUrl($url) { - // Will throw SoapFault if there's an error in a SOAP call. - $client = new \SoapClient($url); - // Determine the response property name. - $function_found = FALSE; - foreach ($client->__getFunctions() as $function_signature) { - // E.g., "GetWeatherResponse GetWeather(GetWeather $parameters)". - $response_type = strtok($function_signature, ' '); - $function_name = strtok('('); - if (strcasecmp($function_name, $this->function) === 0) { - $function_found = TRUE; - foreach ($client->__getTypes() as $type_info) { - // E.g., "struct GetWeatherResponse {\n string GetWeatherResult;\n}". - if (preg_match('|struct (.*?) {\s*[a-z]+ (.*?);|is', $type_info, $matches)) { - if ($matches[1] == $response_type) { - $response_property = $matches[2]; - } - } - } - break; - } - } - if (!$function_found) { - throw new MigrateException("SOAP function {$this->function} not found."); - } - elseif (!isset($response_property)) { - throw new MigrateException("Response property not found for SOAP function {$this->function}."); - } - $response = $client->{$this->function}($this->parameters); - $response_value = $response->$response_property; - switch ($this->responseType) { - case 'xml': - $xml = simplexml_load_string($response_value); - $this->iterator = new \ArrayIterator($xml->xpath($this->itemSelector)); - break; - case 'object': - $this->iterator = new \ArrayIterator($response_value->{$this->itemSelector}); - break; - case 'array': - $this->iterator = new \ArrayIterator($response_value[$this->itemSelector]); - break; - } - return TRUE; - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $current = $this->iterator->current(); - if ($current) { - foreach ($this->fieldSelectors() as $field_name => $selector) { - $this->currentItem[$field_name] = $current->$selector; - } - $this->iterator->next(); - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Xml.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Xml.php deleted file mode 100644 index 6c0806927..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/Xml.php +++ /dev/null @@ -1,321 +0,0 @@ - 'file', 1 => 'article']. - * - * @var array - */ - protected $elementsToMatch = []; - - /** - * An optional xpath predicate. - * - * Restricts the matching elements based on values in their children. Parsed - * from the element query at construct time. - * - * @var string - */ - protected $xpathPredicate = NULL; - - /** - * Array representing the path to the current element as we traverse the XML. - * - * For example, if in an XML string like '
        ...
        ' - * we are positioned within the article element, currentPath will be - * [0 => 'file', 1 => 'article']. - * - * @var array - */ - protected $currentPath = []; - - /** - * Retains all elements with a given name to support extraction from parents. - * - * This is a hack to support field extraction of values in parents - * of the 'context node' - ie, if $this->fields() has something like '..\nid'. - * Since we are using a streaming xml processor, it is too late to snoop - * around parent elements again once we've located an element of interest. So, - * grab elements with matching names and their depths, and refer back to it - * when building the source row. - * - * @var array - */ - protected $parentXpathCache = []; - - /** - * Hash of the element names that should be captured into $parentXpathCache. - * - * @var array - */ - protected $parentElementsOfInterest = []; - - /** - * Element name matching mode. - * - * When matching element names, whether to compare to the namespace-prefixed - * name, or the local name. - * - * @var bool - */ - protected $prefixedName = FALSE; - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - - $this->reader = new \XMLReader(); - - // Suppress errors during parsing, so we can pick them up after. - libxml_use_internal_errors(TRUE); - - // Parse the element query. First capture group is the element path, second - // (if present) is the attribute. - preg_match_all('|^/([^\[]+)\[?(.*?)]?$|', $configuration['item_selector'], $matches); - $element_path = $matches[1][0]; - $this->elementsToMatch = explode('/', $element_path); - $predicate = $matches[2][0]; - if ($predicate) { - $this->xpathPredicate = $predicate; - } - - // If the element path contains any colons, it must be specifying - // namespaces, so we need to compare using the prefixed element - // name in next(). - if (strpos($element_path, ':')) { - $this->prefixedName = TRUE; - } - - foreach ($this->fieldSelectors() as $field_name => $xpath) { - $prefix = substr($xpath, 0, 3); - if ($prefix === '../') { - $this->parentElementsOfInterest[] = str_replace('../', '', $xpath); - } - elseif ($prefix === '..\\') { - $this->parentElementsOfInterest[] = str_replace('..\\', '', $xpath); - } - } - } - - /** - * Builds a \SimpleXmlElement rooted at the iterator's current location. - * - * The resulting SimpleXmlElement also contains any child nodes of the current - * element. - * - * @return \SimpleXmlElement|false - * A \SimpleXmlElement when the document is parseable, or false if a - * parsing error occurred. - * - * @throws MigrateException - */ - protected function getSimpleXml() { - $node = $this->reader->expand(); - if ($node) { - // We must associate the DOMNode with a DOMDocument to be able to import - // it into SimpleXML. Despite appearances, this is almost twice as fast as - // simplexml_load_string($this->readOuterXML()); - $dom = new \DOMDocument(); - $node = $dom->importNode($node, TRUE); - $dom->appendChild($node); - $sxml_elem = simplexml_import_dom($node); - $this->registerNamespaces($sxml_elem); - return $sxml_elem; - } - else { - foreach (libxml_get_errors() as $error) { - $error_string = self::parseLibXmlError($error); - throw new MigrateException($error_string); - } - return FALSE; - } - } - - /** - * {@inheritdoc} - */ - public function rewind() { - // Reset our path tracker. - $this->currentPath = []; - parent::rewind(); - } - - /** - * {@inheritdoc} - */ - protected function openSourceUrl($url) { - // (Re)open the provided URL. - $this->reader->close(); - - // Clear XML error buffer. Other Drupal code that executed during the - // migration may have polluted the error buffer and could create false - // positives in our error check below. We are only concerned with errors - // that occur from attempting to load the XML string into an object here. - libxml_clear_errors(); - - return $this->reader->open($url, NULL, \LIBXML_NOWARNING); - } - - /** - * {@inheritdoc} - */ - protected function fetchNextRow() { - $target_element = NULL; - - // Loop over each node in the XML file, looking for elements at a path - // matching the input query string (represented in $this->elementsToMatch). - while ($this->reader->read()) { - if ($this->reader->nodeType == \XMLReader::ELEMENT) { - if ($this->prefixedName) { - $this->currentPath[$this->reader->depth] = $this->reader->name; - if (in_array($this->reader->name, $this->parentElementsOfInterest)) { - $this->parentXpathCache[$this->reader->depth][$this->reader->name][] = $this->getSimpleXml(); - } - } - else { - $this->currentPath[$this->reader->depth] = $this->reader->localName; - if (in_array($this->reader->localName, $this->parentElementsOfInterest)) { - $this->parentXpathCache[$this->reader->depth][$this->reader->name][] = $this->getSimpleXml(); - } - } - if ($this->currentPath == $this->elementsToMatch) { - // We're positioned to the right element path - build the SimpleXML - // object to enable proper xpath predicate evaluation. - $target_element = $this->getSimpleXml(); - if ($target_element !== FALSE) { - if (empty($this->xpathPredicate) || $this->predicateMatches($target_element)) { - break; - } - } - } - } - elseif ($this->reader->nodeType == \XMLReader::END_ELEMENT) { - // Remove this element and any deeper ones from the current path. - foreach ($this->currentPath as $depth => $name) { - if ($depth >= $this->reader->depth) { - unset($this->currentPath[$depth]); - } - } - foreach ($this->parentXpathCache as $depth => $elements) { - if ($depth > $this->reader->depth) { - unset($this->parentXpathCache[$depth]); - } - } - } - } - - // If we've found the desired element, populate the currentItem and - // currentId with its data. - if ($target_element !== FALSE && !is_null($target_element)) { - foreach ($this->fieldSelectors() as $field_name => $xpath) { - $prefix = substr($xpath, 0, 3); - if (in_array($prefix, ['../', '..\\'])) { - $name = str_replace($prefix, '', $xpath); - $up = substr_count($xpath, $prefix); - $values = $this->getAncestorElements($up, $name); - } - else { - $values = $target_element->xpath($xpath); - } - foreach ($values as $value) { - // If the SimpleXMLElement doesn't render to a string of any sort, - // and has children then return the whole object for the process - // plugin or other row manipulation. - if ($value->children() && !trim((string) $value)) { - $this->currentItem[$field_name] = $value; - } - else { - $this->currentItem[$field_name][] = (string) $value; - } - } - } - // Reduce single-value results to scalars. - foreach ($this->currentItem as $field_name => $values) { - if (count($values) == 1) { - $this->currentItem[$field_name] = reset($values); - } - } - } - } - - /** - * Tests whether the iterator's xpath predicate matches the provided element. - * - * Has some limitations esp. in that it is easy to write predicates that - * reference things outside this SimpleXmlElement's tree, but "simpler" - * predicates should work as expected. - * - * @param \SimpleXMLElement $elem - * The element to test. - * - * @return bool - * True if the element matches the predicate, false if not. - */ - protected function predicateMatches(\SimpleXMLElement $elem) { - return !empty($elem->xpath('/*[' . $this->xpathPredicate . ']')); - } - - /** - * Gets an ancestor SimpleXMLElement, if the element name was registered. - * - * Gets the SimpleXMLElement some number of levels above the iterator - * having the given name, but only for element names that this - * Xml data parser was told to retain for future reference through the - * constructor's $parent_elements_of_interest. - * - * @param int $levels_up - * The number of levels back towards the root of the DOM tree to ascend - * before searching for the named element. - * @param string $name - * The name of the desired element. - * - * @return \SimpleXMLElement|false - * The element matching the level and name requirements, or false if it is - * not present or was not retained. - */ - public function getAncestorElements($levels_up, $name) { - if ($levels_up > 0) { - $levels_up *= -1; - } - $ancestor_depth = $this->reader->depth + $levels_up + 1; - if ($ancestor_depth < 0) { - return FALSE; - } - - if (array_key_exists($ancestor_depth, $this->parentXpathCache) && array_key_exists($name, $this->parentXpathCache[$ancestor_depth])) { - return $this->parentXpathCache[$ancestor_depth][$name]; - } - else { - return FALSE; - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/XmlTrait.php b/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/XmlTrait.php deleted file mode 100644 index 28519ba51..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/src/Plugin/migrate_plus/data_parser/XmlTrait.php +++ /dev/null @@ -1,62 +0,0 @@ -configuration['namespaces']) && is_array($this->configuration['namespaces'])) { - foreach ($this->configuration['namespaces'] as $prefix => $ns) { - $xml->registerXPathNamespace($prefix, $ns); - } - } - } - - /** - * Parses a LibXMLError to a error message string. - * - * @param \LibXMLError $error - * Error thrown by the XML. - * - * @return string - * Error message - */ - public static function parseLibXmlError(\LibXMLError $error) { - $error_code_name = 'Unknown Error'; - switch ($error->level) { - case LIBXML_ERR_WARNING: - $error_code_name = t('Warning'); - break; - - case LIBXML_ERR_ERROR: - $error_code_name = t('Error'); - break; - - case LIBXML_ERR_FATAL: - $error_code_name = t('Fatal Error'); - break; - } - - return t( - "@libxmlerrorcodename @libxmlerrorcode: @libxmlerrormessage\nLine: @libxmlerrorline\nColumn: @libxmlerrorcolumn\nFile: @libxmlerrorfile", - [ - '@libxmlerrorcodename' => $error_code_name, - '@libxmlerrorcode' => $error->code, - '@libxmlerrormessage' => trim($error->message), - '@libxmlerrorline' => $error->line, - '@libxmlerrorcolumn' => $error->column, - '@libxmlerrorfile' => (($error->file)) ? $error->file : NULL, - ] - ); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/data/missing_properties.json b/sites/all/modules/contrib/migrate/migrate_plus/tests/data/missing_properties.json deleted file mode 100644 index 59b7d6a6e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/data/missing_properties.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "id": "1", - "title": "Title", - "video": { - "title": "Video title", - "url": "https://localhost/" - } - }, - { - "id": "2", - "video": { - "title": "Video title", - "url": "https://localhost/" - } - }, - { - "id": "3", - "title": "Title 3" - } -] diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/data/simple_xml_reduce_single_value.xml b/sites/all/modules/contrib/migrate/migrate_plus/tests/data/simple_xml_reduce_single_value.xml deleted file mode 100644 index 0cffd2890..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/data/simple_xml_reduce_single_value.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Value 1 - Value 2 - - - - - Value 1 (single) - - - diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration.fruit_terms.yml b/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration.fruit_terms.yml deleted file mode 100644 index 7f606d127..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration.fruit_terms.yml +++ /dev/null @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: fruit_terms -label: Fruit Terms -class: null -field_plugin_method: null -cck_plugin_method: null -migration_tags: { } -migration_group: default -source: - plugin: embedded_data - data_rows: - - - name: Apple - - - name: Banana - - - name: Orange - ids: - name: - type: string - constants: - vocabulary: fruit -process: - name: name - vid: constants/vocabulary -destination: - plugin: entity:taxonomy_term -migration_dependencies: - required: { } - optional: { } diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration_group.default.yml b/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration_group.default.yml deleted file mode 100644 index 0f35a2189..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/config/install/migrate_plus.migration_group.default.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: default -label: Default -description: '' -source_type: '' -module: null -shared_configuration: null diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/migrate_plus_test.info.yml b/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/migrate_plus_test.info.yml deleted file mode 100644 index 070d6134a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/modules/migrate_plus_test/migrate_plus_test.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -type: module -name: Migrate Plus Test -description: 'Test module to test Migrate Plus.' -package: Testing -# core: 8.x -dependencies: - - drupal:migrate (>=8.3) - - migrate_plus:migrate_plus - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_plus' -datestamp: 1546879116 diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Functional/LoadTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Functional/LoadTest.php deleted file mode 100644 index d042ecf30..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Functional/LoadTest.php +++ /dev/null @@ -1,53 +0,0 @@ -user = $this->drupalCreateUser(['administer site configuration']); - $this->drupalLogin($this->user); - } - - /** - * Tests that the home page loads with a 200 response. - */ - public function testLoad() { - $this->drupalGet(Url::fromRoute('')); - $this->assertSession()->statusCodeEquals(200); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrateTableTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrateTableTest.php deleted file mode 100755 index dc471770d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrateTableTest.php +++ /dev/null @@ -1,163 +0,0 @@ -connection = Database::getConnection(); - - $this->connection->schema()->createTable(static::TABLE_NAME, [ - 'description' => 'Test table', - 'fields' => [ - 'data' => [ - 'type' => 'varchar', - 'length' => '32', - 'not null' => TRUE, - ], - 'data2' => [ - 'type' => 'varchar', - 'length' => '32', - 'not null' => TRUE, - ], - 'data3' => [ - 'type' => 'varchar', - 'length' => '32', - 'not null' => TRUE, - ], - ], - 'primary key' => ['data'], - ]); - } - - /** - * {@inheritdoc} - */ - protected function tearDown() { - $this->connection->schema()->dropTable(static::TABLE_NAME); - parent::tearDown(); - } - - /** - * Create a minimally valid migration with some source data. - * - * @return array - * The migration definition. - */ - protected function getTableDestinationMigration() { - $definition = [ - 'id' => 'migration_table_test', - 'migration_tags' => ['Testing'], - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'data' => 'dummy value', - 'data2' => 'dummy2 value', - 'data3' => 'dummy3 value', - ], - [ - 'data' => 'dummy value2', - 'data2' => 'dummy2 value2', - 'data3' => 'dummy3 value2', - ], - [ - 'data' => 'dummy value3', - 'data2' => 'dummy2 value3', - 'data3' => 'dummy3 value3', - ], - ], - 'ids' => [ - 'data' => ['type' => 'string'], - ], - ], - 'destination' => [ - 'plugin' => 'table', - 'table_name' => static::TABLE_NAME, - 'id_fields' => ['data' => ['type' => 'string']], - ], - 'process' => [ - 'data' => 'data', - 'data2' => 'data2', - 'data3' => 'data3', - ], - ]; - return $definition; - } - - /** - * Tests table destination. - */ - public function testTableDestination() { - $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($this->getTableDestinationMigration()); - - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - - $values = $this->connection->select(static::TABLE_NAME) - ->fields(static::TABLE_NAME) - ->execute() - ->fetchAllAssoc('data'); - - $this->assertEquals('dummy value', $values['dummy value']->data); - $this->assertEquals('dummy2 value', $values['dummy value']->data2); - $this->assertEquals('dummy2 value2', $values['dummy value2']->data2); - $this->assertEquals('dummy3 value3', $values['dummy value3']->data3); - $this->assertEquals(3, count($values)); - } - - /** - * Tests table rollback. - */ - public function testTableRollback() { - $this->testTableDestination(); - - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($this->getTableDestinationMigration()); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - - $values = $this->connection->select(static::TABLE_NAME) - ->fields(static::TABLE_NAME) - ->execute() - ->fetchAllAssoc('data'); - - $this->assertEquals('dummy value', $values['dummy value']->data); - $this->assertEquals(3, count($values)); - - // Now rollback. - $executable->rollback(); - $values = $this->connection->select(static::TABLE_NAME) - ->fields(static::TABLE_NAME) - ->execute() - ->fetchAllAssoc('data'); - - $this->assertEquals(0, count($values)); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationConfigEntityTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationConfigEntityTest.php deleted file mode 100644 index d32d2d13d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationConfigEntityTest.php +++ /dev/null @@ -1,123 +0,0 @@ -pluginManager = \Drupal::service('plugin.manager.migration'); - $this->installConfig('migrate_plus'); - $this->installEntitySchema('taxonomy_term'); - $this->installSchema('system', ['key_value', 'key_value_expire']); - } - - /** - * Tests cache invalidation. - */ - public function testCacheInvalidation() { - $config = Migration::create([ - 'id' => 'test', - 'status' => TRUE, - 'label' => 'Label A', - 'migration_tags' => [], - 'source' => [], - 'destination' => [], - 'migration_dependencies' => [], - ]); - $config->save(); - - $this->assertTrue($this->pluginManager->getDefinition('test')); - $this->assertSame('Label A', $this->pluginManager->getDefinition('test')['label']); - - // Clear static cache in the plugin manager, the cache tag take care of the - // persistent cache. - $this->pluginManager->useCaches(FALSE); - $this->pluginManager->useCaches(TRUE); - - $config->set('label', 'Label B'); - $config->save(); - - $this->assertSame('Label B', $this->pluginManager->getDefinition('test')['label']); - } - - /** - * Tests migration status. - */ - public function testMigrationStatus() { - $configs = [ - [ - 'id' => 'test_active', - 'status' => TRUE, - 'label' => 'Label Active', - 'migration_tags' => [], - 'source' => [], - 'destination' => [], - 'migration_dependencies' => [], - ], - [ - 'id' => 'test_inactive', - 'status' => FALSE, - 'label' => 'Label Inactive', - 'migration_tags' => [], - 'source' => [], - 'destination' => [], - 'migration_dependencies' => [], - ], - ]; - - foreach ($configs as $config) { - Migration::create($config)->save(); - } - - $definitions = $this->pluginManager->getDefinitions(); - $this->assertCount(1, $definitions); - $this->assertArrayHasKey('test_active', $definitions); - - $this->setExpectedException(PluginNotFoundException::class, 'The "test_inactive" plugin does not exist.'); - $this->pluginManager->getDefinition('test_inactive'); - } - - /** - * Tests migration from configuration. - */ - public function testImport() { - $this->installConfig('migrate_plus_test'); - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->pluginManager->createInstance('fruit_terms'); - $id_map = $migration->getIdMap(); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - $this->assertSame(3, $id_map->importedCount()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationGroupTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationGroupTest.php deleted file mode 100644 index 2909891c6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/MigrationGroupTest.php +++ /dev/null @@ -1,127 +0,0 @@ - $group_id, - 'shared_configuration' => [ - // In migration, so will be overridden. - 'migration_tags' => ['Drupal 6'], - 'source' => [ - 'constants' => [ - // Not in migration, so will be added. - 'type' => 'image', - // In migration, so will be overridden. - 'cardinality' => '1', - ], - ], - // Not in migration, so will be added. - 'destination' => ['plugin' => 'field_storage_config'], - ], - ]; - $this->container->get('entity_type.manager')->getStorage('migration_group') - ->create($group_configuration)->save(); - - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */ - $migration = $this->container->get('entity_type.manager') - ->getStorage('migration')->create([ - 'id' => 'specific_migration', - 'load' => [], - 'migration_group' => $group_id, - 'label' => 'Unaffected by the group', - // Overrides group. - 'migration_tags' => ['Drupal 7'], - 'destination' => [], - 'source' => [], - 'process' => [], - 'migration_dependencies' => [], - ]); - $migration->set('source', [ - // Not in group, persists. - 'plugin' => 'empty', - 'constants' => [ - // Not in group, persists. - 'entity_type' => 'user', - // Overrides group. - 'cardinality' => '3', - ], - ]); - $migration->save(); - - $expected_config = [ - 'label' => 'Unaffected by the group', - 'getMigrationTags' => ['Drupal 7'], - 'getSourceConfiguration' => [ - 'plugin' => 'empty', - 'constants' => [ - 'entity_type' => 'user', - 'type' => 'image', - 'cardinality' => '3', - ], - ], - 'getDestinationConfiguration' => ['plugin' => 'field_storage_config'], - ]; - /** @var \Drupal\migrate_plus\Plugin\MigrationInterface $loaded_migration */ - $loaded_migration = $this->container->get('plugin.manager.migration') - ->createInstance('specific_migration'); - foreach ($expected_config as $method => $expected_value) { - $actual_value = call_user_func([$loaded_migration, $method]); - $this->assertEquals($expected_value, $actual_value); - } - } - - /** - * Test that deleting a group deletes its migrations. - */ - public function testDelete() { - /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group */ - $group_configuration = [ - 'id' => 'test_group', - ]; - $migration_group = $this->container->get('entity_type.manager') - ->getStorage('migration_group')->create($group_configuration); - $migration_group->save(); - - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */ - $migration = $this->container->get('entity_type.manager') - ->getStorage('migration')->create([ - 'id' => 'specific_migration', - 'migration_group' => 'test_group', - 'migration_tags' => [], - 'load' => [], - 'destination' => [], - 'source' => [], - 'migration_dependencies' => [], - ]); - $migration->save(); - - /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $loaded_migration_group */ - $loaded_migration_group = MigrationGroup::load('test_group'); - $loaded_migration_group->delete(); - - /** @var \Drupal\migrate_plus\Entity\MigrationInterface $loaded_migration */ - $loaded_migration = Migration::load('specific_migration'); - $this->assertNull($loaded_migration); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php deleted file mode 100644 index 3a5291817..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityGenerateTest.php +++ /dev/null @@ -1,900 +0,0 @@ - $this->bundle, - 'name' => 'Page', - ]; - $node_type = NodeType::create($values); - $node_type->save(); - - $this->installEntitySchema('node'); - $this->installEntitySchema('taxonomy_term'); - $this->installEntitySchema('taxonomy_vocabulary'); - $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); - $this->installSchema('user', 'users_data'); - $this->installConfig($this->modules); - - // Create a vocabulary. - $vocabulary = Vocabulary::create([ - 'name' => $this->vocabulary, - 'description' => $this->vocabulary, - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ]); - $vocabulary->save(); - - // Create a field. - $this->createEntityReferenceField( - 'node', - $this->bundle, - $this->fieldName, - 'Term reference', - 'taxonomy_term', - 'default', - ['target_bundles' => [$this->vocabulary]], - FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED - ); - - // Create a non-reference field. - FieldStorageConfig::create([ - 'field_name' => 'field_integer', - 'type' => 'integer', - 'entity_type' => 'node', - ])->save(); - FieldConfig::create([ - 'field_name' => 'field_integer', - 'entity_type' => 'node', - 'bundle' => $this->bundle, - ])->save(); - - $this->migrationPluginManager = \Drupal::service('plugin.manager.migration'); - } - - /** - * Tests generating an entity. - * - * @dataProvider transformDataProvider - * - * @covers ::transform - */ - public function testTransform(array $definition, array $expected, array $preSeed = []) { - // Pre seed some test data. - foreach ($preSeed as $storageName => $values) { - // If the first element of $values is a non-empty array, create multiple - // entities. Otherwise, create just one entity. - if (isset($values[0])) { - foreach ($values as $itemValues) { - $this->createTestData($storageName, $itemValues); - } - } - else { - $this->createTestData($storageName, $values); - } - } - - /** @var \Drupal\migrate\Plugin\Migration $migration */ - $migration = $this->migrationPluginManager->createStubMigration($definition); - /** @var EntityStorageBase $storage */ - $storage = $this->readAttribute($migration->getDestinationPlugin(), 'storage'); - $migrationExecutable = (new MigrateExecutable($migration, $this)); - $migrationExecutable->import(); - - foreach ($expected as $row) { - $entity = $storage->load($row['id']); - $properties = array_diff_key($row, array_flip(['id'])); - foreach ($properties as $property => $value) { - if (is_array($value)) { - if (empty($value)) { - $this->assertEmpty($entity->{$property}->getValue(), "Expected value is 'unset' but field $property is set."); - } - else { - // Check if we're testing multiple values in one field. If so, loop - // through them one-by-one and check that they're present in the - // $entity. - if (isset($value[0])) { - foreach ($value as $valueID => $valueToCheck) { - foreach ($valueToCheck as $key => $expectedValue) { - if (empty($expectedValue)) { - if (!$entity->{$property}->isEmpty()) { - $this->assertTrue($entity->{$property}[0]->entity->{$key}->isEmpty(), "Expected value is empty but field $property.$key is not empty."); - } - else { - $this->assertTrue($entity->{$property}->isEmpty(), "Expected value is empty but field $property is not empty."); - } - } - elseif ($entity->{$property}->getValue()) { - $this->assertEquals($expectedValue, $entity->get($property)->offsetGet($valueID)->entity->{$key}->value); - } - else { - $this->fail("Expected value: $expectedValue does not exist in $property."); - } - } - } - } - // If we get to this point, we're only checking a - // single field value. - else { - foreach ($value as $key => $expectedValue) { - if (empty($expectedValue)) { - if (!$entity->{$property}->isEmpty()) { - $this->assertTrue($entity->{$property}[0]->entity->{$key}->isEmpty(), "Expected value is empty but field $property.$key is not empty."); - } - else { - $this->assertTrue($entity->{$property}->isEmpty(), "BINBAZ Expected value is empty but field $property is not empty."); - } - } - elseif ($entity->{$property}->getValue()) { - $referenced_entity = $entity->{$property}[0]->entity; - $result_value = $referenced_entity instanceof ConfigEntityInterface ? $referenced_entity->get($key) : $referenced_entity->get($key)->value; - $this->assertEquals($expectedValue, $result_value); - } - else { - $this->fail("Expected value: $expectedValue does not exist in $property."); - } - } - } - } - } - else { - $this->assertNotEmpty($entity, 'Entity with label ' . $row[$property] . ' is empty'); - $this->assertEquals($row[$property], $entity->label()); - } - } - } - } - - /** - * Test lookup without a reference field. - */ - public function testNonReferenceField() { - $values = [ - 'name' => 'Apples', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ]; - $this->createTestData('taxonomy_term', $values); - - // Not enough context is provided for a non reference field, so error out. - $definition = [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Apples', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - 'field_integer' => [ - 'plugin' => 'entity_generate', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ]; - /** @var \Drupal\migrate\Plugin\Migration $migration */ - $migration = $this->migrationPluginManager->createStubMigration($definition); - $migrationExecutable = (new MigrateExecutable($migration, $this)); - $migrationExecutable->import(); - $this->assertEquals('Destination field type integer is not a recognized reference type.', $migration->getIdMap()->getMessageIterator()->fetch()->message); - $this->assertSame(1, $migration->getIdMap()->messageCount()); - - // Enough context is provided so this should work. - $definition = [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Apples', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - 'field_integer' => [ - 'plugin' => 'entity_generate', - 'source' => 'term', - 'value_key' => 'name', - 'bundle_key' => 'vid', - 'bundle' => $this->vocabulary, - 'entity_type' => 'taxonomy_term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ]; - /** @var \Drupal\migrate\Plugin\Migration $migration */ - $migration = $this->migrationPluginManager->createStubMigration($definition); - $migrationExecutable = (new MigrateExecutable($migration, $this)); - $migrationExecutable->import(); - $this->assertEmpty($migration->getIdMap()->messageCount()); - $term = Term::load(1); - $this->assertEquals('Apples', $term->label()); - } - - /** - * Provides multiple migration definitions for "transform" test. - */ - public function transformDataProvider() { - return [ - 'no arguments' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Apples', - ], - [ - 'id' => 2, - 'title' => 'content item 2', - 'term' => 'Bananas', - ], - [ - 'id' => 3, - 'title' => 'content item 3', - 'term' => 'Grapes', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - $this->fieldName => [ - 'plugin' => 'entity_generate', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [ - 'tid' => 2, - 'name' => 'Apples', - ], - ], - 'row 2' => [ - 'id' => 2, - 'title' => 'content item 2', - $this->fieldName => [ - 'tid' => 3, - 'name' => 'Bananas', - ], - ], - 'row 3' => [ - 'id' => 3, - 'title' => 'content item 3', - $this->fieldName => [ - 'tid' => 1, - 'name' => 'Grapes', - ], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - 'no arguments_lookup_only' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Apples', - ], - [ - 'id' => 2, - 'title' => 'content item 2', - 'term' => 'Bananas', - ], - [ - 'id' => 3, - 'title' => 'content item 3', - 'term' => 'Grapes', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - $this->fieldName => [ - 'plugin' => 'entity_lookup', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [ - 'tid' => NULL, - 'name' => NULL, - ], - ], - 'row 2' => [ - 'id' => 2, - 'title' => 'content item 2', - $this->fieldName => [ - 'tid' => NULL, - 'name' => NULL, - ], - ], - 'row 3' => [ - 'id' => 3, - 'title' => 'content item 3', - $this->fieldName => [ - 'tid' => 1, - 'name' => 'Grapes', - ], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - 'provide values' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Apples', - ], - [ - 'id' => 2, - 'title' => 'content item 2', - 'term' => 'Bananas', - ], - [ - 'id' => 3, - 'title' => 'content item 3', - 'term' => 'Grapes', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - 'term_upper' => [ - 'plugin' => 'callback', - 'source' => 'term', - 'callable' => 'strtoupper', - ], - $this->fieldName => [ - 'plugin' => 'entity_generate', - 'source' => 'term', - 'values' => [ - 'description' => '@term_upper', - ], - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [ - 'tid' => 2, - 'name' => 'Apples', - 'description' => 'APPLES', - ], - ], - 'row 2' => [ - 'id' => 2, - 'title' => 'content item 2', - $this->fieldName => [ - 'tid' => 3, - 'name' => 'Bananas', - 'description' => 'BANANAS', - ], - ], - 'row 3' => [ - 'id' => 3, - 'title' => 'content item 3', - $this->fieldName => [ - 'tid' => 1, - 'name' => 'Grapes', - 'description' => NULL, - ], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - 'lookup single existing term returns correct term' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Grapes', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - $this->fieldName => [ - 'plugin' => 'entity_lookup', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [ - 'tid' => 1, - 'name' => 'Grapes', - ], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - 'lookup single missing term returns null value' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => 'Apple', - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - 'title' => 'title', - $this->fieldName => [ - 'plugin' => 'entity_lookup', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - 'lookup multiple existing terms returns correct terms' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => [ - 'Grapes', - 'Apples', - ], - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'title' => 'title', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - $this->fieldName => [ - 'plugin' => 'entity_lookup', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [ - [ - 'tid' => 1, - 'name' => 'Grapes', - ], - [ - 'tid' => 2, - 'name' => 'Apples', - ], - ], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - [ - 'name' => 'Apples', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - ], - 'lookup multiple mixed terms returns correct terms' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => [ - 'Grapes', - 'Pears', - ], - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'title' => 'title', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - $this->fieldName => [ - 'plugin' => 'entity_lookup', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => '1', - 'title' => 'content item 1', - $this->fieldName => [ - [ - 'tid' => 1, - 'name' => 'Grapes', - ], - ], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - [ - 'name' => 'Apples', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - ], - 'lookup with empty term value returns no terms' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'title' => 'content item 1', - 'term' => [], - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'title' => 'title', - 'type' => [ - 'plugin' => 'default_value', - 'default_value' => $this->bundle, - ], - $this->fieldName => [ - 'plugin' => 'entity_lookup', - 'source' => 'term', - ], - ], - 'destination' => [ - 'plugin' => 'entity:node', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'title' => 'content item 1', - $this->fieldName => [], - ], - ], - 'pre seed' => [ - 'taxonomy_term' => [ - 'name' => 'Grapes', - 'vid' => $this->vocabulary, - 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ], - ], - ], - 'lookup config entity' => [ - 'definition' => [ - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => [ - [ - 'id' => 1, - 'name' => 'user 1', - 'mail' => 'user1@user1.com', - 'roles' => ['role_1'], - ], - ], - 'ids' => [ - 'id' => ['type' => 'integer'], - ], - ], - 'process' => [ - 'id' => 'id', - 'name' => 'name', - 'roles' => [ - 'plugin' => 'entity_lookup', - 'entity_type' => 'user_role', - 'value_key' => 'id', - 'source' => 'roles', - ], - ], - 'destination' => [ - 'plugin' => 'entity:user', - ], - ], - 'expected' => [ - 'row 1' => [ - 'id' => 1, - 'name' => 'user 1', - 'roles' => [ - 'id' => 'role_1', - 'label' => 'Role 1', - ], - ], - ], - 'pre seed' => [ - 'user_role' => [ - 'id' => 'role_1', - 'label' => 'Role 1', - ], - ], - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function display($message, $type = 'status') { - $this->assertTrue($type == 'status', $message); - } - - /** - * Create pre-seed test data. - * - * @param string $storageName - * The storage manager to create. - * @param array $values - * The values to use when creating the entity. - * - * @return string|int - * The entity identifier. - */ - private function createTestData($storageName, array $values) { - /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */ - $storage = $this->container - ->get('entity_type.manager') - ->getStorage($storageName); - $entity = $storage->create($values); - $entity->save(); - return $entity->id(); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php deleted file mode 100644 index 67d403cc6..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate/process/EntityLookupTest.php +++ /dev/null @@ -1,76 +0,0 @@ -installSchema('system', ['sequences']); - $this->installEntitySchema('user'); - } - - /** - * Lookup an entity without bundles on destination key. - * - * Using user entity as destination entity without bundles as example for - * testing. - * - * @covers ::transform - */ - public function testLookupEntityWithoutBundles() { - // Create a user. - $known_user = $this->createUser([], 'lucuma'); - // Setup test migration objects. - $migration_prophecy = $this->prophesize(MigrationInterface::class); - $migrate_destination_prophecy = $this->prophesize(MigrateDestinationInterface::class); - $migrate_destination_prophecy->getPluginId()->willReturn('user'); - $migrate_destination = $migrate_destination_prophecy->reveal(); - $migration_prophecy->getDestinationPlugin()->willReturn($migrate_destination); - $migration_prophecy->getProcess()->willReturn([]); - $migration = $migration_prophecy->reveal(); - $configuration = [ - 'entity_type' => 'user', - 'value_key' => 'name', - ]; - $plugin = \Drupal::service('plugin.manager.migrate.process') - ->createInstance('entity_lookup', $configuration, $migration); - $executable = $this->prophesize(MigrateExecutableInterface::class)->reveal(); - $row = new Row(); - // Check the known user is found. - $value = $plugin->transform('lucuma', $executable, $row, 'name'); - $this->assertSame($known_user->id(), $value); - // Check an unknown user is not found. - $value = $plugin->transform('orange', $executable, $row, 'name'); - $this->assertNull($value); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php deleted file mode 100644 index 76a5c1847..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_fetcher/HttpTest.php +++ /dev/null @@ -1,59 +0,0 @@ -assertEquals($expected, $http->getRequestHeaders()); - } - - /** - * Provides multiple test cases for the testHttpHeaders method. - * - * @return array - * The test cases - */ - public function headerDataProvider() { - return [ - 'dummy headers specified' => [ - 'definition' => [ - 'headers' => [ - 'Accept' => 'application/json', - 'User-Agent' => 'Internet Explorer 6', - 'Authorization-Key' => 'secret', - 'Arbitrary-Header' => 'foobarbaz', - ], - ], - 'expected' => [ - 'Accept' => 'application/json', - 'User-Agent' => 'Internet Explorer 6', - 'Authorization-Key' => 'secret', - 'Arbitrary-Header' => 'foobarbaz', - ], - ], - 'no headers specified' => [ - 'definition' => [ - 'no_headers_here' => 'foo', - ], - 'expected' => [], - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php deleted file mode 100644 index 2fb4f2458..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/JsonTest.php +++ /dev/null @@ -1,112 +0,0 @@ -container - ->get('module_handler') - ->getModule('migrate_plus') - ->getPath(); - $url = $path . '/tests/data/' . $file; - - /** @var \Drupal\migrate_plus\DataParserPluginManager $plugin_manager */ - $plugin_manager = $this->container - ->get('plugin.manager.migrate_plus.data_parser'); - $conf = [ - 'plugin' => 'url', - 'data_fetcher_plugin' => 'file', - 'data_parser_plugin' => 'json', - 'destination' => 'node', - 'urls' => [$url], - 'ids' => $ids, - 'fields' => $fields, - 'item_selector' => NULL, - ]; - $json_parser = $plugin_manager->createInstance('json', $conf); - - $data = []; - foreach ($json_parser as $item) { - $data[] = $item; - } - - $this->assertEquals($expected, $data); - } - - /** - * Provides multiple test cases for the testMissingProperty method. - * - * @return array - * The test cases. - */ - public function jsonBaseDataProvider() { - return [ - 'missing properties' => [ - 'file' => 'missing_properties.json', - 'ids' => ['id' => ['type' => 'integer']], - 'fields' => [ - [ - 'name' => 'id', - 'label' => 'Id', - 'selector' => '/id', - ], - [ - 'name' => 'title', - 'label' => 'Title', - 'selector' => '/title', - ], - [ - 'name' => 'video_url', - 'label' => 'Video url', - 'selector' => '/video/url', - ], - ], - 'expected' => [ - [ - 'id' => '1', - 'title' => 'Title', - 'video_url' => 'https://localhost/', - ], - [ - 'id' => '2', - 'title' => '', - 'video_url' => 'https://localhost/', - ], - [ - 'id' => '3', - 'title' => 'Title 3', - 'video_url' => '', - ], - ], - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php deleted file mode 100644 index fe6b345e1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php +++ /dev/null @@ -1,77 +0,0 @@ -container - ->get('module_handler') - ->getModule('migrate_plus') - ->getPath(); - $url = $path . '/tests/data/simple_xml_reduce_single_value.xml'; - - /** @var \Drupal\migrate_plus\DataParserPluginManager $plugin_manager */ - $plugin_manager = $this->container - ->get('plugin.manager.migrate_plus.data_parser'); - $conf = [ - 'plugin' => 'url', - 'data_fetcher_plugin' => 'file', - 'data_parser_plugin' => 'simple_xml', - 'destination' => 'node', - 'urls' => [$url], - 'ids' => ['id' => ['type' => 'integer']], - 'fields' => [ - [ - 'name' => 'id', - 'label' => 'Id', - 'selector' => '@id', - ], - [ - 'name' => 'values', - 'label' => 'Values', - 'selector' => 'values', - ], - ], - 'item_selector' => '/items/item', - ]; - $parser = $plugin_manager->createInstance('simple_xml', $conf); - - $data = []; - foreach ($parser as $item) { - $values = []; - foreach ($item['values'] as $value) { - $values[] = (string) $value; - } - $data[] = $values; - } - - $expected = [ - [ - 'Value 1', - 'Value 2', - ], - [ - 'Value 1 (single)', - ], - ]; - - $this->assertEquals($expected, $data); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/FileTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/FileTest.php deleted file mode 100644 index 0e09cf77a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/FileTest.php +++ /dev/null @@ -1,185 +0,0 @@ - 'url', - 'data_fetcher_plugin' => 'file', - 'data_parser_plugin' => 'json', - 'item_selector' => 0, - 'fields' => [], - 'ids' => [ - 'id' => [ - 'type' => 'integer', - ], - ], - ]; - - /** - * The data fetcher plugin ID being tested. - * - * @var string - */ - private $dataFetcherPluginId = 'file'; - - /** - * The data fetcher plugin definition. - * - * @var array - */ - private $pluginDefinition = [ - 'id' => 'file', - 'title' => 'File', - ]; - - /** - * Test data to populate a file with. - * - * @var string - */ - private $testData = '[ - { - "id": 1, - "name": "Joe Bloggs" - } - ]'; - - /** - * Define virtual dir where we'll be creating files in/fetching files from. - * - * @var \org\bovigo\vfs\vfsStreamDirectory - */ - private $baseDir; - - /** - * Set up test environment. - */ - public function setUp() { - $this->baseDir = vfsStream::setup(self::BASE_DIRECTORY); - } - - /** - * Test fetching a valid file. - */ - public function testFetchFile() { - $file_name = 'file.json'; - $file_path = vfsStream::url(implode(DIRECTORY_SEPARATOR, [self::BASE_DIRECTORY, $file_name])); - $migration_config = $this->specificMigrationConfig + [ - 'urls' => [$file_path], - ]; - - $plugin = new File( - $migration_config, - $this->dataFetcherPluginId, - $this->pluginDefinition - ); - - $tree = [ - $file_name => $this->testData, - ]; - - vfsStream::create($tree, $this->baseDir); - - $expected = json_decode($this->testData, TRUE); - $retrieved = json_decode($plugin->getResponseContent($file_path), TRUE); - - $this->assertEquals($expected, $retrieved); - } - - /** - * Test fetching multiple valid files. - */ - public function testFetchMultipleFiles() { - $number_of_files = 3; - $file_paths = []; - $file_names = []; - - for ($i = 0; $i < $number_of_files; $i++) { - $file_name = 'file_' . $i . '.json'; - $file_names[] = $file_name; - $file_paths[] = vfsStream::url(implode(DIRECTORY_SEPARATOR, [self::BASE_DIRECTORY, $file_name])); - } - - $migration_config = $this->specificMigrationConfig + [ - 'urls' => $file_paths, - ]; - - $plugin = new File( - $migration_config, - $this->dataFetcherPluginId, - $this->pluginDefinition - ); - - for ($i = 0; $i < $number_of_files; $i++) { - $file_name = $file_names[$i]; - $file_path = $file_paths[$i]; - - $tree = [ - $file_name => $this->testData, - ]; - - vfsStream::create($tree, $this->baseDir); - - $expected = json_decode($this->testData); - $retrieved = json_decode($plugin->getResponseContent($file_path)); - - $this->assertEquals($expected, $retrieved); - } - } - - /** - * Test trying to fetch an unreadable file results in exception. - */ - public function testFetchUnreadableFile() { - $file_name = 'file.json'; - $file_path = vfsStream::url(implode(DIRECTORY_SEPARATOR, [self::BASE_DIRECTORY, $file_name])); - $migration_config = $this->specificMigrationConfig + [ - 'urls' => [$file_path], - ]; - - $plugin = new File( - $migration_config, - $this->dataFetcherPluginId, - $this->pluginDefinition - ); - - // Create an unreadable file. - vfsStream::newFile($file_name, 0300) - ->withContent($this->testData) - ->at($this->baseDir); - - // Trigger exception trying to read the non-readable file. - $this->setExpectedException(MigrateException::class, 'file parser plugin: could not retrieve data from vfs://migration_data/file.json'); - $plugin->getResponseContent($file_path); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/HttpTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/HttpTest.php deleted file mode 100644 index cbaec2d93..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/data_fetcher/HttpTest.php +++ /dev/null @@ -1,242 +0,0 @@ - 'url', - 'urls' => ['http://example.org/http_fetcher_test'], - 'data_fetcher_plugin' => 'http', - 'data_parser_plugin' => 'json', - 'item_selector' => 0, - 'authentication' => [ - 'plugin' => 'basic', - 'username' => 'testing', - 'password' => 'password', - ], - 'fields' => [], - 'ids' => [ - 'id' => [ - 'type' => 'integer', - ], - ], - ]; - - /** - * The data fetcher plugin ID being tested. - * - * @var string - */ - private $dataFetcherPluginId = 'http'; - - /** - * The data fetcher plugin definition. - * - * @var array - */ - private $pluginDefinition = [ - 'id' => 'http', - 'title' => 'HTTP', - ]; - - /** - * Test data to validate an HTTP response against. - * - * @var string - */ - private $testData = ' - { - "id": 1, - "name": "Joe Bloggs" - } - '; - - /** - * Mocked up Basic authentication plugin. - * - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $basicAuthenticator = NULL; - - /** - * Set up test environment. - */ - public function setUp() { - // Mock up a Basic authentication plugin that will be used in requests. - $basic_authenticator = $this->getMockBuilder(Basic::class) - ->disableOriginalConstructor() - ->getMock(); - - $basic_authenticator->method('getAuthenticationOptions') - ->will($this->returnValue([ - 'auth' => [ - 'username', - 'password', - ], - ])); - - $this->basicAuthenticator = $basic_authenticator; - } - - /** - * Test 'http' data fetcher (with auth) returns an expected response. - */ - public function testFetchHttpWithAuth() { - $migration_config = $this->migrationConfiguration + $this->specificMigrationConfig; - - $plugin = new TestHttp($migration_config, $this->dataFetcherPluginId, $this->pluginDefinition); - $plugin->mockHttpClient([[200, 'application/json', $this->testData]], $this->basicAuthenticator); - - // The Guzzle mock returns an instance of StreamInterface. - // http://docs.guzzlephp.org/en/latest/psr7.html - $stream = $plugin->getResponseContent($migration_config['urls'][0]); - - $body = json_decode((string) $stream, TRUE); - - // Compare what we got back from the parser to what we expected to get. - $expected = json_decode($this->testData, TRUE); - $this->assertArrayEquals($expected, $body); - } - - /** - * Test 'http' data fetcher (without auth) returns an expected response. - */ - public function testFetchHttpNoAuth() { - $migration_config = $this->migrationConfiguration + $this->specificMigrationConfig; - unset($migration_config['authentication']); - - $plugin = new TestHttp($migration_config, $this->dataFetcherPluginId, $this->pluginDefinition); - $plugin->mockHttpClient([[200, 'application/json', $this->testData]], NULL); - - $stream = $plugin->getResponseContent($migration_config['urls'][0]); - - $body = json_decode((string) $stream, TRUE); - - $expected = json_decode($this->testData, TRUE); - $this->assertArrayEquals($expected, $body); - } - - /** - * Test 'http' data fetcher (with auth) dies as expected when auth fails. - */ - public function testFetchHttpAuthFailure() { - $migration_config = $this->migrationConfiguration + $this->specificMigrationConfig; - - $plugin = new TestHttp($migration_config, $this->dataFetcherPluginId, $this->pluginDefinition); - $plugin->mockHttpClient([[403, 'text/html', 'Forbidden']], $this->basicAuthenticator); - - $this->setExpectedException(MigrateException::class, 'Error message: Client error: `GET http://example.org/http_fetcher_test` resulted in a `403 Forbidden'); - $plugin->getResponseContent($migration_config['urls'][0]); - } - - /** - * Test 'http' data fetcher (with auth) dies as expected when server down. - */ - public function testFetchHttp500Error() { - $migration_config = $this->migrationConfiguration + $this->specificMigrationConfig; - - $plugin = new TestHttp($migration_config, $this->dataFetcherPluginId, $this->pluginDefinition); - $plugin->mockHttpClient([[500, 'text/html', 'Internal Server Error']], $this->basicAuthenticator); - - $this->setExpectedException(MigrateException::class, 'GET http://example.org/http_fetcher_test` resulted in a `500 Internal Server Error'); - $plugin->getResponseContent($migration_config['urls'][0]); - } - -} - -/** - * Test class to mock an HTTP request. - */ -class TestHttp extends Http { - - /** - * Mocked authenticator plugin. - * - * @var \PHPUnit_Framework_MockObject_MockObject - */ - public $authenticator = NULL; - - /** - * Mock the HttpClient, so we can control the request/response(s) etc. - * - * @param array $responses - * An array of responses (arrays), with each consisting of properties, - * ordered: response code, content-type and response body. - * @param \PHPUnit_Framework_MockObject_MockObject $authenticator - * Mocked authenticator plugin. - */ - public function mockHttpClient(array $responses, \PHPUnit_Framework_MockObject_MockObject $authenticator = NULL) { - // Set mocked authentication plugin to be used for the request auth plugin. - $this->authenticator = $authenticator; - - $handler_responses = []; - foreach ($responses as $response) { - $handler_responses[] = new Response( - $response[0], - ['Content-Type' => $response[1]], - $response[2] - ); - } - - $mock = new MockHandler($handler_responses); - $handler = HandlerStack::create($mock); - - $this->httpClient = new Client(['handler' => $handler]); - } - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition) { - // Skip calling the Http() constructor (that sets the httpClient instance - // variable via \Drupal which we don't want to do), but keep the call to its - // parent class constructor. @see https://bugs.php.net/bug.php?id=42016 - DataFetcherPluginBase::__construct($configuration, $plugin_id, $plugin_definition); - - // This is what the parent class is doing, that we need to override. - $this->httpClient = NULL; - } - - /** - * Override the parent::getAuthenticationPlugin() - * - * So we can mock the authentication plugin. - * - * @return \PHPUnit_Framework_MockObject_MockObject - * A mocked authentication plugin. - */ - public function getAuthenticationPlugin() { - if (!isset($this->authenticationPlugin)) { - $this->authenticationPlugin = $this->authenticator; - } - - return $this->authenticationPlugin; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayPopTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayPopTest.php deleted file mode 100644 index 84316d799..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayPopTest.php +++ /dev/null @@ -1,71 +0,0 @@ -plugin = new ArrayPop([], 'array_pop', []); - parent::setUp(); - } - - /** - * Data provider for testArrayPop(). - * - * @return array - * An array containing input values and expected output values. - */ - public function arrayPopDataProvider() { - return [ - 'indexed array' => [ - 'input' => ['v1', 'v2', 'v3'], - 'expected_output' => 'v3', - ], - 'associative array' => [ - 'input' => ['i1' => 'v1', 'i2' => 'v2', 'i3' => 'v3'], - 'expected_output' => 'v3', - ], - 'empty array' => [ - 'input' => [], - 'expected_output' => NULL, - ], - ]; - } - - /** - * Test array pop plugin. - * - * @param array $input - * The input values. - * @param mixed $expected_output - * The expected output. - * - * @dataProvider arrayPopDataProvider - */ - public function testArrayPop(array $input, $expected_output) { - $output = $this->plugin->transform($input, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame($output, $expected_output); - } - - /** - * Test invalid input. - */ - public function testArrayPopFromString() { - $this->setExpectedException(MigrateException::class, 'Input should be an array.'); - $this->plugin->transform('foo', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayShiftTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayShiftTest.php deleted file mode 100644 index 6c6950fee..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/ArrayShiftTest.php +++ /dev/null @@ -1,71 +0,0 @@ -plugin = new ArrayShift([], 'array_shift', []); - parent::setUp(); - } - - /** - * Data provider for testArrayShift(). - * - * @return array - * An array containing input values and expected output values. - */ - public function arrayShiftDataProvider() { - return [ - 'indexed array' => [ - 'input' => ['v1', 'v2', 'v3'], - 'expected_output' => 'v1', - ], - 'associative array' => [ - 'input' => ['i1' => 'v1', 'i2' => 'v2', 'i3' => 'v3'], - 'expected_output' => 'v1', - ], - 'empty array' => [ - 'input' => [], - 'expected_output' => NULL, - ], - ]; - } - - /** - * Test array shift plugin. - * - * @param array $input - * The input values. - * @param mixed $expected_output - * The expected output. - * - * @dataProvider arrayShiftDataProvider - */ - public function testArrayShift(array $input, $expected_output) { - $output = $this->plugin->transform($input, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame($output, $expected_output); - } - - /** - * Test invalid input. - */ - public function testArrayShiftFromString() { - $this->setExpectedException(MigrateException::class, 'Input should be an array.'); - $this->plugin->transform('foo', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/MultipleValuesTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/MultipleValuesTest.php deleted file mode 100644 index 60a520c0d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/MultipleValuesTest.php +++ /dev/null @@ -1,32 +0,0 @@ -plugin = new MultipleValues([], 'multiple_values', []); - parent::setUp(); - } - - /** - * Test input treated as multiple value output. - */ - public function testTreatAsMultiple() { - $value = ['v1', 'v2', 'v3']; - $output = $this->plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame($output, $value); - $this->assertTrue($this->plugin->multiple()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SingleValueTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SingleValueTest.php deleted file mode 100644 index 203b1c5cb..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SingleValueTest.php +++ /dev/null @@ -1,32 +0,0 @@ -plugin = new SingleValue([], 'single_value', []); - parent::setUp(); - } - - /** - * Test input treated as single value output. - */ - public function testTreatAsSingle() { - $value = ['v1', 'v2', 'v3']; - $output = $this->plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame($output, $value); - $this->assertFalse($this->plugin->multiple()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php deleted file mode 100644 index 968e6f0fb..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/SkipOnValueTest.php +++ /dev/null @@ -1,145 +0,0 @@ -setExpectedException(MigrateSkipProcessException::class); - (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - - /** - * @covers ::process - */ - public function testProcessSkipsOnMultipleValue() { - $configuration['method'] = 'process'; - $configuration['value'] = [1, 1, 2, 3, 5, 8]; - $this->setExpectedException(MigrateSkipProcessException::class); - (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('5', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - - /** - * @covers ::process - */ - public function testProcessBypassesOnNonValue() { - $configuration['method'] = 'process'; - $configuration['value'] = 'sourcevalue'; - $configuration['not_equals'] = TRUE; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('sourcevalue', $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, 'sourcevalue'); - $configuration['value'] = 86; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, '86'); - } - - /** - * @covers ::process - */ - public function testProcessSkipsOnMultipleNonValue() { - $configuration['method'] = 'process'; - $configuration['value'] = [1, 1, 2, 3, 5, 8]; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform(4, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, '4'); - } - - /** - * @covers ::process - */ - public function testProcessBypassesOnMultipleNonValue() { - $configuration['method'] = 'process'; - $configuration['value'] = [1, 1, 2, 3, 5, 8]; - $configuration['not_equals'] = TRUE; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform(5, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, '5'); - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform(1, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, '1'); - } - - /** - * @covers ::row - */ - public function testRowBypassesOnMultipleNonValue() { - $configuration['method'] = 'row'; - $configuration['value'] = [1, 1, 2, 3, 5, 8]; - $configuration['not_equals'] = TRUE; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform(5, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, '5'); - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform(1, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, '1'); - } - - /** - * @covers ::row - */ - public function testRowSkipsOnValue() { - $configuration['method'] = 'row'; - $configuration['value'] = 86; - $this->setExpectedException(MigrateSkipRowException::class); - (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - - /** - * @covers ::row - */ - public function testRowBypassesOnNonValue() { - $configuration['method'] = 'row'; - $configuration['value'] = 'sourcevalue'; - $configuration['not_equals'] = TRUE; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('sourcevalue', $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, 'sourcevalue'); - $configuration['value'] = 86; - $value = (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('86', $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($value, 86); - } - - /** - * @covers ::row - */ - public function testRequiredRowConfiguration() { - $configuration['method'] = 'row'; - $this->setExpectedException(MigrateException::class); - (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('sourcevalue', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - - /** - * @covers ::process - */ - public function testRequiredProcessConfiguration() { - $configuration['method'] = 'process'; - $this->setExpectedException(MigrateException::class); - (new SkipOnValue($configuration, 'skip_on_value', [])) - ->transform('sourcevalue', $this->migrateExecutable, $this->row, 'destinationproperty'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/StrReplaceTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/StrReplaceTest.php deleted file mode 100644 index 7194c711b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/StrReplaceTest.php +++ /dev/null @@ -1,100 +0,0 @@ -transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame('vero eos that accusam that justo vero', $actual); - - } - - /** - * Test for case insensitive searches. - */ - public function testStrIreplace() { - $value = 'VERO eos et accusam et justo vero'; - $configuration['search'] = 'vero'; - $configuration['replace'] = 'that'; - $configuration['case_insensitive'] = TRUE; - $plugin = new StrReplace($configuration, 'str_replace', []); - $actual = $plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame('that eos et accusam et justo that', $actual); - - } - - /** - * Test for regular expressions. - */ - public function testPregReplace() { - $value = 'vero eos et 123 accusam et justo 123 duo'; - $configuration['search'] = '/[0-9]{3}/'; - $configuration['replace'] = 'the'; - $configuration['regex'] = TRUE; - $plugin = new StrReplace($configuration, 'str_replace', []); - $actual = $plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame('vero eos et the accusam et justo the duo', $actual); - } - - /** - * Test for MigrateException for "search" configuration. - */ - public function testSearchMigrateException() { - $value = 'vero eos et accusam et justo vero'; - $configuration['replace'] = 'that'; - $plugin = new StrReplace($configuration, 'str_replace', []); - $this->setExpectedException('\Drupal\migrate\MigrateException', '"search" must be configured.'); - $plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - } - - /** - * Test for MigrateException for "replace" configuration. - */ - public function testReplaceMigrateException() { - $value = 'vero eos et accusam et justo vero'; - $configuration['search'] = 'et'; - $plugin = new StrReplace($configuration, 'str_replace', []); - $this->setExpectedException('\Drupal\migrate\MigrateException', '"replace" must be configured.'); - $plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - } - - /** - * Test for multiple. - */ - public function testIsMultiple() { - $value = [ - 'vero eos et accusam et justo vero', - 'et eos vero accusam vero justo et', - ]; - - $expected = [ - 'vero eos that accusam that justo vero', - 'that eos vero accusam vero justo that', - ]; - $configuration['search'] = 'et'; - $configuration['replace'] = 'that'; - $plugin = new StrReplace($configuration, 'str_replace', []); - $actual = $plugin->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertArrayEquals($expected, $actual); - - $this->assertTrue($plugin->multiple()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/TransliterationTest.php b/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/TransliterationTest.php deleted file mode 100644 index dbfe28857..000000000 --- a/sites/all/modules/contrib/migrate/migrate_plus/tests/src/Unit/process/TransliterationTest.php +++ /dev/null @@ -1,51 +0,0 @@ -transliteration = new PhpTransliteration(); - $this->row = $this->getMockBuilder(Row::class) - ->disableOriginalConstructor() - ->getMock(); - $this->migrateExecutable = $this->getMockBuilder(MigrateExecutableInterface::class) - ->disableOriginalConstructor() - ->getMock(); - parent::setUp(); - } - - /** - * Tests transliteration transformation of non-alphanumeric characters. - */ - public function testTransform() { - $actual = '9000004351_53494854_Spøgelsesjægerneáéö'; - $expected_result = '9000004351_53494854_Spogelsesjaegerneaeo'; - - $plugin = new Transliteration([], 'transliteration', [], $this->transliteration); - $value = $plugin->transform($actual, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertEquals($expected_result, $value); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/LICENSE.txt b/sites/all/modules/contrib/migrate/migrate_tools/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/migrate/migrate_tools/README.txt b/sites/all/modules/contrib/migrate/migrate_tools/README.txt deleted file mode 100644 index 5f46ba08e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/README.txt +++ /dev/null @@ -1,15 +0,0 @@ -The Migrate Tools module provides tools for running and managing Drupal 8 -migrations. - -Drush commands supported include: - -* migrate-status - Lists migrations and their status. -* migrate-import - Performs import operations. -* migrate-rollback - Performs rollback operations. -* migrate-stop - Cleanly stops a running operation. -* migrate-reset-status - Sets a migration status to Idle if it's gotten stuck. -* migrate-messages - Lists any messages associated with a migration import. - -The UI at this point provides a front-end equivalent to the migrate-status and -migrate-messages commands. It will be enhanced to allow running the other -operations, as well as provide the ability to create and alter migrations. diff --git a/sites/all/modules/contrib/migrate/migrate_tools/composer.json b/sites/all/modules/contrib/migrate/migrate_tools/composer.json deleted file mode 100644 index dfd9dbc84..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "drupal/migrate_tools", - "description": "Tools to assist in developing and running migrations.", - "type": "drupal-module", - "homepage": "http://drupal.org/project/migrate_tools", - "support": { - "issues": "http://drupal.org/project/migrate_tools", - "irc": "irc://irc.freenode.org/drupal-migrate", - "source": "http://cgit.drupalcode.org/migrate_tools" - }, - "license": "GPL-2.0-or-later", - "require": { - "drupal/migrate_plus": "^4" - }, - "require-dev": { - "drupal/migrate_plus": "4.x-dev", - "drupal/migrate_source_csv": "^2.2", - "drush/drush": "^9" - }, - "minimum-stability": "dev", - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/drupalci.yml b/sites/all/modules/contrib/migrate/migrate_tools/drupalci.yml deleted file mode 100644 index 116512f40..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/drupalci.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Learn to make one for your own drupal.org project: -# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing -build: - assessment: - validate_codebase: - phplint: - container_composer: - phpcs: - # phpcs will use core's specified version of Coder. - sniff-all-files: true - halt-on-fail: true - testing: - # run_tests task is executed several times in order of performance speeds. - # halt-on-fail can be set on the run_tests tasks in order to fail fast. - # suppress-deprecations is false in order to be alerted to usages of - # deprecated code. - run_tests.standard: - types: 'Simpletest,PHPUnit-Unit,PHPUnit-Kernel,PHPUnit-Functional' - testgroups: '--all' - suppress-deprecations: false - run_tests.js: - types: 'PHPUnit-FunctionalJavascript' - testgroups: '--all' - suppress-deprecations: false - nightwatchjs: { } diff --git a/sites/all/modules/contrib/migrate/migrate_tools/drush.services.yml b/sites/all/modules/contrib/migrate/migrate_tools/drush.services.yml deleted file mode 100644 index ed0a3917b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/drush.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - migrate_tools.commands: - class: \Drupal\migrate_tools\Commands\MigrateToolsCommands - arguments: ['@plugin.manager.migration', '@date.formatter', '@entity_type.manager', '@keyvalue'] - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.drush.inc b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.drush.inc deleted file mode 100644 index 16ff79b1f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.drush.inc +++ /dev/null @@ -1,580 +0,0 @@ - 'List all migrations with current status.', - 'options' => [ - 'group' => 'A comma-separated list of migration groups to list', - 'tag' => 'Name of the migration tag to list', - 'names-only' => 'Only return names, not all the details (faster)', - ], - 'arguments' => [ - 'migration' => 'Restrict to a comma-separated list of migrations. Optional', - ], - 'examples' => [ - 'migrate-status' => 'Retrieve status for all migrations', - 'migrate-status --group=beer' => 'Retrieve status for all migrations in a given group', - 'migrate-status --tag=user' => 'Retrieve status for all migrations with a given tag', - 'migrate-status --group=beer --tag=user' => 'Retrieve status for all migrations in the beer group and with the user tag', - 'migrate-status beer_term,beer_node' => 'Retrieve status for specific migrations', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['ms'], - ]; - - $items['migrate-import'] = [ - 'description' => 'Perform one or more migration processes.', - 'options' => [ - 'all' => 'Process all migrations.', - 'group' => 'A comma-separated list of migration groups to import', - 'tag' => 'Name of the migration tag to import', - 'limit' => 'Limit on the number of items to process in each migration', - 'feedback' => 'Frequency of progress messages, in items processed', - 'idlist' => 'Comma-separated list of IDs to import', - 'idlist-delimiter' => 'The delimiter for records, defaults to \':\'', - 'update' => ' In addition to processing unprocessed items from the source, update previously-imported items with the current data', - 'force' => 'Force an operation to run, even if all dependencies are not satisfied', - 'execute-dependencies' => 'Execute all dependent migrations first.', - ], - 'arguments' => [ - 'migration' => 'ID of migration(s) to import. Delimit multiple using commas.', - ], - 'examples' => [ - 'migrate-import --all' => 'Perform all migrations', - 'migrate-import --group=beer' => 'Import all migrations in the beer group', - 'migrate-import --tag=user' => 'Import all migrations with the user tag', - 'migrate-import --group=beer --tag=user' => 'Import all migrations in the beer group and with the user tag', - 'migrate-import beer_term,beer_node' => 'Import new terms and nodes', - 'migrate-import beer_user --limit=2' => 'Import no more than 2 users', - 'migrate-import beer_user --idlist=5' => 'Import the user record with source ID 5', - 'migrate-import beer_node_revision --idlist=1:2,2:3,3:5' => "Import the node revision record with source IDs [1,2], [2,3], and [3,5]", - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mi', 'mim'], - ]; - - $items['migrate-rollback'] = [ - 'description' => 'Rollback one or more migrations.', - 'options' => [ - 'all' => 'Process all migrations.', - 'group' => 'A comma-separated list of migration groups to rollback', - 'tag' => 'ID of the migration tag to rollback', - 'feedback' => 'Frequency of progress messages, in items processed', - 'idlist' => 'Comma-separated list of IDs to import', - ], - 'arguments' => [ - 'migration' => 'Name of migration(s) to rollback. Delimit multiple using commas.', - 'idlist' => 'Comma-separated list of IDs to import', - ], - 'examples' => [ - 'migrate-rollback --all' => 'Perform all migrations', - 'migrate-rollback --group=beer' => 'Rollback all migrations in the beer group', - 'migrate-rollback --tag=user' => 'Rollback all migrations with the user tag', - 'migrate-rollback --group=beer --tag=user' => 'Rollback all migrations in the beer group and with the user tag', - 'migrate-rollback beer_term,beer_node' => 'Rollback imported terms and nodes', - 'migrate-rollback beer_user --idlist=5' => 'Rollback imported user record with source ID 5', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mr'], - ]; - - $items['migrate-stop'] = [ - 'description' => 'Stop an active migration operation.', - 'arguments' => [ - 'migration' => 'ID of migration to stop', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mst'], - ]; - - $items['migrate-reset-status'] = [ - 'description' => 'Reset a active migration\'s status to idle.', - 'arguments' => [ - 'migration' => 'ID of migration to reset', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mrs'], - ]; - - $items['migrate-messages'] = [ - 'description' => 'View any messages associated with a migration.', - 'arguments' => [ - 'migration' => 'ID of the migration', - ], - 'options' => [ - 'csv' => 'Export messages as a CSV', - ], - 'examples' => [ - 'migrate-messages MyNode' => 'Show all messages for the MyNode migration', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mmsg'], - ]; - - $items['migrate-fields-source'] = [ - 'description' => 'List the fields available for mapping in a source.', - 'arguments' => [ - 'migration' => 'ID of the migration', - ], - 'examples' => [ - 'migrate-fields-source my_node' => 'List fields for the source in the my_node migration', - ], - 'drupal dependencies' => ['migrate_tools'], - 'aliases' => ['mfs'], - ]; - - return $items; -} - -/** - * Display migration status. - * - * @param string $migration_names - * The migration names. - */ -function drush_migrate_tools_migrate_status($migration_names = '') { - $names_only = drush_get_option('names-only'); - - $migrations = drush_migrate_tools_migration_list($migration_names); - - $table = []; - // Take it one group at a time, listing the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - $group = MigrationGroup::load($group_id); - $group_name = !empty($group) ? "{$group->label()} ({$group->id()})" : $group_id; - if ($names_only) { - $table[] = [ - dt('Group: @name', ['@name' => $group_name]), - ]; - } - else { - $table[] = [ - dt('Group: @name', ['@name' => $group_name]), - dt('Status'), - dt('Total'), - dt('Imported'), - dt('Unprocessed'), - dt('Last imported'), - ]; - } - foreach ($migration_list as $migration_id => $migration) { - try { - $map = $migration->getIdMap(); - $imported = $map->importedCount(); - $source_plugin = $migration->getSourcePlugin(); - } - catch (Exception $e) { - drush_log(dt('Failure retrieving information on @migration: @message', - ['@migration' => $migration_id, '@message' => $e->getMessage()])); - continue; - } - if ($names_only) { - $table[] = [$migration_id]; - } - else { - try { - $source_rows = $source_plugin->count(); - // -1 indicates uncountable sources. - if ($source_rows == -1) { - $source_rows = dt('N/A'); - $unprocessed = dt('N/A'); - } - else { - $unprocessed = $source_rows - $map->processedCount(); - } - } - catch (Exception $e) { - drush_print($e->getMessage()); - drush_log(dt('Could not retrieve source count from @migration: @message', - ['@migration' => $migration_id, '@message' => $e->getMessage()])); - $source_rows = dt('N/A'); - $unprocessed = dt('N/A'); - } - - $status = $migration->getStatusLabel(); - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $last_imported = $migrate_last_imported_store->get($migration->id(), FALSE); - if ($last_imported) { - /** @var \Drupal\Core\Datetime\DateFormatter $date_formatter */ - $date_formatter = \Drupal::service('date.formatter'); - $last_imported = $date_formatter->format($last_imported / 1000, - 'custom', 'Y-m-d H:i:s'); - } - else { - $last_imported = ''; - } - $table[] = [ - $migration_id, - $status, - $source_rows, - $imported, - $unprocessed, - $last_imported, - ]; - } - } - } - drush_print_table($table); -} - -/** - * Import a migration. - * - * @param string $migration_names - * The migration names. - */ -function drush_migrate_tools_migrate_import($migration_names = '') { - $group_names = drush_get_option('group'); - $tag_names = drush_get_option('tag'); - $all = drush_get_option('all'); - - // Display a depreciation message if "mi" alias is used. - $args = drush_get_arguments(); - if ($args[0] === 'mi') { - drush_log('The \'mi\' alias is deprecated and will no longer work with Drush 9. Consider the use of \'mim\' alias instead.', 'warning'); - } - - $options = []; - if (!$all && !$group_names && !$migration_names && !$tag_names) { - drush_set_error('MIGRATE_ERROR', dt('You must specify --all, --group, --tag or one or more migration names separated by commas')); - return; - } - - foreach (['limit', 'feedback', 'idlist', 'update', 'force'] as $option) { - if (drush_get_option($option)) { - $options[$option] = drush_get_option($option); - } - } - - $migrations = drush_migrate_tools_migration_list($migration_names); - if (empty($migrations)) { - drush_log(dt('No migrations found.'), 'error'); - } - - // Take it one group at a time, importing the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - array_walk($migration_list, '_drush_migrate_tools_execute_migration', $options); - } -} - -/** - * Executes a single migration. - * - * If the --execute-dependencies option was given, the migration's dependencies - * will also be executed first. - * - * @param \Drupal\migrate\Plugin\MigrationInterface $migration - * The migration to execute. - * @param string $migration_id - * The migration ID (not used, just an artifact of array_walk()). - * @param array $options - * Additional options for the migration. - */ -function _drush_migrate_tools_execute_migration(MigrationInterface $migration, $migration_id, array $options = []) { - $log = new DrushLogMigrateMessage(); - - if (drush_get_option('execute-dependencies')) { - if ($required_IDS = $migration->get('requirements')) { - $manager = \Drupal::service('plugin.manager.migration'); - $required_migrations = $manager->createInstances($required_IDS); - $dependency_options = array_merge($options, ['is_dependency' => TRUE]); - array_walk($required_migrations, __FUNCTION__, $dependency_options); - } - } - if (!empty($options['force'])) { - $migration->set('requirements', []); - } - if (!empty($options['update'])) { - if (empty($options['idlist'])) { - $migration->getIdMap()->prepareUpdate(); - } - else { - $source_id_values_list = MigrateTools::buildIdList($options); - $keys = array_keys($migration->getSourcePlugin()->getIds()); - foreach ($source_id_values_list as $source_id_values) { - $migration->getIdMap()->setUpdate(array_combine($keys, $source_id_values)); - } - } - } - $executable = new MigrateExecutable($migration, $log, $options); - // Function drush_op() provides --simulate support. - drush_op([$executable, 'import']); - if ($count = $executable->getFailedCount()) { - // Nudge Drush to use a non-zero exit code. - drush_set_error('MIGRATE_ERROR', dt('!name Migration - !count failed.', [ - '!name' => $migration_id, - '!count' => $count, - ])); - } -} - -/** - * Rollback migrations. - * - * @param string $migration_names - * The migration names. - */ -function drush_migrate_tools_migrate_rollback($migration_names = '') { - $group_names = drush_get_option('group'); - $tag_names = drush_get_option('tag'); - $all = drush_get_option('all'); - $options = []; - if (!$all && !$group_names && !$migration_names && !$tag_names) { - drush_set_error('MIGRATE_ERROR', dt('You must specify --all, --group, --tag, or one or more migration names separated by commas')); - return; - } - - foreach (['feedback', 'idlist'] as $option) { - if (drush_get_option($option)) { - $options[$option] = drush_get_option($option); - } - } - - $log = new DrushLogMigrateMessage(); - - $migrations = drush_migrate_tools_migration_list($migration_names); - if (empty($migrations)) { - drush_log(dt('No migrations found.'), 'error'); - } - - // Take it one group at a time, rolling back the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - // Roll back in reverse order. - $migration_list = array_reverse($migration_list); - foreach ($migration_list as $migration_id => $migration) { - $executable = new MigrateExecutable($migration, $log, $options); - // drush_op() provides --simulate support. - drush_op([$executable, 'rollback']); - } - } -} - -/** - * Stop a migration. - * - * @param string $migration_id - * The migration id. - */ -function drush_migrate_tools_migrate_stop($migration_id = '') { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration') - ->createInstance($migration_id); - if ($migration) { - $status = $migration->getStatus(); - switch ($status) { - case MigrationInterface::STATUS_IDLE: - drush_log(dt('Migration @id is idle', ['@id' => $migration_id]), 'warning'); - break; - - case MigrationInterface::STATUS_DISABLED: - drush_log(dt('Migration @id is disabled', ['@id' => $migration_id]), 'warning'); - break; - - case MigrationInterface::STATUS_STOPPING: - drush_log(dt('Migration @id is already stopping', ['@id' => $migration_id]), 'warning'); - break; - - default: - $migration->interruptMigration(MigrationInterface::RESULT_STOPPED); - drush_log(dt('Migration @id requested to stop', ['@id' => $migration_id]), 'success'); - break; - } - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * Reset status. - * - * @param string $migration_id - * The migration id. - */ -function drush_migrate_tools_migrate_reset_status($migration_id = '') { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration') - ->createInstance($migration_id); - if ($migration) { - $status = $migration->getStatus(); - if ($status == MigrationInterface::STATUS_IDLE) { - drush_log(dt('Migration @id is already Idle', ['@id' => $migration_id]), 'warning'); - } - else { - $migration->setStatus(MigrationInterface::STATUS_IDLE); - drush_log(dt('Migration @id reset to Idle', ['@id' => $migration_id]), 'status'); - } - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * Print messages. - * - * @param string $migration_id - * The migration id. - */ -function drush_migrate_tools_migrate_messages($migration_id) { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration') - ->createInstance($migration_id); - if ($migration) { - $map = $migration->getIdMap(); - $first = TRUE; - $table = []; - foreach ($map->getMessageIterator() as $row) { - unset($row->msgid); - if ($first) { - // @todo: Ideally, replace sourceid* with source key names. Or, should - // getMessageIterator() do that? - foreach ($row as $column => $value) { - $table[0][] = $column; - } - $first = FALSE; - } - $table[] = (array) $row; - } - if (empty($table)) { - drush_log(dt('No messages for this migration'), 'status'); - } - else { - if (drush_get_option('csv')) { - foreach ($table as $row) { - fputcsv(STDOUT, $row); - } - } - else { - $widths = []; - foreach ($table[0] as $header) { - $widths[] = strlen($header) + 1; - } - drush_print_table($table, TRUE, $widths); - } - } - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * Print source fields. - * - * @param string $migration_id - * The migration id. - */ -function drush_migrate_tools_migrate_fields_source($migration_id) { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = \Drupal::service('plugin.manager.migration') - ->createInstance($migration_id); - if ($migration) { - $source = $migration->getSourcePlugin(); - $table = []; - foreach ($source->fields() as $machine_name => $description) { - $table[] = [strip_tags($description), $machine_name]; - } - drush_print_table($table); - } - else { - drush_log(dt('Migration @id does not exist', ['@id' => $migration_id]), 'error'); - } -} - -/** - * Retrieve a list of active migrations. - * - * @param string $migration_ids - * Comma-separated list of migrations - if present, return only these - * migrations. - * - * @return \Drupal\migrate\Plugin\MigrationInterface[][] - * An array keyed by migration group, each value containing an array of - * migrations or an empty array if no migrations match the input criteria. - */ -function drush_migrate_tools_migration_list($migration_ids = '') { - // Filter keys must match the migration configuration property name. - $filter['migration_group'] = drush_get_option('group') ? explode(',', drush_get_option('group')) : []; - $filter['migration_tags'] = drush_get_option('tag') ? explode(',', drush_get_option('tag')) : []; - - $manager = \Drupal::service('plugin.manager.migration'); - $plugins = $manager->createInstances([]); - $matched_migrations = []; - - // Get the set of migrations that may be filtered. - if (empty($migration_ids)) { - $matched_migrations = $plugins; - } - else { - // Get the requested migrations. - $migration_ids = explode(',', mb_strtolower($migration_ids)); - foreach ($plugins as $id => $migration) { - if (in_array(mb_strtolower($id), $migration_ids)) { - $matched_migrations[$id] = $migration; - } - } - } - - // Do not return any migrations which fail to meet requirements. - /** @var \Drupal\migrate\Plugin\Migration $migration */ - foreach ($matched_migrations as $id => $migration) { - if ($migration->getSourcePlugin() instanceof RequirementsInterface) { - try { - $migration->getSourcePlugin()->checkRequirements(); - } - catch (RequirementsException $e) { - unset($matched_migrations[$id]); - } - } - } - - // Filters the matched migrations if a group or a tag has been input. - if (!empty($filter['migration_group']) || !empty($filter['migration_tags'])) { - // Get migrations in any of the specified groups and with any of the - // specified tags. - foreach ($filter as $property => $values) { - if (!empty($values)) { - $filtered_migrations = []; - foreach ($values as $search_value) { - foreach ($matched_migrations as $id => $migration) { - // Cast to array because migration_tags can be an array. - $configured_values = (array) $migration->get($property); - $configured_id = (in_array($search_value, $configured_values)) ? $search_value : 'default'; - if (empty($search_value) || $search_value == $configured_id) { - if (empty($migration_ids) || in_array(mb_strtolower($id), $migration_ids)) { - $filtered_migrations[$id] = $migration; - } - } - } - } - $matched_migrations = $filtered_migrations; - } - } - } - - // Sort the matched migrations by group. - if (!empty($matched_migrations)) { - foreach ($matched_migrations as $id => $migration) { - $configured_group_id = empty($migration->migration_group) ? 'default' : $migration->migration_group; - $migrations[$configured_group_id][$id] = $migration; - } - } - return isset($migrations) ? $migrations : []; -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.info.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.info.yml deleted file mode 100644 index 104563b8e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -type: module -name: Migrate Tools -description: 'Tools to assist in developing and running migrations.' -package: Migration -# core: 8.x -configure: entity.migration_group.list -dependencies: - - drupal:migrate (>=8.3) - - migrate_plus:migrate_plus -test_dependencies: - - migrate_source_csv:migrate_source_csv (>=8.x-2.2) - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_tools' -datestamp: 1546879109 diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.action.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.action.yml deleted file mode 100644 index 869297cf7..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.action.yml +++ /dev/null @@ -1,11 +0,0 @@ -migrate_tools.add_group_action: - route_name: entity.migration_group.add_form - title: 'Add migration group' - appears_on: - - entity.migration_group.list - -#migrate_tools.add_migration_action: -# route_name: entity.migration.add_form -# title: 'Add migration' -# appears_on: -# - entity.migration.list diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.menu.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.menu.yml deleted file mode 100644 index d55ba56c1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -migrate_tools.menu: - title: Migrations - parent: system.admin_structure - description: Manage migration processes. - route_name: entity.migration_group.list diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.task.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.task.yml deleted file mode 100644 index da508a0ff..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.links.task.yml +++ /dev/null @@ -1,53 +0,0 @@ -# Component routing definition -entity.migration.overview: - route_name: entity.migration.overview - base_route: entity.migration.overview - title: View - -entity.migration.overview_general: - title: Overview - route_name: entity.migration.overview - parent_id: entity.migration.overview -entity.migration.overview_source: - title: Source - route_name: entity.migration.source - parent_id: entity.migration.overview - weight: 1 -entity.migration.overview_process: - title: Process - route_name: entity.migration.process - parent_id: entity.migration.overview - weight: 2 -entity.migration.overview_destination: - title: Destination - route_name: entity.migration.destination - parent_id: entity.migration.overview - weight: 3 - -entity.migration.edit_form: - route_name: entity.migration.edit_form - base_route: entity.migration.overview - title: Edit - -migrate_tools.messages: - route_name: migrate_tools.messages - base_route: entity.migration.overview - title: Messages - -entity.migration.delete_form: - route_name: entity.migration.delete_form - base_route: entity.migration.overview - title: Delete - weight: 10 - - -entity.migration.overview_general_edit: - title: Overview - route_name: entity.migration.edit_form - parent_id: entity.migration.edit_form - -entity.migration.overview_source_edit: - title: Source - route_name: migrate_tools.source_csv - parent_id: entity.migration.edit_form - weight: 1 diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.module b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.module deleted file mode 100644 index b8113fe3d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.module +++ /dev/null @@ -1,58 +0,0 @@ -set('admin_permission', 'administer migrations') - ->setHandlerClass('list_builder', 'Drupal\migrate_tools\Controller\MigrationListBuilder') - ->setFormClass('edit', 'Drupal\migrate_tools\Form\MigrationEditForm') - ->setFormClass('delete', 'Drupal\migrate_tools\Form\MigrationDeleteForm') - ->setLinkTemplate('list-form', '/admin/structure/migrate/manage/{migration_group}/migrations'); - - $entity_types['migration_group'] - ->set('admin_permission', 'administer migrations') - ->setHandlerClass('list_builder', 'Drupal\migrate_tools\Controller\MigrationGroupListBuilder') - ->setFormClass('add', 'Drupal\migrate_tools\Form\MigrationGroupAddForm') - ->setFormClass('edit', 'Drupal\migrate_tools\Form\MigrationGroupEditForm') - ->setFormClass('delete', 'Drupal\migrate_tools\Form\MigrationGroupDeleteForm') - ->setLinkTemplate('edit-form', '/admin/structure/migrate/manage/{migration_group}') - ->setLinkTemplate('delete-form', '/admin/structure/migrate/manage/{migration_group}/delete'); -} - -/** - * Implements hook_migration_plugins_alter(). - */ -function migrate_tools_migration_plugins_alter(array &$migrations) { - /** @var \Drupal\Core\TempStore\PrivateTempStoreFactory $store */ - $tempStoreFactory = \Drupal::service('tempstore.private'); - $store = $tempStoreFactory->get('migrate_tools'); - // TODO: remove work-around after - // https://www.drupal.org/project/drupal/issues/2860341 is fixed. - if (!\Drupal::request()->hasSession()) { - $session = \Drupal::service('session'); - \Drupal::request()->setSession($session); - $session->start(); - } - // Get the list of changed migrations. - $migrationsChanged = $store->get('migrations_changed'); - if (isset($store) && (is_array($migrationsChanged))) { - // Alter the source column names for each changed migration. - foreach ($migrationsChanged as $id) { - $data = $store->get($id); - if (isset($data['changed'])) { - $migrations[$id]['source']['column_names'] = $data['changed']; - } - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.permissions.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.permissions.yml deleted file mode 100644 index b5301e5c1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -'administer migrations': - title: 'Administer migrations' - description: Create, edit, and manage migration processed. diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.routing.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.routing.yml deleted file mode 100644 index ca04f9663..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.routing.yml +++ /dev/null @@ -1,197 +0,0 @@ -# This is the router item for listing all migration group entities. -entity.migration_group.list: - path: '/admin/structure/migrate' - defaults: - _entity_list: 'migration_group' - _title: 'Migrations' - requirements: - _permission: 'administer migrations' - -# This is the router item for adding our migration group entity. -entity.migration_group.add_form: - path: '/admin/structure/migrate/add' - defaults: - _title: 'Add migration group' - _entity_form: migration_group.add - requirements: - _entity_create_access: migration_group - -# This is the router item for editing our migration group entity. -entity.migration_group.edit_form: - path: '/admin/structure/migrate/manage/{migration_group}' - defaults: - _title: 'Edit migration group' - _entity_form: migration_group.edit - requirements: - _entity_access: migration_group.update - -# This is the router item for deleting an instance of our migration group entity. -entity.migration_group.delete_form: - path: '/admin/structure/migrate/manage/{migration_group}/delete' - defaults: - _title: 'Delete migration group' - _entity_form: migration_group.delete - requirements: - _entity_access: migration_group.delete - -# This is the router item for listing all migration entities. -entity.migration.list: - path: '/admin/structure/migrate/manage/{migration_group}/migrations' - defaults: - _entity_list: 'migration' - _title: 'Migrations' - requirements: - _permission: 'administer migrations' - -# This is the router item for adding our migration entity. -#entity.migration.add_form: -# path: '/admin/structure/migrate/manage/{migration_group}/migrations/add' -# defaults: -# _title: 'Add migration' -# _entity_form: migration.add -# requirements: -# _entity_create_access: migration - -# This is the router item for viewing our migration entity. -entity.migration.overview: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MigrationController::overview' - _title: 'Migration overview' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -entity.migration.source: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/source' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MigrationController::source' - _title: 'Source' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -entity.migration.process: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/process' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MigrationController::process' - _title: 'Process' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -entity.migration.process.run: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/process/run' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MigrationController::run' - _title: 'Run' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -entity.migration.destination: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/destination' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MigrationController::destination' - _title: 'Destination' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -# This is the router item for editing our migration entity. -entity.migration.edit_form: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/edit' - defaults: - _title: 'Edit migration' - _entity_form: migration.edit - _migrate_group: true - requirements: - _entity_access: migration.update - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -# This is the router item for deleting an instance of our migration entity. -entity.migration.delete_form: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/delete' - defaults: - _title: 'Delete migration' - _entity_form: migration.delete - _migrate_group: true - requirements: - _entity_access: migration.delete - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -migrate_tools.messages: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/messages' - defaults: - _controller: '\Drupal\migrate_tools\Controller\MessageController::overview' - _title_callback: '\Drupal\migrate_tools\Controller\MessageController::title' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -migrate_tools.execute: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/execute' - defaults: - _form: '\Drupal\migrate_tools\Form\MigrationExecuteForm' - _title: 'Execute migration' - _migrate_group: true - requirements: - _permission: 'administer migrations' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group -migrate_tools.source_csv: - path: '/admin/structure/migrate/manage/{migration_group}/migrations/{migration}/source/edit' - defaults: - _form: 'Drupal\migrate_tools\Form\SourceCsvForm' - _migrate_group: true - requirements: - _permission: 'administer migrations' - _custom_access: 'Drupal\migrate_tools\Form\SourceCsvForm::access' - options: - parameters: - migration: - type: entity:migration - migration_group: - type: entity:migration_group diff --git a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.services.yml b/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.services.yml deleted file mode 100644 index fa61e007f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/migrate_tools.services.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - logger.channel.migrate_tools: - class: Drupal\Core\Logger\LoggerChannel - factory: logger.factory:get - arguments: ['migrate_tools'] - route_processor.migrate_group: - class: Drupal\migrate_tools\Routing\RouteProcessor - tags: - - { name: route_processor_outbound } diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Commands/MigrateToolsCommands.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Commands/MigrateToolsCommands.php deleted file mode 100644 index dbae1fb20..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Commands/MigrateToolsCommands.php +++ /dev/null @@ -1,792 +0,0 @@ -migrationPluginManager = $migrationPluginManager; - $this->dateFormatter = $dateFormatter; - $this->entityTypeManager = $entityTypeManager; - $this->keyValue = $keyValue; - } - - /** - * List all migrations with current status. - * - * @param string $migration_names - * Restrict to a comma-separated list of migrations (Optional). - * @param array $options - * Additional options for the command. - * - * @command migrate:status - * - * @option group A comma-separated list of migration groups to list - * @option tag Name of the migration tag to list - * @option names-only Only return names, not all the details (faster) - * - * @default $options [] - * - * @usage migrate:status - * Retrieve status for all migrations - * @usage migrate:status --group=beer - * Retrieve status for all migrations in a given group - * @usage migrate:status --tag=user - * Retrieve status for all migrations with a given tag - * @usage migrate:status --group=beer --tag=user - * Retrieve status for all migrations in the beer group - * and with the user tag. - * @usage migrate:status beer_term,beer_node - * Retrieve status for specific migrations - * - * @validate-module-enabled migrate_tools - * - * @aliases ms, migrate-status - * - * @field-labels - * group: Group - * id: Migration ID - * status: Status - * total: Total - * imported: Imported - * unprocessed: Unprocessed - * last_imported: Last Imported - * @default-fields group,id,status,total,imported,unprocessed,last_imported - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * Migrations status formatted as table. - */ - public function status($migration_names = '', array $options = []) { - $options += [ - 'group' => NULL, - 'tag' => NULL, - 'names-only' => NULL, - ]; - $names_only = $options['names-only']; - - $migrations = $this->migrationsList($migration_names, $options); - - $table = []; - // Take it one group at a time, listing the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - /** @var \Drupal\migrate_plus\Entity\MigrationGroup $group */ - $group = $this->entityTypeManager->getStorage('migration_group')->load($group_id); - $group_name = !empty($group) ? "{$group->label()} ({$group->id()})" : $group_id; - - foreach ($migration_list as $migration_id => $migration) { - if ($names_only) { - $table[] = [ - 'group' => dt('Group: @name', ['@name' => $group_name]), - 'id' => $migration_id, - ]; - } - else { - try { - $map = $migration->getIdMap(); - $imported = $map->importedCount(); - $source_plugin = $migration->getSourcePlugin(); - } - catch (\Exception $e) { - $this->logger()->error( - dt( - 'Failure retrieving information on @migration: @message', - ['@migration' => $migration_id, '@message' => $e->getMessage()] - ) - ); - continue; - } - - try { - $source_rows = $source_plugin->count(); - // -1 indicates uncountable sources. - if ($source_rows == -1) { - $source_rows = dt('N/A'); - $unprocessed = dt('N/A'); - } - else { - $unprocessed = $source_rows - $map->processedCount(); - } - } - catch (\Exception $e) { - $this->logger()->error( - dt( - 'Could not retrieve source count from @migration: @message', - ['@migration' => $migration_id, '@message' => $e->getMessage()] - ) - ); - $source_rows = dt('N/A'); - $unprocessed = dt('N/A'); - } - - $status = $migration->getStatusLabel(); - $migrate_last_imported_store = $this->keyValue->get( - 'migrate_last_imported' - ); - $last_imported = $migrate_last_imported_store->get( - $migration->id(), - FALSE - ); - if ($last_imported) { - $last_imported = $this->dateFormatter->format( - $last_imported / 1000, - 'custom', - 'Y-m-d H:i:s' - ); - } - else { - $last_imported = ''; - } - $table[] = [ - 'group' => $group_name, - 'id' => $migration_id, - 'status' => $status, - 'total' => $source_rows, - 'imported' => $imported, - 'unprocessed' => $unprocessed, - 'last_imported' => $last_imported, - ]; - } - } - - // Add empty row to separate groups, for readability. - end($migrations); - if ($group_id !== key($migrations)) { - $table[] = []; - } - } - - return new RowsOfFields($table); - } - - /** - * Perform one or more migration processes. - * - * @param string $migration_names - * ID of migration(s) to import. Delimit multiple using commas. - * @param array $options - * Additional options for the command. - * - * @command migrate:import - * - * @option all Process all migrations. - * @option group A comma-separated list of migration groups to import - * @option tag Name of the migration tag to import - * @option limit Limit on the number of items to process in each migration - * @option feedback Frequency of progress messages, in items processed - * @option idlist Comma-separated list of IDs to import - * @option idlist-delimiter The delimiter for records, defaults to ':' - * @option update In addition to processing unprocessed items from the - * source, update previously-imported items with the current data - * @option force Force an operation to run, even if all dependencies are not - * satisfied - * @option execute-dependencies Execute all dependent migrations first. - * - * @default $options [] - * - * @usage migrate:import --all - * Perform all migrations - * @usage migrate:import --group=beer - * Import all migrations in the beer group - * @usage migrate:import --tag=user - * Import all migrations with the user tag - * @usage migrate:import --group=beer --tag=user - * Import all migrations in the beer group and with the user tag - * @usage migrate:import beer_term,beer_node - * Import new terms and nodes - * @usage migrate:import beer_user --limit=2 - * Import no more than 2 users - * @usage migrate:import beer_user --idlist=5 - * Import the user record with source ID 5 - * @usage migrate:import beer_node_revision --idlist=1:2,2:3,3:5 - * Import the node revision record with source IDs [1,2], [2,3], and [3,5] - * - * @validate-module-enabled migrate_tools - * - * @aliases mim, migrate-import - * - * @throws \Exception - * If there are not enough parameters to the command. - */ - public function import($migration_names = '', array $options = []) { - $options += [ - 'all' => NULL, - 'group' => NULL, - 'tag' => NULL, - 'limit' => NULL, - 'feedback' => NULL, - 'idlist' => NULL, - 'idlist-delimiter' => ':', - 'update' => NULL, - 'force' => NULL, - 'execute-dependencies' => NULL, - ]; - $group_names = $options['group']; - $tag_names = $options['tag']; - $all = $options['all']; - $additional_options = []; - if (!$all && !$group_names && !$migration_names && !$tag_names) { - throw new \Exception(dt('You must specify --all, --group, --tag or one or more migration names separated by commas')); - } - - $possible_options = [ - 'limit', - 'feedback', - 'idlist', - 'idlist-delimiter', - 'update', - 'force', - 'execute-dependencies', - ]; - foreach ($possible_options as $option) { - if ($options[$option]) { - $additional_options[$option] = $options[$option]; - } - } - - $migrations = $this->migrationsList($migration_names, $options); - if (empty($migrations)) { - $this->logger->error(dt('No migrations found.')); - } - - // Take it one group at a time, importing the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - array_walk( - $migration_list, - [$this, 'executeMigration'], - $additional_options - ); - } - } - - /** - * Rollback one or more migrations. - * - * @param string $migration_names - * Name of migration(s) to rollback. Delimit multiple using commas. - * @param array $options - * Additional options for the command. - * - * @command migrate:rollback - * - * @option all Process all migrations. - * @option group A comma-separated list of migration groups to rollback - * @option tag ID of the migration tag to rollback - * @option feedback Frequency of progress messages, in items processed - * @option feedback Frequency of progress messages, in items processed - * @option idlist Comma-separated list of IDs to rollback - * @option idlist-delimiter The delimiter for records, defaults to ':' - * - * @default $options [] - * - * @usage migrate:rollback --all - * Perform all migrations - * @usage migrate:rollback --group=beer - * Rollback all migrations in the beer group - * @usage migrate:rollback --tag=user - * Rollback all migrations with the user tag - * @usage migrate:rollback --group=beer --tag=user - * Rollback all migrations in the beer group and with the user tag - * @usage migrate:rollback beer_term,beer_node - * Rollback imported terms and nodes - * @usage migrate:rollback beer_user --idlist=5 - * Rollback imported user record with source ID 5 - * @validate-module-enabled migrate_tools - * - * @aliases mr, migrate-rollback - * - * @throws \Exception - * If there are not enough parameters to the command. - */ - public function rollback($migration_names = '', array $options = []) { - $options += [ - 'all' => NULL, - 'group' => NULL, - 'tag' => NULL, - 'feedback' => NULL, - 'idlist' => NULL, - 'idlist-delimiter' => ':', - ]; - $group_names = $options['group']; - $tag_names = $options['tag']; - $all = $options['all']; - $additional_options = []; - if (!$all && !$group_names && !$migration_names && !$tag_names) { - throw new \Exception(dt('You must specify --all, --group, --tag, or one or more migration names separated by commas')); - } - - foreach (['feedback', 'idlist', 'idlist-delimiter'] as $option) { - if ($options[$option]) { - $additional_options[$option] = $options[$option]; - } - } - - $migrations = $this->migrationsList($migration_names, $options); - if (empty($migrations)) { - $this->logger()->error(dt('No migrations found.')); - } - - // Take it one group at a time, - // rolling back the migrations within each group. - foreach ($migrations as $group_id => $migration_list) { - // Roll back in reverse order. - $migration_list = array_reverse($migration_list); - foreach ($migration_list as $migration_id => $migration) { - $executable = new MigrateExecutable( - $migration, - $this->getMigrateMessage(), - $additional_options - ); - // drush_op() provides --simulate support. - drush_op([$executable, 'rollback']); - } - } - } - - /** - * Stop an active migration operation. - * - * @param string $migration_id - * ID of migration to stop. - * - * @command migrate:stop - * - * @validate-module-enabled migrate_tools - * @aliases mst, migrate-stop - */ - public function stop($migration_id = '') { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance( - $migration_id - ); - if ($migration) { - $status = $migration->getStatus(); - switch ($status) { - case MigrationInterface::STATUS_IDLE: - $this->logger()->warning( - dt('Migration @id is idle', ['@id' => $migration_id]) - ); - break; - - case MigrationInterface::STATUS_DISABLED: - $this->logger()->warning( - dt('Migration @id is disabled', ['@id' => $migration_id]) - ); - break; - - case MigrationInterface::STATUS_STOPPING: - $this->logger()->warning( - dt('Migration @id is already stopping', ['@id' => $migration_id]) - ); - break; - - default: - $migration->interruptMigration(MigrationInterface::RESULT_STOPPED); - $this->logger()->notice( - dt('Migration @id requested to stop', ['@id' => $migration_id]) - ); - break; - } - } - else { - $this->logger()->error( - dt('Migration @id does not exist', ['@id' => $migration_id]) - ); - } - } - - /** - * Reset a active migration's status to idle. - * - * @param string $migration_id - * ID of migration to reset. - * - * @command migrate:reset-status - * - * @validate-module-enabled migrate_tools - * @aliases mrs, migrate-reset-status - */ - public function resetStatus($migration_id = '') { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance( - $migration_id - ); - if ($migration) { - $status = $migration->getStatus(); - if ($status == MigrationInterface::STATUS_IDLE) { - $this->logger()->warning( - dt('Migration @id is already Idle', ['@id' => $migration_id]) - ); - } - else { - $migration->setStatus(MigrationInterface::STATUS_IDLE); - $this->logger()->notice( - dt('Migration @id reset to Idle', ['@id' => $migration_id]) - ); - } - } - else { - $this->logger()->error( - dt('Migration @id does not exist', ['@id' => $migration_id]) - ); - } - } - - /** - * View any messages associated with a migration. - * - * @param string $migration_id - * ID of the migration. - * @param array $options - * Additional options for the command. - * - * @command migrate:messages - * - * @option csv Export messages as a CSV - * @option idlist Comma-separated list of IDs to import - * @option idlist-delimiter The delimiter for records, defaults to ':' - * - * @default $options [] - * - * @usage migrate:messages MyNode - * Show all messages for the MyNode migration - * - * @validate-module-enabled migrate_tools - * - * @aliases mmsg,migrate-messages - * - * @field-labels - * source_ids_hash: Source IDs Hash - * level: Level - * message: Message - * @default-fields source_ids_hash,level,message - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * Source fields of the given migration formatted as a table. - */ - public function messages($migration_id, array $options = []) { - $options += [ - 'csv' => NULL, - 'idlist' => NULL, - 'idlist-delimiter' => ':', - ]; - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance( - $migration_id - ); - if (!$migration) { - $this->logger()->error( - dt('Migration @id does not exist', ['@id' => $migration_id]) - ); - return NULL; - } - $id_list = MigrateTools::buildIdList($options); - $map = new IdMapFilter($migration->getIdMap(), $id_list); - $table = []; - foreach ($map->getMessageIterator() as $row) { - unset($row->msgid); - $table[] = (array) $row; - } - if (empty($table)) { - $this->logger()->notice(dt('No messages for this migration')); - return NULL; - } - - if ($options['csv']) { - fputcsv(STDOUT, array_keys($table[0])); - foreach ($table as $row) { - fputcsv(STDOUT, $row); - } - return NULL; - } - return new RowsOfFields($table); - } - - /** - * List the fields available for mapping in a source. - * - * @param string $migration_id - * ID of the migration. - * - * @command migrate:fields-source - * - * @usage migrate:fields-source my_node - * List fields for the source in the my_node migration - * - * @validate-module-enabled migrate_tools - * - * @aliases mfs, migrate-fields-source - * - * @field-labels - * machine_name: Machine Name - * description: Description - * @default-fields machine_name,description - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * Source fields of the given migration formatted as a table. - */ - public function fieldsSource($migration_id) { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance( - $migration_id - ); - if ($migration) { - $source = $migration->getSourcePlugin(); - $table = []; - foreach ($source->fields() as $machine_name => $description) { - $table[] = [ - 'machine_name' => $machine_name, - 'description' => strip_tags($description), - ]; - } - return new RowsOfFields($table); - } - else { - $this->logger()->error( - dt('Migration @id does not exist', ['@id' => $migration_id]) - ); - } - } - - /** - * Retrieve a list of active migrations. - * - * @param string $migration_ids - * Comma-separated list of migrations - - * if present, return only these migrations. - * @param array $options - * Command options. - * - * @default $options [] - * - * @return \Drupal\migrate\Plugin\MigrationInterface[][] - * An array keyed by migration group, each value containing an array of - * migrations or an empty array if no migrations match the input criteria. - */ - protected function migrationsList($migration_ids = '', array $options = []) { - // Filter keys must match the migration configuration property name. - $filter['migration_group'] = $options['group'] ? explode( - ',', - $options['group'] - ) : []; - $filter['migration_tags'] = $options['tag'] ? explode( - ',', - $options['tag'] - ) : []; - - $manager = $this->migrationPluginManager; - $plugins = $manager->createInstances([]); - $matched_migrations = []; - - // Get the set of migrations that may be filtered. - if (empty($migration_ids)) { - $matched_migrations = $plugins; - } - else { - // Get the requested migrations. - $migration_ids = explode(',', mb_strtolower($migration_ids)); - foreach ($plugins as $id => $migration) { - if (in_array(mb_strtolower($id), $migration_ids)) { - $matched_migrations[$id] = $migration; - } - } - } - - // Do not return any migrations which fail to meet requirements. - /** @var \Drupal\migrate\Plugin\Migration $migration */ - foreach ($matched_migrations as $id => $migration) { - if ($migration->getSourcePlugin() instanceof RequirementsInterface) { - try { - $migration->getSourcePlugin()->checkRequirements(); - } - catch (RequirementsException $e) { - unset($matched_migrations[$id]); - } - } - } - - // Filters the matched migrations if a group or a tag has been input. - if (!empty($filter['migration_group']) || !empty($filter['migration_tags'])) { - // Get migrations in any of the specified groups and with any of the - // specified tags. - foreach ($filter as $property => $values) { - if (!empty($values)) { - $filtered_migrations = []; - foreach ($values as $search_value) { - foreach ($matched_migrations as $id => $migration) { - // Cast to array because migration_tags can be an array. - $configured_values = (array) $migration->get($property); - $configured_id = (in_array( - $search_value, - $configured_values - )) ? $search_value : 'default'; - if (empty($search_value) || $search_value == $configured_id) { - if (empty($migration_ids) || in_array( - mb_strtolower($id), - $migration_ids - )) { - $filtered_migrations[$id] = $migration; - } - } - } - } - $matched_migrations = $filtered_migrations; - } - } - } - - // Sort the matched migrations by group. - if (!empty($matched_migrations)) { - foreach ($matched_migrations as $id => $migration) { - $configured_group_id = empty($migration->migration_group) ? 'default' : $migration->migration_group; - $migrations[$configured_group_id][$id] = $migration; - } - } - return isset($migrations) ? $migrations : []; - } - - /** - * Executes a single migration. - * - * If the --execute-dependencies option was given, - * the migration's dependencies will also be executed first. - * - * @param \Drupal\migrate\Plugin\MigrationInterface $migration - * The migration to execute. - * @param string $migration_id - * The migration ID (not used, just an artifact of array_walk()). - * @param array $options - * Additional options of the command. - * - * @default $options [] - * - * @throws \Exception - * If some migrations failed during execution. - */ - protected function executeMigration(MigrationInterface $migration, $migration_id, array $options = []) { - // Keep track of all migrations run during this command so the same - // migration is not run multiple times. - static $executed_migrations = []; - - if (isset($options['execute-dependencies'])) { - $required_migrations = $migration->get('requirements'); - $required_migrations = array_filter($required_migrations, function ($value) use ($executed_migrations) { - return !isset($executed_migrations[$value]); - }); - - if (!empty($required_migrations)) { - $manager = $this->migrationPluginManager; - $required_migrations = $manager->createInstances($required_migrations); - $dependency_options = array_merge($options, ['is_dependency' => TRUE]); - array_walk($required_migrations, [$this, __FUNCTION__], $dependency_options); - $executed_migrations += $required_migrations; - } - } - if (!empty($options['force'])) { - $migration->set('requirements', []); - } - if (!empty($options['update'])) { - if (empty($options['idlist'])) { - $migration->getIdMap()->prepareUpdate(); - } - else { - $source_id_values_list = MigrateTools::buildIdList($options); - $keys = array_keys($migration->getSourcePlugin()->getIds()); - foreach ($source_id_values_list as $source_id_values) { - $migration->getIdMap()->setUpdate(array_combine($keys, $source_id_values)); - } - } - } - $executable = new MigrateExecutable($migration, $this->getMigrateMessage(), $options); - // drush_op() provides --simulate support. - drush_op([$executable, 'import']); - $executed_migrations += [$migration_id => $migration_id]; - if ($count = $executable->getFailedCount()) { - // Nudge Drush to use a non-zero exit code. - throw new \Exception( - dt( - '!name Migration - !count failed.', - ['!name' => $migration_id, '!count' => $count] - ) - ); - } - } - - /** - * Gets the migrate message logger. - * - * @return \Drupal\migrate\MigrateMessageInterface - * The migrate message service. - */ - protected function getMigrateMessage() { - if (!isset($this->migrateMessage)) { - $this->migrateMessage = new Drush9LogMigrateMessage($this->logger()); - } - return $this->migrateMessage; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MessageController.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MessageController.php deleted file mode 100644 index a08dba7c3..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MessageController.php +++ /dev/null @@ -1,162 +0,0 @@ -get('database'), - $container->get('plugin.manager.migration') - ); - } - - /** - * Constructs a MessageController object. - * - * @param \Drupal\Core\Database\Connection $database - * A database connection. - * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager - * The migration plugin manager. - */ - public function __construct(Connection $database, MigrationPluginManagerInterface $migration_plugin_manager) { - $this->database = $database; - $this->migrationPluginManager = $migration_plugin_manager; - } - - /** - * Gets an array of log level classes. - * - * @return array - * An array of log level classes. - */ - public static function getLogLevelClassMap() { - return [ - MigrationInterface::MESSAGE_INFORMATIONAL => 'migrate-message-4', - MigrationInterface::MESSAGE_NOTICE => 'migrate-message-3', - MigrationInterface::MESSAGE_WARNING => 'migrate-message-2', - MigrationInterface::MESSAGE_ERROR => 'migrate-message-1', - ]; - } - - /** - * Displays a listing of migration messages. - * - * Messages are truncated at 56 chars. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function overview(MigrationGroupInterface $migration_group, MigratePlusMigrationInterface $migration) { - $rows = []; - $classes = static::getLogLevelClassMap(); - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - $source_id_field_names = array_keys($migration_plugin->getSourcePlugin()->getIds()); - $column_number = 1; - foreach ($source_id_field_names as $source_id_field_name) { - $header[] = [ - 'data' => $source_id_field_name, - 'field' => 'sourceid' . $column_number++, - 'class' => [RESPONSIVE_PRIORITY_MEDIUM], - ]; - } - $header[] = [ - 'data' => $this->t('Severity level'), - 'field' => 'level', - 'class' => [RESPONSIVE_PRIORITY_LOW], - ]; - $header[] = [ - 'data' => $this->t('Message'), - 'field' => 'message', - ]; - - $message_table = $migration_plugin->getIdMap()->messageTableName(); - $map_table = $migration_plugin->getIdMap()->mapTableName(); - $query = $this->database->select($message_table, 'msg') - ->extend('\Drupal\Core\Database\Query\PagerSelectExtender') - ->extend('\Drupal\Core\Database\Query\TableSortExtender'); - $query->innerJoin($map_table, 'map', 'msg.source_ids_hash=map.source_ids_hash'); - $query->fields('msg'); - $query->fields('map'); - $result = $query - ->limit(50) - ->orderByHeader($header) - ->execute(); - - foreach ($result as $message_row) { - $column_number = 1; - foreach ($source_id_field_names as $source_id_field_name) { - $column_name = 'sourceid' . $column_number++; - $row[$column_name] = $message_row->$column_name; - } - $row['level'] = $message_row->level; - $row['message'] = $message_row->message; - $row['class'] = [Html::getClass('migrate-message-' . $message_row->level), $classes[$message_row->level]]; - $rows[] = $row; - } - - $build['message_table'] = [ - '#type' => 'table', - '#header' => $header, - '#rows' => $rows, - '#attributes' => ['id' => $message_table, 'class' => [$message_table]], - '#empty' => $this->t('No messages for this migration.'), - ]; - $build['message_pager'] = ['#type' => 'pager']; - - return $build; - } - - /** - * Get the title of the page. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return \Drupal\Core\StringTranslation\TranslatableMarkup - * The translated title. - */ - public function title(MigrationGroupInterface $migration_group, MigratePlusMigrationInterface $migration) { - return $this->t( - 'Messages of %migration', - ['%migration' => $migration->label()] - ); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationController.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationController.php deleted file mode 100644 index 664c41043..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationController.php +++ /dev/null @@ -1,303 +0,0 @@ -migrationPluginManager = $migration_plugin_manager; - $this->currentRouteMatch = $currentRouteMatch; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.migration'), - $container->get('current_route_match') - ); - } - - /** - * Displays an overview of a migration entity. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function overview(MigrationGroupInterface $migration_group, MigrationInterface $migration) { - $build['overview'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Overview'), - ]; - - $build['overview']['group'] = [ - '#title' => $this->t('Group:'), - '#markup' => Xss::filterAdmin($migration_group->label()), - '#type' => 'item', - ]; - - $build['overview']['description'] = [ - '#title' => $this->t('Description:'), - '#markup' => Xss::filterAdmin($migration->label()), - '#type' => 'item', - ]; - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - $migration_dependencies = $migration_plugin->getMigrationDependencies(); - if (!empty($migration_dependencies['required'])) { - $build['overview']['dependencies'] = [ - '#title' => $this->t('Migration Dependencies') , - '#markup' => Xss::filterAdmin(implode(', ', $migration_dependencies['required'])), - '#type' => 'item', - ]; - } - if (!empty($migration_dependencies['optional'])) { - $build['overview']['soft_dependencies'] = [ - '#title' => $this->t('Soft Migration Dependencies'), - '#markup' => Xss::filterAdmin(implode(', ', $migration_dependencies['optional'])), - '#type' => 'item', - ]; - } - - return $build; - } - - /** - * Display source information of a migration entity. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function source(MigrationGroupInterface $migration_group, MigrationInterface $migration) { - // Source field information. - $build['source'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Source'), - '#group' => 'detail', - '#description' => $this->t('

        These are the fields available from the source of this migration task. The machine names listed here may be used as sources in the process pipeline.

        '), - '#attributes' => [ - 'id' => 'migration-detail-source', - ], - ]; - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - $source = $migration_plugin->getSourcePlugin(); - $build['source']['query'] = [ - '#type' => 'item', - '#title' => $this->t('Query'), - '#markup' => '
        ' . Xss::filterAdmin($source) . '
        ', - ]; - $header = [$this->t('Machine name'), $this->t('Description')]; - $rows = []; - foreach ($source->fields($migration_plugin) as $machine_name => $description) { - $rows[] = [ - ['data' => Html::escape($machine_name)], - ['data' => Xss::filterAdmin($description)], - ]; - } - - $build['source']['fields'] = [ - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('No fields'), - ]; - - return $build; - } - - /** - * Run a migration. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function run(MigrationGroupInterface $migration_group, MigrationInterface $migration) { - $migrateMessage = new MigrateMessage(); - $options = []; - - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - $executable = new MigrateBatchExecutable($migration_plugin, $migrateMessage, $options); - $executable->batchImport(); - - $migration_group = $this->currentRouteMatch->getParameter('migration_group'); - $route_parameters = [ - 'migration_group' => $migration_group, - 'migration' => $migration->id(), - ]; - return batch_process(Url::fromRoute('entity.migration.process', $route_parameters)); - } - - /** - * Display process information of a migration entity. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function process(MigrationGroupInterface $migration_group, MigrationInterface $migration) { - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - - // Process information. - $build['process'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Process'), - ]; - - $header = [ - $this->t('Destination'), - $this->t('Source'), - $this->t('Process plugin'), - $this->t('Default'), - ]; - $rows = []; - foreach ($migration_plugin->getProcess() as $destination_id => $process_line) { - $row = []; - $row[] = ['data' => Html::escape($destination_id)]; - if (isset($process_line[0]['source'])) { - if (is_array($process_line[0]['source'])) { - $process_line[0]['source'] = implode(', ', $process_line[0]['source']); - } - $row[] = ['data' => Xss::filterAdmin($process_line[0]['source'])]; - } - else { - $row[] = ''; - } - if (isset($process_line[0]['plugin'])) { - $row[] = ['data' => Xss::filterAdmin($process_line[0]['plugin'])]; - } - else { - $row[] = ''; - } - if (isset($process_line[0]['default_value'])) { - $row[] = ['data' => Xss::filterAdmin($process_line[0]['default_value'])]; - } - else { - $row[] = ''; - } - $rows[] = $row; - } - - $build['process']['fields'] = [ - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('No process defined.'), - ]; - - $build['process']['run'] = [ - '#type' => 'link', - '#title' => $this->t('Run'), - '#url' => Url::fromRoute('entity.migration.process.run', ['migration_group' => $migration_group->id(), 'migration' => $migration->id()]), - ]; - - return $build; - } - - /** - * Displays destination information of a migration entity. - * - * @param \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group - * The migration group. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return array - * A render array as expected by drupal_render(). - */ - public function destination(MigrationGroupInterface $migration_group, MigrationInterface $migration) { - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - - // Destination field information. - $build['destination'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Destination'), - '#group' => 'detail', - '#description' => $this->t('

        These are the fields available in the destination plugin of this migration task. The machine names are those available to be used as the keys in the process pipeline.

        '), - '#attributes' => [ - 'id' => 'migration-detail-destination', - ], - ]; - $destination = $migration_plugin->getDestinationPlugin(); - $build['destination']['type'] = [ - '#type' => 'item', - '#title' => $this->t('Type'), - '#markup' => Xss::filterAdmin($destination->getPluginId()), - ]; - $header = [$this->t('Machine name'), $this->t('Description')]; - $rows = []; - $destination_fields = $destination->fields() ?: []; - foreach ($destination_fields as $machine_name => $description) { - $rows[] = [ - ['data' => Html::escape($machine_name)], - ['data' => Xss::filterAdmin($description)], - ]; - } - - $build['destination']['fields'] = [ - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => $this->t('No fields'), - ]; - - return $build; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationGroupListBuilder.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationGroupListBuilder.php deleted file mode 100644 index 8ab2b87fb..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationGroupListBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -t('Migration Group'); - $header['machine_name'] = $this->t('Machine Name'); - $header['description'] = $this->t('Description'); - $header['source_type'] = $this->t('Source Type'); - return $header + parent::buildHeader(); - } - - /** - * Builds a row for an entity in the entity listing. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity for which to build the row. - * - * @return array - * A render array of the table row for displaying the entity. - * - * @see \Drupal\Core\Entity\EntityListController::render() - */ - public function buildRow(EntityInterface $entity) { - $row['label'] = $entity->label(); - $row['machine_name'] = $entity->id(); - $row['description'] = $entity->get('description'); - $row['source_type'] = $entity->get('source_type'); - - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - $operations['list'] = [ - 'title' => $this->t('List migrations'), - 'weight' => 0, - 'url' => Url::fromRoute('entity.migration.list', ['migration_group' => $entity->id()]), - ]; - - return $operations; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationListBuilder.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationListBuilder.php deleted file mode 100644 index 94951b0e9..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Controller/MigrationListBuilder.php +++ /dev/null @@ -1,244 +0,0 @@ -currentRouteMatch = $current_route_match; - $this->migrationPluginManager = $migration_plugin_manager; - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), - $container->get('current_route_match'), - $container->get('plugin.manager.migration'), - $container->get('logger.channel.migrate_tools') - ); - } - - /** - * Retrieve the migrations belonging to the appropriate group. - * - * @return array - * An array of entity IDs. - */ - protected function getEntityIds() { - $migration_group = $this->currentRouteMatch->getParameter('migration_group'); - - $query = $this->getStorage()->getQuery() - ->sort($this->entityType->getKey('id')); - - $migration_groups = MigrationGroup::loadMultiple(); - - if (array_key_exists($migration_group, $migration_groups)) { - $query->condition('migration_group', $migration_group); - } - else { - $query->notExists('migration_group'); - } - // Only add the pager if a limit is specified. - if ($this->limit) { - $query->pager($this->limit); - } - return $query->execute(); - } - - /** - * Builds the header row for the entity listing. - * - * @return array - * A render array structure of header strings. - * - * @see \Drupal\Core\Entity\EntityListController::render() - */ - public function buildHeader() { - $header['label'] = $this->t('Migration'); - $header['machine_name'] = $this->t('Machine Name'); - $header['status'] = $this->t('Status'); - $header['total'] = $this->t('Total'); - $header['imported'] = $this->t('Imported'); - $header['unprocessed'] = $this->t('Unprocessed'); - $header['messages'] = $this->t('Messages'); - $header['last_imported'] = $this->t('Last Imported'); - $header['operations'] = $this->t('Operations'); - return $header; - } - - /** - * Builds a row for a migration plugin. - * - * @param \Drupal\Core\Entity\EntityInterface $migration_entity - * The migration plugin for which to build the row. - * - * @return array|null - * A render array of the table row for displaying the plugin information. - * - * @see \Drupal\Core\Entity\EntityListController::render() - */ - public function buildRow(EntityInterface $migration_entity) { - try { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance($migration_entity->id()); - $migration_group = $migration_entity->get('migration_group'); - if (!$migration_group) { - $migration_group = 'default'; - } - $route_parameters = [ - 'migration_group' => $migration_group, - 'migration' => $migration->id(), - ]; - $row['label'] = [ - 'data' => [ - '#type' => 'link', - '#title' => $migration->label(), - '#url' => Url::fromRoute("entity.migration.overview", $route_parameters), - ], - ]; - $row['machine_name'] = $migration->id(); - $row['status'] = $migration->getStatusLabel(); - } - catch (PluginException $e) { - $this->logger->warning('Migration entity id %id is malformed: %orig', ['%id' => $migration_entity->id(), '%orig' => $e->getMessage()]); - return NULL; - } - - try { - // Derive the stats. - $source_plugin = $migration->getSourcePlugin(); - $row['total'] = $source_plugin->count(); - $map = $migration->getIdMap(); - $row['imported'] = $map->importedCount(); - // -1 indicates uncountable sources. - if ($row['total'] == -1) { - $row['total'] = $this->t('N/A'); - $row['unprocessed'] = $this->t('N/A'); - } - else { - $row['unprocessed'] = $row['total'] - $map->processedCount(); - } - $row['messages'] = [ - 'data' => [ - '#type' => 'link', - '#title' => $map->messageCount(), - '#url' => Url::fromRoute("migrate_tools.messages", $route_parameters), - ], - ]; - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $last_imported = $migrate_last_imported_store->get($migration->id(), FALSE); - if ($last_imported) { - /** @var \Drupal\Core\Datetime\DateFormatter $date_formatter */ - $date_formatter = \Drupal::service('date.formatter'); - $row['last_imported'] = $date_formatter->format($last_imported / 1000, - 'custom', 'Y-m-d H:i:s'); - } - else { - $row['last_imported'] = ''; - } - - $row['operations']['data'] = [ - '#type' => 'dropbutton', - '#links' => [ - 'simple_form' => [ - 'title' => $this->t('Execute'), - 'url' => Url::fromRoute('migrate_tools.execute', [ - 'migration_group' => $migration_group, - 'migration' => $migration->id(), - ]), - ], - ], - ]; - } - catch (PluginException $e) { - // Derive the stats. - $row['status'] = $this->t('No data found'); - $row['total'] = $this->t('N/A'); - $row['imported'] = $this->t('N/A'); - $row['unprocessed'] = $this->t('N/A'); - $row['messages'] = $this->t('N/A'); - $row['last_imported'] = $this->t('N/A'); - $row['operations'] = $this->t('N/A'); - } - - return $row; - } - - /** - * Add group route parameter. - * - * @param \Drupal\Core\Url $url - * The URL associated with an operation. - * @param string $migration_group - * The migration's parent group. - */ - protected function addGroupParameter(Url $url, $migration_group) { - if (!$migration_group) { - $migration_group = 'default'; - } - $route_parameters = $url->getRouteParameters() + ['migration_group' => $migration_group]; - $url->setRouteParameters($route_parameters); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Drush9LogMigrateMessage.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Drush9LogMigrateMessage.php deleted file mode 100644 index 0217a58e1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Drush9LogMigrateMessage.php +++ /dev/null @@ -1,48 +0,0 @@ - 'notice', - ]; - - /** - * DrushLogMigrateMessage constructor. - */ - public function __construct(LoggerInterface $logger) { - $this->setLogger($logger); - } - - /** - * Output a message from the migration. - * - * @param string $message - * The message to display. - * @param string $type - * The type of message to display. - */ - public function display($message, $type = 'status') { - $type = isset($this->map[$type]) ? $this->map[$type] : $type; - $this->logger->log($type, $message); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/DrushLogMigrateMessage.php b/sites/all/modules/contrib/migrate/migrate_tools/src/DrushLogMigrateMessage.php deleted file mode 100644 index 4f7e92494..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/DrushLogMigrateMessage.php +++ /dev/null @@ -1,28 +0,0 @@ -t('Are you sure you want to delete migration %label?', [ - '%label' => $this->entity->label(), - ]); - } - - /** - * Gather the confirmation text. - * - * @return string - * Translated string. - */ - public function getConfirmText() { - return $this->t('Delete Migration'); - } - - /** - * Gets the cancel URL. - * - * @return \Drupal\Core\Url - * The URL to go to if the user cancels the deletion. - */ - public function getCancelUrl() { - return new Url('entity.migration_group.list'); - } - - /** - * The submit handler for the confirm form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Delete the entity. - $this->entity->delete(); - - // Set a message that the entity was deleted. - $this->messenger()->addStatus($this->t('Migration %label was deleted.', [ - '%label' => $this->entity->label(), - ])); - - // Redirect the user to the list controller when complete. - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationEditForm.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationEditForm.php deleted file mode 100644 index 15740c60b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationEditForm.php +++ /dev/null @@ -1,50 +0,0 @@ -t('Update Migration'); - - return $actions; - } - - /** - * Add group route parameter. - * - * @param \Drupal\Core\Url $url - * The URL associated with an operation. - * @param string $migration_group - * The migration's parent group. - */ - protected function addGroupParameter(Url $url, $migration_group) { - $route_parameters = $url->getRouteParameters() + ['migration_group' => $migration_group]; - $url->setRouteParameters($route_parameters); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationExecuteForm.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationExecuteForm.php deleted file mode 100644 index 352894649..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationExecuteForm.php +++ /dev/null @@ -1,217 +0,0 @@ -migrationPluginManager = $migration_plugin_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.migration') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'migration_execute_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - - $form = []; - - $form['operations'] = $this->migrateMigrateOperations(); - - return $form; - } - - /** - * Get Operations. - */ - private function migrateMigrateOperations() { - // Build the 'Update options' form. - $form = [ - '#type' => 'fieldset', - '#title' => $this->t('Operations'), - ]; - $options = [ - 'import' => $this->t('Import'), - 'rollback' => $this->t('Rollback'), - 'stop' => $this->t('Stop'), - 'reset' => $this->t('Reset'), - ]; - $form['operation'] = [ - '#type' => 'select', - '#title' => $this->t('Choose an operation to run'), - '#options' => $options, - '#default_value' => 'import', - '#required' => TRUE, - ]; - $form['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Execute'), - ]; - $definitions = []; - $definitions[] = $this->t('Import: Imports all previously unprocessed records from the source, plus any records marked for update, into destination Drupal objects.'); - $definitions[] = $this->t('Rollback: Deletes all Drupal objects created by the import.'); - $definitions[] = $this->t('Stop: Cleanly interrupts any import or rollback processes that may currently be running.'); - $definitions[] = $this->t('Reset: Sometimes a process may fail to stop cleanly, and be left stuck in an Importing or Rolling Back status. Choose Reset to clear the status and permit other operations to proceed.'); - $form['definitions'] = [ - '#theme' => 'item_list', - '#title' => $this->t('Definitions'), - '#list_type' => 'ul', - '#items' => $definitions, - ]; - - $form['options'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Options'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ]; - $form['options']['update'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Update'), - '#description' => $this->t('Check this box to update all previously-imported content - in addition to importing new content. Leave unchecked to only import - new content'), - ]; - $form['options']['force'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Ignore dependencies'), - '#description' => $this->t('Check this box to ignore dependencies when running imports - - all tasks will run whether or not their dependent tasks have - completed.'), - ]; - $form['options']['limit'] = [ - '#type' => 'textfield', - '#title' => $this->t('Limit to:'), - '#size' => 10, - '#description' => $this->t('Set a limit of how many items to process for each migration task.'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - if (empty($form_state->getValue('operation'))) { - $form_state->setErrorByName('operation', $this->t('Please select an operation.')); - return; - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - $operation = $form_state->getValue('operation'); - - if ($form_state->getValue('limit')) { - $limit = $form_state->getValue('limit'); - } - else { - $limit = 0; - } - - if ($form_state->getValue('update')) { - $update = $form_state->getValue('update'); - } - else { - $update = 0; - } - if ($form_state->getValue('force')) { - $force = $form_state->getValue('force'); - } - else { - $force = 0; - } - - $migration = \Drupal::routeMatch()->getParameter('migration'); - if ($migration) { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration_plugin */ - $migration_plugin = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - $migrateMessage = new MigrateMessage(); - - switch ($operation) { - case 'import': - - $options = [ - 'limit' => $limit, - 'update' => $update, - 'force' => $force, - ]; - - $executable = new MigrateBatchExecutable($migration_plugin, $migrateMessage, $options); - $executable->batchImport(); - - break; - - case 'rollback': - - $options = [ - 'limit' => $limit, - 'update' => $update, - 'force' => $force, - ]; - - $executable = new MigrateBatchExecutable($migration_plugin, $migrateMessage, $options); - $executable->rollback(); - - break; - - case 'stop': - - $migration_plugin->interruptMigration(MigrationInterface::RESULT_STOPPED); - - break; - - case 'reset': - - $migration_plugin->setStatus(MigrationInterface::STATUS_IDLE); - - break; - - } - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationFormBase.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationFormBase.php deleted file mode 100644 index f568e7e0e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationFormBase.php +++ /dev/null @@ -1,184 +0,0 @@ -entityQueryFactory = $query_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('entity.query')); - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::form(). - * - * Builds the entity add/edit form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An associative array containing the migration add/edit form. - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get anything we need from the base class. - $form = parent::buildForm($form, $form_state); - - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->entity; - - $form['warning'] = [ - '#markup' => $this->t('Creating migrations is not yet supported. See :url', [ - ':url' => 'https://www.drupal.org/node/2573241', - ]), - ]; - - // Build the form. - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $migration->label(), - '#required' => TRUE, - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#title' => $this->t('Machine name'), - '#default_value' => $migration->id(), - '#machine_name' => [ - 'exists' => [$this, 'exists'], - 'replace_pattern' => '([^a-z0-9_]+)|(^custom$)', - 'error' => 'The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".', - ], - '#disabled' => !$migration->isNew(), - ]; - - $groups = MigrationGroup::loadMultiple(); - $group_options = []; - foreach ($groups as $group) { - $group_options[$group->id()] = $group->label(); - } - if (!$migration->migration_group && isset($group_options['default'])) { - $migration->set('migration_group', 'default'); - } - - $form['migration_group'] = [ - '#type' => 'select', - '#title' => $this->t('Migration Group'), - '#empty_value' => '', - '#default_value' => $migration->migration_group, - '#options' => $group_options, - '#description' => $this->t('Assign this migration to an existing group.'), - ]; - - return $form; - } - - /** - * Checks for an existing migration group. - * - * @param string|int $entity_id - * The entity ID. - * @param array $element - * The form element. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * - * @return bool - * TRUE if this format already exists, FALSE otherwise. - */ - public function exists($entity_id, array $element, FormStateInterface $form_state) { - // Use the query factory to build a new migration entity query. - $query = $this->entityQueryFactory->get('migration'); - - // Query the entity ID to see if its in use. - $result = $query->condition('id', $element['#field_prefix'] . $entity_id) - ->execute(); - - // We don't need to return the ID, only if it exists or not. - return (bool) $result; - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::actions(). - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An array of supported actions for the current entity form. - */ - protected function actions(array $form, FormStateInterface $form_state) { - // Get the basic actions from the base class. - $actions = parent::actions($form, $form_state); - - // Change the submit button text. - $actions['submit']['#value'] = $this->t('Save'); - - // Return the result. - return $actions; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $migration = $this->getEntity(); - $status = $migration->save(); - - if ($status == SAVED_UPDATED) { - // If we edited an existing entity... - $this->messenger()->addStatus($this->t('Migration %label has been updated.', ['%label' => $migration->label()])); - } - else { - // If we created a new entity... - $this->messenger()->addStatus($this->t('Migration %label has been added.', ['%label' => $migration->label()])); - } - - // Redirect the user back to the listing route after the save operation. - $form_state->setRedirect('entity.migration.list', - ['migration_group' => $migration->get('migration_group')]); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupAddForm.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupAddForm.php deleted file mode 100644 index 3efbf8c88..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupAddForm.php +++ /dev/null @@ -1,37 +0,0 @@ -t('Create Migration Group'); - return $actions; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupDeleteForm.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupDeleteForm.php deleted file mode 100644 index 52f1c1214..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupDeleteForm.php +++ /dev/null @@ -1,71 +0,0 @@ -t('Are you sure you want to delete migration group %label?', [ - '%label' => $this->entity->label(), - ]); - } - - /** - * Gather the confirmation text. - * - * @return string - * Translated string. - */ - public function getConfirmText() { - return $this->t('Delete Migration Group'); - } - - /** - * Gets the cancel URL. - * - * @return \Drupal\Core\Url - * The URL to go to if the user cancels the deletion. - */ - public function getCancelUrl() { - return new Url('entity.migration_group.list'); - } - - /** - * The submit handler for the confirm form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Delete the entity. - $this->entity->delete(); - - // Set a message that the entity was deleted. - $this->messenger()->addStatus($this->t('Migration group %label was deleted.', [ - '%label' => $this->entity->label(), - ])); - - // Redirect the user to the list controller when complete. - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupEditForm.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupEditForm.php deleted file mode 100644 index 551950a01..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupEditForm.php +++ /dev/null @@ -1,35 +0,0 @@ -t('Update Migration Group'); - return $actions; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupFormBase.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupFormBase.php deleted file mode 100644 index 5fc8b289b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/MigrationGroupFormBase.php +++ /dev/null @@ -1,172 +0,0 @@ -entityQueryFactory = $query_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static($container->get('entity.query')); - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::form(). - * - * Builds the entity add/edit form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An associative array containing the migration group add/edit form. - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Get anything we need from the base class. - $form = parent::buildForm($form, $form_state); - - /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group */ - $migration_group = $this->entity; - - // Build the form. - $form['label'] = [ - '#type' => 'textfield', - '#title' => $this->t('Label'), - '#maxlength' => 255, - '#default_value' => $migration_group->label(), - '#required' => TRUE, - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#title' => $this->t('Machine name'), - '#default_value' => $migration_group->id(), - '#machine_name' => [ - 'exists' => [$this, 'exists'], - 'replace_pattern' => '([^a-z0-9_]+)|(^custom$)', - 'error' => 'The machine-readable name must be unique, and can only contain lowercase letters, numbers, and underscores. Additionally, it can not be the reserved word "custom".', - ], - '#disabled' => !$migration_group->isNew(), - ]; - $form['description'] = [ - '#type' => 'textfield', - '#title' => $this->t('Description'), - '#maxlength' => 255, - '#default_value' => $migration_group->get('description'), - ]; - $form['source_type'] = [ - '#type' => 'textfield', - '#title' => $this->t('Source type'), - '#description' => $this->t('Type of source system the group is migrating from, for example "Drupal 6" or "WordPress 4".'), - '#maxlength' => 255, - '#default_value' => $migration_group->get('source_type'), - ]; - - // Return the form. - return $form; - } - - /** - * Checks for an existing migration group. - * - * @param string|int $entity_id - * The entity ID. - * @param array $element - * The form element. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * - * @return bool - * TRUE if this format already exists, FALSE otherwise. - */ - public function exists($entity_id, array $element, FormStateInterface $form_state) { - // Use the query factory to build a new migration group entity query. - $query = $this->entityQueryFactory->get('migration_group'); - - // Query the entity ID to see if its in use. - $result = $query->condition('id', $element['#field_prefix'] . $entity_id) - ->execute(); - - // We don't need to return the ID, only if it exists or not. - return (bool) $result; - } - - /** - * Overrides Drupal\Core\Entity\EntityFormController::actions(). - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * An associative array containing the current state of the form. - * - * @return array - * An array of supported actions for the current entity form. - */ - protected function actions(array $form, FormStateInterface $form_state) { - // Get the basic actins from the base class. - $actions = parent::actions($form, $form_state); - - // Change the submit button text. - $actions['submit']['#value'] = $this->t('Save'); - - // Return the result. - return $actions; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $migration_group = $this->getEntity(); - $status = $migration_group->save(); - - if ($status == SAVED_UPDATED) { - // If we edited an existing entity... - $this->messenger()->addStatus($this->t('Migration group %label has been updated.', ['%label' => $migration_group->label()])); - } - else { - // If we created a new entity... - $this->messenger()->addStatus($this->t('Migration group %label has been added.', ['%label' => $migration_group->label()])); - } - - // Redirect the user back to the listing route after the save operation. - $form_state->setRedirect('entity.migration_group.list'); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/SourceCsvForm.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Form/SourceCsvForm.php deleted file mode 100644 index bbf2a583f..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Form/SourceCsvForm.php +++ /dev/null @@ -1,449 +0,0 @@ - label 1 - * column_index2 - * property 2 => label 2 - * updated - * column_index1 - * property 2 => label 2 - * column_index2 - * property 1 => label 1 - * - * Example source configuration: - * custom_migration - * original - * 2 - * title => title - * 3 - * body => foo - * updated - * 8 - * title => new_title - * 9 - * body => new_body - */ -class SourceCsvForm extends FormBase { - - /** - * The database connection. - * - * @var \Drupal\Core\Database\Connection - */ - protected $connection; - - /** - * Plugin manager for migration plugins. - * - * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface - */ - protected $migrationPluginManager; - - /** - * The messenger service. - * - * @var \Drupal\Core\Messenger\MessengerInterface - */ - protected $messenger; - - /** - * Temporary store for column assignment changes. - * - * @var \Drupal\Core\TempStore\PrivateTempStoreFactory - */ - protected $store; - - /** - * The file object that reads the CSV file. - * - * @var \SplFileObject - */ - protected $file = NULL; - - /** - * The migration being examined. - * - * @var \Drupal\migrate\Plugin\MigrationInterface - */ - protected $migration; - - /** - * The migration plugin id. - * - * @var string - */ - protected $id; - - /** - * The array of columns names from the CSV source plugin. - * - * @var array - */ - protected $columnNames; - - /** - * An array of options for the column select form field.. - * - * @var array - */ - protected $options; - - /** - * An array of modified and original column_name source plugin configuration. - * - * @var array - */ - protected $sourceConfiguration; - - /** - * Constructs new SourceCsvForm object. - * - * @param \Drupal\Core\Database\Connection $connection - * The database connection. - * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager - * The plugin manager for config entity-based migrations. - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The messenger service. - * @param \Drupal\Core\TempStore\PrivateTempStoreFactory $private_store - * The private store. - */ - public function __construct(Connection $connection, MigrationPluginManagerInterface $migration_plugin_manager, MessengerInterface $messenger, PrivateTempStoreFactory $private_store) { - $this->connection = $connection; - $this->migrationPluginManager = $migration_plugin_manager; - $this->messenger = $messenger; - $this->store = $private_store->get('migrate_tools'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('database'), - $container->get('plugin.manager.migration'), - $container->get('messenger'), - $container->get('tempstore.private') - ); - } - - /** - * A custom access check. - * - * @param \Drupal\Core\Session\AccountInterface $account - * Run access checks for this account. - * @param \Drupal\migrate_plus\Entity\MigrationInterface $migration - * The $migration. - * - * @return \Drupal\Core\Access\AccessResult - * Allowed or forbidden, neutral if tempstore is empty. - */ - public function access(AccountInterface $account, MigrationInterface $migration) { - try { - $this->migration = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - } - catch (PluginException $e) { - return AccessResult::forbidden(); - } - - if ($this->migration) { - if ($source = $this->migration->getSourcePlugin()) { - if (is_a($source, CSV::class)) { - return AccessResult::allowed(); - } - } - } - return AccessResult::forbidden(); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, MigrationInterface $migration = NULL) { - try { - // @TODO: remove this horrible config work around after - // https://www.drupal.org/project/drupal/issues/2986665 is fixed. - $this->migration = $this->migrationPluginManager->createInstance($migration->id(), $migration->toArray()); - /** @var \Drupal\migrate_source_csv\Plugin\migrate\source\CSV $source */ - $source = $this->migration->getSourcePlugin(); - $source->setConfiguration($migration->toArray()['source']); - } - catch (PluginException $e) { - return AccessResult::forbidden(); - } - - // Get the source file after the properties are initialized. - $source->initializeIterator(); - $this->file = $source->getFile(); - - // Set the input field options to the header row values or, if there are - // no such values, use an indexed array. - if ($this->file->getHeaderRowCount() > 0) { - $this->options = $this->getHeaderColumnNames(); - } - else { - for ($i = 0; $i < $this->getFileColumnCount(); $i++) { - $this->options[$i] = $i; - } - } - - // Set the store key to the migration id. - $this->id = $this->migration->getPluginId(); - - // Get the column names from the file or from the store, if updated - // values are in the store. - $this->sourceConfiguration = $this->store->get($this->id); - if (isset($this->sourceConfiguration['changed'])) { - if ($config = $this->sourceConfiguration['changed']) { - $this->columnNames = $config; - } - } - else { - // Get the calculated column names. This is either the header rows or - // the configuration column_name value. - $this->columnNames = $this->file->getColumnNames(); - if (!isset($this->sourceConfiguration['original'])) { - // Save as the original values. - $this->sourceConfiguration['original'] = $this->columnNames; - $this->store->set($this->id, $this->sourceConfiguration); - } - } - $form['#title'] = $this->t('Column Aliases'); - - $form['heading'] = [ - '#type' => 'item', - '#title' => $this->t(':label', [':label' => $this->migration->label()]), - '#description' => '

        ' . $this->t('You can change the columns to be used by this migration for each source property.') . '

        ', - ]; - // Create a form field for each column in this migration. - foreach ($this->columnNames as $index => $data) { - $property_name = key($data); - $default_value = $index; - $label = $this->getLabel($this->sourceConfiguration['original'], $property_name); - - $description = $this->t('Select the column where the data for :label, property :property, will be found.', [ - ':label' => $label, - ':property' => $property_name, - ]); - $form['aliases'][$property_name] = [ - '#type' => 'select', - '#title' => $label, - '#description' => $description, - '#options' => $this->options, - '#default_value' => $default_value, - ]; - } - $form['actions'] = ['#type' => 'actions']; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#button_type' => 'primary', - '#value' => $this->t('Submit'), - ]; - $form['actions']['cancel'] = [ - '#type' => 'submit', - '#value' => $this->t('Cancel'), - '#submit' => ['::cancel'], - '#limit_validation_errors' => [], - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // Display an error message if two properties have the same source column. - $values = []; - foreach ($this->columnNames as $index => $data) { - $property_name = key($data); - $value = $form_state->getValue($property_name); - if (in_array($value, $values)) { - $form_state->setErrorByName($property_name, $this->t('Source properties can not share the same source column.')); - } - $values[] = $value; - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Create a new column_names configuration. - $new_column_names = []; - foreach ($this->columnNames as $index => $data) { - // Keep the property name as it is used in the process pipeline. - $property_name = key($data); - // Get the new column number from the form alias field for this property. - $new_index = $form_state->getValue($property_name); - // Get the new label from the options array. - $new_label = $this->options[$new_index]; - // Save using the new column number and new label. - $new_column_names[$new_index] = [$property_name => $new_label]; - } - // Update the file columns. - $this->file->setColumnNames($new_column_names); - // Save as updated in the store. - $this->sourceConfiguration['changed'] = $new_column_names; - $this->store->set($this->id, $this->sourceConfiguration); - - $changed = ($this->store->get('migrations_changed')) ? $this->store->get('migrations_changed') : []; - if (!in_array($this->id, $changed)) { - $changed[] = $this->id; - $this->store->set('migrations_changed', $changed); - } - } - - /** - * Form submission handler for the 'cancel' action. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function cancel(array $form, FormStateInterface $form_state) { - // Restore the file columns to the original settings. - $this->file->setColumnNames($this->sourceConfiguration['original']); - // Remove this migration from the store. - try { - $this->store->delete($this->id); - } - catch (TempStoreException $e) { - $this->messenger->addError($e->getMessage()); - } - - $migrationsChanged = $this->store->get('migrations_changed'); - unset($migrationsChanged[$this->id]); - try { - $this->store->set('migrations_changed', $migrationsChanged); - } - catch (TempStoreException $e) { - $this->messenger->addError($e->getMessage()); - } - $form_state->setRedirect('entity.migration_group.list'); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'migrate_tools_source_csv'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() {} - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.migration_group.list'); - } - - /** - * Returns the header row. - * - * Use a new file handle so that CSVFileObject::current() is not executed. - * - * @return array - * The header row. - */ - public function getHeaderColumnNames() { - $row = []; - $fname = $this->file->getPathname(); - $handle = fopen($fname, 'r'); - if ($handle) { - fseek($handle, $this->file->getHeaderRowCount() - 1); - $row = fgetcsv($handle); - fclose($handle); - } - return $row; - } - - /** - * Returns the count of fields in the header row. - * - * Use a new file handle so that CSVFileObject::current() is not executed. - * - * @return int - * The number of fields in the header row. - */ - public function getFileColumnCount() { - $count = 0; - $fname = $this->file->getPathname(); - $handle = fopen($fname, 'r'); - if ($handle) { - $row = fgetcsv($handle); - $count = count($row); - fclose($handle); - } - return $count; - } - - /** - * Gets the label for a given property from a column_names array. - * - * @param array $column_names - * An array of column_names. - * @param string $property_name - * The property name to find a label for. - * - * @return string - * The label for this property. - */ - protected function getLabel(array $column_names, $property_name) { - $label = ''; - foreach ($column_names as $column) { - foreach ($column as $key => $value) { - if ($key === $property_name) { - $label = $value; - break; - } - } - } - return $label; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/IdMapFilter.php b/sites/all/modules/contrib/migrate/migrate_tools/src/IdMapFilter.php deleted file mode 100644 index 46518d206..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/IdMapFilter.php +++ /dev/null @@ -1,42 +0,0 @@ -idList = $id_list; - } - - /** - * {@inheritdoc} - */ - public function accept() { - // Row is included. - if (empty($this->idList) || in_array(array_values($this->getInnerIterator()->currentSource()), $this->idList)) { - return TRUE; - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateBatchExecutable.php b/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateBatchExecutable.php deleted file mode 100644 index 9d031c5ff..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateBatchExecutable.php +++ /dev/null @@ -1,302 +0,0 @@ -updateExistingRows = $options['update']; - } - - if (isset($options['force'])) { - $this->checkDependencies = $options['force']; - } - - parent::__construct($migration, $message, $options); - $this->migrationPluginManager = \Drupal::getContainer()->get('plugin.manager.migration'); - } - - /** - * Sets the current batch content so listeners can update the messages. - * - * @param array $context - * The batch context. - */ - public function setBatchContext(array &$context) { - $this->batchContext = &$context; - } - - /** - * Gets a reference to the current batch context. - * - * @return array - * The batch context. - */ - public function &getBatchContext() { - return $this->batchContext; - } - - /** - * Setup batch operations for running the migration. - */ - public function batchImport() { - // Create the batch operations for each migration that needs to be executed. - // This includes the migration for this executable, but also the dependent - // migrations. - $operations = $this->batchOperations([$this->migration], 'import', [ - 'limit' => $this->itemLimit, - 'update' => $this->updateExistingRows, - 'force' => $this->checkDependencies, - ]); - - if (count($operations) > 0) { - $batch = [ - 'operations' => $operations, - 'title' => $this->t('Migrating %migrate', ['%migrate' => $this->migration->label()]), - 'init_message' => $this->t('Start migrating %migrate', ['%migrate' => $this->migration->label()]), - 'progress_message' => $this->t('Migrating %migrate', ['%migrate' => $this->migration->label()]), - 'error_message' => $this->t('An error occurred while migrating %migrate.', ['%migrate' => $this->migration->label()]), - 'finished' => '\Drupal\migrate_tools\MigrateBatchExecutable::batchFinishedImport', - ]; - - batch_set($batch); - } - } - - /** - * Helper to generate the batch operations for importing migrations. - * - * @param \Drupal\migrate\Plugin\MigrationInterface[] $migrations - * The migrations. - * @param string $operation - * The batch operation to perform. - * @param array $options - * The migration options. - * - * @return array - * The batch operations to perform. - */ - protected function batchOperations(array $migrations, $operation, array $options = []) { - $operations = []; - foreach ($migrations as $id => $migration) { - - if (!empty($options['update'])) { - $migration->getIdMap()->prepareUpdate(); - } - - if (!empty($options['force'])) { - $migration->set('requirements', []); - } - else { - $dependencies = $migration->getMigrationDependencies(); - if (!empty($dependencies['required'])) { - $required_migrations = $this->migrationPluginManager->createInstances($dependencies['required']); - // For dependent migrations will need to be migrate all items. - $dependent_options = $options; - $dependent_options['limit'] = 0; - $operations += $this->batchOperations($required_migrations, $operation, [ - 'limit' => 0, - 'update' => $options['update'], - 'force' => $options['force'], - ]); - } - } - - $operations[] = [ - '\Drupal\migrate_tools\MigrateBatchExecutable::batchProcessImport', - [$migration->id(), $options], - ]; - } - - return $operations; - } - - /** - * Batch 'operation' callback. - * - * @param string $migration_id - * The migration id. - * @param array $options - * The batch executable options. - * @param array $context - * The sandbox context. - */ - public static function batchProcessImport($migration_id, array $options, array &$context) { - if (empty($context['sandbox'])) { - $context['finished'] = 0; - $context['sandbox'] = []; - $context['sandbox']['total'] = 0; - $context['sandbox']['counter'] = 0; - $context['sandbox']['batch_limit'] = 0; - $context['sandbox']['operation'] = MigrateBatchExecutable::BATCH_IMPORT; - } - - // Prepare the migration executable. - $message = new MigrateMessage(); - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = \Drupal::getContainer()->get('plugin.manager.migration')->createInstance($migration_id); - - // Each batch run we need to reinitialize the counter for the migration. - if (!empty($options['limit']) && isset($context['results'][$migration->id()]['@numitems'])) { - $options['limit'] = $options['limit'] - $context['results'][$migration->id()]['@numitems']; - } - - $executable = new MigrateBatchExecutable($migration, $message, $options); - - if (empty($context['sandbox']['total'])) { - $context['sandbox']['total'] = $executable->getSource()->count(); - $context['sandbox']['batch_limit'] = $executable->calculateBatchLimit($context); - $context['results'][$migration->id()] = [ - '@numitems' => 0, - '@created' => 0, - '@updated' => 0, - '@failures' => 0, - '@ignored' => 0, - '@name' => $migration->id(), - ]; - } - - // Every iteration, we reset out batch counter. - $context['sandbox']['batch_counter'] = 0; - - // Make sure we know our batch context. - $executable->setBatchContext($context); - - // Do the import. - $result = $executable->import(); - - // Store the result; will need to combine the results of all our iterations. - $context['results'][$migration->id()] = [ - '@numitems' => $context['results'][$migration->id()]['@numitems'] + $executable->getProcessedCount(), - '@created' => $context['results'][$migration->id()]['@created'] + $executable->getCreatedCount(), - '@updated' => $context['results'][$migration->id()]['@updated'] + $executable->getUpdatedCount(), - '@failures' => $context['results'][$migration->id()]['@failures'] + $executable->getFailedCount(), - '@ignored' => $context['results'][$migration->id()]['@ignored'] + $executable->getIgnoredCount(), - '@name' => $migration->id(), - ]; - - // Do some housekeeping. - if ( - $result != MigrationInterface::RESULT_INCOMPLETE - ) { - $context['finished'] = 1; - } - else { - $context['sandbox']['counter'] = $context['results'][$migration->id()]['@numitems']; - if ($context['sandbox']['counter'] <= $context['sandbox']['total']) { - $context['finished'] = ((float) $context['sandbox']['counter'] / (float) $context['sandbox']['total']); - $context['message'] = t('Importing %migration (@percent%).', [ - '%migration' => $migration->label(), - '@percent' => (int) ($context['finished'] * 100), - ]); - } - } - - } - - /** - * Finished callback for import batches. - * - * @param bool $success - * A boolean indicating whether the batch has completed successfully. - * @param array $results - * The value set in $context['results'] by callback_batch_operation(). - * @param array $operations - * If $success is FALSE, contains the operations that remained unprocessed. - */ - public static function batchFinishedImport($success, array $results, array $operations) { - if ($success) { - foreach ($results as $migration_id => $result) { - $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'"; - $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'"; - \Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural($result['@numitems'], - $singular_message, - $plural_message, - $result)); - } - } - } - - /** - * {@inheritdoc} - */ - public function checkStatus() { - $status = parent::checkStatus(); - - if ($status == MigrationInterface::RESULT_COMPLETED) { - // Do some batch housekeeping. - $context = $this->getBatchContext(); - - if (!empty($context['sandbox']) && $context['sandbox']['operation'] == MigrateBatchExecutable::BATCH_IMPORT) { - $context['sandbox']['batch_counter']++; - if ($context['sandbox']['batch_counter'] >= $context['sandbox']['batch_limit']) { - $status = MigrationInterface::RESULT_INCOMPLETE; - } - } - } - - return $status; - } - - /** - * Calculates how much a single batch iteration will handle. - * - * @param array $context - * The sandbox context. - * - * @return float - * The batch limit. - */ - public function calculateBatchLimit(array $context) { - // TODO Maybe we need some other more sophisticated logic here? - return ceil($context['sandbox']['total'] / 100); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateExecutable.php b/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateExecutable.php deleted file mode 100644 index 2930e422c..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateExecutable.php +++ /dev/null @@ -1,405 +0,0 @@ - 0, - MigrateIdMapInterface::STATUS_IGNORED => 0, - MigrateIdMapInterface::STATUS_IMPORTED => 0, - MigrateIdMapInterface::STATUS_NEEDS_UPDATE => 0, - ]; - - /** - * Counter of map saves, used to detect the item limit threshold. - * - * @var int - */ - protected $itemLimitCounter = 0; - - /** - * Counter of map deletions. - * - * @var int - */ - protected $deleteCounter = 0; - - /** - * Maximum number of items to process in this migration. - * - * 0 indicates no limit is to be applied. - * - * @var int - */ - protected $itemLimit = 0; - - /** - * Frequency (in items) at which progress messages should be emitted. - * - * @var int - */ - protected $feedback = 0; - - /** - * List of specific source IDs to import. - * - * @var array - */ - protected $idlist = []; - - /** - * Count of number of items processed so far in this migration. - * - * @var int - */ - protected $counter = 0; - - /** - * Whether the destination item exists before saving. - * - * @var bool - */ - protected $preExistingItem = FALSE; - - /** - * List of event listeners we have registered. - * - * @var array - */ - protected $listeners = []; - - /** - * {@inheritdoc} - */ - public function __construct(MigrationInterface $migration, MigrateMessageInterface $message, array $options = []) { - parent::__construct($migration, $message); - if (isset($options['limit'])) { - $this->itemLimit = $options['limit']; - } - if (isset($options['feedback'])) { - $this->feedback = $options['feedback']; - } - $this->idlist = MigrateTools::buildIdList($options); - - $this->listeners[MigrateEvents::MAP_SAVE] = [$this, 'onMapSave']; - $this->listeners[MigrateEvents::MAP_DELETE] = [$this, 'onMapDelete']; - $this->listeners[MigrateEvents::POST_IMPORT] = [$this, 'onPostImport']; - $this->listeners[MigrateEvents::POST_ROLLBACK] = [$this, 'onPostRollback']; - $this->listeners[MigrateEvents::PRE_ROW_SAVE] = [$this, 'onPreRowSave']; - $this->listeners[MigrateEvents::POST_ROW_DELETE] = [$this, 'onPostRowDelete']; - $this->listeners[MigratePlusEvents::PREPARE_ROW] = [$this, 'onPrepareRow']; - foreach ($this->listeners as $event => $listener) { - \Drupal::service('event_dispatcher')->addListener($event, $listener); - } - } - - /** - * Count up any map save events. - * - * @param \Drupal\migrate\Event\MigrateMapSaveEvent $event - * The map event. - */ - public function onMapSave(MigrateMapSaveEvent $event) { - // Only count saves for this migration. - if ($event->getMap()->getQualifiedMapTableName() == $this->migration->getIdMap()->getQualifiedMapTableName()) { - $fields = $event->getFields(); - $this->itemLimitCounter++; - // Distinguish between creation and update. - if ($fields['source_row_status'] == MigrateIdMapInterface::STATUS_IMPORTED && - $this->preExistingItem - ) { - $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE]++; - } - else { - $this->saveCounters[$fields['source_row_status']]++; - } - } - } - - /** - * Count up any rollback events. - * - * @param \Drupal\migrate\Event\MigrateMapDeleteEvent $event - * The map event. - */ - public function onMapDelete(MigrateMapDeleteEvent $event) { - $this->deleteCounter++; - } - - /** - * Return the number of items created. - * - * @return int - * The number of items created. - */ - public function getCreatedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_IMPORTED]; - } - - /** - * Return the number of items updated. - * - * @return int - * The updated count. - */ - public function getUpdatedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE]; - } - - /** - * Return the number of items ignored. - * - * @return int - * The ignored count. - */ - public function getIgnoredCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_IGNORED]; - } - - /** - * Return the number of items that failed. - * - * @return int - * The failed count. - */ - public function getFailedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_FAILED]; - } - - /** - * Return the total number of items processed. - * - * Note that STATUS_NEEDS_UPDATE is not counted, since this is typically set - * on stubs created as side effects, not on the primary item being imported. - * - * @return int - * The processed count. - */ - public function getProcessedCount() { - return $this->saveCounters[MigrateIdMapInterface::STATUS_IMPORTED] + - $this->saveCounters[MigrateIdMapInterface::STATUS_NEEDS_UPDATE] + - $this->saveCounters[MigrateIdMapInterface::STATUS_IGNORED] + - $this->saveCounters[MigrateIdMapInterface::STATUS_FAILED]; - } - - /** - * Return the number of items rolled back. - * - * @return int - * The rollback count. - */ - public function getRollbackCount() { - return $this->deleteCounter; - } - - /** - * Reset all the per-status counters to 0. - */ - protected function resetCounters() { - foreach ($this->saveCounters as $status => $count) { - $this->saveCounters[$status] = 0; - } - $this->deleteCounter = 0; - } - - /** - * React to migration completion. - * - * @param \Drupal\migrate\Event\MigrateImportEvent $event - * The map event. - */ - public function onPostImport(MigrateImportEvent $event) { - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $migrate_last_imported_store->set($event->getMigration()->id(), round(microtime(TRUE) * 1000)); - $this->progressMessage(); - $this->removeListeners(); - } - - /** - * Clean up all our event listeners. - */ - protected function removeListeners() { - foreach ($this->listeners as $event => $listener) { - \Drupal::service('event_dispatcher')->removeListener($event, $listener); - } - } - - /** - * Emit information on what we've done. - * - * Either since the last feedback or the beginning of this migration. - * - * @param bool $done - * TRUE if this is the last items to process. Otherwise FALSE. - */ - protected function progressMessage($done = TRUE) { - $processed = $this->getProcessedCount(); - if ($done) { - $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'"; - $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'"; - } - else { - $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'"; - $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'"; - } - $this->message->display(\Drupal::translation()->formatPlural($processed, - $singular_message, $plural_message, - [ - '@numitems' => $processed, - '@created' => $this->getCreatedCount(), - '@updated' => $this->getUpdatedCount(), - '@failures' => $this->getFailedCount(), - '@ignored' => $this->getIgnoredCount(), - '@name' => $this->migration->id(), - ] - )); - } - - /** - * React to rollback completion. - * - * @param \Drupal\migrate\Event\MigrateRollbackEvent $event - * The map event. - */ - public function onPostRollback(MigrateRollbackEvent $event) { - $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported'); - $migrate_last_imported_store->set($event->getMigration()->id(), FALSE); - $this->rollbackMessage(); - $this->removeListeners(); - } - - /** - * Emit information on what we've done. - * - * Either since the last feedback or the beginning of this migration. - * - * @param bool $done - * TRUE if this is the last items to rollback. Otherwise FALSE. - */ - protected function rollbackMessage($done = TRUE) { - $rolled_back = $this->getRollbackCount(); - if ($done) { - $singular_message = "Rolled back 1 item - done with '@name'"; - $plural_message = "Rolled back @numitems items - done with '@name'"; - } - else { - $singular_message = "Rolled back 1 item - continuing with '@name'"; - $plural_message = "Rolled back @numitems items - continuing with '@name'"; - } - $this->message->display(\Drupal::translation()->formatPlural($rolled_back, - $singular_message, $plural_message, - [ - '@numitems' => $rolled_back, - '@name' => $this->migration->id(), - ] - )); - } - - /** - * React to an item about to be imported. - * - * @param \Drupal\migrate\Event\MigratePreRowSaveEvent $event - * The pre-save event. - */ - public function onPreRowSave(MigratePreRowSaveEvent $event) { - $id_map = $event->getRow()->getIdMap(); - if (!empty($id_map['destid1'])) { - $this->preExistingItem = TRUE; - } - else { - $this->preExistingItem = FALSE; - } - } - - /** - * React to item rollback. - * - * @param \Drupal\migrate\Event\MigrateRowDeleteEvent $event - * The post-save event. - */ - public function onPostRowDelete(MigrateRowDeleteEvent $event) { - if ($this->feedback && ($this->deleteCounter) && $this->deleteCounter % $this->feedback == 0) { - $this->rollbackMessage(FALSE); - $this->resetCounters(); - } - } - - /** - * React to a new row. - * - * @param \Drupal\migrate_plus\Event\MigratePrepareRowEvent $event - * The prepare-row event. - * - * @throws \Drupal\migrate\MigrateSkipRowException - */ - public function onPrepareRow(MigratePrepareRowEvent $event) { - // TODO: remove after 8.6 suppor is sunset. - // @see https://www.drupal.org/project/migrate_tools/issues/3008316 - if (!empty($this->idlist)) { - $row = $event->getRow(); - // TODO: replace for $source_id = $row->getSourceIdValues(); - // when https://www.drupal.org/node/2698023 is fixed. - $migration = $event->getMigration(); - $source_id = array_merge(array_flip(array_keys($migration->getSourcePlugin() - ->getIds())), $row->getSourceIdValues()); - $skip = TRUE; - foreach ($this->idlist as $item) { - if (array_values($source_id) == $item) { - $skip = FALSE; - break; - } - } - if ($skip) { - throw new MigrateSkipRowException('Skipped due to idlist.', FALSE); - } - } - if ($this->feedback && ($this->counter) && $this->counter % $this->feedback == 0) { - $this->progressMessage(FALSE); - $this->resetCounters(); - } - $this->counter++; - if ($this->itemLimit && ($this->itemLimitCounter + 1) >= $this->itemLimit) { - $event->getMigration()->interruptMigration(MigrationInterface::RESULT_COMPLETED); - } - } - - /** - * {@inheritdoc} - */ - protected function getSource() { - return new SourceFilter(parent::getSource(), $this->idlist); - } - - /** - * {@inheritdoc} - */ - protected function getIdMap() { - return new IdMapFilter(parent::getIdMap(), $this->idlist); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateTools.php b/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateTools.php deleted file mode 100644 index 5a7ce4c90..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/MigrateTools.php +++ /dev/null @@ -1,34 +0,0 @@ - NULL, - 'idlist-delimiter' => ':', - ]; - $id_list = []; - if ($options['idlist']) { - $id_list = explode(',', $options['idlist']); - array_walk($id_list, function (&$value) use ($options) { - $value = str_getcsv($value, $options['idlist-delimiter']); - }); - } - return $id_list; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/Routing/RouteProcessor.php b/sites/all/modules/contrib/migrate/migrate_tools/src/Routing/RouteProcessor.php deleted file mode 100644 index fe0c5e623..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/Routing/RouteProcessor.php +++ /dev/null @@ -1,27 +0,0 @@ -hasDefault('_migrate_group')) { - if ($migration = \Drupal::entityTypeManager()->getStorage('migration')->load($parameters['migration'])) { - if ($group = $migration->get('migration_group')) { - $parameters['migration_group'] = $group; - } - } - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/src/SourceFilter.php b/sites/all/modules/contrib/migrate/migrate_tools/src/SourceFilter.php deleted file mode 100644 index 28a6f9d9e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/src/SourceFilter.php +++ /dev/null @@ -1,53 +0,0 @@ -idList = $id_list; - } - - /** - * {@inheritdoc} - */ - public function accept() { - // No idlist filtering, don't filter. - if (empty($this->idList)) { - return TRUE; - } - // Some source plugins do not extend SourcePluginBase. These cannot be - // filtered so warn and return all values. - if (!$this->getInnerIterator() instanceof SourcePluginBase) { - trigger_error(sprintf('The source plugin %s is not an instance of %s. Extend from %s to support idlist filtering.', $this->getInnerIterator()->getPluginId(), SourcePluginBase::class, SourcePluginBase::class)); - return TRUE; - } - // Row is included. - if (in_array(array_values($this->getInnerIterator()->getCurrentIds()), $this->idList)) { - return TRUE; - } - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration.csv_source_test.yml b/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration.csv_source_test.yml deleted file mode 100644 index 0d600a9ff..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration.csv_source_test.yml +++ /dev/null @@ -1,33 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: csv_source_test -label: Test edit of column aliases for CSV source plugin -class: null -field_plugin_method: null -cck_plugin_method: null -migration_tags: { } -migration_group: csv_test -source: - plugin: csv - path: 'public://test.csv' - header_row_count: 1 - enclosure: '"' - keys: - - vid - column_names: - 0: - vid: 'Vocabulary Id' - 1: - name: 'Name' - 2: - description: 'Description' -process: - vid: vid - name: name - description: description -destination: - plugin: entity:taxonomy_vocabulary -migration_dependencies: - required: { } - optional: { } diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration_group.csv_test.yml b/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration_group.csv_test.yml deleted file mode 100644 index 1c2b05931..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/config/install/migrate_plus.migration_group.csv_test.yml +++ /dev/null @@ -1,4 +0,0 @@ -id: csv_test -label: CSV source plugin edit test -description: Test editting of source plugin via the UI -source_type: CSV diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/csv_source_test.info.yml b/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/csv_source_test.info.yml deleted file mode 100644 index 989af7898..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/csv_source_test/csv_source_test.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -type: module -name: CSV Source edit test -description: 'Test editing of source plugin via the UI.' -package: Testing -# core: 8.x -dependencies: - - drupal:migrate (>=8.3) - - migrate_plus:migrate_plus - - migrate_plus:migrate_source_csv - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_tools' -datestamp: 1546879109 diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration.fruit_terms.yml b/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration.fruit_terms.yml deleted file mode 100644 index 7f606d127..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration.fruit_terms.yml +++ /dev/null @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: fruit_terms -label: Fruit Terms -class: null -field_plugin_method: null -cck_plugin_method: null -migration_tags: { } -migration_group: default -source: - plugin: embedded_data - data_rows: - - - name: Apple - - - name: Banana - - - name: Orange - ids: - name: - type: string - constants: - vocabulary: fruit -process: - name: name - vid: constants/vocabulary -destination: - plugin: entity:taxonomy_term -migration_dependencies: - required: { } - optional: { } diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration_group.default.yml b/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration_group.default.yml deleted file mode 100644 index 0f35a2189..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/config/install/migrate_plus.migration_group.default.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: default -label: Default -description: '' -source_type: '' -module: null -shared_configuration: null diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/migrate_tools_test.info.yml b/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/migrate_tools_test.info.yml deleted file mode 100644 index dd77f458e..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/modules/migrate_tools_test/migrate_tools_test.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -type: module -name: Migrate Tools Test -description: 'Test module to test Migrate Tools.' -package: Testing -# core: 8.x -dependencies: - - drupal:migrate (>=8.3) - - migrate_plus:migrate_plus - -# Information added by Drupal.org packaging script on 2019-01-07 -version: '8.x-4.1' -core: '8.x' -project: 'migrate_tools' -datestamp: 1546879109 diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/MigrateExecutionFormTest.php b/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/MigrateExecutionFormTest.php deleted file mode 100644 index 3bdabdc7a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/MigrateExecutionFormTest.php +++ /dev/null @@ -1,134 +0,0 @@ -vocabulary = $this->createVocabulary(['vid' => 'fruit', 'name' => 'Fruit']); - $this->vocabularyQuery = $this->container->get('entity_type.manager') - ->getStorage('taxonomy_term') - ->getQuery(); - // Log in as user 1. Migrations in the UI can only be performed as user 1. - $this->drupalLogin($this->rootUser); - } - - /** - * Tests execution of import and rollback of a migration. - * - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testExecution() { - $group = 'default'; - $migration = 'fruit_terms'; - $urlPath = "/admin/structure/migrate/manage/{$group}/migrations/{$migration}/execute"; - $real_count = $this->vocabularyQuery->count()->execute(); - $expected_count = 0; - $this->assertEquals($expected_count, $real_count); - $this->drupalGet($urlPath); - $this->assertSession()->responseContains('Choose an operation to run'); - $edit = [ - 'operation' => 'import', - ]; - $this->drupalPostForm($urlPath, $edit, $this->t('Execute')); - $real_count = $this->vocabularyQuery->count()->execute(); - $expected_count = 3; - $this->assertEquals($expected_count, $real_count); - $edit = [ - 'operation' => 'rollback', - ]; - $this->drupalPostForm($urlPath, $edit, $this->t('Execute')); - $real_count = $this->vocabularyQuery->count()->execute(); - $expected_count = 0; - $this->assertEquals($expected_count, $real_count); - $edit = [ - 'operation' => 'import', - ]; - $this->drupalPostForm($urlPath, $edit, $this->t('Execute')); - $real_count = $this->vocabularyQuery->count()->execute(); - $expected_count = 3; - $this->assertEquals($expected_count, $real_count); - } - - /** - * Creates a custom vocabulary based on default settings. - * - * @param array $values - * An array of settings to change from the defaults. - * Example: 'vid' => 'foo'. - * - * @return \Drupal\taxonomy\VocabularyInterface - * Created vocabulary. - */ - protected function createVocabulary(array $values = []) { - // Find a non-existent random vocabulary name. - if (!isset($values['vid'])) { - do { - $id = strtolower($this->randomMachineName(8)); - } while (Vocabulary::load($id)); - } - else { - $id = $values['vid']; - } - $values += [ - 'id' => $id, - 'name' => $id, - ]; - $vocabulary = Vocabulary::create($values); - $status = $vocabulary->save(); - - $this->assertSame($status, SAVED_NEW); - - return $vocabulary; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/SourceCsvFormTest.php b/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/SourceCsvFormTest.php deleted file mode 100644 index 6cbded03b..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Functional/SourceCsvFormTest.php +++ /dev/null @@ -1,243 +0,0 @@ -drupalLogin($this->rootUser); - - // Setup the file system so we create the source CSV. - $this->container->get('stream_wrapper_manager')->registerWrapper('public', PublicStream::class, StreamWrapperInterface::NORMAL); - $fs = \Drupal::service('file_system'); - $fs->mkdir('public://sites/default/files', NULL, TRUE); - - // The source data for this test. - $source_data = <<<'EOD' -vid,name,description,hierarchy,weight -tags,Tags,Use tags to group articles,0,0 -forums,Sujet de discussion,Forum navigation vocabulary,1,0 -test_vocabulary,Test Vocabulary,This is the vocabulary description,1,0 -genre,Genre,Genre description,1,0 -EOD; - - // Write the data to the filepath given in the test migration. - file_put_contents('public://test.csv', $source_data); - - // Get the store. - $tempStoreFactory = \Drupal::service('tempstore.private'); - $this->store = $tempStoreFactory->get('migrate_tools'); - - // Select the group and migration to test. - $this->group = 'csv_test'; - $this->migration = 'csv_source_test'; - } - - /** - * Tests the form to edit CSV column aliases. - * - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testSourceCsvForm() { - // Define the paths to be used. - $executeUrlPath = "/admin/structure/migrate/manage/{$this->group}/migrations/{$this->migration}/execute"; - $editUrlPath = "/admin/structure/migrate/manage/{$this->group}/migrations/{$this->migration}/source/edit"; - - // Assert the test migration is listed. - $this->drupalGet("/admin/structure/migrate/manage/{$this->group}/migrations"); - $session = $this->assertSession(); - $session->responseContains('Test edit of column aliases for CSV source plugin'); - - // Proceed to the edit page. - $this->drupalGet($editUrlPath); - $session->responseContains('You can change the columns to be used by this migration for each source property.'); - - // Test that there are 3 select fields available which match the number of - // properties in the process pipeline. - $this->assertTrue($session->optionExists('edit-vid', 'vid') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-name', 'name') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-description', 'description') - ->isSelected()); - $session->responseNotContains('edit-hierarchy'); - $session->responseNotContains('edit-weight'); - - // Test that all 5 columns in the CSV source are available as options on - // one of the select fields. - $this->assertTrue($session->optionExists('edit-description', 'vid')); - $this->assertTrue($session->optionExists('edit-description', 'name')); - $this->assertTrue($session->optionExists('edit-description', 'description')); - $this->assertTrue($session->optionExists('edit-description', 'hierarchy')); - $this->assertTrue($session->optionExists('edit-description', 'weight')); - - // Test that two aliases can not be the same. - $edit = [ - 'edit-vid' => 2, - 'edit-name' => 1, - 'edit-description' => 1, - ]; - $this->drupalPostForm($editUrlPath, $edit, $this->t('Submit')); - $session->responseContains('Source properties can not share the same source column.'); - $this->assertTrue($session->optionExists('edit-vid', 'description') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-name', 'name') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-description', 'name') - ->isSelected()); - - // Test that changes to all the column aliases are saved. - $edit = [ - 'edit-vid' => 4, - 'edit-name' => 0, - 'edit-description' => 1, - ]; - $this->drupalPostForm($editUrlPath, $edit, $this->t('Submit')); - $this->assertTrue($session->optionExists('edit-vid', 'weight') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-name', 'vid') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-description', 'name') - ->isSelected()); - - // Test that the changes are saved to store. - $columnConfiguration = $this->store->get('csv_source_test'); - $migrationsChanged = $this->store->get('migrations_changed'); - $this->assertSame(['csv_source_test'], $migrationsChanged); - $expected = - [ - 'original' => - [ - 0 => ['vid' => 'Vocabulary Id'], - 1 => ['name' => 'Name'], - 2 => ['description' => 'Description'], - ], - 'changed' => - [ - 4 => ['vid' => 'weight'], - 0 => ['name' => 'vid'], - 1 => ['description' => 'name'], - ], - ]; - $this->assertSame($expected, $columnConfiguration); - - // Test the migration with incorrect column aliases. Flush the cache to - // ensure the plugin alter is run. - drupal_flush_all_caches(); - $edit = [ - 'operation' => 'import', - ]; - $this->drupalPostForm($executeUrlPath, $edit, $this->t('Execute')); - $session->responseContains("Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'csv_source_test'"); - - // Rollback. - $edit = [ - 'operation' => 'rollback', - ]; - $this->drupalPostForm($executeUrlPath, $edit, $this->t('Execute')); - - // Restore to an order that will successfully migrate. - $edit = [ - 'edit-vid' => 0, - 'edit-name' => 1, - 'edit-description' => 2, - ]; - $this->drupalPostForm($editUrlPath, $edit, $this->t('Submit')); - $this->assertTrue($session->optionExists('edit-vid', 'vid') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-name', 'name') - ->isSelected()); - $this->assertTrue($session->optionExists('edit-description', 'description') - ->isSelected()); - - // Test the vocabulary migration. - $edit = [ - 'operation' => 'import', - ]; - drupal_flush_all_caches(); - $this->drupalPostForm($executeUrlPath, $edit, $this->t('Execute')); - $session->responseContains("Processed 4 items (4 created, 0 updated, 0 failed, 0 ignored) - done with 'csv_source_test'"); - $this->assertEntity('tags', 'Tags', 'Use tags to group articles'); - $this->assertEntity('forums', 'Sujet de discussion', 'Forum navigation vocabulary'); - $this->assertEntity('test_vocabulary', 'Test Vocabulary', 'This is the vocabulary description'); - $this->assertEntity('genre', 'Genre', 'Genre description'); - } - - /** - * Validate a migrated vocabulary contains the expected values. - * - * @param string $id - * Entity ID to load and check. - * @param string $expected_name - * The name the migrated entity should have. - * @param string $expected_description - * The description the migrated entity should have. - */ - protected function assertEntity($id, $expected_name, $expected_description) { - /** @var \Drupal\taxonomy\VocabularyInterface $entity */ - $entity = Vocabulary::load($id); - $this->assertTrue($entity instanceof VocabularyInterface); - $this->assertSame($expected_name, $entity->label()); - $this->assertSame($expected_description, $entity->getDescription()); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/DrushTest.php b/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/DrushTest.php deleted file mode 100644 index 6929c96f5..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/DrushTest.php +++ /dev/null @@ -1,217 +0,0 @@ - NULL, - 'group' => NULL, - 'tag' => NULL, - 'limit' => NULL, - 'feedback' => NULL, - 'idlist' => NULL, - 'idlist-delimiter' => ':', - 'update' => NULL, - 'force' => NULL, - 'execute-dependencies' => NULL, - ]; - - /** - * The Migrate Tools Command drush service. - * - * @var \Drupal\migrate_tools\Commands\MigrateToolsCommands - */ - protected $commands; - - /** - * The migration plugin manager. - * - * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface - */ - protected $migrationPluginManager; - - /** - * The logger. - * - * @var \Drupal\Core\Logger\LoggerChannelInterface - */ - protected $logger; - - /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp(); - $this->installConfig('migrate_plus'); - $this->installConfig('migrate_tools_test'); - $this->installEntitySchema('taxonomy_term'); - $this->installSchema('system', ['key_value', 'key_value_expire']); - $this->migrationPluginManager = $this->container->get('plugin.manager.migration'); - $this->logger = $this->container->get('logger.channel.migrate_tools'); - $this->commands = new MigrateToolsCommands( - $this->migrationPluginManager, - $this->container->get('date.formatter'), - $this->container->get('entity_type.manager'), - $this->container->get('keyvalue')); - $this->commands->setLogger($this->logger); - } - - /** - * Tests drush ms. - */ - public function testStatus() { - $this->executeMigration('fruit_terms'); - /** @var \Consolidation\OutputFormatters\StructuredData\RowsOfFields $result */ - $result = $this->commands->status('fruit_terms'); - $rows = $result->getArrayCopy(); - $this->assertSame(1, count($rows)); - $row = reset($rows); - $this->assertSame('fruit_terms', $row['id']); - $this->assertSame(3, $row['total']); - $this->assertSame(3, $row['imported']); - $this->assertSame('Idle', $row['status']); - } - - /** - * Tests drush mim. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function testImport() { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance('fruit_terms'); - $id_map = $migration->getIdMap(); - $this->commands->import('fruit_terms', ['idlist' => 'Apple'] + $this->importBaseOptions); - $this->assertSame(1, $id_map->importedCount()); - $this->commands->import('fruit_terms'); - $this->assertSame(3, $id_map->importedCount()); - $this->commands->import('fruit_terms', ['idlist' => 'Apple', 'update' => TRUE] + $this->importBaseOptions); - $this->assertSame(0, count($id_map->getRowsNeedingUpdate(100))); - } - - /** - * Tests drush mmsg. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function testMessages() { - $this->executeMigration('fruit_terms'); - $message = $this->getRandomGenerator()->string(16); - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance('fruit_terms'); - $id_map = $migration->getIdMap(); - $id_map->saveMessage(['name' => 'Apple'], $message); - /** @var \Consolidation\OutputFormatters\StructuredData\RowsOfFields $result */ - $result = $this->commands->messages('fruit_terms'); - $rows = $result->getArrayCopy(); - $this->assertSame($message, $rows[0]['message']); - } - - /** - * Tests drush mr. - */ - public function testRollback() { - $this->executeMigration('fruit_terms'); - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance('fruit_terms'); - $id_map = $migration->getIdMap(); - $this->assertSame(3, $id_map->importedCount()); - $this->commands->rollback('fruit_terms'); - $this->assertSame(0, $id_map->importedCount()); - } - - /** - * Tests drush mrs. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function testReset() { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance('fruit_terms'); - $migration->setStatus(MigrationInterface::STATUS_IMPORTING); - $this->assertSame('Importing', $this->commands->status('fruit_terms')->getArrayCopy()[0]['status']); - $this->commands->resetStatus('fruit_terms'); - $this->assertSame(MigrationInterface::STATUS_IDLE, $migration->getStatus()); - - } - - /** - * Tests drush mst. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - */ - public function testStop() { - /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->migrationPluginManager->createInstance('fruit_terms'); - $migration->setStatus(MigrationInterface::STATUS_IMPORTING); - $this->commands->stop('fruit_terms'); - $this->assertSame(MigrationInterface::STATUS_STOPPING, $migration->getStatus()); - } - - /** - * Tests drush mfs. - */ - public function testFieldsSource() { - /** @var \Consolidation\OutputFormatters\StructuredData\RowsOfFields $result */ - $result = $this->commands->fieldsSource('fruit_terms'); - $rows = $result->getArrayCopy(); - $this->assertSame(1, count($rows)); - $this->assertSame('name', $rows[0]['machine_name']); - $this->assertSame('name', $rows[0]['description']); - } - -} - -namespace Drupal\migrate_tools\Commands; - -/** - * Stub for drush_op. - * - * @param callable $callable - * The function to call. - */ -function drush_op(callable $callable) { - $args = func_get_args(); - array_shift($args); - call_user_func_array($callable, $args); -} - -/** - * Stub for dt(). - * - * @param string $text - * The text. - * - * @return string - * The text. - */ -function dt($text) { - return $text; -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateImportTest.php b/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateImportTest.php deleted file mode 100644 index 883421bc4..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateImportTest.php +++ /dev/null @@ -1,81 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('taxonomy_vocabulary'); - $this->installEntitySchema('taxonomy_term'); - $this->installConfig(['taxonomy']); - } - - /** - * Tests rolling back configuration and content entities. - */ - public function testImport() { - // We use vocabularies to demonstrate importing and rolling back - // configuration entities. - $vocabulary_data_rows = [ - ['id' => '1', 'name' => 'categories', 'weight' => '2'], - ['id' => '2', 'name' => 'tags', 'weight' => '1'], - ]; - $ids = ['id' => ['type' => 'integer']]; - $definition = [ - 'id' => 'vocabularies', - 'migration_tags' => ['Import and rollback test'], - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => $vocabulary_data_rows, - 'ids' => $ids, - ], - 'process' => [ - 'vid' => 'id', - 'name' => 'name', - 'weight' => 'weight', - ], - 'destination' => ['plugin' => 'entity:taxonomy_vocabulary'], - ]; - - /** @var \Drupal\migrate\Plugin\MigrationInterface $vocabulary_migration */ - $vocabulary_migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition); - $vocabulary_id_map = $vocabulary_migration->getIdMap(); - - // Test id list import. - $executable = new MigrateExecutable($vocabulary_migration, $this, ['idlist' => 2]); - $executable->import(); - - /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ - $vocabulary = Vocabulary::load(1); - $this->assertFalse($vocabulary); - $map_row = $vocabulary_id_map->getRowBySource(['id' => 1]); - $this->assertFalse($map_row); - /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ - $vocabulary = Vocabulary::load(2); - $this->assertTrue($vocabulary); - $map_row = $vocabulary_id_map->getRowBySource(['id' => 2]); - $this->assertNotNull($map_row['destid1']); - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateRollbackTest.php b/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateRollbackTest.php deleted file mode 100644 index 9bbfa47b3..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Kernel/MigrateRollbackTest.php +++ /dev/null @@ -1,106 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('taxonomy_vocabulary'); - $this->installEntitySchema('taxonomy_term'); - $this->installConfig(['taxonomy']); - } - - /** - * Tests rolling back configuration and content entities. - */ - public function testRollback() { - // We use vocabularies to demonstrate importing and rolling back - // configuration entities. - $vocabulary_data_rows = [ - ['id' => '1', 'name' => 'categories', 'weight' => '2'], - ['id' => '2', 'name' => 'tags', 'weight' => '1'], - ]; - $ids = ['id' => ['type' => 'integer']]; - $definition = [ - 'id' => 'vocabularies', - 'migration_tags' => ['Import and rollback test'], - 'source' => [ - 'plugin' => 'embedded_data', - 'data_rows' => $vocabulary_data_rows, - 'ids' => $ids, - ], - 'process' => [ - 'vid' => 'id', - 'name' => 'name', - 'weight' => 'weight', - ], - 'destination' => ['plugin' => 'entity:taxonomy_vocabulary'], - ]; - - /** @var \Drupal\migrate\Plugin\MigrationInterface $vocabulary_migration */ - $vocabulary_migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition); - $vocabulary_id_map = $vocabulary_migration->getIdMap(); - - // Import and validate vocabulary config entities were created. - $executable = new MigrateExecutable($vocabulary_migration, $this, []); - $executable->import(); - foreach ($vocabulary_data_rows as $row) { - /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ - $vocabulary = Vocabulary::load($row['id']); - $this->assertTrue($vocabulary); - $map_row = $vocabulary_id_map->getRowBySource(['id' => $row['id']]); - $this->assertNotNull($map_row['destid1']); - } - - // Test id list rollback. - $rollback_executable = new MigrateExecutable($vocabulary_migration, $this, ['idlist' => 1]); - $rollback_executable->rollback(); - /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ - $vocabulary = Vocabulary::load(1); - $this->assertFalse($vocabulary); - $map_row = $vocabulary_id_map->getRowBySource(['id' => 1]); - $this->assertFalse($map_row); - - // TODO: remove after 8.6 is sunset. - // @see https://www.drupal.org/project/migrate_tools/issues/3008316 - include_once $this->root . '/core/includes/install.core.inc'; - $version = _install_get_version_info(\Drupal::VERSION); - if ($version['minor'] == 6) { - /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ - $vocabulary = Vocabulary::load(1); - $this->assertFalse($vocabulary); - $map_row = $vocabulary_id_map->getRowBySource(['id' => 1]); - $this->assertFalse($map_row); - } - else { - /** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary */ - $vocabulary = Vocabulary::load(2); - $this->assertTrue($vocabulary); - $map_row = $vocabulary_id_map->getRowBySource(['id' => 2]); - $this->assertNotNull($map_row['destid1']); - } - - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Unit/MigrateToolsTest.php b/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Unit/MigrateToolsTest.php deleted file mode 100644 index 23f02c581..000000000 --- a/sites/all/modules/contrib/migrate/migrate_tools/tests/src/Unit/MigrateToolsTest.php +++ /dev/null @@ -1,85 +0,0 @@ -assertEquals($results, $expected); - } - - /** - * Data provider for testBuildIdList. - */ - public function dataProviderIdList() { - $cases = []; - $cases[] = [ - 'options' => [], - 'expected' => [], - ]; - $cases['single id'] = [ - 'options' => [ - 'idlist' => 123, - ], - 'expected' => [[123]], - ]; - $cases['multiple ids'] = [ - 'options' => [ - 'idlist' => '123, 456', - ], - 'expected' => [ - [123], [456], - ], - ]; - $cases['default delimiter, composite key'] = [ - 'options' => [ - 'idlist' => '123:456', - ], - 'expected' => [ - [123, 456], - ], - ]; - $cases['special delimiter, single'] = [ - 'options' => [ - 'idlist' => '123:456', - 'idlist-delimiter' => '~', - ], - 'expected' => [ - ['123:456'], - ], - ]; - $cases['special delimiter, multiple'] = [ - 'options' => [ - 'idlist' => '123:456~987:654', - 'idlist-delimiter' => '~', - ], - 'expected' => [ - ['123:456', '987:654'], - ], - ]; - $cases['space delimiter, multiple'] = [ - 'options' => [ - 'idlist' => '123:456 987:654', - 'idlist-delimiter' => ' ', - ], - 'expected' => [ - ['123:456', '987:654'], - ], - ]; - return $cases; - } - -} diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/LICENSE.txt b/sites/all/modules/contrib/migrate/migrate_upgrade/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/README.txt b/sites/all/modules/contrib/migrate/migrate_upgrade/README.txt deleted file mode 100644 index cf5ee51cf..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/README.txt +++ /dev/null @@ -1,87 +0,0 @@ -The migrate_upgrade module provides drush support for performing upgrades from -previous versions of Drupal to Drupal 8. It implements two drush commands: - -* migrate-upgrade - performs a complete import of the source site's configuration -and content into the target Drupal 8 site. Optionally, with the --configure-only -flag, it may create migration configurations for such an import without actually -running them, to permit customization of the import process. - -* migrate-upgrade-rollback - removes content and certain configuration -previously imported either by the migrate-upgrade command or by the core -upgrade UI. - -migrate-upgrade -=============== -The upgrade command requires a Drupal 6-style database URL of the source site's -database, and the location of the source site's public files. - -drush migrate-upgrade --legacy-db-url=mysql://user:pw@127.0.0.1/d6db --legacy-root=http://example.com - -The --legacy-root option may be either the domain of your existing Drupal site -(with the public files pulled by HTTP), or a local file directory into which you -have copied the files directory from your source site. - -If your source site used a database prefix for all tables, you may specify the -prefix with --legacy-db-prefix. Migration from sites with partial or mixed -prefixing is not supported. Note that if the source site is stored in a Postgres -schema, you must set the prefix to the schema with a period appended (e.g., ---legacy-db-prefix=drupal.). - -The migrate-upgrade command, like the core upgrade UI, is designed to be run on -a freshly installed and empty Drupal 8 site (where the only site configuration -that has been done is enabling any modules for which you wish to migrate data). - -migrate-upgrade-rollback -======================== - -The rollback command has no arguments or options: - -drush migrate-upgrade-rollback - -If it detects that an upgrade has been performed, either by migrate-upgrade or -by the core UI, it removes all content imported via the migration process (it -identifies the upgrade by the presence of the migrate_drupal_ui.performed state -key). In addition, any configuration entites created by the migration process -(such as content type and field definitions) are also removed. Because simple -configuration settings (such as the site title) are generally modified rather -than created by the upgrade process, and the original values are not preserved, -those changes are not rolled back. To completely return to the previous state, -you need to restore the site from backup, or reinstall a fresh empty site. - -migrate-upgrade --configure-only -================================ -At the time of this release, tools have not yet been developed (along the lines -of the migrate_d2d_ui module under Drupal 7) for customizing Drupal-to-Drupal -migrations in Drupal 8. For now, the best option short of doing custom -development is to use the --configure-only option on migrate-upgrade to replace -the actual execution of the migrations with export of their configuration to -configuration entities, which can then be modified as needed for a particular -migration scenario. A suggested workflow: - -1. Install a fresh empty D8 site, enabling all modules for which you wish to - migrate data. -2. Run the drush migrate-upgrade command with the --configure-only option. This - generates migration configuration entities in the D8 database (config table). -3. Create a custom module containing only a .info.yml file (with dependencies on - migrate_plus and migrate_drupal) and a config/install directory. -4. Export your site configuration, e.g. drush cex --destination=/tmp/export -5. Copy the migration configuration that was generated by migrate-upgrade into - the custom module - be sure *not* to copy the default group configuration, - which is defined by migrate_plus: - cp /tmp/export/migrate_plus.migration.* /tmp/export/migrate_plus.migration_group.migrate_*.yml migrate_custom/config/install/ -6. Look at that migrate_plus.migration_group.* file - you'll see your database - configuration captured there. In most cases, what you'll want to do is define - your database connection in settings.php with those credentials under the key - that is configured there - you won't want to commit the credentials to your - git repo. -7. Edit the generated .yml files to reflect your custom migration path. -8. Reinstall D8, enable your custom module and migrate_tools, and proceed to - work with your Drupal migrations as you would with any custom migration. - Hint: you'll probably want config_devel so you can edit .yml files in - config/install and immediately test your changes. - -Note that the configuration entities generated above need to be prefixed to -avoid conflict with the core migration plugins they originated from. For -example, by default the core d6_user plugin generates the upgrade_d6_user -configuration entity. You may modify the 'upgrade_' prefix by providing a ---migration-prefix option. diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/composer.json b/sites/all/modules/contrib/migrate/migrate_upgrade/composer.json deleted file mode 100644 index cb5dd87ec..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/composer.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "drupal/migrate_upgrade", - "description": "Drush support for direct upgrades from older Drupal versions.", - "type": "drupal-module", - "require-dev": { - "drupal/coder": "^8" - }, - "license": "GPL-2.0+", - "require": {}, - "minimum-stability": "dev" -} diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.drush.inc b/sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.drush.inc deleted file mode 100644 index ef5404d31..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.drush.inc +++ /dev/null @@ -1,93 +0,0 @@ - 'Perform one or more upgrade processes.', - 'options' => [ - 'legacy-db-url' => 'A Drupal 6 style database URL. Required if you do not set legacy-db-key.', - 'legacy-db-key' => 'A database connection key from settings.php. Use as an alternative to legacy-db-url', - 'legacy-db-prefix' => 'Prefix of the legacy Drupal installation.', - 'legacy-root' => 'Site address or root of the legacy Drupal installation', - 'configure-only' => 'Set up the appropriate upgrade processes but do not perform them', - 'migration-prefix' => 'With configure-only, a prefix to apply to generated migration ids. Defaults to \'upgrade_\'', - ], - 'examples' => [ - 'migrate-upgrade --legacy-db-url=\'mysql://root:pass@127.0.0.1/d6\'' => 'Upgrade a Drupal 6 database to Drupal 8', - 'migrate-upgrade --legacy-db-key=\'drupal_7\'' => 'Upgrade Drupal 7 database where the connection to Drupal 7 has already been created in settings.php ($databases[\'drupal_7\'])', - 'migrate-upgrade --legacy-db-url=\'mysql://root:pass@127.0.0.1/d7\' --configure-only --migration-prefix=d7_custom_' => 'Generate migrations for a custom migration from Drupal 7 to Drupal 8', - ], - 'drupal dependencies' => ['migrate_upgrade'], - ]; - $items['migrate-upgrade-rollback'] = [ - 'description' => 'Rolls back and removes upgrade migrations.', - 'examples' => [ - 'migrate-upgrade-rollback' => 'Rolls back a previously-run upgrade', - ], - 'drupal dependencies' => ['migrate_upgrade'], - ]; - - return $items; -} - -/** - * Execute the upgrade command, configuring the necessary migrations and - * optionally perform the imports. - */ -function drush_migrate_upgrade() { - $runner = new MigrateUpgradeDrushRunner(); - - try { - $runner->configure(); - if (drush_get_option('configure-only')) { - $runner->export(); - } - else { - $runner->import(); - \Drupal::state()->set('migrate_drupal_ui.performed', REQUEST_TIME); - } - // Remove the global database state. - \Drupal::state()->delete('migrate.fallback_state_key'); - } - catch (\Exception $e) { - drush_log($e->getMessage(), 'error'); - } -} - -/** - * Rolls back any upgrade migrations that are present, and deletes the migrations - * themselves. - */ -function drush_migrate_upgrade_rollback() { - if ($date_performed = \Drupal::state()->get('migrate_drupal_ui.performed')) { - if (drush_confirm(dt('All migrations tagged as \'Drupal\' will be rolled back. Are you sure?'))) { - $runner = new MigrateUpgradeDrushRunner(); - - try { - drush_log(dt('Rolling back the upgrades performed @date', - ['@date' => \Drupal::service('date.formatter')->format($date_performed)])); - $runner->rollback(); - \Drupal::state()->delete('migrate_drupal_ui.performed'); - drush_log(dt('Rolled back upgrades')); - } - catch (\Exception $e) { - drush_log($e->getMessage(), 'error'); - } - } - else { - drush_user_abort(); - } - } - else { - drush_log(dt('No upgrade operation has been performed.'), 'warning'); - } -} diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.info.yml b/sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.info.yml deleted file mode 100644 index 822bd9c7a..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/migrate_upgrade.info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Drupal Upgrade -type: module -description: 'Drush support for direct upgrades from older Drupal versions.' -package: Migration -# core: 8.x -dependencies: - - drupal:migrate (>=8.2) - - drupal:migrate_drupal - - migrate_plus:migrate_plus - - drupal:dblog - -# Information added by Drupal.org packaging script on 2017-09-02 -version: '8.x-3.0-rc2' -core: '8.x' -project: 'migrate_upgrade' -datestamp: 1504384149 diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/phpcs.xml b/sites/all/modules/contrib/migrate/migrate_upgrade/phpcs.xml deleted file mode 100644 index 1ccfe7eb4..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/phpcs.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - PHP CodeSniffer configuration - . - - - - ./vendor/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sites/all/modules/contrib/migrate/migrate_upgrade/src/DrushLogMigrateMessage.php b/sites/all/modules/contrib/migrate/migrate_upgrade/src/DrushLogMigrateMessage.php deleted file mode 100644 index 888fafd3d..000000000 --- a/sites/all/modules/contrib/migrate/migrate_upgrade/src/DrushLogMigrateMessage.php +++ /dev/null @@ -1,23 +0,0 @@ -version = $this->getLegacyDrupalVersion($connection); - $database_state['key'] = drush_get_option('legacy-db-key'); - $database_state_key = 'migrate_drupal_' . $this->version; - \Drupal::state()->set($database_state_key, $database_state); - \Drupal::state()->set('migrate.fallback_state_key', $database_state_key); - } - else { - $db_url = drush_get_option('legacy-db-url'); - $db_spec = drush_convert_db_from_db_url($db_url); - $db_prefix = drush_get_option('legacy-db-prefix'); - $db_spec['prefix'] = $db_prefix; - $connection = $this->getConnection($db_spec); - $this->version = $this->getLegacyDrupalVersion($connection); - $this->createDatabaseStateSettings($db_spec, $this->version); - } - - $this->databaseStateKey = 'migrate_drupal_' . $this->version; - $migrations = $this->getMigrations($this->databaseStateKey, $this->version); - $this->migrationList = []; - foreach ($migrations as $migration) { - $this->applyFilePath($migration); - $this->expandNodeMigrations($migration); - $this->migrationList[$migration->id()] = $migration; - } - } - - /** - * Adds the source base path configuration to relevant migrations. - * - * @param \Drupal\migrate\Plugin\MigrationInterface $migration - * Migration to alter with the provided path. - */ - protected function applyFilePath(MigrationInterface $migration) { - $destination = $migration->getDestinationConfiguration(); - if ($destination['plugin'] === 'entity:file') { - // Make sure we have a single trailing slash. - $source_base_path = rtrim(drush_get_option('legacy-root'), '/') . '/'; - $source = $migration->getSourceConfiguration(); - $source['constants']['source_base_path'] = $source_base_path; - $migration->set('source', $source); - } - } - - /** - * For D6 term_node migrations, make sure the nid reference is expanded. - * - * @param \Drupal\migrate\Plugin\MigrationInterface $migration - * Migration to alter with the list of node migrations. - */ - protected function expandNodeMigrations(MigrationInterface $migration) { - $source = $migration->getSourceConfiguration(); - // Track the node migrations as we see them. - if ($source['plugin'] == 'd6_node') { - $this->nodeMigrations[] = $migration->id(); - } - elseif ($source['plugin'] == 'd6_term_node' || $source['plugin'] == 'd6_term_node_revision') { - if ($source['plugin'] == 'd6_term_node') { - $id_property = 'nid'; - } - else { - $id_property = 'vid'; - } - // If the ID mapping is to the underived d6_node migration, replace - // it with an expanded list of node migrations. - $process = $migration->getProcess(); - $new_nid_process = []; - foreach ($process[$id_property] as $delta => $plugin_configuration) { - if (in_array($plugin_configuration['plugin'], $this->migrationLookupPluginIds) && - is_string($plugin_configuration['migration']) && - substr($plugin_configuration['migration'], -7) == 'd6_node') { - $plugin_configuration['migration'] = $this->nodeMigrations; - } - $new_nid_process[$delta] = $plugin_configuration; - } - $migration->setProcessOfProperty($id_property, $new_nid_process); - } - } - - /** - * Run the configured migrations. - */ - public function import() { - static::$messages = new DrushLogMigrateMessage(); - if (drush_get_option('debug')) { - \Drupal::service('event_dispatcher')->addListener(MigrateEvents::IDMAP_MESSAGE, - [get_class(), 'onIdMapMessage']); - } - foreach ($this->migrationList as $migration_id => $migration) { - drush_print(dt('Upgrading @migration', ['@migration' => $migration_id])); - $executable = new MigrateExecutable($migration, static::$messages); - // drush_op() provides --simulate support. - drush_op([$executable, 'import']); - } - } - - /** - * Export the configured migration plugins as configuration entities. - */ - public function export() { - $db_info = \Drupal::state()->get($this->databaseStateKey); - - // Create a group to hold the database configuration. - $group = [ - 'id' => $this->databaseStateKey, - 'label' => 'Import from Drupal ' . $this->version, - 'description' => 'Migrations originally generated from drush migrate-upgrade --configure-only', - 'source_type' => 'Drupal ' . $this->version, - 'shared_configuration' => [ - 'source' => [ - 'key' => 'drupal_' . $this->version, - ] - ] - ]; - - // Only add the database connection info to the configuration entity - // if it was passed in as a parameter. - if (!empty(drush_get_option('legacy-db-url'))) { - $group['shared_configuration']['source']['database'] = $db_info['database']; - } - - // Ditto for the key. - if (!empty(drush_get_option('legacy-db-key'))) { - $group['shared_configuration']['source']['key'] = drush_get_option('legacy-db-key'); - } - - $group = MigrationGroup::create($group); - $group->save(); - foreach ($this->migrationList as $migration_id => $migration) { - drush_print(dt('Exporting @migration as @new_migration', - ['@migration' => $migration_id, '@new_migration' => $this->modifyId($migration_id)])); - $entity_array['id'] = $migration_id; - $entity_array['class'] = $migration->get('class'); - $entity_array['cck_plugin_method'] = $migration->get('cck_plugin_method'); - $entity_array['migration_group'] = $this->databaseStateKey; - $entity_array['migration_tags'] = $migration->get('migration_tags'); - $entity_array['label'] = $migration->get('label'); - $entity_array['source'] = $migration->getSourceConfiguration(); - $entity_array['destination'] = $migration->getDestinationConfiguration(); - $entity_array['process'] = $migration->get('process'); - $entity_array['migration_dependencies'] = $migration->getMigrationDependencies(); - $migration_entity = Migration::create($this->substituteIds($entity_array)); - $migration_entity->save(); - } - } - - /** - * Rewrite any migration plugin IDs so they won't conflict with the core - * IDs. - * - * @param $entity_array - * A configuration array for a migration. - * - * @return array - * The migration configuration array modified with new IDs. - */ - protected function substituteIds($entity_array) { - $entity_array['id'] = $this->modifyId($entity_array['id']); - foreach ($entity_array['migration_dependencies'] as $type => $dependencies) { - foreach ($dependencies as $key => $dependency) { - $entity_array['migration_dependencies'][$type][$key] = $this->modifyId($dependency); - } - } - $this->substituteMigrationIds($entity_array['process']); - return $entity_array; - } - - /** - * Recursively substitute IDs for migration plugins. - * - * @param mixed $process - */ - protected function substituteMigrationIds(&$process) { - if (is_array($process)) { - // We found a migration plugin, change the ID. - if (isset($process['plugin']) && in_array($process['plugin'], $this->migrationLookupPluginIds)) { - if (is_array($process['migration'])) { - $new_migration = []; - foreach ($process['migration'] as $migration) { - $new_migration[] = $this->modifyId($migration); - } - $process['migration'] = $new_migration; - } - else { - $process['migration'] = $this->modifyId($process['migration']); - } - } - else { - // Recurse on each array member. - foreach ($process as &$subprocess) { - $this->substituteMigrationIds($subprocess); - } - } - } - } - - /** - * @param $id - * The original core plugin ID. - * - * @return string - * The ID modified to serve as a configuration entity ID. - */ - protected function modifyId($id) { - return drush_get_option('migration-prefix', 'upgrade_') . str_replace(':', '_', $id); - } - - /** - * Rolls back the configured migrations. - */ - public function rollback() { - static::$messages = new DrushLogMigrateMessage(); - $database_state_key = \Drupal::state()->get('migrate.fallback_state_key'); - $database_state = \Drupal::state()->get($database_state_key); - $db_spec = $database_state['database']; - $connection = $this->getConnection($db_spec); - $version = $this->getLegacyDrupalVersion($connection); - $migrations = $this->getMigrations('migrate_drupal_' . $version, $version); - - // Roll back in reverse order. - $this->migrationList = array_reverse($migrations); - - foreach ($migrations as $migration) { - drush_print(dt('Rolling back @migration', ['@migration' => $migration->id()])); - $executable = new MigrateExecutable($migration, static::$messages); - // drush_op() provides --simulate support. - drush_op([$executable, 'rollback']); - } - } - - /** - * Display any messages being logged to the ID map. - * - * @param \Drupal\migrate\Event\MigrateIdMapMessageEvent $event - * The message event. - */ - public static function onIdMapMessage(MigrateIdMapMessageEvent $event) { - if ($event->getLevel() == MigrationInterface::MESSAGE_NOTICE || - $event->getLevel() == MigrationInterface::MESSAGE_INFORMATIONAL) { - $type = 'status'; - } - else { - $type = 'error'; - } - $source_id_string = implode(',', $event->getSourceIdValues()); - $message = t('Source ID @source_id: @message', - ['@source_id' => $source_id_string, '@message' => $event->getMessage()]); - static::$messages->display($message, $type); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/CHANGELOG.txt b/sites/all/modules/contrib/search/search_api/CHANGELOG.txt deleted file mode 100644 index 51a09db73..000000000 --- a/sites/all/modules/contrib/search/search_api/CHANGELOG.txt +++ /dev/null @@ -1,587 +0,0 @@ -Search API 1.11 (2018-11-18): ------------------------------ -- #3012778 by Shashwat Purav, pamatt, drunken monkey: Fixed several doc comment - typos. -- #3011340 by pfrenssen, idimopoulos, drunken monkey: Fixed problem when - updating multiple indexes' datasource settings via "drush cim". -- #2986623 by drunken monkey, valic: Added the "Reverse entity references" - processor. -- #3009136 by drunken monkey, mkalkbrenner, borisson_: Added the - "search_api_retrieved_field_values" query option. -- #3006267 by idebr, drunken monkey: Removed conditional code for Drupal 8.5. -- #3007311 by drunken monkey: Fixed catch clause in - PostRequestIndexing::destruct(). -- #2994022 by drunken monkey, Watergate, borisson_: Fixed facets when there are - no search results in Database backend. -- #2898917 by Lennard Westerveld, RoSk0, drunken monkey: Fixed Views filters - with checkboxes and "is all of" operator. -- #3001259 by klausi, drunken monkey, borisson_: Fixed HTML escaping throughout - the module. -- #3001030 by mkalkbrenner, drunken monkey, mvantuch: Fixed excerpt not taking - Solr filters into account. -- #3004017 by idebr, drunken monkey: Fixed server/index config schemas to use - UUID field from Core definition. -- #2971619 by idebr, drunken monkey: Refactored the access check for the - "Execute pending tasks" local action. -- #2995342 by AndrewsizZ, drunken monkey, borisson_: Added stripping of - script/style HTML tags in excerpts to Highlight processor. - -Search API 1.10 (2018-09-17): ------------------------------ -- #2993787 by drunken monkey, borisson_, mkalkbrenner: Added the possibility to - boost fields in MLT queries. -- #2936631 by drunken monkey, borisson_: Added support for the "no_ui" - definition key for plugins. -- #2996936 by drunken monkey, borisson_: Added suggested packages to - composer.json. -- #2987156 by hchonov, drunken monkey, borisson_: Fixed missing dependency on - modules providing fields. -- #2994638 by drunken monkey, Grayle, borisson_: Fixed warning in aggregated - fields without values. -- #2987237 by quicksketch, drunken monkey, borisson_: Fixed requirements hook - for the Taxonomy Term Handlers module preventing updates from running. -- #2992662 by capysara, drunken monkey, borisson_: Fixed the reindexing link - when saving index processors or fields. -- #2989689 by drunken monkey, valthebald, borisson_: Fixed bug in Views cache - plugin alter hook. -- #2919676 by drunken monkey, borisson_: Fixed server entity link definitions. -- #2996278 by drunken monkey: Removed one pointless variable. -- #2987245 by drunken monkey: Fixed use of account_switcher service for - switching the currently active account. -- #2996907 by zerolab, drunken monkey: Fixed entity tracking using access - checks. -- #2993434 by jasonawant, drunken monkey: Fixed handling of comma-separated - values in Views contextual filters. -- #2983843 by drunken monkey, borisson_: Fixed suggestion of installing default - module when dependencies aren't met. -- #2979316 by drunken monkey, Sutharsan: Fixed highlighting problems with - multi-byte characters. -- #2986310 by capysara, drunken monkey: Added link to reindexing when saving - fields. -- #2986013 by tim-diels, drunken monkey, borisson_: Fixed casting of - nun-numeric strings in the database backend. -- #2983630 by chipway, borisson_, drunken monkey: Fixed format of System - dependency in search_api.info.yml. -- #2982660 by jhedstrom, drunken monkey, borisson_: Fixed indexed time of - date-only fields. -- #2986216 by drunken monkey: Added the "legacy" group to - SearchApiDbUpdate8102Test. -- #2920943 by drunken monkey: Fixed error handling for "Rendered item" - processor. - -Search API 1.9 (2018-07-19): ----------------------------- -- #2956012 by drunken monkey, DuaelFr: Added uncustomized view modes as options - when rendering items. -- #2980903 by drunken monkey, kristofferwiklund, borisson_: Fixed undefined - index notice in Views date filter. -- #2982693 by jhedstrom, borisson_, drunken monkey: Adapted tests to latest - Core changes. -- #2971033 by mErilainen, drunken monkey, borisson_: Added an option for prefix - matching to the database backend. -- #2973034 by idebr, drunken monkey: Removed outdated @todo comment. -- #2972510 by msankhala, drunken monkey: Replaced Unicode::* methods with mb_* - functions. -- #2973047 by idebr, drunken monkey: Fixed misnamed test config files. -- #2860167 by drunken monkey, borisson_, fenstrat: Added "orderby" to our - config schema definitions. -- #2948820 by capysara, drunken monkey, borisson_: Added a link to the "need to - reindex" message on the Filters tab. -- #2965803 by capysara, drunken monkey: Fixed left-over use of @url placeholder. -- #2957650 by drunken monkey, borisson_: Fixed two minor problems. -- #2939010 by nedjo, drunken monkey: Fixed deleted fields when index is created - during module install. -- #2931730 by drunken monkey, borisson_, chanderbhushan: Adapted to changes in - drupal_set_message(). -- #2955607 by drunken monkey, borisson_: Removed our custom Query::__wakeup() - work-around. -- #2940138 by drunken monkey, borisson_: Switched to new Core tempstore service. -- #2936630 by drunken monkey, borisson_: Adapted override detection code to use - Config::hasOverrides(). -- #2961537 by drunken monkey: Increased Core dependency to Drupal 8.5. -- #2959809 by drunken monkey, Rob230, mkalkbrenner, borisson_: Fixed small - coding mistake in the "URL field" processor. -- #2960931 by drunken monkey, borisson_: Fixed viewing of multiple content - entity items. - -Search API 1.8 (2018-04-16): ----------------------------- -- #2960854 by nedjo, drunken monkey: Fixed "Database search defaults" index. -- #2930839 by drunken monkey: Update tests according to latest PHPUnit - compatibility changes -- #2921022 by drunken monkey, marcvangend: Fixed automatic task execution with - Drush. -- #2955887 by drunken monkey, borisson_: Added a way to re-execute a query. -- #2925464 by drunken monkey, borisson_, .jch: Fixed problem with missing "NOT - NULL" attribute in database backend. -- #2953266 by drunken monkey, borisson_: Added a helper method for - "selected"/"default" checks. -- #2953267 by drunken monkey, borisson_: Fixed REST dependency of Views test - module. -- #2945870 by Dropa, drunken monkey: Fixed timezone of indexed date strings. -- #2948659 by drunken monkey, borisson_, bskibinski: Added support for HTML5 - placeholder in Views exposed filters. -- #2951055 by bradjones1, borisson_, drunken monkey: Fixed documentation for - IndexInterface::addField(). -- #2945560 by mkalkbrenner, drunken monkey, borisson_: Fixed handling of - existing highlighting data in Highlight processor. -- #2946386 by drunken monkey, borisson_: Fixed typo in Query::getAbortMessage(). -- #2945675 by drunken monkey, borisson_: Unified use of self and static. - -Search API 1.7 (2018-02-23): ----------------------------- -- #2922525 by drunken monkey, borisson_: Changed "Index items immediately" to - delay indexing until the end of the page request. -- #2930720 by drunken monkey, borisson_: Added a UI for rebuilding the tracking - table for an index. -- #2912246 by drunken monkey: Fixed inconsistent array indices in query - languages. -- #2939405 by bserem, borisson_, drunken monkey, yoroy: Improved UI text on - what is included in the index. -- #2943705 by kevin.dutra, drunken monkey, borisson_: Fixed performance - problems with LIFO tracker. -- #2942846 by idebr, drunken monkey, borisson_: Added empty/not empty operators - to Views fulltext field filters. -- #2940255 by drunken monkey: Updated the DB autocomplete implementation to the - stable API version. -- #2938646 by drunken monkey, Johnny vd Laar: Fixed item-boosts in database - backend. -- #2939085 by mattgill, drunken monkey: Fixed fatal error in Views when trying - to set keywords conjunction on aborted query. -- #2933811 by drunken monkey: Fixed coding standards in new Drush code. -- #2932347 by drunken monkey, ghaya: Fixed case insensitive matching for - highlighting non-ASCII text. -- #2938288 by drunken monkey: Fixed problems with PHP 7.2. -- #2934321 by Graber, drunken monkey: Fixed Views total for views with pager - offset. -- #2932347 by drunken monkey, ghaya: Fixed case insensitive matching for - highlighting non-ASCII text. -- #2933309 by drunken monkey, mkalkbrenner: Made some helper methods in the - CommandHelper class public. -- #2928279 by drunken monkey, borisson_: Added a test for the default tracker - plugin. - -Search API 1.6 (2017-12-24): ----------------------------- -- #2669962 by kevin.dutra, drunken monkey, kristofferwiklund, borisson_: Added - option to change the order in which items are indexed. -- #2917399 by drunken monkey, andypost, borisson_, zenimagine: Fixed definition - of Views taxonomy term plugins. -- #2922874 by drunken monkey, borisson_: Fixed DBMS compatibility handling when - a non-default database is used with the Database backend. -- #2923910 by George Bills, drunken monkey, eft, borisson_, robin.ingelbrecht: - Fixed handling of array-valued Views fulltext filter input. -- #2914478 by borisson_, mpp, drunken monkey, pfrenssen, claudiu.cristea, - kevin.dutra, SylvainM, jhedstrom, bircher: Added integration with Drush 9. -- #2926733 by drunken monkey, borisson_: Fixed indexing of leading/trailing - whitespace in fulltext tokens on database backend. -- #2922024 by drunken monkey, borisson_: Fixed Stemmer incorrectly processing - non-English searches. -- #2931730 by drunken monkey: Adapted tests to changes in drupal_set_message(). -- #2929739 by drunken monkey, borisson_: Improved adherence to coding standards. -- #2927748 by mkalkbrenner, mstiem, drunken monkey: Fixed Views field handler - for multiple processor-defined fields returned by the server. -- #2928944 by drunken monkey: Removed assert() calls with string parameters. -- #2923976 by Martijn Houtman, drunken monkey: Fixed facets with random sorting - on Database backend. -- #2921582 by chr.fritsch, drunken monkey: Fixed saving of "database_text" form - field for Database servers. -- #2919884 by samuel.mortenson, borisson_, drunken monkey: Improved performance - for saving an index's reindexing state. -- #2855254 by dev.patrick, drunken monkey, borisson_: Removed the remaining - @codingStandardsIgnoreFile directive. -- #2916754 by chr.fritsch, borisson_, drunken monkey: Fixed failure to detect - whether a view is executed in the current request. -- #2910638 by drunken monkey, borisson_, phillipHG: Fixed handling of - entity-valued processor properties. -- #2917036 by drunken monkey, borisson_: Fixed illegal return values in - Database::getAutocompleteSuggestions(). -- #2916225 by tilenav, borisson_, drunken monkey: Replaced manual config - setting with installConfig() in our Kernel tests. -- #2917779 by mkalkbrenner, edurenye, drunken monkey: Fixed fatal errors in - views on PHP 5. -- #2905562 by drunken monkey, borisson_: Increased the minimum Core version to - 8.4. -- #2905562 by drunken monkey, borisson_: Increased the minimum Core version to - 8.4. -- #2916208 by drunken monkey: Fixed AJAX display of plugin forms. -- #2278433 by drunken monkey, borisson_: Added option to Views field handlers - to use highlighted fields data. -- #2278433 by drunken monkey, borisson_: Added option to Views field handlers - to use highlighted fields data. - -Search API 1.5 (2017-10-14): ----------------------------- -- #2913688 by kevin.dutra, borisson_, drunken monkey: Fixed display plugin for - Views pages with contextual filters. -- #2911734 by drunken monkey, borisson_, mkalkbrenner: Fixed Views display of - fields returned from the backend. -- #2910918 by drunken monkey, borisson_: Fixed error in fields configuration - form. -- #2650986 by drunken monkey, borisson_: Fixed various problems with Views - field handling. -- #2907518 by drunken monkey, jrockowitz, borisson_: Fixed index - creation/update via CLI on large sites. -- #2908440 by claudiu.cristea: Fixed UnsavedIndexConfiguration documentation. -- #2899678 by drunken monkey, Graber, borisson_: Added support for VBO. -- #2909153 by drunken monkey, borisson_: Fixed fatal error for test fails under - certain conditions. -- #2907756 by drunken monkey, bojanz: Fixed "Entity status" processor to - support other publishable entity types. -- #2904377 by drunken monkey, borisson_: Added Autocomplete tests for the DB - backend. -- #2907943 by drunken monkey: Fixed warnings on PHP 5. -- #2906099 by drunken monkey: Fixed use of field's underlying property label in - Views. -- #2896073 by drunken monkey, New Zeal: Fixed warnings when indexing empty text - fields. -- #2898082 by drunken monkey: Re-organized our test class namespaces. -- #2907334 by drunken monkey: Fixed some more Drupal coding standards - violations. -- #2903407 by drunken monkey, alan-ps: Added #optional to form containers where - appropriate. - -Search API 1.4 (2017-09-07): ----------------------------- -- #2905117 by drunken monkey: Fixed problems with multi-valued - processor-generated fields on Solr. -- #2884034 by drunken monkey: Fixed highlighting for processed keywords. -- #2902947 by drunken monkey: Fixed "Thousands marker" setting for Views fields. -- #2902907 by drunken monkey, juagarc4: Fixed indexing of multibyte text on - MySQL. -- #2903805 by drunken monkey: Disabled fields processors for hidden fields. -- #2903014 by drunken monkey: Fixed "Enable for all fields" processor option. -- #2904976 by drunken monkey: Fixed the current test fails. -- #2902810 by drunken monkey, borisson_: Made query serialization in tests - safer. -- #2903834 by drunken monkey: Adapted to latest changes in Autocomplete module. -- #2903633 by drunken monkey: Fixed current test fails. -- #2899920 by kfritsche: Fixed stored value of boolean Views filters. -- #2896312 by kerasai, drunken monkey: Fixed problems with Views options list - filter. -- #2896878 by drunken monkey: Fixed test fails due to latest Core changes. -- #2665476 by ericgsmith, drunken monkey: Fixed paging in cached views. - -Search API 1.3 (2017-07-19): ----------------------------- -- #2888584 by drunken monkey: Fixed index description for "cron batch size" of - -1. -- #2895142 by drunken monkey: Made our test classes more useful for other - modules. -- #2851436 by Erik Frèrejean, andywhale, beltofte, drunken monkey: Added a - "Type-specific boosting" processor. -- #2889426 by cspitzlay, drunken monkey: Fixed test fails on Drupal 8.3. -- #2891387 by drunken monkey: Fixed some new code style issues. -- #2891246 by drunken monkey: Fixed error detection in plugin helper. -- #2884451 by drunken monkey: Fixed missing primary key for denormalized index - tables in DB backend. -- #2886978 by drunken monkey: Fixed tracking of entities in disabled languages. - -Search API 1.2 (2017-06-25): ----------------------------- -- #2881198 by jzavrl, drunken monkey, borisson_: Added property paths to "Add - fields" form. -- #2883475 by Matthijs, drunken monkey, borisson_: Added support for "Language - not applicable". -- #2883807 by LammensJ, drunken monkey: Fixed warning in Views UI for - contextual filters. -- #2880239 by acbramley, drunken monkey, borisson_: Fixed logic for multiple - sorts on the same field. -- #2889426 by drunken monkey: Fixed test fails for latest Core changes. -- #2884720 by blake.thompson: Added a display plugin for the Views Embed - display type. -- #2882347 by mkalkbrenner: Fixed forms to not have unserializable properties. -- #2676468 by acbramley, drunken monkey, borisson_: Fixed stale cache in search - view with tag-based caching. -- #2876398 by drunken monkey: Fixed operator description of Views "Fulltext - search" filter. -- #2881945 by drunken monkey: Removed unnecessary check in - AddURL::addFieldValues(). -- #2886981 by drunken monkey: Fixed test fails for latest Core changes. -- #2880026 by Anton4yk, drunken monkey: Fixed bugs in entity datasource's item - discovery code for edge cases. -- #2881631 by jzavrl, drunken monkey, borisson_: Added alphabetic sort for - properties in "Add fields" form. -- #2867809 by drunken monkey, borisson_: Added an option to enable a processor - for all compatible fields. -- #2878974 by acbramley: Added the date Views argument plugin. -- #2840274 by drunken monkey, borisson_: Updated the Core dependency to 8.3. -- #2874895 by harsha012, drunken monkey, borisson_: Fixed OOP code to use the - t() method instead of the global t() function. -- #2624876 by drunken monkey, borisson_: Added a query option for "properties - to retrieve". -- #2682949 by drunken monkey, borisson_: Adapted to changes in the Autocomplete - module. - -Search API 1.1 (2017-05-10): ----------------------------- -- #2858303 by beluoctavian, drunken monkey: Fixed "is empty" Views filters for - taxonomy term references. -- #2873246 by drunken monkey: Fixed a second error for cached aborted search - queries in Views. -- #2862289 by hoebekewim, drunken monkey: Fixed oversized column for fulltext - fields in denormalized index table. -- #2859683 by drunken monkey: Added a note to fields processors explaining that - per-field keywords processing isn't supported. -- #2871497 by drunken monkey: Fixed validation of "Whitespace characters" - setting for the Tokenizer processor. -- #2868704 by drunken monkey: Fixed old removed fields being present on query - object. -- #2863955 by alan-ps, drunken monkey, borisson_: Fixed unsupported processors - remaining enabled. -- #2870988 by sahilsharma011, c.nish2k3, kala4ek: Removed translations from all - tests. -- #2871030 by drunken monkey: Fixed error for cached aborted search queries in - Views. -- #2230935 by shkiper, drunken monkey: Added the "search-api-server-clear" - Drush command. - -Search API 1.0 (2017-04-26): ----------------------------- -- #2871145 by opdavies, drunken monkey, borisson_: Fixed link to php.net for - PCRE reference. -- #2543472 by drunken monkey: Fixed indexing of multiple indexes via Drush. -- #2871549 by drunken monkey: Added note about backwards compatibility to - README.txt. - -Search API 1.0, RC 4 (2017-04-21): ----------------------------------- -- #2869121 by drunken monkey: Fixed fatal error when required fulltext filter is - in exposed form block. - -Search API 1.0, RC 3 (2017-04-20): ----------------------------------- -- #2869121 by drunken monkey, Wim Leers, wouter.adem, borisson_: Added improved - "Required" handling for the Views "Fulltext search" filter. -- #2870782 by drunken monkey: Fixed the tests for Drupal 8.2. -- #2868851 by acbramley, drunken monkey: Fixed wrong interface used for loggers. -- #2868427 by dbjpanda, drunken monkey: Fixed use of d.o URL alias in - README.txt. - -Search API 1.0, RC 2 (2017-04-10): ----------------------------------- -- #2846932 by drunken monkey, killua99, borisson_: Fixed error when changing - boost values with a Postgres database backend. -- #2866454 by phenaproxima, drunken monkey: Fixed problems in update 8103. -- #2844945 by drunken monkey: Fixed uncaught exception when adding too many - fields. - -Search API 1.0, RC 1 (2017-04-09): ----------------------------------- -- #2776659 by drunken monkey, drholera: Removed the deprecated Utility methods. -- #2268809 by drunken monkey: Converted all arrays in the code to use the short - syntax. -- #2863736 by fran seva, drunken monkey: Added a setDataDefinition() method to - the Field class. -- #2867118 by drunken monkey: Fixed reported coding standards problems. -- #2839932 by drunken monkey, borisson_, bmcclure, jacktonkin: Fixed Views - problems with "Rendered item" fields. -- #2765317 by vasike: Added a "Last" aggregation for aggregated fields. -- #2861657 by drunken monkey: Removed remaining usages of "e.g.". - -Search API 1.0, Beta 5 (2017-04-02): ------------------------------------- -- #2842029 by vasike, drunken monkey: Added a "plugin helper" service for - creating index plugins. -- #2863253 by drunken monkey: Added hook infos for all our hooks. -- #2856050 by StryKaizer, drunken monkey, marthinal, borisson_: Added getPath() - to display plugins and deprecated getUrl(). -- #2856003 by borisson_, drunken monkey: Added "index" and "path" to search - display annotation definition. -- #2842557 by StryKaizer, Boobaa, drunken monkey, borisson_: Fixed "is rendered - on current page" checks for Views displays with contextual filters. -- #2855157 by dbjpanda: Fixed a small CSS error. -- #2842007 by shashank.mundhra: Fixed DB comment of search_api_item.status - column. -- #2682369 by Alumei, drunken monkey, swentel, Crell, stBorchert, prics, - borisson_: Fixed problems with overridden config entities. -- #2645882 by drunken monkey, borisson_: Fixed "items could not be indexed" - message for "Index now". -- #2641388 by mallezie, drunken monkey, borisson_, janusman: Added various UX - improvements for the "Fields" tab. -- #2861587 by alexpott: Fixed the DB/Defaults integration tests. -- #2855758 by StryKaizer, drunken monkey: Fixed "is rendered" checks for Views - block displays. -- #2855444 by drunken monkey: Added language-specific test for the "Rendered - item" processor. -- #2794295 by isramv, drunken monkey, alan-ps: Fixed default index indexing term - names instead of IDs. -- #2343161 by alan-ps, drunken monkey: Added per-datasource indexing stats. -- #2857017 by shkiper: Fixed copy-paste errors in js/index-active-formatters.js. -- #2311039 by drunken monkey: Fixed missing dependency injection for all form - and plugin classes. -- #2745655 by drunken monkey: Added test for (NOT) NULL conditions on fulltext - fields in DB backend. -- #2574889 by drunken monkey, ChristianAdamski: Added Tour module integration. -- #2814925 by kducharm, drunken monkey, Cyberwolf: Fixed indexing of computed - fields. -- #2852807 by alan-ps: Fixed CheckStyle warnings in this project. -- #2659868 by borisson_, drunken monkey: Fixed CacheabilityTest to make sure it - displays the rendered entities. -- #2853049 by Blanca.Esqueda: Fixed config schema error for Views date filters. -- #2847810 by JayKandari: Added Stemmer to ProcessorIntegrationTest. -- #2753667 by pfrenssen, drunken monkey, borisson_, idimopoulos, sandervd, - sardara: Improved Views cache plugins and their cache metadata. -- #2843854 by becw, drunken monkey: Fixed date filters in search views. -- #2753763 by drholera, drunken monkey: Added a logging trait which can also - log exceptions. -- #2850025 by alan-ps: Added a "label_collection" property for our entity types. -- #2851533 by drunken monkey: Adapted the tests to the latest Core changes. -- #2491175 by drunken monkey, ptmkenny: Added a new "Entity status" processor - to replace "Node status". -- #2681273 by drunken monkey, borisson_: Added plugin descriptions consistently - to the UI. -- #2642792 by drunken monkey: Fixed and expanded the RenderedItemTest. -- #2844527 by ayalon, drunken monkey: Added some contextual filters for Views. -- #2847307 by JayKandari, drunken monkey: Removed "Display" suffix from our - search display plugins. -- #2849507 by drunken monkey: Fixed test fails on Drupal 8.4. -- #2846255 by drunken monkey: Fixed displayed order of processors in UI. -- #2656916 by drunken monkey: Removed unused field dependency calculation - method. -- #2844192 by BR0kEN, drunken monkey: Fixed failure in DB backend when setting - field boost from 0 to other value. -- #2847588 by Nick_vh, drunken monkey: Improved the description of the - search_api_views_taxonomy module. -- #2843632 by beram, drunken monkey: Fixed "contains any" for Views fulltext - contextual filter. -- #2842971 by jespermb, borisson_: Fixed wrong URL for block search displays. -- #2842546 by alan-ps: Fixed Drush commands for enabling and disabling indexes. -- #2840675 by nicrodgers, drunken monkey: Added support for Views filters with - option lists. -- #2841550 by drunken monkey: Fixed execution of pending tasks. -- #2841827 by umed91, drunken monkey: Fixed some code style issues. -- #2682615 by drunken monkey: Added tests for object serialization and cloning. -- #2794879 by drunken monkey: Added property paths to the "Fields" tab. -- #2840261 by alan-ps: Fixed usage of outdated hash functions. - -Search API 1.0, Beta 4 (2016-10-24): ------------------------------------- -- #2839981 by borisson_, drunken monkey: Fixed search ID for non-page views. -- #2834350 by alan-ps: Fixed missing field restriction in DB backend - autocomplete code. -- #2809469 by StryKaizer, borisson_, drunken monkey, pfrenssen: Fixed - incompatible cache modes used for Search API views. -- #2839142 by borisson_, drunken monkey: Added new test for Defaults module - index creation. -- #2831436 by borisson_, drunken monkey: Added dependency information to - display plugins. -- #2836994 by dermario: Fixed order of facets in DB backend unreliable. -- #2839445 by borisson_: Fixed test failure in for some Core versions. -- #2833229 by timcosgrove: Removed array type hinting for batch contexts. -- #2656052 by drunken monkey: Removed the "plugin_id"/"settings" sub-level of - index plugin settings. -- #2837099 by drunken monkey: Fixed the tests in latest Drupal 8.3 dev version. -- #2709351 by drunken monkey: Fixed invalid processor configurations when field - configuration changes. -- #2829351 by SchnWalter, drunken monkey, borisson_: Fixed - $entity->search_api_skip_tracking for nodes. -- #2827961 by drunken monkey, Steven Jones: Fixed problems with giant scores in - DB backend. -- #2823985 by felribeiro, dermario, borisson_: Added an integration test for - the "Role filter" processor. -- #2832015 by mkalkbrenner: Removed translations from functional tests. -- #2828184 by ekes: Fixed bug in Stemmer config form validation. -- #2828848 by mkalkbrenner, drunken monkey, borisson_: Prepared IntegrationTest - to be executed with different backends. -- #2828148 by ekes, borisson_, drunken monkey: Fixed problem when stemming - multiple words at once. -- #2826822 by drunken monkey: Fixed use of illegal typed data type "text". -- #2826308 by drunken monkey, mkalkbrenner: Fixed unwanted filter in Views - tests. -- #2734897 by niko-, drunken monkey: Added tests for preIndexSave() - implementations. -- #2650364 by drunken monkey: Added a "skip access checks" option to the Views - relationship plugin. -- #2826160 by keboca, drunken monkey: Fixed config form of "Role filter" - processor to be more robust. -- #2753815 by niko-, drunken monkey, itsekhmistro, borisson_: Ported Simpletest - web tests to BrowserTestBase tests. -- #2358065 by tstoeckler: Added the option for highlighting of partial matches - to the processor. -- #2470837 by sinn, drunken monkey: Added documentation on why to disable Core - Search. -- #2767609 by drunken monkey, borisson_: Added backend tests for empty value - conditions. -- #2789431 by phenaproxima, drunken monkey: Added possibility to display - processor-generated fields in Views. -- #2822553 by niko-: Removed a test assertion that failed when run via GUI. -- #2821445 by drunken monkey: Fixed warning in HTML filter for non-HTML fields. -- #2733185 by sinn, drunken monkey: Added documentation and tests for tracker - and display plugin alter hooks. -- #2824326 by Jo Fitzgerald: Fixed generated autocomplete suggestions of the DB - backend. -- #2824932 by mkalkbrenner: Fixed incorrect indexing call in backend tests. -- #2821498 by stBorchert: Increased our required minimum Core version to 8.2. -- #2816979 by drunken monkey: Added click-sorting for indexed fields in Views. -- #2779159 by mark_fullmer, drunken monkey, borisson_: Added a Stemmer - processor. -- #2799497 by drunken monkey: Added a getter for the Views query's "where" - property. -- #2574583 by drunken monkey: Fixed loading of entities from excluded bundles. -- #2795861 by sinn: Removed some deprecated methods. -- #2748323 by sinn: Fixed comment reference to removed method - alterPropertyDefinitions(). -- #2809753 by drunken monkey: Fixed issues with multiple OR facets. -- #2821955 by mkalkbrenner: Adapted processor test base for use with other - backends. -- #2819637 by alan-ps: Renamed use of the DB layer rollback() method to - rollBack(). - -Search API 1.0, Beta 3 (2016-10-24): ------------------------------------- -- #2625152 by jhedstrom, drunken monkey, borisson_, mpp, stijn.blomme, - Rodlangh: Added an "Index hierarchy" processor. -- #2818621 by alan-ps: Fixed overly accurate index status percentage. -- #2792277 by drunken monkey: Fixed issues during config syncing of our - entities. -- #2813525 by drunken monkey, alan-ps: Fixed incorrect indexing of - nodes/comments with excluded bundle. -- #2803701 by drunken monkey, rbayliss: Fixed strict warnings from - UnsavedConfigurationFormTrait. -- #2711017 by drunken monkey: Adapted Core's UncacheableDependencyTrait. -- #2690229 by drunken monkey: Adapted Core's SubformState solution. -- #2575641 by rbayliss, dazz, drunken monkey: Fixed behavior of "Save and edit" - button for indexes. -- #2769021 by drunken monkey: Added the generated Search API query to the Views - preview. -- #2817341 by mkalkbrenner, drunken monkey: Added PluginDependencyTrait to - ConfigurablePluginBase. -- #2809211 by cristiroma: Fixed size of text fields on "Fields" tab. -- #2684465 by Dropa, david.gil, drunken monkey: Fixed indexing of - non-translated entity references. -- #2695627 by dermario, drunken monkey: Added support for (NOT) IN and (NOT) - BETWEEN operators to Views. -- #2782577 by drunken monkey, zuhair_ak: Fixed extraction of configurable - properties in processors. - -Search API 1.0, Beta 2 (2016-09-28): ------------------------------------- -- #2798643 by drunken monkey, Berdir: Fixed handling of enforced dependencies - for search indexes. -- #2799475 by borisson_, drunken monkey: Added support for Views block and REST - displays in the Views search display deriver. -- #2763161 by drunken monkey, borisson_: Fixed cache issues with Views search - display plugins. -- #2800011 by drunken monkey, borisson_: Fixed display of hidden properties - when adding fields. -- #2794093 by drunken monkey, borisson_, kamalrajsahu21: Fixed the processor - reordering CSS. -- #2640982 by drunken monkey, borisson_: Fixed "unsaved changes" code in the - Fields UI. -- #2727697 by drunken monkey, borisson_: Fixed serialization of modified - indexes. -- #2747767 by joachim: Changed the "Aggregation type" form element to radios. -- #2565621 by LKS90, drunken monkey: Added a test for the database defaults - submodule. -- #2684465 by drunken monkey, marthinal: Fixed indexing of related entities on - multilingual sites. -- #2566241 by drunken monkey: Fixed index tracker select default value. -- #2555177 by drunken monkey: Fixed empty bundle selects in datasource config - forms. - -Search API 1.0, Beta 1 (2016-09-05): ------------------------------------- -First Beta release of the project's Drupal 8 version. The API can be considered -mostly stable and an upgrade path will be provided for all data structure -changes from this point forward. diff --git a/sites/all/modules/contrib/search/search_api/LICENSE.txt b/sites/all/modules/contrib/search/search_api/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/search/search_api/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/search/search_api/README.txt b/sites/all/modules/contrib/search/search_api/README.txt deleted file mode 100644 index 21198bc18..000000000 --- a/sites/all/modules/contrib/search/search_api/README.txt +++ /dev/null @@ -1,138 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - * Introduction - * Requirements - * Installation - * Configuration - * Developers - * Maintainers - -INTRODUCTION ------------- -This module provides a framework for easily creating searches on any entity -known to Drupal, using any kind of search engine. For site administrators, -it is a great alternative to other search solutions, since it already -incorporates faceting support (with [1]) and the ability to use the Views module -for displaying search results, filters, etc. Also, with the Apache Solr -integration [2], a high-performance search engine is available for this module. - -[1] https://www.drupal.org/project/facets -[2] https://www.drupal.org/project/search_api_solr - -Developers, on the other hand, will be impressed by the large flexibility and -numerous ways of extension the module provides. Hence, the growing number of -additional contrib modules, providing additional functionality or helping users -customize some aspects of the search process. - * For a full description of the module, visit the project page: - https://www.drupal.org/project/search_api - * To submit bug reports and feature suggestions, or to track changes: - https://www.drupal.org/project/issues/search_api - -REQUIREMENTS ------------- -No other modules are required. - -INSTALLATION ------------- -Install as you would normally install a contributed Drupal module. For further -information, see: - https://www.drupal.org/docs/8/extending-drupal-8/installing-modules - -CONFIGURATION -------------- -After installation, for a quick start, just install the "Database Search -Defaults" module provided with this project. This will automatically set up a -search view for node content, using a database server for indexing. - -Otherwise, you need to enable at least a module providing integration with a -search backend (like database, Solr, Elasticsearch, …). Possible options are -listed at [3]. - -Then, go to - /admin/config/search/search-api -on your site and create a search server and search index. Afterwards, you can -create a view based on your index to enable users to search the content you -configured to be indexed. More details are available online in the handbook [4]. -There, you can also find answers to frequently asked questions and common -pitfalls to avoid. - -[3] https://www.drupal.org/docs/8/modules/search-api/getting-started/server-backends-and-features -[4] https://www.drupal.org/docs/8/modules/search-api/getting-started - -DEVELOPERS ----------- - -The Search API provides a lot of ways for developers to extend or customize the -framework. - -- Hooks - All available hooks are listed in search_api.api.php. -- Events - Currently, only the Search API's task system (for reliably executing necessary - system tasks) makes use of events. Every time a task is executed, an event - will be fired based on the task's type and the sub-system that scheduled the - task is responsible for reacting to it. This system is extensible and can - therefore also easily be used by contrib modules based on the Search API. For - details, see the description of the \Drupal\search_api\Task\TaskManager class, - and the other classes in src/Task for examples. -- Plugins - The Search API defines several plugin types, all listed in its - search_api.plugin_type.yml file. Here is a list of them, along with the - directory in which you can find there definition files (interface, plugin base - and plugin manager): - - Backends: src/Backend - - Datasources: src/Datasource - - Data types: src/DataType - - Displays: src/Display - - Parse modes: src/ParseMode - - Processors: src/Processor - - Trackers: src/Tracker - The display plugins are a bit of a special case there, because they aren't - really "extending" the framework, but are rather a way of telling the Search - API (and all modules integrating with it) about search pages your module - defines. They can then be used to provide, for example, faceting support for - those pages. Therefore, if your module provides any search pages, it's a good - idea to provide display plugins for them. For an example (for Views pages), - see \Drupal\search_api\Plugin\search_api\display\ViewsPage. - -The handbook documentation for developers is available at [5]. - -[5] https://www.drupal.org/docs/8/modules/search-api/developer-documentation - -To know which parts of the module can be relied upon as its public API, please -read the "Drupal 8 backwards compatibility and internal API policy" [6] and the -module's issue regarding potential module-specific changes to that policy [7]. - -[6] https://www.drupal.org/core/d8-bc-policy -[7] https://www.drupal.org/node/2871549 - -SERVER BACKEND FEATURES ------------------------ - -Server backend features are a way for other contrib modules to cleanly define -ways in which the Search API can be extended. For more information, see [8]. - -[8] https://www.drupal.org/docs/8/modules/search-api/getting-started/server-backends-and-features - -The Search API module itself currently defines one feature: - -- More Like This (search_api_mlt) - This feature can be used to retrieve a list of search results that are similar - to a given indexed item. A backend that supports this plugin has to recognize - the "search_api_mlt" query option. If present, it contains an associative - array with the following keys: - - id: The Search API item ID (consisting of the datasource ID and the - datasource-specific item ID – passing a plain entity ID will NOT work!) of - the item for which similar results should be found. - - fields: A simple array of fields which should be used for determining - similarity. Backends can choose to ignore this field. - - "field boosts": (optional) An associative array mapping fields to a numeric - "boost" value that determines how important they should be considered when - determining similarity. Backends can choose to ignore this field. - The feature can be used in the UI via the "More like this" Views contextual - filter. - -MAINTAINERS ------------ -Current maintainers: - * Thomas Seidl (drunken monkey) - https://www.drupal.org/u/drunken-monkey diff --git a/sites/all/modules/contrib/search/search_api/composer.json b/sites/all/modules/contrib/search/search_api/composer.json deleted file mode 100644 index effce8170..000000000 --- a/sites/all/modules/contrib/search/search_api/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "drupal/search_api", - "description": "Provides a generic framework for modules offering search capabilities.", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/search_api", - "authors": [ - { - "name": "Thomas Seidl", - "homepage": "https://www.drupal.org/u/drunken-monkey" - }, - { - "name": "Nick Veenhof", - "homepage": "https://www.drupal.org/u/nick_vh" - }, - { - "name": "See other contributors", - "homepage":"https://www.drupal.org/node/790418/committers" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/search_api", - "irc": "irc://irc.freenode.org/drupal-search-api", - "source": "http://git.drupal.org/project/search_api.git" - }, - "license": "GPL-2.0+", - "require-dev": { - "drupal/search_api_autocomplete": "@dev" - }, - "suggest": { - "drupal/facets": "Adds the ability to create faceted searches.", - "drupal/search_api_autocomplete": "Allows adding autocomplete suggestions to search fields.", - "drupal/search_api_solr": "Adds support for using Apache Solr as a backend." - }, - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/search/search_api/config/install/search_api.settings.yml b/sites/all/modules/contrib/search/search_api/config/install/search_api.settings.yml deleted file mode 100644 index 3d5fe5e8c..000000000 --- a/sites/all/modules/contrib/search/search_api/config/install/search_api.settings.yml +++ /dev/null @@ -1,4 +0,0 @@ -default_cron_limit: 50 -cron_worker_runtime: 15 -default_tracker: 'default' -tracking_page_size: 100 diff --git a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-fields.yml b/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-fields.yml deleted file mode 100644 index e98680a04..000000000 --- a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-fields.yml +++ /dev/null @@ -1,96 +0,0 @@ -id: search-api-index-fields -module: search_api -label: Fields indexed in this index -langcode: en -routes: - - route_name: entity.search_api_index.fields -dependencies: - module: - - search_api -tips: - search-api-index-fields-introduction: - id: search-api-index-fields-introduction - plugin: text - label: Fields indexed in this index - body: This page lists which fields are indexed in this index, grouped by datasource. (Datasource-independent fields are listed under "General".) Indexed fields can be used to add filters or sorting to views or other search displays based on the index. Fields with type "Fulltext" can also be used for fulltext searching. - weight: 1 - search-api-index-fields-add: - id: search-api-index-fields-add - plugin: text - label: Add fields - body: With the "Add fields" button you can add additional fields to this index. - weight: 2 - attributes: - data-class: button-action[data-drupal-selector="edit-add-field"] - search-api-index-fields-label: - id: search-api-index-fields-label - plugin: text - label: Label - body: A label for the field that will be used to refer to the field in most places in the user interface. - weight: 3 - attributes: - data-class: details-wrapper:nth(0) table thead th:nth(0) - search-api-index-fields-machine-name: - id: search-api-index-fields-machine-name - plugin: text - label: Machine name - body: The internal ID to use for this field. Can safely be ignored by inexperienced users in most cases. Changing a field's machine name requires reindexing of the index. - weight: 4 - attributes: - data-class: details-wrapper:nth(0) table thead th:nth(1) - search-api-index-fields-property-path: - id: search-api-index-fields-property-path - plugin: text - label: Property path - body: The internal relationship linking the indexed item to the field, with links being separated by colons (:). This can be useful information for advanced users, but can otherwise be ignored. - weight: 5 - attributes: - data-class: details-wrapper:nth(0) table thead th:nth(2) - search-api-index-fields-type: - id: search-api-index-fields-type - plugin: text - label: Type - body: The data type to use when indexing the field. Determines how a field can be used in searches. For information on the available types, see the "Data types" box at the bottom of the page. - weight: 6 - attributes: - data-class: details-wrapper:nth(0) table thead th:nth(3) - search-api-index-fields-boost: - id: search-api-index-fields-boost - plugin: text - label: Boost - body: Only applicable for fulltext fields. Determines how "important" the field is compared to other fulltext fields, to influence scoring of fulltext searches. - weight: 7 - attributes: - data-class: details-wrapper:nth(0) table thead th:nth(4) - search-api-index-fields-edit: - id: search-api-index-fields-edit - plugin: text - label: Edit field - body: Some fields have additional configuration available, in which case an "Edit" link is displayed in the "Operations" column. - weight: 8 - attributes: - data-class: details-wrapper:nth(0) table tbody td:nth(5) a - search-api-index-fields-remove: - id: search-api-index-fields-remove - plugin: text - label: Remove field - body: "Removes a field from the index again. (Note: Sometimes, a field is required (for example, by a processor) and cannot be removed.)" - weight: 9 - attributes: - data-class: details-wrapper:nth(0) table tbody td:nth(6) a - search-api-index-fields-submit: - id: search-api-index-fields-submit - plugin: text - label: Save changes - body: This saves all changes made to the fields for this index. Until this button is pressed, all added, changed or removed fields will only be stored temporarily and not effect the actual index used in the rest of the site. - weight: 10 - attributes: - data-id: edit-actions-submit - search-api-index-fields-cancel: - id: search-api-index-fields-cancel - plugin: text - label: Cancel changes - body: If you have made changes to the index's fields but not yet saved them, the "Cancel" link lets you discard those changes. - weight: 10 - attributes: - data-id: edit-actions-cancel diff --git a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-form.yml b/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-form.yml deleted file mode 100644 index 8669147aa..000000000 --- a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-form.yml +++ /dev/null @@ -1,65 +0,0 @@ -id: search-api-index-form -module: search_api -label: 'Add or edit a Search API index' -langcode: en -routes: - - route_name: entity.search_api_index.add_form - - route_name: entity.search_api_index.edit_form -dependencies: - module: - - search_api -tips: - search-api-index-form-introduction: - id: search-api-index-form-introduction - plugin: text - label: Adding or editing an index - body: This form can be used to edit an existing index or add a new index to your site. Indexes define a set of data that will be indexed and can then be searched. - weight: 1 - search-api-index-form-name: - id: search-api-index-form-name - plugin: text - label: Index name - body: Enter a name to identify this index. For example, "Content index". This will only be displayed in the admin user interface. - weight: 2 - attributes: - data-id: edit-name - search-api-index-form-datasources: - id: search-api-index-form-datasources - plugin: text - label: Datasources - body: Datasources define the types of items that will be indexed in this index. By default, all content entities (like content, comments and taxonomy terms) will be available here, but modules can also add their own. - weight: 3 - attributes: - data-id: edit-datasources - search-api-index-form-tracker: - id: search-api-index-form-tracker - plugin: text - label: Tracker - body: An index's tracker is the system that keeps track of which items there are available for the index, and which of them still need to be indexed. Changing the tracker of an existing index will lead to reindexing of all items. - weight: 4 - attributes: - data-id: edit-tracker - search-api-index-form-server: - id: search-api-index-form-server - plugin: text - label: Server - body: The search server that the index should use for indexing and searching. If no server is selected here, the index cannot be enabled. An index can only have one server, but a server can have any number of indexes. - weight: 5 - attributes: - data-id: edit-server - search-api-index-form-description: - id: search-api-index-form-description - plugin: text - label: Index description - body: Optionally, enter a description to explain the function of the index in more detail. This will only be displayed in the admin user interface. - weight: 6 - attributes: - data-id: edit-description - search-api-index-form-options: - id: search-api-index-form-options - plugin: text - label: Advanced options - body: These options allow more detailed configuration of index behavior, but can usually safely be ignored by inexperienced users. - weight: 7 - attributes: - data-id: edit-options diff --git a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-processors.yml b/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-processors.yml deleted file mode 100644 index 008b5db54..000000000 --- a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index-processors.yml +++ /dev/null @@ -1,40 +0,0 @@ -id: search-api-index-processors -module: search_api -label: Processors used for this index -langcode: en -routes: - - route_name: entity.search_api_index.processors -dependencies: - module: - - search_api -tips: - search-api-index-processors-introduction: - id: search-api-index-processors-introduction - plugin: text - label: Processors used for this index - body: Processors customize different aspects of an index's functionality. They can keep items from being indexed, change how certain fields are indexed and influence searches. - weight: 1 - search-api-index-processors-enable: - id: search-api-index-processors-enable - plugin: text - label: Enable processors - body: "This lists all processors available for this index and lets you choose the ones that should be active. (Note: Some processors cannot be disabled.)" - weight: 2 - attributes: - data-id: edit-status - search-api-index-processors-weights: - id: search-api-index-processors-weights - plugin: text - label: Processor order - body: This shows you which enabled processors will be active in the different parts of the indexing/searching workflow, and lets you re-arrange them. This should usually not be necessary, and only be used by advanced users as some processors will lead to unexpected results when used in the wrong order. - weight: 3 - attributes: - data-id: edit-weights - search-api-index-processors-settings: - id: search-api-index-processors-settings - plugin: text - label: Processor settings - body: Some processors have additional configuration available, which you are able to change here. - weight: 4 - attributes: - data-class: form-type-vertical-tabs diff --git a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index.yml b/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index.yml deleted file mode 100644 index bc207ddad..000000000 --- a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-index.yml +++ /dev/null @@ -1,104 +0,0 @@ -id: search-api-index -module: search_api -label: Information about an index -langcode: en -routes: - - route_name: entity.search_api_index.canonical -dependencies: - module: - - search_api -tips: - search-api-index-introduction: - id: search-api-index-introduction - plugin: text - label: Information about an index - body: This page shows a summary of a search index and its status. - weight: 1 - search-api-index-index-status: - id: search-api-index-index-status - plugin: text - label: Index status - body: This gives a summary about how many items are known for this index, and how many have been indexed in their latest version. Items that are not indexed yet cannot be found by searches. - weight: 2 - attributes: - data-class: search-api-index-status - search-api-index-status: - id: search-api-index-status - plugin: text - label: Status - body: Shows whether the index is currently enabled or disabled. - weight: 3 - attributes: - data-class: search-api-index-summary--status - search-api-index-datasources: - id: search-api-index-datasources - plugin: text - label: Datasources - body: Lists all datasources that are enabled for this index. - weight: 4 - attributes: - data-class: search-api-index-summary--datasource - search-api-index-tracker: - id: search-api-index-tracker - plugin: text - label: Tracker - body: The tracker used by the index. Only one ("Default") is available by default. - weight: 5 - attributes: - data-class: search-api-index-summary--tracker - search-api-index-server: - id: search-api-index-server - plugin: text - label: Server - body: If the index is attached to a server, this server is listed here. - weight: 6 - attributes: - data-class: search-api-index-summary--server - search-api-index-server-index-status: - id: search-api-index-server-index-status - plugin: text - label: Server index status - body: For enabled indexes, the number of items that can actually be retrieved from the server is listed here. For reasons why this number might differ from the number under "Index status", see the module's documentation. - weight: 7 - attributes: - data-class: search-api-index-summary--server-index-status - search-api-index-cron-batch-size: - id: search-api-index-cron-batch-size - plugin: text - label: Cron batch size - body: The number of items that will be indexed at once during cron runs. - weight: 8 - attributes: - data-class: search-api-index-summary--cron-batch-size - search-api-index-index-now: - id: search-api-index-remove - plugin: text - label: Start indexing now - body: The "Start indexing now" form allows indexing items manually right away, with a batch process. Otherwise, items are only indexed during cron runs. The form might be disabled if indexing is currently not possible for some reason, or not necessary. - weight: 9 - attributes: - data-id: edit-index - search-api-index-tracking: - id: search-api-index-tracking - plugin: text - label: Track items for index - body: In certain situations, the index's tracker doesn't have the latest state of the items available for indexing. This will be automatically rectified during cron runs, but can also be manually triggered here, with the "Track now" button. - weight: 10 - attributes: - data-id: edit-tracking - search-api-index-reindex: - id: search-api-index-reindex - plugin: text - label: Queue all items for reindexing - body: This will queue all items on this index for reindexing. Previously indexed data will remain on the search server, so searches on this index will continue to yield results. - weight: 11 - attributes: - data-id: edit-reindex - search-api-index-clear: - id: search-api-index-clear - plugin: text - label: Clear all indexed data - body: This will remove all indexed content for this index from the search server and queue it for reindexing. Searches on this index will not return any results until items are reindexed. - weight: 12 - attributes: - data-id: edit-clear diff --git a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server-form.yml b/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server-form.yml deleted file mode 100644 index 840aeca44..000000000 --- a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server-form.yml +++ /dev/null @@ -1,41 +0,0 @@ -id: search-api-server-form -module: search_api -label: 'Add or edit a Search API server' -langcode: en -routes: - - route_name: entity.search_api_server.add_form - - route_name: entity.search_api_server.edit_form -dependencies: - module: - - search_api -tips: - search-api-server-form-introduction: - id: search-api-server-form-introduction - plugin: text - label: Adding or editing a Server - body: This form can be used to edit an existing server or add a new server to your site. Servers will hold your indexed data. - weight: 1 - search-api-server-form-name: - id: search-api-server-form-name - plugin: text - label: Server name - body: Enter a name to identify this server. For example, "Solr server". This will only be displayed in the admin user interface. - weight: 2 - attributes: - data-id: edit-name - search-api-server-form-description: - id: search-api-server-form-description - plugin: text - label: Server description - body: Optionally, enter a description to explain the function of the server in more detail. This will only be displayed in the admin user interface. - weight: 3 - attributes: - data-id: edit-description - search-api-server-form-backend: - id: search-api-server-form-backend - plugin: text - label: Server backend - body: Servers can be based on different technologies. These are called "backends". A server uses exactly one backend and cannot change it later. You can make the "Database" backend available by enabling the "Database Search" module. Another very common backend is "Solr", which requires to be set up separately. - weight: 4 - attributes: - data-id: edit-backend diff --git a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server.yml b/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server.yml deleted file mode 100644 index 4c9db8c1b..000000000 --- a/sites/all/modules/contrib/search/search_api/config/optional/tour.tour.search-api-server.yml +++ /dev/null @@ -1,48 +0,0 @@ -id: search-api-server -module: search_api -label: Information about a server -langcode: en -routes: - - route_name: entity.search_api_server.canonical -dependencies: - module: - - search_api -tips: - search-api-server-introduction: - id: search-api-server-introduction - plugin: text - label: Information about a server - body: This page shows a summary of a search server. - weight: 1 - search-api-server-status: - id: search-api-server-status - plugin: text - label: Status - body: Shows whether the server is currently enabled or disabled. - weight: 2 - attributes: - data-class: search-api-server-summary--status - search-api-server-backend: - id: search-api-server-backend - plugin: text - label: Backend class - body: The backend plugin used for this server. The backend plugin determines how items are indexed and searched – for example, using the database or an Apache Solr server. - weight: 3 - attributes: - data-class: search-api-server-summary--backend - search-api-server-indexes: - id: search-api-server-indexes - plugin: text - label: Search indexes - body: Lists all search indexes that are attached to this server. - weight: 4 - attributes: - data-class: search-api-server-summary--indexes - search-api-server-clear: - id: search-api-server-clear - plugin: text - label: Delete all indexed data - body: This will permanently remove all data currently indexed on this server for indexes that aren't read-only. Items are queued for reindexing. Until reindexing occurs, searches for the affected indexes will not return any results. - weight: 5 - attributes: - data-id: edit-clear diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.datasource.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.datasource.schema.yml deleted file mode 100644 index 42590ed35..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.datasource.schema.yml +++ /dev/null @@ -1,32 +0,0 @@ -"plugin.plugin_configuration.search_api_datasource.entity:*": - type: mapping - label: 'Entity datasource configuration' - mapping: - bundles: - type: mapping - label: 'Bundles' - mapping: - default: - type: boolean - label: 'Whether to exclude (TRUE) or include (FALSE) the selected bundles.' - selected: - type: sequence - label: 'The selected bundles' - orderby: value - sequence: - type: string - label: 'A bundle machine name' - languages: - type: mapping - label: 'Languages' - mapping: - default: - type: boolean - label: 'Whether to exclude (TRUE) or include (FALSE) the selected languages.' - selected: - type: sequence - label: 'The selected languages' - orderby: value - sequence: - type: string - label: 'A language code' diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.index.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.index.schema.yml deleted file mode 100644 index 8e519eb0f..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.index.schema.yml +++ /dev/null @@ -1,96 +0,0 @@ -search_api.index.*: - type: config_entity - label : 'Search index' - mapping: - id: - type: string - label: 'ID' - name: - type: label - label: Name' - description: - type: text - label: 'Description' - read_only: - type: boolean - label: 'Read-only' - field_settings: - type: sequence - label: 'Indexed fields' - orderby: key - sequence: - type: mapping - label: field - mapping: - label: - type: string - label: 'A label for the field' - datasource_id: - type: string - label: 'The datasource ID of the field' - property_path: - type: string - label: 'The property path of the field' - type: - type: string - label: 'The data type of the field' - boost: - type: float - label: 'The boost of the field' - configuration: - type: search_api.property_configuration.[%parent.property_path] - indexed_locked: - type: boolean - label: 'Whether the field is locked or can be removed' - type_locked: - type: boolean - label: 'Whether the field''s data type is locked or can be changed' - hidden: - type: boolean - label: 'Whether the field should appear in the UI' - dependencies: - type: config_dependencies - label: 'The field''s dependencies' - datasource_settings: - type: sequence - label: 'Datasource settings' - orderby: key - sequence: - type: plugin.plugin_configuration.search_api_datasource.[%key] - label: 'The configuration for a single datasource' - processor_settings: - type: sequence - label: 'Processor settings' - orderby: key - sequence: - type: plugin.plugin_configuration.search_api_processor.[%key] - label: 'The configuration for a single processor' - tracker_settings: - type: sequence - label: 'Tracker settings' - orderby: key - sequence: - type: plugin.plugin_configuration.search_api_tracker.[%key] - label: 'The configuration for the tracker' - options: - type: mapping - label: 'Options' - mapping: - cron_limit: - type: integer - label: 'Cron batch size' - index_directly: - type: boolean - label: 'Index items immediately' - server: - type: string - label: 'Server ID' - status: - type: boolean - label: 'Status' - langcode: - type: string - label: 'Language code' - dependencies: - type: config_dependencies - label: 'Dependencies' diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.processor.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.processor.schema.yml deleted file mode 100644 index 0c98ad8a2..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.processor.schema.yml +++ /dev/null @@ -1,245 +0,0 @@ -# Base definitions for processors - -search_api.default_processor_configuration: - type: mapping - label: 'Default processor configuration' - mapping: - weights: - type: sequence - label: 'The processor''s weights for the different processing stages' - orderby: key - sequence: - type: integer - label: 'The processor''s weight for this stage' - -search_api.fields_processor_configuration: - type: search_api.default_processor_configuration - label: 'Fields processor configuration' - mapping: - all_fields: - type: boolean - label: 'Enabled for all supported fields' - fields: - type: sequence - label: 'The selected fields' - orderby: value - sequence: - type: string - label: 'Selected field' - -# Default for any processor without specific configuration -plugin.plugin_configuration.search_api_processor.*: - type: search_api.default_processor_configuration - -# Definitions for individual processors - -plugin.plugin_configuration.search_api_processor.hierarchy: - type: search_api.default_processor_configuration - label: 'Hierarchy processor configuration' - mapping: - fields: - type: sequence - label: 'Fields for which to add the hierarchy, mapped to their hierarchical nested property' - orderby: key - sequence: - type: string - label: 'Field ID' - -plugin.plugin_configuration.search_api_processor.highlight: - type: search_api.default_processor_configuration - label: 'Highlight processor configuration' - mapping: - prefix: - type: string - label: 'Text/HTML that will be prepended to all occurrences of search keywords in highlighted text' - suffix: - type: string - label: 'Text/HTML that will be appended to all occurrences of search keywords in highlighted text' - excerpt: - type: boolean - label: 'When enabled, an excerpt will be created for searches with keywords, containing all occurrences of keywords in a fulltext field.' - excerpt_length: - type: integer - label: 'The requested length of the excerpt, in characters' - exclude_fields: - type: sequence - label: 'Fields excluded from excerpt' - orderby: value - sequence: - type: string - label: 'An excluded field''s ID' - highlight: - type: string - label: 'Defines whether returned fields should be highlighted (always/if returned/never).' - highlight_partial: - type: boolean - label: 'Whether matches in parts of words should be highlighted' - -plugin.plugin_configuration.search_api_processor.html_filter: - type: search_api.fields_processor_configuration - label: 'HTML filter processor configuration' - mapping: - title: - type: boolean - label: 'Title' - alt: - type: boolean - label: 'Alt' - tags: - type: sequence - label: 'Tag boosts' - orderby: key - sequence: - type: integer - label: Boost - -plugin.plugin_configuration.search_api_processor.ignorecase: - type: search_api.fields_processor_configuration - label: 'Ignore case processor configuration' - -plugin.plugin_configuration.search_api_processor.ignore_character: - type: search_api.fields_processor_configuration - label: 'Ignore Character processor configuration' - mapping: - ignorable: - type: string - label: 'Regular expression for characters it should ignore to stem' - strip: - type: mapping - label: 'Configurable characters to ignore' - mapping: - character_sets: - type: sequence - label: 'Configuration of the character sets' - orderby: key - sequence: - type: ignore - label: 'Character set' - -plugin.plugin_configuration.search_api_processor.stemmer: - type: search_api.fields_processor_configuration - label: 'Stemmer processor configuration' - mapping: - exceptions: - type: sequence - label: 'Stemming exceptions' - orderby: key - sequence: - type: string - label: Exception - -plugin.plugin_configuration.search_api_processor.role_filter: - type: search_api.default_processor_configuration - label: 'Role filter processor configuration' - mapping: - default: - type: boolean - label: 'Default' - roles: - type: sequence - label: 'The selected roles' - orderby: value - sequence: - type: string - label: 'The role name' - -plugin.plugin_configuration.search_api_processor.stopwords: - type: search_api.fields_processor_configuration - label: 'Stopwords processor configuration' - mapping: - stopwords: - type: sequence - label: 'Entered stopwords' - orderby: value - sequence: - type: string - label: Stopword - -plugin.plugin_configuration.search_api_processor.tokenizer: - type: search_api.fields_processor_configuration - label: 'Tokenizer processor configuration' - mapping: - spaces: - type: string - label: 'Regular expression for spaces' - ignorable: - type: string - label: 'Regular expression for ignorable characters' - overlap_cjk: - type: integer - label: 'Defines if simple CJK handling should be enabled.' - minimum_word_size: - type: string - label: 'Defines the minimum word size' - -plugin.plugin_configuration.search_api_processor.transliteration: - type: search_api.fields_processor_configuration - label: 'Transliteration processor configuration' - -plugin.plugin_configuration.search_api_processor.type_boost: - type: search_api.default_processor_configuration - label: 'Type-specific boosting processor configuration' - mapping: - boosts: - type: sequence - label: 'Boost settings' - orderby: key - sequence: - type: mapping - label: 'Datasource boost settings' - mapping: - datasource_boost: - type: float - label: 'Base boost for the datasource' - bundle_boosts: - type: sequence - label: 'Bundle-specific boosts' - orderby: key - sequence: - type: float - label: 'The boost value for this bundle' - -# Definitions for property configuration - -search_api.property_configuration.*: - type: mapping - label: 'Default field configuration' - mapping: {} - -search_api.property_configuration.aggregated_field: - type: mapping - label: 'Aggregated field configuration' - mapping: - type: - type: string - label: 'The type of the aggregation' - fields: - type: sequence - label: 'The properties to be aggregated' - orderby: value - sequence: - type: string - label: 'A property that should be part of the aggregation' - -search_api.property_configuration.rendered_item: - type: mapping - label: 'Rendered item processor configuration' - mapping: - roles: - type: sequence - label: 'The selected roles' - orderby: key - sequence: - type: string - label: 'The user roles which will be active when the entity is rendered' - view_mode: - type: sequence - label: 'The selected view modes for each datasource, by bundle' - orderby: key - sequence: - type: sequence - label: 'The selected view modes for the datasource, by bundle' - orderby: key - sequence: - type: string - label: 'The view mode used to render the entity for the specified bundle' diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.schema.yml deleted file mode 100644 index bfbdf2246..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.schema.yml +++ /dev/null @@ -1,16 +0,0 @@ -search_api.settings: - type: config_object - label: 'Search API settings' - mapping: - default_cron_limit: - type: integer - label: 'Default cron batch size' - cron_worker_runtime: - type: integer - label: 'Maximum runtime for the cron worker' - default_tracker: - type: string - label: 'The default tracker plugin' - tracking_page_size: - type: integer - label: 'The number of entities loaded at once when adding items to the tracker for a newly created index' diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.server.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.server.schema.yml deleted file mode 100644 index 99cafafcd..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.server.schema.yml +++ /dev/null @@ -1,30 +0,0 @@ -search_api.server.*: - type: config_entity - label : 'Search server' - mapping: - id: - type: string - label: 'ID' - name: - type: label - label: 'Name' - description: - type: text - label: 'Description' - status: - type: boolean - label: 'Status' - backend: - type: string - label: 'Backend Plugin ID' - backend_config: - type: plugin.plugin_configuration.search_api_backend.[%parent.backend] - langcode: - type: string - label: 'Language code' - dependencies: - type: config_dependencies - label: 'Dependencies' - -plugin.plugin_configuration.search_api_backend.*: - type: mapping diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.tracker.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.tracker.schema.yml deleted file mode 100644 index 3af3715dc..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.tracker.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -plugin.plugin_configuration.search_api_tracker.default: - type: mapping - label: 'Entity tracker configuration' - mapping: - indexing_order: - type: string - label: 'Indexing order' diff --git a/sites/all/modules/contrib/search/search_api/config/schema/search_api.views.schema.yml b/sites/all/modules/contrib/search/search_api/config/schema/search_api.views.schema.yml deleted file mode 100644 index 80cb7c407..000000000 --- a/sites/all/modules/contrib/search/search_api/config/schema/search_api.views.schema.yml +++ /dev/null @@ -1,308 +0,0 @@ -views.query.search_api_query: - type: views_query - label: 'Search API query' - mapping: - bypass_access: - type: boolean - label: If the underlying search index has access checks enabled, this option allows you to disable them for this view. - skip_access: - type: boolean - label: Do not execute additional access checks for all items in the search results. - -views.row.search_api: - type: views_row - label: 'Search API rendered item' - mapping: - view_modes: - type: sequence - label: View modes for each datasource - orderby: key - sequence: - type: sequence - label: A list of all the bundles and their configured view mode - orderby: key - sequence: - type: string - label: View mode for the specific bundle - -views.cache.search_api_time: - type: views_cache - label: 'Time-based caching (Search API)' - mapping: - options: - type: mapping - label: 'Cache options' - mapping: - results_lifespan: - type: integer - label: 'The length of time raw query results should be cached.' - results_lifespan_custom: - type: integer - label: 'Length of time in seconds raw query results should be cached.' - output_lifespan: - type: integer - label: 'The length of time rendered HTML output should be cached.' - output_lifespan_custom: - type: integer - label: 'Length of time in seconds rendered HTML output should be cached.' - -views.cache.search_api_tag: - type: views_cache - label: 'Tag-based caching (Search API)' - mapping: - options: - type: mapping - label: 'Cache options' - - -views.argument.search_api: - type: views.argument.numeric - label: 'Search API' - -views.argument.search_api_fulltext: - type: views.argument.search_api - label: 'Search API more like this' - mapping: - parse_mode: - type: string - label: 'Parse mode' - conjunction: - type: string - label: 'Conjunction' - fields: - type: sequence - label: 'Fields' - orderby: value - sequence: - type: string - label: 'Field' - -views.argument.search_api_more_like_this: - type: views_argument - label: 'Search API more like this' - mapping: - fields: - type: sequence - label: 'Fields' - orderby: value - sequence: - type: string - label: 'Field' - -views.argument.search_api_term: - type: views.argument.search_api - label: 'Search API taxonomy term' - -views.field.search_api: - type: views_field - label: 'Search API standard' - mapping: - link_to_item: - type: boolean - label: 'Link to item' - use_highlighting: - type: boolean - label: 'Use highlighted field data' - multi_type: - type: string - label: 'Handling of multiple values' - multi_separator: - type: string - label: 'Separator for multiple values' - -views.field.search_api_boolean: - type: views.field.boolean - label: 'Search API boolean' - mapping: - link_to_item: - type: boolean - label: 'Link to item' - use_highlighting: - type: boolean - label: 'Use highlighted field data' - multi_type: - type: string - label: 'Handling of multiple values' - multi_separator: - type: string - label: 'Separator for multiple values' - -views.field.search_api_date: - type: views.field.date - label: 'Search API date' - mapping: - link_to_item: - type: boolean - label: 'Link to item' - use_highlighting: - type: boolean - label: 'Use highlighted field data' - multi_type: - type: string - label: 'Handling of multiple values' - multi_separator: - type: string - label: 'Separator for multiple values' - -views.field.search_api_entity: - type: views.field.search_api - label: 'Search API entity reference' - mapping: - display_methods: - type: sequence - label: 'Display settings' - orderby: key - sequence: - type: mapping - label: 'Display settings for bundle' - mapping: - display_method: - type: string - label: 'Display method' - view_mode: - type: string - label: 'View mode' - -views.field.search_api_field: - type: views.field.field - label: 'Search API entity field' - mapping: - field_rendering: - type: boolean - label: 'Use entity field rendering' - fallback_handler: - type: string - label: 'Fallback handler' - fallback_options: - type: views.field.[%parent.fallback_handler] - label: 'Options for fallback handler' - -views.field.search_api_numeric: - type: views.field.numeric - label: 'Search API boolean' - mapping: - link_to_item: - type: boolean - label: 'Link to item' - use_highlighting: - type: boolean - label: 'Use highlighted field data' - multi_type: - type: string - label: 'Handling of multiple values' - multi_separator: - type: string - label: 'Separator for multiple values' - format_plural_values: - type: sequence - label: 'Pluralized strings' - sequence: - type: string - label: 'Singular/Plural string' - -views.filter.search_api_boolean: - type: views.filter.boolean - label: 'Search API boolean' - -views.filter.search_api_datasource: - type: views.filter.search_api_options - label: 'Search API datasource' - -views.filter.search_api_fulltext: - type: views_filter - label: 'Search API fulltext search' - mapping: - parse_mode: - type: string - label: Parse mode - min_length: - type: integer - label: Minimum search string length - fields: - type: sequence - label: Fields to search on - orderby: value - sequence: - type: string - label: Field name - expose: - type: mapping - label: 'Exposed' - mapping: - placeholder: - type: label - label: 'Placeholder' - -views.filter.search_api_language: - type: views.filter.language - label: 'Search API language' - -views.filter.search_api_numeric: - type: views.filter.numeric - label: 'Search API numeric' - -views.filter.search_api_options: - type: views.filter.many_to_one - label: 'Search API options' - -views.filter.search_api_string: - type: views.filter.search_api_numeric - label: 'Search API string' - -views.filter.search_api_term: - type: views.filter.taxonomy_index_tid - label: 'Search API taxonomy term' - -views.filter.search_api_text: - type: views.filter.search_api_string - label: 'Search API text' - -views.filter.search_api_user: - type: views.filter.user_name - label: 'Search API user' - -views.filter_value.search_api_boolean: - type: string - -views.filter_value.search_api_datasource: - type: string - -views.filter_value.search_api_date: - type: views.filter_value.date - label: 'Search API date' - -views.filter_value.search_api_fulltext: - type: string - -views.filter_value.search_api_language: - type: string - -views.filter_value.search_api_numeric: - type: views.filter_value.numeric - -views.filter_value.search_api_options: - type: sequence - orderby: value - sequence: - type: string - label: 'Value' - -views.filter_value.search_api_string: - type: views.filter_value.numeric - -views.filter_value.search_api_term: - type: string - -views.filter_value.search_api_text: - type: views.filter_value.numeric - -views.filter_value.search_api_user: - type: string - -views.relationship.search_api: - type: views_relationship - label: 'Search API' - mapping: - skip_access: - type: boolean - label: Do not execute access checks for entities referenced via this relationship. diff --git a/sites/all/modules/contrib/search/search_api/css/search_api.admin.css b/sites/all/modules/contrib/search/search_api/css/search_api.admin.css deleted file mode 100644 index 4c8f52aaa..000000000 --- a/sites/all/modules/contrib/search/search_api/css/search_api.admin.css +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file - * Administration styles for the Search API module. - */ - -/* - * Search API overview page - */ -.search-api-entity-list { - margin-bottom: 2em; -} - -.search-api-entity-list tr { - border-bottom: none; -} - -.search-api-list-server { - border-top: 1px solid #e6e4df; -} - -.search-api-list-index:last-of-type { - border-bottom: 1px solid #e6e4df; -} - -.search-api-list-server .search-api-type, -.search-api-list-server .search-api-title { - font-weight: bold; -} - -.search-api-list-index .search-api-type { - padding-left: 3em; -} - -.search-api-list-disabled .search-api-type, -.search-api-list-disabled .search-api-title { - font-style: italic; -} - -/* - * Server view page - */ -.search-api-server-summary ul.inline { - margin: 0; -} - -.search-api-server-summary ul.inline li { - padding-left: 0; -} - -details .messages { - margin-left: 20px; - margin-right: 20px; -} - -/* - * Index summary page - */ -.search-api-index-status { - margin-bottom: 6em; -} - -/* Remove animation */ -.search-api-index-status .progress__bar { - background-image: none; -} - -.search-api-index-summary { - margin-bottom: 2em; -} - -/* - * Processors page - */ - -.search-api-stage-wrapper.form-item { - float: left; - box-sizing: border-box; - width: 32.66%; - min-width: 17em; - margin-right: 1%; -} - -.search-api-stage-wrapper.form-item:last-child { - margin-right: 0; -} - -/* - * Miscellaneous - */ -.search-api-checkboxes-list .form-checkboxes { - max-height: 30em; - overflow: auto; -} diff --git a/sites/all/modules/contrib/search/search_api/drush.services.yml b/sites/all/modules/contrib/search/search_api/drush.services.yml deleted file mode 100644 index f619dfffd..000000000 --- a/sites/all/modules/contrib/search/search_api/drush.services.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - search_api.commands: - class: \Drupal\search_api\Commands\SearchApiCommands - arguments: - - '@entity_type.manager' - - '@module_handler' - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/search/search_api/js/search_api.processors.js b/sites/all/modules/contrib/search/search_api/js/search_api.processors.js deleted file mode 100644 index c3e601c49..000000000 --- a/sites/all/modules/contrib/search/search_api/js/search_api.processors.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file - * Attaches show/hide functionality to checkboxes in the "Processor" tab. - */ - -(function ($) { - - 'use strict'; - - Drupal.behaviors.searchApiProcessor = { - attach: function (context, settings) { - $('.search-api-status-wrapper input.form-checkbox', context).each(function () { - var $checkbox = $(this); - var processor_id = $checkbox.data('id'); - - var $rows = $('.search-api-processor-weight--' + processor_id, context); - var tab = $('.search-api-processor-settings-' + processor_id, context).data('verticalTab'); - - // Bind a click handler to this checkbox to conditionally show and hide - // the processor's table row and vertical tab pane. - $checkbox.on('click.searchApiUpdate', function () { - if ($checkbox.is(':checked')) { - $rows.show(); - if (tab) { - tab.tabShow().updateSummary(); - } - } - else { - $rows.hide(); - if (tab) { - tab.tabHide().updateSummary(); - } - } - }); - - // Attach summary for configurable items (only for screen-readers). - if (tab) { - tab.details.drupalSetSummary(function () { - return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled'); - }); - } - - // Trigger our bound click handler to update elements to initial state. - $checkbox.triggerHandler('click.searchApiUpdate'); - }); - } - }; - -})(jQuery); diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/README.txt b/sites/all/modules/contrib/search/search_api/modules/search_api_db/README.txt deleted file mode 100644 index 32cb1ecfa..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/README.txt +++ /dev/null @@ -1,60 +0,0 @@ -Database Search ---------------- - -This module provides a database-based implementation of the Search API. The -database and target to use for storing and accessing the indexes can be selected -when creating a new server. - -All Search API data types are supported by using appropriate SQL data types for -their respective columns. - -The "direct" parse mode for queries will result in a simple splitting of the -query string into keys. Additionally, search keys containing whitespace will be -split for all parse modes, as searching for phrases is currently not supported. - -Supported optional features ---------------------------- - -- search_api_autocomplete - Introduced by module: search_api_autocomplete - Lets you add autocompletion capabilities to search forms on the site. (See - also "Hidden variables" below for backend-specific customization.) - NOTE: Due to internal database restrictions, this will perform significantly - better if only a single field is used for autocompletion. -- search_api_facets - Introduced by module: facets - Allows you to create faceted searches for dynamically filtering search - results. -- search_api_facets_operator_or - Introduced by module: facets - Allows the use of the "OR" operator for facets. - -If you feel some backend option is missing, or have other ideas for improving -this implementation, please file a feature request in the project's issue queue, -at [1], using the "Database search" component. - -[1] http://drupal.org/project/issues/search_api - -Known problems --------------- - -Using facets and autocomplete suggestions with a database server will only work -if the database user Drupal is using has the "CREATE TEMPORARY TABLES" -permission (or similar, in DBMSs other than MySQL). - -Developer information ---------------------- - -Database queries for searches with this module are tagged with -"search_api_db_search" to allow easy altering. As metadata, such database -queries will have the Search API query object set as "search_api_query", and the -field settings of the server for the corresponding search index as -"search_api_db_fields". - -Hidden configuration --------------------- - -- search_api_db.settings.autocomplete_max_occurrences (default: 0.9) - By default, keywords that occur in more than 90% of results are ignored for - autocomplete suggestions. This setting lets you modify that behavior by - providing your own ratio. Use 1 or greater to use all suggestions. diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/install/search_api_db.settings.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/install/search_api_db.settings.yml deleted file mode 100644 index d2f16c17d..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/install/search_api_db.settings.yml +++ /dev/null @@ -1 +0,0 @@ -autocomplete_max_occurrences: 0.9 diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.backend.schema.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.backend.schema.yml deleted file mode 100644 index 96157bda5..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.backend.schema.yml +++ /dev/null @@ -1,23 +0,0 @@ -plugin.plugin_configuration.search_api_backend.search_api_db: - type: mapping - label: 'Search API DB settings' - mapping: - database: - type: 'string' - label: 'Name of the database we are connecting to' - min_chars: - type: 'integer' - label: 'Minimum length of indexed words' - matching: - type: 'string' - label: 'The matching mode – "words", "prefix" or "partial"' - autocomplete: - type: mapping - label: Autcomplete configuration - mapping: - suggest_suffix: - type: boolean - label: Suggest suffix - suggest_words: - type: boolean - label: Suggest words diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.schema.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.schema.yml deleted file mode 100644 index ecb3aeb56..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/config/schema/search_api_db.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -search_api_db.settings: - type: config_object - label: 'Search API DB settings' - mapping: - autocomplete_max_occurrences: - type: float - label: 'Maximum occurrences of a term until autocomplete suggestions ignores it' diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.api.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.api.php deleted file mode 100644 index 9d39bdf81..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.api.php +++ /dev/null @@ -1,38 +0,0 @@ -getOption('custom_sql_conditions')) { - foreach ($custom as $condition) { - $db_query->condition($condition['field'], $condition['value'], $condition['operator']); - } - } -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.info.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.info.yml deleted file mode 100644 index 8777d6a71..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: Database Search -description: Offers an implementation of the Search API that uses database tables for indexing content. -package: Search -# core: 8.x -dependencies: - - search_api:search_api - -# Information added by Drupal.org packaging script on 2018-11-18 -version: '8.x-1.11' -core: '8.x' -project: 'search_api' -datestamp: 1542564486 diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.install b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.install deleted file mode 100644 index 40597e705..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.install +++ /dev/null @@ -1,109 +0,0 @@ -getAll() as $db_info) { - // Use the correct database from the server's backend configuration. - $database = \Drupal::config('search_api.server.' . $db_info['server']) - ->get('backend_config.database'); - if (!$database) { - continue; - } - list($key, $target) = explode(':', $database, 2); - $schema = Database::getConnection($target, $key)->schema(); - - $table = $db_info['index_table']; - foreach ($db_info['field_tables'] as $field_info) { - $column = $field_info['column']; - if ($field_info['type'] === 'text' - && $schema->fieldExists($table, $column)) { - $spec = [ - 'type' => 'varchar', - 'length' => 30, - 'description' => "The field's value for this item", - ]; - $schema->changeField($table, $column, $column, $spec); - } - } - } - - return t('Fulltext field database columns updated.'); -} - -/** - * Adds primary keys to denormalized index tables. - */ -function search_api_db_update_8102() { - // @see https://www.drupal.org/node/2884451 - $key_value = \Drupal::keyValue('search_api_db.indexes'); - - foreach ($key_value->getAll() as $db_info) { - // Use the correct database from the server's backend configuration. - $database = \Drupal::config('search_api.server.' . $db_info['server']) - ->get('backend_config.database'); - if (!$database) { - continue; - } - list($key, $target) = explode(':', $database, 2); - $schema = Database::getConnection($target, $key)->schema(); - - $table = $db_info['index_table']; - try { - $schema->addPrimaryKey($table, ['item_id']); - } - catch (SchemaObjectExistsException $e) { - // Primary key was already added, maybe by a conscientious site admin. - // Nothing to do here in that case. - } - catch (\Exception $e) { - throw new UpdateException("Could not add a primary key to table {{$table}}: " . $e->getMessage(), 0, $e); - } - } - - return t('Primary keys added to all denormalized index tables.'); -} - -/** - * Converts the old "partial_matches" option to the new "matching" option. - */ -function search_api_db_update_8103() { - // @see https://www.drupal.org/project/search_api/issues/2971033 - - $config_factory = \Drupal::configFactory(); - $count = 0; - foreach ($config_factory->listAll('search_api.server.') as $server_id) { - $server = $config_factory->getEditable($server_id); - if ($server->get('backend') !== 'search_api_db') { - continue; - } - - ++$count; - $config = $server->get('backend_config') ?: []; - $config['matching'] = empty($config['partial_matches']) ? 'words' : 'partial'; - unset($config['partial_matches']); - $server->set('backend_config', $config); - // Mark the resulting configuration as trusted data. This avoids issues - // with future schema changes. - $server->save(TRUE); - } - - if ($count) { - return \Drupal::translation() - ->formatPlural($count, 'Updated 1 server.', 'Updated @count servers.'); - } - return NULL; -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.module b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.module deleted file mode 100644 index adc9f5ab6..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.module +++ /dev/null @@ -1,17 +0,0 @@ - [ - 'group' => 'search_api', - ], - ]; -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.services.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.services.yml deleted file mode 100644 index 4fe69b623..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db.services.yml +++ /dev/null @@ -1,22 +0,0 @@ -services: - logger.channel.search_api_db: - parent: logger.channel_base - arguments: ['search_api_db'] - - search_api_db.database_compatibility: - class: Drupal\search_api_db\DatabaseCompatibility\GenericDatabase - arguments: ['@database', '@transliteration'] - tags: - - { name: backend_overridable } - - mysql.search_api_db.database_compatibility: - class: Drupal\search_api_db\DatabaseCompatibility\MySql - arguments: ['@database', '@transliteration'] - - pgsql.search_api_db.database_compatibility: - class: Drupal\search_api_db\DatabaseCompatibility\CaseSensitiveDatabase - arguments: ['@database', '@transliteration'] - - sqlite.search_api_db.database_compatibility: - class: Drupal\search_api_db\DatabaseCompatibility\CaseSensitiveDatabase - arguments: ['@database', '@transliteration'] diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/README.txt b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/README.txt deleted file mode 100644 index 5acc9d503..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/README.txt +++ /dev/null @@ -1,23 +0,0 @@ -Database Search Defaults ------------------------- - -This module provides a default setup for the Search API, for searching node -content through a view, using a database server for indexing. - -By installing this module on your site, the required configuration will be set -up on the site. Other than that, this module has no functionality. You can -(and should, for performance reasons) uninstall it again immediately after -installing, to just get the search set up. - -Due to Drupal's configuration model, subsequent updates to the configuration -deployed with this module won't be applied to existing configuration. - -The search view will be set up at this path: - /search/content - -You can view (and customize) the installed search configuration under these -paths: - Server: /admin/config/search/search-api/server/default_server - Index: /admin/config/search/search-api/index/default_index - View: /admin/structure/views/view/search_content - (if the "Views UI" module is installed) diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_index.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_index.yml deleted file mode 100644 index 9215b0f60..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_index.yml +++ /dev/null @@ -1,43 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.search_index - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_image - - field.field.node.article.field_tags - - node.type.article - module: - - comment - - text - - user -id: node.article.search_index -targetEntityType: node -bundle: article -mode: search_index -content: - body: - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - label: hidden - comment: - type: comment_default - weight: 2 - settings: - pager_id: 0 - third_party_settings: { } - label: hidden - field_tags: - type: entity_reference_label - weight: 1 - settings: - link: false - third_party_settings: { } - label: hidden -hidden: - field_image: true - langcode: true - links: true diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_result.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_result.yml deleted file mode 100644 index eca0c257f..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.article.search_result.yml +++ /dev/null @@ -1,42 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.search_result - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_image - - field.field.node.article.field_tags - - node.type.article - module: - - image - - text - - user -id: node.article.search_result -targetEntityType: node -bundle: article -mode: search_result -content: - body: - type: text_summary_or_trimmed - weight: 1 - settings: - trim_length: 300 - third_party_settings: { } - label: hidden - field_image: - type: image - weight: 0 - settings: - image_style: thumbnail - image_link: content - third_party_settings: { } - label: hidden - links: - weight: 2 - settings: { } - third_party_settings: { } -hidden: - comment: true - field_tags: true - langcode: true diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_index.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_index.yml deleted file mode 100644 index 79e8ab464..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_index.yml +++ /dev/null @@ -1,24 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.search_index - - field.field.node.page.body - - node.type.page - module: - - text - - user -id: node.page.search_index -targetEntityType: node -bundle: page -mode: search_index -content: - body: - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - label: hidden -hidden: - langcode: true - links: true diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_result.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_result.yml deleted file mode 100644 index eba08beba..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/core.entity_view_display.node.page.search_result.yml +++ /dev/null @@ -1,28 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.search_result - - field.field.node.page.body - - node.type.page - module: - - text - - user -id: node.page.search_result -targetEntityType: node -bundle: page -mode: search_result -content: - body: - type: text_summary_or_trimmed - weight: 100 - settings: - trim_length: 300 - third_party_settings: { } - label: hidden - links: - weight: 101 - settings: { } - third_party_settings: { } -hidden: - langcode: true diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.index.default_index.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.index.default_index.yml deleted file mode 100644 index b8eebc911..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.index.default_index.yml +++ /dev/null @@ -1,188 +0,0 @@ -id: default_index -name: 'Default content index' -description: 'Default content index created by the Database Search Defaults module' -read_only: false -field_settings: - author: - label: 'Author name' - type: string - datasource_id: 'entity:node' - property_path: 'uid:entity:name' - changed: - label: Changed - type: date - datasource_id: 'entity:node' - property_path: changed - created: - label: 'Authored on' - type: date - datasource_id: 'entity:node' - property_path: created - field_tags: - label: Tags - type: integer - datasource_id: 'entity:node' - property_path: 'field_tags' - node_grants: - label: 'Node access information' - type: string - property_path: search_api_node_grants - indexed_locked: true - type_locked: true - hidden: true - rendered_item: - label: 'Rendered item' - type: text - property_path: rendered_item - configuration: - roles: - anonymous: anonymous - view_mode: - 'entity:node': - article: search_index - page: search_index - status: - label: 'Publishing status' - type: boolean - datasource_id: 'entity:node' - property_path: status - indexed_locked: true - type_locked: true - sticky: - label: 'Sticky at top of lists' - type: boolean - datasource_id: 'entity:node' - property_path: sticky - title: - label: Title - type: text - datasource_id: 'entity:node' - property_path: title - boost: 8 - type: - label: 'Content type' - type: string - datasource_id: 'entity:node' - property_path: type - uid: - label: 'Author ID' - type: integer - datasource_id: 'entity:node' - property_path: uid - indexed_locked: true - type_locked: true -processor_settings: - add_url: - weights: - preprocess_index: -30 - aggregated_field: - weights: - add_properties: 20 - content_access: - weights: - preprocess_index: -6 - preprocess_query: -4 - entity_status: - weights: - preprocess_index: -10 - html_filter: - weights: - preprocess_index: -3 - preprocess_query: -6 - fields: - - rendered_item - title: true - alt: true - tags: - h1: 5 - h2: 3 - h3: 2 - string: 2 - b: 2 - ignorecase: - weights: - preprocess_index: -5 - preprocess_query: -8 - fields: - - rendered_item - - title - rendered_item: - weights: - add_properties: 0 - pre_index_save: -10 - stopwords: - weights: - preprocess_query: -10 - postprocess_query: -10 - fields: - - rendered_item - - title - stopwords: - - a - - an - - and - - are - - as - - at - - be - - but - - by - - for - - if - - in - - into - - is - - it - - 'no' - - not - - of - - 'on' - - or - - s - - such - - t - - that - - the - - their - - then - - there - - these - - they - - this - - to - - was - - will - - with - tokenizer: - weights: - preprocess_index: -2 - preprocess_query: -5 - fields: - - rendered_item - - title - spaces: '' - overlap_cjk: 1 - minimum_word_size: '3' - transliteration: - weights: - preprocess_index: -4 - preprocess_query: -7 - fields: - - rendered_item - - title -options: - cron_limit: 50 - index_directly: true -datasource_settings: - 'entity:node': { } -tracker_settings: - 'default': { } -server: default_server -status: true -langcode: en -dependencies: - config: - - field.field.node.article.field_tags - - search_api.server.default_server - module: - - node diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.server.default_server.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.server.default_server.yml deleted file mode 100644 index 4451c2b0f..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/search_api.server.default_server.yml +++ /dev/null @@ -1,16 +0,0 @@ -id: default_server -name: 'Database Server' -description: 'Default database server created by the Database Search Defaults module' -status: true -backend: search_api_db -backend_config: - database: 'default:default' - min_chars: 3 - matching: 'words' - autocomplete: - suggest_suffix: true - suggest_words: true -langcode: en -dependencies: - module: - - search_api_db diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/views.view.search_content.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/views.view.search_content.yml deleted file mode 100644 index d2bfb978a..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/config/optional/views.view.search_content.yml +++ /dev/null @@ -1,159 +0,0 @@ -id: search_content -langcode: en -status: true -dependencies: - module: - - search_api - config: - - core.entity_view_mode.node.search_result - - core.entity_view_display.node.article.search_result - - core.entity_view_display.node.page.search_result - - search_api.index.default_index -label: 'Search content' -module: views -description: 'A search page preconfigured to search through the content of your site' -tag: '' -base_table: search_api_index_default_index -base_field: search_api_id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: none - options: { } - query: - type: search_api_query - options: { } - exposed_form: - type: input_required - options: - submit_button: Search - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - text_input_required: 'Please enter some keywords to search.' - text_input_required_format: basic_html - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - tags: - previous: '‹ previous' - next: 'next ›' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - style: - type: default - row: - type: search_api - options: - view_modes: - 'entity:node': - article: search_result - page: search_result - filters: - search_api_fulltext: - id: search_api_fulltext - table: search_api_index_default_index - field: search_api_fulltext - relationship: none - group_type: group - admin_label: '' - operator: and - value: '' - group: 1 - exposed: true - expose: - operator_id: search_op - label: Search - description: '' - use_operator: false - operator: search_op - identifier: keys - required: true - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - parse_mode: terms - min_length: 3 - fields: { } - plugin_id: search_api_fulltext - sorts: { } - title: 'Search Content' - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - empty: false - content: 'Displaying results @start - @end of @total' - plugin_id: result - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - cacheable: false - max-age: 0 - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: search/content - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - cacheable: false - max-age: 0 - tags: { } diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml deleted file mode 100644 index 8e10445b7..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml +++ /dev/null @@ -1,20 +0,0 @@ -type: module -name: Database Search Defaults -description: Enable this module for a best-practice default setup of Search API with the Database backend. After installation it is recommended to uninstall this module again for performance reasons. The provided configuration will not be removed. -package: Search -# core: 8.x -dependencies: - - drupal:comment - - drupal:field - - drupal:image - - drupal:node - - drupal:text - - drupal:user - - drupal:views - - search_api:search_api_db - -# Information added by Drupal.org packaging script on 2018-11-18 -version: '8.x-1.11' -core: '8.x' -project: 'search_api' -datestamp: 1542564486 diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.install b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.install deleted file mode 100644 index ca40db3ad..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.install +++ /dev/null @@ -1,37 +0,0 @@ - $error) { - $requirements["search_api_db_defaults:$type"] = [ - 'severity' => REQUIREMENT_ERROR, - 'description' => $error, - ]; - } - } - - return $requirements; -} - -/** - * Implements hook_install(). - */ -function search_api_db_defaults_install() { - // Clear the display plugin cache after installation so the plugin for the new - // view (display) gets found. - \Drupal::service('plugin.manager.search_api.display') - ->clearCachedDefinitions(); -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/tests/src/Functional/IntegrationTest.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/tests/src/Functional/IntegrationTest.php deleted file mode 100644 index 61dcad7c6..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/search_api_db_defaults/tests/src/Functional/IntegrationTest.php +++ /dev/null @@ -1,181 +0,0 @@ -authenticatedUser = $this->drupalCreateUser(); - $this->adminUser = $this->drupalCreateUser([], NULL, TRUE); - } - - /** - * Tests whether the default search was correctly installed. - */ - public function testInstallAndDefaultSetupWorking() { - $this->drupalLogin($this->adminUser); - - // Installation invokes a batch and this breaks it. - \Drupal::state()->set('search_api_use_tracking_batch', FALSE); - - // Install the search_api_db_defaults module. - $edit_enable = [ - 'modules[search_api_db_defaults][enable]' => TRUE, - ]; - $this->drupalPostForm('admin/modules', $edit_enable, 'Install'); - - $this->assertSession()->pageTextContains('Some required modules must be enabled'); - - $this->drupalPostForm(NULL, [], 'Continue'); - - $this->assertSession()->pageTextContains('2 modules have been enabled: Database Search Defaults, Database Search'); - - $this->rebuildContainer(); - - $this->drupalPostForm('admin/config/search/search-api/server/default_server/edit', [], 'Save'); - $this->assertSession()->pageTextContains('The server was successfully saved.'); - - $server = Server::load('default_server'); - $this->assertTrue($server, 'Server can be loaded'); - - $index = Index::load('default_index'); - $this->assertTrue($index, 'Index can be loaded'); - - $this->drupalLogin($this->authenticatedUser); - $this->drupalGet('search/content'); - $this->assertSession()->statusCodeEquals(200); - $this->drupalLogin($this->adminUser); - - $title = 'Test node title'; - $edit = [ - 'title[0][value]' => $title, - 'body[0][value]' => 'This is test content for the Search API to index.', - ]; - $this->drupalPostForm('node/add/article', $edit, 'Save'); - - $this->drupalLogout(); - $this->drupalGet('search/content'); - $this->assertSession()->pageTextContains('Please enter some keywords to search.'); - $this->assertSession()->pageTextNotContains($title); - $this->assertSession()->responseNotContains('Error message'); - $this->submitForm([], 'Search'); - $this->assertSession()->pageTextNotContains($title); - $this->assertSession()->responseNotContains('Error message'); - $this->submitForm(['keys' => 'test'], 'Search'); - $this->assertSession()->pageTextContains($title); - $this->assertSession()->responseNotContains('Error message'); - - // Uninstall the module. - $this->drupalLogin($this->adminUser); - $edit_disable = [ - 'uninstall[search_api_db_defaults]' => TRUE, - ]; - $this->drupalPostForm('admin/modules/uninstall', $edit_disable, 'Uninstall'); - $this->submitForm([], 'Uninstall'); - $this->rebuildContainer(); - $this->assertFalse($this->container->get('module_handler')->moduleExists('search_api_db_defaults'), 'Search API DB Defaults module uninstalled.'); - - // Check if the server is found in the Search API admin UI. - $this->drupalGet('admin/config/search/search-api/server/default_server'); - $this->assertSession()->statusCodeEquals(200); - - // Check if the index is found in the Search API admin UI. - $this->drupalGet('admin/config/search/search-api/index/default_index'); - $this->assertSession()->statusCodeEquals(200); - - // Check that saving any of the index's config forms works fine. - foreach (['edit', 'fields', 'processors'] as $tab) { - $submit = $tab == 'fields' ? 'Save changes' : 'Save'; - $this->drupalGet("admin/config/search/search-api/index/default_index/$tab"); - $this->submitForm([], $submit); - $this->assertSession()->statusCodeEquals(200); - } - - $this->drupalLogin($this->authenticatedUser); - $this->drupalGet('search/content'); - $this->assertSession()->statusCodeEquals(200); - $this->drupalLogin($this->adminUser); - - // Enable the module again. This should fail because the either the index - // or the server or the view was found. - $this->drupalPostForm('admin/modules', $edit_enable, 'Install'); - $this->assertSession()->pageTextContains('It looks like the default setup provided by this module already exists on your site. Cannot re-install module.'); - - // Delete all the entities that we would fail on if they exist. - $entities_to_remove = [ - 'search_api_index' => 'default_index', - 'search_api_server' => 'default_server', - 'view' => 'search_content', - ]; - /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ - $entity_type_manager = \Drupal::service('entity_type.manager'); - foreach ($entities_to_remove as $entity_type => $entity_id) { - /** @var \Drupal\Core\Entity\EntityStorageInterface $entity_storage */ - $entity_storage = $entity_type_manager->getStorage($entity_type); - $entity_storage->resetCache(); - $entities = $entity_storage->loadByProperties(['id' => $entity_id]); - - if (!empty($entities[$entity_id])) { - $entities[$entity_id]->delete(); - } - } - - // Delete the article content type. - $this->drupalGet('node/1/delete'); - $this->submitForm([], 'Delete'); - $this->drupalGet('admin/structure/types/manage/article'); - $this->clickLink('Delete'); - $this->assertSession()->statusCodeEquals(200); - $this->submitForm([], 'Delete'); - - // Try to install search_api_db_defaults module and test if it failed - // because there was no content type "article". - $this->drupalPostForm('admin/modules', $edit_enable, 'Install'); - $success_text = new FormattableMarkup('Content type @content_type not found. Database Search Defaults module could not be installed.', ['@content_type' => 'article']); - $this->assertSession()->pageTextContains($success_text); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/CaseSensitiveDatabase.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/CaseSensitiveDatabase.php deleted file mode 100644 index 5152c87e2..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/CaseSensitiveDatabase.php +++ /dev/null @@ -1,17 +0,0 @@ -database = $database; - $this->transliterator = $transliterator; - } - - /** - * {@inheritdoc} - */ - public function getDatabase() { - return $this->database; - } - - /** - * {@inheritdoc} - */ - public function getCloneForDatabase(Connection $database) { - $service = clone $this; - $service->database = $database; - return $service; - } - - /** - * {@inheritdoc} - */ - public function alterNewTable($table, $type = 'text') {} - - /** - * {@inheritdoc} - */ - public function preprocessIndexValue($value, $type = 'text') { - if ($type == 'text') { - return $value; - } - return mb_strtolower($this->transliterator->transliterate($value)); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/MySql.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/MySql.php deleted file mode 100644 index 08112f206..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/DatabaseCompatibility/MySql.php +++ /dev/null @@ -1,39 +0,0 @@ -database->query("ALTER TABLE {{$table}} CONVERT TO CHARACTER SET '$charset' COLLATE '$collation'"); - } - catch (\PDOException $e) { - $class = get_class($e); - $message = $e->getMessage(); - throw new SearchApiException("$class while trying to change collation of $type search data table '$table': $message", 0, $e); - } - catch (DatabaseException $e) { - $class = get_class($e); - $message = $e->getMessage(); - throw new SearchApiException("$class while trying to change collation of $type search data table '$table': $message", 0, $e); - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Plugin/search_api/backend/Database.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Plugin/search_api/backend/Database.php deleted file mode 100644 index 172c9a39a..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Plugin/search_api/backend/Database.php +++ /dev/null @@ -1,2785 +0,0 @@ -database = CoreDatabase::getConnection($target, $key); - } - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - /** @var static $backend */ - $backend = parent::create($container, $configuration, $plugin_id, $plugin_definition); - - $backend->setModuleHandler($container->get('module_handler')); - $backend->setConfigFactory($container->get('config.factory')); - $backend->setDataTypePluginManager($container->get('plugin.manager.search_api.data_type')); - $backend->setLogger($container->get('logger.channel.search_api_db')); - $backend->setKeyValueStore($container->get('keyvalue')->get(self::INDEXES_KEY_VALUE_STORE_ID)); - $backend->setDateFormatter($container->get('date.formatter')); - $backend->setDataTypeHelper($container->get('search_api.data_type_helper')); - - // For a new backend plugin, the database might not be set yet. In that case - // we of course also don't need a DBMS compatibility handler. - $database = $backend->getDatabase(); - if ($database) { - $dbms_compatibility_handler = $container->get('search_api_db.database_compatibility'); - // Make sure that we actually provide a handler for the right database, - // otherwise create the right service manually. (This is the case if the - // user didn't pick the default database.) - if ($dbms_compatibility_handler->getDatabase() != $database) { - $database_type = $database->databaseType(); - $service_id = "$database_type.search_api_db.database_compatibility"; - if ($container->has($service_id)) { - /** @var \Drupal\search_api_db\DatabaseCompatibility\DatabaseCompatibilityHandlerInterface $dbms_compatibility_handler */ - $dbms_compatibility_handler = $container->get($service_id); - $dbms_compatibility_handler = $dbms_compatibility_handler->getCloneForDatabase($database); - } - else { - $dbms_compatibility_handler = new GenericDatabase($database, $container->get('transliteration')); - } - } - $backend->setDbmsCompatibilityHandler($dbms_compatibility_handler); - } - - return $backend; - } - - /** - * Retrieves the database connection used by this backend. - * - * @return \Drupal\Core\Database\Connection - * The database connection. - */ - public function getDatabase() { - return $this->database; - } - - /** - * Returns the module handler to use for this plugin. - * - * @return \Drupal\Core\Extension\ModuleHandlerInterface - * The module handler. - */ - public function getModuleHandler() { - return $this->moduleHandler ?: \Drupal::moduleHandler(); - } - - /** - * Sets the module handler to use for this plugin. - * - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler to use for this plugin. - * - * @return $this - */ - public function setModuleHandler(ModuleHandlerInterface $module_handler) { - $this->moduleHandler = $module_handler; - return $this; - } - - /** - * Returns the config factory to use for this plugin. - * - * @return \Drupal\Core\Config\ConfigFactoryInterface - * The config factory. - */ - public function getConfigFactory() { - return $this->configFactory ?: \Drupal::configFactory(); - } - - /** - * Sets the config factory to use for this plugin. - * - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The config factory to use for this plugin. - * - * @return $this - */ - public function setConfigFactory(ConfigFactoryInterface $config_factory) { - $this->configFactory = $config_factory; - return $this; - } - - /** - * Retrieves the data type plugin manager. - * - * @return \Drupal\search_api\DataType\DataTypePluginManager - * The data type plugin manager. - */ - public function getDataTypePluginManager() { - return $this->dataTypePluginManager ?: \Drupal::service('plugin.manager.search_api.data_type'); - } - - /** - * Sets the data type plugin manager. - * - * @param \Drupal\search_api\DataType\DataTypePluginManager $data_type_plugin_manager - * The new data type plugin manager. - * - * @return $this - */ - public function setDataTypePluginManager(DataTypePluginManager $data_type_plugin_manager) { - $this->dataTypePluginManager = $data_type_plugin_manager; - return $this; - } - - /** - * Retrieves the key-value store to use. - * - * @return \Drupal\Core\KeyValueStore\KeyValueStoreInterface - * The key-value store. - */ - public function getKeyValueStore() { - return $this->keyValueStore ?: \Drupal::keyValue(self::INDEXES_KEY_VALUE_STORE_ID); - } - - /** - * Sets the key-value store to use. - * - * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value_store - * The key-value store. - * - * @return $this - */ - public function setKeyValueStore(KeyValueStoreInterface $key_value_store) { - $this->keyValueStore = $key_value_store; - return $this; - } - - /** - * Retrieves the date formatter. - * - * @return \Drupal\Core\Datetime\DateFormatterInterface - * The date formatter. - */ - public function getDateFormatter() { - return $this->dateFormatter ?: \Drupal::service('date.formatter'); - } - - /** - * Sets the date formatter. - * - * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter - * The new date formatter. - * - * @return $this - */ - public function setDateFormatter(DateFormatterInterface $date_formatter) { - $this->dateFormatter = $date_formatter; - return $this; - } - - /** - * Retrieves the data type helper. - * - * @return \Drupal\search_api\Utility\DataTypeHelper - * The data type helper. - */ - public function getDataTypeHelper() { - return $this->dataTypeHelper ?: \Drupal::service('search_api.data_type_helper'); - } - - /** - * Sets the data type helper. - * - * @param \Drupal\search_api\Utility\DataTypeHelper $data_type_helper - * The new data type helper. - * - * @return $this - */ - public function setDataTypeHelper(DataTypeHelper $data_type_helper) { - $this->dataTypeHelper = $data_type_helper; - return $this; - } - - /** - * Retrieves the DBMS compatibility handler. - * - * @return \Drupal\search_api_db\DatabaseCompatibility\DatabaseCompatibilityHandlerInterface - * The DBMS compatibility handler. - */ - public function getDbmsCompatibilityHandler() { - return $this->dbmsCompatibility; - } - - /** - * Sets the DBMS compatibility handler. - * - * @param \Drupal\search_api_db\DatabaseCompatibility\DatabaseCompatibilityHandlerInterface $handler - * The DBMS compatibility handler. - * - * @return $this - */ - protected function setDbmsCompatibilityHandler(DatabaseCompatibilityHandlerInterface $handler) { - $this->dbmsCompatibility = $handler; - return $this; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'database' => NULL, - 'min_chars' => 1, - 'matching' => 'words', - 'autocomplete' => [ - 'suggest_suffix' => TRUE, - 'suggest_words' => TRUE, - ], - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - // Discern between creation and editing of a server, since we don't allow - // the database to be changed later on. - if (!$this->configuration['database']) { - $options = []; - $key = $target = ''; - foreach (CoreDatabase::getAllConnectionInfo() as $key => $targets) { - foreach ($targets as $target => $info) { - $options[$key]["$key:$target"] = "$key » $target"; - } - } - if (count($options) > 1 || count(reset($options)) > 1) { - $form['database'] = [ - '#type' => 'select', - '#title' => $this->t('Database'), - '#description' => $this->t('Select the database key and target to use for storing indexing information in. Cannot be changed after creation.'), - '#options' => $options, - '#default_value' => 'default:default', - '#required' => TRUE, - ]; - } - else { - $form['database'] = [ - '#type' => 'value', - '#value' => "$key:$target", - ]; - } - } - else { - $form = [ - 'database' => [ - '#type' => 'value', - '#title' => $this->t('Database'), - '#value' => $this->configuration['database'], - ], - 'database_text' => [ - '#type' => 'item', - '#title' => $this->t('Database'), - '#plain_text' => str_replace(':', ' > ', $this->configuration['database']), - '#input' => FALSE, - ], - ]; - } - - $form['min_chars'] = [ - '#type' => 'select', - '#title' => $this->t('Minimum word length'), - '#description' => $this->t('The minimum number of characters a word must consist of to be indexed'), - '#options' => array_combine( - [1, 2, 3, 4, 5, 6], - [1, 2, 3, 4, 5, 6] - ), - '#default_value' => $this->configuration['min_chars'], - ]; - - $form['matching'] = [ - '#type' => 'radios', - '#title' => $this->t('Partial matching'), - '#default_value' => $this->configuration['matching'], - '#options' => [ - 'words' => $this->t('Match whole words only'), - 'partial' => $this->t('Match on parts of a word'), - 'prefix' => $this->t('Match words starting with given keywords'), - ], - ]; - - if ($this->getModuleHandler()->moduleExists('search_api_autocomplete')) { - $form['autocomplete'] = [ - '#type' => 'details', - '#title' => $this->t('Autocomplete settings'), - '#description' => $this->t('These settings allow you to configure how suggestions are computed when autocompletion is used. If you are seeing many inappropriate suggestions you might want to deactivate the corresponding suggestion type. You can also deactivate one method to speed up the generation of suggestions.'), - ]; - $form['autocomplete']['suggest_suffix'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Suggest word endings'), - '#description' => $this->t('Suggest endings for the currently entered word.'), - '#default_value' => $this->configuration['autocomplete']['suggest_suffix'], - ]; - $form['autocomplete']['suggest_words'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Suggest additional words'), - '#description' => $this->t('Suggest additional words the user might want to search for.'), - '#default_value' => $this->configuration['autocomplete']['suggest_words'], - ]; - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function viewSettings() { - $info = []; - - $info[] = [ - 'label' => $this->t('Database'), - 'info' => str_replace(':', ' > ', $this->configuration['database']), - ]; - if ($this->configuration['min_chars'] > 1) { - $info[] = [ - 'label' => $this->t('Minimum word length'), - 'info' => $this->configuration['min_chars'], - ]; - } - - $labels = [ - 'words' => $this->t('Match whole words only'), - 'partial' => $this->t('Match on parts of a word'), - 'prefix' => $this->t('Match words starting with given keywords'), - ]; - $info[] = [ - 'label' => $this->t('Partial matching'), - 'info' => $labels[$this->configuration['matching']], - ]; - - if (!empty($this->configuration['autocomplete'])) { - $this->configuration['autocomplete'] += [ - 'suggest_suffix' => TRUE, - 'suggest_words' => TRUE, - ]; - $autocomplete_modes = []; - if ($this->configuration['autocomplete']['suggest_suffix']) { - $autocomplete_modes[] = $this->t('Suggest word endings'); - } - if ($this->configuration['autocomplete']['suggest_words']) { - $autocomplete_modes[] = $this->t('Suggest additional words'); - } - $autocomplete_modes = $autocomplete_modes ? implode('; ', $autocomplete_modes) : $this->t('none'); - $info[] = [ - 'label' => $this->t('Autocomplete suggestions'), - 'info' => $autocomplete_modes, - ]; - } - - return $info; - } - - /** - * {@inheritdoc} - */ - public function getSupportedFeatures() { - return [ - 'search_api_autocomplete', - 'search_api_facets', - 'search_api_facets_operator_or', - ]; - } - - /** - * {@inheritdoc} - */ - public function postUpdate() { - if (empty($this->server->original)) { - // When in doubt, opt for the safer route and reindex. - return TRUE; - } - $original_config = $this->server->original->getBackendConfig(); - $original_config += $this->defaultConfiguration(); - return $this->configuration['min_chars'] != $original_config['min_chars']; - } - - /** - * {@inheritdoc} - */ - public function preDelete() { - $schema = $this->database->schema(); - - $key_value_store = $this->getKeyValueStore(); - foreach ($key_value_store->getAll() as $index_id => $db_info) { - if ($db_info['server'] != $this->server->id()) { - continue; - } - - // Delete the regular field tables. - foreach ($db_info['field_tables'] as $field) { - if ($schema->tableExists($field['table'])) { - $schema->dropTable($field['table']); - } - } - - // Delete the denormalized field tables. - if ($schema->tableExists($db_info['index_table'])) { - $schema->dropTable($db_info['index_table']); - } - - $key_value_store->delete($index_id); - } - } - - /** - * {@inheritdoc} - */ - public function addIndex(IndexInterface $index) { - try { - // Create the denormalized table now. - $index_table = $this->findFreeTable('search_api_db_', $index->id()); - $this->createFieldTable(NULL, ['table' => $index_table], 'index'); - - $db_info = []; - $db_info['server'] = $this->server->id(); - $db_info['field_tables'] = []; - $db_info['index_table'] = $index_table; - $this->getKeyValueStore()->set($index->id(), $db_info); - } - // The database operations might throw PDO or other exceptions, so we catch - // them all and re-wrap them appropriately. - catch (\Exception $e) { - throw new SearchApiException($e->getMessage(), $e->getCode(), $e); - } - - // If dealing with features or stale data or whatever, we might already have - // settings stored for this index. If we have, we should take care to only - // change what is needed, so we don't discard indexed data unnecessarily. - // The easiest way to do this is by just pretending the index was already - // present, but its fields were updated. - $this->fieldsUpdated($index); - } - - /** - * {@inheritdoc} - */ - public function updateIndex(IndexInterface $index) { - // Process field ID changes so they won't lead to reindexing. - $renames = $index->getFieldRenames(); - if ($renames) { - $db_info = $this->getIndexDbInfo($index); - // We have to recreate "field_tables" from scratch in case field IDs got - // swapped between two (or more) fields. - $fields = []; - foreach ($db_info['field_tables'] as $field_id => $info) { - if (isset($renames[$field_id])) { - $field_id = $renames[$field_id]; - } - $fields[$field_id] = $info; - } - if ($fields != $db_info['field_tables']) { - $db_info['field_tables'] = $fields; - $this->getKeyValueStore()->set($index->id(), $db_info); - } - } - - // Check if any fields were updated and trigger a reindex if needed. - if ($this->fieldsUpdated($index)) { - $index->reindex(); - } - } - - /** - * Finds a free table name using a certain prefix and name base. - * - * Used as a helper method in fieldsUpdated(). - * - * MySQL 5.0 imposes a 64 characters length limit for table names, PostgreSQL - * 8.3 only allows 62 bytes. Therefore, always return a name at most 62 - * bytes long. - * - * @param string $prefix - * Prefix for the table name. Must only consist of characters valid for SQL - * identifiers. - * @param string $name - * Name to base the table name on. - * - * @return string - * A database table name that isn't in use yet. - */ - protected function findFreeTable($prefix, $name) { - // A DB prefix might further reduce the maximum length of the table name. - $max_bytes = 62; - if ($db_prefix = $this->database->tablePrefix()) { - // Use strlen() instead of mb_strlen() since we want to measure bytes, not - // characters. - $max_bytes -= strlen($db_prefix); - } - - $base = $table = Unicode::truncateBytes($prefix . mb_strtolower(preg_replace('/[^a-z0-9]/i', '_', $name)), $max_bytes); - $i = 0; - while ($this->database->schema()->tableExists($table)) { - $suffix = '_' . ++$i; - $table = Unicode::truncateBytes($base, $max_bytes - strlen($suffix)) . $suffix; - } - return $table; - } - - /** - * Finds a free column name within a database table. - * - * Used as a helper method in fieldsUpdated(). - * - * MySQL 5.0 imposes a 64 characters length limit for identifier names, - * PostgreSQL 8.3 only allows 62 bytes. Therefore, always return a name at - * most 62 bytes long. - * - * @param string $table - * The name of the table. - * @param string $column - * The name to base the column name on. - * - * @return string - * A column name that isn't in use in the specified table yet. - */ - protected function findFreeColumn($table, $column) { - $maxbytes = 62; - - $base = $name = Unicode::truncateBytes(mb_strtolower(preg_replace('/[^a-z0-9]/i', '_', $column)), $maxbytes); - // If the table does not exist yet, the initial name is not taken. - if ($this->database->schema()->tableExists($table)) { - $i = 0; - while ($this->database->schema()->fieldExists($table, $name)) { - $suffix = '_' . ++$i; - $name = Unicode::truncateBytes($base, $maxbytes - strlen($suffix)) . $suffix; - } - } - return $name; - } - - /** - * Creates or modifies a table to add an indexed field. - * - * Used as a helper method in fieldsUpdated(). - * - * @param \Drupal\search_api\Item\FieldInterface|null $field - * The field to add. Or NULL if only the initial table with an "item_id" - * column should be created. - * @param array $db - * Associative array containing the following: - * - table: The table to use for the field. - * - column: (optional) The column to use in that table. Defaults to - * "value". For creating a separate field table, it must be left empty! - * @param string $type - * (optional) The type of table being created. Either "index" (for the - * denormalized table for an entire index) or "field" (for field-specific - * tables). - * - * @todo Write a test to ensure a field named "value" doesn't break this. - */ - protected function createFieldTable(FieldInterface $field = NULL, array $db, $type = 'field') { - $new_table = !$this->database->schema()->tableExists($db['table']); - if ($new_table) { - $table = [ - 'name' => $db['table'], - 'module' => 'search_api_db', - 'fields' => [ - 'item_id' => [ - 'type' => 'varchar', - 'length' => 150, - 'description' => 'The primary identifier of the item', - 'not null' => TRUE, - ], - ], - ]; - // For the denormalized index table, add a primary key right away. For - // newly created field tables we first need to add the "value" column. - if ($type === 'index') { - $table['primary key'] = ['item_id']; - } - $this->database->schema()->createTable($db['table'], $table); - $this->dbmsCompatibility->alterNewTable($db['table'], $type); - } - - // Stop here if we want to create a table with just the 'item_id' column. - if (!isset($field)) { - return; - } - - $column = isset($db['column']) ? $db['column'] : 'value'; - $db_field = $this->sqlType($field->getType()); - $db_field += [ - 'description' => "The field's value for this item", - ]; - if ($new_table || $type === 'field') { - $db_field['not null'] = TRUE; - } - $this->database->schema()->addField($db['table'], $column, $db_field); - if ($db_field['type'] === 'varchar') { - $index_spec = [[$column, 10]]; - } - else { - $index_spec = [$column]; - } - // Create a table specification skeleton to pass to addIndex(). - $table_spec = [ - 'fields' => [ - $column => $db_field, - ], - 'indexes' => [ - $column => $index_spec, - ], - ]; - - // This is a quick fix for a core bug, so we can run the tests with SQLite - // until this is fixed. - // - // In SQLite, indexes and tables can't have the same name, which is - // the case for Search API DB. We have following situation: - // - a table named search_api_db_default_index_title - // - a table named search_api_db_default_index - // - // The last table has an index on the title column, which results in an - // index with the same as the first table, which conflicts in SQLite. - // - // The core issue addressing this (https://www.drupal.org/node/1008128) was - // closed as it fixed the PostgresSQL part. The SQLite fix is added in - // https://www.drupal.org/node/2625664 - // We prevent this by adding an extra underscore (which is also the proposed - // solution in the original core issue). - // - // @todo: Remove when #2625664 lands in Core. See #2625722 for a patch that - // implements this. - try { - $this->database->schema()->addIndex($db['table'], '_' . $column, $index_spec, $table_spec); - } - catch (\PDOException $e) { - $variables['%column'] = $column; - $variables['%table'] = $db['table']; - $this->logException($e, '%type while trying to add a database index for column %column to table %table: @message in %function (line %line of %file).', $variables, RfcLogLevel::WARNING); - } - catch (DatabaseException $e) { - $variables['%column'] = $column; - $variables['%table'] = $db['table']; - $this->logException($e, '%type while trying to add a database index for column %column to table %table: @message in %function (line %line of %file).', $variables, RfcLogLevel::WARNING); - } - - // Add a covering index for field tables. - if ($new_table && $type == 'field') { - $this->database->schema()->addPrimaryKey($db['table'], ['item_id', $column]); - } - } - - /** - * Returns the schema definition for a database column for a search data type. - * - * @param string $type - * An indexed field's search type. One of the default data types. - * - * @return array - * Column configurations to use for the field's database column. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if $type is unknown. - */ - protected function sqlType($type) { - switch ($type) { - case 'text': - return ['type' => 'varchar', 'length' => 30]; - case 'string': - case 'uri': - return ['type' => 'varchar', 'length' => 255]; - - case 'integer': - case 'duration': - case 'date': - // 'datetime' sucks. Therefore, we just store the timestamp. - return ['type' => 'int', 'size' => 'big']; - - case 'decimal': - return ['type' => 'float']; - - case 'boolean': - return ['type' => 'int', 'size' => 'tiny']; - - default: - throw new SearchApiException("Unknown field type '$type'."); - } - } - - /** - * Updates the storage tables when the field configuration changes. - * - * @param \Drupal\search_api\IndexInterface $index - * The search index whose fields (might) have changed. - * - * @return bool - * TRUE if the data needs to be reindexed, FALSE otherwise. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if any exceptions occur internally – for example, in the database - * layer. - */ - protected function fieldsUpdated(IndexInterface $index) { - try { - $db_info = $this->getIndexDbInfo($index); - $fields = &$db_info['field_tables']; - $new_fields = $index->getFields(); - $new_fields += $this->getSpecialFields($index); - - $reindex = FALSE; - $cleared = FALSE; - $text_table = NULL; - $denormalized_table = $db_info['index_table']; - - foreach ($fields as $field_id => $field) { - $was_text_type = $this->getDataTypeHelper()->isTextType($field['type']); - if (!isset($text_table) && $was_text_type) { - // Stash the shared text table name for the index. - $text_table = $field['table']; - } - - if (!isset($new_fields[$field_id])) { - // The field is no longer in the index, drop the data. - $this->removeFieldStorage($field_id, $field, $denormalized_table); - unset($fields[$field_id]); - continue; - } - $old_type = $field['type']; - $new_type = $new_fields[$field_id]->getType(); - $fields[$field_id]['type'] = $new_type; - $fields[$field_id]['boost'] = $new_fields[$field_id]->getBoost(); - if ($old_type != $new_type) { - $is_text_type = $this->getDataTypeHelper()->isTextType($new_type); - if ($was_text_type || $is_text_type) { - // A change in fulltext status necessitates completely clearing the - // index. - $reindex = TRUE; - if (!$cleared) { - $cleared = TRUE; - $this->deleteAllIndexItems($index); - } - $this->removeFieldStorage($field_id, $field, $denormalized_table); - // Keep the table in $new_fields to create the new storage. - continue; - } - elseif ($this->sqlType($old_type) != $this->sqlType($new_type)) { - // There is a change in SQL type. We don't have to clear the index, - // since types can be converted. - $sql_spec = $this->sqlType($new_type); - $sql_spec += [ - 'description' => "The field's value for this item", - ]; - $this->database->schema()->changeField($denormalized_table, $field['column'], $field['column'], $sql_spec); - $sql_spec['not null'] = TRUE; - $this->database->schema()->changeField($field['table'], 'value', 'value', $sql_spec); - $reindex = TRUE; - } - elseif ($old_type == 'date' || $new_type == 'date') { - // Even though the SQL type stays the same, we have to reindex since - // conversion rules change. - $reindex = TRUE; - } - } - elseif ($was_text_type && $field['boost'] != $new_fields[$field_id]->getBoost()) { - if (!$reindex) { - // If there was a non-zero boost set previously, we can just update - // all scores with a single UPDATE query. Otherwise, no way around - // re-indexing. - if ($field['boost']) { - $multiplier = $new_fields[$field_id]->getBoost() / $field['boost']; - // Postgres doesn't allow multiplying an integer column with a - // float literal, so we have to work around that. - $expression = 'score * :mult'; - $args = [ - ':mult' => $multiplier, - ]; - if (is_float($multiplier) && $pos = strpos("$multiplier", '.')) { - $expression .= ' / :div'; - $after_point_digits = strlen("$multiplier") - $pos - 1; - $args[':div'] = pow(10, min(3, $after_point_digits)); - $args[':mult'] = (int) round($args[':mult'] * $args[':div']); - } - $this->database->update($text_table) - ->expression('score', $expression, $args) - ->condition('field_name', static::getTextFieldName($field_id)) - ->execute(); - } - else { - $reindex = TRUE; - } - } - } - - // Make sure the table and column now exist. (Especially important when - // we actually add the index for the first time.) - $storage_exists = empty($field['table']) || $this->database->schema() - ->fieldExists($field['table'], 'value'); - $denormalized_storage_exists = $this->database->schema() - ->fieldExists($denormalized_table, $field['column']); - if (!$was_text_type && !$storage_exists) { - $db = [ - 'table' => $field['table'], - ]; - $this->createFieldTable($new_fields[$field_id], $db); - } - // Ensure that a column is created in the denormalized storage even for - // 'text' fields. - if (!$denormalized_storage_exists) { - $db = [ - 'table' => $denormalized_table, - 'column' => $field['column'], - ]; - $this->createFieldTable($new_fields[$field_id], $db, 'index'); - } - unset($new_fields[$field_id]); - } - - $prefix = 'search_api_db_' . $index->id(); - // These are new fields that were previously not indexed. - foreach ($new_fields as $field_id => $field) { - $reindex = TRUE; - $fields[$field_id] = []; - if ($this->getDataTypeHelper()->isTextType($field->getType())) { - if (!isset($text_table)) { - // If we have not encountered a text table, assign a name for it. - $text_table = $this->findFreeTable($prefix . '_', 'text'); - } - $fields[$field_id]['table'] = $text_table; - } - else { - $fields[$field_id]['table'] = $this->findFreeTable($prefix . '_', $field_id); - $this->createFieldTable($field, $fields[$field_id]); - } - - // Always add a column in the denormalized table. - $fields[$field_id]['column'] = $this->findFreeColumn($denormalized_table, $field_id); - $this->createFieldTable($field, ['table' => $denormalized_table, 'column' => $fields[$field_id]['column']], 'index'); - - $fields[$field_id]['type'] = $field->getType(); - $fields[$field_id]['boost'] = $field->getBoost(); - } - - // If needed, make sure the text table exists. - if (isset($text_table) && !$this->database->schema()->tableExists($text_table)) { - $table = [ - 'name' => $text_table, - 'module' => 'search_api_db', - 'fields' => [ - 'item_id' => [ - 'type' => 'varchar', - 'length' => 150, - 'description' => 'The primary identifier of the item', - 'not null' => TRUE, - ], - 'field_name' => [ - 'description' => "The name of the field in which the token appears, or a base-64 encoded sha-256 hash of the field", - 'not null' => TRUE, - 'type' => 'varchar', - 'length' => 191, - ], - 'word' => [ - 'description' => 'The text of the indexed token', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - 'binary' => TRUE, - ], - 'score' => [ - 'description' => 'The score associated with this token', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ], - ], - 'indexes' => [ - 'word_field' => [['word', 20], 'field_name'], - ], - // Add a covering index since word is not repeated for each item. - 'primary key' => ['item_id', 'field_name', 'word'], - ]; - $this->database->schema()->createTable($text_table, $table); - $this->dbmsCompatibility->alterNewTable($text_table, 'text'); - } - - $this->getKeyValueStore()->set($index->id(), $db_info); - - return $reindex; - } - // The database operations might throw PDO or other exceptions, so we catch - // them all and re-wrap them appropriately. - catch (\Exception $e) { - throw new SearchApiException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Drops a field's table and its column from the denormalized table. - * - * @param string $name - * The field name. - * @param array $field - * Backend-internal information about the field. - * @param string $index_table - * The table which stores the denormalized data for this field. - */ - protected function removeFieldStorage($name, array $field, $index_table) { - if ($this->getDataTypeHelper()->isTextType($field['type'])) { - // Remove data from the text table. - $this->database->delete($field['table']) - ->condition('field_name', static::getTextFieldName($name)) - ->execute(); - } - elseif ($this->database->schema()->tableExists($field['table'])) { - // Remove the field table. - $this->database->schema()->dropTable($field['table']); - } - - // Remove the field column from the denormalized table. - $this->database->schema()->dropField($index_table, $field['column']); - } - - /** - * {@inheritdoc} - */ - public function removeIndex($index) { - if (!is_object($index)) { - // If the index got deleted, create a dummy to simplify the code. Since we - // can't know, we assume the index was read-only, just to be on the safe - // side. - $index = Index::create([ - 'id' => $index, - 'read_only' => TRUE, - ]); - } - - $db_info = $this->getIndexDbInfo($index); - - try { - if (!isset($db_info['field_tables']) && !isset($db_info['index_table'])) { - return; - } - // Don't delete the index data of read-only indexes. - if (!$index->isReadOnly()) { - foreach ($db_info['field_tables'] as $field) { - if ($this->database->schema()->tableExists($field['table'])) { - $this->database->schema()->dropTable($field['table']); - } - } - if ($this->database->schema()->tableExists($db_info['index_table'])) { - $this->database->schema()->dropTable($db_info['index_table']); - } - } - - $this->getKeyValueStore()->delete($index->id()); - } - // The database operations might throw PDO or other exceptions, so we catch - // them all and re-wrap them appropriately. - catch (\Exception $e) { - throw new SearchApiException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function indexItems(IndexInterface $index, array $items) { - if (!$this->getIndexDbInfo($index)) { - $index_id = $index->id(); - throw new SearchApiException("No field settings saved for index with ID '$index_id'."); - } - $indexed = []; - foreach ($items as $id => $item) { - try { - $this->indexItem($index, $item); - $indexed[] = $id; - } - catch (\Exception $e) { - // We just log the error, hoping we can index the other items. - $this->getLogger()->warning($e->getMessage()); - } - } - return $indexed; - } - - /** - * Indexes a single item on the specified index. - * - * Used as a helper method in indexItems(). - * - * @param \Drupal\search_api\IndexInterface $index - * The index for which the item is being indexed. - * @param \Drupal\search_api\Item\ItemInterface $item - * The item to index. - * - * @throws \Exception - * Any encountered database (or other) exceptions are passed on, out of this - * method. - */ - protected function indexItem(IndexInterface $index, ItemInterface $item) { - $fields = $this->getFieldInfo($index); - $fields_updated = FALSE; - $field_errors = []; - $db_info = $this->getIndexDbInfo($index); - $denormalized_table = $db_info['index_table']; - $item_id = $item->getId(); - - $transaction = $this->database->startTransaction('search_api_db_indexing'); - - try { - // Remove the item from the denormalized table. - $this->database->delete($denormalized_table) - ->condition('item_id', $item_id) - ->execute(); - - $denormalized_values = []; - $text_inserts = []; - $item_fields = $item->getFields(); - $item_fields += $this->getSpecialFields($index, $item); - foreach ($item_fields as $field_id => $field) { - // Sometimes index changes are not triggering the update hooks - // correctly. Therefore, to avoid DB errors, we re-check the tables - // here before indexing. - if (empty($fields[$field_id]['table']) && !$fields_updated) { - unset($db_info['field_tables'][$field_id]); - $this->fieldsUpdated($index); - $fields_updated = TRUE; - $fields = $db_info['field_tables']; - } - if (empty($fields[$field_id]['table']) && empty($field_errors[$field_id])) { - // Log an error, but only once per field. Since a superfluous field is - // not too serious, we just index the rest of the item normally. - $field_errors[$field_id] = TRUE; - $this->getLogger()->warning("Unknown field @field: please check (and re-save) the index's fields settings.", ['@field' => $field_id]); - continue; - } - - $field_info = $fields[$field_id]; - $table = $field_info['table']; - $column = $field_info['column']; - - $this->database->delete($table) - ->condition('item_id', $item_id) - ->execute(); - - $type = $field->getType(); - $values = []; - foreach ($field->getValues() as $field_value) { - $converted_value = $this->convert($field_value, $type, $field->getOriginalType(), $index); - - // Don't add NULL values to the array of values. Also, adding an empty - // array is, of course, a waste of time. - if (isset($converted_value) && $converted_value !== []) { - $values = array_merge($values, is_array($converted_value) ? $converted_value : [$converted_value]); - } - } - - if (!$values) { - // SQLite sometimes has problems letting columns not present in an - // INSERT statement default to NULL, so we set NULL values for the - // denormalized table explicitly. - $denormalized_values[$column] = NULL; - continue; - } - - // If the field contains more than one value, we remember that the field - // can be multi-valued. - if (count($values) > 1) { - $db_info['field_tables'][$field_id]['multi-valued'] = TRUE; - } - - if ($this->getDataTypeHelper()->isTextType($type)) { - // Remember the text table the first time we encounter it. - if (!isset($text_table)) { - $text_table = $table; - } - - $unique_tokens = []; - $denormalized_value = ''; - /** @var \Drupal\search_api\Plugin\search_api\data_type\value\TextTokenInterface $token */ - foreach ($values as $token) { - $word = $token->getText(); - $score = $token->getBoost() * $item->getBoost(); - - // In rare cases, tokens with leading or trailing whitespace can - // slip through. Since this can lead to errors when such tokens are - // part of a primary key (as in this case), we trim such whitespace - // here. - $word = trim($word); - - // Store the first 30 characters of the string as the denormalized - // value. - if (mb_strlen($denormalized_value) < 30) { - $denormalized_value .= $word . ' '; - } - - // Skip words that are too short, except for numbers. - if (is_numeric($word)) { - $word = ltrim($word, '-0'); - } - elseif (mb_strlen($word) < $this->configuration['min_chars']) { - continue; - } - - // Taken from core search to reflect less importance of words later - // in the text. - // Focus is a decaying value in terms of the amount of unique words - // up to this point. From 100 words and more, it decays, to (for - // example) 0.5 at 500 words and 0.3 at 1000 words. - $score *= min(1, .01 + 3.5 / (2 + count($unique_tokens) * .015)); - - // Only insert each canonical base form of a word once. - $word_base_form = $this->dbmsCompatibility->preprocessIndexValue($word); - - if (!isset($unique_tokens[$word_base_form])) { - $unique_tokens[$word_base_form] = [ - 'value' => $word, - 'score' => $score, - ]; - } - else { - $unique_tokens[$word_base_form]['score'] += $score; - } - } - $denormalized_values[$column] = mb_substr(trim($denormalized_value), 0, 30); - if ($unique_tokens) { - $field_name = static::getTextFieldName($field_id); - $boost = $field_info['boost']; - foreach ($unique_tokens as $token) { - $score = $token['score'] * $boost * self::SCORE_MULTIPLIER; - $score = round($score); - // Take care that the score doesn't exceed the maximum value for - // the database column (2^32-1). - $score = min((int) $score, 4294967295); - $text_inserts[] = [ - 'item_id' => $item_id, - 'field_name' => $field_name, - 'word' => $token['value'], - 'score' => $score, - ]; - } - } - } - else { - $denormalized_values[$column] = reset($values); - - // Make sure no duplicate values are inserted (which would lead to a - // database exception). - // Use the canonical base form of the value for the comparison to - // avoid not catching different values that are duplicates under the - // database table's collation. - $case_insensitive_unique_values = []; - foreach ($values as $value) { - $value_base_form = $this->dbmsCompatibility->preprocessIndexValue("$value", 'field'); - // We still insert the value in its original case. - $case_insensitive_unique_values[$value_base_form] = $value; - } - $values = array_values($case_insensitive_unique_values); - - $insert = $this->database->insert($table) - ->fields(['item_id', 'value']); - foreach ($values as $value) { - $insert->values([ - 'item_id' => $item_id, - 'value' => $value, - ]); - } - $insert->execute(); - } - } - - $this->database->insert($denormalized_table) - ->fields(array_merge($denormalized_values, ['item_id' => $item_id])) - ->execute(); - if ($text_inserts && isset($text_table)) { - $query = $this->database->insert($text_table) - ->fields(['item_id', 'field_name', 'word', 'score']); - foreach ($text_inserts as $row) { - $query->values($row); - } - $query->execute(); - } - - // In case any new fields were detected as multi-valued, we re-save the - // index's DB info. - $this->getKeyValueStore()->set($index->id(), $db_info); - } - catch (\Exception $e) { - $transaction->rollBack(); - throw $e; - } - } - - /** - * Trims long field names to fit into the text table's field_name column. - * - * @param string $name - * The field name. - * - * @return string - * The field name as stored in the field_name column. - */ - protected static function getTextFieldName($name) { - if (strlen($name) > 191) { - // Replace long field names with something unique and predictable. - return Crypt::hashBase64($name); - } - else { - return $name; - } - } - - /** - * Converts a value between two search types. - * - * @param mixed $value - * The value to convert. - * @param string $type - * The Search API type to convert to. (Has to be a type supported by this - * backend.) - * @param string $original_type - * The value's original type. - * @param \Drupal\search_api\IndexInterface $index - * The index for which this conversion takes place. - * - * @return mixed - * The converted value. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if $type is unknown. - */ - protected function convert($value, $type, $original_type, IndexInterface $index) { - if (!isset($value)) { - // For text fields, we have to return an array even if the value is NULL. - return $this->getDataTypeHelper()->isTextType($type) ? [] : NULL; - } - switch ($type) { - case 'text': - /** @var \Drupal\search_api\Plugin\search_api\data_type\value\TextValueInterface $value */ - $tokens = $value->getTokens(); - if ($tokens === NULL) { - $tokens = []; - $text = $value->getText(); - // For dates, splitting the timestamp makes no sense. - if ($original_type == 'date') { - $text = $this->getDateFormatter() - ->format($text, 'custom', 'Y y F M n m j d l D'); - } - foreach (static::splitIntoWords($text) as $word) { - if ($word) { - if (mb_strlen($word) > 50) { - $this->getLogger()->warning('An overlong word (more than 50 characters) was encountered while indexing: %word.
        Since database search servers currently cannot index words of more than 50 characters, the word was truncated for indexing. If this should not be a single word, please make sure the "Tokenizer" processor is enabled and configured correctly for index %index.', ['%word' => $word, '%index' => $index->label()]); - $word = mb_substr($word, 0, 50); - } - $tokens[] = new TextToken($word); - } - } - } - else { - while (TRUE) { - foreach ($tokens as $i => $token) { - // Check for over-long tokens. - $score = $token->getBoost(); - $word = $token->getText(); - if (mb_strlen($word) > 50) { - $new_tokens = []; - foreach (static::splitIntoWords($word) as $word) { - if (mb_strlen($word) > 50) { - $this->getLogger()->warning('An overlong word (more than 50 characters) was encountered while indexing: %word.
        Since database search servers currently cannot index words of more than 50 characters, the word was truncated for indexing. If this should not be a single word, please make sure the "Tokenizer" processor is enabled and configured correctly for index %index.', ['%word' => $word, '%index' => $index->label()]); - $word = mb_substr($word, 0, 50); - } - $new_tokens[] = new TextToken($word, $score); - } - array_splice($tokens, $i, 1, $new_tokens); - // Restart the loop looking through all the tokens. - continue 2; - } - } - break; - } - } - return $tokens; - - case 'string': - // For non-dates, PHP can handle this well enough. - if ($original_type == 'date') { - return date('c', $value); - } - if (mb_strlen($value) > 255) { - $value = mb_substr($value, 0, 255); - $this->getLogger()->warning('An overlong value (more than 255 characters) was encountered while indexing: %value.
        Database search servers currently cannot index such values correctly – the value was therefore trimmed to the allowed length.', ['%value' => $value]); - } - return $value; - - case 'integer': - case 'date': - return (int) $value; - - case 'decimal': - return (float) $value; - - case 'boolean': - return $value ? 1 : 0; - - default: - throw new SearchApiException("Unknown field type '$type'."); - } - } - - /** - * Splits the given string into words. - * - * Word characters as seen by this method are only alphanumerics. - * - * @param string $text - * The string to split. - * - * @return string[] - * All groups of alphanumeric characters contained in the string. - */ - protected static function splitIntoWords($text) { - return preg_split('/[^\p{L}\p{N}]+/u', $text, -1, PREG_SPLIT_NO_EMPTY); - } - - /** - * {@inheritdoc} - */ - public function deleteItems(IndexInterface $index, array $item_ids) { - try { - $db_info = $this->getIndexDbInfo($index); - - if (empty($db_info['field_tables'])) { - return; - } - foreach ($db_info['field_tables'] as $field) { - $this->database->delete($field['table']) - ->condition('item_id', $item_ids, 'IN') - ->execute(); - } - // Delete the denormalized field data. - $this->database->delete($db_info['index_table']) - ->condition('item_id', $item_ids, 'IN') - ->execute(); - } - catch (\Exception $e) { - // The database operations might throw PDO or other exceptions, so we - // catch them all and re-wrap them appropriately. - throw new SearchApiException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function deleteAllIndexItems(IndexInterface $index, $datasource_id = NULL) { - try { - $db_info = $this->getIndexDbInfo($index); - $datasource_field = $db_info['field_tables']['search_api_datasource']['column']; - - foreach ($db_info['field_tables'] as $field_id => $field) { - if (!$datasource_id) { - $this->database->truncate($field['table'])->execute(); - unset($db_info['field_tables'][$field_id]['multi-valued']); - } - else { - if (!isset($query)) { - $query = $this->database->select($db_info['index_table'], 't') - ->fields('t', ['item_id']) - ->condition($datasource_field, $datasource_id); - } - $this->database->delete($field['table']) - ->condition('item_id', clone $query, 'IN') - ->execute(); - } - } - - if (!$datasource_id) { - $this->getKeyValueStore()->set($index->id(), $db_info); - $this->database->truncate($db_info['index_table'])->execute(); - } - else { - $this->database->delete($db_info['index_table']) - ->condition($datasource_field, $datasource_id) - ->execute(); - } - } - catch (\Exception $e) { - // The database operations might throw PDO or other exceptions, so we - // catch them all and re-wrap them appropriately. - throw new SearchApiException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function search(QueryInterface $query) { - $this->ignored = $this->warnings = []; - $index = $query->getIndex(); - $db_info = $this->getIndexDbInfo($index); - - if (!isset($db_info['field_tables'])) { - $index_id = $index->id(); - throw new SearchApiException("No field settings saved for index with ID '$index_id'."); - } - $fields = $this->getFieldInfo($index); - $fields['search_api_id'] = [ - 'column' => 'item_id', - ]; - - $db_query = $this->createDbQuery($query, $fields); - - $results = $query->getResults(); - - $skip_count = $query->getOption('skip result count'); - $count = NULL; - if (!$skip_count) { - $count_query = $db_query->countQuery(); - $count = $count_query->execute()->fetchField(); - $results->setResultCount($count); - } - - // With a "min_count" of 0, some facets can even be available if there are - // no results. - if ($query->getOption('search_api_facets')) { - $facets = $this->getFacets($query, clone $db_query, $count); - $results->setExtraData('search_api_facets', $facets); - } - // Everything else can be skipped if the count is 0. - if ($skip_count || $count) { - $query_options = $query->getOptions(); - if (isset($query_options['offset']) || isset($query_options['limit'])) { - $offset = isset($query_options['offset']) ? $query_options['offset'] : 0; - $limit = isset($query_options['limit']) ? $query_options['limit'] : 1000000; - $db_query->range($offset, $limit); - } - - $this->setQuerySort($query, $db_query, $fields); - - $result = $db_query->execute(); - - foreach ($result as $row) { - $item = $this->getFieldsHelper()->createItem($index, $row->item_id); - $item->setScore($row->score / self::SCORE_MULTIPLIER); - $results->addResultItem($item); - } - if ($skip_count && !empty($item)) { - $results->setResultCount(1); - } - } - - // Add additional warnings and ignored keys. - $metadata = [ - 'warnings' => 'addWarning', - 'ignored' => 'addIgnoredSearchKey', - ]; - foreach ($metadata as $property => $method) { - foreach (array_keys($this->$property) as $value) { - $results->$method($value); - } - } - } - - /** - * Creates a database query for a search. - * - * Used as a helper method in search() and getAutocompleteSuggestions(). - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The search query for which to create the database query. - * @param array $fields - * The internal field information to use. - * - * @return \Drupal\Core\Database\Query\SelectInterface - * A database query object which will return the appropriate results (except - * for the range and sorting) for the given search query. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if some illegal query setting (unknown field, etc.) was - * encountered. - */ - protected function createDbQuery(QueryInterface $query, array $fields) { - $keys = &$query->getKeys(); - $keys_set = (boolean) $keys; - $keys = $this->prepareKeys($keys); - - // Only filter by fulltext keys if there are any real keys present. - if ($keys && (!is_array($keys) || count($keys) > 2 || (!isset($keys['#negation']) && count($keys) > 1))) { - // Special case: if the outermost $keys array has "#negation" set, we - // can't handle it like other negated subkeys. To avoid additional - // complexity later, we just wrap $keys so it becomes a subkey. - if (!empty($keys['#negation'])) { - $keys = [ - '#conjunction' => 'AND', - $keys, - ]; - } - - $fulltext_fields = $this->getQueryFulltextFields($query); - if ($fulltext_fields) { - $fulltext_field_information = []; - foreach ($fulltext_fields as $name) { - if (!isset($fields[$name])) { - throw new SearchApiException("Unknown field '$name' specified as search target."); - } - if (!$this->getDataTypeHelper()->isTextType($fields[$name]['type'])) { - $types = $this->getDataTypePluginManager()->getInstances(); - $type = $types[$fields[$name]['type']]->label(); - throw new SearchApiException("Cannot perform fulltext search on field '$name' of type '$type'."); - } - $fulltext_field_information[$name] = $fields[$name]; - } - - $db_query = $this->createKeysQuery($keys, $fulltext_field_information, $fields, $query->getIndex()); - } - else { - $this->getLogger()->warning('Search keys are given but no fulltext fields are defined.'); - $msg = $this->t('Search keys are given but no fulltext fields are defined.'); - $this->warnings[(string) $msg] = 1; - } - } - elseif ($keys_set) { - $msg = $this->t('No valid search keys were present in the query.'); - $this->warnings[(string) $msg] = 1; - } - - if (!isset($db_query)) { - $db_info = $this->getIndexDbInfo($query->getIndex()); - $db_query = $this->database->select($db_info['index_table'], 't'); - $db_query->addField('t', 'item_id', 'item_id'); - $db_query->addExpression(':score', 'score', [':score' => self::SCORE_MULTIPLIER]); - $db_query->distinct(); - } - - $condition_group = $query->getConditionGroup(); - $this->addLanguageConditions($condition_group, $query); - if ($condition_group->getConditions()) { - $condition = $this->createDbCondition($condition_group, $fields, $db_query, $query->getIndex()); - if ($condition) { - $db_query->condition($condition); - } - } - - $db_query->addTag('search_api_db_search'); - $db_query->addMetaData('search_api_query', $query); - $db_query->addMetaData('search_api_db_fields', $fields); - - // Allow subclasses and other modules to alter the query (before a count - // query is constructed from it). - $this->getModuleHandler()->alter('search_api_db_query', $db_query, $query); - $this->preQuery($db_query, $query); - - return $db_query; - } - - /** - * Removes nested expressions and phrase groupings from the search keys. - * - * Used as a helper method in createDbQuery() and createDbCondition(). - * - * @param array|string|null $keys - * The keys which should be preprocessed. - * - * @return array|string|null - * The preprocessed keys. - */ - protected function prepareKeys($keys) { - if (is_scalar($keys)) { - $keys = $this->splitKeys($keys); - return is_array($keys) ? $this->eliminateDuplicates($keys) : $keys; - } - elseif (!$keys) { - return NULL; - } - $keys = $this->eliminateDuplicates($this->splitKeys($keys)); - $conj = $keys['#conjunction']; - $neg = !empty($keys['#negation']); - foreach ($keys as $i => &$nested) { - if (is_array($nested)) { - $nested = $this->prepareKeys($nested); - if (is_array($nested) && $neg == !empty($nested['#negation'])) { - if ($nested['#conjunction'] == $conj) { - unset($nested['#conjunction'], $nested['#negation']); - foreach ($nested as $renested) { - $keys[] = $renested; - } - unset($keys[$i]); - } - } - } - } - $keys = array_filter($keys); - if (($count = count($keys)) <= 2) { - if ($count < 2 || isset($keys['#negation'])) { - $keys = NULL; - } - else { - unset($keys['#conjunction']); - $keys = reset($keys); - } - } - return $keys; - } - - /** - * Splits a keyword expression into separate words. - * - * Used as a helper method in prepareKeys(). - * - * @param array|string $keys - * The keys to split. - * - * @return array|string|null - * The keys split into separate words. - */ - protected function splitKeys($keys) { - if (is_scalar($keys)) { - $processed_keys = $this->dbmsCompatibility->preprocessIndexValue(trim($keys)); - if (is_numeric($processed_keys)) { - return ltrim($processed_keys, '-0'); - } - elseif (mb_strlen($processed_keys) < $this->configuration['min_chars']) { - $this->ignored[$keys] = 1; - return NULL; - } - $words = static::splitIntoWords($processed_keys); - if (count($words) > 1) { - $processed_keys = $this->splitKeys($words); - if ($processed_keys) { - $processed_keys['#conjunction'] = 'AND'; - } - else { - $processed_keys = NULL; - } - } - return $processed_keys; - } - foreach ($keys as $i => $key) { - if (Element::child($i)) { - $keys[$i] = $this->splitKeys($key); - } - } - return array_filter($keys); - } - - /** - * Eliminates duplicate keys from a keyword array. - * - * Used as a helper method in prepareKeys(). - * - * @param array $keys - * The keywords to parse. - * @param array $words - * (optional) A cache of all encountered words so far. Used internally for - * recursive invocations. - * - * @return array - * The processed keywords. - */ - protected function eliminateDuplicates(array $keys, array &$words = []) { - foreach ($keys as $i => $word) { - if (!Element::child($i)) { - continue; - } - if (is_scalar($word)) { - if (isset($words[$word])) { - unset($keys[$i]); - } - else { - $words[$word] = TRUE; - } - } - else { - $keys[$i] = $this->eliminateDuplicates($word, $words); - } - } - return $keys; - } - - /** - * Creates a SELECT query for given search keys. - * - * Used as a helper method in createDbQuery() and createDbCondition(). - * - * @param string|array $keys - * The search keys, formatted like the return value of - * \Drupal\search_api\ParseMode\ParseModeInterface::parseInput(), but - * preprocessed according to internal requirements. - * @param array $fields - * The fulltext fields on which to search, with their names as keys mapped - * to internal information about them. - * @param array $all_fields - * Internal information about all indexed fields on the index. - * @param \Drupal\search_api\IndexInterface $index - * The index we're searching on. - * - * @return \Drupal\Core\Database\Query\SelectInterface - * A SELECT query returning item_id and score (or only item_id, if - * $keys['#negation'] is set). - */ - protected function createKeysQuery($keys, array $fields, array $all_fields, IndexInterface $index) { - if (!is_array($keys)) { - $keys = [ - '#conjunction' => 'AND', - $keys, - ]; - } - - $neg = !empty($keys['#negation']); - $conj = $keys['#conjunction']; - $words = []; - $nested = []; - $negated = []; - $db_query = NULL; - $mul_words = FALSE; - $neg_nested = $neg && $conj == 'AND'; - $match_parts = $this->configuration['matching'] !== 'words'; - $keyword_hits = []; - $prefix_search = $this->configuration['matching'] === 'prefix'; - - foreach ($keys as $i => $key) { - if (!Element::child($i)) { - continue; - } - if (is_scalar($key)) { - $words[] = $key; - } - elseif (empty($key['#negation'])) { - if ($neg) { - // If this query is negated, we also only need item IDs from - // subqueries. - $key['#negation'] = TRUE; - } - $nested[] = $key; - } - else { - $negated[] = $key; - } - } - $word_count = count($words); - $subs = $word_count + count($nested); - $not_nested = ($subs <= 1 && count($fields) == 1) || ($neg && $conj == 'OR' && !$negated); - - if ($words) { - // All text fields in the index share a table. Get name from the first. - $field = reset($fields); - $db_query = $this->database->select($field['table'], 't'); - $mul_words = ($word_count > 1); - if ($neg_nested) { - $db_query->fields('t', ['item_id', 'word']); - } - elseif ($neg) { - $db_query->fields('t', ['item_id']); - } - elseif ($not_nested) { - $db_query->fields('t', ['item_id', 'score']); - } - else { - $db_query->fields('t', ['item_id', 'score', 'word']); - } - - if (!$match_parts) { - $db_query->condition('word', $words, 'IN'); - } - else { - $db_or = new Condition('OR'); - // GROUP BY all existing non-grouped, non-aggregated columns – except - // "word", which we remove since it will be useless to us in this case. - $columns = &$db_query->getFields(); - unset($columns['word']); - foreach (array_keys($columns) as $column) { - $db_query->groupBy($column); - } - - foreach ($words as $i => $word) { - $like = $this->database->escapeLike($word); - $like = $prefix_search ? "$like%" : "%$like%"; - $db_or->condition('t.word', $like, 'LIKE'); - - // Add an expression for each keyword that shows whether the indexed - // word matches that particular keyword. That way we don't return a - // result multiple times if a single indexed word (partially) matches - // multiple keywords. We also remember the column name so we can - // afterwards verify that each word matched at least once. - $alias = 'w' . $i; - $like = '%' . $this->database->escapeLike($word) . '%'; - $alias = $db_query->addExpression("CASE WHEN t.word LIKE :like_$alias THEN 1 ELSE 0 END", $alias, [":like_$alias" => $like]); - $db_query->groupBy($alias); - $keyword_hits[] = $alias; - } - // Also add expressions for any nested queries. - for ($i = $word_count; $i < $subs; ++$i) { - $alias = 'w' . $i; - $alias = $db_query->addExpression('0', $alias); - $db_query->groupBy($alias); - $keyword_hits[] = $alias; - } - $db_query->condition($db_or); - } - - $db_query->condition('field_name', array_map([__CLASS__, 'getTextFieldName'], array_keys($fields)), 'IN'); - } - - if ($nested) { - $word = ''; - foreach ($nested as $i => $k) { - $query = $this->createKeysQuery($k, $fields, $all_fields, $index); - if (!$neg) { - if (!$match_parts) { - $word .= ' '; - $var = ':word' . strlen($word); - $query->addExpression($var, 'word', [$var => $word]); - } - else { - $i += $word_count; - for ($j = 0; $j < $subs; ++$j) { - $alias = isset($keyword_hits[$j]) ? $keyword_hits[$j] : "w$j"; - $keyword_hits[$j] = $query->addExpression($i == $j ? '1' : '0', $alias); - } - } - } - if (!isset($db_query)) { - $db_query = $query; - } - elseif ($not_nested) { - $db_query->union($query, 'UNION'); - } - else { - $db_query->union($query, 'UNION ALL'); - } - } - } - - if (isset($db_query) && !$not_nested) { - $db_query = $this->database->select($db_query, 't'); - $db_query->addField('t', 'item_id', 'item_id'); - if (!$neg) { - $db_query->addExpression('SUM(t.score)', 'score'); - $db_query->groupBy('t.item_id'); - } - if ($conj == 'AND' && $subs > 1) { - $var = ':subs' . ((int) $subs); - if (!$db_query->getGroupBy()) { - $db_query->groupBy('t.item_id'); - } - if (!$match_parts) { - if ($mul_words) { - $db_query->having('COUNT(DISTINCT t.word) >= ' . $var, [$var => $subs]); - } - else { - $db_query->having('COUNT(t.word) >= ' . $var, [$var => $subs]); - } - } - else { - foreach ($keyword_hits as $alias) { - $db_query->having("SUM($alias) >= 1"); - } - } - } - } - - if ($negated) { - if (!isset($db_query) || $conj == 'OR') { - if (isset($db_query)) { - // We are in a rather bizarre case where the keys are something like - // "a OR (NOT b)". - $old_query = $db_query; - } - - // We use this table because all items should be contained exactly once. - $db_info = $this->getIndexDbInfo($index); - $db_query = $this->database->select($db_info['index_table'], 't'); - $db_query->addField('t', 'item_id', 'item_id'); - if (!$neg) { - $db_query->addExpression(':score', 'score', [':score' => self::SCORE_MULTIPLIER]); - $db_query->distinct(); - } - } - - if ($conj == 'AND') { - foreach ($negated as $k) { - $db_query->condition('t.item_id', $this->createKeysQuery($k, $fields, $all_fields, $index), 'NOT IN'); - } - } - else { - $or = new Condition('OR'); - foreach ($negated as $k) { - $or->condition('t.item_id', $this->createKeysQuery($k, $fields, $all_fields, $index), 'NOT IN'); - } - if (isset($old_query)) { - $or->condition('t.item_id', $old_query, 'NOT IN'); - } - $db_query->condition($or); - } - } - - if ($neg_nested) { - $db_query = $this->database->select($db_query, 't')->fields('t', ['item_id']); - } - - return $db_query; - } - - /** - * Adds item language conditions to the condition group, if applicable. - * - * @param \Drupal\search_api\Query\ConditionGroupInterface $condition_group - * The condition group on which to set conditions. - * @param \Drupal\search_api\Query\QueryInterface $query - * The query to inspect for language settings. - * - * @see \Drupal\search_api\Query\QueryInterface::getLanguages() - */ - protected function addLanguageConditions(ConditionGroupInterface $condition_group, QueryInterface $query) { - $languages = $query->getLanguages(); - if ($languages !== NULL) { - $condition_group->addCondition('search_api_language', $languages, 'IN'); - } - } - - /** - * Creates a database query condition for a given search filter. - * - * Used as a helper method in createDbQuery(). - * - * @param \Drupal\search_api\Query\ConditionGroupInterface $conditions - * The conditions for which a condition should be created. - * @param array $fields - * Internal information about the index's fields. - * @param \Drupal\Core\Database\Query\SelectInterface $db_query - * The database query to which the condition will be added. - * @param \Drupal\search_api\IndexInterface $index - * The index we're searching on. - * - * @return \Drupal\Core\Database\Query\ConditionInterface|null - * The condition to set on the query, or NULL if none is necessary. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an unknown field or operator was used in one of the contained - * conditions. - */ - protected function createDbCondition(ConditionGroupInterface $conditions, array $fields, SelectInterface $db_query, IndexInterface $index) { - $conjunction = $conditions->getConjunction(); - $db_condition = new Condition($conjunction); - $db_info = $this->getIndexDbInfo($index); - - // Store the table aliases for the fields in this condition group. - $tables = []; - $wildcard_count = 0; - foreach ($conditions->getConditions() as $condition) { - if ($condition instanceof ConditionGroupInterface) { - $sub_condition = $this->createDbCondition($condition, $fields, $db_query, $index); - if ($sub_condition) { - $db_condition->condition($sub_condition); - } - } - else { - $field = $condition->getField(); - $operator = $condition->getOperator(); - $value = $condition->getValue(); - $this->validateOperator($operator); - $not_equals_operators = ['<>', 'NOT IN', 'NOT BETWEEN']; - $not_equals = in_array($operator, $not_equals_operators); - $not_between = $operator == 'NOT BETWEEN'; - - if (!isset($fields[$field])) { - throw new SearchApiException("Unknown field in filter clause: '$field'."); - } - $field_info = $fields[$field]; - // For NULL values, we can just use the single-values table, since we - // only need to know if there's any value at all for that field. - if ($value === NULL || empty($field_info['multi-valued'])) { - if (empty($tables[NULL])) { - $table = ['table' => $db_info['index_table']]; - $tables[NULL] = $this->getTableAlias($table, $db_query); - } - $column = $tables[NULL] . '.' . $field_info['column']; - if ($value === NULL) { - $method = $not_equals ? 'isNotNull' : 'isNull'; - $db_condition->$method($column); - } - elseif ($not_between) { - $nested_condition = new Condition('OR'); - $nested_condition->condition($column, $value[0], '<'); - $nested_condition->condition($column, $value[1], '>'); - $nested_condition->isNull($column); - $db_condition->condition($nested_condition); - } - elseif ($not_equals) { - // Since SQL never returns TRUE for comparison with NULL values, we - // need to include "OR field IS NULL" explicitly for some operators. - $nested_condition = new Condition('OR'); - $nested_condition->condition($column, $value, $operator); - $nested_condition->isNull($column); - $db_condition->condition($nested_condition); - } - else { - $db_condition->condition($column, $value, $operator); - } - } - elseif ($this->getDataTypeHelper()->isTextType($field_info['type'])) { - $keys = $this->prepareKeys($value); - if (!isset($keys)) { - continue; - } - $query = $this->createKeysQuery($keys, [$field => $field_info], $fields, $index); - // We only want the item IDs, so we use the keys query as a nested - // query. - $query = $this->database->select($query, 't') - ->fields('t', ['item_id']); - $db_condition->condition('t.item_id', $query, $not_equals ? 'NOT IN' : 'IN'); - } - elseif ($not_equals) { - // The situation is more complicated for negative conditions on - // multi-valued fields, since we must make sure that results are - // excluded if ANY of the field's values equals the one(s) given in - // this condition. Probably the most performant way to do this is to - // do a LEFT JOIN with a positive filter on the excluded values in the - // ON clause and then make sure we have no value for the field. - if ($not_between) { - $wildcard1 = ':values_' . ++$wildcard_count; - $wildcard2 = ':values_' . ++$wildcard_count; - $arguments = array_combine([$wildcard1, $wildcard2], $value); - $additional_on = "%alias.value BETWEEN $wildcard1 AND $wildcard2"; - } - else { - $wildcard = ':values_' . ++$wildcard_count . '[]'; - $arguments = [$wildcard => (array) $value]; - $additional_on = "%alias.value IN ($wildcard)"; - } - $alias = $this->getTableAlias($field_info, $db_query, TRUE, 'leftJoin', $additional_on, $arguments); - $db_condition->isNull($alias . '.value'); - } - else { - // We need to join the table if it hasn't been joined (for this - // condition group) before, or if we have "AND" as the active - // conjunction. - if ($conjunction == 'AND' || empty($tables[$field])) { - $tables[$field] = $this->getTableAlias($field_info, $db_query, TRUE); - } - $column = $tables[$field] . '.value'; - $db_condition->condition($column, $value, $operator); - } - } - } - return $db_condition->count() ? $db_condition : NULL; - } - - /** - * Joins a field's table into a database select query. - * - * @param array $field - * The field information array. The "table" key should contain the table - * name to which a join should be made. - * @param \Drupal\Core\Database\Query\SelectInterface $db_query - * The database query used. - * @param bool $new_join - * (optional) If TRUE, a join is done even if the table was already joined - * to in the query. - * @param string $join - * (optional) The join method to use. Must be a method of the $db_query. - * Normally, "join", "innerJoin", "leftJoin" and "rightJoin" are supported. - * @param string|null $additional_on - * (optional) If given, an SQL string with additional conditions for the ON - * clause of the join. - * @param array $on_arguments - * (optional) Additional arguments for the ON clause. - * - * @return string - * The alias for the field's table. - */ - protected function getTableAlias(array $field, SelectInterface $db_query, $new_join = FALSE, $join = 'leftJoin', $additional_on = NULL, array $on_arguments = []) { - if (!$new_join) { - foreach ($db_query->getTables() as $alias => $info) { - $table = $info['table']; - if (is_scalar($table) && $table == $field['table']) { - return $alias; - } - } - } - $condition = 't.item_id = %alias.item_id'; - if ($additional_on) { - $condition .= ' AND ' . $additional_on; - } - return $db_query->$join($field['table'], 't', $condition, $on_arguments); - } - - /** - * Preprocesses a search's database query before it is executed. - * - * This allows subclasses to alter the DB query before a count query (or facet - * queries, or other related queries) are constructed from it. - * - * @param \Drupal\Core\Database\Query\SelectInterface $db_query - * The database query to be executed for the search. Will have "item_id" and - * "score" columns in its result. - * @param \Drupal\search_api\Query\QueryInterface $query - * The search query that is being executed. - * - * @see hook_search_api_db_query_alter() - */ - protected function preQuery(SelectInterface &$db_query, QueryInterface $query) {} - - /** - * Adds the approiate "ORDER BY" statements to a search database query. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The search query whose sorts should be applied. - * @param \Drupal\Core\Database\Query\SelectInterface $db_query - * The database query constructed for the search. - * @param string[][] $fields - * An array containing information about the internal server storage of the - * indexed fields. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an illegal sort was specified. - */ - protected function setQuerySort(QueryInterface $query, SelectInterface $db_query, array $fields) { - $sort = $query->getSorts(); - if ($sort) { - $db_fields = $db_query->getFields(); - foreach ($sort as $field_name => $order) { - if ($order != QueryInterface::SORT_ASC && $order != QueryInterface::SORT_DESC) { - $msg = $this->t('Unknown sort order @order. Assuming "@default".', [ - '@order' => $order, - '@default' => QueryInterface::SORT_ASC, - ]); - $this->warnings[(string) $msg] = 1; - $order = QueryInterface::SORT_ASC; - } - if ($field_name == 'search_api_relevance') { - $db_query->orderBy('score', $order); - continue; - } - - if (!isset($fields[$field_name])) { - throw new SearchApiException("Trying to sort on unknown field '$field_name'."); - } - $index_table = $this->getIndexDbInfo($query->getIndex())['index_table']; - $alias = $this->getTableAlias(['table' => $index_table], $db_query); - $db_query->orderBy($alias . '.' . $fields[$field_name]['column'], $order); - // PostgreSQL automatically adds a field to the SELECT list when - // sorting on it. Therefore, if we have aggregations present we also - // have to add the field to the GROUP BY (since Drupal won't do it for - // us). However, if no aggregations are present, a GROUP BY would lead - // to another error. Therefore, we only add it if there is already a - // GROUP BY. - if ($db_query->getGroupBy()) { - $db_query->groupBy($alias . '.' . $fields[$field_name]['column']); - } - // For SELECT DISTINCT queries in combination with an ORDER BY clause, - // MySQL 5.7 and higher require that the ORDER BY expressions are part - // of the field list. Ensure that all fields used for sorting are part - // of the select list. - if (empty($db_fields[$fields[$field_name]['column']])) { - $db_query->addField($alias, $fields[$field_name]['column']); - } - } - } - else { - $db_query->orderBy('score', 'DESC'); - } - } - - /** - * Computes facets for a search query. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The search query for which facets should be computed. - * @param \Drupal\Core\Database\Query\SelectInterface $db_query - * A database select query which returns all results of that search query. - * @param int|null $result_count - * (optional) The total number of results of the search query, if known. - * - * @return array - * An array of facets, as specified by the search_api_facets feature. - */ - protected function getFacets(QueryInterface $query, SelectInterface $db_query, $result_count = NULL) { - $fields = $this->getFieldInfo($query->getIndex()); - $ret = []; - foreach ($query->getOption('search_api_facets') as $key => $facet) { - if (empty($fields[$facet['field']])) { - $msg = $this->t('Unknown facet field @field.', ['@field' => $facet['field']]); - $this->warnings[(string) $msg] = 1; - continue; - } - $field = $fields[$facet['field']]; - - if (empty($facet['operator']) || $facet['operator'] != 'or') { - // First, check whether this can even possibly have any results. - if ($result_count !== NULL && $result_count < $facet['min_count']) { - continue; - } - - // All the AND facets can use the main query. If we didn't yet create a - // temporary table for them yet, do so now. - if (!isset($table)) { - $table = $this->getTemporaryResultsTable($db_query); - } - if ($table) { - $select = $this->database->select($table, 't'); - } - else { - // If no temporary table could be created (most likely due to a - // missing permission), use a nested query instead. - $select = $this->database->select(clone $db_query, 't'); - } - // In case we didn't get the result count passed to the method, we can - // get it now. (This allows us to skip AND facets with a min_count - // higher than the result count.) - if ($result_count === NULL) { - $result_count = $select->countQuery()->execute()->fetchField(); - if ($result_count < $facet['min_count']) { - continue; - } - } - } - else { - // For OR facets, we need to build a different base query that excludes - // the facet filters applied to the facet. - $or_query = clone $query; - $conditions = &$or_query->getConditionGroup()->getConditions(); - $tag = 'facet:' . $facet['field']; - foreach ($conditions as $i => $condition) { - if ($condition instanceof ConditionGroupInterface && $condition->hasTag($tag)) { - unset($conditions[$i]); - } - } - try { - $or_db_query = $this->createDbQuery($or_query, $fields); - } - catch (SearchApiException $e) { - $this->logException($e, '%type while trying to create a facets query: @message in %function (line %line of %file).'); - continue; - } - $select = $this->database->select($or_db_query, 't'); - } - - // If "Include missing facet" is disabled, we use an INNER JOIN and add IS - // NOT NULL for shared tables. - $is_text_type = $this->getDataTypeHelper()->isTextType($field['type']); - $alias = $this->getTableAlias($field, $select, TRUE, $facet['missing'] ? 'leftJoin' : 'innerJoin'); - $select->addField($alias, $is_text_type ? 'word' : 'value', 'value'); - if ($is_text_type) { - $select->condition($alias . '.field_name', $this->getTextFieldName($facet['field'])); - } - if (!$facet['missing'] && !$is_text_type) { - $select->isNotNull($alias . '.value'); - } - $select->addExpression('COUNT(DISTINCT t.item_id)', 'num'); - $select->groupBy('value'); - $select->orderBy('num', 'DESC'); - $select->orderBy('value', 'ASC'); - - $limit = $facet['limit']; - if ((int) $limit > 0) { - $select->range(0, $limit); - } - if ($facet['min_count'] > 1) { - $select->having('COUNT(DISTINCT t.item_id) >= :count', [':count' => $facet['min_count']]); - } - - $terms = []; - $values = []; - $has_missing = FALSE; - foreach ($select->execute() as $row) { - $terms[] = [ - 'count' => $row->num, - 'filter' => isset($row->value) ? '"' . $row->value . '"' : '!', - ]; - if (isset($row->value)) { - $values[] = $row->value; - } - else { - $has_missing = TRUE; - } - } - - // If 'Minimum facet count' is set to 0 in the display options for this - // facet, we need to retrieve all facets, even ones that aren't matched in - // our search result set above. Here we SELECT all DISTINCT facets, and - // add in those facets that weren't added above. - if ($facet['min_count'] < 1) { - $select = $this->database->select($field['table'], 't'); - $select->addField('t', 'value', 'value'); - $select->distinct(); - if ($values) { - $select->condition('value', $values, 'NOT IN'); - } - $select->isNotNull('value'); - foreach ($select->execute() as $row) { - $terms[] = [ - 'count' => 0, - 'filter' => '"' . $row->value . '"', - ]; - } - if ($facet['missing'] && !$has_missing) { - $terms[] = [ - 'count' => 0, - 'filter' => '!', - ]; - } - } - - $ret[$key] = $terms; - } - return $ret; - } - - /** - * Creates a temporary table from a select query. - * - * Will return the name of a table containing the item IDs of all results, or - * FALSE on failure. - * - * @param \Drupal\Core\Database\Query\SelectInterface $db_query - * The select query whose results should be stored in the temporary table. - * - * @return string|false - * The name of the temporary table, or FALSE on failure. - */ - protected function getTemporaryResultsTable(SelectInterface $db_query) { - // We only need the id field, not the score. - $fields = &$db_query->getFields(); - unset($fields['score']); - if (count($fields) != 1 || !isset($fields['item_id'])) { - $this->getLogger()->warning('Error while adding facets: only "item_id" field should be used, used are: @fields.', ['@fields' => implode(', ', array_keys($fields))]); - return FALSE; - } - $expressions = &$db_query->getExpressions(); - $expressions = []; - - // Remove the ORDER BY clause, as it may refer to expressions that are - // unset above. - $orderBy = &$db_query->getOrderBy(); - $orderBy = []; - - // If there's a GROUP BY for item_id, we leave that, all others need to be - // discarded. - $group_by = &$db_query->getGroupBy(); - $group_by = array_intersect_key($group_by, ['t.item_id' => TRUE]); - - $db_query->distinct(); - if (!$db_query->preExecute()) { - return FALSE; - } - $args = $db_query->getArguments(); - try { - $result = $this->database->queryTemporary((string) $db_query, $args); - } - catch (\PDOException $e) { - $this->logException($e, '%type while trying to create a temporary table: @message in %function (line %line of %file).'); - return FALSE; - } - catch (DatabaseException $e) { - $this->logException($e, '%type while trying to create a temporary table: @message in %function (line %line of %file).'); - return FALSE; - } - return $result; - } - - /** - * Retrieves autocompletion suggestions for some user input. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * A query representing the base search, with all completely entered words - * in the user input so far as the search keys. - * @param \Drupal\search_api_autocomplete\SearchInterface $search - * An object containing details about the search the user is on, and - * settings for the autocompletion. See the class documentation for details. - * Especially $search->getOptions() should be checked for settings, like - * whether to try and estimate result counts for returned suggestions. - * @param string $incomplete_key - * The start of another fulltext keyword for the search, which should be - * completed. Might be empty, in which case all user input up to now was - * considered completed. Then, additional keywords for the search could be - * suggested. - * @param string $user_input - * The complete user input for the fulltext search keywords so far. - * - * @return \Drupal\search_api_autocomplete\Suggestion\SuggestionInterface[] - * An array of autocomplete suggestions. - * - * @see \Drupal\search_api_autocomplete\AutocompleteBackendInterface::getAutocompleteSuggestions() - */ - public function getAutocompleteSuggestions(QueryInterface $query, SearchInterface $search, $incomplete_key, $user_input) { - $settings = $this->configuration['autocomplete']; - - // If none of the options is checked, the user apparently chose a very - // roundabout way of telling us he doesn't want autocompletion. - if (!array_filter($settings)) { - return []; - } - - $index = $query->getIndex(); - $db_info = $this->getIndexDbInfo($index); - if (empty($db_info['field_tables'])) { - return []; - } - $fields = $this->getFieldInfo($index); - - $suggestions = []; - $factory = new SuggestionFactory($user_input); - $passes = []; - $incomplete_like = NULL; - - // Make the input lowercase as the indexed data is (usually) also all - // lowercase. - $incomplete_key = mb_strtolower($incomplete_key); - $user_input = mb_strtolower($user_input); - - // Decide which methods we want to use. - if ($incomplete_key && $settings['suggest_suffix']) { - $passes[] = 1; - $incomplete_like = $this->database->escapeLike($incomplete_key) . '%'; - } - if ($settings['suggest_words'] && (!$incomplete_key || strlen($incomplete_key) >= $this->configuration['min_chars'])) { - $passes[] = 2; - } - - if (!$passes) { - return []; - } - - // We want about half of the suggestions from each enabled method. - $limit = $query->getOption('limit', 10); - $limit /= count($passes); - $limit = ceil($limit); - - // Also collect all keywords already contained in the query so we don't - // suggest them. - $keys = static::splitIntoWords($user_input); - $keys = array_combine($keys, $keys); - - foreach ($passes as $pass) { - if ($pass == 2 && $incomplete_key) { - $query->keys($user_input); - } - // To avoid suggesting incomplete words, we have to temporarily disable - // partial matching. There should be no way we'll save the server during - // the createDbQuery() call, so this should be safe. - $configuration = $this->configuration; - $db_query = NULL; - try { - $this->configuration['matching'] = 'words'; - $db_query = $this->createDbQuery($query, $fields); - $this->configuration = $configuration; - - // We need a list of all current results to match the suggestions - // against. However, since MySQL doesn't allow using a temporary table - // multiple times in one query, we regrettably have to do it this way. - $fulltext_fields = $this->getQueryFulltextFields($query); - if (count($fulltext_fields) > 1) { - $all_results = $db_query->execute()->fetchCol(); - // Compute the total number of results so we can later sort out - // matches that occur too often. - $total = count($all_results); - } - else { - $table = $this->getTemporaryResultsTable($db_query); - if (!$table) { - return []; - } - $all_results = $this->database->select($table, 't') - ->fields('t', ['item_id']); - $sql = "SELECT COUNT(item_id) FROM {{$table}}"; - $total = $this->database->query($sql)->fetchField(); - } - } - catch (SearchApiException $e) { - // If the exception was in createDbQuery(), we need to reset the - // configuration here. - $this->configuration = $configuration; - $this->logException($e, '%type while trying to create autocomplete suggestions: @message in %function (line %line of %file).'); - continue; - } - $max_occurrences = $this->getConfigFactory() - ->get('search_api_db.settings') - ->get('autocomplete_max_occurrences'); - $max_occurrences = max(1, floor($total * $max_occurrences)); - - if (!$total) { - if ($pass == 1) { - return []; - } - continue; - } - - /** @var \Drupal\Core\Database\Query\SelectInterface|null $word_query */ - $word_query = NULL; - foreach ($fulltext_fields as $field) { - if (!isset($fields[$field]) || !$this->getDataTypeHelper()->isTextType($fields[$field]['type'])) { - continue; - } - $field_query = $this->database->select($fields[$field]['table'], 't'); - $field_query->fields('t', ['word', 'item_id']) - ->condition('field_name', $field) - ->condition('item_id', $all_results, 'IN'); - if ($pass == 1) { - $field_query->condition('word', $incomplete_like, 'LIKE') - ->condition('word', $keys, 'NOT IN'); - } - if (!isset($word_query)) { - $word_query = $field_query; - } - else { - $word_query->union($field_query); - } - } - if (!$word_query) { - return []; - } - $db_query = $this->database->select($word_query, 't'); - $db_query->addExpression('COUNT(DISTINCT item_id)', 'results'); - $db_query->fields('t', ['word']) - ->groupBy('word') - ->having('COUNT(DISTINCT item_id) <= :max', [':max' => $max_occurrences]) - ->orderBy('results', 'DESC') - ->range(0, $limit); - $incomp_len = strlen($incomplete_key); - foreach ($db_query->execute() as $row) { - $suffix = ($pass == 1) ? substr($row->word, $incomp_len) : ' ' . $row->word; - $suggestions[] = $factory->createFromSuggestionSuffix($suffix, $row->results); - } - } - - return $suggestions; - } - - /** - * {@inheritdoc} - */ - protected function getSpecialFields(IndexInterface $index, ItemInterface $item = NULL) { - $fields = parent::getSpecialFields($index, $item); - unset($fields['search_api_id']); - return $fields; - } - - /** - * Retrieves the internal field information. - * - * @param \Drupal\search_api\IndexInterface $index - * The index whose fields should be retrieved. - * - * @return array[] - * An array of arrays. The outer array is keyed by field name. Each value - * is an associative array with information on the field. - */ - protected function getFieldInfo(IndexInterface $index) { - $db_info = $this->getIndexDbInfo($index); - return $db_info['field_tables']; - } - - /** - * Retrieves the database info for the given index. - * - * @param \Drupal\search_api\IndexInterface $index - * The search index. - * - * @return array - * The index data from the key-value store. - */ - protected function getIndexDbInfo(IndexInterface $index) { - $db_info = $this->getKeyValueStore()->get($index->id(), []); - if ($db_info && $db_info['server'] != $this->server->id()) { - return []; - } - return $db_info; - } - - /** - * Implements the magic __sleep() method. - * - * Prevents the database connection and logger from being serialized. - */ - public function __sleep() { - $properties = array_flip(parent::__sleep()); - unset($properties['database']); - unset($properties['logger']); - return array_keys($properties); - } - - /** - * Implements the magic __wakeup() method. - * - * Reloads the database connection and logger. - */ - public function __wakeup() { - parent::__wakeup(); - - if (isset($this->configuration['database'])) { - list($key, $target) = explode(':', $this->configuration['database'], 2); - $this->database = CoreDatabase::getConnection($target, $key); - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/DatabaseTestsTrait.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/DatabaseTestsTrait.php deleted file mode 100644 index daa1eca54..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/DatabaseTestsTrait.php +++ /dev/null @@ -1,67 +0,0 @@ -schema(); - $this->assertTrue($schema->tableExists($table), "Table $table exists."); - - if (!$message) { - $message = "Table $table has a primary key."; - } - // The database layer doesn't support generic introspection into primary - // keys. The simplest way to test whether a primary key exists is therefore - // to try to create one and see whether that leads to an exception. - try { - $schema->addPrimaryKey($table, []); - $this->assertTrue(FALSE, $message); - } - catch (SchemaObjectExistsException $e) { - $this->assertTrue(TRUE, $message); - } - catch (\Exception $e) { - // Trying to create a primary key with an empty fields list will probably - // still throw an exception, so we catch that as well. - $this->assertTrue(FALSE, $message); - } - } - - /** - * Asserts that the given table exists and does not have a primary key. - * - * @param string $table - * The name of the table. - * @param string|null $message - * (optional) The message to print for the assertion, or NULL to use an - * automatically generated one. - */ - protected function assertNotHasPrimaryKey($table, $message = NULL) { - $schema = \Drupal::database()->schema(); - $this->assertTrue($schema->tableExists($table), "Table $table exists."); - - if (!$message) { - $message = "Table $table does not have a primary key."; - } - // The database layer doesn't support generic introspection into primary - // keys. The simplest way to make sure a table does not have a primary key - // is trying to drop it and checking the return value. - $this->assertFalse($schema->dropPrimaryKey($table), $message); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php deleted file mode 100644 index 25cd8d1fc..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php +++ /dev/null @@ -1,68 +0,0 @@ -get('entity_type.manager') - ->getDefinition($entity_type_id); - \Drupal::getContainer() - ->get('entity_type.listener') - ->onEntityTypeCreate($entity_type); - } - } - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../tests/fixtures/update/search-api-db-base.php', - __DIR__ . '/../../../tests/fixtures/update/search-api-db-update-8102.php', - ]; - } - - /** - * Tests whether search_api_db_update_8102() works correctly. - * - * @see https://www.drupal.org/node/2884451 - */ - public function testUpdate8102() { - $this->assertNotHasPrimaryKey('search_api_db_index_1'); - $this->assertHasPrimaryKey('search_api_db_index_2'); - - $this->runUpdates(); - - $this->assertHasPrimaryKey('search_api_db_index_1'); - $this->assertHasPrimaryKey('search_api_db_index_2'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-base.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-base.php deleted file mode 100644 index 655c9a635..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-base.php +++ /dev/null @@ -1,59 +0,0 @@ - 8104, - 'search_api_db' => 8101, -]; -foreach ($versions as $name => $version) { - $connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => $name, - 'value' => serialize($version), - ]) - ->execute(); -} - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['search_api'] = 0; -$extensions['module']['search_api_db'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Install the default configuration. -$configs['search_api.settings'] = Yaml::decode(file_get_contents(__DIR__ . '/../../../../../config/install/search_api.settings.yml')); -$configs['search_api_db.settings'] = Yaml::decode(file_get_contents(__DIR__ . '/../../../config/install/search_api_db.settings.yml')); -foreach ($configs as $name => $config) { - $data = $connection->insert('config') - ->fields([ - 'name' => $name, - 'data' => serialize($config), - 'collection' => '', - ]) - ->execute(); -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php deleted file mode 100644 index 0e42bde4e..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/fixtures/update/search-api-db-update-8102.php +++ /dev/null @@ -1,62 +0,0 @@ -insert('config') - ->fields([ - 'collection' => '', - 'name' => 'search_api.server.' . $server_config['id'], - 'data' => serialize($server_config), - ]) - ->execute(); -} - -foreach ([1, 2] as $i) { - $name = "index_$i"; - $table = "search_api_db_$name"; - $value = [ - 'server' => 'default_server', - 'index_table' => $table, - ]; - $connection->insert('key_value') - ->fields([ - 'collection' => 'search_api_db.indexes', - 'name' => $name, - 'value' => serialize($value), - ]) - ->execute(); - - $definition = [ - 'name' => $table, - 'module' => 'search_api_db', - 'fields' => [ - 'item_id' => [ - 'type' => 'varchar', - 'length' => 150, - 'description' => 'The primary identifier of the item', - 'not null' => TRUE, - ], - ], - ]; - if ($i === 2) { - $definition['primary key'] = ['item_id']; - } - $connection->schema()->createTable($table, $definition); -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/config/install/search_api_autocomplete.search.search_api_db_test_autocomplete.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/config/install/search_api_autocomplete.search.search_api_db_test_autocomplete.yml deleted file mode 100644 index 13fbf413b..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/config/install/search_api_autocomplete.search.search_api_db_test_autocomplete.yml +++ /dev/null @@ -1,15 +0,0 @@ -id: search_api_db_test_autocomplete -langcode: en -status: true -dependencies: - config: - - search_api.index.database_search_index -label: Autocomplete test module search -index_id: database_search_index -suggester_settings: - server: - fields: { } -search_settings: - 'search_api_db_test_autocomplete': { } -options: - show_count: true diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml deleted file mode 100644 index 531bb5f3f..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: 'Search API Database Autocomplete Test' -type: module -description: 'Support module for testing Autocomplete support of the "Database" backend' -package: Search -dependencies: - - search_api:search_api_test_views - - search_api_autocomplete:search_api_autocomplete -# core: 8.x -hidden: true - -# Information added by Drupal.org packaging script on 2018-11-18 -version: '8.x-1.11' -core: '8.x' -project: 'search_api' -datestamp: 1542564486 diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/src/Plugin/search_api_autocomplete/search/TestSearch.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/src/Plugin/search_api_autocomplete/search/TestSearch.php deleted file mode 100644 index 106bf436d..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/search_api_db_test_autocomplete/src/Plugin/search_api_autocomplete/search/TestSearch.php +++ /dev/null @@ -1,70 +0,0 @@ -logMethodCall(__FUNCTION__, func_get_args()); - if ($override = $this->getMethodOverride(__FUNCTION__)) { - return call_user_func($override, $this, $form, $form_state); - } - return []; - } - - /** - * {@inheritdoc} - */ - public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->logMethodCall(__FUNCTION__, func_get_args()); - if ($override = $this->getMethodOverride(__FUNCTION__)) { - call_user_func($override, $this, $form, $form_state); - } - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $this->logMethodCall(__FUNCTION__, func_get_args()); - if ($override = $this->getMethodOverride(__FUNCTION__)) { - call_user_func($override, $this, $form, $form_state); - return; - } - $this->setConfiguration($form_state->getValues()); - } - - /** - * {@inheritdoc} - */ - public function createQuery($keys, array $data = []) { - $this->logMethodCall(__FUNCTION__, func_get_args()); - if ($override = $this->getMethodOverride(__FUNCTION__)) { - return call_user_func($override, $this, $keys, $data); - } - return $this->search->getIndex()->query()->keys($keys); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php deleted file mode 100644 index 3c629a383..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php +++ /dev/null @@ -1,40 +0,0 @@ -drupalCreateUser(['administer search_api', 'access administration pages']); - $this->drupalLogin($admin_user); - - $this->drupalGet('admin/config/search/search-api/add-server'); - $this->assertSession()->statusCodeEquals(200); - - $edit = ['name' => ' ~`Test Server', 'id' => '_test']; - $this->submitForm($edit, 'Save'); - $this->assertSession()->addressEquals('admin/config/search/search-api/server/_test'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/AutocompleteTest.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/AutocompleteTest.php deleted file mode 100644 index 9f15316ac..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/AutocompleteTest.php +++ /dev/null @@ -1,144 +0,0 @@ -installSchema('search_api', ['search_api_item']); - $this->installSchema('system', ['router']); - $this->installSchema('user', ['users_data']); - $this->installEntitySchema('entity_test_mulrev_changed'); - $this->installEntitySchema('search_api_task'); - $this->installConfig('search_api'); - - // Do not use a batch for tracking the initial items after creating an - // index when running the tests via the GUI. Otherwise, it seems Drupal's - // Batch API gets confused and the test fails. - if (!Utility::isRunningInCli()) { - \Drupal::state()->set('search_api_use_tracking_batch', FALSE); - } - - $this->installConfig([ - 'search_api_db', - 'search_api_test_example_content', - 'search_api_test_db', - 'search_api_db_test_autocomplete', - ]); - - $this->setUpExampleStructure(); - $this->insertExampleContent(); - - $this->indexItems($this->indexId); - } - - /** - * Tests whether autocomplete suggestions are correctly created. - * - * @covers ::getAutocompleteSuggestions - */ - public function testAutocompletion() { - /** @var \Drupal\search_api_autocomplete\SearchInterface $autocomplete */ - $autocomplete = Search::load('search_api_db_test_autocomplete'); - $index = $autocomplete->getIndex(); - /** @var \Drupal\search_api_db\Plugin\search_api\backend\Database $backend */ - $backend = $index->getServerInstance()->getBackend(); - - $this->assertInstanceOf(Database::class, $backend); - - $query = $index->query() - ->range(0, 10); - $suggestions = $backend->getAutocompleteSuggestions($query, $autocomplete, 'fo', 'fo'); - $expected = [ - 'foo' => 4, - 'foobar' => 1, - 'foobaz' => 1, - 'foobuz' => 1, - ]; - $this->assertSuggestionsEqual($expected, $suggestions); - - $query = $index->query() - ->keys('foo') - ->range(0, 10); - $suggestions = $backend->getAutocompleteSuggestions($query, $autocomplete, 'fo', 'foo fo'); - $expected = [ - 'foo foobaz' => 1, - 'foo foobuz' => 1, - ]; - $this->assertSuggestionsEqual($expected, $suggestions); - } - - /** - * Asserts that the returned suggestions are as expected. - * - * @param int[] $expected - * Associative array mapping suggestion strings to their counts. - * @param \Drupal\search_api_autocomplete\Suggestion\SuggestionInterface[] $suggestions - * The suggestions returned by the backend. - */ - protected function assertSuggestionsEqual(array $expected, array $suggestions) { - $terms = []; - foreach ($suggestions as $suggestion) { - $keys = $suggestion->getSuggestedKeys(); - if ($keys === NULL) { - $keys = $suggestion->getSuggestionPrefix(); - $keys .= $suggestion->getUserInput(); - $keys .= $suggestion->getSuggestionSuffix(); - } - $terms[$keys] = $suggestion->getResultsCount(); - } - $this->assertEquals($expected, $terms); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/BackendTest.php b/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/BackendTest.php deleted file mode 100644 index 703367a94..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_db/tests/src/Kernel/BackendTest.php +++ /dev/null @@ -1,945 +0,0 @@ -schema()->createTable('search_api_db_database_search_index', [ - 'fields' => [ - 'id' => [ - 'type' => 'int', - ], - ], - ]); - - $this->installConfig(['search_api_test_db']); - } - - /** - * {@inheritdoc} - */ - protected function checkBackendSpecificFeatures() { - $this->checkMultiValuedInfo(); - $this->editServerPartial(); - $this->searchSuccessPartial(); - $this->editServerStartsWith(); - $this->searchSuccessStartsWith(); - $this->editServerMinChars(); - $this->searchSuccessMinChars(); - $this->checkUnknownOperator(); - $this->checkDbQueryAlter(); - $this->checkFieldIdChanges(); - } - - /** - * {@inheritdoc} - */ - protected function backendSpecificRegressionTests() { - $this->regressionTest2557291(); - $this->regressionTest2511860(); - $this->regressionTest2846932(); - $this->regressionTest2926733(); - $this->regressionTest2938646(); - $this->regressionTest2925464(); - $this->regressionTest2994022(); - } - - /** - * Tests that all tables and all columns have been created. - */ - protected function checkServerBackend() { - $db_info = $this->getIndexDbInfo(); - $normalized_storage_table = $db_info['index_table']; - $field_infos = $db_info['field_tables']; - - $expected_fields = [ - 'body', - 'category', - 'created', - 'id', - 'keywords', - 'name', - 'search_api_datasource', - 'search_api_language', - 'type', - 'width', - ]; - $actual_fields = array_keys($field_infos); - sort($actual_fields); - $this->assertEquals($expected_fields, $actual_fields, 'All expected field tables were created.'); - - $this->assertTrue(\Drupal::database()->schema()->tableExists($normalized_storage_table), 'Normalized storage table exists.'); - $this->assertHasPrimaryKey($normalized_storage_table, 'Normalized storage table has a primary key.'); - foreach ($field_infos as $field_id => $field_info) { - if ($field_id != 'search_api_id') { - $this->assertTrue(\Drupal::database() - ->schema() - ->tableExists($field_info['table'])); - } - else { - $this->assertEmpty($field_info['table']); - } - $this->assertTrue(\Drupal::database()->schema()->fieldExists($normalized_storage_table, $field_info['column']), new FormattableMarkup('Field column %column exists', ['%column' => $field_info['column']])); - } - } - - /** - * Checks whether changes to the index's fields are picked up by the server. - */ - protected function updateIndex() { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getIndex(); - - // Remove a field from the index and check if the change is matched in the - // server configuration. - $field = $index->getField('keywords'); - if (!$field) { - throw new \Exception(); - } - $index->removeField('keywords'); - $index->save(); - - $index_fields = array_keys($index->getFields()); - // Include the three "magic" fields we're indexing with the DB backend. - $index_fields[] = 'search_api_datasource'; - $index_fields[] = 'search_api_language'; - - $db_info = $this->getIndexDbInfo(); - $server_fields = array_keys($db_info['field_tables']); - - sort($index_fields); - sort($server_fields); - $this->assertEquals($index_fields, $server_fields); - - // Add the field back for the next assertions. - $index->addField($field)->save(); - } - - /** - * Verifies that the generated table names are correct. - */ - protected function checkTableNames() { - $this->assertEquals('search_api_db_database_search_index_1', $this->getIndexDbInfo()['index_table']); - $this->assertEquals('search_api_db_database_search_index_text', $this->getIndexDbInfo()['field_tables']['body']['table']); - } - - /** - * Verifies that the stored information about multi-valued fields is correct. - */ - protected function checkMultiValuedInfo() { - $db_info = $this->getIndexDbInfo(); - $field_info = $db_info['field_tables']; - - $fields = [ - 'name', - 'body', - 'type', - 'keywords', - 'category', - 'width', - 'search_api_datasource', - 'search_api_language', - ]; - $multi_valued = [ - 'name', - 'body', - 'keywords', - ]; - foreach ($fields as $field_id) { - $this->assertArrayHasKey($field_id, $field_info, "Field info saved for field $field_id."); - if (in_array($field_id, $multi_valued)) { - $this->assertFalse(empty($field_info[$field_id]['multi-valued']), "Field $field_id is stored as multi-value."); - } - else { - $this->assertTrue(empty($field_info[$field_id]['multi-valued']), "Field $field_id is not stored as multi-value."); - } - } - } - - /** - * Edits the server to enable partial matches. - */ - protected function editServerPartial() { - $server = $this->getServer(); - $backend_config = $server->getBackendConfig(); - $backend_config['matching'] = 'partial'; - $server->setBackendConfig($backend_config); - $this->assertTrue((bool) $server->save(), 'The server was successfully edited.'); - $this->resetEntityCache(); - } - - /** - * Tests whether partial searches work. - */ - protected function searchSuccessPartial() { - $results = $this->buildSearch('foobaz')->range(0, 1)->execute(); - $this->assertResults([1], $results, 'Partial search for »foobaz«'); - - $results = $this->buildSearch('foo', [], [], FALSE) - ->sort('search_api_relevance', QueryInterface::SORT_DESC) - ->sort('id') - ->execute(); - $this->assertResults([1, 2, 4, 3, 5], $results, 'Partial search for »foo«'); - - $results = $this->buildSearch('foo tes')->execute(); - $this->assertResults([1, 2, 3, 4], $results, 'Partial search for »foo tes«'); - - $results = $this->buildSearch('oob est')->execute(); - $this->assertResults([1, 2, 3], $results, 'Partial search for »oob est«'); - - $results = $this->buildSearch('foo nonexistent')->execute(); - $this->assertResults([], $results, 'Partial search for »foo nonexistent«'); - - $results = $this->buildSearch('bar nonexistent')->execute(); - $this->assertResults([], $results, 'Partial search for »bar nonexistent«'); - - $keys = [ - '#conjunction' => 'AND', - 'oob', - [ - '#conjunction' => 'OR', - 'est', - 'nonexistent', - ], - ]; - $results = $this->buildSearch($keys)->execute(); - $this->assertResults([1, 2, 3], $results, 'Partial search for complex keys'); - - $results = $this->buildSearch('foo', ['category,item_category'], [], FALSE) - ->sort('id', QueryInterface::SORT_DESC) - ->execute(); - $this->assertResults([2, 1], $results, 'Partial search for »foo« with additional filter'); - - $query = $this->buildSearch(); - $conditions = $query->createConditionGroup('OR'); - $conditions->addCondition('name', 'test'); - $conditions->addCondition('body', 'test'); - $query->addConditionGroup($conditions); - $results = $query->execute(); - $this->assertResults([1, 2, 3, 4], $results, 'Partial search with multi-field fulltext filter'); - } - - /** - * Edits the server to enable prefix matching. - */ - protected function editServerStartsWith() { - $server = $this->getServer(); - $backend_config = $server->getBackendConfig(); - $backend_config['matching'] = 'prefix'; - $server->setBackendConfig($backend_config); - $this->assertTrue((bool) $server->save(), 'The server was successfully edited.'); - $this->resetEntityCache(); - } - - /** - * Tests whether prefix matching works. - */ - protected function searchSuccessStartsWith() { - $results = $this->buildSearch('foobaz')->range(0, 1)->execute(); - $this->assertResults([1], $results, 'Prefix search for »foobaz«'); - - $results = $this->buildSearch('foo', [], [], FALSE) - ->sort('search_api_relevance', QueryInterface::SORT_DESC) - ->sort('id') - ->execute(); - $this->assertResults([1, 2, 4, 3, 5], $results, 'Prefix search for »foo«'); - - $results = $this->buildSearch('foo tes')->execute(); - $this->assertResults([1, 2, 3, 4], $results, 'Prefix search for »foo tes«'); - - $results = $this->buildSearch('oob est')->execute(); - $this->assertResults([], $results, 'Prefix search for »oob est«'); - - $results = $this->buildSearch('foo nonexistent')->execute(); - $this->assertResults([], $results, 'Prefix search for »foo nonexistent«'); - - $results = $this->buildSearch('bar nonexistent')->execute(); - $this->assertResults([], $results, 'Prefix search for »bar nonexistent«'); - - $keys = [ - '#conjunction' => 'AND', - 'foob', - [ - '#conjunction' => 'OR', - 'tes', - 'nonexistent', - ], - ]; - $results = $this->buildSearch($keys)->execute(); - $this->assertResults([1, 2, 3], $results, 'Prefix search for complex keys'); - - $results = $this->buildSearch('foo', ['category,item_category'], [], FALSE) - ->sort('id', QueryInterface::SORT_DESC) - ->execute(); - $this->assertResults([2, 1], $results, 'Prefix search for »foo« with additional filter'); - - $query = $this->buildSearch(); - $conditions = $query->createConditionGroup('OR'); - $conditions->addCondition('name', 'test'); - $conditions->addCondition('body', 'test'); - $query->addConditionGroup($conditions); - $results = $query->execute(); - $this->assertResults([1, 2, 3, 4], $results, 'Prefix search with multi-field fulltext filter'); - } - - /** - * Edits the server to change the "Minimum word length" setting. - */ - protected function editServerMinChars() { - $server = $this->getServer(); - $backend_config = $server->getBackendConfig(); - $backend_config['min_chars'] = 4; - $backend_config['matching'] = 'words'; - $server->setBackendConfig($backend_config); - $success = (bool) $server->save(); - $this->assertTrue($success, 'The server was successfully edited.'); - - $this->clearIndex(); - $this->indexItems($this->indexId); - - $this->resetEntityCache(); - } - - /** - * Tests the results of some test searches with minimum word length of 4. - */ - protected function searchSuccessMinChars() { - $results = $this->getIndex()->query()->keys('test')->range(1, 2)->execute(); - $this->assertEquals(4, $results->getResultCount(), 'Search for »test« returned correct number of results.'); - $this->assertEquals($this->getItemIds([4, 1]), array_keys($results->getResultItems()), 'Search for »test« returned correct result.'); - $this->assertEmpty($results->getIgnoredSearchKeys()); - $this->assertEmpty($results->getWarnings()); - - $query = $this->buildSearch(); - $conditions = $query->createConditionGroup('OR'); - $conditions->addCondition('name', 'test'); - $conditions->addCondition('body', 'test'); - $query->addConditionGroup($conditions); - $results = $query->execute(); - $this->assertResults([1, 2, 3, 4], $results, 'Search with multi-field fulltext filter'); - - $results = $this->buildSearch(NULL, ['body,test foobar'])->execute(); - $this->assertResults([3], $results, 'Search with multi-term fulltext filter'); - - $results = $this->getIndex()->query()->keys('test foo')->execute(); - $this->assertResults([2, 4, 1, 3], $results, 'Search for »test foo«', ['foo']); - - $results = $this->buildSearch('foo', ['type,item'])->execute(); - $this->assertResults([1, 2, 3], $results, 'Search for »foo«', ['foo'], ['No valid search keys were present in the query.']); - - $keys = [ - '#conjunction' => 'AND', - 'test', - [ - '#conjunction' => 'OR', - 'baz', - 'foobar', - ], - [ - '#conjunction' => 'OR', - '#negation' => TRUE, - 'bar', - 'fooblob', - ], - ]; - $results = $this->buildSearch($keys)->execute(); - $this->assertResults([3], $results, 'Complex search 1', ['baz', 'bar']); - - $keys = [ - '#conjunction' => 'AND', - 'test', - [ - '#conjunction' => 'OR', - 'baz', - 'foobar', - ], - [ - '#conjunction' => 'OR', - '#negation' => TRUE, - 'bar', - 'fooblob', - ], - ]; - $results = $this->buildSearch($keys)->execute(); - $this->assertResults([3], $results, 'Complex search 2', ['baz', 'bar']); - - $results = $this->buildSearch(NULL, ['keywords,orange'])->execute(); - $this->assertResults([1, 2, 5], $results, 'Filter query 1 on multi-valued field'); - - $conditions = [ - 'keywords,orange', - 'keywords,apple', - ]; - $results = $this->buildSearch(NULL, $conditions)->execute(); - $this->assertResults([2], $results, 'Filter query 2 on multi-valued field'); - - $results = $this->buildSearch()->addCondition('keywords', 'orange', '<>')->execute(); - $this->assertResults([3, 4], $results, 'Negated filter on multi-valued field'); - - $results = $this->buildSearch()->addCondition('keywords', NULL)->execute(); - $this->assertResults([3], $results, 'Query with NULL filter'); - - $results = $this->buildSearch()->addCondition('keywords', NULL, '<>')->execute(); - $this->assertResults([1, 2, 4, 5], $results, 'Query with NOT NULL filter'); - } - - /** - * Checks that an unknown operator throws an exception. - */ - protected function checkUnknownOperator() { - try { - $this->buildSearch() - ->addCondition('id', 1, '!=') - ->execute(); - $this->fail('Unknown operator "!=" did not throw an exception.'); - } - catch (SearchApiException $e) { - $this->assertTrue(TRUE, 'Unknown operator "!=" threw an exception.'); - } - } - - /** - * Checks whether the module's specific alter hooks work correctly. - */ - protected function checkDbQueryAlter() { - $query = $this->buildSearch(); - $query->setOption('search_api_test_db_search_api_db_query_alter', TRUE); - $results = $query->execute(); - $this->assertResults([], $results, 'Query triggering custom alter hook'); - } - - /** - * Checks that field ID changes are treated correctly (without re-indexing). - */ - protected function checkFieldIdChanges() { - $this->getIndex() - ->renameField('type', 'foobar') - ->save(); - - $results = $this->buildSearch(NULL, ['foobar,item'])->execute(); - $this->assertResults([1, 2, 3], $results, 'Search after renaming a field.'); - $this->getIndex()->renameField('foobar', 'type')->save(); - } - - /** - * {@inheritdoc} - */ - protected function checkSecondServer() { - /** @var \Drupal\search_api\ServerInterface $second_server */ - $second_server = Server::create([ - 'id' => 'test2', - 'backend' => 'search_api_db', - 'backend_config' => [ - 'database' => 'default:default', - ], - ]); - $second_server->save(); - $query = $this->buildSearch(); - try { - $second_server->search($query); - $this->fail('Could execute a query for an index on a different server.'); - } - catch (SearchApiException $e) { - $this->assertTrue(TRUE, 'Executing a query for an index on a different server throws an exception.'); - } - $second_server->delete(); - } - - /** - * Tests the case-sensitivity of fulltext searches. - * - * @see https://www.drupal.org/node/2557291 - */ - protected function regressionTest2557291() { - $results = $this->buildSearch('case')->execute(); - $this->assertResults([1], $results, 'Search for lowercase "case"'); - - $results = $this->buildSearch('Case')->execute(); - $this->assertResults([1, 3], $results, 'Search for capitalized "Case"'); - - $results = $this->buildSearch('CASE')->execute(); - $this->assertResults([], $results, 'Search for non-existent uppercase version of "CASE"'); - - $results = $this->buildSearch('föö')->execute(); - $this->assertResults([1], $results, 'Search for keywords with umlauts'); - - $results = $this->buildSearch('smile' . json_decode('"\u1F601"'))->execute(); - $this->assertResults([1], $results, 'Search for keywords with umlauts'); - - $results = $this->buildSearch()->addCondition('keywords', 'grape', '<>')->execute(); - $this->assertResults([1, 3], $results, 'Negated filter on multi-valued field'); - } - - /** - * Tests searching for multiple two-letter words. - * - * @see https://www.drupal.org/node/2511860 - */ - protected function regressionTest2511860() { - $query = $this->buildSearch(); - $query->addCondition('body', 'ab xy'); - $results = $query->execute(); - $this->assertEquals(5, $results->getResultCount(), 'Fulltext filters on short words do not change the result.'); - - $query = $this->buildSearch(); - $query->addCondition('body', 'ab ab'); - $results = $query->execute(); - $this->assertEquals(5, $results->getResultCount(), 'Fulltext filters on duplicate short words do not change the result.'); - } - - /** - * Tests changing a field boost to a floating point value. - * - * @see https://www.drupal.org/node/2846932 - */ - protected function regressionTest2846932() { - $index = $this->getIndex(); - $index->getField('body')->setBoost(0.8); - $index->save(); - } - - /** - * Tests indexing of text tokens with leading/trailing whitespace. - * - * @see https://www.drupal.org/node/2926733 - */ - protected function regressionTest2926733() { - $index = $this->getIndex(); - $item_id = $this->getItemIds([1])[0]; - $fields_helper = \Drupal::getContainer() - ->get('search_api.fields_helper'); - $item = $fields_helper->createItem($index, $item_id); - $field = clone $index->getField('body'); - $value = new TextValue('test'); - $tokens = []; - foreach (['test', ' test', ' test', 'test ', ' test '] as $token) { - $tokens[] = new TextToken($token); - } - $value->setTokens($tokens); - $field->setValues([$value]); - $item->setFields([ - 'body' => $field, - ]); - $item->setFieldsExtracted(TRUE); - $index->getServerInstance()->indexItems($index, [$item_id => $item]); - - // Make sure to re-index the proper version of the item to avoid confusing - // the other tests. - list($datasource_id, $raw_id) = Utility::splitCombinedId($item_id); - $index->trackItemsUpdated($datasource_id, [$raw_id]); - $this->indexItems($index->id()); - } - - /** - * Tests indexing of items with boost. - * - * @see https://www.drupal.org/node/2938646 - */ - protected function regressionTest2938646() { - $db_info = $this->getIndexDbInfo(); - $text_table = $db_info['field_tables']['body']['table']; - $item_id = $this->getItemIds([1])[0]; - $select = \Drupal::database()->select($text_table, 't'); - $select - ->fields('t', ['score']) - ->condition('item_id', $item_id) - ->condition('word', 'test'); - $select2 = clone $select; - - // Check old score. - $old_score = $select - ->execute() - ->fetchField(); - $this->assertNotSame(FALSE, $old_score); - $this->assertGreaterThan(0, $old_score); - - // Re-index item with higher boost. - $index = $this->getIndex(); - $item = $this->container->get('search_api.fields_helper') - ->createItem($index, $item_id); - $item->setBoost(2); - $indexed_ids = $this->indexItemDirectly($index, $item); - $this->assertEquals([$item_id], $indexed_ids); - - // Verify the field scores changed accordingly. - $new_score = $select2 - ->execute() - ->fetchField(); - $this->assertNotSame(FALSE, $new_score); - $this->assertEquals(2 * $old_score, $new_score); - } - - /** - * Tests changing of field types. - * - * @see https://www.drupal.org/node/2925464 - */ - protected function regressionTest2925464() { - $index = $this->getIndex(); - - $index->getField('category')->setType('integer'); - $index->save(); - - $index->getField('category')->setType('string'); - $index->save(); - - $this->indexItems($index->id()); - } - - /** - * Tests changing of field types. - * - * @see https://www.drupal.org/project/search_api/issues/2994022 - */ - protected function regressionTest2994022() { - $query = $this->buildSearch('nonexistent_search_term'); - $facets['category'] = [ - 'field' => 'category', - 'limit' => 0, - 'min_count' => 0, - 'missing' => FALSE, - 'operator' => 'and', - ]; - $query->setOption('search_api_facets', $facets); - $results = $query->execute(); - $this->assertResults([], $results, 'Non-existent keyword'); - $expected = [ - ['count' => 0, 'filter' => '"article_category"'], - ['count' => 0, 'filter' => '"item_category"'], - ]; - $category_facets = $results->getExtraData('search_api_facets')['category']; - usort($category_facets, [$this, 'facetCompare']); - $this->assertEquals($expected, $category_facets, 'Correct facets were returned for minimum count 0'); - - $query = $this->buildSearch('nonexistent_search_term'); - $conditions = $query->createConditionGroup('AND', ['facet:category']); - $conditions->addCondition('category', 'article_category'); - $query->addConditionGroup($conditions); - $facets['category'] = [ - 'field' => 'category', - 'limit' => 0, - 'min_count' => 0, - 'missing' => FALSE, - 'operator' => 'and', - ]; - $query->setOption('search_api_facets', $facets); - $results = $query->execute(); - $this->assertResults([], $results, 'Non-existent keyword with filter'); - $expected = [ - ['count' => 0, 'filter' => '"article_category"'], - ['count' => 0, 'filter' => '"item_category"'], - ]; - $category_facets = $results->getExtraData('search_api_facets')['category']; - usort($category_facets, [$this, 'facetCompare']); - $this->assertEquals($expected, $category_facets, 'Correct facets were returned for minimum count 0'); - } - - /** - * {@inheritdoc} - */ - protected function checkIndexWithoutFields() { - $index = parent::checkIndexWithoutFields(); - - $expected = [ - 'search_api_datasource', - 'search_api_language', - ]; - $db_info = $this->getIndexDbInfo($index->id()); - $info_fields = array_keys($db_info['field_tables']); - sort($info_fields); - $this->assertEquals($expected, $info_fields); - - return $index; - } - - /** - * {@inheritdoc} - */ - protected function checkModuleUninstall() { - $db_info = $this->getIndexDbInfo(); - $normalized_storage_table = $db_info['index_table']; - $field_tables = $db_info['field_tables']; - - // See whether clearing the server works. - // Regression test for #2156151. - $server = $this->getServer(); - $index = $this->getIndex(); - $server->deleteAllIndexItems($index); - $query = $this->buildSearch(); - $results = $query->execute(); - $this->assertEquals(0, $results->getResultCount(), 'Clearing the server worked correctly.'); - $schema = \Drupal::database()->schema(); - $table_exists = $schema->tableExists($normalized_storage_table); - $this->assertTrue($table_exists, 'The index tables were left in place.'); - - // See whether disabling the index correctly removes all of its tables. - $index->disable()->save(); - $db_info = $this->getIndexDbInfo(); - $this->assertNull($db_info, 'The index was successfully removed from the server.'); - $table_exists = $schema->tableExists($normalized_storage_table); - $this->assertFalse($table_exists, 'The index tables were deleted.'); - foreach ($field_tables as $field_table) { - $table_exists = $schema->tableExists($field_table['table']); - $this->assertFalse($table_exists, "Field table {$field_table['table']} was successfully deleted."); - } - $index->enable()->save(); - - // Remove first the index and then the server. - $index->setServer(); - $index->save(); - - $db_info = $this->getIndexDbInfo(); - $this->assertNull($db_info, 'The index was successfully removed from the server.'); - $table_exists = $schema->tableExists($normalized_storage_table); - $this->assertFalse($table_exists, 'The index tables were deleted.'); - foreach ($field_tables as $field_table) { - $table_exists = $schema->tableExists($field_table['table']); - $this->assertFalse($table_exists, "Field table {$field_table['table']} was successfully deleted."); - } - - // Re-add the index to see if the associated tables are also properly - // removed when the server is deleted. - $index->setServer($server); - $index->save(); - $server->delete(); - - $db_info = $this->getIndexDbInfo(); - $this->assertNull($db_info, 'The index was successfully removed from the server.'); - $table_exists = $schema->tableExists($normalized_storage_table); - $this->assertFalse($table_exists, 'The index tables were deleted.'); - foreach ($field_tables as $field_table) { - $table_exists = $schema->tableExists($field_table['table']); - $this->assertFalse($table_exists, "Field table {$field_table['table']} was successfully deleted."); - } - - // Uninstall the module. - \Drupal::service('module_installer')->uninstall(['search_api_db'], FALSE); - $this->assertFalse(\Drupal::moduleHandler()->moduleExists('search_api_db'), 'The Database Search module was successfully uninstalled.'); - - $tables = $schema->findTables('search_api_db_%'); - $expected = [ - 'search_api_db_database_search_index' => 'search_api_db_database_search_index', - ]; - $this->assertEquals($expected, $tables, 'All the tables of the Database Search module have been removed.'); - } - - /** - * Retrieves the database information for the test index. - * - * @param string|null $index_id - * (optional) The ID of the index whose database information should be - * retrieved. - * - * @return array - * The database information stored by the backend for the test index. - */ - protected function getIndexDbInfo($index_id = NULL) { - $index_id = $index_id ?: $this->indexId; - return \Drupal::keyValue(Database::INDEXES_KEY_VALUE_STORE_ID) - ->get($index_id); - } - - /** - * Indexes an item directly. - * - * @param \Drupal\search_api\IndexInterface $index - * The search index to index the item on. - * @param \Drupal\search_api\Item\ItemInterface $item - * The item. - * - * @return string[] - * The successfully indexed IDs. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if indexing failed. - */ - protected function indexItemDirectly(IndexInterface $index, ItemInterface $item) { - $items = [$item->getId() => $item]; - - // Minimalistic version of code copied from - // \Drupal\search_api\Entity\Index::indexSpecificItems(). - $index->alterIndexedItems($items); - \Drupal::moduleHandler()->alter('search_api_index_items', $index, $items); - foreach ($items as $item) { - // This will cache the extracted fields so processors, etc., can retrieve - // them directly. - $item->getFields(); - } - $index->preprocessIndexItems($items); - - $indexed_ids = []; - if ($items) { - $indexed_ids = $index->getServerInstance()->indexItems($index, $items); - } - return $indexed_ids; - } - - /** - * Tests whether a server on a non-default database is handled correctly. - */ - public function testNonDefaultDatabase() { - // Clone the primary credentials to a replica connection. - // Note this will result in two independent connection objects that happen - // to point to the same place. - // @see \Drupal\KernelTests\Core\Database\ConnectionTest::testConnectionRouting() - $connection_info = CoreDatabase::getConnectionInfo('default'); - CoreDatabase::addConnectionInfo('default', 'replica', $connection_info['default']); - - $db1 = CoreDatabase::getConnection('default', 'default'); - $db2 = CoreDatabase::getConnection('replica', 'default'); - - // Safety checks copied from the Core test, if these fail something is wrong - // with Core. - $this->assertNotNull($db1, 'default connection is a real connection object.'); - $this->assertNotNull($db2, 'replica connection is a real connection object.'); - $this->assertNotSame($db1, $db2, 'Each target refers to a different connection.'); - - // Create backends based on each of the two targets and verify they use the - // right connections. - $config = [ - 'database' => 'default:default', - ]; - $backend1 = Database::create($this->container, $config, '', []); - $config['database'] = 'default:replica'; - $backend2 = Database::create($this->container, $config, '', []); - - $this->assertSame($db1, $backend1->getDatabase()); - $this->assertSame($db2, $backend2->getDatabase()); - - // Make sure they also use different DBMS compatibility handlers, which also - // use the correct database connections. - $dbms_comp1 = $backend1->getDbmsCompatibilityHandler(); - $dbms_comp2 = $backend2->getDbmsCompatibilityHandler(); - $this->assertNotSame($dbms_comp1, $dbms_comp2); - $this->assertSame($db1, $dbms_comp1->getDatabase()); - $this->assertSame($db2, $dbms_comp2->getDatabase()); - - // Finally, make sure the DBMS compatibility handlers also have the correct - // classes (meaning we used the correct one and didn't just fall back to the - // generic database). - $service = $this->container->get('search_api_db.database_compatibility'); - $database_type = $db1->databaseType(); - $service_id = "$database_type.search_api_db.database_compatibility"; - $service2 = $this->container->get($service_id); - $this->assertSame($service2, $service); - $class = get_class($service); - $this->assertNotEquals(GenericDatabase::class, $class); - $this->assertSame($dbms_comp1, $service); - $this->assertEquals($class, get_class($dbms_comp2)); - } - - /** - * Tests whether indexing of dates works correctly. - */ - public function testDateIndexing() { - // Load all existing entities. - $storage = \Drupal::entityTypeManager() - ->getStorage('entity_test_mulrev_changed'); - $storage->delete($storage->loadMultiple()); - - $index = Index::load('database_search_index'); - $index->getField('name')->setType('date'); - $index->save(); - - // Simulate date field creation in one timezone and indexing in another. - date_default_timezone_set('America/Chicago'); - - // Test different input values, similar to @dataProvider (but with less - // overhead). - $t = 1400000000; - $date_time_format = DateTimeItemInterface::DATETIME_STORAGE_FORMAT; - $date_format = DateTimeItemInterface::DATE_STORAGE_FORMAT; - $test_values = [ - 'null' => [NULL, NULL], - 'timestamp' => [$t, $t], - 'string timestamp' => ["$t", $t], - 'float timestamp' => [$t + 0.12, $t], - 'date string' => [gmdate($date_time_format, $t), $t], - 'date string with timezone' => [date($date_time_format . 'P', $t), $t], - 'date only' => [ - date($date_format, $t), - // Date-only fields are stored with the default time (12:00:00). - strtotime(date($date_format, $t) . 'T12:00:00+00:00'), - ], - ]; - - // Get storage information for quickly checking the indexed value. - $db_info = $this->getIndexDbInfo(); - $table = $db_info['index_table']; - $column = $db_info['field_tables']['name']['column']; - $sql = "SELECT $column FROM {{$table}} WHERE item_id = :id"; - - $id = 0; - date_default_timezone_set('Asia/Seoul'); - foreach ($test_values as $label => list($field_value, $expected)) { - $entity = $this->addTestEntity(++$id, [ - 'name' => $field_value, - 'type' => 'item', - ]); - $item_id = $this->getItemIds([$id])[0]; - $index->indexSpecificItems([$item_id => $entity->getTypedData()]); - $args[':id'] = $item_id; - $indexed_value = \Drupal::database()->query($sql, $args)->fetchField(); - if ($expected === NULL) { - $this->assertSame($expected, $indexed_value, "Indexing of date field with $label value."); - } - else { - $this->assertEquals($expected, $indexed_value, "Indexing of date field with $label value."); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.info.yml b/sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.info.yml deleted file mode 100644 index e054bd630..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.info.yml +++ /dev/null @@ -1,18 +0,0 @@ -type: module -name: 'Search API Taxonomy Term Handlers' -description: 'Deprecated. You should uninstall this module.' -package: Search -# core: 8.x -hidden: true -configure: search_api.overview -dependencies: - - drupal:system (>=8.1) - - search_api:search_api - - drupal:taxonomy - - drupal:views - -# Information added by Drupal.org packaging script on 2018-11-18 -version: '8.x-1.11' -core: '8.x' -project: 'search_api' -datestamp: 1542564486 diff --git a/sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.install b/sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.install deleted file mode 100644 index fe1d28197..000000000 --- a/sites/all/modules/contrib/search/search_api/modules/search_api_views_taxonomy/search_api_views_taxonomy.install +++ /dev/null @@ -1,29 +0,0 @@ - t('Search API Taxonomy Term Handlers'), - 'value' => t('Out-dated'), - 'description' => t('All functionality of the "Search API Taxonomy Term Handlers" module has been moved into the Search API module. You should uninstall this module.', [ - ':uninstall' => Url::fromRoute('system.modules_uninstall')->toString(), - ]), - 'severity' => REQUIREMENT_WARNING, - ]; - } - - return $requirements; -} diff --git a/sites/all/modules/contrib/search/search_api/phpcs.xml b/sites/all/modules/contrib/search/search_api/phpcs.xml deleted file mode 100644 index 5ff5509b0..000000000 --- a/sites/all/modules/contrib/search/search_api/phpcs.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - Default PHP CodeSniffer configuration for the Search API module. - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - - 0 - - - 0 - - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - - - - - - - - - - - - - - - - diff --git a/sites/all/modules/contrib/search/search_api/search_api.api.php b/sites/all/modules/contrib/search/search_api/search_api.api.php deleted file mode 100644 index 5ec343328..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.api.php +++ /dev/null @@ -1,356 +0,0 @@ - $info) { - $backend_info[$id]['class'] = '\Drupal\my_module\MyBackendDecorator'; - $backend_info[$id]['example_original_class'] = $info['class']; - } -} - -/** - * Alter the features a given search server supports. - * - * @param string[] $features - * The features supported by the server's backend. - * @param \Drupal\search_api\ServerInterface $server - * The search server in question. - * - * @see \Drupal\search_api\Backend\BackendSpecificInterface::getSupportedFeatures() - */ -function hook_search_api_server_features_alter(array &$features, \Drupal\search_api\ServerInterface $server) { - if ($server->getBackend() instanceof \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend) { - $features[] = 'my_custom_feature'; - } -} - -/** - * Alter the available datasources. - * - * Modules may implement this hook to alter the information that defines - * datasources. All properties that are available in - * \Drupal\search_api\Annotation\SearchApiDatasource can be altered here, with - * the addition of the "class" and "provider" keys. - * - * @param array $infos - * The datasource info array, keyed by datasource IDs. - * - * @see \Drupal\search_api\Datasource\DatasourcePluginBase - */ -function hook_search_api_datasource_info_alter(array &$infos) { - // I'm a traditionalist, I want them called "nodes"! - $infos['entity:node']['label'] = t('Node'); -} - -/** - * Alter the available processors. - * - * Modules may implement this hook to alter the information that defines - * processors. All properties that are available in - * \Drupal\search_api\Annotation\SearchApiProcessor can be altered here, with - * the addition of the "class" and "provider" keys. - * - * @param array $processors - * The processor information to be altered, keyed by processor IDs. - * - * @see \Drupal\search_api\Processor\ProcessorPluginBase - */ -function hook_search_api_processor_info_alter(array &$processors) { - if (!empty($processors['example_processor'])) { - $processors['example_processor']['class'] = '\Drupal\my_module\MuchBetterExampleProcessor'; - } -} - -/** - * Alter the available data types. - * - * @param array $data_type_definitions - * The definitions of the data type plugins. - * - * @see \Drupal\search_api\DataType\DataTypePluginBase - */ -function hook_search_api_data_type_info_alter(array &$data_type_definitions) { - if (isset($data_type_definitions['text'])) { - $data_type_definitions['text']['label'] = t('Parsed text'); - } -} - -/** - * Alter the available parse modes. - * - * @param array $parse_mode_definitions - * The definitions of the data type plugins. - * - * @see \Drupal\search_api\ParseMode\ParseModePluginBase - */ -function hook_search_api_parse_mode_info_alter(array &$parse_mode_definitions) { - if (isset($parse_mode_definitions['direct'])) { - $parse_mode_definitions['direct']['label'] = t('Solr syntax'); - } -} - -/** - * Alter the tracker info. - * - * @param array $tracker_info - * The Search API tracker info array, keyed by tracker ID. - * - * @see \Drupal\search_api\Tracker\TrackerPluginBase - */ -function hook_search_api_tracker_info_alter(array &$tracker_info) { - if (isset($tracker_info['default'])) { - $tracker_info['default']['example_original_class'] = $tracker_info['default']['class']; - $tracker_info['default']['class'] = '\Drupal\my_module\Plugin\search_api\tracker\MyCustomImplementationTracker'; - } -} - -/** - * Alter the list of known search displays. - * - * @param array $displays - * The Search API display info array, keyed by display ID. - * - * @see \Drupal\search_api\Display\DisplayPluginBase - */ -function hook_search_api_displays_alter(array &$displays) { - if (isset($displays['some_key'])) { - $displays['some_key']['label'] = t('New label for existing Display'); - } -} - -/** - * Alter the mapping of Drupal data types to Search API data types. - * - * @param array $mapping - * An array mapping all known (and supported) Drupal data types to their - * corresponding Search API data types. A value of FALSE means that fields of - * that type should be ignored by the Search API. - * - * @see \Drupal\search_api\Utility\DataTypeHelperInterface::getFieldTypeMapping() - */ -function hook_search_api_field_type_mapping_alter(array &$mapping) { - $mapping['duration_iso8601'] = FALSE; - $mapping['my_new_type'] = 'string'; -} - -/** - * Alter the mapping of Search API data types to their default Views handlers. - * - * Field handlers are not determined by these simplified (Search API) types, but - * by their actual property data types. For altering that mapping, see - * hook_search_api_views_field_handler_mapping_alter(). - * - * @param array $mapping - * An associative array with data types as the keys and Views table data - * definition items as the values. In addition to all normally defined Search - * API data types, keys can also be "options" for any field with an options - * list, "entity" for general entity-typed fields or "entity:ENTITY_TYPE" - * (with "ENTITY_TYPE" being the machine name of an entity type) for entities - * of that type. - */ -function hook_search_api_views_handler_mapping_alter(array &$mapping) { - $mapping['entity:my_entity_type'] = [ - 'argument' => [ - 'id' => 'my_entity_type', - ], - 'filter' => [ - 'id' => 'my_entity_type', - ], - 'sort' => [ - 'id' => 'my_entity_type', - ], - ]; - $mapping['date']['filter']['id'] = 'my_date_filter'; -} - -/** - * Alter the mapping of property types to their default Views field handlers. - * - * This is used in the Search API Views integration to create Search - * API-specific field handlers for all properties of datasources and some entity - * types. - * - * In addition to the definition returned here, for Field API fields, the - * "field_name" will be set to the field's machine name. - * - * @param array $mapping - * An associative array with property data types as the keys and Views field - * handler definitions as the values (that is, just the inner "field" portion - * of Views data definition items). In some cases the value might also be NULL - * instead, to indicate that properties of this type shouldn't have field - * handlers. The data types in the keys might also contain asterisks (*) as - * wildcard characters. Data types with wildcards will be matched only if no - * specific type exists, and longer type patterns will be tried before shorter - * ones. The "*" mapping therefore is the default if no other match could be - * found. - */ -function hook_search_api_views_field_handler_mapping_alter(array &$mapping) { - $mapping['field_item:string_long'] = [ - 'id' => 'example_field', - ]; - $mapping['example_property_type'] = [ - 'id' => 'example_field', - 'some_option' => 'foo', - ]; -} - -/** - * Allows you to log or alter the items that are indexed. - * - * Please be aware that generally preventing the indexing of certain items is - * deprecated. This is better done with processors, which can easily be - * configured and only added to indexes where this behaviour is wanted. - * If your module will use this hook to reject certain items from indexing, - * please document this clearly to avoid confusion. - * - * @param \Drupal\search_api\IndexInterface $index - * The search index on which items will be indexed. - * @param \Drupal\search_api\Item\ItemInterface[] $items - * The items that will be indexed. - */ -function hook_search_api_index_items_alter(\Drupal\search_api\IndexInterface $index, array &$items) { - foreach ($items as $item_id => $item) { - list(, $raw_id) = \Drupal\search_api\Utility\Utility::splitCombinedId($item->getId()); - if ($raw_id % 5 == 0) { - unset($items[$item_id]); - } - } - $arguments = [ - '%index' => $index->label(), - '@ids' => implode(', ', array_keys($items)), - ]; - $message = t('Indexing items on index %index with the following IDs: @ids', $arguments); - \Drupal::messenger()->addStatus($message); -} - -/** - * React after items were indexed. - * - * @param \Drupal\search_api\IndexInterface $index - * The used index. - * @param array $item_ids - * An array containing the successfully indexed items' IDs. - */ -function hook_search_api_items_indexed(\Drupal\search_api\IndexInterface $index, array $item_ids) { - if ($index->isValidDatasource('entity:node')) { - // Note that this is just an example, and would only work if there are only - // nodes indexed in that index (and even then the printed IDs would probably - // not be as expected). - $message = t('Nodes indexed: @ids.', implode(', ', $item_ids)); - \Drupal::messenger()->addStatus($message); - } -} - -/** - * Alter a search query before it gets executed. - * - * The hook is invoked after all enabled processors have preprocessed the query. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The query that will be executed. - */ -function hook_search_api_query_alter(\Drupal\search_api\Query\QueryInterface &$query) { - // Do not run for queries with a certain tag. - if ($query->hasTag('example_tag')) { - return; - } - // Otherwise, exclude the node with ID 10 from the search results. - $fields = $query->getIndex()->getFields(); - foreach ($query->getIndex()->getDatasources() as $datasource_id => $datasource) { - if ($datasource->getEntityTypeId() == 'node') { - if (isset($fields['nid'])) { - $query->addCondition('nid', 10, '<>'); - } - } - } -} - -/** - * Alter a search query with a specific tag before it gets executed. - * - * The hook is invoked after all enabled processors have preprocessed the query. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The query that will be executed. - */ -function hook_search_api_query_TAG_alter(\Drupal\search_api\Query\QueryInterface &$query) { - // Exclude the node with ID 10 from the search results. - $fields = $query->getIndex()->getFields(); - foreach ($query->getIndex()->getDatasources() as $datasource_id => $datasource) { - if ($datasource->getEntityTypeId() == 'node') { - if (isset($fields['nid'])) { - $query->addCondition('nid', 10, '<>'); - } - } - } -} - -/** - * Alter a search query's result set. - * - * The hook is invoked after all enabled processors have postprocessed the - * results. - * - * @param \Drupal\search_api\Query\ResultSetInterface $results - * The search results to alter. - */ -function hook_search_api_results_alter(\Drupal\search_api\Query\ResultSetInterface &$results) { - $results->setExtraData('example_hook_invoked', microtime(TRUE)); -} - -/** - * Alter the result set of a search query with a specific tag. - * - * The hook is invoked after all enabled processors have postprocessed the - * results. - * - * @param \Drupal\search_api\Query\ResultSetInterface $results - * The search results to alter. - */ -function hook_search_api_results_TAG_alter(\Drupal\search_api\Query\ResultSetInterface &$results) { - $results->setExtraData('example_hook_invoked', microtime(TRUE)); -} - -/** - * React when a search index was scheduled for reindexing. - * - * @param \Drupal\search_api\IndexInterface $index - * The index scheduled for reindexing. - * @param bool $clear - * Boolean indicating whether the index was also cleared. - */ -function hook_search_api_index_reindex(\Drupal\search_api\IndexInterface $index, $clear = FALSE) { - \Drupal\Core\Database\Database::getConnection()->insert('example_search_index_reindexed') - ->fields([ - 'index' => $index->id(), - 'clear' => $clear, - 'update_time' => \Drupal::time()->getRequestTime(), - ]) - ->execute(); -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/sites/all/modules/contrib/search/search_api/search_api.drush.inc b/sites/all/modules/contrib/search/search_api/search_api.drush.inc deleted file mode 100644 index 43f900ad9..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.drush.inc +++ /dev/null @@ -1,449 +0,0 @@ - 'List all search indexes.', - 'examples' => [ - 'drush search-api-list' => dt('List all search indexes.'), - 'drush sapi-l' => dt('Alias to list all search indexes.'), - ], - 'aliases' => ['sapi-l'], - ]; - - $items['search-api-enable'] = [ - 'description' => 'Enable one or more disabled search indexes.', - 'examples' => [ - 'drush search-api-enable node_index' => dt('Enable the search index with the ID @name.', ['@name' => 'node_index']), - 'drush sapi-en node_index' => dt('Alias to enable the search index with the ID @name.', ['@name' => 'node_index']), - ], - 'arguments' => $index, - 'aliases' => ['sapi-en'], - ]; - - $items['search-api-enable-all'] = [ - 'description' => 'Enable all disabled search indexes.', - 'examples' => [ - 'drush search-api-enable-all' => dt('Enable all disabled indexes.'), - 'drush sapi-ena' => dt('Alias to enable all disabled indexes.'), - ], - 'arguments' => [], - 'aliases' => ['sapi-ena'], - ]; - - $items['search-api-disable'] = [ - 'description' => 'Disable one or more enabled search indexes.', - 'examples' => [ - 'drush search-api-disable node_index' => dt('Disable the search index with the ID @name.', ['@name' => 'node_index']), - 'drush sapi-dis node_index' => dt('Alias to disable the search index with the ID @name.', ['@name' => 'node_index']), - ], - 'arguments' => $index, - 'aliases' => ['sapi-dis'], - ]; - - $items['search-api-disable-all'] = [ - 'description' => 'Disable all enabled search indexes.', - 'examples' => [ - 'drush search-api-disable-all' => dt('Disable all enabled indexes.'), - 'drush sapi-disa' => dt('Alias to disable all enabled indexes.'), - ], - 'arguments' => [], - 'aliases' => ['sapi-disa'], - ]; - - $items['search-api-status'] = [ - 'description' => 'Show the status of one or all search indexes.', - 'examples' => [ - 'drush search-api-status' => dt('Show the status of all search indexes.'), - 'drush sapi-s' => dt('Alias to show the status of all search indexes.'), - 'drush sapi-s node_index' => dt('Show the status of the search index with the ID @name.', ['@name' => 'node_index']), - ], - 'arguments' => $index, - 'aliases' => ['sapi-s'], - ]; - - $items['search-api-index'] = [ - 'description' => 'Index items for one or all enabled search indexes.', - 'examples' => [ - 'drush search-api-index' => dt('Index all items for all enabled indexes.'), - 'drush sapi-i' => dt('Alias to index all items for all enabled indexes.'), - 'drush sapi-i node_index' => dt('Index all items for the index with the ID @name.', ['@name' => 'node_index']), - 'drush sapi-i node_index 100' => dt('Index a maximum number of @limit items for the index with the ID @name.', ['@limit' => 100, '@name' => 'node_index']), - 'drush sapi-i node_index 100 10' => dt('Index a maximum number of @limit items (@batch_size items per batch run) for the index with the ID @name.', ['@limit' => 100, '@batch_size' => 10, '@name' => 'node_index']), - ], - 'options' => [ - 'limit' => dt('The number of items to index. Set to 0 to index all items. Defaults to 0 (index all).'), - 'batch-size' => dt('The number of items to index per batch run. Set to 0 to index all items at once. Defaults to the "!batch_size_label" setting of the index.', ['!batch_size_label' => dt('Cron batch size')]), - ], - 'arguments' => $index, - 'aliases' => ['sapi-i'], - ]; - - $items['search-api-reset-tracker'] = [ - 'description' => 'Force reindexing of one or all search indexes, without deleting existing index data.', - 'examples' => [ - 'drush search-api-reindex' => dt('Schedule all search indexes for reindexing.'), - 'drush sapi-r' => dt('Alias to schedule all search indexes for reindexing .'), - 'drush sapi-r node_index' => dt('Schedule the search index with the ID @name for reindexing.', ['@name' => 'node_index']), - ], - 'options' => [ - 'entity-types' => [ - 'description' => dt('List of entity type ids to reset tracker for.'), - 'example_value' => 'user,node', - ], - ], - 'arguments' => $index, - 'aliases' => [ - 'search-api-mark-all', - 'search-api-reindex', - 'sapi-r', - ], - ]; - - $items['search-api-clear'] = [ - 'description' => 'Clear one or all search indexes and mark them for reindexing.', - 'examples' => [ - 'drush search-api-clear' => dt('Clear all search indexes.'), - 'drush sapi-c' => dt('Alias to clear all search indexes.'), - 'drush sapi-c node_index' => dt('Clear the search index with the ID @name.', ['@name' => 'node_index']), - ], - 'arguments' => $index, - 'aliases' => ['sapi-c'], - ]; - - $items['search-api-search'] = [ - 'description' => 'Search for a keyword or phrase in a given index.', - 'examples' => [ - 'drush search-api-search node_index title' => dt('Search for "title" inside the "node_index" index.'), - 'drush sapi-search node_index title' => dt('Alias to search for "title" inside the "node_index" index.'), - ], - 'arguments' => $index + [ - 'keyword' => dt('The keyword to look for.'), - ], - 'aliases' => ['sapi-search'], - ]; - - $items['search-api-server-list'] = [ - 'description' => 'List all search servers.', - 'examples' => [ - 'drush search-api-server-list' => dt('List all search servers.'), - 'drush sapi-sl' => dt('Alias to list all search servers.'), - ], - 'aliases' => ['sapi-sl'], - ]; - - $items['search-api-server-enable'] = [ - 'description' => 'Enable a search server.', - 'examples' => [ - 'drush search-api-server-e my_solr_server' => dt('Enable the @server search server.', ['@server' => 'my_solr_server']), - 'drush sapi-se my_solr_server' => dt('Alias to enable the @server search server.', ['@server' => 'my_solr_server']), - ], - 'arguments' => $server, - 'aliases' => ['sapi-se'], - ]; - - $items['search-api-server-disable'] = [ - 'description' => 'Disable a search server.', - 'examples' => [ - 'drush search-api-server-disable' => dt('Disable the @server search server.', ['@server' => 'my_solr_server']), - 'drush sapi-sd' => dt('Alias to disable the @server search server.', ['@server' => 'my_solr_server']), - ], - 'arguments' => $server, - 'aliases' => ['sapi-sd'], - ]; - - $items['search-api-server-clear'] = [ - 'description' => 'Clear all search indexes on the search server and mark them for reindexing.', - 'examples' => [ - 'drush search-api-server-clear' => dt('Clear all search indexes on the search server @server.', ['@server' => 'my_solr_server']), - 'drush sapi-sc' => dt('Alias to clear all search indexes on the search server @server.', ['@server' => 'my_solr_server']), - ], - 'arguments' => $server, - 'aliases' => ['sapi-sc'], - ]; - - $items['search-api-set-index-server'] = [ - 'description' => 'Set the search server used by a given index.', - 'examples' => [ - 'drush search-api-set-index-server default_node_index my_solr_server' => dt('Set the @index index to used the @server server.', ['@index' => 'default_node_index', '@server' => 'my_solr_server']), - 'drush sapi-sis default_node_index my_solr_server' => dt('Alias to set the @index index to used the @server server.', ['@index' => 'default_node_index', '@server' => 'my_solr_server']), - ], - 'arguments' => $index + $server, - 'aliases' => ['sapi-sis'], - ]; - - return $items; -} - -/** - * Prints a list of all search indexes. - */ -function drush_search_api_list() { - $command_helper = _search_api_drush_command_helper(); - $rows[] = [ - dt('ID'), - dt('Name'), - dt('Server'), - dt('Type'), - dt('Status'), - dt('Limit'), - ]; - $rows += $command_helper->indexListCommand(); - foreach ($rows as &$row) { - $row['types'] = is_array($row['types']) ? implode(', ', $row['types']) : $row['types']; - $row['typeNames'] = is_array($row['types']) ? implode(', ', $row['typeNames']) : $row['types']; - } - drush_print_table($rows); -} - -/** - * Enables one or more search indexes. - * - * @param string|null $index_id - * The ID of a search index to enable. Or NULL (only used internally) to - * enable all disabled indexes. - */ -function drush_search_api_enable($index_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->enableIndexCommand([$index_id]); - } - catch (ConsoleException $exception) { - drush_set_error($exception->getMessage()); - } -} - -/** - * Enables all search indexes. - */ -function drush_search_api_enable_all() { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->enableIndexCommand(); - } - catch (ConsoleException $exception) { - drush_set_error($exception->getMessage()); - } -} - -/** - * Disables one or more search indexes. - * - * @param string|null $index_id - * The ID of a search index to disable. Or NULL (only used internally) to - * disable all enabled indexes. - */ -function drush_search_api_disable($index_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->disableIndexCommand([$index_id]); - } - catch (ConsoleException $exception) { - drush_set_error($exception->getMessage()); - } -} - -/** - * Disables all search indexes. - */ -function drush_search_api_disable_all() { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->disableIndexCommand(); - } - catch (ConsoleException $exception) { - drush_set_error($exception->getMessage()); - } -} - -/** - * Displays the status of one or all search indexes. - * - * @param string|null $index_id - * (optional) The ID of the search index whose status should be displayed, or - * NULL to display the status of all search indexes. - */ -function drush_search_api_status($index_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - $rows[] = [ - dt('ID'), - dt('Name'), - dt('% Complete'), - dt('Indexed'), - dt('Total'), - ]; - $rows += $command_helper->indexStatusCommand([$index_id]); - - drush_print_table($rows); -} - -/** - * Indexes items. - * - * @param string|null $index_id - * (optional) The index ID for which items should be indexed, or NULL to index - * items on all indexes. - */ -function drush_search_api_index($index_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - $limit = drush_get_option('limit'); - $batch_size = drush_get_option('batch-size'); - - $batch_set = $command_helper->indexItemsToIndexCommand([$index_id], $limit, $batch_size); - if ($batch_set) { - drush_backend_batch_process(); - } -} - -/** - * Schedules a search index for reindexing. - * - * @param string|null $index_id - * (optional) The index ID for which items should be reindexed, or NULL to - * reindex all search indexes. - */ -function drush_search_api_reset_tracker($index_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - $entity_types = drush_get_option_list('entity-types'); - $command_helper->resetTrackerCommand([$index_id], $entity_types); -} - -/** - * Clears a search index. - * - * @param string|null $index_id - * (optional) The ID of the search index which should be cleared, or NULL to - * clear all search indexes. - */ -function drush_search_api_clear($index_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - $command_helper->clearIndexCommand([$index_id]); -} - -/** - * Executes a simple keyword search and displays the results in a table. - * - * @param string $index_id - * The ID of the index being searched. - * @param string $keyword - * The search keyword. - */ -function drush_search_api_search($index_id, $keyword) { - $command_helper = _search_api_drush_command_helper(); - $rows = $command_helper->searchIndexCommand($index_id, $keyword); - drush_print_table($rows); -} - -/** - * Lists all available search servers. - */ -function drush_search_api_server_list() { - $command_helper = _search_api_drush_command_helper(); - $rows[] = [ - dt('ID'), - dt('Name'), - dt('Status'), - ]; - - try { - $rows += $command_helper->serverListCommand(); - } - catch (ConsoleException $exception) { - drush_print($exception->getMessage()); - } - - drush_print_table($rows); -} - -/** - * Enables a search server. - * - * @param string $server_id - * The ID of the server to enable. - */ -function drush_search_api_server_enable($server_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->enableServerCommand($server_id); - } - catch (ConsoleException $exception) { - drush_print($exception->getMessage()); - } -} - -/** - * Disables a search server. - * - * @param string $server_id - * The ID of the server to disable. - */ -function drush_search_api_server_disable($server_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->disableServerCommand($server_id); - } - catch (ConsoleException $exception) { - drush_print($exception->getMessage()); - } -} - -/** - * Clears all search indexes on the server and marks them for reindexing. - * - * @param string $server_id - * The ID of the server to clear all search indexes. - */ -function drush_search_api_server_clear($server_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->clearServerCommand($server_id); - } - catch (ConsoleException $exception) { - drush_print($exception->getMessage()); - } -} - -/** - * Sets the server for a given index. - * - * @param string $index_id - * The ID of the index whose server should be changed. - * @param string $server_id - * The ID of the new server for the index. - */ -function drush_search_api_set_index_server($index_id = NULL, $server_id = NULL) { - $command_helper = _search_api_drush_command_helper(); - try { - $command_helper->setIndexServerCommand($index_id, $server_id); - } - catch (ConsoleException $exception) { - drush_print($exception->getMessage()); - } -} - -/** - * Returns an instance of the command helper. - * - * @return \Drupal\search_api\Utility\CommandHelper - * An instance of the command helper class. - */ -function _search_api_drush_command_helper() { - $command_helper = new CommandHelper(\Drupal::entityTypeManager(), \Drupal::moduleHandler(), 'dt'); - $command_helper->setLogger(\Drupal::logger('search_api')); - return $command_helper; -} diff --git a/sites/all/modules/contrib/search/search_api/search_api.info.yml b/sites/all/modules/contrib/search/search_api/search_api.info.yml deleted file mode 100644 index f2d747f03..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -type: module -name: 'Search API' -description: 'Provides a generic framework for modules offering search capabilities.' -package: Search -# core: 8.x -configure: search_api.overview -dependencies: - - drupal:system (>=8.5) - -# Information added by Drupal.org packaging script on 2018-11-18 -version: '8.x-1.11' -core: '8.x' -project: 'search_api' -datestamp: 1542564486 diff --git a/sites/all/modules/contrib/search/search_api/search_api.install b/sites/all/modules/contrib/search/search_api/search_api.install deleted file mode 100644 index dca72e83c..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.install +++ /dev/null @@ -1,281 +0,0 @@ - 'Stores the items which should be indexed for each index, and their state.', - 'fields' => [ - 'index_id' => [ - 'description' => 'The ID of the index this item belongs to', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - ], - 'datasource' => [ - 'description' => 'The plugin ID of the datasource this item belongs to', - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - ], - 'item_id' => [ - 'description' => 'The unique identifier of this item', - 'type' => 'varchar', - 'length' => 150, - 'not null' => TRUE, - ], - 'changed' => [ - 'description' => 'A timestamp indicating when the item was last changed', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'status' => [ - 'description' => 'Boolean indicating the reindexation status, "1" when we need to reindex, "0" otherwise', - 'type' => 'int', - 'not null' => TRUE, - ], - ], - 'indexes' => [ - 'indexing' => ['index_id', 'status', 'changed', 'item_id'], - ], - 'primary key' => ['index_id', 'item_id'], - ]; - - return $schema; -} - -/** - * Implements hook_uninstall(). - */ -function search_api_uninstall() { - \Drupal::state()->delete('search_api_use_tracking_batch'); - foreach (\Drupal::configFactory()->listAll('search_api.index.') as $index_id) { - \Drupal::state()->delete("search_api.index.$index_id.has_reindexed"); - } -} - -/** - * Implements hook_requirements(). - */ -function search_api_requirements($phase) { - if ($phase == 'runtime') { - $requirements = []; - $message = _search_api_search_module_warning(); - if ($message) { - $requirements += [ - 'search_api_core_search' => [ - 'title' => t('Search API'), - 'value' => $message, - 'severity' => REQUIREMENT_WARNING, - ], - ]; - } - - /** @var \Drupal\search_api\ServerInterface[] $servers */ - $servers = Server::loadMultiple(); - $unavailable_servers = []; - foreach ($servers as $server) { - if ($server->status() && !$server->isAvailable()) { - $unavailable_servers[] = $server->label(); - } - } - if (!empty($unavailable_servers)) { - $requirements += [ - 'search_api_server_unavailable' => [ - 'title' => t('Search API'), - 'value' => \Drupal::translation()->formatPlural( - count($unavailable_servers), - 'The search server "@servers" is currently not available', - 'The following search servers are not available: @servers', - ['@servers' => implode(', ', $unavailable_servers)] - ), - 'severity' => REQUIREMENT_ERROR - ] - ]; - } - - $pending_tasks = \Drupal::getContainer() - ->get('search_api.task_manager') - ->getTasksCount(); - if ($pending_tasks) { - $args['@link'] = ''; - $url = Url::fromRoute('search_api.execute_tasks'); - if ($url->access()) { - $link = new Link(t('Execute now'), $url); - $link = $link->toString(); - $args['@link'] = $link; - $args['@link'] = new FormattableMarkup(' (@link)', $args); - } - - $requirements['search_api_pending_tasks'] = [ - 'title' => t('Search API'), - 'value' => \Drupal::translation()->formatPlural( - $pending_tasks, - 'There is @count pending Search API task. @link', - 'There are @count pending Search API tasks. @link', - $args - ), - 'severity' => REQUIREMENT_WARNING, - ]; - } - - return $requirements; - } - return []; -} - -/** - * Adapts index config schema to remove an unnecessary layer for plugins. - */ -function search_api_update_8101() { - // This update function updates search indexes for the change from - // https://www.drupal.org/node/2656052. - $config_factory = \Drupal::configFactory(); - $plugin_types = [ - 'processor', - 'datasource', - 'tracker', - ]; - - foreach ($config_factory->listAll('search_api.index.') as $index_id) { - $index = $config_factory->getEditable($index_id); - $changed = FALSE; - - foreach ($plugin_types as $plugin_type) { - $property = $plugin_type . '_settings'; - $plugins = $index->get($property); - foreach ($plugins as $id => $config) { - if (isset($config['plugin_id']) && isset($config['settings'])) { - $changed = TRUE; - $plugins[$id] = $config['settings']; - } - } - $index->set($property, $plugins); - } - - if ($changed) { - // Mark the resulting configuration as trusted data. This avoids issues - // with future schema changes. - $index->save(TRUE); - } - } - - return t('Index config schema updated.'); -} - -/** - * Removes unsupported cache plugins from Search API views. - */ -function search_api_update_8102() { - $config_factory = \Drupal::configFactory(); - $changed = []; - - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $view = $config_factory->getEditable($view_config_name); - $displays = $view->get('display'); - - if ($displays['default']['display_options']['query']['type'] === 'search_api_query') { - $change = FALSE; - foreach ($displays as $id => $display) { - if (!empty($display['display_options']['cache']['type']) && in_array($display['display_options']['cache']['type'], ['tag', 'time']) - ) { - $displays[$id]['display_options']['cache']['type'] = 'none'; - $change = TRUE; - } - } - - if ($change) { - $view->set('display', $displays); - // Mark the resulting configuration as trusted data. This avoids issues - // with future schema changes. - $view->save(TRUE); - $changed[] = $view->get('id'); - } - } - } - - if (!empty($changed)) { - return \Drupal::translation()->translate('Removed incompatible cache options for the following Search API-based views: @ids', ['@ids' => implode(', ', array_unique($changed))]); - } - - return NULL; -} - -/** - * Switches from the old "Node status" to the new "Entity status" processor. - */ -function search_api_update_8103() { - // This update function updates search indexes for the change from - // https://www.drupal.org/node/2491175. - $config_factory = \Drupal::configFactory(); - - foreach ($config_factory->listAll('search_api.index.') as $index_id) { - $index = $config_factory->getEditable($index_id); - $processors = $index->get('processor_settings'); - - if (isset($processors['node_status'])) { - $processors['entity_status'] = $processors['node_status']; - unset($processors['node_status']); - $index->set('processor_settings', $processors); - // Mark the resulting configuration as trusted data. This avoids issues - // with future schema changes. - $index->save(TRUE); - } - } - - // Clear the processor plugin cache so that if anything else indirectly tries - // to update Search API-related configuration, the plugin helper gets the most - // up-to-date plugin definitions. - \Drupal::getContainer() - ->get('plugin.manager.search_api.processor') - ->clearCachedDefinitions(); - - return t('Switched from old "Node status" to new "Entity status" processor.'); -} - -/** - * Update Views to use the time-based cache plugin for Search API. - */ -function search_api_update_8104() { - $config_factory = \Drupal::configFactory(); - $changed = []; - - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $view = $config_factory->getEditable($view_config_name); - $displays = $view->get('display'); - - $updated = FALSE; - foreach ($displays as $id => $display) { - if (!empty($display['display_options']['cache']['type']) && $display['display_options']['cache']['type'] === 'search_api') { - $displays[$id]['display_options']['cache']['type'] = 'search_api_time'; - $updated = TRUE; - } - } - - if ($updated) { - $view->set('display', $displays); - // Mark the resulting configuration as trusted data. This avoids issues - // with future schema changes. - $view->save(TRUE); - $changed[] = $view->get('id'); - } - } - - if (!empty($changed)) { - return \Drupal::translation()->translate('The following views have been updated to use the time-based cache plugin: @ids', ['@ids' => implode(', ', array_unique($changed))]); - } - - return NULL; -} diff --git a/sites/all/modules/contrib/search/search_api/search_api.libraries.yml b/sites/all/modules/contrib/search/search_api/search_api.libraries.yml deleted file mode 100644 index ac1b451b9..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.libraries.yml +++ /dev/null @@ -1,13 +0,0 @@ -drupal.search_api.admin_css: - version: VERSION - css: - theme: - css/search_api.admin.css: {} -drupal.search_api.processors: - version: VERSION - js: - js/search_api.processors.js: {} - dependencies: - - core/drupal - - core/jquery - - core/jquery.once diff --git a/sites/all/modules/contrib/search/search_api/search_api.links.action.yml b/sites/all/modules/contrib/search/search_api/search_api.links.action.yml deleted file mode 100644 index 5b99f87fa..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.links.action.yml +++ /dev/null @@ -1,15 +0,0 @@ -entity.search_api_server.add_form: - route_name: entity.search_api_server.add_form - title: 'Add server' - appears_on: - - search_api.overview -entity.search_api_index.add_form: - route_name: entity.search_api_index.add_form - title: 'Add index' - appears_on: - - search_api.overview -search_api.execute_tasks: - route_name: search_api.execute_tasks - title: 'Execute pending tasks' - appears_on: - - search_api.overview diff --git a/sites/all/modules/contrib/search/search_api/search_api.links.menu.yml b/sites/all/modules/contrib/search/search_api/search_api.links.menu.yml deleted file mode 100644 index 897449dc8..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -search_api.overview: - title: Search API - description: 'Create and configure search indexes and servers.' - route_name: search_api.overview - parent: system.admin_config_search diff --git a/sites/all/modules/contrib/search/search_api/search_api.links.task.yml b/sites/all/modules/contrib/search/search_api/search_api.links.task.yml deleted file mode 100644 index 8eb808c88..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.links.task.yml +++ /dev/null @@ -1,27 +0,0 @@ -entity.search_api_server.canonical: - route_name: entity.search_api_server.canonical - base_route: entity.search_api_server.canonical - title: 'View' -entity.search_api_server.edit_form: - route_name: entity.search_api_server.edit_form - base_route: entity.search_api_server.canonical - title: 'Edit' -entity.search_api_index.canonical: - route_name: entity.search_api_index.canonical - base_route: entity.search_api_index.canonical - title: 'View' -entity.search_api_index.edit_form: - route_name: entity.search_api_index.edit_form - base_route: entity.search_api_index.canonical - title: 'Edit' - weight: 5 -entity.search_api_index.fields: - title: 'Fields' - route_name: entity.search_api_index.fields - base_route: entity.search_api_index.canonical - weight: 10 -entity.search_api_index.processors: - route_name: entity.search_api_index.processors - base_route: entity.search_api_index.canonical - title: 'Processors' - weight: 20 diff --git a/sites/all/modules/contrib/search/search_api/search_api.module b/sites/all/modules/contrib/search/search_api/search_api.module deleted file mode 100644 index 8aea28d8c..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.module +++ /dev/null @@ -1,672 +0,0 @@ -$message

        $search_module_warning

        "; - } - return $message; - } - return NULL; -} - -/** - * Implements hook_cron(). - * - * This will first execute pending tasks (if there are any). After that, items - * will be indexed on all enabled indexes with a non-zero cron limit. Indexing - * will run for the time set in the cron_worker_runtime config setting - * (defaulting to 15 seconds), but will at least index one batch of items on - * each index. - */ -function search_api_cron() { - // Execute pending server tasks. - \Drupal::getContainer()->get('search_api.server_task_manager')->execute(); - - // Load all enabled, not read-only indexes. - $conditions = [ - 'status' => TRUE, - ]; - $index_storage = \Drupal::entityTypeManager()->getStorage('search_api_index'); - /** @var \Drupal\search_api\IndexInterface[] $indexes */ - $indexes = $index_storage->loadByProperties($conditions); - if (!$indexes) { - return; - } - - // Add items to the tracking system for all indexes for which this hasn't - // happened yet. - $task_manager = \Drupal::getContainer()->get('search_api.task_manager'); - foreach ($indexes as $index_id => $index) { - $conditions = [ - 'type' => IndexTaskManager::TRACK_ITEMS_TASK_TYPE, - 'index_id' => $index_id, - ]; - $task_manager->executeSingleTask($conditions); - - // Filter out read-only indexes here, since we want to have tracking but not - // index items for them. - if ($index->isReadOnly()) { - unset($indexes[$index_id]); - } - } - - // Now index items. - // Remember servers which threw an exception. - $ignored_servers = []; - - // Continue indexing, one batch from each index, until the time is up, but at - // least index one batch per index. - $settings = \Drupal::config('search_api.settings'); - $default_cron_limit = $settings->get('default_cron_limit'); - $end = time() + $settings->get('cron_worker_runtime'); - $first_pass = TRUE; - while (TRUE) { - if (!$indexes) { - break; - } - foreach ($indexes as $id => $index) { - if (!$first_pass && time() >= $end) { - break 2; - } - if (!empty($ignored_servers[$index->getServerId()])) { - continue; - } - - $limit = $index->getOption('cron_limit', $default_cron_limit); - $num = 0; - if ($limit) { - try { - $num = $index->indexItems($limit); - if ($num) { - $variables = [ - '@num' => $num, - '%name' => $index->label(), - ]; - \Drupal::service('logger.channel.search_api')->info('Indexed @num items for index %name.', $variables); - } - } - catch (SearchApiException $e) { - // Exceptions will probably be caused by the server in most cases. - // Therefore, don't index for any index on this server. - $ignored_servers[$index->getServerId()] = TRUE; - $vars['%index'] = $index->label(); - watchdog_exception('search_api', $e, '%type while trying to index items on %index: @message in %function (line %line of %file).', $vars); - } - } - if (!$num) { - // Couldn't index any items => stop indexing for this index in this - // cron run. - unset($indexes[$id]); - } - } - $first_pass = FALSE; - } -} - -/** - * Implements hook_hook_info(). - */ -function search_api_hook_info() { - $hooks = [ - 'search_api_backend_info_alter', - 'search_api_server_features_alter', - 'search_api_datasource_info_alter', - 'search_api_processor_info_alter', - 'search_api_data_type_info_alter', - 'search_api_parse_mode_info_alter', - 'search_api_tracker_info_alter', - 'search_api_displays_alter', - 'search_api_field_type_mapping_alter', - 'search_api_views_handler_mapping_alter', - 'search_api_views_field_handler_mapping_alter', - 'search_api_index_items_alter', - 'search_api_items_indexed', - 'search_api_query_alter', - // Unfortunately, it's not possible to add hook infos for hooks with - // "wildcards". - // 'search_api_query_TAG_alter', - 'search_api_results_alter', - // 'search_api_results_TAG_alter', - 'search_api_index_reindex', - ]; - $info = [ - 'group' => 'search_api', - ]; - return array_fill_keys($hooks, $info); -} - -/** - * Implements hook_config_import_steps_alter(). - */ -function search_api_config_import_steps_alter(&$sync_steps, ConfigImporter $config_importer) { - $new = $config_importer->getUnprocessedConfiguration('create'); - $changed = $config_importer->getUnprocessedConfiguration('update'); - $new_or_changed = array_merge($new, $changed); - $prefix = \Drupal::entityTypeManager()->getDefinition('search_api_index')->getConfigPrefix() . '.'; - $prefix_length = strlen($prefix); - foreach ($new_or_changed as $config_id) { - if (substr($config_id, 0, $prefix_length) === $prefix) { - $sync_steps[] = ['Drupal\search_api\Task\IndexTaskManager', 'processIndexTasks']; - } - } -} - -/** - * Implements hook_entity_insert(). - * - * Adds entries for all languages of the new entity to the tracking table for - * each index that tracks entities of this type. - * - * By setting the $entity->search_api_skip_tracking property to a true-like - * value before this hook is invoked, you can prevent this behavior and make the - * Search API ignore this new entity. - * - * Note that this function implements tracking only on behalf of the "Content - * Entity" datasource defined in this module, not for entity-based datasources - * in general. Datasources defined by other modules still have to implement - * their own mechanism for tracking new/updated/deleted entities. - * - * @see \Drupal\search_api\Plugin\search_api\datasource\ContentEntity - */ -function search_api_entity_insert(EntityInterface $entity) { - // Check if the entity is a content entity. - if (!($entity instanceof ContentEntityInterface) || $entity->search_api_skip_tracking) { - return; - } - $indexes = ContentEntity::getIndexesForEntity($entity); - if (!$indexes) { - return; - } - - // Compute the item IDs for all languages of the entity. - $item_ids = []; - $entity_id = $entity->id(); - foreach (array_keys($entity->getTranslationLanguages()) as $langcode) { - $item_ids[] = $entity_id . ':' . $langcode; - } - $datasource_id = 'entity:' . $entity->getEntityTypeId(); - foreach ($indexes as $index) { - $filtered_item_ids = ContentEntity::filterValidItemIds($index, $datasource_id, $item_ids); - $index->trackItemsInserted($datasource_id, $filtered_item_ids); - } -} - -/** - * Implements hook_entity_update(). - * - * Updates the corresponding tracking table entries for each index that tracks - * this entity. - * - * Also takes care of new or deleted translations. - * - * By setting the $entity->search_api_skip_tracking property to a true-like - * value before this hook is invoked, you can prevent this behavior and make the - * Search API ignore this update. - * - * Note that this function implements tracking only on behalf of the "Content - * Entity" datasource defined in this module, not for entity-based datasources - * in general. Datasources defined by other modules still have to implement - * their own mechanism for tracking new/updated/deleted entities. - * - * @see \Drupal\search_api\Plugin\search_api\datasource\ContentEntity - */ -function search_api_entity_update(EntityInterface $entity) { - // Check if the entity is a content entity. - if (!($entity instanceof ContentEntityInterface) || $entity->search_api_skip_tracking) { - return; - } - $indexes = ContentEntity::getIndexesForEntity($entity); - if (!$indexes) { - return; - } - - // Compare old and new languages for the entity to identify inserted, - // updated and deleted translations (and, therefore, search items). - $entity_id = $entity->id(); - $inserted_item_ids = []; - $updated_item_ids = $entity->getTranslationLanguages(); - $deleted_item_ids = []; - $old_translations = $entity->original->getTranslationLanguages(); - foreach ($old_translations as $langcode => $language) { - if (!isset($updated_item_ids[$langcode])) { - $deleted_item_ids[] = $langcode; - } - } - foreach ($updated_item_ids as $langcode => $language) { - if (!isset($old_translations[$langcode])) { - unset($updated_item_ids[$langcode]); - $inserted_item_ids[] = $langcode; - } - } - - $datasource_id = 'entity:' . $entity->getEntityTypeId(); - $combine_id = function ($langcode) use ($entity_id) { - return $entity_id . ':' . $langcode; - }; - $inserted_item_ids = array_map($combine_id, $inserted_item_ids); - $updated_item_ids = array_map($combine_id, array_keys($updated_item_ids)); - $deleted_item_ids = array_map($combine_id, $deleted_item_ids); - foreach ($indexes as $index) { - if ($inserted_item_ids) { - $filtered_item_ids = ContentEntity::filterValidItemIds($index, $datasource_id, $inserted_item_ids); - $index->trackItemsInserted($datasource_id, $filtered_item_ids); - } - if ($updated_item_ids) { - $index->trackItemsUpdated($datasource_id, $updated_item_ids); - } - if ($deleted_item_ids) { - $index->trackItemsDeleted($datasource_id, $deleted_item_ids); - } - } -} - -/** - * Implements hook_entity_delete(). - * - * Deletes all entries for this entity from the tracking table for each index - * that tracks this entity type. - * - * By setting the $entity->search_api_skip_tracking property to a true-like - * value before this hook is invoked, you can prevent this behavior and make the - * Search API ignore this deletion. (Note that this might lead to stale data in - * the tracking table or on the server, since the item will not removed from - * there (if it has been added before).) - * - * Note that this function implements tracking only on behalf of the "Content - * Entity" datasource defined in this module, not for entity-based datasources - * in general. Datasources defined by other modules still have to implement - * their own mechanism for tracking new/updated/deleted entities. - * - * @see \Drupal\search_api\Plugin\search_api\datasource\ContentEntity - */ -function search_api_entity_delete(EntityInterface $entity) { - // Check if the entity is a content entity. - if (!($entity instanceof ContentEntityInterface) || $entity->search_api_skip_tracking) { - return; - } - $indexes = ContentEntity::getIndexesForEntity($entity); - if (!$indexes) { - return; - } - - // Remove the search items for all the entity's translations. - $item_ids = []; - $entity_id = $entity->id(); - foreach (array_keys($entity->getTranslationLanguages()) as $langcode) { - $item_ids[] = $entity_id . ':' . $langcode; - } - $datasource_id = 'entity:' . $entity->getEntityTypeId(); - foreach ($indexes as $index) { - $index->trackItemsDeleted($datasource_id, $item_ids); - } -} - -/** - * Implements hook_node_access_records_alter(). - * - * Marks the node and its comments changed for indexes that use the "Content - * access" processor. - */ -function search_api_node_access_records_alter(array &$grants, NodeInterface $node) { - /** @var \Drupal\search_api\IndexInterface $index */ - foreach (Index::loadMultiple() as $index) { - if (!$index->hasValidTracker() || !$index->status()) { - continue; - } - if (!$index->isValidProcessor('content_access')) { - continue; - } - - foreach ($index->getDatasources() as $datasource_id => $datasource) { - switch ($datasource->getEntityTypeId()) { - case 'node': - // Don't index the node if search_api_skip_tracking is set on it. - if ($node->search_api_skip_tracking) { - continue 2; - } - $item_id = $datasource->getItemId($node->getTypedData()); - if ($item_id !== NULL) { - $index->trackItemsUpdated($datasource_id, [$item_id]); - } - break; - - case 'comment': - if (!isset($comments)) { - $entity_query = \Drupal::entityQuery('comment'); - $entity_query->condition('entity_id', (int) $node->id()); - $entity_query->condition('entity_type', 'node'); - $comment_ids = $entity_query->execute(); - /** @var \Drupal\comment\CommentInterface[] $comments */ - $comments = Comment::loadMultiple($comment_ids); - } - $item_ids = []; - foreach ($comments as $comment) { - $item_id = $datasource->getItemId($comment->getTypedData()); - if ($item_id !== NULL) { - $item_ids[] = $item_id; - } - } - if ($item_ids) { - $index->trackItemsUpdated($datasource_id, $item_ids); - } - break; - } - } - } -} - -/** - * Implements hook_theme(). - */ -function search_api_theme() { - return [ - 'search_api_admin_fields_table' => [ - 'render element' => 'element', - 'function' => 'theme_search_api_admin_fields_table', - 'file' => 'search_api.theme.inc', - ], - 'search_api_admin_data_type_table' => [ - 'variables' => [ - 'data_types' => [], - 'fallback_mapping' => [] - ], - 'function' => 'theme_search_api_admin_data_type_table', - 'file' => 'search_api.theme.inc', - ], - 'search_api_form_item_list' => [ - 'render element' => 'element', - 'function' => 'theme_search_api_form_item_list', - 'file' => 'search_api.theme.inc', - ], - 'search_api_server' => [ - 'variables' => ['server' => NULL], - 'function' => 'theme_search_api_server', - 'file' => 'search_api.theme.inc', - ], - 'search_api_index' => [ - 'variables' => [ - 'index' => NULL, - 'server_count' => NULL, - 'server_count_error' => NULL, - ], - 'function' => 'theme_search_api_index', - 'file' => 'search_api.theme.inc', - ], - ]; -} - -/** - * Implements hook_ENTITY_TYPE_update() for type "search_api_index". - * - * Implemented on behalf of the "entity" datasource plugin. - * - * @see \Drupal\search_api\Plugin\search_api\datasource\ContentEntity - */ -function search_api_search_api_index_update(IndexInterface $index) { - if (!$index->status() || empty($index->original)) { - return; - } - /** @var \Drupal\search_api\IndexInterface $original */ - $original = $index->original; - if (!$original->status()) { - return; - } - - foreach ($index->getDatasources() as $datasource_id => $datasource) { - if ($datasource->getBaseId() != 'entity' - || !($datasource instanceof EntityDatasourceInterface) - || !$original->isValidDatasource($datasource_id)) { - continue; - } - $old_datasource = $original->getDatasource($datasource_id); - $old_config = $old_datasource->getConfiguration(); - $new_config = $datasource->getConfiguration(); - - if ($old_config != $new_config) { - // Bundles and languages share the same structure, so changes can be - // processed in a unified way. - $tasks = []; - $insert_task = ContentEntityTaskManager::INSERT_ITEMS_TASK_TYPE; - $delete_task = ContentEntityTaskManager::DELETE_ITEMS_TASK_TYPE; - $settings = []; - $entity_type = \Drupal::entityTypeManager() - ->getDefinition($datasource->getEntityTypeId()); - if ($entity_type->hasKey('bundle')) { - $settings['bundles'] = $datasource->getBundles(); - } - if ($entity_type->isTranslatable()) { - $settings['languages'] = \Drupal::languageManager()->getLanguages(); - } - - // Determine which bundles/languages have been newly selected or - // deselected and then assign them to the appropriate actions depending - // on the current "default" setting. - foreach ($settings as $setting => $all) { - $old_selected = array_flip($old_config[$setting]['selected']); - $new_selected = array_flip($new_config[$setting]['selected']); - - // First, check if the "default" setting changed and invert the checked - // items for the old config, so the following comparison makes sense. - if ($old_config[$setting]['default'] != $new_config[$setting]['default']) { - $old_selected = array_diff_key($all, $old_selected); - } - - $newly_selected = array_keys(array_diff_key($new_selected, $old_selected)); - $newly_unselected = array_keys(array_diff_key($old_selected, $new_selected)); - if ($new_config[$setting]['default']) { - $tasks[$insert_task][$setting] = $newly_unselected; - $tasks[$delete_task][$setting] = $newly_selected; - } - else { - $tasks[$insert_task][$setting] = $newly_selected; - $tasks[$delete_task][$setting] = $newly_unselected; - } - } - - // This will keep only those tasks where at least one of "bundles" or - // "languages" is non-empty. - $tasks = array_filter($tasks, 'array_filter'); - $task_manager = \Drupal::getContainer() - ->get('search_api.task_manager'); - foreach ($tasks as $task => $data) { - $data += [ - 'datasource' => $datasource_id, - 'page' => 0, - ]; - $task_manager->addTask($task, NULL, $index, $data); - } - - // If we added any new tasks, set a batch for them. (If we aren't in a - // form submission, this will just be ignored.) - if ($tasks) { - $task_manager->setTasksBatch([ - 'index_id' => $index->id(), - 'type' => array_keys($tasks), - ]); - } - } - } -} - -/** - * Implements hook_views_plugins_argument_alter(). - */ -function search_api_views_plugins_argument_alter(array &$plugins) { - // We have to include the term argument handler like this, since adding it - // directly (i.e., with an annotation) would cause fatal errors on sites - // without the Taxonomy module. - if (\Drupal::moduleHandler()->moduleExists('taxonomy')) { - $plugins['search_api_term'] = [ - 'plugin_type' => 'argument', - 'id' => 'search_api_term', - 'class' => TermArgument::class, - 'provider' => 'search_api', - ]; - } -} - -/** - * Implements hook_views_plugins_filter_alter(). - */ -function search_api_views_plugins_filter_alter(array &$plugins) { - // We have to include the term filter handler like this, since adding it - // directly (i.e., with an annotation) would cause fatal errors on sites - // without the Taxonomy module. - if (\Drupal::moduleHandler()->moduleExists('taxonomy')) { - $plugins['search_api_term'] = [ - 'plugin_type' => 'filter', - 'id' => 'search_api_term', - 'class' => TermFilter::class, - 'provider' => 'search_api', - ]; - } -} - -/** - * Implements hook_ENTITY_TYPE_insert() for type "view". - */ -function search_api_view_insert(ViewEntityInterface $view) { - _search_api_view_crud_event($view); - - // Disable Views' default caching mechanisms on Search API views. - $displays = $view->get('display'); - if ($displays['default']['display_options']['query']['type'] === 'search_api_query') { - $change = FALSE; - foreach ($displays as $id => $display) { - if (isset($display['display_options']['cache']['type']) && in_array($display['display_options']['cache']['type'], ['tag', 'time'])) { - $displays[$id]['display_options']['cache']['type'] = 'none'; - $change = TRUE; - } - } - - if ($change) { - $warning = t('The selected caching mechanism does not work with views on Search API indexes. Please either use one of the Search API-specific caching options or "None". Caching was turned off for this view.'); - \Drupal::messenger()->addWarning($warning); - $view->set('display', $displays); - $view->save(); - } - } -} - -/** - * Implements hook_ENTITY_TYPE_update() for type "view". - */ -function search_api_view_update(ViewEntityInterface $view) { - _search_api_view_crud_event($view); -} - -/** - * Implements hook_ENTITY_TYPE_delete() for type "view". - */ -function search_api_view_delete(ViewEntityInterface $view) { - _search_api_view_crud_event($view); -} - -/** - * Reacts to a view CRUD event. - * - * @param \Drupal\views\ViewEntityInterface $view - * The view that was created, changed or deleted. - */ -function _search_api_view_crud_event(ViewEntityInterface $view) { - // Whenever a view is created, updated (displays might have been added or - // removed) or deleted, we need to clear our cached display definitions. - if (SearchApiQuery::getIndexFromTable($view->get('base_table'))) { - \Drupal::getContainer() - ->get('plugin.manager.search_api.display') - ->clearCachedDefinitions(); - } -} - -/** - * Retrieves the allowed values for a list field instance. - * - * @param string $entity_type - * The entity type to which the field is attached. - * @param string $bundle - * The bundle to which the field is attached. - * @param string $field_name - * The field's field name. - * - * @return array|null - * An array of allowed values in the form key => label, or NULL. - * - * @see _search_api_views_handler_adjustments() - */ -function _search_api_views_get_allowed_values($entity_type, $bundle, $field_name) { - $field_manager = \Drupal::getContainer()->get('entity_field.manager'); - $field_definitions = $field_manager->getFieldDefinitions($entity_type, $bundle); - if (!empty($field_definitions[$field_name])) { - /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */ - $field_definition = $field_definitions[$field_name]; - $options = $field_definition->getSetting('allowed_values'); - if ($options) { - return $options; - } - } - return NULL; -} - -/** - * Implements hook_form_FORM_ID_alter() for form "views_ui_edit_display_form". - */ -function search_api_form_views_ui_edit_display_form_alter(&$form, FormStateInterface $form_state) { - // Disable Views' default caching mechanisms on Search API views. - $displays = $form_state->getStorage()['view']->get('display'); - if ($displays['default']['display_options']['query']['type'] === 'search_api_query') { - unset($form['options']['cache']['type']['#options']['tag']); - unset($form['options']['cache']['type']['#options']['time']); - } -} - -/** - * Returns a warning message if the Core Search module is enabled. - * - * @return string|null - * A warning message if needed, NULL otherwise. - * - * @see search_api_install() - * @see search_api_requirements() - */ -function _search_api_search_module_warning() { - if (\Drupal::moduleHandler()->moduleExists('search')) { - $args = [ - ':url' => Url::fromRoute('system.modules_uninstall')->toString(), - ':documentation' => 'https://www.drupal.org/node/2010146#core-search', - ]; - return t('The default Drupal core Search module is still enabled. If you are using Search API, you probably want to uninstall the Search module for performance reasons. For more information see the Search API handbook.', $args); - } - return NULL; -} diff --git a/sites/all/modules/contrib/search/search_api/search_api.permissions.yml b/sites/all/modules/contrib/search/search_api/search_api.permissions.yml deleted file mode 100644 index b515ad814..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -'administer search_api': - title: 'Administer Search API' - description: 'Create and configure Search API servers and indexes.' diff --git a/sites/all/modules/contrib/search/search_api/search_api.plugin_type.yml b/sites/all/modules/contrib/search/search_api/search_api.plugin_type.yml deleted file mode 100644 index ffa129416..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.plugin_type.yml +++ /dev/null @@ -1,34 +0,0 @@ -search_api_backend: - label: Search API backend - plugin_manager_service_id: plugin.manager.search_api.backend - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator - -search_api_datasource: - label: Search API datasource - plugin_manager_service_id: plugin.manager.search_api.datasource - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator - -search_api_data_type: - label: Search API data type - plugin_manager_service_id: plugin.manager.search_api.data_type - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator - -search_api_display: - label: Search API display - plugin_manager_service_id: plugin.manager.search_api.display - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator - -search_api_processor: - label: Search API processor - plugin_manager_service_id: plugin.manager.search_api.processor - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator - -search_api_parse_mode: - label: Search API parse mode - plugin_manager_service_id: plugin.manager.search_api.parse_mode - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator - -search_api_tracker: - label: Search API tracker - plugin_manager_service_id: plugin.manager.search_api.tracker - plugin_definition_decorator_class: \Drupal\plugin\PluginDefinition\ArrayPluginDefinitionDecorator diff --git a/sites/all/modules/contrib/search/search_api/search_api.routing.yml b/sites/all/modules/contrib/search/search_api/search_api.routing.yml deleted file mode 100644 index 978574262..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.routing.yml +++ /dev/null @@ -1,241 +0,0 @@ -search_api.overview: - path: '/admin/config/search/search-api' - defaults: - _title: 'Search API' - _entity_list: 'search_api_index' - requirements: - _permission: 'administer search_api' - -search_api.execute_tasks: - path: '/admin/config/search/search-api/execute-tasks' - defaults: - _controller: '\Drupal\search_api\Controller\TaskController::executeTasks' - _title: 'Execute pending tasks' - requirements: - _custom_access: '\Drupal\search_api\Controller\TaskController::executeTasksAccess' - -entity.search_api_server.add_form: - path: '/admin/config/search/search-api/add-server' - defaults: - _entity_form: 'search_api_server.default' - requirements: - _entity_create_access: 'search_api_server' - -entity.search_api_server.canonical: - path: '/admin/config/search/search-api/server/{search_api_server}' - defaults: - _controller: '\Drupal\search_api\Controller\ServerController::page' - _title_callback: '\Drupal\search_api\Controller\ServerController::pageTitle' - _title: "View" - requirements: - _entity_access: 'search_api_server.view' - options: - parameters: - search_api_server: - with_config_overrides: TRUE - -entity.search_api_server.edit_form: - path: '/admin/config/search/search-api/server/{search_api_server}/edit' - defaults: - _entity_form: 'search_api_server.edit' - requirements: - _entity_access: 'search_api_server.edit' - -entity.search_api_server.delete_form: - path: '/admin/config/search/search-api/server/{search_api_server}/delete' - defaults: - _entity_form: 'search_api_server.delete' - requirements: - _entity_access: 'search_api_server.delete' - options: - parameters: - search_api_server: - with_config_overrides: TRUE - -entity.search_api_server.enable: - path: '/admin/config/search/search-api/server/{search_api_server}/enable' - defaults: - _controller: 'Drupal\search_api\Controller\ServerController::serverBypassEnable' - requirements: - _entity_access: 'search_api_server.enable' - _csrf_token: 'TRUE' - -entity.search_api_server.disable: - path: '/admin/config/search/search-api/server/{search_api_server}/disable' - defaults: - _entity_form: 'search_api_server.disable' - requirements: - _entity_access: 'search_api_server.disable' - -entity.search_api_server.clear: - path: '/admin/config/search/search-api/server/{search_api_server}/clear' - defaults: - _entity_form: 'search_api_server.clear' - requirements: - _entity_access: 'search_api_server.clear' - options: - parameters: - search_api_server: - with_config_overrides: TRUE - -entity.search_api_index.add_form: - path: '/admin/config/search/search-api/add-index' - defaults: - _entity_form: 'search_api_index.default' - requirements: - _entity_create_access: 'search_api_index' - -entity.search_api_index.canonical: - path: '/admin/config/search/search-api/index/{search_api_index}' - defaults: - _controller: '\Drupal\search_api\Controller\IndexController::page' - _title_callback: '\Drupal\search_api\Controller\IndexController::pageTitle' - requirements: - _entity_access: 'search_api_index.view' - options: - parameters: - search_api_index: - with_config_overrides: TRUE - -entity.search_api_index.edit_form: - path: '/admin/config/search/search-api/index/{search_api_index}/edit' - defaults: - _entity_form: 'search_api_index.edit' - requirements: - _entity_access: 'search_api_index.edit' - -entity.search_api_index.delete_form: - path: '/admin/config/search/search-api/index/{search_api_index}/delete' - defaults: - _entity_form: 'search_api_index.delete' - requirements: - _entity_access: 'search_api_index.delete' - options: - parameters: - search_api_index: - with_config_overrides: TRUE - -entity.search_api_index.enable: - path: '/admin/config/search/search-api/index/{search_api_index}/enable' - defaults: - _controller: 'Drupal\search_api\Controller\IndexController::indexBypassEnable' - requirements: - _entity_access: 'search_api_index.enable' - _csrf_token: 'TRUE' - -entity.search_api_index.disable: - path: '/admin/config/search/search-api/index/{search_api_index}/disable' - defaults: - _entity_form: 'search_api_index.disable' - requirements: - _entity_access: 'search_api_index.disable' - -entity.search_api_index.fields: - path: '/admin/config/search/search-api/index/{search_api_index}/fields' - options: - parameters: - search_api_index: - tempstore: TRUE - type: 'entity:search_api_index' - defaults: - _entity_form: 'search_api_index.fields' - requirements: - _entity_access: 'search_api_index.fields' - -entity.search_api_index.add_fields: - path: '/admin/config/search/search-api/index/{search_api_index}/fields/add/nojs' - options: - parameters: - search_api_index: - tempstore: TRUE - type: 'entity:search_api_index' - defaults: - _entity_form: 'search_api_index.add_fields' - requirements: - _entity_access: 'search_api_index.fields' - -entity.search_api_index.add_fields_ajax: - path: '/admin/config/search/search-api/index/{search_api_index}/fields/add/ajax' - options: - parameters: - search_api_index: - tempstore: TRUE - type: 'entity:search_api_index' - defaults: - _entity_form: 'search_api_index.add_fields' - requirements: - _entity_access: 'search_api_index.fields' - -entity.search_api_index.field_config: - path: '/admin/config/search/search-api/index/{search_api_index}/fields/edit/{field_id}' - options: - parameters: - search_api_index: - tempstore: TRUE - type: 'entity:search_api_index' - defaults: - _title: 'Edit field' - _entity_form: 'search_api_index.field_config' - requirements: - _entity_access: 'search_api_index.fields' - -entity.search_api_index.remove_field: - path: '/admin/config/search/search-api/index/{search_api_index}/fields/remove/{field_id}' - options: - parameters: - search_api_index: - tempstore: TRUE - type: 'entity:search_api_index' - defaults: - _controller: 'Drupal\search_api\Controller\IndexController::removeField' - requirements: - _entity_access: 'search_api_index.fields' - _csrf_token: 'TRUE' - -entity.search_api_index.break_lock_form: - path: '/admin/config/search/search-api/index/{search_api_index}/fields/break-lock' - defaults: - _entity_form: 'search_api_index.break_lock' - _title: 'Break lock' - requirements: - _entity_access: 'search_api_index.break-lock' - -entity.search_api_index.processors: - path: '/admin/config/search/search-api/index/{search_api_index}/processors' - defaults: - _entity_form: 'search_api_index.processors' - requirements: - _entity_access: 'search_api_index.processors' - -entity.search_api_index.reindex: - path: '/admin/config/search/search-api/index/{search_api_index}/reindex' - defaults: - _entity_form: 'search_api_index.reindex' - requirements: - _entity_access: 'search_api_index.reindex' - options: - parameters: - search_api_index: - with_config_overrides: TRUE - -entity.search_api_index.clear: - path: '/admin/config/search/search-api/index/{search_api_index}/clear' - defaults: - _entity_form: 'search_api_index.clear' - requirements: - _entity_access: 'search_api_index.clear' - options: - parameters: - search_api_index: - with_config_overrides: TRUE - -entity.search_api_index.rebuild_tracker: - path: '/admin/config/search/search-api/index/{search_api_index}/rebuild-tracker' - defaults: - _entity_form: 'search_api_index.rebuild_tracker' - requirements: - _entity_access: 'search_api_index.rebuild_tracker' - options: - parameters: - search_api_index: - with_config_overrides: TRUE diff --git a/sites/all/modules/contrib/search/search_api/search_api.services.yml b/sites/all/modules/contrib/search/search_api/search_api.services.yml deleted file mode 100644 index e32b8e6f4..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.services.yml +++ /dev/null @@ -1,88 +0,0 @@ -services: - logger.channel.search_api: - parent: logger.channel_base - arguments: ['search_api'] - - paramconverter.search_api: - class: Drupal\search_api\ParamConverter\SearchApiConverter - arguments: ['@entity.manager', '@tempstore.shared', '@current_user'] - tags: - - { name: paramconverter, priority: 10 } - lazy: true - - plugin.manager.search_api.backend: - class: Drupal\search_api\Backend\BackendPluginManager - parent: default_plugin_manager - - plugin.manager.search_api.data_type: - class: Drupal\search_api\DataType\DataTypePluginManager - parent: default_plugin_manager - - plugin.manager.search_api.datasource: - class: Drupal\search_api\Datasource\DatasourcePluginManager - parent: default_plugin_manager - - plugin.manager.search_api.display: - class: Drupal\search_api\Display\DisplayPluginManager - parent: default_plugin_manager - - plugin.manager.search_api.parse_mode: - class: Drupal\search_api\ParseMode\ParseModePluginManager - parent: default_plugin_manager - - plugin.manager.search_api.processor: - class: Drupal\search_api\Processor\ProcessorPluginManager - arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@string_translation'] - - plugin.manager.search_api.tracker: - class: Drupal\search_api\Tracker\TrackerPluginManager - parent: default_plugin_manager - - search_api.datasource_task_manager: - class: Drupal\search_api\Plugin\search_api\datasource\ContentEntityTaskManager - arguments: ['@search_api.task_manager', '@entity_type.manager'] - tags: - - { name: event_subscriber } - - search_api.data_type_helper: - class: \Drupal\search_api\Utility\DataTypeHelper - arguments: ['@module_handler', '@plugin.manager.search_api.data_type'] - - search_api.fields_helper: - class: \Drupal\search_api\Utility\FieldsHelper - arguments: ['@entity_type.manager', '@entity_field.manager', '@entity_type.bundle.info', '@search_api.data_type_helper'] - - search_api.index_task_manager: - class: Drupal\search_api\Task\IndexTaskManager - arguments: ['@search_api.task_manager', '@entity_type.manager'] - tags: - - { name: event_subscriber } - - search_api.plugin_helper: - class: Drupal\search_api\Utility\PluginHelper - arguments: ['@plugin.manager.search_api.datasource', '@plugin.manager.search_api.processor', '@plugin.manager.search_api.tracker'] - - search_api.post_request_indexing: - class: Drupal\search_api\Utility\PostRequestIndexing - arguments: ['@entity_type.manager'] - tags: - - { name: needs_destruction } - - search_api.query_helper: - class: Drupal\search_api\Utility\QueryHelper - arguments: ['@request_stack', '@module_handler', '@plugin.manager.search_api.parse_mode'] - - search_api.server_task_manager: - class: Drupal\search_api\Task\ServerTaskManager - arguments: ['@search_api.task_manager', '@entity_type.manager'] - tags: - - { name: event_subscriber } - - search_api.task_manager: - class: Drupal\search_api\Task\TaskManager - arguments: ['@entity_type.manager', '@event_dispatcher', '@string_translation', '@messenger'] - - search_api.vbo_view_data_provider: - class: Drupal\search_api\Contrib\ViewsBulkOperationsEventSubscriber - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/search/search_api/search_api.theme.inc b/sites/all/modules/contrib/search/search_api/search_api.theme.inc deleted file mode 100644 index 6e04006f0..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.theme.inc +++ /dev/null @@ -1,506 +0,0 @@ - $row, - 'data-field-row-id' => $name, - ]; - if (!empty($form['fields'][$name]['description']['#value'])) { - $row['title'] = strip_tags($form['fields'][$name]['description']['#value']); - } - $rows[] = $row; - } - } - - $note = isset($form['note']) ? $form['note'] : ''; - unset($form['note'], $form['submit']); - $output = ''; - foreach (Element::children($form) as $key) { - if (!empty($form[$key])) { - $output .= render($form[$key]); - } - } - - $build = [ - '#theme' => 'table', - '#header' => $form['#header'], - '#rows' => $rows, - '#empty' => t('No fields have been added for this datasource.'), - ]; - - $output .= render($build); - $output .= render($note); - - return $output; -} - -/** - * Returns HTML for the data type overview table. - * - * @param array $variables - * An associative array containing: - * - data_types: An associative array of data types, keyed by data type ID and - * containing associative arrays with information about the data type: - * - label: The (translated) human-readable label for the data type. - * - description: The (translated) description of the data type. - * - fallback: The type ID of the fallback type. - * - fallback_mapping: array of fallback data types for unsupported data - * types. - * - * @return string - * The rendered HTML for a fields form table. - * - * @ingroup themeable - */ -function theme_search_api_admin_data_type_table(array $variables) { - $data_types = $variables['data_types']; - $fallback_mapping = $variables['fallback_mapping']; - $header = [ - t('Data Type'), - t('Description'), - t('Supported'), - ]; - // Only show the column with fallback types if there is actually an - // unsupported type listed. - if ($fallback_mapping) { - $header[] = t('Fallback data type'); - } - - $rows = []; - $yes = t('Yes'); - $yes_img = 'core/misc/icons/73b355/check.svg'; - $no = t('No'); - $no_img = 'core/misc/icons/e32700/error.svg'; - foreach ($data_types as $data_type_id => $data_type) { - $has_fallback = isset($fallback_mapping[$data_type_id]); - $supported_label = $has_fallback ? $no : $yes; - $supported_icon = [ - '#theme' => 'image', - '#uri' => $has_fallback ? $no_img : $yes_img, - '#width' => 18, - '#height' => 18, - '#alt' => $supported_label, - '#title' => $supported_label, - ]; - - $row = [ - $data_type['label'], - $data_type['description'], - ['data' => $supported_icon], - ]; - - if ($fallback_mapping) { - $row[] = $has_fallback ? $data_types[$data_type['fallback']]['label'] : ''; - } - - $rows[] = $row; - } - - $build = [ - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - ]; - - return render($build); -} - -/** - * Returns HTML for a list of form items. - * - * Wrapper around the "item_list" theme which uses the child elements as the - * list items instead of the "#items" key. - * - * @param array $variables - * An associative array containing a single value, "element", containing the - * element to be rendered. - * - * @return string - * The rendered HTML for the list. - * - * @ingroup themeable - */ -function theme_search_api_form_item_list(array $variables) { - $element = $variables['element']; - - $build = [ - '#theme' => 'item_list', - ]; - if (!empty($element['#title'])) { - $build['#title'] = $element['#title']; - } - foreach (Element::children($element) as $key) { - $build['#items'][$key] = $element[$key]; - } - - return render($build); -} - -/** - * Returns HTML for a search server. - * - * @param array $variables - * An associative array containing: - * - server: The server that should be displayed. - * - * @return string - * The rendered HTML for a search server. - * - * @ingroup themeable - */ -function theme_search_api_server(array $variables) { - // Get the search server. - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $variables['server']; - - $output = ''; - - if (($description = $server->getDescription())) { - // Sanitize the description and append to the output. - $output .= '

        ' . nl2br(Html::escape($description)) . '

        '; - } - - // Initialize the $rows variable which will hold the different parts of server - // information. - $rows = []; - // Create a row template with references so we don't have to deal with the - // complicated structure for each individual row. - $row = [ - 'data' => [ - ['header' => TRUE], - '', - ], - 'class' => [''], - ]; - // Get the individual parts of the row by reference. - $label = &$row['data'][0]['data']; - $info = &$row['data'][1]; - $classes = &$row['class']; - - // Check if the server is enabled. - if ($server->status()) { - $classes[] = 'ok'; - $info = t('enabled (disable)', [':url' => $server->toUrl('disable')->toString()]); - } - else { - $classes[] = 'warning'; - $info = t('disabled (enable)', [':url' => $server->toUrl('enable')->toString()]); - } - // Append the row and reset variables. - $label = t('Status'); - $classes[] = 'search-api-server-summary--status'; - $rows[] = Utility::deepCopy($row); - $classes = []; - - // Check if the backend used by the server is valid and get its label. - if ($server->hasValidBackend()) { - $backend = $server->getBackend(); - $info = Html::escape($backend->label()); - } - else { - $classes[] = 'error'; - $info = t('Invalid or missing backend plugin: %backend_id', ['%backend_id' => $server->getBackendId()]); - } - - // Append the row and reset variables. - $label = t('Backend class'); - $classes[] = 'search-api-server-summary--backend'; - $rows[] = Utility::deepCopy($row); - $classes = []; - - // Build the indexes links container. - $indexes = [ - '#theme' => 'links', - '#attributes' => ['class' => ['inline']], - '#links' => [], - ]; - // Add links for all indexes attached to this server. - foreach ($server->getIndexes() as $index) { - $indexes['#links'][] = [ - 'title' => $index->label(), - 'url' => $index->toUrl('canonical'), - ]; - } - // Check if the indexes variable contains links. - if ($indexes['#links']) { - $label = t('Search indexes'); - $info = render($indexes); - $classes[] = 'search-api-server-summary--indexes'; - $rows[] = Utility::deepCopy($row); - $classes = []; - } - - // Add backend-specific additional information. - foreach ($server->viewSettings() as $information) { - // Convert the extra information and append the information to the row. - $label = $information['label']; - $info = $information['info']; - if (!empty($information['status'])) { - $classes[] = $information['status']; - } - $rows[] = Utility::deepCopy($row); - $classes = []; - } - - // Append the server info table to the output. - $server_info_table = [ - '#theme' => 'table', - '#rows' => $rows, - '#attributes' => [ - 'class' => [ - 'search-api-server-summary', - ], - ], - ]; - $output .= render($server_info_table); - - return $output; -} - -/** - * Implements hook_preprocess_search_api_index(). - */ -function search_api_preprocess_search_api_index(array &$variables) { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $variables['index']; - - if ($index->status()) { - try { - $variables['server_count'] = $index->query() - ->setProcessingLevel(QueryInterface::PROCESSING_NONE) - ->addTag('server_index_status') - ->range(0, 0) - ->execute() - ->getResultCount(); - } - catch (SearchApiException $e) { - $variables['server_count_error'] = $e->getMessage(); - } - } -} - -/** - * Returns HTML for a search index. - * - * @param array $variables - * An associative array containing: - * - index: The search index to display. - * - server_count: The count of items on the server for this index. - * - server_count_error: If set, the error that occurred while trying to get - * the server items count. - * - * @return string - * The rendered HTML for a search index. - * - * @ingroup themeable - */ -function theme_search_api_index(array $variables) { - // Get the index. - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $variables['index']; - $server = $index->hasValidServer() ? $index->getServerInstance() : NULL; - $tracker = $index->hasValidTracker() ? $index->getTrackerInstance() : NULL; - - $output = ''; - - if (($description = $index->getDescription())) { - // Sanitize the description and append to the output. - $output .= '

        ' . nl2br(Html::escape($description)) . '

        '; - } - - // Initialize the $rows variable which will hold the different parts of server - // information. - $rows = []; - // Create a row template with references so we don't have to deal with the - // complicated structure for each individual row. - $row = [ - 'data' => [ - ['header' => TRUE], - '', - ], - 'class' => [], - ]; - // Get the individual parts of the row by reference. - $label = &$row['data'][0]['data']; - $info = &$row['data'][1]; - $classes = &$row['class']; - - // Check if the index is enabled. - if ($index->status()) { - $classes[] = 'ok'; - $info = t('enabled (disable)', [':url' => $index->toUrl('disable')->toString()]); - } - // Check if a server is available and enabled. - elseif ($server && $server->status()) { - $classes[] = 'warning'; - $info = t('disabled (enable)', [':url' => $index->toUrl('enable')->toString()]); - } - else { - $classes[] = 'warning'; - $info = t('disabled'); - } - // Append the row and reset variables. - $label = t('Status'); - $classes[] = 'search-api-index-summary--status'; - $rows[] = Utility::deepCopy($row); - $classes = []; - - foreach ($index->getDatasourceIds() as $datasource_id) { - // Check if the datasource is valid. - if ($index->isValidDatasource($datasource_id)) { - $info = $index->getDatasource($datasource_id)->label(); - if ($tracker) { - $args = [ - '@indexed' => $tracker->getIndexedItemsCount($datasource_id), - '@total' => $tracker->getTotalItemsCount($datasource_id), - ]; - $indexed = t('@indexed/@total indexed', $args); - $args = [ - '@datasource' => $info, - '@indexed' => $indexed, - ]; - $info = new FormattableMarkup('@datasource (@indexed)', $args); - } - } - else { - $classes[] = 'error'; - $info = t('Invalid or missing datasource plugin: %datasource_id', ['%datasource_id' => $datasource_id]); - } - // Append the row and reset variables. - $label = t('Datasource'); - $classes[] = 'search-api-index-summary--datasource'; - $rows[] = Utility::deepCopy($row); - $classes = []; - } - - // Check if the tracker is valid. - if ($tracker) { - $info = $tracker->label(); - } - else { - $classes[] = 'error'; - $info = t('Invalid or missing tracker plugin: %tracker_id', ['%tracker_id' => $index->getTrackerId()]); - } - // Append the row and reset variables. - $label = t('Tracker'); - $classes[] = 'search-api-index-summary--tracker'; - $rows[] = Utility::deepCopy($row); - $classes = []; - - // Check if a server is available. - $classes[] = 'search-api-index-summary--server'; - if ($server) { - $label = t('Server'); - $info = $server->toLink(NULL, 'canonical')->toString(); - $rows[] = Utility::deepCopy($row); - } - elseif ($index->getServerId()) { - $classes[] = 'error'; - $label = t('Server'); - $info = t('Unknown server set for index: %server_id', ['%server_id' => $index->getServerId()]); - $rows[] = Utility::deepCopy($row); - } - $classes = []; - - // Check if the index is enabled. - if ($index->status()) { - $label = t('Server index status'); - if (isset($variables['server_count'])) { - $vars = [':url' => Url::fromUri('https://drupal.org/node/2009804#server-index-status')->toString()]; - // Build the server index status info. - $info = \Drupal::translation()->formatPlural($variables['server_count'], 'There is 1 item indexed on the server for this index. (More information)', 'There are @count items indexed on the server for this index. (More information)', $vars); - } - else { - $args = ['@message' => $variables['server_count_error']]; - $info = t('Error while checking server index status: @message', $args); - $classes[] = 'error'; - } - $classes[] = 'search-api-index-summary--server-index-status'; - $rows[] = Utility::deepCopy($row); - $classes = []; - - $cron_limit = $index->getOption('cron_limit', \Drupal::config('search_api.settings')->get('default_cron_limit')); - // Check if the cron limit is higher than zero. - if ($cron_limit != 0) { - $classes[] = 'ok'; - if ($cron_limit > 0) { - $info = \Drupal::translation()->formatPlural($cron_limit, 'During cron runs, 1 item will be indexed per batch.', 'During cron runs, @count items will be indexed per batch.'); - } - else { - $info = t('All items will be indexed at once during cron runs.'); - } - } - else { - $classes[] = 'warning'; - $info = t('No items will be indexed during cron runs.'); - } - // Append the row and reset variables. - $label = t('Cron batch size'); - $classes[] = 'search-api-index-summary--cron-batch-size'; - $rows[] = Utility::deepCopy($row); - $classes = []; - - // Add the indexing progress bar. - if ($tracker) { - $indexed_count = $tracker->getIndexedItemsCount(); - $total_count = $tracker->getTotalItemsCount(); - - $index_progress = [ - '#theme' => 'progress_bar', - '#percent' => $total_count ? (int) (100 * $indexed_count / $total_count) : 100, - '#message' => t('@indexed/@total indexed', ['@indexed' => $indexed_count, '@total' => $total_count]), - ]; - $output .= '

        ' . t('Index status') . '

        '; - $output .= '
        ' . render($index_progress) . '
        '; - } - } - - // Append the index info table to the output. - $index_info_table = [ - '#theme' => 'table', - '#rows' => $rows, - '#attributes' => [ - 'class' => [ - 'search-api-index-summary', - ], - ], - ]; - $output .= render($index_info_table); - - return $output; -} diff --git a/sites/all/modules/contrib/search/search_api/search_api.views.inc b/sites/all/modules/contrib/search/search_api/search_api.views.inc deleted file mode 100644 index 674c509a1..000000000 --- a/sites/all/modules/contrib/search/search_api/search_api.views.inc +++ /dev/null @@ -1,829 +0,0 @@ -id(); - $table = &$data[$key]; - $index_label = $index->label(); - $table['table']['group'] = t('Index @name', ['@name' => $index_label]); - $table['table']['base'] = [ - 'field' => 'search_api_id', - 'index' => $index->id(), - 'title' => t('Index @name', ['@name' => $index_label]), - 'help' => t('Use the @name search index for filtering and retrieving data.', ['@name' => $index_label]), - 'query_id' => 'search_api_query', - ]; - - // Add suitable handlers for all indexed fields. - foreach ($index->getFields(TRUE) as $field_id => $field) { - $field_alias = _search_api_views_find_field_alias($field_id, $table); - $field_definition = _search_api_views_get_handlers($field); - // The field handler has to be extra, since it is a) determined by the - // field's underlying property and b) needs a different "real field" - // set. - if ($field->getPropertyPath()) { - $field_handler = _search_api_views_get_field_handler_for_property($field->getDataDefinition(), $field->getPropertyPath()); - if ($field_handler) { - $field_definition['field'] = $field_handler; - $field_definition['field']['real field'] = $field->getCombinedPropertyPath(); - $field_definition['field']['search_api field'] = $field_id; - } - } - if ($field_definition) { - $field_label = $field->getLabel(); - $field_definition += [ - 'title' => $field_label, - 'help' => $field->getDescription() ?: t('(No description available)'), - ]; - if ($datasource = $field->getDatasource()) { - $field_definition['group'] = t('@datasource datasource', ['@datasource' => $datasource->label()]); - } - if ($field_id != $field_alias) { - $field_definition['real field'] = $field_id; - } - if (isset($field_definition['field'])) { - $field_definition['field']['title'] = t('@field (indexed field)', ['@field' => $field_label]); - } - $table[$field_alias] = $field_definition; - } - } - - // Add special fields. - _search_api_views_data_special_fields($table); - - // Add relationships for field data of all datasources. - $datasource_tables_prefix = 'search_api_datasource_' . $index->id() . '_'; - foreach ($index->getDatasources() as $datasource_id => $datasource) { - $table_key = _search_api_views_find_field_alias($datasource_tables_prefix . $datasource_id, $data); - $data[$table_key] = _search_api_views_datasource_table($datasource, $data); - // Automatically join this table for views of this index. - $data[$table_key]['table']['join'][$key] = [ - 'join_id' => 'search_api', - ]; - } - } - catch (\Exception $e) { - $args = [ - '%index' => $index->label(), - ]; - watchdog_exception('search_api', $e, '%type while computing Views data for index %index: @message in %function (line %line of %file).', $args); - } - } - - return array_filter($data); -} - -/** - * Implements hook_views_plugins_cache_alter(). - */ -function search_api_views_plugins_cache_alter(array &$plugins) { - // Collect all base tables provided by this module. - $bases = []; - /** @var \Drupal\search_api\IndexInterface $index */ - foreach (Index::loadMultiple() as $index) { - $bases[] = 'search_api_index_' . $index->id(); - } - $plugins['search_api_tag']['base'] = $bases; - $plugins['search_api_time']['base'] = $bases; -} - -/** - * Implements hook_views_plugins_row_alter(). - */ -function search_api_views_plugins_row_alter(array &$plugins) { - // Collect all base tables provided by this module. - $bases = []; - /** @var \Drupal\search_api\IndexInterface $index */ - foreach (Index::loadMultiple() as $index) { - $bases[] = 'search_api_index_' . $index->id(); - } - $plugins['search_api']['base'] = $bases; -} - -/** - * Finds an unused field alias for a field in a Views table definition. - * - * @param string $field_id - * The original ID of the Search API field. - * @param array $table - * The Views table definition. - * - * @return string - * The field alias to use. - */ -function _search_api_views_find_field_alias($field_id, array &$table) { - $base = $field_alias = preg_replace('/[^a-zA-Z0-9]+/S', '_', $field_id); - $i = 0; - while (isset($table[$field_alias])) { - $field_alias = $base . '_' . ++$i; - } - return $field_alias; -} - -/** - * Returns the Views handlers to use for a given field. - * - * @param \Drupal\search_api\Item\FieldInterface $field - * The field to add to the definition. - * - * @return array - * The Views definition to add for the given field. - */ -function _search_api_views_get_handlers(FieldInterface $field) { - $mapping = _search_api_views_handler_mapping(); - - try { - $types = []; - - $definition = $field->getDataDefinition(); - if ($definition->getSetting('target_type')) { - $types[] = 'entity:' . $definition->getSetting('target_type'); - $types[] = 'entity'; - } - - if ($definition->getSetting('allowed_values')) { - $types[] = 'options'; - } - - $types[] = $field->getType(); - /** @var \Drupal\search_api\DataType\DataTypeInterface $data_type */ - $data_type = \Drupal::service('plugin.manager.search_api.data_type')->createInstance($field->getType()); - if (!$data_type->isDefault()) { - $types[] = $data_type->getFallbackType(); - } - - foreach ($types as $type) { - if (isset($mapping[$type])) { - _search_api_views_handler_adjustments($type, $field, $mapping[$type]); - return $mapping[$type]; - } - } - } - catch (SearchApiException $e) { - $vars['%index'] = $field->getIndex()->label(); - $vars['%field'] = $field->getPrefixedLabel(); - watchdog_exception('search_api', $e, '%type while adding Views handlers for field %field on index %index: @message in %function (line %line of %file).', $vars); - } - - return []; -} - -/** - * Determines the mapping of Search API data types to their Views handlers. - * - * @return array - * An associative array with data types as the keys and Views field data - * definitions as the values. In addition to all normally defined data types, - * keys can also be "options" for any field with an options list, "entity" for - * general entity-typed fields or "entity:ENTITY_TYPE" (with "ENTITY_TYPE" - * being the machine name of an entity type) for entities of that type. - * - * @see search_api_views_handler_mapping_alter() - */ -function _search_api_views_handler_mapping() { - $mapping = &drupal_static(__FUNCTION__); - - if (!isset($mapping)) { - $mapping = [ - 'boolean' => [ - 'argument' => [ - 'id' => 'search_api', - ], - 'filter' => [ - 'id' => 'search_api_boolean', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'date' => [ - 'argument' => [ - 'id' => 'search_api_date', - ], - 'filter' => [ - 'id' => 'search_api_date', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'decimal' => [ - 'argument' => [ - 'id' => 'search_api', - 'filter' => 'floatval', - ], - 'filter' => [ - 'id' => 'search_api_numeric', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'integer' => [ - 'argument' => [ - 'id' => 'search_api', - 'filter' => 'intval', - ], - 'filter' => [ - 'id' => 'search_api_numeric', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'string' => [ - 'argument' => [ - 'id' => 'search_api', - ], - 'filter' => [ - 'id' => 'search_api_string', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'text' => [ - 'argument' => [ - 'id' => 'search_api', - ], - 'filter' => [ - 'id' => 'search_api_text', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'options' => [ - 'argument' => [ - 'id' => 'search_api', - ], - 'filter' => [ - 'id' => 'search_api_options', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'entity:taxonomy_term' => [ - 'argument' => [ - 'id' => 'search_api_term', - ], - 'filter' => [ - 'id' => 'search_api_term', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'entity:user' => [ - 'argument' => [ - 'id' => 'search_api', - 'filter' => 'intval', - ], - 'filter' => [ - 'id' => 'search_api_user', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - 'entity:node_type' => [ - 'argument' => [ - 'id' => 'search_api', - ], - 'filter' => [ - 'id' => 'search_api_options', - 'options callback' => 'node_type_get_names', - ], - 'sort' => [ - 'id' => 'search_api', - ], - ], - ]; - - $alter_id = 'search_api_views_handler_mapping'; - \Drupal::moduleHandler()->alter($alter_id, $mapping); - } - - return $mapping; -} - -/** - * Makes necessary, field-specific adjustments to Views handler definitions. - * - * @param string $type - * The type of field, as defined in _search_api_views_handler_mapping(). - * @param \Drupal\search_api\Item\FieldInterface $field - * The field whose handler definitions are being created. - * @param array $definitions - * The handler definitions for the field, as a reference. - */ -function _search_api_views_handler_adjustments($type, FieldInterface $field, array &$definitions) { - // By default, all fields can be empty (or at least have to be treated that - // way by the Search API). - if (!isset($definitions['filter']['allow empty'])) { - $definitions['filter']['allow empty'] = TRUE; - } - - // For taxonomy term references, set the referenced vocabulary. - $data_definition = $field->getDataDefinition(); - if ($type == 'entity:taxonomy_term') { - if (isset($data_definition->getSettings()['handler_settings']['target_bundles'])) { - $target_bundles = $data_definition->getSettings()['handler_settings']['target_bundles']; - if (count($target_bundles) == 1) { - $definitions['filter']['vocabulary'] = reset($target_bundles); - } - } - } - elseif ($type == 'options') { - if ($data_definition instanceof FieldItemDataDefinition) { - // If this is a normal Field API field, dynamically retrieve the options - // list at query time. - $field_definition = $data_definition->getFieldDefinition(); - $bundle = $field_definition->getTargetBundle(); - $field_name = $field_definition->getName(); - $entity_type = $field_definition->getTargetEntityTypeId(); - $definitions['filter']['options callback'] = '_search_api_views_get_allowed_values'; - $definitions['filter']['options arguments'] = [$entity_type, $bundle, $field_name]; - } - else { - // Otherwise, include the options list verbatim in the Views data, unless - // it's too big (or doesn't look valid). - $options = $data_definition->getSetting('allowed_values'); - if (is_array($options) && count($options) <= 50) { - // Since the Views InOperator filter plugin doesn't allow just including - // the options in the definition, we use this workaround. - $definitions['filter']['options callback'] = 'array_filter'; - $definitions['filter']['options arguments'] = [$options]; - } - } - } -} - -/** - * Adds definitions for our special fields to a Views data table definition. - * - * @param array $table - * The existing Views data table definition. - */ -function _search_api_views_data_special_fields(array &$table) { - $id_field = _search_api_views_find_field_alias('search_api_id', $table); - $table[$id_field]['title'] = t('Item ID'); - $table[$id_field]['help'] = t("The item's internal (Search API-specific) ID"); - $table[$id_field]['field']['id'] = 'standard'; - $table[$id_field]['sort']['id'] = 'search_api'; - if ($id_field != 'search_api_id') { - $table[$id_field]['real field'] = 'search_api_id'; - } - - $datasource_field = _search_api_views_find_field_alias('search_api_datasource', $table); - $table[$datasource_field]['title'] = t('Datasource'); - $table[$datasource_field]['help'] = t("The data source ID"); - $table[$datasource_field]['argument']['id'] = 'search_api'; - $table[$datasource_field]['argument']['disable_break_phrase'] = TRUE; - $table[$datasource_field]['field']['id'] = 'standard'; - $table[$datasource_field]['filter']['id'] = 'search_api_datasource'; - $table[$datasource_field]['sort']['id'] = 'search_api'; - if ($datasource_field != 'search_api_datasource') { - $table[$datasource_field]['real field'] = 'search_api_datasource'; - } - - $language_field = _search_api_views_find_field_alias('search_api_language', $table); - $table[$language_field]['title'] = t('Item language'); - $table[$language_field]['help'] = t("The item's language"); - $table[$language_field]['field']['id'] = 'language'; - $table[$language_field]['filter']['id'] = 'search_api_language'; - $table[$language_field]['filter']['allow empty'] = FALSE; - $table[$language_field]['sort']['id'] = 'search_api'; - if ($language_field != 'search_api_language') { - $table[$language_field]['real field'] = 'search_api_language'; - } - - $relevance_field = _search_api_views_find_field_alias('search_api_relevance', $table); - $table[$relevance_field]['group'] = t('Search'); - $table[$relevance_field]['title'] = t('Relevance'); - $table[$relevance_field]['help'] = t('The relevance of this search result with respect to the query'); - $table[$relevance_field]['field']['type'] = 'decimal'; - $table[$relevance_field]['field']['id'] = 'numeric'; - $table[$relevance_field]['field']['search_api field'] = 'search_api_relevance'; - $table[$relevance_field]['sort']['id'] = 'search_api'; - if ($relevance_field != 'search_api_relevance') { - $table[$relevance_field]['real field'] = 'search_api_relevance'; - } - - $excerpt_field = _search_api_views_find_field_alias('search_api_excerpt', $table); - $table[$excerpt_field]['group'] = t('Search'); - $table[$excerpt_field]['title'] = t('Excerpt'); - $table[$excerpt_field]['help'] = t('The search result excerpted to show found search terms'); - $table[$excerpt_field]['field']['id'] = 'search_api'; - $table[$excerpt_field]['field']['filter_type'] = 'xss'; - if ($excerpt_field != 'search_api_excerpt') { - $table[$excerpt_field]['real field'] = 'search_api_excerpt'; - } - - $fulltext_field = _search_api_views_find_field_alias('search_api_fulltext', $table); - $table[$fulltext_field]['group'] = t('Search'); - $table[$fulltext_field]['title'] = t('Fulltext search'); - $table[$fulltext_field]['help'] = t('Search several or all fulltext fields at once.'); - $table[$fulltext_field]['filter']['id'] = 'search_api_fulltext'; - $table[$fulltext_field]['argument']['id'] = 'search_api_fulltext'; - if ($fulltext_field != 'search_api_fulltext') { - $table[$fulltext_field]['real field'] = 'search_api_fulltext'; - } - - $mlt_field = _search_api_views_find_field_alias('search_api_more_like_this', $table); - $table[$mlt_field]['group'] = t('Search'); - $table[$mlt_field]['title'] = t('More like this'); - $table[$mlt_field]['help'] = t('Find similar content.'); - $table[$mlt_field]['argument']['id'] = 'search_api_more_like_this'; - if ($mlt_field != 'search_api_more_like_this') { - $table[$mlt_field]['real field'] = 'search_api_more_like_this'; - } - - // @todo Add an "All taxonomy terms" contextual filter (if applicable). -} - -/** - * Creates a Views table definition for one datasource of an index. - * - * @param \Drupal\search_api\Datasource\DatasourceInterface $datasource - * The datasource for which to create a table definition. - * @param array $data - * The existing Views data definitions. Passed by reference so additionally - * needed tables can be inserted. - * - * @return array - * A Views table definition for the given datasource. - */ -function _search_api_views_datasource_table(DatasourceInterface $datasource, array &$data) { - $datasource_id = $datasource->getPluginId(); - $table = [ - 'table' => [ - 'group' => t('@datasource datasource', ['@datasource' => $datasource->label()]), - 'index' => $datasource->getIndex()->id(), - 'datasource' => $datasource_id, - ], - ]; - $entity_type_id = $datasource->getEntityTypeId(); - if ($entity_type_id) { - $table['table']['entity type'] = $entity_type_id; - $table['table']['entity revision'] = FALSE; - } - - _search_api_views_add_handlers_for_properties($datasource->getPropertyDefinitions(), $table, $data); - - // Prefix the "real field" of each entry with the datasource ID. - foreach ($table as $key => $definition) { - if ($key == 'table') { - continue; - } - - $real_field = isset($definition['real field']) ? $definition['real field'] : $key; - $table[$key]['real field'] = Utility::createCombinedId($datasource_id, $real_field); - - // Relationships sometimes have different real fields set, since they might - // also include the nested property that contains the actual reference. So, - // if a "real field" is set for that, we need to adapt it as well. - if (isset($definition['relationship']['real field'])) { - $real_field = $definition['relationship']['real field']; - $table[$key]['relationship']['real field'] = Utility::createCombinedId($datasource_id, $real_field); - } - } - - return $table; -} - -/** - * Creates a Views table definition for an entity type. - * - * @param string $entity_type_id - * The ID of the entity type. - * @param array $data - * The existing Views data definitions, passed by reference. - * - * @return array - * A Views table definition for the given entity type. Or an empty array if - * the entity type could not be found. - */ -function _search_api_views_entity_type_table($entity_type_id, array &$data) { - $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_type_id); - if (!$entity_type || !$entity_type->entityClassImplements(FieldableEntityInterface::class)) { - return []; - } - - $table = [ - 'table' => [ - 'group' => t('@entity_type relationship', ['@entity_type' => $entity_type->getLabel()]), - 'entity type' => $entity_type_id, - 'entity revision' => FALSE, - ], - ]; - - $entity_field_manager = \Drupal::getContainer()->get('entity_field.manager'); - $bundle_info = \Drupal::getContainer()->get('entity_type.bundle.info'); - $properties = $entity_field_manager->getBaseFieldDefinitions($entity_type_id); - foreach (array_keys($bundle_info->getBundleInfo($entity_type_id)) as $bundle_id) { - $additional = $entity_field_manager->getFieldDefinitions($entity_type_id, $bundle_id); - $properties += $additional; - } - _search_api_views_add_handlers_for_properties($properties, $table, $data); - - return $table; -} - -/** - * Adds field and relationship handlers for the given properties. - * - * @param \Drupal\Core\TypedData\DataDefinitionInterface[] $properties - * The properties for which handlers should be added. - * @param array $table - * The existing Views data table definition, passed by reference. - * @param array $data - * The existing Views data definitions, passed by reference. - */ -function _search_api_views_add_handlers_for_properties(array $properties, array &$table, array &$data) { - $entity_reference_types = array_flip([ - 'field_item:entity_reference', - 'field_item:image', - 'field_item:file', - ]); - - foreach ($properties as $property_path => $property) { - $key = _search_api_views_find_field_alias($property_path, $table); - $original_property = $property; - $property = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->getInnerProperty($property); - - // Add a field handler, if applicable. - $definition = _search_api_views_get_field_handler_for_property($property, $property_path); - if ($definition) { - $table[$key]['field'] = $definition; - } - - // For entity-typed properties, also add a relationship to the entity type - // table. - if ($property instanceof FieldItemDataDefinition && isset($entity_reference_types[$property->getDataType()])) { - $entity_type_id = $property->getSetting('target_type'); - if ($entity_type_id) { - $entity_type_table_key = 'search_api_entity_' . $entity_type_id; - if (!isset($data[$entity_type_table_key])) { - // Initialize the table definition before calling - // _search_api_views_entity_type_table() to avoid an infinite - // recursion. - $data[$entity_type_table_key] = []; - $data[$entity_type_table_key] = _search_api_views_entity_type_table($entity_type_id, $data); - } - // Add the relationship only if we have a non-empty table definition. - if ($data[$entity_type_table_key]) { - // Get the entity type to determine the label for the relationship. - $entity_type = \Drupal::entityTypeManager() - ->getDefinition($entity_type_id); - $entity_type_label = $entity_type ? $entity_type->getLabel() : $entity_type_id; - $args = [ - '@label' => $entity_type_label, - '@field_name' => $original_property->getLabel(), - ]; - // Look through the child properties to find the data reference - // property that should be the "real field" for the relationship. - // (For Core entity references, this will usually be ":entity".) - $suffix = ''; - foreach ($property->getPropertyDefinitions() as $name => $nested_property) { - if ($nested_property instanceof DataReferenceDefinitionInterface) { - $suffix = ":$name"; - break; - } - } - $table[$key]['relationship'] = [ - 'title' => t('@label referenced from @field_name', $args), - 'label' => t('@field_name: @label', $args), - 'help' => $property->getDescription() ?: t('(No description available)'), - 'id' => 'search_api', - 'base' => $entity_type_table_key, - 'entity type' => $entity_type_id, - 'entity revision' => FALSE, - 'real field' => $property_path . $suffix, - ]; - } - } - } - - if (!empty($table[$key]) && empty($table[$key]['title'])) { - $table[$key]['title'] = $original_property->getLabel(); - $table[$key]['help'] = $original_property->getDescription() ?: t('(No description available)'); - if ($key != $property_path) { - $table[$key]['real field'] = $property_path; - } - } - } -} - -/** - * Computes a handler definition for the given property. - * - * @param \Drupal\Core\TypedData\DataDefinitionInterface $property - * The property definition. - * @param string|null $property_path - * (optional) The property path of the property. If set, it will be used for - * Field API fields to set the "field_name" property of the definition. - * - * @return array|null - * Either a Views field handler definition for this property, or NULL if the - * property shouldn't have one. - * - * @see hook_search_api_views_field_handler_mapping_alter() - */ -function _search_api_views_get_field_handler_for_property(DataDefinitionInterface $property, $property_path = NULL) { - $mappings = _search_api_views_get_field_handler_mapping(); - - // First, look for an exact match. - $data_type = $property->getDataType(); - if (array_key_exists($data_type, $mappings['simple'])) { - $definition = $mappings['simple'][$data_type]; - } - else { - // Then check all the patterns defined by regular expressions, defaulting to - // the "default" definition. - $definition = $mappings['default']; - foreach (array_keys($mappings['regex']) as $regex) { - if (preg_match($regex, $data_type)) { - $definition = $mappings['regex'][$regex]; - } - } - } - - // Field items have a special handler, but need a fallback handler set to be - // able to optionally circumvent entity field rendering. That's why we just - // set the "field_item:…" types to their fallback handlers in - // _search_api_views_get_field_handler_mapping(), along with non-field item - // types, and here manually update entity field properties to have the correct - // definition, with "search_api_field" handler, correct fallback handler and - // "field_name" and "entity_type" correctly set. - if (isset($definition) && $property instanceof FieldItemDataDefinition) { - list(, $field_name) = Utility::splitPropertyPath($property_path, TRUE); - if (!isset($definition['fallback_handler'])) { - $definition['fallback_handler'] = $definition['id']; - $definition['id'] = 'search_api_field'; - } - $definition['field_name'] = $field_name; - $definition['entity_type'] = $property - ->getFieldDefinition() - ->getTargetEntityTypeId(); - } - - return $definition; -} - -/** - * Retrieves the field handler mapping used by the Search API Views integration. - * - * @return array - * An associative array with three keys: - * - simple: An associative array mapping property data types to their field - * handler definitions. - * - regex: An array associative array mapping regular expressions for - * property data types to their field handler definitions, ordered by - * descending string length of the regular expression. - * - default: The default definition for data types that match no other field. - */ -function _search_api_views_get_field_handler_mapping() { - $mappings = &drupal_static(__FUNCTION__); - - if (!isset($mappings)) { - // First create a plain mapping and pass it to the alter hook. - $plain_mapping = []; - - $plain_mapping['*'] = [ - 'id' => 'search_api', - ]; - - $text_mapping = [ - 'id' => 'search_api', - 'filter_type' => 'xss', - ]; - $plain_mapping['field_item:text_long'] = $text_mapping; - $plain_mapping['field_item:text_with_summary'] = $text_mapping; - $plain_mapping['search_api_html'] = $text_mapping; - unset($text_mapping['filter_type']); - $plain_mapping['search_api_text'] = $text_mapping; - - $numeric_mapping = [ - 'id' => 'search_api_numeric', - ]; - $plain_mapping['field_item:integer'] = $numeric_mapping; - $plain_mapping['field_item:list_integer'] = $numeric_mapping; - $plain_mapping['integer'] = $numeric_mapping; - $plain_mapping['timespan'] = $numeric_mapping; - - $float_mapping = [ - 'id' => 'search_api_numeric', - 'float' => TRUE, - ]; - $plain_mapping['field_item:decimal'] = $float_mapping; - $plain_mapping['field_item:float'] = $float_mapping; - $plain_mapping['field_item:list_float'] = $float_mapping; - $plain_mapping['decimal'] = $float_mapping; - $plain_mapping['float'] = $float_mapping; - - $date_mapping = [ - 'id' => 'search_api_date', - ]; - $plain_mapping['field_item:created'] = $date_mapping; - $plain_mapping['field_item:changed'] = $date_mapping; - $plain_mapping['datetime_iso8601'] = $date_mapping; - $plain_mapping['timestamp'] = $date_mapping; - - $bool_mapping = [ - 'id' => 'search_api_boolean', - ]; - $plain_mapping['boolean'] = $bool_mapping; - $plain_mapping['field_item:boolean'] = $bool_mapping; - - $ref_mapping = [ - 'id' => 'search_api_entity', - ]; - $plain_mapping['field_item:entity_reference'] = $ref_mapping; - $plain_mapping['field_item:comment'] = $ref_mapping; - - // Finally, set a default handler for unknown field items. - $plain_mapping['field_item:*'] = [ - 'id' => 'search_api', - ]; - - // Let other modules change or expand this mapping. - $alter_id = 'search_api_views_field_handler_mapping'; - \Drupal::moduleHandler()->alter($alter_id, $plain_mapping); - - // Then create a new, more practical structure, with the mappings grouped by - // mapping type. - $mappings = [ - 'simple' => [], - 'regex' => [], - 'default' => NULL, - ]; - foreach ($plain_mapping as $type => $definition) { - if ($type == '*') { - $mappings['default'] = $definition; - } - elseif (strpos($type, '*') === FALSE) { - $mappings['simple'][$type] = $definition; - } - else { - // Transform the type into a PCRE regular expression, taking care to - // quote everything except for the wildcards. - $parts = explode('*', $type); - // Passing the second parameter to preg_quote() is a bit tricky with - // array_map(), we need to construct an array of slashes. - $slashes = array_fill(0, count($parts), '/'); - $parts = array_map('preg_quote', $parts, $slashes); - // Use the "S" modifier for closer analysis of the pattern, since it - // might be executed a lot. - $regex = '/^' . implode('.*', $parts) . '$/S'; - $mappings['regex'][$regex] = $definition; - } - } - // Finally, order the regular expressions descending by their lengths. - $compare = function ($a, $b) { - return strlen($b) - strlen($a); - }; - uksort($mappings['regex'], $compare); - } - - return $mappings; -} diff --git a/sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiBackend.php b/sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiBackend.php deleted file mode 100644 index 7e1d2d762..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Annotation/SearchApiBackend.php +++ /dev/null @@ -1,44 +0,0 @@ -setServer($configuration['#server']); - unset($configuration['#server']); - } - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - /** @var static $plugin */ - $plugin = parent::create($container, $configuration, $plugin_id, $plugin_definition); - - $plugin->setFieldsHelper($container->get('search_api.fields_helper')); - $plugin->setMessenger($container->get('messenger')); - - return $plugin; - } - - /** - * Retrieves the fields helper. - * - * @return \Drupal\search_api\Utility\FieldsHelper - * The fields helper. - */ - public function getFieldsHelper() { - return $this->fieldsHelper ?: \Drupal::service('search_api.fields_helper'); - } - - /** - * Sets the fields helper. - * - * @param \Drupal\search_api\Utility\FieldsHelper $fields_helper - * The new fields helper. - * - * @return $this - */ - public function setFieldsHelper(FieldsHelper $fields_helper) { - $this->fieldsHelper = $fields_helper; - return $this; - } - - /** - * Retrieves the messenger. - * - * @return \Drupal\Core\Messenger\MessengerInterface - * The messenger. - */ - public function getMessenger() { - return $this->messenger ?: \Drupal::service('messenger'); - } - - /** - * Sets the messenger. - * - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The new messenger. - * - * @return $this - */ - public function setMessenger(MessengerInterface $messenger) { - $this->messenger = $messenger; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getServer() { - return $this->server; - } - - /** - * {@inheritdoc} - */ - public function setServer(ServerInterface $server) { - $this->server = $server; - return $this; - } - - /** - * {@inheritdoc} - */ - public function viewSettings() { - return []; - } - - /** - * {@inheritdoc} - */ - public function isAvailable() { - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function getSupportedFeatures() { - return []; - } - - /** - * {@inheritdoc} - */ - public function supportsDataType($type) { - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function postInsert() {} - - /** - * {@inheritdoc} - */ - public function preUpdate() {} - - /** - * {@inheritdoc} - */ - public function postUpdate() { - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function preDelete() { - try { - $this->getServer()->deleteAllItems(); - } - catch (SearchApiException $e) { - $vars = [ - '%server' => $this->getServer()->label(), - ]; - $this->logException($e, '%type while deleting items from server %server: @message in %function (line %line of %file).', $vars); - $this->getMessenger()->addError($this->t('Deleting some of the items on the server failed. Check the logs for details. The server was still removed.')); - } - } - - /** - * {@inheritdoc} - */ - public function getBackendDefinedFields(IndexInterface $index) { - return []; - } - - /** - * {@inheritdoc} - */ - public function addIndex(IndexInterface $index) {} - - /** - * {@inheritdoc} - */ - public function updateIndex(IndexInterface $index) {} - - /** - * {@inheritdoc} - */ - public function removeIndex($index) { - // Only delete the index's data if the index isn't read-only. (If only the - // ID is given, we assume the index was read-only, to be on the safe side.) - if ($index instanceof IndexInterface && !$index->isReadOnly()) { - $this->deleteAllIndexItems($index); - } - } - - /** - * {@inheritdoc} - */ - public function getDiscouragedProcessors() { - return []; - } - - /** - * Creates dummy field objects for the "magic" fields present for every index. - * - * @param \Drupal\search_api\IndexInterface $index - * The index for which to create the fields. (Needed since field objects - * always need an index set.) - * @param \Drupal\search_api\Item\ItemInterface|null $item - * (optional) If given, an item whose data should be used for the fields' - * values. - * - * @return \Drupal\search_api\Item\FieldInterface[] - * An array of field objects for all "magic" fields, keyed by field IDs. - */ - protected function getSpecialFields(IndexInterface $index, ItemInterface $item = NULL) { - $field_info = [ - 'type' => 'string', - 'original type' => 'string', - ]; - $fields['search_api_id'] = $this->getFieldsHelper() - ->createField($index, 'search_api_id', $field_info); - $fields['search_api_datasource'] = $this->getFieldsHelper() - ->createField($index, 'search_api_datasource', $field_info); - $fields['search_api_language'] = $this->getFieldsHelper() - ->createField($index, 'search_api_language', $field_info); - - if ($item) { - $fields['search_api_id']->setValues([$item->getId()]); - $fields['search_api_datasource']->setValues([$item->getDatasourceId()]); - $fields['search_api_language']->setValues([$item->getLanguage()]); - } - - return $fields; - } - - /** - * Verifies that the given condition operator is valid for this backend. - * - * @param string $operator - * The operator in question. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if the operator is not known. - * - * @see \Drupal\search_api\Query\ConditionSetInterface::addCondition() - */ - protected function validateOperator($operator) { - switch ($operator) { - case '=': - case '<>': - case '<': - case '<=': - case '>=': - case '>': - case 'IN': - case 'NOT IN': - case 'BETWEEN': - case 'NOT BETWEEN': - return; - } - throw new SearchApiException("Unknown operator '$operator' used in search query condition"); - } - - /** - * Implements the magic __sleep() method. - * - * Prevents the server entity from being serialized. - */ - public function __sleep() { - if ($this->server) { - $this->serverId = $this->server->id(); - } - $properties = array_flip(parent::__sleep()); - unset($properties['server']); - return array_keys($properties); - } - - /** - * Implements the magic __wakeup() method. - * - * Reloads the server entity. - */ - public function __wakeup() { - parent::__wakeup(); - - if ($this->serverId) { - $this->server = Server::load($this->serverId); - $this->serverId = NULL; - } - } - - /** - * Retrieves the effective fulltext fields from the query. - * - * Automatically translates a NULL value in the query object to all fulltext - * fields in the search index. - * - * If a specific backend supports any "virtual" fulltext fields not listed in - * the index, it should override this method to add them, if appropriate. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The search query. - * - * @return string[] - * The fulltext fields in which to search for the search keys. - * - * @see \Drupal\search_api\Query\QueryInterface::getFulltextFields() - */ - protected function getQueryFulltextFields(QueryInterface $query) { - $fulltext_fields = $query->getFulltextFields(); - $index_fields = $query->getIndex()->getFulltextFields(); - return $fulltext_fields === NULL ? $index_fields : array_intersect($fulltext_fields, $index_fields); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Backend/BackendPluginManager.php b/sites/all/modules/contrib/search/search_api/src/Backend/BackendPluginManager.php deleted file mode 100644 index c498cc485..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Backend/BackendPluginManager.php +++ /dev/null @@ -1,36 +0,0 @@ -setCacheBackend($cache_backend, 'search_api_backends'); - $this->alterInfo('search_api_backend_info'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Backend/BackendSpecificInterface.php b/sites/all/modules/contrib/search/search_api/src/Backend/BackendSpecificInterface.php deleted file mode 100644 index 393e4451d..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Backend/BackendSpecificInterface.php +++ /dev/null @@ -1,216 +0,0 @@ -getServerId(). - * - * If the index wasn't added to the server previously, the method call should - * be ignored. - * - * Implementations of this method should also check whether - * $index->isReadOnly() and don't delete any indexed data if it is. - * - * @param \Drupal\search_api\IndexInterface|string $index - * Either an object representing the index to remove, or its ID (if the - * index was completely deleted). - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an error occurred while removing the index. - */ - public function removeIndex($index); - - /** - * Indexes the specified items. - * - * @param \Drupal\search_api\IndexInterface $index - * The search index for which items should be indexed. - * @param \Drupal\search_api\Item\ItemInterface[] $items - * An array of items to be indexed, keyed by their item IDs. - * - * @return string[] - * The IDs of all items that were successfully indexed. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if indexing was prevented by a fundamental configuration error. - */ - public function indexItems(IndexInterface $index, array $items); - - /** - * Deletes the specified items from the index. - * - * @param \Drupal\search_api\IndexInterface $index - * The index from which items should be deleted. - * @param string[] $item_ids - * The IDs of the deleted items. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an error occurred while trying to delete the items. - */ - public function deleteItems(IndexInterface $index, array $item_ids); - - /** - * Deletes all the items from the index. - * - * @param \Drupal\search_api\IndexInterface $index - * The index for which items should be deleted. - * @param string|null $datasource_id - * (optional) If given, only delete items from the datasource with the - * given ID. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an error occurred while trying to delete indexed items. - */ - public function deleteAllIndexItems(IndexInterface $index, $datasource_id = NULL); - - /** - * Executes a search on this server. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The query to execute. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an error prevented the search from completing. - */ - public function search(QueryInterface $query); - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Commands/SearchApiCommands.php b/sites/all/modules/contrib/search/search_api/src/Commands/SearchApiCommands.php deleted file mode 100644 index f7fdcba88..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Commands/SearchApiCommands.php +++ /dev/null @@ -1,458 +0,0 @@ -commandHelper = new CommandHelper($entityTypeManager, $moduleHandler, 'dt'); - } - - /** - * {@inheritdoc} - */ - public function setLogger(LoggerInterface $logger) { - parent::setLogger($logger); - $this->commandHelper->setLogger($logger); - } - - /** - * Lists all search indexes. - * - * @command search-api:list - * - * @usage drush search-api:list - * List all search indexes. - * - * @field-labels - * id: ID - * name: Name - * server: Server ID - * serverName: Server name - * types: Type IDs - * typeNames: Type names - * status: Status - * limit: Limit - * - * @default-fields id,name,serverName,typeNames,status,limit - * - * @aliases sapi-l,search-api-list - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * The table rows. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if an index has a server which couldn't be loaded. - */ - public function listCommand() { - $rows = $this->commandHelper->indexListCommand(); - - return new RowsOfMultiValueFields($rows); - } - - /** - * Enables one disabled search index. - * - * @param string $indexId - * A search index ID. - * - * @command search-api:enable - * - * @usage drush search-api:enable node_index - * Enable the search index with the ID node_index. - * - * @aliases sapi-en,search-api-enable - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if no indexes could be loaded. - */ - public function enable($indexId) { - $this->commandHelper->enableIndexCommand([$indexId]); - } - - /** - * Enables all disabled search indexes. - * - * @command search-api:enable-all - * - * @usage drush search-api:enable-all - * Enable all disabled indexes. - * @usage drush sapi-ena - * Alias to enable all disabled indexes. - * - * @aliases sapi-ena,search-api-enable-all - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if no indexes could be loaded. - */ - public function enableAll() { - $this->commandHelper->enableIndexCommand(); - } - - /** - * Disables one or more enabled search indexes. - * - * @param string $indexId - * A search index ID. - * - * @command search-api:disable - * - * @usage drush search-api:disable node_index - * Disable the search index with the ID node_index. - * @usage drush sapi-dis node_index - * Alias to disable the search index with the ID node_index. - * - * @aliases sapi-dis,search-api-disable - * - * @throws \Exception - * If no indexes are defined or no index has been passed. - */ - public function disable($indexId) { - $this->commandHelper->disableIndexCommand([$indexId]); - } - - /** - * Disables all enabled search indexes. - * - * @command search-api:disable-all - * - * @usage drush search-api:disable-all - * Disable all enabled indexes. - * @usage drush sapi-disa - * Alias to disable all enabled indexes. - * - * @aliases sapi-disa,search-api-disable-all - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if no indexes could be loaded. - */ - public function disableAll() { - $this->commandHelper->disableIndexCommand(); - } - - /** - * Shows the status of one or all search indexes. - * - * @param string|null $indexId - * (optional) A search index ID, or NULL to show the status of all indexes. - * - * @command search-api:status - * - * @usage drush search-api:status - * Show the status of all search indexes. - * @usage drush sapi-s - * Alias to show the status of all search indexes. - * @usage drush sapi-s node_index - * Show the status of the search index with the ID node_index. - * - * @field-labels - * id: ID - * name: Name - * complete: % Complete - * indexed: Indexed - * total: Total - * - * @aliases sapi-s,search-api-status - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * The table rows. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if one of the affected indexes had an invalid tracker set. - */ - public function status($indexId = NULL) { - $rows = $this->commandHelper->indexStatusCommand([$indexId]); - return new RowsOfFields($rows); - } - - /** - * Indexes items for one or all enabled search indexes. - * - * @param string $indexId - * (optional) A search index ID, or NULL to index items for all enabled - * indexes. - * @param array $options - * (optional) An array of options. - * - * @command search-api:index - * - * @option limit - * The maximum number of items to index. Set to 0 to index all items. - * Defaults to 0 (index all). - * @option batch-size - * The maximum number of items to index per batch run. Set to 0 to index all - * items at once. Defaults to the "Cron batch size" setting of the index. - * - * @usage drush search-api:index - * Index all items for all enabled indexes. - * @usage drush sapi-i - * Alias to index all items for all enabled indexes. - * @usage drush sapi-i node_index - * Index all items for the index with the ID node_index. - * @usage drush sapi-i node_index 100 - * Index a maximum number of 100 items for the index with the ID node_index. - * @usage drush sapi-i node_index 100 10 - * Index a maximum number of 100 items (10 items per batch run) for the - * index with the ID node_index. - * - * @aliases sapi-i,search-api-index - * - * @throws \Exception - * If a batch process could not be created. - */ - public function index($indexId = NULL, array $options = ['limit' => NULL, 'batch-size' => NULL]) { - $limit = $options['limit']; - $batch_size = $options['batch-size']; - $process_batch = $this->commandHelper->indexItemsToIndexCommand([$indexId], $limit, $batch_size); - - if ($process_batch === TRUE) { - drush_backend_batch_process(); - } - } - - /** - * Marks one or all indexes for reindexing without deleting existing data. - * - * @param string $indexId - * The machine name of an index. Optional. If missed, will schedule all - * search indexes for reindexing. - * @param array $options - * An array of options. - * - * @command search-api:reset-tracker - * - * @option entity-types List of entity type ids to reset tracker for. - * - * @usage drush search-api:reset-tracker - * Schedule all search indexes for reindexing. - * @usage drush sapi-r - * Alias to schedule all search indexes for reindexing . - * @usage drush sapi-r node_index - * Schedule the search index with the ID node_index for reindexing. - * - * @aliases search-api-mark-all,search-api-reindex,sapi-r,search-api-reset-tracker - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if one of the affected indexes had an invalid tracker set, or some - * other internal error occurred. - */ - public function resetTracker($indexId = NULL, array $options = ['entity-types' => []]) { - $this->commandHelper->resetTrackerCommand([$indexId], $options['entity-types']); - } - - /** - * Clears one or all search indexes and marks them for reindexing. - * - * @param string $indexId - * The machine name of an index. Optional. If missed all search indexes will - * be cleared. - * - * @command search-api:clear - * - * @usage drush search-api:clear - * Clear all search indexes. - * @usage drush sapi-c - * Alias to clear all search indexes. - * @usage drush sapi-c node_index - * Clear the search index with the ID node_index. - * - * @aliases sapi-c,search-api-clear - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if one of the affected indexes had an invalid tracker set, or some - * other internal error occurred. - */ - public function clear($indexId = NULL) { - $this->commandHelper->clearIndexCommand([$indexId]); - } - - /** - * Searches for a keyword or phrase in a given index. - * - * @param string $indexId - * The machine name of an index. - * @param string $keyword - * The keyword to look for. - * - * @command search-api:search - * - * @usage drush search-api:search node_index title - * Search for "title" inside the "node_index" index. - * @usage drush sapi-search node_index title - * Alias to search for "title" inside the "node_index" index. - * - * @field-labels - * id: ID - * label: Label - * - * @aliases sapi-search,search-api-search - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * The table rows. - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if searching failed for any reason. - * @throws \Drupal\search_api\SearchApiException - * Thrown if no search query could be created for the given index, for - * example because it is disabled or its server could not be loaded. - */ - public function search($indexId, $keyword) { - $rows = $this->commandHelper->searchIndexCommand($indexId, $keyword); - - return new RowsOfFields($rows); - } - - /** - * Lists all search servers. - * - * @command search-api:server-list - * - * @usage drush search-api:server-list - * List all search servers. - * @usage drush sapi-sl - * Alias to list all search servers. - * - * @field-labels - * id: ID - * name: Name - * status: Status - * - * @aliases sapi-sl,search-api-server-list - * - * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields - * The table rows. - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if no servers could be loaded. - */ - public function serverList() { - $rows = $this->commandHelper->serverListCommand(); - - return new RowsOfFields($rows); - } - - /** - * Enables a search server. - * - * @param string $serverId - * The machine name of a server. - * - * @command search-api:server-enable - * - * @usage drush search-api:server-enable my_solr_server - * Enable the my_solr_server search server. - * @usage drush sapi-se my_solr_server - * Alias to enable the my_solr_server search server. - * - * @aliases sapi-se,search-api-server-enable - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if the server couldn't be loaded. - * @throws \Drupal\Core\Entity\EntityStorageException - * Thrown if an internal error occurred when saving the server. - */ - public function serverEnable($serverId) { - $this->commandHelper->enableServerCommand($serverId); - } - - /** - * Disables a search server. - * - * @param string $serverId - * The machine name of a server. - * - * @command search-api:server-disable - * - * @usage drush search-api:server-disable - * Disable the my_solr_server search server. - * @usage drush sapi-sd - * Alias to disable the my_solr_server search server. - * - * @aliases sapi-sd,search-api-server-disable - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if the server couldn't be loaded. - * @throws \Drupal\Core\Entity\EntityStorageException - * Thrown if an internal error occurred when saving the server. - */ - public function serverDisable($serverId) { - $this->commandHelper->disableServerCommand($serverId); - } - - /** - * Clears all search indexes on the given search server. - * - * @param string $serverId - * The machine name of a server. - * - * @command search-api:server-clear - * - * @usage drush search-api:server-clear my_solr_server - * Clear all search indexes on the search server my_solr_server. - * @usage drush sapi-sc my_solr_server - * Alias to clear all search indexes on the search server my_solr_server. - * - * @aliases sapi-sc,search-api-server-clear - * - * @throws \Drupal\search_api\ConsoleException - * Thrown if the server couldn't be loaded. - * @throws \Drupal\search_api\SearchApiException - * Thrown if one of the affected indexes had an invalid tracker set, or some - * other internal error occurred. - */ - public function serverClear($serverId) { - $this->commandHelper->clearServerCommand($serverId); - } - - /** - * Sets the search server used by a given index. - * - * @param string $indexId - * The machine name of an index. - * @param string $serverId - * The machine name of a server. - * - * @command search-api:set-index-server - * - * @usage drush search-api:set-index-server default_node_index my_solr_server - * Set the default_node_index index to used the my_solr_server server. - * @usage drush sapi-sis default_node_index my_solr_server - * Alias to set the default_node_index index to used the my_solr_server - * server. - * - * @aliases sapi-sis,search-api-set-index-server - * - * @throws \Exception - * If no index or no server were passed or passed values are invalid. - */ - public function setIndexServer($indexId, $serverId) { - $this->commandHelper->setIndexServerCommand($indexId, $serverId); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/ConsoleException.php b/sites/all/modules/contrib/search/search_api/src/ConsoleException.php deleted file mode 100644 index 7d1b1fef9..000000000 --- a/sites/all/modules/contrib/search/search_api/src/ConsoleException.php +++ /dev/null @@ -1,8 +0,0 @@ -getView()->storage->get('base_table'); - $index = SearchApiQuery::getIndexFromTable($base_table); - - if ($index) { - $event->setEntityTypeIds($index->getEntityTypes()); - - $event->setEntityGetter([ - 'callable' => [SearchApiQuery::class, 'getEntityFromRow'], - ]); - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Controller/IndexController.php b/sites/all/modules/contrib/search/search_api/src/Controller/IndexController.php deleted file mode 100644 index 26a72dd06..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Controller/IndexController.php +++ /dev/null @@ -1,215 +0,0 @@ -setRequestStack($container->get('request_stack')); - $controller->setMessenger($container->get('messenger')); - - return $controller; - } - - /** - * Retrieves the request stack. - * - * @return \Symfony\Component\HttpFoundation\RequestStack - * The request stack. - */ - public function getRequestStack() { - return $this->requestStack ?: \Drupal::service('request_stack'); - } - - /** - * Retrieves the current request. - * - * @return \Symfony\Component\HttpFoundation\Request|null - * The current request. - */ - public function getRequest() { - return $this->getRequestStack()->getCurrentRequest(); - } - - /** - * Sets the request stack. - * - * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack - * The new request stack. - * - * @return $this - */ - public function setRequestStack(RequestStack $request_stack) { - $this->requestStack = $request_stack; - return $this; - } - - /** - * Retrieves the messenger. - * - * @return \Drupal\Core\Messenger\MessengerInterface - * The messenger. - */ - public function getMessenger() { - return $this->messenger ?: \Drupal::service('messenger'); - } - - /** - * Sets the messenger. - * - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The new messenger. - * - * @return $this - */ - public function setMessenger(MessengerInterface $messenger) { - $this->messenger = $messenger; - return $this; - } - - /** - * Displays information about a search index. - * - * @param \Drupal\search_api\IndexInterface $search_api_index - * The index to display. - * - * @return array - * An array suitable for drupal_render(). - */ - public function page(IndexInterface $search_api_index) { - // Build the search index information. - $render = [ - 'view' => [ - '#theme' => 'search_api_index', - '#index' => $search_api_index, - ], - ]; - // Check if the index is enabled and can be written to. - if ($search_api_index->status() && !$search_api_index->isReadOnly()) { - // Attach the index status form. - $render['form'] = $this->formBuilder()->getForm('Drupal\search_api\Form\IndexStatusForm', $search_api_index); - } - return $render; - } - - /** - * Returns the page title for an index's "View" tab. - * - * @param \Drupal\search_api\IndexInterface $search_api_index - * The index that is displayed. - * - * @return string - * The page title. - */ - public function pageTitle(IndexInterface $search_api_index) { - return new FormattableMarkup('@title', ['@title' => $search_api_index->label()]); - } - - /** - * Enables a search index without a confirmation form. - * - * @param \Drupal\search_api\IndexInterface $search_api_index - * The index to be enabled. - * - * @return \Symfony\Component\HttpFoundation\Response - * The response to send to the browser. - */ - public function indexBypassEnable(IndexInterface $search_api_index) { - // Enable the index. - $search_api_index->setStatus(TRUE)->save(); - - // \Drupal\search_api\Entity\Index::preSave() doesn't allow an index to be - // enabled if its server is not set or disabled. - if ($search_api_index->status()) { - // Notify the user about the status change. - $this->getMessenger()->addStatus($this->t('The search index %name has been enabled.', ['%name' => $search_api_index->label()])); - } - else { - // Notify the user that the status change did not succeed. - $this->getMessenger()->addStatus($this->t('The search index %name could not be enabled. Check if its server is set and enabled.', ['%name' => $search_api_index->label()])); - } - - // Redirect to the index's "View" page. - $url = $search_api_index->toUrl('canonical'); - return $this->redirect($url->getRouteName(), $url->getRouteParameters()); - } - - /** - * Removes a field from a search index. - * - * @param \Drupal\search_api\IndexInterface $search_api_index - * The search index. - * @param string $field_id - * The ID of the field to remove. - * - * @return \Symfony\Component\HttpFoundation\Response - * The response to send to the browser. - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * Thrown when the field was not found. - */ - public function removeField(IndexInterface $search_api_index, $field_id) { - $fields = $search_api_index->getFields(); - $success = FALSE; - if (isset($fields[$field_id])) { - try { - $search_api_index->removeField($field_id); - $search_api_index->save(); - $success = TRUE; - } - catch (SearchApiException $e) { - $args['%field'] = $fields[$field_id]->getLabel(); - $this->getMessenger()->addError($this->t('The field %field is locked and cannot be removed.', $args)); - } - } - else { - throw new NotFoundHttpException(); - } - - // If this is an AJAX request, just remove the row in question. - if ($success && $this->getRequest()->request->get(AjaxResponseSubscriber::AJAX_REQUEST_PARAMETER)) { - $response = new AjaxResponse(); - $response->addCommand(new RemoveCommand("tr[data-field-row-id='$field_id']")); - return $response; - } - // Redirect to the index's "Fields" page. - $url = $search_api_index->toUrl('fields'); - return $this->redirect($url->getRouteName(), $url->getRouteParameters()); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Controller/ServerController.php b/sites/all/modules/contrib/search/search_api/src/Controller/ServerController.php deleted file mode 100644 index d17bcbf94..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Controller/ServerController.php +++ /dev/null @@ -1,119 +0,0 @@ -setMessenger($container->get('messenger')); - - return $controller; - } - - /** - * Retrieves the messenger. - * - * @return \Drupal\Core\Messenger\MessengerInterface - * The messenger. - */ - public function getMessenger() { - return $this->messenger ?: \Drupal::service('messenger'); - } - - /** - * Sets the messenger. - * - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The new messenger. - * - * @return $this - */ - public function setMessenger(MessengerInterface $messenger) { - $this->messenger = $messenger; - return $this; - } - - /** - * Displays information about a search server. - * - * @param \Drupal\search_api\ServerInterface $search_api_server - * The server to display. - * - * @return array - * An array suitable for drupal_render(). - */ - public function page(ServerInterface $search_api_server) { - // Build the search server information. - $render = [ - 'view' => [ - '#theme' => 'search_api_server', - '#server' => $search_api_server, - ], - '#attached' => [ - 'library' => ['search_api/drupal.search_api.admin_css'], - ], - ]; - // Check if the server is enabled. - if ($search_api_server->status()) { - // Attach the server status form. - $render['form'] = $this->formBuilder()->getForm('Drupal\search_api\Form\ServerStatusForm', $search_api_server); - } - return $render; - } - - /** - * Returns the page title for a server's "View" tab. - * - * @param \Drupal\search_api\ServerInterface $search_api_server - * The server that is displayed. - * - * @return string - * The page title. - */ - public function pageTitle(ServerInterface $search_api_server) { - return new FormattableMarkup('@title', ['@title' => $search_api_server->label()]); - } - - /** - * Enables a search server without a confirmation form. - * - * @param \Drupal\search_api\ServerInterface $search_api_server - * The server to be enabled. - * - * @return \Symfony\Component\HttpFoundation\Response - * The response to send to the browser. - */ - public function serverBypassEnable(ServerInterface $search_api_server) { - $search_api_server->setStatus(TRUE)->save(); - - // Notify the user about the status change. - $this->getMessenger()->addStatus($this->t('The search server %name has been enabled.', ['%name' => $search_api_server->label()])); - - // Redirect to the server's "View" page. - $url = $search_api_server->toUrl('canonical'); - return $this->redirect($url->getRouteName(), $url->getRouteParameters()); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Controller/TaskController.php b/sites/all/modules/contrib/search/search_api/src/Controller/TaskController.php deleted file mode 100644 index f2a6e17a9..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Controller/TaskController.php +++ /dev/null @@ -1,86 +0,0 @@ -setTaskManager($container->get('search_api.task_manager')); - - return $controller; - } - - /** - * Retrieves the task manager. - * - * @return \Drupal\search_api\Task\TaskManagerInterface - * The task manager. - */ - public function getTaskManager() { - return $this->taskManager ?: \Drupal::service('search_api._task_manager'); - } - - /** - * Sets the task manager. - * - * @param \Drupal\search_api\Task\TaskManagerInterface $task_manager - * The new task manager. - * - * @return $this - */ - public function setTaskManager(TaskManagerInterface $task_manager) { - $this->taskManager = $task_manager; - return $this; - } - - /** - * Executes all pending tasks. - */ - public function executeTasks() { - $this->getTaskManager()->setTasksBatch(); - return batch_process(Url::fromRoute('search_api.overview')); - } - - /** - * Checks access for executing pending tasks. - * - * @param \Drupal\Core\Session\AccountInterface $account - * Run access checks for this account. - * - * @return \Drupal\Core\Access\AccessResultInterface - * The access result. - */ - public function executeTasksAccess(AccountInterface $account) { - // @todo Once we depend on Drupal 8.7+, check whether this can't just use - // the "search_api_task_list" cache tag instead. (See #2722237.) - if ($this->taskManager->getTasksCount()) { - return AccessResult::allowedIfHasPermission($account, 'administer search_api') - ->setCacheMaxAge(0); - } - return AccessResult::forbidden()->setCacheMaxAge(0); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/DataType/DataTypeInterface.php b/sites/all/modules/contrib/search/search_api/src/DataType/DataTypeInterface.php deleted file mode 100644 index 2303f7f4e..000000000 --- a/sites/all/modules/contrib/search/search_api/src/DataType/DataTypeInterface.php +++ /dev/null @@ -1,65 +0,0 @@ -pluginDefinition['fallback_type']) ? $this->pluginDefinition['fallback_type'] : 'string'; - } - - /** - * {@inheritdoc} - */ - public function isDefault() { - return !empty($this->pluginDefinition['default']); - } - - /** - * {@inheritdoc} - */ - public function label() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['label']; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['description']; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/DataType/DataTypePluginManager.php b/sites/all/modules/contrib/search/search_api/src/DataType/DataTypePluginManager.php deleted file mode 100644 index 770dbb9e1..000000000 --- a/sites/all/modules/contrib/search/search_api/src/DataType/DataTypePluginManager.php +++ /dev/null @@ -1,119 +0,0 @@ -setCacheBackend($cache_backend, 'search_api_data_type'); - $this->alterInfo('search_api_data_type_info'); - } - - /** - * Creates or retrieves a data type plugin. - * - * @param string $plugin_id - * The ID of the plugin being instantiated. - * @param array $configuration - * (optional) An array of configuration relevant to the plugin instance. - * Ignored for data type plugins. - * - * @return \Drupal\search_api\DataType\DataTypeInterface - * The requested data type plugin. - * - * @throws \Drupal\Component\Plugin\Exception\PluginException - * If the instance cannot be created, such as if the ID is invalid. - */ - public function createInstance($plugin_id, array $configuration = []) { - if (empty($this->dataTypes[$plugin_id])) { - $this->dataTypes[$plugin_id] = parent::createInstance($plugin_id, $configuration); - } - return $this->dataTypes[$plugin_id]; - } - - /** - * Returns all known data types. - * - * @return \Drupal\search_api\DataType\DataTypeInterface[] - * An array of data type plugins, keyed by type identifier. - */ - public function getInstances() { - if (!$this->allCreated) { - $this->allCreated = TRUE; - if (!isset($this->dataTypes)) { - $this->dataTypes = []; - } - - foreach ($this->getDefinitions() as $plugin_id => $definition) { - if (class_exists($definition['class']) && empty($this->dataTypes[$plugin_id])) { - $data_type = $this->createInstance($plugin_id); - $this->dataTypes[$plugin_id] = $data_type; - } - } - } - - return $this->dataTypes; - } - - /** - * Returns all field data types known by the Search API as an options list. - * - * @return string[] - * An associative array with all recognized types as keys, mapped to their - * translated display names. - * - * @see \Drupal\search_api\DataType\DataTypePluginManager::getInstances() - */ - public function getInstancesOptions() { - $types = []; - foreach ($this->getInstances() as $id => $info) { - $types[$id] = $info->label(); - } - return $types; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Datasource/DatasourceInterface.php b/sites/all/modules/contrib/search/search_api/src/Datasource/DatasourceInterface.php deleted file mode 100644 index 5cd4ed1a0..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Datasource/DatasourceInterface.php +++ /dev/null @@ -1,241 +0,0 @@ -loadMultiple([$id]); - return $items ? reset($items) : NULL; - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $ids) { - return []; - } - - /** - * {@inheritdoc} - */ - public function getItemLabel(ComplexDataInterface $item) { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getItemBundle(ComplexDataInterface $item) { - return $this->getPluginId(); - } - - /** - * {@inheritdoc} - */ - public function getItemLanguage(ComplexDataInterface $item) { - if ($item instanceof TranslatableInterface) { - return $item->language()->getId(); - } - $item = $item->getValue(); - if ($item instanceof TranslatableInterface) { - return $item->language()->getId(); - } - return Language::LANGCODE_NOT_SPECIFIED; - } - - /** - * {@inheritdoc} - */ - public function getItemUrl(ComplexDataInterface $item) { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function checkItemAccess(ComplexDataInterface $item, AccountInterface $account = NULL) { - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function getViewModes($bundle = NULL) { - return []; - } - - /** - * {@inheritdoc} - */ - public function getBundles() { - return [ - $this->getPluginId() => $this->label(), - ]; - } - - /** - * {@inheritdoc} - */ - public function viewItem(ComplexDataInterface $item, $view_mode, $langcode = NULL) { - return []; - } - - /** - * {@inheritdoc} - */ - public function viewMultipleItems(array $items, $view_mode, $langcode = NULL) { - $build = []; - foreach ($items as $key => $item) { - $build[$key] = $this->viewItem($item, $view_mode, $langcode); - } - return $build; - } - - /** - * {@inheritdoc} - */ - public function getEntityTypeId() { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getItemIds($page = NULL) { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getFieldDependencies(array $fields) { - return []; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Datasource/DatasourcePluginManager.php b/sites/all/modules/contrib/search/search_api/src/Datasource/DatasourcePluginManager.php deleted file mode 100644 index be9e684cd..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Datasource/DatasourcePluginManager.php +++ /dev/null @@ -1,36 +0,0 @@ -setCacheBackend($cache_backend, 'search_api_datasources'); - $this->alterInfo('search_api_datasource_info'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Display/DisplayDeriverBase.php b/sites/all/modules/contrib/search/search_api/src/Display/DisplayDeriverBase.php deleted file mode 100644 index 05dbefb31..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Display/DisplayDeriverBase.php +++ /dev/null @@ -1,68 +0,0 @@ -get('entity_type.manager'); - $deriver->setEntityTypeManager($entity_type_manager); - - $translation = $container->get('string_translation'); - $deriver->setStringTranslation($translation); - - return $deriver; - } - - /** - * Retrieves the entity manager. - * - * @return \Drupal\Core\Entity\EntityTypeManagerInterface - * The entity manager. - */ - public function getEntityTypeManager() { - return $this->entityTypeManager; - } - - /** - * Sets the entity manager. - * - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity manager. - * - * @return $this - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) { - $this->entityTypeManager = $entity_type_manager; - return $this; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Display/DisplayInterface.php b/sites/all/modules/contrib/search/search_api/src/Display/DisplayInterface.php deleted file mode 100644 index c5969a38f..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Display/DisplayInterface.php +++ /dev/null @@ -1,74 +0,0 @@ -setCurrentPath($container->get('path.current')); - $display->setEntityTypeManager($container->get('entity_type.manager')); - - return $display; - } - - /** - * Retrieves the current path service. - * - * @return \Drupal\Core\Path\CurrentPathStack - * The current path service. - */ - public function getCurrentPath() { - return $this->currentPath ?: \Drupal::service('path.current'); - } - - /** - * Sets the current path service. - * - * @param \Drupal\Core\Path\CurrentPathStack $current_path - * The new current path service. - * - * @return $this - */ - public function setCurrentPath(CurrentPathStack $current_path) { - $this->currentPath = $current_path; - return $this; - } - - /** - * Retrieves the entity type manager. - * - * @return \Drupal\Core\Entity\EntityTypeManagerInterface - * The entity type manager. - */ - public function getEntityTypeManager() { - return $this->entityTypeManager ?: \Drupal::service('entity_type.manager'); - } - - /** - * Sets the entity type manager. - * - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The new entity type manager. - * - * @return $this - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) { - $this->entityTypeManager = $entity_type_manager; - return $this; - } - - /** - * {@inheritdoc} - */ - public function label() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['label']; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['description']; - } - - /** - * {@inheritdoc} - */ - public function getIndex() { - $plugin_definition = $this->getPluginDefinition(); - return $this->getEntityTypeManager() - ->getStorage('search_api_index') - ->load($plugin_definition['index']); - } - - /** - * {@inheritdoc} - */ - public function getUrl() { - if ($path = $this->getPath()) { - return Url::fromUserInput($path); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getPath() { - $plugin_definition = $this->getPluginDefinition(); - if (!empty($plugin_definition['path'])) { - return $plugin_definition['path']; - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function isRenderedInCurrentRequest() { - if ($path = $this->getPath()) { - $current_path = $this->getCurrentPath()->getPath(); - return $current_path == $path; - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = []; - - // By default, add dependencies to the module providing this display and to - // the index it is based on. - $definition = $this->getPluginDefinition(); - $dependencies['module'][] = $definition['provider']; - - $index = $this->getIndex(); - $dependencies[$index->getConfigDependencyKey()][] = $index->getConfigDependencyName(); - - return $dependencies; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManager.php b/sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManager.php deleted file mode 100644 index abac905ae..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManager.php +++ /dev/null @@ -1,64 +0,0 @@ -setCacheBackend($cache_backend, 'search_api_displays'); - $this->alterInfo('search_api_displays'); - } - - /** - * {@inheritdoc} - */ - public function getInstances() { - if ($this->displays === NULL) { - $this->displays = []; - - foreach ($this->getDefinitions() as $name => $display_definition) { - if (class_exists($display_definition['class']) && empty($this->displays[$name])) { - $display = $this->createInstance($name); - $this->displays[$name] = $display; - } - } - } - - return $this->displays; - } - - /** - * {@inheritdoc} - */ - public function clearCachedDefinitions() { - parent::clearCachedDefinitions(); - - $this->discovery = NULL; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManagerInterface.php b/sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManagerInterface.php deleted file mode 100644 index a1d4c49d1..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Display/DisplayPluginManagerInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - [ - * // Settings … - * ], - * … - * ] - * @endcode - * - * @var array - */ - protected $datasource_settings = []; - - /** - * The instantiated datasource plugins. - * - * In the ::preSave method we're saving the contents of these back into the - * $datasource_settings array. When adding, removing or changing configuration - * we should therefore always manipulate this property instead of the stored - * one. - * - * @var \Drupal\search_api\Datasource\DatasourceInterface[]|null - * - * @see getDatasources() - */ - protected $datasourceInstances; - - /** - * The tracker settings. - * - * The array has the following structure: - * - * @code - * [ - * 'TRACKER_ID' => [ - * // Settings … - * ], - * ] - * @endcode - * - * There is always just a single entry in the array. - * - * @var array - */ - protected $tracker_settings = NULL; - - /** - * The tracker plugin instance. - * - * In the ::preSave method we're saving the contents of these back into the - * $tracker_settings array. When adding, removing or changing configuration - * we should therefore always manipulate this property instead of the stored - * one. - * - * @var \Drupal\search_api\Tracker\TrackerInterface|null - * - * @see getTrackerInstance() - */ - protected $trackerInstance; - - /** - * The ID of the server on which data should be indexed. - * - * @var string|null - */ - protected $server; - - /** - * The server entity belonging to this index. - * - * @var \Drupal\search_api\ServerInterface - * - * @see getServerInstance() - */ - protected $serverInstance; - - /** - * The array of processor settings. - * - * The array has the following structure: - * - * @code - * [ - * 'PROCESSOR_ID' => [ - * 'weights' => [], - * // Other settings … - * ], - * … - * ] - * @endcode - * - * @var array - */ - protected $processor_settings = []; - - /** - * Instances of the processor plugins. - * - * In the ::preSave method we're saving the contents of these back into the - * $tracker_settings array. When adding, removing or changing configuration - * we should therefore always manipulate this property instead of the stored - * one. - * - * @var \Drupal\search_api\Processor\ProcessorInterface[]|null - */ - protected $processorInstances; - - /** - * Static cache of retrieved property definitions, grouped by datasource. - * - * @var \Drupal\Core\TypedData\DataDefinitionInterface[][] - * - * @see \Drupal\search_api\Entity\Index::getPropertyDefinitions() - */ - protected $properties = []; - - /** - * The number of currently active "batch tracking" modes. - * - * @var int - */ - protected $batchTracking = 0; - - /** - * {@inheritdoc} - */ - public function id() { - return $this->id; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->description; - } - - /** - * {@inheritdoc} - */ - public function isReadOnly() { - return $this->read_only; - } - - /** - * {@inheritdoc} - */ - public function getOption($name, $default = NULL) { - return isset($this->options[$name]) ? $this->options[$name] : $default; - } - - /** - * {@inheritdoc} - */ - public function getOptions() { - return $this->options; - } - - /** - * {@inheritdoc} - */ - public function setOption($name, $option) { - $this->options[$name] = $option; - return $this; - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) { - $this->options = $options; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getDatasources() { - if ($this->datasourceInstances === NULL) { - $this->datasourceInstances = \Drupal::getContainer() - ->get('search_api.plugin_helper') - ->createDatasourcePlugins($this, array_keys($this->datasource_settings)); - } - - return $this->datasourceInstances; - } - - /** - * {@inheritdoc} - */ - public function getDatasourceIds() { - return array_keys($this->getDatasources()); - } - - /** - * {@inheritdoc} - */ - public function isValidDatasource($datasource_id) { - $datasources = $this->getDatasources(); - return !empty($datasources[$datasource_id]); - } - - /** - * {@inheritdoc} - */ - public function getDatasource($datasource_id) { - $datasources = $this->getDatasources(); - - if (empty($datasources[$datasource_id])) { - $index_label = $this->label(); - throw new SearchApiException("The datasource with ID '$datasource_id' could not be retrieved for index '$index_label'."); - } - - return $datasources[$datasource_id]; - } - - /** - * {@inheritdoc} - */ - public function addDatasource(DatasourceInterface $datasource) { - // Make sure the datasourceInstances are loaded before trying to add a plugin - // to them. - if ($this->datasourceInstances === NULL) { - $this->getDatasources(); - } - $this->datasourceInstances[$datasource->getPluginId()] = $datasource; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function removeDatasource($datasource_id) { - // Make sure the datasourceInstances are loaded before trying to remove a - // plugin from them. - if ($this->datasourceInstances === NULL) { - $this->getDatasources(); - } - unset($this->datasourceInstances[$datasource_id]); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setDatasources(array $datasources = NULL) { - $this->datasourceInstances = $datasources; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getEntityTypes($return_bool = FALSE) { - $types = []; - foreach ($this->getDatasources() as $datasource_id => $datasource) { - if ($type = $datasource->getEntityTypeId()) { - $types[$datasource_id] = $type; - } - } - return $types; - } - - /** - * {@inheritdoc} - */ - public function hasValidTracker() { - return (bool) \Drupal::getContainer() - ->get('plugin.manager.search_api.tracker') - ->getDefinition($this->getTrackerId(), FALSE); - } - - /** - * {@inheritdoc} - */ - public function getTrackerId() { - if ($this->trackerInstance) { - return $this->trackerInstance->getPluginId(); - } - if (empty($this->tracker_settings)) { - return \Drupal::config('search_api.settings')->get('default_tracker'); - } - reset($this->tracker_settings); - return key($this->tracker_settings); - } - - /** - * {@inheritdoc} - */ - public function getTrackerInstance() { - if (!$this->trackerInstance) { - $tracker_id = $this->getTrackerId(); - - $configuration = []; - if (!empty($this->tracker_settings[$tracker_id])) { - $configuration = $this->tracker_settings[$tracker_id]; - } - - $this->trackerInstance = \Drupal::getContainer() - ->get('search_api.plugin_helper') - ->createTrackerPlugin($this, $tracker_id, $configuration); - } - - return $this->trackerInstance; - } - - /** - * {@inheritdoc} - */ - public function setTracker(TrackerInterface $tracker) { - $this->trackerInstance = $tracker; - return $this; - } - - /** - * {@inheritdoc} - */ - public function hasValidServer() { - return $this->serverInstance - || ($this->server !== NULL && Server::load($this->server)); - } - - /** - * {@inheritdoc} - */ - public function isServerEnabled() { - return $this->hasValidServer() && $this->getServerInstance()->status(); - } - - /** - * {@inheritdoc} - */ - public function getServerId() { - return $this->server; - } - - /** - * {@inheritdoc} - */ - public function getServerInstance() { - if (!$this->serverInstance && $this->server) { - $this->serverInstance = Server::load($this->server); - if (!$this->serverInstance) { - $index_label = $this->label(); - throw new SearchApiException("The server with ID '$this->server' could not be retrieved for index '$index_label'."); - } - } - - return $this->serverInstance; - } - - /** - * {@inheritdoc} - */ - public function setServer(ServerInterface $server = NULL) { - $this->serverInstance = $server; - $this->server = $server ? $server->id() : NULL; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getProcessors() { - if ($this->processorInstances !== NULL) { - return $this->processorInstances; - } - - // Filter the processors to only include those that are enabled (or locked). - // We should only reach this point in the code once, at the first call after - // the index is loaded. - $this->processorInstances = []; - $processors = \Drupal::getContainer() - ->get('search_api.plugin_helper') - ->createProcessorPlugins($this); - foreach ($processors as $processor_id => $processor) { - if (isset($this->processor_settings[$processor_id]) || $processor->isLocked()) { - $this->processorInstances[$processor_id] = $processor; - } - } - - return $this->processorInstances; - } - - /** - * {@inheritdoc} - */ - public function getProcessorsByStage($stage, array $overrides = []) { - // Get a list of all processors which support this stage, along with their - // weights. - $processors = $this->getProcessors(); - $processor_weights = []; - foreach ($processors as $name => $processor) { - if ($processor->supportsStage($stage)) { - $processor_weights[$name] = $processor->getWeight($stage); - } - } - - // Apply any overrides that were passed by the caller. - $plugin_helper = \Drupal::getContainer()->get('search_api.plugin_helper'); - foreach ($overrides as $name => $config) { - $processor = $plugin_helper->createProcessorPlugin($this, $name, $config); - if ($processor->supportsStage($stage)) { - $processors[$name] = $processor; - $processor_weights[$name] = $processor->getWeight($stage); - } - else { - // In rare cases, the override might change whether or not the processor - // supports the given stage. So, to make sure, unset the weight in case - // it was set before. - unset($processor_weights[$name]); - } - } - - // Sort requested processors by weight. - asort($processor_weights); - - $return_processors = []; - foreach ($processor_weights as $name => $weight) { - $return_processors[$name] = $processors[$name]; - } - - return $return_processors; - } - - /** - * {@inheritdoc} - */ - public function isValidProcessor($processor_id) { - $processors = $this->getProcessors(); - return !empty($processors[$processor_id]); - } - - /** - * {@inheritdoc} - */ - public function getProcessor($processor_id) { - $processors = $this->getProcessors(); - - if (empty($processors[$processor_id])) { - $index_label = $this->label(); - throw new SearchApiException("The processor with ID '$processor_id' could not be retrieved for index '$index_label'."); - } - - return $processors[$processor_id]; - } - - /** - * {@inheritdoc} - */ - public function addProcessor(ProcessorInterface $processor) { - // Make sure the processorInstances are loaded before trying to add a plugin - // to them. - if ($this->processorInstances === NULL) { - $this->getProcessors(); - } - $this->processorInstances[$processor->getPluginId()] = $processor; - return $this; - } - - /** - * {@inheritdoc} - */ - public function removeProcessor($processor_id) { - // Make sure the processorInstances are loaded before trying to remove a - // plugin from them. - if ($this->processorInstances === NULL) { - $this->getProcessors(); - } - unset($this->processorInstances[$processor_id]); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setProcessors(array $processors) { - $this->processorInstances = $processors; - return $this; - } - - /** - * {@inheritdoc} - */ - public function alterIndexedItems(array &$items) { - foreach ($this->getProcessorsByStage(ProcessorInterface::STAGE_ALTER_ITEMS) as $processor) { - $processor->alterIndexedItems($items); - } - } - - /** - * {@inheritdoc} - */ - public function preprocessIndexItems(array $items) { - foreach ($this->getProcessorsByStage(ProcessorInterface::STAGE_PREPROCESS_INDEX) as $processor) { - $processor->preprocessIndexItems($items); - } - } - - /** - * {@inheritdoc} - */ - public function preprocessSearchQuery(QueryInterface $query) { - foreach ($this->getProcessorsByStage(ProcessorInterface::STAGE_PREPROCESS_QUERY) as $processor) { - $processor->preprocessSearchQuery($query); - } - } - - /** - * {@inheritdoc} - */ - public function postprocessSearchResults(ResultSetInterface $results) { - foreach ($this->getProcessorsByStage(ProcessorInterface::STAGE_POSTPROCESS_QUERY) as $processor) { - $processor->postprocessSearchResults($results); - } - } - - /** - * {@inheritdoc} - */ - public function addField(FieldInterface $field) { - $field_id = $field->getFieldIdentifier(); - $reserved = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->isFieldIdReserved($field_id); - if ($reserved) { - throw new SearchApiException("'$field_id' is a reserved value and cannot be used as the machine name of a normal field."); - } - - // This will automatically call getFields(), thus initializing - // $this->fieldInstances, if that hasn't been done yet. - $old_field = $this->getField($field_id); - if ($old_field && $old_field != $field) { - throw new SearchApiException("Cannot add field with machine name '$field_id': machine name is already taken."); - } - - $this->fieldInstances[$field_id] = $field; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function renameField($old_field_id, $new_field_id) { - if (!isset($this->getFields()[$old_field_id])) { - throw new SearchApiException("Could not rename field with machine name '$old_field_id': no such field."); - } - $reserved = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->isFieldIdReserved($new_field_id); - if ($reserved) { - throw new SearchApiException("'$new_field_id' is a reserved value and cannot be used as the machine name of a normal field."); - } - if (isset($this->getFields()[$new_field_id])) { - throw new SearchApiException("'$new_field_id' already exists and can't be used as a new field id."); - } - - $this->fieldInstances[$new_field_id] = $this->fieldInstances[$old_field_id]; - unset($this->fieldInstances[$old_field_id]); - $this->fieldInstances[$new_field_id]->setFieldIdentifier($new_field_id); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function removeField($field_id) { - $field = $this->getField($field_id); - if (!$field) { - return $this; - } - if ($field->isIndexedLocked()) { - throw new SearchApiException("Cannot remove field with machine name '$field_id': field is locked."); - } - - unset($this->fieldInstances[$field_id]); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setFields(array $fields) { - $this->fieldInstances = $fields; - } - - /** - * {@inheritdoc} - */ - public function getFields($include_server_defined = FALSE) { - if (!isset($this->fieldInstances)) { - $this->fieldInstances = []; - foreach ($this->field_settings as $key => $field_info) { - $this->fieldInstances[$key] = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->createField($this, $key, $field_info); - } - } - - $fields = $this->fieldInstances; - if ($include_server_defined && $this->hasValidServer()) { - $fields += $this->getServerInstance()->getBackendDefinedFields($this); - } - return $fields; - } - - /** - * {@inheritdoc} - */ - public function getField($field_id) { - $fields = $this->getFields(); - return isset($fields[$field_id]) ? $fields[$field_id] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getFieldsByDatasource($datasource_id) { - $datasource_fields = []; - foreach ($this->getFields() as $field_id => $field) { - if ($field->getDatasourceId() === $datasource_id) { - $datasource_fields[$field_id] = $field; - } - } - - return $datasource_fields; - } - - /** - * {@inheritdoc} - */ - public function getFulltextFields() { - $fulltext_fields = []; - foreach ($this->getFields() as $key => $field) { - if (\Drupal::getContainer() - ->get('search_api.data_type_helper') - ->isTextType($field->getType())) { - $fulltext_fields[] = $key; - } - } - return $fulltext_fields; - } - - /** - * {@inheritdoc} - */ - public function getFieldRenames() { - $renames = []; - foreach ($this->getFields() as $field_id => $field) { - if ($field->getOriginalFieldIdentifier() != $field_id) { - $renames[$field->getOriginalFieldIdentifier()] = $field_id; - } - } - return $renames; - } - - /** - * {@inheritdoc} - */ - public function discardFieldChanges() { - $this->fieldInstances = NULL; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPropertyDefinitions($datasource_id) { - if (!isset($this->properties[$datasource_id])) { - if (isset($datasource_id)) { - $datasource = $this->getDatasource($datasource_id); - $properties = $datasource->getPropertyDefinitions(); - } - else { - $datasource = NULL; - $properties = []; - } - - foreach ($this->getProcessorsByStage(ProcessorInterface::STAGE_ADD_PROPERTIES) as $processor) { - $properties += $processor->getPropertyDefinitions($datasource); - } - - $this->properties[$datasource_id] = $properties; - } - - return $this->properties[$datasource_id]; - } - - /** - * {@inheritdoc} - */ - public function loadItem($item_id) { - $items = $this->loadItemsMultiple([$item_id]); - return $items ? reset($items) : NULL; - } - - /** - * {@inheritdoc} - */ - public function loadItemsMultiple(array $item_ids) { - // Group the requested items by datasource. This will also later be used to - // determine whether all items were loaded successfully. - $items_by_datasource = []; - foreach ($item_ids as $item_id) { - list($datasource_id, $raw_id) = Utility::splitCombinedId($item_id); - $items_by_datasource[$datasource_id][$raw_id] = $item_id; - } - - // Load the items from the datasources and keep track of which were - // successfully retrieved. - $items = []; - foreach ($items_by_datasource as $datasource_id => $raw_ids) { - try { - $datasource = $this->getDatasource($datasource_id); - $datasource_items = $datasource->loadMultiple(array_keys($raw_ids)); - foreach ($datasource_items as $raw_id => $item) { - $id = $raw_ids[$raw_id]; - $items[$id] = $item; - // Remember that we successfully loaded this item. - unset($items_by_datasource[$datasource_id][$raw_id]); - } - } - catch (SearchApiException $e) { - $this->logException($e); - // If the complete datasource could not be loaded, don't report all its - // individual requested items as missing. - unset($items_by_datasource[$datasource_id]); - } - } - - // Check whether there are requested items that couldn't be loaded. - $items_by_datasource = array_filter($items_by_datasource); - if ($items_by_datasource) { - // Extract the second-level values of the two-dimensional array (that is, - // the combined item IDs) and log a warning reporting their absence. - $missing_ids = array_reduce(array_map('array_values', $items_by_datasource), 'array_merge', []); - $args['%index'] = $this->label(); - $args['@items'] = '"' . implode('", "', $missing_ids) . '"'; - $this->getLogger()->warning('Could not load the following items on index %index: @items.', $args); - // Also remove those items from tracking so we don't keep trying to load - // them. - foreach ($items_by_datasource as $datasource_id => $raw_ids) { - $this->trackItemsDeleted($datasource_id, array_keys($raw_ids)); - } - } - - // Return the loaded items. - return $items; - } - - /** - * {@inheritdoc} - */ - public function indexItems($limit = '-1', $datasource_id = NULL) { - if ($this->hasValidTracker() && !$this->isReadOnly()) { - $tracker = $this->getTrackerInstance(); - $next_set = $tracker->getRemainingItems($limit, $datasource_id); - if (!$next_set) { - return 0; - } - $items = $this->loadItemsMultiple($next_set); - if (!$items) { - return 0; - } - try { - return count($this->indexSpecificItems($items)); - } - catch (SearchApiException $e) { - $variables['%index'] = $this->label(); - $this->logException($e, '%type while trying to index items on index %index: @message in %function (line %line of %file)', $variables); - } - } - return 0; - } - - /** - * {@inheritdoc} - */ - public function indexSpecificItems(array $search_objects) { - if (!$search_objects || $this->read_only) { - return []; - } - if (!$this->status) { - $index_label = $this->label(); - throw new SearchApiException("Couldn't index values on index '$index_label' (index is disabled)"); - } - - /** @var \Drupal\search_api\Item\ItemInterface[] $items */ - $items = []; - foreach ($search_objects as $item_id => $object) { - $items[$item_id] = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->createItemFromObject($this, $object, $item_id); - } - - // Remember the items that were initially passed, to be able to determine - // the items rejected by alter hooks and processors afterwards. - $rejected_ids = array_keys($items); - $rejected_ids = array_combine($rejected_ids, $rejected_ids); - - // Preprocess the indexed items. - $this->alterIndexedItems($items); - \Drupal::moduleHandler()->alter('search_api_index_items', $this, $items); - foreach ($items as $item) { - // This will cache the extracted fields so processors, etc., can retrieve - // them directly. - $item->getFields(); - } - $this->preprocessIndexItems($items); - - // Remove all items still in $items from $rejected_ids. Thus, only the - // rejected items' IDs are still contained in $ret, to later be returned - // along with the successfully indexed ones. - foreach ($items as $item_id => $item) { - unset($rejected_ids[$item_id]); - } - - // Items that are rejected should also be deleted from the server. - if ($rejected_ids) { - $this->getServerInstance()->deleteItems($this, $rejected_ids); - } - - $indexed_ids = []; - if ($items) { - $indexed_ids = $this->getServerInstance()->indexItems($this, $items); - } - - // Return the IDs of all items that were either successfully indexed or - // rejected before being handed to the server. - $processed_ids = array_merge(array_values($rejected_ids), array_values($indexed_ids)); - - if ($processed_ids) { - if ($this->hasValidTracker()) { - $this->getTrackerInstance()->trackItemsIndexed($processed_ids); - } - // Since we've indexed items now, triggering reindexing would have some - // effect again. Therefore, we reset the flag. - $this->setHasReindexed(FALSE); - \Drupal::moduleHandler()->invokeAll('search_api_items_indexed', [$this, $processed_ids]); - - // Clear search api list caches. - Cache::invalidateTags(['search_api_list:' . $this->id]); - } - - return $processed_ids; - } - - /** - * {@inheritdoc} - */ - public function isBatchTracking() { - return (bool) $this->batchTracking; - } - - /** - * {@inheritdoc} - */ - public function startBatchTracking() { - $this->batchTracking++; - return $this; - } - - /** - * {@inheritdoc} - */ - public function stopBatchTracking() { - if (!$this->batchTracking) { - throw new SearchApiException('Trying to leave "batch tracking" mode on index "' . $this->label() . '" which was not entered first.'); - } - $this->batchTracking--; - return $this; - } - - /** - * {@inheritdoc} - */ - public function trackItemsInserted($datasource_id, array $ids) { - $this->trackItemsInsertedOrUpdated($datasource_id, $ids, __FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function trackItemsUpdated($datasource_id, array $ids) { - $this->trackItemsInsertedOrUpdated($datasource_id, $ids, __FUNCTION__); - } - - /** - * Tracks insertion or updating of items. - * - * Used as a helper method in trackItemsInserted() and trackItemsUpdated() to - * avoid code duplication. - * - * @param string $datasource_id - * The ID of the datasource to which the items belong. - * @param array $ids - * An array of datasource-specific item IDs. - * @param string $tracker_method - * The method to call on the tracker. Must be either "trackItemsInserted" or - * "trackItemsUpdated". - */ - protected function trackItemsInsertedOrUpdated($datasource_id, array $ids, $tracker_method) { - if ($this->hasValidTracker() && $this->status()) { - $item_ids = []; - foreach ($ids as $id) { - $item_ids[] = Utility::createCombinedId($datasource_id, $id); - } - $this->getTrackerInstance()->$tracker_method($item_ids); - if (!$this->isReadOnly() && $this->getOption('index_directly') && !$this->batchTracking) { - \Drupal::getContainer()->get('search_api.post_request_indexing') - ->registerIndexingOperation($this->id(), $item_ids); - } - } - } - - /** - * {@inheritdoc} - */ - public function trackItemsDeleted($datasource_id, array $ids) { - if (!$this->status()) { - return; - } - - $item_ids = []; - foreach ($ids as $id) { - $item_ids[] = Utility::createCombinedId($datasource_id, $id); - } - if ($this->hasValidTracker()) { - $this->getTrackerInstance()->trackItemsDeleted($item_ids); - } - if (!$this->isReadOnly() && $this->hasValidServer()) { - $this->getServerInstance()->deleteItems($this, $item_ids); - } - } - - /** - * {@inheritdoc} - */ - public function reindex() { - if ($this->status() && !$this->isReindexing()) { - $this->setHasReindexed(); - $this->getTrackerInstance()->trackAllItemsUpdated(); - \Drupal::moduleHandler()->invokeAll('search_api_index_reindex', [$this, FALSE]); - } - } - - /** - * {@inheritdoc} - */ - public function clear() { - if (!$this->status()) { - return; - } - - // Only invoke the hook if we actually did something. - $invoke_hook = FALSE; - if (!$this->isReindexing()) { - $invoke_hook = TRUE; - $this->setHasReindexed(); - $this->getTrackerInstance()->trackAllItemsUpdated(); - } - if (!$this->isReadOnly()) { - $invoke_hook = TRUE; - $this->getServerInstance()->deleteAllIndexItems($this); - } - if ($invoke_hook) { - \Drupal::moduleHandler() - ->invokeAll('search_api_index_reindex', [$this, !$this->isReadOnly()]); - } - } - - /** - * {@inheritdoc} - */ - public function rebuildTracker() { - if (!$this->status()) { - return; - } - - $index_task_manager = \Drupal::getContainer() - ->get('search_api.index_task_manager'); - $index_task_manager->stopTracking($this); - $index_task_manager->startTracking($this); - $this->setHasReindexed(); - \Drupal::moduleHandler() - ->invokeAll('search_api_index_reindex', [$this, FALSE]); - $index_task_manager->addItemsBatch($this); - } - - /** - * {@inheritdoc} - */ - public function isReindexing() { - $key = "search_api.index.{$this->id()}.has_reindexed"; - return \Drupal::state()->get($key, FALSE); - } - - /** - * Sets whether this index has all items marked for re-indexing. - * - * @param bool $has_reindexed - * (optional) TRUE if the index has all items marked for re-indexing, FALSE - * otherwise. - * - * @return $this - */ - protected function setHasReindexed($has_reindexed = TRUE) { - if ($this->isReindexing() !== $has_reindexed) { - $key = "search_api.index.{$this->id()}.has_reindexed"; - \Drupal::state()->set($key, $has_reindexed); - } - return $this; - } - - /** - * {@inheritdoc} - */ - public function query(array $options = []) { - if (!$this->status()) { - throw new SearchApiException('Cannot search on a disabled index.'); - } - return \Drupal::getContainer() - ->get('search_api.query_helper') - ->createQuery($this, $options); - } - - /** - * {@inheritdoc} - */ - public function postCreate(EntityStorageInterface $storage) { - parent::postCreate($storage); - - // Merge in default options. - $config = \Drupal::config('search_api.settings'); - $this->options += [ - 'cron_limit' => $config->get('default_cron_limit'), - 'index_directly' => TRUE, - ]; - } - - /** - * {@inheritdoc} - */ - public function preSave(EntityStorageInterface $storage) { - // If we are in the process of syncing, or in the process of installing - // configuration from an extension, we shouldn't change any entity - // properties (or other configuration). - if ($this->isSyncing() || $this->isInstallingFromExtension()) { - parent::preSave($storage); - return; - } - - // Retrieve active config overrides for this index. - $overrides = Utility::getConfigOverrides($this); - - // Prevent enabling of indexes when the server is disabled. Take into - // account that both the index's "status" and "server" properties might be - // overridden. - if ($this->status() && !isset($overrides['status'])) { - // NULL would be a valid override, so we can't use isset() here. - if (!array_key_exists('server', $overrides)) { - if (!$this->isServerEnabled()) { - $this->disable(); - } - } - else { - $server_id = $overrides['server']; - $server = $server_id !== NULL ? Server::load($server_id) : NULL; - if (!$server || !$server->status()) { - $this->disable(); - } - } - } - - // Merge in default options. - $config = \Drupal::config('search_api.settings'); - $this->options += [ - 'cron_limit' => $config->get('default_cron_limit'), - 'index_directly' => TRUE, - ]; - - // Reset the static cache for getPropertyDefinitions() to make sure we don't - // remove any fields just because of caching problems. - $this->properties = []; - foreach ($this->getFields() as $field_id => $field) { - // Remove all "locked" and "hidden" flags from all fields of the index. If - // they are still valid, they should be re-added by the processors. - $field->setIndexedLocked(FALSE); - $field->setTypeLocked(FALSE); - $field->setHidden(FALSE); - - // Also check whether the underlying property actually (still) exists. - $datasource_id = $field->getDatasourceId(); - $property = NULL; - if ($datasource_id === NULL || $this->isValidDatasource($datasource_id)) { - $properties = $this->getPropertyDefinitions($datasource_id); - $property = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->retrieveNestedProperty($properties, $field->getPropertyPath()); - } - if (!$property) { - $this->removeField($field_id); - } - } - - // Check whether all enabled processors actually still support this index. - // (Since we can't remove processors which are present in overrides anyways, - // we don't need to take overrides into account here.) - foreach ($this->getProcessors() as $processor_id => $processor) { - if (!$processor->supportsIndex($this)) { - $this->removeProcessor($processor_id); - } - } - - // Call the preIndexSave() method of all applicable processors. - $processor_overrides = !empty($overrides['processor_settings']) ? $overrides['processor_settings'] : []; - foreach ($this->getProcessorsByStage(ProcessorInterface::STAGE_PRE_INDEX_SAVE, $processor_overrides) as $processor) { - $processor->preIndexSave(); - } - - // Write the field and plugin settings to the persistent *_settings - // properties. - $this->writeChangesToSettings(); - - // Since we change dependency-relevant data in this method, we can only call - // the parent method at the end (or we'd need to re-calculate the - // dependencies). - parent::preSave($storage); - } - - /** - * Prepares for changes to this index to be persisted. - * - * To this end, the settings for all loaded field and plugin objects are - * written back to the corresponding *_settings properties. - * - * @return $this - */ - protected function writeChangesToSettings() { - // Calculate field dependencies and save field settings containing them. - $fields = $this->getFields(); - $field_dependencies = $this->getFieldDependencies(); - $field_dependencies += array_fill_keys(array_keys($fields), []); - $this->field_settings = []; - foreach ($fields as $field_id => $field) { - $field->setDependencies($field_dependencies[$field_id]); - $this->field_settings[$field_id] = $field->getSettings(); - } - - // Write the enabled processors to the settings property. - $processors = $this->getProcessors(); - $this->processor_settings = []; - foreach ($processors as $processor_id => $processor) { - $this->processor_settings[$processor_id] = $processor->getConfiguration(); - } - - // Write the tracker configuration to the settings property. - $tracker = $this->getTrackerInstance(); - $tracker_id = $tracker->getPluginId(); - $this->tracker_settings = [ - $tracker_id => $tracker->getConfiguration(), - ]; - - // Write the enabled datasources to the settings array. - $this->datasource_settings = []; - foreach ($this->getDatasources() as $plugin_id => $datasource) { - $this->datasource_settings[$plugin_id] = $datasource->getConfiguration(); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - parent::postSave($storage, $update); - - // New indexes don't have any items indexed. - if (!$update) { - $this->setHasReindexed(); - } - - try { - // Fake an original for inserts to make code cleaner. - /** @var \Drupal\search_api\IndexInterface $original */ - $original = $update ? $this->original : static::create(['status' => FALSE]); - $index_task_manager = \Drupal::getContainer() - ->get('search_api.index_task_manager'); - - if ($this->status() && $original->status()) { - // React on possible changes that would require re-indexing, etc. - $this->reactToServerSwitch($original); - $this->reactToDatasourceSwitch($original); - $this->reactToTrackerSwitch($original); - $this->reactToProcessorChanges($original); - } - elseif (!$this->status() && $original->status()) { - if ($this->hasValidTracker()) { - $index_task_manager->stopTracking($original); - } - if ($original->isServerEnabled()) { - $original->getServerInstance()->removeIndex($original); - } - } - elseif ($this->status() && !$original->status()) { - $this->getServerInstance()->addIndex($this); - if ($this->hasValidTracker()) { - $index_task_manager->startTracking($this); - } - } - - if (!$index_task_manager->isTrackingComplete($this)) { - // Give tests and site admins the possibility to disable the use of a - // batch for tracking items. Also, do not use a batch if running in the - // CLI. - $use_batch = \Drupal::state()->get('search_api_use_tracking_batch', TRUE); - if (!$use_batch || Utility::isRunningInCli()) { - $index_task_manager->addItemsAll($this); - } - else { - $index_task_manager->addItemsBatch($this); - } - } - - if (\Drupal::moduleHandler()->moduleExists('views')) { - Views::viewsData()->clear(); - // Remove this line when https://www.drupal.org/node/2370365 gets fixed. - Cache::invalidateTags(['extension:views']); - \Drupal::cache('discovery')->delete('views:wizard'); - } - - Cache::invalidateTags($this->getCacheTags()); - - $this->properties = []; - } - catch (SearchApiException $e) { - $this->logException($e); - } - } - - /** - * Checks whether the index switched server and reacts accordingly. - * - * Used as a helper method in postSave(). Should only be called when the index - * was enabled before the change and remained so. - * - * @param \Drupal\search_api\IndexInterface $original - * The previous version of the index. - */ - protected function reactToServerSwitch(IndexInterface $original) { - // Asserts that the index was enabled before saving and will still be - // enabled afterwards. Otherwise, this method should not be called. - assert($this->status() && $original->status(), '::reactToServerSwitch should only be called when the index is enabled'); - - if ($this->getServerId() != $original->getServerId()) { - if ($original->hasValidServer()) { - $original->getServerInstance()->removeIndex($this); - } - if ($this->hasValidServer()) { - $this->getServerInstance()->addIndex($this); - } - // When the server changes we also need to trigger a reindex. - $this->reindex(); - } - elseif ($this->hasValidServer()) { - // Tell the server the index configuration got updated. - $this->getServerInstance()->updateIndex($this); - } - } - - /** - * Checks whether the index's datasources changed and reacts accordingly. - * - * Used as a helper method in postSave(). Should only be called when the index - * was enabled before the change and remained so. - * - * @param \Drupal\search_api\IndexInterface $original - * The previous version of the index. - */ - protected function reactToDatasourceSwitch(IndexInterface $original) { - // Asserts that the index was enabled before saving and will still be - // enabled afterwards. Otherwise, this method should not be called. - assert($this->status() && $original->status(), '::reactToDatasourceSwitch should only be called when the index is enabled'); - - $new_datasource_ids = $this->getDatasourceIds(); - $original_datasource_ids = $original->getDatasourceIds(); - if ($new_datasource_ids != $original_datasource_ids) { - $added = array_diff($new_datasource_ids, $original_datasource_ids); - $removed = array_diff($original_datasource_ids, $new_datasource_ids); - $index_task_manager = \Drupal::getContainer()->get('search_api.index_task_manager'); - $index_task_manager->stopTracking($this, $removed); - if ($this->hasValidServer()) { - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $this->getServerInstance(); - foreach ($removed as $datasource_id) { - $server->deleteAllIndexItems($this, $datasource_id); - } - } - $index_task_manager->startTracking($this, $added); - } - } - - /** - * Checks whether the index switched tracker plugin and reacts accordingly. - * - * Used as a helper method in postSave(). Should only be called when the index - * was enabled before the change and remained so. - * - * @param \Drupal\search_api\IndexInterface $original - * The previous version of the index. - */ - protected function reactToTrackerSwitch(IndexInterface $original) { - // Asserts that the index was enabled before saving and will still be - // enabled afterwards. Otherwise, this method should not be called. - assert($this->status() && $original->status(), '::reactToTrackerSwitch should only be called when the index is enabled'); - - if ($this->getTrackerId() != $original->getTrackerId()) { - $index_task_manager = \Drupal::getContainer() - ->get('search_api.index_task_manager'); - if ($original->hasValidTracker()) { - $index_task_manager->stopTracking($original); - } - if ($this->hasValidTracker()) { - $index_task_manager->startTracking($this); - } - } - } - - /** - * Reacts to changes in processor configuration. - * - * @param \Drupal\search_api\IndexInterface $original - * The previous version of the index. - */ - protected function reactToProcessorChanges(IndexInterface $original) { - $old_processors = $original->getProcessors(); - $new_processors = $this->getProcessors(); - - $requires_reindex = FALSE; - - // Loop over all new settings and check if the processors were already set - // in the original entity. - foreach ($new_processors as $key => $processor) { - // The processor is new, because it wasn't configured in the original - // entity. - if (!isset($old_processors[$key])) { - if ($processor->requiresReindexing(NULL, $processor->getConfiguration())) { - $requires_reindex = TRUE; - break; - } - } - } - - if (!$requires_reindex) { - // Loop over all original settings and check if one of them has been - // removed or changed. - foreach ($old_processors as $key => $old_processor) { - $new_processor = isset($new_processors[$key]) ? $new_processors[$key] : NULL; - $old_config = $old_processor->getConfiguration(); - $new_config = $new_processor ? $new_processor->getConfiguration() : NULL; - if (!$new_processor || $old_config != $new_config) { - if ($old_processor->requiresReindexing($old_config, $new_config)) { - $requires_reindex = TRUE; - break; - } - } - } - } - - if ($requires_reindex) { - $this->reindex(); - } - } - - /** - * {@inheritdoc} - */ - public static function preDelete(EntityStorageInterface $storage, array $entities) { - parent::preDelete($storage, $entities); - - $index_task_manager = \Drupal::getContainer() - ->get('search_api.index_task_manager'); - /** @var \Drupal\search_api\IndexInterface[] $entities */ - foreach ($entities as $index) { - if ($index->status()) { - $index_task_manager->stopTracking($index); - if ($index->hasValidServer()) { - $index->getServerInstance()->removeIndex($index); - } - } - } - } - - /** - * {@inheritdoc} - */ - public static function postDelete(EntityStorageInterface $storage, array $entities) { - parent::postDelete($storage, $entities); - - if (\Drupal::moduleHandler()->moduleExists('views')) { - Views::viewsData()->clear(); - // Remove this line when https://www.drupal.org/node/2370365 gets fixed. - Cache::invalidateTags(['extension:views']); - \Drupal::cache('discovery')->delete('views:wizard'); - } - - /** @var \Drupal\Core\TempStore\SharedTempStore $temp_store */ - $temp_store = \Drupal::service('tempstore.shared')->get('search_api_index'); - foreach ($entities as $entity) { - try { - $temp_store->delete($entity->id()); - } - catch (TempStoreException $e) { - // Can't really be helped, I guess. But is also very unlikely to happen. - // Ignore it. - } - } - } - - // @todo Override static load() etc. methods? Measure performance difference. - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = $this->getDependencyData(); - // Keep only "enforced" dependencies, then add those computed by - // getDependencyData(). - $this->dependencies = array_intersect_key($this->dependencies, ['enforced' => TRUE]); - $this->dependencies += array_map('array_keys', $dependencies); - return $this; - } - - /** - * Retrieves data about this index's dependencies. - * - * The return value is structured as follows: - * - * @code - * [ - * 'config' => [ - * 'CONFIG_DEPENDENCY_KEY' => [ - * 'always' => [ - * 'processors' => [ - * 'PROCESSOR_ID' => $processor, - * ], - * 'datasources' => [ - * 'DATASOURCE_ID_1' => $datasource_1, - * 'DATASOURCE_ID_2' => $datasource_2, - * ], - * ], - * 'optional' => [ - * 'index' => [ - * 'INDEX_ID' => $index, - * ], - * 'tracker' => [ - * 'TRACKER_ID' => $tracker, - * ], - * ], - * ], - * ], - * ] - * @endcode - * - * Enforced dependencies are not included in this method's return value. - * - * @return object[][][][][] - * An associative array containing the index's dependencies. The array is - * first keyed by the config dependency type ("module", "config", etc.) and - * then by the names of the config dependencies of that type which the index - * has. The values are associative arrays with up to two keys, "always" and - * "optional", specifying whether the dependency is a hard one by the plugin - * (or index) in question or potentially depending on the configuration. The - * values on this level are arrays with keys "index", "tracker", - * "datasources" and/or "processors" and values arrays of IDs mapped to - * their entities/plugins. - */ - protected function getDependencyData() { - $dependency_data = []; - - // Since calculateDependencies() will work directly on the $dependencies - // property, we first save its original state and then restore it - // afterwards. - $original_dependencies = $this->dependencies; - parent::calculateDependencies(); - unset($this->dependencies['enforced']); - foreach ($this->dependencies as $dependency_type => $list) { - foreach ($list as $name) { - $dependency_data[$dependency_type][$name]['always']['index'][$this->id] = $this; - } - } - $this->dependencies = $original_dependencies; - - // Include the field dependencies. - $type_dependencies = []; - foreach ($this->getFields() as $field_id => $field) { - foreach ($field->getDependencies() as $dependency_type => $names) { - foreach ($names as $name) { - $dependency_data[$dependency_type][$name]['always']['fields'][$field_id] = $field; - } - } - - // Also take dependencies of the field's data type plugin into account. - // (Since data type plugins cannot have configuration, this will always be - // the same for a certain type, so we only have to compute this once per - // type.) - $type = $field->getType(); - if (!isset($type_dependencies[$type])) { - $type_dependencies[$type] = []; - $data_type = $field->getDataTypePlugin(); - if ($data_type && !$data_type->isDefault()) { - $definition = $data_type->getPluginDefinition(); - $type_dependencies[$type]['module'][] = $definition['provider']; - // Plugins can declare additional dependencies in their definition. - if (!empty($definition['config_dependencies'])) { - $type_dependencies[$type] = NestedArray::mergeDeep( - $type_dependencies[$type], - $definition['config_dependencies'] - ); - } - // If a plugin is dependent, calculate its dependencies. - if ($data_type instanceof DependentPluginInterface) { - $type_dependencies[$type] = NestedArray::mergeDeep( - $type_dependencies[$type], - $data_type->calculateDependencies() - ); - } - } - } - foreach ($type_dependencies[$type] as $dependency_type => $list) { - foreach ($list as $name) { - $dependency_data[$dependency_type][$name]['optional']['fields'][$field_id] = $field; - } - } - } - - // The server needs special treatment, since it is a dependency of the index - // itself, and not one of its plugins. - if ($this->hasValidServer()) { - $name = $this->getServerInstance()->getConfigDependencyName(); - $dependency_data['config'][$name]['optional']['index'][$this->id] = $this; - } - - // All other plugins can be treated uniformly. - $plugins = $this->getAllPlugins(); - - foreach ($plugins as $plugin_type => $type_plugins) { - foreach ($type_plugins as $plugin_id => $plugin) { - // Largely copied from - // \Drupal\Core\Plugin\PluginDependencyTrait::calculatePluginDependencies(). - $definition = $plugin->getPluginDefinition(); - - // First, always depend on the module providing the plugin. - $dependency_data['module'][$definition['provider']]['always'][$plugin_type][$plugin_id] = $plugin; - - // Plugins can declare additional dependencies in their definition. - if (isset($definition['config_dependencies'])) { - foreach ($definition['config_dependencies'] as $dependency_type => $list) { - foreach ($list as $name) { - $dependency_data[$dependency_type][$name]['always'][$plugin_type][$plugin_id] = $plugin; - } - } - } - - // Finally, add the dynamically-calculated dependencies of the plugin. - foreach ($plugin->calculateDependencies() as $dependency_type => $list) { - foreach ($list as $name) { - $dependency_data[$dependency_type][$name]['optional'][$plugin_type][$plugin_id] = $plugin; - } - } - } - } - - return $dependency_data; - } - - /** - * Retrieves information about the dependencies of the indexed fields. - * - * @return string[][][] - * An associative array containing the dependencies of the indexed fields. - * The array is keyed by field ID and dependency type, the values are arrays - * with dependency names. - */ - protected function getFieldDependencies() { - $field_dependencies = []; - - foreach ($this->getDatasources() as $datasource_id => $datasource) { - $fields = []; - foreach ($this->getFieldsByDatasource($datasource_id) as $field_id => $field) { - $fields[$field_id] = $field->getPropertyPath(); - } - $field_dependencies += $datasource->getFieldDependencies($fields); - } - - return $field_dependencies; - } - - /** - * {@inheritdoc} - */ - public function onDependencyRemoval(array $dependencies) { - $changed = parent::onDependencyRemoval($dependencies); - - $all_plugins = $this->getAllPlugins(); - $dependency_data = $this->getDependencyData(); - // Make sure our dependency data has the exact same keys as $dependencies, - // to simplify the subsequent code. - $dependencies = array_filter($dependencies); - $dependency_data = array_intersect_key($dependency_data, $dependencies); - $dependency_data += array_fill_keys(array_keys($dependencies), []); - $call_on_removal = []; - - foreach ($dependencies as $dependency_type => $dependency_objects) { - // Annoyingly, modules and theme dependencies come not keyed by dependency - // name here, while entities do. Flip the array for modules and themes to - // make the code simpler. - if (in_array($dependency_type, ['module', 'theme'])) { - $dependency_objects = array_flip($dependency_objects); - } - $dependency_data[$dependency_type] = array_intersect_key($dependency_data[$dependency_type], $dependency_objects); - foreach ($dependency_data[$dependency_type] as $name => $dependency_sources) { - // We first remove all the "hard" dependencies. - if (!empty($dependency_sources['always'])) { - foreach ($dependency_sources['always'] as $plugin_type => $plugins) { - // We can hardly remove the index itself. - if ($plugin_type == 'index') { - continue; - } - - // This will definitely lead to a change. - $changed = TRUE; - - if ($plugin_type == 'fields') { - // Remove a field from the index that is being removed from the - // system. - /** @var \Drupal\search_api\Item\FieldInterface $field */ - foreach ($plugins as $field_id => $field) { - // In case the field is locked, unlock it before removing. - if ($field->isIndexedLocked()) { - $field->setIndexedLocked(FALSE); - } - $this->removeField($field_id); - } - } - else { - // For all other types, just remove the plugin from our list. - $all_plugins[$plugin_type] = array_diff_key($all_plugins[$plugin_type], $plugins); - } - } - } - - // Then, collect all the optional ones. - if (!empty($dependency_sources['optional'])) { - // However this plays out, it will lead to a change. - $changed = TRUE; - - foreach ($dependency_sources['optional'] as $plugin_type => $plugins) { - // Deal with the index right away, since that dependency can only be - // the server. - if ($plugin_type == 'index') { - $this->setServer(NULL); - continue; - } - - // Fields can only have optional dependencies caused by their data - // type plugin. Reset to the fallback type. - if ($plugin_type == 'fields') { - foreach ($plugins as $field) { - $field->setType($field->getDataTypePlugin()->getFallbackType()); - } - continue; - } - - // Only include those plugins that have not already been removed. - $plugins = array_intersect_key($plugins, $all_plugins[$plugin_type]); - - foreach ($plugins as $plugin_id => $plugin) { - $call_on_removal[$plugin_type][$plugin_id][$dependency_type][$name] = $dependency_objects[$name]; - } - } - } - } - } - - // Now for all plugins with optional dependencies (stored in - // $call_on_removal, mapped to their removed dependencies) call their - // onDependencyRemoval() methods. - $updated_config = []; - foreach ($call_on_removal as $plugin_type => $plugins) { - foreach ($plugins as $plugin_id => $plugin_dependencies) { - $removal_successful = $all_plugins[$plugin_type][$plugin_id]->onDependencyRemoval($plugin_dependencies); - // If the plugin was successfully changed to remove the dependency, - // remember the new configuration to later set it. Otherwise, remove the - // plugin from the index so the dependency still gets removed. - if ($removal_successful) { - $updated_config[$plugin_type][$plugin_id] = $all_plugins[$plugin_type][$plugin_id]->getConfiguration(); - } - else { - unset($all_plugins[$plugin_type][$plugin_id]); - } - } - } - - // The handling of how we translate plugin changes back to the index varies - // according to plugin type, unfortunately. - // First, remove plugins that need to be removed. - $this->processor_settings = array_intersect_key($this->processor_settings, $all_plugins['processors']); - $this->processorInstances = array_intersect_key($this->processorInstances, $all_plugins['processors']); - - $this->datasource_settings = array_intersect_key($this->datasource_settings, $all_plugins['datasources']); - $this->datasourceInstances = array_intersect_key($this->datasourceInstances, $all_plugins['datasources']); - - // There always needs to be a tracker so reset it back to the default - // tracker. - if (empty($all_plugins['tracker'])) { - $default_tracker_id = \Drupal::config('search_api.settings') - ->get('default_tracker'); - - $this->tracker_settings = [ - $default_tracker_id => [], - ]; - // Reset $trackerInstance so it will get newly loaded from our reset - // settings when required. - $this->trackerInstance = NULL; - } - - // There also always needs to be a datasource, but here we have no easy way - // out – if we had to remove all datasources, the operation fails. Return - // FALSE to indicate this, which will cause the index to be deleted. - if (!$this->datasource_settings) { - return FALSE; - } - - // Then, update configuration as necessary. - foreach ($updated_config as $plugin_type => $plugin_configs) { - foreach ($plugin_configs as $plugin_id => $plugin_config) { - switch ($plugin_type) { - case 'processors': - $this->processor_settings[$plugin_id] = $plugin_config; - break; - - case 'datasources': - $this->datasource_settings[$plugin_id] = $plugin_config; - break; - - case 'tracker': - $this->tracker_settings[$plugin_id] = $plugin_config; - break; - - } - } - } - - return $changed; - } - - /** - * Retrieves all the plugins contained in this index. - * - * @return \Drupal\search_api\Plugin\IndexPluginInterface[][] - * All plugins contained in this index, keyed by their property on the index - * and their plugin ID. - */ - protected function getAllPlugins() { - $plugins = []; - - if ($this->hasValidTracker()) { - $plugins['tracker'][$this->getTrackerId()] = $this->getTrackerInstance(); - } - $plugins['processors'] = $this->getProcessors(); - $plugins['datasources'] = $this->getDatasources(); - - return $plugins; - } - - /** - * Implements the magic __sleep() method. - * - * Prevents the instantiated plugins and fields from being serialized. - */ - public function __sleep() { - // First, write our changes to the persistent *_settings properties so they - // won't be discarded. Make sure we have a container to do this. This is - // important to correctly display test failures. - if (\Drupal::hasContainer()) { - $this->writeChangesToSettings(); - } - - // Then, return a list of all properties that don't contain objects. - $properties = get_object_vars($this); - unset($properties['datasourceInstances']); - unset($properties['trackerInstance']); - unset($properties['serverInstance']); - unset($properties['processorInstances']); - unset($properties['fieldInstances']); - unset($properties['properties']); - return array_keys($properties); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Entity/InstallingTrait.php b/sites/all/modules/contrib/search/search_api/src/Entity/InstallingTrait.php deleted file mode 100644 index ab3e94c17..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Entity/InstallingTrait.php +++ /dev/null @@ -1,38 +0,0 @@ -isNew() && !empty($this->_core)); - } - - /** - * Determines whether the entity is new. - * - * Usually an entity is new if no ID exists for it yet. However, entities may - * be enforced to be new with existing IDs too. - * - * @return bool - * TRUE if the entity is new, or FALSE if the entity has already been saved. - * - * @see \Drupal\Core\Entity\EntityInterface::isNew() - */ - abstract public function isNew(); - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Entity/SearchApiConfigEntityStorage.php b/sites/all/modules/contrib/search/search_api/src/Entity/SearchApiConfigEntityStorage.php deleted file mode 100644 index 1505b084d..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Entity/SearchApiConfigEntityStorage.php +++ /dev/null @@ -1,70 +0,0 @@ -resetCache([$entity->id()]); - - // The entity is no longer new. - $entity->enforceIsNew(FALSE); - - $overridden_entity = $this->load($entity->id()); - if (isset($entity->original)) { - $overridden_entity->original = $entity->original; - - // In the case of indexes, we also need to clone the fields to allow the - // correct detection of renamed field. Conversely, we need to set the new, - // rename-free fields on the passed index ($entity) so a subsequent save - // won't false detect field renames. - if ($entity instanceof IndexInterface) { - /** @var \Drupal\search_api\IndexInterface $overridden_entity */ - $old_fields = $entity->original->getFields(); - $new_fields = $entity->getFields(); - $saved_fields = $overridden_entity->getFields(); - foreach ($entity->getFieldRenames() as $old_id => $new_id) { - if (!empty($old_fields[$old_id]) && !empty($saved_fields[$new_id])) { - $field = clone $new_fields[$new_id]; - $field->setIndex($overridden_entity); - $saved_fields[$new_id] = $field; - } - } - $overridden_entity->setFields($saved_fields); - } - } - - // Allow code to run after saving. - $overridden_entity->postSave($this, $update); - $this->invokeHook($update ? 'update' : 'insert', $overridden_entity); - - if ($entity instanceof IndexInterface) { - // Reset the field instances so saved renames won't be reported anymore. - $entity->discardFieldChanges(); - $overridden_entity->discardFieldChanges(); - } - - // After saving, this is now the "original entity", and subsequent saves - // will be updates instead of inserts, and updates must always be able to - // correctly identify the original entity. - $entity->setOriginalId($entity->id()); - $overridden_entity->setOriginalId($entity->id()); - - unset($entity->original); - unset($overridden_entity->original); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Entity/Server.php b/sites/all/modules/contrib/search/search_api/src/Entity/Server.php deleted file mode 100644 index 61e858eae..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Entity/Server.php +++ /dev/null @@ -1,625 +0,0 @@ -description; - } - - /** - * {@inheritdoc} - */ - public function hasValidBackend() { - $backend_plugin_definition = \Drupal::service('plugin.manager.search_api.backend')->getDefinition($this->getBackendId(), FALSE); - return !empty($backend_plugin_definition); - } - - /** - * {@inheritdoc} - */ - public function getBackendId() { - return $this->backend; - } - - /** - * {@inheritdoc} - */ - public function getBackend() { - if (!$this->backendPlugin) { - $backend_plugin_manager = \Drupal::service('plugin.manager.search_api.backend'); - $config = $this->backend_config; - $config['#server'] = $this; - if (!($this->backendPlugin = $backend_plugin_manager->createInstance($this->getBackendId(), $config))) { - $backend_id = $this->getBackendId(); - $label = $this->label(); - throw new SearchApiException("The backend with ID '$backend_id' could not be retrieved for server '$label'."); - } - } - return $this->backendPlugin; - } - - /** - * {@inheritdoc} - */ - public function getBackendConfig() { - return $this->backend_config; - } - - /** - * {@inheritdoc} - */ - public function setBackendConfig(array $backend_config) { - $this->backend_config = $backend_config; - $this->getBackend()->setConfiguration($backend_config); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getIndexes(array $properties = []) { - $storage = \Drupal::entityTypeManager()->getStorage('search_api_index'); - return $storage->loadByProperties(['server' => $this->id()] + $properties); - } - - /** - * {@inheritdoc} - */ - public function viewSettings() { - return $this->hasValidBackend() ? $this->getBackend()->viewSettings() : []; - } - - /** - * {@inheritdoc} - */ - public function isAvailable() { - return $this->hasValidBackend() ? $this->getBackend()->isAvailable() : FALSE; - } - - /** - * {@inheritdoc} - */ - public function supportsFeature($feature) { - return in_array($feature, $this->getSupportedFeatures()); - } - - /** - * {@inheritdoc} - */ - public function getSupportedFeatures() { - if (!isset($this->features)) { - $this->features = []; - if ($this->hasValidBackend()) { - $this->features = $this->getBackend()->getSupportedFeatures(); - } - \Drupal::moduleHandler() - ->alter('search_api_server_features', $this->features, $this); - } - - return $this->features; - } - - /** - * {@inheritdoc} - */ - public function supportsDataType($type) { - if ($this->hasValidBackend()) { - return $this->getBackend()->supportsDataType($type); - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getDiscouragedProcessors() { - if ($this->hasValidBackend()) { - return $this->getBackend()->getDiscouragedProcessors(); - } - return []; - } - - /** - * {@inheritdoc} - */ - public function getBackendDefinedFields(IndexInterface $index) { - if ($this->hasValidBackend()) { - return $this->getBackend()->getBackendDefinedFields($index); - } - return []; - } - - /** - * {@inheritdoc} - */ - public function addIndex(IndexInterface $index) { - $server_task_manager = \Drupal::getContainer()->get('search_api.server_task_manager'); - // When freshly adding an index to a server, it doesn't make any sense to - // execute possible other tasks for that server/index combination. - // (removeIndex() is implicit when adding an index which was already added.) - $server_task_manager->delete($this, $index); - - try { - if ($server_task_manager->execute($this)) { - $this->getBackend()->addIndex($index); - return; - } - } - catch (SearchApiException $e) { - $vars = [ - '%server' => $this->label(), - '%index' => $index->label(), - ]; - $this->logException($e, '%type while adding index %index to server %server: @message in %function (line %line of %file).', $vars); - } - - $task_manager = \Drupal::getContainer() - ->get('search_api.task_manager'); - $task_manager->addTask(__FUNCTION__, $this, $index); - } - - /** - * {@inheritdoc} - */ - public function updateIndex(IndexInterface $index) { - $server_task_manager = \Drupal::getContainer()->get('search_api.server_task_manager'); - try { - if ($server_task_manager->execute($this)) { - $this->getBackend()->updateIndex($index); - return; - } - } - catch (SearchApiException $e) { - $vars = [ - '%server' => $this->label(), - '%index' => $index->label(), - ]; - $this->logException($e, '%type while updating the fields of index %index on server %server: @message in %function (line %line of %file).', $vars); - } - - $task_manager = \Drupal::getContainer() - ->get('search_api.task_manager'); - $task_manager->addTask(__FUNCTION__, $this, $index, isset($index->original) ? $index->original : NULL); - } - - /** - * {@inheritdoc} - */ - public function removeIndex($index) { - $server_task_manager = \Drupal::getContainer()->get('search_api.server_task_manager'); - // When removing an index from a server, it doesn't make any sense anymore - // to delete items from it, or react to other changes. - $server_task_manager->delete($this, $index); - - try { - if ($server_task_manager->execute($this)) { - $this->getBackend()->removeIndex($index); - return; - } - } - catch (SearchApiException $e) { - $vars = [ - '%server' => $this->label(), - '%index' => is_object($index) ? $index->label() : $index, - ]; - $this->logException($e, '%type while removing index %index from server %server: @message in %function (line %line of %file).', $vars); - } - - $task_manager = \Drupal::getContainer() - ->get('search_api.task_manager'); - $data = NULL; - if (!is_object($index)) { - $data = $index; - $index = NULL; - } - $task_manager->addTask(__FUNCTION__, $this, $index, $data); - } - - /** - * {@inheritdoc} - */ - public function indexItems(IndexInterface $index, array $items) { - $server_task_manager = \Drupal::getContainer()->get('search_api.server_task_manager'); - if ($server_task_manager->execute($this)) { - return $this->getBackend()->indexItems($index, $items); - } - $index_label = $index->label(); - throw new SearchApiException("Could not index items on index '$index_label' because pending server tasks could not be executed."); - } - - /** - * {@inheritdoc} - */ - public function deleteItems(IndexInterface $index, array $item_ids) { - if ($index->isReadOnly()) { - $vars = [ - '%index' => $index->label(), - ]; - $this->getLogger()->warning('Trying to delete items from index %index which is marked as read-only.', $vars); - return; - } - - $server_task_manager = \Drupal::getContainer()->get('search_api.server_task_manager'); - try { - if ($server_task_manager->execute($this)) { - $this->getBackend()->deleteItems($index, $item_ids); - // Clear search api list caches. - Cache::invalidateTags(['search_api_list:' . $index->id()]); - return; - } - } - catch (SearchApiException $e) { - $vars = [ - '%server' => $this->label(), - ]; - $this->logException($e, '%type while deleting items from server %server: @message in %function (line %line of %file).', $vars); - } - - $task_manager = \Drupal::getContainer() - ->get('search_api.task_manager'); - $task_manager->addTask(__FUNCTION__, $this, $index, $item_ids); - } - - /** - * {@inheritdoc} - */ - public function deleteAllIndexItems(IndexInterface $index, $datasource_id = NULL) { - if ($index->isReadOnly()) { - $vars = [ - '%index' => $index->label(), - ]; - $this->getLogger()->warning('Trying to delete items from index %index which is marked as read-only.', $vars); - return; - } - - $server_task_manager = \Drupal::getContainer()->get('search_api.server_task_manager'); - - if (!$datasource_id) { - // If we're deleting all items of the index, there's no point in keeping - // any other "delete items" tasks. - $types = [ - 'deleteItems', - 'deleteAllIndexItems', - ]; - $server_task_manager->delete($this, $index, $types); - } - - try { - if ($server_task_manager->execute($this)) { - $this->getBackend()->deleteAllIndexItems($index, $datasource_id); - // Clear search api list caches. - Cache::invalidateTags(['search_api_list:' . $index->id()]); - return; - } - } - catch (SearchApiException $e) { - $vars = [ - '%server' => $this->label(), - '%index' => $index->label(), - ]; - $this->logException($e, '%type while deleting items of index %index from server %server: @message in %function (line %line of %file).', $vars); - } - - $task_manager = \Drupal::getContainer() - ->get('search_api.task_manager'); - $task_manager->addTask(__FUNCTION__, $this, $index, $datasource_id); - } - - /** - * {@inheritdoc} - */ - public function deleteAllItems() { - $failed = []; - $properties['status'] = TRUE; - $properties['read_only'] = FALSE; - foreach ($this->getIndexes($properties) as $index) { - try { - $this->getBackend()->deleteAllIndexItems($index); - Cache::invalidateTags(['search_api_list:' . $index->id()]); - } - catch (SearchApiException $e) { - $args = [ - '%index' => $index->label(), - ]; - $this->logException($e, '%type while deleting all items from index %index: @message in %function (line %line of %file).', $args); - $failed[] = $index->label(); - } - } - if (!empty($e)) { - $server_name = $this->label(); - $failed = implode(', ', $failed); - throw new SearchApiException("Deleting all items from server '$server_name' failed for the following (write-enabled) indexes: $failed.", 0, $e); - } - - $types = [ - 'deleteItems', - 'deleteAllIndexItems', - ]; - \Drupal::getContainer() - ->get('search_api.server_task_manager') - ->delete($this, NULL, $types); - } - - /** - * {@inheritdoc} - */ - public function search(QueryInterface $query) { - $this->getBackend()->search($query); - } - - /** - * {@inheritdoc} - */ - public function preSave(EntityStorageInterface $storage) { - parent::preSave($storage); - - // The rest of the code only applies to updates. - if (!isset($this->original)) { - return; - } - // Retrieve active config overrides for this server. - $overrides = Utility::getConfigOverrides($this); - - // If there are overrides for the backend or its configuration, attempt to - // apply them for the preUpdate() call. - if (isset($overrides['backend']) || isset($overrides['backend_config'])) { - $backend_config = $this->getBackendConfig(); - if (isset($overrides['backend_config'])) { - $backend_config = $overrides['backend_config']; - } - $backend_id = $this->getBackendId(); - if (isset($overrides['backend'])) { - $backend_id = $overrides['backend']; - } - $backend_plugin_manager = \Drupal::service('plugin.manager.search_api.backend'); - $backend_config['#server'] = $this; - if (!($backend = $backend_plugin_manager->createInstance($backend_id, $backend_config))) { - $label = $this->label(); - throw new SearchApiException("The backend with ID '$backend_id' could not be retrieved for server '$label'."); - } - } - else { - $backend = $this->getBackend(); - } - - $backend->preUpdate(); - - // If the server is being disabled, also disable all its indexes. - if (!$this->isSyncing() - && !$this->isInstallingFromExtension() - && !isset($overrides['status']) - && !$this->status() - && $this->original->status()) { - foreach ($this->getIndexes(['status' => TRUE]) as $index) { - /** @var \Drupal\search_api\IndexInterface $index */ - $index->setStatus(FALSE)->save(); - } - } - } - - /** - * {@inheritdoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - if ($this->hasValidBackend()) { - if ($update) { - $reindexing_necessary = $this->getBackend()->postUpdate(); - if ($reindexing_necessary) { - foreach ($this->getIndexes() as $index) { - $index->reindex(); - } - } - } - else { - $this->getBackend()->postInsert(); - } - } - } - - /** - * {@inheritdoc} - */ - public static function preDelete(EntityStorageInterface $storage, array $entities) { - // @todo This will, via Index::onDependencyRemoval(), remove all indexes - // from this server, triggering the server's removeIndex() method. This - // is, at best, wasted performance and could at worst lead to a bug if - // removeIndex() saves the server. We should try what happens when this is - // the case, whether there really is a bug, and try to fix it somehow – - // maybe clever detection of this case in removeIndex() or - // Index::postSave(). $server->isUninstalling() might help? - parent::preDelete($storage, $entities); - - // Iterate through the servers, executing the backends' preDelete() methods - // and removing all their pending server tasks. - foreach ($entities as $server) { - /** @var \Drupal\search_api\ServerInterface $server */ - if ($server->hasValidBackend()) { - $server->getBackend()->preDelete(); - } - \Drupal::getContainer()->get('search_api.server_task_manager')->delete($server); - } - } - - /** - * {@inheritdoc} - */ - public function toArray() { - // @todo It's a bug that we have to do this. Backend configuration should - // always be set via the server's setBackendConfiguration() method, - // otherwise the two can diverge causing this and other problems. The - // alternative would be to call $server->setBackendConfiguration() in the - // backend's setConfiguration() method and use a second $propagate - // parameter to avoid an infinite loop. Similar things go for the index's - // various plugins. Maybe using plugin bags is the solution here? - $properties = parent::toArray(); - if ($this->hasValidBackend()) { - $properties['backend_config'] = $this->getBackend()->getConfiguration(); - } - return $properties; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - parent::calculateDependencies(); - - // Add the backend's dependencies. - if ($this->hasValidBackend()) { - $this->calculatePluginDependencies($this->getBackend()); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function onDependencyRemoval(array $dependencies) { - $changed = parent::onDependencyRemoval($dependencies); - - if ($this->hasValidBackend()) { - $removed_backend_dependencies = []; - $backend = $this->getBackend(); - foreach ($backend->calculateDependencies() as $dependency_type => $list) { - if (isset($dependencies[$dependency_type])) { - $removed_backend_dependencies[$dependency_type] = array_intersect_key($dependencies[$dependency_type], array_flip($list)); - } - } - $removed_backend_dependencies = array_filter($removed_backend_dependencies); - if ($removed_backend_dependencies) { - if ($backend->onDependencyRemoval($removed_backend_dependencies)) { - $this->backend_config = $backend->getConfiguration(); - $changed = TRUE; - } - } - } - - return $changed; - } - - /** - * Implements the magic __clone() method. - * - * Prevents the backend plugin instance from being cloned. - */ - public function __clone() { - $this->backendPlugin = NULL; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Entity/Task.php b/sites/all/modules/contrib/search/search_api/src/Entity/Task.php deleted file mode 100644 index 09edc21d9..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Entity/Task.php +++ /dev/null @@ -1,184 +0,0 @@ -entityTypeManager ?: \Drupal::entityTypeManager(); - } - - /** - * {@inheritdoc} - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entityTypeManager) { - $this->entityTypeManager = $entityTypeManager; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getType() { - return $this->get('type')[0]->value; - } - - /** - * {@inheritdoc} - */ - public function getServerId() { - $field = $this->get('server_id')[0]; - return $field ? $field->value : NULL; - } - - /** - * {@inheritdoc} - */ - public function getServer() { - $server_id = $this->getServerId(); - if ($server_id && !isset($this->serverInstance)) { - $this->serverInstance = $this->getEntityTypeManager() - ->getStorage('search_api_server') - ->load($server_id); - if (!$this->serverInstance) { - $args['%server'] = $server_id; - throw new SearchApiException("Could not load server with ID '$server_id'."); - } - } - - return $this->serverInstance; - } - - /** - * {@inheritdoc} - */ - public function getIndexId() { - $field = $this->get('index_id')[0]; - return $field ? $field->value : NULL; - } - - /** - * {@inheritdoc} - */ - public function getIndex() { - $index_id = $this->getIndexId(); - if ($index_id && !isset($this->indexInstance)) { - $this->indexInstance = $this->getEntityTypeManager() - ->getStorage('search_api_index') - ->load($index_id); - if (!$this->indexInstance) { - throw new SearchApiException("Could not load index with ID '$index_id'."); - } - } - - return $this->indexInstance; - } - - /** - * {@inheritdoc} - */ - public function getData() { - if (!isset($this->unserializedData)) { - $data = $this->get('data')[0]; - if ($data) { - $this->unserializedData = unserialize($data->value); - if (!empty($this->unserializedData['#entity_type'])) { - $this->unserializedData = \Drupal::entityTypeManager() - ->getStorage($this->unserializedData['#entity_type']) - ->create($this->unserializedData['#values']); - } - } - } - - return $this->unserializedData; - } - - /** - * {@inheritdoc} - */ - public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { - /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ - $fields = parent::baseFieldDefinitions($entity_type); - - $fields['type'] = BaseFieldDefinition::create('string') - ->setLabel(t('Task type')) - ->setSetting('max_length', 50) - ->setRequired(TRUE) - ->setReadOnly(TRUE); - - $fields['server_id'] = BaseFieldDefinition::create('string') - ->setLabel(t('Server ID')) - ->setSetting('max_length', 50) - ->setReadOnly(TRUE); - - $fields['index_id'] = BaseFieldDefinition::create('string') - ->setLabel(t('Index ID')) - ->setSetting('max_length', 50) - ->setReadOnly(TRUE); - - $fields['data'] = BaseFieldDefinition::create('string_long') - ->setLabel(t('Task data')) - ->setReadOnly(TRUE); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/FacetsQueryTypeMappingInterface.php b/sites/all/modules/contrib/search/search_api/src/FacetsQueryTypeMappingInterface.php deleted file mode 100644 index ee6729430..000000000 --- a/sites/all/modules/contrib/search/search_api/src/FacetsQueryTypeMappingInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - $this->dateFormatter = $date_formatter; - $this->requestStack = $request_stack; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $entity_type_manager = $container->get('entity_type.manager'); - $renderer = $container->get('renderer'); - $date_formatter = $container->get('date.formatter'); - $request_stack = $container->get('request_stack'); - $messenger = $container->get('messenger'); - - return new static($entity_type_manager, $renderer, $date_formatter, $request_stack, $messenger); - } - - /** - * {@inheritdoc} - */ - public function getBaseFormId() { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'search_api_field_config'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $field = $this->getField(); - - if (!$field) { - $args['@id'] = $this->getRequest()->attributes->get('field_id'); - $form['message'] = [ - '#markup' => $this->t('Unknown field with ID "@id".', $args), - ]; - return $form; - } - - $args['%field'] = $field->getLabel(); - $form['#title'] = $this->t('Edit field %field', $args); - - if ($this->getRequest()->query->get('modal_redirect')) { - $form['title']['#markup'] = new FormattableMarkup('

        @title

        ', ['@title' => $form['#title']]); - Html::setIsAjax(TRUE); - } - - $this->formIdAttribute = Html::getUniqueId($this->getFormId()); - $form['#id'] = $this->formIdAttribute; - - $form['messages'] = [ - '#type' => 'status_messages', - ]; - - $property = $field->getDataDefinition(); - if (!($property instanceof ConfigurablePropertyInterface)) { - $args['%field'] = $field->getLabel(); - $form['message'] = [ - '#markup' => $this->t('Field %field is not configurable.', $args), - ]; - return $form; - } - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - - $field = $this->getField(); - /** @var \Drupal\search_api\Processor\ConfigurablePropertyInterface $property */ - $property = $field->getDataDefinition(); - - $form = $property->buildConfigurationForm($field, $form, $form_state); - - $this->checkEntityEditable($form, $this->entity); - - return $form; - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - unset($actions['delete']); - - if ($this->getRequest()->query->get('modal_redirect')) { - $actions['submit']['#ajax']['wrapper'] = $this->formIdAttribute; - } - else { - $actions['cancel'] = [ - '#type' => 'link', - '#title' => $this->t('Cancel'), - '#url' => $this->entity->toUrl('fields'), - ]; - } - - return $actions; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $field = $this->getField(); - /** @var \Drupal\search_api\Processor\ConfigurablePropertyInterface $property */ - $property = $field->getDataDefinition(); - $property->validateConfigurationForm($field, $form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $field = $this->getField(); - /** @var \Drupal\search_api\Processor\ConfigurablePropertyInterface $property */ - $property = $field->getDataDefinition(); - $property->submitConfigurationForm($field, $form, $form_state); - - $this->messenger->addStatus($this->t('The field configuration was successfully saved.')); - if ($this->getRequest()->query->get('modal_redirect')) { - $url = $this->entity->toUrl('add-fields-ajax') - ->setOption('query', [ - MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax', - ]); - $form_state->setRedirectUrl($url); - } - else { - $form_state->setRedirectUrl($this->entity->toUrl('fields')); - } - } - - /** - * {@inheritdoc} - */ - protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) { - // Our form structure doesn't emulate the entity structure, so copying those - // values wouldn't make any sense. - } - - /** - * Retrieves the field that is being edited. - * - * @return \Drupal\search_api\Item\FieldInterface|null - * The field, if it exists. - */ - protected function getField() { - if (!isset($this->field)) { - $field_id = $this->getRequest()->attributes->get('field_id'); - $this->field = $this->entity->getField($field_id); - } - - return $this->field; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexAddFieldsForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexAddFieldsForm.php deleted file mode 100644 index aa06680e3..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexAddFieldsForm.php +++ /dev/null @@ -1,498 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->fieldsHelper = $fields_helper; - $this->dataTypeHelper = $data_type_helper; - $this->renderer = $renderer; - $this->dateFormatter = $date_formatter; - $this->messenger = $messenger; - $this->parameters = $parameters; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $entity_type_manager = $container->get('entity_type.manager'); - $fields_helper = $container->get('search_api.fields_helper'); - $data_type_helper = $container->get('search_api.data_type_helper'); - $renderer = $container->get('renderer'); - $date_formatter = $container->get('date.formatter'); - $request_stack = $container->get('request_stack'); - $messenger = $container->get('messenger'); - $parameters = $request_stack->getCurrentRequest()->query->all(); - - return new static($entity_type_manager, $fields_helper, $data_type_helper, $renderer, $date_formatter, $messenger, $parameters); - } - - /** - * {@inheritdoc} - */ - public function getBaseFormId() { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'search_api_index_add_fields'; - } - - /** - * Retrieves a single page request parameter. - * - * @param string $name - * The name of the parameter. - * @param string|null $default - * The value to return if the parameter isn't present. - * - * @return string|null - * The parameter value. - */ - public function getParameter($name, $default = NULL) { - return isset($this->parameters[$name]) ? $this->parameters[$name] : $default; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $index = $this->entity; - - // Do not allow the form to be cached. See - // \Drupal\views_ui\ViewEditForm::form(). - $form_state->disableCache(); - - $this->checkEntityEditable($form, $index); - - $args['%index'] = $index->label(); - $form['#title'] = $this->t('Add fields to index %index', $args); - - $this->formIdAttribute = Html::getUniqueId($this->getFormId()); - $form['#id'] = $this->formIdAttribute; - - $form['messages'] = [ - '#type' => 'status_messages', - ]; - - $datasources = [ - '' => NULL, - ]; - $datasources += $this->entity->getDatasources(); - foreach ($datasources as $datasource_id => $datasource) { - $item = $this->getDatasourceListItem($datasource); - if ($item) { - $form['datasources']['datasource_' . $datasource_id] = $item; - } - } - - $form['actions'] = $this->actionsElement($form, $form_state); - - // Log any unmapped types that were encountered. - if ($this->unmappedFields) { - $unmapped_fields = []; - foreach ($this->unmappedFields as $type => $fields) { - foreach ($fields as $field) { - $unmapped_fields[] = new FormattableMarkup('@field (type "@type")', [ - '@field' => $field, - '@type' => $type, - ]); - } - } - $form['unmapped_types'] = [ - '#type' => 'details', - '#title' => $this->t('Skipped fields'), - 'fields' => [ - '#theme' => 'item_list', - '#items' => $unmapped_fields, - '#prefix' => $this->t('The following fields cannot be indexed since there is no type mapping for them:'), - '#suffix' => $this->t("If you think one of these fields should be available for indexing, please report this in the module's issue queue. (Make sure to first search for an existing issue for this field.) Please note that entity-valued fields generally can be indexed by either indexing their parent reference field, or their child entity ID field.", [':url' => Url::fromUri('https://www.drupal.org/project/issues/search_api')->toString()]), - ], - ]; - } - - return $form; - } - - /** - * Creates a list item for one datasource. - * - * @param \Drupal\search_api\Datasource\DatasourceInterface|null $datasource - * The datasource, or NULL for general properties. - * - * @return array - * A render array representing the given datasource and, possibly, its - * attached properties. - */ - protected function getDatasourceListItem(DatasourceInterface $datasource = NULL) { - $datasource_id = $datasource ? $datasource->getPluginId() : NULL; - $datasource_id_param = $datasource_id ?: ''; - $properties = $this->entity->getPropertyDefinitions($datasource_id); - if ($properties) { - $active_property_path = ''; - $active_datasource = $this->getParameter('datasource'); - if ($active_datasource !== NULL && $active_datasource == $datasource_id_param) { - $active_property_path = $this->getParameter('property_path', ''); - } - - $base_url = $this->entity->toUrl('add-fields'); - $base_url->setOption('query', ['datasource' => $datasource_id_param]); - - $item = $this->getPropertiesList($properties, $active_property_path, $base_url, $datasource_id); - $item['#title'] = $datasource ? $datasource->label() : $this->t('General'); - return $item; - } - - return NULL; - } - - /** - * Creates an items list for the given properties. - * - * @param \Drupal\Core\TypedData\DataDefinitionInterface[] $properties - * The property definitions, keyed by their property names. - * @param string $active_property_path - * The relative property path to the active property. - * @param \Drupal\Core\Url $base_url - * The base URL to which property path parameters should be added for - * the navigation links. - * @param string|null $datasource_id - * The datasource ID of the listed properties, or NULL for - * datasource-independent properties. - * @param string $parent_path - * (optional) The common property path prefix of the given properties. - * @param string $label_prefix - * (optional) The prefix to use for the labels of created fields. - * - * @return array - * A render array representing the given properties and, possibly, nested - * properties. - */ - protected function getPropertiesList(array $properties, $active_property_path, Url $base_url, $datasource_id, $parent_path = '', $label_prefix = '') { - $list = []; - - $active_item = ''; - if ($active_property_path) { - list($active_item, $active_property_path) = explode(':', $active_property_path, 2) + [1 => '']; - } - - $type_mapping = $this->dataTypeHelper->getFieldTypeMapping(); - - $query_base = $base_url->getOption('query'); - foreach ($properties as $key => $property) { - if ($property instanceof ProcessorPropertyInterface && $property->isHidden()) { - continue; - } - $this_path = $parent_path ? $parent_path . ':' : ''; - $this_path .= $key; - - $label = $property->getLabel(); - $property = $this->fieldsHelper->getInnerProperty($property); - - $can_be_indexed = TRUE; - $nested_properties = []; - $parent_child_type = NULL; - if ($property instanceof ComplexDataDefinitionInterface) { - $can_be_indexed = FALSE; - $nested_properties = $this->fieldsHelper->getNestedProperties($property); - $main_property = $property->getMainPropertyName(); - if ($main_property && isset($nested_properties[$main_property])) { - $parent_child_type = $property->getDataType() . '.'; - $property = $nested_properties[$main_property]; - $parent_child_type .= $property->getDataType(); - unset($nested_properties[$main_property]); - $can_be_indexed = TRUE; - } - - // Don't add the additional "entity" property for entity reference - // fields which don't target a content entity type. - if (isset($nested_properties['entity'])) { - $entity_property = $nested_properties['entity']; - if ($entity_property instanceof DataReferenceDefinitionInterface) { - $target = $entity_property->getTargetDefinition(); - if ($target instanceof EntityDataDefinitionInterface) { - if (!$this->fieldsHelper->isContentEntityType($target->getEntityTypeId())) { - unset($nested_properties['entity']); - } - } - } - } - } - - // Don't allow indexing of properties with unmapped types. Also, prefer - // a "parent.child" type mapping (taking into account the parent property - // for, for example, text fields). - $type = $property->getDataType(); - if ($parent_child_type && !empty($type_mapping[$parent_child_type])) { - $type = $parent_child_type; - } - elseif (empty($type_mapping[$type])) { - // Remember the type only if it was not explicitly mapped to FALSE. - if (!isset($type_mapping[$type])) { - $this->unmappedFields[$type][] = $label_prefix . $label; - } - $can_be_indexed = FALSE; - } - - // If the property can neither be expanded nor indexed, just skip it. - if (!($nested_properties || $can_be_indexed)) { - continue; - } - - $item = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['container-inline'], - ], - ]; - - $nested_list = []; - if ($nested_properties) { - if ($key == $active_item) { - $link_url = clone $base_url; - $query_base['property_path'] = $parent_path; - $link_url->setOption('query', $query_base); - $item['expand_link'] = [ - '#type' => 'link', - '#title' => '(-) ', - '#url' => $link_url, - '#ajax' => [ - 'wrapper' => $this->formIdAttribute, - ], - ]; - - $nested_list = $this->getPropertiesList($nested_properties, $active_property_path, $base_url, $datasource_id, $this_path, $label_prefix . $label . ' » '); - } - else { - $link_url = clone $base_url; - $query_base['property_path'] = $this_path; - $link_url->setOption('query', $query_base); - $item['expand_link'] = [ - '#type' => 'link', - '#title' => '(+) ', - '#url' => $link_url, - '#ajax' => [ - 'wrapper' => $this->formIdAttribute, - ], - ]; - } - } - - $label_markup = Html::escape($label); - $escaped_path = Html::escape($this_path); - $label_markup = "$label_markup ($escaped_path)"; - $item['label']['#markup'] = $label_markup . ' '; - - if ($can_be_indexed) { - $item['add'] = [ - '#type' => 'submit', - '#name' => Utility::createCombinedId($datasource_id, $this_path), - '#value' => $this->t('Add'), - '#submit' => ['::addField', '::save'], - '#property' => $property, - '#prefixed_label' => $label_prefix . $label, - '#data_type' => $type_mapping[$type], - '#ajax' => [ - 'wrapper' => $this->formIdAttribute, - ], - ]; - } - - if ($nested_list) { - $item['properties'] = $nested_list; - } - - $list[$key] = $item; - } - - if ($list) { - uasort($list, [static::class, 'compareFieldLabels']); - $list['#theme'] = 'search_api_form_item_list'; - } - - return $list; - } - - /** - * Compares labels of property render arrays. - * - * Used as an uasort() callback in - * \Drupal\search_api\Form\IndexAddFieldsForm::getPropertiesList(). - * - * @param array $a - * First property render array. - * @param array $b - * Second property render array. - * - * @return int - * -1, 0 or 1 if the first array should be considered, respectively, less - * than, equal to or greater than the second. - */ - public static function compareFieldLabels(array $a, array $b) { - $a_title = (string) $a['label']['#markup']; - $b_title = (string) $b['label']['#markup']; - - return strnatcasecmp($a_title, $b_title); - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - return [ - 'done' => [ - '#type' => 'link', - '#title' => $this->t('Done'), - '#url' => $this->entity->toUrl('fields'), - '#attributes' => [ - 'class' => ['button'], - ], - ], - ]; - } - - /** - * Form submission handler for adding a new field to the index. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function addField(array $form, FormStateInterface $form_state) { - $button = $form_state->getTriggeringElement(); - if (!$button) { - return; - } - - /** @var \Drupal\Core\TypedData\DataDefinitionInterface $property */ - $property = $button['#property']; - - list($datasource_id, $property_path) = Utility::splitCombinedId($button['#name']); - $field = $this->fieldsHelper->createFieldFromProperty($this->entity, $property, $datasource_id, $property_path, NULL, $button['#data_type']); - $field->setLabel($button['#prefixed_label']); - $this->entity->addField($field); - - if ($property instanceof ConfigurablePropertyInterface) { - $parameters = [ - 'search_api_index' => $this->entity->id(), - 'field_id' => $field->getFieldIdentifier(), - ]; - $options = []; - $route = $this->getRequest()->attributes->get('_route'); - if ($route === 'entity.search_api_index.add_fields_ajax') { - $options['query'] = [ - MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax', - 'modal_redirect' => 1, - ]; - } - $form_state->setRedirect('entity.search_api_index.field_config', $parameters, $options); - } - - $args['%label'] = $field->getLabel(); - $this->messenger->addStatus($this->t('Field %label was added to the index.', $args)); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexBreakLockForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexBreakLockForm.php deleted file mode 100644 index 66e942ee9..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexBreakLockForm.php +++ /dev/null @@ -1,138 +0,0 @@ -tempStore = $temp_store_factory->get('search_api_index'); - $this->entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $temp_store_factory = $container->get('tempstore.shared'); - $entity_type_manager = $container->get('entity_type.manager'); - $renderer = $container->get('renderer'); - $messenger = $container->get('messenger'); - - return new static($temp_store_factory, $entity_type_manager, $renderer, $messenger); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'search_api_index_break_lock_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Do you want to break the lock on search index %name?', ['%name' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - $locked = $this->tempStore->getMetadata($this->entity->id()); - $account = $this->entityTypeManager->getStorage('user')->load($locked->owner); - $username = [ - '#theme' => 'username', - '#account' => $account, - ]; - return $this->t('By breaking this lock, any unsaved changes made by @user will be lost.', ['@user' => $this->renderer->render($username)]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return $this->entity->toUrl('fields'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Break lock'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - if (!$this->tempStore->getMetadata($this->entity->id())) { - $form['message']['#markup'] = $this->t('There is no lock on search index %name to break.', ['%name' => $this->entity->id()]); - return $form; - } - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->tempStore->delete($this->entity->id()); - $form_state->setRedirectUrl($this->entity->toUrl('fields')); - $this->messenger->addStatus($this->t('The lock has been broken. You may now edit this search index.')); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexClearConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexClearConfirmForm.php deleted file mode 100644 index 5c497d190..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexClearConfirmForm.php +++ /dev/null @@ -1,74 +0,0 @@ -setMessenger($container->get('messenger')); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to clear the indexed data for the search index %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('All indexed data for this index will be deleted from the search server. Searches on this index will not return any results until items are reindexed. This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_index.canonical', ['search_api_index' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - - try { - $index->clear(); - $this->messenger() - ->addStatus($this->t('All items were successfully deleted from search index %name.', ['%name' => $index->label()])); - } - catch (SearchApiException $e) { - $this->messenger->addError($this->t('Failed to clear the search index %name.', ['%name' => $index->label()])); - $message = '%type while trying to clear the index %name: @message in %function (line %line of %file)'; - $variables = [ - '%name' => $index->label(), - ]; - $variables += Error::decodeException($e); - $this->getLogger('search_api')->error($message, $variables); - } - - $form_state->setRedirect('entity.search_api_index.canonical', ['search_api_index' => $index->id()]); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexDeleteConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexDeleteConfirmForm.php deleted file mode 100644 index 99fd8fa25..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexDeleteConfirmForm.php +++ /dev/null @@ -1,72 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to delete the search index %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_index.canonical', ['search_api_index' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - $this->messenger->addStatus($this->t('The search index %name has been removed.', ['%name' => $this->entity->label()])); - $form_state->setRedirect('search_api.overview'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexDisableConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexDisableConfirmForm.php deleted file mode 100644 index ad00bde2c..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexDisableConfirmForm.php +++ /dev/null @@ -1,82 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to disable the search index %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Searches on this index will stop working. Indexed data will be deleted from the server and will need to be reindexed when the index is enabled again.'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_index.canonical', ['search_api_index' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Disable'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\IndexInterface $entity */ - $entity = $this->entity; - - $entity->setStatus(FALSE)->save(); - $this->messenger->addStatus($this->t('The search index %name has been disabled.', ['%name' => $this->entity->label()])); - $form_state->setRedirect('search_api.overview'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexFieldsForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexFieldsForm.php deleted file mode 100644 index 9e17f9ae5..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexFieldsForm.php +++ /dev/null @@ -1,520 +0,0 @@ -tempStore = $temp_store_factory->get('search_api_index'); - $this->entityTypeManager = $entity_type_manager; - $this->dataTypePluginManager = $data_type_plugin_manager; - $this->renderer = $renderer; - $this->dateFormatter = $date_formatter; - $this->dataTypeHelper = $data_type_helper; - $this->fieldsHelper = $fields_helper; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $temp_store_factory = $container->get('tempstore.shared'); - $entity_type_manager = $container->get('entity_type.manager'); - $data_type_plugin_manager = $container->get('plugin.manager.search_api.data_type'); - $renderer = $container->get('renderer'); - $date_formatter = $container->get('date.formatter'); - $data_type_helper = $container->get('search_api.data_type_helper'); - $fields_helper = $container->get('search_api.fields_helper'); - $messenger = $container->get('messenger'); - - return new static($temp_store_factory, $entity_type_manager, $data_type_plugin_manager, $renderer, $date_formatter, $data_type_helper, $fields_helper, $messenger); - } - - /** - * {@inheritdoc} - */ - public function getBaseFormId() { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'search_api_index_fields'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; - - $index = $this->entity; - - // Do not allow the form to be cached. See - // \Drupal\views_ui\ViewEditForm::form(). - $form_state->disableCache(); - - $this->checkEntityEditable($form, $index, TRUE); - - // Set an appropriate page title. - $form['#title'] = $this->t('Manage fields for search index %label', ['%label' => $index->label()]); - $form['#tree'] = TRUE; - - $form['add-field'] = [ - '#type' => 'link', - '#title' => $this->t('Add fields'), - '#url' => $this->entity->toUrl('add-fields'), - '#attributes' => [ - 'class' => [ - 'use-ajax', - 'button', - 'button-action', - 'button--primary', - 'button--small', - ], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ]; - - $form['description']['#markup'] = $this->t('

        The data type of a field determines how it can be used for searching and filtering. The boost is used to give additional weight to certain fields, for example titles or tags.

        For information about the data types available for indexing, see the data types table at the bottom of the page.

        ', [':url' => '#search-api-data-types-table']); - - if ($fields = $index->getFieldsByDatasource(NULL)) { - $form['_general'] = $this->buildFieldsTable($fields); - $form['_general']['#title'] = $this->t('General'); - } - - foreach ($index->getDatasources() as $datasource_id => $datasource) { - $fields = $index->getFieldsByDatasource($datasource_id); - $form[$datasource_id] = $this->buildFieldsTable($fields); - $form[$datasource_id]['#title'] = $datasource->label(); - } - - // Build the data type table. - $instances = $this->dataTypePluginManager->getInstances(); - $fallback_mapping = $this->dataTypeHelper - ->getDataTypeFallbackMapping($index); - - $data_types = []; - foreach ($instances as $name => $type) { - if ($type->isHidden()) { - continue; - } - $data_types[$name] = [ - 'label' => $type->label(), - 'description' => $type->getDescription(), - 'fallback' => $type->getFallbackType(), - ]; - } - - $form['data_type_explanation'] = [ - '#type' => 'details', - '#id' => 'search-api-data-types-table', - '#title' => $this->t('Data types'), - '#description' => $this->t("The data types which can be used for indexing fields in this index. Whether a type is supported depends on the backend of the index's server. If a type is not supported, the fallback type that will be used instead is shown, too."), - '#theme' => 'search_api_admin_data_type_table', - '#data_types' => $data_types, - '#fallback_mapping' => $fallback_mapping, - ]; - - $form['actions'] = $this->actionsElement($form, $form_state); - - return $form; - } - - /** - * Builds the form fields for a set of fields. - * - * @param \Drupal\search_api\Item\FieldInterface[] $fields - * List of fields to display. - * - * @return array - * The build structure. - */ - protected function buildFieldsTable(array $fields) { - $fallback_types = $this->dataTypeHelper - ->getDataTypeFallbackMapping($this->entity); - - // If one of the unsupported types is actually used by the index, show a - // warning. - if ($fallback_types) { - foreach ($fields as $field) { - if (isset($fallback_types[$field->getType()])) { - $args = [':url' => '#search-api-data-types-table']; - $warning = $this->t("Some of the used data types aren't supported by the server's backend. See the data types table to find out which types are supported.", $args); - $this->messenger->addWarning($warning); - break; - } - } - } - - $types = []; - $fulltext_types = [ - [ - 'value' => 'text', - ], - ]; - // Add all data types with fallback "text" to fulltext types as well. - foreach ($this->dataTypePluginManager->getInstances() as $type_id => $type) { - if (!$type->isHidden()) { - $types[$type_id] = $type->label(); - } - if ($type->getFallbackType() == 'text') { - $fulltext_types[] = [ - 'value' => $type_id, - ]; - } - } - - $boost_values = [ - '0.0', - '0.1', - '0.2', - '0.3', - '0.5', - '0.8', - '1.0', - '2.0', - '3.0', - '5.0', - '8.0', - '13.0', - '21.0', - ]; - $boosts = array_combine($boost_values, $boost_values); - - $build = [ - '#type' => 'details', - '#open' => TRUE, - '#theme' => 'search_api_admin_fields_table', - '#parents' => [], - '#header' => [ - $this->t('Label'), - $this->t('Machine name'), - [ - 'data' => $this->t('Property path'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - $this->t('Type'), - $this->t('Boost'), - [ - 'data' => $this->t('Operations'), - 'colspan' => 2, - ], - ], - ]; - - uasort($fields, [$this->fieldsHelper, 'compareFieldLabels']); - foreach ($fields as $key => $field) { - $build['fields'][$key]['#access'] = !$field->isHidden(); - - $build['fields'][$key]['title'] = [ - '#type' => 'textfield', - '#default_value' => $field->getLabel() ? $field->getLabel() : $key, - '#required' => TRUE, - '#size' => 40, - ]; - $build['fields'][$key]['id'] = [ - '#type' => 'textfield', - '#default_value' => $key, - '#required' => TRUE, - '#size' => 35, - ]; - $build['fields'][$key]['property_path'] = [ - '#markup' => Html::escape($field->getPropertyPath()), - ]; - - if ($field->getDescription()) { - $build['fields'][$key]['description'] = [ - '#type' => 'value', - '#value' => $field->getDescription(), - ]; - } - - $build['fields'][$key]['type'] = [ - '#type' => 'select', - '#options' => $types, - '#default_value' => $field->getType(), - ]; - if ($field->isTypeLocked()) { - $build['fields'][$key]['type']['#disabled'] = TRUE; - } - - $build['fields'][$key]['boost'] = [ - '#type' => 'select', - '#options' => $boosts, - '#default_value' => sprintf('%.1f', $field->getBoost()), - '#states' => [ - 'visible' => [ - ':input[name="fields[' . $key . '][type]"]' => $fulltext_types, - ], - ], - ]; - - $route_parameters = [ - 'search_api_index' => $this->entity->id(), - 'field_id' => $key, - ]; - // Provide some invisible markup as default, if a link is missing, so we - // don't break the table structure. (theme_search_api_admin_fields_table() - // does not add empty cells.) - $build['fields'][$key]['edit']['#markup'] = ''; - try { - if ($field->getDataDefinition() instanceof ConfigurablePropertyInterface) { - $build['fields'][$key]['edit'] = [ - '#type' => 'link', - '#title' => $this->t('Edit'), - '#url' => Url::fromRoute('entity.search_api_index.field_config', $route_parameters), - '#attributes' => [ - 'class' => [ - 'use-ajax', - ], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], - ]; - } - } - catch (SearchApiException $e) { - // Could not retrieve data definition. Since this almost certainly means - // that the property isn't configurable, we can just ignore it here. - } - $build['fields'][$key]['remove']['#markup'] = ''; - if (!$field->isIndexedLocked()) { - $build['fields'][$key]['remove'] = [ - '#type' => 'link', - '#title' => $this->t('Remove'), - '#url' => Url::fromRoute('entity.search_api_index.remove_field', $route_parameters), - '#attributes' => [ - 'class' => ['use-ajax'], - ], - ]; - } - } - - return $build; - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = [ - 'submit' => [ - '#type' => 'submit', - '#value' => $this->t('Save changes'), - '#button_type' => 'primary', - '#submit' => ['::submitForm', '::save'], - ], - ]; - if ($this->entity instanceof UnsavedConfigurationInterface && $this->entity->hasChanges()) { - $actions['cancel'] = [ - '#type' => 'submit', - '#value' => $this->t('Cancel'), - '#button_type' => 'danger', - '#submit' => ['::cancel'], - ]; - } - return $actions; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $field_values = $form_state->getValues()['fields']; - $new_ids = []; - - foreach ($field_values as $field_id => $field) { - $new_id = $field['id']; - $new_ids[$new_id][] = $field_id; - - // Check for reserved and other illegal field IDs. - if ($this->fieldsHelper->isFieldIdReserved($new_id)) { - $args = [ - '%field_id' => $new_id, - ]; - $error = $this->t('%field_id is a reserved value and cannot be used as the machine name of a normal field.', $args); - $form_state->setErrorByName('fields][' . $field_id . '][id', $error); - } - elseif (preg_match('/^_+$/', $new_id)) { - $error = $this->t('Field IDs have to contain non-underscore characters.'); - $form_state->setErrorByName('fields][' . $field_id . '][id', $error); - } - elseif (preg_match('/[^a-z0-9_]/', $new_id)) { - $error = $this->t('Field IDs must contain only lowercase letters, numbers and underscores.'); - $form_state->setErrorByName('fields][' . $field_id . '][id', $error); - } - } - - // Identify duplicates. - $has_duplicates = function (array $old_ids) { - return count($old_ids) > 1; - }; - foreach (array_filter($new_ids, $has_duplicates) as $new_id => $old_ids) { - $args['%field_id'] = $new_id; - $error = $this->t('Field ID %field_id is used multiple times. Field IDs must be unique.', $args); - foreach ($old_ids as $field_id) { - $form_state->setErrorByName('fields][' . $field_id . '][id', $error); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $index = $this->entity; - - // Store the fields configuration. - $fields = $index->getFields(); - $field_values = $form_state->getValue('fields', []); - $new_fields = []; - foreach ($field_values as $field_id => $new_settings) { - if (!isset($fields[$field_id])) { - $args['%field_id'] = $field_id; - $this->messenger->addWarning($this->t('The field with ID %field_id does not exist anymore.', $args)); - continue; - } - $field = $fields[$field_id]; - $field->setLabel($new_settings['title']); - $field->setType($new_settings['type']); - $field->setBoost($new_settings['boost']); - $field->setFieldIdentifier($new_settings['id']); - - $new_fields[$new_settings['id']] = $field; - } - - $index->setFields($new_fields); - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $index = $this->entity; - if ($index instanceof UnsavedConfigurationInterface) { - $index->savePermanent(); - } - else { - $index->save(); - } - - $this->messenger->addStatus($this->t('The changes were successfully saved.')); - if ($this->entity->isReindexing()) { - $url = $this->entity->toUrl('canonical'); - $this->messenger->addStatus($this->t('All content was scheduled for reindexing so the new settings can take effect.', [':url' => $url->toString()])); - } - - return SAVED_UPDATED; - } - - /** - * Cancels the editing of the index's fields. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function cancel(array &$form, FormStateInterface $form_state) { - if ($this->entity instanceof UnsavedConfigurationInterface && $this->entity->hasChanges()) { - $this->entity->discardChanges(); - } - - $form_state->setRedirectUrl($this->entity->toUrl('canonical')); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexForm.php deleted file mode 100644 index 5615fd994..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexForm.php +++ /dev/null @@ -1,641 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->pluginHelper = $plugin_helper; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $entity_type_manager = $container->get('entity_type.manager'); - $plugin_helper = $container->get('search_api.plugin_helper'); - $messenger = $container->get('messenger'); - - return new static($entity_type_manager, $plugin_helper, $messenger); - } - - /** - * Retrieves all available servers as an options list. - * - * @return string[] - * An associative array mapping server IDs to their labels. - */ - protected function getServerOptions() { - $options = []; - /** @var \Drupal\search_api\ServerInterface[] $servers */ - $servers = $this->entityTypeManager - ->getStorage('search_api_server') - ->loadMultiple(); - foreach ($servers as $server_id => $server) { - // @todo Special formatting for disabled servers. - $options[$server_id] = Utility::escapeHtml($server->label()); - } - return $options; - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - // If the form is being rebuilt, rebuild the entity with the current form - // values. - if ($form_state->isRebuilding()) { - // When the form is being built for an AJAX response the ID is not present - // in $form_state. To ensure our entity is always valid, we're adding the - // ID back. - if (!$this->entity->isNew()) { - $form_state->setValue('id', $this->entity->id()); - } - $this->entity = $this->buildEntity($form, $form_state); - } - - $form = parent::form($form, $form_state); - - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - if ($index->isNew()) { - $form['#title'] = $this->t('Add search index'); - } - else { - $arguments = ['%label' => $index->label()]; - $form['#title'] = $this->t('Edit search index %label', $arguments); - } - - $this->buildEntityForm($form, $form_state, $index); - - return $form; - } - - /** - * Builds the form for the basic index properties. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * @param \Drupal\search_api\IndexInterface $index - * The index that is being created or edited. - */ - public function buildEntityForm(array &$form, FormStateInterface $form_state, IndexInterface $index) { - $form['#tree'] = TRUE; - $form['name'] = [ - '#type' => 'textfield', - '#title' => $this->t('Index name'), - '#description' => $this->t('Enter the displayed name for the index.'), - '#default_value' => $index->label(), - '#required' => TRUE, - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => $index->isNew() ? NULL : $index->id(), - '#maxlength' => 50, - '#required' => TRUE, - '#machine_name' => [ - 'exists' => '\Drupal\search_api\Entity\Index::load', - 'source' => ['name'], - ], - '#disabled' => !$index->isNew(), - ]; - - $form['#attached']['library'][] = 'search_api/drupal.search_api.admin_css'; - - $form['datasources'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Data sources'), - '#description' => $this->t('Select one or more data sources of items that will be stored in this index.'), - '#default_value' => $index->getDatasourceIds(), - '#multiple' => TRUE, - '#required' => TRUE, - '#attributes' => ['class' => ['search-api-checkboxes-list']], - '#ajax' => [ - 'trigger_as' => ['name' => 'datasources_configure'], - 'callback' => '::buildAjaxDatasourceConfigForm', - 'wrapper' => 'search-api-datasources-config-form', - 'method' => 'replace', - 'effect' => 'fade', - ], - ]; - $datasource_options = []; - foreach ($this->pluginHelper->createDatasourcePlugins($index) as $datasource_id => $datasource) { - if ($datasource->isHidden()) { - continue; - } - $datasource_options[$datasource_id] = Utility::escapeHtml($datasource->label()); - $form['datasources'][$datasource_id]['#description'] = Utility::escapeHtml($datasource->getDescription()); - } - asort($datasource_options, SORT_NATURAL | SORT_FLAG_CASE); - $form['datasources']['#options'] = $datasource_options; - - $form['datasource_configs'] = [ - '#type' => 'container', - '#attributes' => [ - 'id' => 'search-api-datasources-config-form', - ], - '#tree' => TRUE, - ]; - - $form['datasource_configure_button'] = [ - '#type' => 'submit', - '#name' => 'datasources_configure', - '#value' => $this->t('Configure'), - '#limit_validation_errors' => [['datasources']], - '#submit' => ['::submitAjaxDatasourceConfigForm'], - '#ajax' => [ - 'callback' => '::buildAjaxDatasourceConfigForm', - 'wrapper' => 'search-api-datasources-config-form', - ], - '#attributes' => ['class' => ['js-hide']], - ]; - - $this->buildDatasourcesConfigForm($form, $form_state, $index); - - $form['tracker'] = [ - '#type' => 'radios', - '#title' => $this->t('Tracker'), - '#description' => $this->t('Select the type of tracker which should be used for keeping track of item changes.'), - '#default_value' => $index->getTrackerId(), - '#required' => TRUE, - '#ajax' => [ - 'trigger_as' => ['name' => 'tracker_configure'], - 'callback' => '::buildAjaxTrackerConfigForm', - 'wrapper' => 'search-api-tracker-config-form', - 'method' => 'replace', - 'effect' => 'fade', - ], - ]; - $tracker_options = []; - foreach ($this->pluginHelper->createTrackerPlugins($index) as $tracker_id => $tracker) { - if ($tracker->isHidden()) { - continue; - } - $tracker_options[$tracker_id] = Utility::escapeHtml($tracker->label()); - $form['tracker'][$tracker_id]['#description'] = Utility::escapeHtml($tracker->getDescription()); - } - asort($tracker_options, SORT_NATURAL | SORT_FLAG_CASE); - $form['tracker']['#options'] = $tracker_options; - $form['tracker']['#access'] = !$index->hasValidTracker() || count($tracker_options) > 1; - - $form['tracker_config'] = [ - '#type' => 'container', - '#attributes' => [ - 'id' => 'search-api-tracker-config-form', - ], - '#tree' => TRUE, - ]; - - $form['tracker_configure_button'] = [ - '#type' => 'submit', - '#name' => 'tracker_configure', - '#value' => $this->t('Configure'), - '#limit_validation_errors' => [['tracker']], - '#submit' => ['::submitAjaxTrackerConfigForm'], - '#ajax' => [ - 'callback' => '::buildAjaxTrackerConfigForm', - 'wrapper' => 'search-api-tracker-config-form', - ], - '#attributes' => ['class' => ['js-hide']], - '#access' => count($tracker_options) > 1, - ]; - - $this->buildTrackerConfigForm($form, $form_state, $index); - - $form['server'] = [ - '#type' => 'radios', - '#title' => $this->t('Server'), - '#description' => $this->t('Select the server this index should use. Indexes cannot be enabled without a connection to a valid, enabled server.'), - '#options' => ['' => '' . $this->t('- No server -') . ''] + $this->getServerOptions(), - '#default_value' => $index->hasValidServer() ? $index->getServerId() : '', - ]; - - $form['status'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enabled'), - '#description' => $this->t('Only enabled indexes can be used for indexing and searching. This setting will only take effect if the selected server is also enabled.'), - '#default_value' => $index->status(), - // Can't enable an index lying on a disabled server or no server at all. - '#disabled' => !$index->status() && (!$index->hasValidServer() || !$index->getServerInstance()->status()), - // @todo This doesn't seem to work and should also hide for disabled - // servers. If that works, we can probably remove the last sentence of - // the description. - '#states' => [ - 'invisible' => [ - ':input[name="server"]' => ['value' => ''], - ], - ], - ]; - - $form['description'] = [ - '#type' => 'textarea', - '#title' => $this->t('Description'), - '#description' => $this->t('Enter a description for the index.'), - '#default_value' => $index->getDescription(), - ]; - - $form['options'] = [ - '#tree' => TRUE, - '#type' => 'details', - '#title' => $this->t('Index options'), - '#collapsed' => TRUE, - ]; - - // We display the "read-only" flag along with the other options, even though - // it is a property directly on the index object. We use "#parents" to move - // it to the correct place in the form values. - $form['options']['read_only'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Read only'), - '#description' => $this->t('Do not write to this index or track the status of items in this index.'), - '#default_value' => $index->isReadOnly(), - '#parents' => ['read_only'], - ]; - $form['options']['index_directly'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Index items immediately'), - '#description' => $this->t('Immediately index new or updated items instead of waiting for the next cron run. This might have serious performance drawbacks and is generally not advised for larger sites.'), - '#default_value' => $index->getOption('index_directly'), - ]; - $form['options']['cron_limit'] = [ - '#type' => 'textfield', - '#title' => $this->t('Cron batch size'), - '#description' => $this->t('Set how many items will be indexed at once when indexing items during a cron run. "0" means that no items will be indexed by cron for this index, "-1" means that cron should index all items at once.'), - '#default_value' => $index->getOption('cron_limit'), - '#size' => 4, - ]; - } - - /** - * Builds the configuration forms for all selected datasources. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * @param \Drupal\search_api\IndexInterface $index - * The index being created or edited. - */ - public function buildDatasourcesConfigForm(array &$form, FormStateInterface $form_state, IndexInterface $index) { - $selected_datasources = $form_state->getValue('datasources'); - if ($selected_datasources === NULL) { - // Initial form build, use the saved datasources (or none for new - // indexes). - $datasources = $index->getDatasources(); - } - else { - // The form is being rebuilt – use the datasources selected by the user - // instead of the ones saved in the config. - $datasources = $this->pluginHelper->createDatasourcePlugins($index, $selected_datasources); - } - $form_state->set('datasources', array_keys($datasources)); - - $show_message = FALSE; - foreach ($datasources as $datasource_id => $datasource) { - if ($datasource instanceof PluginFormInterface) { - // Get the "sub-form state" and appropriate form part to send to - // buildConfigurationForm(). - $datasource_form = []; - if (!empty($form['datasource_configs'][$datasource_id])) { - $datasource_form = $form['datasource_configs'][$datasource_id]; - } - $datasource_form_state = SubformState::createForSubform($datasource_form, $form, $form_state); - $form['datasource_configs'][$datasource_id] = $datasource->buildConfigurationForm($datasource_form, $datasource_form_state); - - $show_message = TRUE; - $form['datasource_configs'][$datasource_id]['#type'] = 'details'; - $form['datasource_configs'][$datasource_id]['#title'] = $this->t('Configure the %datasource datasource', ['%datasource' => $datasource->label()]); - $form['datasource_configs'][$datasource_id]['#open'] = $index->isNew(); - } - } - - // If the user changed the datasources and there is at least one datasource - // config form, show a message telling the user to configure it. - if ($selected_datasources && $show_message) { - $this->messenger->addWarning($this->t('Please configure the used datasources.')); - } - } - - /** - * Builds the tracker configuration form. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * @param \Drupal\search_api\IndexInterface $index - * The index being created or edited. - */ - public function buildTrackerConfigForm(array &$form, FormStateInterface $form_state, IndexInterface $index) { - $selected_tracker = $form_state->getValue('tracker'); - if ($selected_tracker === NULL || $selected_tracker == $index->getTrackerId()) { - // Initial form build, use the saved tracker (or none for new indexes). - if ($index->hasValidTracker()) { - $tracker = $index->getTrackerInstance(); - } - // Only notify the user of a missing tracker plugin if we're editing an - // existing index. - elseif (!$index->isNew()) { - $this->messenger->addError($this->t('The tracker plugin is missing or invalid.')); - } - } - else { - // Probably an AJAX rebuild of the form – use the tracker selected by - // the user. - $tracker = $this->pluginHelper->createTrackerPlugin($index, $selected_tracker); - } - - if (empty($tracker)) { - return; - } - - $form_state->set('tracker', $tracker->getPluginId()); - - if ($tracker instanceof PluginFormInterface) { - // Get the "sub-form state" and appropriate form part to send to - // buildConfigurationForm(). - $tracker_form = !empty($form['tracker_config']) ? $form['tracker_config'] : []; - $tracker_form_state = SubformState::createForSubform($tracker_form, $form, $form_state); - $form['tracker_config'] = $tracker->buildConfigurationForm($tracker_form, $tracker_form_state); - - $form['tracker_config']['#type'] = 'details'; - $form['tracker_config']['#title'] = $this->t('Configure the %plugin tracker', ['%plugin' => $tracker->label()]); - $form['tracker_config']['#description'] = Utility::escapeHtml($tracker->getDescription()); - $form['tracker_config']['#open'] = $index->isNew(); - - // If the user changed the tracker and the new one has a config form, show - // a message telling the user to configure it. - if ($selected_tracker && $selected_tracker != $tracker->getPluginId()) { - $this->messenger->addWarning($this->t('Please configure the used tracker.')); - } - } - } - - /** - * Form submission handler for buildEntityForm(). - * - * Takes care of changes in the selected datasources. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - */ - public function submitAjaxDatasourceConfigForm(array $form, FormStateInterface $form_state) { - $form_state->setValue('id', NULL); - $form_state->setRebuild(); - } - - /** - * Handles changes to the selected datasources. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * - * @return array - * The part of the form to return as AJAX. - */ - public function buildAjaxDatasourceConfigForm(array $form, FormStateInterface $form_state) { - return $form['datasource_configs']; - } - - /** - * Form submission handler for buildEntityForm(). - * - * Takes care of changes in the selected tracker plugin. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - */ - public function submitAjaxTrackerConfigForm(array $form, FormStateInterface $form_state) { - $form_state->setValue('id', NULL); - $form_state->setRebuild(); - } - - /** - * Handles switching the selected tracker plugin. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * - * @return array - * The part of the form to return as AJAX. - */ - public function buildAjaxTrackerConfigForm(array $form, FormStateInterface $form_state) { - return $form['tracker_config']; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - - $storage = $this->entityTypeManager->getStorage('search_api_index'); - if (!$index->isNew()) { - $this->originalEntity = $storage->loadUnchanged($index->id()); - } - if (empty($this->originalEntity)) { - $this->originalEntity = $storage->create(['status' => FALSE]); - } - - // Store the array of datasource plugin IDs with integer keys. - $datasource_ids = array_values(array_filter($form_state->getValue('datasources', []))); - $form_state->setValue('datasources', $datasource_ids); - - // Call validateConfigurationForm() for each enabled datasource with a form. - $datasources = $this->pluginHelper->createDatasourcePlugins($index, $datasource_ids); - $previous_datasources = $form_state->get('datasources'); - foreach ($datasources as $datasource_id => $datasource) { - if ($datasource instanceof PluginFormInterface) { - if (!in_array($datasource_id, $previous_datasources)) { - $form_state->setRebuild(); - continue; - } - $datasource_form = &$form['datasource_configs'][$datasource_id]; - $datasource_form_state = SubformState::createForSubform($datasource_form, $form, $form_state); - $datasource->validateConfigurationForm($datasource_form, $datasource_form_state); - } - } - - // Call validateConfigurationForm() for the (possibly new) tracker, if it - // has not changed and if it has a form. - $tracker_id = $form_state->getValue('tracker', NULL); - if ($tracker_id == $form_state->get('tracker')) { - $tracker = $this->pluginHelper->createTrackerPlugin($index, $tracker_id); - if ($tracker instanceof PluginFormInterface) { - $tracker_form_state = SubformState::createForSubform($form['tracker_config'], $form, $form_state); - $tracker->validateConfigurationForm($form['tracker_config'], $tracker_form_state); - } - } - else { - $tracker = $this->pluginHelper->createTrackerPlugin($this->originalEntity, $tracker_id); - if ($tracker instanceof PluginFormInterface) { - $form_state->setRebuild(); - } - } - } - - /** - * {@inheritdoc} - */ - public function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - - if ($this->getEntity()->isNew()) { - $actions['save_edit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save and add fields'), - '#submit' => $actions['submit']['#submit'], - '#button_type' => 'primary', - // Work around for submit callbacks after save() not being called due to - // batch operations. - '#redirect_to_url' => 'add-fields', - ]; - } - - return $actions; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); - - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - $index->setOptions($form_state->getValue('options', []) + $this->originalEntity->getOptions()); - - $datasource_ids = $form_state->getValue('datasources', []); - $datasources = $this->pluginHelper->createDatasourcePlugins($index, $datasource_ids); - foreach ($datasources as $datasource_id => $datasource) { - if ($datasource instanceof PluginFormInterface) { - $datasource_form_state = SubformState::createForSubform($form['datasource_configs'][$datasource_id], $form, $form_state); - $datasource->submitConfigurationForm($form['datasource_configs'][$datasource_id], $datasource_form_state); - } - } - $index->setDatasources($datasources); - - // Call submitConfigurationForm() for the (possibly new) tracker, if it - // has not changed and if it has a form. - $tracker_id = $form_state->getValue('tracker', NULL); - $tracker = $this->pluginHelper->createTrackerPlugin($index, $tracker_id); - if ($tracker_id == $form_state->get('tracker')) { - if ($tracker instanceof PluginFormInterface) { - $tracker_form_state = SubformState::createForSubform($form['tracker_config'], $form, $form_state); - $tracker->submitConfigurationForm($form['tracker_config'], $tracker_form_state); - } - } - /** @var \Drupal\search_api\Tracker\TrackerInterface $tracker */ - $index->setTracker($tracker); - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - // @todo Redirect to a confirm form if changing server or tracker, since - // that isn't such a light operation (equaling a "clear", basically). - // Only save the index if the form doesn't need to be rebuilt. - if (!$form_state->isRebuilding()) { - try { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - $index->save(); - $this->messenger->addStatus($this->t('The index was successfully saved.')); - $button = $form_state->getTriggeringElement(); - if (!empty($button['#redirect_to_url'])) { - $form_state->setRedirectUrl($index->toUrl($button['#redirect_to_url'])); - } - else { - $form_state->setRedirect('entity.search_api_index.canonical', ['search_api_index' => $index->id()]); - } - } - catch (EntityStorageException $e) { - $form_state->setRebuild(); - - $message = '%type: @message in %function (line %line of %file).'; - $variables = Error::decodeException($e); - $this->getLogger('search_api')->error($message, $variables); - - $this->messenger->addError($this->t('The index could not be saved.')); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexProcessorsForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexProcessorsForm.php deleted file mode 100644 index bb2b7a7d2..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexProcessorsForm.php +++ /dev/null @@ -1,392 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->processorPluginManager = $processor_plugin_manager; - $this->logger = $logger; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $entity_type_manager = $container->get('entity_type.manager'); - $processor_plugin_manager = $container->get('plugin.manager.search_api.processor'); - $logger = $container->get('logger.channel.search_api'); - $messenger = $container->get('messenger'); - - return new static($entity_type_manager, $processor_plugin_manager, $logger, $messenger); - } - - /** - * {@inheritdoc} - */ - public function getBaseFormId() { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form['#attached']['library'][] = 'search_api/drupal.search_api.admin_css'; - - // Retrieve lists of all processors, and the stages and weights they have. - if (!$form_state->has('processors')) { - $all_processors = $this->getAllProcessors(); - $sort_processors = function (ProcessorInterface $a, ProcessorInterface $b) { - return strnatcasecmp($a->label(), $b->label()); - }; - uasort($all_processors, $sort_processors); - $form_state->set('processors', $all_processors); - } - else { - $all_processors = $form_state->get('processors'); - } - - $stages = $this->processorPluginManager->getProcessingStages(); - /** @var \Drupal\search_api\Processor\ProcessorInterface[][] $processors_by_stage */ - $processors_by_stage = []; - foreach ($all_processors as $processor_id => $processor) { - foreach ($stages as $stage => $definition) { - if ($processor->supportsStage($stage)) { - $processors_by_stage[$stage][$processor_id] = $processor; - } - } - } - - $enabled_processors = $this->entity->getProcessors(); - - $backend_discouraged_processors = []; - if ($this->entity->getServerInstance()) { - $backend_discouraged_processors = $this->entity->getServerInstance() - ->getDiscouragedProcessors(); - - foreach ($backend_discouraged_processors as $processor_id) { - if (!isset($enabled_processors[$processor_id])) { - // Remove processors from the overview. - unset($all_processors[$processor_id]); - - // Remove processors from the stages. - foreach ($processors_by_stage as $stage => $processors) { - unset($processors_by_stage[$stage][$processor_id]); - } - } - } - } - - $form['#tree'] = TRUE; - $form['#attached']['library'][] = 'search_api/drupal.search_api.processors'; - $form['#title'] = $this->t('Manage processors for search index %label', ['%label' => $this->entity->label()]); - $form['description']['#markup'] = '

        ' . $this->t('Configure processors which will pre- and post-process data at index and search time.') . '

        '; - - // Add the list of processors with checkboxes to enable/disable them. - $form['status'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Enabled'), - '#attributes' => [ - 'class' => [ - 'search-api-status-wrapper', - ], - ], - ]; - foreach ($all_processors as $processor_id => $processor) { - $clean_css_id = Html::cleanCssIdentifier($processor_id); - $form['status'][$processor_id] = [ - '#type' => 'checkbox', - '#title' => $processor->label(), - '#default_value' => $processor->isLocked() || !empty($enabled_processors[$processor_id]), - '#description' => $processor->getDescription(), - '#attributes' => [ - 'class' => [ - 'search-api-processor-status-' . $clean_css_id, - ], - 'data-id' => $clean_css_id, - ], - '#disabled' => $processor->isLocked(), - '#access' => !$processor->isHidden(), - ]; - if (in_array($processor_id, $backend_discouraged_processors)) { - $form['status'][$processor_id]['#description'] .= '
        ' . $this->t('It is recommended not to use this processor with the selected server.') . ''; - } - } - - $form['weights'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Processor order'), - ]; - // Order enabled processors per stage. - foreach ($stages as $stage => $description) { - $form['weights'][$stage] = [ - '#type' => 'fieldset', - '#title' => $description['label'], - '#attributes' => [ - 'class' => [ - 'search-api-stage-wrapper', - 'search-api-stage-wrapper-' . Html::cleanCssIdentifier($stage), - ], - ], - ]; - $form['weights'][$stage]['order'] = [ - '#type' => 'table', - ]; - $form['weights'][$stage]['order']['#tabledrag'][] = [ - 'action' => 'order', - 'relationship' => 'sibling', - 'group' => 'search-api-processor-weight-' . Html::cleanCssIdentifier($stage), - ]; - } - foreach ($processors_by_stage as $stage => $processors) { - // Sort the processors by weight for this stage. - $processor_weights = []; - foreach ($processors as $processor_id => $processor) { - $processor_weights[$processor_id] = $processor->getWeight($stage); - } - asort($processor_weights); - - foreach ($processor_weights as $processor_id => $weight) { - $processor = $processors[$processor_id]; - if ($processor->isHidden()) { - $form['processors'][$processor_id]['weights'][$stage] = [ - '#type' => 'value', - '#value' => $weight, - ]; - continue; - } - $form['weights'][$stage]['order'][$processor_id]['#attributes']['class'][] = 'draggable'; - $form['weights'][$stage]['order'][$processor_id]['#attributes']['class'][] = 'search-api-processor-weight--' . Html::cleanCssIdentifier($processor_id); - $form['weights'][$stage]['order'][$processor_id]['#weight'] = $weight; - $form['weights'][$stage]['order'][$processor_id]['label']['#plain_text'] = $processor->label(); - $form['weights'][$stage]['order'][$processor_id]['weight'] = [ - '#type' => 'weight', - '#title' => $this->t('Weight for processor %title', ['%title' => $processor->label()]), - '#title_display' => 'invisible', - '#delta' => 50, - '#default_value' => $weight, - '#parents' => ['processors', $processor_id, 'weights', $stage], - '#attributes' => [ - 'class' => [ - 'search-api-processor-weight-' . Html::cleanCssIdentifier($stage), - ], - ], - ]; - } - } - - // Add vertical tabs containing the settings for the processors. Tabs for - // disabled processors are hidden with JS magic, but need to be included in - // case the processor is enabled. - $form['processor_settings'] = [ - '#title' => $this->t('Processor settings'), - '#type' => 'vertical_tabs', - ]; - - foreach ($all_processors as $processor_id => $processor) { - if ($processor instanceof PluginFormInterface) { - $form['settings'][$processor_id] = [ - '#type' => 'details', - '#title' => $processor->label(), - '#group' => 'processor_settings', - '#parents' => ['processors', $processor_id, 'settings'], - '#attributes' => [ - 'class' => [ - 'search-api-processor-settings-' . Html::cleanCssIdentifier($processor_id), - ], - ], - ]; - $processor_form_state = SubformState::createForSubform($form['settings'][$processor_id], $form, $form_state); - $form['settings'][$processor_id] += $processor->buildConfigurationForm($form['settings'][$processor_id], $processor_form_state); - } - else { - unset($form['settings'][$processor_id]); - } - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - $values = $form_state->getValues(); - $processors = $this->getAllProcessors(); - - // Iterate over all processors that have a form and are enabled. - foreach (array_keys(array_filter($values['status'])) as $processor_id) { - $processor = $processors[$processor_id]; - if ($processor instanceof PluginFormInterface) { - $processor_form_state = SubformState::createForSubform($form['settings'][$processor_id], $form, $form_state); - $processor->validateConfigurationForm($form['settings'][$processor_id], $processor_form_state); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $old_processors = $this->entity->getProcessors(); - - // Store processor settings. - $processors = $this->getAllProcessors(); - foreach ($processors as $processor_id => $processor) { - if (empty($values['status'][$processor_id])) { - if (isset($old_processors[$processor_id])) { - $this->entity->removeProcessor($processor_id); - $form_state->set('processors_changed', TRUE); - } - continue; - } - $old_configuration = $processor->getConfiguration(); - if ($processor instanceof PluginFormInterface) { - $processor_form_state = SubformState::createForSubform($form['settings'][$processor_id], $form, $form_state); - $processor->submitConfigurationForm($form['settings'][$processor_id], $processor_form_state); - } - if (!empty($values['processors'][$processor_id]['weights'])) { - foreach ($values['processors'][$processor_id]['weights'] as $stage => $weight) { - $processor->setWeight($stage, (int) $weight); - } - } - if (!isset($old_processors[$processor_id])) { - $this->entity->addProcessor($processor); - $form_state->set('processors_changed', TRUE); - } - elseif ($old_configuration != $processor->getConfiguration()) { - $form_state->set('processors_changed', TRUE); - } - } - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - if ($form_state->get('processors_changed')) { - $save_status = parent::save($form, $form_state); - $this->messenger->addStatus($this->t('The indexing workflow was successfully edited.')); - if ($this->entity->isReindexing()) { - $url = $this->entity->toUrl('canonical'); - $this->messenger->addStatus($this->t('All content was scheduled for reindexing so the new settings can take effect.', [':url' => $url->toString()])); - } - } - else { - $this->messenger->addStatus($this->t('No values were changed.')); - $save_status = SAVED_UPDATED; - } - - return $save_status; - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - - // We don't have a "delete" action here. - unset($actions['delete']); - - return $actions; - } - - /** - * Retrieves all available processors. - */ - protected function getAllProcessors() { - $processors = $this->entity->getProcessors(); - $settings['#index'] = $this->entity; - - foreach ($this->processorPluginManager->getDefinitions() as $name => $processor_definition) { - if (isset($processors[$name])) { - continue; - } - elseif (class_exists($processor_definition['class'])) { - if (call_user_func([$processor_definition['class'], 'supportsIndex'], $this->entity)) { - /** @var \Drupal\search_api\Processor\ProcessorInterface $processor */ - $processor = $this->processorPluginManager->createInstance($name, $settings); - $processors[$name] = $processor; - } - } - else { - $this->logger->warning('Processor %id specifies a non-existing class %class.', [ - '%id' => $name, - '%class' => $processor_definition['class'], - ]); - } - } - - return $processors; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexRebuildTrackerConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexRebuildTrackerConfirmForm.php deleted file mode 100644 index 5f652a126..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexRebuildTrackerConfirmForm.php +++ /dev/null @@ -1,59 +0,0 @@ -setMessenger($container->get('messenger')); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to rebuild the tracking data for the search index %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t("

        The complete information about existing and indexed items for this index will be deleted and will have to be rebuilt.

        This should usually not be necessary, but can help if some existing items aren't contained in the index's tracking data for whatever reason (in other words, when the total number of items to be indexed is less than it should be).

        This action cannot be undone.

        "); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_index.canonical', ['search_api_index' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - $index->rebuildTracker(); - $this->messenger() - ->addStatus($this->t('The tracking information for search index %name will be rebuilt.', ['%name' => $index->label()])); - $form_state->setRedirect('entity.search_api_index.canonical', ['search_api_index' => $index->id()]); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexReindexConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexReindexConfirmForm.php deleted file mode 100644 index 24b37dfd9..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexReindexConfirmForm.php +++ /dev/null @@ -1,89 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to reindex the search index %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Indexed data will remain on the search server until all items have been reindexed. Searches on this index will continue to yield results. This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_index.canonical', ['search_api_index' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->getEntity(); - - try { - $index->reindex(); - $this->messenger->addStatus($this->t('The search index %name was successfully reindexed.', ['%name' => $index->label()])); - } - catch (SearchApiException $e) { - $this->messenger->addError($this->t('Failed to reindex items for the search index %name.', ['%name' => $index->label()])); - $message = '%type while trying to reindex items on index %name: @message in %function (line %line of %file)'; - $variables = [ - '%name' => $index->label(), - ]; - $variables += Error::decodeException($e); - $this->getLogger('search_api')->error($message, $variables); - } - - $form_state->setRedirect('entity.search_api_index.canonical', ['search_api_index' => $index->id()]); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/IndexStatusForm.php b/sites/all/modules/contrib/search/search_api/src/Form/IndexStatusForm.php deleted file mode 100644 index d13e7f93d..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/IndexStatusForm.php +++ /dev/null @@ -1,273 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * The index task manager. - * - * @var \Drupal\search_api\Task\IndexTaskManagerInterface|null - */ - protected $indexTaskManager; - - /** - * Retrieves the index task manager. - * - * @return \Drupal\search_api\Task\IndexTaskManagerInterface - * The index task manager. - */ - public function getIndexTaskManager() { - return $this->indexTaskManager ?: \Drupal::service('search_api.index_task_manager'); - } - - /** - * Sets the index task manager. - * - * @param \Drupal\search_api\Task\IndexTaskManagerInterface $index_task_manager - * The new index task manager. - * - * @return $this - */ - public function setIndexTaskManager(IndexTaskManagerInterface $index_task_manager) { - $this->indexTaskManager = $index_task_manager; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'search_api_index_status'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, IndexInterface $index = NULL) { - if (!isset($index)) { - return []; - } - - $form['#index'] = $index; - - if ($index->status() && $index->hasValidTracker()) { - $form['#attached']['library'][] = 'search_api/drupal.search_api.admin_css'; - - if (!$this->getIndexTaskManager()->isTrackingComplete($index)) { - $form['tracking'] = [ - '#type' => 'details', - '#title' => $this->t('Track items for index'), - '#description' => $this->t('Not all items have been tracked for this index. This means the displayed index status is incomplete and not all items will currently be indexed.'), - '#open' => TRUE, - '#attributes' => [ - 'class' => ['container-inline'], - ], - ]; - $form['tracking']['index_now'] = [ - '#type' => 'submit', - '#value' => $this->t('Track now'), - '#name' => 'track_now', - ]; - } - - // Add the "Index now" form. - $form['index'] = [ - '#type' => 'details', - '#title' => $this->t('Start indexing now'), - '#open' => TRUE, - '#attributes' => [ - 'class' => ['container-inline'], - ], - ]; - $has_remaining_items = ($index->getTrackerInstance()->getRemainingItemsCount() > 0); - $all_value = $this->t('all', [], ['context' => 'items to index']); - $limit = [ - '#type' => 'textfield', - '#default_value' => $all_value, - '#size' => 4, - '#attributes' => [ - 'class' => ['search-api-limit'], - ], - '#disabled' => !$has_remaining_items, - ]; - $batch_size = [ - '#type' => 'textfield', - '#default_value' => $index->getOption('cron_limit', $this->config('search_api.settings')->get('default_cron_limit')), - '#size' => 4, - '#attributes' => [ - 'class' => ['search-api-batch-size'], - ], - '#disabled' => !$has_remaining_items, - ]; - // Here it gets complicated. We want to build a sentence from the form - // input elements, but to translate that we have to make the two form - // elements (for limit and batch size) pseudo-variables in the $this->t() - // call. - // Since we can't pass them directly, we split the translated sentence - // (which still has the two tokens), figure out their order and then put - // the pieces together again using the form elements' #prefix and #suffix - // properties. - $sentence = preg_split('/@(limit|batch_size)/', $this->t('Index @limit items in batches of @batch_size items'), -1, PREG_SPLIT_DELIM_CAPTURE); - // Check if the sentence contains the expected amount of parts. - if (count($sentence) === 5) { - $first = $sentence[1]; - $form['index'][$first] = ${$first}; - $form['index'][$first]['#prefix'] = $sentence[0]; - $form['index'][$first]['#suffix'] = $sentence[2]; - $second = $sentence[3]; - $form['index'][$second] = ${$second}; - $form['index'][$second]['#suffix'] = "{$sentence[4]} "; - } - else { - // Sentence is broken. Use fallback method instead. - $limit['#title'] = $this->t('Number of items to index'); - $form['index']['limit'] = $limit; - $batch_size['#title'] = $this->t('Number of items per batch run'); - $form['index']['batch_size'] = $batch_size; - } - // Add the value "all" so it can be used by the validation. - $form['index']['all'] = [ - '#type' => 'value', - '#value' => $all_value, - ]; - $form['index']['index_now'] = [ - '#type' => 'submit', - '#value' => $this->t('Index now'), - '#disabled' => !$has_remaining_items, - '#name' => 'index_now', - ]; - - // Add actions for reindexing and for clearing the index. - $form['actions']['#type'] = 'actions'; - $form['actions']['reindex'] = [ - '#type' => 'submit', - '#value' => $this->t('Queue all items for reindexing'), - '#name' => 'reindex', - '#button_type' => 'danger', - ]; - $form['actions']['clear'] = [ - '#type' => 'submit', - '#value' => $this->t('Clear all indexed data'), - '#name' => 'clear', - '#button_type' => 'danger', - ]; - $form['actions']['rebuild_tracker'] = [ - '#type' => 'submit', - '#value' => $this->t('Rebuild tracking information'), - '#name' => 'rebuild_tracker', - '#button_type' => 'danger', - ]; - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - // Only the "Index now" action needs any validation. - if ($form_state->getTriggeringElement()['#name'] === 'index_now') { - $values = $form_state->getValues(); - // Get the translated "all" value and lowercase it for comparison. - $all_value = mb_strtolower($values['all']); - - foreach (['limit', 'batch_size'] as $field) { - // Trim and lowercase the value so we correctly identify "all" values, - // even if not matching exactly. - $value = mb_strtolower(trim($values[$field])); - - if ($value === $all_value) { - $value = -1; - } - elseif (!$value || !is_numeric($value) || ((int) $value) != $value) { - $form_state->setErrorByName($field, $this->t('Enter a non-zero integer. Use "-1" or "@all" for "all items".', ['@all' => $values['all']])); - } - else { - $value = (int) $value; - } - - $form_state->setValue($field, $value); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $form['#index']; - - switch ($form_state->getTriggeringElement()['#name']) { - case 'index_now': - $values = $form_state->getValues(); - try { - IndexBatchHelper::setStringTranslation($this->getStringTranslation()); - IndexBatchHelper::create($index, $values['batch_size'], $values['limit']); - } - catch (SearchApiException $e) { - $this->messenger->addWarning($this->t('Failed to create a batch, please check the batch size and limit.')); - } - break; - - case 'reindex': - $form_state->setRedirect('entity.search_api_index.reindex', ['search_api_index' => $index->id()]); - break; - - case 'clear': - $form_state->setRedirect('entity.search_api_index.clear', ['search_api_index' => $index->id()]); - break; - - case 'rebuild_tracker': - $form_state->setRedirect('entity.search_api_index.rebuild_tracker', ['search_api_index' => $index->id()]); - break; - - case 'track_now': - $this->getIndexTaskManager()->addItemsBatch($index); - break; - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/ServerClearConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/ServerClearConfirmForm.php deleted file mode 100644 index 4e452ad99..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/ServerClearConfirmForm.php +++ /dev/null @@ -1,111 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to clear all indexed data from the search server %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t("This will permanently remove all data currently indexed on this server for indexes that aren't read-only. Items are queued for reindexing. Until reindexing occurs, searches for the affected indexes will not return any results. This action cannot be undone."); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_server.canonical', ['search_api_server' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $this->getEntity(); - - try { - $server->deleteAllItems(); - $this->messenger->addStatus($this->t('All indexed data was successfully deleted from the server.')); - } - catch (SearchApiException $e) { - $this->messenger->addError($this->t('Indexed data could not be cleared for some indexes. Check the logs for details.')); - } - - $failed_reindexing = []; - $properties = [ - 'status' => TRUE, - 'read_only' => FALSE, - ]; - foreach ($server->getIndexes($properties) as $index) { - try { - $index->reindex(); - } - catch (SearchApiException $e) { - $message = '%type while clearing index %index: @message in %function (line %line of %file).'; - $variables = [ - '%index' => $index->label(), - ]; - $variables += Error::decodeException($e); - $this->getLogger('search_api')->error($message, $variables); - - $failed_reindexing[] = $index->label(); - } - } - - if ($failed_reindexing) { - $args = [ - '@indexes' => implode(', ', $failed_reindexing), - ]; - $this->messenger->addWarning($this->t('Failed to mark the following indexes for reindexing: @indexes. Check the logs for details.', $args)); - } - - $form_state->setRedirect('entity.search_api_server.canonical', ['search_api_server' => $server->id()]); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/ServerDeleteConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/ServerDeleteConfirmForm.php deleted file mode 100644 index b861648bb..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/ServerDeleteConfirmForm.php +++ /dev/null @@ -1,79 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to delete the search server %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Deleting a server will disable all its indexes and their searches.'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_server.canonical', ['search_api_server' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - $this->messenger->addStatus($this->t('The search server %name has been deleted.', ['%name' => $this->entity->label()])); - $form_state->setRedirect('search_api.overview'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/ServerDisableConfirmForm.php b/sites/all/modules/contrib/search/search_api/src/Form/ServerDisableConfirmForm.php deleted file mode 100644 index b2fb63b9e..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/ServerDisableConfirmForm.php +++ /dev/null @@ -1,82 +0,0 @@ -messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $messenger = $container->get('messenger'); - - return new static($messenger); - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return $this->t('Are you sure you want to disable the search server %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->t('Disabling a server will also disable all attached indexes, clearing their tracking tables and indexed data. When re-enabling the server and its indexes, all data will have to be re-indexed. This action cannot be undone.'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.search_api_server.canonical', ['search_api_server' => $this->entity->id()]); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Disable'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $this->entity; - $server->setStatus(FALSE)->save(); - - $this->messenger->addStatus($this->t('The search server %name has been disabled.', ['%name' => $this->entity->label()])); - $form_state->setRedirect('search_api.overview'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/ServerForm.php b/sites/all/modules/contrib/search/search_api/src/Form/ServerForm.php deleted file mode 100644 index eea3d372b..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/ServerForm.php +++ /dev/null @@ -1,328 +0,0 @@ -backendPluginManager = $backend_plugin_manager; - $this->messenger = $messenger; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - $backend_plugin_manager = $container->get('plugin.manager.search_api.backend'); - $messenger = $container->get('messenger'); - - return new static($backend_plugin_manager, $messenger); - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - // If the form is being rebuilt, rebuild the entity with the current form - // values. - if ($form_state->isRebuilding()) { - $this->entity = $this->buildEntity($form, $form_state); - } - - $form = parent::form($form, $form_state); - - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $this->getEntity(); - - // Set the page title according to whether we are creating or editing the - // server. - if ($server->isNew()) { - $form['#title'] = $this->t('Add search server'); - } - else { - $form['#title'] = $this->t('Edit search server %label', ['%label' => $server->label()]); - } - - $this->buildEntityForm($form, $form_state, $server); - // Skip adding the backend config form if we cleared the server form due to - // an error. - if ($form) { - $this->buildBackendConfigForm($form, $form_state, $server); - } - - return $form; - } - - /** - * Builds the form for the basic server properties. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * @param \Drupal\search_api\ServerInterface $server - * The server that is being created or edited. - */ - public function buildEntityForm(array &$form, FormStateInterface $form_state, ServerInterface $server) { - $form['#attached']['library'][] = 'search_api/drupal.search_api.admin_css'; - - $form['name'] = [ - '#type' => 'textfield', - '#title' => $this->t('Server name'), - '#description' => $this->t('Enter the displayed name for the server.'), - '#default_value' => $server->label(), - '#required' => TRUE, - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => $server->isNew() ? NULL : $server->id(), - '#maxlength' => 50, - '#required' => TRUE, - '#machine_name' => [ - 'exists' => '\Drupal\search_api\Entity\Server::load', - 'source' => ['name'], - ], - '#disabled' => !$server->isNew(), - ]; - $form['status'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enabled'), - '#description' => $this->t('Only enabled servers can index items or execute searches.'), - '#default_value' => $server->status(), - ]; - $form['description'] = [ - '#type' => 'textarea', - '#title' => $this->t('Description'), - '#description' => $this->t('Enter a description for the server.'), - '#default_value' => $server->getDescription(), - ]; - - $backends = $this->backendPluginManager->getDefinitions(); - $backend_options = []; - $descriptions = []; - foreach ($backends as $backend_id => $definition) { - $config = $backend_id === $server->getBackendId() ? $server->getBackendConfig() : []; - $config['#server'] = $server; - try { - /** @var \Drupal\search_api\Backend\BackendInterface $backend */ - $backend = $this->backendPluginManager - ->createInstance($backend_id, $config); - } - catch (PluginException $e) { - continue; - } - if ($backend->isHidden()) { - continue; - } - $backend_options[$backend_id] = Utility::escapeHtml($backend->label()); - $descriptions[$backend_id]['#description'] = Utility::escapeHtml($backend->getDescription()); - } - asort($backend_options, SORT_NATURAL | SORT_FLAG_CASE); - if ($backend_options) { - if (count($backend_options) == 1) { - $server->set('backend', key($backend_options)); - } - $form['backend'] = [ - '#type' => 'radios', - '#title' => $this->t('Backend'), - '#description' => $this->t('Choose a backend to use for this server.'), - '#options' => $backend_options, - '#default_value' => $server->getBackendId(), - '#required' => TRUE, - '#disabled' => !$server->isNew(), - '#ajax' => [ - 'callback' => [get_class($this), 'buildAjaxBackendConfigForm'], - 'wrapper' => 'search-api-backend-config-form', - 'method' => 'replace', - 'effect' => 'fade', - ], - ]; - $form['backend'] += $descriptions; - } - else { - $url = 'https://www.drupal.org/node/1254698'; - $args[':url'] = Url::fromUri($url)->toString(); - $error = $this->t('There are no backend plugins available for the Search API. Please install a module that provides a backend plugin to proceed.', $args); - $this->messenger->addError($error); - $form = []; - } - } - - /** - * Builds the backend-specific configuration form. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * @param \Drupal\search_api\ServerInterface $server - * The server that is being created or edited. - */ - public function buildBackendConfigForm(array &$form, FormStateInterface $form_state, ServerInterface $server) { - $form['backend_config'] = []; - if ($server->hasValidBackend()) { - $backend = $server->getBackend(); - $form_state->set('backend', $backend->getPluginId()); - if ($backend instanceof PluginFormInterface) { - if ($form_state->isRebuilding()) { - $this->messenger->addWarning($this->t('Please configure the selected backend.')); - } - // Attach the backend plugin configuration form. - $backend_form_state = SubformState::createForSubform($form['backend_config'], $form, $form_state); - $form['backend_config'] = $backend->buildConfigurationForm($form['backend_config'], $backend_form_state); - - // Modify the backend plugin configuration container element. - $form['backend_config']['#type'] = 'details'; - $form['backend_config']['#title'] = $this->t('Configure %plugin backend', ['%plugin' => $backend->label()]); - $form['backend_config']['#open'] = TRUE; - } - } - // Only notify the user of a missing backend plugin if we're editing an - // existing server. - elseif (!$server->isNew()) { - $this->messenger->addError($this->t('The backend plugin is missing or invalid.')); - return; - } - $form['backend_config'] += [ - '#type' => 'container', - ]; - $form['backend_config']['#attributes']['id'] = 'search-api-backend-config-form'; - $form['backend_config']['#tree'] = TRUE; - } - - /** - * Handles switching the selected backend plugin. - * - * @param array $form - * The current form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current form state. - * - * @return array - * The part of the form to return as AJAX. - */ - public static function buildAjaxBackendConfigForm(array $form, FormStateInterface $form_state) { - // The work is already done in form(), where we rebuild the entity according - // to the current form values and then create the backend configuration form - // based on that. So we just need to return the relevant part of the form - // here. - return $form['backend_config']; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $this->getEntity(); - - // Check if the backend plugin changed. - $backend_id = $server->getBackendId(); - if ($backend_id != $form_state->get('backend')) { - // This can only happen during initial server creation, since we don't - // allow switching the backend afterwards. The user has selected a - // different backend, so any values entered for the other backend should - // be discarded. - $input = &$form_state->getUserInput(); - $input['backend_config'] = []; - $new_backend = $this->backendPluginManager->createInstance($form_state->getValues()['backend']); - if ($new_backend instanceof PluginFormInterface) { - $form_state->setRebuild(); - } - } - // Check before loading the backend plugin so we don't throw an exception. - elseif ($server->hasValidBackend()) { - $backend = $server->getBackend(); - if ($backend instanceof PluginFormInterface) { - $backend_form_state = SubformState::createForSubform($form['backend_config'], $form, $form_state); - $backend->validateConfigurationForm($form['backend_config'], $backend_form_state); - } - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); - - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $this->getEntity(); - // Check before loading the backend plugin so we don't throw an exception. - if ($server->hasValidBackend()) { - $backend = $server->getBackend(); - if ($backend instanceof PluginFormInterface) { - $backend_form_state = SubformState::createForSubform($form['backend_config'], $form, $form_state); - $backend->submitConfigurationForm($form['backend_config'], $backend_form_state); - } - } - - return $server; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - // Only save the server if the form doesn't need to be rebuilt. - if (!$form_state->isRebuilding()) { - try { - $server = $this->getEntity(); - $server->save(); - $this->messenger->addStatus($this->t('The server was successfully saved.')); - $form_state->setRedirect('entity.search_api_server.canonical', ['search_api_server' => $server->id()]); - } - catch (EntityStorageException $e) { - $form_state->setRebuild(); - - $message = '%type: @message in %function (line %line of %file).'; - $variables = Error::decodeException($e); - $this->getLogger('search_api')->error($message, $variables); - - $this->messenger->addError($this->t('The server could not be saved.')); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/ServerStatusForm.php b/sites/all/modules/contrib/search/search_api/src/Form/ServerStatusForm.php deleted file mode 100644 index 895a37cbb..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/ServerStatusForm.php +++ /dev/null @@ -1,123 +0,0 @@ -setServerTaskManager($container->get('search_api.server_task_manager')); - - return $form; - } - - /** - * Retrieves the server task manager. - * - * @return \Drupal\search_api\Task\ServerTaskManagerInterface - * The server task manager. - */ - public function getServerTaskManager() { - return $this->serverTaskManager ?: \Drupal::service('search_api.server_task_manager'); - } - - /** - * Sets the server task manager. - * - * @param \Drupal\search_api\Task\ServerTaskManagerInterface $server_task_manager - * The new server task manager. - * - * @return $this - */ - public function setServerTaskManager(ServerTaskManagerInterface $server_task_manager) { - $this->serverTaskManager = $server_task_manager; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'search_api_server_status'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, ServerInterface $server = NULL) { - $form['#server'] = $server; - - $pending_tasks = $this->getServerTaskManager()->getCount($server); - if ($pending_tasks) { - $status = $this->formatPlural( - $pending_tasks, - 'There is currently @count task pending for this server.', - 'There are currently @count tasks pending for this server.' - ); - $form['tasks'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Pending server tasks'), - ]; - $form['tasks']['help'] = [ - '#type' => 'item', - '#title' => $status, - '#description' => $this->t('Pending tasks are created when operations on the server, such as deleting one or more items, cannot be executed because the server is currently unavailable (which will usually also create an entry in the Drupal logs). They are automatically tried again before any other operation is executed and the operation is aborted if the tasks could still not be executed, or if there are too many pending tasks to be executed in a single page request. In the latter case, you can use this form to manually execute all tasks and thus unblock the server again.'), - ]; - $form['tasks']['execute'] = [ - '#type' => 'submit', - '#value' => $this->t('Execute tasks now'), - '#disabled' => !$server->isAvailable(), - '#submit' => ['::executeTasks'], - ]; - } - - $form['actions']['#type'] = 'actions'; - $form['actions']['clear'] = [ - '#type' => 'submit', - '#value' => $this->t('Delete all indexed data on this server'), - '#button_type' => 'danger', - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function executeTasks(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $form['#server']; - $this->getServerTaskManager()->setExecuteBatch($server); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Redirect to the "Clear server" confirmation form. - /** @var \Drupal\search_api\ServerInterface $server */ - $server = $form['#server']; - $form_state->setRedirect('entity.search_api_server.clear', ['search_api_server' => $server->id()]); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Form/UnsavedConfigurationFormTrait.php b/sites/all/modules/contrib/search/search_api/src/Form/UnsavedConfigurationFormTrait.php deleted file mode 100644 index 6b90121c2..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Form/UnsavedConfigurationFormTrait.php +++ /dev/null @@ -1,106 +0,0 @@ -renderer; - } - - /** - * Retrieves the date formatter. - * - * @return \Drupal\Core\Datetime\DateFormatterInterface - * The date formatter. - */ - public function getDateFormatter() { - return $this->dateFormatter; - } - - /** - * Checks whether the given entity contains unsaved changes. - * - * If this is the case and the changes were made by a different user, the form - * is disabled and a message displayed. - * - * Optionally, if there are unsaved changes by the current user, a different - * message can be displayed. - * - * @param array $form - * The form structure, passed by reference. - * @param object $entity - * The entity in question. - * @param bool $reportChanged - * (optional) If TRUE, also show a message for unsaved changes by the - * current user. - */ - protected function checkEntityEditable(array &$form, $entity, $reportChanged = FALSE) { - if ($entity instanceof UnsavedConfigurationInterface && $entity->hasChanges()) { - if ($entity->isLocked()) { - $form['#disabled'] = TRUE; - $username = [ - '#theme' => 'username', - '#account' => $entity->getLockOwner(), - ]; - $lockMessageSubstitutions = [ - '@user' => $this->renderer->render($username), - '@age' => $this->dateFormatter->formatTimeDiffSince($entity->getLastUpdated()), - ':url' => $entity->toUrl('break-lock-form')->toString(), - ]; - $form['locked'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => [ - 'index-locked', - 'messages', - 'messages--warning', - ], - ], - '#children' => $this->t('This index is being edited by user @user, and is therefore locked from editing by others. This lock is @age old. Click here to break this lock.', $lockMessageSubstitutions), - '#weight' => -10, - ]; - } - elseif ($reportChanged) { - $form['changed'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => [ - 'index-changed', - 'messages', - 'messages--warning', - ], - ], - '#children' => $this->t('You have unsaved changes.'), - '#weight' => -10, - ]; - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/IndexBatchHelper.php b/sites/all/modules/contrib/search/search_api/src/IndexBatchHelper.php deleted file mode 100644 index f531e2a88..000000000 --- a/sites/all/modules/contrib/search/search_api/src/IndexBatchHelper.php +++ /dev/null @@ -1,210 +0,0 @@ -translate($string, $args, $options); - } - - /** - * Formats a string containing a count of items. - * - * @see \Drupal\Core\StringTranslation\TranslationInterface::formatPlural() - */ - protected static function formatPlural($count, $singular, $plural, array $args = [], array $options = []) { - return static::getStringTranslation()->formatPlural($count, $singular, $plural, $args, $options); - } - - /** - * Creates an indexing batch for a given search index. - * - * @param \Drupal\search_api\IndexInterface $index - * The search index for which items should be indexed. - * @param int|null $batch_size - * (optional) Number of items to index per batch. Defaults to the cron limit - * set for the index. - * @param int $limit - * (optional) Maximum number of items to index. Defaults to indexing all - * remaining items. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if the batch could not be created. - */ - public static function create(IndexInterface $index, $batch_size = NULL, $limit = -1) { - // Check if the size should be determined by the index cron limit option. - if ($batch_size === NULL) { - // Use the size set by the index. - $batch_size = $index->getOption('cron_limit', \Drupal::config('search_api.settings')->get('default_cron_limit')); - } - // Check if indexing items is allowed. - if ($index->status() && !$index->isReadOnly() && $batch_size !== 0 && $limit !== 0) { - // Define the search index batch definition. - $batch_definition = [ - 'operations' => [ - [[__CLASS__, 'process'], [$index, $batch_size, $limit]], - ], - 'finished' => [__CLASS__, 'finish'], - 'progress_message' => static::t('Completed about @percentage% of the indexing operation (@current of @total).'), - ]; - // Schedule the batch. - batch_set($batch_definition); - } - else { - $index_label = $index->label(); - throw new SearchApiException("Failed to create a batch with batch size '$batch_size' and limit '$limit' for index '$index_label'."); - } - } - - /** - * Processes an index batch operation. - * - * @param \Drupal\search_api\IndexInterface $index - * The index on which items should be indexed. - * @param int $batch_size - * The maximum number of items to index per batch pass. - * @param int $limit - * The maximum number of items to index in total, or -1 to index all items. - * @param array|\ArrayAccess $context - * The context of the current batch, as defined in the @link batch Batch - * operations @endlink documentation. - */ - public static function process(IndexInterface $index, $batch_size, $limit, &$context) { - // Check if the sandbox should be initialized. - if (!isset($context['sandbox']['limit'])) { - // Initialize the sandbox with data which is shared among the batch runs. - $context['sandbox']['limit'] = $limit; - $context['sandbox']['batch_size'] = $batch_size; - } - // Check if the results should be initialized. - if (!isset($context['results']['indexed'])) { - // Initialize the results with data which is shared among the batch runs. - $context['results']['indexed'] = 0; - $context['results']['not indexed'] = 0; - } - // Get the remaining item count. When no valid tracker is available then - // the value will be set to zero which will cause the batch process to - // stop. - $remaining_item_count = ($index->hasValidTracker() ? $index->getTrackerInstance()->getRemainingItemsCount() : 0); - - // Check if an explicit limit needs to be used. - if ($context['sandbox']['limit'] > -1) { - // Calculate the remaining amount of items that can be indexed. Note that - // a minimum is taking between the allowed number of items and the - // remaining item count to prevent incorrect reporting of not indexed - // items. - $actual_limit = min($context['sandbox']['limit'] - $context['results']['indexed'], $remaining_item_count); - } - else { - // Use the remaining item count as actual limit. - $actual_limit = $remaining_item_count; - } - - // Store original count of items to be indexed to show progress properly. - if (empty($context['sandbox']['original_item_count'])) { - $context['sandbox']['original_item_count'] = $actual_limit; - } - - // Determine the number of items to index for this run. - $to_index = min($actual_limit, $context['sandbox']['batch_size']); - // Catch any exception that may occur during indexing. - try { - // Index items limited by the given count. - $indexed = $index->indexItems($to_index); - // Increment the indexed result and progress. - $context['results']['indexed'] += $indexed; - // Display progress message. - if ($indexed > 0) { - $context['message'] = static::formatPlural($context['results']['indexed'], 'Successfully indexed 1 item.', 'Successfully indexed @count items.'); - } - // Everything has been indexed? - if ($indexed === 0 || $context['results']['indexed'] >= $context['sandbox']['original_item_count']) { - $context['finished'] = 1; - $context['results']['not indexed'] = $context['sandbox']['original_item_count'] - $context['results']['indexed']; - } - else { - $context['finished'] = ($context['results']['indexed'] / $context['sandbox']['original_item_count']); - } - } - catch (\Exception $e) { - // Log exception to watchdog and abort the batch job. - watchdog_exception('search_api', $e); - $context['message'] = static::t('An error occurred during indexing: @message', ['@message' => $e->getMessage()]); - $context['finished'] = 1; - $context['results']['not indexed'] = $context['sandbox']['original_item_count'] - $context['results']['indexed']; - } - } - - /** - * Finishes an index batch. - */ - public static function finish($success, $results, $operations) { - // Check if the batch job was successful. - if ($success) { - // Display the number of items indexed. - if (!empty($results['indexed'])) { - // Build the indexed message. - $indexed_message = static::formatPlural($results['indexed'], 'Successfully indexed 1 item.', 'Successfully indexed @count items.'); - // Notify user about indexed items. - \Drupal::messenger()->addStatus($indexed_message); - // Display the number of items not indexed. - if (!empty($results['not indexed'])) { - // Build the not indexed message. - $not_indexed_message = static::formatPlural($results['not indexed'], '1 item could not be indexed. Check the logs for details.', '@count items could not be indexed. Check the logs for details.'); - // Notify user about not indexed items. - \Drupal::messenger()->addWarning($not_indexed_message); - } - } - else { - // Notify user about failure to index items. - \Drupal::messenger()->addError(static::t("Couldn't index items. Check the logs for details.")); - } - } - else { - // Notify user about batch job failure. - \Drupal::messenger()->addError(static::t('An error occurred while trying to index items. Check the logs for details.')); - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/IndexInterface.php b/sites/all/modules/contrib/search/search_api/src/IndexInterface.php deleted file mode 100644 index 7eeb42476..000000000 --- a/sites/all/modules/contrib/search/search_api/src/IndexInterface.php +++ /dev/null @@ -1,730 +0,0 @@ -serverStorage = $server_storage; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity_type.manager')->getStorage($entity_type->id()), - $container->get('entity_type.manager')->getStorage('search_api_server') - ); - } - - /** - * Determines whether the "Database Search Defaults" module can be installed. - * - * @return \Drupal\Core\StringTranslation\TranslatableMarkup[] - * An array of error messages describing why the module cannot be installed, - * keyed by a short, machine name-like identifier for the kind of error. If - * the array is empty, the module can be installed. - */ - public static function checkDefaultsModuleCanBeInstalled() { - $errors = []; - - $node_types = NodeType::loadMultiple(); - $required_types = [ - 'article' => ['body', 'comment', 'field_tags', 'field_image'], - 'page' => ['body'], - ]; - - /** @var \Drupal\Core\Entity\EntityFieldManager $entity_field_manager */ - $entity_field_manager = \Drupal::service('entity_field.manager'); - - foreach ($required_types as $required_type_id => $required_fields) { - if (!isset($node_types[$required_type_id])) { - $errors[$required_type_id] = t('Content type @content_type not found. Database Search Defaults module could not be installed.', ['@content_type' => $required_type_id]); - } - else { - // Check if all the fields are here. - $fields = $entity_field_manager->getFieldDefinitions('node', $required_type_id); - foreach ($required_fields as $required_field) { - if (!isset($fields[$required_field])) { - $errors[$required_type_id . ':' . $required_field] = t('Field @field in content type @node_type not found. Database Search Defaults module could not be installed', [ - '@node_type' => $required_type_id, - '@field' => $required_field - ]); - } - } - } - } - - if (\Drupal::moduleHandler()->moduleExists('search_api_db')) { - $entities_to_check = [ - 'search_api_index' => 'default_index', - 'search_api_server' => 'default_server', - 'view' => 'search_content', - ]; - - /** @var \Drupal\Core\Entity\EntityTypeManager $entity_type_manager */ - $entity_type_manager = \Drupal::service('entity_type.manager'); - foreach ($entities_to_check as $entity_type => $entity_id) { - try { - // Find out if the entity is already in place. If so, fail to install - // the module. - $entity_storage = $entity_type_manager->getStorage($entity_type); - $entity_storage->resetCache(); - $entity = $entity_storage->load($entity_id); - if ($entity) { - $errors['defaults_exist'] = t('It looks like the default setup provided by this module already exists on your site. Cannot re-install module.'); - break; - } - } - catch (PluginException $e) { - // This can only happen for the view, if the Views module isn't - // installed. Ignore. - } - } - } - - return $errors; - } - - /** - * {@inheritdoc} - */ - public function getDefaultOperations(EntityInterface $entity) { - $operations = parent::getDefaultOperations($entity); - - if ($entity instanceof IndexInterface) { - $route_parameters['search_api_index'] = $entity->id(); - $operations['fields'] = [ - 'title' => $this->t('Fields'), - 'weight' => 20, - 'url' => new Url('entity.search_api_index.fields', $route_parameters), - ]; - $operations['processors'] = [ - 'title' => $this->t('Processors'), - 'weight' => 30, - 'url' => new Url('entity.search_api_index.processors', $route_parameters), - ]; - } - - return $operations; - } - - /** - * {@inheritdoc} - */ - public function buildHeader() { - return [ - 'type' => $this->t('Type'), - 'title' => $this->t('Name'), - 'status' => [ - 'data' => $this->t('Status'), - 'class' => ['checkbox'], - ], - ] + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ - $row = parent::buildRow($entity); - - $status = $entity->status(); - $status_server = TRUE; - $status_label = $status ? $this->t('Enabled') : $this->t('Disabled'); - - if ($entity instanceof ServerInterface && $entity->status() && !$entity->isAvailable()) { - $status = FALSE; - $status_server = FALSE; - $status_label = $this->t('Unavailable'); - } - - $status_icon = [ - '#theme' => 'image', - '#uri' => $status ? 'core/misc/icons/73b355/check.svg' : 'core/misc/icons/e32700/error.svg', - '#width' => 18, - '#height' => 18, - '#alt' => $status_label, - '#title' => $status_label, - ]; - - $row = [ - 'data' => [ - 'type' => [ - 'data' => $entity instanceof ServerInterface ? $this->t('Server') : $this->t('Index'), - 'class' => ['search-api-type'], - ], - 'title' => [ - 'data' => [ - '#type' => 'link', - '#title' => $entity->label(), - '#suffix' => '
        ' . $entity->get('description') . '
        ', - ] + $entity->toUrl('canonical')->toRenderArray(), - 'class' => ['search-api-title'], - ], - 'status' => [ - 'data' => $status_icon, - 'class' => ['checkbox'], - ], - 'operations' => $row['operations'], - ], - 'title' => $this->t('ID: @name', ['@name' => $entity->id()]), - 'class' => [ - Html::cleanCssIdentifier($entity->getEntityTypeId() . '-' . $entity->id()), - $status ? 'search-api-list-enabled' : 'search-api-list-disabled', - $entity instanceof ServerInterface ? 'search-api-list-server' : 'search-api-list-index', - ], - ]; - - if (!$status_server) { - $row['class'][] = 'color-error'; - } - - return $row; - } - - /** - * {@inheritdoc} - */ - public function render() { - $entity_groups = $this->loadGroups(); - $list['#type'] = 'container'; - $list['#attached']['library'][] = 'search_api/drupal.search_api.admin_css'; - - $list['servers'] = [ - '#type' => 'table', - '#header' => $this->buildHeader(), - '#rows' => [], - '#empty' => '', - '#attributes' => [ - 'id' => 'search-api-entity-list', - 'class' => ['search-api-entity-list'], - ], - ]; - foreach ($entity_groups['servers'] as $server_groups) { - /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */ - foreach ($server_groups as $entity) { - $list['servers']['#rows'][$entity->getEntityTypeId() . '.' . $entity->id()] = $this->buildRow($entity); - } - } - - // Output the list of indexes without a server separately. - if (!empty($entity_groups['lone_indexes'])) { - $list['lone_indexes']['heading']['#markup'] = '

        ' . $this->t('Indexes not currently associated with any server') . '

        '; - $list['lone_indexes']['table'] = [ - '#type' => 'table', - '#header' => $this->buildHeader(), - '#rows' => [], - ]; - - foreach ($entity_groups['lone_indexes'] as $entity) { - $list['lone_indexes']['table']['#rows'][$entity->id()] = $this->buildRow($entity); - } - } - elseif (!$list['servers']['#rows']) { - if (static::checkDefaultsModuleCanBeInstalled() === []) { - $list['servers']['#empty'] = $this->t('There are no servers or indexes defined. For a quick start, we suggest you install the Database Search Defaults module.'); - } - else { - $list['servers']['#empty'] = $this->t('There are no servers or indexes defined.'); - } - } - - return $list; - } - - /** - * Loads search servers and indexes, grouped by servers. - * - * @return \Drupal\Core\Config\Entity\ConfigEntityInterface[][] - * An associative array with two keys: - * - servers: All available search servers, each followed by all search - * indexes attached to it. - * - lone_indexes: All search indexes that aren't attached to any server. - */ - public function loadGroups() { - $indexes = $this->storage->loadMultiple(); - /** @var \Drupal\search_api\ServerInterface[] $servers */ - $servers = $this->serverStorage->loadMultiple(); - - $this->sortByStatusThenAlphabetically($indexes); - $this->sortByStatusThenAlphabetically($servers); - - $server_groups = []; - foreach ($servers as $server) { - $server_group = [ - 'server.' . $server->id() => $server, - ]; - - foreach ($server->getIndexes() as $index) { - $server_group['index.' . $index->id()] = $index; - // Remove this index from $index so it will finally only contain those - // indexes not belonging to any server. - unset($indexes[$index->id()]); - } - - $server_groups['server.' . $server->id()] = $server_group; - } - - return [ - 'servers' => $server_groups, - 'lone_indexes' => $indexes, - ]; - } - - /** - * Sorts an array of entities by status and then alphabetically. - * - * Will preserve the key/value association of the array. - * - * @param \Drupal\Core\Config\Entity\ConfigEntityInterface[] $entities - * An array of config entities. - */ - protected function sortByStatusThenAlphabetically(array &$entities) { - uasort($entities, function (ConfigEntityInterface $a, ConfigEntityInterface $b) { - if ($a->status() == $b->status()) { - return strnatcasecmp($a->label(), $b->label()); - } - else { - return $a->status() ? -1 : 1; - } - }); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Item/Field.php b/sites/all/modules/contrib/search/search_api/src/Item/Field.php deleted file mode 100644 index 7371d603e..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Item/Field.php +++ /dev/null @@ -1,683 +0,0 @@ -index = $index; - $this->fieldIdentifier = $this->originalFieldIdentifier = $field_identifier; - } - - /** - * Retrieves the data type manager. - * - * @return \Drupal\search_api\DataType\DataTypePluginManager - * The data type manager. - */ - public function getDataTypeManager() { - return $this->dataTypeManager ?: \Drupal::service('plugin.manager.search_api.data_type'); - } - - /** - * Sets the data type manager. - * - * @param \Drupal\search_api\DataType\DataTypePluginManager $data_type_manager - * The new data type manager. - * - * @return $this - */ - public function setDataTypeManager(DataTypePluginManager $data_type_manager) { - $this->dataTypeManager = $data_type_manager; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getIndex() { - return $this->index; - } - - /** - * {@inheritdoc} - */ - public function setIndex(IndexInterface $index) { - if ($this->index->id() != $index->id()) { - throw new \InvalidArgumentException('Attempted to change the index of a field object.'); - } - $this->index = $index; - $this->datasource = NULL; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFieldIdentifier() { - return $this->fieldIdentifier; - } - - /** - * {@inheritdoc} - */ - public function getOriginalFieldIdentifier() { - return $this->originalFieldIdentifier; - } - - /** - * {@inheritdoc} - */ - public function setFieldIdentifier($field_id) { - $this->fieldIdentifier = $field_id; - return $this; - } - - /** - * {@inheritdoc} - */ - public function wasRenamed() { - return $this->fieldIdentifier != $this->originalFieldIdentifier; - } - - /** - * {@inheritdoc} - */ - public function getSettings() { - $settings = [ - 'label' => $this->getLabel(), - 'datasource_id' => $this->getDatasourceId(), - 'property_path' => $this->getPropertyPath(), - 'type' => $this->getType(), - ]; - if ($this->getDatasourceId() === NULL) { - unset($settings['datasource_id']); - } - if ($this->getBoost() != 1.0) { - $settings['boost'] = $this->getBoost(); - } - if ($this->isIndexedLocked()) { - $settings['indexed_locked'] = TRUE; - } - if ($this->isTypeLocked()) { - $settings['type_locked'] = TRUE; - } - if ($this->isHidden()) { - $settings['hidden'] = TRUE; - } - if ($this->getConfiguration()) { - $settings['configuration'] = $this->getConfiguration(); - } - if ($this->getDependencies()) { - $settings['dependencies'] = $this->getDependencies(); - } - return $settings; - } - - /** - * {@inheritdoc} - */ - public function getDatasourceId() { - return $this->datasourceId; - } - - /** - * {@inheritdoc} - */ - public function getDatasource() { - if (!isset($this->datasource) && isset($this->datasourceId)) { - $this->datasource = $this->index->getDatasource($this->datasourceId); - } - return $this->datasource; - } - - /** - * {@inheritdoc} - */ - public function setDatasourceId($datasource_id) { - if ($this->datasourceId != $datasource_id) { - $this->datasource = NULL; - } - $this->datasourceId = $datasource_id; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPropertyPath() { - return $this->propertyPath; - } - - /** - * {@inheritdoc} - */ - public function setPropertyPath($property_path) { - $this->propertyPath = $property_path; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getCombinedPropertyPath() { - return Utility::createCombinedId($this->getDatasourceId(), $this->getPropertyPath()); - } - - /** - * {@inheritdoc} - */ - public function getLabel() { - return $this->label; - } - - /** - * {@inheritdoc} - */ - public function setLabel($label) { - $this->label = $label; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - if (!isset($this->description)) { - try { - $property = $this->getDataDefinition(); - if ($property instanceof ConfigurablePropertyInterface) { - $this->description = $property->getFieldDescription($this); - } - else { - $this->description = $property->getDescription(); - } - $this->description = $this->description ?: FALSE; - } - catch (SearchApiException $e) { - $this->logException($e); - } - } - return $this->description ?: NULL; - } - - /** - * {@inheritdoc} - */ - public function setDescription($description) { - // Set FALSE instead of NULL so caching will work properly. - $this->description = $description ?: FALSE; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPrefixedLabel() { - if (!isset($this->labelPrefix)) { - $this->labelPrefix = ''; - if (isset($this->datasourceId)) { - $this->labelPrefix = $this->datasourceId; - try { - $this->labelPrefix = $this->getDatasource()->label(); - } - catch (SearchApiException $e) { - $this->logException($e); - } - $this->labelPrefix .= ' » '; - } - } - return $this->labelPrefix . $this->getLabel(); - } - - /** - * {@inheritdoc} - */ - public function setLabelPrefix($label_prefix) { - $this->labelPrefix = $label_prefix; - return $this; - } - - /** - * {@inheritdoc} - */ - public function isHidden() { - return (bool) $this->hidden; - } - - /** - * {@inheritdoc} - */ - public function setHidden($hidden = TRUE) { - $this->hidden = $hidden; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getDataDefinition() { - if (!isset($this->dataDefinition)) { - $definitions = $this->index->getPropertyDefinitions($this->getDatasourceId()); - $definition = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->retrieveNestedProperty($definitions, $this->getPropertyPath()); - if (!$definition) { - $field_label = $this->getLabel(); - $index_label = $this->getIndex()->label(); - throw new SearchApiException("Could not retrieve data definition for field '$field_label' on index '$index_label'."); - } - $this->dataDefinition = $definition; - } - return $this->dataDefinition; - } - - /** - * Sets the field's data definition. - * - * This should mainly be used only when creating a new field object. Calling - * this on an existing field object might not work as expected. - * - * @param \Drupal\Core\TypedData\DataDefinitionInterface $data_definition - * The field's new data definition. - * - * @return $this - */ - public function setDataDefinition(DataDefinitionInterface $data_definition) { - $this->dataDefinition = $data_definition; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getType() { - return $this->type; - } - - /** - * {@inheritdoc} - */ - public function getDataTypePlugin() { - $data_type_manager = $this->getDataTypeManager(); - if ($data_type_manager->hasDefinition($this->getType())) { - return $data_type_manager->createInstance($this->getType()); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function setType($type) { - if ($type != $this->type && $this->isTypeLocked()) { - $field_label = $this->getLabel(); - $index_label = $this->getIndex()->label(); - throw new SearchApiException("Trying to change the type of field '$field_label' on index '$index_label', which is locked."); - } - $this->type = $type; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getValues() { - return $this->values; - } - - /** - * {@inheritdoc} - */ - public function setValues(array $values) { - $this->values = array_values($values); - return $this; - } - - /** - * {@inheritdoc} - */ - public function addValue($value) { - // The data type has to be able to alter the given value before it is - // included. - $data_type_plugin = $this->getDataTypePlugin(); - if ($data_type_plugin) { - $value = $data_type_plugin->getValue($value); - } - - $this->values[] = $value; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOriginalType() { - if (!isset($this->originalType)) { - $this->originalType = 'string'; - try { - $this->originalType = $this->getDataDefinition()->getDataType(); - } - catch (SearchApiException $e) { - $this->logException($e); - } - } - return $this->originalType; - } - - /** - * {@inheritdoc} - */ - public function setOriginalType($original_type) { - $this->originalType = $original_type; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getBoost() { - return isset($this->boost) ? $this->boost : 1.0; - } - - /** - * {@inheritdoc} - */ - public function setBoost($boost) { - $this->boost = (float) $boost; - return $this; - } - - /** - * {@inheritdoc} - */ - public function isIndexedLocked() { - return (bool) $this->indexedLocked; - } - - /** - * {@inheritdoc} - */ - public function setIndexedLocked($indexed_locked = TRUE) { - $this->indexedLocked = $indexed_locked; - return $this; - } - - /** - * {@inheritdoc} - */ - public function isTypeLocked() { - return (bool) $this->typeLocked; - } - - /** - * {@inheritdoc} - */ - public function setTypeLocked($type_locked = TRUE) { - $this->typeLocked = $type_locked; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getConfiguration() { - return $this->configuration; - } - - /** - * {@inheritdoc} - */ - public function setConfiguration(array $configuration) { - $this->configuration = $configuration; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getDependencies() { - return $this->dependencies; - } - - /** - * {@inheritdoc} - */ - public function setDependencies(array $dependencies) { - $this->dependencies = $dependencies; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getIterator() { - return new \ArrayIterator($this->values); - } - - /** - * Implements the magic __toString() method to simplify debugging. - */ - public function __toString() { - $label = $this->getLabel(); - $field_id = $this->getFieldIdentifier(); - $type = $this->getType(); - $out = "$label [$field_id]: indexed as type $type"; - $is_text_type = \Drupal::getContainer() - ->get('search_api.data_type_helper') - ->isTextType($type); - if ($is_text_type) { - $out .= ' (boost ' . $this->getBoost() . ')'; - } - if ($this->getValues()) { - $out .= "\nValues:"; - foreach ($this->getValues() as $value) { - $value = str_replace("\n", "\n ", "$value"); - $out .= "\n- " . $value; - } - } - return $out; - } - - /** - * {@inheritdoc} - */ - public function __sleep() { - $this->indexId = $this->index->id(); - $properties = get_object_vars($this); - // Don't serialize objects in properties or the field values. - unset($properties['index']); - unset($properties['datasource']); - unset($properties['dataDefinition']); - unset($properties['dataTypeManager']); - return array_keys($properties); - } - - /** - * Implements the magic __wakeup() method to control object unserialization. - */ - public function __wakeup() { - // Make sure we have a container to do this. This is important to correctly - // display test failures. - if ($this->indexId && \Drupal::hasContainer()) { - $this->index = \Drupal::entityTypeManager() - ->getStorage('search_api_index') - ->load($this->indexId); - $this->indexId = NULL; - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Item/FieldInterface.php b/sites/all/modules/contrib/search/search_api/src/Item/FieldInterface.php deleted file mode 100644 index 5c993e8e3..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Item/FieldInterface.php +++ /dev/null @@ -1,425 +0,0 @@ -index = $index; - $this->itemId = $id; - if ($datasource) { - $this->datasource = $datasource; - $this->datasourceId = $datasource->getPluginId(); - } - } - - /** - * {@inheritdoc} - */ - public function getDatasourceId() { - if (!isset($this->datasourceId)) { - list($this->datasourceId) = Utility::splitCombinedId($this->itemId); - } - return $this->datasourceId; - } - - /** - * {@inheritdoc} - */ - public function getDatasource() { - if (!isset($this->datasource)) { - $this->datasource = $this->index->getDatasource($this->getDatasourceId()); - } - return $this->datasource; - } - - /** - * {@inheritdoc} - */ - public function getIndex() { - return $this->index; - } - - /** - * {@inheritdoc} - */ - public function getLanguage() { - if (!isset($this->language)) { - $this->language = $this->getDatasource()->getItemLanguage($this->getOriginalObject()); - } - return $this->language; - } - - /** - * {@inheritdoc} - */ - public function setLanguage($language) { - $this->language = $language; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getId() { - return $this->itemId; - } - - /** - * {@inheritdoc} - */ - public function getOriginalObject($load = TRUE) { - if (!isset($this->originalObject) && $load) { - $this->originalObject = $this->index->loadItem($this->itemId); - if (!$this->originalObject) { - throw new SearchApiException('Failed to load original object ' . $this->itemId); - } - } - return $this->originalObject; - } - - /** - * {@inheritdoc} - */ - public function setOriginalObject(ComplexDataInterface $original_object) { - $this->originalObject = $original_object; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getField($field_id, $extract = TRUE) { - if (isset($this->fields[$field_id])) { - return $this->fields[$field_id]; - } - $fields = $this->getFields($extract); - return isset($fields[$field_id]) ? $fields[$field_id] : NULL; - } - - /** - * {@inheritdoc} - */ - public function getFields($extract = TRUE) { - if ($extract && !$this->fieldsExtracted) { - $data_type_fallback_mapping = \Drupal::getContainer() - ->get('search_api.data_type_helper') - ->getDataTypeFallbackMapping($this->index); - foreach ([NULL, $this->getDatasourceId()] as $datasource_id) { - $fields_by_property_path = []; - $processors_with_fields = []; - $properties = $this->index->getPropertyDefinitions($datasource_id); - foreach ($this->index->getFieldsByDatasource($datasource_id) as $field_id => $field) { - // Don't overwrite fields that were previously set. - if (empty($this->fields[$field_id])) { - $this->fields[$field_id] = clone $field; - - $field_data_type = $this->fields[$field_id]->getType(); - // If the field data type is in the fallback mapping list, then use - // the fallback type as field type. - if (isset($data_type_fallback_mapping[$field_data_type])) { - $this->fields[$field_id]->setType($data_type_fallback_mapping[$field_data_type]); - } - - // For determining whether the field is provided via a processor, we - // need to check using the first part of its property path (in other - // words, the property that's directly on the result item, not - // nested), since only direct properties of the item can be added by - // the processor. - $property = NULL; - $property_name = Utility::splitPropertyPath($field->getPropertyPath(), FALSE)[0]; - if (isset($properties[$property_name])) { - $property = $properties[$property_name]; - } - if ($property instanceof ProcessorPropertyInterface) { - $processors_with_fields[$property->getProcessorId()] = TRUE; - } - elseif ($datasource_id) { - $fields_by_property_path[$field->getPropertyPath()][] = $this->fields[$field_id]; - } - } - } - try { - if ($fields_by_property_path) { - \Drupal::getContainer() - ->get('search_api.fields_helper') - ->extractFields($this->getOriginalObject(), $fields_by_property_path, $this->getLanguage()); - } - if ($processors_with_fields) { - $processors = $this->index->getProcessorsByStage(ProcessorInterface::STAGE_ADD_PROPERTIES); - foreach ($processors as $processor_id => $processor) { - if (isset($processors_with_fields[$processor_id])) { - $processor->addFieldValues($this); - } - } - } - } - catch (SearchApiException $e) { - // If we couldn't load the object, just log an error and fail - // silently to set the values. - $this->logException($e); - } - } - $this->fieldsExtracted = TRUE; - } - return $this->fields; - } - - /** - * {@inheritdoc} - */ - public function setField($field_id, FieldInterface $field = NULL) { - if ($field) { - if ($field->getFieldIdentifier() !== $field_id) { - throw new \InvalidArgumentException('The field identifier passed must be consistent with the identifier set on the field object.'); - } - // Make sure that the field has the same index object set as we. This - // might otherwise cause impossibly hard-to-detect bugs. - $field->setIndex($this->index); - $this->fields[$field_id] = $field; - } - else { - unset($this->fields[$field_id]); - } - return $this; - } - - /** - * {@inheritdoc} - */ - public function setFields(array $fields) { - // Make sure that all fields have the same index object set as we. This - // might otherwise cause impossibly hard-to-detect bugs. - /** @var \Drupal\search_api\Item\FieldInterface $field */ - foreach ($fields as $field) { - $field->setIndex($this->index); - } - $this->fields = $fields; - return $this; - } - - /** - * {@inheritdoc} - */ - public function isFieldsExtracted() { - return $this->fieldsExtracted; - } - - /** - * {@inheritdoc} - */ - public function setFieldsExtracted($fields_extracted) { - $this->fieldsExtracted = $fields_extracted; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getScore() { - return $this->score; - } - - /** - * {@inheritdoc} - */ - public function setScore($score) { - $this->score = $score; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getBoost() { - return $this->boost; - } - - /** - * {@inheritdoc} - */ - public function setBoost($boost) { - $this->boost = $boost; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getExcerpt() { - return $this->excerpt; - } - - /** - * {@inheritdoc} - */ - public function setExcerpt($excerpt) { - $this->excerpt = $excerpt; - return $this; - } - - /** - * {@inheritdoc} - */ - public function hasExtraData($key) { - return array_key_exists($key, $this->extraData); - } - - /** - * {@inheritdoc} - */ - public function getExtraData($key, $default = NULL) { - return array_key_exists($key, $this->extraData) ? $this->extraData[$key] : $default; - } - - /** - * {@inheritdoc} - */ - public function getAllExtraData() { - return $this->extraData; - } - - /** - * {@inheritdoc} - */ - public function setExtraData($key, $data = NULL) { - if (isset($data)) { - $this->extraData[$key] = $data; - } - else { - unset($this->extraData[$key]); - } - return $this; - } - - /** - * {@inheritdoc} - */ - public function checkAccess(AccountInterface $account = NULL) { - try { - return $this->getDatasource() - ->checkItemAccess($this->getOriginalObject(), $account); - } - catch (SearchApiException $e) { - return FALSE; - } - } - - /** - * {@inheritdoc} - */ - public function getIterator() { - return new \ArrayIterator($this->getFields()); - } - - /** - * Implements the magic __clone() method to implement a deep clone. - */ - public function __clone() { - // The fields definitely need to be cloned. For the extra data its hard (or, - // rather, impossible) to tell, but we opt for cloning objects there, too, - // to be on the (hopefully) safer side. (Ideas for later: introduce an - // interface that tells us to not clone the data object; or check whether - // its an entity; or introduce some other system to override this default.) - foreach ($this->fields as $field_id => $field) { - $this->fields[$field_id] = clone $field; - } - foreach ($this->extraData as $key => $data) { - if (is_object($data)) { - $this->extraData[$key] = clone $data; - } - } - } - - /** - * Implements the magic __toString() method to simplify debugging. - */ - public function __toString() { - $out = 'Item ' . $this->getId(); - if ($this->getScore() != 1) { - $out .= "\nScore: " . $this->getScore(); - } - if ($this->getBoost() != 1) { - $out .= "\nBoost: " . $this->getBoost(); - } - if ($this->getExcerpt()) { - $excerpt = str_replace("\n", "\n ", $this->getExcerpt()); - $out .= "\nExcerpt: $excerpt"; - } - if ($this->getFields()) { - $out .= "\nFields:"; - foreach ($this->getFields() as $field) { - $field = str_replace("\n", "\n ", "$field"); - $out .= "\n- " . $field; - } - } - if ($this->getAllExtraData()) { - $data = str_replace("\n", "\n ", print_r($this->getAllExtraData(), TRUE)); - $out .= "\nExtra data: " . $data; - } - return $out; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Item/ItemInterface.php b/sites/all/modules/contrib/search/search_api/src/Item/ItemInterface.php deleted file mode 100644 index a3fdbb6f5..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Item/ItemInterface.php +++ /dev/null @@ -1,301 +0,0 @@ -logger ?: \Drupal::service('logger.channel.search_api'); - } - - /** - * Sets the logger. - * - * @param \Psr\Log\LoggerInterface $logger - * The new logger. - * - * @return $this - */ - public function setLogger(LoggerInterface $logger) { - $this->logger = $logger; - return $this; - } - - /** - * Logs an exception. - * - * @param \Exception $exception - * The exception that is going to be logged. - * @param string|null $message - * (optional) The message to display in the log, which can use variables - * retrieved from the exception (like "%type" or "@message"). Or NULL to use - * the default message. - * @param array $variables - * (optional) Array of variables to replace in the message when it is - * displayed, or NULL if the message should not be translated. The normal - * patterns for translation variables can be used. - * @param int $severity - * (optional) The severity of the message, as per RFC 3164. - * @param string|null $link - * (optional) A link to associate with the message, if any. - * - * @see watchdog_exception() - * @see \Drupal\Core\Utility\Error::decodeException() - */ - protected function logException(\Exception $exception, $message = NULL, array $variables = [], $severity = RfcLogLevel::ERROR, $link = NULL) { - // Use a default value if $message is not set. - if (empty($message)) { - $message = '%type: @message in %function (line %line of %file).'; - } - - if ($link) { - $variables['link'] = $link; - } - - $variables += Error::decodeException($exception); - - $this->getLogger()->log($severity, $message, $variables); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/ParamConverter/SearchApiConverter.php b/sites/all/modules/contrib/search/search_api/src/ParamConverter/SearchApiConverter.php deleted file mode 100644 index a3929bf09..000000000 --- a/sites/all/modules/contrib/search/search_api/src/ParamConverter/SearchApiConverter.php +++ /dev/null @@ -1,97 +0,0 @@ -tempStoreFactory = $temp_store_factory; - $this->currentUser = $user; - } - - /** - * {@inheritdoc} - */ - public function convert($value, $definition, $name, array $defaults) { - /** @var \Drupal\search_api\IndexInterface $entity */ - $storage = $this->entityManager->getStorage('search_api_index'); - if (!($storage instanceof ConfigEntityStorageInterface)) { - return NULL; - } - if (!($entity = $storage->loadOverrideFree($value))) { - return NULL; - } - - // Get the temp store for this variable if it needs one. Attempt to load the - // index from the temp store, update the currently logged-in user's ID and - // store the lock metadata. - $store = $this->tempStoreFactory->get('search_api_index'); - $current_user_id = $this->currentUser->id() ?: session_id(); - /** @var \Drupal\search_api\IndexInterface|\Drupal\search_api\UnsavedIndexConfiguration $index */ - if ($index = $store->get($value)) { - $index = new UnsavedIndexConfiguration($index, $store, $current_user_id); - $index->setLockInformation($store->getMetadata($value)); - $index->setEntityTypeManager($this->entityManager); - } - // Otherwise, create a new temporary copy of the search index. - else { - $index = new UnsavedIndexConfiguration($entity, $store, $current_user_id); - } - - return $index; - } - - /** - * {@inheritdoc} - */ - public function applies($definition, $name, Route $route) { - if (parent::applies($definition, $name, $route)) { - return !empty($definition['tempstore']) && $definition['type'] === 'entity:search_api_index'; - } - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModeInterface.php b/sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModeInterface.php deleted file mode 100644 index 46b1fc3d9..000000000 --- a/sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModeInterface.php +++ /dev/null @@ -1,75 +0,0 @@ -getPluginDefinition(); - return $plugin_definition['label']; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['description']; - } - - /** - * {@inheritdoc} - */ - public function getConjunction() { - return $this->conjunction; - } - - /** - * {@inheritdoc} - */ - public function setConjunction($conjunction) { - $this->conjunction = $conjunction; - return $this; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModePluginManager.php b/sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModePluginManager.php deleted file mode 100644 index d913d9a25..000000000 --- a/sites/all/modules/contrib/search/search_api/src/ParseMode/ParseModePluginManager.php +++ /dev/null @@ -1,72 +0,0 @@ -setCacheBackend($cache_backend, 'search_api_parse_mode'); - $this->alterInfo('search_api_parse_mode_info'); - } - - /** - * Returns all known parse modes. - * - * @return \Drupal\search_api\ParseMode\ParseModeInterface[] - * An array of parse mode plugins, keyed by type identifier. - */ - public function getInstances() { - $parse_modes = []; - - foreach ($this->getDefinitions() as $plugin_id => $definition) { - if (class_exists($definition['class'])) { - $parse_modes[$plugin_id] = $this->createInstance($plugin_id); - } - } - - return $parse_modes; - } - - /** - * Returns all parse modes known by the Search API as an options list. - * - * @return string[] - * An associative array with all parse mode's IDs as keys, mapped to their - * translated labels. - * - * @see \Drupal\search_api\ParseMode\ParseModePluginManager::getInstances() - */ - public function getInstancesOptions() { - $parse_modes = []; - foreach ($this->getInstances() as $id => $info) { - $parse_modes[$id] = $info->label(); - } - return $parse_modes; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginBase.php b/sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginBase.php deleted file mode 100644 index 37c1e37ca..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginBase.php +++ /dev/null @@ -1,95 +0,0 @@ -defaultConfiguration(); - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $plugin = new static($configuration, $plugin_id, $plugin_definition); - - /** @var \Drupal\Core\StringTranslation\TranslationInterface $translation */ - $translation = $container->get('string_translation'); - $plugin->setStringTranslation($translation); - - return $plugin; - } - - /** - * {@inheritdoc} - */ - public function label() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['label']; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - $plugin_definition = $this->getPluginDefinition(); - return isset($plugin_definition['description']) ? $plugin_definition['description'] : ''; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return []; - } - - /** - * {@inheritdoc} - */ - public function getConfiguration() { - return $this->configuration; - } - - /** - * {@inheritdoc} - */ - public function setConfiguration(array $configuration) { - $this->configuration = $configuration + $this->defaultConfiguration(); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - return []; - } - - /** - * {@inheritdoc} - */ - public function onDependencyRemoval(array $dependencies) { - // By default, we're not reacting to anything and so we should leave - // everything as it was. - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginInterface.php b/sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginInterface.php deleted file mode 100644 index 44d3b5af7..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/ConfigurablePluginInterface.php +++ /dev/null @@ -1,57 +0,0 @@ -pluginDefinition['no_ui']); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/HideablePluginInterface.php b/sites/all/modules/contrib/search/search_api/src/Plugin/HideablePluginInterface.php deleted file mode 100644 index 5925118dd..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/HideablePluginInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -setIndex($configuration['#index']); - unset($configuration['#index']); - } - parent::__construct($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public function getIndex() { - return $this->index; - } - - /** - * {@inheritdoc} - */ - public function setIndex(IndexInterface $index) { - $this->index = $index; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/IndexPluginInterface.php b/sites/all/modules/contrib/search/search_api/src/Plugin/IndexPluginInterface.php deleted file mode 100644 index b42db65c4..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/IndexPluginInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -setConfiguration($form_state->getValues()); - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/BooleanDataType.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/BooleanDataType.php deleted file mode 100644 index 2be11146a..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/BooleanDataType.php +++ /dev/null @@ -1,19 +0,0 @@ -setDefaultDateTime(); - } - return $date->getTimestamp(); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/DecimalDataType.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/DecimalDataType.php deleted file mode 100644 index 3b6a4858a..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/DecimalDataType.php +++ /dev/null @@ -1,19 +0,0 @@ -text = $text; - $this->boost = $boost; - } - - /** - * {@inheritdoc} - */ - public function getText() { - return $this->text; - } - - /** - * {@inheritdoc} - */ - public function setText($text) { - $this->text = $text; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getBoost() { - return $this->boost; - } - - /** - * {@inheritdoc} - */ - public function setBoost($boost) { - $this->boost = $boost; - return $this; - } - - /** - * Implements the magic __toString() method. - */ - public function __toString() { - return $this->getText(); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextTokenInterface.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextTokenInterface.php deleted file mode 100644 index 257efb48d..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextTokenInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -text = $this->originalText = $text; - } - - /** - * {@inheritdoc} - */ - public function getText() { - return $this->text; - } - - /** - * {@inheritdoc} - */ - public function toText() { - $tokens = $this->getTokens(); - if ($tokens !== NULL) { - $to_string = function (TextTokenInterface $token) { - return $token->getText(); - }; - return implode(' ', array_map($to_string, $tokens)); - } - return $this->getText(); - } - - /** - * {@inheritdoc} - */ - public function setText($text) { - $this->text = $text; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOriginalText() { - return $this->originalText; - } - - /** - * {@inheritdoc} - */ - public function setOriginalText($originalText) { - $this->originalText = $originalText; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getTokens() { - return $this->tokens; - } - - /** - * {@inheritdoc} - */ - public function setTokens(array $tokens = NULL) { - $this->tokens = $tokens; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getProperties() { - return $this->properties; - } - - /** - * {@inheritdoc} - */ - public function getProperty($name, $default = NULL) { - if (array_key_exists($name, $this->properties)) { - return $this->properties[$name]; - } - return $default; - } - - /** - * {@inheritdoc} - */ - public function setProperties(array $properties) { - $this->properties = $properties; - return $this; - } - - /** - * {@inheritdoc} - */ - public function setProperty($name, $value = TRUE) { - $this->properties[$name] = $value; - return $this; - } - - /** - * Implements the magic __toString() method. - */ - public function __toString() { - return $this->toText(); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextValueInterface.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextValueInterface.php deleted file mode 100644 index 2b4b601b2..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/data_type/value/TextValueInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -setIndex($configuration['#index']); - unset($configuration['#index']); - } - - // Since defaultConfiguration() depends on the plugin definition, we need to - // override the constructor and set the definition property before calling - // that method. - $this->pluginDefinition = $plugin_definition; - $this->pluginId = $plugin_id; - $this->configuration = $configuration + $this->defaultConfiguration(); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - /** @var static $datasource */ - $datasource = parent::create($container, $configuration, $plugin_id, $plugin_definition); - - $datasource->setEntityTypeManager($container->get('entity_type.manager')); - $datasource->setEntityFieldManager($container->get('entity_field.manager')); - $datasource->setEntityDisplayRepository($container->get('entity_display.repository')); - $datasource->setEntityTypeBundleInfo($container->get('entity_type.bundle.info')); - $datasource->setTypedDataManager($container->get('typed_data_manager')); - $datasource->setConfigFactory($container->get('config.factory')); - $datasource->setLanguageManager($container->get('language_manager')); - $datasource->setFieldsHelper($container->get('search_api.fields_helper')); - - return $datasource; - } - - /** - * Retrieves the entity type manager. - * - * @return \Drupal\Core\Entity\EntityTypeManagerInterface - * The entity type manager. - */ - public function getEntityTypeManager() { - return $this->entityTypeManager ?: \Drupal::entityTypeManager(); - } - - /** - * Retrieves the entity storage. - * - * @return \Drupal\Core\Entity\EntityStorageInterface - * The entity storage. - */ - protected function getEntityStorage() { - return $this->getEntityTypeManager()->getStorage($this->getEntityTypeId()); - } - - /** - * Returns the definition of this datasource's entity type. - * - * @return \Drupal\Core\Entity\EntityTypeInterface - * The entity type definition. - */ - protected function getEntityType() { - return $this->getEntityTypeManager() - ->getDefinition($this->getEntityTypeId()); - } - - /** - * Sets the entity type manager. - * - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The new entity type manager. - * - * @return $this - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) { - $this->entityTypeManager = $entity_type_manager; - return $this; - } - - /** - * Retrieves the entity field manager. - * - * @return \Drupal\Core\Entity\EntityFieldManagerInterface - * The entity field manager. - */ - public function getEntityFieldManager() { - return $this->entityFieldManager ?: \Drupal::service('entity_field.manager'); - } - - /** - * Sets the entity field manager. - * - * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager - * The new entity field manager. - * - * @return $this - */ - public function setEntityFieldManager(EntityFieldManagerInterface $entity_field_manager) { - $this->entityFieldManager = $entity_field_manager; - return $this; - } - - /** - * Retrieves the entity display repository. - * - * @return \Drupal\Core\Entity\EntityDisplayRepositoryInterface - * The entity entity display repository. - */ - public function getEntityDisplayRepository() { - return $this->entityDisplayRepository ?: \Drupal::service('entity_display.repository'); - } - - /** - * Sets the entity display repository. - * - * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository - * The new entity display repository. - * - * @return $this - */ - public function setEntityDisplayRepository(EntityDisplayRepositoryInterface $entity_display_repository) { - $this->entityDisplayRepository = $entity_display_repository; - return $this; - } - - /** - * Retrieves the entity display repository. - * - * @return \Drupal\Core\Entity\EntityTypeBundleInfoInterface - * The entity entity display repository. - */ - public function getEntityTypeBundleInfo() { - return $this->entityTypeBundleInfo ?: \Drupal::service('entity_type.bundle.info'); - } - - /** - * Sets the entity type bundle info. - * - * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info - * The new entity type bundle info. - * - * @return $this - */ - public function setEntityTypeBundleInfo(EntityTypeBundleInfoInterface $entity_type_bundle_info) { - $this->entityTypeBundleInfo = $entity_type_bundle_info; - return $this; - } - - /** - * Retrieves the typed data manager. - * - * @return \Drupal\Core\TypedData\TypedDataManagerInterface - * The typed data manager. - */ - public function getTypedDataManager() { - return $this->typedDataManager ?: \Drupal::typedDataManager(); - } - - /** - * Sets the typed data manager. - * - * @param \Drupal\Core\TypedData\TypedDataManagerInterface $typed_data_manager - * The new typed data manager. - * - * @return $this - */ - public function setTypedDataManager(TypedDataManagerInterface $typed_data_manager) { - $this->typedDataManager = $typed_data_manager; - return $this; - } - - /** - * Retrieves the config factory. - * - * @return \Drupal\Core\Config\ConfigFactoryInterface - * The config factory. - */ - public function getConfigFactory() { - return $this->configFactory ?: \Drupal::configFactory(); - } - - /** - * Retrieves the config value for a certain key in the Search API settings. - * - * @param string $key - * The key whose value should be retrieved. - * - * @return mixed - * The config value for the given key. - */ - protected function getConfigValue($key) { - return $this->getConfigFactory()->get('search_api.settings')->get($key); - } - - /** - * Sets the config factory. - * - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The new config factory. - * - * @return $this - */ - public function setConfigFactory(ConfigFactoryInterface $config_factory) { - $this->configFactory = $config_factory; - return $this; - } - - /** - * Retrieves the language manager. - * - * @return \Drupal\Core\Language\LanguageManagerInterface - * The language manager. - */ - public function getLanguageManager() { - return $this->languageManager ?: \Drupal::languageManager(); - } - - /** - * Sets the language manager. - * - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * The new language manager. - */ - public function setLanguageManager(LanguageManagerInterface $language_manager) { - $this->languageManager = $language_manager; - } - - /** - * Retrieves the fields helper. - * - * @return \Drupal\search_api\Utility\FieldsHelperInterface - * The fields helper. - */ - public function getFieldsHelper() { - return $this->fieldsHelper ?: \Drupal::service('search_api.fields_helper'); - } - - /** - * Sets the fields helper. - * - * @param \Drupal\search_api\Utility\FieldsHelperInterface $fields_helper - * The new fields helper. - * - * @return $this - */ - public function setFieldsHelper(FieldsHelperInterface $fields_helper) { - $this->fieldsHelper = $fields_helper; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPropertyDefinitions() { - $type = $this->getEntityTypeId(); - $properties = $this->getEntityFieldManager()->getBaseFieldDefinitions($type); - if ($bundles = array_keys($this->getBundles())) { - foreach ($bundles as $bundle_id) { - $properties += $this->getEntityFieldManager()->getFieldDefinitions($type, $bundle_id); - } - } - // Exclude properties with custom storage, since we can't extract them - // currently, due to a shortcoming of Core's Typed Data API. See #2695527. - // Computed properties should mostly be OK, though, even though they still - // count as having "custom storage". The "Path" field from the Core module - // does not work, though, so we explicitly exclude it here to avoid - // confusion. - foreach ($properties as $key => $property) { - if (!$property->isComputed() || $key === 'path') { - if ($property->getFieldStorageDefinition()->hasCustomStorage()) { - unset($properties[$key]); - } - } - } - return $properties; - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $ids) { - $allowed_languages = $this->getLanguages(); - // Always allow items with undefined language. (Can be the case when - // entities are created programmatically.) - $allowed_languages[LanguageInterface::LANGCODE_NOT_SPECIFIED] = TRUE; - $allowed_languages[LanguageInterface::LANGCODE_NOT_APPLICABLE] = TRUE; - - $entity_ids = []; - foreach ($ids as $item_id) { - $pos = strrpos($item_id, ':'); - // This can only happen if someone passes an invalid ID, since we always - // include a language code. Still, no harm in guarding against bad input. - if ($pos === FALSE) { - continue; - } - $entity_id = substr($item_id, 0, $pos); - $langcode = substr($item_id, $pos + 1); - if (isset($allowed_languages[$langcode])) { - $entity_ids[$entity_id][$item_id] = $langcode; - } - } - - /** @var \Drupal\Core\Entity\ContentEntityInterface[] $entities */ - $entities = $this->getEntityStorage()->loadMultiple(array_keys($entity_ids)); - $items = []; - $allowed_bundles = $this->getBundles(); - foreach ($entity_ids as $entity_id => $langcodes) { - if (empty($entities[$entity_id]) || !isset($allowed_bundles[$entities[$entity_id]->bundle()])) { - continue; - } - foreach ($langcodes as $item_id => $langcode) { - if ($entities[$entity_id]->hasTranslation($langcode)) { - $items[$item_id] = $entities[$entity_id]->getTranslation($langcode)->getTypedData(); - } - } - } - - return $items; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - $default_configuration = []; - - if ($this->hasBundles()) { - $default_configuration['bundles'] = [ - 'default' => TRUE, - 'selected' => [], - ]; - } - - if ($this->isTranslatable()) { - $default_configuration['languages'] = [ - 'default' => TRUE, - 'selected' => [], - ]; - } - - return $default_configuration; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - if ($this->hasBundles() && ($bundles = $this->getEntityBundleOptions())) { - $form['bundles'] = [ - '#type' => 'details', - '#title' => $this->t('Bundles'), - '#open' => TRUE, - ]; - $form['bundles']['default'] = [ - '#type' => 'radios', - '#title' => $this->t('Which bundles should be indexed?'), - '#options' => [ - 0 => $this->t('Only those selected'), - 1 => $this->t('All except those selected'), - ], - '#default_value' => (int) $this->configuration['bundles']['default'], - ]; - $form['bundles']['selected'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Bundles'), - '#options' => $bundles, - '#default_value' => $this->configuration['bundles']['selected'], - '#size' => min(4, count($bundles)), - '#multiple' => TRUE, - ]; - } - - if ($this->isTranslatable()) { - $form['languages'] = [ - '#type' => 'details', - '#title' => $this->t('Languages'), - '#open' => TRUE, - ]; - $form['languages']['default'] = [ - '#type' => 'radios', - '#title' => $this->t('Which languages should be indexed?'), - '#options' => [ - 0 => $this->t('Only those selected'), - 1 => $this->t('All except those selected'), - ], - '#default_value' => (int) $this->configuration['languages']['default'], - ]; - $form['languages']['selected'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Languages'), - '#options' => $this->getTranslationOptions(), - '#default_value' => $this->configuration['languages']['selected'], - '#multiple' => TRUE, - ]; - } - - return $form; - } - - /** - * Retrieves the available bundles of this entity type as an options list. - * - * @return array - * An associative array of bundle labels, keyed by the bundle name. - */ - protected function getEntityBundleOptions() { - $options = []; - if (($bundles = $this->getEntityBundles())) { - foreach ($bundles as $bundle => $bundle_info) { - $options[$bundle] = Utility::escapeHtml($bundle_info['label']); - } - } - return $options; - } - - /** - * Retrieves the available languages of this entity type as an options list. - * - * @return array - * An associative array of language labels, keyed by the language name. - */ - protected function getTranslationOptions() { - $options = []; - foreach ($this->getLanguageManager()->getLanguages() as $language) { - $options[$language->getId()] = $language->getName(); - } - - return $options; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - // Filter out empty checkboxes. - foreach (['bundles', 'languages'] as $key) { - if ($form_state->hasValue($key)) { - $parents = [$key, 'selected']; - $value = $form_state->getValue($parents, []); - $value = array_keys(array_filter($value)); - $form_state->setValue($parents, $value); - } - } - - $this->setConfiguration($form_state->getValues()); - } - - /** - * Retrieves the entity from a search item. - * - * @param \Drupal\Core\TypedData\ComplexDataInterface $item - * An item of this datasource's type. - * - * @return \Drupal\Core\Entity\EntityInterface|null - * The entity object represented by that item, or NULL if none could be - * found. - */ - protected function getEntity(ComplexDataInterface $item) { - $value = $item->getValue(); - return $value instanceof EntityInterface ? $value : NULL; - } - - /** - * {@inheritdoc} - */ - public function getItemId(ComplexDataInterface $item) { - if ($entity = $this->getEntity($item)) { - $enabled_bundles = $this->getBundles(); - if (isset($enabled_bundles[$entity->bundle()])) { - return $entity->id() . ':' . $entity->language()->getId(); - } - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getItemLabel(ComplexDataInterface $item) { - if ($entity = $this->getEntity($item)) { - return $entity->label(); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getItemBundle(ComplexDataInterface $item) { - if ($entity = $this->getEntity($item)) { - return $entity->bundle(); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getItemUrl(ComplexDataInterface $item) { - if ($entity = $this->getEntity($item)) { - if ($entity->hasLinkTemplate('canonical')) { - return $entity->toUrl('canonical'); - } - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function checkItemAccess(ComplexDataInterface $item, AccountInterface $account = NULL) { - if ($entity = $this->getEntity($item)) { - return $this->getEntityTypeManager() - ->getAccessControlHandler($this->getEntityTypeId()) - ->access($entity, 'view', $account); - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getItemIds($page = NULL) { - return $this->getPartialItemIds($page); - } - - /** - * {@inheritdoc} - */ - public function getEntityTypeId() { - $plugin_definition = $this->getPluginDefinition(); - return $plugin_definition['entity_type']; - } - - /** - * Determines whether the entity type supports bundles. - * - * @return bool - * TRUE if the entity type supports bundles, FALSE otherwise. - */ - protected function hasBundles() { - return $this->getEntityType()->hasKey('bundle'); - } - - /** - * Determines whether the entity type supports translations. - * - * @return bool - * TRUE if the entity is translatable, FALSE otherwise. - */ - protected function isTranslatable() { - return $this->getEntityType()->isTranslatable(); - } - - /** - * Retrieves all bundles of this datasource's entity type. - * - * @return array - * An associative array of bundle infos, keyed by the bundle names. - */ - protected function getEntityBundles() { - return $this->hasBundles() ? $this->getEntityTypeBundleInfo()->getBundleInfo($this->getEntityTypeId()) : []; - } - - /** - * {@inheritdoc} - */ - public function getPartialItemIds($page = NULL, array $bundles = NULL, array $languages = NULL) { - // These would be pretty pointless calls, but for the sake of completeness - // we should check for them and return early. (Otherwise makes the rest of - // the code more complicated.) - if (($bundles === [] && !$languages) || ($languages === [] && !$bundles)) { - return NULL; - } - - $select = $this->getEntityTypeManager() - ->getStorage($this->getEntityTypeId()) - ->getQuery(); - - // When tracking items, we never want access checks. - $select->accessCheck(FALSE); - - // We want to determine all entities of either one of the given bundles OR - // one of the given languages. That means we can't just filter for $bundles - // if $languages is given. Instead, we have to filter for all bundles we - // might want to include and later sort out those for which we want only the - // translations in $languages and those (matching $bundles) where we want - // all (enabled) translations. - if ($this->hasBundles()) { - $bundle_property = $this->getEntityType()->getKey('bundle'); - if ($bundles && !$languages) { - $select->condition($bundle_property, $bundles, 'IN'); - } - else { - $enabled_bundles = array_keys($this->getBundles()); - // Since this is also called for removed bundles/languages, - // $enabled_bundles might not include $bundles. - if ($bundles) { - $enabled_bundles = array_unique(array_merge($bundles, $enabled_bundles)); - } - if (count($enabled_bundles) < count($this->getEntityBundles())) { - $select->condition($bundle_property, $enabled_bundles, 'IN'); - } - } - } - - if (isset($page)) { - $page_size = $this->getConfigValue('tracking_page_size'); - assert($page_size, 'Tracking page size is not set.'); - $select->range($page * $page_size, $page_size); - // For paging to reliably work, a sort should be present. - $entity_id = $this->getEntityType()->getKey('id'); - $select->sort($entity_id); - } - - $entity_ids = $select->execute(); - - if (!$entity_ids) { - return NULL; - } - - // For all loaded entities, compute all their item IDs (one for each - // translation we want to include). For those matching the given bundles (if - // any), we want to include translations for all enabled languages. For all - // other entities, we just want to include the translations for the - // languages passed to the method (if any). - $item_ids = []; - $enabled_languages = array_keys($this->getLanguages()); - // As above for bundles, $enabled_languages might not include $languages. - if ($languages) { - $enabled_languages = array_unique(array_merge($languages, $enabled_languages)); - } - // Also, we want to always include entities with unknown language. - $enabled_languages[] = LanguageInterface::LANGCODE_NOT_SPECIFIED; - $enabled_languages[] = LanguageInterface::LANGCODE_NOT_APPLICABLE; - - /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - foreach ($this->getEntityStorage()->loadMultiple($entity_ids) as $entity_id => $entity) { - $translations = array_keys($entity->getTranslationLanguages()); - $translations = array_intersect($translations, $enabled_languages); - // If only languages were specified, keep only those translations matching - // them. If bundles were also specified, keep all (enabled) translations - // for those entities that match those bundles. - if ($languages !== NULL - && (!$bundles || !in_array($entity->bundle(), $bundles))) { - $translations = array_intersect($translations, $languages); - } - foreach ($translations as $langcode) { - $item_ids[] = "$entity_id:$langcode"; - } - } - - if (Utility::isRunningInCli()) { - // When running in the CLI, this might be executed for all entities from - // within a single process. To avoid running out of memory, reset the - // static cache after each batch. - $this->getEntityStorage()->resetCache($entity_ids); - } - - return $item_ids; - } - - /** - * {@inheritdoc} - */ - public function getBundles() { - if (!$this->hasBundles()) { - // For entity types that have no bundle, return a default pseudo-bundle. - return [$this->getEntityTypeId() => $this->label()]; - } - - $configuration = $this->getConfiguration(); - - // If "default" is TRUE (that is, "All except those selected"),remove all - // the selected bundles from the available ones to compute the indexed - // bundles. Otherwise, return all the selected bundles. - $bundles = []; - $entity_bundles = $this->getEntityBundles(); - $selected_bundles = array_flip($configuration['bundles']['selected']); - $function = $configuration['bundles']['default'] ? 'array_diff_key' : 'array_intersect_key'; - $entity_bundles = $function($entity_bundles, $selected_bundles); - foreach ($entity_bundles as $bundle_id => $bundle_info) { - $bundles[$bundle_id] = isset($bundle_info['label']) ? $bundle_info['label'] : $bundle_id; - } - return $bundles ?: [$this->getEntityTypeId() => $this->label()]; - } - - /** - * Retrieves the enabled languages. - * - * @return \Drupal\Core\Language\LanguageInterface[] - * All languages that are enabled for this datasource, keyed by language - * code. - */ - protected function getLanguages() { - $all_languages = $this->getLanguageManager()->getLanguages(); - - if ($this->isTranslatable()) { - $selected_languages = array_flip($this->configuration['languages']['selected']); - if ($this->configuration['languages']['default']) { - return array_diff_key($all_languages, $selected_languages); - } - else { - return array_intersect_key($all_languages, $selected_languages); - } - } - - return $all_languages; - } - - /** - * {@inheritdoc} - */ - public function getViewModes($bundle = NULL) { - return $this->getEntityDisplayRepository() - ->getViewModeOptions($this->getEntityTypeId()); - } - - /** - * {@inheritdoc} - */ - public function viewItem(ComplexDataInterface $item, $view_mode, $langcode = NULL) { - try { - if ($entity = $this->getEntity($item)) { - $langcode = $langcode ?: $entity->language()->getId(); - return $this->getEntityTypeManager()->getViewBuilder($this->getEntityTypeId())->view($entity, $view_mode, $langcode); - } - } - catch (\Exception $e) { - // The most common reason for this would be a - // \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException in - // getViewBuilder(), because the entity type definition doesn't specify a - // view_builder class. - } - return []; - } - - /** - * {@inheritdoc} - */ - public function viewMultipleItems(array $items, $view_mode, $langcode = NULL) { - try { - $view_builder = $this->getEntityTypeManager() - ->getViewBuilder($this->getEntityTypeId()); - // Langcode passed, use that for viewing. - if (isset($langcode)) { - $entities = []; - foreach ($items as $i => $item) { - if ($entity = $this->getEntity($item)) { - $entities[$i] = $entity; - } - } - if ($entities) { - return $view_builder->viewMultiple($entities, $view_mode, $langcode); - } - return []; - } - // Otherwise, separate the items by language, keeping the keys. - $items_by_language = []; - foreach ($items as $i => $item) { - if ($entity = $this->getEntity($item)) { - $items_by_language[$entity->language()->getId()][$i] = $entity; - } - } - // Then build the items for each language. We initialize $build beforehand - // and use array_replace() to add to it so the order stays the same. - $build = array_fill_keys(array_keys($items), []); - foreach ($items_by_language as $langcode => $language_items) { - $build = array_replace($build, $view_builder->viewMultiple($language_items, $view_mode, $langcode)); - } - return $build; - } - catch (\Exception $e) { - // The most common reason for this would be a - // \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException in - // getViewBuilder(), because the entity type definition doesn't specify a - // view_builder class. - return []; - } - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $this->dependencies = parent::calculateDependencies(); - - $this->addDependency('module', $this->getEntityType()->getProvider()); - - return $this->dependencies; - } - - /** - * {@inheritdoc} - */ - public function getFieldDependencies(array $fields) { - $dependencies = []; - $properties = $this->getPropertyDefinitions(); - - foreach ($fields as $field_id => $property_path) { - $dependencies[$field_id] = $this->getPropertyPathDependencies($property_path, $properties); - } - - return $dependencies; - } - - /** - * Computes all dependencies of the given property path. - * - * @param string $property_path - * The property path of the property. - * @param \Drupal\Core\TypedData\DataDefinitionInterface[] $properties - * The properties which form the basis for the property path. - * - * @return string[][] - * An associative array with the dependencies for the given property path, - * mapping dependency types to arrays of dependency names. - */ - protected function getPropertyPathDependencies($property_path, array $properties) { - $dependencies = []; - - list($key, $nested_path) = Utility::splitPropertyPath($property_path, FALSE); - if (!isset($properties[$key])) { - return $dependencies; - } - - $property = $properties[$key]; - if ($property instanceof FieldConfigInterface) { - $storage = $property->getFieldStorageDefinition(); - if ($storage instanceof FieldStorageConfigInterface) { - $name = $storage->getConfigDependencyName(); - $dependencies[$storage->getConfigDependencyKey()][$name] = $name; - } - } - - // The field might be provided by a module which is not the provider of the - // entity type, therefore we need to add a dependency on that module. - if ($property instanceof FieldStorageDefinitionInterface) { - $provider = $property->getProvider(); - $dependencies['module'][$provider] = $provider; - } - - $property = $this->getFieldsHelper()->getInnerProperty($property); - - if ($property instanceof EntityDataDefinitionInterface) { - $entity_type_definition = $this->getEntityTypeManager() - ->getDefinition($property->getEntityTypeId()); - if ($entity_type_definition) { - $module = $entity_type_definition->getProvider(); - $dependencies['module'][$module] = $module; - } - } - - if (isset($nested_path) && $property instanceof ComplexDataDefinitionInterface) { - $nested = $this->getFieldsHelper()->getNestedProperties($property); - $nested_dependencies = $this->getPropertyPathDependencies($nested_path, $nested); - foreach ($nested_dependencies as $type => $names) { - $dependencies += [$type => []]; - $dependencies[$type] += $names; - } - } - - return array_map('array_values', $dependencies); - } - - /** - * {@inheritdoc} - */ - public static function getIndexesForEntity(ContentEntityInterface $entity) { - $datasource_id = 'entity:' . $entity->getEntityTypeId(); - $entity_bundle = $entity->bundle(); - $has_bundles = $entity->getEntityType()->hasKey('bundle'); - - // Needed for PhpStorm. See https://youtrack.jetbrains.com/issue/WI-23395. - /** @var \Drupal\search_api\IndexInterface[] $indexes */ - $indexes = Index::loadMultiple(); - - foreach ($indexes as $index_id => $index) { - // Filter out indexes that don't contain the datasource in question. - if (!$index->isValidDatasource($datasource_id)) { - unset($indexes[$index_id]); - } - elseif ($has_bundles) { - // If the entity type supports bundles, we also have to filter out - // indexes that exclude the entity's bundle. - $config = $index->getDatasource($datasource_id)->getConfiguration(); - if (!Utility::matches($entity_bundle, $config['bundles'])) { - unset($indexes[$index_id]); - } - } - } - - return $indexes; - } - - /** - * Filters a set of datasource-specific item IDs. - * - * Returns only those item IDs that are valid for the given datasource and - * index. This method only checks the item language, though – whether an - * entity with that ID actually exists, or whether it has a bundle included - * for that datasource, is not verified. - * - * @param \Drupal\search_api\IndexInterface $index - * The index for which to validate. - * @param string $datasource_id - * The ID of the datasource on the index for which to validate. - * @param string[] $item_ids - * The item IDs to be validated. - * - * @return string[] - * All given item IDs that are valid for that index and datasource. - */ - public static function filterValidItemIds(IndexInterface $index, $datasource_id, array $item_ids) { - if (!$index->isValidDatasource($datasource_id)) { - return $item_ids; - } - $config = $index->getDatasource($datasource_id)->getConfiguration(); - // If the entity type doesn't allow translations, we just accept all IDs. - // (If the entity type were translatable, the config key would have been set - // with the default configuration.) - if (!isset($config['languages']['selected'])) { - return $item_ids; - } - $always_valid = [ - LanguageInterface::LANGCODE_NOT_SPECIFIED, - LanguageInterface::LANGCODE_NOT_APPLICABLE, - ]; - $valid_ids = []; - foreach ($item_ids as $item_id) { - $pos = strrpos($item_id, ':'); - // Item IDs without colons are always invalid. - if ($pos === FALSE) { - continue; - } - $langcode = substr($item_id, $pos + 1); - if (Utility::matches($langcode, $config['languages']) - || in_array($langcode, $always_valid)) { - $valid_ids[] = $item_id; - } - } - return $valid_ids; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityDeriver.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityDeriver.php deleted file mode 100644 index 7f6318fb6..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityDeriver.php +++ /dev/null @@ -1,97 +0,0 @@ -get('entity_type.manager'); - $deriver->setEntityTypeManager($entity_type_manager); - - /** @var \Drupal\Core\StringTranslation\TranslationInterface $translation */ - $translation = $container->get('string_translation'); - $deriver->setStringTranslation($translation); - - return $deriver; - } - - /** - * Retrieves the entity type manager. - * - * @return \Drupal\Core\Entity\EntityTypeManagerInterface - * The entity type manager. - */ - public function getEntityTypeManager() { - return $this->entityTypeManager ?: \Drupal::entityTypeManager(); - } - - /** - * Sets the entity type manager. - * - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager. - * - * @return $this - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) { - $this->entityTypeManager = $entity_type_manager; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - if (!isset($this->derivatives)) { - $plugin_derivatives = []; - foreach ($this->getEntityTypeManager()->getDefinitions() as $entity_type => $entity_type_definition) { - // We only support content entity types at the moment, since config - // entities don't implement \Drupal\Core\TypedData\ComplexDataInterface. - if ($entity_type_definition instanceof ContentEntityType) { - $plugin_derivatives[$entity_type] = [ - 'entity_type' => $entity_type, - 'label' => $entity_type_definition->getLabel(), - 'description' => $this->t('Provides %entity_type entities for indexing and searching.', ['%entity_type' => $entity_type_definition->getLabel()]), - ] + $base_plugin_definition; - } - } - - $this->derivatives = $plugin_derivatives; - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityTaskManager.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityTaskManager.php deleted file mode 100644 index e6fde8128..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/ContentEntityTaskManager.php +++ /dev/null @@ -1,113 +0,0 @@ -taskManager = $task_manager; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events['search_api.task.' . self::INSERT_ITEMS_TASK_TYPE][] = ['processEvent']; - $events['search_api.task.' . self::DELETE_ITEMS_TASK_TYPE][] = ['processEvent']; - - return $events; - } - - /** - * Processes a datasource tracking event. - * - * @param \Drupal\search_api\Task\TaskEvent $event - * The task event. - * @param string $event_name - * The name of the event. - */ - public function processEvent(TaskEvent $event, $event_name) { - $event->stopPropagation(); - - // The complete event name prefix in front of the method name is 45 - // characters long: "search_api.task.search_api.entity_datasource.". - $method = substr($event_name, 45); - - $task = $event->getTask(); - $index = $task->getIndex(); - $data = $task->getData(); - - if (!$index->hasValidTracker()) { - $args['%index'] = $index->label(); - $message = new FormattableMarkup('Index %index does not have a valid tracker set.', $args); - $event->setException(new SearchApiException($message)); - return; - } - - $datasource_id = $data['datasource']; - $reschedule = FALSE; - if ($index->isValidDatasource($datasource_id)) { - $datasource = $index->getDatasource($datasource_id); - if ($datasource instanceof EntityDatasourceInterface) { - $raw_ids = $datasource->getPartialItemIds($data['page'], $data['bundles'], $data['languages']); - if ($raw_ids !== NULL) { - $reschedule = TRUE; - if ($raw_ids) { - $index->startBatchTracking(); - $index->$method($datasource_id, $raw_ids); - $index->stopBatchTracking(); - } - } - } - } - - if ($reschedule) { - ++$data['page']; - $this->taskManager->addTask($task->getType(), NULL, $index, $data); - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/EntityDatasourceInterface.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/EntityDatasourceInterface.php deleted file mode 100644 index db92c8954..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/datasource/EntityDatasourceInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -pluginDefinition['view_id'] . '-' . $this->pluginDefinition['view_display']; - $blocks = $this->getEntityTypeManager() - ->getStorage('block') - ->loadByProperties(['plugin' => $plugin_id]); - foreach ($blocks as $block) { - if ($block->access('view')) { - return TRUE; - } - } - - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayBase.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayBase.php deleted file mode 100644 index d8ef7bdb6..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayBase.php +++ /dev/null @@ -1,108 +0,0 @@ -setCurrentRouteMatch($container->get('current_route_match')); - - return $display; - } - - /** - * Retrieves the current route match service. - * - * @return \Drupal\Core\Routing\RouteMatchInterface - * The current route match service. - */ - public function getCurrentRouteMatch() { - return $this->currentRouteMatch ?: \Drupal::routeMatch(); - } - - /** - * Sets the current route match service. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $current_route_match - * The new current route match service. - * - * @return $this - */ - public function setCurrentRouteMatch(RouteMatchInterface $current_route_match) { - $this->currentPath = $current_route_match; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPath() { - $path = parent::getPath(); - - // Recreating a link when a contextual filter is used in the display's path - // is not possible. So instead we return NULL, which forces most - // implementations to use the current request's path instead. - if (strpos($path, '%') !== FALSE) { - return NULL; - } - - return $path; - } - - /** - * {@inheritdoc} - */ - public function isRenderedInCurrentRequest() { - $plugin_definition = $this->getPluginDefinition(); - $current_route = $this->getCurrentRouteMatch(); - $view_id = $current_route->getParameter('view_id'); - $display_id = $current_route->getParameter('display_id'); - return $view_id === $plugin_definition['view_id'] && - $display_id === $plugin_definition['view_display']; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $dependencies = parent::calculateDependencies(); - - $view = $this->getView(); - $dependencies[$view->getConfigDependencyKey()][] = $view->getConfigDependencyName(); - - return $dependencies; - } - - /** - * Retrieves the view this search display is based on. - * - * @returns \Drupal\views\ViewEntityInterface - */ - protected function getView() { - $plugin_definition = $this->getPluginDefinition(); - return $this->getEntityTypeManager() - ->getStorage('view') - ->load($plugin_definition['view_id']); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayDeriver.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayDeriver.php deleted file mode 100644 index 8ed5701a5..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsDisplayDeriver.php +++ /dev/null @@ -1,122 +0,0 @@ -derivatives)) { - $this->derivatives = []; - - try { - /** @var \Drupal\Core\Entity\EntityStorageInterface $views_storage */ - $views_storage = $this->entityTypeManager->getStorage('view'); - $all_views = $views_storage->loadMultiple(); - } - catch (PluginNotFoundException $e) { - return $this->derivatives; - } - - /** @var \Drupal\views\Entity\View $view */ - foreach ($all_views as $view) { - $this->derivatives += $this->getDisplaysForView($base_plugin_definition, $view, $this->derivatives); - } - } - - return $this->derivatives; - } - - /** - * Creates derived plugin definitions for a view. - * - * @param array $base_plugin_definition - * The plugin definition for this plugin. - * @param \Drupal\views\ViewEntityInterface $view - * The view to create plugin definitions for. - * @param array $plugin_derivatives - * An array of already existing derived plugin definitions. - * - * @return array - * Returns an array of plugin definitions, keyed by derivative ID. - */ - protected function getDisplaysForView(array $base_plugin_definition, ViewEntityInterface $view, array $plugin_derivatives) { - $type = $base_plugin_definition['views_display_type']; - - $index = SearchApiQuery::getIndexFromTable($view->get('base_table')); - if (!$index instanceof IndexInterface) { - return []; - } - - $displays = $view->get('display'); - foreach ($displays as $name => $display_info) { - if ($display_info['display_plugin'] == $type) { - // Create a machine name by getting the view ID and appending the name - // of the display to it (block1, rest_export, foobar). - $base_machine_name = $view->id() . '__' . $name; - $machine_name = $base_machine_name; - - // Make sure the machine name is unique. (Will almost always be - // the case, unless a view or page ID contains two consecutive - // underscores.) - $i = 0; - while (isset($plugin_derivatives[$machine_name])) { - $machine_name = $base_machine_name . '_' . ++$i; - } - - $label_arguments = [ - '%view_name' => $view->label(), - '%display_title' => $display_info['display_title'], - ]; - $label = $this->t('View %view_name, display %display_title', $label_arguments); - - $executable = $view->getExecutable(); - $executable->setDisplay($name); - $display = $executable->getDisplay(); - - // Create the actual derivative plugin definition. - $args = [ - '%view_name' => $view->label(), - '%display_title' => $display_info['display_title'], - ]; - if ($view->get('description')) { - $args['%view_description'] = $view->get('description'); - $description = $this->t('%view_description – Represents the display %display_title of view %view_name.', $args); - } - else { - $description = $this->t('Represents the display %display_title of view %view_name.', $args); - } - $plugin_derivatives[$machine_name] = [ - 'label' => $label, - 'description' => $description, - 'view_id' => $view->id(), - 'view_display' => $name, - 'index' => $index->id(), - ] + $base_plugin_definition; - - // Add the path information to the definition. - if ($display->hasPath()) { - $plugin_derivatives[$machine_name]['path'] = '/' . $display->getPath(); - } - } - } - - return $plugin_derivatives; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsEmbed.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsEmbed.php deleted file mode 100644 index 717654b3c..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/display/ViewsEmbed.php +++ /dev/null @@ -1,14 +0,0 @@ - $this->getConjunction(), - $keys, - ]; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/parse_mode/Terms.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/parse_mode/Terms.php deleted file mode 100644 index e5ea66e9b..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/parse_mode/Terms.php +++ /dev/null @@ -1,60 +0,0 @@ - $v) { - if (!$v) { - continue; - } - if ($quoted) { - if (substr($v, -1) == '"') { - $v = substr($v, 0, -1); - $str .= ' ' . $v; - $ret[$k] = $str; - $quoted = FALSE; - } - else { - $str .= ' ' . $v; - unset($ret[$k]); - } - } - elseif ($v[0] == '"') { - $len = strlen($v); - if ($len > 1 && $v[$len - 1] == '"') { - $ret[$k] = substr($v, 1, -1); - } - else { - $str = substr($v, 1); - $quoted = TRUE; - unset($ret[$k]); - } - } - } - if ($quoted) { - $ret[] = $str; - } - $ret['#conjunction'] = $this->getConjunction(); - return array_filter($ret); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddHierarchy.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddHierarchy.php deleted file mode 100644 index 80b24388d..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddHierarchy.php +++ /dev/null @@ -1,323 +0,0 @@ -setEntityTypeManager($container->get('entity_type.manager')); - - return $processor; - } - - /** - * Retrieves the entity type manager service. - * - * @return \Drupal\Core\Entity\EntityTypeManagerInterface - * The entity type manager service. - */ - public function getEntityTypeManager() { - return $this->entityTypeManager ?: \Drupal::entityTypeManager(); - } - - /** - * Sets the entity type manager service. - * - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager service. - * - * @return $this - */ - public function setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager) { - $this->entityTypeManager = $entity_type_manager; - return $this; - } - - /** - * {@inheritdoc} - */ - public static function supportsIndex(IndexInterface $index) { - $processor = new static(['#index' => $index], 'hierarchy', []); - return (bool) $processor->getHierarchyFields(); - } - - /** - * Finds all (potentially) hierarchical fields for this processor's index. - * - * Fields are returned if: - * - they point to an entity type; and - * - that entity type contains a property referencing the same type of entity - * (so that a hierarchy could be built from that nested property). - * - * @return string[][] - * An array containing all fields of the index for which hierarchical data - * might be retrievable. The keys are those field's IDs, the values are - * associative arrays containing the nested properties of those fields from - * which a hierarchy might be constructed, with the property paths as the - * keys and labels as the values. - */ - protected function getHierarchyFields() { - if (!isset(static::$indexHierarchyFields[$this->index->id()])) { - $field_options = []; - - foreach ($this->index->getFields() as $field_id => $field) { - $definition = $field->getDataDefinition(); - if ($definition instanceof ComplexDataDefinitionInterface) { - $properties = $this->getFieldsHelper() - ->getNestedProperties($definition); - // The property might be an entity data definition itself. - $properties[''] = $definition; - foreach ($properties as $property) { - $property_label = $property->getLabel(); - $property = $this->getFieldsHelper()->getInnerProperty($property); - if ($property instanceof EntityDataDefinitionInterface) { - $options = static::findHierarchicalProperties($property, $property_label); - if ($options) { - $field_options += [$field_id => []]; - $field_options[$field_id] += $options; - } - } - } - } - } - - static::$indexHierarchyFields[$this->index->id()] = $field_options; - } - - return static::$indexHierarchyFields[$this->index->id()]; - } - - /** - * Finds all hierarchical properties nested on an entity-typed property. - * - * @param \Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface $property - * The property to be searched for hierarchical nested properties. - * @param string $property_label - * The property's label. - * - * @return string[] - * An options list of hierarchical properties, keyed by the parent - * property's entity type ID and the nested properties identifier, - * concatenated with a dash (-). - */ - protected function findHierarchicalProperties(EntityDataDefinitionInterface $property, $property_label) { - $entity_type_id = $property->getEntityTypeId(); - $property_label = Utility::escapeHtml($property_label); - $options = []; - - // Check properties for potential hierarchy. Check two levels down, since - // Core's entity references all have an additional "entity" sub-property for - // accessing the actual entity reference, which we'd otherwise miss. - foreach ($this->getFieldsHelper()->getNestedProperties($property) as $name_2 => $property_2) { - $property_2_label = $property_2->getLabel(); - $property_2 = $this->getFieldsHelper()->getInnerProperty($property_2); - $is_reference = FALSE; - if ($property_2 instanceof EntityDataDefinitionInterface) { - if ($property_2->getEntityTypeId() == $entity_type_id) { - $is_reference = TRUE; - } - } - elseif ($property_2 instanceof ComplexDataDefinitionInterface) { - foreach ($property_2->getPropertyDefinitions() as $property_3) { - $property_3 = $this->getFieldsHelper()->getInnerProperty($property_3); - if ($property_3 instanceof EntityDataDefinitionInterface) { - if ($property_3->getEntityTypeId() == $entity_type_id) { - $is_reference = TRUE; - break; - } - } - } - } - if ($is_reference) { - $property_2_label = Utility::escapeHtml($property_2_label); - $options["$entity_type_id-$name_2"] = $property_label . ' » ' . $property_2_label; - } - } - return $options; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'fields' => [], - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $formState) { - $form['#description'] = $this->t('Select the fields to which hierarchical data should be added.'); - - foreach ($this->getHierarchyFields() as $field_id => $options) { - $enabled = !empty($this->configuration['fields'][$field_id]); - $form['fields'][$field_id]['status'] = [ - '#type' => 'checkbox', - '#title' => $this->index->getField($field_id)->getLabel(), - '#default_value' => $enabled, - ]; - reset($options); - $form['fields'][$field_id]['property'] = [ - '#type' => 'radios', - '#title' => $this->t('Hierarchy property to use'), - '#description' => $this->t("This field has several nested properties which look like they might contain hierarchy data for the field. Please pick the one that should be used."), - '#options' => $options, - '#default_value' => $enabled ? $this->configuration['fields'][$field_id] : key($options), - '#access' => count($options) > 1, - '#states' => [ - 'visible' => [ - // @todo This shouldn't be dependent on the form array structure. - // Use the '#process' trick instead. - ":input[name=\"processors[hierarchy][settings][fields][$field_id][status]\"]" => [ - 'checked' => TRUE, - ], - ], - ], - ]; - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateConfigurationForm(array &$form, FormStateInterface $formState) { - $fields = []; - foreach ($formState->getValue('fields', []) as $field_id => $values) { - if (!empty($values['status'])) { - if (empty($values['property'])) { - $formState->setError($form['fields'][$field_id]['property'], $this->t('You need to select a nested property to use for the hierarchy data.')); - } - else { - $fields[$field_id] = $values['property']; - } - } - } - $formState->setValue('fields', $fields); - if (!$fields) { - $formState->setError($form['fields'], $this->t('You need to select at least one field for which to add hierarchy data.')); - } - } - - /** - * {@inheritdoc} - */ - public function preprocessIndexItems(array $items) { - /** @var \Drupal\search_api\Item\ItemInterface $item */ - foreach ($items as $item) { - foreach ($this->configuration['fields'] as $field_id => $property_specifier) { - $field = $item->getField($field_id); - if (!$field) { - continue; - } - list ($entity_type_id, $property) = explode('-', $property_specifier); - foreach ($field->getValues() as $entity_id) { - $this->addHierarchyValues($entity_type_id, $entity_id, $property, $field); - } - } - } - } - - /** - * Adds all ancestors' IDs of the given entity to the given field. - * - * @param string $entityTypeId - * The entity type ID. - * @param mixed $entityId - * The ID of the entity for which ancestors should be found. - * @param string $property - * The name of the property on the entity type which contains the references - * to the parent entities. - * @param \Drupal\search_api\Item\FieldInterface $field - * The field to which values should be added. - */ - protected function addHierarchyValues($entityTypeId, $entityId, $property, FieldInterface $field) { - if ("$entityTypeId-$property" == 'taxonomy_term-parent') { - /** @var \Drupal\taxonomy\TermStorageInterface $entity_storage */ - $entity_storage = $this->getEntityTypeManager() - ->getStorage('taxonomy_term'); - $parents = []; - foreach ($entity_storage->loadParents($entityId) as $term) { - $parents[] = $term->id(); - } - } - else { - $entity = $this->getEntityTypeManager() - ->getStorage($entityTypeId) - ->load($entityId); - $parents = []; - if ($entity instanceof ContentEntityInterface) { - try { - foreach ($entity->get($property) as $data) { - $values = static::getFieldsHelper()->extractFieldValues($data); - $parents = array_merge($parents, $values); - } - } - catch (\InvalidArgumentException $e) { - // Might happen, for example, if the property only exists on a certain - // bundle, and this entity has the wrong one. - } - } - } - - foreach ($parents as $parent) { - if (!in_array($parent, $field->getValues())) { - $field->addValue($parent); - $this->addHierarchyValues($entityTypeId, $parent, $property, $field); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddURL.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddURL.php deleted file mode 100644 index 5fd163bc6..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AddURL.php +++ /dev/null @@ -1,61 +0,0 @@ - $this->t('URI'), - 'description' => $this->t('A URI where the item can be accessed'), - 'type' => 'string', - 'processor_id' => $this->getPluginId(), - ]; - $properties['search_api_url'] = new ProcessorProperty($definition); - } - - return $properties; - } - - /** - * {@inheritdoc} - */ - public function addFieldValues(ItemInterface $item) { - $url = $item->getDatasource()->getItemUrl($item->getOriginalObject()); - if ($url) { - $url = $url->toString(); - $fields = $item->getFields(FALSE); - $fields = $this->getFieldsHelper() - ->filterForPropertyPath($fields, NULL, 'search_api_url'); - foreach ($fields as $field) { - $field->addValue($url); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AggregatedFields.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AggregatedFields.php deleted file mode 100644 index 87952a26d..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/AggregatedFields.php +++ /dev/null @@ -1,128 +0,0 @@ - $this->t('Aggregated field'), - 'description' => $this->t('An aggregation of multiple other fields.'), - 'type' => 'string', - 'processor_id' => $this->getPluginId(), - // Most aggregation types are single-valued, but "Union" isn't, and we - // can't know which will be picked, so err on the side of caution here. - 'is_list' => TRUE, - ]; - $properties['aggregated_field'] = new AggregatedFieldProperty($definition); - } - - return $properties; - } - - /** - * {@inheritdoc} - */ - public function addFieldValues(ItemInterface $item) { - $fields = $this->index->getFields(); - $aggregated_fields = $this->getFieldsHelper() - ->filterForPropertyPath($fields, NULL, 'aggregated_field'); - $required_properties_by_datasource = [ - NULL => [], - $item->getDatasourceId() => [], - ]; - foreach ($aggregated_fields as $field) { - foreach ($field->getConfiguration()['fields'] as $combined_id) { - list($datasource_id, $property_path) = Utility::splitCombinedId($combined_id); - $required_properties_by_datasource[$datasource_id][$property_path] = $combined_id; - } - } - - $property_values = $this->getFieldsHelper() - ->extractItemValues([$item], $required_properties_by_datasource)[0]; - - $aggregated_fields = $this->getFieldsHelper() - ->filterForPropertyPath($item->getFields(), NULL, 'aggregated_field'); - foreach ($aggregated_fields as $aggregated_field) { - $values = []; - $configuration = $aggregated_field->getConfiguration(); - foreach ($configuration['fields'] as $combined_id) { - if (!empty($property_values[$combined_id])) { - $values = array_merge($values, $property_values[$combined_id]); - } - } - - switch ($configuration['type']) { - case 'concat': - $values = [implode("\n\n", $values)]; - break; - - case 'sum': - $values = [array_sum($values)]; - break; - - case 'count': - $values = [count($values)]; - break; - - case 'max': - if ($values) { - $values = [max($values)]; - } - break; - - case 'min': - if ($values) { - $values = [min($values)]; - } - break; - - case 'first': - if ($values) { - $values = [reset($values)]; - } - break; - case 'last': - if ($values) { - $values = [end($values)]; - } - break; - } - - // Do not use setValues(), since that doesn't preprocess the values - // according to their data type. - foreach ($values as $value) { - $aggregated_field->addValue($value); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/ContentAccess.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/ContentAccess.php deleted file mode 100644 index 18e7f5519..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/ContentAccess.php +++ /dev/null @@ -1,380 +0,0 @@ -setLogger($container->get('logger.channel.search_api')); - $processor->setDatabase($container->get('database')); - $processor->setCurrentUser($container->get('current_user')); - - return $processor; - } - - /** - * Retrieves the database connection. - * - * @return \Drupal\Core\Database\Connection - * The database connection. - */ - public function getDatabase() { - return $this->database ?: \Drupal::database(); - } - - /** - * Sets the database connection. - * - * @param \Drupal\Core\Database\Connection $database - * The new database connection. - * - * @return $this - */ - public function setDatabase(Connection $database) { - $this->database = $database; - return $this; - } - - /** - * Retrieves the current user. - * - * @return \Drupal\Core\Session\AccountProxyInterface - * The current user. - */ - public function getCurrentUser() { - return $this->currentUser ?: \Drupal::currentUser(); - } - - /** - * Sets the current user. - * - * @param \Drupal\Core\Session\AccountProxyInterface $current_user - * The current user. - * - * @return $this - */ - public function setCurrentUser(AccountProxyInterface $current_user) { - $this->currentUser = $current_user; - return $this; - } - - /** - * {@inheritdoc} - */ - public static function supportsIndex(IndexInterface $index) { - foreach ($index->getDatasources() as $datasource) { - if (in_array($datasource->getEntityTypeId(), ['node', 'comment'])) { - return TRUE; - } - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) { - $properties = []; - - if (!$datasource) { - $definition = [ - 'label' => $this->t('Node access information'), - 'description' => $this->t('Data needed to apply node access.'), - 'type' => 'string', - 'processor_id' => $this->getPluginId(), - 'hidden' => TRUE, - 'is_list' => TRUE, - ]; - $properties['search_api_node_grants'] = new ProcessorProperty($definition); - } - - return $properties; - } - - /** - * {@inheritdoc} - */ - public function addFieldValues(ItemInterface $item) { - static $anonymous_user; - - if (!isset($anonymous_user)) { - // Load the anonymous user. - $anonymous_user = new AnonymousUserSession(); - } - - // Only run for node and comment items. - $entity_type_id = $item->getDatasource()->getEntityTypeId(); - if (!in_array($entity_type_id, ['node', 'comment'])) { - return; - } - - // Get the node object. - $node = $this->getNode($item->getOriginalObject()); - if (!$node) { - // Apparently we were active for a wrong item. - return; - } - - $fields = $item->getFields(); - $fields = $this->getFieldsHelper() - ->filterForPropertyPath($fields, NULL, 'search_api_node_grants'); - foreach ($fields as $field) { - // Collect grant information for the node. - if (!$node->access('view', $anonymous_user)) { - // If anonymous user has no permission we collect all grants with - // their realms in the item. - $sql = 'SELECT * FROM {node_access} WHERE (nid = 0 OR nid = :nid) AND grant_view = 1'; - $args = [':nid' => $node->id()]; - foreach ($this->getDatabase()->query($sql, $args) as $grant) { - $field->addValue("node_access_{$grant->realm}:{$grant->gid}"); - } - } - else { - // Add the generic pseudo view grant if we are not using node access - // or the node is viewable by anonymous users. - $field->addValue('node_access__all'); - } - } - } - - /** - * {@inheritdoc} - */ - public function preIndexSave() { - foreach ($this->index->getDatasources() as $datasource_id => $datasource) { - $entity_type = $datasource->getEntityTypeId(); - if (in_array($entity_type, ['node', 'comment'])) { - $this->ensureField($datasource_id, 'status', 'boolean'); - if ($entity_type == 'node') { - $this->ensureField($datasource_id, 'uid', 'integer'); - } - } - } - - $field = $this->ensureField(NULL, 'search_api_node_grants', 'string'); - $field->setHidden(); - } - - /** - * Retrieves the node related to an indexed search object. - * - * Will be either the node itself, or the node the comment is attached to. - * - * @param \Drupal\Core\TypedData\ComplexDataInterface $item - * A search object that is being indexed. - * - * @return \Drupal\node\NodeInterface|null - * The node related to that search object. - */ - protected function getNode(ComplexDataInterface $item) { - $item = $item->getValue(); - if ($item instanceof CommentInterface) { - $item = $item->getCommentedEntity(); - } - if ($item instanceof NodeInterface) { - return $item; - } - - return NULL; - } - - /** - * {@inheritdoc} - */ - public function preprocessSearchQuery(QueryInterface $query) { - if (!$query->getOption('search_api_bypass_access')) { - $account = $query->getOption('search_api_access_account', $this->getCurrentUser()); - if (is_numeric($account)) { - $account = User::load($account); - } - if ($account instanceof AccountInterface) { - try { - $this->addNodeAccess($query, $account); - } - catch (SearchApiException $e) { - $this->logException($e); - } - } - else { - $account = $query->getOption('search_api_access_account', $this->getCurrentUser()); - if ($account instanceof AccountInterface) { - $account = $account->id(); - } - if (!is_scalar($account)) { - $account = var_export($account, TRUE); - } - $this->getLogger()->warning('An illegal user UID was given for node access: @uid.', ['@uid' => $account]); - } - } - } - - /** - * Adds a node access filter to a search query, if applicable. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The query to which a node access filter should be added, if applicable. - * @param \Drupal\Core\Session\AccountInterface $account - * The user for whom the search is executed. - * - * @throws \Drupal\search_api\SearchApiException - * Thrown if not all necessary fields are indexed on the index. - */ - protected function addNodeAccess(QueryInterface $query, AccountInterface $account) { - // Don't do anything if the user can access all content. - if ($account->hasPermission('bypass node access')) { - return; - } - - // Gather the affected datasources, grouped by entity type, as well as the - // unaffected ones. - $affected_datasources = []; - $unaffected_datasources = []; - foreach ($this->index->getDatasources() as $datasource_id => $datasource) { - $entity_type = $datasource->getEntityTypeId(); - if (in_array($entity_type, ['node', 'comment'])) { - $affected_datasources[$entity_type][] = $datasource_id; - } - else { - $unaffected_datasources[] = $datasource_id; - } - } - - // The filter structure we want looks like this: - // [belongs to other datasource] - // OR - // ( - // [is enabled (or was created by the user, if applicable)] - // AND - // [grants view access to one of the user's gid/realm combinations] - // ) - // If there are no "other" datasources, we don't need the nested OR, - // however, and can add the inner conditions directly to the query. - if ($unaffected_datasources) { - $outer_conditions = $query->createConditionGroup('OR', ['content_access']); - $query->addConditionGroup($outer_conditions); - foreach ($unaffected_datasources as $datasource_id) { - $outer_conditions->addCondition('search_api_datasource', $datasource_id); - } - $access_conditions = $query->createConditionGroup('AND'); - $outer_conditions->addConditionGroup($access_conditions); - } - else { - $access_conditions = $query; - } - - if (!$account->hasPermission('access content')) { - unset($affected_datasources['node']); - } - if (!$account->hasPermission('access comments')) { - unset($affected_datasources['comment']); - } - - // If the user does not have the permission to see any content at all, deny - // access to all items from affected datasources. - if (!$affected_datasources) { - // If there were "other" datasources, the existing filter will already - // remove all results of node or comment datasources. Otherwise, we should - // not return any results at all. - if (!$unaffected_datasources) { - $query->abort($this->t('You have no access to any results in this search.')); - } - return; - } - - // Collect all the required fields that need to be part of the index. - $unpublished_own = $account->hasPermission('view own unpublished content'); - - $enabled_conditions = $query->createConditionGroup('OR', ['content_access_enabled']); - foreach ($affected_datasources as $entity_type => $datasources) { - foreach ($datasources as $datasource_id) { - // If this is a comment datasource, or users cannot view their own - // unpublished nodes, a simple filter on "status" is enough. Otherwise, - // it's a bit more complicated. - $status_field = $this->findField($datasource_id, 'status', 'boolean'); - if ($status_field) { - $enabled_conditions->addCondition($status_field->getFieldIdentifier(), TRUE); - } - if ($entity_type == 'node' && $unpublished_own) { - $author_field = $this->findField($datasource_id, 'uid', 'integer'); - if ($author_field) { - $enabled_conditions->addCondition($author_field->getFieldIdentifier(), $account->id()); - } - } - } - } - $access_conditions->addConditionGroup($enabled_conditions); - - // Filter by the user's node access grants. - $node_grants_field = $this->findField(NULL, 'search_api_node_grants', 'string'); - if (!$node_grants_field) { - return; - } - $node_grants_field_id = $node_grants_field->getFieldIdentifier(); - $grants_conditions = $query->createConditionGroup('OR', ['content_access_grants']); - $grants = node_access_grants('view', $account); - foreach ($grants as $realm => $gids) { - foreach ($gids as $gid) { - $grants_conditions->addCondition($node_grants_field_id, "node_access_$realm:$gid"); - } - } - // Also add items that are accessible for everyone by checking the "access - // all" pseudo grant. - $grants_conditions->addCondition($node_grants_field_id, 'node_access__all'); - $access_conditions->addConditionGroup($grants_conditions); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/EntityStatus.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/EntityStatus.php deleted file mode 100644 index 98627c1b5..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/EntityStatus.php +++ /dev/null @@ -1,70 +0,0 @@ -getDatasources() as $datasource) { - $entity_type_id = $datasource->getEntityTypeId(); - if (!$entity_type_id) { - continue; - } - // We support users and any entities that implement - // \Drupal\Core\Entity\EntityPublishedInterface. - if ($entity_type_id === 'user') { - return TRUE; - } - $entity_type = \Drupal::entityTypeManager() - ->getDefinition($entity_type_id); - if ($entity_type && $entity_type->entityClassImplements($interface)) { - return TRUE; - } - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function alterIndexedItems(array &$items) { - // Annoyingly, this doc comment is needed for PHPStorm. See - // http://youtrack.jetbrains.com/issue/WI-23586 - /** @var \Drupal\search_api\Item\ItemInterface $item */ - foreach ($items as $item_id => $item) { - $object = $item->getOriginalObject()->getValue(); - $enabled = TRUE; - if ($object instanceof EntityPublishedInterface) { - $enabled = $object->isPublished(); - } - elseif ($object instanceof UserInterface) { - $enabled = $object->isActive(); - } - if (!$enabled) { - unset($items[$item_id]); - } - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Highlight.php b/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Highlight.php deleted file mode 100644 index f98a5a6c0..000000000 --- a/sites/all/modules/contrib/search/search_api/src/Plugin/search_api/processor/Highlight.php +++ /dev/null @@ -1,648 +0,0 @@ -dataTypeHelper ?: \Drupal::service('search_api.data_type_helper'); - } - - /** - * Sets the data type helper. - * - * @param \Drupal\search_api\Utility\DataTypeHelperInterface $data_type_helper - * The new data type helper. - * - * @return $this - */ - public function setDataTypeHelper(DataTypeHelperInterface $data_type_helper) { - $this->dataTypeHelper = $data_type_helper; - return $this; - } - - /** - * {@inheritdoc} - */ - public function preIndexSave() { - parent::preIndexSave(); - - if (empty($this->configuration['exclude_fields'])) { - return; - } - - $renames = $this->index->getFieldRenames(); - - $selected_fields = array_flip($this->configuration['exclude_fields']); - $renames = array_intersect_key($renames, $selected_fields); - if ($renames) { - $new_fields = array_keys(array_diff_key($selected_fields, $renames)); - $new_fields = array_merge($new_fields, array_values($renames)); - $this->configuration['exclude_fields'] = $new_fields; - } - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return [ - 'prefix' => '', - 'suffix' => '', - 'excerpt' => TRUE, - 'excerpt_length' => 256, - 'highlight' => 'always', - 'highlight_partial' => FALSE, - 'exclude_fields' => [], - ]; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $parent_name = 'processors[highlight][settings]'; - if (!empty($form['#parents'])) { - $parents = $form['#parents']; - $parent_name = $root = array_shift($parents); - if ($parents) { - $parent_name = $root . '[' . implode('][', $parents) . ']'; - } - } - - $form['highlight'] = [ - '#type' => 'select', - '#title' => $this->t('Highlight returned field data'), - '#description' => $this->t('Select whether returned fields should be highlighted.'), - '#options' => [ - 'always' => $this->t('Always'), - 'server' => $this->t('If the server returns fields'), - 'never' => $this->t('Never'), - ], - '#default_value' => $this->configuration['highlight'], - ]; - $form['highlight_partial'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Highlight partial matches'), - '#description' => $this->t('When enabled, matches in parts of words will be highlighted as well.'), - '#default_value' => $this->configuration['highlight_partial'], - ]; - $form['excerpt'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Create excerpt'), - '#description' => $this->t('When enabled, an excerpt will be created for searches with keywords, containing all occurrences of keywords in a fulltext field.'), - '#default_value' => $this->configuration['excerpt'], - ]; - $form['excerpt_length'] = [ - '#type' => 'number', - '#title' => $this->t('Excerpt length'), - '#description' => $this->t('The requested length of the excerpt, in characters'), - '#default_value' => $this->configuration['excerpt_length'], - '#min' => 50, - '#states' => [ - 'visible' => [ - ":input[name=\"{$parent_name}[excerpt]\"]" => [ - 'checked' => TRUE, - ], - ], - ], - ]; - // Exclude certain fulltext fields. - $fields = $this->index->getFields(); - $fulltext_fields = []; - foreach ($this->index->getFulltextFields() as $field_id) { - $fulltext_fields[$field_id] = $fields[$field_id]->getLabel() . ' (' . $field_id . ')'; - } - $form['exclude_fields'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Exclude fields from excerpt'), - '#description' => $this->t('Exclude certain fulltext fields from being included in the excerpt.'), - '#options' => $fulltext_fields, - '#default_value' => $this->configuration['exclude_fields'], - '#attributes' => ['class' => ['search-api-checkboxes-list']], - '#states' => [ - 'visible' => [ - ":input[name=\"{$parent_name}[excerpt]\"]" => [ - 'checked' => TRUE, - ], - ], - ], - ]; - $form['prefix'] = [ - '#type' => 'textfield', - '#title' => $this->t('Highlighting prefix'), - '#description' => $this->t('Text/HTML that will be prepended to all occurrences of search keywords in highlighted text'), - '#default_value' => $this->configuration['prefix'], - ]; - $form['suffix'] = [ - '#type' => 'textfield', - '#title' => $this->t('Highlighting suffix'), - '#description' => $this->t('Text/HTML that will be appended to all occurrences of search keywords in highlighted text'), - '#default_value' => $this->configuration['suffix'], - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - // Sanitize the storage for the "exclude_fields" setting. - $excluded = &$form_state->getValue('exclude_fields'); - $excluded = array_keys(array_filter($excluded)); - $this->setConfiguration($form_state->getValues()); - } - - /** - * {@inheritdoc} - */ - public function postprocessSearchResults(ResultSetInterface $results) { - $query = $results->getQuery(); - if (!$results->getResultCount() - || $query->getProcessingLevel() != QueryInterface::PROCESSING_FULL - || !($keys = $this->getKeywords($query))) { - return; - } - - $excerpt_fulltext_fields = $this->index->getFulltextFields(); - if (!empty($this->configuration['exclude_fields'])) { - $excerpt_fulltext_fields = array_combine($excerpt_fulltext_fields, $excerpt_fulltext_fields); - foreach ($this->configuration['exclude_fields'] as $field) { - unset($excerpt_fulltext_fields[$field]); - } - } - - $result_items = $results->getResultItems(); - if ($this->configuration['excerpt']) { - $this->addExcerpts($result_items, $excerpt_fulltext_fields, $keys); - } - if ($this->configuration['highlight'] != 'never') { - $highlighted_fields = $this->highlightFields($result_items, $keys); - foreach ($highlighted_fields as $item_id => $item_fields) { - $item = $result_items[$item_id]; - $item->setExtraData('highlighted_fields', $item_fields); - } - } - } - - /** - * Adds excerpts to all results, if possible. - * - * @param \Drupal\search_api\Item\ItemInterface[] $results - * The result items to which excerpts should be added. - * @param string[] $fulltext_fields - * The fulltext fields from which the excerpt should be created. - * @param array $keys - * The search keys to use for highlighting. - */ - protected function addExcerpts(array $results, array $fulltext_fields, array $keys) { - $items = $this->getFulltextFields($results, $fulltext_fields); - foreach ($items as $item_id => $item) { - $text = []; - foreach ($item as $values) { - $text = array_merge($text, $values); - } - $item_keys = $keys; - - // If the backend already did highlighting and told us the exact keys it - // found in the item's text values, we can use those for our own - // highlighting. This will help us take stemming, transliteration, etc. - // into account properly. - $highlighted_keys = $results[$item_id]->getExtraData('highlighted_keys'); - if ($highlighted_keys) { - $item_keys = array_unique(array_merge($keys, $highlighted_keys)); - } - - // @todo This is pretty poor handling for the borders between different - // values/fields. Better would be to pass an array and have proper - // handling of this in createExcerpt(), ensuring that no snippet goes - // across multiple values/fields. - $results[$item_id]->setExcerpt($this->createExcerpt(implode($this->getEllipses()[1], $text), $item_keys)); - } - } - - /** - * Retrieves highlighted field values for the given result items. - * - * @param \Drupal\search_api\Item\ItemInterface[] $results - * The result items whose fields should be highlighted. - * @param array $keys - * The search keys to use for highlighting. - * - * @return string[][][] - * An array keyed by item IDs, containing arrays that map field IDs to the - * highlighted versions of the values for that field. - */ - protected function highlightFields(array $results, array $keys) { - $highlighted_fields = []; - foreach ($results as $item_id => $item) { - // Maybe the backend or some other processor has already set highlighted - // field values. - $highlighted_fields[$item_id] = $item->getExtraData('highlighted_fields', []); - } - - $load = $this->configuration['highlight'] == 'always'; - $item_fields = $this->getFulltextFields($results, NULL, $load); - foreach ($item_fields as $item_id => $fields) { - foreach ($fields as $field_id => $values) { - if (empty($highlighted_fields[$item_id][$field_id])) { - $change = FALSE; - foreach ($values as $i => $value) { - $values[$i] = $this->highlightField($value, $keys); - if ($values[$i] !== $value) { - $change = TRUE; - } - } - if ($change) { - $highlighted_fields[$item_id][$field_id] = $values; - } - } - } - } - return $highlighted_fields; - } - - /** - * Retrieves the fulltext fields of the given result items. - * - * @param \Drupal\search_api\Item\ItemInterface[] $result_items - * The results for which fulltext data should be extracted, keyed by item - * ID. - * @param string[]|null $fulltext_fields - * (optional) The fulltext fields to highlight, or NULL to highlight all - * fulltext fields. - * @param bool $load - * (optional) If FALSE, only field values already present will be returned. - * Otherwise, fields will be loaded if necessary. - * - * @return mixed[][][] - * Field values extracted from the result items' fulltext fields, keyed by - * item ID, field ID and then numeric indices. - */ - protected function getFulltextFields(array $result_items, array $fulltext_fields = NULL, $load = TRUE) { - // All the index's fulltext fields, grouped by datasource. - $fields_by_datasource = []; - foreach ($this->index->getFields() as $field_id => $field) { - if (isset($fulltext_fields) && !in_array($field_id, $fulltext_fields)) { - continue; - } - if ($this->getDataTypeHelper()->isTextType($field->getType())) { - $fields_by_datasource[$field->getDatasourceId()][$field->getPropertyPath()] = $field_id; - } - } - - return $this->getFieldsHelper() - ->extractItemValues($result_items, $fields_by_datasource, $load); - } - - /** - * Extracts the positive keywords used in a search query. - * - * @param \Drupal\search_api\Query\QueryInterface $query - * The query from which to extract the keywords. - * - * @return string[] - * An array of all unique positive keywords used in the query. - */ - protected function getKeywords(QueryInterface $query) { - $keys = $query->getOriginalKeys(); - if (!$keys) { - return []; - } - if (is_array($keys)) { - return $this->flattenKeysArray($keys); - } - - $keywords_in = preg_split(static::$split, $keys); - // Assure there are no duplicates. (This is actually faster than - // array_unique() by a factor of 3 to 4.) - // Remove quotes from keywords. - $keywords = []; - foreach (array_filter($keywords_in) as $keyword) { - if ($keyword = trim($keyword, "'\"")) { - $keywords[$keyword] = $keyword; - } - } - return $keywords; - } - - /** - * Extracts the positive keywords from a keys array. - * - * @param array $keys - * A search keys array, as specified by - * \Drupal\search_api\ParseMode\ParseModeInterface::parseInput(). - * - * @return string[] - * An array of all unique positive keywords contained in the keys array. - */ - protected function flattenKeysArray(array $keys) { - if (!empty($keys['#negation'])) { - return []; - } - - $keywords = []; - foreach ($keys as $i => $key) { - if (!Element::child($i)) { - continue; - } - if (is_array($key)) { - $keywords += $this->flattenKeysArray($key); - } - else { - $keywords[$key] = $key; - } - } - - return $keywords; - } - - /** - * Returns snippets from a piece of text, with certain keywords highlighted. - * - * Largely copied from search_excerpt(). - * - * @param string $text - * The text to extract fragments from. - * @param array $keys - * The search keywords entered by the user. - * - * @return string|null - * A string containing HTML for the excerpt. Or NULL if no excerpt could be - * created. - */ - protected function createExcerpt($text, array $keys) { - // Remove HTML tags - -And another foo! -END; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => [$body_value], - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $output = $results->getResultItems(); - $excerpt = $output[$this->itemIds[0]]->getExcerpt(); - $correct_output = '… Sentence with foo keyword. And another foo! …'; - $this->assertEquals($correct_output, $excerpt, 'Excerpt was added.'); - } - - /** - * Tests whether highlighting works on a longer text matching near the end. - */ - public function testPostprocessSearchResultsExerptMatchNearEnd() { - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue(['#conjunction' => 'AND', 'diam'])); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $field = $this->createTestField('body', 'entity:node/body'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $field])); - - $this->processor->setIndex($this->index); - - $body_values = [$this->getFieldBody()]; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $output = $results->getResultItems(); - $excerpt = $output[$this->itemIds[0]]->getExcerpt(); - $correct_output = '… Fusce in mauris eu leo fermentum feugiat. Proin varius diam ante, non eleifend ipsum luctus sed. …'; - $this->assertEquals($correct_output, $excerpt, 'Excerpt was added.'); - } - - /** - * Tests whether highlighting works with a changed excerpt length. - */ - public function testPostprocessSearchResultsWithChangedExcerptLength() { - $this->processor->setConfiguration(['excerpt_length' => 64]); - - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue('congue')); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $field = $this->createTestField('body', 'entity:node/body'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $field])); - - $this->processor->setIndex($this->index); - - $body_values = [$this->getFieldBody()]; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $output = $results->getResultItems(); - $excerpt = $output[$this->itemIds[0]]->getExcerpt(); - $correct_output = '… dapibus, lorem nunc congue velit, et dictum augue …'; - $this->assertEquals($correct_output, $excerpt, 'Excerpt has correct reduced length.'); - } - - /** - * Tests whether adding an excerpt can be successfully disabled. - */ - public function testPostprocessSearchResultsWithoutExcerpt() { - $this->processor->setConfiguration(['excerpt' => FALSE]); - - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue(['#conjunction' => 'AND', 'congue'])); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $field = $this->createTestField('body', 'entity:node/body'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $field])); - - $this->processor->setIndex($this->index); - - $body_values = [$this->getFieldBody()]; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $excerpt = $items[$this->itemIds[0]]->getExcerpt(); - - $this->assertEmpty($excerpt, 'No excerpt added when disabled.'); - } - - /** - * Tests whether excerpt creation uses the "highlighted_keys" extra data. - */ - public function testPostprocessSearchResultsExcerptWithKeysFromBackend() { - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue(['#conjunction' => 'AND', 'congues'])); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $field = $this->createTestField('body', 'entity:node/body'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $field])); - - $this->processor->setIndex($this->index); - - $body_values = [$this->getFieldBody()]; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - $items[$this->itemIds[0]]->setExtraData('highlighted_keys', ['congue']); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $output = $results->getResultItems(); - $excerpt = $output[$this->itemIds[0]]->getExcerpt(); - $correct_output = '… tristique, ligula sit amet condimentum dapibus, lorem nunc congue velit, et dictum augue leo sodales augue. Maecenas …'; - $this->assertEquals($correct_output, $excerpt, 'Excerpt was added.'); - } - - /** - * Tests whether highlighting works on a longer text. - */ - public function testPostprocessSearchResultsWithComplexKeys() { - $keys = [ - '#conjunction' => 'AND', - [ - '#conjunction' => 'OR', - 'foo', - 'bar', - ], - 'baz', - [ - '#conjunction' => 'OR', - '#negation' => TRUE, - 'text', - 'will', - ], - ]; - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue($keys)); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $body_field = $this->createTestField('body', 'entity:node/body'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $body_field])); - - $this->processor->setIndex($this->index); - - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => [ - 'This foo text bar will get baz riddled with <strong> tags.', - ], - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $fields = $items[$this->itemIds[0]]->getExtraData('highlighted_fields'); - $this->assertEquals('This foo text bar will get baz riddled with <strong> tags.', $fields['body'][0], 'Highlighting is correctly applied when keys are complex.'); - $correct_output = '… This foo text bar will get baz riddled with <strong> tags. …'; - $excerpt = $items[$this->itemIds[0]]->getExcerpt(); - $this->assertEquals($correct_output, $excerpt, 'Excerpt was added.'); - } - - /** - * Tests field highlighting and excerpts for two fields. - */ - public function testPostprocessSearchResultsWithTwoFields() { - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue(['#conjunction' => 'AND', 'foo'])); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $body_field = $this->createTestField('body', 'entity:node/body'); - $title_field = $this->createTestField('title', 'title'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue([ - 'body' => $body_field, - 'title' => $title_field, - ])); - - $this->processor->setIndex($this->index); - - $body_values = ['Some foo value', 'foo bar']; - $title_values = ['Title foo']; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - 'title' => [ - 'type' => 'text', - 'values' => $title_values, - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $fields = $items[$this->itemIds[0]]->getExtraData('highlighted_fields'); - $this->assertEquals('Some foo value', $fields['body'][0], 'Highlighting is correctly applied to first body field value.'); - $this->assertEquals('foo bar', $fields['body'][1], 'Highlighting is correctly applied to second body field value.'); - $this->assertEquals('Title foo', $fields['title'][0], 'Highlighting is correctly applied to title field.'); - - $excerpt = $items[$this->itemIds[0]]->getExcerpt(); - $this->assertContains('Some foo value', $excerpt); - $this->assertContains('foo bar', $excerpt); - $this->assertContains('Title foo', $excerpt); - $this->assertEquals(4, substr_count($excerpt, '…')); - } - - /** - * Tests field highlighting and excerpts with two items. - */ - public function testPostprocessSearchResultsWithTwoItems() { - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue(['#conjunction' => 'OR', 'foo'])); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $body_field = $this->createTestField('body', 'entity:node/body'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $body_field])); - - $this->processor->setIndex($this->index); - - $body_values = ['Some foo value', 'foo bar']; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - ]; - - $items = $this->createItems($this->index, 2, $fields); - - $items[$this->itemIds[1]]->getField('body') - ->setValues(['The second item also contains foo in its body.']); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $fields = $items[$this->itemIds[0]]->getExtraData('highlighted_fields'); - $this->assertEquals('Some foo value', $fields['body'][0], 'Highlighting is correctly applied to first body field value.'); - $this->assertEquals('foo bar', $fields['body'][1], 'Highlighting is correctly applied to second body field value.'); - - $fields = $items[$this->itemIds[1]]->getExtraData('highlighted_fields'); - $this->assertEquals('The second item also contains foo in its body.', $fields['body'][0], 'Highlighting is correctly applied to second item.'); - - $excerpt1 = '… Some foo value … foo bar …'; - $excerpt2 = '… The second item also contains foo in its body. …'; - $this->assertEquals($excerpt1, $items[$this->itemIds[0]]->getExcerpt(), 'Correct excerpt created from two text fields.'); - $this->assertEquals($excerpt2, $items[$this->itemIds[1]]->getExcerpt(), 'Correct excerpt created for second item.'); - } - - /** - * Tests excerpts with some fields excluded. - */ - public function testExcerptExcludeFields() { - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue(['#conjunction' => 'AND', 'foo'])); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $body_field = $this->createTestField('body', 'entity:node/body'); - $title_field = $this->createTestField('title', 'title'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue([ - 'body' => $body_field, - 'title' => $title_field, - ])); - - $this->processor->setIndex($this->index); - - $this->processor->setConfiguration([ - 'exclude_fields' => ['title'], - ]); - - $body_values = ['Some foo value', 'foo bar']; - $title_values = ['Title foo']; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - 'title' => [ - 'type' => 'text', - 'values' => $title_values, - ], - ]; - - $items = $this->createItems($this->index, 1, $fields); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $fields = $items[$this->itemIds[0]]->getExtraData('highlighted_fields'); - $this->assertEquals('Some foo value', $fields['body'][0], 'Highlighting is correctly applied to first body field value.'); - $this->assertEquals('foo bar', $fields['body'][1], 'Highlighting is correctly applied to second body field value.'); - $this->assertEquals('Title foo', $fields['title'][0], 'Highlighting is correctly applied to title field.'); - - $excerpt = '… Some foo value … foo bar …'; - $this->assertEquals($excerpt, $items[$this->itemIds[0]]->getExcerpt(), 'Correct excerpt created ignoring title field.'); - } - - /** - * Tests that field extraction in the processor works correctly. - */ - public function testFieldExtraction() { - /** @var \Drupal\Tests\search_api\Unit\TestComplexDataInterface|\PHPUnit_Framework_MockObject_MockObject $object */ - $object = $this->createMock(TestComplexDataInterface::class); - $bar_foo_property = $this->createMock(TypedDataInterface::class); - $bar_foo_property->method('getValue') - ->willReturn('value3 foo'); - $bar_foo_property->method('getDataDefinition') - ->willReturn(new DataDefinition()); - $bar_property = $this->createMock(TestComplexDataInterface::class); - $bar_property->method('get') - ->willReturnMap([ - ['foo', $bar_foo_property], - ]); - $bar_property->method('getProperties') - ->willReturn([ - 'foo' => TRUE, - ]); - $foobar_property = $this->createMock(TypedDataInterface::class); - $foobar_property->method('getValue') - ->willReturn('wrong_value2 foo'); - $foobar_property->method('getDataDefinition') - ->willReturn(new DataDefinition()); - $object->method('get') - ->willReturnMap([ - ['bar', $bar_property], - ['foobar', $foobar_property], - ]); - $object->method('getProperties') - ->willReturn([ - 'bar' => TRUE, - 'foobar' => TRUE, - ]); - - $this->index->method('getFields') - ->willReturn([ - 'field1' => $this->createTestField('field1', 'entity:test1/bar:foo'), - 'field2' => $this->createTestField('field2', 'entity:test2/foobar'), - 'field3' => $this->createTestField('field3', 'foo'), - 'field4' => $this->createTestField('field4', 'baz', FALSE), - 'field5' => $this->createTestField('field5', 'entity:test1/foobar'), - ]); - $this->index->method('getPropertyDefinitions') - ->willReturnMap([ - [ - NULL, - [ - 'foo' => new ProcessorProperty([ - 'processor_id' => 'processor1', - ]), - ], - ], - [ - 'entity:test1', - [ - 'bar' => new DataDefinition(), - 'foobar' => new DataDefinition(), - ], - ], - ]); - $processor_mock = $this->createMock(ProcessorInterface::class); - $processor_mock->method('addFieldValues') - ->willReturnCallback(function (ItemInterface $item) { - foreach ($item->getFields(FALSE) as $field) { - if ($field->getCombinedPropertyPath() == 'foo') { - $field->setValues(['value4 foo', 'value5 foo']); - } - } - }); - $this->index->method('getProcessorsByStage') - ->willReturnMap([ - [ - ProcessorInterface::STAGE_ADD_PROPERTIES, - [], - [ - 'aggregated_field' => $this->processor, - 'processor1' => $processor_mock, - ], - ], - ]); - $this->processor->setIndex($this->index); - - /** @var \Drupal\search_api\Datasource\DatasourceInterface|\PHPUnit_Framework_MockObject_MockObject $datasource */ - $datasource = $this->createMock(DatasourceInterface::class); - $datasource->method('getPluginId') - ->willReturn('entity:test1'); - - $item = \Drupal::getContainer() - ->get('search_api.fields_helper') - ->createItem($this->index, 'id', $datasource); - $item->setOriginalObject($object); - $field = $this->createTestField('field4', 'baz') - ->addValue('wrong_value1 foo'); - $item->setField('field4', $field); - $field = $this->createTestField('field5', 'entity:test1/foobar') - ->addValue('value1 foo') - ->addValue('value2 foo'); - $item->setField('field5', $field); - - $this->processor->setConfiguration(['excerpt' => FALSE]); - /** @var \Drupal\search_api\Query\QueryInterface|\PHPUnit_Framework_MockObject_MockObject $query */ - $query = $this->createMock(QueryInterface::class); - $query->method('getOriginalKeys') - ->willReturn('foo'); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $results = new ResultSet($query); - $results->setResultCount(1) - ->setResultItems([$item]); - $this->processor->postprocessSearchResults($results); - - $expected = [ - 'field1' => [ - 'value3 foo', - ], - 'field3' => [ - 'value4 foo', - 'value5 foo', - ], - 'field5' => [ - 'value1 foo', - 'value2 foo', - ], - ]; - $fields = $item->getExtraData('highlighted_fields'); - $this->assertEquals($expected, $fields); - } - - /** - * Tests field highlighting with a result set that has some highlighting data. - */ - public function testPostprocessSearchResultsWithExistingHighlighting() { - $query = $this->createMock(QueryInterface::class); - $query->expects($this->once()) - ->method('getProcessingLevel') - ->willReturn(QueryInterface::PROCESSING_FULL); - $query->expects($this->atLeastOnce()) - ->method('getOriginalKeys') - ->will($this->returnValue('foo')); - /** @var \Drupal\search_api\Query\QueryInterface $query */ - - $body = $this->createTestField('body', 'entity:node/body'); - $title = $this->createTestField('title', 'entity:node/title'); - - $this->index->expects($this->atLeastOnce()) - ->method('getFields') - ->will($this->returnValue(['body' => $body, 'title' => $title])); - - $this->processor->setIndex($this->index); - - $body_values = ['Some foo value']; - $title_values = ['The foo title']; - $fields = [ - 'entity:node/body' => [ - 'type' => 'text', - 'values' => $body_values, - ], - 'entity:node/title' => [ - 'type' => 'text', - 'values' => $title_values, - ], - ]; - - $items = $this->createItems($this->index, 2, $fields); - $items[$this->itemIds[0]]->setExtraData('highlighted_fields', [ - 'title' => ['The foo title'], - ]); - $items[$this->itemIds[1]]->setExtraData('highlighted_fields', [ - 'body' => ['Some foo value'], - ]); - - $results = new ResultSet($query); - $results->setResultItems($items); - $results->setResultCount(1); - - $this->processor->postprocessSearchResults($results); - - $fields = $items[$this->itemIds[0]]->getExtraData('highlighted_fields'); - $this->assertEquals('The foo title', $fields['title'][0], 'Existing highlighting data for title was correctly kept.'); - $this->assertEquals('Some foo value', $fields['body'][0], 'Highlighting is correctly applied to body field.'); - $fields = $items[$this->itemIds[1]]->getExtraData('highlighted_fields'); - $this->assertEquals('The foo title', $fields['title'][0], 'Highlighting is correctly applied to title field.'); - $this->assertEquals('Some foo value', $fields['body'][0], 'Existing highlighting data for body was correctly kept.'); - } - - /** - * Creates a field object for testing. - * - * @param string $id - * The field ID to set. - * @param string $combined_property_path - * The combined property path of the field. - * @param bool $text - * (optional) Whether the field should be a fulltext field or not. - * - * @return \Drupal\search_api\Item\FieldInterface - * A field object. - */ - protected function createTestField($id, $combined_property_path, $text = TRUE) { - $field = new Field($this->index, $id); - list ($datasource_id, $property_path) = Utility::splitCombinedId($combined_property_path); - $field->setDatasourceId($datasource_id); - $field->setPropertyPath($property_path); - $field->setType($text ? 'text' : 'string'); - - return $field; - } - - /** - * Returns a long text to use for highlighting tests. - * - * @return string - * A Lorem Ipsum text. - */ - protected function getFieldBody() { - return 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris dictum ultricies sapien id consequat. -Fusce tristique erat at dui ultricies, eu rhoncus odio rutrum. Praesent viverra mollis mauris a cursus. -Curabitur at condimentum orci. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. -Praesent suscipit massa non pretium volutpat. Suspendisse id lacus facilisis, fringilla mauris vitae, tincidunt turpis. -Proin a euismod libero. Nam aliquet neque nulla, nec placerat libero accumsan id. Quisque sit amet consequat lacus. -Donec mauris erat, iaculis id nisl nec, dapibus posuere lectus. Sed ultrices libero id elit volutpat sagittis. -Donec a tortor ullamcorper, tempus lectus at, ultrices felis. Nam nibh magna, dictum in massa ut, ornare venenatis enim. -Phasellus enim massa, condimentum eu sem vel, consectetur fermentum erat. Cras porttitor ut dolor interdum vehicula. -Vestibulum erat arcu, placerat quis gravida quis, venenatis vel magna. Pellentesque pellentesque lacus ut feugiat auctor. -Mauris libero magna, dictum in fermentum nec, blandit non augue. -Morbi sed viverra libero.Phasellus sem velit, sollicitudin in felis lacinia, suscipit auctor dolor. -Praesent dignissim dolor sed lobortis mattis. -Ut tristique, ligula sit amet condimentum dapibus, lorem nunc congue velit, et dictum augue leo sodales augue. -Maecenas eget mi ac massa sagittis malesuada. Fusce ac purus vel ipsum imperdiet vulputate. -Mauris vestibulum sapien sit amet elementum tincidunt. Aenean sollicitudin tortor pulvinar ante commodo sagittis. -Integer in nisi consequat, elementum felis in, consequat purus. Maecenas blandit ipsum id tellus accumsan, sit amet venenatis orci vestibulum. -Ut id erat venenatis, vehicula mi eget, gravida odio. Etiam dapibus purus in massa condimentum, vitae lobortis est aliquam. -Morbi tristique velit et sem varius rhoncus. In tincidunt sagittis libero. Integer interdum sit amet sem sit amet sodales. -Donec sit amet arcu sit amet leo tristique dignissim vel ut enim. Nulla faucibus lacus eu adipiscing semper. Sed ut sodales erat. -Sed mauris purus, tempor non eleifend et, mollis ut lacus. Etiam interdum velit justo, nec imperdiet nunc pulvinar sit amet. -Sed eu lacus eget augue laoreet vehicula id sed sem. Maecenas at condimentum massa, et pretium nulla. Aliquam sed nibh velit. -Quisque turpis lacus, sodales nec malesuada nec, commodo non purus. -Cras pellentesque, lectus ut imperdiet euismod, purus sem convallis tortor, ut fermentum elit nulla et quam. -Mauris luctus mattis enim non accumsan. Sed consequat sapien lorem, in ultricies orci posuere nec. -Fusce in mauris eu leo fermentum feugiat. Proin varius diam ante, non eleifend ipsum luctus sed.'; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/HtmlFilterTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/HtmlFilterTest.php deleted file mode 100644 index 3984528d0..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/HtmlFilterTest.php +++ /dev/null @@ -1,283 +0,0 @@ -setUpMockContainer(); - - $this->processor = new HtmlFilter([], 'html_filter', []); - } - - /** - * Tests preprocessing field values with "title" settings. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param string $expected_value - * The expected processed value. - * @param bool $title_config - * The value to set for the processor's "title" setting. - * - * @dataProvider titleConfigurationDataProvider - */ - public function testTitleConfiguration($passed_value, $expected_value, $title_config) { - $configuration = [ - 'tags' => [], - 'title' => $title_config, - 'alt' => FALSE, - ]; - $this->processor->setConfiguration($configuration); - $type = 'text'; - $this->invokeMethod('processFieldValue', [&$passed_value, $type]); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Data provider for testTitleConfiguration(). - * - * @return array - * An array of argument arrays for testTitleConfiguration(). - */ - public function titleConfigurationDataProvider() { - return [ - ['word', 'word', FALSE], - ['word', 'word', TRUE], - ['
        word
        ', 'word', TRUE], - ['
        word
        ', 'TITLE word', TRUE], - ['
        word
        ', 'word', FALSE], - ['
        word
        ', 'word', TRUE], - ['
        word', 'TITLE word', TRUE], - ]; - } - - /** - * Tests preprocessing field values with "alt" settings. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param mixed $expected_value - * The expected processed value. - * @param bool $alt_config - * The value to set for the processor's "alt" setting. - * - * @dataProvider altConfigurationDataProvider - */ - public function testAltConfiguration($passed_value, $expected_value, $alt_config) { - $configuration = [ - 'tags' => ['img' => '2'], - 'title' => FALSE, - 'alt' => $alt_config, - ]; - $this->processor->setConfiguration($configuration); - $type = 'text'; - $this->invokeMethod('processFieldValue', [&$passed_value, $type]); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Data provider method for testAltConfiguration(). - * - * @return array - * An array of argument arrays for testAltConfiguration(). - */ - public function altConfigurationDataProvider() { - return [ - ['word', [Utility::createTextToken('word')], FALSE], - ['word', [Utility::createTextToken('word')], TRUE], - [ - 'word', - [Utility::createTextToken('word')], - TRUE, - ], - [ - 'ALT word', - [ - Utility::createTextToken('ALT', 2), - Utility::createTextToken('word'), - ], - TRUE, - ], - [ - 'ALT word', - [Utility::createTextToken('word')], - FALSE, - ], - [ - ' word', - [Utility::createTextToken('word')], - TRUE, - ], - [ - 'ALT word ', - [ - Utility::createTextToken('ALT', 2), - Utility::createTextToken('word'), - ], - TRUE, - ], - // Test fault tolerance. - [ - 'a < b', - [ - Utility::createTextToken('a < b'), - ], - TRUE, - ], - ]; - } - - /** - * Tests preprocessing field values with "alt" settings. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param mixed $expected_value - * The expected processed value. - * @param float[] $tags_config - * The value to set for the processor's "tags" setting. - * - * @dataProvider tagConfigurationDataProvider - */ - public function testTagConfiguration($passed_value, $expected_value, array $tags_config) { - $configuration = [ - 'tags' => $tags_config, - 'title' => TRUE, - 'alt' => TRUE, - ]; - $this->processor->setConfiguration($configuration); - $type = 'text'; - $this->invokeMethod('processFieldValue', [&$passed_value, $type]); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Data provider method for testTagConfiguration(). - * - * @return array - * An array of argument arrays for testTagConfiguration(). - */ - public function tagConfigurationDataProvider() { - $complex_test = [ - '

        Foo Bar Baz

        - -

        Bla Bla Bla. Important: Bla.

        -Some picture -This is hidden', - [ - Utility::createTextToken('Foo Bar', 3.0), - Utility::createTextToken('Baz', 4.5), - Utility::createTextToken('Bla Bla Bla.', 1.0), - Utility::createTextToken('Foobar Important:', 2.0), - Utility::createTextToken('Bla.', 1.0), - Utility::createTextToken('Some picture', 0.5), - ], - [ - 'em' => 1.5, - 'strong' => 2.0, - 'h2' => 3.0, - 'img' => 0.5, - 'span' => 0, - ], - ]; - $tags_config = ['h2' => '2']; - return [ - ['h2word', 'h2word', []], - ['h2word', [Utility::createTextToken('h2word')], $tags_config], - [ - 'foo bar

        h2word

        ', - [ - Utility::createTextToken('foo bar'), - Utility::createTextToken('h2word', 2.0), - ], - $tags_config, - ], - [ - 'foo bar

        h2word

        ', - [ - Utility::createTextToken('foo bar'), - Utility::createTextToken('h2word', 2.0), - ], - $tags_config, - ], - [ - '
        word
        ', - [Utility::createTextToken('word', 2)], - ['div' => 2], - ], - $complex_test, - ]; - } - - /** - * Tests whether strings are correctly handled. - * - * String field handling should be completely independent of configuration. - * - * @param array $config - * The configuration to set on the processor. - * - * @dataProvider stringProcessingDataProvider - */ - public function testStringProcessing(array $config) { - $this->processor->setConfiguration($config); - - $passed_value = '

        Foo Bar Baz

        - -

        Bla Bla Bla. Important: Bla.

        -Some picture -This is hidden'; - $expected_value = preg_replace('/\s+/', ' ', strip_tags($passed_value)); - - $type = 'string'; - $this->invokeMethod('processFieldValue', [&$passed_value, $type]); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Provides a few sets of HTML filter configuration. - * - * @return array - * An array of argument arrays for testStringProcessing(), where each array - * contains a HTML filter configuration as the only value. - */ - public function stringProcessingDataProvider() { - $configs = []; - $configs[] = [[]]; - $config['tags'] = [ - 'h2' => 2.0, - 'span' => 4.0, - 'strong' => 1.5, - 'p' => 0, - ]; - $configs[] = [$config]; - $config['title'] = TRUE; - $configs[] = [$config]; - $config['alt'] = TRUE; - $configs[] = [$config]; - unset($config['tags']); - $configs[] = [$config]; - return $configs; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCaseTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCaseTest.php deleted file mode 100644 index 71faece81..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCaseTest.php +++ /dev/null @@ -1,57 +0,0 @@ -processor = new IgnoreCase([], 'string', []); - } - - /** - * Tests the process() method. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param string $expected_value - * The expected processed value. - * - * @dataProvider processDataProvider - */ - public function testProcess($passed_value, $expected_value) { - $this->invokeMethod('process', [&$passed_value]); - $this->assertEquals($passed_value, $expected_value); - } - - /** - * Provides sets of arguments for testProcess(). - * - * @return array[] - * Arrays of arguments for testProcess(). - */ - public function processDataProvider() { - return [ - ['Foo bar', 'foo bar'], - ['foo Bar', 'foo bar'], - ['Foo Bar', 'foo bar'], - ['Foo bar BaZ, ÄÖÜÀÁ<>»«.', 'foo bar baz, äöüàá<>»«.'], - ]; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCharacterTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCharacterTest.php deleted file mode 100644 index 51bb9cf8f..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/IgnoreCharacterTest.php +++ /dev/null @@ -1,139 +0,0 @@ -processor = new IgnoreCharacters(['ignorable' => ''], 'ignore_character', []); - } - - /** - * Tests preprocessing with different ignorable character sets. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param string $expected_value - * The expected processed value. - * @param string[] $character_classes - * The "character_sets" setting to set on the processor. - * - * @dataProvider ignoreCharacterSetsDataProvider - */ - public function testIgnoreCharacterSets($passed_value, $expected_value, array $character_classes) { - $this->processor->setConfiguration(['strip' => ['character_sets' => $character_classes]]); - $this->invokeMethod('process', [&$passed_value, 'text']); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Data provider for testValueConfiguration(). - */ - public function ignoreCharacterSetsDataProvider() { - return [ - ['word_s', 'words', ['Pc' => 'Pc']], - ['word⁔s', 'words', ['Pc' => 'Pc']], - - ['word〜s', 'words', ['Pd' => 'Pd']], - ['w–ord⸗s', 'words', ['Pd' => 'Pd']], - - ['word⌉s', 'words', ['Pe' => 'Pe']], - ['word⦊s〕', 'words', ['Pe' => 'Pe']], - - ['word»s', 'words', ['Pf' => 'Pf']], - ['word⸍s', 'words', ['Pf' => 'Pf']], - - ['word⸂s', 'words', ['Pi' => 'Pi']], - ['w«ord⸉s', 'words', ['Pi' => 'Pi']], - - ['words%', 'words', ['Po' => 'Po']], - ['wo*rd/s', 'words', ['Po' => 'Po']], - - ['word༺s', 'words', ['Ps' => 'Ps']], - ['w❮ord⌈s', 'words', ['Ps' => 'Ps']], - - ['word៛s', 'words', ['Sc' => 'Sc']], - ['wo₥rd₦s', 'words', ['Sc' => 'Sc']], - - ['w˓ords', 'words', ['Sk' => 'Sk']], - ['wo˘rd˳s', 'words', ['Sk' => 'Sk']], - - ['word×s', 'words', ['Sm' => 'Sm']], - ['wo±rd؈s', 'words', ['Sm' => 'Sm']], - - ['wo᧧rds', 'words', ['So' => 'So']], - ['w᧶ord᧲s', 'words', ['So' => 'So']], - - ["wor\x0Ads", 'words', ['Cc' => 'Cc']], - ["wo\x0Crds", 'words', ['Cc' => 'Cc']], - - ['word۝s', 'words', ['Cf' => 'Cf']], - ['wo᠎rd؁s', 'words', ['Cf' => 'Cf']], - - ['words', 'words', ['Co' => 'Co']], - ['wo󿿽rds', 'words', ['Co' => 'Co']], - - ['wordॊs', 'words', ['Mc' => 'Mc']], - ['worौdংs', 'words', ['Mc' => 'Mc']], - - ['wo⃞rds', 'words', ['Me' => 'Me']], - ['wor⃤⃟ds', 'words', ['Me' => 'Me']], - - ['woྰrds', 'words', ['Mn' => 'Mn']], - ['worྵdྶs', 'words', ['Mn' => 'Mn']], - - ['woྰrds', 'words', ['Mn' => 'Mn', 'Pd' => 'Pd', 'Pe' => 'Pe']], - ['worྵdྶs', 'words', ['Mn' => 'Mn', 'Pd' => 'Pd', 'Pe' => 'Pe']], - ]; - } - - /** - * Tests preprocessing with the "Ignorable characters" setting. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param string $expected_value - * The expected processed value. - * @param string $ignorable - * The "ignorable" setting to set on the processor. - * - * @dataProvider ignorableCharactersDataProvider - */ - public function testIgnorableCharacters($passed_value, $expected_value, $ignorable) { - $this->processor->setConfiguration(['ignorable' => $ignorable, 'strip' => ['character_sets' => []]]); - $this->invokeMethod('process', [&$passed_value, 'text']); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Provides sets of test parameters for testIgnorableCharacters(). - * - * @return array - * Sets of arguments for testIgnorableCharacters(). - */ - public function ignorableCharactersDataProvider() { - return [ - ['abcde', 'ace', '[bd]'], - [['abcde', 'abcdef'], ['ace', 'ace'], '[bdf]'], - ["ab.c'de", "a.'de", '[b-c]'], - ['foo 13$%& (bar)[93]', 'foo $%& (bar)[]', '\d'], - ]; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/ProcessorTestTrait.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/ProcessorTestTrait.php deleted file mode 100644 index 58cab130e..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/ProcessorTestTrait.php +++ /dev/null @@ -1,35 +0,0 @@ -processor)); - $method = $class->getMethod($method_name); - $method->setAccessible(TRUE); - return $method->invokeArgs($this->processor, $args); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/RoleFilterTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/RoleFilterTest.php deleted file mode 100644 index 58c082278..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/RoleFilterTest.php +++ /dev/null @@ -1,125 +0,0 @@ -setUpMockContainer(); - - $this->processor = new RoleFilter([], 'role_filter', []); - - /** @var \Drupal\search_api\IndexInterface $index */ - $index = $this->createMock(IndexInterface::class); - - $node_datasource = $this->createMock(DatasourceInterface::class); - $node_datasource->expects($this->any()) - ->method('getEntityTypeId') - ->will($this->returnValue('node')); - /** @var \Drupal\search_api\Datasource\DatasourceInterface $node_datasource */ - $user_datasource = $this->createMock(DatasourceInterface::class); - $user_datasource->expects($this->any()) - ->method('getEntityTypeId') - ->will($this->returnValue('user')); - /** @var \Drupal\search_api\Datasource\DatasourceInterface $user_datasource */ - - $fields_helper = \Drupal::getContainer()->get('search_api.fields_helper'); - $item = $fields_helper->createItem($index, Utility::createCombinedId('entity:node', '1:en'), $node_datasource); - $node = $this->getMockBuilder(TestNodeInterface::class) - ->disableOriginalConstructor() - ->getMock(); - /** @var \Drupal\node\NodeInterface $node */ - $item->setOriginalObject(EntityAdapter::createFromEntity($node)); - $this->items[$item->getId()] = $item; - - $item = $fields_helper->createItem($index, Utility::createCombinedId('entity:user', '1:en'), $user_datasource); - $account1 = $this->getMockBuilder(TestUserInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $account1->expects($this->any()) - ->method('getRoles') - ->will($this->returnValue(['authenticated' => 'authenticated', 'editor' => 'editor'])); - /** @var \Drupal\user\UserInterface $account1 */ - $item->setOriginalObject(EntityAdapter::createFromEntity($account1)); - $this->items[$item->getId()] = $item; - - $item = $fields_helper->createItem($index, Utility::createCombinedId('entity:user', '2:en'), $user_datasource); - $account2 = $this->getMockBuilder(TestUserInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $account2->expects($this->any()) - ->method('getRoles') - ->will($this->returnValue(['authenticated' => 'authenticated'])); - /** @var \Drupal\user\UserInterface $account2 */ - $item->setOriginalObject(EntityAdapter::createFromEntity($account2)); - $this->items[$item->getId()] = $item; - } - - /** - * Tests preprocessing search items with an inclusive filter. - */ - public function testFilterInclusive() { - $configuration['roles'] = ['authenticated']; - $configuration['default'] = 0; - $this->processor->setConfiguration($configuration); - - $this->processor->alterIndexedItems($this->items); - - $this->assertTrue(!empty($this->items[Utility::createCombinedId('entity:user', '1:en')]), 'User with two roles was not removed.'); - $this->assertTrue(!empty($this->items[Utility::createCombinedId('entity:user', '2:en')]), 'User with only the authenticated role was not removed.'); - $this->assertTrue(!empty($this->items[Utility::createCombinedId('entity:node', '1:en')]), 'Node item was not removed.'); - } - - /** - * Tests preprocessing search items with an exclusive filter. - */ - public function testFilterExclusive() { - $configuration['roles'] = ['editor']; - $configuration['default'] = 1; - $this->processor->setConfiguration($configuration); - - $this->processor->alterIndexedItems($this->items); - - $this->assertTrue(empty($this->items[Utility::createCombinedId('entity:user', '1:en')]), 'User with editor role was successfully removed.'); - $this->assertTrue(!empty($this->items[Utility::createCombinedId('entity:user', '2:en')]), 'User without the editor role was not removed.'); - $this->assertTrue(!empty($this->items[Utility::createCombinedId('entity:node', '1:en')]), 'Node item was not removed.'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StemmerTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StemmerTest.php deleted file mode 100644 index b75177db9..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StemmerTest.php +++ /dev/null @@ -1,240 +0,0 @@ -setUpMockContainer(); - - $this->processor = new Stemmer([], 'string', []); - } - - /** - * Tests the preprocessIndexItems() method. - * - * @covers ::preprocessIndexItems - */ - public function testPreprocessIndexItems() { - $index = $this->createMock(IndexInterface::class); - - $item_en = $this->getMockBuilder(ItemInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $item_en->method('getLanguage')->willReturn('en'); - $field_en = new Field($index, 'foo'); - $field_en->setType('text'); - $field_en->setValues([ - new TextValue('ties'), - ]); - $item_en->method('getFields')->willReturn(['foo' => $field_en]); - - $item_de = $this->getMockBuilder(ItemInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $item_de->method('getLanguage')->willReturn('de'); - $field_de = new Field($index, 'foo'); - $field_de->setType('text'); - $field_de->setValues([ - new TextValue('ties'), - ]); - $item_de->method('getFields')->willReturn(['foo' => $field_de]); - - $items = [$item_en, $item_de]; - $this->processor->preprocessIndexItems($items); - - /** @var \Drupal\search_api\Plugin\search_api\data_type\value\TextValueInterface $value */ - $value = $field_en->getValues()[0]; - $this->assertEquals('tie', $value->toText()); - $value = $field_de->getValues()[0]; - $this->assertEquals('ties', $value->toText()); - } - - /** - * Tests the preprocessSearchQuery() method. - * - * @param string[]|null $languages - * The languages to set for the query. - * @param bool $should_process - * Whether keys are expected to be processed by the processor or not. - * - * @covers ::preprocessSearchQuery - * - * @dataProvider preprocessSearchQueryDataProvider - */ - public function testPreprocessSearchQuery(array $languages = NULL, $should_process) { - /** @var \Drupal\search_api\Query\QueryInterface|\PHPUnit_Framework_MockObject_MockObject $query */ - $query = $this->createMock(QueryInterface::class); - $query->method('getLanguages')->willReturn($languages); - // Unfortunately, returning a reference (as getKeys() has to do for - // processing to work) doesn't seem to be possible with a mock object. But - // since the only code we really want to test is the language check, using - // an exception works just as well, and is quite simple. - $query->method('getKeys')->willThrowException(new SearchApiException()); - - try { - $this->processor->preprocessSearchQuery($query); - $this->assertFalse($should_process, "Keys weren't processed but should have been."); - } - catch (SearchApiException $e) { - $this->assertTrue($should_process, "Keys were processed but shouldn't have been."); - } - } - - /** - * Provides sets of arguments for testPreprocessSearchQuery(). - * - * @return array[] - * Arrays of arguments for testPreprocessSearchQuery(). - */ - public function preprocessSearchQueryDataProvider() { - return [ - 'language-less query' => [NULL, TRUE], - 'English query' => [['en'], TRUE], - 'Non-English query' => [['de'], FALSE], - 'Multilingual query (including English)' => [['en', 'fr', 'es'], TRUE], - 'Multilingual query (not including English)' => [['de', 'it'], FALSE], - ]; - } - - /** - * Tests the process() method. - * - * @param string $passed_value - * The value that should be passed into process(). - * @param string $expected_value - * The expected processed value. - * - * @covers ::process - * - * @dataProvider processDataProvider - */ - public function testProcess($passed_value, $expected_value) { - $this->invokeMethod('process', [&$passed_value]); - $this->assertEquals($passed_value, $expected_value); - } - - /** - * Provides sets of arguments for testProcess(). - * - * @return array[] - * Arrays of arguments for testProcess(). - */ - public function processDataProvider() { - return [ - ['Yo', 'yo'], - ['ties', 'tie'], - ['cries', 'cri'], - ['exceed', 'exceed'], - ['consign', 'consign'], - ['consigned', 'consign'], - ['consigning', 'consign'], - ['consignment', 'consign'], - ['consist', 'consist'], - ['consisted', 'consist'], - ['consistency', 'consist'], - ['consistent', 'consist'], - ['consistently', 'consist'], - ['consisting', 'consist'], - ['consists', 'consist'], - ['consolation', 'consol'], - ['consolations', 'consol'], - ['consolatory', 'consolatori'], - ['console', 'consol'], - ['consoled', 'consol'], - ['consoles', 'consol'], - ['consolidate', 'consolid'], - ['consolidated', 'consolid'], - ['consolidating', 'consolid'], - ['consoling', 'consol'], - ['consolingly', 'consol'], - ['consols', 'consol'], - ['consonant', 'conson'], - ['consort', 'consort'], - ['consorted', 'consort'], - ['consorting', 'consort'], - ['conspicuous', 'conspicu'], - ['conspicuously', 'conspicu'], - ['conspiracy', 'conspiraci'], - ['conspirator', 'conspir'], - ['conspirators', 'conspir'], - ['conspire', 'conspir'], - ['conspired', 'conspir'], - ['conspiring', 'conspir'], - ['constable', 'constabl'], - ['constables', 'constabl'], - ['constance', 'constanc'], - ['constancy', 'constanc'], - ['constant', 'constant'], - ['knack', 'knack'], - ['knackeries', 'knackeri'], - ['knacks', 'knack'], - ['knag', 'knag'], - ['knave', 'knave'], - ['knaves', 'knave'], - ['knavish', 'knavish'], - ['kneaded', 'knead'], - ['kneading', 'knead'], - ['knee', 'knee'], - ['kneel', 'kneel'], - ['kneeled', 'kneel'], - ['kneeling', 'kneel'], - ['kneels', 'kneel'], - ['knees', 'knee'], - ['knell', 'knell'], - ['knelt', 'knelt'], - ['knew', 'knew'], - ['knick', 'knick'], - ['knif', 'knif'], - ['knife', 'knife'], - ['knight', 'knight'], - ['knightly', 'knight'], - ['knights', 'knight'], - ['knit', 'knit'], - ['knits', 'knit'], - ['knitted', 'knit'], - ['knitting', 'knit'], - ['knives', 'knive'], - ['knob', 'knob'], - ['knobs', 'knob'], - ['knock', 'knock'], - ['knocked', 'knock'], - ['knocker', 'knocker'], - ['knockers', 'knocker'], - ['knocking', 'knock'], - ['knocks', 'knock'], - ['knopp', 'knopp'], - ['knot', 'knot'], - ['knots', 'knot'], - // This can happen when Tokenizer is off during indexing, or when - // preprocessing a search query with quoted keywords. - [" \tExtra spaces \rappeared \n", 'extra space appear'], - ["\tspaced-out \r\n", 'space out'], - ]; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StopwordsTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StopwordsTest.php deleted file mode 100644 index effcd6039..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/StopwordsTest.php +++ /dev/null @@ -1,118 +0,0 @@ -setUpMockContainer(); - $this->processor = new Stopwords([], 'stopwords', []);; - } - - /** - * Tests the process() method of the Stopwords processor. - * - * @param string $passed_value - * The string that should be passed to process(). - * @param string $expected_value - * The expected altered string. - * @param string[] $stopwords - * The stopwords with which to configure the test processor. - * - * @dataProvider processDataProvider - */ - public function testProcess($passed_value, $expected_value, array $stopwords) { - $this->processor->setConfiguration(['stopwords' => $stopwords]); - $this->invokeMethod('process', [&$passed_value]); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Data provider for testStopwords(). - * - * Processor checks for exact case, and tokenized content. - */ - public function processDataProvider() { - return [ - [ - 'or', - '', - ['or'], - ], - [ - 'orb', - 'orb', - ['or'], - ], - [ - 'for', - 'for', - ['or'], - ], - [ - 'ordor', - 'ordor', - ['or'], - ], - [ - 'ÄÖÜÀÁ<>»«û', - 'ÄÖÜÀÁ<>»«û', - ['stopword1', 'ÄÖÜÀÁ<>»«', 'stopword3'], - ], - [ - 'ÄÖÜÀÁ', - '', - ['stopword1', 'ÄÖÜÀÁ', 'stopword3'], - ], - [ - 'ÄÖÜÀÁ stopword1', - 'ÄÖÜÀÁ stopword1', - ['stopword1', 'ÄÖÜÀÁ', 'stopword3'], - ], - ]; - } - - /** - * Tests the processor's preprocessSearchQuery() method. - */ - public function testPreprocessSearchQuery() { - $index = $this->createMock(IndexInterface::class); - $index->expects($this->any()) - ->method('status') - ->will($this->returnValue(TRUE)); - /** @var \Drupal\search_api\IndexInterface $index */ - - $this->processor->setIndex($index); - $query = \Drupal::getContainer() - ->get('search_api.query_helper') - ->createQuery($index); - $keys = ['#conjunction' => 'AND', 'foo', 'bar', 'bar foo']; - $query->keys($keys); - - $configuration = ['stopwords' => ['foobar', 'bar', 'barfoo']]; - $this->processor->setConfiguration($configuration); - $this->processor->preprocessSearchQuery($query); - unset($keys[1]); - $this->assertEquals($keys, $query->getKeys()); - - $this->assertEquals(['bar'], $query->getResults()->getIgnoredSearchKeys()); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestFieldsProcessorPlugin.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestFieldsProcessorPlugin.php deleted file mode 100644 index 33a1a5313..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestFieldsProcessorPlugin.php +++ /dev/null @@ -1,135 +0,0 @@ -setTokens($tokens); - return $return; - } - - /** - * Overrides a method in this processor. - * - * @param string $method - * The name of the method to override. - * @param callable|null $override - * The new code of the method, or NULL to use the default. - */ - public function setMethodOverride($method, callable $override = NULL) { - $this->methodOverrides[$method] = $override; - } - - /** - * {@inheritdoc} - */ - protected function testField($name, FieldInterface $field) { - if (isset($this->methodOverrides[__FUNCTION__])) { - return $this->methodOverrides[__FUNCTION__]($name, $field); - } - return parent::testField($name, $field); - } - - /** - * {@inheritdoc} - */ - protected function testType($type) { - if (isset($this->methodOverrides[__FUNCTION__])) { - return $this->methodOverrides[__FUNCTION__]($type); - } - return parent::testType($type); - } - - /** - * {@inheritdoc} - */ - protected function processFieldValue(&$value, $type) { - if (isset($this->methodOverrides[__FUNCTION__])) { - $this->methodOverrides[__FUNCTION__]($value, $type); - return; - } - parent::processFieldValue($value, $type); - } - - /** - * {@inheritdoc} - */ - protected function processKey(&$value) { - if (isset($this->methodOverrides[__FUNCTION__])) { - $this->methodOverrides[__FUNCTION__]($value); - return; - } - parent::processKey($value); - } - - /** - * {@inheritdoc} - */ - protected function processConditionValue(&$value) { - if (isset($this->methodOverrides[__FUNCTION__])) { - $this->methodOverrides[__FUNCTION__]($value); - return; - } - parent::processConditionValue($value); - } - - /** - * {@inheritdoc} - */ - protected function process(&$value) { - if (isset($this->methodOverrides[__FUNCTION__])) { - $this->methodOverrides[__FUNCTION__]($value); - return; - } - if (isset($value)) { - $value = "*$value"; - } - else { - $value = 'undefined'; - } - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestItemsTrait.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestItemsTrait.php deleted file mode 100644 index 6dfb511f5..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TestItemsTrait.php +++ /dev/null @@ -1,156 +0,0 @@ -itemIds[0] = $itemId = Utility::createCombinedId('entity:node', '1:en'); - $item = new Item($index, $itemId); - $field = new Field($index, $fieldId); - $field->setType($fieldType); - $field->addValue($fieldValue); - $item->setField($fieldId, $field); - $item->setFieldsExtracted(TRUE); - - return [$itemId => $item]; - } - - /** - * Creates a certain number of test items. - * - * @param \Drupal\search_api\IndexInterface $index - * The index that should be used for the items. - * @param int $count - * The number of items to create. - * @param array[] $fields - * The fields to create on the items, with keys being combined property - * paths and values being arrays with properties to set on the field. - * @param \Drupal\Core\TypedData\ComplexDataInterface|null $object - * (optional) The object to set on each item as the "original object". - * @param array|null $datasource_ids - * (optional) An array of datasource IDs to use for the items, in that order - * (starting again from the front if necessary). - * - * @return \Drupal\search_api\Item\ItemInterface[] - * An array containing the requested test items. - */ - public function createItems(IndexInterface $index, $count, array $fields, ComplexDataInterface $object = NULL, array $datasource_ids = ['entity:node']) { - $datasource_count = count($datasource_ids); - $items = []; - for ($i = 0; $i < $count; ++$i) { - $datasource_id = $datasource_ids[$i % $datasource_count]; - $this->itemIds[$i] = $item_id = Utility::createCombinedId($datasource_id, ($i + 1) . ':en'); - $item = new Item($index, $item_id); - if (isset($object)) { - $item->setOriginalObject($object); - } - foreach ($fields as $combined_property_path => $field_info) { - list($field_info['datasource_id'], $field_info['property_path']) = Utility::splitCombinedId($combined_property_path); - // Only add fields of the right datasource. - if (isset($field_info['datasource_id']) && $field_info['datasource_id'] != $datasource_id) { - continue; - } - $fields_helper = \Drupal::getContainer() - ->get('search_api.fields_helper'); - $field_id = $fields_helper->getNewFieldId($index, $field_info['property_path']); - $field = $fields_helper->createField($index, $field_id, $field_info); - $item->setField($field_id, $field); - } - $item->setFieldsExtracted(TRUE); - $items[$item_id] = $item; - } - return $items; - } - - /** - * Adds a container with several mock services commonly needed by our tests. - */ - protected function setUpMockContainer() { - /** @var \Drupal\Tests\UnitTestCase|\Drupal\Tests\search_api\Unit\Processor\TestItemsTrait $this */ - $dataTypeManager = $this->getMockBuilder('Drupal\search_api\DataType\DataTypePluginManager') - ->disableOriginalConstructor() - ->getMock(); - $dataTypeManager->method('getInstances') - ->will($this->returnValue([])); - - $moduleHandler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface') - ->disableOriginalConstructor() - ->getMock(); - $dataTypeHelper = new DataTypeHelper($moduleHandler, $dataTypeManager); - - $entityTypeManager = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeManagerInterface') - ->disableOriginalConstructor() - ->getMock(); - $entityFieldManager = $this->getMockBuilder('Drupal\Core\Entity\EntityFieldManagerInterface') - ->disableOriginalConstructor() - ->getMock(); - $entityBundleInfo = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeBundleInfoInterface') - ->disableOriginalConstructor() - ->getMock(); - $fieldsHelper = new FieldsHelper($entityTypeManager, $entityFieldManager, $entityBundleInfo, $dataTypeHelper); - - $queryHelper = $this->createMock(QueryHelperInterface::class); - $queryHelper->method('createQuery') - ->willReturnCallback(function (IndexInterface $index, array $options = []) { - return Query::create($index, $options); - }); - $queryHelper->method('getResults') - ->will($this->returnValue([])); - - $this->container = new ContainerBuilder(); - $this->container->set('plugin.manager.search_api.data_type', $dataTypeManager); - $this->container->set('search_api.data_type_helper', $dataTypeHelper); - $this->container->set('search_api.fields_helper', $fieldsHelper); - $this->container->set('search_api.query_helper', $queryHelper); - \Drupal::setContainer($this->container); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TokenizerTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TokenizerTest.php deleted file mode 100644 index cdac9a528..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TokenizerTest.php +++ /dev/null @@ -1,389 +0,0 @@ -processor = new Tokenizer([], 'tokenizer', []); - } - - /** - * Tests the processFieldValue() method. - * - * @param string $passed_value - * The field value passed to the processor's processFieldValue() method. - * @param string $expected_value - * The expected preprocessed value. - * @param array $config - * (optional) Configuration to override the processor's defaults. - * - * @dataProvider textDataProvider - */ - public function testProcessFieldValue($passed_value, $expected_value, array $config = []) { - if ($config) { - $this->processor->setConfiguration($config); - } - $type = 'text'; - $this->invokeMethod('processFieldValue', [&$passed_value, $type]); - $this->assertEquals($expected_value, $passed_value); - } - - /** - * Provides test data for testValueConfiguration(). - * - * @return array - * Arrays of parameters for testProcessFieldValue(), each containing (in - * this order): - * - The field value passed to the processor's processFieldValue() method. - * - The expected preprocessed value. - * - (optional) Configuration to override the processor's defaults. - */ - public function textDataProvider() { - $word_token = Utility::createTextToken('word'); - return [ - // Test some simple cases. - ['word', [$word_token]], - ['word word', [$word_token, $word_token]], - // Test whether the default splits on special characters, too. - ['words!word', [Utility::createTextToken('words'), $word_token]], - ['words$word', [Utility::createTextToken('words'), $word_token]], - // Test whether overriding the default works and is case-insensitive. - [ - 'wordXwordxword', - [$word_token, Utility::createTextToken('wordxword')], - ['spaces' => 'X'], - ], - [ - 'word3word!word', - [$word_token, Utility::createTextToken('word!word')], - ['spaces' => '\d'], - ], - [ - 'wordXwordRword', - [$word_token, $word_token, $word_token], - ['spaces' => 'R-Z'], - ], - [ - 'wordXwordRword', - [$word_token, $word_token, $word_token], - ['spaces' => 'R-TW-Z'], - ], - [ - 'wordXword word', - [$word_token, $word_token, $word_token], - ['spaces' => 'R-Z'], - ], - // Test whether minimum word size works. - [ - 'wordSwo', - [$word_token], - ['spaces' => 'R-Z'], - ], - [ - 'wordSwo', - [$word_token, Utility::createTextToken('wo')], - ['spaces' => 'R-Z', 'minimum_word_size' => 2], - ], - [ - 'word w', - [$word_token], - ['minimum_word_size' => 2], - ], - [ - 'word w', - [$word_token, Utility::createTextToken('w')], - ['minimum_word_size' => 1], - ], - [ - 'word wordword', - [], - ['minimum_word_size' => 10], - ], - ]; - } - - /** - * Tests that the simplifyText() method handles CJK characters properly. - * - * The simplifyText() method does special things with numbers, symbols and - * punctuation. So we only test that CJK characters that are not in these - * character classes are tokenized properly. See PREG_CLASS_CJK for more - * information. - */ - public function testCjkSupport() { - $this->invokeMethod('prepare'); - - // Create a string of CJK characters from various character ranges in - // the Unicode tables. $starts contains the starts of the character ranges, - // $ends the ends. - $starts = [ - 'CJK unified' => 0x4e00, - 'CJK Ext A' => 0x3400, - 'CJK Compat' => 0xf900, - 'Hangul Jamo' => 0x1100, - 'Hangul Ext A' => 0xa960, - 'Hangul Ext B' => 0xd7b0, - 'Hangul Compat' => 0x3131, - 'Half non-punct 1' => 0xff21, - 'Half non-punct 2' => 0xff41, - 'Half non-punct 3' => 0xff66, - 'Hangul Syllables' => 0xac00, - 'Hiragana' => 0x3040, - 'Katakana' => 0x30a1, - 'Katakana Ext' => 0x31f0, - 'CJK Reserve 1' => 0x20000, - 'CJK Reserve 2' => 0x30000, - 'Bomofo' => 0x3100, - 'Bomofo Ext' => 0x31a0, - 'Lisu' => 0xa4d0, - 'Yi' => 0xa000, - ]; - $ends = [ - 'CJK unified' => 0x9fcf, - 'CJK Ext A' => 0x4dbf, - 'CJK Compat' => 0xfaff, - 'Hangul Jamo' => 0x11ff, - 'Hangul Ext A' => 0xa97f, - 'Hangul Ext B' => 0xd7ff, - 'Hangul Compat' => 0x318e, - 'Half non-punct 1' => 0xff3a, - 'Half non-punct 2' => 0xff5a, - 'Half non-punct 3' => 0xffdc, - 'Hangul Syllables' => 0xd7af, - 'Hiragana' => 0x309f, - 'Katakana' => 0x30ff, - 'Katakana Ext' => 0x31ff, - 'CJK Reserve 1' => 0x2fffd, - 'CJK Reserve 2' => 0x3fffd, - 'Bomofo' => 0x312f, - 'Bomofo Ext' => 0x31b7, - 'Lisu' => 0xa4fd, - 'Yi' => 0xa48f, - ]; - - // Generate characters consisting of starts, midpoints, and ends. - $chars = []; - foreach ($starts as $key => $value) { - $chars[] = static::codepointToUtf8($starts[$key]); - $mid = round(0.5 * ($starts[$key] + $ends[$key])); - $chars[] = static::codepointToUtf8($mid); - $chars[] = static::codepointToUtf8($ends[$key]); - } - - // Merge into a single string and tokenize. - $text = implode('', $chars); - $simplified_text = $this->invokeMethod('simplifyText', [$text]); - - // Prepare the expected return value, which consists of all the 3-grams in - // the original string, separated by spaces. - $expected = ''; - for ($i = 2; $i < count($chars); ++$i) { - $expected .= $chars[$i - 2]; - $expected .= $chars[$i - 1]; - $expected .= $chars[$i]; - $expected .= ' '; - } - $expected = trim($expected); - - // Verify that the output matches what we expect. - $this->assertEquals($expected, $simplified_text, 'CJK tokenizer worked on all supplied CJK characters'); - - // Verify that disabling the "overlap_cjk" setting works as expected. - $this->processor->setConfiguration(['overlap_cjk' => FALSE]); - $this->invokeMethod('prepare'); - $simplified_text = $this->invokeMethod('simplifyText', [$text]); - $this->assertEquals($text, $simplified_text, 'CJK tokenizing is successfully disabled'); - } - - /** - * Verifies that strings of non-CJK characters are not tokenized. - * - * This is just a sanity check – it verifies that strings of letters are - * not tokenized. - */ - public function testNoTokenizer() { - // Set the minimum word size to 1 (to split all CJK characters). - $this->processor->setConfiguration(['minimum_word_size' => 1]); - $this->invokeMethod('prepare'); - - $letters = 'abcdefghijklmnopqrstuvwxyz'; - $out = $this->invokeMethod('simplifyText', [$letters]); - - $this->assertEquals($letters, $out, 'Latin letters are not CJK tokenized'); - } - - /** - * Converts a Unicode code point to a UTF-8 string. - * - * The PHP function "chr()" only works for ASCII characters up to character - * 255. This function converts a number to the corresponding unicode - * character. Adapted from functions supplied in comments on several functions - * on php.net. - * - * @param int $num - * A Unicode code point. - * - * @return string - * A UTF-8 string containing the character corresponding to that code point. - */ - protected static function codepointToUtf8($num) { - if ($num < 128) { - return chr($num); - } - - if ($num < 2048) { - return chr(($num >> 6) + 192) . chr(($num & 63) + 128); - } - - if ($num < 65536) { - return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); - } - - if ($num < 2097152) { - return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); - } - - return ''; - } - - /** - * Tests that all Unicode characters simplify correctly. - * - * This test uses a Drupal core search file that was constructed so that the - * even lines are boundary characters, and the odd lines are valid word - * characters. (It was generated as a sequence of all the Unicode characters, - * and then the boundary characters (punctuation, spaces, etc.) were split - * off into their own lines). So the even-numbered lines should simplify to - * nothing, and the odd-numbered lines we need to split into shorter chunks - * and verify that simplification doesn't lose any characters. - * - * @see \Drupal\search\Tests\SearchSimplifyTest::testSearchSimplifyUnicode() - */ - public function testSearchSimplifyUnicode() { - // Set the minimum word size to 1 (to split all CJK characters). - $this->processor->setConfiguration(['minimum_word_size' => 1]); - $this->invokeMethod('prepare'); - - $input = file_get_contents($this->root . '/core/modules/search/tests/UnicodeTest.txt'); - $basestrings = explode(chr(10), $input); - $strings = []; - foreach ($basestrings as $key => $string) { - if ($key % 2) { - // Even line, should be removed by simplifyText(). - $simplified = $this->invokeMethod('simplifyText', [$string]); - $this->assertEquals('', $simplified, "Line $key is excluded from the index"); - } - else { - // Odd line, should be word characters (which might be expanded, but - // never removed). Split this into 30-character chunks, so we don't run - // into limits of truncation. - $start = 0; - while ($start < mb_strlen($string)) { - $newstr = mb_substr($string, $start, 30); - // Special case: leading zeros are removed from numeric strings, - // and there's one string in this file that is numbers starting with - // zero, so prepend a 1 on that string. - if (preg_match('/^[0-9]+$/', $newstr)) { - $newstr = '1' . $newstr; - } - $strings[] = $newstr; - $start += 30; - } - } - } - foreach ($strings as $key => $string) { - $simplified = $this->invokeMethod('simplifyText', [$string]); - $this->assertGreaterThanOrEqual(mb_strlen($string), mb_strlen($simplified), "Nothing is removed from string $key."); - } - - // Test the low-numbered ASCII control characters separately. They are not - // in the text file because they are problematic for diff, especially \0. - $string = ''; - for ($i = 0; $i < 32; $i++) { - $string .= chr($i); - } - $this->assertEquals('', $this->invokeMethod('simplifyText', [$string]), 'Text simplification works for ASCII control characters.'); - } - - /** - * Tests whether punctuation is treated correctly. - * - * @param string $passed_value - * The string passed to simplifyText(). - * @param string $expected_value - * The expected return value. - * @param string $message - * The message to display for the assertion. - * - * @dataProvider searchSimplifyPunctuationProvider - */ - public function testSearchSimplifyPunctuation($passed_value, $expected_value, $message) { - // Set the minimum word size to 1 (to split all CJK characters). - $this->processor->setConfiguration(['minimum_word_size' => 1]); - $this->invokeMethod('prepare'); - - $out = $this->invokeMethod('simplifyText', [$passed_value]); - $this->assertEquals($expected_value, $out, $message); - } - - /** - * Provides test data for testSearchSimplifyPunctuation(). - * - * @return array - * Arrays of parameters for testSearchSimplifyPunctuation(), each containing - * (in this order): - * - The string passed to simplifyText(). - * - The expected return value. - * - The message to display for the assertion. - */ - public function searchSimplifyPunctuationProvider() { - $cases = [ - [ - '20.03/94-28,876', - '20039428876', - 'Punctuation removed from numbers', - ], - [ - 'great...drupal--module', - 'great drupal module', - 'Multiple dot and dashes are word boundaries', - ], - [ - 'very_great-drupal.module', - 'verygreatdrupalmodule', - 'Single dot, dash, underscore are removed', - ], - [ - 'regular,punctuation;word', - 'regular punctuation word', - 'Punctuation is a word boundary', - ], - [ - 'Äußerung français repülőtér', - 'Äußerung français repülőtér', - 'Umlauts and accented characters are not treated as word boundaries', - ], - ]; - return $cases; - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TransliterationTest.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TransliterationTest.php deleted file mode 100644 index 44da8a814..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/Processor/TransliterationTest.php +++ /dev/null @@ -1,85 +0,0 @@ -index = $this->createMock(IndexInterface::class); - - $this->setUpMockContainer(); - $this->processor = new Transliteration([], 'transliteration', []); - $this->processor->setLangcode('en'); - - $transliterator = $this->createMock(TransliterationInterface::class); - $transliterate = function ($string, $langcode = 'en', $unknown_character = '?', $max_length = NULL) { - return "translit-$string-$langcode$unknown_character$max_length"; - }; - $transliterator->expects($this->any()) - ->method('transliterate') - ->will($this->returnCallback($transliterate)); - /** @var \Drupal\Component\Transliteration\TransliterationInterface $transliterator */ - $this->processor->setTransliterator($transliterator); - } - - /** - * Tests that integers are not affected. - */ - public function testTransliterationWithInteger() { - $field_value = 5; - /** @var \Drupal\search_api\Item\FieldInterface $field */ - $items = $this->createSingleFieldItem($this->index, 'int', $field_value, $field); - $this->processor->preprocessIndexItems($items); - $this->assertEquals([$field_value], $field->getValues(), 'Integer not affected by transliteration.'); - } - - /** - * Tests that floating point numbers are not affected. - */ - public function testTransliterationWithDouble() { - $field_value = 3.14; - /** @var \Drupal\search_api\Item\FieldInterface $field */ - $items = $this->createSingleFieldItem($this->index, 'double', $field_value, $field); - $this->processor->preprocessIndexItems($items); - $this->assertEquals([$field_value], $field->getValues(), 'Floating point number not affected by transliteration.'); - } - - /** - * Tests that strings are affected. - */ - public function testTransliterationWithString() { - $field_value = 'test_string'; - /** @var \Drupal\search_api\Item\FieldInterface $field */ - $items = $this->createSingleFieldItem($this->index, 'string', $field_value, $field); - $this->processor->preprocessIndexItems($items); - $expected_value = "translit-$field_value-en?"; - $this->assertEquals([$expected_value], $field->getValues(), 'Strings are correctly transliterated.'); - } - -} diff --git a/sites/all/modules/contrib/search/search_api/tests/src/Unit/TestComplexDataInterface.php b/sites/all/modules/contrib/search/search_api/tests/src/Unit/TestComplexDataInterface.php deleted file mode 100644 index 003a696e6..000000000 --- a/sites/all/modules/contrib/search/search_api/tests/src/Unit/TestComplexDataInterface.php +++ /dev/null @@ -1,13 +0,0 @@ - docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - - # Pull container. - - docker pull geerlingguy/drupal-vm:latest - -script: - # Build environment and install Honeypot. - - docker-compose up -d - - docker exec honeypot install-drupal 8.x-dev - - docker exec honeypot ln -s /opt/honeypot/ /var/www/drupalvm/drupal/web/modules/honeypot - - docker exec honeypot bash -c 'cd /var/www/drupalvm/drupal/web; drush en -y honeypot simpletest' - - # Fix permissions on the simpletest directories. - - docker exec honeypot mkdir -p /var/www/drupalvm/drupal/web/sites/simpletest - - docker exec honeypot chown -R www-data:www-data /var/www/drupalvm/drupal/web/sites/simpletest - - docker exec honeypot chown -R www-data:www-data /var/www/drupalvm/drupal/web/sites/default/files - - # Run module tests. - - docker exec honeypot bash -c 'sudo -u www-data php /var/www/drupalvm/drupal/web/core/scripts/run-tests.sh --verbose --module honeypot --url http://localhost/' diff --git a/sites/all/modules/contrib/security/honeypot/LICENSE.txt b/sites/all/modules/contrib/security/honeypot/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/security/honeypot/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/security/honeypot/README.md b/sites/all/modules/contrib/security/honeypot/README.md deleted file mode 100644 index 7930749f9..000000000 --- a/sites/all/modules/contrib/security/honeypot/README.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Honeypot - -[![Build Status](https://travis-ci.org/geerlingguy/drupal-honeypot.svg?branch=8.x-1.x)](https://travis-ci.org/geerlingguy/drupal-honeypot) - - -## Installation - -To install this module, `composer require` it, or place it in your modules -folder and enable it on the modules page. - - -## Configuration - -All settings for this module are on the Honeypot configuration page, under the -Configuration section, in the Content authoring settings. You can visit the -configuration page directly at admin/config/content/honeypot. - -Note that, when testing Honeypot on your website, make sure you're not logged in -as an administrative user or user 1; Honeypot allows administrative users to -bypass Honeypot protection, so by default, Honeypot will not be added to forms -accessed by site administrators. - - -## Use in Your Own Forms - -If you want to add honeypot to your own forms, or to any form through your own -module's hook_form_alter's, you can simply place the following function call -inside your form builder function (or inside a hook_form_alter): - - honeypot_add_form_protection( - $form, - $form_state, - ['honeypot', 'time_restriction'] - ); - -Note that you can enable or disable either the honeypot field, or the time -restriction on the form by including or not including the option in the array. - - -## Testing - -Honeypot includes a `docker-compose.yml` file that can be used for testing purposes. To build a Drupal 8 environment for local testing, do the following: - - 1. Make sure you have Docker for Mac (or for whatever OS you're using) installed. - 2. Add the following entry to your `/etc/hosts` file: `192.168.22.33 local.drupalhoneypot.com` - 3. Run `docker-compose up -d` in this directory. - 4. Install Drupal: `docker exec honeypot install-drupal` (optionally provide a version after `install-drupal`). - 5. Link the honeypot module directory into the Drupal modules directory: `docker exec honeypot ln -s /opt/honeypot/ /var/www/drupalvm/drupal/web/modules/honeypot` - 6. Visit `http://local.drupalhoneypot.com/user` and log in using the admin credentials Drush displayed. - -> Note: If you're using a Mac, you may also need to perform additional steps to get the hostname working; see [Managing your hosts file](http://docs.drupalvm.com/en/latest/other/docker/#managing-your-hosts-file) in the Drupal VM documentation. - - -## Credit - -The Honeypot module was originally developed by Jeff Geerling of Midwestern Mac, -LLC (midwesternmac.com), and sponsored by Flocknote (flocknote.com). diff --git a/sites/all/modules/contrib/security/honeypot/composer.json b/sites/all/modules/contrib/security/honeypot/composer.json deleted file mode 100644 index c8d309634..000000000 --- a/sites/all/modules/contrib/security/honeypot/composer.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "drupal/honeypot", - "description": "Mitigates spam form submissions using the honeypot method.", - "type": "drupal-module", - "license": "GPL-2.0+", - "keywords": ["spam", "php", "form", "honeypot", "honeytrap", "deterrent"], - "homepage": "https://www.drupal.org/project/honeypot", - "minimum-stability": "dev", - "authors": [ - { - "name": "Jeff Geerling", - "email": "geerlingguy@mac.com" - } - ], - "require": { } -} diff --git a/sites/all/modules/contrib/security/honeypot/config/install/honeypot.settings.yml b/sites/all/modules/contrib/security/honeypot/config/install/honeypot.settings.yml deleted file mode 100644 index e70bdc2af..000000000 --- a/sites/all/modules/contrib/security/honeypot/config/install/honeypot.settings.yml +++ /dev/null @@ -1,16 +0,0 @@ -unprotected_forms: - - 'user_login_form' - - 'search_form' - - 'search_block_form' - - 'views_exposed_form' - - 'honeypot_settings_form' -protect_all_forms: false -log: false -element_name: 'url' -time_limit: 5 -expire: 300 -form_settings: - user_register_form: false - user_pass: false - feedback_contact_message_form: false - _contact_message_form: false diff --git a/sites/all/modules/contrib/security/honeypot/config/optional/tour.tour.honeypot.yml b/sites/all/modules/contrib/security/honeypot/config/optional/tour.tour.honeypot.yml deleted file mode 100644 index 1de333a55..000000000 --- a/sites/all/modules/contrib/security/honeypot/config/optional/tour.tour.honeypot.yml +++ /dev/null @@ -1,59 +0,0 @@ -id: honeypot -module: honeypot -label: Honeypot -langcode: en -routes: - - route_name: honeypot.config -tips: - honeypot-configuration: - id: honeypot-configuration - plugin: text - label: Honeypot - weight: -10 - body: "Congratulations on installing Honeypot on your site! With just a few clicks, you can have your site well-protected against automated spam bots.\r\n\r\nClick Next to be guided through this configuration page." - location: top - protect-all-forms: - id: protect-all-forms - plugin: text - label: 'Protect all forms' - weight: -9 - attributes: - data-id: edit-protect-all-forms - body: "Protecting all the forms is the easiest way to quickly cut down on spam on your site, but doing this disables Drupal's caching for every page where a form is displayed.\r\n\r\nNote: If you have the honeypot time limit enabled, this option may cause issues with Drupal Commerce product forms or similarly-sparse forms that are able to be completed in a very short time." - location: bottom - log-blocked-form-submissions: - id: log-blocked-form-submissions - plugin: text - label: 'Log blocked form submissions' - weight: -8 - attributes: - data-id: edit-log - body: 'Check this box to log every form submission using watchdog. If you have Database Logging enabled, you can view these log entries in the Recent log messages page under Reports.' - location: bottom - honeypot-element-name: - id: honeypot-element-name - plugin: text - label: 'Honeypot Element Name' - weight: -7 - attributes: - data-id: edit-element-name - body: 'Spam bots typically fill out any field they believe will help get links back to their site, so tempting them with a field named something like ''url'', ''homepage'', or ''link'' makes it hard for them to resist filling in the field—and easy to catch them in the trap and reject their submissions!' - location: top - honeypot-time-limit: - id: honeypot-time-limit - plugin: text - label: 'Honeypot Time Limit' - weight: -6 - attributes: - data-id: edit-time-limit - body: 'If you enter a positive value, Honeypot will require that all protected forms take at least that many seconds long to fill out. Most forms take at least 5-10 seconds to complete (if you''re a human), so setting this to a value < 5 will help protect against spam bots. Set to 0 to disable.' - location: top - honeypot-form-specific-settings: - id: honeypot-form-specific-settings - plugin: text - label: 'Honeypot form-specific settings' - weight: -5 - attributes: - data-id: edit-form-settings - body: 'If you would like to choose particular forms to be protected by Honeypot, check the forms you wish to protect in this section. Most common types of forms are available for protection.' - location: top diff --git a/sites/all/modules/contrib/security/honeypot/config/schema/honeypot.schema.yml b/sites/all/modules/contrib/security/honeypot/config/schema/honeypot.schema.yml deleted file mode 100644 index ec37c016b..000000000 --- a/sites/all/modules/contrib/security/honeypot/config/schema/honeypot.schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -honeypot.settings: - type: config_object - mapping: - protect_all_forms: - type: boolean - label: 'Protect all forms' - unprotected_forms: - type: sequence - label: 'Unprotected forms' - sequence: - type: string - label: 'Unprotected form' - log: - type: boolean - label: 'Log blocked form submissions' - element_name: - type: string - label: 'Honeypot element name' - time_limit: - type: integer - label: 'Honeypot time limit' - expire: - type: integer - label: 'Expiration' - form_settings: - type: sequence - sequence: - type: boolean diff --git a/sites/all/modules/contrib/security/honeypot/docker-compose.yml b/sites/all/modules/contrib/security/honeypot/docker-compose.yml deleted file mode 100644 index 110425415..000000000 --- a/sites/all/modules/contrib/security/honeypot/docker-compose.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: "3" - -services: - - honeypot: - image: geerlingguy/drupal-vm - container_name: honeypot - ports: - - 80:80 - - 443:443 - privileged: true - extra_hosts: - local.drupalhoneypot.com: 127.0.0.1 - dns: - - 8.8.8.8 - - 8.8.4.4 - volumes: - # Switch to the commented line once Docker CE stable has the feature. - - ./:/opt/honeypot/:rw - # - ./:/opt/honeypot/:rw,delegated - command: /lib/systemd/systemd - networks: - honeypot: - ipv4_address: 192.168.22.33 - -networks: - - honeypot: - driver: bridge - driver_opts: - ip: 192.168.22.1 - ipam: - config: - - subnet: "192.168.22.0/16" diff --git a/sites/all/modules/contrib/security/honeypot/honeypot.api.php b/sites/all/modules/contrib/security/honeypot/honeypot.api.php deleted file mode 100644 index efe433224..000000000 --- a/sites/all/modules/contrib/security/honeypot/honeypot.api.php +++ /dev/null @@ -1,100 +0,0 @@ - 'Table that stores failed attempts to submit a form.', - 'fields' => [ - 'uid' => [ - 'description' => 'Foreign key to {users}.uid; uniquely identifies a Drupal user to whom this ACL data applies.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'hostname' => [ - 'type' => 'varchar', - 'length' => 128, - 'not null' => TRUE, - 'description' => 'Hostname of user that that triggered honeypot.', - ], - 'timestamp' => [ - 'description' => 'Date/time when the form submission failed, as Unix timestamp.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - ], - 'indexes' => [ - 'uid' => ['uid'], - 'timestamp' => ['timestamp'], - ], - ]; - return $schema; -} - -/** - * Implements hook_install(). - */ -function honeypot_install() { - if (PHP_SAPI !== 'cli') { - $config_url = Url::fromUri('base://admin/config/content/honeypot'); - drupal_set_message(t( - 'Honeypot installed successfully. Please configure Honeypot to protect your forms from spam bots.', - [':url' => $config_url->toString()] - )); - } -} - -/** - * Implements hook_uninstall(). - */ -function honeypot_uninstall() { - // Clear the bootstrap cache. - \Drupal::cache('bootstrap')->deleteAll(); - \Drupal::configFactory()->getEditable('honeypot.settings.yml')->delete(); -} - -/** - * Adds the 'hostname' column to the {honeypot_user} table. - */ -function honeypot_update_8100() { - $schema = honeypot_schema(); - $spec = $schema['honeypot_user']['fields']['hostname']; - $spec['initial'] = ''; - \Drupal::database()->schema()->addField('honeypot_user', 'hostname', $spec); -} diff --git a/sites/all/modules/contrib/security/honeypot/honeypot.links.menu.yml b/sites/all/modules/contrib/security/honeypot/honeypot.links.menu.yml deleted file mode 100644 index 2a7ec411c..000000000 --- a/sites/all/modules/contrib/security/honeypot/honeypot.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -honeypot.config: - title: Honeypot configuration - description: 'Configure Honeypot spam prevention and the forms on which Honeypot will be used.' - parent: system.admin_config_content - route_name: honeypot.config diff --git a/sites/all/modules/contrib/security/honeypot/honeypot.module b/sites/all/modules/contrib/security/honeypot/honeypot.module deleted file mode 100644 index 55bec566e..000000000 --- a/sites/all/modules/contrib/security/honeypot/honeypot.module +++ /dev/null @@ -1,337 +0,0 @@ -' . t('About') . ''; - $output .= '

        ' . t('The Honeypot module uses both the honeypot and timestamp methods of deterring spam bots from completing forms on your Drupal site. These methods are effective against many spam bots, and are not as intrusive as CAPTCHAs or other methods which punish the user. For more information, see the online documentation for the Honeypot module.', [':url' => 'https://www.drupal.org/docs/8/modules/honeypot']) . '

        '; - $output .= '

        ' . t('Uses') . '

        '; - $output .= '
        '; - $output .= '
        ' . t('Configuring Honeypot') . '
        '; - $output .= '
        ' . t('All settings for this module are on the Honeypot configuration page, under the Configuration section, in the Content authoring settings. You can visit the configuration page directly from the Honeypot configuration link below. The configuration settings are described in the online documentation for the Honeypot module.', [':url' => 'https://www.drupal.org/docs/8/modules/honeypot/using-honeypot']) . '
        '; - $output .= '
        ' . t('Setting up Honeypot in your own forms') . '
        '; - $output .= '
        ' . t('Honeypot protection can be bypassed for certain user roles. For instance, site administrators, who just might be able to fill out a form in less than 5 seconds. And, Honeypot protection can be enabled only for certain forms. Or, it can protect all forms on the site. Finally, honeypot protection can be used in any of your own forms by simply including a little code snippet included on the module\'s project page.') . '
        '; - $output .= '
        '; - return $output; - } -} - -/** - * Implements hook_cron(). - */ -function honeypot_cron() { - // Delete {honeypot_user} entries older than the value of honeypot_expire. - $expire_limit = \Drupal::config('honeypot.settings')->get('expire'); - \Drupal::database()->delete('honeypot_user') - ->condition('timestamp', \Drupal::time()->getRequestTime() - $expire_limit, '<') - ->execute(); -} - -/** - * Implements hook_form_alter(). - * - * Add Honeypot features to forms enabled in the Honeypot admin interface. - */ -function honeypot_form_alter(&$form, FormStateInterface $form_state, $form_id) { - // Don't use for maintenance mode forms (install, update, etc.). - if (defined('MAINTENANCE_MODE')) { - return; - } - - // Add a tag to all forms, so that if they are cached and honeypot - // configuration is changed, the cached forms are invalidated and honeypot - // protection can be re-evaluated. - $form['#cache']['tags'][] = 'config:honeypot.settings'; - - // Get list of unprotected forms and setting for whether to protect all forms. - $unprotected_forms = \Drupal::config('honeypot.settings')->get('unprotected_forms'); - $protect_all_forms = \Drupal::config('honeypot.settings')->get('protect_all_forms'); - - // If configured to protect all forms, add protection to every form. - if ($protect_all_forms && !in_array($form_id, $unprotected_forms)) { - // Don't protect system forms - only admins should have access, and system - // forms may be programmatically submitted by drush and other modules. - if (preg_match('/[^a-zA-Z]system_/', $form_id) === 0 && preg_match('/[^a-zA-Z]search_/', $form_id) === 0 && preg_match('/[^a-zA-Z]views_exposed_form_/', $form_id) === 0) { - honeypot_add_form_protection($form, $form_state, ['honeypot', 'time_restriction']); - } - } - - // Otherwise add form protection to admin-configured forms. - elseif ($forms_to_protect = honeypot_get_protected_forms()) { - foreach ($forms_to_protect as $protect_form_id) { - // For most forms, do a straight check on the form ID. - if ($form_id == $protect_form_id) { - honeypot_add_form_protection($form, $form_state, ['honeypot', 'time_restriction']); - } - } - } -} - -/** - * Build an array of all the protected forms on the site, by form_id. - */ -function honeypot_get_protected_forms() { - $forms = &drupal_static(__FUNCTION__); - - // If the data isn't already in memory, get from cache or look it up fresh. - if (!isset($forms)) { - if ($cache = \Drupal::cache()->get('honeypot_protected_forms')) { - $forms = $cache->data; - } - else { - $form_settings = \Drupal::config('honeypot.settings')->get('form_settings'); - if (!empty($form_settings)) { - // Add each form that's enabled to the $forms array. - foreach ($form_settings as $form_id => $enabled) { - if ($enabled) { - $forms[] = $form_id; - } - } - } - else { - $forms = []; - } - - // Save the cached data. - \Drupal::cache()->set('honeypot_protected_forms', $forms); - } - } - - return $forms; -} - -/** - * Form builder function to add different types of protection to forms. - * - * @param array $options - * Array of options to be added to form. Currently accepts 'honeypot' and - * 'time_restriction'. - */ -function honeypot_add_form_protection(&$form, FormStateInterface $form_state, array $options = []) { - $account = \Drupal::currentUser(); - - // Allow other modules to alter the protections applied to this form. - \Drupal::moduleHandler()->alter('honeypot_form_protections', $options, $form); - - // Don't add any protections if the user can bypass the Honeypot. - if ($account->hasPermission('bypass honeypot protection')) { - return; - } - - // Build the honeypot element. - if (in_array('honeypot', $options)) { - // Get the element name (default is generic 'url'). - $honeypot_element = \Drupal::config('honeypot.settings')->get('element_name'); - - // Build the honeypot element. - $honeypot_class = $honeypot_element . '-textfield'; - $form[$honeypot_element] = [ - '#theme_wrappers' => [ - 'container' => [ - '#id' => NULL, - '#attributes' => [ - 'class' => [ - $honeypot_class, - ], - 'style' => [ - 'display: none !important;', - ], - ], - ], - ], - '#type' => 'textfield', - '#title' => t('Leave this field blank'), - '#size' => 20, - '#weight' => 100, - '#attributes' => ['autocomplete' => 'off'], - '#element_validate' => ['_honeypot_honeypot_validate'], - ]; - - } - - // Set the time restriction for this form (if it's not disabled). - if (in_array('time_restriction', $options) && \Drupal::config('honeypot.settings')->get('time_limit') != 0) { - // Set the current time in a hidden value to be checked later. - $input = $form_state->getUserInput(); - if (empty($input['honeypot_time'])) { - $identifier = Crypt::randomBytesBase64(); - \Drupal::service('keyvalue.expirable')->get('honeypot_time_restriction')->setWithExpire($identifier, time(), 3600*24); - } - else { - $identifier = $input['honeypot_time']; - } - $form['honeypot_time'] = [ - '#type' => 'hidden', - '#title' => t('Timestamp'), - '#default_value' => $identifier, - '#element_validate' => ['_honeypot_time_restriction_validate'], - '#cache' => [ - 'max-age' => 0, - ], - ]; - - // Disable page caching to make sure timestamp isn't cached. - $account = \Drupal::currentUser(); - if ($account->id() == 0) { - // TODO D8 - Use DIC? See: http://drupal.org/node/1539454 - // Should this now set 'omit_vary_cookie' instead? - Drupal::service('page_cache_kill_switch')->trigger(); - } - } - - // Allow other modules to react to addition of form protection. - if (!empty($options)) { - \Drupal::moduleHandler()->invokeAll('honeypot_add_form_protection', [$options, $form]); - } -} - -/** - * Validate honeypot field. - */ -function _honeypot_honeypot_validate($element, FormStateInterface $form_state) { - // Get the honeypot field value. - $honeypot_value = $element['#value']; - - // Make sure it's empty. - if (!empty($honeypot_value)) { - _honeypot_log($form_state->getValue('form_id'), 'honeypot'); - $form_state->setErrorByName('', t('There was a problem with your form submission. Please refresh the page and try again.')); - } -} - -/** - * Validate honeypot's time restriction field. - */ -function _honeypot_time_restriction_validate($element, FormStateInterface $form_state) { - if ($form_state->isProgrammed()) { - // Don't do anything if the form was submitted programmatically. - return; - } - - $triggering_element = $form_state->getTriggeringElement(); - // Don't do anything if the triggering element is a preview button. - if ($triggering_element['#value'] == t('Preview')) { - return; - } - - // Get the time value. - $identifier = $form_state->getValue('honeypot_time', FALSE); - $honeypot_time = \Drupal::service('keyvalue.expirable')->get('honeypot_time_restriction')->get($identifier, 0); - - // Get the honeypot_time_limit. - $time_limit = honeypot_get_time_limit($form_state->getValues()); - - // Make sure current time - (time_limit + form time value) is greater than 0. - // If not, throw an error. - if (!$honeypot_time || \Drupal::time()->getRequestTime() < ($honeypot_time + $time_limit)) { - _honeypot_log($form_state->getValue('form_id'), 'honeypot_time'); - $time_limit = honeypot_get_time_limit(); - \Drupal::service('keyvalue.expirable')->get('honeypot_time_restriction')->setWithExpire($identifier, \Drupal::time()->getRequestTime(), 3600*24); - $form_state->setErrorByName('', t('There was a problem with your form submission. Please wait @limit seconds and try again.', ['@limit' => $time_limit])); - } -} - -/** - * Log blocked form submissions. - * - * @param string $form_id - * Form ID for the form on which submission was blocked. - * @param string $type - * String indicating the reason the submission was blocked. Allowed values: - * - honeypot: If honeypot field was filled in. - * - honeypot_time: If form was completed before the configured time limit. - */ -function _honeypot_log($form_id, $type) { - honeypot_log_failure($form_id, $type); - if (\Drupal::config('honeypot.settings')->get('log')) { - $variables = [ - '%form' => $form_id, - '@cause' => ($type == 'honeypot') ? t('submission of a value in the honeypot field') : t('submission of the form in less than minimum required time'), - ]; - \Drupal::logger('honeypot')->notice(t('Blocked submission of %form due to @cause.', $variables)); - } -} - -/** - * Look up the time limit for the current user. - * - * @param array $form_values - * Array of form values (optional). - */ -function honeypot_get_time_limit(array $form_values = []) { - $account = \Drupal::currentUser(); - $honeypot_time_limit = \Drupal::config('honeypot.settings')->get('time_limit'); - - // Only calculate time limit if honeypot_time_limit has a value > 0. - if ($honeypot_time_limit) { - $expire_time = \Drupal::config('honeypot.settings')->get('expire'); - - // Query the {honeypot_user} table to determine the number of failed - // submissions for the current user. - $uid = $account->id(); - $query = \Drupal::database()->select('honeypot_user', 'hu') - ->condition('uid', $uid) - ->condition('timestamp', \Drupal::time()->getRequestTime() - $expire_time, '>'); - - // For anonymous users, take the hostname into account. - if ($uid === 0) { - $hostname = \Drupal::request()->getClientIp(); - $query->condition('hostname', $hostname); - } - $number = $query->countQuery()->execute()->fetchField(); - - // Don't add more than 30 days' worth of extra time. - $honeypot_time_limit = (int) min($honeypot_time_limit + exp($number) - 1, $expire_time); - // TODO - Only accepts two args. - $additions = \Drupal::moduleHandler()->invokeAll('honeypot_time_limit', [ - $honeypot_time_limit, - $form_values, - $number, - ]); - if (count($additions)) { - $honeypot_time_limit += array_sum($additions); - } - } - return $honeypot_time_limit; -} - -/** - * Log the failed submission with timestamp and hostname. - * - * @param string $form_id - * Form ID for the rejected form submission. - * @param string $type - * String indicating the reason the submission was blocked. Allowed values: - * - honeypot: If honeypot field was filled in. - * - honeypot_time: If form was completed before the configured time limit. - */ -function honeypot_log_failure($form_id, $type) { - $account = \Drupal::currentUser(); - $uid = $account->id(); - - // Log failed submissions. - \Drupal::database()->insert('honeypot_user') - ->fields([ - 'uid' => $uid, - 'hostname' => Drupal::request()->getClientIp(), - 'timestamp' => \Drupal::time()->getRequestTime(), - ]) - ->execute(); - - // Allow other modules to react to honeypot rejections. - // TODO - Only accepts two args. - \Drupal::moduleHandler()->invokeAll('honeypot_reject', [$form_id, $uid, $type]); -} diff --git a/sites/all/modules/contrib/security/honeypot/honeypot.permissions.yml b/sites/all/modules/contrib/security/honeypot/honeypot.permissions.yml deleted file mode 100644 index 3db0d8d5d..000000000 --- a/sites/all/modules/contrib/security/honeypot/honeypot.permissions.yml +++ /dev/null @@ -1,7 +0,0 @@ -'administer honeypot': - title: 'Administer Honeypot' - description: 'Administer Honeypot-protected forms and settings.' - -'bypass honeypot protection': - title: 'Bypass Honeypot protection' - description: 'Bypass Honeypot form protection.' diff --git a/sites/all/modules/contrib/security/honeypot/honeypot.routing.yml b/sites/all/modules/contrib/security/honeypot/honeypot.routing.yml deleted file mode 100644 index 06c4963b1..000000000 --- a/sites/all/modules/contrib/security/honeypot/honeypot.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -honeypot.config: - path: '/admin/config/content/honeypot' - defaults: - _form: '\Drupal\honeypot\Controller\HoneypotSettingsController' - _title: 'Honeypot configuration' - requirements: - _permission: 'administer honeypot' diff --git a/sites/all/modules/contrib/security/honeypot/src/Controller/HoneypotSettingsController.php b/sites/all/modules/contrib/security/honeypot/src/Controller/HoneypotSettingsController.php deleted file mode 100644 index 72e6a4b37..000000000 --- a/sites/all/modules/contrib/security/honeypot/src/Controller/HoneypotSettingsController.php +++ /dev/null @@ -1,329 +0,0 @@ -moduleHandler = $module_handler; - $this->entityTypeManager = $entity_type_manager; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - $this->cache = $cache_backend; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('module_handler'), - $container->get('entity_type.manager'), - $container->get('entity_type.bundle.info'), - $container->get('cache.default') - ); - } - - /** - * Get a value from the retrieved form settings array. - */ - public function getFormSettingsValue($form_settings, $form_id) { - // If there are settings in the array and the form ID already has a setting, - // return the saved setting for the form ID. - if (!empty($form_settings) && isset($form_settings[$form_id])) { - return $form_settings[$form_id]; - } - // Default to false. - else { - return 0; - } - } - - /** - * {@inheritdoc} - */ - protected function getEditableConfigNames() { - return ['honeypot.settings']; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'honeypot_settings_form'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - // Honeypot Configuration. - $form['configuration'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Honeypot Configuration'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - ]; - $form['configuration']['protect_all_forms'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Protect all forms with Honeypot'), - '#description' => $this->t('Enable Honeypot protection for ALL forms on this site (it is best to only enable Honeypot for the forms you need below).'), - '#default_value' => $this->config('honeypot.settings')->get('protect_all_forms'), - ]; - $form['configuration']['protect_all_forms']['#description'] .= '
        ' . $this->t('Page caching will be disabled on any page where a form is present if the Honeypot time limit is not set to 0.'); - $form['configuration']['log'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Log blocked form submissions'), - '#description' => $this->t('Log submissions that are blocked due to Honeypot protection.'), - '#default_value' => $this->config('honeypot.settings')->get('log'), - ]; - $form['configuration']['element_name'] = [ - '#type' => 'textfield', - '#title' => $this->t('Honeypot element name'), - '#description' => $this->t("The name of the Honeypot form field. It's usually most effective to use a generic name like email, homepage, or link, but this should be changed if it interferes with fields that are already in your forms. Must not contain spaces or special characters."), - '#default_value' => $this->config('honeypot.settings')->get('element_name'), - '#required' => TRUE, - '#size' => 30, - ]; - $form['configuration']['time_limit'] = [ - '#type' => 'textfield', - '#title' => $this->t('Honeypot time limit'), - '#description' => $this->t('Minimum time required before form should be considered entered by a human instead of a bot. Set to 0 to disable.'), - '#default_value' => $this->config('honeypot.settings')->get('time_limit'), - '#required' => TRUE, - '#size' => 5, - '#field_suffix' => $this->t('seconds'), - ]; - $form['configuration']['time_limit']['#description'] .= '
        ' . $this->t('Page caching will be disabled if there is a form protected by time limit on the page.'); - - // Honeypot Enabled forms. - $form_settings = $this->config('honeypot.settings')->get('form_settings'); - $form['form_settings'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Honeypot Enabled Forms'), - '#description' => $this->t("Check the boxes next to individual forms on which you'd like Honeypot protection enabled."), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#tree' => TRUE, - '#states' => [ - // Hide this fieldset when all forms are protected. - 'invisible' => [ - 'input[name="protect_all_forms"]' => ['checked' => TRUE], - ], - ], - ]; - - // Generic forms. - $form['form_settings']['general_forms'] = ['#markup' => '
        ' . $this->t('General Forms') . '
        ']; - // User register form. - $form['form_settings']['user_register_form'] = [ - '#type' => 'checkbox', - '#title' => $this->t('User Registration form'), - '#default_value' => $this->getFormSettingsValue($form_settings, 'user_register_form'), - ]; - // User password form. - $form['form_settings']['user_pass'] = [ - '#type' => 'checkbox', - '#title' => $this->t('User Password Reset form'), - '#default_value' => $this->getFormSettingsValue($form_settings, 'user_pass'), - ]; - - // If contact.module enabled, add contact forms. - if ($this->moduleHandler->moduleExists('contact')) { - $form['form_settings']['contact_forms'] = ['#markup' => '
        ' . $this->t('Contact Forms') . '
        ']; - - $bundles = $this->entityTypeBundleInfo->getBundleInfo('contact_message'); - $formController = $this->entityTypeManager->getFormObject('contact_message', 'default'); - - foreach ($bundles as $bundle_key => $bundle) { - $stub = $this->entityTypeManager->getStorage('contact_message')->create([ - 'contact_form' => $bundle_key, - ]); - $formController->setEntity($stub); - $form_id = $formController->getFormId(); - - $form['form_settings'][$form_id] = [ - '#type' => 'checkbox', - '#title' => Html::escape($bundle['label']), - '#default_value' => $this->getFormSettingsValue($form_settings, $form_id), - ]; - } - } - - // Node types for node forms. - if ($this->moduleHandler->moduleExists('node')) { - $types = NodeType::loadMultiple(); - if (!empty($types)) { - // Node forms. - $form['form_settings']['node_forms'] = ['#markup' => '
        ' . $this->t('Node Forms') . '
        ']; - foreach ($types as $type) { - $id = 'node_' . $type->get('type') . '_form'; - $form['form_settings'][$id] = [ - '#type' => 'checkbox', - '#title' => $this->t('@name node form', ['@name' => $type->label()]), - '#default_value' => $this->getFormSettingsValue($form_settings, $id), - ]; - } - } - } - - // Comment types for comment forms. - if ($this->moduleHandler->moduleExists('comment')) { - $types = CommentType::loadMultiple(); - if (!empty($types)) { - $form['form_settings']['comment_forms'] = ['#markup' => '
        ' . $this->t('Comment Forms') . '
        ']; - foreach ($types as $type) { - $id = 'comment_' . $type->id() . '_form'; - $form['form_settings'][$id] = [ - '#type' => 'checkbox', - '#title' => $this->t('@name comment form', ['@name' => $type->label()]), - '#default_value' => $this->getFormSettingsValue($form_settings, $id), - ]; - } - } - } - - // Store the keys we want to save in configuration when form is submitted. - $keys_to_save = array_keys($form['configuration']); - foreach ($keys_to_save as $key => $key_to_save) { - if (strpos($key_to_save, '#') !== FALSE) { - unset($keys_to_save[$key]); - } - } - $form_state->setStorage(['keys' => $keys_to_save]); - - // For now, manually add submit button. Hopefully, by the time D8 is - // released, there will be something like system_settings_form() in D7. - $form['actions']['#type'] = 'container'; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Save configuration'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - // Make sure the time limit is a positive integer or 0. - $time_limit = $form_state->getValue('time_limit'); - if ((is_numeric($time_limit) && $time_limit > 0) || $time_limit === '0') { - if (ctype_digit($time_limit)) { - // Good to go. - } - else { - $form_state->setErrorByName('time_limit', $this->t("The time limit must be a positive integer or 0.")); - } - } - else { - $form_state->setErrorByName('time_limit', $this->t("The time limit must be a positive integer or 0.")); - } - - // Make sure Honeypot element name only contains A-Z, 0-9. - if (!preg_match("/^[-_a-zA-Z0-9]+$/", $form_state->getValue('element_name'))) { - $form_state->setErrorByName('element_name', $this->t("The element name cannot contain spaces or other special characters.")); - } - - // Make sure Honeypot element name starts with a letter. - if (!preg_match("/^[a-zA-Z].+$/", $form_state->getValue('element_name'))) { - $form_state->setErrorByName('element_name', $this->t("The element name must start with a letter.")); - } - - // Make sure Honeypot element name isn't one of the reserved names. - $reserved_element_names = [ - 'name', - 'pass', - 'website', - ]; - if (in_array($form_state->getValue('element_name'), $reserved_element_names)) { - $form_state->setErrorByName('element_name', $this->t("The element name cannot match one of the common Drupal form field names (e.g. @names).", ['@names' => implode(', ', $reserved_element_names)])); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $config = $this->config('honeypot.settings'); - $storage = $form_state->getStorage(); - - // Save all the Honeypot configuration items from $form_state. - foreach ($form_state->getValues() as $key => $value) { - if (in_array($key, $storage['keys'])) { - $config->set($key, $value); - } - } - - // Save the honeypot forms from $form_state into a 'form_settings' array. - $config->set('form_settings', $form_state->getValue('form_settings')); - - $config->save(); - - // Clear the honeypot protected forms cache. - $this->cache->delete('honeypot_protected_forms'); - - // Tell the user the settings have been saved. - drupal_set_message($this->t('The configuration options have been saved.')); - } - -} diff --git a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotAdminFormTest.php b/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotAdminFormTest.php deleted file mode 100644 index 1347d46ef..000000000 --- a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotAdminFormTest.php +++ /dev/null @@ -1,96 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'administer honeypot', - 'bypass honeypot protection', - ]); - } - - /** - * Test a valid element name. - */ - public function testElementNameUpdateSuccess() { - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Set up form and submit it. - $edit['element_name'] = "test"; - $this->drupalPostForm('admin/config/content/honeypot', $edit, t('Save configuration')); - - // Form should have been submitted successfully. - $this->assertText(t('The configuration options have been saved.'), 'Honeypot element name assertion works for valid names.'); - - // Set up form and submit it. - $edit['element_name'] = "test-1"; - $this->drupalPostForm('admin/config/content/honeypot', $edit, t('Save configuration')); - - // Form should have been submitted successfully. - $this->assertText(t('The configuration options have been saved.'), 'Honeypot element name assertion works for valid names with dashes and numbers.'); - } - - /** - * Test an invalid element name (invalid first character). - */ - public function testElementNameUpdateFirstCharacterFail() { - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Set up form and submit it. - $edit['element_name'] = "1test"; - $this->drupalPostForm('admin/config/content/honeypot', $edit, t('Save configuration')); - - // Form submission should fail. - $this->assertText(t('The element name must start with a letter.'), 'Honeypot element name assertion works for invalid names.'); - } - - /** - * Test an invalid element name (invalid character in name). - */ - public function testElementNameUpdateInvalidCharacterFail() { - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Set up form and submit it. - $edit['element_name'] = "special-character-&"; - $this->drupalPostForm('admin/config/content/honeypot', $edit, t('Save configuration')); - - // Form submission should fail. - $this->assertText(t('The element name cannot contain spaces or other special characters.'), 'Honeypot element name assertion works for invalid names with special characters.'); - - // Set up form and submit it. - $edit['element_name'] = "space in name"; - $this->drupalPostForm('admin/config/content/honeypot', $edit, t('Save configuration')); - - // Form submission should fail. - $this->assertText(t('The element name cannot contain spaces or other special characters.'), 'Honeypot element name assertion works for invalid names with spaces.'); - } - -} diff --git a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormCacheTest.php b/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormCacheTest.php deleted file mode 100644 index d899facba..000000000 --- a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormCacheTest.php +++ /dev/null @@ -1,137 +0,0 @@ -getEditable('honeypot.settings'); - $honeypot_config->set('element_name', 'url'); - // Enable time_limit protection. - $honeypot_config->set('time_limit', 5); - // Test protecting all forms. - $honeypot_config->set('protect_all_forms', TRUE); - $honeypot_config->set('log', FALSE); - $honeypot_config->save(); - - // Set up other required configuration. - $user_config = \Drupal::configFactory()->getEditable('user.settings'); - $user_config->set('verify_mail', TRUE); - $user_config->set('register', USER_REGISTER_VISITORS); - $user_config->save(); - - // Create an Article node type. - if ($this->profile != 'standard') { - $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); - // Create comment field on article. - $this->addDefaultCommentField('node', 'article'); - } - } - - /** - * Test enabling and disabling of page cache based on time limit settings. - */ - public function testCacheContactForm() { - // Create a Website feedback contact form. - $feedback_form = ContactForm::create([ - 'id' => 'feedback', - 'label' => 'Website feedback', - 'recipients' => [], - 'reply' => '', - 'weight' => 0, - ]); - $feedback_form->save(); - $contact_settings = \Drupal::configFactory()->getEditable('contact.settings'); - $contact_settings->set('default_form', 'feedback')->save(); - - // Give anonymous users permission to view contact form. - Role::load(RoleInterface::ANONYMOUS_ID) - ->grantPermission('access site-wide contact form') - ->save(); - - // Prime the cache. - $this->drupalGet('contact/feedback'); - - // Test on cache header with time limit enabled, cache should miss. - $this->drupalGet('contact/feedback'); - $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), '', 'Page was not cached.'); - - // Disable time limit. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 0)->save(); - - // Prime the cache. - $this->drupalGet('contact/feedback'); - // Test on cache header with time limit disabled, cache should hit. - $this->drupalGet('contact/feedback'); - $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); - - // Re-enable the time limit, we should not be seeing the cached version. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 5)->save(); - $this->drupalGet('contact/feedback'); - $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), '', 'Page was not cached.'); - } - - /** - * Test enabling and disabling of page cache based on time limit settings. - */ - public function testCacheCommentForm() { - // Set up example node. - $this->node = $this->drupalCreateNode([ - 'type' => 'article', - 'comment' => CommentItemInterface::OPEN, - ]); - - // Give anonymous users permission to post comments. - Role::load(RoleInterface::ANONYMOUS_ID) - ->grantPermission('post comments') - ->grantPermission('access comments') - ->save(); - - // Prime the cache. - $this->drupalGet('node/' . $this->node->id()); - - // Test on cache header with time limit enabled, cache should miss. - $this->drupalGet('node/' . $this->node->id()); - $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), '', 'Page was not cached.'); - - // Disable time limit. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 0)->save(); - - // Prime the cache. - $this->drupalGet('node/' . $this->node->id()); - - // Test on cache header with time limit disabled, cache should hit. - $this->drupalGet('node/' . $this->node->id()); - $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); - - } - -} diff --git a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormProgrammaticSubmissionTest.php b/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormProgrammaticSubmissionTest.php deleted file mode 100644 index f1d39fb8d..000000000 --- a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormProgrammaticSubmissionTest.php +++ /dev/null @@ -1,48 +0,0 @@ -getEditable('honeypot.settings'); - $honeypot_config->set('element_name', 'url'); - $honeypot_config->set('time_limit', 5); - $honeypot_config->set('protect_all_forms', TRUE); - $honeypot_config->set('log', FALSE); - $honeypot_config->save(); - - $this->drupalCreateUser([], 'robo-user'); - } - - /** - * Trigger a programmatic form submission and verify the validation errors. - */ - public function testProgrammaticFormSubmission() { - $result = $this->drupalGet('/honeypot_test/submit_form'); - $form_errors = (array) json_decode($result); - $this->assertNoRaw('There was a problem with your form submission. Please wait 6 seconds and try again.'); - $this->assertFalse($form_errors, 'The were no validation errors when submitting the form.'); - } - -} diff --git a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormTest.php b/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormTest.php deleted file mode 100644 index 20ea19837..000000000 --- a/sites/all/modules/contrib/security/honeypot/src/Tests/HoneypotFormTest.php +++ /dev/null @@ -1,254 +0,0 @@ -getEditable('honeypot.settings'); - $honeypot_config->set('element_name', 'url'); - // Disable time_limit protection. - $honeypot_config->set('time_limit', 0); - // Test protecting all forms. - $honeypot_config->set('protect_all_forms', TRUE); - $honeypot_config->set('log', FALSE); - $honeypot_config->save(); - - // Set up other required configuration. - $user_config = \Drupal::configFactory()->getEditable('user.settings'); - $user_config->set('verify_mail', TRUE); - $user_config->set('register', USER_REGISTER_VISITORS); - $user_config->save(); - - // Create an Article node type. - if ($this->profile != 'standard') { - $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); - // Create comment field on article. - $this->addDefaultCommentField('node', 'article'); - } - - // Set up admin user. - $this->adminUser = $this->drupalCreateUser([ - 'administer honeypot', - 'bypass honeypot protection', - 'administer content types', - 'administer users', - 'access comments', - 'post comments', - 'skip comment approval', - 'administer comments', - ]); - - // Set up web user. - $this->webUser = $this->drupalCreateUser([ - 'access comments', - 'post comments', - 'create article content', - 'access site-wide contact form', - ]); - - // Set up example node. - $this->node = $this->drupalCreateNode([ - 'type' => 'article', - 'comment' => CommentItemInterface::OPEN, - ]); - } - - /** - * Make sure user login form is not protected. - */ - public function testUserLoginNotProtected() { - $this->drupalGet('user'); - $this->assertNoText('id="edit-url" name="url"', 'Honeypot not enabled on user login form.'); - } - - /** - * Test user registration (anonymous users). - */ - public function testProtectRegisterUserNormal() { - // Set up form and submit it. - $edit['name'] = $this->randomMachineName(); - $edit['mail'] = $edit['name'] . '@example.com'; - $this->drupalPostForm('user/register', $edit, t('Create new account')); - - // Form should have been submitted successfully. - $this->assertText(t('A welcome message with further instructions has been sent to your email address.'), 'User registered successfully.'); - } - - /** - * Test for user register honeypot filled. - */ - public function testProtectUserRegisterHoneypotFilled() { - // Set up form and submit it. - $edit['name'] = $this->randomMachineName(); - $edit['mail'] = $edit['name'] . '@example.com'; - $edit['url'] = 'http://www.example.com/'; - $this->drupalPostForm('user/register', $edit, t('Create new account')); - - // Form should have error message. - $this->assertText(t('There was a problem with your form submission. Please refresh the page and try again.'), 'Registration form protected by honeypot.'); - } - - /** - * Test for user register too fast. - */ - public function testProtectRegisterUserTooFast() { - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 1)->save(); - - // First attempt a submission that does not trigger honeypot. - $edit['name'] = $this->randomMachineName(); - $edit['mail'] = $edit['name'] . '@example.com'; - $this->drupalGet('user/register'); - sleep(2); - $this->drupalPostForm(NULL, $edit, t('Create new account')); - $this->assertNoText(t('There was a problem with your form submission.')); - - // Set the time limit a bit higher so we can trigger honeypot. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 5)->save(); - - // Set up form and submit it. - $edit['name'] = $this->randomMachineName(); - $edit['mail'] = $edit['name'] . '@example.com'; - $this->drupalPostForm('user/register', $edit, t('Create new account')); - - // Form should have error message. - $this->assertText(t('There was a problem with your form submission. Please wait 6 seconds and try again.'), 'Registration form protected by time limit.'); - } - - /** - * Test comment form protection. - */ - public function testProtectCommentFormNormal() { - $comment = 'Test comment.'; - - // Disable time limit for honeypot. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 0)->save(); - - // Log in the web user. - $this->drupalLogin($this->webUser); - - // Set up form and submit it. - $edit["comment_body[0][value]"] = $comment; - $this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit, t('Save')); - $this->assertText(t('Your comment has been queued for review'), 'Comment posted successfully.'); - } - - /** - * Test for comment form honeypot filled. - */ - public function testProtectCommentFormHoneypotFilled() { - $comment = 'Test comment.'; - - // Log in the web user. - $this->drupalLogin($this->webUser); - - // Set up form and submit it. - $edit["comment_body[0][value]"] = $comment; - $edit['url'] = 'http://www.example.com/'; - $this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit, t('Save')); - $this->assertText(t('There was a problem with your form submission. Please refresh the page and try again.'), 'Comment posted successfully.'); - } - - /** - * Test for comment form honeypot bypass. - */ - public function testProtectCommentFormHoneypotBypass() { - // Log in the admin user. - $this->drupalLogin($this->adminUser); - - // Get the comment reply form and ensure there's no 'url' field. - $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment'); - $this->assertNoText('id="edit-url" name="url"', 'Honeypot home page field not shown.'); - } - - /** - * Test node form protection. - */ - public function testProtectNodeFormTooFast() { - // Log in the admin user. - $this->drupalLogin($this->webUser); - - // Reset the time limit to 5 seconds. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('time_limit', 5)->save(); - - // Set up the form and submit it. - $edit["title[0][value]"] = 'Test Page'; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - $this->assertText(t('There was a problem with your form submission.'), 'Honeypot node form timestamp protection works.'); - } - - /** - * Test node form protection. - */ - public function testProtectNodeFormPreviewPassthru() { - // Log in the admin user. - $this->drupalLogin($this->webUser); - - // Post a node form using the 'Preview' button and make sure it's allowed. - $edit["title[0][value]"] = 'Test Page'; - $this->drupalPostForm('node/add/article', $edit, t('Preview')); - $this->assertNoText(t('There was a problem with your form submission.'), 'Honeypot not blocking node form previews.'); - } - - /** - * Test protection on the Contact form. - */ - public function testProtectContactForm() { - $this->drupalLogin($this->adminUser); - - // Disable 'protect_all_forms'. - \Drupal::configFactory()->getEditable('honeypot.settings')->set('protect_all_forms', FALSE)->save(); - - // Create a Website feedback contact form. - $feedback_form = ContactForm::create([ - 'id' => 'feedback', - 'label' => 'Website feedback', - 'recipients' => [], - 'reply' => '', - 'weight' => 0, - ]); - $feedback_form->save(); - $contact_settings = \Drupal::configFactory()->getEditable('contact.settings'); - $contact_settings->set('default_form', 'feedback')->save(); - - // Submit the admin form so we can verify the right forms are displayed. - $this->drupalPostForm('admin/config/content/honeypot', [ - 'form_settings[contact_message_feedback_form]' => TRUE, - ], t('Save configuration')); - - $this->drupalLogin($this->webUser); - $this->drupalGet('contact/feedback'); - $this->assertField('url', 'Honeypot field is added to Contact form.'); - } - -} diff --git a/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.info.yml b/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.info.yml deleted file mode 100644 index 02df91108..000000000 --- a/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: honeypot_test -type: module -description: Support module for Honeypot internal testing purposes. -# core: 8.x -package: Testing -hidden: true - -# Information added by Drupal.org packaging script on 2018-09-05 -version: '8.x-1.29' -core: '8.x' -project: 'honeypot' -datestamp: 1536179284 diff --git a/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.routing.yml b/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.routing.yml deleted file mode 100644 index 3693cf040..000000000 --- a/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/honeypot_test.routing.yml +++ /dev/null @@ -1,8 +0,0 @@ -honeypot_test.submit_form: - path: '/honeypot_test/submit_form' - defaults: - _title: 'Test programmatic form submission' - _controller: '\Drupal\honeypot_test\Controller\HoneypotTestController::submitFormPage' - requirements: - # This is a test form, we don't need to worry about access. - _access: 'TRUE' diff --git a/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/src/Controller/HoneypotTestController.php b/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/src/Controller/HoneypotTestController.php deleted file mode 100644 index 61c1564b6..000000000 --- a/sites/all/modules/contrib/security/honeypot/tests/modules/honeypot_test/src/Controller/HoneypotTestController.php +++ /dev/null @@ -1,31 +0,0 @@ - 'robo-user', - 'mail' => 'robouser@example.com', - 'op' => t('Submit'), - ]; - $form_state->setValues($values); - \Drupal::formBuilder()->submitForm('\Drupal\user\Form\UserPasswordForm', $form_state); - - return new JsonResponse($form_state->getErrors()); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/LICENSE.txt b/sites/all/modules/contrib/taxonomy/synonyms/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/taxonomy/synonyms/README.txt b/sites/all/modules/contrib/taxonomy/synonyms/README.txt deleted file mode 100644 index 32139520b..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/README.txt +++ /dev/null @@ -1,63 +0,0 @@ - --- SUMMARY -- - -The Synonyms module enriches content Entities with the notion of synonyms. -Currently the module provides the following functionality: -* support of synonyms through Fields both base and attached ones. Any field, - for which synonyms provider exists, can be enabled as source of synonyms. -* synonyms-friendly autocomplete and select widgets for entity reference field - type. -* integration with Views: Synonyms module provides a few filters and contextual - filters that allow filtering not only by entity name but also by one of its - synonyms. -* 2 form elements are provided for developers: synonyms-friendly entity - autocomplete and select. - --- REQUIREMENTS -- - -The Synonyms module requires only Drupal core. - --- SUPPORTED SYNONYMS PROVIDERS -- - -Module ships with ability to provide synonyms from the following field types: -* "Text" field type -* "Entity Reference" field type -* "Number" field type -* "Float" field type -* "Decimal" field type -* "Email" field type -* "Telephone" field type - -Worth mentioning here: this list is easily extended further by implementing new -synonyms providers in your code. Refer to Synonyms documentation for more -details on how to accomplish it. - --- GRANULATION WITHIN SYNONYMS BEHAVIOR -- - -In order to achieve greater flexibility, this module introduced additional -granularity into what "synonyms" mean. This granularity is expressed via -"synonyms behavior" idea whatsoever. Therefore each synonyms behavior may have -its own synonyms provider than you can enable and configure through admin UI of -the Synonyms module. For example, field "Typos" can be part of autocomplete -behavior, while field "Other spellings" can be part of select behavior. -Currently the following synonym behaviors are recognized (other modules actually -can extend this list): -* Autocomplete - whether synonyms from this provider should participate in - autocomplete suggestions. This module ships with synonyms friendly - autocomplete widget and the autocomplete suggestions will be filled in with - the synonyms from enabled providers for "autocomplete" behavior -* Select - whether synonyms from this provider should be included in the - synonyms friendly select widget. - -That way on the Synonyms configuration page you will get to add/remove certain -synonym providers for certain synonym behaviors. Also, each behavior and -provider may have its own settings that you get to configure too. - --- INSTALLATION -- - -* Install as usual - --- CONFIGURATION -- - -* You can configure synonyms of all eligible entity types by going to Admin -> - Structure -> Synonyms (/admin/structure/synonyms) diff --git a/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonym.schema.yml b/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonym.schema.yml deleted file mode 100644 index 80d8d4453..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonym.schema.yml +++ /dev/null @@ -1,22 +0,0 @@ -synonyms.synonym.*: - type: config_entity - label: 'Synonym configuration' - mapping: - id: - type: string - label: 'ID' - provider_plugin: - type: string - label: 'Controlled provider plugin' - base_provider_plugin: - type: string - label: 'Base ID of the controlled provider plugin' - provider_configuration: - type: synonyms.provider.[%parent.base_provider_plugin] - label: 'Configuration of provider plugin' - behavior: - type: string - label: 'Controlled behavior service' - behavior_configuration: - type: synonyms.[%parent.behavior] - label: 'Configuration of behavior service' diff --git a/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.behavior.schema.yml b/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.behavior.schema.yml deleted file mode 100644 index 7f58a26d5..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.behavior.schema.yml +++ /dev/null @@ -1,15 +0,0 @@ -synonyms.synonyms.behavior.select: - type: mapping - label: 'Settings of select synonyms behavior' - mapping: - wording: - type: string - label: 'Wording for select entry' - -synonyms.synonyms.behavior.autocomplete: - type: mapping - label: 'Settings of autocomplete synonyms behavior' - mapping: - wording: - type: string - label: 'Wording for autocomplete suggestion' diff --git a/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.provider.schema.yml b/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.provider.schema.yml deleted file mode 100644 index d3c4fd194..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/config/schema/synonyms.provider.schema.yml +++ /dev/null @@ -1,14 +0,0 @@ -synonyms.provider.field: - type: mapping - label: 'Settings of field synonyms provider' - mapping: - -synonyms.provider.base_field: - type: mapping - label: 'Settings of base field synonyms provider' - mapping: - -synonyms.provider.entityreference_field: - type: mapping - label: 'Settings of entity reference field synonyms provider' - mapping: diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Annotation/SynonymsProvider.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Annotation/SynonymsProvider.php deleted file mode 100644 index 2d0136d2e..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Annotation/SynonymsProvider.php +++ /dev/null @@ -1,56 +0,0 @@ -autocompleteService = $autocomplete_service; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('synonyms.behavior.autocomplete') - ); - } - - /** - * Routing callback: provide suggestions for autocomplete form element. - */ - public function autocomplete(Request $request, EntityTypeInterface $target_type, $token) { - $matches = []; - - if ($input = $request->get('q')) { - $input = Tags::explode($input); - $input = array_pop($input); - foreach ($this->autocompleteService->autocompleteLookup($input, $token) as $k => $suggestion) { - $key = $suggestion['entity_label'] . ' (' . $suggestion['entity_id'] . ')'; - $key = preg_replace('/\s\s+/', ' ', str_replace("\n", '', trim(Html::decodeEntities(strip_tags($key))))); - - // Names containing commas or quotes must be wrapped in quotes. - $key = Tags::encode($key); - - $matches[] = [ - 'value' => $key, - 'label' => $suggestion['wording'], - ]; - } - } - - return new JsonResponse($matches); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Controller/SynonymConfigController.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Controller/SynonymConfigController.php deleted file mode 100644 index 7e4290225..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Controller/SynonymConfigController.php +++ /dev/null @@ -1,149 +0,0 @@ -entityTypeBundleInfo = $entity_type_bundle_info; - $this->behaviorService = $behavior_service; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.bundle.info'), - $container->get('synonyms.behaviors') - ); - } - - /** - * Routing callback: show overview table of synonyms configuration. - */ - public function overview() { - $render = [ - '#type' => 'table', - '#header' => [ - $this->t('Entity type'), - $this->t('Bundle'), - $this->t('Manage'), - ], - ]; - - foreach ($this->entityTypeManager()->getDefinitions() as $entity_type) { - if ($entity_type instanceof ContentEntityTypeInterface) { - foreach ($this->entityTypeBundleInfo->getBundleInfo($entity_type->id()) as $bundle => $bundle_info) { - $links = []; - foreach ($this->behaviorService->getBehaviorServices() as $service_id => $service) { - $count = count($this->behaviorService->getSynonymConfigEntities($service_id, $entity_type->id(), $bundle)); - - if ($count > 0) { - $title = $this->t('@behavior (@count)', [ - '@behavior' => $service['service']->getTitle(), - '@count' => $count, - ]); - } - else { - $title = $service['service']->getTitle(); - } - - $links[$service_id] = [ - 'title' => $title, - 'url' => Url::fromRoute('entity.synonym.overview.entity_type.bundle.behavior', [ - 'synonyms_entity_type' => $entity_type->id(), - 'bundle' => $bundle, - 'synonyms_behavior_service' => $service_id, - ]), - ]; - } - - $render[] = [ - ['#markup' => Html::escape($entity_type->getLabel())], - ['#markup' => $bundle == $entity_type->id() ? '' : Html::escape($bundle_info['label'])], - ['#type' => 'operations', '#links' => $links], - ]; - } - } - } - - return $render; - } - - /** - * Routing callback to overview a particular entity type and behavior service. - */ - public function overviewEntityTypeBundle(EntityTypeInterface $synonyms_entity_type, $bundle, SynonymsBehaviorInterface $synonyms_behavior_service) { - $table = [ - '#type' => 'table', - '#header' => [ - $this->t('Provider'), - $this->t('Operations'), - ], - ]; - - foreach ($this->entityTypeManager()->getStorage('synonym')->loadMultiple() as $synonym_config) { - $provider_instance = $synonym_config->getProviderPluginInstance(); - $provider_definition = $provider_instance->getPluginDefinition(); - if ($provider_definition['controlled_entity_type'] == $synonyms_entity_type->id() && $provider_definition['controlled_bundle'] == $bundle && $this->behaviorService->getBehaviorService($provider_definition['synonyms_behavior_service'])['service'] == $synonyms_behavior_service) { - $table[] = [ - ['#markup' => Html::escape($synonym_config->label())], - [ - '#type' => 'operations', - '#links' => $this->entityTypeManager()->getListBuilder($synonym_config->getEntityTypeId())->getOperations($synonym_config), - ], - ]; - } - } - - return $table; - } - - /** - * Title callback for 'entity.synonym.overview.entity_type.bundle.behavior'. - */ - public function overviewEntityTypeBundleTitle(EntityTypeInterface $synonyms_entity_type, $bundle, SynonymsBehaviorInterface $synonyms_behavior_service) { - if ($synonyms_entity_type->id() == $bundle) { - return $this->t('Manage @behavior of @entity_type', [ - '@behavior' => $synonyms_behavior_service->getTitle(), - '@entity_type' => $synonyms_entity_type->getLabel(), - ]); - } - - $bundle_info = $this->entityTypeBundleInfo->getBundleInfo($synonyms_entity_type->id()); - - return $this->t('Manage @behavior of @entity_type @bundle', [ - '@behavior' => $synonyms_behavior_service->getTitle(), - '@entity_type' => $synonyms_entity_type->getLabel(), - '@bundle' => $bundle_info[$bundle]['label'], - ]); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntityAutocomplete.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntityAutocomplete.php deleted file mode 100644 index c3e75ae09..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntityAutocomplete.php +++ /dev/null @@ -1,148 +0,0 @@ -getStorage($element['#target_type'])->loadMultiple($entity_ids); - } - - if (is_array($entities)) { - $value = []; - foreach ($entities as $entity) { - $value[] = $entity->label() . ' (' . $entity->id() . ')'; - } - return Tags::implode($value); - } - } - - /** - * Form element process callback for 'synonyms_entity_autocomplete' type. - */ - public static function elementSynonymsEntityAutocomplete(array &$element, FormStateInterface $form_state, array &$complete_form) { - $data = [ - 'target_type' => $element['#target_type'], - 'target_bundles' => $element['#target_bundles'], - 'suggestion_size' => $element['#suggestion_size'], - 'suggest_only_unique' => $element['#suggest_only_unique'], - 'match' => $element['#match'], - ]; - $token = Crypt::hmacBase64(serialize($data), Settings::getHashSalt()); - $key_value_storage = \Drupal::keyValue('synonyms_entity_autocomplete'); - - $key_value_storage->setIfNotExists($token, $data); - - $element['#autocomplete_route_name'] = 'synonyms.entity_autocomplete'; - $element['#autocomplete_route_parameters'] = [ - 'target_type' => $element['#target_type'], - 'token' => $token, - ]; - - return $element; - } - - /** - * Form element validation handler for synonyms_entity_autocomplete elements. - */ - public static function validateEntityAutocomplete(array &$element, FormStateInterface $form_state, array &$complete_form) { - $tokens = Tags::explode($form_state->getValue($element['#parents'])); - $value = []; - - $autocomplete_service = \Drupal::getContainer()->get('synonyms.behavior.autocomplete'); - foreach ($tokens as $token) { - $entity_id = self::extractEntityIdFromAutocompleteInput($token); - if (!$entity_id) { - $lookup = $autocomplete_service->autocompleteLookup($token, $element['#autocomplete_route_parameters']['token']); - $lookup = array_shift($lookup); - if ($lookup) { - $entity_id = $lookup['entity_id']; - } - } - - if ($entity_id) { - $value[] = ['target_id' => $entity_id]; - } - } - $form_state->setValueForElement($element, $value); - } - - /** - * Extracts the entity ID from the autocompletion result. - * - * @param string $input - * The input coming from the autocompletion result. - * - * @return mixed|null - */ - public static function extractEntityIdFromAutocompleteInput($input) { - $match = NULL; - - // Take "label (entity id)', match the ID from parenthesis when it's a - // number. - if (preg_match("/.+\s\((\d+)\)/", $input, $matches)) { - $match = $matches[1]; - } - return $match; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntitySelect.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntitySelect.php deleted file mode 100644 index d8ea1b45f..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Element/SynonymsEntitySelect.php +++ /dev/null @@ -1,161 +0,0 @@ -getInstance([ - 'target_type' => $element['#target_type'], - 'handler' => $element['#handler'], - 'handler_settings' => $element['#handler_settings'], - 'entity' => NULL, - ]); - - $bundle_info = \Drupal::getContainer()->get('entity_type.bundle.info')->getBundleInfo($element['#target_type']); - - $referenceable_entities = $selection->getReferenceableEntities(); - $entities = []; - - foreach ($referenceable_entities as $bundle_entity_ids) { - $entities = array_merge($entities, array_keys($bundle_entity_ids)); - } - - if (!empty($entities)) { - $entities = \Drupal::entityTypeManager()->getStorage($element['#target_type'])->loadMultiple($entities); - } - - foreach ($referenceable_entities as $bundle => $entity_ids) { - $key = (string) $bundle_info[$bundle]['label']; - $options[$key] = []; - - $synonyms = \Drupal::getContainer()->get('synonyms.behavior.select')->getSynonymsMultiple(array_intersect_key($entities, $entity_ids)); - - foreach ($entity_ids as $entity_id => $label) { - $options[$key][$entity_id] = $label; - - foreach ($synonyms[$entity_id] as $synonym) { - $options[$key][$entity_id . self::DELIMITER . $synonym['synonym']] = $synonym['wording']; - } - } - - asort($options[$key]); - } - - if (count($options) == 1) { - // Strip away the bundle optgroup if it's the only bundle. - $options = reset($options); - } - - $element['#options'] = $options; - - return $element; - } - - /** - * Form element validation handler for synonyms_entity_select elements. - */ - public static function validateEntitySelect(array &$element, FormStateInterface $form_state, array &$complete_form) { - $value = $form_state->getValue($element['#parents']); - if (!isset($element['#multiple']) || !$element['#multiple']) { - $value = [$value]; - } - - $unique = []; - foreach ($value as $v) { - if ($v !== '') { - if (!is_numeric($v)) { - $v = explode(self::DELIMITER, $v, 2)[0]; - } - $unique[$v] = $v; - } - } - - $items = []; - foreach ($unique as $v) { - $items[] = [ - $element['#key_column'] => $v, - ]; - } - - if (!isset($element['#multiple']) || !$element['#multiple']) { - $items = reset($items); - } - - $form_state->setValueForElement($element, $items); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Entity/Synonym.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Entity/Synonym.php deleted file mode 100644 index 8f78a8887..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Entity/Synonym.php +++ /dev/null @@ -1,235 +0,0 @@ -getProviderPluginInstance()->getPluginDefinition()['label']; - } - - /** - * {@inheritdoc} - */ - public function getProviderPluginInstance() { - return $this->getPluginCollection()->get($this->getProviderPlugin()); - } - - /** - * {@inheritdoc} - */ - public function getProviderPlugin() { - return $this->provider_plugin; - } - - /** - * {@inheritdoc} - */ - public function setProviderPlugin($plugin) { - $this->provider_plugin = $plugin; - } - - /** - * {@inheritdoc} - */ - public function getProviderConfiguration() { - if ($this->getProviderPluginInstance() instanceof ConfigurablePluginInterface) { - return $this->getPluginCollection()->get($this->getProviderPlugin())->getConfiguration(); - } - return $this->provider_configuration; - } - - /** - * {@inheritdoc} - */ - public function setProviderConfiguration(array $provider_configuration) { - if ($this->getProviderPluginInstance() instanceof ConfigurablePluginInterface) { - $this->getProviderPluginInstance()->setConfiguration($provider_configuration); - } - $this->provider_configuration = $provider_configuration; - } - - /** - * {@inheritdoc} - */ - public function getBehaviorConfiguration() { - return $this->behavior_configuration; - } - - /** - * {@inheritdoc} - */ - public function setBehaviorConfiguration(array $behavior_configuration) { - $this->behavior_configuration = $behavior_configuration; - } - - /** - * Gets the plugin collections used by this entity. - * - * @return SynonymProviderPluginCollection[] - * An array of plugin collections, keyed by the property name they use to - * store their configuration. - */ - public function getPluginCollections() { - return ['provider_configuration' => $this->getPluginCollection()]; - } - - /** - * {@inheritdoc} - */ - public static function postLoad(EntityStorageInterface $storage, array &$entities) { - parent::postLoad($storage, $entities); - foreach ($entities as $entity) { - $entity->addCacheTags([self::cacheTagConstruct($entity->get('behavior'), $entity->getProviderPluginInstance()->getPluginDefinition()['controlled_entity_type'], $entity->getProviderPluginInstance()->getPluginDefinition()['controlled_bundle'])]); - } - } - - /** - * {@inheritdoc} - */ - public function preSave(EntityStorageInterface $storage) { - parent::preSave($storage); - - // Update the "static" properties. We keep them only to be able to leverage - // Schema API through them. - $this->base_provider_plugin = $this->getProviderPluginInstance()->getBaseId(); - $this->behavior = $this->getProviderPluginInstance()->getBehaviorService(); - - // Make sure we have appropriate cache tags in this entity. If it was just - // created and runs its first save it might not have it set up yet. - $this->addCacheTags([self::cacheTagConstruct($this->behavior, $this->getProviderPluginInstance()->getPluginDefinition()['controlled_entity_type'], $this->getProviderPluginInstance()->getPluginDefinition()['controlled_bundle'])]); - } - - /** - * Construct a cache tag. - * - * Construct a cache tag that represents synonyms config for a given behavior, - * entity type, and bundle. - * - * @param string $behavior - * Synonyms behavior whose cache tag is requested - * @param string $entity_type - * Entity type whose cache tag is requested - * @param string $bundle - * Bundle whose cache tag is requested - * - * @return string - * Cache tag - */ - public static function cacheTagConstruct($behavior, $entity_type, $bundle) { - return 'synonyms:' . $behavior . '.' . $entity_type . '.' . $bundle; - } - - /** - * Encapsulates the creation of entity's LazyPluginCollection. - * - * @return SynonymProviderPluginCollection - * The entity's plugin collection. - */ - protected function getPluginCollection() { - if (!$this->pluginCollection && $this->getProviderPlugin()) { - $this->pluginCollection = new SynonymProviderPluginCollection(\Drupal::service('plugin.manager.synonyms_provider'), $this->getProviderPlugin(), $this->provider_configuration); - } - return $this->pluginCollection; - } - - /** - * {@inheritdoc} - */ - protected function invalidateTagsOnSave($update) { - parent::invalidateTagsOnSave($update); - Cache::invalidateTags($this->cacheTags); - } - - /** - * {@inheritdoc} - */ - protected static function invalidateTagsOnDelete(EntityTypeInterface $entity_type, array $entities) { - $cacheability_metadata = new CacheableMetadata(); - foreach ($entities as $entity) { - $cacheability_metadata->addCacheableDependency($entity); - } - Cache::invalidateTags($cacheability_metadata->getCacheTags()); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymDeleteForm.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymDeleteForm.php deleted file mode 100644 index 081b5b117..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymDeleteForm.php +++ /dev/null @@ -1,45 +0,0 @@ -t('Are you sure you want to delete synonym configuration %name?', ['%name' => $this->entity->label()]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.synonym.overview'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $this->entity->delete(); - drupal_set_message($this->t('Synonym configuration %label has been deleted.', ['%label' => $this->entity->label()])); - - $form_state->setRedirectUrl($this->getCancelUrl()); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymForm.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymForm.php deleted file mode 100644 index 0954ed998..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Form/SynonymForm.php +++ /dev/null @@ -1,292 +0,0 @@ -entityQuery = $entity_query; - $this->entityTypeManager = $entity_type_manager; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - $this->synonymsProviderPluginManager = $synonyms_provider_plugin_manager; - $this->behaviorServices = $behavior_services; - $this->container = $container; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity.query'), - $container->get('entity_type.manager'), - $container->get('entity_type.bundle.info'), - $container->get('plugin.manager.synonyms_provider'), - $container->get('synonyms.behaviors'), - $container - ); - } - - /** - * {@inheritdoc} - */ - protected function init(FormStateInterface $form_state) { - parent::init($form_state); - - if ($this->entity->isNew()) { - $this->controlledEntityType = $this->getRequest()->get('synonyms_entity_type')->id(); - $this->controlledBundle = $this->getRequest()->get('bundle'); - $this->behaviorServiceId = $this->getRouteMatch()->getRawParameter('synonyms_behavior_service'); - } - else { - $plugin_definition = $this->entity->getProviderPluginInstance()->getPluginDefinition(); - $this->controlledEntityType = $plugin_definition['controlled_entity_type']; - $this->controlledBundle = $plugin_definition['controlled_bundle']; - $this->behaviorServiceId = $plugin_definition['synonyms_behavior_service']; - } - } - - /** - * {@inheritdoc} - */ - public function form(array $form, FormStateInterface $form_state) { - $form = parent::form($form, $form_state); - - $class = get_class($this); - - $provider_plugin = $this->entity->getProviderPlugin(); - if ($form_state->getValue('provider_plugin')) { - $provider_plugin = $form_state->getValue('provider_plugin'); - } - - $form['id'] = [ - '#type' => 'value', - '#value' => str_replace(':', '.', $provider_plugin), - ]; - - $options = []; - foreach ($this->synonymsProviderPluginManager->getDefinitions() as $plugin_id => $plugin) { - if ($plugin['controlled_entity_type'] == $this->controlledEntityType && $plugin['controlled_bundle'] == $this->controlledBundle && $plugin['synonyms_behavior_service'] == $this->behaviorServiceId) { - $options[$plugin_id] = $plugin['label']; - } - } - - $form['provider_plugin'] = [ - '#type' => 'select', - '#title' => $this->t('Synonyms provider'), - '#description' => $this->t('Select what synonyms provider it should represent.'), - '#required' => TRUE, - '#options' => $options, - '#default_value' => $this->entity->getProviderPlugin(), - '#ajax' => [ - 'wrapper' => 'synonyms-entity-configuration-ajax-wrapper', - 'event' => 'change', - 'callback' => [$class, 'ajaxForm'], - ], - ]; - - $form['ajax_wrapper'] = [ - '#prefix' => '
        ', - '#suffix' => '
        ', - ]; - - $form['ajax_wrapper']['provider_configuration'] = [ - '#tree' => TRUE, - '#title' => $this->t('Provider settings'), - '#open' => TRUE, - ]; - - $form['ajax_wrapper']['behavior_configuration'] = [ - '#tree' => TRUE, - '#title' => $this->t('Behavior settings'), - '#open' => TRUE, - ]; - - if ($provider_plugin) { - $provider_plugin_instance = $this->entity->getProviderPluginInstance(); - - if ($provider_plugin_instance instanceof PluginFormInterface) { - $form['ajax_wrapper']['provider_configuration']['#type'] = 'details'; - $form['ajax_wrapper']['provider_configuration'] += $provider_plugin_instance->buildConfigurationForm($form['ajax_wrapper']['provider_configuration'], $form_state); - } - - $behavior_service_instance = $provider_plugin_instance->getBehaviorServiceInstance(); - if ($behavior_service_instance instanceof SynonymsBehaviorConfigurableInterface) { - $form['ajax_wrapper']['behavior_configuration']['#type'] = 'details'; - $form['ajax_wrapper']['behavior_configuration'] += $behavior_service_instance->buildConfigurationForm($form['ajax_wrapper']['behavior_configuration'], $form_state, $this->entity->getBehaviorConfiguration(), $this->entity); - } - - } - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - - if ($this->entity->getProviderPluginInstance() instanceof PluginFormInterface) { - $this->entity->getProviderPluginInstance()->validateConfigurationForm($form['ajax_wrapper']['provider_configuration'], $this->getSubFormState('provider_configuration', $form, $form_state)); - } - - if ($this->entity->getProviderPluginInstance()->getBehaviorServiceInstance() instanceof SynonymsBehaviorConfigurableInterface) { - $this->entity->getProviderPluginInstance()->getBehaviorServiceInstance()->validateConfigurationForm($form['ajax_wrapper']['behavior_configuration'], $this->getSubFormState('behavior_configuration', $form, $form_state), $this->entity); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - parent::submitForm($form, $form_state); - - if ($this->entity->getProviderPluginInstance() instanceof PluginFormInterface) { - $this->entity->getProviderPluginInstance()->submitConfigurationForm($form['ajax_wrapper']['provider_configuration'], $this->getSubFormState('provider_configuration', $form, $form_state)); - } - - if ($this->entity->getProviderPluginInstance()->getBehaviorServiceInstance() instanceof SynonymsBehaviorConfigurableInterface) { - $this->entity->setBehaviorConfiguration($this->entity->getProviderPluginInstance()->getBehaviorServiceInstance()->submitConfigurationForm($form['ajax_wrapper']['behavior_configuration'], $this->getSubFormState('behavior_configuration', $form, $form_state), $this->entity)); - } - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $status = $this->entity->save(); - - if ($status) { - drupal_set_message($this->t('Saved the %label synonym configuration.', [ - '%label' => $this->entity->label(), - ])); - } - else { - drupal_set_message($this->t('The %label synonym configuration was not saved.', [ - '%label' => $this->entity->label(), - ]), 'error'); - } - - $form_state->setRedirect('entity.synonym.overview'); - } - - /** - * Check whether entity with such ID already exists. - * - * @param string $id - * Entity ID to check - * - * @return bool - * Whether entity with such ID already exists. - */ - public function exist($id) { - $entity = $this->entityQuery->get('synonym') - ->condition('id', $id) - ->execute(); - return (bool) $entity; - } - - /** - * Ajax callback. - */ - public static function ajaxForm(array &$form, FormStateInterface $form_state, Request $request) { - return $form['ajax_wrapper']; - } - - /** - * Supportive method to create sub-form-states. - * - * @param string $element_name - * Name of the nested form element for which to create a sub form state - * @param array $form - * Full form array - * @param FormStateInterface $form_state - * Full form state out of which to create sub form state - * - * @return SubformState - * Sub form state object generated based on the input arguments - */ - protected function getSubFormState($element_name, array $form, FormStateInterface $form_state) { - return SubformState::createForSubform($form['ajax_wrapper'][$element_name], $form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/EntityTypeParamConverter.php b/sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/EntityTypeParamConverter.php deleted file mode 100644 index 127fabb2c..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/EntityTypeParamConverter.php +++ /dev/null @@ -1,40 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public function convert($value, $definition, $name, array $defaults) { - return $this->entityTypeManager->getDefinition($value); - } - - /** - * {@inheritdoc} - */ - public function applies($definition, $name, Route $route) { - return (!empty($definition['type']) && $definition['type'] == 'synonyms_entity_type'); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/SynonymsBehaviorServiceParamConverter.php b/sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/SynonymsBehaviorServiceParamConverter.php deleted file mode 100644 index 189ec5213..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/ParamConverter/SynonymsBehaviorServiceParamConverter.php +++ /dev/null @@ -1,40 +0,0 @@ -behaviorService = $behavior_service; - } - - /** - * {@inheritdoc} - */ - public function convert($value, $definition, $name, array $defaults) { - return $this->behaviorService->getBehaviorService($value)['service']; - } - - /** - * {@inheritdoc} - */ - public function applies($definition, $name, Route $route) { - return (!empty($definition['type']) && $definition['type'] == 'synonyms_behavior_service'); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/EntityReferenceField.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/EntityReferenceField.php deleted file mode 100644 index c09d132dd..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/EntityReferenceField.php +++ /dev/null @@ -1,113 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->behaviorService = $behavior_service; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - $this->entityFieldManager = $entity_field_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('synonyms.behaviors'), - $container->get('entity_type.bundle.info'), - $container->get('entity_field.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $implemented_interfaces = new \ReflectionClass($base_plugin_definition['class']); - $implemented_interfaces = $implemented_interfaces->getInterfaceNames(); - - foreach ($this->behaviorService->getBehaviorServices() as $service_id => $behavior) { - $required_interfaces = $behavior['required_interfaces']; - - $diff = array_diff($required_interfaces, $implemented_interfaces); - if (empty($diff)) { - // This plugin has implemented all required interfaces for this - // behavior. - foreach ($this->entityTypeManager->getDefinitions() as $entity_type) { - if ($entity_type instanceof ContentEntityType) { - foreach ($this->entityTypeBundleInfo->getBundleInfo($entity_type->id()) as $bundle => $bundle_info) { - $fields = $this->entityFieldManager->getFieldDefinitions($entity_type->id(), $bundle); - - foreach ($fields as $field) { - if ($field->getType() == 'entity_reference') { - $derivative_name = implode('_', [ - $service_id, - $entity_type->id(), - $bundle, - $field->getName(), - ]); - - $this->derivatives[$derivative_name] = $base_plugin_definition; - $this->derivatives[$derivative_name]['label'] = $this->t('@behavior on @field', [ - '@behavior' => $behavior['service']->getTitle(), - '@field' => $field->getLabel(), - ]); - $this->derivatives[$derivative_name]['synonyms_behavior_service'] = $service_id; - $this->derivatives[$derivative_name]['controlled_entity_type'] = $entity_type->id(); - $this->derivatives[$derivative_name]['controlled_bundle'] = $bundle; - $this->derivatives[$derivative_name]['field'] = $field->getName(); - } - } - } - } - } - } - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/Field.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/Field.php deleted file mode 100644 index 8e15cdf1d..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/Field.php +++ /dev/null @@ -1,133 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->behaviorService = $behavior_service; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - $this->entityFieldManager = $entity_field_manager; - $this->fieldTypeToSynonyms = $field_type_to_synonyms; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $container->get('entity_type.manager'), - $container->get('synonyms.behaviors'), - $container->get('entity_type.bundle.info'), - $container->get('entity_field.manager'), - $container->get('synonyms.provider.field_type_to_synonyms') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $implemented_interfaces = new \ReflectionClass($base_plugin_definition['class']); - $implemented_interfaces = $implemented_interfaces->getInterfaceNames(); - - $field_type_to_property_map = $this->fieldTypeToSynonyms->getSimpleFieldTypeToPropertyMap(); - foreach ($this->behaviorService->getBehaviorServices() as $service_id => $behavior) { - $required_interfaces = $behavior['required_interfaces']; - - $diff = array_diff($required_interfaces, $implemented_interfaces); - if (empty($diff)) { - // This plugin has implemented all required interfaces for this - // behavior. - foreach ($this->entityTypeManager->getDefinitions() as $entity_type) { - if ($entity_type instanceof ContentEntityType) { - foreach ($this->entityTypeBundleInfo->getBundleInfo($entity_type->id()) as $bundle => $bundle_info) { - $base_fields = $this->entityFieldManager->getBaseFieldDefinitions($entity_type->id()); - $fields = $this->entityFieldManager->getFieldDefinitions($entity_type->id(), $bundle); - - switch ($base_plugin_definition['id']) { - case 'base_field': - $fields = $base_fields; - break; - - case 'field': - $fields = array_diff_key($fields, $base_fields); - break; - } - - foreach ($fields as $field) { - if ($field->getName() != 'synonyms' && isset($field_type_to_property_map[$field->getType()])) { - $derivative_name = implode('_', [ - $service_id, - $entity_type->id(), - $bundle, - $field->getName(), - ]); - - $this->derivatives[$derivative_name] = $base_plugin_definition; - $this->derivatives[$derivative_name]['label'] = $this->t('@behavior on @field', [ - '@behavior' => $behavior['service']->getTitle(), - '@field' => $field->getLabel(), - ]); - $this->derivatives[$derivative_name]['synonyms_behavior_service'] = $service_id; - $this->derivatives[$derivative_name]['controlled_entity_type'] = $entity_type->id(); - $this->derivatives[$derivative_name]['controlled_bundle'] = $bundle; - $this->derivatives[$derivative_name]['field'] = $field->getName(); - } - } - } - } - } - } - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/ViewsSynonymsEntityArgumentValidator.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/ViewsSynonymsEntityArgumentValidator.php deleted file mode 100644 index 4062a5b88..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Derivative/ViewsSynonymsEntityArgumentValidator.php +++ /dev/null @@ -1,78 +0,0 @@ -basePluginId = $base_plugin_id; - $this->entityTypeManager = $entity_type_manager; - $this->stringTranslation = $string_translation; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static( - $base_plugin_id, - $container->get('entity_type.manager'), - $container->get('string_translation') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $entity_types = $this->entityTypeManager->getDefinitions(); - $this->derivatives = []; - foreach ($entity_types as $entity_type_id => $entity_type) { - if ($entity_type instanceof ContentEntityTypeInterface) { - $this->derivatives[$entity_type_id] = [ - 'id' => 'synonyms_entity:' . $entity_type_id, - 'provider' => 'synonyms', - 'title' => $this->t('Synonyms of @entity_type', [ - '@entity_type' => $entity_type->getLowercaseLabel(), - ]), - 'help' => $this->t('Validate @label', ['@label' => $entity_type->getLabel()]), - 'entity_type' => $entity_type_id, - 'class' => $base_plugin_definition['class'], - ]; - } - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsAutocomplete.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsAutocomplete.php deleted file mode 100644 index 68b0e2156..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsAutocomplete.php +++ /dev/null @@ -1,161 +0,0 @@ -behaviorService = $behavior_service; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $plugin_id, - $plugin_definition, - $configuration['field_definition'], - $configuration['settings'], - $configuration['third_party_settings'], - $container->get('synonyms.behaviors') - ); - } - - /** - * {@inheritdoc} - */ - public static function defaultSettings() { - return [ - 'suggestion_size' => 10, - 'suggest_only_unique' => FALSE, - 'match' => 'CONTAINS', - ] + parent::defaultSettings(); - } - - /** - * {@inheritdoc} - */ - public function settingsForm(array $form, FormStateInterface $form_state) { - $elements = parent::settingsForm($form, $form_state); - - $elements['suggestion_size'] = [ - '#type' => 'textfield', - '#title' => $this->t('Suggestions Size'), - '#description' => $this->t('Please, enter how many suggested entities to show in the autocomplete textfield.'), - '#required' => TRUE, - '#default_value' => $this->getSetting('suggestion_size'), - ]; - - $elements['suggest_only_unique'] = [ - '#type' => 'checkbox', - '#title' => t('Suggest only one entry per entity'), - '#description' => t('If you want to include only name or a single synonym, suggesting a particular entity, while disregarding all ongoing ones, please, tick this checkbox on.'), - '#default_value' => $this->getSetting('suggest_only_unique'), - ]; - - $elements['match'] = [ - '#type' => 'radios', - '#title' => $this->t('Match operator'), - '#description' => $this->t('Choose how to match the keyword against existing data.'), - '#options' => $this->getMatchOperatorOptions(), - '#default_value' => $this->getSetting('match'), - '#required' => TRUE, - ]; - - return $elements; - } - - /** - * {@inheritdoc} - */ - public function settingsSummary() { - $summary = parent::settingsSummary(); - - $summary[] = $this->t('Suggestion size: @size', [ - '@size' => $this->getSetting('suggestion_size'), - ]); - - $summary[] = $this->t('Only unique: @unique', [ - '@unique' => $this->getSetting('suggest_only_unique') ? $this->t('Yes') : $this->t('No'), - ]); - - $summary[] = $this->t('Match: @match', [ - '@match' => $this->getMatchOperatorOptions()[$this->getSetting('match')], - ]); - - return $summary; - } - - /** - * {@inheritdoc} - */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { - $default_value = []; - foreach ($items as $item) { - if ($item->entity) { - $default_value[] = $item->entity; - } - } - $element += [ - '#type' => 'synonyms_entity_autocomplete', - '#target_type' => $this->getFieldSetting('target_type'), - '#target_bundles' => $this->getFieldSetting('handler_settings')['target_bundles'], - '#suggestion_size' => $this->getSetting('suggestion_size'), - '#suggest_only_unique' => $this->getSetting('suggest_only_unique'), - // Entity reference field items are handling validation themselves via - // the 'ValidReference' constraint. - '#validate_reference' => FALSE, - '#maxlength' => 1024, - '#match' => $this->getSetting('match'), - '#default_value' => $default_value, - ]; - - return $element; - } - - /** - * Returns the options for the match operator. - * - * @return array - * List of options. - */ - protected function getMatchOperatorOptions() { - return [ - 'STARTS_WITH' => t('Starts with'), - 'CONTAINS' => t('Contains'), - ]; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsSelect.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsSelect.php deleted file mode 100644 index 3f46aadc4..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Field/FieldWidget/EntityReferenceSynonymsSelect.php +++ /dev/null @@ -1,56 +0,0 @@ -{$this->getKeyColumn()}) { - $default_value[] = $item->{$this->getKeyColumn()}; - } - } - - $element += [ - '#type' => 'synonyms_entity_select', - '#key_column' => $this->getKeyColumn(), - '#target_type' => $this->getFieldSetting('target_type'), - '#handler' => $this->fieldDefinition->getSetting('handler'), - '#handler_settings' => $this->fieldDefinition->getSetting('handler_settings') ?: [], - '#multiple' => $this->fieldDefinition->getFieldStorageDefinition()->isMultiple(), - '#default_value' => $this->fieldDefinition->getFieldStorageDefinition()->isMultiple() ? $default_value : reset($default_value), - ]; - return $element; - } - - /** - * Get name of the column that is managed by this widget in the field - * . - * @return string - */ - protected function getKeyColumn() { - return $this->fieldDefinition->getFieldStorageDefinition()->getPropertyNames()[0]; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/AbstractProvider.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/AbstractProvider.php deleted file mode 100644 index a1c701df4..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/AbstractProvider.php +++ /dev/null @@ -1,58 +0,0 @@ -container = $container; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container - ); - } - - /** - * {@inheritdoc} - */ - public function getBehaviorService() { - return $this->getPluginDefinition()['synonyms_behavior_service']; - } - - /** - * {@inheritdoc} - */ - public function getBehaviorServiceInstance() { - return $this->container->get($this->getPluginDefinition()['synonyms_behavior_service']); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/BaseField.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/BaseField.php deleted file mode 100644 index ff7b9d554..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/BaseField.php +++ /dev/null @@ -1,128 +0,0 @@ -entityFieldManager = $entity_field_manager; - $this->fieldTypeToSynonyms = $field_type_to_synonyms; - $this->entityTypeManager = $entity_type_manager; - $this->database = $database; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_field.manager'), - $container->get('synonyms.provider.field_type_to_synonyms'), - $container->get('entity_type.manager'), - $container->get('database'), - $container - ); - } - - /** - * {@inheritdoc} - */ - public function getSynonyms(ContentEntityInterface $entity, array $behavior_configuration = []) { - $map = $this->fieldTypeToSynonyms->getSimpleFieldTypeToPropertyMap(); - $field_type = $entity->getFieldDefinition($this->getPluginDefinition()['field'])->getType(); - - $synonyms = []; - - if (isset($map[$field_type])) { - foreach ($entity->get($this->getPluginDefinition()['field']) as $item) { - $synonyms[] = $item->{$map[$field_type]}; - } - } - - return $synonyms; - } - - /** - * {@inheritdoc} - */ - public function synonymsFind(ConditionInterface $condition) { - $entity_type_definition = $this->entityTypeManager->getDefinition($this->getPluginDefinition()['controlled_entity_type']); - $entity_keys = $entity_type_definition->getKeys(); - - $query = $this->database->select($entity_type_definition->getDataTable(), 'base'); - $query->addField('base', $entity_keys['id'], 'entity_id'); - $query->addField('base', $this->getPluginDefinition()['field'], 'synonym'); - - if ($this->getPluginDefinition()['controlled_entity_type'] != $this->getPluginDefinition()['controlled_bundle'] && isset($entity_keys['bundle']) && $entity_keys['bundle']) { - $query->condition($entity_keys['bundle'], $this->getPluginDefinition()['controlled_bundle']); - } - - $this->synonymsFindProcessCondition($condition, $this->getPluginDefinition()['field'], $entity_keys['id']); - $query->condition($condition); - - return $query->execute(); - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $field = $this->entityFieldManager->getFieldDefinitions($this->getPluginDefinition()['controlled_entity_type'], $this->getPluginDefinition()['controlled_bundle'])[$this->getPluginDefinition()['field']]; - return [ - $field->getConfigDependencyKey() => [$field->getConfigDependencyName()], - ]; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/EntityReferenceField.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/EntityReferenceField.php deleted file mode 100644 index a566396e4..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/EntityReferenceField.php +++ /dev/null @@ -1,191 +0,0 @@ -entityFieldManager = $entity_field_manager; - $this->entityTypeManager = $entity_type_manager; - $this->database = $database; - $this->entityQueryFactory = $entity_query_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_field.manager'), - $container->get('entity_type.manager'), - $container->get('database'), - $container->get('entity.query'), - $container - ); - } - - /** - * {@inheritdoc} - */ - public function getSynonyms(ContentEntityInterface $entity, array $behavior_configuration = []) { - $synonyms = []; - - foreach ($entity->get($this->getPluginDefinition()['field']) as $item) { - $synonyms[] = $item->entity->label(); - } - - return $synonyms; - } - - /** - * {@inheritdoc} - */ - public function synonymsFind(ConditionInterface $condition) { - $entity_type_definition = $this->entityTypeManager->getDefinition($this->getPluginDefinition()['controlled_entity_type']); - $field = $this->entityFieldManager->getFieldDefinitions($this->getPluginDefinition()['controlled_entity_type'], $this->getPluginDefinition()['controlled_bundle']); - $field = $field[$this->getPluginDefinition()['field']]; - - $query = new FieldQuery($entity_type_definition, 'AND', $this->database, QueryBase::getNamespaces($this->entityQueryFactory->get($entity_type_definition->id(), 'AND'))); - - if ($entity_type_definition->hasKey('bundle')) { - $query->condition($entity_type_definition->getKey('bundle'), $this->getPluginDefinition()['controlled_bundle']); - } - - $target_entity_type_definition = $this->entityTypeManager->getDefinition($field->getSetting('target_type')); - $label_column = $target_entity_type_definition->getKey('label'); - - // Some hacks. - if (!$label_column && $target_entity_type_definition->id() == 'user') { - $label_column = 'name'; - } - - if (!$label_column) { - // No label column is defined on target entity type, there's nothing we - // can do. - return []; - } - - $synonym_column = $field->getName() . '.entity.' . $label_column; - $this->synonymsFindProcessCondition($condition, $synonym_column, $entity_type_definition->getKey('id')); - - $conditions_array = $condition->conditions(); - $entity_condition = new Condition($conditions_array['#conjunction'], $query); - - // We will insert a dummy condition for a synonym column just to have the - // actual table.column data on the synonym column. - $hash = md5($synonym_column); - $query->condition($synonym_column, $hash); - - unset($conditions_array['#conjunction']); - foreach ($conditions_array as $v) { - $entity_condition->condition($v['field'], $v['value'], $v['operator']); - } - - $query->condition($entity_condition); - - // We need run the entity query in order to force it into building a normal - // SQL query. - $query->execute(); - - // Now let's get "demapped" normal SQL query that will tell us explicitly - // where all entity properties/fields are stored among the SQL tables. Such - // data is what we need and we do not want to demap it manually. - $sql_query = $query->getSqlQuery(); - - // Swap the entity_id column into the alias "entity_id" as we are supposed - // to do in this method implementation. - $select_fields = &$sql_query->getFields(); - $select_fields = ['entity_id' => $select_fields[$entity_type_definition->getKey('id')]]; - $select_fields['entity_id']['alias'] = 'entity_id'; - - // We need some dummy extra condition to force them into re-compilation. - $sql_query->where('1 = 1'); - $conditions_array = &$sql_query->conditions(); - foreach ($conditions_array as $k => $condition_array) { - if (isset($condition_array['value']) && $condition_array['value'] == $hash) { - list($table_alias, $column) = explode('.', $condition_array['field']); - unset($conditions_array[$k]); - - // Also unsetting the table aliased by this condition. - $tables = &$sql_query->getTables(); - $real_table = $tables[$table_alias]['table']; - foreach ($tables as $k2 => $v2) { - if ($k2 != $table_alias && $real_table == $v2['table']) { - unset($tables[$table_alias]); - $table_alias = $k2; - } - } - - $sql_query->addField($table_alias, $column, 'synonym'); - break; - } - } - $result = $sql_query->execute(); - return $result; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $field = $this->entityFieldManager->getFieldDefinitions($this->getPluginDefinition()['controlled_entity_type'], $this->getPluginDefinition()['controlled_bundle'])[$this->getPluginDefinition()['field']]; - return [ - $field->getConfigDependencyKey() => [$field->getConfigDependencyName()], - ]; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/Field.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/Field.php deleted file mode 100644 index 72ce06891..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/Synonyms/Provider/Field.php +++ /dev/null @@ -1,216 +0,0 @@ -entityFieldManager = $entity_field_manager; - $this->fieldTypeToSynonyms = $field_type_to_synonyms; - $this->entityTypeManager = $entity_type_manager; - $this->database = $database; - $this->entityQueryFactory = $entity_query_factory; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_field.manager'), - $container->get('synonyms.provider.field_type_to_synonyms'), - $container->get('entity_type.manager'), - $container->get('database'), - $container->get('entity.query'), - $container - ); - } - - /** - * {@inheritdoc} - */ - public function getSynonyms(ContentEntityInterface $entity, array $behavior_configuration = []) { - $map = $this->fieldTypeToSynonyms->getSimpleFieldTypeToPropertyMap(); - $field_type = $entity->getFieldDefinition($this->getPluginDefinition()['field'])->getType(); - - $synonyms = []; - - if (isset($map[$field_type])) { - foreach ($entity->get($this->getPluginDefinition()['field']) as $item) { - $synonyms[] = $item->{$map[$field_type]}; - } - } - - return $synonyms; - } - - /** - * {@inheritdoc} - */ - public function synonymsFind(ConditionInterface $condition) { - $entity_type_definition = $this->entityTypeManager->getDefinition($this->getPluginDefinition()['controlled_entity_type']); - $field = $this->entityFieldManager->getFieldDefinitions($this->getPluginDefinition()['controlled_entity_type'], $this->getPluginDefinition()['controlled_bundle']); - $field = $field[$this->getPluginDefinition()['field']]; - $field_property = $this->fieldTypeToSynonyms->getSimpleFieldTypeToPropertyMap(); - if (isset($field_property[$field->getType()])) { - $field_property = $field_property[$field->getType()]; - } - else { - return []; - } - - $query = new FieldQuery($entity_type_definition, 'AND', $this->database, QueryBase::getNamespaces($this->entityQueryFactory->get($entity_type_definition->id(), 'AND'))); - - - if ($entity_type_definition->hasKey('bundle')) { - $query->condition($entity_type_definition->getKey('bundle'), $this->getPluginDefinition()['controlled_bundle']); - } - - $synonym_column = $field->getName() . '.' . $field_property; - $this->synonymsFindProcessCondition($condition, $synonym_column, $entity_type_definition->getKey('id')); - - $conditions_array = $condition->conditions(); - $entity_condition = new Condition($conditions_array['#conjunction'], $query); - - // We will insert a dummy condition for a synonym column just to have the - // actual table.column data on the synonym column. - $hash = md5($synonym_column); - $query->condition($synonym_column, $hash); - - unset($conditions_array['#conjunction']); - foreach ($conditions_array as $v) { - $entity_condition->condition($v['field'], $v['value'], $v['operator']); - } - - $query->condition($entity_condition); - - // We need run the entity query in order to force it into building a normal - // SQL query. - $query->execute(); - - // Now let's get "demapped" normal SQL query that will tell us explicitly - // where all entity properties/fields are stored among the SQL tables. Such - // data is what we need and we do not want to demap it manually. - $sql_query = $query->getSqlQuery(); - - // Swap the entity_id column into the alias "entity_id" as we are supposed - // to do in this method implementation. - $select_fields = &$sql_query->getFields(); - $select_fields = ['entity_id' => $select_fields[$entity_type_definition->getKey('id')]]; - $select_fields['entity_id']['alias'] = 'entity_id'; - - // We need some dummy extra condition to force them into re-compilation. - $sql_query->where('1 = 1'); - $conditions_array = &$sql_query->conditions(); - foreach ($conditions_array as $k => $condition_array) { - if (isset($condition_array['value']) && $condition_array['value'] == $hash) { - list($table_alias, $column) = explode('.', $condition_array['field']); - unset($conditions_array[$k]); - - // Also unsetting the table aliased by this condition. - $tables = &$sql_query->getTables(); - $real_table = $tables[$table_alias]['table']; - foreach ($tables as $k2 => $v2) { - if ($k2 != $table_alias && $real_table == $v2['table']) { - unset($tables[$table_alias]); - $table_alias = $k2; - } - } - - $sql_query->addField($table_alias, $column, 'synonym'); - break; - } - } - $result = $sql_query->execute(); - return $result; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - $field = $this->entityFieldManager->getFieldDefinitions($this->getPluginDefinition()['controlled_entity_type'], $this->getPluginDefinition()['controlled_bundle'])[$this->getPluginDefinition()['field']]; - return [ - $field->getConfigDependencyKey() => [$field->getConfigDependencyName()], - ]; - } - -} - -/** - * Hacked implementation of Entity query. - */ -class FieldQuery extends Query { - - /** - * We need to be able to extract SQL query object. - * - * @return \Drupal\Core\Database\Query\SelectInterface - */ - public function getSqlQuery() { - return $this->sqlQuery; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/SynonymsFieldItemList.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/SynonymsFieldItemList.php deleted file mode 100644 index ca9c192f7..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/SynonymsFieldItemList.php +++ /dev/null @@ -1,33 +0,0 @@ -getEntity(); - - $behavior_service = \Drupal::getContainer()->get('synonyms.behaviors'); - - $services = $behavior_service->getBehaviorServicesWithInterface(SynonymsGetProviderInterface::class); - foreach ($services as $service_id => $service) { - foreach ($behavior_service->getSynonymConfigEntities($service_id, $entity->getEntityTypeId(), $entity->bundle()) as $synonym_config) { - $synonyms = array_merge($synonyms, $synonym_config->getProviderPluginInstance()->getSynonyms($entity, $synonym_config->getBehaviorConfiguration())); - } - } - - return array_unique($synonyms); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/argument_validator/SynonymsEntity.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/argument_validator/SynonymsEntity.php deleted file mode 100644 index 72d218fcf..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/argument_validator/SynonymsEntity.php +++ /dev/null @@ -1,144 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityQuery = $entity_query; - $this->behaviorService = $behavior_service; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_definition, - $plugin_definition, - $container->get('entity.manager'), - $container->get('entity_type.manager'), - $container->get('entity.query'), - $container->get('synonyms.behaviors') - ); - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - - $form['transform'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Transform dashes in URL to spaces.'), - '#default_value' => $this->options['transform'], - ]; - } - - /** - * {@inheritdoc} - */ - public function validateArgument($argument) { - if ($this->options['transform']) { - $argument = str_replace('-', ' ', $argument); - } - - $entity_type = $this->entityTypeManager->getDefinition($this->definition['entity_type']); - - if ($entity_type->hasKey('label') || $entity_type->id() == 'user') { - $query = $this->entityQuery->get($entity_type->id()); - - // User entity type does not declare its label, while it does have one. - $label_column = $entity_type->id() == 'user' ? 'name' : $entity_type->getKey('label'); - $query->condition($label_column, $argument, '='); - - if ($entity_type->hasKey('bundle') && !empty($this->options['bundles'])) { - $query->condition($entity_type->getKey('bundle'), $this->options['bundles'], 'IN'); - } - - $result = $query->execute(); - if (!empty($result)) { - $entities = $this->entityTypeManager->getStorage($entity_type->id())->loadMultiple($result); - foreach ($entities as $entity) { - if ($this->validateEntity($entity)) { - $this->argument->argument = $entity->id(); - return TRUE; - } - } - } - } - - // We've fallen through with search by entity name, now it's time to search - // by synonyms. - $condition = new Condition('AND'); - $condition->condition(SynonymsFindProviderInterface::COLUMN_SYNONYM_PLACEHOLDER, $argument, '='); - - foreach ($this->behaviorService->getBehaviorServicesWithInterface(SynonymsFindProviderInterface::class) as $service_id => $service) { - foreach ($this->behaviorService->getSynonymConfigEntities($service_id, $entity_type->id(), empty($this->options['bundles']) ? NULL : $this->options['bundles']) as $synonym_config) { - foreach ($synonym_config->getProviderPluginInstance()->synonymsFind(clone $condition) as $synonym) { - $entity = $this->entityTypeManager->getStorage($entity_type->id())->load($synonym->entity_id); - if ($this->validateEntity($entity)) { - $this->argument->argument = $entity->id(); - return TRUE; - } - } - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['transform'] = ['default' => FALSE]; - - return $options; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/filter/SynonymsEntity.php b/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/filter/SynonymsEntity.php deleted file mode 100644 index 2bae0db8d..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/Plugin/views/filter/SynonymsEntity.php +++ /dev/null @@ -1,243 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('entity_type.bundle.info') - ); - } - - /** - * {@inheritdoc} - */ - public function defineOptions() { - $options = parent::defineOptions(); - - $options['widget'] = [ - 'default' => 'autocomplete', - ]; - - $options['target_bundles'] = [ - 'default' => NULL, - ]; - - return $options; - } - - /** - * {@inheritdoc} - */ - public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { - parent::init($view, $display, $options); - - switch ($this->options['widget']) { - case 'autocomplete': - $this->operator = 'IN'; - break; - - case 'select': - $this->operator = !$this->isExposed() || $this->options['expose']['multiple'] ? 'IN' : '='; - break; - } - } - - /** - * {@inheritdoc} - */ - public function buildExtraOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildExtraOptionsForm($form, $form_state); - - $form['widget'] = [ - '#type' => 'radios', - '#title' => $this->t('Widget'), - '#options' => [ - 'autocomplete' => $this->t('Autocomplete'), - 'select' => $this->t('Select'), - ], - '#default_value' => $this->options['widget'], - '#required' => TRUE, - '#description' => $this->t('Choose what widget to use in order to specify entity.'), - ]; - - if ($this->entityTypeManager->getDefinition($this->definition['entity_type'])->hasKey('bundle')) { - $options = array_map(function($item) { - return $item['label']; - }, $this->entityTypeBundleInfo->getBundleInfo($this->definition['entity_type'])); - - $form['target_bundles'] = [ - '#type' => 'checkboxes', - '#title' => $this->t('Bundles'), - '#description' => $this->t('Limit the possible values down to specific subset of bundles. Leave empty to have no filter by bundles.'), - '#default_value' => $this->options['target_bundles'], - '#options' => $options, - ]; - } - } - - /** - * {@inheritdoc} - */ - public function submitExtraOptionsForm($form, FormStateInterface $form_state) { - parent::submitExtraOptionsForm($form, $form_state); - - if (isset($form['target_bundles'])) { - $target_bundles = array_values(array_filter($form_state->getValue($form['target_bundles']['#parents']))); - if (empty($target_bundles)) { - $target_bundles = NULL; - } - $form_state->setValueForElement($form['target_bundles'], $target_bundles); - } - } - - /** - * {@inheritdoc} - */ - public function hasExtraOptions() { - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function validateExposed(&$form, FormStateInterface $form_state) { - parent::validateExposed($form, $form_state); - - $identifier = $this->options['expose']['identifier']; - - $target_ids = $form_state->getValue($identifier); - switch ($this->operator) { - case 'IN': - $target_ids = array_map(function($item) { - return $item['target_id']; - }, $target_ids); - break; - - case '=': - $target_ids = $target_ids['target_id']; - break; - } - - $form_state->setValue($identifier, $target_ids); - } - - /** - * {@inheritdoc} - */ - public function adminSummary() { - if ($this->isExposed()) { - return $this->t('Exposed'); - } - - $labels = []; - - if (!empty($this->value)) { - foreach ($this->getEntityStorage()->loadMultiple($this->value) as $entity) { - $labels[] = $entity->label(); - } - } - - return $this->operator . ' ' . implode(', ', $labels); - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state) { - if (!empty($this->value)) { - $default_value = $this->getEntityStorage()->loadMultiple($this->value); - } - else { - $default_value = []; - } - - switch ($this->options['widget']) { - case 'autocomplete': - $form['value'] = [ - '#type' => 'synonyms_entity_autocomplete', - '#title' => $this->t('Entity'), - '#target_type' => $this->definition['entity_type'], - '#target_bundles' => $this->options['target_bundles'], - '#default_value' => $default_value, - ]; - break; - - case 'select': - $form['value'] = [ - '#type' => 'synonyms_entity_select', - '#title' => $this->t('Entity'), - '#target_type' => $this->definition['entity_type'], - '#handler_settings' => [ - 'target_bundles' => $this->options['target_bundles'], - ], - '#default_value' => array_keys($default_value), - '#multiple' => TRUE, - '#empty_option' => '', - ]; - break; - } - } - - /** - * {@inheritdoc} - */ - protected function valueSubmit($form, FormStateInterface $form_state) { - parent::valueSubmit($form, $form_state); - - $target_ids = array_map(function($item) { - return $item['target_id']; - }, $form_state->getValue($form['value']['#parents'])); - - $form_state->setValueForElement($form['value'], $target_ids); - } - - /** - * Get entity storage of the entity type this filter is set up to use. - * - * @return \Drupal\Core\Entity\EntityStorageInterface - */ - protected function getEntityStorage() { - return $this->entityTypeManager->getStorage($this->definition['entity_type']); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymInterface.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymInterface.php deleted file mode 100644 index 79d5c40db..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymInterface.php +++ /dev/null @@ -1,72 +0,0 @@ -synonymsFindProcessCondition() method, so you won't have to worry - * much about it - * - * @return \Traversable - * Traversable result set of found synonyms and entity IDs to which those - * belong. Each element in the result set should be an object and should - * have the following structure: - * - synonym: (string) Synonym that was found and which satisfies the - * provided condition - * - entity_id: (int) ID of the entity to which the found synonym belongs - */ - public function synonymsFind(ConditionInterface $condition); - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFindTrait.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFindTrait.php deleted file mode 100644 index 3b43cc857..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFindTrait.php +++ /dev/null @@ -1,45 +0,0 @@ -conditions(); - foreach ($condition_array as &$v) { - if (is_array($v) && isset($v['field'])) { - if ($v['field'] instanceof ConditionInterface) { - // Recursively process this condition too. - $this->synonymsFindProcessCondition($v['field'], $synonym_column, $entity_id_column); - } - else { - $replace = [ - SynonymsFindProviderInterface::COLUMN_SYNONYM_PLACEHOLDER => $synonym_column, - SynonymsFindProviderInterface::COLUMN_ENTITY_ID_PLACEHOLDER => $entity_id_column, - ]; - $v['field'] = str_replace(array_keys($replace), array_values($replace), $v['field']); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFormatWordingProviderInterface.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFormatWordingProviderInterface.php deleted file mode 100644 index 65756fa28..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsFormatWordingProviderInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - $synonym, - '@entity_label' => $entity->label(), - ]; - return str_replace(array_keys($map), array_values($map), $synonym_config->getBehaviorConfiguration()['wording']); - } - - /** - * @return array - * Array of supported tokens in wording. Keys are the tokens whereas - * corresponding values are explanations about what each token means - */ - public function formatWordingAvailableTokens() { - return [ - '@synonym' => $this->t('actual synonym value'), - '@entity_label' => $this->t('actual label of the entity this synonym belongs to'), - ]; - } - -} - diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsGetProviderInterface.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsGetProviderInterface.php deleted file mode 100644 index 91881e48d..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsGetProviderInterface.php +++ /dev/null @@ -1,45 +0,0 @@ - $entity) { - $synonyms[$entity_id] = $this->getSynonyms($entity, $behavior_configuration); - } - - return $synonyms; - } - - /** - * Fetch synonyms from an entity. - * - * @param ContentEntityInterface $entity - * Entity whose synonyms should be fetched - * @param array $behavior_configuration - * Configuration of the synonyms behavior that this provider should obey to - * - * @return string[] - * Array of extracted synonyms - */ - abstract public function getSynonyms(ContentEntityInterface $entity, array $behavior_configuration = []); - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsProviderInterface.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsProviderInterface.php deleted file mode 100644 index dc297bdbd..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsProviderInterface/SynonymsProviderInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -alterInfo('synonyms_provider_info'); - $this->setCacheBackend($cache_backend, 'synonyms_provider_info_plugins'); - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/AutocompleteService.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/AutocompleteService.php deleted file mode 100644 index 7a87602a6..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/AutocompleteService.php +++ /dev/null @@ -1,250 +0,0 @@ -keyValue = $key_value->get('synonyms_entity_autocomplete'); - $this->selectionManager = $selection_plugin_manager; - $this->behaviorService = $behavior_service; - $this->database = $database; - $this->entityTypeManager = $entity_type_manager; - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state, array $configuration, SynonymInterface $synonym_config) { - $replacements = [ - '#theme' => 'item_list', - '#list_type' => 'ul', - '#items' => [], - ]; - foreach ($synonym_config->getProviderPluginInstance()->formatWordingAvailableTokens() as $token => $token_info) { - $replacements['#items'][] = Html::escape($token) . ': ' . $token_info; - } - - $replacements = $this->renderer->renderRoot($replacements); - - $form['wording'] = [ - '#type' => 'textfield', - '#title' => $this->t('Wording for autocomplete suggestion'), - '#default_value' => $configuration['wording'], - '#description' => $this->t('Specify the wording with which the autocomplete suggestion should be presented. Available replacement tokens are: @replacements', [ - '@replacements' => $replacements, - ]), - '#required' => TRUE, - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateConfigurationForm(array &$form, FormStateInterface $form_state, SynonymInterface $synonym_config) { - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state, SynonymInterface $synonym_config) { - return [ - 'wording' => $form_state->getValue('wording'), - ]; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Autocomplete'); - } - - /** - * {@inheritdoc} - */ - public function getRequiredInterfaces() { - return [ - SynonymsGetProviderInterface::class, - SynonymsFindProviderInterface::class, - SynonymsFormatWordingProviderInterface::class, - ]; - } - - /** - * Execute synonym-friendly lookup of entities by a given keyword. - * - * @param string $keyword - * Keyword to search for - * @param string $key_value_key - * Key under which additional settings about the lookup are stored in - * key-value storage - * - * @return array - * Array of looked up suggestions. Each array will have the following - * structure: - * - entity_id: (int) ID of the entity which this entry represents - * - entity_label: (string) Label of the entity which this entry represents - * - wording: (string) Wording with which this entry should be shown to the - * end user on the UI - */ - public function autocompleteLookup($keyword, $key_value_key) { - $suggestions = []; - - if ($this->keyValue->has($key_value_key)) { - $settings = $this->keyValue->get($key_value_key); - - $suggested_entity_ids = []; - - $target_bundles = $settings['target_bundles']; - $handler_settings = []; - if (!empty($target_bundles)) { - $handler_settings['target_bundles'] = $target_bundles; - } - elseif (!$this->entityTypeManager->getDefinition($settings['target_type'])->hasKey('bundle')) { - $target_bundles = [$settings['target_type']]; - } - - $options = [ - 'target_type' => $settings['target_type'], - 'handler' => 'default', - 'handler_settings' => $handler_settings, - ]; - $handler = $this->selectionManager->getInstance($options); - - foreach ($handler->getReferenceableEntities($keyword, $settings['match'], $settings['suggestion_size']) as $suggested_entities) { - foreach ($suggested_entities as $entity_id => $entity_label) { - $suggestions[] = [ - 'entity_id' => $entity_id, - 'entity_label' => $entity_label, - 'wording' => $entity_label, - ]; - if ($settings['suggest_only_unique']) { - $suggested_entity_ids[] = $entity_id; - } - } - } - - if (count($suggestions) < $settings['suggestion_size']) { - foreach ($this->behaviorService->getSynonymConfigEntities('synonyms.behavior.autocomplete', $settings['target_type'], $target_bundles) as $behavior_service) { - $plugin_instance = $behavior_service->getProviderPluginInstance(); - - $condition = new Condition('AND'); - switch ($settings['match']) { - case 'CONTAINS': - $condition->condition(SynonymsFindProviderInterface::COLUMN_SYNONYM_PLACEHOLDER, '%' . $this->database->escapeLike($keyword) . '%', 'LIKE'); - break; - - case 'STARTS_WITH': - $condition->condition(SynonymsFindProviderInterface::COLUMN_SYNONYM_PLACEHOLDER, $this->database->escapeLike($keyword) . '%', 'LIKE'); - break; - } - - if (!empty($suggested_entity_ids)) { - $condition->condition(SynonymsFindProviderInterface::COLUMN_ENTITY_ID_PLACEHOLDER, $suggested_entity_ids, 'NOT IN'); - } - - - foreach ($plugin_instance->synonymsFind($condition) as $row) { - if (!in_array($row->entity_id, $suggested_entity_ids)) { - $suggestions[] = [ - 'entity_id' => $row->entity_id, - 'entity_label' => NULL, - 'synonym' => $row->synonym, - 'synonym_config_entity' => $behavior_service, - 'wording' => NULL, - ]; - } - - if ($settings['suggest_only_unique']) { - $suggested_entity_ids[] = $row->entity_id; - } - - if (count($suggestions) == $settings['suggestion_size']) { - break(2); - } - } - } - } - - $ids = []; - foreach ($suggestions as $suggestion) { - if (!$suggestion['entity_label']) { - $ids[] = $suggestion['entity_id']; - } - } - $ids = array_unique($ids); - - if (!empty($ids)) { - $entities = $this->entityTypeManager->getStorage($settings['target_type']) - ->loadMultiple($ids); - - foreach ($suggestions as $k => $suggestion) { - if (!$suggestion['entity_label']) { - $suggestions[$k]['entity_label'] = $entities[$suggestion['entity_id']]->label(); - $suggestions[$k]['wording'] = $suggestion['synonym_config_entity']->getProviderPluginInstance()->synonymFormatWording($suggestion['synonym'], $entities[$suggestion['entity_id']], $suggestion['synonym_config_entity']); - } - } - } - } - - return $suggestions; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SelectService.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SelectService.php deleted file mode 100644 index ca04eb0e4..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SelectService.php +++ /dev/null @@ -1,157 +0,0 @@ -behaviorService = $behavior_service; - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state, array $configuration, SynonymInterface $synonym_config) { - $replacements = [ - '#theme' => 'item_list', - '#list_type' => 'ul', - '#items' => [], - ]; - foreach ($synonym_config->getProviderPluginInstance()->formatWordingAvailableTokens() as $token => $token_info) { - $replacements['#items'][] = Html::escape($token) . ': ' . $token_info; - } - - $replacements = $this->renderer->renderRoot($replacements); - - $form['wording'] = [ - '#type' => 'textfield', - '#title' => $this->t('Wording for select entry'), - '#default_value' => $configuration['wording'], - '#description' => $this->t('Specify the wording with which the select entry should be presented. Available replacement tokens are: @replacements', [ - '@replacements' => $replacements, - ]), - '#required' => TRUE, - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateConfigurationForm(array &$form, FormStateInterface $form_state, SynonymInterface $synonym_config) { - } - - /** - * {@inheritdoc} - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state, SynonymInterface $synonym_config) { - return [ - 'wording' => $form_state->getValue('wording'), - ]; - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Select'); - } - - /** - * {@inheritdoc} - */ - public function getRequiredInterfaces() { - return [ - SynonymsGetProviderInterface::class, - SynonymsFormatWordingProviderInterface::class, - ]; - } - - /** - * Extract a list of synonyms from an entity. - * - * @param ContentEntityInterface $entity - * Entity from which to extract the synonyms - * - * @return array - * Array of synonyms. Each sub array will have the following structure: - * - synonym: (string) Synonym itself - * - wording: (string) Formatted wording with which this synonym should be - * presented to the end user - */ - public function getSynonyms(ContentEntityInterface $entity) { - $synonyms = $this->getSynonymsMultiple([$entity->id() => $entity]); - return $synonyms[$entity->id()]; - } - - /** - * Extract a list of synonyms from multiple entities. - * - * @param ContentEntityInterface[] $entities - * Array of entities from which to extract the synonyms. It should be keyed - * by entity ID and may only contain entities of the same type and bundle - * - * @return array - * Array of synonyms. The returned array will be keyed by entity ID and the - * inner array will have the following structure: - * - synonym: (string) Synonym itself - * - wording: (string) Formatted wording with which this synonym should be - * presented to the end user - */ - public function getSynonymsMultiple(array $entities) { - if (empty($entities)) { - return []; - } - - $synonym_configs = $this->behaviorService->getSynonymConfigEntities('synonyms.behavior.select', reset($entities)->getEntityTypeId(), reset($entities)->bundle()); - - $synonyms = []; - foreach ($entities as $entity) { - $synonyms[$entity->id()] = []; - } - - foreach ($synonym_configs as $synonym_config) { - foreach ($synonym_config->getProviderPluginInstance()->getSynonymsMultiple($entities, $synonym_config->getBehaviorConfiguration()) as $entity_id => $entity_synonyms) { - foreach ($entity_synonyms as $entity_synonym) { - $synonyms[$entity_id][] = [ - 'synonym' => $entity_synonym, - 'wording' => $synonym_config->getProviderPluginInstance()->synonymFormatWording($entity_synonym, $entities[$entity_id], $synonym_config), - ]; - } - } - } - - return $synonyms; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SynonymsBehaviorConfigurableInterface.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SynonymsBehaviorConfigurableInterface.php deleted file mode 100644 index f5fcc59bd..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/Behavior/SynonymsBehaviorConfigurableInterface.php +++ /dev/null @@ -1,65 +0,0 @@ -behaviorServices = []; - - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager') - ); - } - - /** - * Add a new discovered behavior service. - * - * @param SynonymsBehaviorInterface $behavior_service - * Behavior service object that was discovered and should be added into the - * list of known ones - * @param string $id - * Service ID that corresponds to this behavior service - */ - public function addBehaviorService(SynonymsBehaviorInterface $behavior_service, $id) { - if (!isset($this->behaviorServices[$id])) { - $this->behaviorServices[$id] = [ - 'service' => $behavior_service, - 'required_interfaces' => [], - ]; - } - $this->behaviorServices[$id]['required_interfaces'] = $behavior_service->getRequiredInterfaces(); - } - - /** - * Array of known synonyms behavior service. - * - * @return array - */ - public function getBehaviorServices() { - return $this->behaviorServices; - } - - /** - * Get a synonyms behavior service. - * - * @param string $behavior_service_id - * ID of the service to retrieve - * - * @return array - * Array of information about the behavior service. The array will have the - * following structure: - * - service: (SynonymsBehaviorInterface) Initiated behavior service - * - required_interfaces: (array) Array of PHP interfaces it requires - */ - public function getBehaviorService($behavior_service_id) { - return isset($this->behaviorServices[$behavior_service_id]) ? $this->behaviorServices[$behavior_service_id] : NULL; - } - - /** - * Get a list of behavior services that require a given interface. - * - * @param string $interface - * Full name of the interface - * - * @return array - * The return structure of this method is identical of the return structure - * of static::getBehaviorServices() - */ - public function getBehaviorServicesWithInterface($interface) { - $return = []; - - foreach ($this->getBehaviorServices() as $service_id => $service) { - if (in_array($interface, $service['required_interfaces'])) { - $return[$service_id] = $service; - } - } - - return $return; - } - - /** - * Get a list of enabled synonym providers for a requested synonyms behavior. - * - * @param string $synonyms_behavior - * ID of the synonyms behavior services whose enabled providers should be - * returned - * @param string $entity_type - * Entity type for which to conduct the search - * @param string|array $bundle - * Single bundle or an array of them for which to conduct the search. If - * null is given, then no restrictions are applied on bundle level - * - * @return Synonym[] - */ - public function getSynonymConfigEntities($synonyms_behavior, $entity_type, $bundle) { - $entities = []; - - if (is_scalar($bundle) && !is_null($bundle)) { - $bundle = [$bundle]; - } - - foreach ($this->entityTypeManager->getStorage('synonym')->loadMultiple() as $entity) { - $provider_instance = $entity->getProviderPluginInstance(); - $provider_definition = $provider_instance->getPluginDefinition(); - if ($provider_definition['synonyms_behavior_service'] == $synonyms_behavior && $provider_definition['controlled_entity_type'] == $entity_type && (!is_array($bundle) || in_array($provider_definition['controlled_bundle'], $bundle))) { - $entities[] = $entity; - } - } - - return $entities; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/EntityGet.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/EntityGet.php deleted file mode 100644 index 0638d07bd..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/EntityGet.php +++ /dev/null @@ -1,79 +0,0 @@ -synonymsFindService = $synonyms_find_service; - $this->entityTypeManager = $entity_type_manager; - $this->queryFactory = $query_factory; - } - - /** - * Try finding an entity by its name or synonym. - * - * @param EntityTypeInterface $entity_type - * What entity type is being searched - * @param string $name - * The look up keyword (the supposed name or synonym) - * @param string $bundle - * Optionally limit the search within a specific bundle name of the provided - * entity type - * - * @return int - * ID of the looked up entity. If such entity was not found, then 0 is - * returned - */ - public function entityGetBySynonym(EntityTypeInterface $entity_type, $name, $bundle = NULL) { - if ($entity_type->id() == 'user' || $entity_type->hasKey('label')) { - $label_column = $entity_type->id() == 'user' ? 'name' : $entity_type->getKey('label'); - $query = $this->queryFactory->get($entity_type->id()); - $query->condition($label_column, $name); - if ($entity_type->hasKey('bundle') && $bundle) { - $query->condition($entity_type->getKey('bundle'), $bundle); - } - - $result = $query->execute(); - $result = reset($result); - if ($result) { - return $result; - } - } - - $condition = new Condition('AND'); - $condition->condition(SynonymsFindProviderInterface::COLUMN_SYNONYM_PLACEHOLDER, $name); - - $synonyms_found = $this->synonymsFindService->synonymsFind($condition, $entity_type, $bundle, '*'); - if (isset($synonyms_found[0]->entity_id)) { - return $synonyms_found[0]->entity_id; - } - - return 0; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/FieldTypeToSynonyms.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/FieldTypeToSynonyms.php deleted file mode 100644 index a1708509f..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/FieldTypeToSynonyms.php +++ /dev/null @@ -1,44 +0,0 @@ -moduleHandler = $module_handler; - } - - /** - * Map field types to the properties within them where synonyms are stored. - * - * @return array - * Map where keys are simple field types and values are the properties where - * the corresponding field type keeps the synonyms - */ - public function getSimpleFieldTypeToPropertyMap() { - $map = [ - 'integer' => 'value', - 'float' => 'value', - 'decimal' => 'value', - 'string' => 'value', - 'email' => 'value', - 'telephone' => 'value', - ]; - $this->moduleHandler->alter('synonyms_field_type_to_synonym', $map); - return $map; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/SynonymsFind.php b/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/SynonymsFind.php deleted file mode 100644 index 2246f2e77..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/src/SynonymsService/SynonymsFind.php +++ /dev/null @@ -1,84 +0,0 @@ -behaviorService = $behavior_service; - $this->entityTypeBundleInfo = $entity_type_bundle_info; - } - - /** - * Lookup entity IDs by the $condition. - * - * @param Condition $condition - * Condition which defines what to search for - * @param EntityTypeInterface $entity_type - * Entity type within which to search - * @param string|array $bundle - * Either single bundle string or array of such within which to search. NULL - * stands for no filtering by bundle, i.e. searching among all bundles - * @param string|array $service_id - * Either a single behavior service ID or an array of them within which to - * execute the lookup. You may also use the wildcard * to search among all - * supported behaviors - * - * @return array - * Array of looked up synonyms/entities. Each element in this array will be - * an object with the following structure: - * - synonym: (string) synonym that was looked up - * - entity_id: (int) ID of the entity which this synonym belongs to - */ - public function synonymsFind(Condition $condition, EntityTypeInterface $entity_type, $bundle = NULL, $service_id = 'synonyms.behavior.autocomplete') { - if (!$entity_type->getKey('bundle')) { - $bundle = $entity_type->id(); - } - - $lookup = []; - - if ($service_id == '*') { - $service_id = array_keys($this->behaviorService->getBehaviorServicesWithInterface(SynonymsFindProviderInterface::class)); - } - - if (!is_array($service_id)) { - $service_id = [$service_id]; - } - - if (is_null($bundle)) { - $bundle = array_keys($this->entityTypeBundleInfo->getBundleInfo($entity_type->id())); - } - - foreach ($service_id as $service_id_value) { - foreach ($this->behaviorService->getSynonymConfigEntities($service_id_value, $entity_type->id(), $bundle) as $synonym_config) { - foreach ($synonym_config->getProviderPluginInstance()->synonymsFind(clone $condition) as $synonym) { - $lookup[] = $synonym; - } - } - } - - return $lookup; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.api.php b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.api.php deleted file mode 100644 index 388659292..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.api.php +++ /dev/null @@ -1,30 +0,0 @@ -=8.2) - -# Information added by Drupal.org packaging script on 2018-10-21 -version: '8.x-1.0-alpha1+5-dev' -core: '8.x' -project: 'synonyms' -datestamp: 1540141684 diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.action.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.action.yml deleted file mode 100644 index 00f6cb2b1..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -entity.synonym.entity_type.bundle.behavior.add_form: - route_name: 'entity.synonym.entity_type.bundle.behavior.add_form' - title: 'Add synonym configuration' - appears_on: - - entity.synonym.overview.entity_type.bundle.behavior diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.menu.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.menu.yml deleted file mode 100644 index da3f4ed76..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -synonyms.configure: - title: 'Synonyms' - route_name: entity.synonym.overview - description: 'Manage entity synonyms.' - parent: system.admin_structure diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.module b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.module deleted file mode 100644 index 4e0298593..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.module +++ /dev/null @@ -1,47 +0,0 @@ -setLabel(t('Entity synonyms')) - ->setDescription(t('A list of known entity synonyms.')) - ->setComputed(TRUE) - ->setClass('\Drupal\synonyms\Plugin\SynonymsFieldItemList'); - - return $fields; - } -} - -/** - * Implements hook_views_data(). - */ -function synonyms_views_data() { - $data = []; - - foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type) { - if ($entity_type instanceof \Drupal\Core\Entity\ContentEntityTypeInterface && $entity_type->getBaseTable() && $entity_type->getKey('id')) { - $data[$entity_type->getBaseTable()]['synonyms'] = [ - 'title' => t('Synonyms of @entity_type', [ - '@entity_type' => $entity_type->getLowercaseLabel(), - ]), - 'filter' => [ - 'id' => 'synonyms_entity', - 'real field' => $entity_type->getKey('id'), - 'entity_type' => $entity_type->id(), - ], - ]; - } - } - - return $data; -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.permissions.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.permissions.yml deleted file mode 100644 index ace7fe85c..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.permissions.yml +++ /dev/null @@ -1,7 +0,0 @@ -administer synonyms: - title: 'Administer synonyms' - description: 'Administer synonyms of entities.' - -access synonyms entity autocomplete: - title: 'Access synonyms entity autocomplete' - description: 'Access synonyms-friendly entity autocomplete' diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.routing.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.routing.yml deleted file mode 100644 index 76bb331c9..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.routing.yml +++ /dev/null @@ -1,63 +0,0 @@ -entity.synonym.overview: - path: '/admin/structure/synonyms' - defaults: - _controller: 'Drupal\synonyms\Controller\SynonymConfigController::overview' - _title: 'Synonyms' - requirements: - _permission: 'administer synonyms' - -entity.synonym.overview.entity_type.bundle.behavior: - path: '/admin/structure/synonyms/{synonyms_entity_type}/{bundle}/{synonyms_behavior_service}' - options: - parameters: - synonyms_entity_type: - type: synonyms_entity_type - synonyms_behavior_service: - type: synonyms_behavior_service - defaults: - _controller: 'Drupal\synonyms\Controller\SynonymConfigController::overviewEntityTypeBundle' - _title: 'Synonyms' - _title_callback: 'Drupal\synonyms\Controller\SynonymConfigController::overviewEntityTypeBundleTitle' - requirements: - _permission: 'administer synonyms' - -entity.synonym.entity_type.bundle.behavior.add_form: - path: '/admin/structure/synonyms/{synonyms_entity_type}/{bundle}/{synonyms_behavior_service}/add' - options: - parameters: - synonyms_entity_type: - type: synonyms_entity_type - synonyms_behavior_service: - type: synonyms_behavior_service - defaults: - _entity_form: 'synonym.add' - _title: 'Add synonym configuration' - requirements: - _permission: 'administer synonyms' - -entity.synonym.edit_form: - path: '/admin/structure/synonyms/{synonym}' - defaults: - _entity_form: 'synonym.edit' - _title: 'Edit synonym configuration' - requirements: - _permission: 'administer synonyms' - -entity.synonym.delete_form: - path: '/admin/structure/synonyms/{synonym}/delete' - defaults: - _entity_form: 'synonym.delete' - _title: 'Delete synonym configuration' - requirements: - _permission: 'administer synonyms' - -synonyms.entity_autocomplete: - path: '/synonyms/entity/autocomplete/{target_type}/{token}' - options: - parameters: - target_type: - type: synonyms_entity_type - defaults: - _controller: 'Drupal\synonyms\Controller\EntityAutocomplete::autocomplete' - requirements: - _permission: 'access synonyms entity autocomplete' diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.services.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms.services.yml deleted file mode 100644 index fb5224816..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms.services.yml +++ /dev/null @@ -1,46 +0,0 @@ -services: - plugin.manager.synonyms_provider: - class: Drupal\synonyms\SynonymsProviderPluginManager - parent: default_plugin_manager - - synonyms.behaviors: - class: Drupal\synonyms\SynonymsService\BehaviorService - tags: - - { name: service_collector, tag: synonyms_behavior, call: addBehaviorService } - arguments: [ '@entity_type.manager' ] - - synonyms.provider.field_type_to_synonyms: - class: Drupal\synonyms\SynonymsService\FieldTypeToSynonyms - arguments: [ '@module_handler' ] - - synonyms.synonyms_find: - class: Drupal\synonyms\SynonymsService\SynonymsFind - arguments: [ '@synonyms.behaviors', '@entity_type.bundle.info' ] - - synonyms.synonyms_entity_get: - class: Drupal\synonyms\SynonymsService\EntityGet - arguments: [ '@synonyms.synonyms_find', '@entity_type.manager', '@entity.query' ] - - synonyms.behavior.autocomplete: - class: Drupal\synonyms\SynonymsService\Behavior\AutocompleteService - arguments: [ '@keyvalue', '@plugin.manager.entity_reference_selection', '@synonyms.behaviors', '@database', '@entity_type.manager', '@renderer' ] - tags: - - { name: synonyms_behavior } - - synonyms.behavior.select: - class: Drupal\synonyms\SynonymsService\Behavior\SelectService - arguments: [ '@synonyms.behaviors', '@renderer' ] - tags: - - { name: synonyms_behavior } - - synonyms.param_converter.entity_type: - class: Drupal\synonyms\ParamConverter\EntityTypeParamConverter - tags: - - { name: paramconverter } - arguments: [ '@entity_type.manager' ] - - synonyms.param_converter.synonyms_behavior: - class: Drupal\synonyms\ParamConverter\SynonymsBehaviorServiceParamConverter - tags: - - { name: paramconverter } - arguments: [ '@synonyms.behaviors' ] diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/src/SynonymsService/Behavior/SearchService.php b/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/src/SynonymsService/Behavior/SearchService.php deleted file mode 100644 index bf52c1a5a..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/src/SynonymsService/Behavior/SearchService.php +++ /dev/null @@ -1,194 +0,0 @@ -entityFieldManager = $entity_field_manager; - $this->entityTypeManager = $entity_type_manager; - $this->behaviorService = $behavior_service; - $this->queryFactory = $query_factory; - $this->database = $database; - $this->time = $time; - } - - /** - * Implementation of hook_entity_view(). - */ - public function entityView(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) { - if ($entity instanceof ContentEntityInterface && $view_mode == 'search_index') { - $synonyms = []; - $cacheable_metadata = new CacheableMetadata(); - - $entity_references = array_filter($this->entityFieldManager->getFieldDefinitions($entity->getEntityTypeId(), $entity->bundle()), function($item) { - if ($item->getType() == 'entity_reference') { - $target_entity_type = $this->entityTypeManager->getDefinition($item->getSetting('target_type')); - return $target_entity_type instanceof ContentEntityTypeInterface; - } - return FALSE; - }); - foreach ($entity_references as $entity_reference) { - foreach ($entity->get($entity_reference->getName())->referencedEntities() as $target_entity) { - $synonyms = array_merge($synonyms, $this->getEntitySynonyms($target_entity)); - $cacheable_metadata->addCacheableDependency($target_entity); - - // Depend on the synonyms configs for this entity type + bundle. - $cacheable_metadata->addCacheTags([Synonym::cacheTagConstruct(self::behavior, $target_entity->getEntityTypeId(), $target_entity->bundle())]); - } - } - - $build['synonyms_search'] = [ - '#markup' => implode(', ', $synonyms), - ]; - $cacheable_metadata->applyTo($build['synonyms_search']); - } - } - - /** - * Mark all search index dependent on a given entity for reindexing. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * Entity whose dependent search index should be marked for reindexing - */ - public function entityMarkForReindex(ContentEntityInterface $entity) { - $this->entityMarkForReindexMultiple([$entity->id()], $entity->getEntityTypeId()); - } - - /** - * Mark all search index dependent on given entities for reindexing. - * - * @param array $entity_ids - * Entity IDs whose dependent search index should be marked for reindexing - * @param string $entity_type - * Entity type of the give entity IDs - */ - public function entityMarkForReindexMultiple($entity_ids, $entity_type) { - if (empty($entity_ids)) { - return; - } - - $map = $this->entityFieldManager->getFieldMapByFieldType('entity_reference'); - foreach ($map as $host_entity_type => $fields) { - foreach ($fields as $field_name => $field_info) { - $field = FieldStorageConfig::loadByName($host_entity_type, $field_name); - if ($field && $field->getSetting('target_type') == $entity_type) { - $query = $this->queryFactory->get($host_entity_type, 'AND'); - $query->condition($field_name, $entity_ids, 'IN'); - $result = $query->execute(); - - // For the sake of performance we do a direct query on the - // {search_dataset} table instead of using search_mark_for_reindex() - // function. - // TODO: is there any smarter way to generate search type rather then - // adding suffix of '_search'? - if (!empty($result)) { - $this->database->update('search_dataset') - ->fields(['reindex' => $this->time->getRequestTime()]) - ->condition('reindex', 0) - ->condition('type', $host_entity_type . '_search') - ->condition('sid', array_values($result), 'IN') - ->execute(); - } - } - } - } - } - - /** - * {@inheritdoc} - */ - public function getTitle() { - return $this->t('Search'); - } - - /** - * {@inheritdoc} - */ - public function getRequiredInterfaces() { - return [ - SynonymsGetProviderInterface::class, - ]; - } - - /** - * Retrieve a list of synonyms from a given entity. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * - * @return string[] - * A list of synonyms of a given entity - */ - protected function getEntitySynonyms(ContentEntityInterface $entity) { - $synonyms = []; - - foreach ($this->behaviorService->getSynonymConfigEntities('synonyms.behavior.search', $entity->getEntityTypeId(), $entity->bundle()) as $synonym_config) { - $synonyms = array_merge($synonyms, $synonym_config->getProviderPluginInstance()->getSynonyms($entity)); - } - - return $synonyms; - } - -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.info.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.info.yml deleted file mode 100644 index 01b4e0878..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Synonyms Search -description: Integrates Synonyms with core Search module. -package: Synonyms -type: module -# core: 8.x -dependencies: - - synonyms - - search - -# Information added by Drupal.org packaging script on 2018-10-21 -version: '8.x-1.0-alpha1+5-dev' -core: '8.x' -project: 'synonyms' -datestamp: 1540141684 diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.module b/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.module deleted file mode 100644 index 1b4d6b698..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.module +++ /dev/null @@ -1,69 +0,0 @@ -entityView($build, $entity, $display, $view_mode); -} - -/** - * Implements hook_entity_update(). - */ -function synonyms_search_entity_update(Drupal\Core\Entity\EntityInterface $entity) { - if ($entity instanceof \Drupal\Core\Entity\ContentEntityInterface) { - \Drupal::service('synonyms.behavior.search')->entityMarkForReindex($entity); - } -} - -/** - * Implements hook_entity_delete(). - */ -function synonyms_search_entity_delete(Drupal\Core\Entity\EntityInterface $entity) { - if ($entity instanceof \Drupal\Core\Entity\ContentEntityInterface) { - \Drupal::service('synonyms.behavior.search')->entityMarkForReindex($entity); - } -} - -/** - * Implements hook_ENTITY_TYPE_insert(). - */ -function synonyms_search_synonym_insert(Drupal\Core\Entity\EntityInterface $entity) { - synonyms_search_synonym_reindex($entity); -} - -/** - * Implements hook_ENTITY_TYPE_update(). - */ -function synonyms_search_synonym_update(Drupal\Core\Entity\EntityInterface $entity) { - synonyms_search_synonym_reindex($entity); -} - -/** - * Implements hook_ENTITY_TYPE_delete(). - */ -function synonyms_search_synonym_delete(Drupal\Core\Entity\EntityInterface $entity) { - synonyms_search_synonym_reindex($entity); -} - -/** - * Mark all search index dependent on a given synonym config for reindexing. - * - * @param \Drupal\synonyms\SynonymInterface $synonym - * Synonym config whose dependent search index should be marked for reindexing - */ -function synonyms_search_synonym_reindex(\Drupal\synonyms\SynonymInterface $synonym) { - if ($synonym->get('behavior') == 'synonyms.behavior.search') { - $entity_type = \Drupal::entityTypeManager()->getDefinition($synonym->getProviderPluginInstance()->getPluginDefinition()['controlled_entity_type']); - $bundle = $synonym->getProviderPluginInstance()->getPluginDefinition()['controlled_bundle']; - $query = \Drupal::entityQuery($entity_type->id()); - $query->condition($entity_type->getKey('bundle'), $bundle); - $result = $query->execute(); - \Drupal::service('synonyms.behavior.search')->entityMarkForReindexMultiple(array_values($result), $entity_type->id()); - } -} diff --git a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.services.yml b/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.services.yml deleted file mode 100644 index 6bd2d8674..000000000 --- a/sites/all/modules/contrib/taxonomy/synonyms/synonyms_search/synonyms_search.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - synonyms.behavior.search: - class: Drupal\synonyms_search\SynonymsService\Behavior\SearchService - arguments: [ '@entity_field.manager', '@entity_type.manager', '@synonyms.behaviors', '@entity.query', '@database', '@datetime.time' ] - tags: - - { name: synonyms_behavior } diff --git a/sites/all/modules/contrib/theme/extlink/LICENSE.txt b/sites/all/modules/contrib/theme/extlink/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/theme/extlink/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/theme/extlink/README.txt b/sites/all/modules/contrib/theme/extlink/README.txt deleted file mode 100644 index 8b44719e6..000000000 --- a/sites/all/modules/contrib/theme/extlink/README.txt +++ /dev/null @@ -1,37 +0,0 @@ -The External Links module is a very simple approach to adding icons to links -to external websites or e-mail addresses. It is a JavaScript-based -implementation, so the icons are only shown to users that have JavaScript -enabled. - -External Links was written by Nathan Haug. -Built by Robots: http://www.lullabot.com - -Install -------- -Simply install External Links like you would install any other module. - -1) Copy the extlink folder in the modules folder in your Drupal docroot. - -2) Enable the module using Manage -> Extend (/admin/modules). - -3) No additional configuration is necessary though you may fine-tune settings at - Manage -> Configuration -> External Links (/admin/config/user-interface/extlink). - -A note about the CSS --------------------- -This module adds a CSS file that is only a few lines in length. You may choose -to move this CSS to your theme to prevent the file from needing to be loaded -separately. To do this: - -1) Open the .info.yml file for your theme and add those lines of code to prevent - the extlink.css file from loading: - - stylesheets-remove: - - extlink.css - -2) Open the extlink.css file within the extlink directory and copy all the code - from the file into your theme's style.css file. -3) Copy the extlink.png and mailto.png files to your theme's directory. - -Note that you DO NOT need to make an extlink.css file. Specifying the file in the -.info.yml file is enough to tell Drupal not to load the original file. diff --git a/sites/all/modules/contrib/theme/extlink/config/extlink.settings.yml b/sites/all/modules/contrib/theme/extlink/config/extlink.settings.yml deleted file mode 100644 index 1a650813c..000000000 --- a/sites/all/modules/contrib/theme/extlink/config/extlink.settings.yml +++ /dev/null @@ -1,8 +0,0 @@ -extlink_target: 0 -extlink_subdomains: 1 -extlink_alert: 0 -extlink_alert_text: 'This link will take you to an external web site. We are not responsible for their content.' -extlink_exclude: '' -extlink_include: '' -extlink_class: 'ext' -extlink_mailto_class: 'mailto' \ No newline at end of file diff --git a/sites/all/modules/contrib/theme/extlink/config/schema/extlink.schema.yml b/sites/all/modules/contrib/theme/extlink/config/schema/extlink.schema.yml deleted file mode 100644 index 08fe220cb..000000000 --- a/sites/all/modules/contrib/theme/extlink/config/schema/extlink.schema.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Schema for the configuration files of the exlink module. - -extlink.settings: - type: mapping - label: 'External Links Settings' - mapping: - extlink_target: - type: boolean - label: 'Open external links in a new window' - extlink_subdomains: - type: boolean - label: 'Consider subdomains internal' - extlink_alert: - type: boolean - label: 'Enable Pop-up warnings' - extlink_alert_text: - type: string - label: 'Message to display when Pop-up warning is shown' - extlink_exclude: - type: string - label: 'Exclude links matching the pattern' - extlink_include: - type: string - label: 'Include links matching the pattern' - extlink_class: - type: string - label: 'Add icon to external links' - extlink_img_class: - type: boolean - label: 'Treat images wrapped in an anchor tag as external links' - extlink_css_exclude: - type: string - label: 'Comma-separated list of CSS selectors to exclude' - extlink_css_explicit: - type: string - label: 'Comma-separated list of CSS selectors to include' - extlink_mailto_class: - type: string - label: 'Add icon to mailto links' - diff --git a/sites/all/modules/contrib/theme/extlink/extlink.css b/sites/all/modules/contrib/theme/extlink/extlink.css deleted file mode 100644 index f912d8b8f..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.css +++ /dev/null @@ -1,22 +0,0 @@ -span.ext { - background: url(extlink_s.png) 2px center no-repeat; - width: 10px; - height: 10px; - padding-right: 12px; - text-decoration: none; -} -span.mailto { - background: url(extlink_s.png) -20px center no-repeat; - width: 10px; - height: 10px; - padding-right: 12px; - text-decoration: none; -} - -/* Hide the extra spans when printing. */ -@media print { - span.ext, span.mailto { - display: none; - padding: 0; - } -} diff --git a/sites/all/modules/contrib/theme/extlink/extlink.info.yml b/sites/all/modules/contrib/theme/extlink/extlink.info.yml deleted file mode 100644 index e70b4f818..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: External Links -type: module -description: Modify behavior and appearance of external links. -package: User interface -# version: 8.x -# core: 8.x -configure: extlink_admin.settings - -# Information added by Drupal.org packaging script on 2016-08-31 -version: '8.x-1.0-alpha2+8-dev' -core: '8.x' -project: 'extlink' -datestamp: 1472650450 diff --git a/sites/all/modules/contrib/theme/extlink/extlink.install b/sites/all/modules/contrib/theme/extlink/extlink.install deleted file mode 100644 index 92aa2bcc1..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.install +++ /dev/null @@ -1,21 +0,0 @@ -configure the External Links module for your site.', - ['@extlink_admin' => $url->toString()]), 'status'); - } -} diff --git a/sites/all/modules/contrib/theme/extlink/extlink.js b/sites/all/modules/contrib/theme/extlink/extlink.js deleted file mode 100644 index 5af9fccf0..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.js +++ /dev/null @@ -1,171 +0,0 @@ -(function ($, Drupal, drupalSettings) { - - "use strict"; - - Drupal.extlink = Drupal.extlink || {}; - - Drupal.extlink.attach = function (context, drupalSettings) { - if (!drupalSettings.data.hasOwnProperty('extlink')) { - return; - } - - // Strip the host name down, removing ports, subdomains, or www. - var pattern = /^(([^\/:]+?\.)*)([^\.:]{1,})((\.[a-z0-9]{1,253})*)(:[0-9]{1,5})?$/; - var host = window.location.host.replace(pattern, '$3$4'); - var subdomain = window.location.host.replace(pattern, '$1'); - - // Determine what subdomains are considered internal. - var subdomains; - if (drupalSettings.data.extlink.extSubdomains) { - subdomains = "([^/]*\\.)?"; - } - else if (subdomain === 'www.' || subdomain === '') { - subdomains = "(www\\.)?"; - } - else { - subdomains = subdomain.replace(".", "\\."); - } - - // Build regular expressions that define an internal link. - var internal_link = new RegExp("^https?://" + subdomains + host, "i"); - - // Extra internal link matching. - var extInclude = false; - if (drupalSettings.data.extlink.extInclude) { - extInclude = new RegExp(drupalSettings.data.extlink.extInclude.replace(/\\/, '\\'), "i"); - } - - // Extra external link matching. - var extExclude = false; - if (drupalSettings.data.extlink.extExclude) { - extExclude = new RegExp(drupalSettings.data.extlink.extExclude.replace(/\\/, '\\'), "i"); - } - - // Extra external link CSS selector exclusion. - var extCssExclude = false; - if (drupalSettings.data.extlink.extCssExclude) { - extCssExclude = drupalSettings.data.extlink.extCssExclude; - } - - // Extra external link CSS selector explicit. - var extCssExplicit = false; - if (drupalSettings.data.extlink.extCssExplicit) { - extCssExplicit = drupalSettings.data.extlink.extCssExplicit; - } - - // Find all links which are NOT internal and begin with http as opposed - // to ftp://, javascript:, etc. other kinds of links. - // When operating on the 'this' variable, the host has been appended to - // all links by the browser, even local ones. - // In jQuery 1.1 and higher, we'd use a filter method here, but it is not - // available in jQuery 1.0 (Drupal 5 default). - var external_links = []; - var mailto_links = []; - $("a:not(." + drupalSettings.data.extlink.extClass + ", ." + drupalSettings.data.extlink.mailtoClass + "), area:not(." + drupalSettings.data.extlink.extClass + ", ." + drupalSettings.data.extlink.mailtoClass + ")", context).each(function (el) { - try { - if (typeof this.href == 'string') { - var url = this.href.toLowerCase(); - } - // Handle SVG links (xlink:href). - else if (typeof this.href == 'object') { - var url = this.href.baseVal; - } - if (url.indexOf('http') === 0 - && ((!url.match(internal_link) && !(extExclude && url.match(extExclude))) || (extInclude && url.match(extInclude))) - && !(extCssExclude && $(this).parents(extCssExclude).length > 0) - && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { - external_links.push(this); - } - // Do not include area tags with begin with mailto: (this prohibits - // icons from being added to image-maps). - else if (this.tagName !== 'AREA' - && url.indexOf('mailto:') === 0 - && !(extCssExclude && $(this).parents(extCssExclude).length > 0) - && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { - mailto_links.push(this); - } - } - // IE7 throws errors often when dealing with irregular links, such as: - // Empty tags. - // example User:pass syntax. - catch (error) { - return false; - } - }); - - if (drupalSettings.data.extlink.extClass) { - Drupal.extlink.applyClassAndSpan(external_links, drupalSettings.data.extlink.extClass); - } - - if (drupalSettings.data.extlink.mailtoClass) { - Drupal.extlink.applyClassAndSpan(mailto_links, drupalSettings.data.extlink.mailtoClass); - } - - if (drupalSettings.data.extlink.extTarget) { - // Apply the target attribute to all links. - if(drupalSettings.data.extlink.extTarget){ - $(external_links).attr('target', '_blank'); - } - } - - Drupal.extlink = Drupal.extlink || {}; - - // Set up default click function for the external links popup. This should be - // overridden by modules wanting to alter the popup. - Drupal.extlink.popupClickHandler = Drupal.extlink.popupClickHandler || function () { - if (drupalSettings.data.extlink.extAlert) { - return confirm(drupalSettings.data.extlink.extAlertText); - } - }; - - $(external_links).click(function (e) { - return Drupal.extlink.popupClickHandler(e, this); - }); - }; - - /** - * Apply a class and a trailing to all links not containing images. - * - * @param links - * An array of DOM elements representing the links. - * @param class_name - * The class to apply to the links. - */ - Drupal.extlink.applyClassAndSpan = function (links, class_name) { - var $links_to_process; - if (drupalSettings.data.extlink.extImgClass) { - $links_to_process = $(links); - } - else { - var links_with_images = $(links).find('img').parents('a'); - $links_to_process = $(links).not(links_with_images); - } - $links_to_process.addClass(class_name); - var i; - var length = $links_to_process.length; - for (i = 0; i < length; i++) { - var $link = $($links_to_process[i]); - if ($link.css('display') === 'inline' || $link.css('display') === 'inline-block') { - if (class_name === drupalSettings.data.extlink.mailtoClass) { - $link.append(' ' + drupalSettings.data.extlink.mailtoLabel + ''); - } - else { - $link.append(' ' + drupalSettings.data.extlink.extLabel + ''); - } - } - } - }; - - Drupal.behaviors.extlink = Drupal.behaviors.extlink || {}; - Drupal.behaviors.extlink.attach = function (context, drupalSettings) { - // Backwards compatibility, for the benefit of modules overriding extlink - // functionality by defining an "extlinkAttach" global function. - if (typeof extlinkAttach === 'function') { - extlinkAttach(context); - } - else { - Drupal.extlink.attach(context, drupalSettings); - } - }; - -})(jQuery, Drupal, drupalSettings); diff --git a/sites/all/modules/contrib/theme/extlink/extlink.libraries.yml b/sites/all/modules/contrib/theme/extlink/extlink.libraries.yml deleted file mode 100644 index dae673e6c..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.libraries.yml +++ /dev/null @@ -1,12 +0,0 @@ -drupal.extlink: - version: VERSION - js: - extlink.min.js: {} - css: - theme: - extlink.css: { every_page: 1 } - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - core/jquery.once diff --git a/sites/all/modules/contrib/theme/extlink/extlink.links.menu.yml b/sites/all/modules/contrib/theme/extlink/extlink.links.menu.yml deleted file mode 100644 index 4392012c2..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -extlink_admin.settings: - title: External Links - description: 'External Links administration page.' - route_name: extlink_admin.settings - parent: system.admin_config_ui diff --git a/sites/all/modules/contrib/theme/extlink/extlink.min.js b/sites/all/modules/contrib/theme/extlink/extlink.min.js deleted file mode 100644 index c4d7aeaf9..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,a,e){"use strict";a.extlink=a.extlink||{},a.extlink.attach=function(e,n){if(n.data.hasOwnProperty("extlink")){var l,i=/^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/,s=window.location.host.replace(i,"$3$4"),x=window.location.host.replace(i,"$1");l=n.data.extlink.extSubdomains?"([^/]*\\.)?":"www."===x||""===x?"(www\\.)?":x.replace(".","\\.");var p=new RegExp("^https?://"+l+s,"i"),d=!1;n.data.extlink.extInclude&&(d=new RegExp(n.data.extlink.extInclude.replace(/\\/,"\\"),"i"));var r=!1;n.data.extlink.extExclude&&(r=new RegExp(n.data.extlink.extExclude.replace(/\\/,"\\"),"i"));var k=!1;n.data.extlink.extCssExclude&&(k=n.data.extlink.extCssExclude);var c=!1;n.data.extlink.extCssExplicit&&(c=n.data.extlink.extCssExplicit);var o=[],h=[];t("a:not(."+n.data.extlink.extClass+", ."+n.data.extlink.mailtoClass+"), area:not(."+n.data.extlink.extClass+", ."+n.data.extlink.mailtoClass+")",e).each(function(a){try{var e=this.href.toLowerCase();0!==e.indexOf("http")||(e.match(p)||r&&e.match(r))&&(!d||!e.match(d))||k&&t(this).parents(k).length>0||c&&t(this).parents(c).length<1?"AREA"===this.tagName||0!==e.indexOf("mailto:")||k&&t(this).parents(k).length>0||c&&t(this).parents(c).length<1||h.push(this):o.push(this)}catch(n){return!1}}),n.data.extlink.extClass&&a.extlink.applyClassAndSpan(o,n.data.extlink.extClass),n.data.extlink.mailtoClass&&a.extlink.applyClassAndSpan(h,n.data.extlink.mailtoClass),n.data.extlink.extTarget&&n.data.extlink.extTarget&&t(o).attr("target","_blank"),a.extlink=a.extlink||{},a.extlink.popupClickHandler=a.extlink.popupClickHandler||function(){return n.data.extlink.extAlert?confirm(n.data.extlink.extAlertText):void 0},t(o).click(function(t){return a.extlink.popupClickHandler(t)})}},a.extlink.applyClassAndSpan=function(a,n){var l;if(e.data.extlink.extImgClass)l=t(a);else{var i=t(a).find("img").parents("a");l=t(a).not(i)}l.addClass(n);var s,x=l.length;for(s=0;x>s;s++){var p=t(l[s]);("inline"===p.css("display")||"inline-block"===p.css("display"))&&(n===e.data.extlink.mailtoClass?p.append(' '+e.data.extlink.mailtoLabel+""):p.append(' '+e.data.extlink.extLabel+""))}},a.behaviors.extlink=a.behaviors.extlink||{},a.behaviors.extlink.attach=function(t,e){"function"==typeof extlinkAttach?extlinkAttach(t):a.extlink.attach(t,e)}}(jQuery,Drupal,drupalSettings); diff --git a/sites/all/modules/contrib/theme/extlink/extlink.module b/sites/all/modules/contrib/theme/extlink/extlink.module deleted file mode 100644 index 92d744467..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.module +++ /dev/null @@ -1,32 +0,0 @@ - $config->get('extlink_target', 0), - 'extClass' => $config->get('extlink_class', 'ext'), - 'extLabel' => Html::escape($config->get('extlink_label', t('(link is external)'))), - 'extImgClass' => $config->get('extlink_img_class', 0), - 'extSubdomains' => $config->get('extlink_subdomains', 1), - 'extExclude' => $config->get('extlink_exclude', ''), - 'extInclude' => $config->get('extlink_include', ''), - 'extCssExclude' => $config->get('extlink_css_exclude', ''), - 'extCssExplicit' => $config->get('extlink_css_explicit', ''), - 'extAlert' => $config->get('extlink_alert', 0), - 'extAlertText' => $config->get('extlink_alert_text', t('This link will take you to an external web site. We are not responsible for their content.')), - 'mailtoClass' => $config->get('extlink_mailto_class', 'mailto'), - 'mailtoLabel' => Html::escape($config->get('extlink_mailto_label', t('(link sends e-mail)'))), - ); -} diff --git a/sites/all/modules/contrib/theme/extlink/extlink.routing.yml b/sites/all/modules/contrib/theme/extlink/extlink.routing.yml deleted file mode 100644 index 63bd78df8..000000000 --- a/sites/all/modules/contrib/theme/extlink/extlink.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -extlink_admin.settings: - path: '/admin/config/user-interface/extlink' - defaults: - _form: '\Drupal\extlink\Form\ExtlinkAdminSettingsForm' - _title: 'External Links' - requirements: - _permission: 'administer site configuration' \ No newline at end of file diff --git a/sites/all/modules/contrib/theme/extlink/extlink_s.png b/sites/all/modules/contrib/theme/extlink/extlink_s.png deleted file mode 100644 index 778fb586c4789382e5b7b8a4192540dbf6668509..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^3P8-o!2%@fU8d**sRU0K#}JM4b0?kVWl-R7zFE&) zmZWYIVt0%~EAGM){Vg6Q-KKndr>oo)XAmxFuvzLay*7q%oAo?}_K92@qC}Zn_V7(K zz0{P(cH;I6y!Bqk8OynIwte{C%H};|?#YWrCtZPdF?hQAxvX 'checkbox', - '#title' => $this->t('Place an icon next to external links.'), - '#return_value' => 'ext', - '#default_value' => $config->get('extlink_class'), - '#description' => $this->t('Places an   icon next to external links.'), - ); - - $form['extlink_mailto_class'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Place an icon next to mailto links'), - '#return_value' => 'mailto', - '#default_value' => $config->get('extlink_mailto_class'), - '#description' => $this->t('Places an   icon next to mailto links.'), - ); - - $form['extlink_img_class'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Place an icon next to image links'), - '#return_value' => TRUE, - '#default_value' => $config->get('extlink_img_class', FALSE), - '#description' => $this->t('If checked, images wrapped in an anchor tag will be treated as external links.'), - ); - - $form['extlink_subdomains'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Exclude links with the same primary domain.'), - '#default_value' => $config->get('extlink_subdomains'), - '#description' => $this->t("For example, a link from 'www.example.com' to the subdomain of 'my.example.com' would be excluded."), - ); - - $form['extlink_target'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Open external links in a new window'), - '#return_value' => '_blank', - '#default_value' => $config->get('extlink_target'), - ); - - $form['extlink_alert'] = array( - '#type' => 'checkbox', - '#title' => $this->t('Display a pop-up warning when any external link is clicked.'), - '#return_value' => '_blank', - '#default_value' => $config->get('extlink_alert'), - ); - - $form['extlink_alert_text'] = array( - '#type' => 'textarea', - '#title' => $this->t('Text to display in the pop-up warning box.'), - '#rows' => 3, - '#default_value' => $config->get('extlink_alert_text'), - '#description' => $this->t('Text to display in the pop-up external link warning box.'), - '#wysiwyg' => FALSE, - '#states' => array( - // Only show this field when user opts to display a pop-up warning. - 'visible' => array( - ':input[name="extlink_alert"]' => array('checked' => TRUE), - ), - ), - ); - - $patterns = array( - '#theme' => 'item_list', - '#items' => array( - array('#markup' => '(example\.com) ' . $this->t('Matches example.com.')), - array('#markup' => '(example\.com)|(example\.net) ' . $this->t('Multiple patterns can be strung together by using a pipe. Matches example.com OR example.net.')), - array('#markup' => '(links/goto/[0-9]+/[0-9]+) ' . $this->t('Matches links that go through the Links module redirect.')), - ), - ); - - $wildcards = array( - '#theme' => 'item_list', - '#items' => array( - array('#markup' => '. ' . $this->t('Matches any character.')), - array('#markup' => '? ' . $this->t('The previous character or set is optional.')), - array('#markup' => '\d ' . $this->t('Matches any digit (0-9).')), - array('#markup' => '[a-z] ' . $this->t('Brackets may be used to match a custom set of characters. This matches any alphabetic letter.')), - ), - ); - - $form['patterns'] = array( - '#type' => 'details', - '#title' => $this->t('Pattern matching'), - '#description' => - '

        ' . $this->t('External links uses patterns (regular expressions) to match the "href" property of links.') . '

        ' . - $this->t('Here are some common patterns.') . - $renderer->render($patterns) . - $this->t('Common special characters:') . - $renderer->render($wildcards) . - '

        ' . $this->t('All special characters (@characters) must also be escaped with backslashes. Patterns are not case-sensitive. Any pattern supported by JavaScript may be used.', array('@characters' => '^ $ . ? ( ) | * +')) . '

        ', - '#open' => FALSE, - ); - - $form['patterns']['extlink_exclude'] = array( - '#type' => 'textfield', - '#title' => $this->t('Exclude links matching the pattern'), - '#maxlength' => NULL, - '#default_value' => $config->get('extlink_exclude'), - '#description' => $this->t('Enter a regular expression for links that you wish to exclude from being considered external.'), - ); - - $form['patterns']['extlink_include'] = array( - '#type' => 'textfield', - '#title' => $this->t('Include links matching the pattern'), - '#maxlength' => NULL, - '#default_value' => $config->get('extlink_include'), - '#description' => $this->t('Enter a regular expression for internal links that you wish to be considered external.'), - ); - - $form['css_matching'] = array( - '#tree' => FALSE, - '#type' => 'fieldset', - '#title' => $this->t('CSS Matching'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#description' => - '

        ' . $this->t('Use CSS selectors to exclude entirely or only look inside explicitly specified classes and IDs for external links. These will be passed straight to jQuery for matching.') . '

        ', - ); - - $form['css_matching']['extlink_css_exclude'] = array( - '#type' => 'textarea', - '#title' => $this->t('Exclude links inside these CSS selectors'), - '#maxlength' => NULL, - '#default_value' => $config->get('extlink_css_exclude', ''), - '#description' => $this->t('Enter a comma-separated list of CSS selectors (ie "#block-block-2 .content, ul.menu")'), - ); - - $form['css_matching']['extlink_css_explicit'] = array( - '#type' => 'textarea', - '#title' => $this->t('Only look for links inside these CSS selectors'), - '#maxlength' => NULL, - '#default_value' => $config->get('extlink_css_explicit', ''), - '#description' => $this->t('Enter a comma-separated list of CSS selectors (ie "#block-block-2 .content, ul.menu")'), - ); - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - parent::validateForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - - \Drupal::configFactory()->getEditable('extlink.settings') - ->set('extlink_include', $values['extlink_include']) - ->set('extlink_exclude', $values['extlink_exclude']) - ->set('extlink_alert_text', $values['extlink_alert_text']) - ->set('extlink_alert', $values['extlink_alert']) - ->set('extlink_target', $values['extlink_target']) - ->set('extlink_subdomains', $values['extlink_subdomains']) - ->set('extlink_mailto_class', $values['extlink_mailto_class']) - ->set('extlink_img_class', $values['extlink_img_class']) - ->set('extlink_class', $values['extlink_class']) - ->set('extlink_css_exclude', $values['extlink_css_exclude']) - ->set('extlink_css_explicit', $values['extlink_css_explicit']) - ->save(); - - parent::SubmitForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function getEditableConfigNames() { - return ['extlink.settings']; - } - -} diff --git a/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkAdminTest.php b/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkAdminTest.php deleted file mode 100644 index 9d4feb246..000000000 --- a/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkAdminTest.php +++ /dev/null @@ -1,26 +0,0 @@ -drupalLogin($this->normal_user); - $this->drupalGet(self::EXTLINK_ADMIN_PATH); - $this->assertText(t('Access denied'), 'Normal users should not be able to access the External Links admin pages', 'External Links'); - - $this->drupalLogin($this->admin_user); - $this->drupalGet(self::EXTLINK_ADMIN_PATH); - $this->assertNoText(t('Access denied'), 'Admin users should be able to access the External Links admin pages', 'External Links'); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTest.php b/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTest.php deleted file mode 100644 index 581b191cb..000000000 --- a/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTest.php +++ /dev/null @@ -1,18 +0,0 @@ -drupalGet(''); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTestBase.php b/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTestBase.php deleted file mode 100644 index 962d1ef47..000000000 --- a/sites/all/modules/contrib/theme/extlink/src/Tests/ExtlinkTestBase.php +++ /dev/null @@ -1,67 +0,0 @@ -normal_user = $this->drupalCreateUser($permissions); - - // Create an admin user. - $permissions[] = 'administer site configuration'; - $permissions[] = 'administer permissions'; - $this->admin_user = $this->drupalCreateUser($permissions); - } - - protected function getNodeFormValues() { - $edit = array( - 'title' => 'node_title ' . $this->randomName(32), - 'body[' . LANGUAGE_NONE . '][0][value]' => 'node_body ' . $this->randomName(256) . ' Google!', - ); - return $edit; - } - - /** - * Test if External Link is present - */ - protected function assertExternalLinkPresence() { - $elements = $this->xpath('//span[@class="ext"]'); - if (count($elements) > 0) - $this->pass('There should be an External Link on the form.', 'External Links'); - else - $this->fail('There should be an External Link on the form.', 'External Links'); - } -} \ No newline at end of file diff --git a/sites/all/modules/contrib/users/autologout/LICENSE.txt b/sites/all/modules/contrib/users/autologout/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/users/autologout/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/users/autologout/README.txt b/sites/all/modules/contrib/users/autologout/README.txt deleted file mode 100644 index 5b02eee2b..000000000 --- a/sites/all/modules/contrib/users/autologout/README.txt +++ /dev/null @@ -1,54 +0,0 @@ -CONTENTS OF THIS FILE ---------------------- - * Introduction - * Requirements - * Recommended Modules - * Installation - * Configuration - -INTRODUCTION ------------- -After a given timeout has passed, users are given a configurable session -expiration prompt. They can reset the timeout, logout, or ignore it, in which -case they'll be logged out after the padding time is elapsed. This is all backed -up by a server side logout if JS is disabled or bypassed. - -REQUIREMENTS ------------- -None. - -RECOMMENDED MODULES -------------------- - * Session Limit (https://www.drupal.org/project/session_limit) - * Password Policy (https://www.drupal.org/project/password_policy) - -INSTALLATION ------------- - * Install as usual: - See https://www.drupal.org/documentation/install/modules-themes/modules-8 - for further information. - -CONFIGURATION -------------- -* Configure permissions : Home >> Administration >> People - (/admin/people/permissions) -* Configure Automated logout : Home >> Administration >> Configuration >> People - (/admin/config/people/autologout) -* Configurable "Global timeout" and "Timeout padding". - The latter determines how much time a user has to respond to the prompt - and when the server side timeout will occur. -* Configurable messaging. -* Configurable "Redirect URL" with the destination automatically appended. -* Configure which roles will be automatically logged out. -* Configure if a logout will occur on admin pages. -* Integration with ui.dialog if available. - This makes for attractive and more functional dialogs. -* Configurable timeout based on user. -* Configurable maximum timeout. - Primarily used when a user has permission to change their timeout value, - this will be a cap or maximum value they can use. -* Order of precedence is : user timeout -> lowest role timeout -> global - timeout. -* So if a user has a user timeout set, that is their timeout threshold, - if none is set the lowest timeout value based on all the roles the user - belongs to is used, if none is set the global timeout is used. diff --git a/sites/all/modules/contrib/users/autologout/autologout.api.php b/sites/all/modules/contrib/users/autologout/autologout.api.php deleted file mode 100644 index aa99fdcf6..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.api.php +++ /dev/null @@ -1,49 +0,0 @@ -isAdminRoute(routeMatch()->getRouteObject()) && !\Drupal::config('autologout.settings')->get('enforce_admin')) { - return TRUE; - } -} diff --git a/sites/all/modules/contrib/users/autologout/autologout.info.yml b/sites/all/modules/contrib/users/autologout/autologout.info.yml deleted file mode 100644 index 3f8ec658a..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.info.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Automated Logout -type: module -description: 'Adds automated timed logout.' -# core: 8.x -configure: autologout.set_admin - -# Information added by Drupal.org packaging script on 2017-05-08 -version: '8.x-1.0' -core: '8.x' -project: 'autologout' -datestamp: 1494237191 diff --git a/sites/all/modules/contrib/users/autologout/autologout.install b/sites/all/modules/contrib/users/autologout/autologout.install deleted file mode 100644 index 800477b54..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.install +++ /dev/null @@ -1,31 +0,0 @@ -select('config', 'c') - ->fields('c', ['name', 'data']) - ->condition('name', 'autologout.user.%', 'LIKE') - ->execute()->fetchAll(); - if (!isset($sandbox['current'])) { - $sandbox['current'] = 0; - $sandbox['max'] = count($result); - } - $limit = 5; - $result = array_slice($result, $sandbox['current'], $limit); - foreach ($result as $row) { - $key = $row->name; - // User uid is a part of the key after. E.g. autologout.user.1 for user 1. - $user_id = (substr($key, 16)); - $data = unserialize($row->data); - \Drupal::service('user.data')->set('autologout', $user_id, 'timeout', $data['timeout']); - \Drupal::service('user.data')->set('autologout', $user_id, 'enabled', $data['enabled']); - $sandbox['current']++; - } - $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['current'] / $sandbox['max']); - if ($sandbox['#finished'] >= 1) { - return t('Autologout settings are successfully updated. Updated @users', ["@users" => $sandbox['max']]); - } -} diff --git a/sites/all/modules/contrib/users/autologout/autologout.libraries.yml b/sites/all/modules/contrib/users/autologout/autologout.libraries.yml deleted file mode 100644 index 78ae9d353..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.libraries.yml +++ /dev/null @@ -1,9 +0,0 @@ -drupal.autologout: - version: VERSION - js: - js/autologout.js: { weight: -2 } - - dependencies: - - core/drupal.dialog - - core/drupal.ajax - - core/drupalSettings diff --git a/sites/all/modules/contrib/users/autologout/autologout.links.menu.yml b/sites/all/modules/contrib/users/autologout/autologout.links.menu.yml deleted file mode 100644 index fe7f99a8d..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.links.menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -autologout.set_admin: - title: 'Automated logout settings' - parent: user.admin_index - description: 'Configure default automated logout settings.' - weight: -10 - route_name: autologout.set_admin diff --git a/sites/all/modules/contrib/users/autologout/autologout.module b/sites/all/modules/contrib/users/autologout/autologout.module deleted file mode 100644 index 1ae9daca3..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.module +++ /dev/null @@ -1,236 +0,0 @@ -getUserTimeout(); - $output = ''; - $output .= '

        ' . t('About') . '

        '; - $output .= '

        ' . t("This module allows you to force site users to be logged out after a given amount of time due to inactivity after first being presented with a confirmation dialog. Your current logout threshold is %seconds seconds.", ['%seconds' => $seconds]) . '

        '; - return $output; - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Adds a field to user/edit to change that users logout. - */ -function autologout_form_user_form_alter(&$form, FormStateInterface $form_state) { - $user = \Drupal::currentUser(); - $account = $form_state->getFormObject()->getEntity(); - $user_id = $account->id(); - $access = FALSE; - - // If user has access to change, and they are changing their own and only - // their own timeout. Or they are an admin. - if (!\Drupal::currentUser()->isAnonymous() && (($user->hasPermission('change own logout threshold') && $user->id() == $user_id) || $user->hasPermission('administer autologout'))) { - $access = TRUE; - $autologout_data = \Drupal::service('user.data')->get('autologout', $user_id, 'timeout'); - } - - if ($access) { - $form['user_' . $user_id] = [ - '#type' => 'textfield', - '#title' => t('Your current logout threshold'), - '#default_value' => isset($autologout_data) ? $autologout_data : '', - '#size' => 8, - '#description' => t('How many seconds to give a user to respond to the logout dialog before ending their session.'), - '#element_validate' => ['_autologout_user_uid_timeout_validate'], - ]; - - $form['actions']['submit']['#submit'][] = 'autologout_user_profile_submit'; - } -} - -/** - * Form validation. - */ -function _autologout_user_uid_timeout_validate($element, FormStateInterface $form_state) { - $max_timeout = \Drupal::config('autologout.settings')->get('max_timeout'); - $timeout = $element['#value']; - - // Set error if timeout isn't strictly a number between 60 and max. - if ($timeout != "" && ($timeout < 10 || ($timeout > 0 && $timeout < 60) || $timeout > $max_timeout || !is_numeric($timeout))) { - $form_state->setError($element, t('The timeout must be an integer greater than 60, and less then %max.', ['%max' => $max_timeout])); - } -} - -/** - * Handle submission of timeout threshold in user/edit. - */ -function autologout_user_profile_submit(&$form, FormStateInterface $form_state) { - $user_id = $form_state->getFormObject()->getEntity()->id(); - - $timeout = $form_state->getValue('user_' . $user_id); - $enabled = ($timeout != '') ? TRUE : FALSE; - - \Drupal::service('user.data')->set('autologout', $user_id, 'timeout', $timeout); -} - -/** - * Implements hook_autologout_prevent(). - */ -function autologout_autologout_prevent() { - $user = \Drupal::currentUser(); - - // Don't include autologout JS checks on ajax callbacks. - $paths = [ - 'system', - 'autologout_ajax_get_time_left', - 'autologout_ahah_logout', - 'autologout_ahah_set_last', - ]; - // getPath is used because Url::fromRoute('')->toString() doesn't - // give correct path for XHR request. - $url = \Drupal::service('path.current')->getPath(); - $path_args = explode('/', $url); - if (in_array($path_args[1], $paths)) { - return TRUE; - } - - // If user is anonymous or has no timeout set. - if ($user->id() == 0 || (!\Drupal::service('autologout.manager')->getUserTimeout())) { - return TRUE; - } - - // If the user has checked remember_me via the remember_me module. - $remember_me = \Drupal::service('user.data')->get('remember_me', $user->id(), 'remember_me'); - if (!empty($remember_me)) { - return TRUE; - } -} - -/** - * Implements hook_autologout_refresh_only(). - */ -function autologout_autologout_refresh_only() { - if (!\Drupal::config('autologout.settings')->get('enforce_admin') && \Drupal::service('router.admin_context')->isAdminRoute(\Drupal::routeMatch()->getRouteObject())) { - return TRUE; - } -} - -/** - * Implements hook_page_attachments(). - * - * Add a form element to every page which is used to detect if the page was - * loaded from browser cache. This happens when the browser's back button is - * pressed for example. The JS will set the value of the hidden input element - * to 1 after initial load. If this is 1 on subsequent loads, the page was - * loaded from cache and an autologout timeout refresh needs to be triggered. - */ -function autologout_page_attachments(array &$page) { - $autologout_manager = \Drupal::service('autologout.manager'); - - // Check if JS should be included on this request. - if ($autologout_manager->preventJs()) { - return; - } - - // Check if anything wants to be refresh only. This URL would include the - // javascript but will keep the login alive whilst that page is opened. - $refresh_only = $autologout_manager->refreshOnly(); - - $settings = \Drupal::config('autologout.settings'); - - $timeout = $autologout_manager->getUserTimeout(); - $timeout_padding = $settings->get('padding'); - $redirect_url = $settings->get('redirect_url'); - $redirect_query = \Drupal::service('redirect.destination')->getAsArray() + ['autologout_timeout' => 1]; - $no_dialog = $settings->get('no_dialog'); - $use_alt_logout_method = $settings->get('use_alt_logout_method'); - - // Get all settings JS will need for dialog. - $msg = t('@msg', ['@msg' => $settings->get('message')]); - $settings = [ - 'timeout' => $refresh_only ? ($timeout * 500) : ($timeout * 1000), - 'timeout_padding' => $timeout_padding * 1000, - 'message' => t('@msg', ['@msg' => $msg]), - 'redirect_url' => Url::fromUserInput($redirect_url, ['query' => $redirect_query])->toString(), - 'title' => t('@name Alert', ['@name' => \Drupal::config('system.site')->get('name')]), - 'refresh_only' => $refresh_only, - 'no_dialog' => $no_dialog, - 'use_alt_logout_method' => $use_alt_logout_method, - ]; - // If this is an AJAX request, then the logout redirect url should still be - // referring to the page that generated this request. - if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { - global $base_url; - $relative_url = str_replace($base_url . '/', '', $_SERVER['HTTP_REFERER']); - $settings['redirect_url'] = Url::fromUserInput($redirect_url, [ - 'query' => ['destination' => urlencode($relative_url)], - 'autologout_timeout' => 1, - ]); - } - - autologout_attach_js($page, $settings, TRUE); - -} - -/** - * Implements hook_page_bottom(). - */ -function autologout_page_bottom() { - if (!\Drupal::service('autologout.manager')->preventJs()) { - $page_bottom['autologout'] = [ - '#markup' => '
        ', - ]; - } -} - -/** - * Adds the necessary js and libraries. - * - * @param array $element - * The renderable array element to #attach the js to. - * @param array $settings - * The JS Settings. - */ -function autologout_attach_js(&$element, $settings) { - $element['#attached']['drupalSettings']['autologout'] = $settings; - $element['#attached']['library'][] = 'autologout/drupal.autologout'; -} - -/** - * Implements hook_user_login(). - * - * Delete stale sessions for the user on login. This stops - * session_limit module thinking the user has reached their - * session limit. - */ -function autologout_user_login($account) { - // Cleanup old sessions. - $timeout = \Drupal::service('autologout.manager')->getUserTimeout($account->id()); - - if (empty($timeout)) { - // Users that don't get logged have their sessions left. - return; - } - - $timeout_padding = \Drupal::config('autologout.settings')->get('padding'); - $timestamp = REQUEST_TIME - ($timeout + $timeout_padding); - - // Find all stale sessions. - $database = \Drupal::database(); - $sids = $database->select('sessions', 's') - ->fields('s', ['sid']) - ->condition('uid', $account->id()) - ->condition('timestamp', $timestamp, '<') - ->orderBy('timestamp', 'DESC') - ->execute() - ->fetchCol(); - - if (!empty($sids)) { - // Delete stale sessions at login. - $database->delete('sessions') - ->condition('sid', $sids, 'IN') - ->execute(); - } -} diff --git a/sites/all/modules/contrib/users/autologout/autologout.permissions.yml b/sites/all/modules/contrib/users/autologout/autologout.permissions.yml deleted file mode 100644 index 031fdde3d..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.permissions.yml +++ /dev/null @@ -1,4 +0,0 @@ -change own logout threshold: - title: 'Change own logout threshold' -administer autologout: - title: 'Administer Autologout' diff --git a/sites/all/modules/contrib/users/autologout/autologout.routing.yml b/sites/all/modules/contrib/users/autologout/autologout.routing.yml deleted file mode 100644 index 51860e937..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.routing.yml +++ /dev/null @@ -1,34 +0,0 @@ -autologout.set_admin: - path: '/admin/config/people/autologout' - defaults: - _form: '\Drupal\autologout\Form\AutologoutSettingsForm' - _title: 'Automated logout settings' - requirements: - _permission: 'administer autologout' - -autologout.ahah_logout: - path: '/autologout_ahah_logout' - defaults: - _controller: '\Drupal\autologout\Controller\AutologoutController::ahahLogout' - options: - _theme: ajax_base_page - requirements: - _user_is_logged_in: 'TRUE' - -autologout.ahah_set_last: - path: '/autologout_ahah_set_last' - defaults: - _controller: '\Drupal\autologout\Controller\AutologoutController::ahahSetLast' - options: - _theme: ajax_base_page - requirements: - _user_is_logged_in: 'TRUE' - -autologout.ajax_get_time_left: - path: '/autologout_ajax_get_time_left' - defaults: - _controller: '\Drupal\autologout\Controller\AutologoutController::ahahGetRemainingTime' - options: - _theme: ajax_base_page - requirements: - _user_is_logged_in: 'TRUE' diff --git a/sites/all/modules/contrib/users/autologout/autologout.services.yml b/sites/all/modules/contrib/users/autologout/autologout.services.yml deleted file mode 100644 index 1ed5e1703..000000000 --- a/sites/all/modules/contrib/users/autologout/autologout.services.yml +++ /dev/null @@ -1,12 +0,0 @@ -services: - autologout_event_subscriber: - class: Drupal\autologout\EventSubscriber\AutologoutSubscriber - tags: - - {name: event_subscriber} - arguments: ['@autologout.manager'] - - autologout.manager: - class: Drupal\autologout\AutologoutManager - tags: - - {name: autologout_manager} - arguments: ['@module_handler', '@config.factory'] diff --git a/sites/all/modules/contrib/users/autologout/composer.json b/sites/all/modules/contrib/users/autologout/composer.json deleted file mode 100644 index e4a803047..000000000 --- a/sites/all/modules/contrib/users/autologout/composer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "drupal/autologout", - "description": "Adds automated timed logout.", - "type": "drupal-module", - "homepage": "http://drupal.org/project/autologout", - "license": "GPL-2.0+" -} diff --git a/sites/all/modules/contrib/users/autologout/config/install/autologout.settings.yml b/sites/all/modules/contrib/users/autologout/config/install/autologout.settings.yml deleted file mode 100644 index a55506360..000000000 --- a/sites/all/modules/contrib/users/autologout/config/install/autologout.settings.yml +++ /dev/null @@ -1,13 +0,0 @@ -timeout: 1800 -max_timeout: 172800 -padding: 20 -role_logout: false -redirect_url: /user/login -no_dialog: false -message: 'Your session is about to expire. Do you want to reset it?' -inactivity_message: 'You have been logged out due to inactivity.' -enforce_admin: false -jstimer_format: '%hours%:%mins%:%secs%' -jstimer_js_load_option: false -use_alt_logout_method: false -use_watchdog: true diff --git a/sites/all/modules/contrib/users/autologout/config/schema/autologout.schema.yml b/sites/all/modules/contrib/users/autologout/config/schema/autologout.schema.yml deleted file mode 100644 index fec039616..000000000 --- a/sites/all/modules/contrib/users/autologout/config/schema/autologout.schema.yml +++ /dev/null @@ -1,64 +0,0 @@ -autologout.settings: - type: config_object - mapping: - timeout: - type: integer - label: 'Timeout value' - max_timeout: - type: integer - label: 'Max timeout value' - padding: - type: integer - label: 'Seconds to give a user to respond' - role_logout: - type: boolean - label: 'Enable role timeout' - redirect_url: - type: string - label: 'Redirect url' - no_dialog: - type: boolean - label: 'Integer label' - message: - type: string - label: 'Message to display' - inactivity_message: - type: string - label: 'Message displayed after logging out' - enforce_admin: - type: boolean - label: 'Enable admin logout' - jstimer_format: - type: string - label: 'JS timer format' - jstimer_js_load_option: - type: boolean - label: 'JS timer load' - use_alt_logout_method: - type: boolean - label: 'Use alternate logout methode' - use_watchdog: - type: boolean - label: 'Use watchdog' - -autologout.role.*: - type: config_object - label: 'Role Settings' - mapping: - enabled: - type: boolean - label: 'Enabled' - timeout: - type: integer - label: 'Timeout' - -autologout.user.*: - type: config_object - label: 'User Settings' - mapping: - enabled: - type: boolean - label: 'Enabled' - timeout: - type: integer - label: 'Timeout' diff --git a/sites/all/modules/contrib/users/autologout/js/autologout.js b/sites/all/modules/contrib/users/autologout/js/autologout.js deleted file mode 100644 index c2f3d6725..000000000 --- a/sites/all/modules/contrib/users/autologout/js/autologout.js +++ /dev/null @@ -1,313 +0,0 @@ -/** - * @file - * JavaScript for autologout. - */ - -(function ($, Drupal) { - - 'use strict'; - - /** - * Attaches the batch behavior for autologout. - * - * @type {Drupal~behavior} - */ - Drupal.behaviors.autologout = { - attach: function (context, settings) { - if (context !== document) { - return; - } - - var paddingTimer; - var theDialog; - var t; - var localSettings; - - // Activity is a boolean used to detect a user has - // interacted with the page. - var activity; - - // Timer to keep track of activity resets. - var activityResetTimer; - - // Prevent settings being overridden by ajax callbacks by cloning it. - localSettings = jQuery.extend(true, {}, settings.autologout); - - // Add timer element to prevent detach of all behaviours. - var timerMarkup = $('
        ').hide(); - $('body').append(timerMarkup); - - if (localSettings.refresh_only) { - // On pages where user shouldn't be logged out, don't set the timer. - t = setTimeout(keepAlive, localSettings.timeout); - } - else { - // Set no activity to start with. - activity = false; - - // Bind formUpdated events to preventAutoLogout event. - $('body').bind('formUpdated', function (event) { - $(event.target).trigger('preventAutologout'); - }); - - // Bind formUpdated events to preventAutoLogout event. - $('body').bind('mousemove', function (event) { - $(event.target).trigger('preventAutologout'); - }); - - // Support for CKEditor. - if (typeof CKEDITOR !== 'undefined') { - CKEDITOR.on('instanceCreated', function (e) { - e.editor.on('contentDom', function () { - e.editor.document.on('keyup', function (event) { - // Keyup event in ckeditor should prevent autologout. - $(e.editor.element.$).trigger('preventAutologout'); - }); - }); - }); - } - - $('body').bind('preventAutologout', function (event) { - // When the preventAutologout event fires, we set activity to true. - activity = true; - - // Clear timer if one exists. - clearTimeout(activityResetTimer); - - // Set a timer that goes off and resets this activity indicator after - // a minute, otherwise sessions never timeout. - activityResetTimer = setTimeout(function () { - activity = false; - }, 60000); - }); - - // On pages where the user should be logged out, set the timer to popup - // and log them out. - t = setTimeout(init, localSettings.timeout); - } - - function init() { - var noDialog = settings.autologout.no_dialog; - if (activity) { - // The user has been active on the page. - activity = false; - refresh(); - } - else { - // The user has not been active, ask them if they want to stay logged - // in and start the logout timer. - paddingTimer = setTimeout(confirmLogout, localSettings.timeout_padding); - // While the countdown timer is going, lookup the remaining time. If - // there is more time remaining (i.e. a user is navigating in another - // tab), then reset the timer for opening the dialog. - Drupal.Ajax['autologout.getTimeLeft'].autologoutGetTimeLeft(function (time) { - if (time > 0) { - clearTimeout(paddingTimer); - t = setTimeout(init, time); - } - else { - // Logout user right away without displaying a confirmation dialog. - if (noDialog) { - logout(); - return; - } - theDialog = dialog(); - } - }); - } - } - - function dialog() { - var buttons = {}; - buttons[Drupal.t('Yes')] = function () { - $(this).dialog("destroy"); - clearTimeout(paddingTimer); - refresh(); - }; - - buttons[Drupal.t('No')] = function () { - $(this).dialog("destroy"); - logout(); - }; - - return $('
        ' + localSettings.message + '
        ').dialog({ - modal: true, - closeOnEscape: false, - width: "auto", - dialogClass: 'autologout-dialog', - title: localSettings.title, - buttons: buttons, - close: function (event, ui) { - logout(); - } - }); - } - - // A user could have used the reset button on the tab/window they're - // actively using, so we need to double check before actually logging out. - function confirmLogout() { - $(theDialog).dialog('destroy'); - - Drupal.Ajax['autologout.getTimeLeft'].autologoutGetTimeLeft(function (time) { - if (time > 0) { - t = setTimeout(init, time); - } - else { - logout(); - } - }); - } - - function logout() { - if (localSettings.use_alt_logout_method) { - window.location = drupalSettings.path.baseUrl + "autologout_ahah_logout"; - } - else { - $.ajax({ - url: drupalSettings.path.baseUrl + "autologout_ahah_logout", - type: "POST", - beforeSend: function (xhr) { - xhr.setRequestHeader('X-Requested-With', { - toString: function (){ - return ''; - } - }); - }, - success: function () { - window.location = localSettings.redirect_url; - }, - error: function (XMLHttpRequest, textStatus) { - if (XMLHttpRequest.status === 403 || XMLHttpRequest.status === 404) { - window.location = localSettings.redirect_url; - } - } - }); - } - } - - /** - * Get the remaining time. - * - * Use the Drupal ajax library to handle get time remaining events - * because if using the JS Timer, the return will update it. - * - * @param function callback(time) - * The function to run when ajax is successful. The time parameter - * is the time remaining for the current user in ms. - */ - Drupal.Ajax.prototype.autologoutGetTimeLeft = function (callback) { - var ajax = this; - - if (ajax.ajaxing) { - return false; - } - ajax.options.success = function (response, status) { - if (typeof response == 'string') { - response = $.parseJSON(response); - } - if (typeof response[0].command === 'string' && response[0].command === 'alert') { - // In the event of an error, we can assume user has been logged out. - window.location = localSettings.redirect_url; - } - - callback(response[1].settings.time); - - response[0].data = ''; - - // Let Drupal.ajax handle the JSON response. - return ajax.success(response, status); - }; - - try { - $.ajax(ajax.options); - } - catch (e) { - ajax.ajaxing = false; - } - }; - - Drupal.Ajax['autologout.getTimeLeft'] = Drupal.ajax({ - base: null, - element: document.body, - url: drupalSettings.path.baseUrl + 'autologout_ajax_get_time_left', - event: 'autologout.getTimeLeft', - error: function (XMLHttpRequest, textStatus) { - // Disable error reporting to the screen. - } - }); - - /** - * Handle refresh event. - * - * Use the Drupal ajax library to handle refresh events because if using - * the JS Timer, the return will update it. - * - * @param function timerFunction - * The function to tell the timer to run after its been restarted. - */ - Drupal.Ajax.prototype.autologoutRefresh = function (timerfunction) { - var ajax = this; - - if (ajax.ajaxing) { - return false; - } - - ajax.options.success = function (response, status) { - if (typeof response === 'string') { - response = $.parseJSON(response); - } - if (typeof response[0].command === 'string' && response[0].command === 'alert') { - // In the event of an error, we can assume the user has been logged out. - window.location = localSettings.redirect_url; - } - - t = setTimeout(timerfunction, localSettings.timeout); - activity = false; - - // Wrap response data in timer markup to prevent detach of all behaviors. - response[0].data = ''; - - // Let Drupal.ajax handle the JSON response. - return ajax.success(response, status); - }; - - try { - $.ajax(ajax.options); - } - catch (e) { - ajax.ajaxing = false; - } - }; - - Drupal.Ajax['autologout.refresh'] = Drupal.ajax({ - base: null, - element: document.body, - url: drupalSettings.path.baseUrl + 'autologout_ahah_set_last', - event: 'autologout.refresh', - error: function (XMLHttpRequest, textStatus) { - // Disable error reporting to the screen. - } - }); - - function keepAlive() { - Drupal.Ajax['autologout.refresh'].autologoutRefresh(keepAlive); - } - - function refresh() { - Drupal.Ajax['autologout.refresh'].autologoutRefresh(init); - } - - // Check if the page was loaded via a back button click. - var $dirty_bit = $('#autologout-cache-check-bit'); - if ($dirty_bit.length !== 0) { - if ($dirty_bit.val() === '1') { - // Page was loaded via back button click, we should refresh the timer. - refresh(); - } - - $dirty_bit.val('1'); - } - } - }; - -})(jQuery, Drupal); diff --git a/sites/all/modules/contrib/users/autologout/src/AutologoutManager.php b/sites/all/modules/contrib/users/autologout/src/AutologoutManager.php deleted file mode 100644 index 3874e3f7a..000000000 --- a/sites/all/modules/contrib/users/autologout/src/AutologoutManager.php +++ /dev/null @@ -1,195 +0,0 @@ -moduleHandler = $module_handler; - $this->autoLogoutSettings = $config_factory->get('autologout.settings'); - $this->configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function preventJs() { - foreach ($this->moduleHandler->invokeAll('autologout_prevent') as $prevent) { - if (!empty($prevent)) { - return TRUE; - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function refreshOnly() { - foreach ($this->moduleHandler->invokeAll('autologout_refresh_only') as $module_refresh_only) { - if (!empty($module_refresh_only)) { - return TRUE; - } - } - - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function inactivityMessage() { - $message = $this->autoLogoutSettings->get('inactivity_message'); - if (!empty($message)) { - drupal_set_message($message); - } - } - - /** - * {@inheritdoc} - */ - public function logout() { - $user = \Drupal::currentUser(); - - if ($this->autoLogoutSettings->get('use_watchdog')) { - \Drupal::logger('user')->info('Session automatically closed for %name by autologout.', ['%name' => $user->getAccountName()]); - } - - // Destroy the current session. - $this->moduleHandler->invokeAll('user_logout', [$user]); - \Drupal::service('session_manager')->destroy(); - $user->setAccount(new AnonymousUserSession()); - } - - /** - * {@inheritdoc} - */ - public function getRoleTimeout() { - $roles = user_roles(TRUE); - $role_timeout = []; - - // Go through roles, get timeouts for each and return as array. - foreach ($roles as $name => $role) { - $role_settings = $this->configFactory->get('autologout.role.' . $name); - if ($role_settings->get('enabled')) { - $timeout_role = $role_settings->get('timeout'); - $role_timeout[$name] = $timeout_role; - } - } - return $role_timeout; - } - - /** - * {@inheritdoc} - */ - public function getRemainingTime() { - $timeout = $this->getUserTimeout(); - $time_passed = isset($_SESSION['autologout_last']) ? REQUEST_TIME - $_SESSION['autologout_last'] : 0; - return $timeout - $time_passed; - } - - - /** - * {@inheritdoc} - */ - public function createTimer() { - return $this->getRemainingTime(); - } - - /** - * {@inheritdoc} - */ - public function getUserTimeout($uid = NULL) { - if (is_null($uid)) { - // If $uid is not provided, use the logged in user. - $user = \Drupal::currentUser(); - } - else { - $user = User::load($uid); - } - - if ($user->id() == 0) { - // Anonymous doesn't get logged out. - return 0; - } - $user_timeout = \Drupal::service('user.data')->get('autologout', $user->id(), 'timeout'); - - if (is_numeric($user_timeout)) { - // User timeout takes precedence. - return $user_timeout; - } - - // Get role timeouts for user. - if ($this->autoLogoutSettings->get('role_logout')) { - $user_roles = $user->getRoles(); - $output = []; - $timeouts = $this->getRoleTimeout(); - foreach ($user_roles as $rid => $role) { - if (isset($timeouts[$role])) { - $output[$rid] = $timeouts[$role]; - } - } - - // Assign the lowest timeout value to be session timeout value. - if (!empty($output)) { - // If one of the user's roles has a unique timeout, use this. - return min($output); - } - } - - // If no user or role override exists, return the default timeout. - return $this->autoLogoutSettings->get('timeout'); - } - - /** - * {@inheritdoc} - */ - public function logoutRole($user) { - if ($this->autoLogoutSettings->get('role_logout')) { - foreach ($user->roles as $name => $role) { - if ($this->configFactory->get('autologout.role.' . $name . '.enabled')) { - return TRUE; - } - } - } - - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/AutologoutManagerInterface.php b/sites/all/modules/contrib/users/autologout/src/AutologoutManagerInterface.php deleted file mode 100644 index a97245925..000000000 --- a/sites/all/modules/contrib/users/autologout/src/AutologoutManagerInterface.php +++ /dev/null @@ -1,83 +0,0 @@ -autoLogoutManager = $autologout; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('autologout.manager') - ); - } - - /** - * AJAX callback that performs the actual logout and redirects the user. - */ - public function ahahLogout() { - $this->autoLogoutManager->logout(); - $response = new AjaxResponse(); - $response->setStatusCode(200); - return $response; - } - - /** - * Ajax callback to reset the last access session variable. - */ - public function ahahSetLast() { - $_SESSION['autologout_last'] = REQUEST_TIME; - - // Reset the timer. - $response = new AjaxResponse(); - $markup = $this->autoLogoutManager->createTimer(); - $response->addCommand(new Ajax\ReplaceCommand('#timer', $markup)); - - return $response; - } - - /** - * AJAX callback that returns the time remaining for this user is logged out. - */ - public function ahahGetRemainingTime() { - $time_remaining_ms = $this->autoLogoutManager->getRemainingTime() * 1000; - - // Reset the timer. - $response = new AjaxResponse(); - $markup = $this->autoLogoutManager->createTimer(); - - $response->addCommand(new Ajax\ReplaceCommand('#timer', $markup)); - $response->addCommand(new Ajax\SettingsCommand(['time' => $time_remaining_ms])); - - return $response; - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/EventSubscriber/AutologoutSubscriber.php b/sites/all/modules/contrib/users/autologout/src/EventSubscriber/AutologoutSubscriber.php deleted file mode 100644 index aa8a94bca..000000000 --- a/sites/all/modules/contrib/users/autologout/src/EventSubscriber/AutologoutSubscriber.php +++ /dev/null @@ -1,93 +0,0 @@ -autoLogoutManager = $autologout; - } - - /** - * Check for autologout JS. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event - * The request event. - */ - public function onRequest(GetResponseEvent $event) { - $autologout_manager = \Drupal::service('autologout.manager'); - - $uid = \Drupal::currentUser()->id(); - - if ($uid == 0) { - if (!empty($_GET['autologout_timeout']) && $_GET['autologout_timeout'] == 1 && empty($_POST)) { - $autologout_manager->inactivityMessage(); - } - return; - } - - if ($this->autoLogoutManager->preventJs()) { - return; - } - - $now = REQUEST_TIME; - // Check if anything wants to be refresh only. This URL would include the - // javascript but will keep the login alive whilst that page is opened. - $refresh_only = $autologout_manager->refreshOnly(); - $settings = \Drupal::config('autologout.settings'); - $timeout = $autologout_manager->getUserTimeout(); - $timeout_padding = $settings->get('padding'); - - // We need a backup plan if JS is disabled. - if (!$refresh_only && isset($_SESSION['autologout_last'])) { - // If time since last access is > timeout + padding, log them out. - $diff = $now - $_SESSION['autologout_last']; - if ($diff >= ($timeout + (int) $timeout_padding)) { - $autologout_manager->logout(); - // User has changed so force Drupal to remake decisions based on user. - global $theme, $theme_key; - drupal_static_reset(); - $theme = NULL; - $theme_key = NULL; - \Drupal::theme()->getActiveTheme(); - $autologout_manager->inactivityMessage(); - } - else { - $_SESSION['autologout_last'] = $now; - } - } - else { - $_SESSION['autologout_last'] = $now; - } - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events[KernelEvents::REQUEST][] = ['onRequest', 100]; - return $events; - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/Form/AutologoutBlockForm.php b/sites/all/modules/contrib/users/autologout/src/Form/AutologoutBlockForm.php deleted file mode 100644 index dce8f0361..000000000 --- a/sites/all/modules/contrib/users/autologout/src/Form/AutologoutBlockForm.php +++ /dev/null @@ -1,77 +0,0 @@ -autoLogoutManager = $autologout; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('autologout.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $form['reset'] = [ - '#type' => 'button', - '#value' => t('Reset Timeout'), - '#weight' => 1, - '#limit_validation_errors' => FALSE, - '#executes_submit_callback' => FALSE, - '#ajax' => [ - 'callback' => 'autologout_ahah_set_last', - ], - ]; - - $form['timer'] = [ - '#markup' => $this->autoLogoutManager->createTimer(), - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Submits on block form. - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/Form/AutologoutSettingsForm.php b/sites/all/modules/contrib/users/autologout/src/Form/AutologoutSettingsForm.php deleted file mode 100644 index 9e30f53f6..000000000 --- a/sites/all/modules/contrib/users/autologout/src/Form/AutologoutSettingsForm.php +++ /dev/null @@ -1,315 +0,0 @@ -moduleHandler = $module_handler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('config.factory'), - $container->get('module_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function getEditableConfigNames() { - return ['autologout.settings']; - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'autologout_settings'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $config = $this->config('autologout.settings'); - $form['timeout'] = [ - '#type' => 'textfield', - '#title' => $this->t('Timeout value in seconds'), - '#default_value' => $config->get('timeout'), - '#size' => 8, - '#weight' => -10, - '#description' => $this->t('The length of inactivity time, in seconds, before automated log out. Must be 60 seconds or greater. Will not be used if role timeout is activated.'), - ]; - - $form['max_timeout'] = [ - '#type' => 'textfield', - '#title' => $this->t('Max timeout setting'), - '#default_value' => $config->get('max_timeout'), - '#size' => 10, - '#maxlength' => 12, - '#weight' => -8, - '#description' => $this->t('The maximum logout threshold time that can be set by users who have the permission to set user level timeouts.'), - ]; - - $form['padding'] = [ - '#type' => 'textfield', - '#title' => $this->t('Timeout padding'), - '#default_value' => $config->get('padding'), - '#size' => 8, - '#weight' => -6, - '#description' => $this->t('How many seconds to give a user to respond to the logout dialog before ending their session.'), - ]; - - $form['role_logout'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Role Timeout'), - '#default_value' => $config->get('role_logout'), - '#weight' => -4, - '#description' => $this->t('Enable each role to have its own timeout threshold, a refresh maybe required for changes to take effect. Any role not ticked will use the default timeout value. Any role can have a value of 0 which means that they will never be logged out.'), - ]; - - $form['redirect_url'] = [ - '#type' => 'textfield', - '#title' => $this->t('Redirect URL at logout'), - '#default_value' => $config->get('redirect_url'), - '#size' => 40, - '#description' => $this->t('Send users to this internal page when they are logged out.'), - ]; - - $form['no_dialog'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Do not display the logout dialog'), - '#default_value' => $config->get('no_dialog'), - '#description' => $this->t('Enable this if you want users to logout right away and skip displaying the logout dialog.'), - ]; - - $form['use_alt_logout_method'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Use alternate logout method'), - '#default_value' => $config->get('use_alt_logout_method'), - '#description' => $this->t('Normally when auto logout is triggered, it is done via an AJAX service call. Sites that use an SSO provider, such as CAS, are likely to see this request fail with the error "Origin is not allowed by Access-Control-Allow-Origin". The alternate approach is to have the auto logout trigger a page redirect to initiate the logout process instead.'), - ]; - - $form['message'] = [ - '#type' => 'textarea', - '#title' => $this->t('Message to display in the logout dialog'), - '#default_value' => $config->get('message'), - '#size' => 40, - '#description' => $this->t('This message must be plain text as it might appear in a JavaScript confirm dialog.'), - ]; - - $form['inactivity_message'] = [ - '#type' => 'textarea', - '#title' => $this->t('Message to display to the user after they are logged out.'), - '#default_value' => $config->get('inactivity_message'), - '#size' => 40, - '#description' => $this->t('This message is displayed after the user was logged out due to inactivity. You can leave this blank to show no message to the user.'), - ]; - - $form['use_watchdog'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enable watchdog Automated Logout logging'), - '#default_value' => $config->get('use_watchdog'), - '#description' => $this->t('Enable logging of automatically logged out users'), - ]; - - $form['enforce_admin'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Enforce auto logout on admin pages'), - '#default_value' => $config->get('enforce_admin'), - '#description' => $this->t('If checked, then users will be automatically logged out when administering the site.'), - ]; - - if ($this->moduleHandler->moduleExists('jstimer') && $this->moduleHandler->moduleExists('jst_timer')) { - $form['jstimer_format'] = [ - '#type' => 'textfield', - '#title' => $this->t('Autologout block time format'), - '#default_value' => $config->get('jstimer_format'), - '#description' => $this->t('Change the display of the dynamic timer. Available replacement values are: %day%, %month%, %year%, %dow%, %moy%, %years%, %ydays%, %days%, %hours%, %mins%, and %secs%.'), - ]; - } - - $form['table'] = [ - '#type' => 'table', - '#weight' => -2, - '#header' => [ - 'enable' => $this->t('Enable'), - 'name' => $this->t('Role Name'), - 'timeout' => $this->t('Timeout (seconds)'), - ], - '#title' => $this->t('If Enabled every user in role will be logged out based on that roles timeout, unless the user has an individual timeout set.'), - '#states' => [ - 'visible' => [ - // Only show this field when the 'role_logout' checkbox is enabled. - ':input[name="role_logout"]' => ['checked' => TRUE], - ], - ], - ]; - - foreach (user_roles(TRUE) as $key => $role) { - $form['table'][$key] = [ - 'enabled' => [ - '#type' => 'checkbox', - '#default_value' => $this->config('autologout.role.' . $key)->get('enabled'), - ], - 'role' => [ - '#type' => 'item', - '#value' => $key, - '#markup' => $key, - ], - 'timeout' => [ - '#type' => 'textfield', - '#default_value' => $this->config('autologout.role.' . $key)->get('timeout'), - '#size' => 8, - ], - ]; - } - - return parent::buildForm($form, $form_state); - } - /** - * Validate timeout range. - * - * Checks to see if timeout threshold is outside max/min values. Done here - * to centralize and stop repeated code. Hard coded min, configurable max. - * - * @param int $timeout - * The timeout value in seconds to validate. - * @param int $max_timeout - * (optional) Maximum value of timeout. If not set, system default is used. - * - * @return bool - * Return TRUE or FALSE - */ - public function timeoutValidate($timeout, $max_timeout = NULL) { - $validate = TRUE; - if (is_null($max_timeout)) { - $max_timeout = $this->config('autologout.settings')->get('max_timeout'); - } - - if (!is_numeric($timeout) || $timeout < 0 || ($timeout > 0 && $timeout < 60) || $timeout > $max_timeout) { - // Less than 60, greater than max_timeout and is numeric. - // 0 is allowed now as this means no timeout. - $validate = FALSE; - } - return $validate; - } - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $new_stack = []; - foreach ($values['table'] as $key => $pair) { - if (is_array($pair)) { - foreach ($pair as $pairkey => $pairvalue) { - $new_stack[$key][$pairkey] = $pairvalue; - } - } - } - - $max_timeout = $values['max_timeout']; - - if ($values['role_logout']) { - // Validate timeouts for each role. - foreach (array_keys(user_roles(TRUE)) as $role) { - if (empty($new_stack[$role]) || $new_stack[$role]['enabled'] == 0) { - // Don't validate role timeouts for non enabled roles. - continue; - } - - $timeout = $new_stack[$role]['timeout']; - $validate = $this->timeoutValidate($timeout, $max_timeout); - if (!$validate) { - $form_state->setErrorByName('table][' . $role . '][timeout', $this->t('%role role timeout must be an integer greater than 60, less then %max or 0 to disable autologout for that role.', ['%role' => $role, '%max' => $max_timeout])); - } - } - } - - $timeout = $values['timeout']; - // Validate timeout. - if ($timeout < 60) { - $form_state->setErrorByName('timeout', $this->t('The timeout value must be an integer 60 seconds or greater.')); - } - elseif ($max_timeout <= 60) { - $form_state->setErrorByName('max_timeout', $this->t('The max timeout must be an integer greater than 60.')); - } - elseif (!is_numeric($timeout) || ((int) $timeout != $timeout) || $timeout < 60 || $timeout > $max_timeout) { - $form_state->setErrorByName('timeout', $this->t('The timeout must be an integer greater than 60 and less then %max.', ['%max' => $max_timeout])); - } - - $redirect_url = $values['redirect_url']; - - // Validate redirect url. - if (strpos($redirect_url, '/') !== 0) { - $form_state->setErrorByName('redirect_url', $this->t("The user-entered string :redirect_url must begin with a '/'", [':redirect_url' => $redirect_url])); - } - - parent::validateForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $values = $form_state->getValues(); - $autologout_settings = $this->config('autologout.settings'); - - $autologout_settings->set('timeout', $values['timeout']) - ->set('max_timeout', $values['max_timeout']) - ->set('padding', $values['padding']) - ->set('role_logout', $values['role_logout']) - ->set('redirect_url', $values['redirect_url']) - ->set('no_dialog', $values['no_dialog']) - ->set('message', $values['message']) - ->set('inactivity_message', $values['inactivity_message']) - ->set('enforce_admin', $values['enforce_admin']) - ->set('use_alt_logout_method', $values['use_alt_logout_method']) - ->set('use_watchdog', $values['use_watchdog']) - ->save(); - - foreach ($values['table'] as $user) { - $this->configFactory()->getEditable('autologout.role.' . $user['role']) - ->set('enabled', $user['enabled']) - ->set('timeout', $user['timeout']) - ->save(); - } - - if (isset($values['jstimer_format'])) { - $autologout_settings->set('jstimer_format', $values['jstimer_format'])->save(); - } - - parent::submitForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/Plugin/Block/AutologoutWarningBlock.php b/sites/all/modules/contrib/users/autologout/src/Plugin/Block/AutologoutWarningBlock.php deleted file mode 100644 index 08a42adb1..000000000 --- a/sites/all/modules/contrib/users/autologout/src/Plugin/Block/AutologoutWarningBlock.php +++ /dev/null @@ -1,129 +0,0 @@ -moduleHandler = $module_handler; - $this->dateFormatter = $date_formatter; - $this->autoLogoutSettings = $autologout_settings; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('module_handler'), - $container->get('date.formatter'), - $container->get('config.factory')->get('autologout.settings') - ); - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - // @todo: This is not the place where we should be doing this. - $return = []; - //if ($this->moduleHandler->moduleExists('jstimer')) { - // if (!$this->moduleHandler->moduleExists(('jst_timer'))) { - // drupal_set_message($this->t('The "Widget: timer" module must also be enabled for the dynamic countdown to work in the automated logout block.'), 'error'); - // } - - // if ($this->autoLogoutSettings->get('jstimer_js_load_option') != 1) { - // drupal_set_message($this->t("The Javascript timer module's 'Javascript load options' setting should be set to 'Every page' for the dynamic countdown to work in the automated logout block."), 'error'); - // } - //} - return $return; - } - - /** - * {@inheritdoc} - */ - public function build() { - $autologout_manager = \Drupal::service('autologout.manager'); - if ($autologout_manager->preventJs()) { - - // Don't display the block if the user is not going - // to be logged out on this page. - return []; - } - - if ($autologout_manager->refreshOnly()) { - $markup = $this->t('Autologout does not apply on the current page, - you will be kept logged in whilst this page remains open.'); - } - elseif ($this->moduleHandler->moduleExists('jstimer') && $this->moduleHandler->moduleExists('jst_timer')) { - return \Drupal::formBuilder()->getForm('Drupal\autologout\Form\AutologoutBlockForm'); - } - else { - $timeout = (int) $this->autoLogoutSettings->get('timeout'); - $markup = $this->t('You will be logged out in @time if this page is not refreshed before then.', ['@time' => $this->dateFormatter->formatInterval($timeout)]); - } - - return [ - '#type' => 'markup', - '#markup' => $markup, - ]; - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutAjaxTest.php b/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutAjaxTest.php deleted file mode 100644 index 6c16ae907..000000000 --- a/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutAjaxTest.php +++ /dev/null @@ -1,141 +0,0 @@ -privilegedUser = $this->drupalCreateUser([ - 'access content', - 'administer site configuration', - 'access site reports', - 'access administration pages', - 'bypass node access', - 'administer content types', - 'administer nodes', - 'administer autologout', - 'change own logout threshold', - ]); - $this->drupalLogin($this->privilegedUser); - - // Make node page default. - $this->config('system.site')->set('page.front', 'node')->save(); - // Place the User login block on the home page to verify Log out text. - $this->drupalPlaceBlock('system_menu_block:account'); - } - - /** - * Test ajax logout callbacks work as expected. - */ - public function testAutologoutByAjax() { - - $config = \Drupal::configFactory()->getEditable('autologout.settings'); - $config->set('timeout', 100) - ->set('padding', 10) - ->save(); - - // Check that the user can access the page after login. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText(t('Log out'), 'User is still logged in.'); - - // Test the time remaining callback works as expected. - $result = $this->drupalGetAjax('autologout_ajax_get_time_left'); - $this->assertResponse(200, 'autologout_ajax_get_time_left is accessible when logged in'); - $this->assertEqual('insert', $result[0]['command'], 'autologout_ajax_get_time_left returns an insert command for adding the jstimer onto the page'); - $this->assertEqual('#timer', $result[0]['selector'], 'autologout_ajax_get_time_left specifies the #timer selector.'); - $this->assert(!empty($result[1]['settings']['time']) && is_int($result[1]['settings']['time']) && $result[1]['settings']['time'] > 0, 'autologout_ajax_get_time_left returns the remaining time as a positive integer'); - - // Test that ajax logout works as expected. - $this->drupalGet('autologout_ahah_logout'); - $this->assertResponse(200, 'autologout_ahah_logout is accessible when logged in'); - - // Check we are now logged out. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertNoText(t('Log out'), 'User is no longer logged in.'); - - // Check further get time remaining requests return access denied. - $this->drupalGet('autologout_ajax_get_time_left'); - $this->assertResponse(403, 'autologout_ajax_get_time_left is not accessible when logged out.'); - - // Check further logout requests result in access denied. - $this->drupalGet('autologout_ahah_logout'); - $this->assertResponse(403, 'autologout_ahah_logout is not accessible when logged out.'); - - } - - /** - * Test ajax stay logged in callbacks work as expected. - */ - public function testStayloggedInByAjax() { - $config = \Drupal::configFactory()->getEditable('autologout.settings'); - $config->set('timeout', 20) - ->set('padding', 5) - ->save(); - - // Check that the user can access the page after login. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText(t('Log out'), 'User is still logged in.'); - - // Sleep for half the timeout. - sleep(14); - - // Test that ajax stay logged in works. - $result = $this->drupalGetAjax('autologout_ahah_set_last'); - $this->assertResponse(200, 'autologout_ahah_set_last is accessible when logged in.'); - $this->assertEqual('insert', $result[0]['command'], 'autologout_ajax_set_last returns an insert command for adding the jstimer onto the page'); - $this->assertEqual('#timer', $result[0]['selector'], 'autologout_ajax_set_last specifies the #timer selector.'); - - // Sleep for half the timeout again. - sleep(14); - - // Check we are still logged in. - $this->drupalGet('node'); - $this->assertResponse(200, t('Homepage is accessible')); - $this->assertText(t('Log out'), t('User is still logged in.')); - - // Logout. - $this->drupalGet('autologout_ahah_logout'); - $this->assertResponse(200, 'autologout_ahah_logout is accessible when logged in.'); - - // Check further requests to set last result in 403. - $result = $this->drupalGetAjax('autologout_ahah_set_last'); - $this->assertResponse(403, 'autologout_ahah_set_last is not accessible when logged out.'); - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutSessionCleanupOnLoginTest.php b/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutSessionCleanupOnLoginTest.php deleted file mode 100644 index ccab5bb1b..000000000 --- a/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutSessionCleanupOnLoginTest.php +++ /dev/null @@ -1,188 +0,0 @@ -privilegedUser = $this->drupalCreateUser(['access content overview', - 'administer site configuration', - 'access site reports', - 'access administration pages', - 'bypass node access', - 'administer content types', - 'administer nodes', - 'administer autologout', - 'change own logout threshold', - ]); - $this->database = $this->container->get('database'); - } - - /** - * Test that stale sessions are cleaned up at login. - */ - public function testSessionCleanupAtLogin() { - // For the purposes of the test, set the timeout periods to 5 seconds. - $config = \Drupal::configFactory()->getEditable('autologout.settings'); - $config->set('timeout', 5) - ->set('padding', 0) - ->save(); - - // Login in session 1. - $this->drupalLogin($this->privilegedUser); - // Check one active session. - $sessions = $this->getSessions($this->privilegedUser); - $this->assertEqual(1, count($sessions), 'After initial login there is one active session'); - - // Switch sessions. - $session1 = $this->stashSession(); - - // Login to session 2. - $this->drupalLogin($this->privilegedUser); - - // Check two active sessions. - $sessions = $this->getSessions($this->privilegedUser); - $this->assertEqual(2, count($sessions), 'After second login there is now two active session'); - - $this->stashSession(); - - // Switch sessions. - // Wait for sessions to expire. - sleep(6); - - // Login to session 3. - $this->drupalLogin($this->privilegedUser); - - // Check one active session. - $sessions = $this->getSessions($this->privilegedUser); - $this->assertEqual(1, count($sessions), 'After third login, there is 1 active session, two stale sessions were cleaned up.'); - - // Switch back to session 1 and check no longer logged in. - $this->restoreSession($session1); - $this->drupalGet('node'); - $this->assertNoText(t('Log out'), 'User is no longer logged in on session 1.'); - - $this->closeAllSessions(); - } - - /** - * Get active sessions for given user. - */ - public function getSessions($account) { - // Check there is one session in the sessions table. - $result = $this->database->select('sessions', 's') - ->fields('s') - ->condition('uid', $account->id()) - ->orderBy('timestamp', 'DESC') - ->execute(); - $sessions = []; - foreach ($result as $session) { - $sessions[] = $session; - } - - return $sessions; - } - - /** - * Initialise a new unique session. - * - * @return string - * Unique identifier for the session just stored. - * It is the cookiefile name. - */ - public function stashSession() { - if (empty($this->cookieFile)) { - // No session to stash. - return 0; - } - - // The session_id is the current cookieFile. - $session_id = $this->cookieFile; - - $this->curlHandles[$session_id] = $this->curlHandle; - $this->loggedInUsers[$session_id] = $this->loggedInUser; - - // Reset Curl. - unset($this->curlHandle); - $this->loggedInUser = FALSE; - - // Set a new unique cookie filename. - do { - $this->cookieFile = $this->originalFileDirectory . '/' . $this->randomMachineName() . '.jar'; - } while (isset($this->curlHandles[$this->cookieFile])); - - return $session_id; - } - - /** - * Restore a previously stashed session. - * - * @param string $session_id - * The session to restore as returned by stashSession(); - * This is also the path to the cookie file. - * - * @return string - * The old session id that was replaced. - */ - public function restoreSession($session_id) { - $old_session_id = NULL; - - if (isset($this->curlHandle)) { - $old_session_id = $this->stashSession(); - } - - // Restore the specified session. - $this->curlHandle = $this->curlHandles[$session_id]; - $this->cookieFile = $session_id; - $this->loggedInUser = $this->loggedInUsers[$session_id]; - - return $old_session_id; - } - - /** - * Close all stashed sessions and the current session. - */ - public function closeAllSessions() { - foreach ($this->curlHandles as $curl_handle) { - if (isset($curl_handle)) { - curl_close($curl_handle); - } - } - - // Make the server forget all sessions. - $this->database->truncate('sessions')->execute(); - - $this->curlHandles = []; - $this->loggedInUsers = []; - $this->loggedInUser = FALSE; - $this->cookieFile = $this->originalFileDirectory . '/' . $this->randomMachineName() . '.jar'; - unset($this->curlHandle); - } - -} diff --git a/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutTest.php b/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutTest.php deleted file mode 100644 index 1053d50ed..000000000 --- a/sites/all/modules/contrib/users/autologout/src/Tests/AutologoutTest.php +++ /dev/null @@ -1,395 +0,0 @@ -privilegedUser = $this->drupalCreateUser([ - 'access content', - 'administer site configuration', - 'access site reports', - 'access administration pages', - 'bypass node access', - 'administer content types', - 'administer nodes', - 'administer autologout', - 'change own logout threshold', - 'access site reports', - 'view the administration theme', - ]); - $this->drupalLogin($this->privilegedUser); - - $this->configFactory = $this->container->get('config.factory'); - $this->userData = $this->container->get('user.data'); - - $config = $this->configFactory->getEditable('autologout.settings'); - // For the purposes of the test, set the timeout periods to 10 seconds. - $config->set('timeout', 10) - ->save(); - - $this->drupalLogin($this->privilegedUser); - - // Make node page default. - $this->configFactory->getEditable('system.site')->set('page.front', 'node')->save(); - // Place the User login block on the home page to verify Log out text. - $this->drupalPlaceBlock('system_menu_block:account'); - } - - /** - * Test the precedence of the timeouts. - * - * This tests the following function: - * _autologout_get_user_timeout(); - */ - public function testAutologoutTimeoutPrecedence() { - $autologout_settings = $this->configFactory->getEditable('autologout.settings'); - $autologout_role_settings = $this->configFactory->getEditable('autologout.role.authenticated'); - $uid = $this->privilegedUser->id(); - $autologout_user_settings = \Drupal::service('user.data'); - - // Default used if no role is specified. - $autologout_settings->set('timeout', 100) - ->set('role_logout', FALSE) - ->save(); - $autologout_role_settings->set('enabled', FALSE) - ->set('timeout', 200) - ->save(); - $this->assertAutotimeout($uid, 100, 'User timeout uses default if no other option set'); - - // Default used if role selected but no user's role is selected. - $autologout_settings->set('role_logout', TRUE) - ->save(); - $autologout_role_settings->set('enabled', FALSE) - ->set('timeout', 200) - ->save(); - $this->assertAutotimeout($uid, 100, 'User timeout uses default if role timeouts are used but not one of the current user.'); - - // Role timeout is used if user's role is selected. - $autologout_settings->set('role_logout', TRUE) - ->save(); - $autologout_role_settings->set('enabled', TRUE) - ->set('timeout', 200) - ->save(); - $this->assertAutotimeout($uid, 200, 'User timeout uses role value'); - - // Role timeout is used if user's role is selected. - $autologout_settings->set('role_logout', TRUE) - ->save(); - $autologout_role_settings->set('enabled', TRUE) - ->set('timeout', 0) - ->save(); - $this->assertAutotimeout($uid, 0, 'User timeout uses role value of 0 if set for one of the user roles.'); - - // Role timeout used if personal timeout is empty string. - $autologout_settings->set('role_logout', TRUE) - ->save(); - $autologout_role_settings->set('enabled', TRUE) - ->set('timeout', 200) - ->save(); - $autologout_user_settings->set('autologout', $uid, 'timeout', ''); - $autologout_user_settings->set('autologout', $uid, 'enabled', FALSE); - $this->assertAutotimeout($uid, 200, 'User timeout uses role value if personal value is the empty string.'); - - // Default timeout used if personal timeout is empty string. - $autologout_settings->set('role_logout', TRUE) - ->save(); - $autologout_role_settings->set('enabled', FALSE) - ->set('timeout', 200) - ->save(); - $autologout_user_settings->set('autologout', $uid, 'timeout', ''); - $autologout_user_settings->set('autologout', $uid, 'enabled', FALSE); - $this->assertAutotimeout($uid, 100, 'User timeout uses default value if personal value is the empty string and no role timeout is specified.'); - - // Personal timeout used if set. - $autologout_settings->set('role_logout', TRUE) - ->save(); - $autologout_role_settings->set('enabled', FALSE) - ->set('timeout', 200) - ->save(); - $autologout_user_settings->set('autologout', $uid, 'timeout', 300); - $autologout_user_settings->set('autologout', $uid, 'enabled', TRUE); - $this->assertAutotimeout($uid, 300, 'User timeout uses default value if personal value is the empty string and no role timeout is specified.'); - } - - /** - * Test a user is logged out after the default timeout period. - */ - public function testAutologoutDefaultTimeout() { - // Check that the user can access the page after login. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText('Log out', 'User is still logged in.'); - - // Wait for timeout period to elapse. - sleep(30); - - // Check we are now logged out. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertNoRaw(t('Log out'), 'User is no longer logged in.'); - $this->assertText(t('You have been logged out due to inactivity.'), 'User sees inactivity message.'); - } - - /** - * Test a user is not logged out within the default timeout period. - */ - public function testAutologoutNoLogoutInsideTimeout() { - // Check that the user can access the page after login. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText(t('Log out'), 'User is still logged in.'); - - // Wait within the timeout period. - sleep(10); - - // Check we are still logged in. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText(t('Log out'), 'User is still logged in.'); - $this->assertNoText(t('You have been logged out due to inactivity.'), 'User does not see inactivity message.'); - } - - /** - * Test the behaviour of the settings for submission. - */ - public function testAutologoutSettingsForm() { - $edit = []; - $autologout_settings = $this->configFactory->getEditable('autologout.settings'); - $autologout_settings->set('max_timeout', 1000) - ->save(); - - $roles = user_roles(TRUE); - // Unset authenticated, as it will be used to add manual value later. - unset($roles['authenticated']); - - // Test that it is possible to set a value above the max_timeout - // threshold. - $edit['timeout'] = 1500; - $edit['max_timeout'] = 2000; - $edit['padding'] = 60; - $edit['role_logout'] = TRUE; - $edit['table[authenticated][enabled]'] = TRUE; - $edit['table[authenticated][timeout]'] = 1200; - foreach ($roles as $key => $role) { - $edit['table[' . $key . '][enabled]'] = TRUE; - $edit['table[' . $key . '][timeout]'] = 1200; - } - $edit['redirect_url'] = '/user/login'; - - $this->drupalPostForm('admin/config/people/autologout', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), 'Unable to save autologout config when modifying the max timeout.'); - - // Test that out of range values are picked up. - $edit['timeout'] = 2500; - $edit['max_timeout'] = 2000; - $edit['padding'] = 60; - $edit['role_logout'] = TRUE; - $edit['table[authenticated][enabled]'] = TRUE; - $edit['table[authenticated][timeout]'] = 1200; - foreach ($roles as $key => $role) { - $edit['table[' . $key . '][enabled]'] = TRUE; - $edit['table[' . $key . '][timeout]'] = 1200; - } - $edit['redirect_url'] = '/user/login'; - $this->drupalPostForm('admin/config/people/autologout', $edit, t('Save configuration')); - $this->assertNoText(t('The configuration options have been saved.'), 'Saved configuration despite the autologout_timeout being too large.'); - - // Test that out of range values are picked up. - $edit['timeout'] = 1500; - $edit['max_timeout'] = 2000; - $edit['padding'] = 60; - $edit['role_logout'] = TRUE; - $edit['table[authenticated][enabled]'] = TRUE; - $edit['table[authenticated][timeout]'] = 2500; - foreach ($roles as $key => $role) { - $edit['table[' . $key . '][enabled]'] = TRUE; - $edit['table[' . $key . '][timeout]'] = 1200; - } - $edit['redirect_url'] = '/user/login'; - $this->drupalPostForm('admin/config/people/autologout', $edit, t('Save configuration')); - $this->assertNoText(t('The configuration options have been saved.'), 'Saved configuration despite a role timeout being too large.'); - - // Test that role timeouts are not validated for disabled roles. - $edit['timeout'] = 1500; - $edit['max_timeout'] = 2000; - $edit['padding'] = 60; - $edit['role_logout'] = TRUE; - $edit['table[authenticated][enabled]'] = FALSE; - $edit['table[authenticated][timeout]'] = 4000; - foreach ($roles as $key => $role) { - $edit['table[' . $key . '][enabled]'] = FALSE; - $edit['table[' . $key . '][timeout]'] = 1200; - } - $edit['redirect_url'] = '/user/login'; - - $this->drupalPostForm('admin/config/people/autologout', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), 'Unable to save autologout due to out of range role timeout for a role which is not enabled..'); - } - - /** - * Test a user is logged out and denied access to admin pages. - */ - public function testAutologoutDefaultTimeoutAccessDeniedToAdmin() { - $autologout_settings = $this->configFactory->getEditable('autologout.settings'); - // Enforce auto logout of admin pages. - $autologout_settings->set('enforce_admin', FALSE) - ->save(); - - // Check that the user can access the page after login. - $this->drupalGet('admin/reports/status'); - $this->assertResponse(200, 'Admin page is accessible'); - $this->assertText(t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation."), 'User can access elements of the admin page.'); - - // Wait for timeout period to elapse. - sleep(30); - - // Check we are now logged out. - $this->drupalGet('admin/reports/status'); - $this->assertResponse(403, 'Admin page returns 403 access denied.'); - $this->assertNoText(t('Log out'), 'User is no longer logged in.'); - $this->assertNoText(t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation."), 'User cannot access elements of the admin page.'); - $this->assertText(t('You have been logged out due to inactivity.'), 'User sees inactivity message.'); - } - - /** - * Test integration with the remember me module. - * - * Users who checked remember_me on login should never be logged out. - */ - public function testNoAutologoutWithRememberMe() { - // Set the remember_me module data bit to TRUE. - $this->userData->set('remember_me', $this->privilegedUser->id(), 'remember_me', TRUE); - - // Check that the user can access the page after login. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText(t('Log out'), 'User is still logged in.'); - - // Wait for timeout period to elapse. - sleep(30); - - // Check we are still logged in. - $this->drupalGet('node'); - $this->assertResponse(200, 'Homepage is accessible'); - $this->assertText(t('Log out'), 'User is still logged in after timeout with remember_me on.'); - } - - /** - * Test the behaviour of custom message displayed on autologout. - */ - public function testCustomMessage() { - $autologout_settings = $this->configFactory->getEditable('autologout.settings'); - $inactivity_message = 'Custom message for test'; - - // Update message string in configuration. - $autologout_settings->set('inactivity_message', $inactivity_message) - ->save(); - - // Set time out for 10 seconds. - $autologout_settings->set('timeout', 10) - ->save(); - - // Wait for 20 seconds for timeout. - sleep(30); - - // Access the admin page and verify user is logged out and custom message - // is displayed. - $this->drupalGet('admin/reports/status'); - $this->assertText($inactivity_message, 'User sees custom message'); - } - - /** - * Test the behaviour of application when Autologout is enabled for admin. - */ - public function testAutologoutAdminPages() { - - $autologout_settings = $this->configFactory->getEditable('autologout.settings'); - // Enforce auto logout of admin pages. - $autologout_settings->set('enforce_admin', TRUE) - ->save(); - // Set time out as 10 seconds. - $autologout_settings->set('timeout', 10) - ->save(); - // Verify admin should not be logged out. - $this->drupalGet('admin/reports/status'); - $this->assertResponse('200', 'Admin pages are accessible'); - - // Wait until timeout. - sleep(30); - - // Verify admin should be logged out. - $this->drupalGet('admin/reports/status'); - $this->assertText(t('You have been logged out due to inactivity.'), 'User sees inactivity message.'); - } - - /** - * Assert the timeout for a particular user. - * - * @param int $uid - * User uid to assert the timeout for. - * @param int $expected_timeout - * The expected timeout. - * @param string $message - * The test message. - * @param string $group - * The test grouping. - */ - public function assertAutotimeout($uid, $expected_timeout, $message = '', $group = '') { - return $this->assertEqual(\Drupal::service('autologout.manager')->getUserTimeout($uid), $expected_timeout, $message, $group); - } - -} diff --git a/sites/all/modules/contrib/users/email_registration/LICENSE.txt b/sites/all/modules/contrib/users/email_registration/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/users/email_registration/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/users/email_registration/README.txt b/sites/all/modules/contrib/users/email_registration/README.txt deleted file mode 100644 index 4021cc533..000000000 --- a/sites/all/modules/contrib/users/email_registration/README.txt +++ /dev/null @@ -1,45 +0,0 @@ -INTRODUCTION ------------- - -Email Registration allows users to register and login with their email address -instead of using a separate username in addition to the email address. It will -automatically generate a username based on the email address but that behavior -can be overridden with a custom hook implementation in a site specific module. - -INSTALLATION ------------- - -Required step: - -Enable the module as you normally would. See: -https://www.drupal.org/docs/8/extending-drupal-8/installing-modules - - -CONFIGURATION -------------- - -* You will probably want to change the welcome email (Administration - -> Configuration -> People -> Account Settings) and replace instances of the - token [user:display-name] with [user:mail]. - -* The automatically generated username is still displayed name for posts, - comments, etc. You can allow your users to change their username by granting - the permission (Administraion -> People -> Permissions) to "change own - username". This privilege allows a user to change their username in "My - Account". - -* If a user enters an invalid email or password they will see a message: - "Unrecognized username or password. Forgot your password?" - That message is confusing because it mentions username when all other - language on the page mentions entering their email. This can be easily - overridden in your settings.php file with an entry like this: - -$settings['locale_custom_strings_en'][''] = [ - 'Unrecognized username or password. Forgot your password?' => 'Unrecognized e-mail address or password. Forgot your password?', -]; - -BUGS, FEATURES, QUESTIONS -------------------------- -Post any bugs, features or questions to the issue queue: - -http://drupal.org/project/issues/email_registration diff --git a/sites/all/modules/contrib/users/email_registration/composer.json b/sites/all/modules/contrib/users/email_registration/composer.json deleted file mode 100644 index 63cc982d0..000000000 --- a/sites/all/modules/contrib/users/email_registration/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "drupal/email_registration", - "type": "drupal-module", - "description": "Allows users to register with an email address as their username.", - "license": "GPL-2.0+", - "homepage": "https://www.drupal.org/project/email_registration", - "minimum-stability": "dev", - "authors": [ - { - "name": "Greg Knaddison (greggles)", - "homepage": "https://www.drupal.org/u/greggles", - "role": "Maintainer" - }, - { - "name": "Andrey Postnikov (andypost)", - "homepage": "https://www.drupal.org/u/andypost", - "role": "Maintainer" - }, - { - "name": "Chris Herberte", - "homepage": "https://www.drupal.org/u/chris-herberte", - "role": "Maintainer" - }, - { - "name": "Moshe Weitzman (moshe weitzman)", - "homepage": "https://www.drupal.org/u/moshe-weitzman", - "role": "Maintainer" - } - ], - "support": { - "issues": "http://drupal.org/project/issues/email_registration", - "source": "http://cgit.drupalcode.org/email_registration" - } -} diff --git a/sites/all/modules/contrib/users/email_registration/config/install/email_registration.settings.yml b/sites/all/modules/contrib/users/email_registration/config/install/email_registration.settings.yml deleted file mode 100644 index f684df731..000000000 --- a/sites/all/modules/contrib/users/email_registration/config/install/email_registration.settings.yml +++ /dev/null @@ -1 +0,0 @@ -login_with_username: FALSE diff --git a/sites/all/modules/contrib/users/email_registration/config/schema/email_registration.schema.yml b/sites/all/modules/contrib/users/email_registration/config/schema/email_registration.schema.yml deleted file mode 100644 index 00fcc8ee1..000000000 --- a/sites/all/modules/contrib/users/email_registration/config/schema/email_registration.schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -email_registration.settings: - type: config_object - label: 'Email registration config' - mapping: - login_with_username: - type: boolean - label: 'Allow users to log in with email address or username.' diff --git a/sites/all/modules/contrib/users/email_registration/email_registration.api.php b/sites/all/modules/contrib/users/email_registration/email_registration.api.php deleted file mode 100644 index a54566746..000000000 --- a/sites/all/modules/contrib/users/email_registration/email_registration.api.php +++ /dev/null @@ -1,37 +0,0 @@ -id()); -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/sites/all/modules/contrib/users/email_registration/email_registration.info.yml b/sites/all/modules/contrib/users/email_registration/email_registration.info.yml deleted file mode 100644 index 2e2003e9f..000000000 --- a/sites/all/modules/contrib/users/email_registration/email_registration.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Email Registration -type: module -description: 'Allows users to register with an email address as their username.' -# core: 8.x -dependencies: - - drupal:user - -# Information added by Drupal.org packaging script on 2018-12-21 -version: '8.x-1.0-rc6' -core: '8.x' -project: 'email_registration' -datestamp: 1545350889 diff --git a/sites/all/modules/contrib/users/email_registration/email_registration.install b/sites/all/modules/contrib/users/email_registration/email_registration.install deleted file mode 100644 index 8c31c7560..000000000 --- a/sites/all/modules/contrib/users/email_registration/email_registration.install +++ /dev/null @@ -1,35 +0,0 @@ -moduleExists('logintoboggan') && \Drupal::config('logintoboggan.settings')->get('login_with_email')) { - $requirements['email_registration'] = [ - 'title' => t('Email Registration / LoginToboggan Conflict'), - 'value' => t('Conflict'), - 'description' => t('There is a conflict between %email_registration and %logintoboggan. You should disable the "Allow users to login using their email address" option from %logintoboggan.', ['%email_registration' => 'Email registration', '%logintoboggan' => 'Login Toboggan']), - 'severity' => REQUIREMENT_ERROR, - ]; - } - - return $requirements; -} - -/** - * Add an option to log in with the username as well as the email address. - */ -function email_registration_update_8100() { - $config_factory = \Drupal::configFactory(); - $email_registration = $config_factory->getEditable('email_registration.settings'); - $email_registration->set('login_with_username', FALSE); - $email_registration->save(); -} diff --git a/sites/all/modules/contrib/users/email_registration/email_registration.module b/sites/all/modules/contrib/users/email_registration/email_registration.module deleted file mode 100644 index 71095c2ec..000000000 --- a/sites/all/modules/contrib/users/email_registration/email_registration.module +++ /dev/null @@ -1,204 +0,0 @@ -getAccountName(); - if (!empty($name) && strpos($name, 'email_registration_') !== 0) { - return; - } - - // Other modules may implement hook_email_registration_name($edit, $account) - // to generate a username (return a string to be used as the username, NULL - // to have email_registration generate it). - $names = Drupal::moduleHandler()->invokeAll('email_registration_name', [$account]); - // Remove any empty entries. - $names = array_filter($names); - - if (empty($names)) { - // Strip off everything after the @ sign. - $new_name = preg_replace('/@.*$/', '', $account->getEmail()); - // Clean up the username. - $new_name = email_registration_cleanup_username($new_name); - } - else { - // One would expect a single implementation of the hook, but if there - // are multiples out there use the last one. - $new_name = array_pop($names); - } - - // Ensure whatever name we have is unique. - $new_name = email_registration_unique_username($new_name, $account->id()); - - $account->setUsername($new_name); - if ($account->isValidationRequired() && !$account->validate()) { - \Drupal::logger('email_registration')->error('Email registration failed setting the new name on user @id.', ['@id' => $account->id()]); - return; - } - $account->save(); -} - -/** - * Makes the username unique. - * - * Given a starting point for a Drupal username (e.g. the name portion of an - * email address) return a legal, unique Drupal username. This function is - * designed to work on the results of the /user/register or /admin/people/create - * forms which have already called user_validate_name, valid_email_address - * or a similar function. If your custom code is creating users, you should - * ensure that the email/name is already validated using something like that. - * - * @param string $name - * A name from which to base the final user name. - * May contain illegal characters; these will be stripped. - * @param int $uid - * (optional) Uid to ignore when searching for unique user - * (e.g. if we update the username after the {users} row is inserted). - * - * @return string - * A unique user name based on $name. - * - * @see user_validate_name() - */ -function email_registration_unique_username($name, $uid = 0) { - // Iterate until we find a unique name. - $i = 0; - $database = \Drupal::database(); - do { - $new_name = empty($i) ? $name : $name . '_' . $i; - $found = $database->queryRange("SELECT uid from {users_field_data} WHERE uid <> :uid AND name = :name", 0, 1, [':uid' => $uid, ':name' => $new_name])->fetchAssoc(); - $i++; - } while (!empty($found)); - - return $new_name; -} - -/** - * Cleans up username. - * - * Run username sanitation, e.g.: - * Replace two or more spaces with a single underscore - * Strip illegal characters. - * - * @param string $name - * The username to be cleaned up. - * - * @return string - * Cleaned up username. - */ -function email_registration_cleanup_username($name) { - // Strip illegal characters. - $name = preg_replace('/[^\x{80}-\x{F7} a-zA-Z0-9@_.\'-]/', '', $name); - - // Strip leading and trailing spaces. - $name = trim($name); - - // Convert any other series of spaces to a single underscore. - $name = preg_replace('/\s+/', '_', $name); - - // If there's nothing left use a default. - $name = ('' === $name) ? t('user') : $name; - - // Truncate to a reasonable size. - $name = (Unicode::strlen($name) > (UserInterface::USERNAME_MAX_LENGTH - 10)) ? Unicode::substr($name, 0, UserInterface::USERNAME_MAX_LENGTH - 11) : $name; - return $name; -} - -/** - * Implements hook_form_BASE_FORM_ID_alter(). - */ -function email_registration_form_user_form_alter(&$form, FormStateInterface $form_state) { - $form['account']['name']['#type'] = 'value'; - $form['account']['name']['#value'] = 'email_registration_' . user_password(); - $form['account']['mail']['#title'] = t('Email'); -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function email_registration_form_user_pass_alter(&$form, FormStateInterface $form_state) { - $form['name']['#title'] = t('Email'); - // Only convert textfields to email fields. This field is a hidden value when - // you are already logged in. - if ($form['name']['#type'] == 'textfield') { - // Allow client side validation of input format. - $form['name']['#type'] = 'email'; - $form['name']['#maxlength'] = Email::EMAIL_MAX_LENGTH; - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function email_registration_form_user_login_form_alter(&$form, FormStateInterface $form_state) { - $config = \Drupal::config('email_registration.settings'); - $login_with_username = $config->get('login_with_username'); - $form['name']['#title'] = $login_with_username ? t('Email or username') : t('Email'); - $form['name']['#description'] = $login_with_username ? t('Enter your email address or username.') : t('Enter your email address.'); - $form['name']['#element_validate'][] = 'email_registration_user_login_validate'; - $form['pass']['#description'] = t('Enter the password that accompanies your email address.'); - // Allow client side validation of input format. - $form['name']['#type'] = $login_with_username ? 'textfield' : 'email'; - $form['name']['#maxlength'] = Email::EMAIL_MAX_LENGTH; - // Make sure the login form cache is invalidated when the setting changes. - $form['#cache']['tags'][] = 'config:email_registration.settings'; -} - -/** - * Form element validation handler for the user login form. - * - * Allows users to authenticate by email, which is our preferred method. - */ -function email_registration_user_login_validate($form, FormStateInterface $form_state) { - $mail = $form_state->getValue('name'); - if (!empty($mail)) { - $config = \Drupal::config('email_registration.settings'); - if ($user = user_load_by_mail($mail)) { - $form_state->setValue('name', $user->getAccountName()); - } - elseif (!$config->get('login_with_username')) { - $user_input = $form_state->getUserInput(); - $query = isset($user_input['name']) ? ['name' => $user_input['name']] : []; - $form_state->setErrorByName('name', t('Unrecognized email address or password. Forgot your password?', [':password' => Url::fromRoute('user.pass', [], ['query' => $query])->toString()])); - } - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function email_registration_form_user_admin_settings_alter(&$form, FormStateInterface $form_state) { - $config = \Drupal::config('email_registration.settings'); - $form['registration_cancellation']['login_with_username'] = [ - '#type' => 'checkbox', - '#title' => t('Allow log in with email address or username.'), - '#description' => t('Allow users to log in with either their email address or their username.'), - '#default_value' => $config->get('login_with_username'), - ]; - $form['#submit'][] = 'email_registration_form_user_admin_settings_submit'; -} - -/** - * Submit function for user_admin_settings to save our variable. - * - * @see email_registration_form_user_admin_settings_alter(). - */ -function email_registration_form_user_admin_settings_submit(array &$form, FormStateInterface $form_state) { - $config = \Drupal::configFactory()->getEditable('email_registration.settings'); - $config->set('login_with_username', $form_state->getValue('login_with_username'))->save(); -} diff --git a/sites/all/modules/contrib/users/email_registration/src/Plugin/Commerce/CheckoutPane/EmailRegistrationLogin.php b/sites/all/modules/contrib/users/email_registration/src/Plugin/Commerce/CheckoutPane/EmailRegistrationLogin.php deleted file mode 100644 index 1bd226bfd..000000000 --- a/sites/all/modules/contrib/users/email_registration/src/Plugin/Commerce/CheckoutPane/EmailRegistrationLogin.php +++ /dev/null @@ -1,108 +0,0 @@ -get('login_with_username'); - $pane_form['returning_customer']['name']['#title'] = $login_with_username ? t('Email address or username') : t('Email address'); - $pane_form['returning_customer']['name']['#description'] = $login_with_username ? t('Enter your email address or username.') : t('Enter your email address.'); - $pane_form['returning_customer']['name']['#element_validate'][] = 'email_registration_user_login_validate'; - $pane_form['returning_customer']['name']['#type'] = $login_with_username ? 'textfield' : 'email'; - $pane_form['returning_customer']['name']['#maxlength'] = Email::EMAIL_MAX_LENGTH; - $pane_form['returning_customer']['password']['#description'] = t('Enter the password that accompanies your email address.'); - $complete_form['#cache']['tags'][] = 'config:email_registration.settings'; - - $pane_form['register']['name']['#type'] = 'value'; - $pane_form['register']['name']['#value'] = 'email_registration_' . user_password(); - $pane_form['register']['mail']['#title'] = t('Email'); - - return $pane_form; - } - - /** - * {@inheritdoc} - */ - public function validatePaneForm(array &$pane_form, FormStateInterface $form_state, array &$complete_form) { - $values = $form_state->getValue($pane_form['#parents']); - $triggering_element = $form_state->getTriggeringElement(); - if ($triggering_element['#op'] === 'login') { - $mail = $form_state->getValue([ - 'email_registration_login', - 'returning_customer', - 'name', - ]); - if (!empty($mail)) { - $config = \Drupal::config('email_registration.settings'); - if ($user = user_load_by_mail($mail)) { - $username = $user->getAccountName(); - $form_state->setValue([ - 'email_registration_login', - 'returning_customer', - 'name', - ], $username); - } - elseif (!$config->get('login_with_username')) { - $user_input = $form_state->getUserInput(); - $query = isset($user_input['email_registration_login']['returning_customer']['name']) ? ['name' => $user_input['email_registration_login']['returning_customer']['name']] : []; - $form_state->setError($pane_form['returning_customer'], t('Unrecognized email address or password. Forgot your password?', [ - ':password' => Url::fromRoute('user.pass', [], ['query' => $query]) - ->toString(), - ])); - return; - } - } - $name_element = $pane_form['returning_customer']['name']; - $password = trim($values['returning_customer']['password']); - // Generate the "reset password" url. - $query = !empty($username) ? ['name' => $username] : []; - $password_url = Url::fromRoute('user.pass', [], ['query' => $query]) - ->toString(); - - if (user_is_blocked($username)) { - $form_state->setError($name_element, $this->t('The account with email address %mail has not been activated or is blocked.', ['%mail' => $mail])); - return; - } - if (!$this->credentialsCheckFlood->isAllowedHost($this->clientIp)) { - $form_state->setErrorByName($name_element, $this->t('Too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or request a new password.', [':url' => Url::fromRoute('user.pass')])); - $this->credentialsCheckFlood->register($this->clientIp, $username); - return; - } - elseif (!$this->credentialsCheckFlood->isAllowedAccount($this->clientIp, $username)) { - $form_state->setErrorByName($name_element, $this->t('Too many failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', [':url' => Url::fromRoute('user.pass')])); - $this->credentialsCheckFlood->register($this->clientIp, $username); - return; - } - - $uid = $this->userAuth->authenticate($username, $password); - if (!$uid) { - $this->credentialsCheckFlood->register($this->clientIp, $username); - $form_state->setError($name_element, $this->t('Unrecognized email address or password. Forgot your password?', [':url' => $password_url])); - } - $form_state->set('logged_in_uid', $uid); - } - parent::validatePaneForm($pane_form, $form_state, $complete_form); - } - -} diff --git a/sites/all/modules/contrib/users/email_registration/tests/src/Functional/EmailRegistrationTestCase.php b/sites/all/modules/contrib/users/email_registration/tests/src/Functional/EmailRegistrationTestCase.php deleted file mode 100644 index db9938cef..000000000 --- a/sites/all/modules/contrib/users/email_registration/tests/src/Functional/EmailRegistrationTestCase.php +++ /dev/null @@ -1,111 +0,0 @@ -container->get('config.factory')->getEditable('user.settings'); - $email_registration_config = $this->container->get('config.factory')->getEditable('email_registration.settings'); - $user_config - ->set('verify_mail', FALSE) - ->set('register', USER_REGISTER_VISITORS) - ->save(); - // Try to register a user. - $name = $this->randomMachineName(); - $pass = $this->randomString(10); - $register = [ - 'mail' => $name . '@example.com', - 'pass[pass1]' => $pass, - 'pass[pass2]' => $pass, - ]; - $this->drupalPostForm('/user/register', $register, t('Create new account')); - $this->drupalLogout(); - - $login = [ - 'name' => $name . '@example.com', - 'pass' => $pass, - ]; - $this->drupalPostForm('user/login', $login, t('Log in')); - - // Really basic confirmation that the user was created and logged in. - $this->assertRaw('' . $name . ' | Drupal', t('User properly created, logged in.')); - - // Now try the immediate login. - $this->drupalLogout(); - - // Try to login with just username, should fail by default. - $this->drupalGet('user/login'); - $this->assertText('Enter your email address.'); - $this->assertText('Email'); - $this->assertNoText('Email or username'); - $login = [ - 'name' => $name, - 'pass' => $pass, - ]; - $this->drupalPostForm('user/login', $login, t('Log in')); - $error_message = $this->xpath('//div[contains(@class, "error")]'); - $this->assertTrue(!empty($error_message), t('When login_with_username is false, a user cannot login with just their username.')); - - // Set login_with_username to TRUE and try to login with just username. - $email_registration_config->set('login_with_username', TRUE)->save(); - $this->drupalGet('user/login'); - $this->assertText('Enter your email address or username.'); - $this->assertText('Email or username'); - $this->drupalPostForm('user/login', $login, t('Log in')); - $this->assertRaw('' . $name . ' | Drupal', t('When login_with_username is true, a user can login with just their username.')); - $this->drupalLogout(); - - $user_config - ->set('verify_mail', FALSE) - ->save(); - $name = $this->randomMachineName(); - $pass = $this->randomString(10); - $register = [ - 'mail' => $name . '@example.com', - 'pass[pass1]' => $pass, - 'pass[pass2]' => $pass, - ]; - $this->drupalPostForm('/user/register', $register, t('Create new account')); - $this->assertRaw('Registration successful. You are now logged in.', t('User properly created, immediately logged in.')); - - // Test email_registration_unique_username(). - $this->drupalLogout(); - $user_config - ->set('verify_mail', FALSE) - ->set('register', USER_REGISTER_VISITORS) - ->save(); - $name = $this->randomMachineName(32); - $pass = $this->randomString(10); - - $this->createUser([], $name); - $next_unique_name = email_registration_unique_username($name); - - $register = [ - 'mail' => $name . '@example2.com', - 'pass[pass1]' => $pass, - 'pass[pass2]' => $pass, - ]; - $this->drupalPostForm('/user/register', $register, t('Create new account')); - $account = user_load_by_mail($register['mail']); - $this->assertTrue($next_unique_name === $account->getAccountName()); - } - -} diff --git a/sites/all/modules/contrib/users/profile/.travis-phpcs.sh b/sites/all/modules/contrib/users/profile/.travis-phpcs.sh deleted file mode 100644 index 8803b3b4f..000000000 --- a/sites/all/modules/contrib/users/profile/.travis-phpcs.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e $DRUPAL_TI_DEBUG - -# Ensure the right Drupal version is installed. -# Note: This function is re-entrant. -drupal_ti_ensure_drupal - -phpcs --report=full --standard=Drupal "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_MODULES_PATH/$DRUPAL_TI_MODULE_NAME" || true diff --git a/sites/all/modules/contrib/users/profile/.travis.yml b/sites/all/modules/contrib/users/profile/.travis.yml deleted file mode 100644 index d4c22ddb5..000000000 --- a/sites/all/modules/contrib/users/profile/.travis.yml +++ /dev/null @@ -1,119 +0,0 @@ -# @file -# .travis.yml - Drupal for Travis CI Integration -# -# Template provided by https://github.com/LionsAd/drupal_ti. -# -# Based for simpletest upon: -# https://github.com/sonnym/travis-ci-drupal-module-example - -language: php -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -php: - - 5.5 - - 5.6 - - 7 - - hhvm - -matrix: - fast_finish: true - allow_failures: - - php: 7 - - php: hhvm -branches: - only: - - "8.x-1.x" - -env: - global: - # add composer's global bin directory to the path - # see: https://github.com/drush-ops/drush#install---composer - - PATH="$PATH:$HOME/.composer/vendor/bin" - - # Configuration variables. - - DRUPAL_TI_MODULE_NAME="profile" - - DRUPAL_TI_SIMPLETEST_GROUP="profile" - - # Define runners and environment vars to include before and after the - # main runners / environment vars. - #- DRUPAL_TI_SCRIPT_DIR_BEFORE="./drupal_ti/before" - #- DRUPAL_TI_SCRIPT_DIR_AFTER="./drupal_ti/after" - - # The environment to use, supported are: drupal-7, drupal-8 - - DRUPAL_TI_ENVIRONMENT="drupal-8" - - # Drupal specific variables. - - DRUPAL_TI_DB="drupal_travis_db" - - DRUPAL_TI_DB_URL="mysql://root:@127.0.0.1/drupal_travis_db" - # Note: Do not add a trailing slash here. - - DRUPAL_TI_WEBSERVER_URL="http://127.0.0.1" - - DRUPAL_TI_WEBSERVER_PORT="8080" - - # Simpletest specific commandline arguments, the DRUPAL_TI_SIMPLETEST_GROUP is appended at the end. - - DRUPAL_TI_SIMPLETEST_ARGS="--verbose --color --concurrency 4 --url $DRUPAL_TI_WEBSERVER_URL:$DRUPAL_TI_WEBSERVER_PORT" - - # === Behat specific variables. - # This is relative to $TRAVIS_BUILD_DIR - - DRUPAL_TI_BEHAT_DIR="./tests/behat" - # These arguments are passed to the bin/behat command. - - DRUPAL_TI_BEHAT_ARGS="" - # Specify the filename of the behat.yml with the $DRUPAL_TI_DRUPAL_DIR variables. - - DRUPAL_TI_BEHAT_YML="behat.yml.dist" - # This is used to setup Xvfb. - - DRUPAL_TI_BEHAT_SCREENSIZE_COLOR="1280x1024x16" - # The version of seleniumthat should be used. - - DRUPAL_TI_BEHAT_SELENIUM_VERSION="2.44" - - # PHPUnit specific commandline arguments. - - DRUPAL_TI_PHPUNIT_ARGS="" - - # Code coverage via coveralls.io - - DRUPAL_TI_COVERAGE="satooshi/php-coveralls:0.6.*" - # This needs to match your .coveralls.yml file. - - DRUPAL_TI_COVERAGE_FILE="build/logs/clover.xml" - - # Debug options - #- DRUPAL_TI_DEBUG="-x -v" - # Set to "all" to output all files, set to e.g. "xvfb selenium" or "selenium", - # etc. to only output those channels. - #- DRUPAL_TI_DEBUG_FILE_OUTPUT="selenium xvfb webserver" - - matrix: - # [[[ SELECT ANY OR MORE OPTIONS ]]] - #- DRUPAL_TI_RUNNERS="phpunit" - - DRUPAL_TI_RUNNERS="simpletest" - #- DRUPAL_TI_RUNNERS="behat" - #- DRUPAL_TI_RUNNERS="phpunit simpletest behat" - # Uncomment once unit tests added. - #- DRUPAL_TI_RUNNERS="phpunit-core simpletest" - -mysql: - database: drupal_travis_db - username: root - encoding: utf8 - -before_install: - - composer self-update - - composer global require "lionsad/drupal_ti:1.*" - - drupal-ti before_install - # Codesniffer and Coder - - composer global require "squizlabs/php_codesniffer:2.0.*@dev" - - composer global require drupal/coder:8.2.0-beta1 - - ln -s ~/.composer/vendor/drupal/coder/coder_sniffer/Drupal ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/ - -install: - - drupal-ti install - -before_script: - - drupal-ti before_script - -script: - - drupal-ti --include .travis-phpcs.sh - - export SIMPLETEST_DB=mysql://root:@127.0.0.1/drupal_travis_db; drupal-ti script - -after_script: - - drupal-ti after_script diff --git a/sites/all/modules/contrib/users/profile/LICENSE.txt b/sites/all/modules/contrib/users/profile/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/users/profile/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/users/profile/README.md b/sites/all/modules/contrib/users/profile/README.md deleted file mode 100644 index fb77c5bf4..000000000 --- a/sites/all/modules/contrib/users/profile/README.md +++ /dev/null @@ -1,23 +0,0 @@ -Profile -------- - -The *Profile* module provides configurable user profiles. - -## Requirements - -* [Entity API](https://www.drupal.org/project/entity) - -## Comparison to user account fields - -Why use profiles instead of user account fields? - -* With profile, user account settings and user profiles are conceptually different things, e.g. with the "Profile" module enabled users get two separate menu links "My account" and "My profile". -* Profile allows for creating multiple profile types, which may be assigned to roles via permissions (e.g. a general profile + a customer profile) -* Profile supports private profile fields, which are only shown to the user owning the profile and to administrators. - -## Features - -* Multiple profile types may be created via the UI (e.g. a general profile + a customer profile), whereas the module provides separated permissions for those. -* Optionally, profile forms are shown during user account registration. -* Fields may be configured to be private - thus visible only to the profile owner and administrators. -* Profile types are displayed on the user view page, and can be configured through "Manage Display" on account settings. \ No newline at end of file diff --git a/sites/all/modules/contrib/users/profile/composer.json b/sites/all/modules/contrib/users/profile/composer.json deleted file mode 100644 index 3b0970111..000000000 --- a/sites/all/modules/contrib/users/profile/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "drupal/profile", - "type": "drupal-module", - "description": "Provides configurable user profiles.", - "homepage": "http://drupal.org/project/profile", - "license": "GPL-2.0+", - "require": { - "drupal/core": "~8.1" - } -} diff --git a/sites/all/modules/contrib/users/profile/config/install/system.action.profile_delete_action.yml b/sites/all/modules/contrib/users/profile/config/install/system.action.profile_delete_action.yml deleted file mode 100644 index 8805221e8..000000000 --- a/sites/all/modules/contrib/users/profile/config/install/system.action.profile_delete_action.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - profile -id: profile_delete_action -label: 'Delete selected profile' -type: profile -plugin: profile_delete_action diff --git a/sites/all/modules/contrib/users/profile/config/install/system.action.profile_publish_action.yml b/sites/all/modules/contrib/users/profile/config/install/system.action.profile_publish_action.yml deleted file mode 100644 index 36e5eda64..000000000 --- a/sites/all/modules/contrib/users/profile/config/install/system.action.profile_publish_action.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - profile -id: profile_publish_action -label: 'Publish selected profile' -type: profile -plugin: profile_publish_action diff --git a/sites/all/modules/contrib/users/profile/config/install/system.action.profile_unpublish_action.yml b/sites/all/modules/contrib/users/profile/config/install/system.action.profile_unpublish_action.yml deleted file mode 100644 index ac0e0f330..000000000 --- a/sites/all/modules/contrib/users/profile/config/install/system.action.profile_unpublish_action.yml +++ /dev/null @@ -1,9 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - profile -id: profile_unpublish_action -label: 'Unpublish selected profile' -type: profile -plugin: profile_unpublish_action diff --git a/sites/all/modules/contrib/users/profile/config/install/views.view.profiles.yml b/sites/all/modules/contrib/users/profile/config/install/views.view.profiles.yml deleted file mode 100644 index 9f6953648..000000000 --- a/sites/all/modules/contrib/users/profile/config/install/views.view.profiles.yml +++ /dev/null @@ -1,379 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - entity - - profile -id: profiles -label: Profiles -module: views -description: '' -tag: '' -base_table: profile -base_field: profile_id -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - offset: 0 - style: - type: grid - options: - grouping: { } - columns: 4 - automatic_width: true - alignment: horizontal - col_class_default: true - col_class_custom: '' - row_class_default: true - row_class_custom: '' - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - rendered_entity: - id: rendered_entity - table: profile - field: rendered_entity - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - view_mode: default - entity_type: profile - plugin_id: rendered_entity - operations: - id: operations - table: profile - field: operations - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - entity_type: profile - plugin_id: entity_operations - filters: { } - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: - uid: - id: uid - table: profile - field: uid - relationship: none - group_type: group - admin_label: '' - default_action: default - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: user - default_argument_options: - user: false - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - not: false - entity_type: profile - entity_field: uid - plugin_id: numeric - type: - id: type - table: profile - field: type - relationship: none - group_type: group - admin_label: '' - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: true - validate: - type: 'entity:profile_type' - fail: 'not found' - validate_options: { } - glossary: false - limit: 0 - case: none - path_case: none - transform_dash: false - break_phrase: false - entity_type: profile - entity_field: type - plugin_id: string - status: - id: status - table: profile - field: status - relationship: none - group_type: group - admin_label: '' - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - not: false - entity_type: profile - entity_field: status - plugin_id: numeric - display_extenders: { } - title: Profiles - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - profile_type_listing: - display_plugin: embed - id: profile_type_listing - display_title: 'Profile type listing' - position: 1 - display_options: - display_extenders: { } - display_description: '' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url - user_view: - display_plugin: embed - id: user_view - display_title: 'User view' - position: 2 - display_options: - display_extenders: { } - fields: - rendered_entity: - id: rendered_entity - table: profile - field: rendered_entity - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - view_mode: default - entity_type: profile - plugin_id: rendered_entity - defaults: - fields: false - display_description: '' - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_interface' - - url diff --git a/sites/all/modules/contrib/users/profile/config/schema/profile.schema.yml b/sites/all/modules/contrib/users/profile/config/schema/profile.schema.yml deleted file mode 100644 index 77acd0288..000000000 --- a/sites/all/modules/contrib/users/profile/config/schema/profile.schema.yml +++ /dev/null @@ -1,59 +0,0 @@ -profile.type.*: - type: config_entity - label: 'Profile type settings' - mapping: - id: - type: string - label: 'Machine-readable name' - uuid: - type: string - label: 'UUID' - label: - type: label - label: 'Label' - registration: - type: boolean - label: 'Registration' - multiple: - type: boolean - label: 'Allow multiple profiles' - roles: - label: 'Allowed roles' - type: sequence - sequence: - type: string - weight: - type: integer - label: 'Weight' - status: - type: boolean - label: 'Status' - langcode: - type: string - label: 'Default language' - use_revisions: - type: boolean - label: 'User revisions' - description: - type: text - label: 'Description' - -field.field.*.*.*.third_party.profile: - type: mapping - label: 'Profile private' - mapping: - profile_private: - type: boolean - label: 'Whether this field is private or not.' - -action.configuration.profile_delete_action: - type: action_configuration_default - label: 'Delete profile configuration' - -action.configuration.profile_publish_action: - type: action_configuration_default - label: 'Publish selected profile configuration' - -action.configuration.profile_unpublish_action: - type: action_configuration_default - label: 'Unpublish selected profile configuration' diff --git a/sites/all/modules/contrib/users/profile/css/profile.base.css b/sites/all/modules/contrib/users/profile/css/profile.base.css deleted file mode 100644 index dde5e01a4..000000000 --- a/sites/all/modules/contrib/users/profile/css/profile.base.css +++ /dev/null @@ -1,11 +0,0 @@ -.profile-title { - font-weight: bold; -} - -.profile-item { - margin-bottom: 20px; -} - -.profile-item-action-links { - margin-bottom: 10px; -} diff --git a/sites/all/modules/contrib/users/profile/profile.info.yml b/sites/all/modules/contrib/users/profile/profile.info.yml deleted file mode 100644 index aa5c68101..000000000 --- a/sites/all/modules/contrib/users/profile/profile.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Profile -type: module -description: 'Provides configurable user profiles.' -# core: 8.x -configure: entity.profile_type.collection -dependencies: - - user - - entity - - field - - views - - system (>=8.1.0) - -# Information added by Drupal.org packaging script on 2017-09-19 -version: '8.x-1.0-rc1' -core: '8.x' -project: 'profile' -datestamp: 1505830148 diff --git a/sites/all/modules/contrib/users/profile/profile.install b/sites/all/modules/contrib/users/profile/profile.install deleted file mode 100644 index e4201c440..000000000 --- a/sites/all/modules/contrib/users/profile/profile.install +++ /dev/null @@ -1,36 +0,0 @@ -getDefinition('profile'); - - // Allow langcode field to be null. - $schema = \Drupal::database()->schema(); - if ($schema->fieldExists($definition->getBaseTable(), 'langcode')) { - $schema->changeField($definition->getBaseTable(), 'langcode', 'langcode', [ - 'type' => 'varchar', - 'length' => 12, - 'not null' => FALSE, - ]); - - // Set langcode field to null so it can be deleted. - \Drupal::database() - ->update($definition->getBaseTable()) - ->fields(['langcode' => NULL]) - ->execute(); - } - - $entity_definition_update = \Drupal::entityDefinitionUpdateManager(); - if ($storage_definition = $entity_definition_update->getFieldStorageDefinition('langcode', 'profile')) { - $entity_definition_update->uninstallFieldStorageDefinition($storage_definition); - } - - return t('Language code field uninstalled from profile entity.'); -} diff --git a/sites/all/modules/contrib/users/profile/profile.libraries.yml b/sites/all/modules/contrib/users/profile/profile.libraries.yml deleted file mode 100644 index 8b1a352b4..000000000 --- a/sites/all/modules/contrib/users/profile/profile.libraries.yml +++ /dev/null @@ -1,5 +0,0 @@ -drupal.profile-items: - version: VERSION - css: - component: - css/profile.base.css: {} diff --git a/sites/all/modules/contrib/users/profile/profile.links.action.yml b/sites/all/modules/contrib/users/profile/profile.links.action.yml deleted file mode 100644 index 0ed924ea8..000000000 --- a/sites/all/modules/contrib/users/profile/profile.links.action.yml +++ /dev/null @@ -1,5 +0,0 @@ -profile_type_add: - route_name: entity.profile_type.add_form - title: 'Add profile type' - appears_on: - - entity.profile_type.collection diff --git a/sites/all/modules/contrib/users/profile/profile.links.menu.yml b/sites/all/modules/contrib/users/profile/profile.links.menu.yml deleted file mode 100644 index 8556ad1b0..000000000 --- a/sites/all/modules/contrib/users/profile/profile.links.menu.yml +++ /dev/null @@ -1,11 +0,0 @@ -entity.profile.collection: - title: 'Profiles' - description: 'Manage user profiles.' - route_name: entity.profile.collection - parent: entity.user.collection - -entity.profile_type.collection: - title: 'Profile types' - description: 'Manage profile types, including fields.' - route_name: entity.profile_type.collection - parent: user.admin_index diff --git a/sites/all/modules/contrib/users/profile/profile.links.task.yml b/sites/all/modules/contrib/users/profile/profile.links.task.yml deleted file mode 100644 index 404ea939b..000000000 --- a/sites/all/modules/contrib/users/profile/profile.links.task.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Tabs on the user admin page -entity.profile.collection_tab: - route_name: entity.profile.collection - base_route: entity.user.collection - title: 'Profiles' - weight: 10 - -entity.profile_type.edit_form: - title: 'Edit' - route_name: entity.profile_type.edit_form - base_route: entity.profile_type.edit_form - -# Add tabs for each profile type -entity.profile.user_profile_form: - deriver: Drupal\profile\Plugin\Derivative\ProfileLocalTask diff --git a/sites/all/modules/contrib/users/profile/profile.module b/sites/all/modules/contrib/users/profile/profile.module deleted file mode 100644 index 8e8ef7dfc..000000000 --- a/sites/all/modules/contrib/users/profile/profile.module +++ /dev/null @@ -1,385 +0,0 @@ -' . t('About') . ''; - $output .= '

        ' . t('The Profile module provides a fieldable entity, that allows administrators to define different sets of fields for user profiles, which are then displayed in the My Account section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.', ['@user' => Url::fromRoute('user.page')->toString()]) . '

        '; - $output .= '
        '; - $output .= '
        ' . t('Types of profiles') . '
        '; - $output .= '
        ' . t('Profile types provide a way of grouping similar data for user profiles e.g. Personal information, Work etc. A default "Personal information type is provided. You may create more types and manage fields for each type from the Profile types admin page. When creating a new profile type, you will be able to specify whether a user may create multiple profiles or make the profile form available when registering a new user.', ['@profile-types' => Url::fromRoute('entity.profile_type.collection')->toString()]) . '
        '; - $output .= '
        ' . t('Creating profiles') . '
        '; - $output .= '
        ' . t('A user will see tabs they have access to, when editing their main user account e.g. "Add personal information profile". The visibility of a tab depends on whether they can create multiple profiles or if they haven\'t created a profile of the type that doesn\'t allow multiple instances.') . '
        '; - $output .= '
        '; - return $output; - } -} - -/** - * Implements hook_entity_field_access(). - */ -function profile_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) { - if ($operation == 'view' && $items && $field_definition->getTargetEntityTypeId() == 'profile') { - if ($field_definition instanceof FieldConfigInterface) { - $is_private = $field_definition->getThirdPartySetting('profile', 'profile_private', FALSE); - if ($is_private) { - // Users may see their own private profile fields by default, so this - // requires user granularity for caching. - /** @var \Drupal\profile\Entity\ProfileInterface $profile */ - $profile = $items->getEntity(); - if ($account->id() === $profile->getOwnerId()) { - return AccessResult::neutral(); - } - - return AccessResult::forbiddenIf(!$account->hasPermission('administer profile')); - } - } - } - return AccessResult::neutral(); -} - -/** - * Implements hook_theme(). - */ -function profile_theme() { - return [ - 'profile' => [ - 'render element' => 'elements', - ], - ]; -} - -/** - * Prepares variables for profile templates. - * - * Default template: profile.html.twig. - * - * @param array $variables - * An associative array containing: - * - elements: An associative array containing rendered fields. - * - attributes: HTML attributes for the containing element. - */ -function template_preprocess_profile(array &$variables) { - /** @var Drupal\profile\Entity\ProfileInterface $profile */ - $profile = $variables['elements']['#profile']; - - $variables['profile'] = $profile; - $variables['url'] = $profile->id() ? $profile->toUrl() : FALSE; - // Helpful $content variable for templates. - $variables['content'] = []; - foreach (Element::children($variables['elements']) as $key) { - $variables['content'][$key] = $variables['elements'][$key]; - } -} - -/** - * Implements hook_user_view(). - */ -function profile_user_view(array &$build, UserInterface $account, EntityViewDisplayInterface $display, $view_mode) { - // Iterate through each bundle and see if it's component exists. - foreach (ProfileType::loadMultiple() as $bundle) { - $component_key = 'profile_' . $bundle->id(); - if ($display->getComponent($component_key)) { - - // Embed the view of active profiles for profile type. - $build[$component_key] = [ - '#type' => 'view', - '#name' => 'profiles', - '#display_id' => 'user_view', - '#arguments' => [$account->id(), $bundle->id(), 1], - '#embed' => TRUE, - '#title' => $bundle->label(), - '#pre_render' => [ - ['\Drupal\views\Element\View', 'preRenderViewElement'], - 'profile_views_add_title_pre_render', - ], - ]; - } - } -} - -/** - * Implements hook_entity_extra_field_info(). - */ -function profile_entity_extra_field_info() { - $extra = []; - - // Add each profile type as an extra field for display. Not enabled by default - // as many sites will not need this and it otherwise also gets added - // automatically to other view modes. - /** @var \Drupal\profile\Entity\ProfileType $bundle */ - foreach (ProfileType::loadMultiple() as $bundle) { - $extra['user']['user']['display']['profile_' . $bundle->id()] = array( - 'label' => $bundle->label(), - 'description' => t('Display @type profiles', ['@type' => $bundle->label()]), - 'weight' => 10, - 'visible' => FALSE, - ); - } - return $extra; -} - -/** - * Implements hook_user_delete(). - */ -function profile_user_delete(EntityInterface $entity) { - $list = \Drupal::entityTypeManager() - ->getStorage('profile') - ->loadByProperties([ - 'uid' => $entity->id(), - ]); - - foreach ($list as $profile) { - $profile->delete(); - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function profile_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) { - $field = $form_state->getFormObject()->getEntity(); - if ($field->getTargetEntityTypeId() != 'profile') { - return; - } - - $form['field']['profile']['profile_private'] = [ - '#type' => 'checkbox', - '#title' => t('This is a private field.'), - '#default_value' => $field->getThirdPartySetting('profile', 'profile_private', FALSE), - ]; - $form['actions']['submit']['#submit'][] = 'profile_form_field_config_edit_form_submit'; -} - -/** - * Form submission handler for profile_form_field_config_edit_form_alter. - * - * @param array $form - * The form array. - * @param FormStateInterface $form_state - * The form state. - */ -function profile_form_field_config_edit_form_submit(array $form, FormStateInterface $form_state) { - $field = $form_state->getFormObject()->getEntity(); - $form_fields = &$form_state->getValues(); - - // If the private option is checked, update settings. - if ($form_fields['profile_private']) { - $field->setThirdPartySetting('profile', 'profile_private', TRUE); - $field->save(); - } - else { - $field->unsetThirdPartySetting('profile', 'profile_private'); - $field->save(); - } -} - -/** - * Implements hook_form_FORM_ID_alter(). - * - * Add available profile forms to the user registration form. - */ -function profile_form_user_register_form_alter(&$form, FormStateInterface $form_state) { - $attached_profile_form = FALSE; - $weight = 90; - - /** @var ProfileType[] $profile_types */ - $profile_types = ProfileType::loadMultiple(); - foreach ($profile_types as $profile_type) { - $instances = array_filter(\Drupal::service('entity_field.manager')->getFieldDefinitions('profile', $profile_type->id()), function ($field_definition) { - return $field_definition instanceof FieldConfigInterface; - }); - - if ($profile_type->getRegistration() === TRUE && count($instances)) { - $property = ['profiles', $profile_type->id()]; - $profile = $form_state->get($property); - if (empty($profile)) { - $profile = Profile::create([ - 'type' => $profile_type->id(), - 'langcode' => $profile_type->language() ? $profile_type->language() : \Drupal::languageManager()->getDefaultLanguage()->getId(), - ]); - - // Attach profile entity form. - $form_state->set($property, $profile); - } - $form_state->set('form_display_' . $profile_type->id(), EntityFormDisplay::collectRenderDisplay($profile, 'default')); - $form['entity_' . $profile_type->id()] = [ - '#type' => 'details', - '#title' => $profile_type->label(), - '#tree' => TRUE, - '#parents' => ['entity_' . $profile_type->id()], - '#weight' => ++$weight, - '#open' => TRUE, - ]; - - // @see https://www.drupal.org/node/2871480. - if (\Drupal::moduleHandler()->moduleExists('field_group')) { - $context = [ - 'entity_type' => $profile->getEntityTypeId(), - 'bundle' => $profile->bundle(), - 'entity' => $profile, - 'context' => 'form', - 'display_context' => 'form', - 'mode' => 'default', - ]; - - field_group_attach_groups($form['entity_' . $profile_type->id()], $context); - $form['entity_' . $profile_type->id()]['#pre_render'][] = 'field_group_form_pre_render'; - } - - $form_state - ->get('form_display_' . $profile_type->id()) - ->buildForm($profile, $form['entity_' . $profile_type->id()], $form_state); - - $attached_profile_form = TRUE; - } - } - - if ($attached_profile_form) { - $form['actions']['submit']['#validate'][] = 'profile_form_user_register_form_validate'; - $form['actions']['submit']['#submit'][] = 'profile_form_user_register_form_submit'; - } -} - -/** - * Extra form validation handler for the user registration form. - */ -function profile_form_user_register_form_validate(array &$form, FormStateInterface $form_state) { - $profiles = $form_state->get('profiles'); - if (!empty($profiles)) { - foreach ($profiles as $bundle => $entity) { - /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ - $form_display = $form_state->get('form_display_' . $bundle); - if (isset($form['entity_' . $bundle])) { - $form_display->extractFormValues($entity, $form['entity_' . $bundle], $form_state); - $form_display->validateFormValues($entity, $form['entity_' . $bundle], $form_state); - } - } - } - // Entity was validated in entityFormValidate(). This will prevent validation - // exception from being thrown. - $form_state->getFormObject()->validateForm($form, $form_state); -} - -/** - * Extra form submission handler for the user registration form. - */ -function profile_form_user_register_form_submit(array &$form, FormStateInterface $form_state) { - /** @var \Drupal\Core\Session\AccountInterface $account */ - $account = $form_state->getFormObject()->getEntity(); - $profiles = $form_state->get('profiles'); - if (!empty($profiles)) { - foreach ($profiles as $bundle => $entity) { - $entity->setOwnerId($account->id()); - $entity->setActive(TRUE); - $entity->save(); - } - } -} - -/** - * Pre render callback for profile embedded views to ensure a title is set. - * @param $element - * - * @return mixed - */ -function profile_views_add_title_pre_render($element) { - /** @var \Drupal\views\ViewExecutable $view */ - if (isset($element['#title'])) { - $view = $element['view_build']['#view']; - if (!empty($view->result)) { - $view->setTitle($element['#title']); - } - } - - return $element; -} - -/** - * Implements hook_preprocess_HOOK(). - */ -function profile_preprocess_views_view(&$variables) { - // We have to manually add back the title since it was removed by Views. - // @see template_preprocess_views_view() - /** @var \Drupal\views\ViewExecutable $view */ - $view = $variables['view']; - if ($view->storage->id() == 'profiles' && !empty($view->result)) { - // Test access to the profile. - /** @var \Drupal\profile\Entity\profile $entity */ - $entity = reset($view->result)->_entity; - if ($entity->access('view')) { - $variables['title'] = $view->getTitle(); - } - } -} - -/** - * Implements hook_views_data_alter(). - * - * Adds a relationship from the user table to its' profile entity. - */ -function profile_views_data_alter(&$data) { - $data['users_field_data']['profile']['relationship'] = [ - 'title' => t('Profile'), - 'label' => t('Profile'), - 'group' => 'User', - 'help' => t('Reference to the profile of a user.'), - 'id' => 'standard', - 'base' => 'profile', - 'base field' => 'uid', - 'field' => 'uid', - ]; - $data['users_field_data']['profile_type']['relationship'] = [ - 'title' => t('Profile Type'), - 'label' => t('Profile Type'), - 'group' => 'User', - 'help' => t('Reference to a specific profile type of a user.'), - 'id' => 'profile_relationship', - 'base' => 'profile', - 'base field' => 'uid', - 'field' => 'uid', - ]; -} - -/** - * Implements hook_theme_suggestions_HOOK(). - */ -function profile_theme_suggestions_profile(array $variables) { - $original = $variables['theme_hook_original']; - $entity = $variables['elements']['#profile']; - $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_'); - - $suggestions = []; - $suggestions[] = $original; - $suggestions[] = $original . '__' . $sanitized_view_mode; - $suggestions[] = $original . '__' . $entity->bundle(); - $suggestions[] = $original . '__' . $entity->bundle() . '__' . $sanitized_view_mode; - $suggestions[] = $original . '__' . $entity->id(); - $suggestions[] = $original . '__' . $entity->id() . '__' . $sanitized_view_mode; - - return $suggestions; -} diff --git a/sites/all/modules/contrib/users/profile/profile.permissions.yml b/sites/all/modules/contrib/users/profile/profile.permissions.yml deleted file mode 100644 index 2243cce2f..000000000 --- a/sites/all/modules/contrib/users/profile/profile.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -administer profile types: - title: 'Administer profile types' - restrict access: true diff --git a/sites/all/modules/contrib/users/profile/profile.routing.yml b/sites/all/modules/contrib/users/profile/profile.routing.yml deleted file mode 100644 index bd7dce8bd..000000000 --- a/sites/all/modules/contrib/users/profile/profile.routing.yml +++ /dev/null @@ -1,67 +0,0 @@ -# edit_form, delete_form routes are generated by DefaultHtmlRouteProvider. -entity.profile.collection: - path: '/admin/people/profiles' - defaults: - _entity_list: 'profile' - _title: 'Profiles' - requirements: - _permission: 'administer profile' - -entity.profile_type.collection: - path: '/admin/config/people/profiles' - defaults: - _entity_list: 'profile_type' - _title: 'Profile types' - requirements: - _permission: 'administer profile types' - -entity.profile_type.add_form: - path: '/admin/config/people/profiles/add' - defaults: - _entity_form: profile_type.add - _title: 'Add' - requirements: - _permission: 'administer profile types' - -entity.profile.type.user_profile_form: - path: '/user/{user}/{profile_type}' - defaults: - _controller: '\Drupal\profile\Controller\ProfileController::userProfileForm' - _title_callback: '\Drupal\profile\Controller\ProfileController::addPageTitle' - requirements: - _profile_access_check: 'add' - -entity.profile.type.user_profile_form.add: - path: '/user/{user}/{profile_type}/add' - defaults: - _controller: '\Drupal\profile\Controller\ProfileController::addProfile' - _title_callback: '\Drupal\profile\Controller\ProfileController::addPageTitle' - requirements: - _profile_access_check: 'add' - -entity.profile.canonical: - path: '/profile/{profile}' - defaults: - _controller: '\Drupal\profile\Controller\ProfileViewController::view' - _title_callback: '\Drupal\profile\Controller\ProfileViewController::title' - requirements: - _entity_access: 'profile.view' - -entity.profile.multiple_delete_confirm: - path: '/admin/content/profile/delete' - defaults: - _form: '\Drupal\profile\Form\DeleteMultiple' - requirements: - _permission: 'administer profile' - -entity.profile.set_default: - path: '/profile/{profile}/set-default' - defaults: - _controller: '\Drupal\profile\Controller\ProfileController::setDefault' - options: - parameters: - profile: - type: entity:profile - requirements: - _entity_access: 'profile.update' - _csrf_token: 'TRUE' diff --git a/sites/all/modules/contrib/users/profile/profile.services.yml b/sites/all/modules/contrib/users/profile/profile.services.yml deleted file mode 100644 index 97b7ed71b..000000000 --- a/sites/all/modules/contrib/users/profile/profile.services.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - - access_check.profile_type.profile_access: - class: Drupal\profile\Access\ProfileAccessCheck - arguments: ['@entity.manager'] - tags: - - { name: access_check, applies_to: _profile_access_check } diff --git a/sites/all/modules/contrib/users/profile/src/Access/ProfileAccessCheck.php b/sites/all/modules/contrib/users/profile/src/Access/ProfileAccessCheck.php deleted file mode 100644 index 80e817452..000000000 --- a/sites/all/modules/contrib/users/profile/src/Access/ProfileAccessCheck.php +++ /dev/null @@ -1,59 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * Checks access to the profile add page for the profile type. - * - * @param \Symfony\Component\Routing\Route $route - * The route to check against. - * @param \Drupal\Core\Session\AccountInterface $account - * The currently logged in account. - * @param \Drupal\Core\Session\AccountInterface $user - * The user entity. - * @param \Drupal\profile\Entity\ProfileTypeInterface $profile_type - * The profile type entity. - * - * @return bool|\Drupal\Core\Access\AccessResultInterface - * The access result. - */ - public function access(Route $route, AccountInterface $account, AccountInterface $user, ProfileTypeInterface $profile_type) { - if ($account->hasPermission('administer profile types')) { - return AccessResult::allowed()->cachePerPermissions(); - } - $own_any = ($account->id() == $user->id()) ? 'own' : 'any'; - $operation = ($profile_type->getMultiple()) ? 'view' : 'update'; - - return AccessResult::allowedIfHasPermission($account, "$operation $own_any {$profile_type->id()} profile"); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Controller/ProfileController.php b/sites/all/modules/contrib/users/profile/src/Controller/ProfileController.php deleted file mode 100644 index 7ecb50476..000000000 --- a/sites/all/modules/contrib/users/profile/src/Controller/ProfileController.php +++ /dev/null @@ -1,179 +0,0 @@ -entityTypeManager()->getStorage('profile')->create([ - 'uid' => $user->id(), - 'type' => $profile_type->id(), - ]); - - return $this->entityFormBuilder()->getForm($profile, 'add', ['uid' => $user->id(), 'created' => REQUEST_TIME]); - } - - /** - * Provides the profile edit form. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * @param \Drupal\user\UserInterface $user - * The user account. - * @param \Drupal\profile\Entity\ProfileInterface $profile - * The profile entity to edit. - * - * @return array - * The profile edit form. - */ - public function editProfile(RouteMatchInterface $route_match, UserInterface $user, ProfileInterface $profile) { - return $this->entityFormBuilder()->getForm($profile, 'edit'); - } - - /** - * Provides profile delete form. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * @param \Drupal\user\UserInterface $user - * The user account. - * @param \Drupal\profile\Entity\ProfileTypeInterface $profile_type - * The profile type entity for the profile. - * @param int $id - * The id of the profile to delete. - * - * @return array - * Returns form array. - */ - public function deleteProfile(RouteMatchInterface $route_match, UserInterface $user, ProfileTypeInterface $profile_type, $id) { - return $this->entityFormBuilder()->getForm(Profile::load($id), 'delete'); - } - - /** - * The _title_callback for the add profile form route. - * - * @param \Drupal\profile\Entity\ProfileTypeInterface $profile_type - * The current profile type. - * - * @return string - * The page title. - */ - public function addPageTitle(ProfileTypeInterface $profile_type) { - // @todo: edit profile uses this form too? - return $this->t('Create @label', ['@label' => $profile_type->label()]); - } - - /** - * Provides profile create form. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. - * @param \Drupal\user\UserInterface $user - * The user account. - * @param \Drupal\profile\Entity\ProfileTypeInterface $profile_type - * The profile type entity for the profile. - * - * @return array - * Returns form array. - */ - public function userProfileForm(RouteMatchInterface $route_match, UserInterface $user, ProfileTypeInterface $profile_type) { - /** @var \Drupal\profile\Entity\ProfileType $profile_type */ - - /** @var \Drupal\profile\Entity\ProfileInterface|bool $active_profile */ - $active_profile = $this->entityTypeManager() - ->getStorage('profile') - ->loadByUser($user, $profile_type->id()); - - // If the profile type does not support multiple, only display an add form - // if there are no entities, or an edit for the current. - if (!$profile_type->getMultiple()) { - - // If there is an active profile, provide edit form. - if ($active_profile) { - return $this->editProfile($route_match, $user, $active_profile); - } - - // Else show the add form. - return $this->addProfile($route_match, $user, $profile_type); - } - // Display active, and link to create a profile. - else { - $build = []; - - // If there is no active profile, display add form. - if (!$active_profile) { - return $this->addProfile($route_match, $user, $profile_type); - } - - $build['add_profile'] = Link::createFromRoute( - $this->t('Add new @type', ['@type' => $profile_type->label()]), - 'entity.profile.type.user_profile_form.add', - ['user' => $user->id(), 'profile_type' => $profile_type->id()]) - ->toRenderable(); - - // Render the active profiles. - $build['active_profiles'] = [ - '#type' => 'view', - '#name' => 'profiles', - '#display_id' => 'profile_type_listing', - '#arguments' => [$user->id(), $profile_type->id(), 1], - '#embed' => TRUE, - '#title' => $this->t('Active @type', ['@type' => $profile_type->label()]), - '#pre_render' => [ - ['\Drupal\views\Element\View', 'preRenderViewElement'], - 'profile_views_add_title_pre_render', - ], - ]; - - return $build; - } - } - - /** - * Mark profile as default. - * - * @param \Drupal\Core\Routing\RouteMatchInterface $routeMatch - * The route match. - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse - * A redirect back to the currency listing. - */ - public function setDefault(RouteMatchInterface $routeMatch) { - /** @var \Drupal\profile\Entity\ProfileInterface $profile */ - $profile = $routeMatch->getParameter('profile'); - $profile->setDefault(TRUE); - $profile->save(); - - drupal_set_message($this->t('The %label profile has been marked as default.', ['%label' => $profile->label()])); - - $url = $profile->toUrl('collection'); - return $this->redirect($url->getRouteName(), $url->getRouteParameters(), $url->getOptions()); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Controller/ProfileViewController.php b/sites/all/modules/contrib/users/profile/src/Controller/ProfileViewController.php deleted file mode 100644 index b99985dcf..000000000 --- a/sites/all/modules/contrib/users/profile/src/Controller/ProfileViewController.php +++ /dev/null @@ -1,61 +0,0 @@ - \Drupal::entityTypeManager() - ->getViewBuilder($profile->getEntityTypeId()) - ->view($profile, $view_mode, $langcode), - ]; - $build['#title'] = $profile->label(); - - foreach ($profile->uriRelationships() as $rel) { - // Set the profile path as the canonical URL to prevent duplicate content. - $build['#attached']['html_head_link'][] = [ - [ - 'rel' => $rel, - 'href' => $profile->toUrl($rel)->toString(), - ], - TRUE, - ]; - - if ($rel == 'canonical') { - // Set the non-aliased canonical path as a default shortlink. - $build['#attached']['html_head_link'][] = [ - [ - 'rel' => 'shortlink', - 'href' => $profile->toUrl($rel, ['alias' => TRUE])->toString(), - ], - TRUE, - ]; - } - } - return $build; - } - - /** - * The _title_callback for the page that renders a profile entity. - * - * @param \Drupal\Core\Entity\EntityInterface $profile - * The current profile. - * - * @return string - * The page title. - */ - public function title(EntityInterface $profile) { - return $this->entityManager->getTranslationFromContext($profile)->label(); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Entity/Profile.php b/sites/all/modules/contrib/users/profile/src/Entity/Profile.php deleted file mode 100644 index bc8e09778..000000000 --- a/sites/all/modules/contrib/users/profile/src/Entity/Profile.php +++ /dev/null @@ -1,293 +0,0 @@ -bundle()); - $label = $this->t('@type profile #@id', [ - '@type' => $profile_type->label(), - '@id' => $this->id(), - ]); - // Allow the label to be overridden. - $event = new ProfileLabelEvent($this, $label); - $event_dispatcher = \Drupal::service('event_dispatcher'); - $event_dispatcher->dispatch(ProfileEvents::PROFILE_LABEL, $event); - $label = $event->getLabel(); - - return $label; - } - - /** - * {@inheritdoc} - */ - public function getOwnerId() { - return $this->get('uid')->target_id; - } - - /** - * {@inheritdoc} - */ - public function setOwnerId($uid) { - $this->set('uid', $uid); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getOwner() { - return $this->get('uid')->entity; - } - - /** - * {@inheritdoc} - */ - public function setOwner(UserInterface $account) { - $this->set('uid', $account->id()); - return $this; - } - - /** - * {@inheritdoc} - */ - public function isActive() { - return (bool) $this->get('status')->value; - } - - /** - * {@inheritdoc} - */ - public function setActive($active) { - $this->set('status', (bool) $active); - return $this; - } - - /** - * {@inheritdoc} - */ - public function isDefault() { - return (bool) $this->get('is_default')->value; - } - - /** - * {@inheritdoc} - */ - public function setDefault($is_default) { - $this->set('is_default', (bool) $is_default); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getCreatedTime() { - return $this->get('created')->value; - } - - /** - * {@inheritdoc} - */ - public function setCreatedTime($timestamp) { - $this->set('created', $timestamp); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getRevisionCreationTime() { - return $this->get('revision_timestamp')->value; - } - - /** - * {@inheritdoc} - */ - public function setRevisionCreationTime($timestamp) { - $this->set('revision_timestamp', $timestamp); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getRevisionAuthor() { - return $this->get('revision_uid')->entity; - } - - /** - * {@inheritdoc} - */ - public function setRevisionAuthorId($uid) { - $this->set('revision_uid', $uid); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getCacheTagsToInvalidate() { - $tags = parent::getCacheTagsToInvalidate(); - return Cache::mergeTags($tags, [ - 'user:' . $this->getOwnerId(), - 'user_view', - ]); - } - - /** - * {@inheritdoc} - */ - public function preSave(EntityStorageInterface $storage) { - /** @var \Drupal\profile\ProfileStorage $storage */ - parent::preSave($storage); - - // If this profile is active and the owner has no current default profile - // of this type, set this as the default. - if ($this->getOwner()) { - if ($this->isActive() && !$this->isDefault()) { - if (!$storage->loadDefaultByUser($this->getOwner(), $this->bundle())) { - $this->setDefault(TRUE); - } - } - // Only active profiles can be default. - elseif (!$this->isActive()) { - $this->setDefault(FALSE); - } - } - } - - /** - * {@inheritdoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - /** @var \Drupal\profile\ProfileStorage $storage */ - parent::postSave($storage, $update); - - // Check if this profile is, or became the default. - if ($this->getOwner()) { - if ($this->isDefault()) { - /** @var \Drupal\profile\Entity\ProfileInterface[] $profiles */ - $profiles = $storage->loadMultipleByUser($this->getOwner(), $this->bundle()); - - // Ensure that all other profiles are set to not default. - foreach ($profiles as $profile) { - if ($profile->id() != $this->id() && $profile->isDefault()) { - $profile->setDefault(FALSE); - $profile->save(); - } - } - } - // If this isn't the default, try to set a new one. - elseif (!$storage->loadDefaultByUser($this->getOwner(), $this->bundle())) { - /** @var \Drupal\profile\Entity\ProfileInterface $profile */ - if ($profile = $storage->loadByUser($this->getOwner(), $this->bundle())) { - $profile->setDefault(TRUE); - $profile->save(); - } - } - } - } - - /** - * {@inheritdoc} - */ - public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { - $fields = parent::baseFieldDefinitions($entity_type); - - $fields['uid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Owner')) - ->setDescription(t('The user that owns this profile.')) - ->setRevisionable(TRUE) - ->setSetting('target_type', 'user') - ->setSetting('handler', 'default'); - - $fields['status'] = BaseFieldDefinition::create('boolean') - ->setLabel(t('Active')) - ->setDescription(t('Whether the profile is active.')) - ->setDefaultValue(TRUE) - ->setRevisionable(TRUE); - - $fields['is_default'] = BaseFieldDefinition::create('boolean') - ->setLabel(t('Default')) - ->setDescription(t('Whether this is the default profile.')) - ->setRevisionable(TRUE); - - $fields['created'] = BaseFieldDefinition::create('created') - ->setLabel(t('Created')) - ->setDescription(t('The time when the profile was created.')) - ->setRevisionable(TRUE); - - $fields['changed'] = BaseFieldDefinition::create('changed') - ->setLabel(t('Changed')) - ->setDescription(t('The time when the profile was last edited.')) - ->setRevisionable(TRUE); - - return $fields; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Entity/ProfileInterface.php b/sites/all/modules/contrib/users/profile/src/Entity/ProfileInterface.php deleted file mode 100644 index b678e7967..000000000 --- a/sites/all/modules/contrib/users/profile/src/Entity/ProfileInterface.php +++ /dev/null @@ -1,108 +0,0 @@ -registration; - } - - /** - * {@inheritdoc} - */ - public function setRegistration($registration) { - $this->registration = $registration; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getMultiple() { - return $this->multiple; - } - - /** - * {@inheritdoc} - */ - public function setMultiple($multiple) { - $this->multiple = $multiple; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getRoles() { - return $this->roles; - } - - /** - * {@inheritdoc} - */ - public function setRoles(array $roles) { - $this->roles = $roles; - return $this; - } - - /** - * {@inheritdoc} - */ - public function getWeight() { - return $this->weight; - } - - /** - * {@inheritdoc} - */ - public function setWeight($weight) { - $this->weight = $weight; - return $this; - } - - /** - * {@inheritdoc} - */ - public function shouldCreateNewRevision() { - return $this->use_revisions; - } - - /** - * {@inheritdoc} - */ - public function getDescription() { - return $this->description; - } - - /** - * {@inheritdoc} - */ - public function setDescription($description) { - $this->description = $description; - return $this; - } - - /** - * {@inheritdoc} - */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - parent::postSave($storage, $update); - - // Rebuild module data to generate bundle permissions and link tasks. - if (!$update) { - system_rebuild_module_data(); - } - } -} diff --git a/sites/all/modules/contrib/users/profile/src/Entity/ProfileTypeInterface.php b/sites/all/modules/contrib/users/profile/src/Entity/ProfileTypeInterface.php deleted file mode 100644 index a81ab8f82..000000000 --- a/sites/all/modules/contrib/users/profile/src/Entity/ProfileTypeInterface.php +++ /dev/null @@ -1,75 +0,0 @@ -profile = $profile; - $this->label = $label; - } - - /** - * Gets the profile. - * - * @return \Drupal\profile\Entity\ProfileInterface - * The profile. - */ - public function getProfile() { - return $this->profile; - } - - /** - * Gets the profile label. - * - * @return string - * The profile label. - */ - public function getLabel() { - return $this->label; - } - - /** - * Sets the profile label. - * - * @param string $label - * The profile label. - * - * @return $this - */ - public function setLabel($label) { - $this->label = $label; - return $this; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Form/DeleteMultiple.php b/sites/all/modules/contrib/users/profile/src/Form/DeleteMultiple.php deleted file mode 100644 index 3bf73ecb0..000000000 --- a/sites/all/modules/contrib/users/profile/src/Form/DeleteMultiple.php +++ /dev/null @@ -1,124 +0,0 @@ -privateTempStoreFactory = $temp_store_factory; - $this->storage = $manager->getStorage('profile'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('user.private_tempstore'), - $container->get('entity.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'profile_multiple_delete_confirm'; - } - - /** - * {@inheritdoc} - */ - public function getQuestion() { - return \Drupal::translation()->formatPlural(count($this->profiles), 'Are you sure you want to delete this profile?', 'Are you sure you want to delete these profiles?'); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - return new Url('entity.profile.collection'); - } - - /** - * {@inheritdoc} - */ - public function getConfirmText() { - return $this->t('Delete'); - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - $this->profiles = $this->privateTempStoreFactory->get('profile_multiple_delete_confirm')->get(\Drupal::currentUser()->id()); - if (empty($this->profiles)) { - return new RedirectResponse(Url::fromRoute('entity.profile.collection', [], ['absolute' => TRUE])); - } - - $form['profiles'] = [ - '#theme' => 'item_list', - '#items' => array_map(function ($profile) { - return $profile->label(); - }, $this->profiles), - ]; - $form = parent::buildForm($form, $form_state); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - if ($form_state->getValue('confirm') && !empty($this->profiles)) { - $this->storage->delete($this->profiles); - $this->privateTempStoreFactory->get('profile_multiple_delete_confirm')->delete(\Drupal::currentUser()->id()); - $count = count($this->profiles); - $this->logger('content')->notice('Deleted @count profiles.', ['@count' => $count]); - drupal_set_message(\Drupal::translation()->formatPlural($count, 'Deleted 1 profile.', 'Deleted @count profiles.')); - } - $form_state->setRedirect('entity.profile.collection'); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Form/ProfileDeleteForm.php b/sites/all/modules/contrib/users/profile/src/Form/ProfileDeleteForm.php deleted file mode 100644 index 9d4dc2787..000000000 --- a/sites/all/modules/contrib/users/profile/src/Form/ProfileDeleteForm.php +++ /dev/null @@ -1,53 +0,0 @@ -t('Are you sure you want to delete %label?', [ - '%label' => $this->getEntity()->label(), - ]); - } - - /** - * {@inheritdoc} - */ - protected function getDeletionMessage() { - $entity = $this->getEntity(); - return $this->t('%label has been deleted.', [ - '%label' => $entity->label(), - ]); - } - - /** - * {@inheritdoc} - */ - public function getCancelUrl() { - /** @var \Drupal\profile\Entity\ProfileInterface $entity */ - $entity = $this->entity; - if ($entity->getOwnerId()) { - return Url::fromRoute('entity.user.canonical', [ - 'user' => $entity->getOwnerId(), - ]); - } - return Url::fromRoute('entity.profile.collection'); - } - - /** - * {@inheritdoc} - */ - protected function getRedirectUrl() { - return $this->getCancelUrl(); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Form/ProfileForm.php b/sites/all/modules/contrib/users/profile/src/Form/ProfileForm.php deleted file mode 100644 index eefdddc51..000000000 --- a/sites/all/modules/contrib/users/profile/src/Form/ProfileForm.php +++ /dev/null @@ -1,102 +0,0 @@ -entity; - - $profile_type_storage = $this->entityTypeManager->getStorage('profile_type'); - /** @var \Drupal\profile\Entity\ProfileTypeInterface $profile_type */ - $profile_type = $profile_type_storage->load($profile->bundle()); - - // Allow the profile to be saved as default if type supports multiple. - if ($profile_type->getMultiple() && !$profile->isDefault()) { - // Add a "make default" button. - $element['set_default'] = $element['submit']; - $element['set_default']['#value'] = $this->t('Save and make default'); - $element['set_default']['#weight'] = 10; - array_unshift($element['set_default']['#submit'], [$this, 'setDefault']); - } - - return $element; - } - - /** - * Form submission handler for the 'set_default' action. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * A reference to a keyed array containing the current state of the form. - */ - public function setDefault(array $form, FormStateInterface $form_state) { - $form_state->setValue('is_default', TRUE); - } - - /** - * Form submission handler for the 'deactivate' action. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * A reference to a keyed array containing the current state of the form. - */ - public function deactivate(array $form, FormStateInterface $form_state) { - $form_state->setValue('status', FALSE); - } - - /** - * {@inheritdoc} - */ - public function buildEntity(array $form, FormStateInterface $form_state) { - /** @var \Drupal\profile\Entity\ProfileInterface $entity */ - $entity = parent::buildEntity($form, $form_state); - - // Mark a new revision if the profile type enforces revisions. - /** @var \Drupal\profile\Entity\ProfileTypeInterface $profile_type */ - $profile_type = $this->entityTypeManager->getStorage('profile_type')->load($entity->bundle()); - $entity->setNewRevision($profile_type->shouldCreateNewRevision()); - - return $entity; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - switch ($this->entity->save()) { - case SAVED_NEW: - drupal_set_message($this->t('%label has been created.', ['%label' => $this->entity->label()])); - break; - - case SAVED_UPDATED: - drupal_set_message($this->t('%label has been updated.', ['%label' => $this->entity->label()])); - break; - } - - if ($this->entity->getOwnerId()) { - $form_state->setRedirect('entity.user.canonical', [ - 'user' => $this->entity->getOwnerId(), - ]); - } - else { - $form_state->setRedirect('entity.profile.collection'); - } - - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Form/ProfileTypeDeleteForm.php b/sites/all/modules/contrib/users/profile/src/Form/ProfileTypeDeleteForm.php deleted file mode 100644 index e16493bf3..000000000 --- a/sites/all/modules/contrib/users/profile/src/Form/ProfileTypeDeleteForm.php +++ /dev/null @@ -1,32 +0,0 @@ -entityTypeManager->getStorage('profile')->getQuery() - ->condition('type', $this->entity->id()) - ->count() - ->execute(); - if ($num_profiles) { - $caption = '

        ' . \Drupal::translation() - ->formatPlural($num_profiles, '%type is used by 1 profile on your site. You can not remove this profile type until you have removed all of the %type profiles.', '%type is used by @count profiles on your site. You may not remove %type until you have removed all of the %type profiles.', ['%type' => $this->entity->label()]) . '

        '; - $form['#title'] = $this->getQuestion(); - $form['description'] = ['#markup' => $caption]; - return $form; - } - - return parent::buildForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Form/ProfileTypeForm.php b/sites/all/modules/contrib/users/profile/src/Form/ProfileTypeForm.php deleted file mode 100644 index 0084b4cc5..000000000 --- a/sites/all/modules/contrib/users/profile/src/Form/ProfileTypeForm.php +++ /dev/null @@ -1,138 +0,0 @@ -entity; - - if ($this->operation == 'add') { - $form['#title'] = $this->t('Add profile type'); - } - else { - $form['#title'] = $this->t('Edit %label profile type', ['%label' => $type->label()]); - } - - $form['label'] = [ - '#title' => t('Label'), - '#type' => 'textfield', - '#default_value' => $type->label(), - '#description' => t('The human-readable name of this profile type.'), - '#required' => TRUE, - '#size' => 30, - ]; - $form['id'] = [ - '#type' => 'machine_name', - '#default_value' => $type->id(), - '#maxlength' => EntityTypeInterface::BUNDLE_MAX_LENGTH, - '#machine_name' => [ - 'exists' => '\Drupal\profile\Entity\ProfileType::load', - 'source' => ['label'], - ], - ]; - $form['description'] = [ - '#title' => $this->t('Description'), - '#type' => 'textarea', - '#default_value' => $type->getDescription(), - '#description' => $this->t('This text will be displayed only for administrative purposes.'), - ]; - $form['registration'] = [ - '#type' => 'checkbox', - '#title' => t('Include in user registration form'), - '#default_value' => $type->getRegistration(), - ]; - $form['multiple'] = [ - '#type' => 'checkbox', - '#title' => t('Allow multiple profiles'), - '#default_value' => $type->getMultiple(), - ]; - - $form['roles'] = [ - '#type' => 'checkboxes', - '#title' => t('Allowed roles'), - '#description' => $this->t('Limit the users that can have this profile by role.
        None will indicate that all users can have this profile type.'), - '#options' => [], - '#default_value' => $type->getRoles(), - ]; - foreach (Role::loadMultiple() as $role) { - /** @var \Drupal\user\Entity\Role $role */ - // We aren't interested in anon role. - if ($role->id() !== Role::ANONYMOUS_ID) { - $form['roles']['#options'][$role->id()] = $role->label(); - } - } - - $form['use_revisions'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Create a new revision when a profile is modified'), - '#default_value' => $type->shouldCreateNewRevision(), - ]; - - return $this->protectBundleIdElement($form); - } - - /** - * {@inheritdoc} - */ - protected function actions(array $form, FormStateInterface $form_state) { - $actions = parent::actions($form, $form_state); - if (\Drupal::moduleHandler()->moduleExists('field_ui') && - $this->getEntity()->isNew() - ) { - $actions['save_continue'] = $actions['submit']; - $actions['save_continue']['#value'] = $this->t('Save and manage fields'); - $actions['save_continue']['#submit'][] = [$this, 'redirectToFieldUi']; - } - return $actions; - } - - /** - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { - $type = $this->entity; - $status = $type->save(); - - if ($status == SAVED_UPDATED) { - drupal_set_message($this->t('%label profile type has been updated.', ['%label' => $type->label()])); - } - else { - drupal_set_message($this->t('%label profile type has been created.', ['%label' => $type->label()])); - } - $form_state->setRedirect('entity.profile_type.collection'); - } - - /** - * Form submission handler to redirect to Manage fields page of Field UI. - */ - public function redirectToFieldUi(array $form, FormStateInterface $form_state) { - if ($form_state->getTriggeringElement()['#parents'][0] === 'save_continue' && $route_info = FieldUI::getOverviewRouteInfo('profile', $this->entity->id())) { - $form_state->setRedirectUrl($route_info); - } - } - - /** - * {@inheritdoc} - */ - public function delete(array $form, FormStateInterface $form_state) { - $form_state->setRedirect('entity.profile_type.delete_form', [ - 'profile_type' => $this->entity->id(), - ]); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/Action/DeleteProfile.php b/sites/all/modules/contrib/users/profile/src/Plugin/Action/DeleteProfile.php deleted file mode 100644 index 6b2ec57bb..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/Action/DeleteProfile.php +++ /dev/null @@ -1,77 +0,0 @@ -privateTempStore = $private_temp_store->get('profile_multiple_delete_confirm'); - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition, $container->get('user.private_tempstore')); - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $entities) { - $this->privateTempStore->set(\Drupal::currentUser()->id(), $entities); - } - - /** - * {@inheritdoc} - */ - public function execute($object = NULL) { - $this->executeMultiple([$object]); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - /** @var \Drupal\profile\Entity\ProfileInterface $object */ - return $object->access('delete', $account, $return_as_object); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/Action/PublishProfile.php b/sites/all/modules/contrib/users/profile/src/Plugin/Action/PublishProfile.php deleted file mode 100644 index 2a62437ca..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/Action/PublishProfile.php +++ /dev/null @@ -1,39 +0,0 @@ -setActive(TRUE); - $entity->save(); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - /** @var \Drupal\profile\Entity\ProfileInterface $object */ - $result = $object->access('update', $account, TRUE) - ->andIf($object->status->access('edit', $account, TRUE)); - - return $return_as_object ? $result : $result->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/Action/UnpublishProfile.php b/sites/all/modules/contrib/users/profile/src/Plugin/Action/UnpublishProfile.php deleted file mode 100644 index dea0dde9a..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/Action/UnpublishProfile.php +++ /dev/null @@ -1,39 +0,0 @@ -setActive(FALSE); - $entity->save(); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - /** @var \Drupal\profile\Entity\ProfileInterface $object */ - $access = $object->access('update', $account, TRUE) - ->andIf($object->status->access('edit', $account, TRUE)); - - return $return_as_object ? $access : $access->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/Derivative/ProfileLocalTask.php b/sites/all/modules/contrib/users/profile/src/Plugin/Derivative/ProfileLocalTask.php deleted file mode 100644 index c5007064f..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/Derivative/ProfileLocalTask.php +++ /dev/null @@ -1,66 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_definition) { - return new static( - $base_plugin_definition, - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - $this->derivatives = []; - - // Starting weight for ordering the local tasks. - $weight = 10; - - foreach ($this->entityTypeManager->getStorage('profile_type')->loadMultiple() as $profile_type_id => $profile_type) { - $this->derivatives["profile.type.$profile_type_id"] = [ - 'title' => $profile_type->label(), - 'route_name' => 'entity.profile.type.user_profile_form', - 'base_route' => 'entity.user.canonical', - 'route_parameters' => ['profile_type' => $profile_type_id], - 'weight' => ++$weight, - ] + $base_plugin_definition; - } - - return $this->derivatives; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/EntityReferenceSelection/ProfileSelection.php b/sites/all/modules/contrib/users/profile/src/Plugin/EntityReferenceSelection/ProfileSelection.php deleted file mode 100644 index a3e4bca68..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/EntityReferenceSelection/ProfileSelection.php +++ /dev/null @@ -1,30 +0,0 @@ -t('Profile types'); - return $form; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/search_api/processor/ProfileUserStatus.php b/sites/all/modules/contrib/users/profile/src/Plugin/search_api/processor/ProfileUserStatus.php deleted file mode 100644 index 3a7d0ceb2..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/search_api/processor/ProfileUserStatus.php +++ /dev/null @@ -1,52 +0,0 @@ -getDatasources() as $datasource) { - if (in_array($datasource->getEntityTypeId(), $supported_entity_types)) { - return TRUE; - } - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function alterIndexedItems(array &$items) { - foreach ($items as $item_id => $item) { - $object = $item->getOriginalObject()->getValue(); - if ($object instanceof ProfileInterface) { - $user = $object->getOwner(); - if (!$user->isActive()) { - unset($items[$item_id]); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/views/field/ProfileBulkForm.php b/sites/all/modules/contrib/users/profile/src/Plugin/views/field/ProfileBulkForm.php deleted file mode 100644 index 918f14a9a..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/views/field/ProfileBulkForm.php +++ /dev/null @@ -1,21 +0,0 @@ -t('No profile selected.'); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/Plugin/views/relationship/ProfileViewsRelationship.php b/sites/all/modules/contrib/users/profile/src/Plugin/views/relationship/ProfileViewsRelationship.php deleted file mode 100644 index 1fd7e34ab..000000000 --- a/sites/all/modules/contrib/users/profile/src/Plugin/views/relationship/ProfileViewsRelationship.php +++ /dev/null @@ -1,84 +0,0 @@ -definition = $plugin_definition + $configuration; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition); - } - - /** - * {@inheritdoc} - */ - public function defineOptions() { - $options = parent::defineOptions(); - $options['profile_type'] = ['default' => NULL]; - $options['required'] = ['default' => 1]; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - - $form['admin_label']['#description'] = $this->t('The name of the selected profile type makes a good label.'); - - $form['profile_type'] = [ - '#type' => 'radios', - '#title' => $this->t('Profile Type'), - '#default_value' => $this->options['profile_type'], - '#required' => TRUE, - ]; - - foreach (ProfileType::loadMultiple() as $profile_id => $profile_type) { - $form['profile_type']['#options'][$profile_id] = $profile_type->label(); - } - - $form['required']['#description'] .= '
        ' . $this->t('You must require this relationship to use the Rendered Entity field type for this relationship') . '
        '; - } - - /** - * {@inheritdoc} - */ - public function query() { - - $this->definition['extra'][] = [ - 'field' => 'type', - 'value' => $this->options['profile_type'] - ]; - - parent::query(); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfileAccessControlHandler.php b/sites/all/modules/contrib/users/profile/src/ProfileAccessControlHandler.php deleted file mode 100644 index 8c4eac463..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfileAccessControlHandler.php +++ /dev/null @@ -1,34 +0,0 @@ -isAllowed()) { - $bundle = ProfileType::load($entity_bundle); - if (!empty(array_filter($bundle->getRoles()))) { - $result = AccessResult::allowedIf(!empty(array_intersect($account->getRoles(), $bundle->getRoles()))); - } - } - - return $result; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfileListBuilder.php b/sites/all/modules/contrib/users/profile/src/ProfileListBuilder.php deleted file mode 100644 index 6d0bc43d1..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfileListBuilder.php +++ /dev/null @@ -1,155 +0,0 @@ -dateFormatter = $date_formatter; - $this->renderer = $renderer; - $this->redirectDestination = $redirect_destination; - } - - /** - * {@inheritdoc} - */ - public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { - return new static( - $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), - $container->get('date.formatter'), - $container->get('renderer'), - $container->get('redirect.destination') - ); - } - - /** - * {@inheritdoc} - */ - public function buildHeader() { - $header = [ - 'label' => $this->t('Label'), - 'type' => [ - 'data' => $this->t('Type'), - 'class' => [RESPONSIVE_PRIORITY_MEDIUM], - ], - 'owner' => [ - 'data' => $this->t('Owner'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - 'status' => $this->t('Status'), - 'is_default' => $this->t('Default'), - 'changed' => [ - 'data' => $this->t('Updated'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ], - ]; - if (\Drupal::languageManager()->isMultilingual()) { - $header['language_name'] = [ - 'data' => $this->t('Language'), - 'class' => [RESPONSIVE_PRIORITY_LOW], - ]; - } - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - /** @var \Drupal\profile\Entity\ProfileInterface $entity */ - $langcode = $entity->language()->getId(); - $uri = $entity->toUrl(); - $options = $uri->getOptions(); - $options += ($langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? ['language' => $languages[$langcode]] : []); - $uri->setOptions($options); - $row['label'] = $entity->toLink(); - $row['type'] = $entity->bundle(); - $row['owner']['data'] = [ - '#theme' => 'username', - '#account' => $entity->getOwner(), - ]; - $row['status'] = $entity->isActive() ? $this->t('active') : $this->t('not active'); - $row['is_default'] = $entity->isDefault() ? $this->t('default') : $this->t('not default'); - $row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short'); - $language_manager = \Drupal::languageManager(); - if ($language_manager->isMultilingual()) { - $row['language_name'] = $language_manager->getLanguageName($langcode); - } - - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - - $destination = $this->redirectDestination->getAsArray(); - foreach ($operations as $key => $operation) { - $operations[$key]['query'] = $destination; - } - - if ($entity->isActive() && !$entity->isDefault()) { - $operations['set_default'] = [ - 'title' => $this->t('Mark as default'), - 'url' => $entity->toUrl('set-default'), - 'parameter' => $entity, - ]; - } - - return $operations; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfilePermissionProvider.php b/sites/all/modules/contrib/users/profile/src/ProfilePermissionProvider.php deleted file mode 100644 index 6fe47b78c..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfilePermissionProvider.php +++ /dev/null @@ -1,43 +0,0 @@ -getSingularLabel(); - $entity_type_id = $entity_type->id(); - $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id); - - foreach ($bundles as $bundle_name => $bundle_info) { - $permissions["view any {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: View any @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $singular_label, - ]), - ]; - $permissions["view own {$bundle_name} {$entity_type_id}"] = [ - 'title' => $this->t('@bundle: View own @type', [ - '@bundle' => $bundle_info['label'], - '@type' => $singular_label, - ]), - ]; - } - - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfileStorage.php b/sites/all/modules/contrib/users/profile/src/ProfileStorage.php deleted file mode 100644 index 4ae10cf7e..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfileStorage.php +++ /dev/null @@ -1,51 +0,0 @@ -loadByProperties([ - 'uid' => $account->id(), - 'type' => $profile_type, - 'status' => $active, - ]); - - return reset($result); - } - - /** - * {@inheritdoc} - */ - public function loadMultipleByUser(AccountInterface $account, $profile_type, $active = TRUE) { - return $this->loadByProperties([ - 'uid' => $account->id(), - 'type' => $profile_type, - 'status' => $active, - ]); - } - - /** - * {@inheritdoc} - */ - public function loadDefaultByUser(AccountInterface $account, $profile_type) { - $result = $this->loadByProperties([ - 'uid' => $account->id(), - 'type' => $profile_type, - 'status' => TRUE, - 'is_default' => TRUE, - ]); - - return reset($result); - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfileStorageInterface.php b/sites/all/modules/contrib/users/profile/src/ProfileStorageInterface.php deleted file mode 100644 index 18bea72b9..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfileStorageInterface.php +++ /dev/null @@ -1,56 +0,0 @@ -randomMachineName(); - $label = !empty($label) ? $label : $this->randomMachineName(); - - $type = ProfileType::create([ - 'id' => $id, - 'label' => $label, - 'registration' => $registration, - 'roles' => $roles, - ]); - $type->save(); - - return $type; - } - - /** - * Create a user, and optionally a profile. - * - * @param \Drupal\profile\Entity\ProfileTypeInterface $profile_type - * A profile type for the created profile entity. - * @param \Drupal\user\UserInterface $user - * A user to create a profile. - * - * @return \Drupal\profile\Entity\ProfileInterface - * A profile for a user. - */ - protected function createProfile(ProfileTypeInterface $profile_type, UserInterface $user) { - $profile = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $user->id(), - ]); - $profile->save(); - return $profile; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfileTypeListBuilder.php b/sites/all/modules/contrib/users/profile/src/ProfileTypeListBuilder.php deleted file mode 100644 index 5ed56134c..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfileTypeListBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ -t('Profile type'); - $header['description'] = $this->t('Description'); - $header['registration'] = $this->t('Registration'); - $header['multiple'] = $this->t('Allow multiple profiles'); - return $header + parent::buildHeader(); - } - - /** - * {@inheritdoc} - */ - public function buildRow(EntityInterface $entity) { - $row['type'] = $entity->toLink(NULL, 'edit-form'); - $row['description'] = $entity->getDescription(); - $row['registration'] = $entity->getRegistration() ? $this->t('Yes') : $this->t('No'); - $row['multiple'] = $entity->getMultiple() ? $this->t('Yes') : $this->t('No'); - return $row + parent::buildRow($entity); - } - - /** - * {@inheritdoc} - */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - // Place the edit operation after the operations added by field_ui.module - // which have the weights 15, 20, 25. - if (isset($operations['edit'])) { - $operations['edit'] = [ - 'title' => $this->t('Edit'), - 'weight' => 30, - 'url' => $entity->toUrl('edit-form'), - ]; - } - if (isset($operations['delete'])) { - $operations['delete'] = [ - 'title' => $this->t('Delete'), - 'weight' => 35, - 'url' => $entity->toUrl('delete-form'), - ]; - } - // Sort the operations to normalize link order. - uasort($operations, [ - 'Drupal\Component\Utility\SortArray', - 'sortByWeightElement', - ]); - - return $operations; - } - -} diff --git a/sites/all/modules/contrib/users/profile/src/ProfileViewBuilder.php b/sites/all/modules/contrib/users/profile/src/ProfileViewBuilder.php deleted file mode 100644 index d5916f580..000000000 --- a/sites/all/modules/contrib/users/profile/src/ProfileViewBuilder.php +++ /dev/null @@ -1,22 +0,0 @@ - $this->t('Profile operations bulk form'), - 'help' => $this->t('Add a form element that lets you run operations on multiple profiles.'), - 'field' => [ - 'id' => 'profile_bulk_form', - ], - ]; - - return $data; - } - -} diff --git a/sites/all/modules/contrib/users/profile/templates/profile.html.twig b/sites/all/modules/contrib/users/profile/templates/profile.html.twig deleted file mode 100644 index 08966d2e5..000000000 --- a/sites/all/modules/contrib/users/profile/templates/profile.html.twig +++ /dev/null @@ -1,24 +0,0 @@ -{# -/** - * @file - * - * Default theme implementation for profiles. - * - * Available variables: - * - content: Items for the content of the profile. - * Use 'content' to print them all, or print a subset such as - * 'content.title'. Use the following code to exclude the - * printing of a given child element: - * @code - * {{ content|without('title') }} - * @endcode - * - attributes: HTML attributes for the wrapper. - * - profile: The profile object. - * - url: The profile URL, if available. - * - * @ingroup themeable - */ -#} - - {{ content }} -
        diff --git a/sites/all/modules/contrib/users/profile/tests/profile_test/profile_test.info.yml b/sites/all/modules/contrib/users/profile/tests/profile_test/profile_test.info.yml deleted file mode 100644 index 1220c6f32..000000000 --- a/sites/all/modules/contrib/users/profile/tests/profile_test/profile_test.info.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Profile -type: module -description: 'Test module for Profile.' -# core: 8.x -dependencies: - - profile - -# Information added by Drupal.org packaging script on 2017-09-19 -version: '8.x-1.0-rc1' -core: '8.x' -project: 'profile' -datestamp: 1505830148 diff --git a/sites/all/modules/contrib/users/profile/tests/profile_test/test_views/views.view.users.yml b/sites/all/modules/contrib/users/profile/tests/profile_test/test_views/views.view.users.yml deleted file mode 100644 index 87832c3ef..000000000 --- a/sites/all/modules/contrib/users/profile/tests/profile_test/test_views/views.view.users.yml +++ /dev/null @@ -1,243 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - profile - - user -id: users -label: Users -module: views -description: '' -tag: '' -base_table: users_field_data -base_field: uid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access user profiles' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 0 - offset: 0 - id: 0 - total_pages: null - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: default - row: - type: fields - options: - default_field_elements: true - inline: { } - separator: '' - hide_empty: false - fields: - name: - id: name - table: users_field_data - field: name - entity_type: user - entity_field: name - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: user_name - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - profile_id: - id: profile_id - table: profile - field: profile_id - relationship: profile - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: number_integer - settings: - thousand_separator: '' - prefix_suffix: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: profile - entity_field: profile_id - plugin_id: field - filters: - status: - value: true - table: users_field_data - field: status - plugin_id: boolean - entity_type: user - entity_field: status - id: status - expose: - operator: '' - group: 1 - sorts: { } - title: Users - header: { } - footer: { } - empty: { } - relationships: - profile: - id: profile - table: users_field_data - field: profile - relationship: none - group_type: group - admin_label: Profile - required: true - entity_type: user - plugin_id: standard - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: users - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileDefaultTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileDefaultTest.php deleted file mode 100644 index cd006f4ba..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileDefaultTest.php +++ /dev/null @@ -1,148 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access user profiles', - 'administer profile', - 'administer profile types', - 'access administration pages', - ]); - - $this->user1 = User::create([ - 'name' => $this->randomMachineName(), - 'mail' => $this->randomMachineName() . '@example.com', - ]); - $this->user1->save(); - $this->user2 = User::create([ - 'name' => $this->randomMachineName(), - 'mail' => $this->randomMachineName() . '@example.com', - ]); - $this->user2->save(); - } - - /** - * Tests whether profile default on edit is working. - */ - public function testProfileEdit() { - $type = ProfileType::create([ - 'id' => $this->randomMachineName(), - 'label' => $this->randomMachineName(), - 'registration' => FALSE, - 'roles' => [], - 'multiple' => TRUE, - ]); - $type->save(); - - $admin_user = $this->drupalCreateUser([ - 'administer profile', - 'administer users', - ]); - - // Create new profiles. - $profile1 = Profile::create([ - 'type' => $type->id(), - 'uid' => $this->user1->id(), - ]); - $profile1->save(); - $profile2 = Profile::create([ - 'type' => $type->id(), - 'uid' => $this->user1->id(), - ]); - $profile2->save(); - - // Verify that the first profile of this type is default. - $this->assertTrue($profile1->isDefault()); - $this->assertFalse($profile2->isDefault()); - - $this->drupalLogin($admin_user); - - $this->drupalGet($profile1->toUrl('edit-form')->toString()); - $this->assertSession()->buttonNotExists('Save and make default'); - $this->assertSession()->buttonExists('Save'); - - $this->drupalGet($profile2->toUrl('edit-form')->toString()); - $this->assertSession()->buttonExists('Save'); - $this->assertSession()->buttonExists('Save and make default'); - $this->submitForm([], 'Save and make default'); - - \Drupal::entityTypeManager()->getStorage('profile')->resetCache([$profile1->id(), $profile2->id()]); - $this->assertFalse(Profile::load($profile1->id())->isDefault()); - $this->assertTrue(Profile::load($profile2->id())->isDefault()); - } - - /** - * Tests the entity.profile.set_default route. - */ - public function testSetDefaultRoute() { - $this->type->setMultiple(TRUE)->save(); - $id = $this->type->id(); - $test_user = $this->drupalCreateUser([ - "view own $id profile", - "create $id profile", - "update own $id profile", - "delete own $id profile", - ]); - - $profile1 = Profile::create([ - 'type' => $id, - 'uid' => $test_user->id(), - 'profile_fullname' => 'Frederick Pabst', - ]); - $profile1->save(); - $profile2 = Profile::create([ - 'type' => $id, - 'uid' => $test_user->id(), - 'profile_fullname' => 'Frederick Miller', - ]); - $profile2->save(); - - $this->drupalLogin($test_user); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user->id(), 'profile_type' => $id])); - $this->assertSession()->pageTextContains('Frederick Pabst'); - $this->assertSession()->pageTextContains('Frederick Miller'); - $this->assertSession()->linkExists('Mark as default'); - $this->getSession()->getPage()->clickLink('Mark as default'); - $this->assertSession()->responseContains(new FormattableMarkup('The %label profile has been marked as default.', ['%label' => $profile2->label()])); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileFieldAccessTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileFieldAccessTest.php deleted file mode 100644 index 1206be667..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileFieldAccessTest.php +++ /dev/null @@ -1,121 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access user profiles', - 'administer profile', - 'administer profile types', - 'administer profile fields', - 'administer profile display', - ]); - - $user_permissions = [ - 'access user profiles', - "create {$this->type->id()} profile", - "update own {$this->type->id()} profile", - "view any {$this->type->id()} profile", - ]; - - $this->webUser = $this->drupalCreateUser($user_permissions); - $this->otherUser = $this->drupalCreateUser($user_permissions); - } - - /** - * Tests private profile field access. - */ - public function testPrivateField() { - $this->field->setThirdPartySetting('profile', 'profile_private', TRUE); - $this->field->save(); - - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'profile_bio', - 'entity_type' => 'profile', - 'type' => 'text', - ]); - $field_storage->save(); - - $bio_field = FieldConfig::create([ - 'field_storage' => $field_storage, - 'bundle' => $this->type->id(), - 'label' => 'Bio', - ]); - $bio_field->save(); - - $this->display - ->setComponent($bio_field->getName(), [ - 'type' => 'string', - 'label' => 'above', - ]) - ->save(); - $this->form - ->setComponent($bio_field->getName(), [ - 'type' => 'text_default', - 'settings' => [], - ])->save(); - - // Fill in a field value. - $this->drupalLogin($this->webUser); - $secret = $this->randomMachineName(); - $not_secret = $this->randomMachineName(); - $this->drupalGet("user/{$this->webUser->id()}/{$this->type->id()}"); - $edit = [ - 'profile_fullname[0][value]' => $secret, - 'profile_bio[0][value]' => $not_secret, - ]; - $this->assertSession()->buttonNotExists('Save and make default'); - $this->submitForm($edit, 'Save'); - - /** @var \Drupal\profile\ProfileStorageInterface $storage */ - $storage = $this->container->get('entity_type.manager')->getStorage('profile'); - $web_user_profile = $storage->loadDefaultByUser($this->webUser, $this->type->id()); - - // Verify that the private field value appears for the profile owner. - $this->drupalGet($web_user_profile->toUrl()); - $this->assertSession()->pageTextContains($secret); - $this->assertSession()->pageTextContains($not_secret); - - // Verify that the private field value does not appear for other users. - $this->drupalLogin($this->otherUser); - $this->drupalGet($web_user_profile->toUrl()); - $this->assertSession()->pageTextNotContains($secret); - $this->assertSession()->pageTextContains($not_secret); - - // Verify that the private field value appears for the administrator. - $this->drupalLogin($this->adminUser); - $this->drupalGet($web_user_profile->toUrl()); - $this->assertSession()->pageTextContains($secret); - $this->assertSession()->pageTextContains($not_secret); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileHelpTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileHelpTest.php deleted file mode 100644 index 1d91a8744..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileHelpTest.php +++ /dev/null @@ -1,26 +0,0 @@ -createUser(['access administration pages']); - $this->drupalLogin($user); - $this->drupalGet(Url::fromRoute('help.page', ['name' => 'profile'])->toString()); - $this->assertSession()->pageTextContains('Types of profiles'); - $this->assertSession()->pageTextContains('Creating profiles'); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRegisterFormTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRegisterFormTest.php deleted file mode 100644 index 32b1a64a7..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRegisterFormTest.php +++ /dev/null @@ -1,74 +0,0 @@ -type->id(); - $field_name = $this->field->getName(); - - $this->field->setRequired(TRUE); - $this->field->save(); - - // Allow registration without administrative approval and log in user - // directly after registering. - \Drupal::configFactory()->getEditable('user.settings') - ->set('register', USER_REGISTER_VISITORS) - ->set('verify_mail', 0) - ->save(); - user_role_grant_permissions(AccountInterface::AUTHENTICATED_ROLE, ['view own test profile']); - - $this->drupalGet('user/register'); - // Verify that the additional profile field is attached and required. - $name = $this->randomMachineName(); - $pass_raw = $this->randomMachineName(); - // Use existing email to verify normal validation happens. - $edit = [ - 'name' => $name, - 'mail' => $this->adminUser->getEmail(), - 'pass[pass1]' => $pass_raw, - 'pass[pass2]' => $pass_raw, - ]; - $this->submitForm($edit, t('Create new account')); - - $this->assertSession()->pageTextContains(new FormattableMarkup('@name field is required.', ['@name' => $this->field->getLabel()])); - $this->assertSession()->pageTextContains(new FormattableMarkup('The email address @email is already taken.', ['@email' => $this->adminUser->getEmail()])); - - // Verify that we can register. - $edit['mail'] = $this->randomMachineName() . '@example.com'; - $edit["entity_" . $id . "[$field_name][0][value]"] = $this->randomMachineName(); - $this->submitForm($edit, t('Create new account')); - $this->assertSession()->pageTextContains(new FormattableMarkup('Registration successful. You are now logged in.', [])); - - $new_user = user_load_by_name($name); - $this->assertTrue($new_user->isActive(), 'New account is active after registration.'); - - /** @var \Drupal\profile\ProfileStorageInterface $storage */ - $storage = $this->container->get('entity_type.manager')->getStorage('profile'); - - // Verify that a new profile was created for the new user ID. - $profile = $storage->loadDefaultByUser($new_user, $this->type->id()); - - $this->assertEquals($profile->get($field_name)->value, $edit["entity_" . $id . "[$field_name][0][value]"], 'Field value found in loaded profile.'); - // Verify that, as the first profile of this type for the user, it was set - // as default. - $this->assertTrue($profile->isDefault()); - - // Verify that the profile field value appears on the user account page. - $this->drupalGet($profile->toUrl()->toString()); - $this->assertSession()->pageTextContains($edit["entity_" . $id . "[$field_name][0][value]"]); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRevisionTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRevisionTest.php deleted file mode 100644 index 8d72ea67d..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileRevisionTest.php +++ /dev/null @@ -1,160 +0,0 @@ - $this->randomMachineName(), - 'label' => $this->randomMachineName(), - 'use_revisions' => TRUE, - ]); - $use_revisions_type->save(); - $this->useRevisionsType = $use_revisions_type; - - $use_revisions_fullname_field = FieldConfig::create([ - 'field_storage' => $this->field->getFieldStorageDefinition(), - 'bundle' => $this->useRevisionsType->id(), - 'label' => 'Full name', - ]); - $use_revisions_fullname_field->save(); - - // Configure the default display. - $use_revisions_display = EntityViewDisplay::load("profile.{$this->useRevisionsType->id()}.default"); - if (!$use_revisions_display) { - $use_revisions_display = EntityViewDisplay::create([ - 'targetEntityType' => 'profile', - 'bundle' => $this->useRevisionsType->id(), - 'mode' => 'default', - 'status' => TRUE, - ]); - $use_revisions_display->save(); - } - $use_revisions_display - ->setComponent($this->field->getName(), ['type' => 'string']) - ->save(); - - // Configure the default form. - $use_revisions_form = EntityFormDisplay::load("profile.{$this->useRevisionsType->id()}.default"); - if (!$use_revisions_form) { - $use_revisions_form = EntityFormDisplay::create([ - 'targetEntityType' => 'profile', - 'bundle' => $this->useRevisionsType->id(), - 'mode' => 'default', - 'status' => TRUE, - ]); - $this->form->save(); - } - $use_revisions_form - ->setComponent($this->field->getName(), [ - 'type' => 'string_textfield', - ])->save(); - - } - - /** - * Tests revision handling. - */ - public function testProfileRevisions() { - /** @var \Drupal\profile\ProfileStorageInterface $storage */ - $storage = $this->container->get('entity_type.manager')->getStorage('profile'); - - $user = $this->createUser([ - "create {$this->type->id()} profile", - "view own {$this->type->id()} profile", - "update own {$this->type->id()} profile", - ]); - $this->drupalLogin($user); - - $create_url = Url::fromRoute('entity.profile.type.user_profile_form', [ - 'user' => $this->loggedInUser->id(), - 'profile_type' => $this->type->id(), - ]); - $this->drupalGet($create_url); - $edit = [ - 'profile_fullname[0][value]' => $this->getRandomGenerator()->word(10), - ]; - $this->submitForm($edit, 'Save'); - - $profile = $storage->loadDefaultByUser($this->loggedInUser, $this->type->id()); - $existing_profile_id = $profile->id(); - $existing_revision_id = $profile->getRevisionId(); - - $create_url = Url::fromRoute('entity.profile.type.user_profile_form', [ - 'user' => $this->loggedInUser->id(), - 'profile_type' => $this->type->id(), - ]); - $this->drupalGet($create_url); - $edit = [ - 'profile_fullname[0][value]' => $this->getRandomGenerator()->word(10), - ]; - $this->submitForm($edit, 'Save'); - - $storage->resetCache([$profile->id()]); - $profile = $storage->loadDefaultByUser($this->loggedInUser, $this->type->id()); - $this->assertEquals($existing_profile_id, $profile->id()); - $this->assertEquals($existing_revision_id, $profile->getRevisionId()); - - - $user = $this->createUser([ - "create {$this->useRevisionsType->id()} profile", - "view own {$this->useRevisionsType->id()} profile", - "update own {$this->useRevisionsType->id()} profile", - ]); - $this->drupalLogin($user); - - $create_url = Url::fromRoute('entity.profile.type.user_profile_form', [ - 'user' => $this->loggedInUser->id(), - 'profile_type' => $this->useRevisionsType->id(), - ]); - $this->drupalGet($create_url); - $edit = [ - 'profile_fullname[0][value]' => $this->getRandomGenerator()->word(10), - ]; - $this->submitForm($edit, 'Save'); - - $profile = $storage->loadDefaultByUser($this->loggedInUser, $this->useRevisionsType->id()); - $existing_profile_id = $profile->id(); - $existing_revision_id = $profile->getRevisionId(); - - $create_url = Url::fromRoute('entity.profile.type.user_profile_form', [ - 'user' => $this->loggedInUser->id(), - 'profile_type' => $this->useRevisionsType->id(), - ]); - $this->drupalGet($create_url); - $edit = [ - 'profile_fullname[0][value]' => $this->getRandomGenerator()->word(10), - ]; - $this->submitForm($edit, 'Save'); - - $storage->resetCache([$profile->id()]); - $profile = $storage->loadDefaultByUser($this->loggedInUser, $this->useRevisionsType->id()); - $this->assertEquals($existing_profile_id, $profile->id()); - $this->assertNotEquals($existing_revision_id, $profile->getRevisionId()); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTabTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTabTest.php deleted file mode 100644 index fa4e80667..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTabTest.php +++ /dev/null @@ -1,136 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access user profiles', - 'administer profile', - 'administer profile types', - 'administer users', - 'access administration pages', - ]); - } - - /** - * Tests tabs in profile UI. - */ - public function testProfileTabs() { - $types_data = [ - 'profile_type_0' => ['label' => $this->randomMachineName()], - 'profile_type_1' => ['label' => $this->randomMachineName()], - ]; - - /** @var ProfileType[] $types */ - $types = []; - foreach ($types_data as $id => $values) { - $types[$id] = ProfileType::create(['id' => $id] + $values); - $types[$id]->save(); - } - $this->container->get('router.builder')->rebuild(); - - $this->user1 = User::create([ - 'name' => $this->randomMachineName(), - 'mail' => $this->randomMachineName() . '@example.com', - ]); - $this->user1->save(); - $this->user2 = User::create([ - 'name' => $this->randomMachineName(), - 'mail' => $this->randomMachineName() . '@example.com', - ]); - $this->user2->save(); - - // Create new profiles. - $profile1 = Profile::create($expected = [ - 'type' => $types['profile_type_0']->id(), - 'uid' => $this->user1->id(), - ]); - $profile1->save(); - $profile2 = Profile::create($expected = [ - 'type' => $types['profile_type_1']->id(), - 'uid' => $this->user2->id(), - ]); - $profile2->save(); - - $this->drupalLogin($this->adminUser); - - $this->drupalGet('admin/config/people'); - $this->clickLink('Profile types'); - $this->assertResponse(200); - $this->assertUrl('admin/config/people/profiles'); - - $this->drupalGet('admin/people/profiles'); - $this->assertLink($profile1->label()); - $this->assertLinkByHref($profile2->toUrl('canonical')->toString()); - - $this->drupalGet('admin/people'); - $tasks = [ - ['entity.user.collection', []], - ['entity.profile.collection', []], - ]; - $this->assertLocalTasks($tasks, 0); - } - - /** - * Asserts local tasks in the page output. - * - * @param array $routes - * A list of expected local tasks, prepared as an array of route names and - * their associated route parameters, to assert on the page (in the given - * order). - * @param int $level - * (optional) The local tasks level to assert; 0 for primary, 1 for - * secondary. Defaults to 0. - */ - protected function assertLocalTasks(array $routes, $level = 0) { - $elements = $this->xpath('//*[contains(@class, :class)]//a', [ - ':class' => $level == 0 ? 'tabs primary' : 'tabs secondary', - ]); - $this->assertTrue(count($elements), 'Local tasks found.'); - foreach ($routes as $index => $route_info) { - list($route_name, $route_parameters) = $route_info; - $expected = Url::fromRoute($route_name, $route_parameters)->toString(); - $method = ($elements[$index]->getAttribute('href') == $expected ? 'pass' : 'fail'); - $this->{$method}(new FormattableMarkup('Task @number href @value equals @expected.', [ - '@number' => $index + 1, - '@value' => (string) $elements[$index]->getAttribute('href'), - '@expected' => $expected, - ])); - } - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTest.php deleted file mode 100644 index 480cbbbd2..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTest.php +++ /dev/null @@ -1,127 +0,0 @@ -drupalLogin($this->adminUser); - - $profile_fullname = $this->randomString(); - $create_url = Url::fromRoute('entity.profile.type.user_profile_form', [ - 'user' => $this->loggedInUser->id(), - 'profile_type' => $this->type->id(), - ]); - $this->drupalGet($create_url->toString()); - $this->assertSession()->titleEquals("Create {$this->type->label()} | Drupal"); - $this->assertSession()->buttonNotExists('Save and make default'); - $edit = [ - 'profile_fullname[0][value]' => $profile_fullname, - ]; - $this->submitForm($edit, 'Save'); - - /** @var \Drupal\profile\ProfileStorageInterface $storage */ - $storage = $this->container->get('entity_type.manager')->getStorage('profile'); - - $profile = $storage->loadDefaultByUser($this->loggedInUser, $this->type->id()); - $this->assertEquals($profile_fullname, $profile->get('profile_fullname')->value); - - $this->drupalGet($profile->toUrl('edit-form')->toString()); - $this->assertSession()->titleEquals("Edit {$this->type->label()} profile #{$profile->id()} | Drupal"); - - $profile_fullname = $this->randomString(); - $edit = [ - 'profile_fullname[0][value]' => $profile_fullname, - ]; - $this->submitForm($edit, 'Save'); - - $storage->resetCache([$profile->id()]); - $profile = $storage->loadDefaultByUser($this->loggedInUser, $this->type->id()); - $this->assertEquals($profile_fullname, $profile->get('profile_fullname')->value); - } - - /** - * Tests that a profile belonging to an anonymous user can be edited. - */ - public function testAnonymousProfileEdit() { - $profile = $this->createProfile($this->type, User::getAnonymousUser()); - - $this->drupalLogin($this->adminUser); - $this->drupalGet($profile->toUrl('edit-form')->toString()); - $profile_fullname = $this->randomString(); - $edit = [ - 'profile_fullname[0][value]' => $profile_fullname, - ]; - $this->submitForm($edit, 'Save'); - $this->assertSession()->addressEquals($profile->toUrl('collection')->toString()); - } - - /** - * Tests entity.profile.type.user_profile_form route access. - */ - public function testUserProfileFormAccess() { - $id = $this->type->id(); - $test_user1 = $this->drupalCreateUser([ - "view own $id profile", - "create $id profile", - "update own $id profile", - "delete own $id profile", - ]); - $test_user2 = $this->drupalCreateUser([ - "view own $id profile", - "create $id profile", - "update own $id profile", - "delete own $id profile", - ]); - - $this->drupalLogin($this->adminUser); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user1->id(), 'profile_type' => $id])); - $this->assertSession()->statusCodeEquals(200); - $this->drupalLogin($test_user1); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user1->id(), 'profile_type' => $id])); - $this->assertSession()->statusCodeEquals(200); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user2->id(), 'profile_type' => $id])); - $this->assertSession()->statusCodeEquals(403); - - $this->type->setMultiple(TRUE)->save(); - - // Add link only appears if there are existing profiles. - Profile::create([ - 'type' => $this->type->id(), - 'uid' => $test_user1->id(), - 'profile_fullname' => $this->randomMachineName(), - ])->save(); - Profile::create([ - 'type' => $this->type->id(), - 'uid' => $test_user2->id(), - 'profile_fullname' => $this->randomMachineName(), - ])->save(); - - $this->drupalLogin($this->adminUser); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user1->id(), 'profile_type' => $id])); - $this->assertSession()->linkExists(new FormattableMarkup('Add new @type', ['@type' => $this->type->label()])); - $this->assertSession()->statusCodeEquals(200); - $this->drupalLogin($test_user1); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user1->id(), 'profile_type' => $id])); - $this->assertSession()->linkExists(new FormattableMarkup('Add new @type', ['@type' => $this->type->label()])); - $this->assertSession()->statusCodeEquals(200); - $this->drupalGet(Url::fromRoute('entity.profile.type.user_profile_form', ['user' => $test_user2->id(), 'profile_type' => $id])); - $this->assertSession()->linkNotExists(new FormattableMarkup('Add new @type', ['@type' => $this->type->label()])); - $this->assertSession()->statusCodeEquals(403); - - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTestBase.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTestBase.php deleted file mode 100644 index 69c0ca0b2..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTestBase.php +++ /dev/null @@ -1,138 +0,0 @@ -drupalPlaceBlock('local_tasks_block'); - $this->drupalPlaceBlock('local_actions_block'); - $this->drupalPlaceBlock('page_title_block'); - - $this->type = $this->createProfileType('test', 'Test profile', TRUE); - - $id = $this->type->id(); - - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'profile_fullname', - 'entity_type' => 'profile', - 'type' => 'text', - ]); - $field_storage->save(); - - $this->field = FieldConfig::create([ - 'field_storage' => $field_storage, - 'bundle' => $this->type->id(), - 'label' => 'Full name', - ]); - $this->field->save(); - - // Configure the default display. - $this->display = EntityViewDisplay::load("profile.{$this->type->id()}.default"); - if (!$this->display) { - $this->display = EntityViewDisplay::create([ - 'targetEntityType' => 'profile', - 'bundle' => $this->type->id(), - 'mode' => 'default', - 'status' => TRUE, - ]); - $this->display->save(); - } - $this->display - ->setComponent($this->field->getName(), ['type' => 'string']) - ->save(); - - // Configure the default form. - $this->form = EntityFormDisplay::load("profile.{$this->type->id()}.default"); - if (!$this->form) { - $this->form = EntityFormDisplay::create([ - 'targetEntityType' => 'profile', - 'bundle' => $this->type->id(), - 'mode' => 'default', - 'status' => TRUE, - ]); - $this->form->save(); - } - $this->form - ->setComponent($this->field->getName(), [ - 'type' => 'string_textfield', - ])->save(); - - $this->checkPermissions([ - 'administer profile types', - "create $id profile", - "view own $id profile", - "view any $id profile", - "update own $id profile", - "update any $id profile", - "delete own $id profile", - "delete any $id profile", - ]); - - user_role_grant_permissions(AccountInterface::AUTHENTICATED_ROLE, ['access user profiles']); - $this->adminUser = $this->drupalCreateUser([ - 'administer profile types', - 'administer profile', - "view any $id profile", - "create $id profile", - "update any $id profile", - "delete any $id profile", - ]); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeCRUDTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeCRUDTest.php deleted file mode 100644 index 1ced719ac..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeCRUDTest.php +++ /dev/null @@ -1,105 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access user profiles', - 'administer profile types', - 'administer profile fields', - 'administer profile display', - ]); - } - - /** - * Verify that routes are created for the profile type. - */ - public function testRoutes() { - $this->drupalLogin($this->adminUser); - $type = $this->createProfileType($this->randomMachineName()); - \Drupal::service('router.builder')->rebuildIfNeeded(); - $this->drupalGet("user/{$this->adminUser->id()}/{$type->id()}"); - $this->assertSession()->statusCodeEquals(200); - } - - /** - * Tests CRUD operations for profile types through the UI. - */ - public function testUi() { - $this->drupalLogin($this->adminUser); - - // Create a new profile type. - $this->drupalGet('admin/config/people/profiles'); - $this->assertSession()->statusCodeEquals(200); - $this->clickLink(t('Add profile type')); - - $this->assertSession()->addressEquals('admin/config/people/profiles/add'); - $id = Unicode::strtolower($this->randomMachineName()); - $label = $this->getRandomGenerator()->word(10); - $edit = [ - 'id' => $id, - 'label' => $label, - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertSession()->addressEquals('admin/config/people/profiles'); - $this->assertSession()->responseContains(new FormattableMarkup('%label profile type has been created.', ['%label' => $label])); - $this->assertSession()->linkByHrefExists("admin/config/people/profiles/manage/$id"); - $this->assertSession()->linkByHrefExists("admin/config/people/profiles/manage/$id/fields"); - $this->assertSession()->linkByHrefExists("admin/config/people/profiles/manage/$id/display"); - $this->assertSession()->linkByHrefExists("admin/config/people/profiles/manage/$id/delete"); - - // Edit the new profile type. - $this->drupalGet("admin/config/people/profiles/manage/$id"); - $this->assertSession()->responseContains(new FormattableMarkup('Edit %label profile type', ['%label' => $label])); - $this->getSession()->getPage()->checkField('Include in user registration form'); - $this->getSession()->getPage()->checkField('Create a new revision when a profile is modified'); - $this->submitForm([], 'Save'); - $this->assertSession()->addressEquals('admin/config/people/profiles'); - $this->assertSession()->responseContains(new FormattableMarkup('%label profile type has been updated.', ['%label' => $label])); - - $profile_type = ProfileType::load($id); - $this->assertEquals($label, $profile_type->label()); - $this->assertTrue($profile_type->getRegistration()); - $this->assertTrue($profile_type->shouldCreateNewRevision()); - - // Delete profile type. - // First check with existing profile of type. - $profile = Profile::create([ - 'type' => $id, - 'uid' => $this->adminUser->id(), - ]); - $profile->save(); - $this->drupalGet("admin/config/people/profiles/manage/$id/delete"); - $this->assertSession()->responseContains(new FormattableMarkup('%label is used by 1 profile on your site. You can not remove this profile type until you have removed all of the %label profiles', ['%label' => $label])); - - // Delete profile and delete profile type. - $profile->delete(); - $this->drupalGet("admin/config/people/profiles/manage/$id/delete"); - $this->assertSession()->responseContains('This action cannot be undone.'); - $this->assertSession()->linkByHrefExists('admin/config/people/profiles'); - $this->submitForm([], 'Delete'); - $this->assertSession()->addressEquals('admin/config/people/profiles'); - $this->assertSession()->responseContains(new FormattableMarkup('The profile type %label has been deleted.', ['%label' => $label])); - - $profile_type = ProfileType::load($id); - $this->assertNull($profile_type); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeTest.php b/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeTest.php deleted file mode 100644 index a41fe8101..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Functional/ProfileTypeTest.php +++ /dev/null @@ -1,77 +0,0 @@ -adminUser = $this->drupalCreateUser([ - 'access user profiles', - 'administer profile types', - 'administer profile fields', - 'administer profile display', - ]); - } - - /** - * Verify that routes are created for the profile type. - */ - public function testRoutes() { - $this->drupalLogin($this->adminUser); - $type = $this->createProfileType($this->randomMachineName()); - \Drupal::service('router.builder')->rebuildIfNeeded(); - $this->drupalGet("user/{$this->adminUser->id()}/{$type->id()}"); - $this->assertResponse(200); - } - - /** - * Tests CRUD operations for profile types through the UI. - */ - public function testUi() { - $this->drupalLogin($this->adminUser); - - // Create a new profile type. - $this->drupalGet('admin/config/people/profiles'); - $this->assertResponse(200); - $this->clickLink(t('Add profile type')); - - $this->assertUrl('admin/config/people/profiles/add'); - $id = Unicode::strtolower($this->randomMachineName()); - $label = $this->randomString(); - $edit = [ - 'id' => $id, - 'label' => $label, - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertUrl('admin/config/people/profiles'); - $this->assertRaw(new FormattableMarkup('%label profile type has been created.', ['%label' => $label])); - $this->assertLinkByHref("admin/config/people/profiles/manage/$id"); - $this->assertLinkByHref("admin/config/people/profiles/manage/$id/fields"); - $this->assertLinkByHref("admin/config/people/profiles/manage/$id/display"); - $this->assertLinkByHref("admin/config/people/profiles/manage/$id/delete"); - - // Edit the new profile type. - $this->drupalGet("admin/config/people/profiles/manage/$id"); - $this->assertRaw(new FormattableMarkup('Edit %label profile type', ['%label' => $label])); - $edit = [ - 'registration' => 1, - ]; - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertUrl('admin/config/people/profiles'); - $this->assertRaw(new FormattableMarkup('%label profile type has been updated.', ['%label' => $label])); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileAccessTest.php b/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileAccessTest.php deleted file mode 100644 index 46b10fcf5..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileAccessTest.php +++ /dev/null @@ -1,219 +0,0 @@ -installEntitySchema('profile'); - $this->installEntitySchema('view'); - $this->installConfig(['profile']); - $this->accessControlHandler = $this->container->get('entity_type.manager') - ->getAccessControlHandler('profile'); - $this->accessManager = $this->container->get('access_manager'); - $this->type = $this->createProfileType('test', 'Test profile', TRUE); - $this->createUser(); - } - - /** - * Tests profile create and permissions. - */ - public function testProfileCreateAccess() { - // Test user without any permissions. - $web_user1 = $this->createUser(); - - // Verify user does not have access to create. - $access = $this->accessControlHandler->createAccess($this->type->id(), $web_user1); - $this->assertFalse($access); - - // Verify access through route. - $this->assertFalse($this->accessManager->checkNamedRoute( - 'entity.profile.type.user_profile_form.add', - ['user' => $web_user1->id(), 'profile_type' => $this->type->id()], - $web_user1 - )); - - // Test user with permission to only add a profile. - $web_user2 = $this->createUser([], [ - "create {$this->type->id()} profile", - "update own {$this->type->id()} profile", - ]); - $web_user1->addRole($web_user2->get('roles')->first()->target_id); - $web_user1->save(); - - // Verify user has access to add their own profile. - $access = $this->accessControlHandler->createAccess($this->type->id(), $web_user2); - $this->assertTrue($access); - - // User 2 can create profile of type. - $this->assertTrue($this->accessManager->checkNamedRoute( - 'entity.profile.type.user_profile_form.add', - ['user' => $web_user2->id(), 'profile_type' => $this->type->id()], - $web_user2 - )); - // User 1 cannot create a profile for User 2. - $this->assertFalse($this->accessManager->checkNamedRoute( - 'entity.profile.type.user_profile_form.add', - ['user' => $web_user2->id(), 'profile_type' => $this->type->id()], - $web_user1 - )); - - // Create a new profile type. - $second_type = $this->createProfileType('test2', 'Test2 profile', TRUE); - $this->assertFalse($this->accessControlHandler->createAccess('test2', $web_user2)); - $this->assertFalse($this->accessManager->checkNamedRoute( - 'entity.profile.type.user_profile_form.add', - ['user' => $web_user2->id(), 'profile_type' => $second_type->id()], - $web_user2 - )); - - // Test user with permission to only add any profile. - $web_user3 = $this->createUser([], [ - "create {$this->type->id()} profile", - "update own {$this->type->id()} profile", - ]); - $this->assertTrue($this->accessControlHandler->createAccess($this->type->id(), $web_user3)); - - // Verify access through route. - $this->assertTrue($this->accessManager->checkNamedRoute( - 'entity.profile.type.user_profile_form.add', - ['user' => $web_user3->id(), 'profile_type' => $this->type->id()], - $web_user3 - )); - $this->assertFalse($this->accessManager->checkNamedRoute( - 'entity.profile.type.user_profile_form.add', - ['user' => $web_user2->id(), 'profile_type' => $this->type->id()], - $web_user3 - )); - } - - /** - * Tests profile view access. - */ - public function testProfileViewAccess() { - // Setup users. - $web_user1 = $this->createUser([], [ - 'access user profiles', - "view own {$this->type->id()} profile", - ]); - $web_user2 = $this->createUser([], [ - 'access user profiles', - "view any {$this->type->id()} profile", - ]); - - // Setup profiles. - $profile1 = Profile::create([ - 'uid' => $web_user1->id(), - 'type' => $this->type->id(), - ]); - $profile1->save(); - $profile2 = Profile::create([ - 'uid' => $web_user2->id(), - 'type' => $this->type->id(), - ]); - $profile2->save(); - - // Test user1 can only view own profiles. - $this->assertTrue($profile1->access('view', $web_user1)); - $this->assertFalse($profile2->access('view', $web_user1)); - - // Test user2 can view any profiles. - $this->assertTrue($profile1->access('view', $web_user2)); - $this->assertTrue($profile2->access('view', $web_user2)); - - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ["view own {$this->type->id()} profile"]); - $this->assertFalse($profile1->access('view', User::getAnonymousUser())); - $this->assertFalse($profile2->access('view', User::getAnonymousUser())); - - // @todo Fix in https://www.drupal.org/node/2820209 - user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ["view any {$this->type->id()} profile"]); - // $this->assertTrue($profile1->access('view', User::getAnonymousUser())); - // $this->assertTrue($profile2->access('view', User::getAnonymousUser())); - } - - /** - * Tests profile edit flow and permissions. - */ - public function testProfileEditAccess() { - // Setup users. - $web_user1 = $this->createUser([], [ - "create {$this->type->id()} profile", - "update own {$this->type->id()} profile", - ]); - $web_user2 = $this->createUser([], [ - "create {$this->type->id()} profile", - "update any {$this->type->id()} profile", - ]); - - // Setup profiles. - $profile1 = Profile::create([ - 'uid' => $web_user1->id(), - 'type' => $this->type->id(), - ]); - $profile1->save(); - $profile2 = Profile::create([ - 'uid' => $web_user2->id(), - 'type' => $this->type->id(), - ]); - $profile2->save(); - - // Test user1 can only edit own profiles. - $this->assertTrue($profile1->access('update', $web_user1)); - $this->assertFalse($profile2->access('update', $web_user1)); - - // Test user2 can edit any profiles. - $this->assertTrue($profile1->access('update', $web_user2)); - $this->assertTrue($profile2->access('update', $web_user2)); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileRoleAccessTest.php b/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileRoleAccessTest.php deleted file mode 100644 index 9c476c2ce..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileRoleAccessTest.php +++ /dev/null @@ -1,201 +0,0 @@ -role1 = Role::create([ - 'id' => strtolower($this->randomMachineName(8)), - 'label' => $this->randomMachineName(8), - ]); - $this->role1->save(); - $this->role2 = Role::create([ - 'id' => strtolower($this->randomMachineName(8)), - 'label' => $this->randomMachineName(8), - ]); - $this->role2->save(); - $this->type1 = $this->createProfileType(NULL, NULL, FALSE, []); - $this->type2 = $this->createProfileType(NULL, NULL, FALSE, [$this->role2->id()]); - $this->type3 = $this->createProfileType(NULL, NULL, FALSE, [ - $this->role1->id(), - $this->role2->id(), - ]); - - $this->accessHandler = $this->container->get('entity_type.manager') - ->getAccessControlHandler('profile'); - - // Do not allow uid == 1 to skew tests. - $this->createUser(); - } - - /** - * Tests profile form access for a type that has no role requirement. - */ - public function testProfileWithNoRoles() { - // Create user with add profile permissions. - $web_user1 = $this->createUser([], ["create {$this->type1->id()} profile"]); - $this->assertTrue($this->accessHandler->createAccess($this->type1->id(), $web_user1)); - } - - /** - * Tests profile form access for a type that has the locked role requirement. - */ - public function testLockedRoles() { - $locked_role_type = $this->createProfileType(NULL, NULL, FALSE, [AccountInterface::AUTHENTICATED_ROLE]); - // Create user with add profile permissions. - $web_user1 = $this->createUser([], ["create {$locked_role_type->id()} profile"]); - $this->assertTrue($this->accessHandler->createAccess($locked_role_type->id(), $web_user1)); - } - - /** - * Tests profile form access for a type that requires a role. - */ - public function testProfileWithSingleRole() { - // Create user with add own profile permissions. - $web_user1 = $this->createUser([], ["create {$this->type2->id()} profile"]); - - // Test user without role can access add profile form. - // Expected: User cannot access form. - $this->assertFalse($this->accessHandler->createAccess($this->type2->id(), $web_user1)); - $this->accessHandler->resetCache(); - - // Test user with wrong role can access add profile form. - // Expected: User cannot access form. - $web_user1->addRole($this->role1->id()); - $web_user1->save(); - - $this->assertFalse($this->accessHandler->createAccess($this->type2->id(), $web_user1)); - $this->accessHandler->resetCache(); - - // Test user with correct role can access add profile form. - // Expected: User can access form. - $web_user1->removeRole($this->role1->id()); - $web_user1->addRole($this->role2->id()); - $web_user1->save(); - $this->reloadEntity($web_user1); - - $this->assertTrue($this->accessHandler->createAccess($this->type2->id(), $web_user1)); - } - - /** - * Tests profile form access for a type that requires multiple roles. - */ - public function testProfileWithAllRoles() { - // Create user with add own profile permissions. - $web_user1 = $this->createUser([], ["create {$this->type3->id()} profile"]); - - // Test user without role can access add profile form. - // Expected: User cannot access form. - $this->assertFalse($this->accessHandler->createAccess($this->type3->id(), $web_user1)); - $this->accessHandler->resetCache(); - - // Test user with role 1 can access add profile form. - // Expected: User can access form. - $web_user1->addRole($this->role1->id()); - $web_user1->save(); - - $this->assertTrue($this->accessHandler->createAccess($this->type3->id(), $web_user1)); - $this->accessHandler->resetCache(); - - // Test user with both roles can access add profile form. - // Expected: User can access form. - $web_user1->addRole($this->role2->id()); - $web_user1->save(); - - $this->assertTrue($this->accessHandler->createAccess($this->type3->id(), $web_user1)); - $this->accessHandler->resetCache(); - - // Test user with role 2 can access add profile form. - // Expected: User can access form. - $web_user1->removeRole($this->role1->id()); - $web_user1->save(); - - $this->assertTrue($this->accessHandler->createAccess($this->type3->id(), $web_user1)); - $this->accessHandler->resetCache(); - - // Test user without role can access add profile form. - // Expected: User cannot access form. - $web_user1->removeRole($this->role2->id()); - $web_user1->save(); - - $this->assertFalse($this->accessHandler->createAccess($this->type3->id(), $web_user1)); - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileTest.php b/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileTest.php deleted file mode 100644 index df42f1cf9..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileTest.php +++ /dev/null @@ -1,332 +0,0 @@ -installEntitySchema('profile'); - $this->installEntitySchema('view'); - $this->installSchema('user', ['users_data']); - $this->installConfig(['profile', 'user']); - $this->profileStorage = $this->container->get('entity_type.manager') - ->getStorage('profile'); - $this->user1 = $this->createUser(); - $this->user2 = $this->createUser(); - } - - /** - * Tests the profile entity and its methods. - */ - public function testProfile() { - $types_data = [ - 'profile_type_0' => ['label' => $this->randomMachineName()], - 'profile_type_1' => ['label' => $this->randomMachineName()], - ]; - - /** @var \Drupal\profile\Entity\ProfileTypeInterface[] $types */ - $types = []; - foreach ($types_data as $id => $values) { - $types[$id] = ProfileType::create(['id' => $id] + $values); - $types[$id]->save(); - } - - // Create a new profile. - /** @var \Drupal\profile\Entity\ProfileInterface $profile */ - $profile = $this->profileStorage->create([ - 'type' => $types['profile_type_0']->id(), - 'uid' => $this->user1->id(), - ]); - - $this->assertEquals($profile->getOwnerId(), $this->user1->id()); - $this->assertEquals($profile->getCreatedTime(), REQUEST_TIME); - $this->assertEquals($profile->getChangedTime(), REQUEST_TIME); - - // Save the profile. - $profile->save(); - $this->assertEquals(REQUEST_TIME, $profile->getChangedTime()); - $expected_label = new TranslatableMarkup('@type profile #@id', [ - '@type' => $types['profile_type_0']->label(), - '@id' => $profile->id(), - ]); - $this->assertEquals($expected_label, $profile->label()); - - // List profiles for the user and verify that the new profile appears. - $list = $this->profileStorage->loadByProperties(['uid' => $this->user1->id()]); - $list_ids = array_keys($list); - $this->assertEquals($list_ids, [$profile->id()]); - - // Create a second profile. - $user1_profile1 = $profile; - $user1_profile = $this->profileStorage->create([ - 'type' => $types['profile_type_0']->id(), - 'uid' => $this->user1->id(), - ]); - $user1_profile->save(); - - // List profiles for the user and verify that both profiles appear. - $list = $this->profileStorage->loadByProperties(['uid' => $this->user1->id()]); - $list_ids = array_keys($list); - $this->assertEquals($list_ids, [$user1_profile1->id(), $user1_profile->id()]); - - // Delete the second profile and verify that the first still exists. - $user1_profile->delete(); - $list = $this->profileStorage->loadByProperties(['uid' => $this->user1->id()]); - $list_ids = array_keys($list); - $this->assertEquals($list_ids, [$user1_profile1->id()]); - - // Create a profile for the second user. - $user2_profile1 = $this->profileStorage->create([ - 'type' => $types['profile_type_0']->id(), - 'uid' => $this->user2->id(), - ]); - $user2_profile1->save(); - - // Delete the first user and verify that all of its profiles are deleted. - $this->user1->delete(); - $list = $this->profileStorage->loadByProperties(['uid' => $this->user1->id()]); - $list_ids = array_keys($list); - $this->assertEquals($list_ids, []); - - // List profiles for the second user and verify that they still exist. - $list = $this->profileStorage->loadByProperties(['uid' => $this->user2->id()]); - $list_ids = array_keys($list); - $this->assertEquals($list_ids, [$user2_profile1->id()]); - } - - /** - * Tests profiles are active by default. - */ - public function testProfileActive() { - $profile_type = ProfileType::create([ - 'id' => 'test_defaults', - 'label' => 'test_defaults', - ]); - $profile_type->save(); - - // Create new profiles. - $profile1 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - ]); - $profile1->save(); - $this->assertTrue($profile1->isActive()); - - $profile1->setActive(FALSE); - $profile1->save(); - - $this->assertFalse($profile1->isActive()); - } - - /** - * Tests default profile functionality. - */ - public function testDefaultProfile() { - $profile_type = ProfileType::create([ - 'id' => 'test_defaults', - 'label' => 'test_defaults', - ]); - $profile_type->save(); - - // Create a new profile. - $profile1 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - ]); - $profile1->save(); - - // Verify that the first profile of this type is default. - $this->assertTrue($profile1->isDefault()); - - // Create a second new profile. - $profile2 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - ]); - $profile2->setDefault(TRUE); - $profile2->save(); - - $this->assertFalse($this->reloadEntity($profile1)->isDefault()); - $this->assertTrue($this->reloadEntity($profile2)->isDefault()); - - $profile1->setDefault(TRUE)->save(); - $this->assertFalse($this->reloadEntity($profile2)->isDefault()); - $this->assertTrue($this->reloadEntity($profile1)->isDefault()); - - // Verify that a deactivated profile cannot be the default and that if the - // current default is disactivated another default is set. - $profile2->setActive(FALSE); - $profile2->save(); - - $this->assertFalse($this->reloadEntity($profile2)->isDefault()); - $this->assertTrue($this->reloadEntity($profile1)->isDefault()); - } - - /** - * Tests loading default from storage handler. - */ - public function testLoadDefaultProfile() { - $profile_type = ProfileType::create([ - 'id' => 'test_defaults', - 'label' => 'test_defaults', - ]); - $profile_type->save(); - - // Create new profiles. - $profile1 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - ]); - $profile1->setActive(TRUE); - $profile1->save(); - $profile2 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - ]); - $profile2->setActive(TRUE); - $profile2->setDefault(TRUE); - $profile2->save(); - - /** @var \Drupal\profile\ProfileStorageInterface $storage */ - $storage = \Drupal::entityTypeManager()->getStorage('profile'); - - $default_profile = $storage->loadDefaultByUser($this->user1, $profile_type->id()); - $this->assertEquals($profile2->id(), $default_profile->id()); - - // Ensure that \Drupal\profile\Entity\Profile::preSave doesn't crash. - $anonymous_profile = Profile::create(['type' => $profile_type->id()]); - $anonymous_profile->save(); - $this->assertTrue(empty($anonymous_profile->getOwner())); - } - - /** - * Tests revisions. - */ - public function testProfileRevisions() { - $profile_type = ProfileType::create([ - 'id' => 'test_defaults', - 'label' => 'test_defaults', - ]); - $profile_type->save(); - - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'profile_fullname', - 'entity_type' => 'profile', - 'type' => 'text', - ]); - $field_storage->save(); - - $field = FieldConfig::create([ - 'field_storage' => $field_storage, - 'bundle' => $profile_type->id(), - 'label' => 'Full name', - ]); - $field->save(); - - - // Create new profiles. - /** @var \Drupal\profile\Entity\Profile $profile1 */ - $profile1 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - 'profile_fullname' => $this->randomMachineName(), - ]); - $profile1->save(); - - $profile1 = $this->reloadEntity($profile1); - $existing_profile_id = $profile1->id(); - $existing_revision_id = $profile1->getRevisionId(); - - $profile1->get('profile_fullname')->setValue($this->randomMachineName()); - $profile1->save(); - - $profile1 = $this->reloadEntity($profile1); - $this->assertEquals($existing_profile_id, $profile1->id()); - $this->assertEquals($existing_revision_id, $profile1->getRevisionId()); - - $profile_type->set('use_revisions', TRUE); - $profile_type->save(); - - // Create new profiles. - /** @var \Drupal\profile\Entity\Profile $profile2 */ - $profile2 = Profile::create([ - 'type' => $profile_type->id(), - 'uid' => $this->user1->id(), - 'profile_fullname' => $this->randomMachineName(), - ]); - $profile2->setDefault(TRUE); - $profile2->save(); - - $profile2 = $this->reloadEntity($profile2); - $existing_profile_id = $profile2->id(); - $existing_revision_id = $profile2->getRevisionId(); - - // Changing profiles support revisions. - $profile2->get('profile_fullname')->setValue($this->randomMachineName()); - $profile2->setNewRevision(); - $profile2->save(); - - $profile2 = $this->reloadEntity($profile2); - $this->assertEquals($existing_profile_id, $profile2->id()); - $this->assertNotEquals($existing_revision_id, $profile2->getRevisionId()); - - $existing_profile_id = $profile2->id(); - $existing_revision_id = $profile2->getRevisionId(); - - // Random save does not create a revision. - $profile2->save(); - $profile2 = $this->reloadEntity($profile2); - $this->assertEquals($existing_profile_id, $profile2->id()); - $this->assertEquals($existing_revision_id, $profile2->getRevisionId()); - - } - -} diff --git a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileViewTest.php b/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileViewTest.php deleted file mode 100644 index 632424220..000000000 --- a/sites/all/modules/contrib/users/profile/tests/src/Kernel/ProfileViewTest.php +++ /dev/null @@ -1,109 +0,0 @@ -installEntitySchema('user'); - $this->installEntitySchema('profile'); - $this->installEntitySchema('profile_type'); - - ViewTestData::createTestViews(get_class($this), ['profile_test']); - } - - /** - * Tests views relationship with multiple referenced entities. - * - * Relationship is required, so only users with profiles will be listed. - */ - public function testProfileRelationship() { - $profile_type = $this->createProfileType(); - - $user[0] = $user1 = User::create([ - 'name' => Unicode::strtolower($this->randomMachineName()), - 'status' => TRUE, - ]); - $user1->save(); - $user2 = User::create([ - 'name' => Unicode::strtolower($this->randomMachineName()), - 'status' => TRUE, - ]); - $user2->save(); - $user[1] = $user3 = User::create([ - 'name' => Unicode::strtolower($this->randomMachineName()), - 'status' => TRUE, - ]); - $user3->save(); - $user4 = User::create([ - 'name' => Unicode::strtolower($this->randomMachineName()), - 'status' => TRUE, - ]); - $user4->save(); - - $profile[0] = $this->createProfile($profile_type, $user1); - $profile[1] = $this->createProfile($profile_type, $user3); - - Views::viewsData()->clear(); - - // Check table relationship exists. - $views_data = Views::viewsData()->get('users_field_data'); - $this->assertEquals($views_data['profile']['relationship']['base'], 'profile'); - $this->assertEquals($views_data['profile']['relationship']['base field'], 'uid'); - - $view = Views::getView('users'); - $this->executeView($view); - - // Ensure values are populated for user and profiles. - foreach ($view->result as $index => $row) { - $this->assertEquals($row->uid, $user[$index]->id(), 'User ' . $user[$index]->id() . ' found on row: ' . $index); - $this->assertEquals($row->profile_users_field_data_profile_id, $profile[$index]->id(), 'Profile ' . $profile[$index]->id() . ' found on view: ' . $index); - } - } - - /** - * Create a user, and optionally a profile. - * - * @return \Drupal\user\UserInterface - * A newly created user. - */ - protected function createUser() { - $user = User::create([ - 'name' => Unicode::strtolower($this->randomMachineName()), - 'status' => TRUE, - ]); - $user->save(); - return $user; - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/LICENSE.txt b/sites/all/modules/contrib/views/translation_views/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/views/translation_views/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/views/translation_views/README.md b/sites/all/modules/contrib/views/translation_views/README.md deleted file mode 100644 index 2110fd249..000000000 --- a/sites/all/modules/contrib/views/translation_views/README.md +++ /dev/null @@ -1,78 +0,0 @@ -Translation Views -============= - -INTRODUCTION ------------- -Provides fields and filter for views to display information about each row, the **source** translation, in another **target** language. You can also add translation operation links to decide if you want to add/edit the content in the target language. - -Configurations for a demo view is imported on installation, named `Content translation jobs` which can be found at path `/translate/content`. If you want to get view for other translatable entities, you should build it yourself using our fields/filters. - -**Notice**: This module provides view's fields/filters only for translatable entity types, this means that until you have enabled content translation support for an entity you'll not get provided any extra fields/filters. The content translations can be enabled at path `admin/config/regional/content-language` - -FEATURES ------------- - -**Target translation** - -- Target language: `field`,`filter`. Should in most cases be an exposed filter. - Also, there is an extra filter option: *Remove rows where source language is equal to target language* - -These fields/filters will display information about the each row in the selected target language: -- Translation outdated: `field`,`filter` -- Translation status: `field`,`filter` -- Target language equals default language: `field`,`filter`: Checks if the target language is the same as the original language of the node. -- Translation changed time: `field` -- Source translation of target language equals row language: `field`,`filter`: Checks if the source translation of the row is the same as the target language -- Translation operations: `field` -- Translation moderation state: `field` - -**Source translation** -- Translation counter: `field`,`filter`: count translations of oirignal language. You can also configure the field to include original language in the count. - -REQUIREMENTS ------------- -- Drupal 8 -- PHP 7+ - -INSTALLATION ------------- -Install module as usually. - -CONFIGURATION -------------- -No configuration is needed. - -### Demo view: Content translation jobs: -Upon installation, a new view is added named `Content translation jobs` that demonstrate how the fields/filters can be used to create lists of translation jobs. Available at path `/translate/content`. - -If this didn't happened on installation then go to the`admin/config/development/configuration/single/import` and manually import config from the file located in the module folder at: `config/optional/views.view.content_translations.yml`. - -**Fields** -The view display: -- Title for each node in the view -- The node language -- The target language -- The translation status of target language. -- The time the content was last changed in target language -- Translation operations to add/edit translation in target language - -**Filters** -Exposed filters: -- Source language (the language of each node in the view) -- Target language -- Outdated status in target language -- Translation status in target language - -Hidden filters -- Source content outdated must be false: Make sure you do not translation from outdated nodes. -- Target language equals default language must be false: As there is no use to check status of original language as a target language. -- The target language must be untranslated or the same as the source language of translation: This makes sure that once there is a translation in target language it will only be displayed if the source language is the correct source language. If target language is not translated you can use different language as source translation. - -MODULE INTEGRATION -------------- -You can limit the target language filter list to the users registered translation skill if you're using [Local Translation](https://www.drupal.org/project/local_translation) - -MAINTAINERS ------------ -Developed by [vlad.dancer](https://drupal.org/u/vladdancer) -Designed by [matsbla](https://drupal.org/u/matsbla) diff --git a/sites/all/modules/contrib/views/translation_views/config/optional/views.view.content_translations.yml b/sites/all/modules/contrib/views/translation_views/config/optional/views.view.content_translations.yml deleted file mode 100644 index ba341e188..000000000 --- a/sites/all/modules/contrib/views/translation_views/config/optional/views.view.content_translations.yml +++ /dev/null @@ -1,878 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - translation_views - - user -id: content_translations -label: 'Content translation jobs' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'create content translations' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: null - tags: - previous: ‹‹ - next: ›› - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - title: title - langcode: langcode - translation_target_language: translation_target_language - translation_outdated: translation_outdated - translation_status: translation_status - changed: changed - translation_operations: translation_operations - info: - title: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - langcode: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_target_language: - align: '' - separator: '' - empty_column: false - responsive: '' - translation_outdated: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_status: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' - changed: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_operations: - align: '' - separator: '' - empty_column: false - responsive: '' - default: changed - empty_table: false - row: - type: fields - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - label: From - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: language - settings: - link_to_entity: false - native_language: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: langcode - plugin_id: field - translation_target_language: - id: translation_target_language - table: node_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - label: To - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - native_language: false - entity_type: node - plugin_id: translation_views_target_language - translation_outdated: - id: translation_outdated - table: node_translation_target - field: translation_outdated - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: boolean - type_custom_true: '' - type_custom_false: '' - not: false - plugin_id: boolean - translation_status: - id: translation_status - table: node_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - label: 'Translation status' - exclude: false - alter: - alter_text: true - text: "{{ translation_status }}\n{% if translation_outdated %} {{ 'outdated'|t }}{% endif %}" - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: status - type_custom_true: ✅ - type_custom_false: ❌ - not: false - plugin_id: boolean - translation_changed: - id: translation_changed - table: node_translation_target - field: translation_changed - relationship: none - group_type: group - admin_label: '' - label: Changed - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' - entity_field: changed - plugin_id: date - translation_operations: - id: translation_operations - table: node_translation - field: translation_operations - relationship: none - group_type: group - admin_label: '' - label: 'Translation operations' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - entity_type: node - plugin_id: translation_views_operations - filters: - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: 'Source language' - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: langcode - plugin_id: language - content_translation_outdated: - id: content_translation_outdated - table: node_field_data - field: content_translation_outdated - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '0' - group: 1 - exposed: false - expose: - operator_id: '' - label: 'Translation outdated' - description: '' - use_operator: false - operator: content_translation_outdated_op - identifier: content_translation_outdated - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: content_translation_outdated - plugin_id: boolean - translation_target_language: - id: translation_target_language - table: node_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Target language' - description: '' - use_operator: false - operator: translation_target_language_op - identifier: translation_target_language - required: true - remember: true - multiple: false - remember_roles: - anonymous: anonymous - authenticated: authenticated - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - remove: true - entity_type: node - plugin_id: translation_views_target_language - translation_outdated: - id: translation_outdated - table: node_translation_target - field: translation_outdated - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: Outdated - description: '' - use_operator: false - operator: translation_outdated_op - identifier: translation_outdated - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_field: content_translation_outdated - plugin_id: boolean - translation_status: - id: translation_status - table: node_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '0' - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Translation status' - description: '' - use_operator: false - operator: translation_status_op - identifier: translation_status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - plugin_id: translation_views_status - translation_default: - id: translation_default - table: node_translation_target - field: translation_default - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '0' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: boolean - translation_status_1: - id: translation_status_1 - table: node_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '0' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - plugin_id: translation_views_status - translation_source: - id: translation_source - table: node_translation_target - field: translation_source - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 2 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: translation_views_source_equals_row - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Content Translation jobs' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - 2: OR - 3: OR - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: translate/content - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/translation_views/config/schema/translation_views.views.schema.yml b/sites/all/modules/contrib/views/translation_views/config/schema/translation_views.views.schema.yml deleted file mode 100644 index 74d22e5ae..000000000 --- a/sites/all/modules/contrib/views/translation_views/config/schema/translation_views.views.schema.yml +++ /dev/null @@ -1,71 +0,0 @@ -views.filter.translation_views_translation_count: - type: views.filter.numeric - label: 'Translation count' - -views.filter_value.translation_views_translation_count: - type: views.filter_value.numeric - label: 'Filter rows by amount of translations' - -views.filter.translation_views_source_equals_row: - type: views.filter.boolean - value: 'A boolean indicating whether the translation source of target language is same as the row language' - -views.filter.translation_views_status: - type: views.filter.boolean - label: 'A boolean indicating whether the node is translated into target language' - -views.filter.translation_views_target_language: - type: views_filter - label: 'Target language' - mapping: - value: - type: string - label: 'Value' - remove: - type: boolean - label: 'Remove rows where source language is equal to target language' - limit: - type: boolean - label: 'Enable limiting languages list using Local Translation module' - column: - type: mapping - label: 'Column' - mapping: - from: - type: string - lable: 'Source language' - to: - type: string - lable: 'Target language' - -views.field.translation_views_translation_count: - type: views.field.numeric - label: 'Amount of translations' - mapping: - include_original_language: - type: boolean - label: 'Include original language in count' - -views.field.translation_views_operations: - type: views_field - label: 'Provides links to perform translation operations' - -views.field.translation_views_source_equals_row: - type: views.field.boolean - label: 'A boolean indicating whether the translation source of target language is same as the row language' - -views.field.translation_views_status: - type: views.field.boolean - label: 'A boolean indicating whether the node is translated into target language' - -views.field.translation_views_target_language: - type: views.field.language - label: 'The target language' - -views.field.translation_moderation_state: - type: views_field - label: 'Translation moderation state' - mapping: - display_name: - type: string - label: 'Formatter' diff --git a/sites/all/modules/contrib/views/translation_views/src/EntityTranslationInfo.php b/sites/all/modules/contrib/views/translation_views/src/EntityTranslationInfo.php deleted file mode 100644 index c4f65503a..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/EntityTranslationInfo.php +++ /dev/null @@ -1,81 +0,0 @@ -entity = $entity; - $this->accessHandler = $accessHandler; - - $this->sourceLanguage = $sourceLanguage; - $this->targetLanguage = $targetLanguage; - - $this->entityTypeId = $entity->getEntityTypeId(); - $this->entityType = $entity->getEntityType(); - } - - /** - * A wrapper for getting translation access per operation. - * - * @see \Drupal\content_translation\ContentTranslationHandlerInterface::getTranslationAccess, - * for available operations. - */ - public function getTranslationAccess($operation) { - $access = $this->accessHandler->getTranslationAccess($this->entity, $operation); - return $access->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationCountField.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationCountField.php deleted file mode 100644 index e8c533b65..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationCountField.php +++ /dev/null @@ -1,83 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->joinHandler = $join_handler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, $plugin_id, $plugin_definition, - $container->get('entity_type.manager'), - $container->get('plugin.manager.views.join') - ); - } - - /** - * {@inheritdoc} - */ - public function query() { - /** @var \Drupal\views\Plugin\views\query\Sql $query */ - $query = $this->query; - $join_alias = $this->joinLanguages($query); - $this->field_alias = $query->addField($join_alias, 'count_langs', $this->realField); - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['include_original_language'] = ['default' => FALSE]; - return $options; - } - - /** - * Provide option to include original language in count. - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - $form['include_original_language'] = [ - '#title' => $this->t('Include original language in count'), - '#description' => $this->t("Enable to also count the original language."), - '#type' => 'checkbox', - '#default_value' => !empty($this->options['include_original_language']), - ]; - parent::buildOptionsForm($form, $form_state); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationModerationState.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationModerationState.php deleted file mode 100644 index 435ba90e2..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationModerationState.php +++ /dev/null @@ -1,161 +0,0 @@ -moderationInfo = $moderation_info; - $this->languageManager = $language_manager; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition - ) { - return new static( - $configuration, $plugin_id, $plugin_definition, - $container->get('content_moderation.moderation_information'), - $container->get('language_manager'), - $container->get('entity_type.manager') - ); - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['display_name'] = ['default' => TRUE]; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - $default_value = 'state'; - $states = [ - 'state' => $this->t('Moderation State'), - 'name' => $this->t('Machine Name'), - ]; - if (!empty($this->options['display_name'])) { - $default_value = $this->options['display_name']; - } - $form['display_name'] = [ - '#type' => 'select', - '#title' => $this->t('Formatter'), - '#options' => $states, - '#required' => TRUE, - '#default_value' => $default_value, - ]; - parent::buildOptionsForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function query() { - - } - - /** - * {@inheritdoc} - */ - public function clickSortable() { - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function render(ResultRow $values) { - if ($values->_entity->id()) { - /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */ - $entityTypeId = $values->_entity->getEntityTypeId(); - $storage = $this->entityTypeManager->getStorage($entityTypeId); - $entity = $storage->load($values->_entity->id()); - $target_langcode = $this->getTargetLangcode(); - $pending_revision_enabled = ContentTranslationManager::isPendingRevisionSupportEnabled($entityTypeId); - - if (empty($target_langcode) || $target_langcode == '***LANGUAGE_site_default***') { - $target_langcode = $this->languageManager->getCurrentLanguage()->getId(); - } - - $translation_has_revision = $storage->getLatestTranslationAffectedRevisionId($values->_entity->id(), $target_langcode); - if ($entity && $pending_revision_enabled && $target_langcode && $translation_has_revision) { - $latest_revision = $storage->loadRevision($translation_has_revision); - if ($entity && $latest_revision->hasTranslation($target_langcode)) { - $workflow = $this->moderationInfo->getWorkflowForEntity($latest_revision); - $translation = $latest_revision->getTranslation($target_langcode); - $translation_state = $translation->moderation_state->value; - - if (!empty($this->options['display_name']) && $workflow !== NULL) { - if ($this->options['display_name'] == 'state') { - $translation_label = $workflow->getTypePlugin() - ->getState($translation_state) - ->label(); - $values->{$this->field_alias} = $translation_label ? $translation_label : NULL; - } - else { - $values->{$this->field_alias} = $translation_state ? $translation_state : NULL; - } - } - } - } - } - - return parent::render($values); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationOperationsField.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationOperationsField.php deleted file mode 100644 index 1bd34d13f..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationOperationsField.php +++ /dev/null @@ -1,382 +0,0 @@ -currentUser = $account; - $this->entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition - ) { - return new static( - $configuration, $plugin_id, $plugin_definition, - $container->get('entity.manager'), - $container->get('entity_type.manager'), - $container->get('language_manager'), - $container->get('current_user') - ); - } - - /** - * {@inheritdoc} - * - * Build operation links. - */ - public function render(ResultRow $values) { - /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = $this->getEntity($values); - $langcode_key = $this->buildSourceEntityLangcodeKey($entity); - $source_langcode = $values->{$langcode_key}; - $operations = $this->getTranslationOperations($entity, $source_langcode); - - if ($this->options['destination']) { - foreach ($operations as &$operation) { - if (!isset($operation['query'])) { - $operation['query'] = []; - } - $operation['query'] += $this->getDestinationArray(); - } - } - $build = [ - '#type' => 'operations', - '#links' => $operations, - ]; - $build['#cache']['contexts'][] = 'url.query_args:target_language'; - - return $build; - } - - /** - * Build value key. - * - * Value key based on base table, - * and system name of langcode key (it might be differ then just 'langcode'), - * usually table alias is [entity_type]_field_data_[langcode_key]. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * Used to extract entity type info from entity. - * - * @return string - * The value key. - */ - protected function buildSourceEntityLangcodeKey(ContentEntityInterface $entity) { - return implode('_', [ - $this->view->storage->get('base_table'), - $entity->getEntityType()->getKey('langcode'), - ]); - } - - /** - * Operation links manager. - * - * Decide which links we should generate: - * based on user permissions, - * and entity state (has translation, is default, etc.). - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The source entity to get context for decision. - * @param string $source_langcode - * The langcode of the row. - * - * @return array - * Operation links' render array. - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Core\Entity\EntityMalformedException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - protected function getTranslationOperations(ContentEntityInterface $entity, $source_langcode) { - $links = []; - $target_langcode = $this->getTargetLangcode() - ? $this->getTargetLangcode() - : $source_langcode; - - /* @var \Drupal\content_translation\ContentTranslationHandlerInterface $handler */ - $handler = $this->getEntityManager() - ->getHandler($entity->getEntityTypeId(), 'translation'); - - // Construct special object to store common properties, - // it will be used by all builder functions, - // just as "trait" but for methods. - $translation_info = new EntityTranslationInfo( - $entity, - $handler, - $this->languageManager->getLanguage($target_langcode), - $this->languageManager->getLanguage($source_langcode) - ); - - $is_default = static::isDefaultTranslation($translation_info); - - // Build edit & delete link. - if (array_key_exists($target_langcode, $entity->getTranslationLanguages())) { - // If the user is allowed to edit the entity we point the edit link to - // the entity form, otherwise if we are not dealing with the original - // language we point the link to the translation form. - if ($entity->access('update', NULL) - && $translation_info->entityType->hasLinkTemplate('edit-form') - ) { - $links += $this->buildEditLink($translation_info, 'entity'); - } - elseif (!$is_default - && $translation_info->getTranslationAccess('update') - || $this->checkForOperationTranslationPermission('update') - ) { - $links += $this->buildEditLink($translation_info, 'translation'); - } - - // Build delete link. - if ($entity->access('delete') - && $translation_info->entityType->hasLinkTemplate('delete-form') - ) { - $links += $this->buildDeleteLink($translation_info, 'entity'); - } - elseif (!$is_default - && $translation_info->getTranslationAccess('delete') - || $this->checkForOperationTranslationPermission('delete') - ) { - $links += $this->buildDeleteLink($translation_info, 'translation'); - } - } - // Check if there are pending revisions. - elseif ($this->pendingRevisionExist($translation_info)) { - // If the user is allowed to edit the entity we point the edit link to - // the entity form, otherwise if we are not dealing with the original - // language we point the link to the translation form. - if ($entity->access('update', NULL) - && $translation_info->entityType->hasLinkTemplate('edit-form') - ) { - $links += $this->buildEditLink($translation_info, 'entity'); - } - elseif (!$is_default - && $translation_info->getTranslationAccess('update') - || $this->checkForOperationTranslationPermission('update') - ) { - $links += $this->buildEditLink($translation_info, 'translation'); - } - } - // Build add link. - elseif (!empty($target_langcode) - && $translation_info->entity->isTranslatable() - && $translation_info->getTranslationAccess('create') - ) { - // No such translation. - $links += $this->buildAddLink($translation_info); - } - - return $links; - } - - /** - * Check if the current user has appropriate translation permission. - * - * @param string $operation - * Operation name. - * - * @return bool - * TRUE - if user permitted to perform specified operation, FALSE otherwise. - */ - protected function checkForOperationTranslationPermission($operation) { - if (!in_array($operation, ['create', 'update', 'delete'], TRUE)) { - return FALSE; - } - return $this->currentUser - ->hasPermission("$operation content translations"); - } - - /** - * Check if target translation is the default translation. - * - * @param \Drupal\translation_views\EntityInfo $translation_info - * Entity info object. - * - * @return bool - * Checking result. - */ - protected static function isDefaultTranslation(EntityTranslationInfo $translation_info) { - $default_langcode = $translation_info->entity - ->getUntranslated() - ->language() - ->getId(); - $target_langcode = $translation_info->targetLanguage->getId(); - return $default_langcode === $target_langcode; - } - - /** - * Check if pending revision exist for this translation. - * - * @param \Drupal\translation_views\EntityInfo $translation_info - * Entity info object. - * - * @return bool - * TRUE - if pending revision exist, FALSE otherwise. - * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - */ - protected function pendingRevisionExist(EntityTranslationInfo $translation_info) { - $pending_revision_enabled = ContentTranslationManager::isPendingRevisionSupportEnabled($translation_info->entityTypeId); - if ($this->moduleHandler->moduleExists('content_moderation') && $pending_revision_enabled) { - /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */ - $storage = $this->entityTypeManager->getStorage($translation_info->entityTypeId); - $entity = $storage->load($translation_info->entity->id()); - $translation_has_revision = $storage->getLatestTranslationAffectedRevisionId( - $entity->id(), - $translation_info->targetLanguage->getId() - ); - if ($translation_has_revision) { - return TRUE; - } - } - return FALSE; - } - - /** - * Add link builder. - */ - protected function buildAddLink(EntityTranslationInfo $translation_info) { - $links = []; - - $add_url = new Url( - "entity.{$translation_info->entityTypeId}.content_translation_add", - [ - 'source' => $translation_info->sourceLanguage->getId(), - 'target' => $translation_info->targetLanguage->getId(), - $translation_info->entityTypeId => $translation_info->entity->id(), - ], - [ - 'language' => $translation_info->targetLanguage, - ] - ); - - $links['add'] = [ - 'title' => $this->t('Add'), - 'url' => $add_url, - ]; - return $links; - } - - /** - * Delete link builder. - */ - protected function buildDeleteLink(EntityTranslationInfo $translation_info, $type = FALSE) { - $links = []; - - if (!$type) { - return $links; - } - - if ($type == 'entity') { - $links['delete'] = [ - 'title' => $this->t('Delete'), - 'url' => $translation_info->entity->urlInfo('delete-form'), - 'language' => $translation_info->targetLanguage, - ]; - } - elseif ($type == 'translation') { - $links['delete'] = [ - 'title' => $this->t('Delete'), - 'url' => new Url( - "entity.{$translation_info->entityTypeId}.content_translation_delete", - [ - 'language' => $translation_info->targetLanguage->getId(), - $translation_info->entityTypeId => $translation_info->entity->id(), - ], - [ - 'language' => $translation_info->targetLanguage, - ] - ), - ]; - } - return $links; - } - - /** - * Edit link builder. - * - * @throws \Drupal\Core\Entity\EntityMalformedException - */ - protected function buildEditLink(EntityTranslationInfo $translation_info, $type = FALSE) { - $links = []; - - if ($type == 'entity') { - $links['edit']['url'] = $translation_info->entity->toUrl('edit-form'); - $links['edit']['language'] = $translation_info->targetLanguage; - } - elseif ($type == 'translation') { - $links['edit']['url'] = new Url( - "entity.{$translation_info->entityTypeId}.content_translation_edit", - [ - 'language' => $translation_info->targetLanguage->getId(), - $translation_info->entityTypeId => $translation_info->entity->id(), - ], - [ - 'language' => $translation_info->targetLanguage, - ] - ); - ; - } - - if (isset($links['edit'])) { - $links['edit']['title'] = $this->t('Edit'); - } - - return $links; - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationSourceLangcodeEqualsRowLangcodeField.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationSourceLangcodeEqualsRowLangcodeField.php deleted file mode 100644 index 38b04882b..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationSourceLangcodeEqualsRowLangcodeField.php +++ /dev/null @@ -1,49 +0,0 @@ -field_alias = 'source_lang_eq_row'; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['type'] = ['default' => 'status']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function query() { - $table_alias = $this->ensureMyTable(); - $base_table = $this->view->storage->get('base_table'); - - $this->query->addField( - NULL, - "IF(($table_alias.content_translation_source = $base_table.langcode) OR ($table_alias.default_langcode = 1), 1, 0)", - 'source_lang_eq_row' - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationStatus.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationStatus.php deleted file mode 100644 index a701ce7b4..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationStatus.php +++ /dev/null @@ -1,95 +0,0 @@ -get('language_manager') - ); - } - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->languageManager = $language_manager; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['type'] = ['default' => 'status']; - return $options; - } - - /** - * {@inheritdoc} - */ - public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { - $this->definition['output formats']['status'] = [ - t('Translated'), $this->t('Not translated'), - ]; - $this->field_alias = 'translation_status'; - - parent::init($view, $display, $options); - } - - /** - * {@inheritdoc} - * - * Convert translation status value into TranslationStatusInterface values. - */ - public function render(ResultRow $values) { - $values->{$this->field_alias} = $values->{$this->field_alias} > 0 - ? TranslationStatusInterface::TRANSLATION_EXISTING - : NULL; - return parent::render($values); - } - - /** - * {@inheritdoc} - * - * Expression wouldn't work without: - * - * @see translation_views_query_views_alter() - */ - public function query() { - $table_alias = $this->ensureMyTable(); - $this->query->addField( - NULL, - "FIND_IN_SET(:langcode, $table_alias.langs) > 0", - 'translation_status', - [ - 'placeholders' => [':langcode' => '***TRANSLATION_VIEWS_TARGET_LANG***'], - ] - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationTargetLanguageField.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationTargetLanguageField.php deleted file mode 100644 index 298a269db..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/field/TranslationTargetLanguageField.php +++ /dev/null @@ -1,84 +0,0 @@ -get('language_manager') - ); - } - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->languageManager = $language_manager; - } - - /** - * {@inheritdoc} - */ - public function usesGroupBy() { - return FALSE; - } - - /** - * {@inheritdoc} - * - * Override parent to get langcode from exposed input, - * instead from ResultRow. - */ - public function render(ResultRow $values) { - $target_langcode = $this->getTargetLangcode(); - - $languages = $this->options['native_language'] - ? $this->languageManager->getNativeLanguages() - : $this->languageManager->getLanguages(); - - $build['#markup'] = $languages[$target_langcode]->getName(); - $build['#cache']['contexts'][] = 'url.query_args:' . self::$targetExposedKey; - - return $build; - } - - /** - * {@inheritdoc} - */ - public function query() {} - - /** - * {@inheritdoc} - */ - public function clickSortable() { - return FALSE; - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationCountFilter.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationCountFilter.php deleted file mode 100644 index 24f16ec3f..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationCountFilter.php +++ /dev/null @@ -1,69 +0,0 @@ -get('entity_type.manager'), - $container->get('plugin.manager.views.join') - ); - } - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, ViewsHandlerManager $join_handler) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - - $this->entityTypeManager = $entity_type_manager; - $this->joinHandler = $join_handler; - } - - /** - * {@inheritdoc} - */ - public function query() { - /** @var \Drupal\views\Plugin\views\query\Sql $query */ - $query = $this->query; - $op = $this->operator; - - $join_alias = $this->joinLanguages($query); - - $query->addWhereExpression( - $this->options['group'], - "IF(ISNULL($join_alias.count_langs), 0, $join_alias.count_langs) $op :value", - [':value' => $this->value['value']] - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationSourceLangcodeEqualsRowLangcodeFilter.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationSourceLangcodeEqualsRowLangcodeFilter.php deleted file mode 100644 index f7fdb1bd0..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationSourceLangcodeEqualsRowLangcodeFilter.php +++ /dev/null @@ -1,31 +0,0 @@ -ensureMyTable(); - $base_table = $this->view->storage->get('base_table'); - - $this->query->addWhereExpression( - $this->options['group'], - "IF(($table_alias.content_translation_source $this->operator $base_table.langcode) OR ($table_alias.default_langcode $this->operator 1), 1, 0) = :value", [ - ':value' => $this->value, - ] - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationStatusFilter.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationStatusFilter.php deleted file mode 100644 index 3059968f4..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationStatusFilter.php +++ /dev/null @@ -1,52 +0,0 @@ -valueOptions = [1 => $this->t('Translated'), 0 => $this->t('Not translated')]; - } - - /** - * {@inheritdoc} - */ - public function query() { - $table_alias = $this->ensureMyTable(); - $status = $this->value; - - if ($status == 0) { - $operation = '='; - } - // Then status translated is the case. - else { - // Mysql FIND_IN_SET func will return position of element, - // when no element was found then it returns 0, - // so we use "> 0" as condition to filter out untranslated rows. - $operation = '>'; - $status = 0; - } - - /* @var \Drupal\views\Plugin\views\query\Sql */ - $this->query->addWhereExpression( - $this->options['group'], - "FIND_IN_SET(:langcode, $table_alias.langs) $operation :status", [ - ':langcode' => '***TRANSLATION_VIEWS_TARGET_LANG***', - ':status' => $status, - ] - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationTargetLanguageFilter.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationTargetLanguageFilter.php deleted file mode 100644 index 3844ac630..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/filter/TranslationTargetLanguageFilter.php +++ /dev/null @@ -1,298 +0,0 @@ -get('language_manager'), - $container->get('module_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager, ModuleHandlerInterface $handler) { - parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->languageManager = $language_manager; - $this->localTranslation = $handler->moduleExists('local_translation_content'); - if ($this->localTranslation && \Drupal::hasService('local_translation.user_skills')) { - $this->skills = \Drupal::service('local_translation.user_skills'); - } - } - - /** - * {@inheritdoc} - */ - public function buildExposeForm(&$form, FormStateInterface $form_state) { - parent::buildExposeForm($form, $form_state); - - unset($form['expose']['multiple']); - unset($form['expose']['required']); - - if ($this->localTranslation) { - // We need to force this option to allow users to use only the languages, - // specified as the user's translation skills. - $form['expose']['reduce']['#default_value'] = TRUE; - $form['expose']['reduce']['#disabled'] = TRUE; - } - - $form['expose']['identifier'] = [ - '#type' => 'hidden', - '#value' => static::$targetExposedKey, - ]; - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - - $options['expose']['contains']['label'] = [ - 'default' => $this->t('Target language'), - ]; - - $options['expose']['contains']['identifier'] = [ - 'default' => static::$targetExposedKey, - ]; - - $options['value']['default'] = ''; - $options['remove']['default'] = TRUE; - $options['exposed']['default'] = TRUE; - - if ($this->localTranslation) { - $options['limit'] = ['default' => FALSE]; - $options['column'] = ['default' => ['from' => '', 'to' => 'to']]; - } - - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - if ($this->localTranslation) { - // Remove the values list - we will handle them on a background basis. - // Only if limited option is checked. - $form['value']['#states'] = [ - 'visible' => [ - 'input[name="options[limit]"]' => ['checked' => FALSE], - ], - ]; - // Build values list independently in order to see all the options, - // while switching "limit" option without necessity to reload the form. - $form['value']['#options'] = $this->listLanguages( - LanguageInterface::STATE_ALL - | LanguageInterface::STATE_SITE_DEFAULT - | PluginBase::INCLUDE_NEGOTIATED - ); - - $end = $form['clear_markup_end']; - unset($form['clear_markup_end']); - $form['limit'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Limit target languages by translation skills'), - '#required' => FALSE, - '#default_value' => $this->options['limit'], - ]; - $form['column'] = [ - '#type' => 'checkboxes', - '#options' => [ - 'from' => $this->t('Source languages'), - 'to' => $this->t('Target languages'), - ], - '#title' => $this->t('Languages by translation skills'), - '#required' => FALSE, - '#default_value' => $this->options['column'], - '#states' => [ - 'visible' => [ - 'input[name="options[limit]"]' => ['checked' => TRUE], - ], - ], - ]; - $form['clear_markup_end'] = $end; - $form['value']['#prefix'] = '
        '; - } - } - - /** - * {@inheritdoc} - */ - protected function valueForm(&$form, FormStateInterface $form_state) { - parent::valueForm($form, $form_state); - - $exposed = $form_state->get('exposed'); - - $language_options = $this->buildLanguageOptions(); - $default_langcode = $this->languageManager->getDefaultLanguage()->getId(); - - if (!empty($this->options['exposed'])) { - $identifier = $this->options['expose']['identifier']; - $user_input = $form_state->getUserInput(); - - // We need set exposed input when there is no selected value by user yet. - if ($exposed) { - if (!isset($this->options['limit'])) { - $this->options['limit'] = FALSE; - } - if (!$this->options['limit']) { - if (!isset($user_input[$identifier]) - || (isset($user_input[$identifier]) && $user_input[$identifier] === $default_langcode) - ) { - $this->setExposedValue($identifier, PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT, $form_state); - } - } - elseif (isset($user_input[$identifier]) && !isset($language_options[$user_input[$identifier]])) { - $this->setExposedValue($identifier, array_keys($language_options)[0], $form_state); - $this->value = array_keys($language_options)[0]; - } - } - } - - $this->always_required = TRUE; - - $form['value'] = [ - '#type' => 'select', - '#title' => $this->t('Target language'), - '#options' => $this->buildLanguageOptions(), - '#multiple' => FALSE, - '#required' => TRUE, - '#default_value' => $this->value, - ]; - - $form['expose']['identifier'] = [ - '#type' => 'hidden', - '#value' => static::$targetExposedKey, - ]; - - if (!$exposed) { - $form['remove'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Remove rows where source language is equal to target language.'), - '#default_value' => $this->options['remove'], - '#weight' => -50, - ]; - } - } - - /** - * Provide options for langcode dropdown. - * - * Options are based on configurable languages or site default one. - */ - protected function buildLanguageOptions() { - $options = []; - if ($this->localTranslation && $this->options['limit']) { - $skills = $this->skills->getSkills(NULL, TRUE); - // Handle column options. - foreach ($this->options['column'] as $name => $column) { - if (!empty($column)) { - foreach ($skills as $langs) { - $this->processColumnOption($langs, $name, $options); - } - } - } - return $options; - } - $site_default = $this->languageManager->getDefaultLanguage(); - $options = $this->listLanguages(LanguageInterface::STATE_CONFIGURABLE); - - if (isset($options[$site_default->getId()])) { - unset($options[$site_default->getId()]); - } - return [PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT => $site_default->getName()] + $options; - } - - /** - * Process column options. - * - * @param array $languages - * Languages array. - * @param string $column - * Column name. - */ - protected function processColumnOption(array $languages, $column, &$options) { - $key = "language_$column"; - if (isset($languages[$key])) { - $key = $languages[$key]; - $options[$key] = $this->languageManager - ->getLanguage($key) - ->getName(); - } - } - - /** - * {@inheritdoc} - */ - protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $current_values = NULL) { - return array_map(function ($language) { - return (string) $language; - }, parent::listLanguages($flags, $current_values)); - } - - /** - * {@inheritdoc} - */ - public function query() { - if ($this->options['remove']) { - $this->query->addWhere( - $this->options['group'], - $this->view->storage->get('base_table') . '.langcode', - '***TRANSLATION_VIEWS_TARGET_LANG***', - '<>' - ); - } - } - - /** - * Special setter for exposed value in views. - */ - protected function setExposedValue($identifier, $value, FormStateInterface $form_state) { - $user_input = $form_state->getUserInput(); - $user_input[$identifier] = $value; - - $form_state->setUserInput($user_input); - $this->view->setExposedInput($user_input); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/join/TranslationLanguageJoin.php b/sites/all/modules/contrib/views/translation_views/src/Plugin/views/join/TranslationLanguageJoin.php deleted file mode 100755 index 3f16b895d..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/Plugin/views/join/TranslationLanguageJoin.php +++ /dev/null @@ -1,70 +0,0 @@ -database = $database; - $this->eid = $this->configuration['entity_id']; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('database') - ); - } - - /** - * {@inheritdoc} - */ - public function buildJoin($select_query, $table, $view_query) { - $query = $this->database->select($this->table, 'efd'); - $query->fields('efd', [$this->eid]); - - if (!empty($this->configuration['langcodes_as_count'])) { - $query->addExpression("COUNT(efd.langcode)", 'count_langs'); - if (isset($this->configuration['include_original_language']) - && $this->configuration['include_original_language'] == FALSE) { - $query->where('efd.default_langcode != 1'); - } - } - else { - $query->addExpression("GROUP_CONCAT(efd.langcode separator ',')", 'langs'); - } - $query->groupBy('efd.' . $this->eid); - $this->configuration['table formula'] = $query; - - parent::buildJoin($select_query, $table, $view_query); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/TranslationCountTrait.php b/sites/all/modules/contrib/views/translation_views/src/TranslationCountTrait.php deleted file mode 100644 index 0bc0d12e6..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/TranslationCountTrait.php +++ /dev/null @@ -1,52 +0,0 @@ -tables[$this->tableAlias])) { - $query_base_table = $this->relationship ?: $this->view->storage->get('base_table'); - - $entity_type = $this->entityTypeManager->getDefinition($this->getEntityType()); - $keys = $entity_type->getKeys(); - - $definition = [ - 'type' => 'LEFT', - 'left_field' => $keys['id'], - 'field' => $keys['id'], - 'table' => $query_base_table, - 'left_table' => $query_base_table, - 'include_original_language' => !empty($this->options['include_original_language']), - 'langcodes_as_count' => TRUE, - 'entity_id' => $keys['id'], - ]; - - $tableAlias = $query->ensureTable($query_base_table, $this->relationship); - $join = $this->joinHandler->createInstance('translation_views_language_join', $definition); - - return $query->addTable($query_base_table, $tableAlias, $join, $this->tableAlias); - } - else { - return $this->tableAlias; - } - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/TranslationViewsFieldDefinitions.php b/sites/all/modules/contrib/views/translation_views/src/TranslationViewsFieldDefinitions.php deleted file mode 100644 index 2462fee17..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/TranslationViewsFieldDefinitions.php +++ /dev/null @@ -1,164 +0,0 @@ - [ - 'field_name' => 'status', - 'real field' => 'langcode', - 'title' => t('Translation status'), - 'field' => [ - 'id' => 'translation_views_status', - 'help' => t('A boolean indicating whether the node is translated into target language.'), - 'additional fields' => [ - 'content_translation_source' => 'content_translation_source', - ], - ], - 'filter' => [ - 'id' => 'translation_views_status', - 'help' => t('A boolean indicating whether the node is translated into target language.'), - ], - ], - ]; - } - - /** - * Translation count field definition. - */ - public static function buildCountField() { - return [ - 'translation_count' => [ - 'field_name' => 'counter', - 'real field' => 'translation_langs', - 'title' => t('Translation counter'), - 'field' => [ - 'id' => 'translation_views_translation_count', - 'help' => t('Amount of translations.'), - ], - 'filter' => [ - 'id' => 'translation_views_translation_count', - 'help' => t('Filter rows by amount of translations.'), - ], - ], - ]; - } - - /** - * Translation changed field definition. - */ - public static function buildChangedField($definition) { - $field = []; - $field['translation_changed'] = $definition; - $field['translation_changed']['real field'] = 'changed'; - $field['translation_changed']['field']['id'] = 'date'; - $field['translation_changed']['field']['help'] = t('The time that the node was last edited in target language.'); - $field['translation_changed']['title'] = t('Translation changed time'); - return $field; - } - - /** - * Translation outdated field definition. - */ - public static function buildOutdatedField($definition) { - $field = []; - $field['translation_outdated'] = $definition; - $field['translation_outdated']['real field'] = 'content_translation_outdated'; - $field['translation_outdated']['field']['id'] = 'boolean'; - $field['translation_outdated']['filter']['id'] = 'boolean'; - $field['translation_outdated']['field']['help'] = t('A boolean indicating whether the target language translation is outdated'); - $field['translation_outdated']['filter']['help'] = t('A boolean indicating whether the target language translation is outdated'); - $field['translation_outdated']['title'] = t('Translation outdated'); - return $field; - } - - /** - * Translation source field definition. - */ - public static function buildSourceField($definition) { - $field = []; - $field['translation_source'] = $definition; - $field['translation_source']['real field'] = 'content_translation_source'; - $field['translation_source']['field']['id'] = 'translation_views_source_equals_row'; - $field['translation_source']['filter']['id'] = 'translation_views_source_equals_row'; - $field['translation_source']['field']['help'] = t('A boolean indicating whether the translation source of target language is same as the row language'); - $field['translation_source']['filter']['help'] = t('A boolean indicating whether the translation source of target language is same as the row language'); - $field['translation_source']['title'] = t('Source translation of target language equals row language'); - return $field; - } - - /** - * Translation default langcode field definition. - */ - public static function buildDefaultLangcodeField($definition) { - $field = []; - $field['translation_default'] = $definition; - $field['translation_default']['real field'] = 'default_langcode'; - $field['translation_default']['field']['id'] = 'boolean'; - $field['translation_default']['filter']['id'] = 'boolean'; - $field['translation_default']['filter']['accept null'] = TRUE; - $field['translation_default']['field']['help'] = t('A boolean indicating whether the target language is default language'); - $field['translation_default']['filter']['help'] = t('A boolean indicating whether the target language is default language'); - $field['translation_default']['title'] = t('Target language equals default language'); - return $field; - } - - /** - * Translation operations field definition. - */ - public static function buildOpLinksField() { - $field['translation_operations'] = [ - 'title' => t('Translation operations'), - 'help' => t('Provides links to perform translation operations.'), - 'field' => [ - 'id' => 'translation_views_operations', - ], - ]; - return $field; - } - - /** - * Translation target language field definition. - */ - public static function buildTargetLanguageField() { - $field['translation_target_language']['field'] = [ - 'title' => t('Target language'), - 'id' => 'translation_views_target_language', - 'help' => t('The target language.'), - ]; - $field['translation_target_language']['filter'] = [ - 'title' => t('Target language'), - 'id' => 'translation_views_target_language', - 'help' => t('Define the target language for other translation fields/filters. This filter should in most cases be used only as exposed filter.'), - ]; - return $field; - } - - /** - * Translation moderation state field definition. - */ - public static function buildModerationStateField() { - return [ - 'translation_moderation_state' => [ - 'title' => t('Translation moderation state'), - 'field' => [ - 'id' => 'translation_moderation_state', - 'property' => 'translation_moderation_state', - 'field_name' => t('Translation moderation state'), - 'help' => t('Moderation state of the translation.'), - ], - ], - ]; - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/src/TranslationViewsTargetLanguage.php b/sites/all/modules/contrib/views/translation_views/src/TranslationViewsTargetLanguage.php deleted file mode 100644 index ac0e9db83..000000000 --- a/sites/all/modules/contrib/views/translation_views/src/TranslationViewsTargetLanguage.php +++ /dev/null @@ -1,47 +0,0 @@ -view->getExposedInput(); - $langcode = isset($inputs[self::$targetExposedKey]) - ? $inputs[self::$targetExposedKey] - : PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT; - - return $langcode == PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT - ? $this->languageManager->getDefaultLanguage()->getId() - : $langcode; - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/config/install/views.view.test_local_translation_content_integration.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/config/install/views.view.test_local_translation_content_integration.yml deleted file mode 100644 index d4d912824..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/config/install/views.view.test_local_translation_content_integration.yml +++ /dev/null @@ -1,253 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - module: - - node - - translation_views - - user -id: test_local_translation_content_integration -label: 'Test local translation content integration' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: none - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - offset: 0 - style: - type: default - row: - type: 'entity:node' - options: - relationship: none - view_mode: teaser - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: language - settings: - link_to_entity: false - native_language: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: langcode - plugin_id: field - filters: - translation_target_language: - id: translation_target_language - table: node_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '***LANGUAGE_site_default***' - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Target language' - description: '' - use_operator: false - operator: '' - identifier: translation_target_language - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - remove: true - limit: false - column: - from: '' - to: 'to' - entity_type: node - plugin_id: translation_views_target_language - sorts: { } - title: 'Test local translation content filter' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: test-local-translation-content-filter - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/translation_views_local_translation_test.info.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/translation_views_local_translation_test.info.yml deleted file mode 100644 index b272afabe..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_local_translation_test/translation_views_local_translation_test.info.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Translation views Local Translation integration test' -type: module -description: '' -package: Testing -# core: 8.x -dependencies: - - drupal:node - - drupal:views - - drupal:translation_views - - drupal:content_translation - - drupal:language - - local_translation:local_translation - - local_translation:local_translation_content - -# Information added by Drupal.org packaging script on 2019-02-07 -version: '8.x-1.0-alpha5' -core: '8.x' -project: 'translation_views' -datestamp: 1549581183 diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.comment_translation.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.comment_translation.yml deleted file mode 100644 index 1e8727d73..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.comment_translation.yml +++ /dev/null @@ -1,997 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - comment - - node - - translation_views - - user -id: comment_translation -label: 'Comment translation' -module: views -description: '' -tag: '' -base_table: comment_field_data -base_field: cid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access comments' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - subject: subject - langcode: langcode - translation_target_language: translation_target_language - translation_default: translation_default - translation_changed: translation_changed - translation_count: translation_count - translation_operations: translation_operations - translation_outdated: translation_outdated - translation_source: translation_source - translation_status: translation_status - info: - subject: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - langcode: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_target_language: - align: '' - separator: '' - empty_column: false - responsive: '' - translation_default: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_changed: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_count: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_operations: - align: '' - separator: '' - empty_column: false - responsive: '' - translation_outdated: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_source: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_status: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - relationships: - node: - id: node - table: comment_field_data - field: node - entity_type: comment_field_data - required: true - plugin_id: standard - relationship: none - group_type: group - admin_label: Content - fields: - subject: - id: subject - table: comment_field_data - field: subject - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: false - ellipsis: false - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: comment - entity_field: subject - plugin_id: field - langcode: - id: langcode - table: comment_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - label: 'Translation language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: language - settings: - link_to_entity: false - native_language: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: comment - entity_field: langcode - plugin_id: field - translation_target_language: - id: translation_target_language - table: comment_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - label: 'Target language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - native_language: false - entity_type: comment - plugin_id: translation_views_target_language - translation_default: - id: translation_default - table: comment_translation_target - field: translation_default - relationship: none - group_type: group - admin_label: '' - label: 'Source translation of target language equals row language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - entity_field: default_langcode - plugin_id: boolean - translation_changed: - id: translation_changed - table: comment_translation_target - field: translation_changed - relationship: none - group_type: group - admin_label: '' - label: 'Translation changed time' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' - entity_field: changed - plugin_id: date - translation_count: - id: translation_count - table: comment_translation - field: translation_count - relationship: none - group_type: group - admin_label: '' - label: 'Translation counter' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: ',' - format_plural: false - format_plural_string: !!binary MQNAY291bnQ= - prefix: '' - suffix: '' - include_original_language: false - entity_type: comment - plugin_id: translation_views_translation_count - translation_outdated: - id: translation_outdated - table: comment_translation_target - field: translation_outdated - relationship: none - group_type: group - admin_label: '' - label: 'Translation outdated' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - entity_field: content_translation_outdated - plugin_id: boolean - translation_source: - id: translation_source - table: comment_translation_target - field: translation_source - relationship: none - group_type: group - admin_label: '' - label: 'Source translation of target language equals row language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - entity_field: content_translation_source - plugin_id: translation_views_source_equals_row - translation_status: - id: translation_status - table: comment_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - label: 'Translation status' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: status - type_custom_true: '' - type_custom_false: '' - not: false - entity_type: comment - plugin_id: translation_views_status - translation_operations: - id: translation_operations - table: comment_translation - field: translation_operations - relationship: none - group_type: group - admin_label: '' - label: 'Translation operations' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: false - entity_type: comment - plugin_id: translation_views_operations - filters: - status: - value: '1' - table: comment_field_data - field: status - plugin_id: boolean - entity_type: comment - entity_field: status - id: status - expose: - operator: '' - group: 1 - status_node: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - relationship: node - entity_type: node - entity_field: status - id: status_node - expose: - operator: '' - group: 1 - langcode: - id: langcode - table: comment_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: 'Translation language' - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: comment - entity_field: langcode - plugin_id: language - translation_target_language: - id: translation_target_language - table: comment_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '***LANGUAGE_site_default***' - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Target language' - description: '' - use_operator: false - operator: translation_target_language_op - identifier: translation_target_language - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - remove: false - entity_type: comment - plugin_id: translation_views_target_language - translation_outdated: - id: translation_outdated - table: comment_translation_target - field: translation_outdated - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Translation outdated' - description: '' - use_operator: false - operator: translation_outdated_op - identifier: translation_outdated - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_field: content_translation_outdated - plugin_id: boolean - translation_status: - id: translation_status - table: comment_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Translation status' - description: '' - use_operator: false - operator: translation_status_op - identifier: translation_status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: comment - plugin_id: translation_views_status - translation_count: - id: translation_count - table: comment_translation - field: translation_count - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '' - group: 1 - exposed: true - expose: - operator_id: translation_count_op - label: 'Translation counter' - description: '' - use_operator: false - operator: translation_count_op - identifier: translation_count - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - placeholder: '' - min_placeholder: '' - max_placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: comment - plugin_id: translation_views_translation_count - sorts: { } - title: 'Comment translation' - header: { } - footer: { } - empty: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: comment-translation - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.content_moderation_integration_test.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.content_moderation_integration_test.yml deleted file mode 100644 index feb3d2b76..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.content_moderation_integration_test.yml +++ /dev/null @@ -1,166 +0,0 @@ -uuid: 9f3298b4-2171-4aac-8684-01bdc45909c8 -langcode: en -status: true -dependencies: - config: - - node.type.article - module: - - node - - translation_views - - user -id: content_moderation_integration_test -label: 'Content Moderation Integration test' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: some - options: - items_per_page: 10 - offset: 0 - style: - type: default - row: - type: fields - fields: - translation_moderation_state: - id: translation_moderation_state - table: node_translation - field: translation_moderation_state - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - display_name: state - entity_type: node - plugin_id: translation_moderation_state - filters: - type: - id: type - table: node_field_data - field: type - value: - article: article - entity_type: node - entity_field: type - plugin_id: bundle - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Content Moderation Integration test' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: content-moderation-integration-test - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.test_operations_links.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.test_operations_links.yml deleted file mode 100644 index 2e60e9ec8..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.test_operations_links.yml +++ /dev/null @@ -1,260 +0,0 @@ -uuid: 0df3cfda-b782-4b0d-9810-3ca90a1638cc -langcode: en -status: true -dependencies: - config: - - node.type.article - module: - - node - - translation_views - - user -id: test_operations_links -label: test_operations_links -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - row: - type: fields - fields: - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: language - settings: - link_to_entity: false - native_language: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: langcode - plugin_id: field - translation_operations: - id: translation_operations - table: node_translation - field: translation_operations - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: false - entity_type: node - plugin_id: translation_views_operations - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - type: - id: type - table: node_field_data - field: type - value: - article: article - entity_type: node - entity_field: type - plugin_id: bundle - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: Test - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: test_operations_links - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.translation_views_all_filters_and_fields.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.translation_views_all_filters_and_fields.yml deleted file mode 100644 index 2372c5aac..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/views.view.translation_views_all_filters_and_fields.yml +++ /dev/null @@ -1,925 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - translation_views - - user -id: translation_views_all_filters_and_fields -label: 'Translation views all filters and fields' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - title: title - langcode: langcode - translation_default: translation_default - translation_changed: translation_changed - translation_count: translation_count - translation_outdated: translation_outdated - translation_source: translation_source - translation_status: translation_status - translation_operations: translation_operations - info: - title: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - langcode: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_default: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_changed: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_count: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_outdated: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_source: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_status: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - translation_operations: - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - label: 'Translation language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: language - settings: - link_to_entity: false - native_language: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: langcode - plugin_id: field - translation_target_language: - id: translation_target_language - table: node_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - label: 'Target language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - native_language: false - entity_type: node - plugin_id: translation_views_target_language - translation_default: - id: translation_default - table: node_translation_target - field: translation_default - relationship: none - group_type: group - admin_label: '' - label: 'Source translation of target language equals row language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - entity_field: default_langcode - plugin_id: boolean - translation_changed: - id: translation_changed - table: node_translation_target - field: translation_changed - relationship: none - group_type: group - admin_label: '' - label: 'Translation changed time' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: fallback - custom_date_format: '' - timezone: '' - entity_field: changed - plugin_id: date - translation_count: - id: translation_count - table: node_translation - field: translation_count - relationship: none - group_type: group - admin_label: '' - label: 'Translation counter' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: ',' - format_plural: false - format_plural_string: !!binary MQNAY291bnQ= - prefix: '' - suffix: '' - include_original_language: false - entity_type: node - plugin_id: translation_views_translation_count - translation_outdated: - id: translation_outdated - table: node_translation_target - field: translation_outdated - relationship: none - group_type: group - admin_label: '' - label: 'Translation outdated' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - entity_field: content_translation_outdated - plugin_id: boolean - translation_source: - id: translation_source - table: node_translation_target - field: translation_source - relationship: none - group_type: group - admin_label: '' - label: 'Source translation of target language equals row language' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: yes-no - type_custom_true: '' - type_custom_false: '' - not: false - entity_field: content_translation_source - plugin_id: translation_views_source_equals_row - translation_status: - id: translation_status - table: node_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - label: 'Translation status' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: status - type_custom_true: '' - type_custom_false: '' - not: false - entity_type: node - plugin_id: translation_views_status - translation_operations: - id: translation_operations - table: node_translation - field: translation_operations - relationship: none - group_type: group - admin_label: '' - label: 'Translation operations' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: false - entity_type: node - plugin_id: translation_views_operations - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - content_translation_source: - id: content_translation_source - table: node_field_data - field: content_translation_source - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: content_translation_source_op - label: 'Translation source' - description: '' - use_operator: false - operator: content_translation_source_op - identifier: content_translation_source - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: content_translation_source - plugin_id: language - translation_target_language: - id: translation_target_language - table: node_translation - field: translation_target_language - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Target language' - description: '' - use_operator: false - operator: translation_target_language_op - identifier: translation_target_language - required: false - remember: true - multiple: false - remember_roles: - anonymous: anonymous - authenticated: authenticated - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - remove: true - entity_type: node - plugin_id: translation_views_target_language - translation_default: - id: translation_default - table: node_translation_target - field: translation_default - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Target language equals default language' - description: '' - use_operator: false - operator: translation_default_op - identifier: translation_default - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: 'Target language equals default language' - description: null - identifier: translation_default - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: { } - 2: { } - 3: { } - entity_field: default_langcode - plugin_id: boolean - translation_status: - id: translation_status - table: node_translation - field: translation_status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Translation status' - description: '' - use_operator: false - operator: translation_status_op - identifier: translation_status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - plugin_id: translation_views_status - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Translation views all filters and fields' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: translation-views-all-filters-and-fields - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/workflows.workflow.editorial.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/workflows.workflow.editorial.yml deleted file mode 100644 index 91a0026da..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/test_views/workflows.workflow.editorial.yml +++ /dev/null @@ -1,63 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - node.type.article - module: - - content_moderation -id: editorial -label: Editorial -type: content_moderation -type_settings: - states: - archived: - label: Archived - weight: 5 - published: false - default_revision: true - draft: - label: Draft - published: false - default_revision: false - weight: -5 - published: - label: Published - published: true - default_revision: true - weight: 0 - transitions: - archive: - label: Archive - from: - - published - to: archived - weight: 2 - archived_draft: - label: 'Restore to Draft' - from: - - archived - to: draft - weight: 3 - archived_published: - label: Restore - from: - - archived - to: published - weight: 4 - create_new_draft: - label: 'Create New Draft' - to: draft - weight: 0 - from: - - draft - - published - publish: - label: Publish - to: published - weight: 1 - from: - - draft - - published - entity_types: - node: - - article diff --git a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/translation_views_test_views.info.yml b/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/translation_views_test_views.info.yml deleted file mode 100644 index 3cc541c7b..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/modules/translation_views_test_views/translation_views_test_views.info.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Translation views test view' -type: module -description: 'Provides full view for translation_views tests.' -package: Testing -# core: 8.x -dependencies: - - drupal:node - - drupal:views - - drupal:translation_views - - drupal:content_translation - - drupal:language - - drupal:content_moderation - - drupal:workflows - -# Information added by Drupal.org packaging script on 2019-02-07 -version: '8.x-1.0-alpha5' -core: '8.x' -project: 'translation_views' -datestamp: 1549581183 diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/CommentFullViewFiltersFieldsTest.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/CommentFullViewFiltersFieldsTest.php deleted file mode 100644 index 8f1df71f5..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/CommentFullViewFiltersFieldsTest.php +++ /dev/null @@ -1,491 +0,0 @@ -assertSession() - ->elementTextContains('css', "table > tbody > tr:nth-child({$row_number}) td.views-field-{$css_class}", $text); - } - - /** - * Cyclic check that text is in specific row. - * - * @param string $css_class - * Part of the css class of required field. - * @param array $texts - * Array of texts that should be found in the element - * and rows' order number. - * - * @throws \Behat\Mink\Exception\ElementTextException - */ - private function assertTextInRowOrder($css_class, array $texts) { - foreach ($texts as $id => $text) { - $this->assertTextInRow($id, $css_class, $text); - } - } - - /** - * Adds languages to Drupal. - * - * @param array $langcodes - * Langcodes that should be added to Drupal. - * - * @throws \Drupal\Core\Entity\EntityStorageException - */ - private function addLanguages(array $langcodes) { - foreach ($langcodes as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode)->save(); - } - } - - /** - * Change language settings for entity types. - * - * @param string $category - * Entity category (e.g. Content). - * @param string $subcategory - * Entity subcategory (e.g. Article). - */ - private function enableTranslation($category, $subcategory) { - $this->drupalPostForm('admin/config/regional/content-language', [ - "entity_types[$category]" => 1, - "settings[$category][$subcategory][translatable]" => 1, - "settings[$category][$subcategory][settings][language][language_alterable]" => 1, - ], t('Save configuration')); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - } - - /** - * Set column sorting and order. - * - * @param string $orderColumn - * Machine name of the column to be sorted. - * @param string $sort - * Sorting order (asc or desc). - * @param array $default_params - * Langcode and Translation target language. - * - * @throws \Behat\Mink\Exception\ExpectationException - */ - private function assertOrder($orderColumn, $sort, array $default_params = []) { - $this->drupalGet($this->viewPath, [ - 'query' => [ - 'langcode' => $default_params[0], - 'translation_target_language' => $default_params[1], - 'translation_outdated' => 'All', - 'translation_status' => 'All', - 'order' => $orderColumn, - 'sort' => $sort, - ], - ]); - $this->assertSession()->statusCodeEquals(200); - } - - /** - * {@inheritdoc} - */ - protected function setUp($import_test_views = TRUE) { - parent::setUp($import_test_views); - - $user = $this->drupalCreateUser([ - 'administer content types', - 'edit own comments', - 'administer comments', - 'administer comment types', - 'administer comment fields', - 'administer comment display', - 'post comments', - 'access comments', - 'skip comment approval', - 'access content', - 'administer site configuration', - 'administer nodes', - 'administer views', - 'create article content', - 'edit any article content', - 'administer content translation', - 'translate any entity', - 'create content translations', - 'administer languages', - ]); - - $this->drupalLogin($user); - - ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); - - // Add two languages. - $this->addLanguages(['de', 'fr']); - - // Enable translation for Comment entity type. - $this->enableTranslation('comment', 'comment'); - - // Add 3 nodes. - $this->drupalPostForm('node/add/article', [ - 'title[0][value]' => 'node 1', - 'created[0][value][date]' => '2018-04-01', - ], t('Save')); - $this->drupalPostForm('node/add/article', [ - 'title[0][value]' => 'node 2', - 'created[0][value][date]' => '2018-04-02', - ], t('Save')); - $this->drupalPostForm('node/add/article', [ - 'title[0][value]' => 'node 3', - 'created[0][value][date]' => '2018-04-03', - ], t('Save')); - - // Add comments and translations. - // Comment 1. - $edit = [ - 'langcode[0][value]' => 'en', - 'comment_body[0][value]' => $this->loremIpsum, - 'subject[0][value]' => 'node 1 en comment', - ]; - $this->drupalPostForm('node/1', $edit, 'Save'); - // Comment 2. - $edit = [ - 'langcode[0][value]' => 'de', - 'comment_body[0][value]' => $this->loremIpsum, - 'subject[0][value]' => 'node 1 de comment', - ]; - $this->drupalPostForm('node/1', $edit, 'Save'); - // Comment 3. - $edit = [ - 'langcode[0][value]' => 'de', - 'comment_body[0][value]' => $this->loremIpsum, - 'subject[0][value]' => 'node 2 de comment', - ]; - $this->drupalPostForm('node/2', $edit, 'Save'); - // Comment 4. - $edit = [ - 'langcode[0][value]' => 'fr', - 'comment_body[0][value]' => $this->loremIpsum, - 'subject[0][value]' => 'node 2 fr comment', - ]; - $this->drupalPostForm('node/2', $edit, 'Save'); - // Comment 5. - $edit = [ - 'langcode[0][value]' => 'fr', - 'comment_body[0][value]' => $this->loremIpsum, - 'subject[0][value]' => 'node 3 fr comment', - ]; - $this->drupalPostForm('node/3', $edit, 'Save'); - // Comment 6. - $edit = [ - 'content_translation[retranslate]' => 1, - 'comment_body[0][value]' => $this->loremIpsum, - 'subject[0][value]' => 'node 3 en from fr comment', - ]; - $this->drupalPostForm('comment/5/translations/add/fr/en', $edit, 'Save'); - } - - /** - * Tests that the fields show all required information. - */ - public function testFields() { - $this->drupalGet($this->viewPath); - $this->assertSession()->statusCodeEquals(200); - $this->assertTextInRow(1, 'subject', 'node 1 en comment'); - $this->assertTextInRow(1, 'langcode', 'English'); - $this->assertTextInRow(1, 'translation-target-language', 'English'); - $this->assertTextInRow(1, 'translation-default', 'Yes'); - $this->assertTextInRow(1, 'translation-changed', ':'); - $this->assertTextInRow(1, 'translation-count', '0'); - $this->assertTextInRow(1, 'translation-outdated', 'No'); - $this->assertTextInRow(1, 'translation-source', 'Yes'); - $this->assertTextInRow(1, 'translation-status', 'Translated'); - $this->assertTextInRow(1, 'translation-operations', 'Edit'); - } - - /** - * Tests columns' sorting. - */ - public function testSorting() { - // Title. - $this->assertOrder('subject', 'asc', ['de', 'fr']); - $this->assertTextInRowOrder('subject', [ - 1 => 'node 1 de comment', - 2 => 'node 2 de comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 en comment'); - $this->assertSession()->pageTextNotContains('node 2 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 en from fr comment'); - - $this->assertOrder('subject', 'desc', ['de', 'fr']); - $this->assertTextInRowOrder('subject', [ - 2 => 'node 1 de comment', - 1 => 'node 2 de comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 en comment'); - $this->assertSession()->pageTextNotContains('node 2 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 en from fr comment'); - - // Translation language. - $this->assertOrder('langcode', 'asc', ['All', 'de']); - $this->assertTextInRowOrder('langcode', [ - 1 => 'German', - 2 => 'German', - 3 => 'English', - 4 => 'English', - 5 => 'French', - 6 => 'French', - ]); - - $this->assertOrder('langcode', 'desc', ['All', 'de']); - $this->assertTextInRowOrder('langcode', [ - 6 => 'German', - 5 => 'German', - 4 => 'English', - 3 => 'English', - 2 => 'French', - 1 => 'French', - ]); - - // Target language equals default language. - $this->assertOrder('translation_default', 'asc', ['All', 'fr']); - $this->assertTextInRowOrder('translation-default', [ - 1 => 'No', - 2 => 'No', - 3 => 'No', - 4 => 'Yes', - 5 => 'Yes', - 6 => 'Yes', - ]); - - $this->assertOrder('translation_default', 'desc', ['All', 'fr']); - $this->assertTextInRowOrder('translation-default', [ - 6 => 'No', - 5 => 'No', - 4 => 'No', - 3 => 'Yes', - 2 => 'Yes', - 1 => 'Yes', - ]); - - // Translation changed time. - $this->assertOrder('translation_changed', 'asc', ['All', 'fr']); - $this->assertTextInRowOrder('translation-changed', [ - 4 => ':', - 5 => ':', - 6 => ':', - ]); - - $this->assertOrder('translation_changed', 'desc', ['All', 'fr']); - $this->assertTextInRowOrder('translation-changed', [ - 1 => ':', - 2 => ':', - 3 => ':', - ]); - - // Translation counter. - $this->assertOrder('translation_count', 'asc', ['en', 'fr']); - $this->assertTextInRowOrder('translation-count', [ - 1 => '0', - 2 => '1', - ]); - - $this->assertOrder('translation_count', 'desc', ['en', 'fr']); - $this->assertTextInRowOrder('translation-count', [ - 2 => '0', - 1 => '1', - ]); - - // Translation outdated. - $this->assertOrder('translation-outdated', 'asc', ['en', 'fr']); - $this->assertTextInRowOrder('translation-outdated', [ - 1 => 'No', - 2 => 'Yes', - ]); - - $this->assertOrder('translation-outdated', 'desc', ['en', 'fr']); - $this->assertTextInRowOrder('translation-outdated', [ - 1 => 'No', - 2 => 'Yes', - ]); - - // Source translation of target language equals row language. - $this->assertOrder('translation_source', 'asc', [ - 'All', - '***LANGUAGE_site_default***', - ]); - $this->assertTextInRowOrder('translation-source', [ - 1 => 'No', - 2 => 'No', - 3 => 'No', - 4 => 'No', - 5 => 'Yes', - 6 => 'Yes', - ]); - - $this->assertOrder('translation_source', 'desc', [ - 'All', - '***LANGUAGE_site_default***', - ]); - $this->assertTextInRowOrder('translation-source', [ - 6 => 'No', - 5 => 'No', - 4 => 'No', - 3 => 'No', - 2 => 'Yes', - 1 => 'Yes', - ]); - - // Translation status. - $this->assertOrder('translation_status', 'asc', [ - 'All', - '***LANGUAGE_site_default***', - ]); - $this->assertTextInRowOrder('translation-status', [ - 1 => 'Not translated', - 2 => 'Not translated', - 3 => 'Not translated', - 4 => 'Translated', - 5 => 'Translated', - 6 => 'Translated', - ]); - - $this->assertOrder('translation_status', 'desc', [ - 'All', - '***LANGUAGE_site_default***', - ]); - $this->assertTextInRowOrder('translation-status', [ - 6 => 'Not translated', - 5 => 'Not translated', - 4 => 'Not translated', - 3 => 'Translated', - 2 => 'Translated', - 1 => 'Translated', - ]); - - } - - /** - * Tests that filters are working correctly. - */ - public function testFilters() { - - // Translation language. - $this->drupalGet($this->viewPath, [ - 'query' => [ - 'langcode' => 'en', - ], - ]); - - $this->assertTextInRowOrder('subject', [ - 1 => 'node 1 en comment', - 2 => 'node 3 en from fr comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 de comment'); - $this->assertSession()->pageTextNotContains('node 2 de comment'); - $this->assertSession()->pageTextNotContains('node 2 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 fr comment'); - - // Translation language & Target language. - $this->drupalGet($this->viewPath, [ - 'query' => [ - 'langcode' => 'en', - 'translation_target_language' => 'fr', - ], - ]); - $this->assertTextInRowOrder('subject', [ - 1 => 'node 1 en comment', - 2 => 'node 3 en from fr comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 de comment'); - $this->assertSession()->pageTextNotContains('node 2 de comment'); - $this->assertSession()->pageTextNotContains('node 2 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 fr comment'); - - // Translation language & Target language & Translation outdated. - $this->drupalGet($this->viewPath, [ - 'query' => [ - 'langcode' => 'en', - 'translation_target_language' => 'fr', - 'translation_outdated' => '1', - ], - ]); - $this->assertTextInRowOrder('subject', [ - 1 => 'node 3 en from fr comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 en comment'); - $this->assertSession()->pageTextNotContains('node 1 de comment'); - $this->assertSession()->pageTextNotContains('node 2 de comment'); - $this->assertSession()->pageTextNotContains('node 2 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 fr comment'); - - // Translation status #1. - $this->drupalGet($this->viewPath, [ - 'query' => [ - 'translation_status' => '0', - ], - ]); - $this->assertTextInRowOrder('subject', [ - 1 => 'node 1 de comment', - 2 => 'node 2 de comment', - 3 => 'node 2 fr comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 en comment'); - $this->assertSession()->pageTextNotContains('node 3 fr comment'); - $this->assertSession()->pageTextNotContains('node 3 en from fr comment'); - - // Translation status #2. - $this->drupalGet($this->viewPath, [ - 'query' => [ - 'translation_status' => '1', - ], - ]); - $this->assertTextInRowOrder('subject', [ - 1 => 'node 1 en comment', - 2 => 'node 3 en from fr comment', - 3 => 'node 3 fr comment', - ]); - $this->assertSession()->pageTextNotContains('node 1 de comment'); - $this->assertSession()->pageTextNotContains('node 2 de comment'); - $this->assertSession()->pageTextNotContains('node 2 fr comment'); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentFullViewFiltersFieldsTest.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentFullViewFiltersFieldsTest.php deleted file mode 100644 index bfeac3074..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentFullViewFiltersFieldsTest.php +++ /dev/null @@ -1,471 +0,0 @@ -drupalCreateUser([ - 'administer site configuration', - 'administer nodes', - 'administer views', - 'create article content', - 'access content', - 'edit any article content', - 'administer content translation', - 'translate any entity', - 'create content translations', - 'administer languages', - 'administer content types', - ]); - $this->drupalLogin($user); - - ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); - - $langcodes = ['de', 'fr']; - foreach ($langcodes as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode)->save(); - } - - // Enable translation for article. - $edit = [ - 'entity_types[node]' => 1, - 'settings[node][article][translatable]' => 1, - 'settings[node][article][settings][language][language_alterable]' => 1, - ]; - $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - - // Create a node in en (node1). - $edit = [ - 'title[0][value]' => '001_en_title_node1', - 'langcode[0][value]' => 'en', - ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - // Create a translation in fr (node1). - $edit = [ - 'title[0][value]' => '002_fr_title_node1', - ]; - $this->drupalPostForm('node/1/translations/add/en/fr', $edit, t('Save (this translation)')); - // Create a translation in de (node1). - $edit = [ - 'title[0][value]' => '003_de_title_node1', - ]; - $this->drupalPostForm('node/1/translations/add/en/de', $edit, t('Save (this translation)')); - - // Create a node in de (node2). - $edit = [ - 'title[0][value]' => '004_de_title_node2', - 'langcode[0][value]' => 'de', - ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - // Create a translation in fr (node2). - $edit = [ - 'title[0][value]' => '005_fr_title_node2', - ]; - $this->drupalPostForm('node/2/translations/add/de/fr', $edit, t('Save (this translation)')); - - } - - /** - * Tests the filtering. - */ - public function testFilters() { - $this->drupalGet('translation-views-all-filters-and-fields'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->pageTextContains('Translation views all filters and fields'); - $this->assertSession()->pageTextNotContains('001_en_title_node1'); - $this->assertSession()->pageTextContains('002_fr_title_node1'); - $this->assertSession()->pageTextContains('003_de_title_node1'); - $this->assertSession()->pageTextContains('004_de_title_node2'); - $this->assertSession()->pageTextContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => '***LANGUAGE_site_default***', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('001_en_title_node1'); - $this->assertSession()->pageTextContains('002_fr_title_node1'); - $this->assertSession()->pageTextContains('003_de_title_node1'); - $this->assertSession()->pageTextNotContains('004_de_title_node2'); - $this->assertSession()->pageTextNotContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'de', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('001_en_title_node1'); - $this->assertSession()->pageTextNotContains('002_fr_title_node1'); - $this->assertSession()->pageTextNotContains('003_de_title_node1'); - $this->assertSession()->pageTextNotContains('004_de_title_node2'); - $this->assertSession()->pageTextContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'fr', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('001_en_title_node1'); - $this->assertSession()->pageTextNotContains('002_fr_title_node1'); - $this->assertSession()->pageTextNotContains('003_de_title_node1'); - $this->assertSession()->pageTextNotContains('004_de_title_node2'); - $this->assertSession()->pageTextNotContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => 'de', - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('001_en_title_node1'); - $this->assertSession()->pageTextContains('002_fr_title_node1'); - $this->assertSession()->pageTextNotContains('003_de_title_node1'); - $this->assertSession()->pageTextNotContains('004_de_title_node2'); - $this->assertSession()->pageTextContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => 'fr', - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('001_en_title_node1'); - $this->assertSession()->pageTextNotContains('002_fr_title_node1'); - $this->assertSession()->pageTextContains('003_de_title_node1'); - $this->assertSession()->pageTextContains('004_de_title_node2'); - $this->assertSession()->pageTextNotContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => '1', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('001_en_title_node1'); - $this->assertSession()->pageTextContains('002_fr_title_node1'); - $this->assertSession()->pageTextContains('003_de_title_node1'); - $this->assertSession()->pageTextNotContains('004_de_title_node2'); - $this->assertSession()->pageTextNotContains('005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => '0', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('001_en_title_node1'); - $this->assertSession()->pageTextNotContains('002_fr_title_node1'); - $this->assertSession()->pageTextNotContains('003_de_title_node1'); - $this->assertSession()->pageTextContains('004_de_title_node2'); - $this->assertSession()->pageTextContains('005_fr_title_node2'); - } - - /** - * Test the sorting. - */ - public function testSorting() { - // Title. - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'title', - 'sort' => 'asc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', '002_fr_title_node1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', '003_de_title_node1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', '004_de_title_node2'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', '005_fr_title_node2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'title', - 'sort' => 'desc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', '002_fr_title_node1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', '003_de_title_node1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', '004_de_title_node2'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', '005_fr_title_node2'); - - // Translation language. - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'langcode', - 'sort' => 'asc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'German'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'German'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'French'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', 'French'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'langcode', - 'sort' => 'desc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', 'German'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'German'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'French'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'French'); - - // Target language equals default language. - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_default', - 'sort' => 'asc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'No'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'No'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'Yes'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', 'Yes'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_default', - 'sort' => 'desc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', 'No'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'No'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'Yes'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'Yes'); - - // Translation changed time. - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_changed', - 'sort' => 'asc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextNotContains('css', 'table > tbody > tr:nth-child(1)', ':'); - $this->assertSession() - ->elementTextNotContains('css', 'table > tbody > tr:nth-child(2)', ':'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', ':'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', ':'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_changed', - 'sort' => 'desc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextNotContains('css', 'table > tbody > tr:nth-child(4)', ':'); - $this->assertSession() - ->elementTextNotContains('css', 'table > tbody > tr:nth-child(3)', ':'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', ':'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', ':'); - - // Translation counter. - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_count', - 'sort' => 'asc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', '1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', '1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', '2'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', '2'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_count', - 'sort' => 'desc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', '1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', '1'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', '2'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', '2'); - - // Translation counter. - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_status', - 'sort' => 'asc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'Not translated'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'Not translated'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'Translated'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', 'Translated'); - - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => '***LANGUAGE_site_default***', - 'translation_default' => 'All', - 'translation_status' => 'All', - 'order' => 'translation_status', - 'sort' => 'desc', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(4)', 'Not translated'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'Not translated'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'Translated'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'Translated'); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentModerationIntegration.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentModerationIntegration.php deleted file mode 100644 index 25eb6a364..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentModerationIntegration.php +++ /dev/null @@ -1,103 +0,0 @@ -drupalLogin($this->rootUser); - // Import test views. - ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); - // Create additional language. - ConfigurableLanguage::createFromLangcode('af')->save(); - - // Enable translation for article nodes. - $this->drupalPostForm('admin/config/regional/content-language', [ - "entity_types[node]" => 1, - "settings[node][article][translatable]" => 1, - "settings[node][article][settings][language][language_alterable]" => 1, - ], 'Save configuration'); - // Flush definitions caches. - \Drupal::entityTypeManager()->clearCachedDefinitions(); - - // Enable moderation state for article nodes. - $workflow = Workflow::load('editorial'); - $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article'); - $workflow->save(); - // Logout. - $this->drupalLogout(); - } - - /** - * Test view's field "Translation Moderation State". - */ - public function testTranslationModerationFieldViews() { - // Login as a root user. - $this->drupalLogin($this->rootUser); - // Create node for test. - $node = $this->createNode(['type' => 'article']); - - // Ensure we have moderation state "Draft" by default - // in the newly created node. - $this->assertTrue($node->hasField('moderation_state')); - $this->assertFalse($node->get('moderation_state')->isEmpty()); - $this->assertEquals('draft', $node->get('moderation_state')->first()->getString()); - - // Go to the testing view's page. - $this->drupalGet('/content-moderation-integration-test'); - $this->assertSession()->statusCodeEquals(200); - // Check that created node has "Draft" moderation state by default. - $this->assertSession()->elementTextContains( - 'css', - '.views-field-translation-moderation-state span', - 'Draft' - ); - - // Change moderation state to "Published". - $node->set('moderation_state', 'published')->save(); - - // Reload the testing view's page. - $this->drupalGet('/content-moderation-integration-test'); - $this->assertSession()->statusCodeEquals(200); - // Check that the moderation state value has been changed in view's field. - $this->assertSession()->elementTextContains( - 'css', - '.views-field-translation-moderation-state span', - 'Published' - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentTranslationJobsViewTest.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentTranslationJobsViewTest.php deleted file mode 100644 index 4fc6f7056..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/ContentTranslationJobsViewTest.php +++ /dev/null @@ -1,223 +0,0 @@ -save(); - } - - $user = $this->drupalCreateUser([ - 'administer site configuration', - 'administer nodes', - 'create article content', - 'access content', - 'edit any article content', - 'administer content translation', - 'translate any entity', - 'create content translations', - 'administer languages', - 'administer content types', - ]); - $this->drupalLogin($user); - - // Enable translation for article. - $edit = [ - 'entity_types[node]' => 1, - 'settings[node][article][translatable]' => 1, - 'settings[node][article][settings][language][language_alterable]' => 1, - ]; - $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - - // Create node1 in german. - $edit = [ - 'title[0][value]' => 'node1 de', - 'langcode[0][value]' => 'de', - ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - - // Create node1 translation in french. - $edit = [ - 'title[0][value]' => 'node1 fr', - ]; - $this->drupalPostForm('node/1/translations/add/de/fr', $edit, t('Save (this translation)')); - - // Create node2 in english. - $edit = [ - 'title[0][value]' => 'node2 en', - 'langcode[0][value]' => 'en', - ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - - // Create node3 in french. - $edit = [ - 'title[0][value]' => 'node3 fr', - 'langcode[0][value]' => 'fr', - ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); - } - - /** - * Tests that filters works as expected. - */ - public function testNodesFiltering() { - $this->drupalGet('translate/content', ['query' => ['translation_target_language' => '***LANGUAGE_site_default***']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('node1 de'); - $this->assertSession()->pageTextContains('node1 fr'); - $this->assertSession()->pageTextNotContains('node2 en'); - $this->assertSession()->pageTextContains('node3 fr'); - - $this->drupalGet('translate/content', ['query' => ['translation_target_language' => 'de']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('node1 de'); - $this->assertSession()->pageTextNotContains('node1 fr'); - $this->assertSession()->pageTextContains('node2 en'); - $this->assertSession()->pageTextContains('node3 fr'); - - $this->drupalGet('translate/content', ['query' => ['translation_target_language' => 'fr']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('node1 de'); - $this->assertSession()->pageTextNotContains('node1 fr'); - $this->assertSession()->pageTextContains('node2 en'); - $this->assertSession()->pageTextNotContains('node3 fr'); - - $this->drupalGet('translate/content', [ - 'query' => [ - 'translation_target_language' => 'de', - 'langcode' => 'en', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('node1 de'); - $this->assertSession()->pageTextNotContains('node1 fr'); - $this->assertSession()->pageTextContains('node2 en'); - $this->assertSession()->pageTextNotContains('node3 fr'); - - $this->drupalGet('translate/content', [ - 'query' => [ - 'translation_target_language' => 'fr', - 'langcode' => 'en', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('node1 de'); - $this->assertSession()->pageTextNotContains('node1 fr'); - $this->assertSession()->pageTextContains('node2 en'); - $this->assertSession()->pageTextNotContains('node3 fr'); - - $this->drupalGet('translate/content', ['query' => ['langcode' => 'fr']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('node1 de'); - $this->assertSession()->pageTextContains('node1 fr'); - $this->assertSession()->pageTextNotContains('node2 en'); - $this->assertSession()->pageTextContains('node3 fr'); - - $this->drupalGet('translate/content', ['query' => ['langcode' => 'de']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('node1 de'); - $this->assertSession()->pageTextNotContains('node1 fr'); - $this->assertSession()->pageTextNotContains('node2 en'); - $this->assertSession()->pageTextNotContains('node3 fr'); - - $this->drupalGet('translate/content', ['query' => ['langcode' => 'en']]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextNotContains('node1 de'); - $this->assertSession()->pageTextNotContains('node1 fr'); - $this->assertSession()->pageTextNotContains('node2 en'); - $this->assertSession()->pageTextNotContains('node3 fr'); - - } - - /** - * Tests that columns' sorting works as expected. - */ - public function testNodesSorting() { - // Check title column asc sorting. - $this->drupalGet('translate/content', [ - 'query' => [ - 'order' => 'title', - 'sort' => 'asc', - ], - ]); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'node1 de'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'node1 fr'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'node3 fr'); - - // Check title column desc sorting. - $this->drupalGet('translate/content', [ - 'query' => [ - 'order' => 'title', - 'sort' => 'desc', - ], - ]); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'node1 de'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'node1 fr'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'node3 fr'); - - // Check langcode column asc sorting. - $this->drupalGet('translate/content', [ - 'query' => [ - 'order' => 'langcode', - 'sort' => 'asc', - ], - ]); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'node1 de'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'node1 fr'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'node3 fr'); - - // Check langcode column desc sorting. - $this->drupalGet('translate/content', [ - 'query' => [ - 'order' => 'langcode', - 'sort' => 'desc', - ], - ]); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(1)', 'node1 fr'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(2)', 'node3 fr'); - $this->assertSession() - ->elementTextContains('css', 'table > tbody > tr:nth-child(3)', 'node1 de'); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/LocalTranslationContentIntegrationTest.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/LocalTranslationContentIntegrationTest.php deleted file mode 100644 index 15b09c49a..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/LocalTranslationContentIntegrationTest.php +++ /dev/null @@ -1,221 +0,0 @@ -setUpTest(); - } - - /** - * Additional steps for tests set up. - */ - protected function setUpTest() { - $this->drupalLogin($this->rootUser); - $this->skills = $this->container->get('local_translation.user_skills'); - $this->createLanguages(); - $this->enableTranslation('node', 'article'); - $this->drupalLogout(); - } - - /** - * Get array of all testing languages. - * - * @return array - * All testing langcodes array. - */ - private static function getAllTestingLanguages() { - return array_merge(static::$registeredSkills, static::$unregisteredSkills); - } - - /** - * Change language settings for entity types. - * - * @param string $category - * Entity category (e.g. node). - * @param string $subcategory - * Entity subcategory (e.g. article). - */ - protected function enableTranslation($category, $subcategory) { - $this->drupalPostForm('admin/config/regional/content-language', [ - "entity_types[$category]" => 1, - "settings[$category][$subcategory][translatable]" => 1, - "settings[$category][$subcategory][settings][language][language_alterable]" => 1, - ], 'Save configuration'); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - } - - /** - * Register translation skills for testing. - * - * @throws \Drupal\Core\Entity\EntityStorageException - */ - protected function registerTestSkills() { - $this->skills->addSkill(static::$registeredSkills); - foreach (static::$registeredSkills as $skill) { - $this->assertTrue($this->skills->userHasSkill($skill)); - } - } - - /** - * Create additional languages for testing. - */ - protected function createLanguages() { - try { - foreach (static::getAllTestingLanguages() as $language) { - if ($language === $this->defaultLanguage) { - continue; - } - $this->assertEquals(1, ConfigurableLanguage::createFromLangcode($language)->save()); - } - } - catch (EntityStorageException $e) { - $this->fail('Additional languages have not been created'); - } - } - - /** - * Simply check that all required modules have been installed. - */ - public function testDependencyInstallation() { - $this->assertTrue($this->container->get('module_handler') - ->moduleExists('local_translation')); - $this->assertTrue($this->container->get('module_handler') - ->moduleExists('local_translation_content')); - $this->assertTrue($this->container->has('local_translation.user_skills')); - } - - /** - * Test local translation content integration for target language filter. - */ - public function testLocalTranslationLanguageFilterInView() { - $this->drupalLogin($this->rootUser); - $this->registerTestSkills(); - for ($i = 1; $i <= 10; $i++) { - Node::create([ - 'type' => 'article', - 'title' => $this->randomString(), - 'langcode' => static::$registeredSkills[0], - ]) - ->addTranslation(static::$registeredSkills[1], ['title' => $this->randomString()]) - ->save(); - } - - $this->drupalGet('/test-local-translation-content-filter'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->statusCodeNotEquals(404); - - // Find langcode field element. - $langcode_field = $this->getSession() - ->getPage() - ->findField('translation_target_language'); - $this->assertNotNull($langcode_field); - - // Get all existing options of the langcode filter dropdown. - $options = $langcode_field->findAll('xpath', '//option'); - $this->assertNotNull($options); - - // Prepare array of options' values. - $language_options = array_map(function ($option) { - return $option->getAttribute('value') ?: $option->getText(); - }, $options); - - $this->assertCount(4, $language_options); - $this->assertContains('***LANGUAGE_site_default***', $language_options); - $this->assertContains('fr', $language_options); - $this->assertContains('de', $language_options); - $this->assertContains('sq', $language_options); - - $this->drupalGet('/admin/structure/views/nojs/handler/test_local_translation_content_integration/page_1/filter/translation_target_language'); - // Check for the default state of the options. - $this->assertSession()->checkboxNotChecked('options[limit]'); - $this->assertSession()->checkboxNotChecked('options[column][from]'); - $this->assertSession()->checkboxChecked('options[column][to]'); - // Update options. - $this->drupalPostForm(NULL, [ - 'options[limit]' => 1, - 'options[column][from]' => 1, - 'options[column][to]' => 1, - ], 'Apply'); - $this->click('input[value="Save"]'); - - $this->drupalGet('/test-local-translation-content-filter'); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->statusCodeNotEquals(404); - - // Find langcode field element. - $langcode_field = $this->getSession() - ->getPage() - ->findField('translation_target_language'); - $this->assertNotNull($langcode_field); - - // Get all existing options of the langcode filter dropdown. - $options = $langcode_field->findAll('xpath', '//option'); - $this->assertNotNull($options); - - // Prepare array of options' values. - $language_options = array_map(function ($option) { - return $option->getAttribute('value') ?: $option->getText(); - }, $options); - - $this->assertCount(2, $language_options); - $this->assertContains('en', $language_options); - $this->assertContains('fr', $language_options); - $this->assertNotContains('de', $language_options); - $this->assertNotContains('sq', $language_options); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationTargetLanguageTest.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationTargetLanguageTest.php deleted file mode 100644 index 82a502b0c..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationTargetLanguageTest.php +++ /dev/null @@ -1,211 +0,0 @@ -adminUser = $this->createUser([], 'test_admin', TRUE); - $this->drupalLogin($this->adminUser); - - $this->defaultLangcode = \Drupal::languageManager() - ->getDefaultLanguage() - ->getId(); - - // Set up testing views. - ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); - try { - $this->setUpLanguages(); - } - catch (EntityStorageException $e) { - $this->verbose($e->getMessage()); - } - // Enable translation for Article nodes. - $this->enableTranslation('node', 'article'); - - // Create testing node. - $this->drupalPostForm('node/add/article', [ - 'title[0][value]' => $this->randomString(), - ], 'Save'); - - $this->drupalLogout(); - } - - /** - * Set up languages. - * - * @throws \Drupal\Core\Entity\EntityStorageException - */ - private function setUpLanguages() { - foreach (self::$langcodes as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode)->save(); - } - } - - /** - * Change language settings for entity types. - * - * @param string $category - * Entity category (e.g. node). - * @param string $subcategory - * Entity subcategory (e.g. article). - */ - private function enableTranslation($category, $subcategory) { - $this->drupalPostForm('admin/config/regional/content-language', [ - "entity_types[$category]" => 1, - "settings[$category][$subcategory][translatable]" => 1, - "settings[$category][$subcategory][settings][language][language_alterable]" => 1, - ], 'Save configuration'); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - } - - /** - * Translate node all specified languages. - */ - private function translateNode() { - $node = Node::load(1); - foreach (self::$langcodes as $langcode) { - if (!$node->hasTranslation($langcode)) { - $this->assertFalse($node->hasTranslation($langcode)); - $node->addTranslation($langcode, ['title' => $this->randomMachineName()])->save(); - $this->assertTrue($node->hasTranslation($langcode)); - } - } - } - - /** - * Generate random target language ID from available list. - * - * @return string - * Language ID. - */ - private function generateTargetLanguage() { - $target_language = self::$langcodes[mt_rand(0, 4)]; - $this->assertNotNull($target_language); - return $target_language; - } - - /** - * Assert that the response HTTP code is 200. - * - * @throws \Behat\Mink\Exception\ExpectationException - */ - private function assertResponseOk() { - $this->assertSession()->statusCodeEquals(200); - } - - /** - * Test translation operations target language. - * - * @throws \Behat\Mink\Exception\ElementHtmlException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testTranslationOperationsTargetLanguage() { - $base_selector = 'table > tbody > tr:nth-child(1) .views-field-translation-operations ul li'; - $this->drupalLogin($this->adminUser); - - // Check for "Add" links target languages. - $target_language = $this->generateTargetLanguage(); - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => $target_language, - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertResponseOk(); - $expected_create_link = "/$target_language/node/1/translations/add/{$this->defaultLangcode}/$target_language"; - $this->assertSession() - ->elementAttributeContains( - 'css', - "{$base_selector} a", - 'href', - $expected_create_link - ); - // Translate nodes. - $this->translateNode(); - // Check for "Edit" and "Delete" links target languages. - $target_language = $this->generateTargetLanguage(); - $this->drupalGet('translation-views-all-filters-and-fields', [ - 'query' => [ - 'content_translation_source' => 'All', - 'translation_target_language' => $target_language, - 'translation_default' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertResponseOk(); - $this->assertSession() - ->elementAttributeContains( - 'css', - "{$base_selector}.edit a", - 'href', - "/$target_language/node/1/edit" - ); - $this->assertSession() - ->elementAttributeContains( - 'css', - "{$base_selector}.delete a", - 'href', - "/$target_language/node/1/delete" - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationsFieldPermissionsTest.php b/sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationsFieldPermissionsTest.php deleted file mode 100644 index c6b15c0dd..000000000 --- a/sites/all/modules/contrib/views/translation_views/tests/src/Functional/TranslationOperationsFieldPermissionsTest.php +++ /dev/null @@ -1,285 +0,0 @@ -setUpUsers(); - $this->drupalLogin($this->adminUser); - - // Set up testing views. - ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); - try { - $this->setUpLanguages(); - } - catch (EntityStorageException $e) { - $this->verbose($e->getMessage()); - } - // Enable translation for Article nodes. - $this->enableTranslation('node', 'article'); - - // Create testing node. - $this->drupalPostForm('node/add/article', [ - 'title[0][value]' => $this->randomString(), - ], 'Save'); - - $this->drupalLogout(); - } - - /** - * Set up users with different sets of permissions. - */ - private function setUpUsers() { - $this->adminUser = $this->createUser([], 'test_admin', TRUE); - $this->userCreate = $this->createUser(['create content translations']); - $this->userUpdate = $this->createUser(['update content translations']); - $this->userDelete = $this->createUser(['delete content translations']); - } - - /** - * Set up languages. - * - * @throws \Drupal\Core\Entity\EntityStorageException - */ - private function setUpLanguages() { - foreach (self::$langcodes as $langcode) { - ConfigurableLanguage::createFromLangcode($langcode)->save(); - } - } - - /** - * Checks that text is in specific row. - * - * @param int $row_number - * Table row order number. - * @param string $css_class - * Part of the css class of required field. - * @param string $text - * Text that should be found in the element. - * - * @throws \Behat\Mink\Exception\ElementTextException - */ - private function assertTextInRow($row_number, $css_class, $text) { - $this->assertSession() - ->elementTextContains( - 'css', - ".view-content > div:nth-child({$row_number}) .views-field-{$css_class}", - $text - ); - } - - /** - * Change language settings for entity types. - * - * @param string $category - * Entity category (e.g. node). - * @param string $subcategory - * Entity subcategory (e.g. article). - */ - private function enableTranslation($category, $subcategory) { - $this->drupalPostForm('admin/config/regional/content-language', [ - "entity_types[$category]" => 1, - "settings[$category][$subcategory][translatable]" => 1, - "settings[$category][$subcategory][settings][language][language_alterable]" => 1, - ], 'Save configuration'); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - } - - /** - * Go to the /translate/content page. - * - * @throws \Behat\Mink\Exception\ExpectationException - */ - private function goToTestingView() { - $this->drupalGet('/test_operations_links'); - $this->assertSession()->statusCodeEquals(200); - } - - /** - * Translate node all specified languages. - */ - private function translateNode() { - $node = Node::load(1); - foreach (self::$langcodes as $langcode) { - if (!$node->hasTranslation($langcode)) { - $node->addTranslation($langcode, ['title' => $this->randomMachineName()]) - ->save(); - } - } - } - - /** - * Add specific set of permissions to the "authenticated" role. - * - * @param array $permissions - * Permissions array. - */ - private function addPermissionsForAuthUser(array $permissions = []) { - if (!empty($permissions)) { - $role = Role::load(Role::AUTHENTICATED_ID); - if ($role instanceof Role) { - $this->grantPermissions($role, $permissions); - } - } - } - - /** - * Test translation operation create permissions. - * - * @throws \Behat\Mink\Exception\ElementTextException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testTranslationOperationsCreatePermissions() { - $default_language = \Drupal::languageManager()->getDefaultLanguage(); - $target_language = static::$langcodes[mt_rand(0, 4)]; - $this->assertNotNull($target_language); - $this->assertNotNull($default_language); - - $this->drupalLogin($this->userCreate); - - $this->assertTrue($this->userCreate->hasPermission('create content translations')); - $this->assertFalse($this->userCreate->hasPermission('translate any entity')); - - $this->drupalGet('/translate/content', [ - 'query' => [ - 'langcode' => $default_language->getId(), - 'translation_target_language' => $target_language, - 'translation_outdated' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->elementNotExists( - 'css', - 'table > tbody > tr:nth-child(1) .views-field-translation-operations ul li a' - ); - - $this->addPermissionsForAuthUser(['translate any entity']); - $this->assertTrue($this->userCreate->hasPermission('translate any entity')); - - $this->drupalGet('/translate/content', [ - 'query' => [ - 'langcode' => $default_language->getId(), - 'translation_target_language' => $target_language, - 'translation_outdated' => 'All', - 'translation_status' => 'All', - ], - ]); - $this->assertSession()->statusCodeEquals(200); - $this->assertSession() - ->elementTextContains( - 'css', - "table > tbody > tr:nth-child(1) .views-field-translation-operations ul li a", - 'Add' - ); - } - - /** - * Test translation operation update permissions. - * - * @throws \Behat\Mink\Exception\ElementTextException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testTranslationOperationsUpdatePermissions() { - $this->translateNode(); - $this->assertTrue($this->userUpdate->hasPermission('update content translations')); - $this->assertFalse($this->userUpdate->hasPermission('translate any entity')); - $this->drupalLogin($this->userUpdate); - $this->goToTestingView(); - $this->assertTextInRow( - 1, - 'translation-operations ul li a', - 'Edit' - ); - } - - /** - * Test translation operation delete permissions. - * - * @throws \Behat\Mink\Exception\ElementTextException - * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testTranslationOperationsDeletePermissions() { - $this->translateNode(); - $this->assertTrue($this->userDelete->hasPermission('delete content translations')); - $this->assertFalse($this->userDelete->hasPermission('translate any entity')); - $this->drupalLogin($this->userDelete); - $this->goToTestingView(); - $this->assertTextInRow( - 1, - 'translation-operations ul li a', - 'Delete' - ); - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/translation_views.info.yml b/sites/all/modules/contrib/views/translation_views/translation_views.info.yml deleted file mode 100644 index 974166190..000000000 --- a/sites/all/modules/contrib/views/translation_views/translation_views.info.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Translation Views -type: module -description: Create customized lists and queries of translations from your database. -# core: 8.x -package: Multilingual -dependencies: - - drupal:content_translation - - drupal:views - -test_dependencies: - - local_translation:local_translation - -# Information added by Drupal.org packaging script on 2019-02-07 -version: '8.x-1.0-alpha5' -core: '8.x' -project: 'translation_views' -datestamp: 1549581183 diff --git a/sites/all/modules/contrib/views/translation_views/translation_views.module b/sites/all/modules/contrib/views/translation_views/translation_views.module deleted file mode 100644 index d5b30f376..000000000 --- a/sites/all/modules/contrib/views/translation_views/translation_views.module +++ /dev/null @@ -1,138 +0,0 @@ -getFormObject(); - - if (!($form_object instanceof ContentEntityFormInterface)) { - return; - } - - $entity = $form_object->getEntity(); - $operations = $form_object->getOperation(); - - if ($entity instanceof ContentEntityInterface - && $entity->isTranslatable() - && count($entity->getTranslationLanguages()) > 1 - && in_array($operations, ['edit', 'add', 'default'], TRUE) - ) { - $form['source_langcode']['submit']['#submit'][] = 'translation_views_content_form_fix_destination'; - } -} - -/** - * Submit callback for "source_langcode" button. - */ -function translation_views_content_form_fix_destination($form, FormStateInterface $form_state) { - /* @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */ - /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - /* @var \Symfony\Component\HttpFoundation\ParameterBag $query */ - $form_object = $form_state->getFormObject(); - $entity = $form_object->getEntity(); - $source = $form_state->getValue(['source_langcode', 'source']); - $query = \Drupal::service('request_stack')->getCurrentRequest()->query; - $options = []; - - // Remove destination parameter from request, - // to allow "Change" button works like desired - if ($query->has('destination')) { - $options['query']['destination'] = $query->get('destination'); - $query->remove('destination'); - } - - $entity_type_id = $entity->getEntityTypeId(); - $form_state->setRedirect("entity.$entity_type_id.content_translation_add", [ - $entity_type_id => $entity->id(), - 'source' => $source, - 'target' => $form_object->getFormLangcode($form_state), - ], $options); -} - -/** - * Implements hook_query_TAG_alter(). - * - * Add support to use views query substitutions in expressions - * from hook_views_query_substitutions(). - * Expressions can be used in views fields (i.e addField()), - * and views orderBy formula (i.e addOrderBy()). - * - * @todo Remove this workaround when will be solved in drupal core. - */ -function translation_views_query_views_alter(AlterableInterface $query) { - $substitutions = $query->getMetaData('views_substitutions'); - $expressions =& $query->getExpressions(); - - foreach ($expressions as $field_id => &$item) { - foreach ($item['arguments'] as $replacement_key => $value) { - if (!is_array($value)) { - if (isset($substitutions[$value])) { - $expressions[$field_id]['arguments'][$replacement_key] = $substitutions[$value]; - } - } - else { - foreach ($value as $sub_key => $sub_value) { - if (isset($substitutions[$sub_value])) { - $expressions[$field_id]['arguments'][$replacement_key][$sub_key] = $substitutions[$sub_value]; - } - } - } - } - } -} - -/** - * Implements hook_help(). - * - * @inheritdoc - */ -function translation_views_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'help.page.translation_views': - $text = file_get_contents(dirname(__FILE__) . '/README.md'); - if (!\Drupal::moduleHandler()->moduleExists('markdown')) { - return '
        ' . $text . '
        '; - } - else { - // Use the Markdown filter to render the README. - $filter_manager = \Drupal::service('plugin.manager.filter'); - $settings = \Drupal::configFactory()->get('markdown.settings')->getRawData(); - $config = ['settings' => $settings]; - $filter = $filter_manager->createInstance('markdown', $config); - return $filter->process($text, 'en'); - } - } - return NULL; -} diff --git a/sites/all/modules/contrib/views/translation_views/translation_views.views.inc b/sites/all/modules/contrib/views/translation_views/translation_views.views.inc deleted file mode 100755 index f1b91e84b..000000000 --- a/sites/all/modules/contrib/views/translation_views/translation_views.views.inc +++ /dev/null @@ -1,115 +0,0 @@ -getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->hasHandlerClass('views_data') - && $entity_type->isTranslatable() - && $content_translation_manager->isEnabled($entity_type_id) - ) { - - try { - /** @var \Drupal\views\EntityViewsDataInterface $views_data */ - $views_data = \Drupal::entityTypeManager()->getHandler( - $entity_type_id, - 'views_data' - ); - } - catch (PluginNotFound $e) { - throw new PluginNotFound($entity_type_id, sprintf( - 'The "%s" entity type did not specify views_data handler class.', - $entity_type->getLabel() - )); - } - - $field_data_table = $views_data->getViewsTableForEntityType($entity_type); - - if (!empty($field_data_table)) { - $key = $entity_type_id . '_translation'; - $target_key = $key . '_target'; - $group = t('@entity_label translation', [ - '@entity_label' => $entity_type->getLabel(), - ]); - - $translations_table =& $data[$key]; - $translations_table_target =& $data[$target_key]; - - $entity_id = $entity_type->getKey('id'); - - $translations_table['table'] = [ - 'group' => $group, - 'entity type' => $entity_type_id, - 'join' => [ - $field_data_table => [ - 'join_id' => 'translation_views_language_join', - 'entity_id' => $entity_id, - 'type' => 'LEFT', - 'left_field' => $entity_id, - 'field' => $entity_id, - 'table' => $field_data_table, - ], - ], - ]; - - $translations_table += FieldDefinitions::buildStatusField(); - $translations_table += FieldDefinitions::buildTargetLanguageField(); - $translations_table += FieldDefinitions::buildOpLinksField(); - $translations_table += FieldDefinitions::buildCountField(); - - $module_handler = \Drupal::service('module_handler'); - if ($module_handler->moduleExists('content_moderation')) { - $translations_table += FieldDefinitions::buildModerationStateField(); - } - $translations_table_target['table'] = [ - 'group' => $group, - 'join' => [ - $field_data_table => [ - 'type' => 'LEFT', - 'left_field' => $entity_id, - 'field' => $entity_id, - 'table' => $field_data_table, - 'extra' => [ - [ - 'field' => 'langcode', - 'value' => '***TRANSLATION_VIEWS_TARGET_LANG***', - ], - ], - ], - ], - ]; - - $translations_table_target += FieldDefinitions::buildOutdatedField( - $data[$field_data_table]['content_translation_outdated'] - ); - $translations_table_target += FieldDefinitions::buildSourceField( - $data[$field_data_table]['content_translation_source'] - ); - $translations_table_target += FieldDefinitions::buildDefaultLangcodeField( - $data[$field_data_table]['default_langcode'] - ); - if (isset($data[$field_data_table]['changed'])) { - $translations_table_target += FieldDefinitions::buildChangedField( - $data[$field_data_table]['changed'] - ); - } - } - } - } - -} diff --git a/sites/all/modules/contrib/views/translation_views/translation_views.views_execution.inc b/sites/all/modules/contrib/views/translation_views/translation_views.views_execution.inc deleted file mode 100644 index df547dcb9..000000000 --- a/sites/all/modules/contrib/views/translation_views/translation_views.views_execution.inc +++ /dev/null @@ -1,36 +0,0 @@ -getExposedInput(); - $langcodes = array_keys(\Drupal::languageManager()->getLanguages( - LanguageInterface::STATE_CONFIGURABLE - )); - - if (isset($inputs['translation_target_language']) - && in_array($inputs['translation_target_language'], $langcodes) - ) { - $langcode = $inputs['translation_target_language']; - } - else { - $langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); - } - - $substitutions = [ - '***TRANSLATION_VIEWS_TARGET_LANG***' => $langcode, - ]; - - return $substitutions; -} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/LICENSE.txt b/sites/all/modules/contrib/views/views_bulk_edit/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/views/views_bulk_edit/README.txt b/sites/all/modules/contrib/views/views_bulk_edit/README.txt deleted file mode 100644 index 9efd84cad..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Introduction ------------- - -Views Bulk Edit allows modifying field values of a selected list of entities -of any type. It works with Views Bulk Operations (VBO) module, offering all of its -benefits like batching, ability to select all view results or persistent -selection across pages. - - -Requirements ------------- - -Views Bulk Edit requires Views Bulk operations module to be installed. - - -Installation ------------- - -Install as any other Drupal 8 module. - - -Configuration -------------- - -1. Create or edit any view, the most convenient display type for end - user in case of VBO views is Table. -2. Add a "Views bulk operations" field (global), available on - all entity types, if not already added. -3. Check the "Modify field values" action. -4. (Optional) Define a "bulk_edit" form mode for the entity bundles - that you wish to be able to bulk edit. Under the "Form modes" page - at /admin/structure/display-modes/form you can add a new form - mode. If it uses the machine name "bulk_edit", the form for the - "Modify field values" action will use that form mode to determine - what fields are available for bulk editing. diff --git a/sites/all/modules/contrib/views/views_bulk_edit/composer.json b/sites/all/modules/contrib/views/views_bulk_edit/composer.json deleted file mode 100644 index d46feae44..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/composer.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "drupal/views_bulk_edit", - "type": "drupal-module", - "description": "Allows bulk edition of entity field values.", - "homepage": "https://www.drupal.org/project/views_bulk_edit", - "authors": [ - { - "name": "Marcin Grabias", - "homepage": "https://www.drupal.org/u/graber" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/views_bulk_edit?version=8.x" - }, - "license": "GPL-2.0+", - "require": { - "drupal/views_bulk_operations": "~1.0 | ~2.0" - }, - "minimum-stability": "dev" -} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/css/edit_form.css b/sites/all/modules/contrib/views/views_bulk_edit/css/edit_form.css deleted file mode 100644 index 05c87d7d1..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/css/edit_form.css +++ /dev/null @@ -1,5 +0,0 @@ -.views-bulk-edit-form .vbe-selector-fieldset .form-type-checkbox, -.views-bulk-edit-form .vbe-selector-fieldset .js-form-type-checkbox { - float: left; - margin-right: 20px; -} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/src/Plugin/Action/ModifyEntityValues.php b/sites/all/modules/contrib/views/views_bulk_edit/src/Plugin/Action/ModifyEntityValues.php deleted file mode 100644 index 5389d52c4..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/src/Plugin/Action/ModifyEntityValues.php +++ /dev/null @@ -1,490 +0,0 @@ -viewDataService = $viewDataService; - $this->actionProcessor = $actionProcessor; - $this->entityTypeManager = $entityTypeManager; - $this->bundleInfo = $bundleInfo; - $this->database = $database; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('views_bulk_operations.data'), - $container->get('views_bulk_operations.processor'), - $container->get('entity_type.manager'), - $container->get('entity_type.bundle.info'), - $container->get('database') - ); - } - - /** - * {@inheritdoc} - */ - public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state) { - $form['get_bundles_from_results'] = [ - '#title' => $this->t('Get entity bundles from results'), - '#type' => 'checkbox', - '#default_value' => isset($values['get_bundles_from_results']) ? $values['get_bundles_from_results'] : TRUE, - '#description' => $this->t('NOTE: If performance issues are observed when using "All results in this view" selector in case of large result sets, uncheck this and use a bundle filter (node type, taxonomy vocabulary etc.) on the view.'), - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - - // Get view bundles. - $bundle_data = $this->getViewBundles(); - - // Store entity data. - $storage = $form_state->getStorage(); - $storage['vbe_entity_bundles_data'] = $bundle_data; - $form_state->setStorage($storage); - - $form['#attributes']['class'] = ['views-bulk-edit-form']; - $form['#attached']['library'][] = 'views_bulk_edit/views_bulk_edit.edit_form'; - - $form['options'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Options'), - ]; - $form['options']['_add_values'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Add values to multi-value fields'), - '#description' => $this->t('New values of multi-value fields will be added to the existing ones instead of overwriting them.'), - ]; - - $bundle_count = 0; - foreach ($bundle_data as $entity_type_id => $bundles) { - foreach ($bundles as $bundle => $label) { - $bundle_count++; - } - } - - foreach ($bundle_data as $entity_type_id => $bundles) { - foreach ($bundles as $bundle => $label) { - $form = $this->getBundleForm($entity_type_id, $bundle, $label, $form, $form_state, $bundle_count); - } - } - - return $form; - } - - /** - * Helper method to get bundles displayed by the view. - * - * @return array - * Array of entity bundles returned by the current view - * keyed by entity type IDs. - */ - protected function getViewBundles() { - - // Get a list of all entity types and bundles of the view. - $bundle_data = []; - $bundle_info = $this->bundleInfo->getAllBundleInfo(); - - // If the list of selected results is available, - // query db for selected bundles. - if (!empty($this->context['list'])) { - $query_data = []; - foreach ($this->context['list'] as $item) { - list(,, $entity_type_id, $id,) = $item; - $query_data[$entity_type_id][$id] = $id; - } - foreach ($query_data as $entity_type_id => $entity_ids) { - $entityTypeDefinition = $this->entityTypeManager->getDefinition($entity_type_id); - if ($bundle_key = $entityTypeDefinition->getKey('bundle')) { - $id_key = $entityTypeDefinition->getKey('id'); - - $results = $this->database->select($entityTypeDefinition->getBaseTable(), 'base') - ->fields('base', [$bundle_key]) - ->condition($id_key, $entity_ids, 'IN') - ->execute() - ->fetchCol(); - - foreach ($results as $bundle_id) { - if (!isset($bundle_data[$entity_type_id][$bundle_id])) { - $bundle_data[$entity_type_id][$bundle_id] = $bundle_info[$entity_type_id][$bundle_id]['label']; - } - } - } - else { - $bundle_data[$entity_type_id][$entity_type_id] = ''; - } - } - } - - // If not, fallback to other methods. - else { - // Initialize view and VBO view data service. - $view = Views::getView($this->context['view_id']); - $view->setDisplay($this->context['display_id']); - if (!empty($this->context['arguments'])) { - $view->setArguments($this->context['arguments']); - } - if (!empty($this->context['exposed_input'])) { - $view->setExposedInput($this->context['exposed_input']); - } - $view->build(); - - $this->viewDataService->init($view, $view->getDisplay(), $this->context['relationship_id']); - - // If administrator chose this method, get bundles from actual - // view results. - // NOTE: This can cause performance problems in case of large result sets! - if (!empty($this->context['preconfiguration']['get_bundles_from_results'])) { - $entities = []; - if (empty($this->context['list'])) { - $view->query->setLimit(0); - $view->query->setOffset(0); - $view->query->execute($view); - - foreach ($view->result as $row) { - $entities[] = $this->viewDataService->getEntity($row); - } - - } - else { - foreach ($this->context['list'] as $item) { - $entities[] = $this->actionProcessor->getEntity($item); - } - } - - if (!empty($entities)) { - foreach ($entities as $entity) { - $entity_type_id = $entity->getEntityTypeId(); - $bundle = $entity->bundle(); - if (!isset($bundle_data[$entity_type_id][$bundle])) { - $bundle_data[$entity_type_id][$bundle] = $bundle_info[$entity_type_id][$bundle]['label']; - } - } - } - } - - // The painless way, may display form for more bundles - // than the actual result set has. - else { - // Try to get possible bundles from a bundle filter, fixed or exposed, - // if exists (hopefully). - foreach ($this->viewDataService->getEntityTypeIds() as $entity_type_id) { - $entityTypeDefinition = $this->entityTypeManager->getDefinition($entity_type_id); - $bundle_key = $entityTypeDefinition->getKey('bundle'); - if (isset($view->filter[$bundle_key]) && !empty($view->filter[$bundle_key]->value)) { - foreach ($view->filter[$bundle_key]->value as $bundle) { - $bundle_data[$entity_type_id][$bundle] = $bundle_info[$entity_type_id][$bundle]['label']; - } - } - - // If previous failed and admin did not set to get bundles - // from view results, get all bundles of displayed entity types. - elseif (empty($this->context['preconfiguration']['get_bundles_from_results'])) { - if (isset($bundle_info[$entity_type_id])) { - foreach ($bundle_info[$entity_type_id] as $bundle => $label) { - $bundle_data[$entity_type_id][$bundle] = $bundle_info[$entity_type_id][$bundle]['label']; - } - } - } - } - } - } - return $bundle_data; - } - - /** - * Gets the form for this entity display. - * - * @param string $entity_type_id - * The entity type ID. - * @param string $bundle - * The bundle ID. - * @param mixed $bundle_label - * Bundle label. - * @param array $form - * Form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form_state object. - * @param int $bundle_count - * Number of bundles that may be affected. - * - * @return array - * Edit form for the current entity bundle. - */ - protected function getBundleForm($entity_type_id, $bundle, $bundle_label, array $form, FormStateInterface $form_state, $bundle_count) { - $entityType = $this->entityTypeManager->getDefinition($entity_type_id); - $entity = $this->entityTypeManager->getStorage($entity_type_id)->create([ - $entityType->getKey('bundle') => $bundle, - ]); - - if (!isset($form[$entity_type_id])) { - $form[$entity_type_id] = [ - '#type' => 'container', - '#tree' => TRUE, - ]; - } - - // If there is no bundle label, the entity has no bundles. - if (empty($bundle_label)) { - $bundle_label = $entityType->getLabel(); - } - $form[$entity_type_id][$bundle] = [ - '#type' => 'details', - '#open' => ($bundle_count === 1), - '#title' => $entityType->getLabel() . ' - ' . $bundle_label, - '#parents' => [$entity_type_id, $bundle], - ]; - - $form_display = EntityFormDisplay::collectRenderDisplay($entity, 'bulk_edit'); - $form_display->buildForm($entity, $form[$entity_type_id][$bundle], $form_state); - - $form[$entity_type_id][$bundle] += $this->getSelectorForm($entity_type_id, $bundle, $form[$entity_type_id][$bundle]); - - return $form; - } - - /** - * Builds the selector form. - * - * Given an entity form, create a selector form to provide options to update - * values. - * - * @param string $entity_type_id - * Entity type ID. - * @param string $bundle - * The bundle machine name. - * @param array $form - * The form we're building the selection options for. - * - * @return array - * The new selector form. - */ - protected function getSelectorForm($entity_type_id, $bundle, array &$form) { - $selector['_field_selector'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Select fields to change'), - '#weight' => -50, - '#tree' => TRUE, - '#attributes' => ['class' => ['vbe-selector-fieldset']], - ]; - - foreach (Element::children($form) as $key) { - if (isset($form[$key]['#access']) && !$form[$key]['#access']) { - continue; - } - if ($key == '_field_selector' || !$element = &$this->findFormElement($form[$key])) { - continue; - } - - $element['#required'] = FALSE; - $element['#tree'] = TRUE; - - // Add the toggle field to the form. - $selector['_field_selector'][$key] = [ - '#type' => 'checkbox', - '#title' => $element['#title'], - '#weight' => isset($form[$key]['#weight']) ? $form[$key]['#weight'] : 0, - '#tree' => TRUE, - ]; - - // Force the original value to be hidden unless the checkbox is enabled. - $form[$key]['#states'] = [ - 'visible' => [ - sprintf('[name="%s[%s][_field_selector][%s]"]', $entity_type_id, $bundle, $key) => ['checked' => TRUE], - ], - ]; - } - - if (empty(Element::children($selector['_field_selector']))) { - $selector['_field_selector']['#title'] = $this->t('There are no fields available to modify'); - } - - return $selector; - } - - /** - * Finds the deepest most form element and returns it. - * - * @param array $form - * The form element we're searching. - * - * @return array|null - * The deepest most element if we can find it. - */ - protected function &findFormElement(array &$form) { - foreach (Element::children($form) as $key) { - if (isset($form[$key]['#title']) && isset($form[$key]['#type'])) { - return $form[$key]; - } - elseif (is_array($form[$key])) { - $element = &$this->findFormElement($form[$key]); - return $element; - } - } - return NULL; - } - - /** - * Provides same functionality as ARRAY_FILTER_USE_KEY for PHP 5.5. - * - * @param array $array - * The array of data to filter. - * @param callable $callback - * The function we're going to use to determine the filtering. - * - * @return array - * The filtered data. - */ - protected function filterOnKey(array $array, callable $callback) { - $filtered_values = []; - foreach ($array as $key => $value) { - if ($callback($key)) { - $filtered_values[$key] = $value; - } - } - return $filtered_values; - } - - /** - * Save modified entity field values to action configuration. - * - * @param array $form - * Form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form_state object. - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $storage = $form_state->getStorage(); - $bundle_data = $storage['vbe_entity_bundles_data']; - - foreach ($bundle_data as $entity_type_id => $bundles) { - $entity_type = $this->entityTypeManager->getDefinition($entity_type_id); - foreach ($bundles as $bundle => $label) { - $field_data = $form_state->getValue([$entity_type_id, $bundle]); - $modify = array_filter($field_data['_field_selector']); - if (!empty($modify)) { - $form_clone = $form; - $form_clone['#parents'] = [$entity_type_id, $bundle]; - $entity = $this->entityTypeManager->getStorage($entity_type_id)->create([ - $entity_type->getKey('bundle') => $bundle, - ]); - $form_display = EntityFormDisplay::collectRenderDisplay($entity, 'bulk_edit'); - $form_display->extractFormValues($entity, $form_clone, $form_state); - - foreach (array_keys($modify) as $field) { - $this->configuration[$entity_type_id][$bundle][$field] = $entity->{$field}->getValue(); - } - } - } - } - - $this->configuration['_add_values'] = $form_state->getValue('_add_values'); - } - - /** - * {@inheritdoc} - */ - public function execute($entity = NULL) { - $type_id = $entity->getEntityTypeId(); - $bundle = $entity->bundle(); - - $result = $this->t('Skip (field is not present on this bundle)'); - if (isset($this->configuration[$type_id][$bundle])) { - foreach ($this->configuration[$type_id][$bundle] as $field => $value) { - if (!empty($this->configuration['_add_values'])) { - /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $storageDefinition */ - $storageDefinition = $entity->{$field}->getFieldDefinition()->getFieldStorageDefinition(); - $cardinality = $storageDefinition->getCardinality(); - if ($cardinality === $storageDefinition::CARDINALITY_UNLIMITED || $cardinality > 1) { - $current_value = $entity->{$field}->getValue(); - $value_count = count($current_value); - foreach ($value as $item) { - if ($cardinality != $storageDefinition::CARDINALITY_UNLIMITED && $value_count >= $cardinality) { - break; - } - $current_value[] = $item; - } - $value = $current_value; - } - } - - $entity->{$field}->setValue($value); - } - $entity->save(); - $result = $this->t('Modify field values'); - } - return $result; - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access = $object->access('update', $account, TRUE); - return $return_as_object ? $access : $access->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/tests/src/Functional/ViewsBulkEditModifyEntityValuesTest.php b/sites/all/modules/contrib/views/views_bulk_edit/tests/src/Functional/ViewsBulkEditModifyEntityValuesTest.php deleted file mode 100644 index 1d8de05eb..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/tests/src/Functional/ViewsBulkEditModifyEntityValuesTest.php +++ /dev/null @@ -1,158 +0,0 @@ -createContentType(['type' => 'article', 'name' => 'Article']); - $this->createContentType(['type' => 'page', 'name' => 'Page']); - - // Create a text field on the page content type. - $entityTypeManager = $this->container->get('entity_type.manager'); - $entityTypeManager->getStorage('field_storage_config')->create([ - 'field_name' => 'text', - 'entity_type' => 'node', - 'type' => 'text', - 'module' => 'text', - 'cardinality' => 1, - ])->save(); - $entityTypeManager->getStorage('field_config')->create([ - 'field_name' => 'text', - 'entity_type' => 'node', - 'bundle' => 'page', - 'label' => 'Field text', - ])->save(); - $entityTypeManager->getStorage('entity_form_display')->load('node.page.default')->setComponent('text', [ - 'type' => 'text_textfield', - 'region' => 'content', - 'settings' => [ - 'size' => 10, - ], - ])->save(); - - $this->testNodes = []; - $time = REQUEST_TIME; - for ($i = 0; $i < 4; $i++) { - // Ensure nodes are sorted in the same order they are inserted in the - // array. - $time -= $i; - $type = ($i % 2 == 0) ? 'article' : 'page'; - $this->testNodes[] = $this->drupalCreateNode([ - // Bundles will be: page, article, page, article. - 'type' => $type, - 'title' => 'Title ' . $i . ' (' . $type . ')', - 'sticky' => FALSE, - 'created' => $time, - 'changed' => $time, - ]); - } - - } - - /** - * Test the bulk edit operation. - */ - public function testViewsBulkEdit() { - - // Log in as a user with 'edit any page content' permission - // to have access to perform the test operation. - $admin_user = $this->drupalCreateUser([ - 'administer nodes', - 'bypass node access', - 'execute advanced test action', - ]); - $this->drupalLogin($admin_user); - - // Modify config of the test view: add the views_bulk_edit operation, - // set items per page to 10 and offset to 0. - $testViewConfig = $this->container->get('config.factory')->getEditable('views.view.views_bulk_operations_test_advanced'); - $configData = $testViewConfig->getRawData(); - $configData['display']['default']['display_options']['fields']['views_bulk_operations_bulk_form']['selected_actions']['views_bulk_edit'] = 'views_bulk_edit'; - $configData['display']['default']['display_options']['fields']['views_bulk_operations_bulk_form']['preconfiguration']['views_bulk_edit'] = ['label_override' => '']; - $configData['display']['default']['display_options']['pager']['options']['items_per_page'] = 10; - $configData['display']['default']['display_options']['pager']['options']['offset'] = 0; - $testViewConfig->setData($configData); - $testViewConfig->save(); - - // Post the VBO form with one page and one article selected. - $edit = [ - 'action' => 'views_bulk_edit', - 'views_bulk_operations_bulk_form[1]' => TRUE, - 'views_bulk_operations_bulk_form[2]' => TRUE, - ]; - $this->drupalPostForm('views-bulk-operations-test-advanced', $edit, t('Apply to selected items')); - - // Post the configuration form: modify status and text value field on the - // article content type. - $expected_text_value = 'some text'; - $this->drupalPostForm(NULL, [ - 'node[article][_field_selector][status]' => TRUE, - 'node[article][status][value]' => FALSE, - 'node[page][_field_selector][status]' => TRUE, - 'node[page][status][value]' => FALSE, - 'node[page][_field_selector][text]' => TRUE, - 'node[page][text][0][value]' => $expected_text_value, - ], t('Apply')); - - // Assert if field values have been changed on the selected entities - // and unchanged otherwise. - $nodeStorage = $this->container->get('entity_type.manager')->getStorage('node'); - - foreach ($this->testNodes as $index => $node) { - // Reload the node. - $node = $nodeStorage->load($node->id()); - $status = intval($node->status->value); - $text = isset($node->text) ? $node->text->value : FALSE; - - switch ($index) { - case 0: - $this->assertEquals(NodeInterface::PUBLISHED, $status); - $this->assertEquals(FALSE, $text); - break; - - case 1: - $this->assertEquals(NodeInterface::NOT_PUBLISHED, $status); - $this->assertEquals($expected_text_value, $text); - break; - - case 2: - $this->assertEquals(NodeInterface::NOT_PUBLISHED, $status); - $this->assertEquals(FALSE, $text); - break; - - case 3: - $this->assertEquals(NodeInterface::PUBLISHED, $status); - $this->assertEquals('', $text); - break; - } - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/tests/src/Kernel/ViewsBulkEditActionTest.php b/sites/all/modules/contrib/views/views_bulk_edit/tests/src/Kernel/ViewsBulkEditActionTest.php deleted file mode 100644 index b55592a29..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/tests/src/Kernel/ViewsBulkEditActionTest.php +++ /dev/null @@ -1,79 +0,0 @@ -createTestNodes([ - 'page' => [ - 'count' => 10, - ], - ]); - } - - /** - * Tests the bulk edit action. - * - * @covers ::getViewBundles - * @covers ::execute - */ - public function testModifyEntityValues() { - $vbo_data = [ - 'view_id' => 'views_bulk_operations_test', - 'action_id' => 'views_bulk_edit', - 'configuration' => [ - 'node' => [ - 'page' => [ - 'status' => [ - ['value' => 0], - ], - ], - ], - ], - ]; - - // Get list of rows to process from different view pages. - $selection = [0, 3, 6, 8]; - $vbo_data['list'] = $this->getResultsList($vbo_data, $selection); - - // Execute the action. - $results = $this->executeAction($vbo_data); - - $nodeStorage = $this->container->get('entity_type.manager')->getStorage('node'); - - $statuses = []; - - foreach ($this->testNodesData as $id => $lang_data) { - $node = $nodeStorage->load($id); - $status = intval($node->status->value); - foreach ($vbo_data['list'] as $item) { - if ($item[3] == $id) { - $this->assertEquals(NodeInterface::NOT_PUBLISHED, $status); - break 2; - } - } - $this->assertEquals(NodeInterface::PUBLISHED, $status); - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.info.yml b/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.info.yml deleted file mode 100644 index 713faf655..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: 'Views Bulk Edit' -description: 'Allows bulk edition of entity field values.' -package: 'Views Bulk Operations' -# core: 8.x -dependencies: - - drupal:views_bulk_operations - -# Information added by Drupal.org packaging script on 2018-07-27 -version: '8.x-2.2' -core: '8.x' -project: 'views_bulk_edit' -datestamp: 1532689107 diff --git a/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.libraries.yml b/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.libraries.yml deleted file mode 100644 index bae5a129b..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.libraries.yml +++ /dev/null @@ -1,4 +0,0 @@ -views_bulk_edit.edit_form: - css: - theme: - css/edit_form.css: {} diff --git a/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.module b/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.module deleted file mode 100644 index 56bca3c4f..000000000 --- a/sites/all/modules/contrib/views/views_bulk_edit/views_bulk_edit.module +++ /dev/null @@ -1,24 +0,0 @@ -' . $readme . ''; - - return $output; - } - } -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/LICENSE.txt b/sites/all/modules/contrib/views/views_bulk_operations/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/contrib/views/views_bulk_operations/README.txt b/sites/all/modules/contrib/views/views_bulk_operations/README.txt deleted file mode 100644 index 69a18df9f..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/README.txt +++ /dev/null @@ -1,53 +0,0 @@ -Introduction ------------- - -Views Bulk Operations augments Views by allowing actions -(provided by Drupal core or contrib modules) to be executed -on the selected view rows. - -It does so by showing a checkbox in front of each displayed row, and adding a -select box on top of the View containing operations that can be applied. - - -Getting started ------------------ - -1. Create a View with a page or block display. -2. Add a "Views bulk operations" field (global), available on - all entity types. -3. Configure the field by selecting at least one operation. -4. Go to the View page. VBO functionality should be present. - - -Creating custom actions ------------------------ - -Example that covers different possibilities is available in -modules/views_bulk_operatios_example/. - -In a module, create an action plugin (check the included example module, -test actions in /tests/views_bulk_operations_test/src/Plugin/Action -or \core\modules\node\src\Plugin\Action namespace for simple implementations). - -Available annotation parameters: - - id: The action ID (required), - - label: Action label (required), - - type: Entity type for the action, if left empty, action will be - applicable to all entity types (required), - - confirm: If set to TRUE and the next parameter is empty, - the module default confirmation form will be used (default: FALSE), - - confirm_form_route_name: Route name of the action confirmation form. - If left empty and the previous parameter is empty, there will be - no confirmation step (default: empty string). - - requirements: an array of requirements an action must meet - to be displayed on the action selection form. At the moment - only one possible requirement is supported: '_permission', if - the current user has that permission, the action execution will - be possible. - - -Additional notes ----------------- - -Full documentation with examples is available at -https://www.drupal.org/docs/8/modules/views-bulk-operations-vbo. diff --git a/sites/all/modules/contrib/views/views_bulk_operations/composer.json b/sites/all/modules/contrib/views/views_bulk_operations/composer.json deleted file mode 100644 index 174bebe31..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "drupal/views_bulk_operations", - "description": "Adds an ability to perform bulk operations on selected entities from view results. Provides an API to create such operations.", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/views_bulk_operations", - "authors": [ - { - "name": "Marcin Grabias", - "homepage": "https://www.drupal.org/u/graber" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/views_bulk_operations?version=8.x", - "docs": "https://www.drupal.org/docs/8/modules/views-bulk-operations-vbo" - }, - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": {}, - "extra": { - "drush": { - "services": { - "drush.services.yml": "^9" - } - } - } -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/config/schema/views_bulk_operations.views.schema.yml b/sites/all/modules/contrib/views/views_bulk_operations/config/schema/views_bulk_operations.views.schema.yml deleted file mode 100644 index 0fae1cbc7..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/config/schema/views_bulk_operations.views.schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -views.field.views_bulk_operations_bulk_form: - type: views_field - label: 'Views Bulk Operations' - mapping: - batch: - type: boolean - label: 'Process selected entities in a batch operation' - batch_size: - type: integer - label: 'Size of the processing batch' - form_step: - type: boolean - label: 'Display configuration form on a separate page' - buttons: - type: boolean - label: 'Display action options as buttons' - action_title: - type: string - label: 'Title of the action selector form element' - selected_actions: - type: ignore - label: 'Selected actions array' - preconfiguration: - type: ignore - label: 'Preliminary configuration array' - clear_on_exposed: - type: boolean - label: 'Clear on exposed' diff --git a/sites/all/modules/contrib/views/views_bulk_operations/css/frontUi.css b/sites/all/modules/contrib/views/views_bulk_operations/css/frontUi.css deleted file mode 100644 index e5fb3c457..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/css/frontUi.css +++ /dev/null @@ -1,6 +0,0 @@ -.views-table-row-vbo-select-all div { - text-align: center; -} -.views-field-views-bulk-operations-bulk-form.empty { - display: none; -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/drush.services.yml b/sites/all/modules/contrib/views/views_bulk_operations/drush.services.yml deleted file mode 100644 index 3d629c0fa..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/drush.services.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - views_bulk_operations.commands: - class: \Drupal\views_bulk_operations\Commands\ViewsBulkOperationsCommands - arguments: - - '@current_user' - - '@views_bulk_operations.data' - - '@plugin.manager.views_bulk_operations_action' - tags: - - { name: drush.command } diff --git a/sites/all/modules/contrib/views/views_bulk_operations/js/adminUi.js b/sites/all/modules/contrib/views/views_bulk_operations/js/adminUi.js deleted file mode 100644 index 7a2b3f64d..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/js/adminUi.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file - * Views admin UI functionality. - */ - -(function ($, Drupal) { - - 'use strict'; - - /** - * @type {Drupal~behavior} - */ - Drupal.behaviors.views_bulk_operations = { - attach: function (context, settings) { - $('.views-bulk-operations-ui').once('views-bulk-operations-ui').each(Drupal.viewsBulkOperationsUi); - } - }; - - /** - * Callback used in {@link Drupal.behaviors.views_bulk_operations}. - */ - Drupal.viewsBulkOperationsUi = function () { - var uiElement = $(this); - - // Show / hide actions' preliminary configuration. - uiElement.find('.vbo-action-state').each(function () { - var matches = $(this).attr('name').match(/.*\[.*?\]\[(.*?)\]\[.*?\]/); - if (typeof (matches[1]) != 'undefined') { - var preconfigurationElement = uiElement.find('*[data-for="' + matches[1] + '"]'); - $(this).change(function (event) { - if ($(this).is(':checked')) { - preconfigurationElement.show('fast'); - } - else { - preconfigurationElement.hide('fast'); - } - }); - } - }); - - // Select / deselect all functionality. - var actionsElementWrapper = uiElement.find('details.vbo-actions-widget > .details-wrapper'); - if (actionsElementWrapper.length) { - var checked = false; - var allHandle = $('' + Drupal.t('Select / deselect all') + ''); - actionsElementWrapper.prepend(allHandle); - allHandle.on('click', function (event) { - event.preventDefault(); - checked = !checked; - actionsElementWrapper.find('.vbo-action-state').each(function () { - $(this).prop('checked', checked); - $(this).trigger('change'); - }); - return false; - }); - } - }; -})(jQuery, Drupal); diff --git a/sites/all/modules/contrib/views/views_bulk_operations/js/frontUi.js b/sites/all/modules/contrib/views/views_bulk_operations/js/frontUi.js deleted file mode 100644 index 254c8a655..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/js/frontUi.js +++ /dev/null @@ -1,234 +0,0 @@ -/** - * @file - * Select-All Button functionality. - */ - -(function ($, Drupal) { - - 'use strict'; - - /** - * @type {Drupal~behavior} - */ - Drupal.behaviors.views_bulk_operations = { - attach: function (context, settings) { - $('.vbo-view-form').once('vbo-init').each(Drupal.viewsBulkOperationsFrontUi); - } - }; - - /** - * Views Bulk Operation selection object. - */ - Drupal.viewsBulkOperationsSelection = { - view_id: '', - display_id: '', - list: {}, - $placeholder: null, - - /** - * Bind event handlers to an element. - * - * @param {jQuery} element - */ - bindEventHandlers: function ($element, index) { - if ($element.length) { - var selectionObject = this; - $element.on('keypress', function (event) { - // Emulate click action for enter key. - if (event.which === 13) { - event.preventDefault(); - event.stopPropagation(); - selectionObject.update(this.checked, index, $(this).val()); - $(this).trigger('click'); - } - if (event.which === 32) { - selectionObject.update(this.checked, index, $(this).val()); - } - }); - $element.on('mousedown', function (event) { - // Act only on left button click. - if (event.which === 1) { - selectionObject.update(this.checked, index, $(this).val()); - } - }); - } - }, - - /** - * Perform an AJAX request to update selection. - * - * @param {bool} state - * @param {string} value - */ - update: function (state, index, value) { - if (value === undefined) { - value = null; - } - if (this.view_id.length && this.display_id.length) { - var list = {}; - if (value && value != 'on') { - list[value] = this.list[index][value]; - } - else { - list = this.list[index]; - } - var op = state ? 'remove' : 'add'; - - var $placeholder = this.$placeholder; - var target_uri = '/' + drupalSettings.path.pathPrefix + 'views-bulk-operations/ajax/' + this.view_id + '/' + this.display_id; - $.ajax(target_uri, { - method: 'POST', - data: { - list: list, - op: op - }, - success: function (data) { - var count = parseInt($placeholder.text()); - count += data.change; - $placeholder.text(count); - } - }); - } - } - } - - /** - * Callback used in {@link Drupal.behaviors.views_bulk_operations}. - */ - Drupal.viewsBulkOperationsFrontUi = function () { - var $vboForm = $(this); - var $viewsTables = $('.vbo-table', $vboForm); - var $primarySelectAll = $('.vbo-select-all', $vboForm); - var tableSelectAll = []; - - // When grouping is enabled, there can be multiple tables. - if ($viewsTables.length) { - $viewsTables.each(function (index) { - tableSelectAll[index] = $(this).find('.select-all input').first(); - }); - var $tableSelectAll = $(tableSelectAll); - } - - // Add AJAX functionality to table checkboxes. - var $multiSelectElement = $vboForm.find('.vbo-multipage-selector').first(); - if ($multiSelectElement.length) { - - Drupal.viewsBulkOperationsSelection.$placeholder = $multiSelectElement.find('.placeholder').first(); - Drupal.viewsBulkOperationsSelection.view_id = $multiSelectElement.attr('data-view-id'); - Drupal.viewsBulkOperationsSelection.display_id = $multiSelectElement.attr('data-display-id'); - - // Get the list of all checkbox values and add AJAX callback. - Drupal.viewsBulkOperationsSelection.list = []; - - var $contentWrappers; - if ($viewsTables.length) { - $contentWrappers = $viewsTables; - } - else { - $contentWrappers = $([$vboForm]); - } - - $contentWrappers.each(function (index) { - var $contentWrapper = $(this); - Drupal.viewsBulkOperationsSelection.list[index] = {}; - - $contentWrapper.find('.views-field-views-bulk-operations-bulk-form input[type="checkbox"]').each(function () { - var value = $(this).val(); - if (value != 'on') { - Drupal.viewsBulkOperationsSelection.list[index][value] = $(this).parent().find('label').first().text(); - Drupal.viewsBulkOperationsSelection.bindEventHandlers($(this), index); - } - }); - - // Bind event handlers to select all checkbox. - if ($viewsTables.length && tableSelectAll.length) { - Drupal.viewsBulkOperationsSelection.bindEventHandlers(tableSelectAll[index], index); - } - }); - } - - // Initialize all selector if the primary select all and - // view table elements exist. - if ($primarySelectAll.length && $viewsTables.length) { - var strings = { - selectAll: $('label', $primarySelectAll.parent()).html(), - selectRegular: Drupal.t('Select only items on this page') - }; - - $primarySelectAll.parent().hide(); - - if ($viewsTables.length == 1) { - var colspan = $('thead th', $viewsTables.first()).length; - var $allSelector = $('
        '); - $('tbody', $viewsTables.first()).prepend($allSelector); - } - else { - var $allSelector = $(''); - $($viewsTables.first()).before($allSelector); - } - - if ($primarySelectAll.is(':checked')) { - $('input', $allSelector).val(strings.selectRegular); - $allSelector.show(); - } - else { - var show_all_selector = true; - $tableSelectAll.each(function () { - if (!$(this).is(':checked')) { - show_all_selector = false; - } - }); - if (show_all_selector) { - $allSelector.show(); - } - } - - $('input', $allSelector).on('click', function (event) { - event.preventDefault(); - if ($primarySelectAll.is(':checked')) { - $multiSelectElement.show('fast'); - $primarySelectAll.prop('checked', false); - $allSelector.removeClass('all-selected'); - $(this).val(strings.selectAll); - } - else { - $multiSelectElement.hide('fast'); - $primarySelectAll.prop('checked', true); - $allSelector.addClass('all-selected'); - $(this).val(strings.selectRegular); - } - }); - - $(tableSelectAll).each(function () { - $(this).on('change', function (event) { - var show_all_selector = true; - $tableSelectAll.each(function () { - if (!$(this).is(':checked')) { - show_all_selector = false; - } - }); - if (show_all_selector) { - $allSelector.show(); - } - else { - $allSelector.hide(); - if ($primarySelectAll.is(':checked')) { - $('input', $allSelector).trigger('click'); - } - } - }); - }); - } - else { - $primarySelectAll.first().on('change', function (event) { - if (this.checked) { - $multiSelectElement.hide('fast'); - } - else { - $multiSelectElement.show('fast'); - } - }); - } - }; - -})(jQuery, Drupal); diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.info.yml b/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.info.yml deleted file mode 100644 index 06947af3d..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: 'Actions Permissions' -description: 'Adds access permissions on all actions allowing admins to restrict access on a per-role basis.' -package: 'Views Bulk Operations' -# core: 8.x -dependencies: - - drupal:views_bulk_operations - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-2.5' -core: '8.x' -project: 'views_bulk_operations' -datestamp: 1550740388 diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.permissions.yml b/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.permissions.yml deleted file mode 100644 index e2ccdd1f0..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -permission_callbacks: - - \Drupal\actions_permissions\ActionsPermissions::permissions diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.services.yml b/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.services.yml deleted file mode 100644 index a72918162..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/actions_permissions.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - actions_permissions.views_bulk_operations_actions: - class: Drupal\actions_permissions\EventSubscriber\ActionsPermissionsEventSubscriber - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/ActionsPermissions.php b/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/ActionsPermissions.php deleted file mode 100644 index 3e45e1ea7..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/ActionsPermissions.php +++ /dev/null @@ -1,106 +0,0 @@ -actionManager = $actionManager; - $this->entityTypeManager = $entityTypeManager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.views_bulk_operations_action'), - $container->get('entity_type.manager') - ); - } - - /** - * Get permissions for Actions. - * - * @return array - * Permissions array. - */ - public function permissions() { - $permissions = []; - $entity_type_definitions = $this->entityTypeManager->getDefinitions(); - - // Get definitions that will not be altered by actions_permissions. - foreach ($this->actionManager->getDefinitions([ - 'skip_actions_permissions' => TRUE, - 'nocache' => TRUE, - ]) as $definition) { - - // Skip actions that define their own requirements. - if (!empty($definition['requirements'])) { - continue; - } - - $id = 'execute ' . $definition['id']; - $entity_type = NULL; - if (empty($definition['type'])) { - $entity_type = $this->t('all entity types'); - $id .= ' all'; - } - elseif (isset($entity_type_definitions[$definition['type']])) { - $entity_type = $entity_type_definitions[$definition['type']]->getLabel(); - $id .= ' ' . $definition['type']; - } - - if (isset($entity_type)) { - $permissions[$id] = [ - 'title' => $this->t('Execute the %action action on %type.', [ - '%action' => $definition['label'], - '%type' => $entity_type, - ]), - ]; - } - } - - // Rebuild VBO action definitions cache with - // included action_permissions modifications. - $this->actionManager->getDefinitions([ - 'nocache' => TRUE, - ]); - - return $permissions; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/EventSubscriber/ActionsPermissionsEventSubscriber.php b/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/EventSubscriber/ActionsPermissionsEventSubscriber.php deleted file mode 100644 index 695e9942f..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/actions_permissions/src/EventSubscriber/ActionsPermissionsEventSubscriber.php +++ /dev/null @@ -1,59 +0,0 @@ -alterParameters['skip_actions_permissions'])) { - return; - } - - foreach ($event->definitions as $action_id => $definition) { - - // Only process actions that don't define their own requirements. - if (empty($definition['requirements'])) { - $permission_id = 'execute ' . $definition['id']; - if (empty($definition['type'])) { - $permission_id .= ' all'; - } - else { - $permission_id .= ' ' . $definition['type']; - } - $definition['requirements']['_permission'] = $permission_id; - $event->definitions[$action_id] = $definition; - } - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/src/Plugin/Action/ViewsBulkOperationExampleAction.php b/sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/src/Plugin/Action/ViewsBulkOperationExampleAction.php deleted file mode 100644 index d4262e5f6..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/src/Plugin/Action/ViewsBulkOperationExampleAction.php +++ /dev/null @@ -1,115 +0,0 @@ -configuration. - * Passed view rows will be available in $this->context. - * Data about the view used to select results and optionally - * the batch context are available in $this->context or externally - * through the public getContext() method. - * The entire ViewExecutable object with selected result - * rows is available in $this->view or externally through - * the public getView() method. - */ - - // Do some processing.. - // ... - drupal_set_message($entity->label()); - return sprintf('Example action (configuration: %s)', print_r($this->configuration, TRUE)); - } - - /** - * {@inheritdoc} - */ - public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state) { - $form['example_preconfig_setting'] = [ - '#title' => $this->t('Example setting'), - '#type' => 'textfield', - '#default_value' => isset($values['example_preconfig_setting']) ? $values['example_preconfig_setting'] : '', - ]; - return $form; - } - - /** - * Configuration form builder. - * - * If this method has implementation, the action is - * considered to be configurable. - * - * @param array $form - * Form array. - * @param Drupal\Core\Form\FormStateInterface $form_state - * The form state object. - * - * @return array - * The configuration form. - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form['example_config_setting'] = [ - '#title' => t('Example setting pre-execute'), - '#type' => 'textfield', - '#default_value' => $form_state->getValue('example_config_setting'), - ]; - return $form; - } - - /** - * Submit handler for the action configuration form. - * - * If not implemented, the cleaned form values will be - * passed direclty to the action $configuration parameter. - * - * @param array $form - * Form array. - * @param Drupal\Core\Form\FormStateInterface $form_state - * The form state object. - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - // This is not required here, when this method is not defined, - // form values are assigned to the action configuration by default. - // This function is a must only when user input processing is needed. - $this->configuration['example_config_setting'] = $form_state->getValue('example_config_setting'); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - if ($object->getEntityType() === 'node') { - $access = $object->access('update', $account, TRUE) - ->andIf($object->status->access('edit', $account, TRUE)); - return $return_as_object ? $access : $access->isAllowed(); - } - - // Other entity types may have different - // access methods and properties. - return TRUE; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/views_bulk_operations_example.info.yml b/sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/views_bulk_operations_example.info.yml deleted file mode 100644 index c8c57af49..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/modules/views_bulk_operations_example/views_bulk_operations_example.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: 'Views Bulk Operations example' -description: 'Defines an example action with all possible options.' -package: 'Examples' -# core: 8.x -dependencies: - - drupal:views_bulk_operations - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-2.5' -core: '8.x' -project: 'views_bulk_operations' -datestamp: 1550740388 diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Access/ViewsBulkOperationsAccess.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Access/ViewsBulkOperationsAccess.php deleted file mode 100644 index 9f78a983b..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Access/ViewsBulkOperationsAccess.php +++ /dev/null @@ -1,50 +0,0 @@ -tempStoreFactory = $tempStoreFactory; - } - - /** - * A custom access check. - * - * @param \Drupal\Core\Session\AccountInterface $account - * Run access checks for this account. - * @param \Drupal\Core\Routing\RouteMatch $routeMatch - * The matched route. - */ - public function access(AccountInterface $account, RouteMatch $routeMatch) { - $parameters = $routeMatch->getParameters()->all(); - - if ($view = Views::getView($parameters['view_id'])) { - if ($view->access($parameters['display_id'], $account)) { - return AccessResult::allowed(); - } - } - return AccessResult::forbidden(); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionBase.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionBase.php deleted file mode 100644 index 2209fad10..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionBase.php +++ /dev/null @@ -1,133 +0,0 @@ -context['sandbox'] = &$context['sandbox']; - foreach ($context as $key => $item) { - if ($key === 'sandbox') { - continue; - } - $this->context[$key] = $item; - } - } - - /** - * {@inheritdoc} - */ - public function setView(ViewExecutable $view) { - $this->view = $view; - } - - /** - * {@inheritdoc} - */ - public function executeMultiple(array $objects) { - $results = []; - foreach ($objects as $entity) { - $results[] = $this->execute($entity); - } - - return $results; - } - - /** - * {@inheritdoc} - */ - public function defaultConfiguration() { - return []; - } - - /** - * Default configuration form validator. - * - * This method will be needed if a child class will implement - * \Drupal\Core\Plugin\PluginFormInterface. Code saver. - * - * @param array &$form - * Form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state object. - */ - public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { - - } - - /** - * Default configuration form submit handler. - * - * This method will be needed if a child class will implement - * \Drupal\Core\Plugin\PluginFormInterface. Code saver. - * - * @param array &$form - * Form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state object. - */ - public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { - $form_state->cleanValues(); - foreach ($form_state->getValues() as $key => $value) { - $this->configuration[$key] = $value; - } - } - - /** - * {@inheritdoc} - */ - public function getConfiguration() { - return $this->configuration; - } - - /** - * {@inheritdoc} - */ - public function setConfiguration(array $configuration) { - $this->configuration = $configuration; - } - - /** - * {@inheritdoc} - */ - public function calculateDependencies() { - return []; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionInterface.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionInterface.php deleted file mode 100644 index d6c8824a4..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Action/ViewsBulkOperationsActionInterface.php +++ /dev/null @@ -1,47 +0,0 @@ -currentUser = $currentUser; - $this->viewData = $viewData; - $this->actionManager = $actionManager; - } - - /** - * Execute an action on all results of the specified view. - * - * Use the --verbose parameter to see progress messages. - * - * @param string $view_id - * The ID of the view to use. - * @param string $action_id - * The ID of the action to execute. - * @param array $options - * (optional) An array of options. - * - * @return string - * The summary message. - * - * @command views-bulk-operations:execute - * - * @option display-id - * ID of the display to use. - * @option args - * View arguments (slash is a delimeter). - * @option exposed - * Exposed filters (query string format). - * @option batch-size - * Processing batch size. - * @option configuration - * Action configuration (query string format). - * @option user-id - * The ID of the user account used for performing the operation. - * - * @usage drush views-bulk-operations:execute some_view some_action - * Execute some action on some view. - * @usage drush vbo-execute some_view some_action --args=arg1/arg2 --batch-size=50 - * Execute some action on some view with arg1 and arg2 as - * the view arguments and 50 entities processed per batch. - * @usage drush vbo-exec some_view some_action --configuration="key1=value1&key2=value2" - * Execute some action on some view with the specified action configuration. - * - * @aliases vbo-execute, vbo-exec - */ - public function vboExecute( - $view_id, - $action_id, - array $options = [ - 'display-id' => 'default', - 'args' => '', - 'exposed' => '', - 'batch-size' => 100, - 'configuration' => '', - 'user-id' => 1, - ] - ) { - - if (empty($view_id) || empty($action_id)) { - throw new \Exception($this->t('You must specify the view ID and the action ID parameters.')); - } - - $this->timer($options['verbose']); - - // Prepare options. - if ($options['args']) { - $options['args'] = explode('/', $options['args']); - } - else { - $options['args'] = []; - } - - // Decode query string format options. - foreach (['configuration', 'exposed'] as $name) { - if (!empty($options[$name]) && !is_array($options[$name])) { - parse_str($options[$name], $options[$name]); - } - else { - $options[$name] = []; - } - } - - $vbo_data = [ - 'list' => [], - 'view_id' => $view_id, - 'display_id' => $options['display-id'], - 'action_id' => $action_id, - 'preconfiguration' => $options['configuration'], - 'batch' => TRUE, - 'arguments' => $options['args'], - 'exposed_input' => $options['exposed'], - 'batch_size' => $options['batch-size'], - 'relationship_id' => 'none', - ]; - - // Login as superuser, as drush 9 doesn't support the - // --user parameter. - $account = User::load($options['user-id']); - $this->currentUser->setAccount($account); - - // Initialize the view to check if parameters are correct. - if (!$view = Views::getView($vbo_data['view_id'])) { - throw new \Exception($this->t('Incorrect view ID provided.')); - } - if (!$view->setDisplay($vbo_data['display_id'])) { - throw new \Exception($this->t('Incorrect view display ID provided.')); - } - if (!empty($vbo_data['arguments'])) { - $view->setArguments($vbo_data['arguments']); - } - if (!empty($vbo_data['exposed_input'])) { - $view->setExposedInput($vbo_data['exposed_input']); - } - - // We need total rows count for proper progress message display. - $view->get_total_rows = TRUE; - $view->execute(); - - // Get relationship ID if VBO field exists. - $vbo_data['relationship_id'] = 'none'; - foreach ($view->field as $field) { - if ($field->options['id'] === 'views_bulk_operations_bulk_form') { - $vbo_data['relationship_id'] = $field->options['relationship']; - } - } - - // Get total rows count. - $this->viewData->init($view, $view->getDisplay(), $vbo_data['relationship_id']); - $vbo_data['total_results'] = $this->viewData->getTotalResults(); - - // Get action definition and check if action ID is correct. - $action_definition = $this->actionManager->getDefinition($action_id); - $vbo_data['action_label'] = (string) $action_definition['label']; - - $this->timer($options['verbose'], 'init'); - - // Populate entity list. - $context = []; - do { - $context['finished'] = 1; - $context['message'] = ''; - ViewsBulkOperationsBatch::getList($vbo_data, $context); - if (!empty($context['message'])) { - $this->logger->info($context['message']); - } - } while ($context['finished'] < 1); - $vbo_data = $context['results']; - - $this->timer($options['verbose'], 'list'); - - // Execute the selected action. - $context = []; - do { - $context['finished'] = 1; - $context['message'] = ''; - ViewsBulkOperationsBatch::operation($vbo_data, $context); - if (!empty($context['message'])) { - $this->logger->info($context['message']); - } - } while ($context['finished'] < 1); - - // Output a summary message. - $operations = array_count_values($context['results']['operations']); - $details = []; - foreach ($operations as $op => $count) { - $details[] = $op . ' (' . $count . ')'; - } - - // Display debug information. - if ($options['verbose']) { - $this->timer($options['verbose'], 'execute'); - $this->logger->info($this->t('Initialization time: @time ms.', ['@time' => $this->timer($options['verbose'], 'init')])); - $this->logger->info($this->t('Entity list generation time: @time ms.', ['@time' => $this->timer($options['verbose'], 'list')])); - $this->logger->info($this->t('Execution time: @time ms.', ['@time' => $this->timer($options['verbose'], 'execute')])); - } - - return $this->t('Action processing results: @results.', ['@results' => implode(', ', $details)]); - } - - /** - * Helper function to set / get timer. - * - * @param bool $debug - * Should the function do anything at all? - * @param string $id - * ID of a specific timer span. - * - * @return mixed - * NULL or value of a specific timer if set. - */ - protected function timer($debug = TRUE, $id = NULL) { - if (!$debug) { - return; - } - - static $timers = []; - - if (!isset($id)) { - $timers['start'] = microtime(TRUE); - } - else { - if (isset($timers[$id])) { - end($timers); - do { - if (key($timers) === $id) { - return round((current($timers) - prev($timers)) * 1000, 3); - } - else { - $result = prev($timers); - } - } while ($result); - } - else { - $timers[$id] = microtime(TRUE); - } - } - } - - /** - * Translates a string using the dt function. - * - * @param string $message - * The message to translate. - * @param array $arguments - * (optional) The translation arguments. - * - * @return string - * The translated message. - */ - protected function t($message, array $arguments = []) { - return dt($message, $arguments); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Controller/ViewsBulkOperationsController.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Controller/ViewsBulkOperationsController.php deleted file mode 100644 index 8f87b0629..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Controller/ViewsBulkOperationsController.php +++ /dev/null @@ -1,131 +0,0 @@ -tempStoreFactory = $tempStoreFactory; - $this->actionProcessor = $actionProcessor; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('user.private_tempstore'), - $container->get('views_bulk_operations.processor') - ); - } - - /** - * The actual page callback. - * - * @param string $view_id - * The current view ID. - * @param string $display_id - * The display ID of the current view. - */ - public function execute($view_id, $display_id) { - $view_data = $this->getTempstoreData($view_id, $display_id); - if (empty($view_data)) { - throw new NotFoundHttpException(); - } - $this->deleteTempstoreData(); - - $this->actionProcessor->executeProcessing($view_data); - if ($view_data['batch']) { - return batch_process($view_data['redirect_url']); - } - else { - return new RedirectResponse($view_data['redirect_url']->setAbsolute()->toString()); - } - } - - /** - * AJAX callback to update selection (multipage). - * - * @param string $view_id - * The current view ID. - * @param string $display_id - * The display ID of the current view. - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. - */ - public function updateSelection($view_id, $display_id, Request $request) { - $view_data = $this->getTempstoreData($view_id, $display_id); - if (empty($view_data)) { - throw new NotFoundHttpException(); - } - - $list = $request->request->get('list'); - - $op = $request->request->get('op', 'add'); - $change = 0; - - if ($op === 'add') { - foreach ($list as $bulkFormKey => $label) { - if (!isset($view_data['list'][$bulkFormKey])) { - $view_data['list'][$bulkFormKey] = $this->getListItem($bulkFormKey, $label); - $change++; - } - } - } - elseif ($op === 'remove') { - foreach ($list as $bulkFormKey => $label) { - if (isset($view_data['list'][$bulkFormKey])) { - unset($view_data['list'][$bulkFormKey]); - $change--; - } - } - } - $this->setTempstoreData($view_data); - - $response = new AjaxResponse(); - $response->setData(['change' => $change]); - return $response; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/EventSubscriber/ViewsBulkOperationsEventSubscriber.php b/sites/all/modules/contrib/views/views_bulk_operations/src/EventSubscriber/ViewsBulkOperationsEventSubscriber.php deleted file mode 100644 index 6ff289225..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/EventSubscriber/ViewsBulkOperationsEventSubscriber.php +++ /dev/null @@ -1,61 +0,0 @@ -viewData = $viewData; - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - $events[ViewsBulkOperationsEvent::NAME][] = ['provideViewData', self::PRIORITY]; - return $events; - } - - /** - * Respond to view data request event. - * - * @var \Drupal\views_bulk_operations\ViewsBulkOperationsEvent $event - * The event to respond to. - */ - public function provideViewData(ViewsBulkOperationsEvent $event) { - $view_data = $event->getViewData(); - if (!empty($view_data['table']['entity type'])) { - $event->setEntityTypeIds([$view_data['table']['entity type']]); - $event->setEntityGetter([ - 'callable' => [$this->viewData, 'getEntityDefault'], - ]); - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfigureAction.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfigureAction.php deleted file mode 100644 index ba769346a..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfigureAction.php +++ /dev/null @@ -1,176 +0,0 @@ -tempStoreFactory = $tempStoreFactory; - $this->actionManager = $actionManager; - $this->actionProcessor = $actionProcessor; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('user.private_tempstore'), - $container->get('plugin.manager.views_bulk_operations_action'), - $container->get('views_bulk_operations.processor') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'views_bulk_operations_configure_action'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $view_id = NULL, $display_id = NULL) { - - $form_data = $this->getFormData($view_id, $display_id); - - // TODO: display an error msg, redirect back. - if (!isset($form_data['action_id'])) { - return; - } - - $form['#title'] = $this->t('Configure "%action" action applied to the selection', ['%action' => $form_data['action_label']]); - - $selection = []; - if (!empty($form_data['entity_labels'])) { - $form['list'] = [ - '#theme' => 'item_list', - '#items' => $form_data['entity_labels'], - ]; - } - else { - $form['list'] = [ - '#type' => 'item', - '#markup' => $this->t('All view results'), - ]; - } - $form['list']['#title'] = $this->t('Selected @count entities:', ['@count' => $form_data['selected_count']]); - - // :D Make sure the submit button is at the bottom of the form - // and is editale from the action buildConfigurationForm method. - $form['actions']['#weight'] = 666; - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Apply'), - '#submit' => [ - [$this, 'submitForm'], - ], - ]; - $this->addCancelButton($form); - - $action = $this->actionManager->createInstance($form_data['action_id']); - - if (method_exists($action, 'setContext')) { - $action->setContext($form_data); - } - - $form_state->set('views_bulk_operations', $form_data); - $form = $action->buildConfigurationForm($form, $form_state); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function validateForm(array &$form, FormStateInterface $form_state) { - $form_data = $form_state->get('views_bulk_operations'); - - $action = $this->actionManager->createInstance($form_data['action_id']); - if (method_exists($action, 'validateConfigurationForm')) { - $action->validateConfigurationForm($form, $form_state); - } - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $form_data = $form_state->get('views_bulk_operations'); - - $action = $this->actionManager->createInstance($form_data['action_id']); - if (method_exists($action, 'submitConfigurationForm')) { - $action->submitConfigurationForm($form, $form_state); - $form_data['configuration'] = $action->getConfiguration(); - } - else { - $form_state->cleanValues(); - $form_data['configuration'] = $form_state->getValues(); - } - - $definition = $this->actionManager->getDefinition($form_data['action_id']); - if (!empty($definition['confirm_form_route_name'])) { - // Update tempStore data. - $this->setTempstoreData($form_data, $form_data['view_id'], $form_data['display_id']); - // Go to the confirm route. - $form_state->setRedirect($definition['confirm_form_route_name'], [ - 'view_id' => $form_data['view_id'], - 'display_id' => $form_data['display_id'], - ]); - } - else { - $this->deleteTempstoreData($form_data['view_id'], $form_data['display_id']); - $this->actionProcessor->executeProcessing($form_data); - $form_state->setRedirectUrl($form_data['redirect_url']); - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfirmAction.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfirmAction.php deleted file mode 100644 index dda696db2..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ConfirmAction.php +++ /dev/null @@ -1,131 +0,0 @@ -tempStoreFactory = $tempStoreFactory; - $this->actionManager = $actionManager; - $this->actionProcessor = $actionProcessor; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('user.private_tempstore'), - $container->get('plugin.manager.views_bulk_operations_action'), - $container->get('views_bulk_operations.processor') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'views_bulk_operations_confirm_action'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state, $view_id = NULL, $display_id = NULL) { - - $form_data = $this->getFormData($view_id, $display_id); - - // TODO: display an error msg, redirect back. - if (!isset($form_data['action_id'])) { - return; - } - - if (!empty($form_data['entity_labels'])) { - $form['list'] = [ - '#theme' => 'item_list', - '#items' => $form_data['entity_labels'], - ]; - } - - $form['#title'] = $this->formatPlural( - $form_data['selected_count'], - 'Are you sure you wish to perform "%action" action on 1 entity?', - 'Are you sure you wish to perform "%action" action on %count entities?', - [ - '%action' => $form_data['action_label'], - '%count' => $form_data['selected_count'], - ] - ); - - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Execute action'), - '#submit' => [ - [$this, 'submitForm'], - ], - ]; - $this->addCancelButton($form); - - $form_state->set('views_bulk_operations', $form_data); - - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $form_data = $form_state->get('views_bulk_operations'); - $this->deleteTempstoreData($form_data['view_id'], $form_data['display_id']); - $this->actionProcessor->executeProcessing($form_data); - $form_state->setRedirectUrl($form_data['redirect_url']); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ViewsBulkOperationsFormTrait.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ViewsBulkOperationsFormTrait.php deleted file mode 100644 index fba98fc60..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Form/ViewsBulkOperationsFormTrait.php +++ /dev/null @@ -1,197 +0,0 @@ -getTempstoreData($view_id, $display_id); - - // Get data needed for selected entities list. - if (!empty($form_data['list'])) { - $form_data['entity_labels'] = []; - $form_data['selected_count'] = 0; - foreach ($form_data['list'] as $item) { - $form_data['selected_count']++; - $form_data['entity_labels'][] = $item[4]; - } - } - elseif ($form_data['total_results']) { - $form_data['selected_count'] = $form_data['total_results']; - } - else { - $form_data['selected_count'] = (string) $this->t('all'); - } - - return $form_data; - } - - /** - * Calculates the bulk form key for an entity. - * - * This generates a key that is used as the checkbox return value when - * submitting the bulk form. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity to calculate a bulk form key for. - * @param mixed $base_field_value - * The value of the base field for this view result. - * - * @return string - * The bulk form key representing the entity id, language and revision (if - * applicable) as one string. - * - * @see self::loadEntityFromBulkFormKey() - */ - public static function calculateEntityBulkFormKey(EntityInterface $entity, $base_field_value) { - // We don't really need the entity ID or type ID, since only the - // base field value and language are used to select rows, but - // other modules may need those values. - $key_parts = [ - $base_field_value, - $entity->language()->getId(), - $entity->getEntityTypeId(), - $entity->id(), - ]; - - // An entity ID could be an arbitrary string (although they are typically - // numeric). JSON then Base64 encoding ensures the bulk_form_key is - // safe to use in HTML, and that the key parts can be retrieved. - $key = json_encode($key_parts); - return base64_encode($key); - } - - /** - * Get an entity list item from a bulk form key and label. - * - * @param string $bulkFormKey - * A bulk form key. - * @param mixed $label - * Entity label, string or - * \Drupal\Core\StringTranslation\TranslatableMarkup. - * - * @return array - * Entity list item. - */ - protected function getListItem($bulkFormKey, $label) { - $item = json_decode(base64_decode($bulkFormKey)); - $item[] = $label; - return $item; - } - - /** - * Initialize the current view tempstore object. - */ - protected function getTempstore($view_id = NULL, $display_id = NULL) { - if (!isset($this->viewTempstore)) { - $this->tempStoreName = 'views_bulk_operations_' . $view_id . '_' . $display_id; - $this->viewTempstore = $this->tempStoreFactory->get($this->tempStoreName); - } - return $this->viewTempstore; - } - - /** - * Gets the current view user tempstore data. - * - * @param string $view_id - * The current view ID. - * @param string $display_id - * The display ID of the current view. - */ - protected function getTempstoreData($view_id = NULL, $display_id = NULL) { - $data = $this->getTempstore($view_id, $display_id)->get($this->currentUser()->id()); - - return $data; - } - - /** - * Sets the current view user tempstore data. - * - * @param array $data - * The data to set. - * @param string $view_id - * The current view ID. - * @param string $display_id - * The display ID of the current view. - */ - protected function setTempstoreData(array $data, $view_id = NULL, $display_id = NULL) { - return $this->getTempstore($view_id, $display_id)->set($this->currentUser()->id(), $data); - } - - /** - * Deletes the current view user tempstore data. - * - * @param string $view_id - * The current view ID. - * @param string $display_id - * The display ID of the current view. - */ - protected function deleteTempstoreData($view_id = NULL, $display_id = NULL) { - return $this->getTempstore($view_id, $display_id)->delete($this->currentUser()->id()); - } - - /** - * Add a cancel button into a VBO form. - * - * @param array $form - * The form definition. - */ - protected function addCancelButton(array &$form) { - $form['actions']['cancel'] = [ - '#type' => 'submit', - '#value' => $this->t('Cancel'), - '#submit' => [ - [$this, 'cancelForm'], - ], - '#limit_validation_errors' => [], - ]; - } - - /** - * Submit callback to cancel an action and return to the view. - * - * @param array $form - * The form definition. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - */ - public function cancelForm(array &$form, FormStateInterface $form_state) { - $form_data = $form_state->get('views_bulk_operations'); - drupal_set_message($this->t('Canceled "%action".', ['%action' => $form_data['action_label']])); - $form_state->setRedirectUrl($form_data['redirect_url']); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/CancelUserAction.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/CancelUserAction.php deleted file mode 100644 index 1e73ffc30..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/CancelUserAction.php +++ /dev/null @@ -1,160 +0,0 @@ -currentUser = $currentUser; - $this->userConfig = $configFactory->get('user.settings'); - $this->moduleHandler = $moduleHandler; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('current_user'), - $container->get('config.factory'), - $container->get('module_handler') - ); - } - - /** - * {@inheritdoc} - */ - public function execute($account = NULL) { - if ($account->id() === $this->currentUser->id() && (empty($this->context['list']) || count($this->context['list'] > 1))) { - drupal_set_message($this->t('The current user account cannot be canceled in a batch operation. Select your account only or cancel it from your account page.'), 'error'); - } - elseif (intval($account->id()) === 1) { - drupal_set_message($this->t('The user 1 account (%label) cannot be canceled.', [ - '%label' => $account->label(), - ]), 'error'); - } - else { - // Allow other modules to act. - if ($this->configuration['user_cancel_method'] != 'user_cancel_delete') { - $this->moduleHandler->invokeAll('user_cancel', [ - $this->configuration, - $account, - $this->configuration['user_cancel_method'], - ]); - } - - // Cancel the account. - _user_cancel($this->configuration, $account, $this->configuration['user_cancel_method']); - - // If current user was cancelled, logout. - if ($account->id() == $this->currentUser->id()) { - _user_cancel_session_regenerate(); - } - } - } - - /** - * {@inheritdoc} - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form['user_cancel_method'] = [ - '#type' => 'radios', - '#title' => $this->t('When cancelling these accounts'), - ]; - - $form['user_cancel_method'] += user_cancel_methods(); - - // Allow to send the account cancellation confirmation mail. - $form['user_cancel_confirm'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Require email confirmation to cancel account'), - '#default_value' => FALSE, - '#description' => $this->t('When enabled, the user must confirm the account cancellation via email.'), - ]; - // Also allow to send account canceled notification mail, if enabled. - $form['user_cancel_notify'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Notify user when account is canceled'), - '#default_value' => FALSE, - '#access' => $this->userConfig->get('notify.status_canceled'), - '#description' => $this->t('When enabled, the user will receive an email notification after the account has been canceled.'), - ]; - - return $form; - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - /** @var \Drupal\user\UserInterface $object */ - return $object->access('delete', $account, $return_as_object); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/EntityDeleteAction.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/EntityDeleteAction.php deleted file mode 100644 index 9243b259c..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/Action/EntityDeleteAction.php +++ /dev/null @@ -1,39 +0,0 @@ -delete(); - return $this->t('Delete entities'); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $access = $object->access('delete', $account, TRUE); - if ($object->getEntityType() === 'node') { - $access->andIf($object->status->access('delete', $account, TRUE)); - } - return $return_as_object ? $access : $access->isAllowed(); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php deleted file mode 100644 index 13087d299..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php +++ /dev/null @@ -1,905 +0,0 @@ -viewData = $viewData; - $this->actionManager = $actionManager; - $this->actionProcessor = $actionProcessor; - $this->tempStoreFactory = $tempStoreFactory; - $this->currentUser = $currentUser; - $this->requestStack = $requestStack; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('views_bulk_operations.data'), - $container->get('plugin.manager.views_bulk_operations_action'), - $container->get('views_bulk_operations.processor'), - $container->get('user.private_tempstore'), - $container->get('current_user'), - $container->get('request_stack') - ); - } - - /** - * {@inheritdoc} - */ - public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { - parent::init($view, $display, $options); - - // Don't initialize if view has been built from VBO action processor. - if (!empty($this->view->views_bulk_operations_processor_built)) { - return; - } - - // Set this property to always have the total rows information. - $this->view->get_total_rows = TRUE; - - // Initialize VBO View Data object. - $this->viewData->init($view, $display, $this->options['relationship']); - - // Fetch actions. - $this->actions = []; - $entity_types = $this->viewData->getEntityTypeIds(); - - // Get actions only if there are any entity types set for the view. - if (!empty($entity_types)) { - foreach ($this->actionManager->getDefinitions() as $id => $definition) { - if (empty($definition['type']) || in_array($definition['type'], $entity_types, TRUE)) { - $this->actions[$id] = $definition; - } - } - } - - // Force form_step setting to TRUE due to #2879310. - $this->options['form_step'] = TRUE; - } - - /** - * Update tempstore data. - * - * This function must be called a bit later, when the view - * query has been built. Also, no point doing this on the view - * admin page. - */ - protected function updateTempstoreData() { - // Initialize tempstore object and get data if available. - $this->tempStoreData = $this->getTempstoreData($this->view->id(), $this->view->current_display); - - // Parameters subject to change (either by an admin or user action). - $variable = [ - 'batch' => $this->options['batch'], - 'batch_size' => $this->options['batch'] ? $this->options['batch_size'] : 0, - 'total_results' => $this->viewData->getTotalResults(), - 'arguments' => $this->view->args, - 'redirect_url' => Url::createFromRequest(clone $this->requestStack->getCurrentRequest()), - 'exposed_input' => $this->view->getExposedInput(), - ]; - $query = $variable['redirect_url']->getOption('query'); - if (!$query) { - $query = []; - } - $query += $variable['exposed_input']; - $variable['redirect_url']->setOption('query', $query); - - // Create tempstore data object if it doesn't exist. - if (!is_array($this->tempStoreData)) { - $this->tempStoreData = []; - - // Add constant parameters. - $this->tempStoreData += [ - 'view_id' => $this->view->id(), - 'display_id' => $this->view->current_display, - 'list' => [], - ]; - - // Add variable parameters. - $this->tempStoreData += $variable; - - $this->setTempstoreData($this->tempStoreData); - } - - // Update some of the tempstore data parameters if required. - else { - $update = FALSE; - - // Delete list if view arguments and optionally exposed filters changed. - // NOTE: this should be subject to a discussion, maybe tempstore - // should be arguments - specific? - $clear_triggers = ['arguments']; - if ($this->options['clear_on_exposed']) { - $clear_triggers[] = 'exposed_input'; - } - - foreach ($clear_triggers as $trigger) { - if ($variable[$trigger] !== $this->tempStoreData[$trigger]) { - $this->tempStoreData[$trigger] = $variable[$trigger]; - $this->tempStoreData['list'] = []; - } - unset($variable[$trigger]); - $update = TRUE; - } - - foreach ($variable as $param => $value) { - if (!isset($this->tempStoreData[$param]) || $this->tempStoreData[$param] != $value) { - $update = TRUE; - $this->tempStoreData[$param] = $value; - } - } - - if ($update) { - $this->setTempstoreData($this->tempStoreData); - } - } - - } - - /** - * Gets the current user. - * - * @return \Drupal\Core\Session\AccountInterface - * The current user. - */ - protected function currentUser() { - return $this->currentUser; - } - - /** - * {@inheritdoc} - */ - public function getCacheMaxAge() { - // @todo Consider making the bulk operation form cacheable. See - // https://www.drupal.org/node/2503009. - return 0; - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts() { - return []; - } - - /** - * {@inheritdoc} - */ - public function getCacheTags() { - return []; - } - - /** - * {@inheritdoc} - */ - public function getEntity(ResultRow $row) { - return $this->viewData->getEntity($row); - } - - /** - * {@inheritdoc} - */ - public function query() { - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['batch'] = ['default' => TRUE]; - $options['batch_size'] = ['default' => 10]; - $options['form_step'] = ['default' => TRUE]; - $options['buttons'] = ['default' => FALSE]; - $options['clear_on_exposed'] = ['default' => FALSE]; - $options['action_title'] = ['default' => $this->t('Action')]; - $options['selected_actions'] = ['default' => []]; - $options['preconfiguration'] = ['default' => []]; - return $options; - } - - /** - * {@inheritdoc} - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - // If the view type is not supported, suppress form display. - // Also display information note to the user. - if (empty($this->actions)) { - $form = [ - '#type' => 'item', - '#title' => $this->t('NOTE'), - '#markup' => $this->t('Views Bulk Operations will work only with normal entity views and contrib module views that are integrated. See \Drupal\views_bulk_operations\EventSubscriber\ViewsBulkOperationsEventSubscriber class for integration best practice.'), - '#prefix' => '
        ', - '#suffix' => '
        ', - ]; - return; - } - - $form['#attributes']['class'][] = 'views-bulk-operations-ui'; - $form['#attached']['library'][] = 'views_bulk_operations/adminUi'; - - $form['batch'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Process in a batch operation'), - '#default_value' => $this->options['batch'], - ]; - - $form['batch_size'] = [ - '#title' => $this->t('Batch size'), - '#type' => 'number', - '#min' => 1, - '#step' => 1, - '#description' => $this->t('Only applicable if results are processed in a batch operation.'), - '#default_value' => $this->options['batch_size'], - ]; - - $form['form_step'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Configuration form on new page (configurable actions)'), - '#default_value' => $this->options['form_step'], - // Due to #2879310 this setting must always be at TRUE. - '#access' => FALSE, - ]; - - $form['buttons'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Display selectable actions as buttons.'), - '#default_value' => $this->options['buttons'], - ]; - - $form['clear_on_exposed'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Clear selection when exposed filters change.'), - '#default_value' => $this->options['clear_on_exposed'], - ]; - - $form['action_title'] = [ - '#type' => 'textfield', - '#title' => $this->t('Action title'), - '#default_value' => $this->options['action_title'], - '#description' => $this->t('The title shown above the actions dropdown.'), - ]; - - $form['selected_actions'] = [ - '#tree' => TRUE, - '#type' => 'details', - '#open' => TRUE, - '#title' => $this->t('Selected actions'), - '#attributes' => ['class' => ['vbo-actions-widget']], - ]; - - // Load values for display. - $form_values = $form_state->getValue(['options', 'selected_actions']); - if (is_null($form_values)) { - $selected_actions = $this->options['selected_actions']; - $preconfiguration = $this->options['preconfiguration']; - } - else { - $selected_actions = []; - $preconfiguration = []; - foreach ($form_values as $id => $value) { - $selected_actions[$id] = $value['state'] ? $id : 0; - $preconfiguration[$id] = isset($value['preconfiguration']) ? $value['preconfiguration'] : []; - } - } - - foreach ($this->actions as $id => $action) { - $form['selected_actions'][$id]['state'] = [ - '#type' => 'checkbox', - '#title' => $action['label'], - '#default_value' => empty($selected_actions[$id]) ? 0 : 1, - '#attributes' => ['class' => ['vbo-action-state']], - ]; - - // There are problems with AJAX on this form when adding - // new elements (Views issue), a workaround is to render - // all elements and show/hide them when needed. - $form['selected_actions'][$id]['preconfiguration'] = [ - '#type' => 'fieldset', - '#title' => $this->t('Preconfiguration for "@action"', [ - '@action' => $action['label'], - ]), - '#attributes' => [ - 'data-for' => $id, - 'style' => empty($selected_actions[$id]) ? 'display: none' : NULL, - ], - ]; - - // Default label_override element. - $form['selected_actions'][$id]['preconfiguration']['label_override'] = [ - '#type' => 'textfield', - '#title' => $this->t('Override label'), - '#description' => $this->t('Leave empty for the default label.'), - '#default_value' => isset($preconfiguration[$id]['label_override']) ? $preconfiguration[$id]['label_override'] : '', - ]; - - // Load preconfiguration form if available. - if (method_exists($action['class'], 'buildPreConfigurationForm')) { - if (!isset($preconfiguration[$id])) { - $preconfiguration[$id] = []; - } - $actionObject = $this->actionManager->createInstance($id); - $form['selected_actions'][$id]['preconfiguration'] = $actionObject->buildPreConfigurationForm($form['selected_actions'][$id]['preconfiguration'], $preconfiguration[$id], $form_state); - } - } - - parent::buildOptionsForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitOptionsForm(&$form, FormStateInterface $form_state) { - $options = &$form_state->getValue('options'); - foreach ($options['selected_actions'] as $id => $action) { - if (!empty($action['state'])) { - if (isset($action['preconfiguration'])) { - $options['preconfiguration'][$id] = $action['preconfiguration']; - unset($options['selected_actions'][$id]['preconfiguration']); - } - $options['selected_actions'][$id] = $id; - } - else { - unset($options['preconfiguration'][$id]); - $options['selected_actions'][$id] = 0; - } - } - parent::submitOptionsForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function preRender(&$values) { - parent::preRender($values); - - // Add empty classes if there are no actions available. - if (empty($this->getBulkOptions())) { - $this->options['element_label_class'] .= 'empty'; - $this->options['element_class'] .= 'empty'; - $this->options['element_wrapper_class'] .= 'empty'; - $this->options['label'] = ''; - } - // If the view is using a table style, provide a placeholder for a - // "select all" checkbox. - elseif (!empty($this->view->style_plugin) && $this->view->style_plugin instanceof Table) { - // Add the tableselect css classes. - $this->options['element_label_class'] .= 'select-all'; - // Hide the actual label of the field on the table header. - $this->options['label'] = ''; - } - - } - - /** - * {@inheritdoc} - */ - public function getValue(ResultRow $row, $field = NULL) { - return ''; - } - - /** - * Form constructor for the bulk form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function viewsForm(array &$form, FormStateInterface $form_state) { - // Make sure we do not accidentally cache this form. - // @todo Evaluate this again in https://www.drupal.org/node/2503009. - $form['#cache']['max-age'] = 0; - - // Add VBO class to the form. - $form['#attributes']['class'][] = 'vbo-view-form'; - - // Add VBO front UI and tableselect libraries for table display style. - if ($this->view->style_plugin instanceof Table) { - $form['#attached']['library'][] = 'core/drupal.tableselect'; - $this->view->style_plugin->options['views_bulk_operations_enabled'] = TRUE; - } - $form['#attached']['library'][] = 'views_bulk_operations/frontUi'; - // Only add the bulk form options and buttons if - // there are results and any actions are available. - $action_options = $this->getBulkOptions(); - if (!empty($this->view->result) && !empty($action_options)) { - - // Update tempstore data. - $this->updateTempstoreData(); - - $form[$this->options['id']]['#tree'] = TRUE; - - // Get pager data if available. - if (!empty($this->view->pager) && method_exists($this->view->pager, 'hasMoreRecords')) { - $pagerData = [ - 'current' => $this->view->pager->getCurrentPage(), - 'more' => $this->view->pager->hasMoreRecords(), - ]; - } - - // Render checkboxes for all rows. - $page_selected = []; - $base_field = $this->view->storage->get('base_field'); - foreach ($this->view->result as $row_index => $row) { - $entity = $this->getEntity($row); - $bulk_form_key = self::calculateEntityBulkFormKey( - $entity, - $row->{$base_field} - ); - - $checked = isset($this->tempStoreData['list'][$bulk_form_key]); - if ($checked) { - $page_selected[] = $bulk_form_key; - } - $form[$this->options['id']][$row_index] = [ - '#type' => 'checkbox', - '#title' => $entity->label(), - '#title_display' => 'invisible', - '#default_value' => $checked, - '#return_value' => $bulk_form_key, - ]; - } - - // Ensure a consistent container for filters/operations - // in the view header. - $form['header'] = [ - '#type' => 'container', - '#weight' => -100, - ]; - - // Build the bulk operations action widget for the header. - // Allow themes to apply .container-inline on this separate container. - $form['header'][$this->options['id']] = [ - '#type' => 'container', - '#attributes' => [ - 'id' => 'vbo-action-form-wrapper', - ], - ]; - - // Display actions buttons or selector. - if ($this->options['buttons']) { - unset($form['actions']['submit']); - foreach ($action_options as $id => $label) { - $form['actions'][$id] = [ - '#type' => 'submit', - '#value' => $label, - ]; - } - } - else { - // Replace the form submit button label. - $form['actions']['submit']['#value'] = $this->t('Apply to selected items'); - - $form['header'][$this->options['id']]['action'] = [ - '#type' => 'select', - '#title' => $this->options['action_title'], - '#options' => ['' => $this->t('-- Select action --')] + $action_options, - ]; - } - - // Add AJAX functionality if actions are configurable through this form. - if (empty($this->options['form_step'])) { - $form['header'][$this->options['id']]['action']['#ajax'] = [ - 'callback' => [__CLASS__, 'viewsFormAjax'], - 'wrapper' => 'vbo-action-configuration-wrapper', - ]; - $form['header'][$this->options['id']]['configuration'] = [ - '#type' => 'container', - '#attributes' => ['id' => 'vbo-action-configuration-wrapper'], - ]; - - $action_id = $form_state->getValue('action'); - if (!empty($action_id)) { - $action = $this->actions[$action_id]; - if ($this->isActionConfigurable($action)) { - $actionObject = $this->actionManager->createInstance($action_id); - $form['header'][$this->options['id']]['configuration'] += $actionObject->buildConfigurationForm($form['header'][$this->options['id']]['configuration'], $form_state); - $form['header'][$this->options['id']]['configuration']['#config_included'] = TRUE; - } - } - } - - $display_select_all = isset($pagerData) && ($pagerData['more'] || $pagerData['current'] > 0); - // Selection info: displayed if exposed filters are set and selection - // is not cleared when they change or "select all" element display - // conditions are met. - if ((!$this->options['clear_on_exposed'] && !empty($this->view->getExposedInput())) || $display_select_all) { - - $form['header'][$this->options['id']]['multipage'] = [ - '#type' => 'details', - '#open' => FALSE, - '#title' => $this->t('Selected %count items in this view', [ - '%count' => count($this->tempStoreData['list']), - ]), - '#attributes' => [ - // Add view_id and display_id to be available for - // js multipage selector functionality. - 'data-view-id' => $this->tempStoreData['view_id'], - 'data-display-id' => $this->tempStoreData['display_id'], - 'class' => ['vbo-multipage-selector'], - 'name' => 'somename', - ], - ]; - - // Display a list of items selected on other pages. - $form['header'][$this->options['id']]['multipage']['list'] = [ - '#theme' => 'item_list', - '#title' => $this->t('Items selected on other pages:'), - '#items' => [], - '#empty' => $this->t('No selection'), - ]; - if (count($this->tempStoreData['list']) > count($page_selected)) { - foreach ($this->tempStoreData['list'] as $bulk_form_key => $item) { - if (!in_array($bulk_form_key, $page_selected)) { - $form['header'][$this->options['id']]['multipage']['list']['#items'][] = $item[4]; - } - } - $form['header'][$this->options['id']]['multipage']['clear'] = [ - '#type' => 'submit', - '#value' => $this->t('Clear'), - '#submit' => [[$this, 'clearSelection']], - '#limit_validation_errors' => [], - ]; - } - } - - // Select all results checkbox. - if ($display_select_all) { - $form['header'][$this->options['id']]['select_all'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Select all@count results in this view', [ - '@count' => $this->tempStoreData['total_results'] ? ' ' . $this->tempStoreData['total_results'] : '', - ]), - '#attributes' => ['class' => ['vbo-select-all']], - ]; - } - - // Duplicate the form actions into the action container in the header. - $form['header'][$this->options['id']]['actions'] = $form['actions']; - } - else { - // Remove the default actions build array. - unset($form['actions']); - } - - } - - /** - * AJAX callback for the views form. - * - * Currently not used due to #2879310. - */ - public static function viewsFormAjax(array $form, FormStateInterface $form_state) { - $trigger = $form_state->getTriggeringElement(); - $plugin_id = $trigger['#array_parents'][1]; - return $form['header'][$plugin_id]['configuration']; - } - - /** - * Returns the available operations for this form. - * - * @return array - * An associative array of operations, suitable for a select element. - */ - protected function getBulkOptions() { - if (!isset($this->bulkOptions)) { - $this->bulkOptions = []; - foreach ($this->actions as $id => $definition) { - // Filter out actions that weren't selected. - if (!in_array($id, $this->options['selected_actions'], TRUE)) { - continue; - } - - // Check access permission, if defined. - if (!empty($definition['requirements']['_permission']) && !$this->currentUser->hasPermission($definition['requirements']['_permission'])) { - continue; - } - - // Override label if applicable. - if (!empty($this->options['preconfiguration'][$id]['label_override'])) { - $this->bulkOptions[$id] = $this->options['preconfiguration'][$id]['label_override']; - } - else { - $this->bulkOptions[$id] = $definition['label']; - } - } - } - - return $this->bulkOptions; - } - - /** - * Submit handler for the bulk form. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function viewsFormSubmit(array &$form, FormStateInterface $form_state) { - if ($form_state->get('step') == 'views_form_views_form') { - - $action_id = $form_state->getValue('action'); - - $action = $this->actions[$action_id]; - - $this->tempStoreData['action_id'] = $action_id; - $this->tempStoreData['action_label'] = empty($this->options['preconfiguration'][$action_id]['label_override']) ? (string) $action['label'] : $this->options['preconfiguration'][$action_id]['label_override']; - $this->tempStoreData['relationship_id'] = $this->options['relationship']; - $this->tempStoreData['preconfiguration'] = isset($this->options['preconfiguration'][$action_id]) ? $this->options['preconfiguration'][$action_id] : []; - - if (!$form_state->getValue('select_all')) { - - // Update list data with the current form selection. - foreach ($form_state->getValue($this->options['id']) as $row_index => $bulkFormKey) { - if ($bulkFormKey) { - $this->tempStoreData['list'][$bulkFormKey] = $this->getListItem($bulkFormKey, $form[$this->options['id']][$row_index]['#title']); - } - else { - unset($this->tempStoreData['list'][$form[$this->options['id']][$row_index]['#return_value']]); - } - } - } - else { - // Unset the list completely. - $this->tempStoreData['list'] = []; - } - - $configurable = $this->isActionConfigurable($action); - - // Get configuration if using AJAX. - if ($configurable && empty($this->options['form_step'])) { - $actionObject = $this->actionManager->createInstance($action_id); - if (method_exists($actionObject, 'submitConfigurationForm')) { - $actionObject->submitConfigurationForm($form, $form_state); - $this->tempStoreData['configuration'] = $actionObject->getConfiguration(); - } - else { - $form_state->cleanValues(); - $this->tempStoreData['configuration'] = $form_state->getValues(); - } - } - - // Routing - determine redirect route. - - // Set default redirection due to issue #2952498. - // TODO: remove the next line when core cause is eliminated. - $redirect_route = 'views_bulk_operations.execute_batch'; - - if ($this->options['form_step'] && $configurable) { - $redirect_route = 'views_bulk_operations.execute_configurable'; - } - elseif ($this->options['batch']) { - if (!empty($action['confirm_form_route_name'])) { - $redirect_route = $action['confirm_form_route_name']; - } - } - elseif (!empty($action['confirm_form_route_name'])) { - $redirect_route = $action['confirm_form_route_name']; - } - - // Redirect if needed. - if (!empty($redirect_route)) { - $this->setTempstoreData($this->tempStoreData); - - $form_state->setRedirect($redirect_route, [ - 'view_id' => $this->view->id(), - 'display_id' => $this->view->current_display, - ]); - } - // Or process rows here and now. - else { - $this->deleteTempstoreData(); - $this->actionProcessor->executeProcessing($this->tempStoreData, $this->view); - $form_state->setRedirectUrl($this->tempStoreData['redirect_url']); - } - } - } - - /** - * Clear the form selection along with entire tempstore. - * - * @param array $form - * An associative array containing the structure of the form. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the form. - */ - public function clearSelection(array &$form, FormStateInterface $form_state) { - $this->deleteTempstoreData(); - } - - /** - * {@inheritdoc} - */ - public function viewsFormValidate(&$form, FormStateInterface $form_state) { - if ($this->options['buttons']) { - $trigger = $form_state->getTriggeringElement(); - $action_id = end($trigger['#parents']); - $form_state->setValue('action', $action_id); - } - - if (empty($form_state->getValue('action'))) { - $form_state->setErrorByName('action', $this->t('Please select an action to perform.')); - } - - // This happened once, can't reproduce but here's a safety switch. - if (!isset($this->actions[$form_state->getValue('action')])) { - $form_state->setErrorByName('action', $this->t('Form error occurred, please try again.')); - } - - if (!$form_state->getValue('select_all')) { - // Update tempstore data to make sure we have also - // results selected in other requests and validate if - // anything is selected. - $this->tempStoreData = $this->getTempstoreData(); - $selected = array_filter($form_state->getValue($this->options['id'])); - if (empty($this->tempStoreData['list']) && empty($selected)) { - $form_state->setErrorByName('', $this->t('No items selected.')); - } - } - - // Action config validation (if implemented). - if (empty($this->options['form_step']) && !empty($form['header'][$this->options['id']]['configuration']['#config_included'])) { - $action_id = $form_state->getValue('action'); - $action = $this->actions[$action_id]; - if (method_exists($action['class'], 'validateConfigurationForm')) { - $actionObject = $this->actionManager->createInstance($action_id); - $actionObject->validateConfigurationForm($form['header'][$this->options['id']]['configuration'], $form_state); - } - } - } - - /** - * {@inheritdoc} - */ - public function clickSortable() { - return FALSE; - } - - /** - * Check if an action is configurable. - */ - protected function isActionConfigurable($action) { - return (in_array('Drupal\Core\Plugin\PluginFormInterface', class_implements($action['class']), TRUE) || method_exists($action['class'], 'buildConfigurationForm')); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionManager.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionManager.php deleted file mode 100644 index 39fa43e00..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionManager.php +++ /dev/null @@ -1,183 +0,0 @@ -eventDispatcher = $eventDispatcher; - $this->setCacheBackend($cacheBackend, 'views_bulk_operations_action_info'); - } - - /** - * {@inheritdoc} - */ - protected function findDefinitions() { - $definitions = $this->getDiscovery()->getDefinitions(); - - // Incompatible actions. - $incompatible = [ - 'node_delete_action', - 'user_cancel_user_action', - ]; - - foreach ($definitions as $plugin_id => &$definition) { - $this->processDefinition($definition, $plugin_id); - if (empty($definition) || in_array($definition['id'], $incompatible)) { - unset($definitions[$plugin_id]); - } - } - $this->alterDefinitions($definitions); - foreach ($definitions as $plugin_id => $plugin_definition) { - // If the plugin definition is an object, attempt to convert it to an - // array, if that is not possible, skip further processing. - if (is_object($plugin_definition) && !($plugin_definition = (array) $plugin_definition)) { - continue; - } - // If this plugin was provided by a module that does not exist, remove the - // plugin definition. - if (isset($plugin_definition['provider']) && !in_array($plugin_definition['provider'], ['core', 'component']) && !$this->providerExists($plugin_definition['provider'])) { - unset($definitions[$plugin_id]); - } - } - return $definitions; - } - - /** - * {@inheritdoc} - * - * @param array $parameters - * Parameters of the method. Passed to alter event. - */ - public function getDefinitions(array $parameters = []) { - if (empty($parameters['nocache'])) { - $definitions = $this->getCachedDefinitions(); - } - if (!isset($definitions)) { - $this->alterParameters = $parameters; - $definitions = $this->findDefinitions($parameters); - - $this->setCachedDefinitions($definitions); - } - - return $definitions; - } - - /** - * Gets a specific plugin definition. - * - * @param string $plugin_id - * A plugin id. - * @param bool $exception_on_invalid - * (optional) If TRUE, an invalid plugin ID will throw an exception. - * @param array $parameters - * Parameters of the method. Passed to alter event. - * - * @return mixed - * A plugin definition, or NULL if the plugin ID is invalid and - * $exception_on_invalid is FALSE. - * - * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException - * Thrown if $plugin_id is invalid and $exception_on_invalid is TRUE. - */ - public function getDefinition($plugin_id, $exception_on_invalid = TRUE, array $parameters = []) { - // Loading all definitions here will not hurt much, as they're cached, - // and we need the option to alter a definition. - $definitions = $this->getDefinitions($parameters); - if (isset($definitions[$plugin_id])) { - return $definitions[$plugin_id]; - } - elseif (!$exception_on_invalid) { - return NULL; - } - - throw new PluginNotFoundException($plugin_id, sprintf('The "%s" plugin does not exist.', $plugin_id)); - } - - /** - * {@inheritdoc} - */ - public function processDefinition(&$definition, $plugin_id) { - // Only arrays can be operated on. - if (!is_array($definition)) { - return; - } - - if (!empty($this->defaults) && is_array($this->defaults)) { - $definition = NestedArray::mergeDeep($this->defaults, $definition); - } - - // Merge in defaults. - $definition += [ - 'confirm' => FALSE, - ]; - - // Add default confirmation form if confirm set to TRUE - // and not explicitly set. - if ($definition['confirm'] && empty($definition['confirm_form_route_name'])) { - $definition['confirm_form_route_name'] = 'views_bulk_operations.confirm'; - } - - } - - /** - * {@inheritdoc} - */ - protected function alterDefinitions(&$definitions) { - // Let other modules change definitions. - // Main purpose: Action permissions bridge. - $event = new Event(); - $event->alterParameters = $this->alterParameters; - $event->definitions = &$definitions; - $this->eventDispatcher->dispatch(static::ALTER_ACTIONS_EVENT, $event); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php deleted file mode 100644 index cb9d7cb32..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php +++ /dev/null @@ -1,419 +0,0 @@ -viewDataService = $viewDataService; - $this->actionManager = $actionManager; - $this->currentUser = $currentUser; - $this->moduleHandler = $moduleHandler; - } - - /** - * {@inheritdoc} - */ - public function initialize(array $view_data, $view = NULL) { - - // It may happen that the service was already initialized - // in this request (e.g. multiple Batch API operation calls). - // Clear the processing queue in such a case. - if ($this->initialized) { - $this->queue = []; - } - - if (!isset($view_data['configuration'])) { - $view_data['configuration'] = []; - } - if (!empty($view_data['preconfiguration'])) { - $view_data['configuration'] += $view_data['preconfiguration']; - } - - // Initialize action object. - $this->action = $this->actionManager->createInstance($view_data['action_id'], $view_data['configuration']); - - // Set action context. - $this->setActionContext($view_data); - - // Set entire view data as object parameter for future reference. - $this->bulkFormData = $view_data; - - // Set the current view. - $this->setView($view); - - $this->initialized = TRUE; - } - - /** - * Set the current view object. - * - * @param mixed $view - * The current view object or NULL. - */ - protected function setView($view = NULL) { - if (!is_null($view)) { - $this->view = $view; - } - else { - $this->view = Views::getView($this->bulkFormData['view_id']); - $this->view->setDisplay($this->bulkFormData['display_id']); - } - $this->view->get_total_rows = TRUE; - $this->view->views_bulk_operations_processor_built = TRUE; - if (!empty($this->bulkFormData['arguments'])) { - $this->view->setArguments($this->bulkFormData['arguments']); - } - } - - /** - * {@inheritdoc} - */ - public function getPageList($page) { - $list = []; - - $this->viewDataService->init($this->view, $this->view->getDisplay(), $this->bulkFormData['relationship_id']); - - // Set exposed filters and pager parameters. - if (!empty($this->bulkFormData['exposed_input'])) { - $this->view->setExposedInput($this->bulkFormData['exposed_input']); - } - $this->view->setItemsPerPage($this->bulkFormData['batch_size']); - $this->view->setCurrentPage($page); - $this->view->build(); - - $offset = $this->bulkFormData['batch_size'] * $page; - // If the view doesn't start from the first result, - // move the offset. - if ($pager_offset = $this->view->pager->getOffset()) { - $offset += $pager_offset; - } - $this->view->query->setLimit($this->bulkFormData['batch_size']); - $this->view->query->setOffset($offset); - $this->moduleHandler->invokeAll('views_pre_execute', [$this->view]); - $this->view->query->execute($this->view); - - $base_field = $this->view->storage->get('base_field'); - foreach ($this->view->result as $row) { - $entity = $this->viewDataService->getEntity($row); - - // We don't need entity label here. - $list[] = [ - $row->{$base_field}, - $entity->language()->getId(), - $entity->getEntityTypeId(), - $entity->id(), - ]; - } - - return $list; - } - - /** - * {@inheritdoc} - */ - public function populateQueue(array $list, array &$context = []) { - // Determine batch size and offset. - if (!empty($context)) { - $batch_size = $this->bulkFormData['batch_size']; - if (!isset($context['sandbox']['current_batch'])) { - $context['sandbox']['current_batch'] = 0; - } - $current_batch = &$context['sandbox']['current_batch']; - $offset = $current_batch * $batch_size; - } - else { - $batch_size = 0; - $current_batch = 0; - $offset = 0; - } - - if ($batch_size) { - $batch_list = array_slice($list, $offset, $batch_size); - } - else { - $batch_list = $list; - } - - $base_field_values = []; - foreach ($batch_list as $item) { - $base_field_values[] = $item[0]; - } - if (empty($base_field_values)) { - return 0; - } - - $this->view->setItemsPerPage(0); - $this->view->setCurrentPage(0); - $this->view->setOffset(0); - $this->view->initHandlers(); - - // Remove all exposed filters so we don't have any default filter - // values that could make the actual selection out of range. - if (!empty($this->view->filter)) { - foreach ($this->view->filter as $id => $filter) { - if (!empty($filter->options['exposed'])) { - unset($this->view->filter[$id]); - } - } - } - - // Build the view query. - $this->view->build(); - - // Modify the view query: determine and apply the base field condition. - $base_field = $this->view->storage->get('base_field'); - if (isset($this->view->query->fields[$base_field])) { - $base_field_alias = $this->view->query->fields[$base_field]['table'] . '.' . $this->view->query->fields[$base_field]['alias']; - } - else { - $base_field_alias = $base_field; - } - $this->view->query->addWhere(0, $base_field_alias, $base_field_values, 'IN'); - - // Rebuild the view query. - $this->view->query->build($this->view); - - // Execute the view. - $this->moduleHandler->invokeAll('views_pre_execute', [$this->view]); - $this->view->query->execute($this->view); - - // Get entities. - $this->viewDataService->init($this->view, $this->view->getDisplay(), $this->bulkFormData['relationship_id']); - foreach ($this->view->result as $row_index => $row) { - // This may return rows for all possible languages. - // Check if the current language is on the list. - $found = FALSE; - $entity = $this->viewDataService->getEntity($row); - foreach ($batch_list as $delta => $item) { - if ($row->{$base_field} === $item[0] && $entity->language()->getId() === $item[1]) { - $this->queue[] = $entity; - $found = TRUE; - unset($batch_list[$delta]); - break; - } - } - if (!$found) { - unset($this->view->result[$row_index]); - } - } - - // Extra processing when executed in a Batch API operation. - if (!empty($context)) { - if (!isset($context['sandbox']['total'])) { - if (empty($list)) { - $context['sandbox']['total'] = $this->viewDataService->getTotalResults(); - } - else { - $context['sandbox']['total'] = count($list); - } - } - // Add batch size to context array for potential use in actions. - $context['sandbox']['batch_size'] = $batch_size; - $this->setActionContext($context); - } - - if ($batch_size) { - $current_batch++; - } - - $this->setActionView(); - - return count($this->queue); - } - - /** - * Set action context if action method exists. - * - * @param array $context - * The context to be set. - */ - protected function setActionContext(array $context) { - if (isset($this->action) && method_exists($this->action, 'setContext')) { - $this->action->setContext($context); - } - } - - /** - * Sets the current view object as the executed action parameter. - */ - protected function setActionView() { - if (isset($this->action) && method_exists($this->action, 'setView')) { - $this->action->setView($this->view); - } - } - - /** - * {@inheritdoc} - */ - public function process() { - $output = []; - - // Check if all queue items are actually Drupal entities. - foreach ($this->queue as $delta => $entity) { - if (!($entity instanceof EntityInterface)) { - $output[] = $this->t('Skipped'); - unset($this->queue[$delta]); - } - } - - // Check entity type for multi-type views like search_api index. - $action_definition = $this->actionManager->getDefinition($this->bulkFormData['action_id']); - if (!empty($action_definition['type'])) { - foreach ($this->queue as $delta => $entity) { - if ($entity->getEntityTypeId() !== $action_definition['type']) { - $output[] = $this->t('Entity type not supported'); - unset($this->queue[$delta]); - } - } - } - - // Check access. - foreach ($this->queue as $delta => $entity) { - if (!$this->action->access($entity, $this->currentUser)) { - $output[] = $this->t('Access denied'); - unset($this->queue[$delta]); - } - } - - // Process queue. - $results = $this->action->executeMultiple($this->queue); - - // Populate output. - if (empty($results)) { - $count = count($this->queue); - for ($i = 0; $i < $count; $i++) { - $output[] = $this->bulkFormData['action_label']; - } - } - else { - foreach ($results as $result) { - $output[] = $result; - } - } - return $output; - } - - /** - * {@inheritdoc} - */ - public function executeProcessing(array &$data, $view = NULL) { - if ($data['batch']) { - $batch = ViewsBulkOperationsBatch::getBatch($data); - batch_set($batch); - } - else { - $list = $data['list']; - - // Populate and process queue. - if (!$this->initialized) { - $this->initialize($data, $view); - } - if (empty($list)) { - $list = $this->getPageList(0); - } - if ($this->populateQueue($list)) { - $batch_results = $this->process(); - } - - $results = ['operations' => []]; - foreach ($batch_results as $result) { - $results['operations'][] = (string) $result; - } - ViewsBulkOperationsBatch::finished(TRUE, $results, []); - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessorInterface.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessorInterface.php deleted file mode 100644 index 219cc11fb..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessorInterface.php +++ /dev/null @@ -1,56 +0,0 @@ -eventDispatcher = $eventDispatcher; - } - - /** - * {@inheritdoc} - */ - public function init(ViewExecutable $view, DisplayPluginBase $display, $relationship) { - $this->view = $view; - $this->displayHandler = $display; - $this->relationship = $relationship; - - // Get view entity types and results fetcher callable. - $event = new ViewsBulkOperationsEvent($this->getViewProvider(), $this->getData(), $view); - $this->eventDispatcher->dispatch(ViewsBulkOperationsEvent::NAME, $event); - $this->entityTypeIds = $event->getEntityTypeIds(); - $this->entityGetter = $event->getEntityGetter(); - } - - /** - * {@inheritdoc} - */ - public function getEntityTypeIds() { - return $this->entityTypeIds; - } - - /** - * Helper function to get data of the current view. - * - * @return array - * Part of views data that refers to the current view. - */ - protected function getData() { - if (!$this->data) { - $viewsData = Views::viewsData(); - if (!empty($this->relationship) && $this->relationship != 'none') { - $relationship = $this->displayHandler->getOption('relationships')[$this->relationship]; - $table_data = $viewsData->get($relationship['table']); - $this->data = $viewsData->get($table_data[$relationship['field']]['relationship']['base']); - } - else { - $this->data = $viewsData->get($this->view->storage->get('base_table')); - } - } - return $this->data; - } - - /** - * {@inheritdoc} - */ - public function getViewProvider() { - $views_data = $this->getData(); - if (isset($views_data['table']['provider'])) { - return $views_data['table']['provider']; - } - return FALSE; - } - - /** - * {@inheritdoc} - */ - public function getViewBaseField() { - $views_data = $this->getData(); - if (isset($views_data['table']['base']['field'])) { - return $views_data['table']['base']['field']; - } - throw new \Exception('Unable to get base field for the view.'); - } - - /** - * {@inheritdoc} - */ - public function getEntity(ResultRow $row) { - if (!empty($this->entityGetter['file'])) { - require_once $this->entityGetter['file']; - } - if (is_callable($this->entityGetter['callable'])) { - return call_user_func($this->entityGetter['callable'], $row, $this->relationship, $this->view); - } - else { - if (is_array($this->entityGetter['callable'])) { - if (is_object($this->entityGetter['callable'][0])) { - $info = get_class($this->entityGetter['callable'][0]); - } - else { - $info = $this->entityGetter['callable'][0]; - } - $info .= '::' . $this->entityGetter['callable'][1]; - } - else { - $info = $this->entityGetter['callable']; - } - throw new \Exception(sprintf("Entity getter method %s doesn't exist.", $info)); - } - } - - /** - * Get the total count of results on all pages. - * - * @return int - * The total number of results this view displays. - */ - public function getTotalResults() { - $total_results = NULL; - if (!empty($this->view->pager->total_items)) { - $total_results = $this->view->pager->total_items; - } - elseif (!empty($this->view->total_rows)) { - $total_results = $this->view->total_rows; - } - - return $total_results; - } - - /** - * {@inheritdoc} - */ - public function getEntityDefault(ResultRow $row, $relationship_id, ViewExecutable $view) { - if ($relationship_id == 'none') { - if (!empty($row->_entity)) { - $entity = $row->_entity; - } - } - elseif (isset($row->_relationship_entities[$relationship_id])) { - $entity = $row->_relationship_entities[$relationship_id]; - } - else { - throw new \Exception('Unexpected view result row structure.'); - } - - if ($entity instanceof TranslatableInterface && $entity->isTranslatable()) { - - // Try to find a field alias for the langcode. - // Assumption: translatable entities always - // have a langcode key. - $language_field = ''; - $langcode_key = $entity->getEntityType()->getKey('langcode'); - $base_table = $view->storage->get('base_table'); - foreach ($view->query->fields as $field) { - if ( - $field['field'] === $langcode_key && ( - empty($field['base_table']) || - $field['base_table'] === $base_table - ) - ) { - $language_field = $field['alias']; - break; - } - } - if (!$language_field) { - $language_field = $langcode_key; - } - - if (isset($row->{$language_field})) { - return $entity->getTranslation($row->{$language_field}); - } - } - - return $entity; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsViewDataInterface.php b/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsViewDataInterface.php deleted file mode 100644 index ed41b7851..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/Service/ViewsBulkOperationsViewDataInterface.php +++ /dev/null @@ -1,86 +0,0 @@ -translate($string, $args, $options); - } - - /** - * Set message function wrapper. - * - * @see \drupal_set_message() - */ - public static function message($message = NULL, $type = 'status', $repeat = TRUE) { - drupal_set_message($message, $type, $repeat); - } - - /** - * Gets the list of entities to process. - * - * Used in "all results" batch operation. - * - * @param array $data - * Processed view data. - * @param array $context - * Batch context. - */ - public static function getList(array $data, array &$context) { - // Initialize batch. - if (empty($context['sandbox'])) { - $context['sandbox']['processed'] = 0; - $context['sandbox']['page'] = 0; - $context['results'] = $data; - } - - $actionProcessor = \Drupal::service('views_bulk_operations.processor'); - $actionProcessor->initialize($data); - - // Populate queue. - $list = $actionProcessor->getPageList($context['sandbox']['page']); - $count = count($list); - - if ($count) { - foreach ($list as $item) { - $context['results']['list'][] = $item; - } - - $context['sandbox']['page']++; - $context['sandbox']['processed'] += $count; - - // There may be cases where we don't know the total number of - // results (e.g. mini pager with a search_api view) - $context['finished'] = 0; - if ($data['total_results']) { - $context['finished'] = $context['sandbox']['processed'] / $data['total_results']; - $context['message'] = static::t('Prepared @count of @total entities for processing.', [ - '@count' => $context['sandbox']['processed'], - '@total' => $data['total_results'], - ]); - } - else { - $context['message'] = static::t('Prepared @count entities for processing.', [ - '@count' => $context['sandbox']['processed'], - ]); - } - } - - } - - /** - * Save generated list to user tempstore. - * - * @param bool $success - * Was the process successfull? - * @param array $results - * Batch process results array. - * @param array $operations - * Performed operations array. - */ - public static function saveList($success, array $results, array $operations) { - if ($success) { - $results['redirect_url'] = $results['redirect_after_processing']; - unset($results['redirect_after_processing']); - $tempstore_factory = \Drupal::service('user.private_tempstore'); - $current_user = \Drupal::service('current_user'); - $tempstore_name = 'views_bulk_operations_' . $results['view_id'] . '_' . $results['display_id']; - $results['prepopulated'] = TRUE; - $tempstore_factory->get($tempstore_name)->set($current_user->id(), $results); - } - } - - /** - * Batch operation callback. - * - * @param array $data - * Processed view data. - * @param array $context - * Batch context. - */ - public static function operation(array $data, array &$context) { - // Initialize batch. - if (empty($context['sandbox'])) { - $context['sandbox']['processed'] = 0; - $context['results']['operations'] = []; - } - - // Get entities to process. - $actionProcessor = \Drupal::service('views_bulk_operations.processor'); - $actionProcessor->initialize($data); - - // Do the processing. - $count = $actionProcessor->populateQueue($data['list'], $context); - if ($count) { - $batch_results = $actionProcessor->process(); - if (!empty($batch_results)) { - // Convert translatable markup to strings in order to allow - // correct operation of array_count_values function. - foreach ($batch_results as $result) { - $context['results']['operations'][] = (string) $result; - } - } - $context['sandbox']['processed'] += $count; - - $context['finished'] = 0; - // There may be cases where we don't know the total number of - // results (probably all of them were already eliminated but - // leaving this code just in case). - if ($context['sandbox']['total']) { - $context['finished'] = $context['sandbox']['processed'] / $context['sandbox']['total']; - $context['message'] = static::t('Processed @count of @total entities.', [ - '@count' => $context['sandbox']['processed'], - '@total' => $context['sandbox']['total'], - ]); - } - else { - $context['message'] = static::t('Processed @count entities.', [ - '@count' => $context['sandbox']['processed'], - ]); - } - } - } - - /** - * Batch finished callback. - * - * @param bool $success - * Was the process successfull? - * @param array $results - * Batch process results array. - * @param array $operations - * Performed operations array. - */ - public static function finished($success, array $results, array $operations) { - if ($success) { - $operations = array_count_values($results['operations']); - $details = []; - foreach ($operations as $op => $count) { - $details[] = $op . ' (' . $count . ')'; - } - $message = static::t('Action processing results: @operations.', [ - '@operations' => implode(', ', $details), - ]); - static::message($message); - } - else { - $message = static::t('Finished with an error.'); - static::message($message, 'error'); - } - } - - /** - * Batch builder function. - * - * @param array $view_data - * Processed view data. - */ - public static function getBatch(array &$view_data) { - $current_class = get_called_class(); - - // Prepopulate results. - if (empty($view_data['list'])) { - // Redirect this batch to the processing URL and set - // previous redirect under a different key for later use. - $view_data['redirect_after_processing'] = $view_data['redirect_url']; - $view_data['redirect_url'] = Url::fromRoute('views_bulk_operations.execute_batch', [ - 'view_id' => $view_data['view_id'], - 'display_id' => $view_data['display_id'], - ]); - - $batch = [ - 'title' => static::t('Prepopulating entity list for processing.'), - 'operations' => [ - [ - [$current_class, 'getList'], - [$view_data], - ], - ], - 'progress_message' => static::t('Prepopulating, estimated time left: @estimate, elapsed: @elapsed.'), - 'finished' => [$current_class, 'saveList'], - ]; - } - - // Execute action. - else { - $batch = [ - 'title' => static::t('Performing @operation on selected entities.', ['@operation' => $view_data['action_label']]), - 'operations' => [ - [ - [$current_class, 'operation'], - [$view_data], - ], - ], - 'progress_message' => static::t('Processing, estimated time left: @estimate, elapsed: @elapsed.'), - 'finished' => [$current_class, 'finished'], - ]; - } - - return $batch; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/src/ViewsBulkOperationsEvent.php b/sites/all/modules/contrib/views/views_bulk_operations/src/ViewsBulkOperationsEvent.php deleted file mode 100644 index 44ad3e522..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/src/ViewsBulkOperationsEvent.php +++ /dev/null @@ -1,139 +0,0 @@ -provider = $provider; - $this->viewData = $viewData; - $this->view = $view; - } - - /** - * Get view provider. - * - * @return string - * The view provider - */ - public function getProvider() { - return $this->provider; - } - - /** - * Get view data. - * - * @return string - * The current view data - */ - public function getViewData() { - return $this->viewData; - } - - /** - * Get current view. - * - * @return \Drupal\views\ViewExecutable - * The current view object - */ - public function getView() { - return $this->view; - } - - /** - * Get entity type IDs displayed by the current view. - * - * @return array - * Entity type IDs. - */ - public function getEntityTypeIds() { - return $this->entityTypeIds; - } - - /** - * Get entity getter callable. - * - * @return array - * Entity getter information. - */ - public function getEntityGetter() { - return $this->entityGetter; - } - - /** - * Set entity type IDs. - * - * @param array $entityTypeIds - * Entity type IDs. - */ - public function setEntityTypeIds(array $entityTypeIds) { - $this->entityTypeIds = $entityTypeIds; - } - - /** - * Set entity getter callable. - * - * @param array $entityGetter - * Entity getter information. - */ - public function setEntityGetter(array $entityGetter) { - if (!isset($entityGetter['callable'])) { - throw new \Exception('Views Bulk Operations entity getter callable is not defined.'); - } - $this->entityGetter = $entityGetter; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Functional/ViewsBulkOperationsBulkFormTest.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Functional/ViewsBulkOperationsBulkFormTest.php deleted file mode 100644 index 74c1170eb..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Functional/ViewsBulkOperationsBulkFormTest.php +++ /dev/null @@ -1,344 +0,0 @@ -drupalCreateContentType(['type' => 'page']); - - $this->testNodes = []; - $time = $this->container->get('datetime.time')->getRequestTime(); - for ($i = 0; $i < 15; $i++) { - // Ensure nodes are sorted in the same order they are inserted in the - // array. - $time -= $i; - $this->testNodes[] = $this->drupalCreateNode([ - 'type' => 'page', - 'title' => 'Title ' . $i, - 'sticky' => FALSE, - 'created' => $time, - 'changed' => $time, - ]); - } - - } - - /** - * Helper function to test a batch process. - * - * After checking if we're on a Batch API page, - * the iterations are executed, the finished page is opened - * and browser redirects to the final destination. - * - * NOTE: As of Drupal 8.4, functional test - * automatically redirects user through all Batch API pages, - * so this function is not longer needed. - */ - protected function assertBatchProcess() { - // Get the current batch ID. - $current_url = $this->getUrl(); - $q = substr($current_url, strrpos($current_url, '/') + 1); - $this->assertEquals('batch?', substr($q, 0, 6), 'We are on a Batch API page.'); - - preg_match('#id=([0-9]+)#', $q, $matches); - $batch_id = $matches[1]; - - // Proceed with the operations. - // Assumption: all operations will be completed within a single request. - // TODO: modify code to include an option when the assumption is false. - do { - $this->drupalGet('batch', [ - 'query' => [ - 'id' => $batch_id, - 'op' => 'do_nojs', - ], - ]); - } while (FALSE); - - // Get the finished page. - $this->drupalGet('batch', [ - 'query' => [ - 'id' => $batch_id, - 'op' => 'finished', - ], - ]); - } - - /** - * Tests the VBO bulk form with simple test action. - */ - public function testViewsBulkOperationsBulkFormSimple() { - - $assertSession = $this->assertSession(); - - $this->drupalGet('views-bulk-operations-test'); - - // Test that the views edit header appears first. - $first_form_element = $this->xpath('//form/div[1][@id = :id]', [':id' => 'edit-header']); - $this->assertTrue($first_form_element, 'The views form edit header appears first.'); - - // Make sure a checkbox appears on all rows. - $edit = []; - for ($i = 0; $i < 4; $i++) { - $assertSession->fieldExists('edit-views-bulk-operations-bulk-form-' . $i, NULL, format_string('The checkbox on row @row appears.', ['@row' => $i])); - } - - // The advanced action should not be shown on the form - no permission. - $this->assertTrue(empty($this->cssSelect('select[name=views_bulk_operations_advanced_test_action]')), t('Advanced action is not selectable.')); - - // Log in as a user with 'edit any page content' permission - // to have access to perform the test operation. - $admin_user = $this->drupalCreateUser(['edit any page content']); - $this->drupalLogin($admin_user); - - // Execute the simple test action. - $edit = []; - $selected = [0, 2, 3]; - foreach ($selected as $index) { - $edit["views_bulk_operations_bulk_form[$index]"] = TRUE; - } - - // Tests: actions as buttons, label override. - $this->drupalPostForm('views-bulk-operations-test', $edit, t('Simple test action')); - - $testViewConfig = \Drupal::service('config.factory')->get('views.view.views_bulk_operations_test'); - $configData = $testViewConfig->getRawData(); - $preconfig_setting = $configData['display']['default']['display_options']['fields']['views_bulk_operations_bulk_form']['preconfiguration']['views_bulk_operations_simple_test_action']['preconfig']; - - foreach ($selected as $index) { - $assertSession->pageTextContains( - sprintf('Test action (preconfig: %s, label: %s)', - $preconfig_setting, - $this->testNodes[$index]->label() - ), - sprintf('Action has been executed on node "%s".', - $this->testNodes[$index]->label() - ) - ); - } - - // Test the select all functionality. - $edit = [ - 'select_all' => 1, - ]; - $this->drupalPostForm(NULL, $edit, t('Simple test action')); - - $assertSession->pageTextContains( - sprintf('Action processing results: Test (%d).', count($this->testNodes)), - sprintf('Action has been executed on %d nodes.', count($this->testNodes)) - ); - - } - - /** - * More advanced test. - * - * Uses the ViewsBulkOperationsAdvancedTestAction. - */ - public function testViewsBulkOperationsBulkFormAdvanced() { - - $assertSession = $this->assertSession(); - - // Log in as a user with 'edit any page content' permission - // to have access to perform the test operation. - $admin_user = $this->drupalCreateUser(['edit any page content', 'execute advanced test action']); - $this->drupalLogin($admin_user); - - // First execute the simple action to test - // the ViewsBulkOperationsController class. - $edit = [ - 'action' => 'views_bulk_operations_simple_test_action', - ]; - $selected = [0, 2]; - foreach ($selected as $index) { - $edit["views_bulk_operations_bulk_form[$index]"] = TRUE; - } - $this->drupalPostForm('views-bulk-operations-test-advanced', $edit, t('Apply to selected items')); - - $assertSession->pageTextContains( - sprintf('Action processing results: Test (%d).', count($selected)), - sprintf('Action has been executed on %d nodes.', count($selected)) - ); - - // Execute the advanced test action. - $edit = [ - 'action' => 'views_bulk_operations_advanced_test_action', - ]; - $selected = [0, 1, 3]; - foreach ($selected as $index) { - $edit["views_bulk_operations_bulk_form[$index]"] = TRUE; - } - $this->drupalPostForm('views-bulk-operations-test-advanced', $edit, t('Apply to selected items')); - - // Check if the configuration form is open and contains the - // test_config field. - $assertSession->fieldExists('edit-test-config', NULL, 'The configuration field appears.'); - - // Check if the configuration form contains selected entity labels. - // NOTE: The view pager has an offset set on this view, so checkbox - // indexes are not equal to test nodes array keys. Hence the $index + 1. - foreach ($selected as $index) { - $assertSession->pageTextContains($this->testNodes[$index + 1]->label()); - } - - $config_value = 'test value'; - $edit = [ - 'test_config' => $config_value, - ]; - $this->drupalPostForm(NULL, $edit, t('Apply')); - - // Execute action by posting the confirmation form - // (also tests if the submit button exists on the page). - $this->drupalPostForm(NULL, [], t('Execute action')); - - // If all went well and Batch API did its job, - // the next page should display results. - $testViewConfig = \Drupal::service('config.factory')->get('views.view.views_bulk_operations_test_advanced'); - $configData = $testViewConfig->getRawData(); - $preconfig_setting = $configData['display']['default']['display_options']['fields']['views_bulk_operations_bulk_form']['preconfiguration']['views_bulk_operations_advanced_test_action']['test_preconfig']; - - // NOTE: The view pager has an offset set on this view, so checkbox - // indexes are not equal to test nodes array keys. Hence the $index + 1. - foreach ($selected as $index) { - $assertSession->pageTextContains(sprintf('Test action (preconfig: %s, config: %s, label: %s)', - $preconfig_setting, - $config_value, - $this->testNodes[$index + 1]->label() - )); - } - - // Test the select all functionality with batching and entity - // property changes affecting view query results. - $edit = [ - 'action' => 'views_bulk_operations_advanced_test_action', - 'select_all' => 1, - ]; - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - $this->drupalPostForm(NULL, ['test_config' => 'unpublish'], t('Apply')); - $this->drupalPostForm(NULL, [], t('Execute action')); - // Again, take offset into account (-1). - $assertSession->pageTextContains( - sprintf('Action processing results: Test (%d).', (count($this->testNodes) - 1)), - sprintf('Action has been executed on all %d nodes.', (count($this->testNodes) - 1)) - ); - $this->assertTrue(empty($this->cssSelect('table.views-table tr')), t("The view doesn't show any results.")); - } - - /** - * View and context passing test. - * - * Uses the ViewsBulkOperationsPassTestAction. - */ - public function testViewsBulkOperationsBulkFormPassing() { - - $assertSession = $this->assertSession(); - - // Log in as a user with 'administer content' permission - // to have access to perform the test operation. - $admin_user = $this->drupalCreateUser(['bypass node access']); - $this->drupalLogin($admin_user); - - // Test with all selected and specific selection, with batch - // size greater than items per page and lower than items per page, - // using Batch API process and without it. - $cases = [ - ['batch' => FALSE, 'selection' => TRUE, 'page' => 1], - ['batch' => FALSE, 'selection' => FALSE], - ['batch' => TRUE, 'batch_size' => 3, 'selection' => TRUE, 'page' => 1], - ['batch' => TRUE, 'batch_size' => 7, 'selection' => TRUE], - ['batch' => TRUE, 'batch_size' => 3, 'selection' => FALSE], - ['batch' => TRUE, 'batch_size' => 7, 'selection' => FALSE], - ]; - - // Custom selection. - $selected = [0, 1, 3, 4]; - - $testViewConfig = \Drupal::service('config.factory')->getEditable('views.view.views_bulk_operations_test_advanced'); - $configData = $testViewConfig->getRawData(); - $configData['display']['default']['display_options']['pager']['options']['items_per_page'] = 5; - - foreach ($cases as $case) { - - // Populate form values. - $edit = [ - 'action' => 'views_bulk_operations_passing_test_action', - ]; - if ($case['selection']) { - foreach ($selected as $index) { - $edit["views_bulk_operations_bulk_form[$index]"] = TRUE; - } - } - else { - $edit['select_all'] = 1; - } - - // Update test view configuration. - $configData['display']['default']['display_options']['pager']['options']['items_per_page']++; - $configData['display']['default']['display_options']['fields']['views_bulk_operations_bulk_form']['batch'] = $case['batch']; - if (isset($case['batch_size'])) { - $configData['display']['default']['display_options']['fields']['views_bulk_operations_bulk_form']['batch_size'] = $case['batch_size']; - } - $testViewConfig->setData($configData); - $testViewConfig->save(); - - $options = []; - if (!empty($case['page'])) { - $options['query'] = ['page' => $case['page']]; - } - - $this->drupalGet('views-bulk-operations-test-advanced', $options); - $this->drupalPostForm(NULL, $edit, t('Apply to selected items')); - - // On batch-enabled processes check if provided context data is correct. - if ($case['batch']) { - if ($case['selection']) { - $total = count($selected); - } - else { - // Again, include offset. - $total = count($this->testNodes) - 1; - } - $n_batches = ceil($total / $case['batch_size']); - - for ($i = 0; $i < $n_batches; $i++) { - $processed = $i * $case['batch_size']; - $assertSession->pageTextContains(sprintf( - 'Processed %s of %s.', - $processed, - $total - ), 'The correct processed info message appears.'); - } - } - - // Passed view integrity check. - $assertSession->pageTextContains('Passed view results match the entity queue.'); - } - - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsActionProcessorTest.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsActionProcessorTest.php deleted file mode 100644 index a62a06233..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsActionProcessorTest.php +++ /dev/null @@ -1,89 +0,0 @@ -createTestNodes([ - 'page' => [ - 'count' => 20, - ], - ]); - } - - /** - * Tests general functionality of ViewsBulkOperationsActionProcessor. - * - * @covers ::getPageList - * @covers ::populateQueue - * @covers ::process - */ - public function testViewsbulkOperationsActionProcessor() { - $vbo_data = [ - 'view_id' => 'views_bulk_operations_test', - 'action_id' => 'views_bulk_operations_simple_test_action', - 'configuration' => [ - 'preconfig' => 'test', - ], - ]; - - // Test executing all view results first. - $results = $this->executeAction($vbo_data); - - // The default batch size is 10 and there are 20 result rows total - // (10 nodes, each having a translation), check messages: - $this->assertEquals('Processed 10 of 20 entities.', $results['messages'][0]); - $this->assertEquals('Processed 20 of 20 entities.', $results['messages'][1]); - $this->assertEquals(20, $results['operations']['Test']); - - // For a more advanced test, check if randomly selected entities - // have been unpublished. - $vbo_data = [ - 'view_id' => 'views_bulk_operations_test', - 'action_id' => 'views_bulk_operations_advanced_test_action', - 'preconfiguration' => [ - 'test_preconfig' => 'test', - 'test_config' => 'unpublish', - ], - ]; - - // Get list of rows to process from different view pages. - $selection = [0, 3, 6, 8, 15, 16, 18]; - $vbo_data['list'] = $this->getResultsList($vbo_data, $selection); - - // Execute the action. - $results = $this->executeAction($vbo_data); - - $nodeStorage = $this->container->get('entity_type.manager')->getStorage('node'); - - $statuses = []; - - foreach ($this->testNodesData as $id => $lang_data) { - $node = $nodeStorage->load($id); - $statuses[$id] = intval($node->status->value); - } - - foreach ($statuses as $id => $status) { - foreach ($vbo_data['list'] as $item) { - if ($item[3] == $id) { - $this->assertEquals(NodeInterface::NOT_PUBLISHED, $status); - break 2; - } - } - $this->assertEquals(NodeInterface::PUBLISHED, $status); - } - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsDataServiceTest.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsDataServiceTest.php deleted file mode 100644 index 1a004a32b..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsDataServiceTest.php +++ /dev/null @@ -1,58 +0,0 @@ -createTestNodes([ - 'page' => [ - 'languages' => ['pl', 'es', 'it', 'fr', 'de'], - 'count' => 20, - ], - ]); - } - - /** - * Tests the getEntityDefault() method. - * - * @covers ::getEntityDefault - */ - public function testViewsbulkOperationsViewDataEntityGetter() { - // Initialize and execute the test view with all items displayed. - $view = Views::getView('views_bulk_operations_test'); - $view->setDisplay('page_1'); - $view->setItemsPerPage(0); - $view->setCurrentPage(0); - $view->execute(); - - $test_data = $this->testNodesData; - foreach ($view->result as $row) { - $entity = $this->vboDataService->getEntityDefault($row, 'none', $view); - - $expected_label = $test_data[$entity->id()][$entity->language()->getId()]; - - $this->assertEquals($expected_label, $entity->label(), 'Title matches'); - if ($expected_label === $entity->label()) { - unset($test_data[$entity->id()][$entity->language()->getId()]); - if (empty($test_data[$entity->id()])) { - unset($test_data[$entity->id()]); - } - } - } - - $this->assertEmpty($test_data, 'All created entities and their translations were returned.'); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsKernelTestBase.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsKernelTestBase.php deleted file mode 100644 index 8dcf35515..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Kernel/ViewsBulkOperationsKernelTestBase.php +++ /dev/null @@ -1,297 +0,0 @@ - [], - 'display_id' => 'default', - 'preconfiguration' => [], - 'batch' => TRUE, - 'arguments' => [], - 'exposed_input' => [], - 'batch_size' => 10, - 'relationship_id' => 'none', - ]; - - /** - * Test node types already created. - * - * @var array - */ - protected $testNodesTypes; - - - /** - * Test nodes data including titles and languages. - * - * @var array - */ - protected $testNodesData; - - /** - * VBO views data service. - * - * @var \Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewDataInterface - */ - protected $vboDataService; - - /** - * {@inheritdoc} - */ - public static $modules = [ - 'user', - 'node', - 'field', - 'content_translation', - 'views_bulk_operations', - 'views_bulk_operations_test', - 'views', - 'filter', - 'language', - 'text', - 'action', - 'system', - ]; - - /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp(); - - $this->installEntitySchema('user'); - $this->installEntitySchema('node'); - $this->installSchema('node', 'node_access'); - $this->installSchema('system', 'sequences'); - $this->installSchema('system', 'key_value_expire'); - - $user = User::create(); - $user->setPassword('password'); - $user->enforceIsNew(); - $user->setEmail('email'); - $user->setUsername('user_name'); - $user->save(); - user_login_finalize($user); - - $this->installConfig([ - 'system', - 'filter', - 'views_bulk_operations_test', - 'language', - ]); - - // Get time and VBO view data services. - $this->time = $this->container->get('datetime.time'); - $this->vboDataService = $this->container->get('views_bulk_operations.data'); - } - - /** - * Create some test nodes. - * - * @param array $test_node_data - * Describes test node bundles and properties. - * - * @see Drupal\Tests\views_bulk_operations\Kernel\ViewsBulkOperationsDataServiceTest::setUp() - */ - protected function createTestNodes(array $test_node_data) { - $this->testNodesData = []; - foreach ($test_node_data as $type_name => $type_data) { - $type = NodeType::create([ - 'type' => $type_name, - 'name' => $type_name, - ]); - $type->save(); - - $count_languages = isset($type_data['languages']) ? count($type_data['languages']) : 0; - if ($count_languages) { - for ($i = 0; $i < $count_languages; $i++) { - $language = ConfigurableLanguage::createFromLangcode($type_data['languages'][$i]); - $language->save(); - } - $this->container->get('content_translation.manager')->setEnabled('node', $type_name, TRUE); - // $this->container->get('entity_type.manager')->clearCachedDefinitions(); - } - - // Create some test nodes. - $time = $this->time->getRequestTime(); - if (!isset($type_data['count'])) { - $type_data['count'] = 10; - } - for ($i = 0; $i < $type_data['count']; $i++) { - $time -= $i; - $title = 'Title ' . $i; - $node = $this->drupalCreateNode([ - 'type' => $type_name, - 'title' => $title, - 'sticky' => FALSE, - 'created' => $time, - 'changed' => $time, - ]); - $this->testNodesData[$node->id()]['en'] = $title; - - if ($count_languages) { - // It doesn't really matter to which languages we translate - // from the API point of view so some randomness should be fine. - $langcode = $type_data['languages'][rand(0, $count_languages - 1)]; - $title = 'Translated title ' . $langcode . ' ' . $i; - $translation = $node->addTranslation($langcode, [ - 'title' => $title, - ]); - $translation->save(); - $this->testNodesData[$node->id()][$langcode] = $title; - } - } - } - } - - /** - * Initialize and return the view described by $vbo_data. - * - * @param array $vbo_data - * An array of data passed to VBO Processor service. - * - * @return \Drupal\views\ViewExecutable - * The view object. - */ - protected function initializeView(array $vbo_data) { - if (!$view = Views::getView($vbo_data['view_id'])) { - throw new \Exception('Incorrect view ID provided.'); - } - if (!$view->setDisplay($vbo_data['display_id'])) { - throw new \Exception('Incorrect view display ID provided.'); - } - $view->built = FALSE; - $view->executed = FALSE; - - return $view; - } - - /** - * Get a random list of results bulk keys. - * - * @param array $vbo_data - * An array of data passed to VBO Processor service. - * @param array $deltas - * Array of result rows deltas. - * - * @return array - * List of results to process. - */ - protected function getResultsList(array $vbo_data, array $deltas) { - // Merge in defaults. - $vbo_data += static::VBO_DEFAULTS; - - $view = $this->initializeView($vbo_data); - if (!empty($vbo_data['arguments'])) { - $view->setArguments($vbo_data['arguments']); - } - if (!empty($vbo_data['exposed_input'])) { - $view->setExposedInput($vbo_data['exposed_input']); - } - - $view->setItemsPerPage(0); - $view->setCurrentPage(0); - $view->execute(); - - $this->vboDataService->init($view, $view->getDisplay(), $vbo_data['relationship_id']); - - $list = []; - $base_field = $view->storage->get('base_field'); - foreach ($deltas as $delta) { - $entity = $this->vboDataService->getEntity($view->result[$delta]); - - $list[] = [ - $view->result[$delta]->{$base_field}, - $entity->language()->getId(), - $entity->getEntityTypeId(), - $entity->id(), - ]; - } - - $view->destroy(); - - return $list; - } - - /** - * Execute an action on a specific view results. - * - * @param array $vbo_data - * An array of data passed to VBO Processor service. - */ - protected function executeAction(array $vbo_data) { - - // Merge in defaults. - $vbo_data += static::VBO_DEFAULTS; - - $view = $this->initializeView($vbo_data); - $view->get_total_rows = TRUE; - - $view->execute(); - - // Get total rows count. - $this->vboDataService->init($view, $view->getDisplay(), $vbo_data['relationship_id']); - $vbo_data['total_results'] = $this->vboDataService->getTotalResults(); - - // Get action definition and check if action ID is correct. - $action_definition = $this->container->get('plugin.manager.views_bulk_operations_action')->getDefinition($vbo_data['action_id']); - if (!isset($vbo_data['action_label'])) { - $vbo_data['action_label'] = (string) $action_definition['label']; - } - - // Populate entity list if empty. - if (empty($vbo_data['list'])) { - $context = []; - do { - $context['finished'] = 1; - $context['message'] = ''; - ViewsBulkOperationsBatch::getList($vbo_data, $context); - } while ($context['finished'] < 1); - $vbo_data = $context['results']; - } - - $summary = [ - 'messages' => [], - ]; - - // Execute the selected action. - $context = []; - do { - $context['finished'] = 1; - $context['message'] = ''; - ViewsBulkOperationsBatch::operation($vbo_data, $context); - if (!empty($context['message'])) { - $summary['messages'][] = (string) $context['message']; - } - } while ($context['finished'] < 1); - - // Add information to the summary array. - $summary += [ - 'operations' => array_count_values($context['results']['operations']), - ]; - - return $summary; - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Unit/TestViewsBulkOperationsBatch.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Unit/TestViewsBulkOperationsBatch.php deleted file mode 100644 index cbf30569b..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/src/Unit/TestViewsBulkOperationsBatch.php +++ /dev/null @@ -1,34 +0,0 @@ -container = new ContainerBuilder(); - \Drupal::setContainer($this->container); - } - - /** - * Returns a stub ViewsBulkOperationsActionProcessor that returns dummy data. - * - * @return \Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor - * A mocked action processor. - */ - public function getViewsBulkOperationsActionProcessorStub($entities_count) { - $actionProcessor = $this->getMockBuilder('Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor') - ->disableOriginalConstructor() - ->getMock(); - - $actionProcessor->expects($this->any()) - ->method('populateQueue') - ->will($this->returnValue($entities_count)); - - $actionProcessor->expects($this->any()) - ->method('process') - ->will($this->returnCallback(function () use ($entities_count) { - $return = []; - for ($i = 0; $i < $entities_count; $i++) { - $return[] = 'Some action'; - } - return $return; - })); - - return $actionProcessor; - } - - /** - * Tests the getBatch() method. - * - * @covers ::getBatch - */ - public function testGetBatch() { - $data = [ - 'list' => [[0, 'en', 'node', 1]], - 'some_data' => [], - 'action_label' => '', - ]; - $batch = TestViewsBulkOperationsBatch::getBatch($data); - $this->assertArrayHasKey('title', $batch); - $this->assertArrayHasKey('operations', $batch); - $this->assertArrayHasKey('finished', $batch); - } - - /** - * Tests the operation() method. - * - * @covers ::operation - */ - public function testOperation() { - $batch_size = 2; - $entities_count = 10; - - $this->container->set('views_bulk_operations.processor', $this->getViewsBulkOperationsActionProcessorStub($batch_size)); - - $view = new View(['id' => 'test_view'], 'view'); - $view_storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage') - ->disableOriginalConstructor() - ->getMock(); - $view_storage->expects($this->any()) - ->method('load') - ->with('test_view') - ->will($this->returnValue($view)); - - $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $entity_manager->expects($this->any()) - ->method('getStorage') - ->with('view') - ->will($this->returnValue($view_storage)); - $this->container->set('entity.manager', $entity_manager); - - $executable = $this->getMockBuilder('Drupal\views\ViewExecutable') - ->disableOriginalConstructor() - ->getMock(); - - $executable->result = []; - - // We set only $batch_size entities because - // $view->setItemsPerPage will not have effect. - for ($i = 0; $i < $batch_size; $i++) { - $row = new \stdClass(); - $row->_entity = new \stdClass(); - $executable->result[] = $row; - } - - $viewExecutableFactory = $this->getMockBuilder('Drupal\views\ViewExecutableFactory') - ->disableOriginalConstructor() - ->getMock(); - $viewExecutableFactory->expects($this->any()) - ->method('get') - ->will($this->returnValue($executable)); - $this->container->set('views.executable', $viewExecutableFactory); - - $data = [ - 'view_id' => 'test_view', - 'display_id' => 'test_display', - 'batch_size' => $batch_size, - 'list' => [], - ]; - $context = [ - 'sandbox' => [ - 'processed' => 0, - 'total' => $entities_count, - ], - ]; - - TestViewsBulkOperationsBatch::operation($data, $context); - - $this->assertEquals(count($context['results']['operations']), $batch_size); - $this->assertEquals($context['finished'], ($batch_size / $entities_count)); - } - - /** - * Tests the finished() method. - * - * @covers ::finished - */ - public function testFinished() { - $results = ['operations' => ['Some operation', 'Some operation']]; - TestViewsBulkOperationsBatch::finished(TRUE, $results, []); - $this->assertEquals(TestViewsBulkOperationsBatch::message(), 'Action processing results: Some operation (2).'); - - $results = ['operations' => ['Some operation1', 'Some operation2']]; - TestViewsBulkOperationsBatch::finished(TRUE, $results, []); - $this->assertEquals(TestViewsBulkOperationsBatch::message(), 'Action processing results: Some operation1 (1), Some operation2 (1).'); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml deleted file mode 100644 index 9a2d0057f..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml +++ /dev/null @@ -1,232 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user - - views_bulk_operations -id: views_bulk_operations_test -label: 'Views Bulk Operations Test' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 4 - offset: 0 - id: 0 - total_pages: null - tags: - previous: ‹‹ - next: ›› - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - style: - type: table - row: - type: fields - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - views_bulk_operations_bulk_form: - id: views_bulk_operations_bulk_form - table: views - field: views_bulk_operations_bulk_form - relationship: none - group_type: group - admin_label: '' - label: 'Views bulk operations' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - batch: false - batch_size: 10 - form_step: true - buttons: true - action_title: Action - selected_actions: - views_bulk_operations_simple_test_action: views_bulk_operations_simple_test_action - views_bulk_operations_advanced_test_action: views_bulk_operations_advanced_test_action - preconfiguration: - views_bulk_operations_simple_test_action: - label_override: 'Simple test action' - preconfig: 'Test setting' - views_bulk_operations_advanced_test_action: - label_override: '' - preconfig: 'Test setting' - plugin_id: views_bulk_operations_bulk_form - filters: { } - sorts: - created: - id: created - table: node_field_data - field: created - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - granularity: second - entity_type: node - entity_field: created - plugin_id: date - title: 'Views Bulk Operations Test' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: views-bulk-operations-test - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test_advanced.yml b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test_advanced.yml deleted file mode 100644 index 67805a381..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test_advanced.yml +++ /dev/null @@ -1,270 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user - - views_bulk_operations -id: views_bulk_operations_test_advanced -label: 'Views Bulk Operations Advanced Test' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - cache: - type: none - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 4 - offset: 1 - id: 0 - total_pages: null - tags: - previous: ‹‹ - next: ›› - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - style: - type: table - row: - type: fields - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: Title - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - views_bulk_operations_bulk_form: - id: views_bulk_operations_bulk_form - table: views - field: views_bulk_operations_bulk_form - relationship: none - group_type: group - admin_label: '' - label: 'Views bulk operations' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - batch: true - batch_size: 2 - form_step: true - buttons: false - action_title: Action - selected_actions: - views_bulk_operations_simple_test_action: views_bulk_operations_simple_test_action - views_bulk_operations_advanced_test_action: views_bulk_operations_advanced_test_action - views_bulk_operations_passing_test_action: views_bulk_operations_passing_test_action - preconfiguration: - views_bulk_operations_simple_test_action: - label_override: 'Simple test action' - preconfig: 'Test setting' - views_bulk_operations_advanced_test_action: - label_override: '' - test_preconfig: 'Test setting' - views_bulk_operations_passing_test_action: - label_override: '' - plugin_id: views_bulk_operations_bulk_form - filters: - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: status - plugin_id: boolean - sorts: - created: - id: created - table: node_field_data - field: created - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - granularity: second - entity_type: node - entity_field: created - plugin_id: date - title: 'Views Bulk Operations Test' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: views-bulk-operations-test-advanced - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsAdvancedTestAction.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsAdvancedTestAction.php deleted file mode 100644 index b56702688..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsAdvancedTestAction.php +++ /dev/null @@ -1,98 +0,0 @@ -view is an instance of ViewsExecutable. - if (!($this->view instanceof ViewExecutable)) { - throw new \Exception('View passed to action object is not an instance of \Drupal\views\ViewExecutable.'); - } - - // Check if context array has been passed to the action. - if (empty($this->context)) { - throw new \Exception('Context array empty in action object.'); - } - - drupal_set_message(sprintf('Test action (preconfig: %s, config: %s, label: %s)', - $this->configuration['test_preconfig'], - $this->configuration['test_config'], - $entity->label() - )); - - // Unpublish entity. - if ($this->configuration['test_config'] === 'unpublish') { - if (!$entity->isDefaultTranslation()) { - $entity = \Drupal::service('entity_type.manager')->getStorage('node')->load($entity->id()); - } - $entity->setPublished(FALSE); - $entity->save(); - } - - return 'Test'; - } - - /** - * {@inheritdoc} - */ - public function buildPreConfigurationForm(array $element, array $values, FormStateInterface $form_state) { - $element['test_preconfig'] = [ - '#title' => $this->t('Preliminary configuration'), - '#type' => 'textfield', - '#default_value' => isset($values['preconfig']) ? $values['preconfig'] : '', - ]; - return $element; - } - - /** - * Configuration form builder. - * - * @param array $form - * Form array. - * @param Drupal\Core\Form\FormStateInterface $form_state - * The form state object. - * - * @return array - * The configuration form. - */ - public function buildConfigurationForm(array $form, FormStateInterface $form_state) { - $form['test_config'] = [ - '#title' => t('Config'), - '#type' => 'textfield', - '#default_value' => $form_state->getValue('config'), - ]; - return $form; - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - return $object->access('update', $account, $return_as_object); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsPassTestAction.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsPassTestAction.php deleted file mode 100644 index c2c0eecb5..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsPassTestAction.php +++ /dev/null @@ -1,71 +0,0 @@ -context['sandbox'])) { - drupal_set_message(sprintf( - 'Processed %s of %s.', - $this->context['sandbox']['processed'], - $this->context['sandbox']['total'] - )); - } - - // Check if the passed view result rows contain the correct nodes. - if (empty($this->context['sandbox']['result_pass_error'])) { - $this->view->result = array_values($this->view->result); - foreach ($nodes as $index => $node) { - $result_node = $this->view->result[$index]->_entity; - if ( - $node->id() !== $result_node->id() || - $node->label() !== $result_node->label() - ) { - $this->context['sandbox']['result_pass_error'] = TRUE; - } - } - } - - $batch_size = isset($this->context['sandbox']['batch_size']) ? $this->context['sandbox']['batch_size'] : 0; - $total = isset($this->context['sandbox']['total']) ? $this->context['sandbox']['total'] : 0; - $processed = isset($this->context['sandbox']['processed']) ? $this->context['sandbox']['processed'] : 0; - - // On last batch display message if passed rows match. - if ($processed + $batch_size >= $total) { - if (empty($this->context['sandbox']['result_pass_error'])) { - drupal_set_message('Passed view results match the entity queue.'); - } - } - } - - /** - * {@inheritdoc} - */ - public function execute($entity = NULL) { - $this->executeMultiple([$entity]); - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - return $object->access('update', $account, $return_as_object); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsSimpleTestAction.php b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsSimpleTestAction.php deleted file mode 100644 index a8e0d3388..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/src/Plugin/Action/ViewsBulkOperationsSimpleTestAction.php +++ /dev/null @@ -1,37 +0,0 @@ -configuration['preconfig'], - $entity->label() - )); - return 'Test'; - } - - /** - * {@inheritdoc} - */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - return $object->access('update', $account, $return_as_object); - } - -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.info.yml b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.info.yml deleted file mode 100644 index a8b750f94..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: 'Views Bulk Operations test' -type: module -description: 'Support module for testing Views Bulk Operations.' -package: Testing -# core: 8.x -dependencies: - - drupal:views_bulk_operations - - drupal:node - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-2.5' -core: '8.x' -project: 'views_bulk_operations' -datestamp: 1550740388 diff --git a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.permissions.yml b/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.permissions.yml deleted file mode 100644 index 0fa2f9e7b..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/tests/views_bulk_operations_test/views_bulk_operations_test.permissions.yml +++ /dev/null @@ -1,2 +0,0 @@ -execute advanced test action: - title: 'Execute advanced test action' diff --git a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.drush.inc b/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.drush.inc deleted file mode 100644 index 4593d13f5..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.drush.inc +++ /dev/null @@ -1,207 +0,0 @@ - [ - 'description' => 'Execute an action on all results of the given view.', - 'aliases' => ['vbo-execute', 'vbo-exec'], - 'arguments' => [ - 'view_id' => 'The ID of the view to use', - 'action_id' => 'The ID of the action to execute', - ], - 'options' => [ - 'display-id' => 'ID of the display to use (default: default)', - 'args' => 'View arguments (slash is a delimeter, default: none)', - 'exposed' => 'Exposed filters (query string format)', - 'batch-size' => 'Processing batch size (default: 100)', - 'config' => 'Action configuration (query string format)', - 'debug' => 'Include additional debugging information.', - ], - 'examples' => [ - 'drush vbo-execute some_view some_action --user=1' => 'Execute some action on some view as the superuser.', - 'drush vbo-execute some_view some_action --args=arg1/arg2 --batch-size=50' => 'Execute some action on some view with arg1 and arg2 as view arguments and 50 entities processed per batch.', - 'drush vbo-execute some_view some_action --config="key1=value1&key2=value2"' => 'Execute some action on some view with action configuration set.', - ], - ], - ]; -} - -/** - * Helper function to set / get timer. - * - * @param bool $debug - * Should the function do anything at all? - * @param string $id - * ID of a specific timer span. - * - * @return mixed - * NULL or value of a specific timer if set. - */ -function _views_bulk_operations_timer($debug = TRUE, $id = NULL) { - if (!$debug) { - return; - } - - static $timers = []; - - if (!isset($id)) { - $timers['start'] = microtime(TRUE); - } - else { - if (isset($timers[$id])) { - end($timers); - do { - if (key($timers) === $id) { - return round((current($timers) - prev($timers)) * 1000, 3); - } - else { - $result = prev($timers); - } - } while ($result); - } - else { - $timers[$id] = microtime(TRUE); - } - } -} - -/** - * The vbo-exec command executtion function. - * - * @param string $view_id - * The ID of the view to use. - * @param string $action_id - * The ID of the action to execute. - */ -function drush_views_bulk_operations_execute($view_id, $action_id) { - - $debug = drush_get_option('debug', FALSE); - _views_bulk_operations_timer($debug); - - // Prepare parameters. - $arguments = drush_get_option('args', FALSE); - if ($arguments) { - $arguments = explode('/', $arguments); - } - - $qs_config = [ - 'config' => [], - 'exposed' => [], - ]; - foreach ($qs_config as $name => $value) { - $config_data = drush_get_option($name, []); - if (!empty($config_data)) { - parse_str($config_data, $qs_config[$name]); - } - } - - $vbo_data = [ - 'list' => [], - 'view_id' => $view_id, - 'display_id' => drush_get_option('display-id', 'default'), - 'action_id' => $action_id, - 'preconfiguration' => $qs_config['config'], - 'batch' => TRUE, - 'arguments' => $arguments, - 'exposed_input' => $qs_config['exposed'], - 'batch_size' => drush_get_option('batch-size', 100), - 'relationship_id' => 'none', - ]; - - // Initialize the view to check if parameters are correct. - if (!$view = Views::getView($vbo_data['view_id'])) { - drush_set_error('Incorrect view ID provided.'); - return; - } - if (!$view->setDisplay($vbo_data['display_id'])) { - drush_set_error('Incorrect view display ID provided.'); - return; - } - if (!empty($vbo_data['arguments'])) { - $view->setArguments($vbo_data['arguments']); - } - if (!empty($vbo_data['exposed_input'])) { - $view->setExposedInput($vbo_data['exposed_input']); - } - - // We need total rows count for proper progress message display. - $view->get_total_rows = TRUE; - $view->execute(); - - // Get relationship ID if VBO field exists. - $vbo_data['relationship_id'] = 'none'; - foreach ($view->field as $field) { - if ($field->options['id'] === 'views_bulk_operations_bulk_form') { - $vbo_data['relationship_id'] = $field->options['relationship']; - } - } - - // Get total rows count. - $viewDataService = \Drupal::service('views_bulk_operations.data'); - $viewDataService->init($view, $view->getDisplay(), $vbo_data['relationship_id']); - $vbo_data['total_results'] = $viewDataService->getTotalResults(); - - // Get action definition and check if action ID is correct. - try { - $action_definition = \Drupal::service('plugin.manager.views_bulk_operations_action')->getDefinition($action_id); - } - catch (\Exception $e) { - drush_set_error($e->getMessage()); - return; - } - $vbo_data['action_label'] = (string) $action_definition['label']; - - _views_bulk_operations_timer($debug, 'init'); - - // Populate entity list. - $context = []; - do { - $context['finished'] = 1; - $context['message'] = ''; - ViewsBulkOperationsBatch::getList($vbo_data, $context); - if (!empty($context['message'])) { - drush_log($context['message'], 'ok'); - } - } while ($context['finished'] < 1); - $vbo_data = $context['results']; - - _views_bulk_operations_timer($debug, 'list'); - - // Execute the selected action. - $context = []; - do { - $context['finished'] = 1; - $context['message'] = ''; - ViewsBulkOperationsBatch::operation($vbo_data, $context); - if (!empty($context['message'])) { - drush_log($context['message'], 'ok'); - } - } while ($context['finished'] < 1); - - // Output a summary message. - $operations = array_count_values($context['results']['operations']); - $details = []; - foreach ($operations as $op => $count) { - $details[] = $op . ' (' . $count . ')'; - } - drush_log(dt('Action processing results: @results.', ['@results' => implode(', ', $details)]), 'ok'); - - // Display debug information. - if ($debug) { - _views_bulk_operations_timer($debug, 'execute'); - drush_print(sprintf('Initialization time: %d ms.', _views_bulk_operations_timer($debug, 'init'))); - drush_print(sprintf('Entity list generation time: %d ms.', _views_bulk_operations_timer($debug, 'list'))); - drush_print(sprintf('Execution time: %d ms.', _views_bulk_operations_timer($debug, 'execute'))); - } -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.info.yml b/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.info.yml deleted file mode 100644 index 06015357a..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.info.yml +++ /dev/null @@ -1,13 +0,0 @@ -type: module -name: 'Views Bulk Operations' -description: 'Adds an ability to perform bulk operations on selected entities from view results.' -package: 'Views' -# core: 8.x -dependencies: - - drupal:views (>=8.4) - -# Information added by Drupal.org packaging script on 2019-02-21 -version: '8.x-2.5' -core: '8.x' -project: 'views_bulk_operations' -datestamp: 1550740388 diff --git a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.libraries.yml b/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.libraries.yml deleted file mode 100644 index bed306fba..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.libraries.yml +++ /dev/null @@ -1,20 +0,0 @@ -frontUi: - version: 1.0 - js: - js/frontUi.js: {} - css: - component: - css/frontUi.css: {} - dependencies: - - core/drupal - - core/jquery - - core/jquery.once - -adminUi: - version: 1.0 - js: - js/adminUi.js: {} - dependencies: - - core/drupal - - core/jquery - - core/jquery.once diff --git a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.module b/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.module deleted file mode 100644 index 74791d9f2..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.module +++ /dev/null @@ -1,47 +0,0 @@ - t('Views bulk operations'), - 'help' => t("Process entities returned by the view with Views Bulk Operations' actions."), - 'field' => [ - 'id' => 'views_bulk_operations_bulk_form', - ], - ]; -} - -/** - * Implements hook_help(). - */ -function views_bulk_operations_help($route_name, RouteMatchInterface $route_match) { - switch ($route_name) { - case 'help.page.views_bulk_operations': - $filepath = dirname(__FILE__) . '/README.txt'; - if (file_exists($filepath)) { - $readme = file_get_contents($filepath); - $output = '
        ' . $readme . '
        '; - - return $output; - } - } -} - -/** - * Implements hook_preprocess_THEME(). - */ -function views_bulk_operations_preprocess_views_view_table(&$variables) { - if (!empty($variables['view']->style_plugin->options['views_bulk_operations_enabled'])) { - // Add module own class to improve resistance to theme overrides. - $variables['attributes']['class'][] = 'vbo-table'; - } -} diff --git a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.routing.yml b/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.routing.yml deleted file mode 100644 index 36649a0ee..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.routing.yml +++ /dev/null @@ -1,32 +0,0 @@ -views_bulk_operations.execute_batch: - path: '/views-bulk-operations/execute/{view_id}/{display_id}' - defaults: - _controller: '\Drupal\views_bulk_operations\Controller\ViewsBulkOperationsController::execute' - _title: 'Views Bulk Operations batch starter' - requirements: - _views_bulk_operation_access: 'TRUE' -views_bulk_operations.update_selection: - path: '/views-bulk-operations/ajax/{view_id}/{display_id}' - defaults: - _controller: '\Drupal\views_bulk_operations\Controller\ViewsBulkOperationsController::updateSelection' - _title: 'Views Bulk Operations multipage AJAX' - requirements: - _views_bulk_operation_access: 'TRUE' -views_bulk_operations.execute_configurable: - path: '/views-bulk-operations/configure/{view_id}/{display_id}' - defaults: - _form: '\Drupal\views_bulk_operations\Form\ConfigureAction' - _title: 'Views Bulk Operations configure step' - requirements: - _views_bulk_operation_access: 'TRUE' - options: - _admin_route: TRUE -views_bulk_operations.confirm: - path: '/views-bulk-operations/confirm/{view_id}/{display_id}' - defaults: - _form: '\Drupal\views_bulk_operations\Form\ConfirmAction' - _title: 'Views Bulk Operations confirm execution' - requirements: - _views_bulk_operation_access: 'TRUE' - options: - _admin_route: TRUE diff --git a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.services.yml b/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.services.yml deleted file mode 100644 index ef82b7ab8..000000000 --- a/sites/all/modules/contrib/views/views_bulk_operations/views_bulk_operations.services.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - views_bulk_operations.data: - class: Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData - arguments: ['@event_dispatcher'] - views_bulk_operations.processor: - class: Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor - arguments: ['@views_bulk_operations.data', '@plugin.manager.views_bulk_operations_action', '@current_user', '@module_handler'] - plugin.manager.views_bulk_operations_action: - class: Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionManager - arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@event_dispatcher'] - views_bulk_operations.access: - class: Drupal\views_bulk_operations\Access\ViewsBulkOperationsAccess - arguments: ['@user.private_tempstore'] - tags: - - { name: access_check, applies_to: _views_bulk_operation_access } - views_bulk_operations.view_data_provider: - class: Drupal\views_bulk_operations\EventSubscriber\ViewsBulkOperationsEventSubscriber - arguments: ['@views_bulk_operations.data'] - tags: - - { name: event_subscriber } diff --git a/sites/all/modules/examples/examples/LICENSE.txt b/sites/all/modules/examples/examples/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/examples/examples/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/modules/examples/ms_ajax_form_example/LICENSE.txt b/sites/all/modules/examples/ms_ajax_form_example/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/modules/examples/ms_ajax_form_example/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/themes/contrib/adminimal_theme/LICENSE.txt b/sites/all/themes/contrib/adminimal_theme/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/sites/all/themes/contrib/adminimal_theme/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/themes/contrib/adminimal_theme/adminimal_theme.info.yml b/sites/all/themes/contrib/adminimal_theme/adminimal_theme.info.yml deleted file mode 100644 index db3dce3b2..000000000 --- a/sites/all/themes/contrib/adminimal_theme/adminimal_theme.info.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Adminimal -type: theme -description: 'Drupal administration theme with modern minimalist design.' -# core: 8.x -base theme: seven - -libraries: - - adminimal_theme/global-styling -libraries-override: - system/base: - css: - component: - /core/themes/stable/css/system/components/system-status-counter.css: /core/themes/seven/css/components/system-status-counter.css - /core/themes/stable/css/system/components/system-status-report-counters.css: /core/themes/seven/css/components/system-status-report-counters.css - /core/themes/stable/css/system/components/system-status-report-general-info.css: /core/themes/seven/css/components/system-status-report-general-info.css - -regions: - header: 'Header' - pre_content: 'Pre-content' - breadcrumb: Breadcrumb - highlighted: Highlighted - help: Help - content: Content - page_top: 'Page top' - page_bottom: 'Page bottom' - sidebar_first: 'First sidebar' -regions_hidden: - - sidebar_first - -# Information added by Drupal.org packaging script on 2019-01-20 -version: '8.x-1.4' -core: '8.x' -project: 'adminimal_theme' -datestamp: 1547996584 diff --git a/sites/all/themes/contrib/adminimal_theme/adminimal_theme.libraries.yml b/sites/all/themes/contrib/adminimal_theme/adminimal_theme.libraries.yml deleted file mode 100644 index 4f38fbcda..000000000 --- a/sites/all/themes/contrib/adminimal_theme/adminimal_theme.libraries.yml +++ /dev/null @@ -1,11 +0,0 @@ -global-styling: - version: VERSION - css: - base: - css/adminimal.css: {} - -custom-styling: - version: VERSION - css: - theme: - public://adminimal-custom.css: {} diff --git a/sites/all/themes/contrib/adminimal_theme/adminimal_theme.theme b/sites/all/themes/contrib/adminimal_theme/adminimal_theme.theme deleted file mode 100644 index ee7f3b1e1..000000000 --- a/sites/all/themes/contrib/adminimal_theme/adminimal_theme.theme +++ /dev/null @@ -1,106 +0,0 @@ - $old_css_path]), 'warning'); - } - - $form['adminimal_custom'] = [ - '#type' => 'fieldset', - '#title' => t('Adminimal Customization'), - '#weight' => -10, - ]; - - $form['adminimal_custom']['custom_css'] = [ - '#type' => 'checkbox', - '#title' => t('Use "adminimal-custom.css"'), - '#description' => t('Include adminimal-custom.css file to override or add custom css code without subthememing/hacking Adminimal Theme.'), - '#default_value' => theme_get_setting('custom_css'), - ]; - - $form['adminimal_custom']['adminimal_custom_check'] = [ - '#type' => 'fieldset', - '#title' => t('Custom CSS file check'), - '#weight' => 50, - '#states' => [ - // Hide the settings when the cancel notify checkbox is disabled. - 'visible' => [ - ':input[name="custom_css"]' => ['checked' => TRUE], - ], - ], - ]; - - if (file_exists($custom_css_path)) { - $form['adminimal_custom']['adminimal_custom_check']['custom_css_description'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['messages', 'messages--status'], - ], - 'message' => [ - '#markup' => t('Custom CSS file Found in: @css', ['@css' => $custom_css_dir]), - ], - ]; - } - else { - $form['adminimal_custom']['adminimal_custom_check']['custom_css_not_found'] = [ - '#type' => 'container', - '#attributes' => [ - 'class' => ['messages', 'messages--error'], - ], - 'message' => [ - '#markup' => t('Custom CSS file not found. You must create the @css file manually.', ['@css' => $custom_css_dir]), - ], - ]; - } -} diff --git a/sites/all/themes/contrib/adminimal_theme/composer.json b/sites/all/themes/contrib/adminimal_theme/composer.json deleted file mode 100644 index e5c2b6515..000000000 --- a/sites/all/themes/contrib/adminimal_theme/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "drupal/adminimal_theme", - "description": "Drupal administration theme with modern minimalist design.", - "type": "drupal-theme", - "homepage": "https://www.drupal.org/project/adminimal_theme", - "support": { - "issues": "https://www.drupal.org/project/issues/adminimal_theme" - }, - "license": "GPL-2.0+" -} diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_breadcrumbs.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_breadcrumbs.yml deleted file mode 100644 index a39e6831b..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_breadcrumbs.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - adminimal_theme -id: adminimal_theme_breadcrumbs -theme: adminimal_theme -region: breadcrumb -weight: 0 -provider: null -plugin: system_breadcrumb_block -settings: - id: system_breadcrumb_block - label: Breadcrumbs - provider: system - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_content.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_content.yml deleted file mode 100644 index e864c1312..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_content.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - adminimal_theme -id: adminimal_theme_content -theme: adminimal_theme -region: content -weight: 0 -provider: null -plugin: system_main_block -settings: - id: system_main_block - label: 'Main page content' - provider: system - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_help.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_help.yml deleted file mode 100644 index 2c677a2b2..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_help.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - help - theme: - - adminimal_theme -id: adminimal_theme_help -theme: adminimal_theme -region: help -weight: 0 -provider: null -plugin: help_block -settings: - id: help_block - label: Help - provider: help - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_local_actions.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_local_actions.yml deleted file mode 100644 index 5a2b9b6c1..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_local_actions.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - adminimal_theme -id: adminimal_theme_local_actions -theme: adminimal_theme -region: content -weight: -10 -provider: null -plugin: local_actions_block -settings: - id: local_actions_block - label: 'Primary admin actions' - provider: core - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_login.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_login.yml deleted file mode 100644 index 40e285639..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_login.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user - theme: - - adminimal_theme -id: adminimal_theme_login -theme: adminimal_theme -region: content -weight: 10 -provider: null -plugin: user_login_block -settings: - id: user_login_block - label: 'User login' - provider: user - label_display: visible -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_messages.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_messages.yml deleted file mode 100644 index 013372a3b..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_messages.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - adminimal_theme -id: adminimal_theme_messages -theme: adminimal_theme -region: highlighted -weight: 0 -provider: null -plugin: system_messages_block -settings: - id: system_messages_block - label: 'Status messages' - provider: system - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_page_title.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_page_title.yml deleted file mode 100644 index b4b0a2e1b..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_page_title.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - adminimal_theme -id: adminimal_theme_page_title -theme: adminimal_theme -region: header -weight: -30 -provider: null -plugin: page_title_block -settings: - id: page_title_block - label: 'Page title' - provider: core - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_primary_local_tasks.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_primary_local_tasks.yml deleted file mode 100644 index 3701ac468..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_primary_local_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - adminimal_theme -id: adminimal_theme_primary_local_tasks -theme: adminimal_theme -region: header -weight: 0 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: 'Primary tabs' - provider: core - label_display: '0' - primary: true - secondary: false -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_secondary_local_tasks.yml b/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_secondary_local_tasks.yml deleted file mode 100644 index 9590b19ca..000000000 --- a/sites/all/themes/contrib/adminimal_theme/config/optional/block.block.adminimal_theme_secondary_local_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - adminimal_theme -id: adminimal_theme_secondary_local_tasks -theme: adminimal_theme -region: pre_content -weight: 0 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: 'Secondary tabs' - provider: core - label_display: '0' - primary: false - secondary: true -visibility: { } diff --git a/sites/all/themes/contrib/adminimal_theme/css/adminimal.css b/sites/all/themes/contrib/adminimal_theme/css/adminimal.css deleted file mode 100644 index c514df1f2..000000000 --- a/sites/all/themes/contrib/adminimal_theme/css/adminimal.css +++ /dev/null @@ -1,844 +0,0 @@ -/* Adminimal Theme overrides file. All selectors must start with ".adminimal" */ - -/* Import the Open Sans webfont from Google CDN */ -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTRsxEYwM7FgeyaSgU71cLG0.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/uYKcPVoh6c5R0NpdEY5A-Q.woff) format('woff'); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 600; - src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNShsxEYwM7FgeyaSgU71cLG0.woff) format('woff'); -} - -/*html { - zoom: 1.1; -}*/ - -/* Fix drag and drop offset in ckeditor toolbar configuration */ -/*.adminimal .ckeditor-toolbar-configuration.js-form-wrapper.form-wrapper { - zoom: 0.9; -}*/ - -body.adminimal { - font: normal 81.3%/1.538em "Open Sans", sans-serif; -} - -.adminimal h1, -.adminimal .heading-a { - color: #fff; - font-size: 2.35em; - font-weight: 300; - line-height: 1.2em; - margin-bottom: 1rem; -} - -.adminimal .content-header { - background-color: #333; - padding: 1rem 0 0; -} - -.adminimal thead th { - border: none; - color: #909090; - font-size: 0.91rem; - font-weight: 500; - text-transform: none; -} - -.adminimal thead th.is-active { - background: #fff; - border: 1px solid #e6e4df; - border-bottom: 1px solid #fff; -} - -.adminimal th.is-active > a, -.adminimal th.is-active > a:hover { - color: #333; -} - -.adminimal th > a:hover { - text-decoration: underline; -} - -.adminimal th > a:after, -.adminimal th.is-active > a:after { - display: none; -} - -.adminimal thead > tr { - border-bottom: 1px solid #e6e4df; -} - -.adminimal .tabs__tab { - border: 1px solid transparent; -} - -.adminimal .tabs.primary { - margin: 0; -} - -.adminimal .tabs.primary .tabs__tab.is-active { - border-radius: 0; /* LTR */ -} - -[dir="rtl"] .adminimal .tabs.primary .tabs__tab.is-active { - border-top-right-radius: 0; -} - -.adminimal .is-collapse-enabled .tabs__trigger { - border-radius: 0; /* LTR */ -} - -[dir="rtl"] .is-collapse-enabled .tabs__trigger { - border-left: 1px solid transparent; - border-radius: 0; -} - -.adminimal .is-open .tabs__tab.is-active { - border-bottom: 1px solid transparent; -} - -.adminimal .is-horizontal .tabs__tab { - transition: all, 0.3s; -} - -.adminimal .is-horizontal .tabs__tab + .tabs__tab, -[dir="rtl"] .adminimal .is-horizontal .tabs__tab + .tabs__tab, -.adminimal .is-horizontal .tabs.primary .tabs__tab:first-child, -[dir="rtl"] .adminimal .is-horizontal .tabs.primary .tabs__tab:first-child, -.adminimal .is-horizontal .tabs.primary .tabs__tab:last-child, -[dir="rtl"] .adminimal .is-horizontal .tabs.primary .tabs__tab:last-child, -.adminimal .is-horizontal .tabs__tab.is-active, -.adminimal .is-horizontal .tabs.primary .tabs__tab.is-active, -[dir="rtl"] .adminimal .is-horizontal .tabs.primary .tabs__tab.is-active { - border-radius: 0; - border: none; - margin-left: 0; - margin-right: 0; -} - -.adminimal .is-collapse-enabled .tabs:before, -.adminimal .is-horizontal .tabs:before { - display: none; -} - -.adminimal .tabs__tab, -.adminimal .tabs__tab:hover, -.adminimal .tabs__tab:focus, -.adminimal .tabs.primary a:focus { - background: transparent; -} - -.adminimal .is-horizontal .tabs.primary a:hover { - text-decoration: underline; -} - -.adminimal nav.is-horizontal.is-collapsible.position-container.is-horizontal-enabled ul.tabs.primary { - background: #ebebeb; - margin-left: -2.1rem; - margin-right: -2.1rem; - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -.adminimal .is-horizontal .tabs.primary .tabs__tab:first-child.is-active { - box-shadow: -0.5rem 0px 0 #fff; -} - -.adminimal .is-horizontal ul.tabs.secondary li:first-of-type { - margin-left: 0; -} - -[dir="rtl"] .adminimal .is-horizontal ul.tabs.secondary li:first-of-type { - margin-left: 1em; -} - -[dir="rtl"] .adminimal .is-horizontal ul.tabs.secondary li:first-of-type { - margin-right: 0; -} - -.adminimal .vertical-tabs { - background: #f2f2f0; - border-radius: 0; - border: 1px solid #b5b5b5; -} - -.adminimal .vertical-tabs__panes { - border: none; -} - -.adminimal .vertical-tabs__menu { - border-bottom: none; -} - -.adminimal .vertical-tabs__menu-item a { - border: none; - transition: all, 0.2s; -} - -.adminimal .vertical-tabs__menu-item a:hover, -.adminimal .vertical-tabs__menu-item a:focus { - background: #d2e7f4; -} - -.adminimal .vertical-tabs__menu-item.is-selected a:hover, -.adminimal .vertical-tabs__menu-item.is-selected a:focus { - background: #fcfcfa; -} - -.adminimal .vertical-tabs__menu-item.is-selected { - border: none; - box-shadow: none; -} - -.adminimal .button:not(.media-library-item__remove) { - background-image: none; -} - -.adminimal .button:not(.media-library-item__remove):hover, -.adminimal .button:not(.media-library-item__remove):focus { - background-image: none; -} - -.adminimal .button { - background-color: #f9f9f9; - border-radius: 0; - text-shadow: none; - transition: all, 0.2s; -} - -.adminimal .button:hover, -.adminimal .button:focus { - background-color: #FFFFFF; - border-color: #008ee6; -} - -.adminimal .button-action:before { - display: none; -} - -.adminimal .action-links { - margin: 2em 0; -} - -.adminimal .button--primary { - background: #0071b8; - border-color: #0071b8; -} - -.adminimal .button--primary:hover, -.adminimal .button--primary:focus { - background-image: none; - background-color: #1f86c7; - border-color: #1f86c7; -} - -.adminimal .button:focus { - box-shadow: none; - border-color: rgb(104, 163, 207); - outline: rgb(193, 224, 255) solid 2px; -} - -.adminimal .button--small:focus { - outline: none; -} - -.adminimal .action-links .button--primary { - background: #fff; - border: 2px solid #327ebd; - border-radius: 999px; - color: #327ebd; - font-family: sans-serif; - font-size: 14px; - font-weight: 600; - padding: 0.4rem 1.33rem; -} - -.adminimal .action-links .button--primary:hover, -.adminimal .action-links .button--primary:focus { - background-color: #327ebd; - background-image: none; - box-shadow: none; - color: #fff; -} - -.adminimal .action-links .button--primary:focus { - border-color: #08639b; - outline: none; -} - -.adminimal .button--small { - background: #fff; - border-color: #cacaca; - border-radius: 0.2rem; - font-weight: 500; -} - -.adminimal .button--danger { - text-decoration: none; - background-color: transparent; -} - -.adminimal .button--danger:hover { - text-decoration: underline; -} - -.adminimal select { - min-height: 28px; - text-shadow: none; -} - -@media screen and (-webkit-min-device-pixel-ratio: 0) { - .adminimal select { - border-radius: 0; - background: url(../images/caret-down.svg) no-repeat 98% 64% #fcfcfa; - } - - .adminimal select:focus, - .adminimal select:hover { - background: url(../images/caret-down.svg) no-repeat 98% 64% #fcfcfa; - } - .adminimal select:focus { - border-color: #68a3cf; - color: #000; - outline: 2px solid #C1E0FF; - outline-offset: 0; - } -} - -.js .adminimal .form-actions .dropbutton .dropbutton-action > * { - text-shadow: none; -} - -.js .adminimal .form-actions .dropbutton .dropbutton-action > *, -.js .adminimal .dropbutton-widget .dropbutton-action a, -.js .adminimal .dropbutton-widget .dropbutton-action input, -.js .adminimal .dropbutton-widget .dropbutton-action button, -.js .adminimal .dropbutton-multiple .dropbutton-widget, -.js .adminimal .dropbutton-widget .dropbutton-action input, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button { - border-radius: 0; - box-shadow: none; - font-weight: 500; -} - -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:focus, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:focus, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:focus { - box-shadow: none; -} - -.js .adminimal .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button, -.adminimal .form-actions .dropbutton .secondary-action { - border-color: #ffffff; -} - -.js .adminimal .dropbutton-multiple .dropbutton-widget { - background: #fcfcfa; - background-image: none; - text-shadow: none; -} - -.js .adminimal .form-actions .dropbutton-multiple .dropbutton-widget { - background-color: #0071b8; -} - -.js .adminimal .dropbutton-multiple .dropbutton-widget { - text-shadow: none; -} - -.js .adminimal .dropbutton-multiple.open .dropbutton-action:first-child a, -.js .adminimal .dropbutton-multiple.open .dropbutton-action:first-child .button { - border-radius: 0; -} - -.js .adminimal .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:hover, -.js .adminimal .form-actions .dropbutton-wrapper .dropbutton-widget .dropbutton-action .button:focus { - background-image: none; - box-shadow: none; -} - -.adminimal label { - margin: 0 0 0.2em; -} - -.adminimal input.form-autocomplete, -.adminimal input.form-text, -.adminimal input.form-tel, -.adminimal input.form-email, -.adminimal input.form-url, -.adminimal input.form-search, -.adminimal input.form-number, -.adminimal input.form-color, -.adminimal input.form-file, -.adminimal input.form-date, -.adminimal input.form-time, -.adminimal textarea.form-textarea { - box-shadow: none; - border-radius: 0; -} - -.adminimal .form-text:focus, -.adminimal .form-tel:focus, -.adminimal .form-email:focus, -.adminimal .form-url:focus, -.adminimal .form-search:focus, -.adminimal .form-number:focus, -.adminimal .form-color:focus, -.adminimal .form-file:focus, -.adminimal .form-textarea:focus, -.adminimal .form-date:focus, -.adminimal .form-time:focus { - border-color: #68A3CF; - outline: 2px solid #C1E0FF; - outline-offset: 0px; - color: #000; -} - -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action a:focus, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action button:focus, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-action input:focus, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:hover, -.js .adminimal .dropbutton-wrapper .dropbutton-widget .dropbutton-toggle button:focus { - background-image:none; - background-color: #ffffff; -} - -.adminimal .link.tabledrag-toggle-weight { - margin-bottom: 0.3em; -} - -.adminimal .toolbar { - font-family: "Open Sans"; -} - -.adminimal.toolbar-fixed.toolbar-vertical { - padding-top: 32px !important; -} - -.adminimal .toolbar a { - transition: all, 0.2s; -} - -.adminimal .toolbar .toolbar-bar { - background-color: #2d2d2d; - box-shadow: none; -} - -.adminimal .toolbar .toolbar-menu { - background: #333; -} - -.adminimal .toolbar .toolbar-tray-vertical { - border: none; - box-shadow: none; -} - -.adminimal .toolbar-tray a { - color: #bbbbbb; -} - -.adminimal .toolbar .toolbar-bar .toolbar-tab > .toolbar-item { - font-weight: 600; -} - -.adminimal .toolbar .toolbar-bar .toolbar-item { - color: #bebebe; -} - -.adminimal .toolbar .toolbar-bar .toolbar-tab > .toolbar-item:hover { - background-color: #2d2d2d; - background-image: none; - color: #fff; - text-decoration: none; -} - -.adminimal .toolbar .toolbar-bar .toolbar-tab > .toolbar-item.is-active, -.adminimal .toolbar .toolbar-bar .toolbar-tab > .toolbar-item:focus { - background-image: none; - background-color: #333; - text-decoration: none; -} - -.adminimal .toolbar .toolbar-tray-horizontal .menu-item + .menu-item, -[dir="rtl"] .adminimal .toolbar .toolbar-tray-horizontal .menu-item + .menu-item, -.adminimal .toolbar .toolbar-tray-horizontal .menu-item:last-child { - border-left: none; /* LTR */ - border-right: none; -} - -.adminimal .toolbar .toolbar-tray .menu-item--active-trail > .toolbar-box a, -.adminimal .toolbar .toolbar-tray a.is-active { - color: #bbb; - font-weight: 500; - text-decoration: none; -} - -.adminimal .toolbar .toolbar-tray-vertical .menu-item + .menu-item { - border: 0 none; -} - -.adminimal .toolbar .toolbar-tray { - background-color: #333; - box-shadow: -2px 2px 12px rgba(0,0,0,0.85); -} - -.adminimal .toolbar .toolbar-tray-horizontal { - border-bottom: 1px solid #333; - box-shadow: none; -} - -.adminimal .toolbar .toolbar-toggle-orientation { - background-color: #333; -} - -.adminimal .toolbar .toolbar-icon.toolbar-handle:focus { - background-color: transparent; -} - -.adminimal .toolbar .toolbar-icon.toolbar-handle:before { - background-image: url(../images/chevron-disc-down.svg); -} - -.adminimal .toolbar .toolbar-icon.toolbar-handle:hover:before { - background-image: url(../images/chevron-disc-down-hover.svg); -} - -.adminimal .toolbar .toolbar-icon.toolbar-handle.open:before { - background-image: url(../images//chevron-disc-up.svg); -} - -.adminimal .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle:before { - background-image: url(../images/chevron-disc-down.svg); -} - -.adminimal .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle:hover:before { - background-image: url(../images/chevron-disc-down-hover.svg); -} - -.adminimal .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle.open:before { - background-image: url(../images//chevron-disc-up.svg); -} - -.adminimal .toolbar-tray-horizontal a:focus, .toolbar-box a:focus { - background: transparent; -} - -.adminimal .toolbar .toolbar-tray-vertical .toolbar-menu a { - color: #bbb; -} - -.adminimal .toolbar .toolbar-tray-vertical .toolbar-menu a:hover { - color: #fff; -} - -.adminimal .toolbar .toolbar-tray-vertical .toolbar-menu ul ul { - border: none; -} - -.adminimal .toolbar .toolbar-tray-horizontal .toolbar-toggle-orientation { - border: none; -} - -/* Style checkbox and radio buttons */ -input[type=checkbox], -input[type=radio], -input[type=checkbox]#edit-delete { - display: inline-block; - position: relative; - top: 3px; - margin-right: 0.25em; - padding: 0; - background: #fff; - border: 1px solid #b5b5b5; - width: 16px !important; - height: 16px !important; - -webkit-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - transition: background 0.5s ease; - outline: none; -} - -.adminimal-theme .location .form-item input.form-checkbox { - display: inline-block; - width: 16px; -} - -input[type=checkbox]#edit-delete { - margin-bottom: 0; -} - -input[type=radio] { - border-radius: 50%; -} - -input[type=checkbox]:hover, -input[type=checkbox]:focus, -input[type=radio]:hover, -input[type=radio]:focus { - border-color: #0074bd; - cursor: pointer; -} - -input[type=checkbox]#edit-delete:hover, -input[type=checkbox]#edit-delete:focus { - border-color: #d01616; - cursor: pointer; -} - -input[type=checkbox]:checked, -input[type=checkbox]:disabled:checked, -input[type=checkbox].error:checked, -input[type=checkbox].error:focus:checked, -input[type=radio]:checked, -input[type=radio]:disabled:checked, -input[type=radio].error:checked, -input[type=radio].error:focus:checked { - background: #0074bd; - box-shadow: inset 0 0 0 3px #fff; -} - -input[type=checkbox]#edit-delete:checked, -input[type=checkbox]#edit-delete:disabled:checked { - background: #D01616; - box-shadow: inset 0 0 0 3px #fff; -} - -input[type=checkbox]:disabled, -input[type=radio]:disabled { - opacity: .5; - background: #e2e2e2; -} - -input[type=checkbox]#edit-delete:disabled { - opacity: .5; - background: #e88181; -} - -input[type=checkbox]:disabled:hover { - border-color: #b5b5b5; - cursor: default; -} - -input[type=checkbox]:disabled:hover, -input[type=radio]:disabled:hover { - border-color: #b5b5b5; - cursor: default; -} - -/* in Chrome + Safari + Opera + Mozilla */ -@supports (-webkit-appearance:none) { - input[type="checkbox"], - input[type="radio"], - input[type="checkbox"]#edit-delete { - -webkit-appearance: none; - } -} - -/* in Mozilla */ -@supports (-moz-appearance:none) { - input[type="checkbox"], - input[type="radio"], - input[type="checkbox"]#edit-delete { - -moz-appearance:none; - } -} - -.adminimal .dropbutton-single .dropbutton-action a { - border-radius: 0 !important; - background-image: none; - background: #f5f5f2; -} - -.adminimal .ui-dialog .ui-dialog-titlebar { - border-radius: 0; - background: #333; -} - -.adminimal .ui-dialog .ui-widget-content.ui-dialog-buttonpane { - border-radius: 0; -} - -.adminimal .ui-dialog .ui-dialog-titlebar, -.adminimal .ui-dialog { - outline: none; -} - -.adminimal .ui-dialog { - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); -} - -.adminimal .ui-button-icon-only.ui-dialog-titlebar-close.ui-state-active, -.adminimal .ui-button-icon-only.ui-dialog-titlebar-close.ui-widget-content .ui-state-active { - background: transparent; - border-color: transparent; - color: transparent; -} - -.adminimal .ui-dialog .ui-dialog-titlebar-close { - opacity: 0.5; - transition: all, 0.2s; -} - -.adminimal .ui-dialog .ui-dialog-titlebar-close:hover { - opacity: 1; -} - -.adminimal .messages { - margin: 1rem 0 1rem 0; - border-width: 1px 0 1px 0; - border-radius: 0; - background-color: transparent; - box-shadow: none; - background-size: 1.3rem; - background-position: 5px 50%; -} - -.adminimal .messages--error { - border-color: #e32700; -} - -.adminimal .messages--warning { - border-color: #e29700; -} - -.adminimal .messages--status { - border-color: #73b355; -} - -.adminimal .cke_top, -.adminimal .cke_bottom { - background: #f7f7f7; - background-image: none; - box-shadow: none; -} - -.adminimal .filter-wrapper { - background: #f7f7f7; -} - -.adminimal .cke_ltr .cke_button:first-child, -.adminimal .cke_rtl .cke_button:last-child, -.adminimal .cke_toolgroup { - border-radius: 0; -} - -/* Main menu icons. */ -.adminimal .toolbar-icon-system-admin-content:active:before, -.adminimal .toolbar-icon-system-admin-content.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/file.svg); -} - -.adminimal .toolbar-icon-system-admin-structure:active:before, -.adminimal .toolbar-icon-system-admin-structure.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/orgchart.svg); -} - -.adminimal .toolbar-icon-system-themes-page:active:before, -.adminimal .toolbar-icon-system-themes-page.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/paintbrush.svg); -} - -.adminimal .toolbar-icon-entity-user-collection:active:before, -.adminimal .toolbar-icon-entity-user-collection.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/people.svg); -} - -.adminimal .toolbar-icon-system-modules-list:active:before, -.adminimal .toolbar-icon-system-modules-list.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/puzzlepiece.svg); -} - -.adminimal .toolbar-icon-system-admin-config:active:before, -.adminimal .toolbar-icon-system-admin-config.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/wrench.svg); -} - -.adminimal .toolbar-icon-system-admin-reports:active:before, -.adminimal .toolbar-icon-system-admin-reports.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/barchart.svg); -} - -.adminimal .toolbar-icon-help-main:active:before, -.adminimal .toolbar-icon-help-main.is-active:before { - background-image: url(/core/themes/stable/images/core/icons/787878/questionmark-disc.svg); -} - -/* Main menu icons end. */ -.adminimal.path-batch .layout-container { - padding-top: 1.3rem; -} - -/* Module: Views */ -.adminimal .views-display-top { - background-color: #fafafa; - border-bottom: 1px solid #f2f2f2; -} - -.adminimal .views-displays { - border: 1px solid #e8e8e8; -} - -.adminimal .views-admin .form-edit .form-actions { - border-color: #e8e8e8; - background-color: #fafafa; -} - -.adminimal .views-ui-display-tab-bucket .views-display-setting:nth-of-type(even) { - background-color: inherit; -} - -.adminimal .views-displays .tabs.secondary a { - border-radius: 0; -} - -.adminimal .view-preview-form__title { - background-color: #fafdfe; - border-bottom: 1px solid #e8e8e8; - font-size: 1.2em; -} - -.adminimal .views-preview-wrapper { - border: 1px solid #e8e8e8; -} - -.adminimal .views-ui-dialog .views-override { - background-color: #f6f6f6; -} - -.adminimal .field-multiple-table .form-item { - margin: 0.75em 0; -} - -.node-preview-container .form-type-select { - float: right; -} - -.node-preview-container label { - color: #fff; -} - -.content-header .page-title .field--name-title { - display: block; - margin-top: 1.2rem; -} - -.adminimal .media-library-item__remove.button { - border-radius: 20px; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/adminimal_theme/images/caret-down.svg b/sites/all/themes/contrib/adminimal_theme/images/caret-down.svg deleted file mode 100644 index 4e48c8c98..000000000 --- a/sites/all/themes/contrib/adminimal_theme/images/caret-down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down-hover.svg b/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down-hover.svg deleted file mode 100644 index ec9f71cdd..000000000 --- a/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down-hover.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down.svg b/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down.svg deleted file mode 100644 index ab6f1372d..000000000 --- a/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-down.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-up.svg b/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-up.svg deleted file mode 100644 index 7ba4e0802..000000000 --- a/sites/all/themes/contrib/adminimal_theme/images/chevron-disc-up.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/sites/all/themes/contrib/adminimal_theme/screenshot.png b/sites/all/themes/contrib/adminimal_theme/screenshot.png deleted file mode 100644 index cea54bfc31e7ac026ec67fb84920e98cfeecb195..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11319 zcmajFbyQr<(lu3vRkb?vp+>aK8=4{})Oy zvpJfW38_lU{?A-5JyALfXJ-c?AkfXtjmwRf%ihr($So)+2n6u}d3ZQqBsiTs?3@kV zIqjV2|E)pV)XCV<(!tr%-j3!UjfO_{F3zHKFP8ov7i=B=qt?#pf5P+yZG3U*G;hIYoL3euuS*a|Y9i}sZ%gwpkA*D%yDdEbRp0+$P5!$ry#Eyod@%<2&$|Av zb^bT&C3*g7{wHf+I{(RgQ@fXBcYMief10AOmru-31^iiNb8~ZccGe-o;ppf{NlEGU z_SVtS@%sAu^73+je?K`nxxc?ZKR>^rzWxFZzpG+CJw1KCy9C&`KR-YF`}^+>{@6P> zJ@0dnjTEop;u?#H;N;}|kTyE#;&O0uv#`3ixwQ|9>?z9?zPY*H+upor|FXHZdUABq z!N(tJAa1VecyfHg;1{~Le{_Cw{s4zZqz62}A7Wx+7ne6L&MyuR4=*k+-$%(lJw5I2 z?)*b9uiYK^i|EV!@Nj>3cXxmP@BlwQKfAxbd%4cf&aSVn&d$!RuC87NUszYyS7$H7 z=V!M!w|o10*H_m!w>K|zd3mw_(%;*^dU5#r>ZNt@LYEf@hX*gT_u~Kl3+M9S@TGrv z@=+710tNsQ2YNX-+4J zuli#5T}`2$&Nkyyq9-R*RAm`wkDCJ&Jv+3gAPhOFtqEtkVyX zL>%mY4QC{eS!lHBn;yepRCE6wZlGQN^FVg7laAfB%3jfmLTEyIy|T)vETPH4ob&J-YT}+Y0X+m6=PVGbFU)z%iLrlJ+1={z)CVc;RIZCk z9%W|P>b)RKbZaMXgt_2o*0QdVn(lKBm8dz6J6*JJ#FQopz7eJ^Ya!(eDu?E|n)e{& z5D;sc0vf~;w&{yyXjv8KUc>}Ub(M}KR7yBRG;7++eyvue3*GAiW()0fCXvqB%tJqu zYkz|=sgDgq&%Oaj#O^qc7^yMTs~zn-9?hInB7$HK=&^W2!=3w*X9|yy1nS%1J1ma%akDU>;*^xxCVo%8nZY-YT3>haVBw|~96hD<-( z(84S$b$nif4?ZI1W%lU>XSz%_M1ZSn)v)GEi8VAnB|;$w+nxxv(*qVhF6qH|PnOjN zWl+5{Y1-f`MDhSjE6LWT<08AMnhitl;*B>mGsEqX(Gf?Kt`llCQ(3CsV{%TVIgBWr!?)4a zRMl1$_m%P1kHZvN%J-`@A6I4(&&Q!vk*^rC)eg~9AdM3SG45Oq*e?|^d5Z59Sju6S8w<~GHX;~dE~{gr3yICo zO7(zU%M2lwV*dkelsYOPi1RI)gCe^Yuwc!hQyhzH7SY-Az2q(k8Fg9{yQW*3oA7Ypg?IPgt0YqskG`=Yd0eRt{jNJ87UeSh~)?QZyVCXCMsPk)C6RVK|O=&Q-i&uh+lAVQnw^ z{>CF`eDxg!^I(Rd&+FNXppTEH#E_H#4b#}sv_&I{+Y|=+y4MAQ9(=VXdc^D>ChBvS z0(6sKWE@+)pfdctF|lp4mD+Y>EyKEWr^qFZQ?>f|7#_5=`YN46;0`RAYm@d3=sR1a zA%;=Z5ygDQm`%nzTxva)?6rnqa6Gq})k2k5_e7I0MW%RQw+qM8!N4wxIsNeM9BIhH za3cwFm{gVEEdLw@9bWN=7WtsP%@E2-f7{trU7KkM7MB}O{Xq-nj`SP9YiV+96cWsz&WjTcBk{$|Zr_flu%6_ zJMHOW!K%WYICD;8wqe%B!$kEX=gq5~VSP@y-F9r)!JFE(N2fxHJc)5{BDI{dR2ctu zM@3r`P4)D_5~QzKMgQjxcj+2zT2mwM7D-h9S`ggY(^Pw9Bt}nhz&KfGYnsy<)pLIz zQ3S4?!T6;=)xGTumSOp3Z5w}SZEcdf1}l@LvMvd&q%n0$ zqT}Vj{P9+VM<4x%?{&KM@eG|v>?=gU0vmzN*>!cbjlnQ;}5#XkS{hfjBA7*W(Z*V|g;xry=dRUI2|g&uN)+Fq8@qhmz)(#Qz^h{17ch1`f? zx^=3%d$W$eVV8=^;4v4(262?X59P1lYbxZ)a@+Sx)-u0ap=&|EjYz(PghS2{Nagi7 zh_k-gT3f3j;g1gs^i z?8Gw>5G+`ruWfO|bjuMVN1$$<0jSf9#PiiD$htz^WPH6Mx*$`wN1Nx;(lwi#^@Bx0P9)Oaejxw*Ml8Eeb~Ypx4<{5L^T zaU~r9k^DVcFDHu{5|}iBkHz{j3QF!tXc=g4)!ZzpZbC9r$wWb)in`d3h$oZ7qh$g& z>hpR(L}#32V?8t4+l|OJGS6wXn5o&R?8+H!`8Iv?%c4hoX@pFFv?QV0J7wevs$IM+ zGv?X6;pXNKfk7TKQDj-?J-k^EnI;{-r z6Bs;C!L3lvnTaQbgK|uM`jqg;PG~pRj%oG)dEo~A0}N_*|HVy_Mb-;xwXo+)L(C%H z7v339KLwC@JxT_cJJ~{Qk>mX@kx%aIC%F9)oPKPRLN@yhtWe$9c$j<}j`R-ld`U zhtMgE%PXyA5q<~aHVPz^+>>H<2*}-rp@5eR>@`#q7A$_d2_IfH6=hEv`7iq*rHQ}h zLCvAOO+&5Ws#e_K!b2@0HVmlnD0h?(RfeKY#buu=CBirGwihR9TAJqJjw>W%3F`(|4Z4LshMrsXyHZ=|U_>D^NNz0Q+2EH<5cOfb5U* zwcd#0d6ed4Out(}j9vhf)V=n))%Q;3)?`R{2gg)_vjNCqqT%355gN_S20}K~Xh<6A zSUuzSmc*twwv4;QB|V+;?Q=97bikK*i#wng;O_96&N76Z((j28l3Q=cmdyONXpHo) zuQ4g=y1Ql`%EM!750$_CXFR5<67e5e^kBfx;4V!{(uBKBpHHMrs;D2`89S4wQTiFq zG)cTT!vg(lsSdGJKPZF*f5&6_OKdRji>5Yr#UZ+I5>T!?U94_bNbrkie<;Q}F-*OY zqRjd8Ut-SUhs$|%a&>-s)Y62)JRo{wLh+U(?IMO%5Zb({T*tJ#nkjbIam`Gl zB7yvupZJ&Bm9DiAN?PpS?f#~T#VN#xcf(cKDWxb6+Vmrv*?xs3w9pZ@OVlPFdx@f| z!AgQz_6=1&onG6e_kXA`+KS5J2_ka4DH8yFt6xj2LW2}QibQZ)`X1S{K?{GkUKNl7 z@X0*AQX)HC?hWQGxOGrus814@r6A<{m(>(A=b{$-?2653P%(@ZL)O;aE0C=SLc4%{ zs~n;rcPT}ngvfUgRH(Sc68?2Gs3Js_%vJbQof8)T7BXV9HS!L~Cb(z2My<@M=lT4p z*9#3plD?)8A0xdLecZY8wG7=G%JN$Yzz>q8EW(;(NX+D`Xy6e3O;^RK@4R(ygY&BG z^kn4g_wH)6R2>QeaUf+x0wo1&;uOQbWK1m{!(FJ^l7n5z1tFu{oeOiV3I;B$!S?1Y z&K;ZV@}4=<0p;M^;9{xrFI~B3=mnpM6Wu=Nov|d(t!;1}X}Y9qYL($vH+^(dQqN@j zSU(g`;V@{7$VujM+wj%~qaoO`h=-3O8zcU>Pa2j$G(ZOB=qL2IG(txc8-7r>yJChg zDcRqyMp~P@x|f&}i7TsRf)e|`upHRq_uC-C#)z#a4|>g-bGO)gM{ z-yRrDK5qz=?|t`QKIu$O zVrxmnNv)fS0RHLY*jP+ogx8KDl5FY+9o}=25X9wbilppRR$H-iQ3R3W6eRAR+ z8OYWPQAo=4gQOaVoWCh1s^1cvmC;|MK^7bFmkk)(wsVbP?Er`^(QA9xu}ajR^5dCN zPndXM1u4kpHwuRA$#qPQoAzAh6y)J`&JY_7?wh7T)&C&;DjwwZ1!>dfHSuLIFZke1;M8Q9vDp2NK)$81Pygi?huo= zdJ1co*w2I=^31hjHSUGriQl@rI4;b&MQMy+2)YF>lMrgxCB2XtxoL=H43Q)R{7X6h ziQfA!k(RPe%C7GAc8VWsDVkjs<_f!E$~J0zkUBlf;g59w-2VGQ3Z4DW!t{RVzg*Y| z)W}}KAelzg-03x{xQIrd{*B(m576#TV7JXaa5}~MC2g;BM@Wge`wN@F-yMq-mN*EL z2D6dXpYM*)!cNDLkw(yf(1-Zmc+x2J-m!INN(Xpc9-H$m`D=(txM5s>up8Zh5$1LQ zty}Emb=q#IGK}DtmxsA(=@JT3CdDyj0Z%pC2K6buj3kCBA?7uJAeG6mmwO@w#IFmH z<_IbD2MTFFzx-bNbCH<7M^OCo8|WyBKyX88@$Zf-qg7(;x%BiJyMpsT%L(7@{nl|g z(YiU+EX=b0C2{gT^yb>Pe#YyN@iHG$W#5%R3?biu^rS!sK(eh8`LFi&CnPq{Jiz*# zh_JaiwIx=YkKg7}7YqK#uICpxvNa#N5Y+i5)cU@9PUML1_%49anOW_}if#eXld*gZ zf{dD|iv`!0z3#XKKqT-g^Q$Ex(_6A6`qDg4TSgOaQ<*3Tyf*|oD4&1gz+_5*L3?#G z&FLY9s=o$vx~R{!d$A-9=6|w#ndduhVPcH}<_n{6&IJQA(eeFOVCZ)K>z@-%U0z>* z_{grx6W7QKI)2&9Arnj|rsDaeusl%`3dUi;D}LO2i;s*k>t54=J2E`iV~mcJo>62b zup#gv+7MdHsHwWtv&6($UXVDVwf!L;>$};sQ2dM$S!Q2kvQ9-=N2B@&Q+D#gZr=?q z$vrBt6J(E^sFgVUa>xPmhpBm}Rp4Yk5C1E>*~me(qr%C<56Hgk=0rr1J)@>qCC9?T zrD^HM1&I+w$Np3qr<&>?rv{fZn(C22uGgywzeYbysmZ(O2rdaDNt+jW)@jZmn9o^h zObxQ4l=-m+&3~F9@1+c@GEU)b)Sb0RnBs*Asj&;ku^tt8nVT22CUmf^{3Qj$2FDgjS(%Oq&2B+x?_WLRzT{AgJN8cICA*@EfK%)KG_2zYR!t^ z0vfykoH&>@MYS-y;I#6d^FhbZ%%rWpTI$=4s}1j~p-H0yoAMHczZq=n#)+E}Z;7Z} z#u70`HAM;T-gN5bJ171u)_Z-ifzi;B+`#j;DUkDU?M$N&J)3BIN!W=fFMBA15#F^_a~lLe?rb>o+A-BUJOapBCVOd0BCL>d1X(9-v%jd!N@A&rdpemHl? z-y73fammwPrZhwsEyq!A#R+D*+VVW@?Be3jNiXiw2Z9KinkLBQ9o6Iczbh>Sw(rpTg~V~S z&1=ELMMs!&sk7@gOc{}j*f_Q0c9vQKcH7oB6x&Cl-m%|yP{#n;o z_g#fnBeIFq^*TqjPm2anoT~(hpKp>})h$6S+TU$RrYif=t;1%tv=mOCUc?3`_AsI5guaprPRXAV$@aW=tp~LqkKV&%S6av z?EF&Vu0E*{WbqZ#39|q+eEWo@60$zDnP4b+#1!S8T`VG93NB0pRoS+SCk@N1{+S6V z58^)hlh1lIRleo7#hhl7c+ND2b@#+DjWw8?43=w6MC0OfbxRU&@#Vldbssgi z!hk|Kz4W}8Fd9|Z!4X`VgIH;jzCTHP9%LMQucFdNy3t*B7%GQ>_GVu&=55lm{z#8aMvu(4PryCA(M?GEk=#?fQ_jPw6ZJ zG<65wTnQIW*>zfVYNVvpTLeov^(4qW9EWXmrl!*C>MX?=u`U$=tAAcG$DqQ}*X)zO zr2t@o?L-mX#XN5iz!-f}(w}&7&i-Jx?CO+;oR4edxQPDJR+0K^{0h1kuWLWU;}-Fh zMSS)Rtmi&4(zC`0TH#tUH>=7U)=LK2j=B;O{bBdBtbf!#W6ss;3$l73lNsuHz=W;$ z;yE^u37?Zs+6#CDrZ0hVB70@L(CtW}N?5rZQ9O0juRpfr^aKNl&6deXVC+puH?j9{@&5Sq2b{_+l z7kwO?v4FrvLd$xgSPfxE5{iWRbc;={NuBX{TL_a269J{``nl=kEu#ICUTZuogxj_r zu4Nghrq%YzdLnlsx`wW@?=X;9M|V<;c~xz-6Qom}a!nd8OE2VoC`;eJ<;p<3hn=Ik zYj#$E5*!*s94i?qH@k=IjBa72BJPary;_f=7T{XpQR)84_?1)x9{F92Rb&MKLE|KVYkUC7zUf_v&>5*OpYVt*jdhhQ`So2 zSZW)rsN_-!JviOYDykuvFD?|YLX8iZ#JJT!YraQL>7wRy0JF_cOPaENZdS>Hq+@XC zCrYtJHqZ}5;%0^1;4;0cWTh-xQ)2EjB^nSid!L$0@sPa|=JL#7_%&Q?Ok3@mpjmg4 zX%nU1?oD8d)AvtO;1x+btM9Tu#o#;30_%~G?R@*;cK!Q1fu5A_jZn+&s(Xx~lokZ= z1%XVr+RE}?B*xPRoX*^jNslQG$B|(%M$4rRs3XG18}GGg$EZgh5*|IMyuM!Yo?uH2 zdHnRqc&>uCVP)Aj&mKj2KZ@~4z@9{iBTeq#pdVJl#q6UGJZ3H|ERuU{ekx_QgqNmA zBmXl0vdcHdI<18uVv_B`7sNX(e;wl`AP)XS^VvsESK#6r+d4*o|Ku&iP3yc1jtTRAHdiJ&FLm_FuFSd1UgMm4G`F{lX3b`_i9zsE7z zM{fFWZho0%3e<3mj@Lv14d%_3lIpY%k&;lIY?ALOApTl5#(!+{$FcH3T`jGZSo8RF zbIZ%S$=6DcKHC7aYxuAih3&N->2j_k>`t%V*vKWR$|Lqf_ukevb z`a!$Hp7{26K{S&4p}mAUe1Y+H2}QQT@6{}3UJeKje+?navO7suoMkjwkkbU2`BuD> z=tbBJ1lPQrC)BMdez+W%3y4ay zuaG)wl*P5Sf+PYLjC>pNAoKy+X~o=$nQM3nO|{) zhr!DX7K~=ftXIm+MW)*%*0{nw65j^BUZN$hJHgiLvh@6#@xxuYZpH4tw(2nkp-pI7 z;4T+Fvm)X8y#2Vv_v8vb0Y2Y}dm{}zbi;>Mo=4tAHF%Lx_w#wX-Q_=D+Ar%r-L15? zKXk8vh`$Bk$2#%2n?lwDmIb;l+gJ3S?%JPLZiu@G-GZtkB1iDOXn0oi1)>F0_bv#$`b2z8M!(qnxM{e~GK+(d zO(}Z>W1eq*ywr@{EA-AbBwslPwJN+E!9r)a8Grg;^f2r-DSJX3QsUmC=`hA0`rjzv z#EU8`yvB{A#S41Jo6znFhHbeT?HPK;yF;KuQK5URP%_*dMVwTUGP9>a?vVxtL6;E? zDyV|Ohq((-tMai3_#|rY`%}Nbptx_~a}^?FnM40fUt>9Duk<|jJKXFpd4*y5_F`p) zqxJdP><(V9c!)C=sNJ!GT-kCVNFDz07}>@@92P5AnfS2O{-}8ZY=1s__O!p-uwTBX z_9>PNGxQflV>-;(_-3fHiq2=!htaiAss#W)?<{TIeD`((w?B^bb_KvhYMVMT3-OqY zj+_TucI9?|35Xy-kw;^j=f0(pu8={+hfnX*lXSg_bxAW+o#uuc+(BR%Ci51&v!?a* z>Rj;x8#=QooB|DYBN2e&d`vnXDtAl~6DhuX2W13Pi%*LC-d3oX!>Jpt@qNYPuA5V# zIG^1fb0R~R9DT@3aR~fw-_H3y$V0^F(mg3Fal3|al5@K;Y<>J{u3}ekp!nGZ-%Dn) z!ef&syZeQ#w;lbjxqu`p3XfeZ-X?D`*ZPI{pApD>B-|vBAT;C+y3=^9QAD~l2#kf@ ze*WGxfhVXiYJ(^-6^tw79w&t%r6xdhEcLILx8lDMD<^^CRZFqSfSovbr?FTJmk>0{ zeFo~Evw5@4xfs09zM$T$2OJl!WLJ9-lgkX&_qLuDrI4RY(9u+4Ok$Nt$TD5>3LaEk zSB&*(ZzK=tpmww!QSA|)0=-Gnr-yF3udSI++b5hdKr4hX^@F=tsG(n)y$i$+tqj?C zpsou+`Wa9VFIwnbfc@#hiET;&LO#g^W@#5TK0@!YrdH5W!?BMEc^%%=k^r6JZF86N zP?7o3`E>XCWw(o4zAo7|$@_pCJ2eN;96Y8qn)SiQP_YUAO|P%H>Sxpyl`E~&B0%ky ze{FhYf_VwHzCr`kX+u!E_3FNqx?S3u31hvhx!us0-Md|O^X}Ck-Mhc<(a?h}Pu&PB z&t#WccRBlbdn-4Ty{ff7b3W{H4?ZZ~C^jaUb4p`EclPcAr0Y_v78DnE@=Lja{kt_^ z0zt3~kKk^gT3xFqXb-vW?%zQ=#IMILzw=8AM6@d#-}LN|z>F!klrQU=`Hcb&4b`;p zbjMx@)$}{tKPA7885^UWouXaT*Q3k`Z6Eor{gTNmdcGIkQ+Ib$tKJSizVF_J;x)B} ze2u|dyc<|Oy??{BzPZ1D|4K)+P3+B^u5}X!A8&UTe3bt9`0i7FXX-XF5o*jbgub)2 z)#cZfD642=fdpZQKRcZq+-@d7TDas2i9l}&~Xe--sqJX%#Y%fW8;jCO(0#}h~;uihyHEI{c&}I|Fzn5pBKw9Z=w*L zxlUjis}Uq`w0RXvNPF~4olVe!{2X#L(G;BS zu-HWBP8l@Xlm$8NP@dH_(m&T)*MA%k?E0yf!M+zJ8m*QNNt-a(C0Gh8xju`Q9VKoj zf%HYWFaNX-c;$#-#V4kiJvw3G%^=rh&QLYyOTU9F_ZIDEs&G_Vjzd50{Dj3O`L|E$ zEbk3m@5vgy@n9W9E~^d@c_99r?YqV!s=lk3`eu!cF4L1u>c+v$=>-FuZmdZk7nZ2L zNSAph%le2i8+5W5k-bvRbdt#^8tGg>>^2bK*E!{CL?F_T#%Of2v&$c?|UJ+JT&)Sax zLXf1SL()cFJ83ti%RijaGGAQvl6#lps*@>(x~_(XhLlLz1o9+=dwA>_>krX?rCOM< z*0-cp*D94b*Jazv`+I&c`Q>uT@GFqRoY_?XjaKHfKWnIAGOMSZbdX~hx-TnQnU*JC zpj~n@se-T&qJ&JwL-OH#VY+G45a-sdi(q|Eq&~5_--&7rC5kn!^_pC7T?a5W`GH4W zkw^^<;@)FrsHp?o*v7wjRiIQtQ%0oCy%i_X%;)Gi7_C*R6ou%D2&qVa8@J zEyC5V85h^#L~q?aC15{6EKpB$;I^IjuGL6UA2;%zgqM5|U`x3$!O z9m0-zkV1V4@b(XK(W-H4T244|?YQ=-m;>-*86ii%MeJ-L zjD};2RCO9yOvY>Q-5uo3R3UDY{0{brpT5GgHH78U!t1TQ=|P65_BCNGTV`5m`1OH) z_B)S!%rfIITJaFTydiT_Pm+?W4WiVJU*(?kZwy~CzHfABN$obN6%2%&Ku0dlx&D+L zGjFCOY5AEmpqhZk43+Vpt_myJAWOlIKEQA)mFnRx;2CirqxhqlwhDx4h>s;k&6j5z zKh~5zN%vbNgAETb0^i)Un>=ziCVos5=<$@D=Wurh?R&r_FdxN|bu~4rJ2dt}8Pzhr zdvN-!Uo=zdLjIL%VMJN5Y67G30+_Kk#1BSq-TmrH6$-b}`xtW(EOg$OseMeiRNVW$ zmP2%;V - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/sites/all/themes/contrib/basic/README.txt b/sites/all/themes/contrib/basic/README.txt deleted file mode 100644 index 876d8b5e3..000000000 --- a/sites/all/themes/contrib/basic/README.txt +++ /dev/null @@ -1,242 +0,0 @@ - -===================== -Introduction to Basic -===================== - -Basic boasts a clean HTML5 structure with extensible CSS classes and IDs for -unlimited theming possibilities as well as a top-down load order for improved -SEO. It is fully responsive out-of-the-box and provides an adaptive, elegant, -SASS-based grid system (Bourbon Neat). - -Basic's goal is to provide themers the building blocks needed to get their -designs up and running quickly and simply. - -Basic is perfect if you want a simple, smart, and flexible theme starter. - -Less code spam, more ham. - - -============ -Installation -============ - -Basic utilizes SASS for adaptive grids and layouts and general structure of the -site. It's recommended to use SASS for building out your theme. The following -packages are included via 'npm install' - - SASS (http://sass-lang.com/) - - Bourbon (http://bourbon.io/) - - Bourbon Neat (http://neat.bourbon.io/) - -Basic is meant to be YOUR theme. Follow one of the two methods below and you can -rename 'basic' to another name like 'mytheme'. You're also welcome to keep -'basic'. - -1. DRUSH: The provided drush install script will duplicate the basic theme - folder and rename all appropriate files and content to the new theme name you - provide. - - - Download and enable the basic theme: $ drush en basic - - Set the theme as default $ drush config-set system.theme default basic - or copy the includes/basic.drush.inc into your .drush folder. - - Run the provided drush install script: $ drush basic-install - - The script will first ask you to enter your theme name (eg. My Theme). - Second, it will ask you to enter a machine name (eg. my_theme). - - After complete, you can enable your new theme: $drush en my_theme - - At this time, you can uninstall basic: $drush pmu basic - - Commence work on your theme! - -2. MANUAL: To manually change the name of the theme follow these steps BEFORE - enabling the theme: - - - Rename the theme folder to 'mytheme' - - Rename basic.info.yml to mytheme.info.yml - - edit basic.info.yml and change the name, description, project (can be - deleted), and change all other instances of 'basic' to 'mytheme' - - Rename basic.libraries.yml to mytheme.libraries.yml - - Rename basic.theme to mytheme.theme - - in basic.theme, change each instance of 'basic' to 'mytheme' - - Rename config/schema/basic.schema.yml to mytheme.schema.yml - - Rename each file in config/install from block.block.basic_tools.yml (for - example) to block.block.mytheme_tools.yml - - Every file in config/install, change each instance of 'basic' to - 'mytheme' - - In js/source/scripts.js, change each instance of 'basic' to 'mytheme' - - In theme-settings.php, change each instance of 'basic' to 'mytheme' - - In templates/html.html.twig, change each instance of 'basic' to 'mytheme' - - In templates/menu-local-tasks.html.twig, change each instance of 'basic' to - 'mytheme' - - In templates/status-messages.html.twig, change each instance of 'basic' to - 'mytheme' - - When renaming, remember the following: - - Do not simply replace every instance of 'basic' in every file in the theme. - Most of Basic's dependencies use the word 'basic' somewhere and renaming - these instances will cause Basic to break in unpredictable ways. - - If you don't rename all these files, you may get a vague and unhelpful error - message when attempting to enable your theme: "The website encountered an - unexpected error. Please try again later." Turn on a higher level of error - logging in your server's php.ini to help determine what you've missed. - - If you don't bother renaming Basic in the above locations, be advised that - you will run into conflicts with other versions of Basic on your site. If - your site uses more than one theme based on Basic, make sure at least one of - the themes has been renamed properly! - - -============================ -How to compile SASS in Basic -============================ - -To use SASS and automatically compile it within your theme, please refer to "How -to Use Grunt with Basic" in the documentation below. - -Install node-sass: - - npm install node-sass -g - -If you don't like Grunt, or would just prefer to use SASS' internal watch -functionality, simply cd into your theme directory and run: - - node-sass sass -o css --output-style expanded --source-map true --watch - -Or simply compile the latest: - - node-sass sass -o css --output-style expanded --source-map true - - -======================= -What are the files for? -======================= - -- basic.info.yml - Provide informations about the theme, like regions and libraries. -- block.html.twig - Template to edit the blocks. -- comment.html.twig - Template to edit the comments. -- node.html.twig - Template to edit the nodes (in content). -- page.html.twig - Template to edit the page. -- basic.theme - Used to modify Drupal's default behavior before outputting HTML through the - templates. -- theme-settings.php - Provides additional settings in the theme settings page. - - -============ -In /sass -============ - -- layout/layout.sass - Defines the layout of the theme (compiles to css/layout/layout.css) -- theme/print.sass - Defines the way the theme looks when printed (compiles to css/theme/print.css) -- components/tabs.sass - Styles for the admin tabs (compiles to css/components/tabs.css) - - -============ -In /js -============ - -- modernizr.js - Modernizr detects HTML and CSS features and applies classes to - the object you can then reference in your stylesheets. Use the URL at - the top of the modernizr.js file to customize the features you wish to detect. -- selectivizr-min.js - This script will only be loaded for Internet Explorer 8 - through the ie8 theme library. It will provide a JS fallback for CSS :nth- - child, an important part of the Bourbon Neat grid system, as it is not - supported in Internet Explorer 8. -- build/scripts.js & source/scripts.js - When using Grunt, save files to the - source folder and a minified version will automatically be saved to the build - folder. See comments in basic.libraries.yml file to enable the starter - scripts.js file. - - -=================== -Changing the Layout -=================== - -The layout used in Basic is fairly similar to the Holy Grail method. It has been -tested on all major browsers including IE (5 to >10), Opera, Firefox, Safari, -and Chrome. The purpose of this method is to have a minimal markup for an ideal -display. For accessibility and search engine optimization, the best order to -display a page is the following: - -1. Header -2. Content -3. Sidebars -4. Footer - -This is how the page template is buit in Basic, and it works in fluid and fixed -layout. Refer to the notes in layout.sass to see how to modify the layout. - - -=========================== -How to Use Grunt with Basic -=========================== - -Grunt (http://gruntjs.com/) requires Node.JS to be installed on your machine. -There are various package managers that can handle this for you. - -https://nodejs.org/download/ - -Once Node.JS is installed, go to the root folder of Basic and install your Grunt -packages: - - npm install - -This will install the neccessary node_modules to run Grunt. In order for Grunt -to work from the command line we are going to need the Grunt CLI. Open a new -Terminal window and type: - - npm install -g grunt-cli - -This will install the CLI globally. Restart terminal when that is complete and -you will now be able to use Grunt commands. - -Once installed, cd to the root folder of Basic and run Grunt via the command -line: - - grunt - -This will initialize Grunt and start watching changes to your SASS files. Voilà! - - -============== -Updating Basic -============== - -Once you start using Basic, you will massively change it until you reach the -point where it has nothing to do with Basic anymore. Unlike Zen, Basic is not -intended to be use as a base theme for a sub-theme (even though it is possible -to do so). Because of this, it is not necessary to update your theme when a new -version of Basic comes out. Always see Basic as a STARTER, and as soon as you -start using it, it is not Basic anymore, but your own theme. - -If you didn't rename your theme, but you don't want to be notified when Basic -has a new version by the update module, simply delete "project = "basic" in -basic.info.yml. - - -================ -Bugs & Questions -================ - -Thanks for using Basic, and remember to use the issue queue in drupal.org for -any questions or bug reports: - -http://drupal.org/project/issues/basic - - -==================== -Current maintainers: -==================== -* Steve Krueger (SteveK) - https://www.drupal.org/u/stevek -* Leah Marsh (leahtard) - https://www.drupal.org/u/leahtard -* Joël Pittet (joelpittet) - https://www.drupal.org/u/joelpittet -* Catherine Winters (CatherineOmega) - https://www.drupal.org/u/catherineomega -* Johannes Schmidt (johannez) - https://www.drupal.org/u/johannez diff --git a/sites/all/themes/contrib/basic/basic.info.yml b/sites/all/themes/contrib/basic/basic.info.yml deleted file mode 100644 index 53a660df9..000000000 --- a/sites/all/themes/contrib/basic/basic.info.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Basic -type: theme -description: 'HTML5, SASS, Responsive grid starter theme.' -package: Core -# version: VERSION -# core: 8.x - -libraries: - - core/normalize - - basic/global - - -regions: - header: Header - help: Help - page_top: 'Page top' - page_bottom: 'Page bottom' - highlighted: Highlighted - content: Content - sidebar_first: 'Sidebar first' - sidebar_second: 'Sidebar second' - footer: Footer - -# Information added by Drupal.org packaging script on 2017-10-15 -version: '8.x-1.3' -core: '8.x' -project: 'basic' -datestamp: 1508096954 diff --git a/sites/all/themes/contrib/basic/basic.libraries.yml b/sites/all/themes/contrib/basic/basic.libraries.yml deleted file mode 100644 index 21500f5b1..000000000 --- a/sites/all/themes/contrib/basic/basic.libraries.yml +++ /dev/null @@ -1,40 +0,0 @@ -global: - version: VERSION - css: - base: - css/base/base.css: {} - layout: - css/layout/layout.css: {} - component: - css/components/components.css: {} - theme: - css/theme/theme.css: {} - css/theme/print.css: { media: print } - js: - js/modernizr.js: {} - # js/build/scripts.js: {} - # dependencies: - # - core/drupal - # - core/jquery - - # Uncomment the code above to load scripts.js file on all pages. This file also requires JQuery to be - # loaded on all pages. Consider implimenting your scripts through theme libraries if you wish to - # avoid this. https://www.drupal.org/developing/api/8/assets - -tabs: - version: VERSION - css: - component: - css/components/tabs.css: {} - -messages: - version: VERSION - css: - component: - css/components/messages.css: {} - -ie8: - version: VERSION - header: true - js: - js/selectivizr-min.js: { browsers: { IE: 'lte IE 8', '!IE': false }, minified: true, preprocess: false } diff --git a/sites/all/themes/contrib/basic/basic.theme b/sites/all/themes/contrib/basic/basic.theme deleted file mode 100644 index 5781cc09a..000000000 --- a/sites/all/themes/contrib/basic/basic.theme +++ /dev/null @@ -1,55 +0,0 @@ -isFrontPage(); - } - catch (Exception $e) { - // If the database is not yet available, set default values for these - // variables. - $variables['is_front'] = FALSE; - } - - // If we're on the front page. - if (!$variables['is_front']) { - // Add unique classes for each page and website section. - $path = \Drupal::service('path.current')->getPath(); - $alias = \Drupal::service('path.alias_manager')->getAliasByPath($path); - $alias = trim($alias, '/'); - if (!empty($alias)) { - $name = str_replace('/', '-', $alias); - $variables['attributes']['class'][] = 'page-' . $name; - list($section,) = explode('/', $alias, 2); - if (!empty($section)) { - $variables['attributes']['class'][] = 'section-' . $section; - } - } - } - - // Add cachability metadata. - $theme_name = \Drupal::theme()->getActiveTheme()->getName(); - $theme_settings = \Drupal::config($theme_name . '.settings'); - CacheableMetadata::createFromRenderArray($variables) - ->addCacheableDependency($theme_settings) - ->applyTo($variables); - // Union all theme setting variables to the html.html.twig template. - $variables += $theme_settings->getOriginal(); -} - -/** - * Prepares variables for the field.html.twig template. - */ -function basic_preprocess_field(&$variables, $hook) { - // Make additional variables available to the template. - $variables['bundle'] = $variables['element']['#bundle']; -} diff --git a/sites/all/themes/contrib/basic/composer.json b/sites/all/themes/contrib/basic/composer.json deleted file mode 100644 index a8c771a9f..000000000 --- a/sites/all/themes/contrib/basic/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "drupal/basic", - "description": "HTML5, SASS, Responsive grid starter theme.", - "type": "drupal-theme", - "homepage": "http://drupal.org/project/basic", - "authors": [ - { - "name": "Steve Krueger", - "email": "steve@thejibe.com", - "homepage": "http://thejibe.com", - "role": "Maintainer" - }, - { - "name": "Joël Pittet", - "email": "joel@pittet.ca", - "homepage": "https://www.drupal.org/u/joelpittet", - "role": "Maintainer" - }, - { - "name": "Leah Wagner", - "email": "leah@thejibe.com", - "homepage": "http://thejibe.com", - "role": "Maintainer" - }, - { - "name": "Catherine Winters", - "email": "catherine@catherinewinters.com", - "homepage": "http://www.catherinewinters.com", - "role": "Maintainer" - }, - { - "name": "Johannes Schmidt", - "email": "mail@2tabs.com", - "homepage": "http://2tabs.com", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/basic", - "irc": "irc://irc.freenode.org/drupal-contribute", - "source": "http://cgit.drupalcode.org/basic" - }, - "license": "GPL-2.0+", - "minimum-stability": "dev", - "require": {} -} diff --git a/sites/all/themes/contrib/basic/config/install/basic.settings.yml b/sites/all/themes/contrib/basic/config/install/basic.settings.yml deleted file mode 100644 index f4d8524c6..000000000 --- a/sites/all/themes/contrib/basic/config/install/basic.settings.yml +++ /dev/null @@ -1,9 +0,0 @@ -browser_sync: - enabled: false - host: localhost - port: 3000 -clear_registry: false -ie_enabled: false -ie_enabled_versions: - ie8: false - ie9: false diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_account_menu.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_account_menu.yml deleted file mode 100644 index e169f53b0..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_account_menu.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.account - module: - - system - theme: - - basic -id: basic_account_menu -theme: basic -region: header -weight: 0 -provider: null -plugin: 'system_menu_block:account' -settings: - id: 'system_menu_block:account' - label: 'User account menu' - provider: system - label_display: '0' - level: 1 - depth: 1 -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_branding.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_branding.yml deleted file mode 100644 index ef5012292..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_branding.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - basic -id: basic_branding -theme: basic -region: header -weight: 0 -provider: null -plugin: system_branding_block -settings: - id: system_branding_block - label: 'Site branding' - provider: system - label_display: '0' - use_site_logo: true - use_site_name: true - use_site_slogan: true -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_breadcrumbs.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_breadcrumbs.yml deleted file mode 100644 index a7ba2ffaf..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_breadcrumbs.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - basic -id: basic_breadcrumbs -theme: basic -region: content -weight: -45 -provider: null -plugin: system_breadcrumb_block -settings: - id: system_breadcrumb_block - label: Breadcrumbs - provider: system - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_content.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_content.yml deleted file mode 100644 index b1a1d1520..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_content.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - basic -id: basic_content -theme: basic -region: content -weight: 0 -provider: null -plugin: system_main_block -settings: - id: system_main_block - label: 'Main page content' - provider: system - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_footer.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_footer.yml deleted file mode 100644 index b6f6eec81..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_footer.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.footer - module: - - system - theme: - - basic -id: basic_footer -theme: basic -region: footer -weight: 0 -provider: null -plugin: 'system_menu_block:footer' -settings: - id: 'system_menu_block:footer' - label: 'Footer menu' - provider: system - label_display: '0' - level: 1 - depth: 0 -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_help.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_help.yml deleted file mode 100644 index f54d8bc6b..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_help.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - help - theme: - - basic -id: basic_help -theme: basic -region: help -weight: -30 -provider: null -plugin: help_block -settings: - id: help_block - label: Help - provider: help - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_local_actions.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_local_actions.yml deleted file mode 100644 index c2f0b37ef..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_local_actions.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - basic -id: basic_local_actions -theme: basic -region: content -weight: -20 -provider: null -plugin: local_actions_block -settings: - id: local_actions_block - label: 'Primary admin actions' - provider: core - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_local_tasks.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_local_tasks.yml deleted file mode 100644 index da84822dd..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_local_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - basic -id: basic_local_tasks -theme: basic -region: content -weight: -40 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: Tabs - provider: core - label_display: '0' - primary: true - secondary: true -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_main_menu.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_main_menu.yml deleted file mode 100644 index 95168abf9..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_main_menu.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.main - module: - - system - theme: - - basic -id: basic_main_menu -theme: basic -region: header -weight: 1 -provider: null -plugin: 'system_menu_block:main' -settings: - id: 'system_menu_block:main' - label: 'Main navigation' - provider: system - label_display: '0' - level: 1 - depth: 1 -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_messages.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_messages.yml deleted file mode 100644 index 5b7e6d664..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_messages.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - basic -id: basic_messages -theme: basic -region: highlighted -weight: 0 -provider: null -plugin: system_messages_block -settings: - id: system_messages_block - label: 'Status messages' - provider: system - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_page_title.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_page_title.yml deleted file mode 100644 index d1c324d00..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_page_title.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - basic -id: basic_page_title -theme: basic -region: content -weight: -50 -provider: null -plugin: page_title_block -settings: - id: page_title_block - label: 'Page title' - provider: core - label_display: '0' -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_search.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_search.yml deleted file mode 100644 index c417f2f26..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_search.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - search - theme: - - basic -id: basic_search -theme: basic -region: sidebar_first -weight: -1 -provider: null -plugin: search_form_block -settings: - id: search_form_block - label: Search - provider: search - label_display: visible -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/optional/block.block.basic_tools.yml b/sites/all/themes/contrib/basic/config/optional/block.block.basic_tools.yml deleted file mode 100644 index 742d392b7..000000000 --- a/sites/all/themes/contrib/basic/config/optional/block.block.basic_tools.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.tools - module: - - system - theme: - - basic -id: basic_tools -theme: basic -region: sidebar_first -weight: 0 -provider: null -plugin: 'system_menu_block:tools' -settings: - id: 'system_menu_block:tools' - label: Tools - provider: system - label_display: visible - level: 1 - depth: 0 -visibility: { } diff --git a/sites/all/themes/contrib/basic/config/schema/basic.schema.yml b/sites/all/themes/contrib/basic/config/schema/basic.schema.yml deleted file mode 100644 index 0a2f592fb..000000000 --- a/sites/all/themes/contrib/basic/config/schema/basic.schema.yml +++ /dev/null @@ -1,33 +0,0 @@ -basic.settings: - type: theme_settings - label: 'Basic theme settings' - mapping: - browser_sync: - type: mapping - label: 'Enable Browser Sync' - mapping: - enabled: - type: boolean - label: 'Enable Browser Sync' - host: - type: string - label: 'Host' - port: - type: integer - label: 'Port' - clear_registry: - type: boolean - label: 'Enable clear Registry' - ie_enabled: - type: boolean - label: 'Enable IE support HTML classes' - ie_enabled_versions: - type: mapping - label: 'IE versions supported' - mapping: - ie8: - type: boolean - label: 'Support IE8' - ie9: - type: boolean - label: 'Support IE8' diff --git a/sites/all/themes/contrib/basic/css/base/base.css b/sites/all/themes/contrib/basic/css/base/base.css deleted file mode 100644 index 921a0f763..000000000 --- a/sites/all/themes/contrib/basic/css/base/base.css +++ /dev/null @@ -1,271 +0,0 @@ -html { - box-sizing: border-box; -} - -*, *::after, *::before { - box-sizing: inherit; -} - -button, input[type="button"], input[type="reset"], input[type="submit"] { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #555; - border: 0; - border-radius: 2px; - color: #fff; - cursor: pointer; - display: inline-block; - font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif; - font-size: 16px; - -webkit-font-smoothing: antialiased; - font-weight: 600; - line-height: 1; - padding: 0.75em 1.5em; - text-decoration: none; - transition: background-color 150ms ease; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - vertical-align: middle; - white-space: nowrap; -} - -button:hover, button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus { - background-color: #444444; - color: #fff; -} - -button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled { - cursor: not-allowed; - opacity: 0.5; -} - -button:disabled:hover, input[type="button"]:disabled:hover, input[type="reset"]:disabled:hover, input[type="submit"]:disabled:hover { - background-color: #555; -} - -fieldset { - background-color: transparent; - border: 0; - margin: 0; - padding: 0; -} - -legend { - font-weight: 600; - margin-bottom: 0.375em; - padding: 0; -} - -label { - display: block; - font-weight: normal; - margin-bottom: 0.375em; -} - -input, -select { - display: block; - font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif; - font-size: 16px; -} - -input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], input:not([type]), textarea, -select[multiple] { - background-color: #fff; - border: 1px solid #ddd; - border-radius: 2px; - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06); - box-sizing: border-box; - font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif; - font-size: 16px; - margin-bottom: 0.75em; - padding: 0.5em; - transition: border-color 150ms ease; - width: 100%; -} - -input[type="color"]:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[type="datetime-local"]:hover, input[type="email"]:hover, input[type="month"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="text"]:hover, input[type="time"]:hover, input[type="url"]:hover, input[type="week"]:hover, input:not([type]):hover, textarea:hover, -select[multiple]:hover { - border-color: #b1b1b1; -} - -input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="email"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, input:not([type]):focus, textarea:focus, -select[multiple]:focus { - border-color: #555; - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 5px rgba(72, 72, 72, 0.7); - outline: none; -} - -input[type="color"]:disabled, input[type="date"]:disabled, input[type="datetime"]:disabled, input[type="datetime-local"]:disabled, input[type="email"]:disabled, input[type="month"]:disabled, input[type="number"]:disabled, input[type="password"]:disabled, input[type="search"]:disabled, input[type="tel"]:disabled, input[type="text"]:disabled, input[type="time"]:disabled, input[type="url"]:disabled, input[type="week"]:disabled, input:not([type]):disabled, textarea:disabled, -select[multiple]:disabled { - background-color: #f2f2f2; - cursor: not-allowed; -} - -input[type="color"]:disabled:hover, input[type="date"]:disabled:hover, input[type="datetime"]:disabled:hover, input[type="datetime-local"]:disabled:hover, input[type="email"]:disabled:hover, input[type="month"]:disabled:hover, input[type="number"]:disabled:hover, input[type="password"]:disabled:hover, input[type="search"]:disabled:hover, input[type="tel"]:disabled:hover, input[type="text"]:disabled:hover, input[type="time"]:disabled:hover, input[type="url"]:disabled:hover, input[type="week"]:disabled:hover, input:not([type]):disabled:hover, textarea:disabled:hover, -select[multiple]:disabled:hover { - border: 1px solid #ddd; -} - -textarea { - resize: vertical; -} - -[type="search"] { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; -} - -[type="checkbox"], -[type="radio"] { - display: inline; - margin-right: 0.375em; -} - -[type="file"] { - margin-bottom: 0.75em; - width: 100%; -} - -select { - margin-bottom: 1.5em; - max-width: 100%; - width: auto; -} - -ul, -ol { - list-style-type: none; - margin: 0; - padding: 0; -} - -dl { - margin-bottom: 0.75em; -} - -dl dt { - font-weight: 600; - margin-top: 0.75em; -} - -dl dd { - margin: 0; -} - -picture, -img { - max-width: 100%; - height: auto; - vertical-align: top; -} - -table { - border-collapse: collapse; - margin: 0.75em 0; - table-layout: fixed; - width: 100%; -} - -th { - border-bottom: 1px solid #a6a6a6; - font-weight: 600; - padding: 0.75em 0; - text-align: left; -} - -td { - border-bottom: 1px solid #ddd; - padding: 0.75em 0; -} - -tr, -td, -th { - vertical-align: middle; -} - -body { - color: #333; - font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif; - font-size: 16px; - line-height: 1.5; - letter-spacing: 0.03em; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif; - font-size: 16px; - line-height: 1.3; - margin: 0 0 0.75em; -} - -h1 { - font-size: 2.2em; -} - -h2 { - font-size: 1.8em; -} - -h3 { - font-size: 1.4em; -} - -h4 { - font-size: 1.2em; -} - -h5 { - font-size: 1.1em; -} - -p { - margin: 0 0 0.75em; -} - -a { - color: #555; - text-decoration: none; - transition: color 150ms ease; -} - -a:active, a:focus, a:hover { - color: #404040; -} - -hr { - border-bottom: 1px solid #ddd; - border-left: 0; - border-right: 0; - border-top: 0; - margin: 1.5em 0; -} - -pre, code, tt { - font: 1em "andale mono", "lucida console", monospace; - line-height: 1.5; -} - -pre { - background-color: #efefef; - display: block; - padding: 5px; - margin: 5px 0; - border: 1px solid #aaaaaa; -} - -abbr { - border-bottom: 1px dotted #666666; - cursor: help; - white-space: nowrap; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/css/components/components.css b/sites/all/themes/contrib/basic/css/components/components.css deleted file mode 100644 index 08e57a08c..000000000 --- a/sites/all/themes/contrib/basic/css/components/components.css +++ /dev/null @@ -1,33 +0,0 @@ -html { - box-sizing: border-box; -} - -*, *::after, *::before { - box-sizing: inherit; -} - -.breadcrumb li { - list-style-type: none; - display: inline-block; -} - -#navigation li { - list-style-type: none; - display: inline-block; -} - -.site-name { - font-size: 2.2em; - line-height: 1.3em; - font-weight: 300; - padding: 0 0 0.5em; - margin: 0; -} - -.pager__item { - display: inline; -} - -.pager__item a { - display: inline-block; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/css/components/messages.css b/sites/all/themes/contrib/basic/css/components/messages.css deleted file mode 100644 index 395ec23e1..000000000 --- a/sites/all/themes/contrib/basic/css/components/messages.css +++ /dev/null @@ -1,50 +0,0 @@ -html { - box-sizing: border-box; -} - -*, *::after, *::before { - box-sizing: inherit; -} - -.messages { - padding: 9px; - margin: 1em 0; - color: #919191; - background-color: #ddd; - border: 1px solid #c4c4c4; - word-wrap: break-word; -} - -.messages pre { - border: 0; -} - -.messages--warning { - color: #903023; - background-color: #ddc44f; - border-color: #d1b328; -} - -.messages--warning pre { - background-color: #d1b328; -} - -.messages--error { - color: white; - background-color: #cd4533; - border-color: #a53728; -} - -.messages--error pre { - background-color: #a53728; -} - -.messages--status { - color: #304319; - background-color: #8dbe51; - border-color: #73a03c; -} - -.messages--status pre { - background-color: #73a03c; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/css/components/tabs.css b/sites/all/themes/contrib/basic/css/components/tabs.css deleted file mode 100644 index 8392afa33..000000000 --- a/sites/all/themes/contrib/basic/css/components/tabs.css +++ /dev/null @@ -1,24 +0,0 @@ -html { - box-sizing: border-box; -} - -*, *::after, *::before { - box-sizing: inherit; -} - -ul.tabs { - width: 100%; - margin: 0 0 5px; - border-bottom: 1px solid #ddd; -} - -ul.tabs li { - display: inline-block; -} - -ul.tabs a { - display: block; - border: 1px solid #ddd; - border-bottom: 0; - border-radius: 3px 3px 0 0; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/css/layout/layout.css b/sites/all/themes/contrib/basic/css/layout/layout.css deleted file mode 100644 index 89a759b57..000000000 --- a/sites/all/themes/contrib/basic/css/layout/layout.css +++ /dev/null @@ -1,174 +0,0 @@ -html { - box-sizing: border-box; -} - -*, *::after, *::before { - box-sizing: inherit; -} - -.container { - max-width: 1200px; - margin-left: auto; - margin-right: auto; - width: auto; -} - -.container::after { - clear: both; - content: ""; - display: block; -} - -@media screen and (min-width: 45em) { - .one-sidebar.sidebar-second #content { - float: left; - display: block; - margin-right: 3.22581%; - width: 74.19355%; - } - .one-sidebar.sidebar-second #content:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 60em) { - .one-sidebar.sidebar-second #content { - float: left; - display: block; - margin-right: 2.12766%; - width: 65.95745%; - } - .one-sidebar.sidebar-second #content:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 45em) { - .one-sidebar.sidebar-first #content { - float: left; - display: block; - margin-right: 3.22581%; - width: 74.19355%; - margin-left: 25.80645%; - } - .one-sidebar.sidebar-first #content:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 60em) { - .one-sidebar.sidebar-first #content { - float: left; - display: block; - margin-right: 2.12766%; - width: 74.46809%; - margin-left: 25.53191%; - } - .one-sidebar.sidebar-first #content:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 45em) { - .two-sidebars #content { - float: left; - display: block; - margin-right: 3.22581%; - width: 48.3871%; - margin-left: 25.80645%; - } - .two-sidebars #content:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 60em) { - .two-sidebars #content { - float: left; - display: block; - margin-right: 2.12766%; - width: 40.42553%; - margin-left: 25.53191%; - } - .two-sidebars #content:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 45em) { - #sidebar-first { - float: left; - display: block; - margin-right: 3.22581%; - width: 22.58065%; - margin-left: -77.41935%; - } - #sidebar-first:last-child { - margin-right: 0; - } - .one-sidebar.sidebar-first #sidebar-first { - margin-left: -103.22581%; - } -} - -@media screen and (min-width: 60em) { - #sidebar-first { - float: left; - display: block; - margin-right: 2.12766%; - width: 23.40426%; - margin-left: -68.08511%; - } - #sidebar-first:last-child { - margin-right: 0; - } - .one-sidebar.sidebar-first #sidebar-first { - margin-left: -102.12766%; - } -} - -@media screen and (min-width: 45em) { - #sidebar-second { - float: left; - display: block; - margin-right: 3.22581%; - width: 22.58065%; - margin-left: 0%; - } - #sidebar-second:last-child { - margin-right: 0; - } -} - -@media screen and (min-width: 60em) { - #sidebar-second { - float: left; - display: block; - margin-right: 2.12766%; - width: 31.91489%; - margin-left: 0%; - } - #sidebar-second:last-child { - margin-right: 0; - } -} - -#footer { - float: none; - clear: both; -} - -#header, #footer, -#sidebar-first, -#sidebar-second, -#navigation { - background: rgba(170, 170, 170, 0.2); -} - -#header, -#footer, -.mission, -.breadcrumb, -.node { - clear: both; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/css/theme/print.css b/sites/all/themes/contrib/basic/css/theme/print.css deleted file mode 100644 index eb22536da..000000000 --- a/sites/all/themes/contrib/basic/css/theme/print.css +++ /dev/null @@ -1,34 +0,0 @@ -* { - background-color: transparent; -} - -.sidebar, -#navigation, -#header-region, -#footer, -.breadcrumb, -.tabs, -.feed-icon, -.links { - display: none; -} - -.layout-container { - width: 100%; -} - -#content, -.title { - margin: 20px 0; - width: auto; -} - -a:hover, a:active, a:link, a:visited { - color: black; -} - -#content a:link:after, #content a:visited:after { - content: " (" attr(href) ") "; - font-size: 0.8em; - font-weight: normal; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/css/theme/theme.css b/sites/all/themes/contrib/basic/css/theme/theme.css deleted file mode 100644 index cb389d387..000000000 --- a/sites/all/themes/contrib/basic/css/theme/theme.css +++ /dev/null @@ -1,7 +0,0 @@ -html { - box-sizing: border-box; -} - -*, *::after, *::before { - box-sizing: inherit; -} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/images/optimized/README.txt b/sites/all/themes/contrib/basic/images/optimized/README.txt deleted file mode 100644 index a316d5431..000000000 --- a/sites/all/themes/contrib/basic/images/optimized/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -============================= -Image Minification with Grunt -============================= - -When running Grunt, save images to /images/source and compressed images will -automatically be saved to /images/optimized. - -=========================== -How to Use Grunt with Basic -=========================== - -Grunt requires Node.JS to be installed on your machine. There are various -package managers that can handle this for you. - -https://nodejs.org/download/ - -Once Node.JS is installed, go to basic/grunt and install your Grunt packages: - - npm install - -This will install the neccessary node_modules to run Grunt. Once installed, run -Grunt via the command line: - - grunt - -This will initialize Grunt and start watching changes to your SASS files. Voilà! diff --git a/sites/all/themes/contrib/basic/images/source/README.txt b/sites/all/themes/contrib/basic/images/source/README.txt deleted file mode 100644 index 298d07874..000000000 --- a/sites/all/themes/contrib/basic/images/source/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -============================= -Image Minification with Grunt -============================= - -When running Grunt, save images to /images/source and compressed images will -automatically be saved to /images/optimized. - -=========================== -How to Use Grunt with Basic -=========================== - -Grunt requires Node.JS to be installed on your machine. There are various -package managers that can handle this for you. - -https://nodejs.org/download/ - -Once Node.JS is installed, go to basic/grunt and install your Grunt packages: - - npm install - -This will install the neccessary node_modules to run grunt. Once installed, run -Grunt via the command line: - - grunt - -This will initialize Grunt and start watching changes to your SASS files. Voilà! diff --git a/sites/all/themes/contrib/basic/includes/basic.drush.inc b/sites/all/themes/contrib/basic/includes/basic.drush.inc deleted file mode 100644 index f2d8ef8cf..000000000 --- a/sites/all/themes/contrib/basic/includes/basic.drush.inc +++ /dev/null @@ -1,442 +0,0 @@ - dt('Run through the installation process of the Basic theme.'), - 'options' => array( - 'destination' => array( - 'description' => 'Path to which the theme will be placed. If you\'re providing a relative path, note it is relative to the drupal root.', - 'example-value' => 'themes/', - ), - ), - 'aliases' => array('binstall'), - ); - - return $items; -} - -/** - * Implements hook_drush_help(). - */ -function basic_drush_help($section) { - switch ($section) { - case 'drush:basic-install': - return dt('Runs through an automated process for installing and renaming your theme to use as your own.'); - } -} - -/** - * Implements drush_hook_COMMAND(). - */ -function drush_basic_install() { - drush_print('Checking for npm...'); - $npm_check_output = drush_shell_exec('npm version 2>&1'); - if (strpos($npm_check_output, 'command not found')) { - drush_print('NPM could not be found. Please install npm (https://nodejs.org/en/) and try again.'); - exit(); - } - else { - drush_print('npm was found.'); - } - - // Prompt the user what we're doing. - drush_print('-----------------------------'); - drush_print(dt('Welcome to the Basic Install!')); - drush_print('-----------------------------'); - drush_print(dt('We will perform the automated tasks for you to use your new theme. We will create a copy of the Basic theme and store it in the standard theme directory or in spescified destination.')); - drush_confirm(dt('Do you wish to continue?')); - - // Rebuild the theme data so that we can safely check for the existence of - // themes by using the information provided by list_themes(). - $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->rebuildThemeData(); - - // Prompt for a theme name. - $name = drush_prompt(dt('Please enter the name of that you want for your theme'), 'My Theme'); - - // Try to generate a machine-readable name. If that fails, prompt for one. - if (!$machine_name = drush_basic_generate_theme_name($name)) { - drush_print(dt("Sorry, I couldn't generate a machine-readable name for @name", array( - '@name' => $name, - ))); - } - // Prompt for a theme name using the automatically generated default if any. - drush_set_option('machine-name', drush_basic_require_valid_theme_name(dt('Please enter a machine-readable name for your new theme'), $machine_name)); - - // Try to generate a machine-readable name. If that fails, prompt for one. - if (!$machine_name = drush_get_option('machine-name', drush_basic_generate_theme_name($name))) { - drush_print(dt("Sorry, I couldn't generate a machine-readable name for @name. Please use the '--machine-name' option to specify it manually.", array( - '@name' => $name, - ))); - } - - $origin_path = $theme_handler->getTheme('basic')->getPath(); - $temporary = \Drupal::config('system.file')->get('path.temporary'); - $temp_path = $temporary . '/' . $machine_name; - $destination_path = drush_basic_get_destination($machine_name); - - // Check whether the destination path exist and bail out if it does, - // so we don't delete any important data by accident. - if (file_exists($destination_path)) { - return drush_set_error('BASIC_COPY_PATH', dt('The path !path already exists.', array( - '!path' => $destination_path, - ))); - } - - if (is_dir($temp_path)) { - basic_rm_dir($temp_path); - } - - // Copy into temp directory. - if (!basic_copy_dir($origin_path, $temp_path)) { - return drush_set_error('DRUSH_COPY_DIR_FAILURE', dt('Failed to copy !origin_path to !temp_path.', array( - '!origin_path' => $origin_path, - '!temp_path' => $temp_path, - ))); - } - - // Recursively rewrite the file names and contents of all the files that are - // now in the subtheme's directory to represent the human- and - // machine-readable names of the subtheme. - $search = array( - 'basic' => $machine_name, - 'Basic' => $name, - ); - - if (!drush_basic_rewrite_recursive($temp_path, array_keys($search), array_values($search))) { - return drush_set_error('BASIC_COPY_GENERATE_THEME', dt('Failed to rewrite files and contents while generating theme.')); - } - - // Copy from temp folder into new theme's folder. - if (!basic_copy_dir($temp_path, $destination_path)) { - return drush_set_error('DRUSH_COPY_DIR_FAILURE', dt('Failed to copy !temp_path to !destination_path.', array( - '!temp_path' => $temp_path, - '!destination_path' => $destination_path, - ))); - } - - // Run npm install on the new theme folder. - drush_print(dt("Building node dependencies for the theme @theme. This could take a couple minutes.", array( - '@theme' => $machine_name, - ))); - drush_op('chdir', DRUPAL_ROOT . '/' . $destination_path); - drush_shell_exec('npm install'); - drush_print(dt("Node dependancies have been successfully built.")); - - // Notify user of successful installation. - drush_print(dt("------------------------------------------------------------------")); - drush_print(dt("The new theme, !theme, has been successfully derived from Basic and placed in !destination.", array( - '!theme' => $machine_name, - '!destination' => $destination_path, - ))); - drush_print(dt("------------------------------------------------------------------")); -} - -/** - * Generates a valid machine-readable name for a theme from any string. - * - * @param string $string - * The string to generate the machine-readable name from. - * - * @return string - * The generated machine-readable name. - */ -function drush_basic_generate_theme_name($string) { - // Lowercase to start. - $string = strtolower($string); - // Machine-readable names have to start with a lowercase letter. - // $string = preg_replace('/^[^a-z]+/', '', strtolower($string)); - // Machine-readable names may only contain alphanumeric characters and - // underscores. - $string = preg_replace('/[^a-z0-9_]+/', '_', $string); - // Trim all trailing and leading underscores. - $string = trim($string, '_'); - - // Get list of current themes. - $theme_handler = \Drupal::service('theme_handler'); - $themes = $theme_handler->listInfo(); - - if (isset($themes[$string])) { - $plain = $string; - $counter = 0; - - while (isset($themes[$string])) { - // Make sure that the machine-readable name of the theme is unique. - $string = $plain . '_' . $counter++; - } - } - - return $string; -} - -/** - * Helper function that continuously prompts for a valid machine-readable name. - * - * @param string $message - * The message that should be displayed. - * @param string $default - * (Optional) The default theme name. Defaults to NULL. - * - * @return string - * A valid, unique machine-readable name. - */ -function drush_basic_require_valid_theme_name($message, $default = NULL) { - while (TRUE) { - // Keep prompting for a machine-name until we get an acceptable value. - $prompt = drush_prompt($message, $default); - - if (!preg_match('/^[a-z][a-z0-9_]*$/', $prompt)) { - drush_print('The machine-readable name is invalid. It may only contain lowercase numbers, letters and underscores and must start with a letter.'); - } - else { - - // Get list of current themes. - $theme_handler = \Drupal::service('theme_handler'); - $themes = $theme_handler->listInfo(); - - // Validate that the machine-readable name of the theme is unique. - if (isset($themes[$prompt])) { - drush_print(dt('A theme with the name @name already exists. The machine-readable name must be unique.', array( - '@name' => $prompt, - ))); - } - else { - // The given machine-readable name is valid. Let's proceed. - return $prompt; - } - } - } -} - -/** - * Helper function to get proper destination for the new theme. - * - * @param string $machine_name - * A valid, unique machine-readable name for the new theme. - * - * @return string - * The path to the destination where the new theme should be placed. - */ -function drush_basic_get_destination($machine_name) { - // Find proper destination if no destination option is provided. - if ($destination = drush_get_option('destination')) { - $destination_path = drush_trim_path($destination) . '/' . $machine_name; - } - else { - $site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT'); - if ($site_root == 'sites/default') { - $destination_path = 'themes/' . $machine_name; - } - else { - $destination_path = $site_root . '/themes/' . $machine_name; - } - } - $destination_path = drush_normalize_path($destination_path); - return $destination_path; -} - -/** - * Recursively rewrites (and renames) all files in a given path. - * - * @param string $path - * The path to rewrite all files in. - * @param string|array $search - * The string(s) to look for when replacing the file names and contents. Can - * be an array or a string. - * @param string|array $replace - * The string(s) to replace $search with. Can be an array or a string. - * - * @return bool - * TRUE if the operation succeeded, FALSE otherwise. - * - * @see omega_drush_replace_contents() - * @see str_replace() - */ -function drush_basic_rewrite_recursive($path, $search, $replace) { - if (!is_dir($path)) { - return drush_set_error('INVALID_PATH', dt('The given path !path is not a directory.', array( - '!path' => $path, - ))); - } - - // If the file actually is a directory, proceed with the recursion. - $directory = new DirectoryIterator($path); - - foreach ($directory as $item) { - if ($item->isDot()) { - // Do not process '..' and '.'. - continue; - } - - // Retrieve the path of the current item. - $pathname = $item->getPathname(); - if ($item->isDir() && !drush_basic_rewrite_recursive($pathname, $search, $replace)) { - return FALSE; - } - elseif ($item->isFile()) { - // If it is a file, try to replace its contents. - $content = file_get_contents($pathname); - - // Nothing to replace in empty files. - if (empty($content)) { - unlink($pathname); - continue; - } - - if (($changed_content = str_replace($search, $replace, $content)) === NULL) { - return drush_set_error('REWRITE_FAILURE', dt('There was an error while trying to rewrite !path (!search to !replace)', array( - '!path' => $pathname, - '!search' => $search, - '!replace' => $replace, - ))); - } - - if ($content !== $changed_content) { - file_put_contents($pathname, $changed_content); - } - } - } - - return TRUE; -} - -/** - * Copy $src to $dest. - * - * @param string $src - * The directory to copy. - * @param string $dest - * The destination to copy the source to, including the new name of - * the directory. To copy directory "a" from "/b" to "/c", then - * $src = "/b/a" and $dest = "/c/a". To copy "a" to "/c" and rename - * it to "d", then $dest = "/c/d". - * @param int $overwrite - * Action to take if destination already exists. - * - FILE_EXISTS_OVERWRITE - completely removes existing directory. - * - FILE_EXISTS_ABORT - aborts the operation. - * - FILE_EXISTS_MERGE - Leaves existing files and directories in place. - * - * @return bool - * TRUE on success, FALSE on failure. - */ -function basic_copy_dir($src, $dest, $overwrite = FILE_EXISTS_ABORT) { - // Preflight based on $overwrite if $dest exists. - if (file_exists($dest)) { - if ($overwrite === FILE_EXISTS_OVERWRITE) { - drush_op('drush_delete_dir', $dest, TRUE); - } - elseif ($overwrite === FILE_EXISTS_ABORT) { - return drush_set_error('DRUSH_DESTINATION_EXISTS', dt('Destination directory !dest already exists.', array('!dest' => $dest))); - } - elseif ($overwrite === FILE_EXISTS_MERGE) { - // $overwrite flag may indicate we should merge instead. - drush_log(dt('Merging existing !dest directory', array('!dest' => $dest))); - } - } - // $src readable? - if (!is_readable($src)) { - return drush_set_error('DRUSH_SOURCE_NOT_EXISTS', dt('Source directory !src is not readable or does not exist.', array('!src' => $src))); - } - // $dest writable? - if (!is_writable(dirname($dest))) { - return drush_set_error('DRUSH_DESTINATION_NOT_WRITABLE', dt('Destination directory !dest is not writable.', array('!dest' => dirname($dest)))); - } - // Try to do a recursive copy. - if (@drush_op('_basic_recursive_copy', $src, $dest)) { - return TRUE; - } - - return drush_set_error('DRUSH_COPY_DIR_FAILURE', dt('Unable to copy !src to !dest.', array('!src' => $src, '!dest' => $dest))); -} - -/** - * Internal function called by basic_copy_dir; do not use directly. - */ -function _basic_recursive_copy($src, $destination) { - static $machine_name; - if (!isset($machine_name)) { - $machine_name = drush_get_option('machine-name'); - } - // All subdirectories and contents. - $ignore_directories = array( - 'node_modules', - ); - $no_mask = '/^' . implode('|', $ignore_directories) . '$/'; - - if (is_dir($src)) { - if (!drush_mkdir($destination, TRUE)) { - return FALSE; - } - $dir_handle = opendir($src); - while ($file = readdir($dir_handle)) { - if (($file[0] != '.' || $file == '.gitignore') && !preg_match($no_mask, $file)) { - if (_basic_recursive_copy("$src/$file", "$destination/$file") !== TRUE) { - return FALSE; - } - } - } - closedir($dir_handle); - } - elseif (is_link($src)) { - symlink(readlink($src), $destination); - } - elseif (!copy($src, $destination)) { - return FALSE; - } - - // Rename files with basic. - if (strpos($destination, 'basic') !== FALSE) { - $renamed_destination = str_replace('basic', $machine_name, $destination); - rename($destination, $renamed_destination); - } - - // Preserve file modification time. - touch($destination, filemtime($src)); - - // Preserve execute permission. - if (!is_link($src) && !drush_is_windows()) { - // Get execute bits of $src. - $execperms = fileperms($src) & 0111; - // Apply execute permissions if any. - if ($execperms > 0) { - $perms = fileperms($destination) | $execperms; - chmod($destination, $perms); - } - } - - return TRUE; -} - -/** - * Recursively removes all files within the provided directory. - * - * USE WITH CAUTION. - * - * @param string $dir - * File path for the directory you want to delete. - */ -function basic_rm_dir($dir) { - if (is_dir($dir)) { - $objects = scandir($dir); - foreach ($objects as $object) { - if ($object != "." && $object != "..") { - if (is_dir($dir . "/" . $object)) { - basic_rm_dir($dir . "/" . $object); - } - else { - unlink($dir . "/" . $object); - } - } - } - rmdir($dir); - } -} diff --git a/sites/all/themes/contrib/basic/js/build/scripts.js b/sites/all/themes/contrib/basic/js/build/scripts.js deleted file mode 100644 index 0134f0b4e..000000000 --- a/sites/all/themes/contrib/basic/js/build/scripts.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(Drupal,$,window){Drupal.behaviors.basic={attach:function(context,settings){$(window).load(function(){}),$(window).resize(function(){}),$(window).scroll(function(){})}}}(Drupal,jQuery,this); -//# sourceMappingURL=scripts.js.map \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/js/modernizr.js b/sites/all/themes/contrib/basic/js/modernizr.js deleted file mode 100644 index fd25a67e9..000000000 --- a/sites/all/themes/contrib/basic/js/modernizr.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! modernizr 3.2.0 (Custom Build) | MIT * - * http://modernizr.com/download/?-applicationcache-audio-backgroundsize-borderimage-boxshadow-canvas-canvastext-cssanimations-csscolumns-cssreflections-csstransforms-csstransforms3d-csstransitions-flexbox-flexboxlegacy-fontface-generatedcontent-geolocation-hashchange-history-hsla-indexeddb-inlinesvg-input-inputtypes-localstorage-multiplebgs-opacity-postmessage-rgba-sessionstorage-smil-svg-svgclippaths-textshadow-video-webgl-websockets-websqldatabase-webworkers-domprefixes-hasevent-mq-prefixes-shiv-testallprops-testprop-teststyles !*/ -!function(e,t,n){function r(e,t){return typeof e===t}function a(){var e,t,n,a,o,i,s;for(var c in b)if(b.hasOwnProperty(c)){if(e=[],t=b[c],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nf;f++)if(g=e[f],h=I.style[g],s(g,"-")&&(g=d(g)),I.style[g]!==n){if(o||r(a,"undefined"))return c(),"pfx"==t?g:!0;try{I.style[g]=a}catch(y){}if(I.style[g]!=h)return c(),"pfx"==t?g:!0}return c(),!1}function h(e,t,n,a,o){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+L.join(i+" ")+i).split(" ");return r(t,"string")||r(t,"undefined")?g(s,t,a,o):(s=(e+" "+E.join(i+" ")+i).split(" "),f(s,t,n))}function v(e,t,r){return h(e,n,n,t,r)}var y=[],b=[],x={_version:"3.2.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){b.push({name:e,fn:t,options:n})},addAsyncTest:function(e){b.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=x,Modernizr=new Modernizr,Modernizr.addTest("applicationcache","applicationCache"in e),Modernizr.addTest("geolocation","geolocation"in navigator),Modernizr.addTest("history",function(){var t=navigator.userAgent;return-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")?e.history&&"pushState"in e.history:!1}),Modernizr.addTest("postmessage","postMessage"in e),Modernizr.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),Modernizr.addTest("websockets","WebSocket"in e&&2===e.WebSocket.CLOSING),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("sessionstorage",function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("websqldatabase","openDatabase"in e),Modernizr.addTest("webworkers","Worker"in e);var T=x._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];x._prefixes=T;var w=t.documentElement,S="svg"===w.nodeName.toLowerCase();S||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=b.elements;return"string"==typeof e?e.split(" "):e}function a(e,t){var n=b.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),b.elements=n+" "+e,l(t)}function o(e){var t=y[e[h]];return t||(t={},v++,e[h]=v,y[v]=t),t}function i(e,n,r){if(n||(n=t),u)return n.createElement(e);r||(r=o(n));var a;return a=r.cache[e]?r.cache[e].cloneNode():g.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!a.canHaveChildren||m.test(e)||a.tagUrn?a:r.frag.appendChild(a)}function s(e,n){if(e||(e=t),u)return e.createDocumentFragment();n=n||o(e);for(var a=n.frag.cloneNode(),i=0,s=r(),c=s.length;c>i;i++)a.createElement(s[i]);return a}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return b.shivMethods?i(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(b,t.frag)}function l(e){e||(e=t);var r=o(e);return!b.shivCSS||d||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),u||c(e,r),e}var d,u,f="3.7.3",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,g=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,h="_html5shiv",v=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="",d="hidden"in e,u=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){d=!0,u=!0}}();var b={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:f,shivCSS:p.shivCSS!==!1,supportsUnknownElements:u,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:l,createElement:i,createDocumentFragment:s,addElements:a};e.html5=b,l(t),"object"==typeof module&&module.exports&&(module.exports=b)}("undefined"!=typeof e?e:this,t);var C="Moz O ms Webkit",E=x._config.usePrefixes?C.toLowerCase().split(" "):[];x._domPrefixes=E;var k=function(e){function n(t,n){var a;return t?(n&&"string"!=typeof n||(n=i(n||"div")),t="on"+t,a=t in n,!a&&r&&(n.setAttribute||(n=i("div")),n.setAttribute(t,""),a="function"==typeof n[t],n[t]!==e&&(n[t]=e),n.removeAttribute(t)),a):!1}var r=!("onblur"in t.documentElement);return n}();x.hasEvent=k,Modernizr.addTest("hashchange",function(){return k("hashchange",e)===!1?!1:t.documentMode===n||t.documentMode>7}),Modernizr.addTest("audio",function(){var e=i("audio"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),t.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,""),t.opus=e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),t.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),t.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("canvas",function(){var e=i("canvas");return!(!e.getContext||!e.getContext("2d"))}),Modernizr.addTest("canvastext",function(){return Modernizr.canvas===!1?!1:"function"==typeof i("canvas").getContext("2d").fillText}),Modernizr.addTest("video",function(){var e=i("video"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("webgl",function(){var t=i("canvas"),n="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return n in t?t[n]("webgl")||t[n]("experimental-webgl"):"WebGLRenderingContext"in e}),Modernizr.addTest("multiplebgs",function(){var e=i("a").style;return e.cssText="background:url(https://),url(https://),red url(https://)",/(url\s*\(.*?){3}/.test(e.background)}),Modernizr.addTest("opacity",function(){var e=i("a").style;return e.cssText=T.join("opacity:.55;"),/^0.55$/.test(e.opacity)}),Modernizr.addTest("rgba",function(){var e=i("a").style;return e.cssText="background-color:rgba(150,255,150,.5)",(""+e.backgroundColor).indexOf("rgba")>-1}),Modernizr.addTest("inlinesvg",function(){var e=i("div");return e.innerHTML="","http://www.w3.org/2000/svg"==("undefined"!=typeof SVGRect&&e.firstChild&&e.firstChild.namespaceURI)});var P=i("input"),_="autocomplete autofocus list placeholder max min multiple pattern required step".split(" "),N={};Modernizr.input=function(t){for(var n=0,r=t.length;r>n;n++)N[t[n]]=!!(t[n]in P);return N.list&&(N.list=!(!i("datalist")||!e.HTMLDataListElement)),N}(_);var z="search tel url email datetime date month week time datetime-local number range color".split(" "),R={};Modernizr.inputtypes=function(e){for(var r,a,o,i=e.length,s=":)",c=0;i>c;c++)P.setAttribute("type",r=e[c]),o="text"!==P.type&&"style"in P,o&&(P.value=s,P.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(r)&&P.style.WebkitAppearance!==n?(w.appendChild(P),a=t.defaultView,o=a.getComputedStyle&&"textfield"!==a.getComputedStyle(P,null).WebkitAppearance&&0!==P.offsetHeight,w.removeChild(P)):/^(search|tel)$/.test(r)||(o=/^(url|email|number)$/.test(r)?P.checkValidity&&P.checkValidity()===!1:P.value!=s)),R[e[c]]=!!o;return R}(z),Modernizr.addTest("hsla",function(){var e=i("a").style;return e.cssText="background-color:hsla(120,40%,100%,.5)",s(e.backgroundColor,"rgba")||s(e.backgroundColor,"hsla")});var $="CSS"in e&&"supports"in e.CSS,A="supportsCSS"in e;Modernizr.addTest("supports",$||A);var M={}.toString;Modernizr.addTest("svgclippaths",function(){return!!t.createElementNS&&/SVGClipPath/.test(M.call(t.createElementNS("http://www.w3.org/2000/svg","clipPath")))}),Modernizr.addTest("smil",function(){return!!t.createElementNS&&/SVGAnimate/.test(M.call(t.createElementNS("http://www.w3.org/2000/svg","animate")))});var L=x._config.usePrefixes?C.split(" "):[];x._cssomPrefixes=L;var O=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return l("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"==(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();x.mq=O;var B=x.testStyles=l,F=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,a=533>t&&e.match(/android/gi);return n||a||r}();F?Modernizr.addTest("fontface",!1):B('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),a=r.sheet||r.styleSheet,o=a?a.cssRules&&a.cssRules[0]?a.cssRules[0].cssText:a.cssText||"":"",i=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);Modernizr.addTest("fontface",i)}),B('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}',function(e){Modernizr.addTest("generatedcontent",e.offsetHeight>=7)});var j=function(t){var r,a=T.length,o=e.CSSRule;if("undefined"==typeof o)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in o)return"@"+t;for(var i=0;a>i;i++){var s=T[i],c=s.toUpperCase()+"_"+r;if(c in o)return"@-"+s.toLowerCase()+"-"+t}return!1};x.atRule=j;var D={elem:i("modernizr")};Modernizr._q.push(function(){delete D.elem});var I={style:D.elem.style};Modernizr._q.unshift(function(){delete I.style});var W=x.testProp=function(e,t,r){return g([e],n,t,r)};Modernizr.addTest("textshadow",W("textShadow","1px 1px")),x.testAllProps=h,x.testAllProps=v,Modernizr.addTest("cssanimations",v("animationName","a",!0)),Modernizr.addTest("backgroundsize",v("backgroundSize","100%",!0)),Modernizr.addTest("borderimage",v("borderImage","url() 1",!0)),Modernizr.addTest("boxshadow",v("boxShadow","1px 1px",!0)),function(){Modernizr.addTest("csscolumns",function(){var e=!1,t=v("columnCount");try{(e=!!t)&&(e=new Boolean(e))}catch(n){}return e});for(var e,t,n=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],r=0;r0){var a=l,f,e=s.substring(0,e).replace(H,i);if(e==i||e.charAt(e.length-1)==o)e+="*";try{f=t(e)}catch(k){}if(f){e=0;for(c=f.length;e-1&&(a=a.substring(0,l));if(a.charAt(0)==":")switch(a.slice(1)){case "root":c=function(a){return b?a!=p:a==p};break;case "target":if(m==8){c=function(a){function c(){var d=location.hash,e=d.slice(1);return b?d==i||a.id!=e:d!=i&&a.id==e}k(j,"hashchange",function(){g(a,d,c())});return c()};break}return!1;case "checked":c=function(a){J.test(a.type)&&k(a,"propertychange",function(){event.propertyName=="checked"&&g(a,d,a.checked!==b)});return a.checked!==b};break;case "disabled":b=!b;case "enabled":c=function(c){if(K.test(c.tagName))return k(c,"propertychange",function(){event.propertyName=="$disabled"&&g(c,d,c.a===b)}),q.push(c),c.a=c.disabled,c.disabled===b;return a==":enabled"?b:!b};break;case "focus":e="focus",f="blur";case "hover":e||(e="mouseenter",f="mouseleave");c=function(a){k(a,b?f:e,function(){g(a,d,!0)});k(a,b?e:f,function(){g(a,d,!1)});return b};break;default:if(!L.test(a))return!1}return{className:d,b:c}}function w(a){return M+"-"+(m==6&&N?O++:a.replace(P,function(a){return a.charCodeAt(0)}))}function D(a){return a.replace(x,h).replace(Q,o)}function g(a,c,d){var b=a.className,c=u(b,c,d);if(c!=b)a.className=c,a.parentNode.className+=i}function u(a,c,d){var b=RegExp("(^|\\s)"+c+"(\\s|$)"),e=b.test(a);return d?e?a:a+o+c:e?a.replace(b,h).replace(x,h):a}function k(a,c,d){a.attachEvent("on"+c,d)}function r(a,c){if(/^https?:\/\//i.test(a))return c.substring(0,c.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return c.substring(0,c.indexOf("/",8))+a;var d=c.split(/[?#]/)[0];a.charAt(0)!="?"&&d.charAt(d.length-1)!="/"&&(d=d.substring(0,d.lastIndexOf("/")+1));return d+a}function y(a){if(a)return n.open("GET",a,!1),n.send(),(n.status==200?n.responseText:i).replace(R,i).replace(S,function(c,d,b,e,f){return y(r(b||f,a))}).replace(T,function(c,d,b){d=d||i;return" url("+d+r(b,a)+d+") "});return i}function U(){var a,c;a=f.getElementsByTagName("BASE");for(var d=a.length>0?a[0].href:f.location.href,b=0;b0&&setInterval(function(){for(var a=0,c=q.length;a8||!n)){var z={NW:"*.Dom.select",MooTools:"$$",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",Sizzle:"*",jQuery:"*",dojo:"*.query"},t,q=[],O=0,N=!0,M="slvzr",R=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,S=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g,T=/\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g,L=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,B=/:(:first-(?:line|letter))/g,C=/(^|})\s*([^\{]*?[\[:][^{]+)/g,G=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,H=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,P=/[^\w-]/g,K=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,J=/^(checkbox|radio)$/,v=m>6?/[\$\^*]=(['"])\1/:null,E=/([(\[+~])\s+/g,F=/\s+([)\]+~])/g,Q=/\s+/g,x=/^\s*((?:[\S\s]*\S)?)\s*$/,i="",o=" ",h="$1";(function(a,c){function d(){try{p.doScroll("left")}catch(a){setTimeout(d,50);return}b("poll")}function b(d){if(!(d.type=="readystatechange"&&f.readyState!="complete")&&((d.type=="load"?a:f).detachEvent("on"+d.type,b,!1),!e&&(e=!0)))c.call(a,d.type||d)}var e=!1,g=!0;if(f.readyState=="complete")c.call(a,i);else{if(f.createEventObject&&p.doScroll){try{g=!a.frameElement}catch(h){}g&&d()}k(f,"readystatechange",b);k(a,"load",b)}})(j,function(){for(var a in z){var c,d,b=j;if(j[a]){for(c=z[a].replace("*",a).split(".");(d=c.shift())&&(b=b[d]););if(typeof b=="function"){t=b;U();break}}}})}}})(this); diff --git a/sites/all/themes/contrib/basic/js/source/scripts.js b/sites/all/themes/contrib/basic/js/source/scripts.js deleted file mode 100644 index f93ce6fc3..000000000 --- a/sites/all/themes/contrib/basic/js/source/scripts.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file - * A JavaScript file for the theme. - * - * In order for this JavaScript to be loaded on pages, see the instructions in - * the README.txt next to this file. - */ - -// JavaScript should be made compatible with libraries other than jQuery by -// wrapping it with an "anonymous closure". See: -// - https://drupal.org/node/1446420 -// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth -(function (Drupal, $) { - 'use strict'; - - // To understand behaviors, see https://www.drupal.org/node/2269515 - Drupal.behaviors.basic = { - attach: function (context, settings) { - - // Execute code once the DOM is ready. $(handler) not required - // within Drupal.behaviors. - $(window).on('load', function () { - // Execute code once the window is fully loaded. - }); - - $(window).on('resize', function () { - // Execute code when the window is resized. - }); - - $(window).on('scroll', function () { - // Execute code when the window scrolls. - }); - - } - }; - -})(Drupal, jQuery); diff --git a/sites/all/themes/contrib/basic/logo.png b/sites/all/themes/contrib/basic/logo.png deleted file mode 100644 index f460ad61e584e4d67e5f373f05a1d7e947f80995..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1584 zcmV-02G9A4P)tG4MjCETd026K5Q1+voIO4fU2LOJx?Ca-T^Job{_^1FwNUEV+Y~~1%&tF+B8VHB@S|i9h4wIJ{d~J1HLOiZ)-q&z=2yUk~$Z^HL6aO_!NX2 ztcSON1lsa9f`97)gzDrdP$Lxve5DiokeOB}3Z7}ixHnSkvsBF$0t)Uk3(58*p$LE* zRhg##(nh6=clHR7XLG{vSy1O251_JA&4{6&Mg>c0;{*^um8i-k-FlSz(vGsR z-}n$Z8&$I8x#&7MMh8TVO6+3~Z8Va|7abM#-bV32x|~kX`>ut&hk$m`6V&qk$Pgf| zBzfC&v1fivZRvz)o+1EIPgUQ*v=Zj=xlq^CxuFt%kB-8nh)#ruJ_U^(h^2!v3XSt~ zNz-FT+6Dal6kwD=`*YK^3(X_F=0N5&b)d@XY`Ytaq9CNTClU!V8MmT*0O{6&7BHp6 zmGd-qARaFzRY|T@W)Pe?7ihcAL>(&xVT2caUy0vKRNNp;H?Yz$PwG+e@OhK|_SJ0zgeX$-x$8oN4?Z0(Ts>5f$>l;S{;KJN z07OM{#ST2iR0Hrjsaf<0m!xOtm#t$7T#(N<0f=wu;9`K4Tq^hFcqsMwbY>2Y%PWbN zNc!ZyM+rm>Q5-b(n=MfXTr+1oXfV6wdsU0=N2Nk+ zSI2Gn-W^88Ib#H?d7EsherU`~P_aQenG! zsz$oytbIG_H99tQaBVhCQRzmVCK}@S$lh**f3Ab{z-7a;>lJm4$lJ}JZYEV)fN|oF - - - - - - - - - - - - - - - - - - diff --git a/sites/all/themes/contrib/basic/package.json b/sites/all/themes/contrib/basic/package.json deleted file mode 100644 index 31b69dffd..000000000 --- a/sites/all/themes/contrib/basic/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "basic", - "version": "0.1.0", - "dependencies": { - "bourbon": "~4.3.0", - "bourbon-neat": "~1.8.0", - "grunt": "^1.0.1", - "autoprefixer": "^6.7.2", - "grunt-browser-sync": "^2.2.0", - "grunt-contrib-concat": "^1.0.1", - "grunt-contrib-imagemin": "^1.0.1", - "grunt-contrib-uglify": "^2.1.0", - "grunt-contrib-watch": "^1.0.0", - "grunt-notify": "^0.4.5", - "grunt-sass": "^2.0.0", - "grunt-svgmin": "^4.0.0", - "grunt-postcss": "^0.8.0", - "pixrem": "^3.0.2", - "postcss": "^5.2.12" - }, - "description": "=========================== How to Use Grunt with Basic ===========================", - "main": "Gruntfile.js", - "devDependencies": {}, - "author": "", - "license": "MIT" -} diff --git a/sites/all/themes/contrib/basic/sass/base/_buttons.sass b/sites/all/themes/contrib/basic/sass/base/_buttons.sass deleted file mode 100755 index 0aebf6b92..000000000 --- a/sites/all/themes/contrib/basic/sass/base/_buttons.sass +++ /dev/null @@ -1,32 +0,0 @@ -// Button styles -#{$all-buttons} - appearance: none - background-color: $action-color - border: 0 - border-radius: $base-border-radius - color: #fff - cursor: pointer - display: inline-block - font-family: $base-font-family - font-size: $base-font-size - -webkit-font-smoothing: antialiased - font-weight: 600 - line-height: 1 - padding: $small-spacing $base-spacing - text-decoration: none - transition: background-color $base-duration $base-timing - user-select: none - vertical-align: middle - white-space: nowrap - - &:hover, - &:focus - background-color: shade($action-color, 20%) - color: #fff - - &:disabled - cursor: not-allowed - opacity: 0.5 - - &:hover - background-color: $action-color diff --git a/sites/all/themes/contrib/basic/sass/base/_forms.sass b/sites/all/themes/contrib/basic/sass/base/_forms.sass deleted file mode 100755 index 5a62704c3..000000000 --- a/sites/all/themes/contrib/basic/sass/base/_forms.sass +++ /dev/null @@ -1,71 +0,0 @@ -// Form styles -fieldset - background-color: transparent - border: 0 - margin: 0 - padding: 0 - -legend - font-weight: 600 - margin-bottom: $small-spacing / 2 - padding: 0 - -label - display: block - font-weight: normal - margin-bottom: $small-spacing / 2 - -input, -select - display: block - font-family: $base-font-family - font-size: $base-font-size - -#{$all-text-inputs}, -select[multiple] - background-color: $base-background-color - border: $base-border - border-radius: $base-border-radius - box-shadow: $form-box-shadow - box-sizing: border-box - font-family: $base-font-family - font-size: $base-font-size - margin-bottom: $small-spacing - padding: $base-spacing / 3 - transition: border-color $base-duration $base-timing - width: 100% - - &:hover - border-color: shade($base-border-color, 20%) - - &:focus - border-color: $action-color - box-shadow: $form-box-shadow-focus - outline: none - - &:disabled - background-color: shade($base-background-color, 5%) - cursor: not-allowed - - &:hover - border: $base-border - -textarea - resize: vertical - -[type="search"] - appearance: none - -[type="checkbox"], -[type="radio"] - display: inline - margin-right: $small-spacing / 2 - -[type="file"] - margin-bottom: $small-spacing - width: 100% - -select - margin-bottom: $base-spacing - max-width: 100% - width: auto diff --git a/sites/all/themes/contrib/basic/sass/base/_lists.sass b/sites/all/themes/contrib/basic/sass/base/_lists.sass deleted file mode 100755 index 021d0c47a..000000000 --- a/sites/all/themes/contrib/basic/sass/base/_lists.sass +++ /dev/null @@ -1,16 +0,0 @@ -// List styles -ul, -ol - list-style-type: none - margin: 0 - padding: 0 - -dl - margin-bottom: $small-spacing - -dt - font-weight: 600 - margin-top: $small-spacing - -dd - margin: 0 diff --git a/sites/all/themes/contrib/basic/sass/base/_media.sass b/sites/all/themes/contrib/basic/sass/base/_media.sass deleted file mode 100644 index 9a0eaddd8..000000000 --- a/sites/all/themes/contrib/basic/sass/base/_media.sass +++ /dev/null @@ -1,9 +0,0 @@ -// Media styles -figure - margin: 0 - -img, -picture - max-width: 100% - height: auto - vertical-align: top diff --git a/sites/all/themes/contrib/basic/sass/base/_tables.sass b/sites/all/themes/contrib/basic/sass/base/_tables.sass deleted file mode 100755 index 602bc9d1a..000000000 --- a/sites/all/themes/contrib/basic/sass/base/_tables.sass +++ /dev/null @@ -1,21 +0,0 @@ -// Table styles -table - border-collapse: collapse - margin: $small-spacing 0 - table-layout: fixed - width: 100% - -th - border-bottom: 1px solid shade($base-border-color, 25%) - font-weight: 600 - padding: $small-spacing 0 - text-align: left - -td - border-bottom: $base-border - padding: $small-spacing 0 - -tr, -td, -th - vertical-align: middle diff --git a/sites/all/themes/contrib/basic/sass/base/_typography.sass b/sites/all/themes/contrib/basic/sass/base/_typography.sass deleted file mode 100755 index fb71f2513..000000000 --- a/sites/all/themes/contrib/basic/sass/base/_typography.sass +++ /dev/null @@ -1,71 +0,0 @@ -// Typographic styles -body - color: $base-font-color - font-family: $base-font-family - font-size: $base-font-size - line-height: $base-line-height - letter-spacing: $base-letter-spacing - -h1, -h2, -h3, -h4, -h5, -h6 - font-family: $heading-font-family - font-size: $base-font-size - line-height: $heading-line-height - margin: 0 0 $small-spacing - -h1 - font-size: 2.2em - -h2 - font-size: 1.8em - -h3 - font-size: 1.4em - -h4 - font-size: 1.2em - -h5 - font-size: 1.1em - -p - margin: 0 0 $small-spacing - -a - color: $action-color - text-decoration: none - transition: color $base-duration $base-timing - - &:active, - &:focus, - &:hover - color: shade($action-color, 25%) - -hr - border-bottom: $base-border - border-left: 0 - border-right: 0 - border-top: 0 - margin: $base-spacing 0 - -// Code -pre, code, tt - font: 1em "andale mono", "lucida console", monospace - line-height: 1.5 - -pre - background-color: #efefef - display: block - padding: 5px - margin: 5px 0 - border: 1px solid #aaaaaa - -// Abbreviation -abbr - border-bottom: 1px dotted #666666 - cursor: help - white-space: nowrap diff --git a/sites/all/themes/contrib/basic/sass/base/base.sass b/sites/all/themes/contrib/basic/sass/base/base.sass deleted file mode 100644 index 18ecac31d..000000000 --- a/sites/all/themes/contrib/basic/sass/base/base.sass +++ /dev/null @@ -1,13 +0,0 @@ -@import "../config/config" - -// BASE: HTML element styling Read more about SMACSS categorization for Drupal -// Themes: https://www.drupal.org/node/1887922 - -// This file is complied separately so we can pull in config dependencies above -// while also maintaining Drupal SMACSS structure. -@import "buttons" -@import "forms" -@import "lists" -@import "media" -@import "tables" -@import "typography" diff --git a/sites/all/themes/contrib/basic/sass/components/_breadcrumb.sass b/sites/all/themes/contrib/basic/sass/components/_breadcrumb.sass deleted file mode 100644 index 248bc0272..000000000 --- a/sites/all/themes/contrib/basic/sass/components/_breadcrumb.sass +++ /dev/null @@ -1,5 +0,0 @@ -// Breadcrumb styles -.breadcrumb - li - list-style-type: none - display: inline-block diff --git a/sites/all/themes/contrib/basic/sass/components/_navigation.sass b/sites/all/themes/contrib/basic/sass/components/_navigation.sass deleted file mode 100644 index 786ea89e2..000000000 --- a/sites/all/themes/contrib/basic/sass/components/_navigation.sass +++ /dev/null @@ -1,5 +0,0 @@ -// Navigation styles -#navigation - li - list-style-type: none - display: inline-block diff --git a/sites/all/themes/contrib/basic/sass/components/_pager.sass b/sites/all/themes/contrib/basic/sass/components/_pager.sass deleted file mode 100644 index 65cb0e219..000000000 --- a/sites/all/themes/contrib/basic/sass/components/_pager.sass +++ /dev/null @@ -1,5 +0,0 @@ -.pager__item - display: inline - - a - display: inline-block \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/sass/components/_site-name.sass b/sites/all/themes/contrib/basic/sass/components/_site-name.sass deleted file mode 100644 index c507b8956..000000000 --- a/sites/all/themes/contrib/basic/sass/components/_site-name.sass +++ /dev/null @@ -1,7 +0,0 @@ -// Site name -.site-name - font-size: 2.2em - line-height: 1.3em - font-weight: 300 - padding: 0 0 0.5em - margin: 0 diff --git a/sites/all/themes/contrib/basic/sass/components/components.sass b/sites/all/themes/contrib/basic/sass/components/components.sass deleted file mode 100644 index 674d5ac6d..000000000 --- a/sites/all/themes/contrib/basic/sass/components/components.sass +++ /dev/null @@ -1,11 +0,0 @@ -@import "../config/config" - -// COMPONENTS: Discrete, reusable UI elements -// Read more about SMACSS categorization for Drupal themes: https://www.drupal.org/node/1887922 - -// This file is complied separately so we can pull in config dependencies above -// while also maintaining Drupals SMACSS structure. -@import "breadcrumb" -@import "navigation" -@import "site-name" -@import "pager" \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/sass/components/messages.sass b/sites/all/themes/contrib/basic/sass/components/messages.sass deleted file mode 100644 index 40c85a512..000000000 --- a/sites/all/themes/contrib/basic/sass/components/messages.sass +++ /dev/null @@ -1,33 +0,0 @@ -@import "../config/config" - -// Messages. -.messages - padding: 9px - margin: 1em 0 - color: darken($light-gray, 30%) - background-color: $light-gray - border: 1px solid darken($light-gray, 10%) - word-wrap: break-word - pre - border: 0 - -.messages--warning - color: darken($error-color, 15%) - background-color: $warning-color - border-color: darken($warning-color, 10%) - pre - background-color: darken($warning-color, 10%) - -.messages--error - color: white - background-color: $error-color - border-color: darken($error-color, 10%) - pre - background-color: darken($error-color, 10%) - -.messages--status - color: darken($status-color, 35%) - background-color: $status-color - border-color: darken($status-color, 10%) - pre - background-color: darken($status-color, 10%) \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/sass/components/tabs.sass b/sites/all/themes/contrib/basic/sass/components/tabs.sass deleted file mode 100644 index 9c56d24e0..000000000 --- a/sites/all/themes/contrib/basic/sass/components/tabs.sass +++ /dev/null @@ -1,16 +0,0 @@ -@import "../config/config" - -// Tabs. -ul.tabs - width: 100% - margin: 0 0 5px - border-bottom: 1px solid $light-gray - - li - display: inline-block - - a - display: block - border: 1px solid $light-gray - border-bottom: 0 - border-radius: 3px 3px 0 0 \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/sass/config/_config.sass b/sites/all/themes/contrib/basic/sass/config/_config.sass deleted file mode 100644 index 0819bd169..000000000 --- a/sites/all/themes/contrib/basic/sass/config/_config.sass +++ /dev/null @@ -1,36 +0,0 @@ -// Config -// --------- -// Use the same color all over the place? Need to do -// some math with height and width and text size? -// Sass supports variables as well as basic math -// operations and many useful functions. -// -// For setting variables, see: -// /sass/config/_variables.sass -// -// For setting mixins: -// /sass/config/_mixins.sass -// -// For complete documentation: -// http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables_ -// -// Available functions: -// http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html - -// Bourbon and Bourbon Neat documentation: -// Bourbon: http://bourbon.io/docs/ -// Bourbon Neat (grid): http://neat.bourbon.io/docs/ - -// Import variables and mixins to be used (Bourbon) -@import "../../node_modules/bourbon/app/assets/stylesheets/bourbon" -@import "../../node_modules/bourbon-neat/app/assets/stylesheets/neat-helpers" - -// Import grid to be used (Bourbon Neat) -@import "grid-settings" - -// We load this after we provide our overrides -@import "../../node_modules/bourbon-neat/app/assets/stylesheets/neat" - -// Import local files -@import "variables" -@import "mixins" diff --git a/sites/all/themes/contrib/basic/sass/config/_grid-settings.sass b/sites/all/themes/contrib/basic/sass/config/_grid-settings.sass deleted file mode 100755 index df3c14638..000000000 --- a/sites/all/themes/contrib/basic/sass/config/_grid-settings.sass +++ /dev/null @@ -1,27 +0,0 @@ -// Bourbon grid display. Set to "true" to turn on. -// $visual-grid: false -// $visual-grid-color: #EEEEEE -// $visual-grid-index: back -// $visual-grid-opacity: 0.4 - -// Set to false if you'd like to remove the responsiveness -$responsive: true - -// Neat Overrides -$column: 60px -$gutter: 20px -$grid-columns: 4 - -// We set the max width of the page. -$font-size: 16px -$max-width: 1200px - -// Breakpoints -$small-screen: 320px -$medium-screen: 720px -$large-screen: 960px - -// Define your mobile first breakpoints using min-width -$small-screen-up: new-breakpoint(min-width #{$small-screen/$font-size}em 4) -$medium-screen-up: new-breakpoint(min-width #{$medium-screen/$font-size}em 8) -$large-screen-up: new-breakpoint(min-width #{$large-screen/$font-size}em 12) diff --git a/sites/all/themes/contrib/basic/sass/config/_mixins.sass b/sites/all/themes/contrib/basic/sass/config/_mixins.sass deleted file mode 100644 index fd310985c..000000000 --- a/sites/all/themes/contrib/basic/sass/config/_mixins.sass +++ /dev/null @@ -1,19 +0,0 @@ -// Mixins -// -------- -// Mixins allow you to define styles that can be re-used / throughout the -// stylesheet without needing to resort to / non-semantic classes like .float- -// left. Mixins can also / contain full CSS rules, and anything else allowed / -// elsewhere in a Sass document. They can even take / arguments which allows you -// to produce a wide variety / of styles with very few mixins. - -// For complete documentation: -// Sass mixins: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins -// Bourbon mixins: http://bourbon.io/docs/ - -// Omega Reset for Bourbon Neat grid -// Read more: http://www.joshfry.me/blog/2013/05/13/omega-reset-for-bourbon-neat -@mixin omega-reset($nth) - &:nth-child(#{$nth}) - margin-right: flex-gutter() - &:nth-child(#{$nth}+1) - clear: none diff --git a/sites/all/themes/contrib/basic/sass/config/_variables.sass b/sites/all/themes/contrib/basic/sass/config/_variables.sass deleted file mode 100644 index c089aec5e..000000000 --- a/sites/all/themes/contrib/basic/sass/config/_variables.sass +++ /dev/null @@ -1,65 +0,0 @@ -// Variables -// ----------- -// Use the same color all over the place? Need to do some math with height and -// width and text size? Sass supports variables as well as basic math operations -// and many useful functions. - -// For complete documentation: -// http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables_ - -// Margin/Padding -$margin: $gutter -$padding: $gutter - -// Typography -$base-font-family: $helvetica -$heading-font-family: $base-font-family - -// Font Sizes -$base-font-size: $font-size - -// Line height -$base-line-height: 1.5 -$heading-line-height: 1.3 - -// Letter spacing -$base-letter-spacing: 0.03em - -// Other Sizes -$base-border-radius: 2px -$base-spacing: $base-line-height * 1em -$small-spacing: $base-spacing / 2 -$base-z-index: 0 - -// Colors -$dark-gray: #333 -$medium-gray: #999 -$light-gray: #ddd - -// Brand Colors -$primary-color: #555 - -// Action Colors -$status-color: #8dbe51 -$warning-color: #ddc44f -$error-color: #cd4533 - -// Font Colors -$base-font-color: $dark-gray -$action-color: $primary-color - -// Border -$base-border-color: $light-gray -$base-border: 1px solid $base-border-color - -// Background Colors -$base-background-color: #fff -$secondary-background-color: tint($base-border-color, 75%) - -// Forms -$form-box-shadow: inset 0 1px 3px rgba(#000, 0.06) -$form-box-shadow-focus: $form-box-shadow, 0 0 5px adjust-color($action-color, $lightness: -5%, $alpha: -0.3) - -// Animations -$base-duration: 150ms -$base-timing: ease diff --git a/sites/all/themes/contrib/basic/sass/layout/_layout--grid.sass b/sites/all/themes/contrib/basic/sass/layout/_layout--grid.sass deleted file mode 100644 index 82a6eceb5..000000000 --- a/sites/all/themes/contrib/basic/sass/layout/_layout--grid.sass +++ /dev/null @@ -1,101 +0,0 @@ -// Layout -// ------ -// Using a negative margin technique, made possible with Bourbon Neat, the page -// is loaded in this order: - -// 1. Header -// 2. Content -// 3. Navigation menus -// 4. Sidebar Left -// 5. Sideabr Right -// -// Layout rules. -// (Disclaimer: do not change if you're not sure you know what you're doing.) - -.container - @include outer-container - width: auto - -#content - .no-sidebar & - // 100% width for small screens. No definitions required. - // Same logic for medium screens. No definitions required. - // Same logic for large screens. No definitions required. - - .one-sidebar.sidebar-second & - // 100% width for small screens. No definitions required. - // Span this div 6 columns wide for medium screens. - @include media($medium-screen-up) - @include span-columns(6) - // Span this div 8 columns wide for large screens. - @include media($large-screen-up) - @include span-columns(8) - - .one-sidebar.sidebar-first & - // 100% width for small screens. No definitions required. - // Span this div 6 columns wide for medium screens. - @include media($medium-screen-up) - @include span-columns(6) - @include shift(2) - // Span this div 9 columns wide for large screens. - @include media($large-screen-up) - @include span-columns(9) - @include shift(3) - - .two-sidebars & - // 100% width for small screens. No definitions required. - // Span this div 4 columns wide for medium screens. - @include media($medium-screen-up) - @include span-columns(4) - @include shift(2) - // Span this div 5 columns wide for large screens. - @include media($large-screen-up) - @include span-columns(5) - @include shift(3) - -#sidebar-first - // 100% width for small screens. No definitions required. - // Span this div 2 columns wide for medium screens. - @include media($medium-screen-up) - @include span-columns(2) - // Shift it to the left to place it in the far left column. Different shift for two-sidebar and one-sidebar layout. - @include shift(-6) - .one-sidebar.sidebar-first & - @include shift(-8) - @include media($large-screen-up) - // Span this div 3 columns wide for large screens. - @include span-columns(3) - // Shift it to the left to place it in the far left column. Different shift for two-sidebar and one-sidebar layout. - @include shift(-8) - .one-sidebar.sidebar-first & - @include shift(-12) - -#sidebar-second - // 100% width for small screens. No definitions required. - // Span this div 2 columns wide for medium screens. - @include media($medium-screen-up) - @include span-columns(2) - @include shift(0) - @include media($large-screen-up) - // Span this div 4 columns wide for large screens. - @include span-columns(4) - @include shift(0) - -#footer - float: none - clear: both - -// Region Colors. Delete when starting a new theme. -#header, #footer, -#sidebar-first, -#sidebar-second, -#navigation - background: rgba(#aaa, 0.2) - -// Layout Helpers -#header, -#footer, -.mission, -.breadcrumb, -.node - clear: both diff --git a/sites/all/themes/contrib/basic/sass/layout/layout.sass b/sites/all/themes/contrib/basic/sass/layout/layout.sass deleted file mode 100644 index 9b5a5cb41..000000000 --- a/sites/all/themes/contrib/basic/sass/layout/layout.sass +++ /dev/null @@ -1,8 +0,0 @@ -@import "../config/config" - -// LAYOUT: Macro arrangement of a web page, including any grid systems. -// Read more about SMACSS categorization for Drupal Themes: https://www.drupal.org/node/1887922 - -// This file is complied separately so we can pull in config dependencies above -// while also maintaining Drupals SMACSS structure. -@import "layout--grid" diff --git a/sites/all/themes/contrib/basic/sass/theme/print.sass b/sites/all/themes/contrib/basic/sass/theme/print.sass deleted file mode 100644 index c03d6516a..000000000 --- a/sites/all/themes/contrib/basic/sass/theme/print.sass +++ /dev/null @@ -1,36 +0,0 @@ -// Use this stylesheet for print styles only. -* - background-color: transparent - -.sidebar, -#navigation, -#header-region, -#footer, -.breadcrumb, -.tabs, -.feed-icon, -.links - display: none - -.layout-container - width: 100% - -#content, -.title - margin: 20px 0 - width: auto - -a - &:hover, - &:active, - &:link, - &:visited - color: black - -// CSS2 selector to add visible href after links. -#content a - &:link:after, - &:visited:after - content: " (" attr(href) ") " - font-size: 0.8em - font-weight: normal diff --git a/sites/all/themes/contrib/basic/sass/theme/theme.sass b/sites/all/themes/contrib/basic/sass/theme/theme.sass deleted file mode 100644 index b38e01bdf..000000000 --- a/sites/all/themes/contrib/basic/sass/theme/theme.sass +++ /dev/null @@ -1,9 +0,0 @@ -@import "../config/config" - -// THEME: purely visual styling (“look-and-feel”) for a component. -// Read more about SMACSS categorization for Drupal Themes: https://www.drupal.org/node/1887922 -// When following SMCASS, this would be used for dark/light themes (not general styling): https://smacss.com/book/type-theme - -// This file is complied separately so we can pull in config dependencies above -// while also maintaining Drupals SMACSS structure. -// @import "theme/theme--light" diff --git a/sites/all/themes/contrib/basic/screenshot.png b/sites/all/themes/contrib/basic/screenshot.png deleted file mode 100644 index 1012e28389ed70535a16882d7782b4a85371a106..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2134 zcmbVNdpOg78y+Pc73CZ$U&-+*%FLYdv$n4}HFM08G&GZ!Mr_I<${~l1sAc>rrcs2l zjOC4r9FsE{NzRADDnomx_n&_M{yx|Bxu5HLuKT&~`}zFyNp!SF?%J-j9Rh*u0#Vi& z2t+Jjbm3b!i8=)jB&edINJ6-goPvBwSG+^;kdqgJ&g0d-ws$J}iRrsHixN znqfe>wgQ1jR)N+hvEc)=jQ+4jo5G2Z>|_E zJq`f=#0_on4W&PDgL81(pZHII0V2ssL%O~6eXbTLDvk`T#GZL{<^-snIL<|rD%FrMikwh^zi(GM8QXndJZ@Os39Lq%D)RpLb zlE$`R-S|mr#DzopM?W(jlmti7sA~dR(MfLQ^%HY@{EL*9XE>+cX^$jTy3eZWV7*-I z({e`_OI(x7r(KeEptWaOdDWa{GkQe-CHBgR>Ot)kB5`$XJC}PmYFX>?YSExUZ9d?g z;^{K`wmLusuA@BBnbXYJb=TuHI8EPNS!MxDtvYZiy)T1rRQD(T81bK^4+U1(-2xtd zl;F!}08yjsYcFij?qQf|*Fje-T)vhZ`-vBYTF+Et?5*f!Y&lp!ly7}}E4@p$c`yyn zTKV4n1^B}6(jf(LQx@Imv4hJ)<&sCqoX3|bfdYbAx=y)UGNa(_*>BT&cz=jG&~=awt^g0&|Ej$6Om&G%rgw zSNWjLf@8{rHGs;#;#nWiNA^g|P0=iFEH4|V|79Dg3;I&gQZ8U9sW(gl-s9*jLYv#{j#(N#1S;V zAwi5LigUZYm&GwT3?4SRq@dove@9PIzI~I6S)YR>YdXObC2E z+$}#iw1c*fc3#uQ7m9B@OM3Y}^8^>B#zJ78<`iiY?~&gEC+YEre@BU!6)H zV^G3+N16kOn=ogo%dC6?^#}82D34n^8TsfcJ$?Cp{^ITMz*IRL|IH=lV<$`+KzXXv zoU`c1@iEsC+>O16Ztx+=OM~1MxS>l7NAPSiuNK?3@S+?fIAvr?w(-~wrHgw04a7tH zp4ZbZ8w>)#l-vtlY^fJ~+XDLL3-v?!W_kTuTCAWBqOSX*es;*v_^f^&vV>>**PCb! zH7d5~yx&@fNLWoTvo@?F z(`1xEn&khq^5yxKC#uG=0y)Xfn0o`&New+k_ z4{-*`c{WulOJvPV?bWlFp?)_sjysbh&(EdcDl87OzoU>_q{JRp`_b?OXYi*s;-aDr zs{QqHPh_Zxa9b)R#(IKw;nsmPuSZL-fkeR|Xc{nkonm{z~?_}l3N31iJ%!~(5; zK1B1cYq?1HT%i4F>2`gh&O3%5bodch!iMZoKB1F6$Cm?`sV~DVz7^gZzBA2G<916K z7G`C38e0Z3Pr7$V6+@D)&DR?R&bLJpe@XTT`6T-e3D*?cbyIyz){o9gn-!BCn1!?v zgKqSwa8BwQ&TdY5tc(vrGJJp|DslH|z^ku7qLP zmNCQR+0CQM51h^(J`dP&^R5S!)SB3*euQ~zv6-cEA;&x^$w92J3|xGG)P!n-GUE;~ zqxhICtVpu!OLp~T_q}CL2OvX3KQ>mM@)y*3e2mY&)v|c}vxj7kQNUQ8(@?Dn!QU*Q zk5t;JlGktmejq-*^VXXOtNSV4Gqr@KhwT#3Z<>h?P}q#)SJwzFZtcJRNJWFj*Q3OD YLdpg#PY*XW>uo532z%=it8=mc17X?4-v9sr diff --git a/sites/all/themes/contrib/basic/templates/block/block--local-actions-block.html.twig b/sites/all/themes/contrib/basic/templates/block/block--local-actions-block.html.twig deleted file mode 100644 index 0fe6617f4..000000000 --- a/sites/all/themes/contrib/basic/templates/block/block--local-actions-block.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "block.html.twig" %} -{# -/** - * @file - * Theme override for local actions (primary admin actions.) - */ -#} -{% block content %} - {% if content %} - - {% endif %} -{% endblock %} \ No newline at end of file diff --git a/sites/all/themes/contrib/basic/templates/block/block--local-tasks-block.html.twig b/sites/all/themes/contrib/basic/templates/block/block--local-tasks-block.html.twig deleted file mode 100644 index a191c60c2..000000000 --- a/sites/all/themes/contrib/basic/templates/block/block--local-tasks-block.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "@block/block.html.twig" %} -{# -/** - * @file - * Theme override for tabs. - */ -#} -{% block content %} - {% if content %} - - {% endif %} -{% endblock %} diff --git a/sites/all/themes/contrib/basic/templates/block/block--search-form-block.html.twig b/sites/all/themes/contrib/basic/templates/block/block--search-form-block.html.twig deleted file mode 100644 index 667202fb6..000000000 --- a/sites/all/themes/contrib/basic/templates/block/block--search-form-block.html.twig +++ /dev/null @@ -1,45 +0,0 @@ -{# -/** - * @file - * Theme override for the search form block. - * - * Available variables: - * - plugin_id: The ID of the block implementation. - * - label: The configured label of the block if visible. - * - configuration: A list of the block's configuration values, including: - * - label: The configured label for the block. - * - label_display: The display settings for the label. - * - provider: The module or other provider that provided this block plugin. - * - Block plugin specific settings will also be stored here. - * - content: The content of this block. - * - attributes: A list HTML attributes populated by modules, intended to - * be added to the main container tag of this template. Includes: - * - id: A valid HTML ID and guaranteed unique. - * - title_attributes: Same as attributes, except applied to the main title - * tag that appears in the template. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - * - * @see template_preprocess_block() - * @see search_preprocess_block() - */ -#} -{% - set classes = [ - 'block', - 'block-search', - 'container-inline', - ] -%} - - {{ title_prefix }} - {% if label %} - {{ label }} - {% endif %} - {{ title_suffix }} - {% block content %} - {{ content }} - {% endblock %} - diff --git a/sites/all/themes/contrib/basic/templates/block/block--system-branding-block.html.twig b/sites/all/themes/contrib/basic/templates/block/block--system-branding-block.html.twig deleted file mode 100644 index 7c3b7dea1..000000000 --- a/sites/all/themes/contrib/basic/templates/block/block--system-branding-block.html.twig +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "block.html.twig" %} -{# -/** - * @file - * Theme override for a branding block. - * - * Each branding element variable (logo, name, slogan) is only available if - * enabled in the block configuration. - * - * Available variables: - * - site_logo: Logo for site as defined in Appearance or theme settings. - * - site_name: Name for site as defined in Site information settings. - * - site_slogan: Slogan for site as defined in Site information settings. - */ -#} -{% block content %} - {% if site_logo %} - - {% endif %} - {% if site_name %} - - {% endif %} - {% if site_slogan %} -
        {{ site_slogan }}
        - {% endif %} -{% endblock %} diff --git a/sites/all/themes/contrib/basic/templates/block/block--system-menu-block.html.twig b/sites/all/themes/contrib/basic/templates/block/block--system-menu-block.html.twig deleted file mode 100644 index 407f8403f..000000000 --- a/sites/all/themes/contrib/basic/templates/block/block--system-menu-block.html.twig +++ /dev/null @@ -1,56 +0,0 @@ -{# -/** - * @file - * Theme override for a menu block. - * - * Available variables: - * - plugin_id: The ID of the block implementation. - * - label: The configured label of the block if visible. - * - configuration: A list of the block's configuration values. - * - label: The configured label for the block. - * - label_display: The display settings for the label. - * - provider: The module or other provider that provided this block plugin. - * - Block plugin specific settings will also be stored here. - * - content: The content of this block. - * - attributes: HTML attributes for the containing element. - * - id: A valid HTML ID and guaranteed unique. - * - title_attributes: HTML attributes for the title element. - * - content_attributes: HTML attributes for the content element. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - * - * Headings should be used on navigation menus that consistently appear on - * multiple pages. When this menu block's label is configured to not be - * displayed, it is automatically made invisible using the 'visually-hidden' CSS - * class, which still keeps it visible for screen-readers and assistive - * technology. Headings allow screen-reader and keyboard only users to navigate - * to or skip the links. - * See http://juicystudio.com/article/screen-readers-display-none.php and - * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. - */ -#} -{% - set classes = [ - 'block', - 'block-menu', - 'navigation', - 'menu--' ~ derivative_plugin_id|clean_class, - ] -%} -{% set heading_id = attributes.id ~ '-menu'|clean_id %} - diff --git a/sites/all/themes/contrib/basic/templates/block/block.html.twig b/sites/all/themes/contrib/basic/templates/block/block.html.twig deleted file mode 100644 index 5a299a51d..000000000 --- a/sites/all/themes/contrib/basic/templates/block/block.html.twig +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "@block/block.html.twig" %} -{# -/** - * @file - * Theme override to display a block. - * - * Available variables: - * - plugin_id: The ID of the block implementation. - * - label: The configured label of the block if visible. - * - configuration: A list of the block's configuration values. - * - label: The configured label for the block. - * - label_display: The display settings for the label. - * - provider: The module or other provider that provided this block plugin. - * - Block plugin specific settings will also be stored here. - * - content: The content of this block. - * - attributes: array of HTML attributes populated by modules, intended to - * be added to the main container tag of this template. - * - id: A valid HTML ID and guaranteed unique. - * - title_attributes: Same as attributes, except applied to the main title - * tag that appears in the template. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - * - * @see template_preprocess_block() - */ -#} -{% set attributes = attributes.addClass([ - 'block-' ~ configuration.provider|clean_class, - attributes.id -]) %} diff --git a/sites/all/themes/contrib/basic/templates/breadcrumb.html.twig b/sites/all/themes/contrib/basic/templates/breadcrumb.html.twig deleted file mode 100644 index 7dc08c520..000000000 --- a/sites/all/themes/contrib/basic/templates/breadcrumb.html.twig +++ /dev/null @@ -1,25 +0,0 @@ -{# -/** - * @file - * Theme override for a breadcrumb trail. - * - * Available variables: - * - breadcrumb: Breadcrumb trail items. - */ -#} -{% if breadcrumb %} - -{% endif %} diff --git a/sites/all/themes/contrib/basic/templates/comment.html.twig b/sites/all/themes/contrib/basic/templates/comment.html.twig deleted file mode 100755 index a3f3c0dfc..000000000 --- a/sites/all/themes/contrib/basic/templates/comment.html.twig +++ /dev/null @@ -1,109 +0,0 @@ -{# -/** - * @file - * Default theme implementation for comments. - * - * Available variables: - * - author: Comment author. Can be a link or plain text. - * - content: The content-related items for the comment display. Use - * {{ content }} to print them all, or print a subset such as - * {{ content.field_example }}. Use the following code to temporarily suppress - * the printing of a given child element: - * @code - * {{ content|without('field_example') }} - * @endcode - * - created: Formatted date and time for when the comment was created. - * Preprocess functions can reformat it by calling format_date() with the - * desired parameters on the 'comment.created' variable. - * - changed: Formatted date and time for when the comment was last changed. - * Preprocess functions can reformat it by calling format_date() with the - * desired parameters on the 'comment.changed' variable. - * - permalink: Comment permalink. - * - submitted: Submission information created from author and created - * during template_preprocess_comment(). - * - user_picture: The comment author's profile picture. - * - status: Comment status. Possible values are: - * unpublished, published, or preview. - * - title: Comment title, linked to the comment. - * - attributes: HTML attributes for the containing element. - * The attributes.class may contain one or more of the following classes: - * - comment: The current template type; e.g., 'theming hook'. - * - by-anonymous: Comment by an unregistered user. - * - by-{entity-type}-author: Comment by the author of the parent entity, - * eg. by-node-author. - * - preview: When previewing a new or edited comment. - * The following applies only to viewers who are registered users: - * - unpublished: An unpublished comment visible only to administrators. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - * - content_attributes: List of classes for the styling of the comment content. - * - title_attributes: Same as attributes, except applied to the main title - * tag that appears in the template. - * - * These variables are provided to give context about the parent comment (if - * any): - * - comment_parent: Full parent comment entity (if any). - * - parent_author: Equivalent to author for the parent comment. - * - parent_created: Equivalent to created for the parent comment. - * - parent_changed: Equivalent to changed for the parent comment. - * - parent_title: Equivalent to title for the parent comment. - * - parent_permalink: Equivalent to permalink for the parent comment. - * - parent: A text string of parent comment submission information created from - * 'parent_author' and 'parent_created' during template_preprocess_comment(). - * This information is presented to help screen readers follow lengthy - * discussion threads. You can hide this from sighted users using the class - * visually-hidden. - * - * These two variables are provided for context: - * - comment: Full comment object. - * - entity: Entity the comments are attached to. - * - * @see template_preprocess_comment() - * - * @ingroup themeable - */ -#} - - - {% if title %} - {{ title_prefix }} - {% endif %} - - {# - Hide the "new" indicator by default, let a piece of JavaScript ask - the server which comments are new for the user. Rendering the final - "new" indicator here would break the render cache. - #} - - - {% if title %} - {{ title }} - {{ title_suffix }} - {% endif %} - - -
        - {{ user_picture }} - - - {# - Indicate the semantic relationship between parent and child comments - for accessibility. The list is difficult to navigate in a screen - reader without this information. - #} - {% if parent %} -

        {{ parent }}

        - {% endif %} - - {{ permalink }} -
        - - - {{ content|without('links') }} - - {% if content.links %} - {{ content.links }} - {% endif %} - diff --git a/sites/all/themes/contrib/basic/templates/field--comment.html.twig b/sites/all/themes/contrib/basic/templates/field--comment.html.twig deleted file mode 100644 index f78172205..000000000 --- a/sites/all/themes/contrib/basic/templates/field--comment.html.twig +++ /dev/null @@ -1,42 +0,0 @@ -{# -/** - * @file - * Default theme override for comment fields. - * - * Available variables: - * - attributes: HTML attributes for the containing element. - * - label_hidden: Whether to show the field label or not. - * - title_attributes: HTML attributes for the title. - * - label: The label for the field. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title_suffix: Additional title output populated by modules, intended to - * be displayed after the main title tag that appears in the template. - * - comments: List of comments rendered through comment.html.twig. - * - content_attributes: HTML attributes for the form title. - * - comment_form: The 'Add new comment' form. - * - comment_display_mode: Is the comments are threaded. - * - comment_type: The comment type bundle ID for the comment field. - * - entity_type: The entity type to which the field belongs. - * - field_name: The name of the field. - * - field_type: The type of the field. - * - label_display: The display settings for the label. - * - * @see template_preprocess_field() - * @see comment_preprocess_field() - */ -#} - - {% if comments and not label_hidden and (entity.entityType != 'node' or entity.bundle != 'forum') %} - {{ title_prefix }} - {{ label }} - {{ title_suffix }} - {% endif %} - - {{ comments }} - - {% if comment_form %} - {{ 'Add new comment'|t }} - {{ comment_form }} - {% endif %} - diff --git a/sites/all/themes/contrib/basic/templates/field.html.twig b/sites/all/themes/contrib/basic/templates/field.html.twig deleted file mode 100644 index 4cdb3e8c0..000000000 --- a/sites/all/themes/contrib/basic/templates/field.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "@stable/field/field.html.twig" %} - -{# Create classes array #} -{% set classes = [] %} - -{# BEM inspired class syntax: https://en.bem.info/ - Enable this code if you would like field classes like "article__tags", where article is the content type and field_tags is the field name. -#} -{% set classes = classes|merge([ - bundle ~ '__' ~ field_name|replace({'field_' : ''})|clean_class -]) %} - - -{% set attributes = attributes.addClass(classes) %} - -{# - Ensures that the visually hidden option for field labels works correctly. - @todo: Remove when https://www.drupal.org/node/2779919 is resolved. -#} -{% set title_attributes = title_attributes.addClass(label_display == 'visually_hidden' ? 'visually-hidden') %} diff --git a/sites/all/themes/contrib/basic/templates/html.html.twig b/sites/all/themes/contrib/basic/templates/html.html.twig deleted file mode 100644 index 372976e07..000000000 --- a/sites/all/themes/contrib/basic/templates/html.html.twig +++ /dev/null @@ -1,81 +0,0 @@ -{# -/** - * @file - * Default theme implementation for the basic structure of a single Drupal page. - * - * Variables: - * - logged_in: A flag indicating if user is logged in. - * - root_path: The root path of the current page (e.g., node, admin, user). - * - node_type: The content type for the current node, if the page is a node. - * - css: A list of CSS files for the current page. - * - head: Markup for the HEAD element (including meta tags, keyword tags, and - * so on). - * - head_title: A modified version of the page title, for use in the TITLE tag. - * - head_title_array: List of text elements that make up the head_title - * variable. May contain or more of the following: - * - title: The title of the page. - * - name: The name of the site. - * - slogan: The slogan of the site. - * - page_top: Initial rendered markup. This should be printed before 'page'. - * - page: The rendered page markup. - * - page_bottom: Closing rendered markup. This variable should be printed after - * 'page'. - * - styles: Style tags necessary to import all necessary CSS files in the head. - * - scripts: Script tags necessary to load the JavaScript files and settings - * in the head. - * - db_offline: A flag indicating if the database is offline. - * - * @see template_preprocess_html() - * - * @ingroup themeable - */ -#} - -{% if ie_enabled_versions.ie8 %} - {{- attach_library('basic/ie8') }} -{% endif %} -{% if ie_enabled_versions.ie9 or ie_enabled_versions.ie8 %} - - - - -{% else -%} - -{% endif %} - - - {{ head_title|safe_join(' | ') }} - - - - {% set classes = [] %} - {% for role in user.roles %} - {% set classes = classes|merge(['role--' ~ role|clean_class]) %} - {% endfor %} - - {% set sidebar_first = page.sidebar_first|render %} - {% set sidebar_second = page.sidebar_second|render %} - - - {{ page_top }} - {{ page }} - {{ page_bottom }} - - {% if browser_sync.enabled %} - - {% endif %} - - diff --git a/sites/all/themes/contrib/basic/templates/menu-local-task.html.twig b/sites/all/themes/contrib/basic/templates/menu-local-task.html.twig deleted file mode 100644 index f29332e49..000000000 --- a/sites/all/themes/contrib/basic/templates/menu-local-task.html.twig +++ /dev/null @@ -1,19 +0,0 @@ -{# -/** - * @file - * Default theme implementation for a local task link. - * - * Available variables: - * - attributes: HTML attributes for the wrapper element. - * - is_active: Whether the task item is an active tab. - * - link: A rendered link element. - * - * Note: This template renders the content for each task item in - * menu-local-tasks.html.twig. - * - * @see template_preprocess_menu_local_task() - * - * @ingroup themeable - */ -#} -{{ link }} diff --git a/sites/all/themes/contrib/basic/templates/menu-local-tasks.html.twig b/sites/all/themes/contrib/basic/templates/menu-local-tasks.html.twig deleted file mode 100644 index 2e88a1808..000000000 --- a/sites/all/themes/contrib/basic/templates/menu-local-tasks.html.twig +++ /dev/null @@ -1,29 +0,0 @@ -{# -/** - * @file - * Default theme implementation to display primary and secondary local tasks. - * - * Available variables: - * - primary: HTML list items representing primary tasks. - * - secondary: HTML list items representing primary tasks. - * - * Each item in these variables (primary and secondary) can be individually - * themed in menu-local-task.html.twig. - * - * @see template_preprocess_menu_local_tasks() - * - * @ingroup themeable - */ -#} - -{{ attach_library('basic/tabs') }} - -{% if primary %} -

        {{ 'Primary tabs'|t }}

        -
          {{ primary }}
        -{% endif %} -{% if secondary %} -

        {{ 'Secondary tabs'|t }}

        -
          {{ secondary }}
        -{% endif %} - diff --git a/sites/all/themes/contrib/basic/templates/menu.html.twig b/sites/all/themes/contrib/basic/templates/menu.html.twig deleted file mode 100644 index e482ef4aa..000000000 --- a/sites/all/themes/contrib/basic/templates/menu.html.twig +++ /dev/null @@ -1,55 +0,0 @@ -{# -/** - * @file - * Theme override to display a menu. - * - * Available variables: - * - menu_name: The machine name of the menu. - * - items: A nested list of menu items. Each menu item contains: - * - attributes: HTML attributes for the menu item. - * - below: The menu item child items. - * - title: The menu link title. - * - url: The menu link url, instance of \Drupal\Core\Url - * - localized_options: Menu link localized options. - * - is_expanded: TRUE if the link has visible children within the current - * menu tree. - * - is_collapsed: TRUE if the link has children within the current menu tree - * that are not currently visible. - * - in_active_trail: TRUE if the link is in the active trail. - */ -#} -{% import _self as menus %} - -{# - We call a macro which calls itself to render the full tree. - @see http://twig.sensiolabs.org/doc/tags/macro.html -#} -{{ menus.menu_links(items, attributes, 0) }} - -{% macro menu_links(items, attributes, menu_level) %} - {% import _self as menus %} - {% if items %} - {% if menu_level == 0 %} - - {% else %} - - {% endif %} -{% endmacro %} diff --git a/sites/all/themes/contrib/basic/templates/node.html.twig b/sites/all/themes/contrib/basic/templates/node.html.twig deleted file mode 100755 index ea30c258d..000000000 --- a/sites/all/themes/contrib/basic/templates/node.html.twig +++ /dev/null @@ -1,53 +0,0 @@ -{# Create classes array. The 'node' class is required for contextual edit links. #} -{% set classes = [ - 'node' -] %} - -{# BEM inspired class syntax: https://en.bem.info/ - Enable this code if you would like node classes like "article article--layout-teaser", where article is the content type and teaser is the view mode. -{% set classes = classes|merge([ - node.bundle|clean_class, - view_mode ? node.bundle|clean_class ~ '--layout-' ~ view_mode|clean_class -]) %} -{% set title_classes = [ - node.bundle|clean_class ~ '__title' -] %} -#} - - - - {% if title_prefix or title_suffix or display_submitted or unpublished or page is empty and label %} -
        - {{ title_prefix }} - {% if not page and label %} - - {{ label }} - - {% endif %} - {{ title_suffix }} - - {% if display_submitted %} - - {% endif %} - - {% if not node.published %} -

        {{ 'Unpublished'|t }}

        - {% endif %} -
        - {% endif %} - - - {{ content|without('links') }} - - - {% if content.links %} - - {% endif %} - - diff --git a/sites/all/themes/contrib/basic/templates/page.html.twig b/sites/all/themes/contrib/basic/templates/page.html.twig deleted file mode 100755 index 314f98be3..000000000 --- a/sites/all/themes/contrib/basic/templates/page.html.twig +++ /dev/null @@ -1,93 +0,0 @@ -{% set main_menu = page.primary_menu|render %} -{% set secondary_menu = page.secondary_menu|render %} - - - - - - - {% if main_menu or secondary_menu %} - - {% endif %} - - - -
        -
        -
        - -
        - - {{ page.breadcrumb }} - - {% if page.highlighted|render %} -
        {{ page.highlighted }}
        - {% endif %} - - {{ title_prefix }} - - {% if title %} -

        {{ title }}

        - {% endif %} - - {{ title_suffix }} - {{ page.help }} - - {% if tabs %} -
        {{ tabs }}
        - {% endif %} - - {% if action_links %} - - {% endif %} - -
        - -
        - {{ page.content }} -
        - -
        - - {% if page.sidebar_first|render %} - - {% endif %} - - {% if page.sidebar_second|render %} - - {% endif %} -
        -
        - - - - {% if page.footer|render %} -
        -
        - {{ page.footer }} -
        -
        - {% endif %} - - diff --git a/sites/all/themes/contrib/basic/templates/pager.html.twig b/sites/all/themes/contrib/basic/templates/pager.html.twig deleted file mode 100644 index 6e1056393..000000000 --- a/sites/all/themes/contrib/basic/templates/pager.html.twig +++ /dev/null @@ -1,98 +0,0 @@ -{# -/** - * @file - * Theme override to display a pager. - * - * Available variables: - * - items: List of pager items. - * The list is keyed by the following elements: - * - first: Item for the first page; not present on the first page of results. - * - previous: Item for the previous page; not present on the first page - * of results. - * - next: Item for the next page; not present on the last page of results. - * - last: Item for the last page; not present on the last page of results. - * - pages: List of pages, keyed by page number. - * Sub-sub elements: - * items.first, items.previous, items.next, items.last, and each item inside - * items.pages contain the following elements: - * - href: URL with appropriate query parameters for the item. - * - attributes: A keyed list of HTML attributes for the item. - * - text: The visible text used for the item link, such as "‹ Previous" - * or "Next ›". - * - current: The page number of the current page. - * - ellipses: If there are more pages than the quantity allows, then an - * ellipsis before or after the listed pages may be present. - * - previous: Present if the currently visible list of pages does not start - * at the first page. - * - next: Present if the visible list of pages ends before the last page. - * - * @see template_preprocess_pager() - */ -#} -{% if items %} - -{% endif %} diff --git a/sites/all/themes/contrib/basic/templates/status-messages.html.twig b/sites/all/themes/contrib/basic/templates/status-messages.html.twig deleted file mode 100644 index 1dbdb703e..000000000 --- a/sites/all/themes/contrib/basic/templates/status-messages.html.twig +++ /dev/null @@ -1,58 +0,0 @@ -{# -/** - * @file - * Theme override for status messages. - * - * Displays status, error, and warning messages, grouped by type. - * - * An invisible heading identifies the messages for assistive technology. - * Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html - * for info. - * - * Add an ARIA label to the contentinfo area so that assistive technology - * user agents will better describe this landmark. - * - * Available variables: - * - message_list: List of messages to be displayed, grouped by type. - * - status_headings: List of all status types. - * - display: (optional) May have a value of 'status' or 'error' when only - * displaying messages of that specific type. - * - attributes: HTML attributes for the element, including: - * - class: HTML classes. - * - * @see template_preprocess_status_messages() - */ -#} - -{{ attach_library('basic/messages') }} - -{% for type, messages in message_list %} - {% - set classes = [ - 'messages', - 'messages--' ~ type, - ] - %} - - {% if type == 'error' %} -
        - {% endif %} - {% if status_headings[type] %} -

        {{ status_headings[type] }}

        - {% endif %} - {% if messages|length > 1 %} -
          - {% for message in messages %} -
        • {{ message }}
        • - {% endfor %} -
        - {% else %} - {{ messages|first }} - {% endif %} - {% if type == 'error' %} -
        - {% endif %} - - {# Remove type specific classes. #} - {{ attributes.removeClass(classes) }} -{% endfor %} diff --git a/sites/all/themes/contrib/basic/templates/views-mini-pager.html.twig b/sites/all/themes/contrib/basic/templates/views-mini-pager.html.twig deleted file mode 100644 index aaa48405f..000000000 --- a/sites/all/themes/contrib/basic/templates/views-mini-pager.html.twig +++ /dev/null @@ -1,41 +0,0 @@ -{# -/** - * @file - * Theme override for a views mini-pager. - * - * Available variables: - * - items: List of pager items. - * - * @see template_preprocess_views_mini_pager() - */ -#} -{% if items.previous or items.next %} - -{% endif %} diff --git a/sites/all/themes/contrib/basic/theme-settings.php b/sites/all/themes/contrib/basic/theme-settings.php deleted file mode 100644 index b6860f2cc..000000000 --- a/sites/all/themes/contrib/basic/theme-settings.php +++ /dev/null @@ -1,83 +0,0 @@ -getActiveTheme()->getName(); - -/** - * Implements hook_form_system_theme_settings_alter(). - * - * Form override for theme settings. - */ -function basic_form_system_theme_settings_alter(array &$form, FormStateInterface $form_state) { - $form['options_settings'] = [ - '#type' => 'fieldset', - '#title' => t('Theme Specific Settings'), - ]; - - // BrowserSync support. - $form['options_settings']['basic_browser_sync'] = [ - '#type' => 'fieldset', - '#title' => t('BrowserSync Settings'), - ]; - $form['options_settings']['basic_browser_sync']['browser_sync']['#tree'] = TRUE; - $form['options_settings']['basic_browser_sync']['browser_sync']['enabled'] = [ - '#type' => 'checkbox', - '#title' => t('Enable BrowserSync support for theme'), - '#default_value' => theme_get_setting('browser_sync.enabled'), - '#description' => t("Checking this box will automatically add the BrowserSync JS to your theme for development."), - ]; - - $form['options_settings']['basic_browser_sync']['browser_sync']['host'] = [ - '#type' => 'textfield', - '#title' => t('BrowserSync host'), - '#default_value' => theme_get_setting('browser_sync.host'), - '#description' => t("Default: localhost. Enter 'HOST' which will be replaced by your site's hostname."), - '#states' => [ - 'visible' => [':input[name="browser_sync[enabled]"]' => ['checked' => TRUE]], - ], - ]; - - $form['options_settings']['basic_browser_sync']['browser_sync']['port'] = [ - '#type' => 'number', - '#title' => t('Enable BrowserSync support for theme'), - '#default_value' => theme_get_setting('browser_sync.port'), - '#description' => t("Default: '3000'."), - '#states' => [ - 'visible' => [':input[name="browser_sync[enabled]"]' => ['checked' => TRUE]], - ], - ]; - - // IE specific settings. - $form['options_settings']['basic_ie'] = [ - '#type' => 'fieldset', - '#title' => t('Internet Explorer Stylesheets'), - ]; - $form['options_settings']['basic_ie']['ie_enabled'] = [ - '#type' => 'checkbox', - '#title' => t('Enable Internet Explorer stylesheets in theme'), - '#default_value' => theme_get_setting('ie_enabled'), - '#description' => t('If you check this box you can choose which IE stylesheets in theme get rendered on display.'), - ]; - $form['options_settings']['basic_ie']['ie_enabled_css'] = [ - '#type' => 'fieldset', - '#title' => t('Which IE versions you want to enable ".lt-ie" CSS classes'), - '#states' => [ - 'visible' => [':input[name="ie_enabled"]' => ['checked' => TRUE]], - ], - ]; - $form['options_settings']['basic_ie']['ie_enabled_css']['ie_enabled_versions'] = [ - '#type' => 'checkboxes', - '#options' => [ - 'ie8' => t('Internet Explorer 8'), - 'ie9' => t('Internet Explorer 9'), - ], - '#default_value' => array_keys(array_filter(theme_get_setting('ie_enabled_versions'))) ?: [], - ]; -} diff --git a/themes/README.txt b/themes/README.txt deleted file mode 100644 index 039aaaf83..000000000 --- a/themes/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -Themes allow you to change the look and feel of your Drupal site. You can use -themes contributed by others or create your own. - -WHAT TO PLACE IN THIS DIRECTORY? --------------------------------- - -Placing downloaded and custom themes in this directory separates downloaded and -custom themes from Drupal core's themes. This allows Drupal core to be updated -without overwriting these files. - -DOWNLOAD ADDITIONAL THEMES --------------------------- - -Contributed themes from the Drupal community may be downloaded at -https://www.drupal.org/project/project_theme. - -MULTISITE CONFIGURATION ------------------------ - -In multisite configurations, themes found in this directory are available to -all sites. You may also put themes in the sites/all/themes directory, and the -versions in sites/all/themes will take precedence over versions of the same -themes that are here. Alternatively, the sites/your_site_name/themes directory -pattern may be used to restrict themes to a specific site instance. - -MORE INFORMATION ------------------ - -Refer to the "Appearance" section of the README.txt in the Drupal root directory -for further information on customizing the appearance of Drupal with custom -themes. diff --git a/.csslintrc b/web/.csslintrc similarity index 100% rename from .csslintrc rename to web/.csslintrc diff --git a/web/.editorconfig b/web/.editorconfig new file mode 100644 index 000000000..686c443ce --- /dev/null +++ b/web/.editorconfig @@ -0,0 +1,17 @@ +# Drupal editor configuration normalization +# @see http://editorconfig.org/ + +# This is the top-most .editorconfig file; do not search in parent directories. +root = true + +# All files. +[*] +end_of_line = LF +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[composer.{json,lock}] +indent_size = 4 diff --git a/.eslintignore b/web/.eslintignore similarity index 100% rename from .eslintignore rename to web/.eslintignore diff --git a/.eslintrc.json b/web/.eslintrc.json similarity index 100% rename from .eslintrc.json rename to web/.eslintrc.json diff --git a/web/.gitattributes b/web/.gitattributes new file mode 100644 index 000000000..a37894e8e --- /dev/null +++ b/web/.gitattributes @@ -0,0 +1,61 @@ +# Drupal git normalization +# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html +# @see https://www.drupal.org/node/1542048 + +# Normally these settings would be done with macro attributes for improved +# readability and easier maintenance. However macros can only be defined at the +# repository root directory. Drupal avoids making any assumptions about where it +# is installed. + +# Define text file attributes. +# - Treat them as text. +# - Ensure no CRLF line-endings, neither on checkout nor on checkin. +# - Detect whitespace errors. +# - Exposed by default in `git diff --color` on the CLI. +# - Validate with `git diff --check`. +# - Deny applying with `git apply --whitespace=error-all`. +# - Fix automatically with `git apply --whitespace=fix`. + +*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html +*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php +*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 + +# Define binary file attributes. +# - Do not treat them as text. +# - Include binary diff in patches instead of "binary files differ." +*.eot -text diff +*.exe -text diff +*.gif -text diff +*.gz -text diff +*.ico -text diff +*.jpeg -text diff +*.jpg -text diff +*.otf -text diff +*.phar -text diff +*.png -text diff +*.svgz -text diff +*.ttf -text diff +*.woff -text diff +*.woff2 -text diff diff --git a/web/.ht.router.php b/web/.ht.router.php new file mode 100644 index 000000000..054f7119b --- /dev/null +++ b/web/.ht.router.php @@ -0,0 +1,65 @@ +getCurrentLanguage()->getId(); - // $language = \Drupal::languageManager()->getCurrentLanguage()->getName(); - $query->addCondition('search_api_language', $language); + $current_langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); + $query->setLanguages(array($current_langcode)); + + // $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); + // // $language = \Drupal::languageManager()->getCurrentLanguage()->getName(); + // $query->addCondition('search_api_language', $language); $result = $query->execute(); $items = $result->getResultItems(); diff --git a/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php b/web/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php similarity index 100% rename from sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php rename to web/sites/all/modules/figli/edlp_search/src/Form/EdlpSearchForm.php diff --git a/sites/all/modules/figli/edlp_search/src/Plugin/Block/EdlpSearchLinkBlock.php b/web/sites/all/modules/figli/edlp_search/src/Plugin/Block/EdlpSearchLinkBlock.php similarity index 100% rename from sites/all/modules/figli/edlp_search/src/Plugin/Block/EdlpSearchLinkBlock.php rename to web/sites/all/modules/figli/edlp_search/src/Plugin/Block/EdlpSearchLinkBlock.php diff --git a/sites/all/modules/figli/edlp_search/templates/edlp-search-results.html.twig b/web/sites/all/modules/figli/edlp_search/templates/edlp-search-results.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_search/templates/edlp-search-results.html.twig rename to web/sites/all/modules/figli/edlp_search/templates/edlp-search-results.html.twig diff --git a/sites/all/modules/figli/edlp_search/templates/edlp-search-search-form.html.twig b/web/sites/all/modules/figli/edlp_search/templates/edlp-search-search-form.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_search/templates/edlp-search-search-form.html.twig rename to web/sites/all/modules/figli/edlp_search/templates/edlp-search-search-form.html.twig diff --git a/sites/all/modules/figli/edlp_studio/__chutier.page.inc b/web/sites/all/modules/figli/edlp_studio/__chutier.page.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/__chutier.page.inc rename to web/sites/all/modules/figli/edlp_studio/__chutier.page.inc diff --git a/sites/all/modules/figli/edlp_studio/__composition.page.inc b/web/sites/all/modules/figli/edlp_studio/__composition.page.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/__composition.page.inc rename to web/sites/all/modules/figli/edlp_studio/__composition.page.inc diff --git a/sites/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js b/web/sites/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js similarity index 100% rename from sites/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js rename to web/sites/all/modules/figli/edlp_studio/assets/dist/scripts/edlp_studio.min.js diff --git a/sites/all/modules/figli/edlp_studio/assets/scripts/edlp_studio.js b/web/sites/all/modules/figli/edlp_studio/assets/scripts/edlp_studio.js similarity index 100% rename from sites/all/modules/figli/edlp_studio/assets/scripts/edlp_studio.js rename to web/sites/all/modules/figli/edlp_studio/assets/scripts/edlp_studio.js diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.info.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.info.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.info.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.info.yml diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.libraries.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.libraries.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.libraries.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.libraries.yml diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.links.action.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.links.action.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.links.action.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.links.action.yml diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.links.menu.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.links.menu.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.links.menu.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.links.menu.yml diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.links.task.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.links.task.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.links.task.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.links.task.yml diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.module b/web/sites/all/modules/figli/edlp_studio/edlp_studio.module similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.module rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.module diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.permissions.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.permissions.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.permissions.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.permissions.yml diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml b/web/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml similarity index 100% rename from sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml rename to web/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml diff --git a/sites/all/modules/figli/edlp_studio/includes/composition.inc b/web/sites/all/modules/figli/edlp_studio/includes/composition.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/includes/composition.inc rename to web/sites/all/modules/figli/edlp_studio/includes/composition.inc diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc b/web/sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc rename to web/sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc b/web/sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc rename to web/sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_compositions_list.inc b/web/sites/all/modules/figli/edlp_studio/includes/edlp_compositions_list.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/includes/edlp_compositions_list.inc rename to web/sites/all/modules/figli/edlp_studio/includes/edlp_compositions_list.inc diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc b/web/sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc similarity index 100% rename from sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc rename to web/sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc diff --git a/sites/all/modules/figli/edlp_studio/readme.md b/web/sites/all/modules/figli/edlp_studio/readme.md similarity index 100% rename from sites/all/modules/figli/edlp_studio/readme.md rename to web/sites/all/modules/figli/edlp_studio/readme.md diff --git a/sites/all/modules/figli/edlp_studio/src/ChutierAccessControlHandler.php b/web/sites/all/modules/figli/edlp_studio/src/ChutierAccessControlHandler.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/ChutierAccessControlHandler.php rename to web/sites/all/modules/figli/edlp_studio/src/ChutierAccessControlHandler.php diff --git a/sites/all/modules/figli/edlp_studio/src/ChutierHtmlRouteProvider.php b/web/sites/all/modules/figli/edlp_studio/src/ChutierHtmlRouteProvider.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/ChutierHtmlRouteProvider.php rename to web/sites/all/modules/figli/edlp_studio/src/ChutierHtmlRouteProvider.php diff --git a/sites/all/modules/figli/edlp_studio/src/ChutierListBuilder.php b/web/sites/all/modules/figli/edlp_studio/src/ChutierListBuilder.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/ChutierListBuilder.php rename to web/sites/all/modules/figli/edlp_studio/src/ChutierListBuilder.php diff --git a/sites/all/modules/figli/edlp_studio/src/CompositionAccessControlHandler.php b/web/sites/all/modules/figli/edlp_studio/src/CompositionAccessControlHandler.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/CompositionAccessControlHandler.php rename to web/sites/all/modules/figli/edlp_studio/src/CompositionAccessControlHandler.php diff --git a/sites/all/modules/figli/edlp_studio/src/CompositionHtmlRouteProvider.php b/web/sites/all/modules/figli/edlp_studio/src/CompositionHtmlRouteProvider.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/CompositionHtmlRouteProvider.php rename to web/sites/all/modules/figli/edlp_studio/src/CompositionHtmlRouteProvider.php diff --git a/sites/all/modules/figli/edlp_studio/src/CompositionListBuilder.php b/web/sites/all/modules/figli/edlp_studio/src/CompositionListBuilder.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/CompositionListBuilder.php rename to web/sites/all/modules/figli/edlp_studio/src/CompositionListBuilder.php diff --git a/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php b/web/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php rename to web/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php diff --git a/sites/all/modules/figli/edlp_studio/src/Controller/CompositionController.php b/web/sites/all/modules/figli/edlp_studio/src/Controller/CompositionController.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Controller/CompositionController.php rename to web/sites/all/modules/figli/edlp_studio/src/Controller/CompositionController.php diff --git a/sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php b/web/sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php rename to web/sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php diff --git a/sites/all/modules/figli/edlp_studio/src/Entity/Chutier.php b/web/sites/all/modules/figli/edlp_studio/src/Entity/Chutier.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Entity/Chutier.php rename to web/sites/all/modules/figli/edlp_studio/src/Entity/Chutier.php diff --git a/sites/all/modules/figli/edlp_studio/src/Entity/ChutierInterface.php b/web/sites/all/modules/figli/edlp_studio/src/Entity/ChutierInterface.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Entity/ChutierInterface.php rename to web/sites/all/modules/figli/edlp_studio/src/Entity/ChutierInterface.php diff --git a/sites/all/modules/figli/edlp_studio/src/Entity/ChutierViewsData.php b/web/sites/all/modules/figli/edlp_studio/src/Entity/ChutierViewsData.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Entity/ChutierViewsData.php rename to web/sites/all/modules/figli/edlp_studio/src/Entity/ChutierViewsData.php diff --git a/sites/all/modules/figli/edlp_studio/src/Entity/Composition.php b/web/sites/all/modules/figli/edlp_studio/src/Entity/Composition.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Entity/Composition.php rename to web/sites/all/modules/figli/edlp_studio/src/Entity/Composition.php diff --git a/sites/all/modules/figli/edlp_studio/src/Entity/CompositionInterface.php b/web/sites/all/modules/figli/edlp_studio/src/Entity/CompositionInterface.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Entity/CompositionInterface.php rename to web/sites/all/modules/figli/edlp_studio/src/Entity/CompositionInterface.php diff --git a/sites/all/modules/figli/edlp_studio/src/Entity/CompositionViewsData.php b/web/sites/all/modules/figli/edlp_studio/src/Entity/CompositionViewsData.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Entity/CompositionViewsData.php rename to web/sites/all/modules/figli/edlp_studio/src/Entity/CompositionViewsData.php diff --git a/sites/all/modules/figli/edlp_studio/src/Form/ChutierDeleteForm.php b/web/sites/all/modules/figli/edlp_studio/src/Form/ChutierDeleteForm.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Form/ChutierDeleteForm.php rename to web/sites/all/modules/figli/edlp_studio/src/Form/ChutierDeleteForm.php diff --git a/sites/all/modules/figli/edlp_studio/src/Form/ChutierForm.php b/web/sites/all/modules/figli/edlp_studio/src/Form/ChutierForm.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Form/ChutierForm.php rename to web/sites/all/modules/figli/edlp_studio/src/Form/ChutierForm.php diff --git a/sites/all/modules/figli/edlp_studio/src/Form/ChutierSettingsForm.php b/web/sites/all/modules/figli/edlp_studio/src/Form/ChutierSettingsForm.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Form/ChutierSettingsForm.php rename to web/sites/all/modules/figli/edlp_studio/src/Form/ChutierSettingsForm.php diff --git a/sites/all/modules/figli/edlp_studio/src/Form/CompositionDeleteForm.php b/web/sites/all/modules/figli/edlp_studio/src/Form/CompositionDeleteForm.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Form/CompositionDeleteForm.php rename to web/sites/all/modules/figli/edlp_studio/src/Form/CompositionDeleteForm.php diff --git a/sites/all/modules/figli/edlp_studio/src/Form/CompositionForm.php b/web/sites/all/modules/figli/edlp_studio/src/Form/CompositionForm.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Form/CompositionForm.php rename to web/sites/all/modules/figli/edlp_studio/src/Form/CompositionForm.php diff --git a/sites/all/modules/figli/edlp_studio/src/Form/CompositionSettingsForm.php b/web/sites/all/modules/figli/edlp_studio/src/Form/CompositionSettingsForm.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Form/CompositionSettingsForm.php rename to web/sites/all/modules/figli/edlp_studio/src/Form/CompositionSettingsForm.php diff --git a/sites/all/modules/figli/edlp_studio/src/Plugin/Block/StudioLinkBlock.php b/web/sites/all/modules/figli/edlp_studio/src/Plugin/Block/StudioLinkBlock.php similarity index 100% rename from sites/all/modules/figli/edlp_studio/src/Plugin/Block/StudioLinkBlock.php rename to web/sites/all/modules/figli/edlp_studio/src/Plugin/Block/StudioLinkBlock.php diff --git a/sites/all/modules/figli/edlp_studio/templates/chutier.html.twig b/web/sites/all/modules/figli/edlp_studio/templates/chutier.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_studio/templates/chutier.html.twig rename to web/sites/all/modules/figli/edlp_studio/templates/chutier.html.twig diff --git a/sites/all/modules/figli/edlp_studio/templates/composition.html.twig b/web/sites/all/modules/figli/edlp_studio/templates/composition.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_studio/templates/composition.html.twig rename to web/sites/all/modules/figli/edlp_studio/templates/composition.html.twig diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp-chutier-ui.html.twig b/web/sites/all/modules/figli/edlp_studio/templates/edlp-chutier-ui.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_studio/templates/edlp-chutier-ui.html.twig rename to web/sites/all/modules/figli/edlp_studio/templates/edlp-chutier-ui.html.twig diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp-composition-ui.html.twig b/web/sites/all/modules/figli/edlp_studio/templates/edlp-composition-ui.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_studio/templates/edlp-composition-ui.html.twig rename to web/sites/all/modules/figli/edlp_studio/templates/edlp-composition-ui.html.twig diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp-compositions-list.html.twig b/web/sites/all/modules/figli/edlp_studio/templates/edlp-compositions-list.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_studio/templates/edlp-compositions-list.html.twig rename to web/sites/all/modules/figli/edlp_studio/templates/edlp-compositions-list.html.twig diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp-studio-ui.html.twig b/web/sites/all/modules/figli/edlp_studio/templates/edlp-studio-ui.html.twig similarity index 100% rename from sites/all/modules/figli/edlp_studio/templates/edlp-studio-ui.html.twig rename to web/sites/all/modules/figli/edlp_studio/templates/edlp-studio-ui.html.twig diff --git a/sites/all/modules/figli/gulpfile.js b/web/sites/all/modules/figli/gulpfile.js similarity index 100% rename from sites/all/modules/figli/gulpfile.js rename to web/sites/all/modules/figli/gulpfile.js diff --git a/sites/all/modules/figli/package-lock.json b/web/sites/all/modules/figli/package-lock.json similarity index 100% rename from sites/all/modules/figli/package-lock.json rename to web/sites/all/modules/figli/package-lock.json diff --git a/sites/all/modules/figli/package.json b/web/sites/all/modules/figli/package.json similarity index 100% rename from sites/all/modules/figli/package.json rename to web/sites/all/modules/figli/package.json diff --git a/sites/all/themes/custom/edlptheme/.gitignore b/web/sites/all/themes/custom/edlptheme/.gitignore similarity index 100% rename from sites/all/themes/custom/edlptheme/.gitignore rename to web/sites/all/themes/custom/edlptheme/.gitignore diff --git a/sites/all/themes/custom/edlptheme/README.md b/web/sites/all/themes/custom/edlptheme/README.md similarity index 100% rename from sites/all/themes/custom/edlptheme/README.md rename to web/sites/all/themes/custom/edlptheme/README.md diff --git a/sites/all/themes/custom/edlptheme/assets/dist/bower/imagesloaded.pkgd.min.js b/web/sites/all/themes/custom/edlptheme/assets/dist/bower/imagesloaded.pkgd.min.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/bower/imagesloaded.pkgd.min.js rename to web/sites/all/themes/custom/edlptheme/assets/dist/bower/imagesloaded.pkgd.min.js diff --git a/sites/all/themes/custom/edlptheme/assets/dist/bower/jquery.hotkeys.js b/web/sites/all/themes/custom/edlptheme/assets/dist/bower/jquery.hotkeys.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/bower/jquery.hotkeys.js rename to web/sites/all/themes/custom/edlptheme/assets/dist/bower/jquery.hotkeys.js diff --git a/sites/all/themes/custom/edlptheme/assets/dist/bower/masonry.pkgd.min.js b/web/sites/all/themes/custom/edlptheme/assets/dist/bower/masonry.pkgd.min.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/bower/masonry.pkgd.min.js rename to web/sites/all/themes/custom/edlptheme/assets/dist/bower/masonry.pkgd.min.js diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-next.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-next.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-next.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-next.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-pause.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-pause.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-pause.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-pause.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-play.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-play.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-play.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-play.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-previous.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-previous.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-previous.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/audio-player-previous.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/close.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/close.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/close.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/close.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/delete.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/delete.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/delete.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/delete.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader-anim.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader-anim.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader-anim.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader-anim.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/edlp-loader.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/favori-off.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/favori-off.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/favori-off.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/favori-off.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/favori-on.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/favori-on.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/favori-on.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/favori-on.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/logo.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/logo.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/logo.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/logo.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/random-active.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/random-active.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/random-active.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/random-active.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/random.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/random.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/random.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/random.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/search-active.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/search-active.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/search-active.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/search-active.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/search.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/studio-active.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/studio-active.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/studio-active.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/studio-active.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/trash.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/trash.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/trash.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/trash.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/user.svg b/web/sites/all/themes/custom/edlptheme/assets/dist/img/user.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/img/user.svg rename to web/sites/all/themes/custom/edlptheme/assets/dist/img/user.svg diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/web/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js rename to web/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js b/web/sites/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js rename to web/sites/all/themes/custom/edlptheme/assets/dist/scripts/redirect.min.js diff --git a/sites/all/themes/custom/edlptheme/assets/dist/styles/app.css b/web/sites/all/themes/custom/edlptheme/assets/dist/styles/app.css similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/styles/app.css rename to web/sites/all/themes/custom/edlptheme/assets/dist/styles/app.css diff --git a/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css b/web/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css rename to web/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css diff --git a/sites/all/themes/custom/edlptheme/assets/img/audio-player-next.svg b/web/sites/all/themes/custom/edlptheme/assets/img/audio-player-next.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/audio-player-next.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/audio-player-next.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/audio-player-pause.svg b/web/sites/all/themes/custom/edlptheme/assets/img/audio-player-pause.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/audio-player-pause.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/audio-player-pause.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/audio-player-play.svg b/web/sites/all/themes/custom/edlptheme/assets/img/audio-player-play.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/audio-player-play.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/audio-player-play.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/audio-player-previous.svg b/web/sites/all/themes/custom/edlptheme/assets/img/audio-player-previous.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/audio-player-previous.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/audio-player-previous.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/close.svg b/web/sites/all/themes/custom/edlptheme/assets/img/close.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/close.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/close.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/delete.svg b/web/sites/all/themes/custom/edlptheme/assets/img/delete.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/delete.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/delete.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/edlp-loader-anim.svg b/web/sites/all/themes/custom/edlptheme/assets/img/edlp-loader-anim.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/edlp-loader-anim.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/edlp-loader-anim.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/edlp-loader.svg b/web/sites/all/themes/custom/edlptheme/assets/img/edlp-loader.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/edlp-loader.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/edlp-loader.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/favori-off.svg b/web/sites/all/themes/custom/edlptheme/assets/img/favori-off.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/favori-off.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/favori-off.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/favori-on.svg b/web/sites/all/themes/custom/edlptheme/assets/img/favori-on.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/favori-on.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/favori-on.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/logo.svg b/web/sites/all/themes/custom/edlptheme/assets/img/logo.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/logo.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/logo.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/random-active.svg b/web/sites/all/themes/custom/edlptheme/assets/img/random-active.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/random-active.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/random-active.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/random.svg b/web/sites/all/themes/custom/edlptheme/assets/img/random.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/random.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/random.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/search-active.svg b/web/sites/all/themes/custom/edlptheme/assets/img/search-active.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/search-active.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/search-active.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/search.svg b/web/sites/all/themes/custom/edlptheme/assets/img/search.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/search.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/search.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/studio-active.svg b/web/sites/all/themes/custom/edlptheme/assets/img/studio-active.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/studio-active.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/studio-active.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/studio.svg b/web/sites/all/themes/custom/edlptheme/assets/img/studio.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/studio.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/studio.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/trash.svg b/web/sites/all/themes/custom/edlptheme/assets/img/trash.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/trash.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/trash.svg diff --git a/sites/all/themes/custom/edlptheme/assets/img/user.svg b/web/sites/all/themes/custom/edlptheme/assets/img/user.svg similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/img/user.svg rename to web/sites/all/themes/custom/edlptheme/assets/img/user.svg diff --git a/sites/all/themes/custom/edlptheme/assets/json/shared_variables.json b/web/sites/all/themes/custom/edlptheme/assets/json/shared_variables.json similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/json/shared_variables.json rename to web/sites/all/themes/custom/edlptheme/assets/json/shared_variables.json diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/web/sites/all/themes/custom/edlptheme/assets/scripts/main.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/scripts/main.js rename to web/sites/all/themes/custom/edlptheme/assets/scripts/main.js diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/redirect.js b/web/sites/all/themes/custom/edlptheme/assets/scripts/redirect.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/scripts/redirect.js rename to web/sites/all/themes/custom/edlptheme/assets/scripts/redirect.js diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/shared_variables_model.js b/web/sites/all/themes/custom/edlptheme/assets/scripts/shared_variables_model.js similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/scripts/shared_variables_model.js rename to web/sites/all/themes/custom/edlptheme/assets/scripts/shared_variables_model.js diff --git a/sites/all/themes/custom/edlptheme/assets/styles/app.scss b/web/sites/all/themes/custom/edlptheme/assets/styles/app.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/app.scss rename to web/sites/all/themes/custom/edlptheme/assets/styles/app.scss diff --git a/sites/all/themes/custom/edlptheme/assets/styles/base/README.md b/web/sites/all/themes/custom/edlptheme/assets/styles/base/README.md similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/base/README.md rename to web/sites/all/themes/custom/edlptheme/assets/styles/base/README.md diff --git a/sites/all/themes/custom/edlptheme/assets/styles/base/_colors.scss b/web/sites/all/themes/custom/edlptheme/assets/styles/base/_colors.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/base/_colors.scss rename to web/sites/all/themes/custom/edlptheme/assets/styles/base/_colors.scss diff --git a/sites/all/themes/custom/edlptheme/assets/styles/base/_fonts.scss b/web/sites/all/themes/custom/edlptheme/assets/styles/base/_fonts.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/base/_fonts.scss rename to web/sites/all/themes/custom/edlptheme/assets/styles/base/_fonts.scss diff --git a/sites/all/themes/custom/edlptheme/assets/styles/base/_grid.scss b/web/sites/all/themes/custom/edlptheme/assets/styles/base/_grid.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/base/_grid.scss rename to web/sites/all/themes/custom/edlptheme/assets/styles/base/_grid.scss diff --git a/sites/all/themes/custom/edlptheme/assets/styles/base/_layout.scss b/web/sites/all/themes/custom/edlptheme/assets/styles/base/_layout.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/base/_layout.scss rename to web/sites/all/themes/custom/edlptheme/assets/styles/base/_layout.scss diff --git a/sites/all/themes/custom/edlptheme/assets/styles/base/_reset.scss b/web/sites/all/themes/custom/edlptheme/assets/styles/base/_reset.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/assets/styles/base/_reset.scss rename to web/sites/all/themes/custom/edlptheme/assets/styles/base/_reset.scss diff --git a/sites/all/themes/custom/edlptheme/bower.json b/web/sites/all/themes/custom/edlptheme/bower.json similarity index 100% rename from sites/all/themes/custom/edlptheme/bower.json rename to web/sites/all/themes/custom/edlptheme/bower.json diff --git a/sites/all/themes/custom/edlptheme/edlptheme.breakpoints.yml b/web/sites/all/themes/custom/edlptheme/edlptheme.breakpoints.yml similarity index 100% rename from sites/all/themes/custom/edlptheme/edlptheme.breakpoints.yml rename to web/sites/all/themes/custom/edlptheme/edlptheme.breakpoints.yml diff --git a/sites/all/themes/custom/edlptheme/edlptheme.info.yml b/web/sites/all/themes/custom/edlptheme/edlptheme.info.yml similarity index 100% rename from sites/all/themes/custom/edlptheme/edlptheme.info.yml rename to web/sites/all/themes/custom/edlptheme/edlptheme.info.yml diff --git a/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml b/web/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml similarity index 100% rename from sites/all/themes/custom/edlptheme/edlptheme.libraries.yml rename to web/sites/all/themes/custom/edlptheme/edlptheme.libraries.yml diff --git a/sites/all/themes/custom/edlptheme/edlptheme.theme b/web/sites/all/themes/custom/edlptheme/edlptheme.theme similarity index 100% rename from sites/all/themes/custom/edlptheme/edlptheme.theme rename to web/sites/all/themes/custom/edlptheme/edlptheme.theme diff --git a/sites/all/themes/custom/edlptheme/favicon.ico b/web/sites/all/themes/custom/edlptheme/favicon.ico similarity index 100% rename from sites/all/themes/custom/edlptheme/favicon.ico rename to web/sites/all/themes/custom/edlptheme/favicon.ico diff --git a/sites/all/themes/custom/edlptheme/gulpfile.js b/web/sites/all/themes/custom/edlptheme/gulpfile.js similarity index 100% rename from sites/all/themes/custom/edlptheme/gulpfile.js rename to web/sites/all/themes/custom/edlptheme/gulpfile.js diff --git a/sites/all/themes/custom/edlptheme/package.json b/web/sites/all/themes/custom/edlptheme/package.json similarity index 100% rename from sites/all/themes/custom/edlptheme/package.json rename to web/sites/all/themes/custom/edlptheme/package.json diff --git a/sites/all/themes/custom/edlptheme/templates/block/block--system-branding-block.html.twig b/web/sites/all/themes/custom/edlptheme/templates/block/block--system-branding-block.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/block/block--system-branding-block.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/block/block--system-branding-block.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/block/block--system-main-block.html.twig b/web/sites/all/themes/custom/edlptheme/templates/block/block--system-main-block.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/block/block--system-main-block.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/block/block--system-main-block.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/block/block--userlogin.html.twig b/web/sites/all/themes/custom/edlptheme/templates/block/block--userlogin.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/block/block--userlogin.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/block/block--userlogin.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-agenda.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-agenda.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-agenda.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-agenda.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--article.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--article.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--article.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--article.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--default.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--default.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--default.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--default.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--evenement--default.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--evenement--default.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--evenement--default.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--evenement--default.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--transcript.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--transcript.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--transcript.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--node--transcript.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--index.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--index.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--index.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--index.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--notice.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--notice.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--notice.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-ajax--taxonomy-term--notice.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-articlesindex.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-articlesindex.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-articlesindex.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-articlesindex.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-collection.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-collection.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-collection.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-collection.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-lastdocs.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-lastdocs.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-lastdocs.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-corpus-lastdocs.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-home.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-home.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-home.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-home.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-productions.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-productions.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-productions.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-productions.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-search-results.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-search-results.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-search-results.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-search-results.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-search-search-form.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-search-search-form.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-search-search-form.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-search-search-form.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/edlp-studio-ui.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/edlp-studio-ui.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/edlp-studio-ui.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/edlp-studio-ui.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/file-link.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/file-link.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/file-link.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/file-link.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/image-formatter.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/image-formatter.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/image-formatter.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/image-formatter.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--compo.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--compo.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--compo.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--compo.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--index-home.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--index-home.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--index-home.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--index-home.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--lastdocs.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--lastdocs.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--lastdocs.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--lastdocs.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--player-cartel.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--player-cartel.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--player-cartel.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--player-cartel.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--search-index.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--search-index.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--search-index.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--enregistrement--search-index.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--evenement--aside.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--evenement--aside.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--evenement--aside.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--evenement--aside.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--evenement--teaser.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--evenement--teaser.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--evenement--teaser.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--evenement--teaser.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--page--image-1-columns.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--page--image-1-columns.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--page--image-1-columns.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--page--image-1-columns.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns0.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns0.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns0.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--page--image-2-columns0.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node--page.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node--page.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node--page.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node--page.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/node.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/node.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/node.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/node.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/old__edlp-agenda.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/old__edlp-agenda.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/old__edlp-agenda.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/old__edlp-agenda.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/content/taxonomy-term--entrees--home-mobile.html.twig b/web/sites/all/themes/custom/edlptheme/templates/content/taxonomy-term--entrees--home-mobile.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/content/taxonomy-term--entrees--home-mobile.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/content/taxonomy-term--entrees--home-mobile.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/form/form-element.html.twig b/web/sites/all/themes/custom/edlptheme/templates/form/form-element.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/form/form-element.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/form/form-element.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/form/input--textfield.html.twig b/web/sites/all/themes/custom/edlptheme/templates/form/input--textfield.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/form/input--textfield.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/form/input--textfield.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/layout/html.html.twig b/web/sites/all/themes/custom/edlptheme/templates/layout/html.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/layout/html.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/layout/html.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/layout/maintenance-page.html.twig b/web/sites/all/themes/custom/edlptheme/templates/layout/maintenance-page.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/layout/maintenance-page.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/layout/maintenance-page.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/layout/page.html.twig b/web/sites/all/themes/custom/edlptheme/templates/layout/page.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/layout/page.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/layout/page.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/layout/region--content.html.twig b/web/sites/all/themes/custom/edlptheme/templates/layout/region--content.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/layout/region--content.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/layout/region--content.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/layout/region.html.twig b/web/sites/all/themes/custom/edlptheme/templates/layout/region.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/layout/region.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/layout/region.html.twig diff --git a/sites/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig b/web/sites/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig similarity index 100% rename from sites/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig rename to web/sites/all/themes/custom/edlptheme/templates/navigation/links--language-block.html.twig diff --git a/sites/all/themes/custom/edlptheme/variables.scss b/web/sites/all/themes/custom/edlptheme/variables.scss similarity index 100% rename from sites/all/themes/custom/edlptheme/variables.scss rename to web/sites/all/themes/custom/edlptheme/variables.scss diff --git a/sites/default/config/sync/.htaccess b/web/sites/default/config/sync/.htaccess similarity index 100% rename from sites/default/config/sync/.htaccess rename to web/sites/default/config/sync/.htaccess diff --git a/sites/default/config/sync/action.settings.yml b/web/sites/default/config/sync/action.settings.yml similarity index 100% rename from sites/default/config/sync/action.settings.yml rename to web/sites/default/config/sync/action.settings.yml diff --git a/sites/default/config/sync/addtoany.settings.yml b/web/sites/default/config/sync/addtoany.settings.yml similarity index 100% rename from sites/default/config/sync/addtoany.settings.yml rename to web/sites/default/config/sync/addtoany.settings.yml diff --git a/sites/default/config/sync/adminimal_theme.settings.yml b/web/sites/default/config/sync/adminimal_theme.settings.yml similarity index 100% rename from sites/default/config/sync/adminimal_theme.settings.yml rename to web/sites/default/config/sync/adminimal_theme.settings.yml diff --git a/sites/default/config/sync/autologout.role.admin.yml b/web/sites/default/config/sync/autologout.role.admin.yml similarity index 100% rename from sites/default/config/sync/autologout.role.admin.yml rename to web/sites/default/config/sync/autologout.role.admin.yml diff --git a/sites/default/config/sync/autologout.role.authenticated.yml b/web/sites/default/config/sync/autologout.role.authenticated.yml similarity index 100% rename from sites/default/config/sync/autologout.role.authenticated.yml rename to web/sites/default/config/sync/autologout.role.authenticated.yml diff --git a/sites/default/config/sync/autologout.role.collectionneur.yml b/web/sites/default/config/sync/autologout.role.collectionneur.yml similarity index 100% rename from sites/default/config/sync/autologout.role.collectionneur.yml rename to web/sites/default/config/sync/autologout.role.collectionneur.yml diff --git a/sites/default/config/sync/autologout.role.invite.yml b/web/sites/default/config/sync/autologout.role.invite.yml similarity index 100% rename from sites/default/config/sync/autologout.role.invite.yml rename to web/sites/default/config/sync/autologout.role.invite.yml diff --git a/sites/default/config/sync/autologout.role.root.yml b/web/sites/default/config/sync/autologout.role.root.yml similarity index 100% rename from sites/default/config/sync/autologout.role.root.yml rename to web/sites/default/config/sync/autologout.role.root.yml diff --git a/sites/default/config/sync/autologout.role.user.yml b/web/sites/default/config/sync/autologout.role.user.yml similarity index 100% rename from sites/default/config/sync/autologout.role.user.yml rename to web/sites/default/config/sync/autologout.role.user.yml diff --git a/sites/default/config/sync/autologout.settings.yml b/web/sites/default/config/sync/autologout.settings.yml similarity index 100% rename from sites/default/config/sync/autologout.settings.yml rename to web/sites/default/config/sync/autologout.settings.yml diff --git a/sites/default/config/sync/basic.settings.yml b/web/sites/default/config/sync/basic.settings.yml similarity index 100% rename from sites/default/config/sync/basic.settings.yml rename to web/sites/default/config/sync/basic.settings.yml diff --git a/sites/default/config/sync/better_messages.settings.yml b/web/sites/default/config/sync/better_messages.settings.yml similarity index 100% rename from sites/default/config/sync/better_messages.settings.yml rename to web/sites/default/config/sync/better_messages.settings.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_breadcrumbs.yml b/web/sites/default/config/sync/block.block.adminimal_theme_breadcrumbs.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_breadcrumbs.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_breadcrumbs.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_content.yml b/web/sites/default/config/sync/block.block.adminimal_theme_content.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_content.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_content.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_local_actions.yml b/web/sites/default/config/sync/block.block.adminimal_theme_local_actions.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_local_actions.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_local_actions.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_login.yml b/web/sites/default/config/sync/block.block.adminimal_theme_login.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_login.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_login.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_messages.yml b/web/sites/default/config/sync/block.block.adminimal_theme_messages.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_messages.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_messages.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_page_title.yml b/web/sites/default/config/sync/block.block.adminimal_theme_page_title.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_page_title.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_page_title.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_primary_local_tasks.yml b/web/sites/default/config/sync/block.block.adminimal_theme_primary_local_tasks.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_primary_local_tasks.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_primary_local_tasks.yml diff --git a/sites/default/config/sync/block.block.adminimal_theme_secondary_local_tasks.yml b/web/sites/default/config/sync/block.block.adminimal_theme_secondary_local_tasks.yml similarity index 100% rename from sites/default/config/sync/block.block.adminimal_theme_secondary_local_tasks.yml rename to web/sites/default/config/sync/block.block.adminimal_theme_secondary_local_tasks.yml diff --git a/sites/default/config/sync/block.block.basic_branding.yml b/web/sites/default/config/sync/block.block.basic_branding.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_branding.yml rename to web/sites/default/config/sync/block.block.basic_branding.yml diff --git a/sites/default/config/sync/block.block.basic_content.yml b/web/sites/default/config/sync/block.block.basic_content.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_content.yml rename to web/sites/default/config/sync/block.block.basic_content.yml diff --git a/sites/default/config/sync/block.block.basic_footer.yml b/web/sites/default/config/sync/block.block.basic_footer.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_footer.yml rename to web/sites/default/config/sync/block.block.basic_footer.yml diff --git a/sites/default/config/sync/block.block.basic_help.yml b/web/sites/default/config/sync/block.block.basic_help.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_help.yml rename to web/sites/default/config/sync/block.block.basic_help.yml diff --git a/sites/default/config/sync/block.block.basic_local_actions.yml b/web/sites/default/config/sync/block.block.basic_local_actions.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_local_actions.yml rename to web/sites/default/config/sync/block.block.basic_local_actions.yml diff --git a/sites/default/config/sync/block.block.basic_local_tasks.yml b/web/sites/default/config/sync/block.block.basic_local_tasks.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_local_tasks.yml rename to web/sites/default/config/sync/block.block.basic_local_tasks.yml diff --git a/sites/default/config/sync/block.block.basic_main_menu.yml b/web/sites/default/config/sync/block.block.basic_main_menu.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_main_menu.yml rename to web/sites/default/config/sync/block.block.basic_main_menu.yml diff --git a/sites/default/config/sync/block.block.basic_messages.yml b/web/sites/default/config/sync/block.block.basic_messages.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_messages.yml rename to web/sites/default/config/sync/block.block.basic_messages.yml diff --git a/sites/default/config/sync/block.block.basic_page_title.yml b/web/sites/default/config/sync/block.block.basic_page_title.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_page_title.yml rename to web/sites/default/config/sync/block.block.basic_page_title.yml diff --git a/sites/default/config/sync/block.block.basic_tools.yml b/web/sites/default/config/sync/block.block.basic_tools.yml similarity index 100% rename from sites/default/config/sync/block.block.basic_tools.yml rename to web/sites/default/config/sync/block.block.basic_tools.yml diff --git a/sites/default/config/sync/block.block.edlpentreesblock.yml b/web/sites/default/config/sync/block.block.edlpentreesblock.yml similarity index 100% rename from sites/default/config/sync/block.block.edlpentreesblock.yml rename to web/sites/default/config/sync/block.block.edlpentreesblock.yml diff --git a/sites/default/config/sync/block.block.edlpsearchlinkblock.yml b/web/sites/default/config/sync/block.block.edlpsearchlinkblock.yml similarity index 100% rename from sites/default/config/sync/block.block.edlpsearchlinkblock.yml rename to web/sites/default/config/sync/block.block.edlpsearchlinkblock.yml diff --git a/sites/default/config/sync/block.block.edlptheme_branding.yml b/web/sites/default/config/sync/block.block.edlptheme_branding.yml similarity index 100% rename from sites/default/config/sync/block.block.edlptheme_branding.yml rename to web/sites/default/config/sync/block.block.edlptheme_branding.yml diff --git a/sites/default/config/sync/block.block.edlptheme_content.yml b/web/sites/default/config/sync/block.block.edlptheme_content.yml similarity index 100% rename from sites/default/config/sync/block.block.edlptheme_content.yml rename to web/sites/default/config/sync/block.block.edlptheme_content.yml diff --git a/sites/default/config/sync/block.block.footer.yml b/web/sites/default/config/sync/block.block.footer.yml similarity index 100% rename from sites/default/config/sync/block.block.footer.yml rename to web/sites/default/config/sync/block.block.footer.yml diff --git a/sites/default/config/sync/block.block.languageswitcher.yml b/web/sites/default/config/sync/block.block.languageswitcher.yml similarity index 100% rename from sites/default/config/sync/block.block.languageswitcher.yml rename to web/sites/default/config/sync/block.block.languageswitcher.yml diff --git a/sites/default/config/sync/block.block.languageswitcher_2.yml b/web/sites/default/config/sync/block.block.languageswitcher_2.yml similarity index 100% rename from sites/default/config/sync/block.block.languageswitcher_2.yml rename to web/sites/default/config/sync/block.block.languageswitcher_2.yml diff --git a/sites/default/config/sync/block.block.mainnavigation.yml b/web/sites/default/config/sync/block.block.mainnavigation.yml similarity index 100% rename from sites/default/config/sync/block.block.mainnavigation.yml rename to web/sites/default/config/sync/block.block.mainnavigation.yml diff --git a/sites/default/config/sync/block.block.mainnavigation_2.yml b/web/sites/default/config/sync/block.block.mainnavigation_2.yml similarity index 100% rename from sites/default/config/sync/block.block.mainnavigation_2.yml rename to web/sites/default/config/sync/block.block.mainnavigation_2.yml diff --git a/sites/default/config/sync/block.block.messages.yml b/web/sites/default/config/sync/block.block.messages.yml similarity index 100% rename from sites/default/config/sync/block.block.messages.yml rename to web/sites/default/config/sync/block.block.messages.yml diff --git a/sites/default/config/sync/block.block.productions.yml b/web/sites/default/config/sync/block.block.productions.yml similarity index 100% rename from sites/default/config/sync/block.block.productions.yml rename to web/sites/default/config/sync/block.block.productions.yml diff --git a/sites/default/config/sync/block.block.selecteurdelangue.yml b/web/sites/default/config/sync/block.block.selecteurdelangue.yml similarity index 100% rename from sites/default/config/sync/block.block.selecteurdelangue.yml rename to web/sites/default/config/sync/block.block.selecteurdelangue.yml diff --git a/sites/default/config/sync/block.block.selecteurdelangue_2.yml b/web/sites/default/config/sync/block.block.selecteurdelangue_2.yml similarity index 100% rename from sites/default/config/sync/block.block.selecteurdelangue_2.yml rename to web/sites/default/config/sync/block.block.selecteurdelangue_2.yml diff --git a/sites/default/config/sync/block.block.sitebranding.yml b/web/sites/default/config/sync/block.block.sitebranding.yml similarity index 100% rename from sites/default/config/sync/block.block.sitebranding.yml rename to web/sites/default/config/sync/block.block.sitebranding.yml diff --git a/sites/default/config/sync/block.block.stark_admin.yml b/web/sites/default/config/sync/block.block.stark_admin.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_admin.yml rename to web/sites/default/config/sync/block.block.stark_admin.yml diff --git a/sites/default/config/sync/block.block.stark_branding.yml b/web/sites/default/config/sync/block.block.stark_branding.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_branding.yml rename to web/sites/default/config/sync/block.block.stark_branding.yml diff --git a/sites/default/config/sync/block.block.stark_local_actions.yml b/web/sites/default/config/sync/block.block.stark_local_actions.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_local_actions.yml rename to web/sites/default/config/sync/block.block.stark_local_actions.yml diff --git a/sites/default/config/sync/block.block.stark_local_tasks.yml b/web/sites/default/config/sync/block.block.stark_local_tasks.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_local_tasks.yml rename to web/sites/default/config/sync/block.block.stark_local_tasks.yml diff --git a/sites/default/config/sync/block.block.stark_login.yml b/web/sites/default/config/sync/block.block.stark_login.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_login.yml rename to web/sites/default/config/sync/block.block.stark_login.yml diff --git a/sites/default/config/sync/block.block.stark_messages.yml b/web/sites/default/config/sync/block.block.stark_messages.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_messages.yml rename to web/sites/default/config/sync/block.block.stark_messages.yml diff --git a/sites/default/config/sync/block.block.stark_page_title.yml b/web/sites/default/config/sync/block.block.stark_page_title.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_page_title.yml rename to web/sites/default/config/sync/block.block.stark_page_title.yml diff --git a/sites/default/config/sync/block.block.stark_tools.yml b/web/sites/default/config/sync/block.block.stark_tools.yml similarity index 100% rename from sites/default/config/sync/block.block.stark_tools.yml rename to web/sites/default/config/sync/block.block.stark_tools.yml diff --git a/sites/default/config/sync/block.block.studiolinkblock.yml b/web/sites/default/config/sync/block.block.studiolinkblock.yml similarity index 100% rename from sites/default/config/sync/block.block.studiolinkblock.yml rename to web/sites/default/config/sync/block.block.studiolinkblock.yml diff --git a/sites/default/config/sync/block.block.tabs.yml b/web/sites/default/config/sync/block.block.tabs.yml similarity index 100% rename from sites/default/config/sync/block.block.tabs.yml rename to web/sites/default/config/sync/block.block.tabs.yml diff --git a/sites/default/config/sync/block.block.userlogin.yml b/web/sites/default/config/sync/block.block.userlogin.yml similarity index 100% rename from sites/default/config/sync/block.block.userlogin.yml rename to web/sites/default/config/sync/block.block.userlogin.yml diff --git a/sites/default/config/sync/block.block.userlogin_2.yml b/web/sites/default/config/sync/block.block.userlogin_2.yml similarity index 100% rename from sites/default/config/sync/block.block.userlogin_2.yml rename to web/sites/default/config/sync/block.block.userlogin_2.yml diff --git a/sites/default/config/sync/config_devel.settings.yml b/web/sites/default/config/sync/config_devel.settings.yml similarity index 100% rename from sites/default/config/sync/config_devel.settings.yml rename to web/sites/default/config/sync/config_devel.settings.yml diff --git a/sites/default/config/sync/config_ignore.settings.yml b/web/sites/default/config/sync/config_ignore.settings.yml similarity index 100% rename from sites/default/config/sync/config_ignore.settings.yml rename to web/sites/default/config/sync/config_ignore.settings.yml diff --git a/sites/default/config/sync/context.context.medium_up.yml b/web/sites/default/config/sync/context.context.medium_up.yml similarity index 100% rename from sites/default/config/sync/context.context.medium_up.yml rename to web/sites/default/config/sync/context.context.medium_up.yml diff --git a/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.changed.yml b/web/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.changed.yml rename to web/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.description.yml b/web/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.description.yml rename to web/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.description.yml diff --git a/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.title.yml b/web/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.title.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.title.yml rename to web/sites/default/config/sync/core.base_field_override.menu_link_content.menu_link_content.title.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.changed.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.changed.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.created.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.created.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.created.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.created.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.menu_link.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.menu_link.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.menu_link.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.menu_link.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.path.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.path.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.path.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.promote.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.promote.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.promote.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.promote.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.status.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.status.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.status.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.status.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.sticky.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.sticky.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.sticky.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.sticky.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.title.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.title.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.title.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.title.yml diff --git a/sites/default/config/sync/core.base_field_override.node.autre_son.uid.yml b/web/sites/default/config/sync/core.base_field_override.node.autre_son.uid.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.autre_son.uid.yml rename to web/sites/default/config/sync/core.base_field_override.node.autre_son.uid.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.changed.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.changed.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.created.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.created.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.created.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.created.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.path.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.path.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.path.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.promote.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.promote.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.promote.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.promote.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.status.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.status.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.status.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.status.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.sticky.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.sticky.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.sticky.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.sticky.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.title.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.title.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.title.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.title.yml diff --git a/sites/default/config/sync/core.base_field_override.node.enregistrement.uid.yml b/web/sites/default/config/sync/core.base_field_override.node.enregistrement.uid.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.enregistrement.uid.yml rename to web/sites/default/config/sync/core.base_field_override.node.enregistrement.uid.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.changed.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.changed.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.created.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.created.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.created.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.created.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.path.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.path.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.path.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.promote.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.promote.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.promote.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.promote.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.status.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.status.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.status.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.status.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.sticky.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.sticky.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.sticky.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.sticky.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.title.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.title.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.title.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.title.yml diff --git a/sites/default/config/sync/core.base_field_override.node.evenement.uid.yml b/web/sites/default/config/sync/core.base_field_override.node.evenement.uid.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.evenement.uid.yml rename to web/sites/default/config/sync/core.base_field_override.node.evenement.uid.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.changed.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.changed.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.created.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.created.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.created.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.created.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.menu_link.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.menu_link.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.menu_link.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.menu_link.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.path.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.path.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.path.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.promote.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.promote.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.promote.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.promote.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.status.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.status.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.status.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.status.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.sticky.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.sticky.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.sticky.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.sticky.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.title.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.title.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.title.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.title.yml diff --git a/sites/default/config/sync/core.base_field_override.node.fil.uid.yml b/web/sites/default/config/sync/core.base_field_override.node.fil.uid.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.fil.uid.yml rename to web/sites/default/config/sync/core.base_field_override.node.fil.uid.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.changed.yml b/web/sites/default/config/sync/core.base_field_override.node.page.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.changed.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.created.yml b/web/sites/default/config/sync/core.base_field_override.node.page.created.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.created.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.created.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.path.yml b/web/sites/default/config/sync/core.base_field_override.node.page.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.path.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.path.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.promote.yml b/web/sites/default/config/sync/core.base_field_override.node.page.promote.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.promote.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.promote.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.status.yml b/web/sites/default/config/sync/core.base_field_override.node.page.status.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.status.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.status.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.sticky.yml b/web/sites/default/config/sync/core.base_field_override.node.page.sticky.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.sticky.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.sticky.yml diff --git a/sites/default/config/sync/core.base_field_override.node.page.uid.yml b/web/sites/default/config/sync/core.base_field_override.node.page.uid.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.page.uid.yml rename to web/sites/default/config/sync/core.base_field_override.node.page.uid.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.changed.yml b/web/sites/default/config/sync/core.base_field_override.node.static.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.changed.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.created.yml b/web/sites/default/config/sync/core.base_field_override.node.static.created.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.created.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.created.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.path.yml b/web/sites/default/config/sync/core.base_field_override.node.static.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.path.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.path.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.promote.yml b/web/sites/default/config/sync/core.base_field_override.node.static.promote.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.promote.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.promote.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.status.yml b/web/sites/default/config/sync/core.base_field_override.node.static.status.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.status.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.status.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.sticky.yml b/web/sites/default/config/sync/core.base_field_override.node.static.sticky.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.sticky.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.sticky.yml diff --git a/sites/default/config/sync/core.base_field_override.node.static.uid.yml b/web/sites/default/config/sync/core.base_field_override.node.static.uid.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.node.static.uid.yml rename to web/sites/default/config/sync/core.base_field_override.node.static.uid.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.changed.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.changed.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.description.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.description.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.description.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.name.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.name.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.name.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.name.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.path.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.path.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.collectionneurs.path.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.changed.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.changed.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.description.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.description.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.description.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.name.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.name.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.name.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.name.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.path.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.path.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.entrees.path.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.changed.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.genres.changed.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.description.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.genres.description.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.description.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.name.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.name.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.genres.name.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.name.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.path.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.genres.path.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.genres.path.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.changed.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.langues.changed.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.description.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.langues.description.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.description.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.name.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.name.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.langues.name.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.name.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.path.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.langues.path.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.langues.path.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.changed.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.changed.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.description.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.description.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.description.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.name.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.name.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.name.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.name.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.path.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.path.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.locuteurs.path.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.changed.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.changed.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.description.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.description.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.description.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.description.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.name.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.name.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.name.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.name.yml diff --git a/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.path.yml b/web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.path.yml rename to web/sites/default/config/sync/core.base_field_override.taxonomy_term.page_type.path.yml diff --git a/sites/default/config/sync/core.base_field_override.user.user.changed.yml b/web/sites/default/config/sync/core.base_field_override.user.user.changed.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.user.user.changed.yml rename to web/sites/default/config/sync/core.base_field_override.user.user.changed.yml diff --git a/sites/default/config/sync/core.base_field_override.user.user.path.yml b/web/sites/default/config/sync/core.base_field_override.user.user.path.yml similarity index 100% rename from sites/default/config/sync/core.base_field_override.user.user.path.yml rename to web/sites/default/config/sync/core.base_field_override.user.user.path.yml diff --git a/sites/default/config/sync/core.date_format.fallback.yml b/web/sites/default/config/sync/core.date_format.fallback.yml similarity index 100% rename from sites/default/config/sync/core.date_format.fallback.yml rename to web/sites/default/config/sync/core.date_format.fallback.yml diff --git a/sites/default/config/sync/core.date_format.html_date.yml b/web/sites/default/config/sync/core.date_format.html_date.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_date.yml rename to web/sites/default/config/sync/core.date_format.html_date.yml diff --git a/sites/default/config/sync/core.date_format.html_datetime.yml b/web/sites/default/config/sync/core.date_format.html_datetime.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_datetime.yml rename to web/sites/default/config/sync/core.date_format.html_datetime.yml diff --git a/sites/default/config/sync/core.date_format.html_month.yml b/web/sites/default/config/sync/core.date_format.html_month.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_month.yml rename to web/sites/default/config/sync/core.date_format.html_month.yml diff --git a/sites/default/config/sync/core.date_format.html_time.yml b/web/sites/default/config/sync/core.date_format.html_time.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_time.yml rename to web/sites/default/config/sync/core.date_format.html_time.yml diff --git a/sites/default/config/sync/core.date_format.html_week.yml b/web/sites/default/config/sync/core.date_format.html_week.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_week.yml rename to web/sites/default/config/sync/core.date_format.html_week.yml diff --git a/sites/default/config/sync/core.date_format.html_year.yml b/web/sites/default/config/sync/core.date_format.html_year.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_year.yml rename to web/sites/default/config/sync/core.date_format.html_year.yml diff --git a/sites/default/config/sync/core.date_format.html_yearless_date.yml b/web/sites/default/config/sync/core.date_format.html_yearless_date.yml similarity index 100% rename from sites/default/config/sync/core.date_format.html_yearless_date.yml rename to web/sites/default/config/sync/core.date_format.html_yearless_date.yml diff --git a/sites/default/config/sync/core.date_format.long.yml b/web/sites/default/config/sync/core.date_format.long.yml similarity index 100% rename from sites/default/config/sync/core.date_format.long.yml rename to web/sites/default/config/sync/core.date_format.long.yml diff --git a/sites/default/config/sync/core.date_format.medium.yml b/web/sites/default/config/sync/core.date_format.medium.yml similarity index 100% rename from sites/default/config/sync/core.date_format.medium.yml rename to web/sites/default/config/sync/core.date_format.medium.yml diff --git a/sites/default/config/sync/core.date_format.short.yml b/web/sites/default/config/sync/core.date_format.short.yml similarity index 100% rename from sites/default/config/sync/core.date_format.short.yml rename to web/sites/default/config/sync/core.date_format.short.yml diff --git a/sites/default/config/sync/core.entity_form_display.composition.composition.default.yml b/web/sites/default/config/sync/core.entity_form_display.composition.composition.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.composition.composition.default.yml rename to web/sites/default/config/sync/core.entity_form_display.composition.composition.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.menu_link_content.menu_link_content.default.yml b/web/sites/default/config/sync/core.entity_form_display.menu_link_content.menu_link_content.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.menu_link_content.menu_link_content.default.yml rename to web/sites/default/config/sync/core.entity_form_display.menu_link_content.menu_link_content.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.node.autre_son.default.yml b/web/sites/default/config/sync/core.entity_form_display.node.autre_son.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.node.autre_son.default.yml rename to web/sites/default/config/sync/core.entity_form_display.node.autre_son.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.node.enregistrement.default.yml b/web/sites/default/config/sync/core.entity_form_display.node.enregistrement.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.node.enregistrement.default.yml rename to web/sites/default/config/sync/core.entity_form_display.node.enregistrement.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.node.evenement.default.yml b/web/sites/default/config/sync/core.entity_form_display.node.evenement.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.node.evenement.default.yml rename to web/sites/default/config/sync/core.entity_form_display.node.evenement.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.node.fil.default.yml b/web/sites/default/config/sync/core.entity_form_display.node.fil.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.node.fil.default.yml rename to web/sites/default/config/sync/core.entity_form_display.node.fil.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.node.page.default.yml b/web/sites/default/config/sync/core.entity_form_display.node.page.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.node.page.default.yml rename to web/sites/default/config/sync/core.entity_form_display.node.page.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.node.static.default.yml b/web/sites/default/config/sync/core.entity_form_display.node.static.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.node.static.default.yml rename to web/sites/default/config/sync/core.entity_form_display.node.static.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.taxonomy_term.entrees.default.yml b/web/sites/default/config/sync/core.entity_form_display.taxonomy_term.entrees.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.taxonomy_term.entrees.default.yml rename to web/sites/default/config/sync/core.entity_form_display.taxonomy_term.entrees.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.taxonomy_term.genres.default.yml b/web/sites/default/config/sync/core.entity_form_display.taxonomy_term.genres.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.taxonomy_term.genres.default.yml rename to web/sites/default/config/sync/core.entity_form_display.taxonomy_term.genres.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.taxonomy_term.langues.default.yml b/web/sites/default/config/sync/core.entity_form_display.taxonomy_term.langues.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.taxonomy_term.langues.default.yml rename to web/sites/default/config/sync/core.entity_form_display.taxonomy_term.langues.default.yml diff --git a/sites/default/config/sync/core.entity_form_display.user.user.default.yml b/web/sites/default/config/sync/core.entity_form_display.user.user.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_display.user.user.default.yml rename to web/sites/default/config/sync/core.entity_form_display.user.user.default.yml diff --git a/sites/default/config/sync/core.entity_form_mode.user.register.yml b/web/sites/default/config/sync/core.entity_form_mode.user.register.yml similarity index 100% rename from sites/default/config/sync/core.entity_form_mode.user.register.yml rename to web/sites/default/config/sync/core.entity_form_mode.user.register.yml diff --git a/sites/default/config/sync/core.entity_view_display.composition.composition.default.yml b/web/sites/default/config/sync/core.entity_view_display.composition.composition.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.composition.composition.default.yml rename to web/sites/default/config/sync/core.entity_view_display.composition.composition.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.composition.composition.studio_ui.yml b/web/sites/default/config/sync/core.entity_view_display.composition.composition.studio_ui.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.composition.composition.studio_ui.yml rename to web/sites/default/config/sync/core.entity_view_display.composition.composition.studio_ui.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.autre_son.default.yml b/web/sites/default/config/sync/core.entity_view_display.node.autre_son.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.autre_son.default.yml rename to web/sites/default/config/sync/core.entity_view_display.node.autre_son.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.autre_son.teaser.yml b/web/sites/default/config/sync/core.entity_view_display.node.autre_son.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.autre_son.teaser.yml rename to web/sites/default/config/sync/core.entity_view_display.node.autre_son.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.article.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.article.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.article.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.article.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.chutier.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.chutier.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.chutier.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.chutier.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.compo.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.compo.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.compo.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.compo.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.compo_document_.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.compo_document_.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.compo_document_.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.compo_document_.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.default.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.default.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.index.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.index.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.index.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.index.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.index_home.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.index_home.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.index_home.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.index_home.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.lastdocs.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.lastdocs.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.lastdocs.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.lastdocs.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.player_cartel.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.player_cartel.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.player_cartel.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.player_cartel.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.search_index.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.search_index.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.search_index.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.search_index.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.teaser.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.teaser.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.enregistrement.transcript.yml b/web/sites/default/config/sync/core.entity_view_display.node.enregistrement.transcript.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.enregistrement.transcript.yml rename to web/sites/default/config/sync/core.entity_view_display.node.enregistrement.transcript.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.evenement.aside.yml b/web/sites/default/config/sync/core.entity_view_display.node.evenement.aside.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.evenement.aside.yml rename to web/sites/default/config/sync/core.entity_view_display.node.evenement.aside.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.evenement.default.yml b/web/sites/default/config/sync/core.entity_view_display.node.evenement.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.evenement.default.yml rename to web/sites/default/config/sync/core.entity_view_display.node.evenement.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.evenement.teaser.yml b/web/sites/default/config/sync/core.entity_view_display.node.evenement.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.evenement.teaser.yml rename to web/sites/default/config/sync/core.entity_view_display.node.evenement.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.fil.admin.yml b/web/sites/default/config/sync/core.entity_view_display.node.fil.admin.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.fil.admin.yml rename to web/sites/default/config/sync/core.entity_view_display.node.fil.admin.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.fil.default.yml b/web/sites/default/config/sync/core.entity_view_display.node.fil.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.fil.default.yml rename to web/sites/default/config/sync/core.entity_view_display.node.fil.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.fil.teaser.yml b/web/sites/default/config/sync/core.entity_view_display.node.fil.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.fil.teaser.yml rename to web/sites/default/config/sync/core.entity_view_display.node.fil.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.page.default.yml b/web/sites/default/config/sync/core.entity_view_display.node.page.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.page.default.yml rename to web/sites/default/config/sync/core.entity_view_display.node.page.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.page.image_1_columns.yml b/web/sites/default/config/sync/core.entity_view_display.node.page.image_1_columns.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.page.image_1_columns.yml rename to web/sites/default/config/sync/core.entity_view_display.node.page.image_1_columns.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.page.image_2_columns.yml b/web/sites/default/config/sync/core.entity_view_display.node.page.image_2_columns.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.page.image_2_columns.yml rename to web/sites/default/config/sync/core.entity_view_display.node.page.image_2_columns.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.page.teaser.yml b/web/sites/default/config/sync/core.entity_view_display.node.page.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.page.teaser.yml rename to web/sites/default/config/sync/core.entity_view_display.node.page.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.page.text_1_column.yml b/web/sites/default/config/sync/core.entity_view_display.node.page.text_1_column.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.page.text_1_column.yml rename to web/sites/default/config/sync/core.entity_view_display.node.page.text_1_column.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.static.default.yml b/web/sites/default/config/sync/core.entity_view_display.node.static.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.static.default.yml rename to web/sites/default/config/sync/core.entity_view_display.node.static.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.node.static.teaser.yml b/web/sites/default/config/sync/core.entity_view_display.node.static.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.node.static.teaser.yml rename to web/sites/default/config/sync/core.entity_view_display.node.static.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.default.yml b/web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.default.yml rename to web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.default.yml diff --git a/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.home_mobile.yml b/web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.home_mobile.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.home_mobile.yml rename to web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.home_mobile.yml diff --git a/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.index.yml b/web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.index.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.index.yml rename to web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.index.yml diff --git a/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.notice.yml b/web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.notice.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.notice.yml rename to web/sites/default/config/sync/core.entity_view_display.taxonomy_term.entrees.notice.yml diff --git a/sites/default/config/sync/core.entity_view_display.taxonomy_term.genres.default.yml b/web/sites/default/config/sync/core.entity_view_display.taxonomy_term.genres.default.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_display.taxonomy_term.genres.default.yml rename to web/sites/default/config/sync/core.entity_view_display.taxonomy_term.genres.default.yml diff --git a/sites/default/config/sync/core.entity_view_mode.block.token.yml b/web/sites/default/config/sync/core.entity_view_mode.block.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.block.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.block.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.chutier.token.yml b/web/sites/default/config/sync/core.entity_view_mode.chutier.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.chutier.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.chutier.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.composition.studio_ui.yml b/web/sites/default/config/sync/core.entity_view_mode.composition.studio_ui.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.composition.studio_ui.yml rename to web/sites/default/config/sync/core.entity_view_mode.composition.studio_ui.yml diff --git a/sites/default/config/sync/core.entity_view_mode.composition.token.yml b/web/sites/default/config/sync/core.entity_view_mode.composition.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.composition.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.composition.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.file.token.yml b/web/sites/default/config/sync/core.entity_view_mode.file.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.file.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.file.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.menu_link_content.token.yml b/web/sites/default/config/sync/core.entity_view_mode.menu_link_content.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.menu_link_content.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.menu_link_content.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.admin.yml b/web/sites/default/config/sync/core.entity_view_mode.node.admin.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.admin.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.admin.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.article.yml b/web/sites/default/config/sync/core.entity_view_mode.node.article.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.article.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.article.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.aside.yml b/web/sites/default/config/sync/core.entity_view_mode.node.aside.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.aside.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.aside.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.chutier.yml b/web/sites/default/config/sync/core.entity_view_mode.node.chutier.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.chutier.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.chutier.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.compo.yml b/web/sites/default/config/sync/core.entity_view_mode.node.compo.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.compo.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.compo.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.compo_document_.yml b/web/sites/default/config/sync/core.entity_view_mode.node.compo_document_.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.compo_document_.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.compo_document_.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.full.yml b/web/sites/default/config/sync/core.entity_view_mode.node.full.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.full.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.full.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.image_1_columns.yml b/web/sites/default/config/sync/core.entity_view_mode.node.image_1_columns.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.image_1_columns.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.image_1_columns.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.image_2_columns.yml b/web/sites/default/config/sync/core.entity_view_mode.node.image_2_columns.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.image_2_columns.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.image_2_columns.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.index.yml b/web/sites/default/config/sync/core.entity_view_mode.node.index.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.index.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.index.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.index_home.yml b/web/sites/default/config/sync/core.entity_view_mode.node.index_home.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.index_home.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.index_home.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.lastdocs.yml b/web/sites/default/config/sync/core.entity_view_mode.node.lastdocs.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.lastdocs.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.lastdocs.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.player_cartel.yml b/web/sites/default/config/sync/core.entity_view_mode.node.player_cartel.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.player_cartel.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.player_cartel.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.rss.yml b/web/sites/default/config/sync/core.entity_view_mode.node.rss.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.rss.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.rss.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.search_index.yml b/web/sites/default/config/sync/core.entity_view_mode.node.search_index.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.search_index.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.search_index.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.search_result.yml b/web/sites/default/config/sync/core.entity_view_mode.node.search_result.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.search_result.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.search_result.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.teaser.yml b/web/sites/default/config/sync/core.entity_view_mode.node.teaser.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.teaser.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.teaser.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.text_1_column.yml b/web/sites/default/config/sync/core.entity_view_mode.node.text_1_column.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.text_1_column.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.text_1_column.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.token.yml b/web/sites/default/config/sync/core.entity_view_mode.node.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.node.transcript.yml b/web/sites/default/config/sync/core.entity_view_mode.node.transcript.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.node.transcript.yml rename to web/sites/default/config/sync/core.entity_view_mode.node.transcript.yml diff --git a/sites/default/config/sync/core.entity_view_mode.profile.token.yml b/web/sites/default/config/sync/core.entity_view_mode.profile.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.profile.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.profile.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.search_api_task.token.yml b/web/sites/default/config/sync/core.entity_view_mode.search_api_task.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.search_api_task.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.search_api_task.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.taxonomy_term.full.yml b/web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.full.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.taxonomy_term.full.yml rename to web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.full.yml diff --git a/sites/default/config/sync/core.entity_view_mode.taxonomy_term.home_mobile.yml b/web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.home_mobile.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.taxonomy_term.home_mobile.yml rename to web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.home_mobile.yml diff --git a/sites/default/config/sync/core.entity_view_mode.taxonomy_term.index.yml b/web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.index.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.taxonomy_term.index.yml rename to web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.index.yml diff --git a/sites/default/config/sync/core.entity_view_mode.taxonomy_term.notice.yml b/web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.notice.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.taxonomy_term.notice.yml rename to web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.notice.yml diff --git a/sites/default/config/sync/core.entity_view_mode.taxonomy_term.token.yml b/web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.taxonomy_term.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.taxonomy_term.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.user.compact.yml b/web/sites/default/config/sync/core.entity_view_mode.user.compact.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.user.compact.yml rename to web/sites/default/config/sync/core.entity_view_mode.user.compact.yml diff --git a/sites/default/config/sync/core.entity_view_mode.user.full.yml b/web/sites/default/config/sync/core.entity_view_mode.user.full.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.user.full.yml rename to web/sites/default/config/sync/core.entity_view_mode.user.full.yml diff --git a/sites/default/config/sync/core.entity_view_mode.user.token.yml b/web/sites/default/config/sync/core.entity_view_mode.user.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.user.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.user.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.workflow_scheduled_transition.token.yml b/web/sites/default/config/sync/core.entity_view_mode.workflow_scheduled_transition.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.workflow_scheduled_transition.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.workflow_scheduled_transition.token.yml diff --git a/sites/default/config/sync/core.entity_view_mode.workflow_transition.token.yml b/web/sites/default/config/sync/core.entity_view_mode.workflow_transition.token.yml similarity index 100% rename from sites/default/config/sync/core.entity_view_mode.workflow_transition.token.yml rename to web/sites/default/config/sync/core.entity_view_mode.workflow_transition.token.yml diff --git a/sites/default/config/sync/core.extension.yml b/web/sites/default/config/sync/core.extension.yml similarity index 100% rename from sites/default/config/sync/core.extension.yml rename to web/sites/default/config/sync/core.extension.yml diff --git a/sites/default/config/sync/core.menu.static_menu_link_overrides.yml b/web/sites/default/config/sync/core.menu.static_menu_link_overrides.yml similarity index 100% rename from sites/default/config/sync/core.menu.static_menu_link_overrides.yml rename to web/sites/default/config/sync/core.menu.static_menu_link_overrides.yml diff --git a/sites/default/config/sync/dblog.settings.yml b/web/sites/default/config/sync/dblog.settings.yml similarity index 100% rename from sites/default/config/sync/dblog.settings.yml rename to web/sites/default/config/sync/dblog.settings.yml diff --git a/sites/default/config/sync/devel.settings.yml b/web/sites/default/config/sync/devel.settings.yml similarity index 100% rename from sites/default/config/sync/devel.settings.yml rename to web/sites/default/config/sync/devel.settings.yml diff --git a/sites/default/config/sync/devel.toolbar.settings.yml b/web/sites/default/config/sync/devel.toolbar.settings.yml similarity index 100% rename from sites/default/config/sync/devel.toolbar.settings.yml rename to web/sites/default/config/sync/devel.toolbar.settings.yml diff --git a/sites/default/config/sync/domain.record.encyclopediedelaparole_org.yml b/web/sites/default/config/sync/domain.record.encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/domain.record.encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/domain.record.encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/domain.record.m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/domain.record.m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/domain.record.m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/domain.record.m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/domain.settings.yml b/web/sites/default/config/sync/domain.settings.yml similarity index 100% rename from sites/default/config/sync/domain.settings.yml rename to web/sites/default/config/sync/domain.settings.yml diff --git a/sites/default/config/sync/domain_access.settings.yml b/web/sites/default/config/sync/domain_access.settings.yml similarity index 100% rename from sites/default/config/sync/domain_access.settings.yml rename to web/sites/default/config/sync/domain_access.settings.yml diff --git a/sites/default/config/sync/domain_alias.alias.beta_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/domain_alias.alias.beta_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/domain_alias.alias.beta_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/domain_alias.alias.beta_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/domain_alias.alias.beta_m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/domain_alias.alias.beta_m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/domain_alias.alias.beta_m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/domain_alias.alias.beta_m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/domain_alias.alias.dev_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/domain_alias.alias.dev_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/domain_alias.alias.dev_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/domain_alias.alias.dev_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/domain_alias.alias.dev_m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/domain_alias.alias.dev_m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/domain_alias.alias.dev_m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/domain_alias.alias.dev_m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/domain_alias.alias.edlp_figli_io.yml b/web/sites/default/config/sync/domain_alias.alias.edlp_figli_io.yml similarity index 100% rename from sites/default/config/sync/domain_alias.alias.edlp_figli_io.yml rename to web/sites/default/config/sync/domain_alias.alias.edlp_figli_io.yml diff --git a/sites/default/config/sync/domain_alias.alias.edlp_m_figli_io.yml b/web/sites/default/config/sync/domain_alias.alias.edlp_m_figli_io.yml similarity index 100% rename from sites/default/config/sync/domain_alias.alias.edlp_m_figli_io.yml rename to web/sites/default/config/sync/domain_alias.alias.edlp_m_figli_io.yml diff --git a/sites/default/config/sync/domain_alias.settings.yml b/web/sites/default/config/sync/domain_alias.settings.yml similarity index 100% rename from sites/default/config/sync/domain_alias.settings.yml rename to web/sites/default/config/sync/domain_alias.settings.yml diff --git a/sites/default/config/sync/domain_menu_access.settings.yml b/web/sites/default/config/sync/domain_menu_access.settings.yml similarity index 100% rename from sites/default/config/sync/domain_menu_access.settings.yml rename to web/sites/default/config/sync/domain_menu_access.settings.yml diff --git a/sites/default/config/sync/domain_site_settings.domainconfigsettings.yml b/web/sites/default/config/sync/domain_site_settings.domainconfigsettings.yml similarity index 100% rename from sites/default/config/sync/domain_site_settings.domainconfigsettings.yml rename to web/sites/default/config/sync/domain_site_settings.domainconfigsettings.yml diff --git a/sites/default/config/sync/editor.editor.wysiwyg.yml b/web/sites/default/config/sync/editor.editor.wysiwyg.yml similarity index 100% rename from sites/default/config/sync/editor.editor.wysiwyg.yml rename to web/sites/default/config/sync/editor.editor.wysiwyg.yml diff --git a/sites/default/config/sync/edlptheme.settings.yml b/web/sites/default/config/sync/edlptheme.settings.yml similarity index 100% rename from sites/default/config/sync/edlptheme.settings.yml rename to web/sites/default/config/sync/edlptheme.settings.yml diff --git a/sites/default/config/sync/email_registration.settings.yml b/web/sites/default/config/sync/email_registration.settings.yml similarity index 100% rename from sites/default/config/sync/email_registration.settings.yml rename to web/sites/default/config/sync/email_registration.settings.yml diff --git a/sites/default/config/sync/features.bundle.default.yml b/web/sites/default/config/sync/features.bundle.default.yml similarity index 100% rename from sites/default/config/sync/features.bundle.default.yml rename to web/sites/default/config/sync/features.bundle.default.yml diff --git a/sites/default/config/sync/features.settings.yml b/web/sites/default/config/sync/features.settings.yml similarity index 100% rename from sites/default/config/sync/features.settings.yml rename to web/sites/default/config/sync/features.settings.yml diff --git a/sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_access.yml b/web/sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_access.yml rename to web/sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.menu_link_content.menu_link_content.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.body.yml b/web/sites/default/config/sync/field.field.node.autre_son.body.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.body.yml rename to web/sites/default/config/sync/field.field.node.autre_son.body.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.field_collectionneurs.yml b/web/sites/default/config/sync/field.field.node.autre_son.field_collectionneurs.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.field_collectionneurs.yml rename to web/sites/default/config/sync/field.field.node.autre_son.field_collectionneurs.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.field_domain_access.yml b/web/sites/default/config/sync/field.field.node.autre_son.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.field_domain_access.yml rename to web/sites/default/config/sync/field.field.node.autre_son.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.node.autre_son.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.node.autre_son.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.field_genres.yml b/web/sites/default/config/sync/field.field.node.autre_son.field_genres.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.field_genres.yml rename to web/sites/default/config/sync/field.field.node.autre_son.field_genres.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.field_locuteurs.yml b/web/sites/default/config/sync/field.field.node.autre_son.field_locuteurs.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.field_locuteurs.yml rename to web/sites/default/config/sync/field.field.node.autre_son.field_locuteurs.yml diff --git a/sites/default/config/sync/field.field.node.autre_son.field_son.yml b/web/sites/default/config/sync/field.field.node.autre_son.field_son.yml similarity index 100% rename from sites/default/config/sync/field.field.node.autre_son.field_son.yml rename to web/sites/default/config/sync/field.field.node.autre_son.field_son.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.body.yml b/web/sites/default/config/sync/field.field.node.enregistrement.body.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.body.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.body.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_collectionneurs.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_collectionneurs.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_collectionneurs.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_collectionneurs.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_description.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_description.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_description.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_description.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_domain_access.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_domain_access.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_entrees.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_entrees.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_entrees.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_entrees.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_genres.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_genres.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_genres.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_genres.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_langues.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_langues.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_langues.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_langues.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_locuteurs.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_locuteurs.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_locuteurs.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_locuteurs.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_nbr_locuteurs.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_nbr_locuteurs.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_nbr_locuteurs.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_nbr_locuteurs.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_son.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_son.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_son.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_son.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_transcript_trad.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_transcript_trad.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_transcript_trad.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_transcript_trad.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_transcript_vo.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_transcript_vo.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_transcript_vo.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_transcript_vo.yml diff --git a/sites/default/config/sync/field.field.node.enregistrement.field_workflow.yml b/web/sites/default/config/sync/field.field.node.enregistrement.field_workflow.yml similarity index 100% rename from sites/default/config/sync/field.field.node.enregistrement.field_workflow.yml rename to web/sites/default/config/sync/field.field.node.enregistrement.field_workflow.yml diff --git a/sites/default/config/sync/field.field.node.evenement.body.yml b/web/sites/default/config/sync/field.field.node.evenement.body.yml similarity index 100% rename from sites/default/config/sync/field.field.node.evenement.body.yml rename to web/sites/default/config/sync/field.field.node.evenement.body.yml diff --git a/sites/default/config/sync/field.field.node.evenement.field_date.yml b/web/sites/default/config/sync/field.field.node.evenement.field_date.yml similarity index 100% rename from sites/default/config/sync/field.field.node.evenement.field_date.yml rename to web/sites/default/config/sync/field.field.node.evenement.field_date.yml diff --git a/sites/default/config/sync/field.field.node.evenement.field_domain_access.yml b/web/sites/default/config/sync/field.field.node.evenement.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.node.evenement.field_domain_access.yml rename to web/sites/default/config/sync/field.field.node.evenement.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.node.evenement.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.node.evenement.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.node.evenement.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.node.evenement.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.evenement.field_page_liee.yml b/web/sites/default/config/sync/field.field.node.evenement.field_page_liee.yml similarity index 100% rename from sites/default/config/sync/field.field.node.evenement.field_page_liee.yml rename to web/sites/default/config/sync/field.field.node.evenement.field_page_liee.yml diff --git a/sites/default/config/sync/field.field.node.evenement.field_workflow_generic.yml b/web/sites/default/config/sync/field.field.node.evenement.field_workflow_generic.yml similarity index 100% rename from sites/default/config/sync/field.field.node.evenement.field_workflow_generic.yml rename to web/sites/default/config/sync/field.field.node.evenement.field_workflow_generic.yml diff --git a/sites/default/config/sync/field.field.node.fil.body.yml b/web/sites/default/config/sync/field.field.node.fil.body.yml similarity index 100% rename from sites/default/config/sync/field.field.node.fil.body.yml rename to web/sites/default/config/sync/field.field.node.fil.body.yml diff --git a/sites/default/config/sync/field.field.node.fil.field_domain_access.yml b/web/sites/default/config/sync/field.field.node.fil.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.node.fil.field_domain_access.yml rename to web/sites/default/config/sync/field.field.node.fil.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.node.fil.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.node.fil.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.node.fil.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.node.fil.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.fil.field_enregistrement.yml b/web/sites/default/config/sync/field.field.node.fil.field_enregistrement.yml similarity index 100% rename from sites/default/config/sync/field.field.node.fil.field_enregistrement.yml rename to web/sites/default/config/sync/field.field.node.fil.field_enregistrement.yml diff --git a/sites/default/config/sync/field.field.node.page.body.yml b/web/sites/default/config/sync/field.field.node.page.body.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.body.yml rename to web/sites/default/config/sync/field.field.node.page.body.yml diff --git a/sites/default/config/sync/field.field.node.page.field_afficher_en_page_d_acceuil.yml b/web/sites/default/config/sync/field.field.node.page.field_afficher_en_page_d_acceuil.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_afficher_en_page_d_acceuil.yml rename to web/sites/default/config/sync/field.field.node.page.field_afficher_en_page_d_acceuil.yml diff --git a/sites/default/config/sync/field.field.node.page.field_documents_lies.yml b/web/sites/default/config/sync/field.field.node.page.field_documents_lies.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_documents_lies.yml rename to web/sites/default/config/sync/field.field.node.page.field_documents_lies.yml diff --git a/sites/default/config/sync/field.field.node.page.field_domain_access.yml b/web/sites/default/config/sync/field.field.node.page.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_domain_access.yml rename to web/sites/default/config/sync/field.field.node.page.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.node.page.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.node.page.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.node.page.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.page.field_page_type.yml b/web/sites/default/config/sync/field.field.node.page.field_page_type.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_page_type.yml rename to web/sites/default/config/sync/field.field.node.page.field_page_type.yml diff --git a/sites/default/config/sync/field.field.node.page.field_son.yml b/web/sites/default/config/sync/field.field.node.page.field_son.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_son.yml rename to web/sites/default/config/sync/field.field.node.page.field_son.yml diff --git a/sites/default/config/sync/field.field.node.page.field_view_mode.yml b/web/sites/default/config/sync/field.field.node.page.field_view_mode.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_view_mode.yml rename to web/sites/default/config/sync/field.field.node.page.field_view_mode.yml diff --git a/sites/default/config/sync/field.field.node.page.field_visuel.yml b/web/sites/default/config/sync/field.field.node.page.field_visuel.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_visuel.yml rename to web/sites/default/config/sync/field.field.node.page.field_visuel.yml diff --git a/sites/default/config/sync/field.field.node.page.field_workflow_generic.yml b/web/sites/default/config/sync/field.field.node.page.field_workflow_generic.yml similarity index 100% rename from sites/default/config/sync/field.field.node.page.field_workflow_generic.yml rename to web/sites/default/config/sync/field.field.node.page.field_workflow_generic.yml diff --git a/sites/default/config/sync/field.field.node.static.body.yml b/web/sites/default/config/sync/field.field.node.static.body.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.body.yml rename to web/sites/default/config/sync/field.field.node.static.body.yml diff --git a/sites/default/config/sync/field.field.node.static.field_afficher_en_page_d_acceuil.yml b/web/sites/default/config/sync/field.field.node.static.field_afficher_en_page_d_acceuil.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.field_afficher_en_page_d_acceuil.yml rename to web/sites/default/config/sync/field.field.node.static.field_afficher_en_page_d_acceuil.yml diff --git a/sites/default/config/sync/field.field.node.static.field_domain_access.yml b/web/sites/default/config/sync/field.field.node.static.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.field_domain_access.yml rename to web/sites/default/config/sync/field.field.node.static.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.node.static.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.node.static.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.node.static.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.field.node.static.field_view_mode.yml b/web/sites/default/config/sync/field.field.node.static.field_view_mode.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.field_view_mode.yml rename to web/sites/default/config/sync/field.field.node.static.field_view_mode.yml diff --git a/sites/default/config/sync/field.field.node.static.field_visuel.yml b/web/sites/default/config/sync/field.field.node.static.field_visuel.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.field_visuel.yml rename to web/sites/default/config/sync/field.field.node.static.field_visuel.yml diff --git a/sites/default/config/sync/field.field.node.static.field_workflow_generic.yml b/web/sites/default/config/sync/field.field.node.static.field_workflow_generic.yml similarity index 100% rename from sites/default/config/sync/field.field.node.static.field_workflow_generic.yml rename to web/sites/default/config/sync/field.field.node.static.field_workflow_generic.yml diff --git a/sites/default/config/sync/field.field.taxonomy_term.entrees.field_color.yml b/web/sites/default/config/sync/field.field.taxonomy_term.entrees.field_color.yml similarity index 100% rename from sites/default/config/sync/field.field.taxonomy_term.entrees.field_color.yml rename to web/sites/default/config/sync/field.field.taxonomy_term.entrees.field_color.yml diff --git a/sites/default/config/sync/field.field.taxonomy_term.entrees.field_notice.yml b/web/sites/default/config/sync/field.field.taxonomy_term.entrees.field_notice.yml similarity index 100% rename from sites/default/config/sync/field.field.taxonomy_term.entrees.field_notice.yml rename to web/sites/default/config/sync/field.field.taxonomy_term.entrees.field_notice.yml diff --git a/sites/default/config/sync/field.field.taxonomy_term.entrees.field_workflow.yml b/web/sites/default/config/sync/field.field.taxonomy_term.entrees.field_workflow.yml similarity index 100% rename from sites/default/config/sync/field.field.taxonomy_term.entrees.field_workflow.yml rename to web/sites/default/config/sync/field.field.taxonomy_term.entrees.field_workflow.yml diff --git a/sites/default/config/sync/field.field.taxonomy_term.genres.field_synonyms.yml b/web/sites/default/config/sync/field.field.taxonomy_term.genres.field_synonyms.yml similarity index 100% rename from sites/default/config/sync/field.field.taxonomy_term.genres.field_synonyms.yml rename to web/sites/default/config/sync/field.field.taxonomy_term.genres.field_synonyms.yml diff --git a/sites/default/config/sync/field.field.user.user.field_domain_access.yml b/web/sites/default/config/sync/field.field.user.user.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.field.user.user.field_domain_access.yml rename to web/sites/default/config/sync/field.field.user.user.field_domain_access.yml diff --git a/sites/default/config/sync/field.field.user.user.field_domain_admin.yml b/web/sites/default/config/sync/field.field.user.user.field_domain_admin.yml similarity index 100% rename from sites/default/config/sync/field.field.user.user.field_domain_admin.yml rename to web/sites/default/config/sync/field.field.user.user.field_domain_admin.yml diff --git a/sites/default/config/sync/field.field.user.user.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.field.user.user.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.field.user.user.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.field.user.user.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.settings.yml b/web/sites/default/config/sync/field.settings.yml similarity index 100% rename from sites/default/config/sync/field.settings.yml rename to web/sites/default/config/sync/field.settings.yml diff --git a/sites/default/config/sync/field.storage.menu_link_content.field_domain_access.yml b/web/sites/default/config/sync/field.storage.menu_link_content.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.storage.menu_link_content.field_domain_access.yml rename to web/sites/default/config/sync/field.storage.menu_link_content.field_domain_access.yml diff --git a/sites/default/config/sync/field.storage.menu_link_content.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.storage.menu_link_content.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.storage.menu_link_content.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.storage.menu_link_content.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.storage.node.body.yml b/web/sites/default/config/sync/field.storage.node.body.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.body.yml rename to web/sites/default/config/sync/field.storage.node.body.yml diff --git a/sites/default/config/sync/field.storage.node.field_afficher_en_page_d_acceuil.yml b/web/sites/default/config/sync/field.storage.node.field_afficher_en_page_d_acceuil.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_afficher_en_page_d_acceuil.yml rename to web/sites/default/config/sync/field.storage.node.field_afficher_en_page_d_acceuil.yml diff --git a/sites/default/config/sync/field.storage.node.field_collectionneurs.yml b/web/sites/default/config/sync/field.storage.node.field_collectionneurs.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_collectionneurs.yml rename to web/sites/default/config/sync/field.storage.node.field_collectionneurs.yml diff --git a/sites/default/config/sync/field.storage.node.field_date.yml b/web/sites/default/config/sync/field.storage.node.field_date.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_date.yml rename to web/sites/default/config/sync/field.storage.node.field_date.yml diff --git a/sites/default/config/sync/field.storage.node.field_description.yml b/web/sites/default/config/sync/field.storage.node.field_description.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_description.yml rename to web/sites/default/config/sync/field.storage.node.field_description.yml diff --git a/sites/default/config/sync/field.storage.node.field_documents_lies.yml b/web/sites/default/config/sync/field.storage.node.field_documents_lies.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_documents_lies.yml rename to web/sites/default/config/sync/field.storage.node.field_documents_lies.yml diff --git a/sites/default/config/sync/field.storage.node.field_domain_access.yml b/web/sites/default/config/sync/field.storage.node.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_domain_access.yml rename to web/sites/default/config/sync/field.storage.node.field_domain_access.yml diff --git a/sites/default/config/sync/field.storage.node.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.storage.node.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.storage.node.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field.storage.node.field_enregistrement.yml b/web/sites/default/config/sync/field.storage.node.field_enregistrement.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_enregistrement.yml rename to web/sites/default/config/sync/field.storage.node.field_enregistrement.yml diff --git a/sites/default/config/sync/field.storage.node.field_entrees.yml b/web/sites/default/config/sync/field.storage.node.field_entrees.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_entrees.yml rename to web/sites/default/config/sync/field.storage.node.field_entrees.yml diff --git a/sites/default/config/sync/field.storage.node.field_genres.yml b/web/sites/default/config/sync/field.storage.node.field_genres.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_genres.yml rename to web/sites/default/config/sync/field.storage.node.field_genres.yml diff --git a/sites/default/config/sync/field.storage.node.field_langues.yml b/web/sites/default/config/sync/field.storage.node.field_langues.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_langues.yml rename to web/sites/default/config/sync/field.storage.node.field_langues.yml diff --git a/sites/default/config/sync/field.storage.node.field_locuteurs.yml b/web/sites/default/config/sync/field.storage.node.field_locuteurs.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_locuteurs.yml rename to web/sites/default/config/sync/field.storage.node.field_locuteurs.yml diff --git a/sites/default/config/sync/field.storage.node.field_nbr_locuteurs.yml b/web/sites/default/config/sync/field.storage.node.field_nbr_locuteurs.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_nbr_locuteurs.yml rename to web/sites/default/config/sync/field.storage.node.field_nbr_locuteurs.yml diff --git a/sites/default/config/sync/field.storage.node.field_page_liee.yml b/web/sites/default/config/sync/field.storage.node.field_page_liee.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_page_liee.yml rename to web/sites/default/config/sync/field.storage.node.field_page_liee.yml diff --git a/sites/default/config/sync/field.storage.node.field_page_type.yml b/web/sites/default/config/sync/field.storage.node.field_page_type.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_page_type.yml rename to web/sites/default/config/sync/field.storage.node.field_page_type.yml diff --git a/sites/default/config/sync/field.storage.node.field_son.yml b/web/sites/default/config/sync/field.storage.node.field_son.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_son.yml rename to web/sites/default/config/sync/field.storage.node.field_son.yml diff --git a/sites/default/config/sync/field.storage.node.field_transcript_trad.yml b/web/sites/default/config/sync/field.storage.node.field_transcript_trad.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_transcript_trad.yml rename to web/sites/default/config/sync/field.storage.node.field_transcript_trad.yml diff --git a/sites/default/config/sync/field.storage.node.field_transcript_vo.yml b/web/sites/default/config/sync/field.storage.node.field_transcript_vo.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_transcript_vo.yml rename to web/sites/default/config/sync/field.storage.node.field_transcript_vo.yml diff --git a/sites/default/config/sync/field.storage.node.field_view_mode.yml b/web/sites/default/config/sync/field.storage.node.field_view_mode.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_view_mode.yml rename to web/sites/default/config/sync/field.storage.node.field_view_mode.yml diff --git a/sites/default/config/sync/field.storage.node.field_visuel.yml b/web/sites/default/config/sync/field.storage.node.field_visuel.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_visuel.yml rename to web/sites/default/config/sync/field.storage.node.field_visuel.yml diff --git a/sites/default/config/sync/field.storage.node.field_workflow.yml b/web/sites/default/config/sync/field.storage.node.field_workflow.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_workflow.yml rename to web/sites/default/config/sync/field.storage.node.field_workflow.yml diff --git a/sites/default/config/sync/field.storage.node.field_workflow_generic.yml b/web/sites/default/config/sync/field.storage.node.field_workflow_generic.yml similarity index 100% rename from sites/default/config/sync/field.storage.node.field_workflow_generic.yml rename to web/sites/default/config/sync/field.storage.node.field_workflow_generic.yml diff --git a/sites/default/config/sync/field.storage.taxonomy_term.field_color.yml b/web/sites/default/config/sync/field.storage.taxonomy_term.field_color.yml similarity index 100% rename from sites/default/config/sync/field.storage.taxonomy_term.field_color.yml rename to web/sites/default/config/sync/field.storage.taxonomy_term.field_color.yml diff --git a/sites/default/config/sync/field.storage.taxonomy_term.field_notice.yml b/web/sites/default/config/sync/field.storage.taxonomy_term.field_notice.yml similarity index 100% rename from sites/default/config/sync/field.storage.taxonomy_term.field_notice.yml rename to web/sites/default/config/sync/field.storage.taxonomy_term.field_notice.yml diff --git a/sites/default/config/sync/field.storage.taxonomy_term.field_synonyms.yml b/web/sites/default/config/sync/field.storage.taxonomy_term.field_synonyms.yml similarity index 100% rename from sites/default/config/sync/field.storage.taxonomy_term.field_synonyms.yml rename to web/sites/default/config/sync/field.storage.taxonomy_term.field_synonyms.yml diff --git a/sites/default/config/sync/field.storage.taxonomy_term.field_workflow.yml b/web/sites/default/config/sync/field.storage.taxonomy_term.field_workflow.yml similarity index 100% rename from sites/default/config/sync/field.storage.taxonomy_term.field_workflow.yml rename to web/sites/default/config/sync/field.storage.taxonomy_term.field_workflow.yml diff --git a/sites/default/config/sync/field.storage.user.field_domain_access.yml b/web/sites/default/config/sync/field.storage.user.field_domain_access.yml similarity index 100% rename from sites/default/config/sync/field.storage.user.field_domain_access.yml rename to web/sites/default/config/sync/field.storage.user.field_domain_access.yml diff --git a/sites/default/config/sync/field.storage.user.field_domain_admin.yml b/web/sites/default/config/sync/field.storage.user.field_domain_admin.yml similarity index 100% rename from sites/default/config/sync/field.storage.user.field_domain_admin.yml rename to web/sites/default/config/sync/field.storage.user.field_domain_admin.yml diff --git a/sites/default/config/sync/field.storage.user.field_domain_all_affiliates.yml b/web/sites/default/config/sync/field.storage.user.field_domain_all_affiliates.yml similarity index 100% rename from sites/default/config/sync/field.storage.user.field_domain_all_affiliates.yml rename to web/sites/default/config/sync/field.storage.user.field_domain_all_affiliates.yml diff --git a/sites/default/config/sync/field_ui.settings.yml b/web/sites/default/config/sync/field_ui.settings.yml similarity index 100% rename from sites/default/config/sync/field_ui.settings.yml rename to web/sites/default/config/sync/field_ui.settings.yml diff --git a/sites/default/config/sync/file.settings.yml b/web/sites/default/config/sync/file.settings.yml similarity index 100% rename from sites/default/config/sync/file.settings.yml rename to web/sites/default/config/sync/file.settings.yml diff --git a/sites/default/config/sync/filter.format.plain_text.yml b/web/sites/default/config/sync/filter.format.plain_text.yml similarity index 100% rename from sites/default/config/sync/filter.format.plain_text.yml rename to web/sites/default/config/sync/filter.format.plain_text.yml diff --git a/sites/default/config/sync/filter.format.wysiwyg.yml b/web/sites/default/config/sync/filter.format.wysiwyg.yml similarity index 100% rename from sites/default/config/sync/filter.format.wysiwyg.yml rename to web/sites/default/config/sync/filter.format.wysiwyg.yml diff --git a/sites/default/config/sync/filter.settings.yml b/web/sites/default/config/sync/filter.settings.yml similarity index 100% rename from sites/default/config/sync/filter.settings.yml rename to web/sites/default/config/sync/filter.settings.yml diff --git a/sites/default/config/sync/honeypot.settings.yml b/web/sites/default/config/sync/honeypot.settings.yml similarity index 100% rename from sites/default/config/sync/honeypot.settings.yml rename to web/sites/default/config/sync/honeypot.settings.yml diff --git a/sites/default/config/sync/image.settings.yml b/web/sites/default/config/sync/image.settings.yml similarity index 100% rename from sites/default/config/sync/image.settings.yml rename to web/sites/default/config/sync/image.settings.yml diff --git a/sites/default/config/sync/image.style.large.yml b/web/sites/default/config/sync/image.style.large.yml similarity index 100% rename from sites/default/config/sync/image.style.large.yml rename to web/sites/default/config/sync/image.style.large.yml diff --git a/sites/default/config/sync/image.style.linkit_result_thumbnail.yml b/web/sites/default/config/sync/image.style.linkit_result_thumbnail.yml similarity index 100% rename from sites/default/config/sync/image.style.linkit_result_thumbnail.yml rename to web/sites/default/config/sync/image.style.linkit_result_thumbnail.yml diff --git a/sites/default/config/sync/image.style.medium.yml b/web/sites/default/config/sync/image.style.medium.yml similarity index 100% rename from sites/default/config/sync/image.style.medium.yml rename to web/sites/default/config/sync/image.style.medium.yml diff --git a/sites/default/config/sync/image.style.thumbnail.yml b/web/sites/default/config/sync/image.style.thumbnail.yml similarity index 100% rename from sites/default/config/sync/image.style.thumbnail.yml rename to web/sites/default/config/sync/image.style.thumbnail.yml diff --git a/sites/default/config/sync/language.content_settings.chutier.chutier.yml b/web/sites/default/config/sync/language.content_settings.chutier.chutier.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.chutier.chutier.yml rename to web/sites/default/config/sync/language.content_settings.chutier.chutier.yml diff --git a/sites/default/config/sync/language.content_settings.composition.composition.yml b/web/sites/default/config/sync/language.content_settings.composition.composition.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.composition.composition.yml rename to web/sites/default/config/sync/language.content_settings.composition.composition.yml diff --git a/sites/default/config/sync/language.content_settings.file.file.yml b/web/sites/default/config/sync/language.content_settings.file.file.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.file.file.yml rename to web/sites/default/config/sync/language.content_settings.file.file.yml diff --git a/sites/default/config/sync/language.content_settings.menu_link_content.menu_link_content.yml b/web/sites/default/config/sync/language.content_settings.menu_link_content.menu_link_content.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.menu_link_content.menu_link_content.yml rename to web/sites/default/config/sync/language.content_settings.menu_link_content.menu_link_content.yml diff --git a/sites/default/config/sync/language.content_settings.node.autre_son.yml b/web/sites/default/config/sync/language.content_settings.node.autre_son.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.node.autre_son.yml rename to web/sites/default/config/sync/language.content_settings.node.autre_son.yml diff --git a/sites/default/config/sync/language.content_settings.node.enregistrement.yml b/web/sites/default/config/sync/language.content_settings.node.enregistrement.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.node.enregistrement.yml rename to web/sites/default/config/sync/language.content_settings.node.enregistrement.yml diff --git a/sites/default/config/sync/language.content_settings.node.evenement.yml b/web/sites/default/config/sync/language.content_settings.node.evenement.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.node.evenement.yml rename to web/sites/default/config/sync/language.content_settings.node.evenement.yml diff --git a/sites/default/config/sync/language.content_settings.node.fil.yml b/web/sites/default/config/sync/language.content_settings.node.fil.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.node.fil.yml rename to web/sites/default/config/sync/language.content_settings.node.fil.yml diff --git a/sites/default/config/sync/language.content_settings.node.page.yml b/web/sites/default/config/sync/language.content_settings.node.page.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.node.page.yml rename to web/sites/default/config/sync/language.content_settings.node.page.yml diff --git a/sites/default/config/sync/language.content_settings.node.static.yml b/web/sites/default/config/sync/language.content_settings.node.static.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.node.static.yml rename to web/sites/default/config/sync/language.content_settings.node.static.yml diff --git a/sites/default/config/sync/language.content_settings.redirect.redirect.yml b/web/sites/default/config/sync/language.content_settings.redirect.redirect.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.redirect.redirect.yml rename to web/sites/default/config/sync/language.content_settings.redirect.redirect.yml diff --git a/sites/default/config/sync/language.content_settings.taxonomy_term.collectionneurs.yml b/web/sites/default/config/sync/language.content_settings.taxonomy_term.collectionneurs.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.taxonomy_term.collectionneurs.yml rename to web/sites/default/config/sync/language.content_settings.taxonomy_term.collectionneurs.yml diff --git a/sites/default/config/sync/language.content_settings.taxonomy_term.entrees.yml b/web/sites/default/config/sync/language.content_settings.taxonomy_term.entrees.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.taxonomy_term.entrees.yml rename to web/sites/default/config/sync/language.content_settings.taxonomy_term.entrees.yml diff --git a/sites/default/config/sync/language.content_settings.taxonomy_term.genres.yml b/web/sites/default/config/sync/language.content_settings.taxonomy_term.genres.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.taxonomy_term.genres.yml rename to web/sites/default/config/sync/language.content_settings.taxonomy_term.genres.yml diff --git a/sites/default/config/sync/language.content_settings.taxonomy_term.langues.yml b/web/sites/default/config/sync/language.content_settings.taxonomy_term.langues.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.taxonomy_term.langues.yml rename to web/sites/default/config/sync/language.content_settings.taxonomy_term.langues.yml diff --git a/sites/default/config/sync/language.content_settings.taxonomy_term.locuteurs.yml b/web/sites/default/config/sync/language.content_settings.taxonomy_term.locuteurs.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.taxonomy_term.locuteurs.yml rename to web/sites/default/config/sync/language.content_settings.taxonomy_term.locuteurs.yml diff --git a/sites/default/config/sync/language.content_settings.taxonomy_term.page_type.yml b/web/sites/default/config/sync/language.content_settings.taxonomy_term.page_type.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.taxonomy_term.page_type.yml rename to web/sites/default/config/sync/language.content_settings.taxonomy_term.page_type.yml diff --git a/sites/default/config/sync/language.content_settings.user.user.yml b/web/sites/default/config/sync/language.content_settings.user.user.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.user.user.yml rename to web/sites/default/config/sync/language.content_settings.user.user.yml diff --git a/sites/default/config/sync/language.content_settings.workflow_scheduled_transition.workflow_scheduled_transition.yml b/web/sites/default/config/sync/language.content_settings.workflow_scheduled_transition.workflow_scheduled_transition.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.workflow_scheduled_transition.workflow_scheduled_transition.yml rename to web/sites/default/config/sync/language.content_settings.workflow_scheduled_transition.workflow_scheduled_transition.yml diff --git a/sites/default/config/sync/language.content_settings.workflow_transition.corpus_documents.yml b/web/sites/default/config/sync/language.content_settings.workflow_transition.corpus_documents.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.workflow_transition.corpus_documents.yml rename to web/sites/default/config/sync/language.content_settings.workflow_transition.corpus_documents.yml diff --git a/sites/default/config/sync/language.content_settings.workflow_transition.generique.yml b/web/sites/default/config/sync/language.content_settings.workflow_transition.generique.yml similarity index 100% rename from sites/default/config/sync/language.content_settings.workflow_transition.generique.yml rename to web/sites/default/config/sync/language.content_settings.workflow_transition.generique.yml diff --git a/sites/default/config/sync/language.entity.en.yml b/web/sites/default/config/sync/language.entity.en.yml similarity index 100% rename from sites/default/config/sync/language.entity.en.yml rename to web/sites/default/config/sync/language.entity.en.yml diff --git a/sites/default/config/sync/language.entity.fr.yml b/web/sites/default/config/sync/language.entity.fr.yml similarity index 100% rename from sites/default/config/sync/language.entity.fr.yml rename to web/sites/default/config/sync/language.entity.fr.yml diff --git a/sites/default/config/sync/language.entity.und.yml b/web/sites/default/config/sync/language.entity.und.yml similarity index 100% rename from sites/default/config/sync/language.entity.und.yml rename to web/sites/default/config/sync/language.entity.und.yml diff --git a/sites/default/config/sync/language.entity.zxx.yml b/web/sites/default/config/sync/language.entity.zxx.yml similarity index 100% rename from sites/default/config/sync/language.entity.zxx.yml rename to web/sites/default/config/sync/language.entity.zxx.yml diff --git a/sites/default/config/sync/language.mappings.yml b/web/sites/default/config/sync/language.mappings.yml similarity index 100% rename from sites/default/config/sync/language.mappings.yml rename to web/sites/default/config/sync/language.mappings.yml diff --git a/sites/default/config/sync/language.negotiation.yml b/web/sites/default/config/sync/language.negotiation.yml similarity index 100% rename from sites/default/config/sync/language.negotiation.yml rename to web/sites/default/config/sync/language.negotiation.yml diff --git a/sites/default/config/sync/language.types.yml b/web/sites/default/config/sync/language.types.yml similarity index 100% rename from sites/default/config/sync/language.types.yml rename to web/sites/default/config/sync/language.types.yml diff --git a/sites/default/config/sync/language/en/addtoany.settings.yml b/web/sites/default/config/sync/language/en/addtoany.settings.yml similarity index 100% rename from sites/default/config/sync/language/en/addtoany.settings.yml rename to web/sites/default/config/sync/language/en/addtoany.settings.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_breadcrumbs.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_breadcrumbs.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_breadcrumbs.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_breadcrumbs.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_content.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_content.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_content.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_content.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_local_actions.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_local_actions.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_local_actions.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_local_actions.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_login.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_login.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_login.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_login.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_messages.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_messages.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_messages.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_messages.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_page_title.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_page_title.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_page_title.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_page_title.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_primary_local_tasks.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_primary_local_tasks.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_primary_local_tasks.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_primary_local_tasks.yml diff --git a/sites/default/config/sync/language/en/block.block.adminimal_theme_secondary_local_tasks.yml b/web/sites/default/config/sync/language/en/block.block.adminimal_theme_secondary_local_tasks.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.adminimal_theme_secondary_local_tasks.yml rename to web/sites/default/config/sync/language/en/block.block.adminimal_theme_secondary_local_tasks.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_branding.yml b/web/sites/default/config/sync/language/en/block.block.basic_branding.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_branding.yml rename to web/sites/default/config/sync/language/en/block.block.basic_branding.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_content.yml b/web/sites/default/config/sync/language/en/block.block.basic_content.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_content.yml rename to web/sites/default/config/sync/language/en/block.block.basic_content.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_footer.yml b/web/sites/default/config/sync/language/en/block.block.basic_footer.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_footer.yml rename to web/sites/default/config/sync/language/en/block.block.basic_footer.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_help.yml b/web/sites/default/config/sync/language/en/block.block.basic_help.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_help.yml rename to web/sites/default/config/sync/language/en/block.block.basic_help.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_local_actions.yml b/web/sites/default/config/sync/language/en/block.block.basic_local_actions.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_local_actions.yml rename to web/sites/default/config/sync/language/en/block.block.basic_local_actions.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_local_tasks.yml b/web/sites/default/config/sync/language/en/block.block.basic_local_tasks.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_local_tasks.yml rename to web/sites/default/config/sync/language/en/block.block.basic_local_tasks.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_main_menu.yml b/web/sites/default/config/sync/language/en/block.block.basic_main_menu.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_main_menu.yml rename to web/sites/default/config/sync/language/en/block.block.basic_main_menu.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_messages.yml b/web/sites/default/config/sync/language/en/block.block.basic_messages.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_messages.yml rename to web/sites/default/config/sync/language/en/block.block.basic_messages.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_page_title.yml b/web/sites/default/config/sync/language/en/block.block.basic_page_title.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_page_title.yml rename to web/sites/default/config/sync/language/en/block.block.basic_page_title.yml diff --git a/sites/default/config/sync/language/en/block.block.basic_tools.yml b/web/sites/default/config/sync/language/en/block.block.basic_tools.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.basic_tools.yml rename to web/sites/default/config/sync/language/en/block.block.basic_tools.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_admin.yml b/web/sites/default/config/sync/language/en/block.block.stark_admin.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_admin.yml rename to web/sites/default/config/sync/language/en/block.block.stark_admin.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_branding.yml b/web/sites/default/config/sync/language/en/block.block.stark_branding.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_branding.yml rename to web/sites/default/config/sync/language/en/block.block.stark_branding.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_local_actions.yml b/web/sites/default/config/sync/language/en/block.block.stark_local_actions.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_local_actions.yml rename to web/sites/default/config/sync/language/en/block.block.stark_local_actions.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_local_tasks.yml b/web/sites/default/config/sync/language/en/block.block.stark_local_tasks.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_local_tasks.yml rename to web/sites/default/config/sync/language/en/block.block.stark_local_tasks.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_login.yml b/web/sites/default/config/sync/language/en/block.block.stark_login.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_login.yml rename to web/sites/default/config/sync/language/en/block.block.stark_login.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_messages.yml b/web/sites/default/config/sync/language/en/block.block.stark_messages.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_messages.yml rename to web/sites/default/config/sync/language/en/block.block.stark_messages.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_page_title.yml b/web/sites/default/config/sync/language/en/block.block.stark_page_title.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_page_title.yml rename to web/sites/default/config/sync/language/en/block.block.stark_page_title.yml diff --git a/sites/default/config/sync/language/en/block.block.stark_tools.yml b/web/sites/default/config/sync/language/en/block.block.stark_tools.yml similarity index 100% rename from sites/default/config/sync/language/en/block.block.stark_tools.yml rename to web/sites/default/config/sync/language/en/block.block.stark_tools.yml diff --git a/sites/default/config/sync/language/en/core.date_format.fallback.yml b/web/sites/default/config/sync/language/en/core.date_format.fallback.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.fallback.yml rename to web/sites/default/config/sync/language/en/core.date_format.fallback.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_date.yml b/web/sites/default/config/sync/language/en/core.date_format.html_date.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_date.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_date.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_datetime.yml b/web/sites/default/config/sync/language/en/core.date_format.html_datetime.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_datetime.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_datetime.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_month.yml b/web/sites/default/config/sync/language/en/core.date_format.html_month.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_month.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_month.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_time.yml b/web/sites/default/config/sync/language/en/core.date_format.html_time.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_time.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_time.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_week.yml b/web/sites/default/config/sync/language/en/core.date_format.html_week.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_week.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_week.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_year.yml b/web/sites/default/config/sync/language/en/core.date_format.html_year.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_year.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_year.yml diff --git a/sites/default/config/sync/language/en/core.date_format.html_yearless_date.yml b/web/sites/default/config/sync/language/en/core.date_format.html_yearless_date.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.html_yearless_date.yml rename to web/sites/default/config/sync/language/en/core.date_format.html_yearless_date.yml diff --git a/sites/default/config/sync/language/en/core.date_format.long.yml b/web/sites/default/config/sync/language/en/core.date_format.long.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.long.yml rename to web/sites/default/config/sync/language/en/core.date_format.long.yml diff --git a/sites/default/config/sync/language/en/core.date_format.medium.yml b/web/sites/default/config/sync/language/en/core.date_format.medium.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.medium.yml rename to web/sites/default/config/sync/language/en/core.date_format.medium.yml diff --git a/sites/default/config/sync/language/en/core.date_format.short.yml b/web/sites/default/config/sync/language/en/core.date_format.short.yml similarity index 100% rename from sites/default/config/sync/language/en/core.date_format.short.yml rename to web/sites/default/config/sync/language/en/core.date_format.short.yml diff --git a/sites/default/config/sync/language/en/core.entity_form_mode.user.register.yml b/web/sites/default/config/sync/language/en/core.entity_form_mode.user.register.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_form_mode.user.register.yml rename to web/sites/default/config/sync/language/en/core.entity_form_mode.user.register.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.node.full.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.node.full.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.node.full.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.node.full.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.node.rss.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.node.rss.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.node.rss.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.node.rss.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.node.search_index.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.node.search_index.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.node.search_index.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.node.search_index.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.node.search_result.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.node.search_result.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.node.search_result.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.node.search_result.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.node.teaser.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.node.teaser.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.node.teaser.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.node.teaser.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.taxonomy_term.full.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.taxonomy_term.full.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.taxonomy_term.full.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.taxonomy_term.full.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.user.compact.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.user.compact.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.user.compact.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.user.compact.yml diff --git a/sites/default/config/sync/language/en/core.entity_view_mode.user.full.yml b/web/sites/default/config/sync/language/en/core.entity_view_mode.user.full.yml similarity index 100% rename from sites/default/config/sync/language/en/core.entity_view_mode.user.full.yml rename to web/sites/default/config/sync/language/en/core.entity_view_mode.user.full.yml diff --git a/sites/default/config/sync/language/en/domain.settings.yml b/web/sites/default/config/sync/language/en/domain.settings.yml similarity index 100% rename from sites/default/config/sync/language/en/domain.settings.yml rename to web/sites/default/config/sync/language/en/domain.settings.yml diff --git a/sites/default/config/sync/language/en/field.field.user.user.field_domain_admin.yml b/web/sites/default/config/sync/language/en/field.field.user.user.field_domain_admin.yml similarity index 100% rename from sites/default/config/sync/language/en/field.field.user.user.field_domain_admin.yml rename to web/sites/default/config/sync/language/en/field.field.user.user.field_domain_admin.yml diff --git a/sites/default/config/sync/language/en/filter.format.plain_text.yml b/web/sites/default/config/sync/language/en/filter.format.plain_text.yml similarity index 100% rename from sites/default/config/sync/language/en/filter.format.plain_text.yml rename to web/sites/default/config/sync/language/en/filter.format.plain_text.yml diff --git a/sites/default/config/sync/language/en/image.style.large.yml b/web/sites/default/config/sync/language/en/image.style.large.yml similarity index 100% rename from sites/default/config/sync/language/en/image.style.large.yml rename to web/sites/default/config/sync/language/en/image.style.large.yml diff --git a/sites/default/config/sync/language/en/image.style.linkit_result_thumbnail.yml b/web/sites/default/config/sync/language/en/image.style.linkit_result_thumbnail.yml similarity index 100% rename from sites/default/config/sync/language/en/image.style.linkit_result_thumbnail.yml rename to web/sites/default/config/sync/language/en/image.style.linkit_result_thumbnail.yml diff --git a/sites/default/config/sync/language/en/image.style.medium.yml b/web/sites/default/config/sync/language/en/image.style.medium.yml similarity index 100% rename from sites/default/config/sync/language/en/image.style.medium.yml rename to web/sites/default/config/sync/language/en/image.style.medium.yml diff --git a/sites/default/config/sync/language/en/image.style.thumbnail.yml b/web/sites/default/config/sync/language/en/image.style.thumbnail.yml similarity index 100% rename from sites/default/config/sync/language/en/image.style.thumbnail.yml rename to web/sites/default/config/sync/language/en/image.style.thumbnail.yml diff --git a/sites/default/config/sync/language/en/language.entity.en.yml b/web/sites/default/config/sync/language/en/language.entity.en.yml similarity index 100% rename from sites/default/config/sync/language/en/language.entity.en.yml rename to web/sites/default/config/sync/language/en/language.entity.en.yml diff --git a/sites/default/config/sync/language/en/language.entity.und.yml b/web/sites/default/config/sync/language/en/language.entity.und.yml similarity index 100% rename from sites/default/config/sync/language/en/language.entity.und.yml rename to web/sites/default/config/sync/language/en/language.entity.und.yml diff --git a/sites/default/config/sync/language/en/language.entity.zxx.yml b/web/sites/default/config/sync/language/en/language.entity.zxx.yml similarity index 100% rename from sites/default/config/sync/language/en/language.entity.zxx.yml rename to web/sites/default/config/sync/language/en/language.entity.zxx.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.403.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.403.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.403.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.403.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.404.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.404.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.404.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.404.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.front.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.front.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.front.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.front.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.global.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.global.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.global.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.global.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.node.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.node.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.node.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.node.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.taxonomy_term.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.taxonomy_term.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.taxonomy_term.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.taxonomy_term.yml diff --git a/sites/default/config/sync/language/en/metatag.metatag_defaults.user.yml b/web/sites/default/config/sync/language/en/metatag.metatag_defaults.user.yml similarity index 100% rename from sites/default/config/sync/language/en/metatag.metatag_defaults.user.yml rename to web/sites/default/config/sync/language/en/metatag.metatag_defaults.user.yml diff --git a/sites/default/config/sync/language/en/migrate_plus.migration_group.d6_edlp.yml b/web/sites/default/config/sync/language/en/migrate_plus.migration_group.d6_edlp.yml similarity index 100% rename from sites/default/config/sync/language/en/migrate_plus.migration_group.d6_edlp.yml rename to web/sites/default/config/sync/language/en/migrate_plus.migration_group.d6_edlp.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_access_all_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_access_all_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_access_all_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_access_all_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_access_edit_all_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_access_edit_all_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_access_edit_all_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_access_edit_all_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_access_edit_none_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_access_edit_none_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_access_edit_none_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_access_edit_none_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_access_none_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_access_none_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_access_none_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_access_none_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_default_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_default_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_default_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_default_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_delete_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_delete_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_delete_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_delete_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_disable_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_disable_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_disable_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_disable_action.yml diff --git a/sites/default/config/sync/language/en/system.action.domain_enable_action.yml b/web/sites/default/config/sync/language/en/system.action.domain_enable_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.domain_enable_action.yml rename to web/sites/default/config/sync/language/en/system.action.domain_enable_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_delete_action.yml b/web/sites/default/config/sync/language/en/system.action.node_delete_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_delete_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_delete_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_make_sticky_action.yml b/web/sites/default/config/sync/language/en/system.action.node_make_sticky_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_make_sticky_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_make_sticky_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_make_unsticky_action.yml b/web/sites/default/config/sync/language/en/system.action.node_make_unsticky_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_make_unsticky_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_make_unsticky_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_promote_action.yml b/web/sites/default/config/sync/language/en/system.action.node_promote_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_promote_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_promote_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_publish_action.yml b/web/sites/default/config/sync/language/en/system.action.node_publish_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_publish_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_publish_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_save_action.yml b/web/sites/default/config/sync/language/en/system.action.node_save_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_save_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_save_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_unpromote_action.yml b/web/sites/default/config/sync/language/en/system.action.node_unpromote_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_unpromote_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_unpromote_action.yml diff --git a/sites/default/config/sync/language/en/system.action.node_unpublish_action.yml b/web/sites/default/config/sync/language/en/system.action.node_unpublish_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.node_unpublish_action.yml rename to web/sites/default/config/sync/language/en/system.action.node_unpublish_action.yml diff --git a/sites/default/config/sync/language/en/system.action.pathauto_update_alias_node.yml b/web/sites/default/config/sync/language/en/system.action.pathauto_update_alias_node.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.pathauto_update_alias_node.yml rename to web/sites/default/config/sync/language/en/system.action.pathauto_update_alias_node.yml diff --git a/sites/default/config/sync/language/en/system.action.pathauto_update_alias_user.yml b/web/sites/default/config/sync/language/en/system.action.pathauto_update_alias_user.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.pathauto_update_alias_user.yml rename to web/sites/default/config/sync/language/en/system.action.pathauto_update_alias_user.yml diff --git a/sites/default/config/sync/language/en/system.action.profile_delete_action.yml b/web/sites/default/config/sync/language/en/system.action.profile_delete_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.profile_delete_action.yml rename to web/sites/default/config/sync/language/en/system.action.profile_delete_action.yml diff --git a/sites/default/config/sync/language/en/system.action.profile_publish_action.yml b/web/sites/default/config/sync/language/en/system.action.profile_publish_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.profile_publish_action.yml rename to web/sites/default/config/sync/language/en/system.action.profile_publish_action.yml diff --git a/sites/default/config/sync/language/en/system.action.profile_unpublish_action.yml b/web/sites/default/config/sync/language/en/system.action.profile_unpublish_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.profile_unpublish_action.yml rename to web/sites/default/config/sync/language/en/system.action.profile_unpublish_action.yml diff --git a/sites/default/config/sync/language/en/system.action.redirect_delete_action.yml b/web/sites/default/config/sync/language/en/system.action.redirect_delete_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.redirect_delete_action.yml rename to web/sites/default/config/sync/language/en/system.action.redirect_delete_action.yml diff --git a/sites/default/config/sync/language/en/system.action.user_block_user_action.yml b/web/sites/default/config/sync/language/en/system.action.user_block_user_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.user_block_user_action.yml rename to web/sites/default/config/sync/language/en/system.action.user_block_user_action.yml diff --git a/sites/default/config/sync/language/en/system.action.user_cancel_user_action.yml b/web/sites/default/config/sync/language/en/system.action.user_cancel_user_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.user_cancel_user_action.yml rename to web/sites/default/config/sync/language/en/system.action.user_cancel_user_action.yml diff --git a/sites/default/config/sync/language/en/system.action.user_unblock_user_action.yml b/web/sites/default/config/sync/language/en/system.action.user_unblock_user_action.yml similarity index 100% rename from sites/default/config/sync/language/en/system.action.user_unblock_user_action.yml rename to web/sites/default/config/sync/language/en/system.action.user_unblock_user_action.yml diff --git a/sites/default/config/sync/language/en/system.maintenance.yml b/web/sites/default/config/sync/language/en/system.maintenance.yml similarity index 100% rename from sites/default/config/sync/language/en/system.maintenance.yml rename to web/sites/default/config/sync/language/en/system.maintenance.yml diff --git a/sites/default/config/sync/language/en/system.menu.account.yml b/web/sites/default/config/sync/language/en/system.menu.account.yml similarity index 100% rename from sites/default/config/sync/language/en/system.menu.account.yml rename to web/sites/default/config/sync/language/en/system.menu.account.yml diff --git a/sites/default/config/sync/language/en/system.menu.admin.yml b/web/sites/default/config/sync/language/en/system.menu.admin.yml similarity index 100% rename from sites/default/config/sync/language/en/system.menu.admin.yml rename to web/sites/default/config/sync/language/en/system.menu.admin.yml diff --git a/sites/default/config/sync/language/en/system.menu.devel.yml b/web/sites/default/config/sync/language/en/system.menu.devel.yml similarity index 100% rename from sites/default/config/sync/language/en/system.menu.devel.yml rename to web/sites/default/config/sync/language/en/system.menu.devel.yml diff --git a/sites/default/config/sync/language/en/system.menu.footer.yml b/web/sites/default/config/sync/language/en/system.menu.footer.yml similarity index 100% rename from sites/default/config/sync/language/en/system.menu.footer.yml rename to web/sites/default/config/sync/language/en/system.menu.footer.yml diff --git a/sites/default/config/sync/language/en/system.menu.main.yml b/web/sites/default/config/sync/language/en/system.menu.main.yml similarity index 100% rename from sites/default/config/sync/language/en/system.menu.main.yml rename to web/sites/default/config/sync/language/en/system.menu.main.yml diff --git a/sites/default/config/sync/language/en/system.menu.tools.yml b/web/sites/default/config/sync/language/en/system.menu.tools.yml similarity index 100% rename from sites/default/config/sync/language/en/system.menu.tools.yml rename to web/sites/default/config/sync/language/en/system.menu.tools.yml diff --git a/sites/default/config/sync/language/en/system.site.yml b/web/sites/default/config/sync/language/en/system.site.yml similarity index 100% rename from sites/default/config/sync/language/en/system.site.yml rename to web/sites/default/config/sync/language/en/system.site.yml diff --git a/sites/default/config/sync/language/en/user.mail.yml b/web/sites/default/config/sync/language/en/user.mail.yml similarity index 100% rename from sites/default/config/sync/language/en/user.mail.yml rename to web/sites/default/config/sync/language/en/user.mail.yml diff --git a/sites/default/config/sync/language/en/user.role.anonymous.yml b/web/sites/default/config/sync/language/en/user.role.anonymous.yml similarity index 100% rename from sites/default/config/sync/language/en/user.role.anonymous.yml rename to web/sites/default/config/sync/language/en/user.role.anonymous.yml diff --git a/sites/default/config/sync/language/en/user.role.authenticated.yml b/web/sites/default/config/sync/language/en/user.role.authenticated.yml similarity index 100% rename from sites/default/config/sync/language/en/user.role.authenticated.yml rename to web/sites/default/config/sync/language/en/user.role.authenticated.yml diff --git a/sites/default/config/sync/language/en/user.settings.yml b/web/sites/default/config/sync/language/en/user.settings.yml similarity index 100% rename from sites/default/config/sync/language/en/user.settings.yml rename to web/sites/default/config/sync/language/en/user.settings.yml diff --git a/sites/default/config/sync/language/en/views.view.archive.yml b/web/sites/default/config/sync/language/en/views.view.archive.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.archive.yml rename to web/sites/default/config/sync/language/en/views.view.archive.yml diff --git a/sites/default/config/sync/language/en/views.view.content.yml b/web/sites/default/config/sync/language/en/views.view.content.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.content.yml rename to web/sites/default/config/sync/language/en/views.view.content.yml diff --git a/sites/default/config/sync/language/en/views.view.content_recent.yml b/web/sites/default/config/sync/language/en/views.view.content_recent.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.content_recent.yml rename to web/sites/default/config/sync/language/en/views.view.content_recent.yml diff --git a/sites/default/config/sync/language/en/views.view.content_translations.yml b/web/sites/default/config/sync/language/en/views.view.content_translations.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.content_translations.yml rename to web/sites/default/config/sync/language/en/views.view.content_translations.yml diff --git a/sites/default/config/sync/language/en/views.view.files.yml b/web/sites/default/config/sync/language/en/views.view.files.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.files.yml rename to web/sites/default/config/sync/language/en/views.view.files.yml diff --git a/sites/default/config/sync/language/en/views.view.frontpage.yml b/web/sites/default/config/sync/language/en/views.view.frontpage.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.frontpage.yml rename to web/sites/default/config/sync/language/en/views.view.frontpage.yml diff --git a/sites/default/config/sync/language/en/views.view.glossary.yml b/web/sites/default/config/sync/language/en/views.view.glossary.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.glossary.yml rename to web/sites/default/config/sync/language/en/views.view.glossary.yml diff --git a/sites/default/config/sync/language/en/views.view.maillog_overview.yml b/web/sites/default/config/sync/language/en/views.view.maillog_overview.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.maillog_overview.yml rename to web/sites/default/config/sync/language/en/views.view.maillog_overview.yml diff --git a/sites/default/config/sync/language/en/views.view.profiles.yml b/web/sites/default/config/sync/language/en/views.view.profiles.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.profiles.yml rename to web/sites/default/config/sync/language/en/views.view.profiles.yml diff --git a/sites/default/config/sync/language/en/views.view.redirect.yml b/web/sites/default/config/sync/language/en/views.view.redirect.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.redirect.yml rename to web/sites/default/config/sync/language/en/views.view.redirect.yml diff --git a/sites/default/config/sync/language/en/views.view.taxonomy_term.yml b/web/sites/default/config/sync/language/en/views.view.taxonomy_term.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.taxonomy_term.yml rename to web/sites/default/config/sync/language/en/views.view.taxonomy_term.yml diff --git a/sites/default/config/sync/language/en/views.view.user_admin_people.yml b/web/sites/default/config/sync/language/en/views.view.user_admin_people.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.user_admin_people.yml rename to web/sites/default/config/sync/language/en/views.view.user_admin_people.yml diff --git a/sites/default/config/sync/language/en/views.view.who_s_new.yml b/web/sites/default/config/sync/language/en/views.view.who_s_new.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.who_s_new.yml rename to web/sites/default/config/sync/language/en/views.view.who_s_new.yml diff --git a/sites/default/config/sync/language/en/views.view.who_s_online.yml b/web/sites/default/config/sync/language/en/views.view.who_s_online.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.who_s_online.yml rename to web/sites/default/config/sync/language/en/views.view.who_s_online.yml diff --git a/sites/default/config/sync/language/en/views.view.workflow_entity_history.yml b/web/sites/default/config/sync/language/en/views.view.workflow_entity_history.yml similarity index 100% rename from sites/default/config/sync/language/en/views.view.workflow_entity_history.yml rename to web/sites/default/config/sync/language/en/views.view.workflow_entity_history.yml diff --git a/sites/default/config/sync/linkit.linkit_profile.collection.yml b/web/sites/default/config/sync/linkit.linkit_profile.collection.yml similarity index 100% rename from sites/default/config/sync/linkit.linkit_profile.collection.yml rename to web/sites/default/config/sync/linkit.linkit_profile.collection.yml diff --git a/sites/default/config/sync/locale.settings.yml b/web/sites/default/config/sync/locale.settings.yml similarity index 100% rename from sites/default/config/sync/locale.settings.yml rename to web/sites/default/config/sync/locale.settings.yml diff --git a/sites/default/config/sync/maillog.settings.yml b/web/sites/default/config/sync/maillog.settings.yml similarity index 100% rename from sites/default/config/sync/maillog.settings.yml rename to web/sites/default/config/sync/maillog.settings.yml diff --git a/sites/default/config/sync/matomo.settings.yml b/web/sites/default/config/sync/matomo.settings.yml similarity index 100% rename from sites/default/config/sync/matomo.settings.yml rename to web/sites/default/config/sync/matomo.settings.yml diff --git a/sites/default/config/sync/menu_ui.settings.yml b/web/sites/default/config/sync/menu_ui.settings.yml similarity index 100% rename from sites/default/config/sync/menu_ui.settings.yml rename to web/sites/default/config/sync/menu_ui.settings.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.403.yml b/web/sites/default/config/sync/metatag.metatag_defaults.403.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.403.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.403.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.404.yml b/web/sites/default/config/sync/metatag.metatag_defaults.404.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.404.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.404.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.front.yml b/web/sites/default/config/sync/metatag.metatag_defaults.front.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.front.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.front.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.global.yml b/web/sites/default/config/sync/metatag.metatag_defaults.global.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.global.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.global.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.node.yml b/web/sites/default/config/sync/metatag.metatag_defaults.node.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.node.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.node.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.taxonomy_term.yml b/web/sites/default/config/sync/metatag.metatag_defaults.taxonomy_term.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.taxonomy_term.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.taxonomy_term.yml diff --git a/sites/default/config/sync/metatag.metatag_defaults.user.yml b/web/sites/default/config/sync/metatag.metatag_defaults.user.yml similarity index 100% rename from sites/default/config/sync/metatag.metatag_defaults.user.yml rename to web/sites/default/config/sync/metatag.metatag_defaults.user.yml diff --git a/sites/default/config/sync/migrate_drupal.settings.yml b/web/sites/default/config/sync/migrate_drupal.settings.yml similarity index 100% rename from sites/default/config/sync/migrate_drupal.settings.yml rename to web/sites/default/config/sync/migrate_drupal.settings.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_allfiles.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_allfiles.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_allfiles.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_allfiles.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_corpus.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_corpus.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_corpus.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_corpus.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_entrees.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_entrees.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_entrees.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_entrees.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_evenements.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_evenements.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_evenements.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_evenements.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_genres.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_genres.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_genres.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_genres.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_langues.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_langues.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_langues.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_langues.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_pages.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_pages.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_pages.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_pages.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_pagetype.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_pagetype.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_pagetype.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_pagetype.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_sons.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_sons.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_sons.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_sons.yml diff --git a/sites/default/config/sync/migrate_plus.migration.d6_edlp_users.yml b/web/sites/default/config/sync/migrate_plus.migration.d6_edlp_users.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration.d6_edlp_users.yml rename to web/sites/default/config/sync/migrate_plus.migration.d6_edlp_users.yml diff --git a/sites/default/config/sync/migrate_plus.migration_group.d6_edlp.yml b/web/sites/default/config/sync/migrate_plus.migration_group.d6_edlp.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration_group.d6_edlp.yml rename to web/sites/default/config/sync/migrate_plus.migration_group.d6_edlp.yml diff --git a/sites/default/config/sync/migrate_plus.migration_group.default.yml b/web/sites/default/config/sync/migrate_plus.migration_group.default.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration_group.default.yml rename to web/sites/default/config/sync/migrate_plus.migration_group.default.yml diff --git a/sites/default/config/sync/migrate_plus.migration_group.edlp.yml b/web/sites/default/config/sync/migrate_plus.migration_group.edlp.yml similarity index 100% rename from sites/default/config/sync/migrate_plus.migration_group.edlp.yml rename to web/sites/default/config/sync/migrate_plus.migration_group.edlp.yml diff --git a/sites/default/config/sync/node.settings.yml b/web/sites/default/config/sync/node.settings.yml similarity index 100% rename from sites/default/config/sync/node.settings.yml rename to web/sites/default/config/sync/node.settings.yml diff --git a/sites/default/config/sync/node.type.autre_son.yml b/web/sites/default/config/sync/node.type.autre_son.yml similarity index 100% rename from sites/default/config/sync/node.type.autre_son.yml rename to web/sites/default/config/sync/node.type.autre_son.yml diff --git a/sites/default/config/sync/node.type.enregistrement.yml b/web/sites/default/config/sync/node.type.enregistrement.yml similarity index 100% rename from sites/default/config/sync/node.type.enregistrement.yml rename to web/sites/default/config/sync/node.type.enregistrement.yml diff --git a/sites/default/config/sync/node.type.evenement.yml b/web/sites/default/config/sync/node.type.evenement.yml similarity index 100% rename from sites/default/config/sync/node.type.evenement.yml rename to web/sites/default/config/sync/node.type.evenement.yml diff --git a/sites/default/config/sync/node.type.fil.yml b/web/sites/default/config/sync/node.type.fil.yml similarity index 100% rename from sites/default/config/sync/node.type.fil.yml rename to web/sites/default/config/sync/node.type.fil.yml diff --git a/sites/default/config/sync/node.type.page.yml b/web/sites/default/config/sync/node.type.page.yml similarity index 100% rename from sites/default/config/sync/node.type.page.yml rename to web/sites/default/config/sync/node.type.page.yml diff --git a/sites/default/config/sync/node.type.static.yml b/web/sites/default/config/sync/node.type.static.yml similarity index 100% rename from sites/default/config/sync/node.type.static.yml rename to web/sites/default/config/sync/node.type.static.yml diff --git a/sites/default/config/sync/path_alias_xt.settings.yml b/web/sites/default/config/sync/path_alias_xt.settings.yml similarity index 100% rename from sites/default/config/sync/path_alias_xt.settings.yml rename to web/sites/default/config/sync/path_alias_xt.settings.yml diff --git a/sites/default/config/sync/pathauto.pattern.documents.yml b/web/sites/default/config/sync/pathauto.pattern.documents.yml similarity index 100% rename from sites/default/config/sync/pathauto.pattern.documents.yml rename to web/sites/default/config/sync/pathauto.pattern.documents.yml diff --git a/sites/default/config/sync/pathauto.pattern.evenements.yml b/web/sites/default/config/sync/pathauto.pattern.evenements.yml similarity index 100% rename from sites/default/config/sync/pathauto.pattern.evenements.yml rename to web/sites/default/config/sync/pathauto.pattern.evenements.yml diff --git a/sites/default/config/sync/pathauto.pattern.page_static.yml b/web/sites/default/config/sync/pathauto.pattern.page_static.yml similarity index 100% rename from sites/default/config/sync/pathauto.pattern.page_static.yml rename to web/sites/default/config/sync/pathauto.pattern.page_static.yml diff --git a/sites/default/config/sync/pathauto.pattern.pages_production.yml b/web/sites/default/config/sync/pathauto.pattern.pages_production.yml similarity index 100% rename from sites/default/config/sync/pathauto.pattern.pages_production.yml rename to web/sites/default/config/sync/pathauto.pattern.pages_production.yml diff --git a/sites/default/config/sync/pathauto.pattern.taxonomy_entrees.yml b/web/sites/default/config/sync/pathauto.pattern.taxonomy_entrees.yml similarity index 100% rename from sites/default/config/sync/pathauto.pattern.taxonomy_entrees.yml rename to web/sites/default/config/sync/pathauto.pattern.taxonomy_entrees.yml diff --git a/sites/default/config/sync/pathauto.settings.yml b/web/sites/default/config/sync/pathauto.settings.yml similarity index 100% rename from sites/default/config/sync/pathauto.settings.yml rename to web/sites/default/config/sync/pathauto.settings.yml diff --git a/sites/default/config/sync/redirect.settings.yml b/web/sites/default/config/sync/redirect.settings.yml similarity index 100% rename from sites/default/config/sync/redirect.settings.yml rename to web/sites/default/config/sync/redirect.settings.yml diff --git a/sites/default/config/sync/search_api.index.collection.yml b/web/sites/default/config/sync/search_api.index.collection.yml similarity index 100% rename from sites/default/config/sync/search_api.index.collection.yml rename to web/sites/default/config/sync/search_api.index.collection.yml diff --git a/sites/default/config/sync/search_api.server.edlp_db.yml b/web/sites/default/config/sync/search_api.server.edlp_db.yml similarity index 100% rename from sites/default/config/sync/search_api.server.edlp_db.yml rename to web/sites/default/config/sync/search_api.server.edlp_db.yml diff --git a/sites/default/config/sync/search_api.settings.yml b/web/sites/default/config/sync/search_api.settings.yml similarity index 100% rename from sites/default/config/sync/search_api.settings.yml rename to web/sites/default/config/sync/search_api.settings.yml diff --git a/sites/default/config/sync/search_api_db.settings.yml b/web/sites/default/config/sync/search_api_db.settings.yml similarity index 100% rename from sites/default/config/sync/search_api_db.settings.yml rename to web/sites/default/config/sync/search_api_db.settings.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.footer.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.footer.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.footer.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.footer.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.productions.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.productions.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.productions.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.menu_link_content.productions.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.enregistrement.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.enregistrement.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.node.enregistrement.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.enregistrement.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.evenement.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.evenement.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.node.evenement.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.evenement.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.page.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.page.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.node.page.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.page.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.static.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.static.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.node.static.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.node.static.yml diff --git a/sites/default/config/sync/simple_sitemap.bundle_settings.default.taxonomy_term.entrees.yml b/web/sites/default/config/sync/simple_sitemap.bundle_settings.default.taxonomy_term.entrees.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.bundle_settings.default.taxonomy_term.entrees.yml rename to web/sites/default/config/sync/simple_sitemap.bundle_settings.default.taxonomy_term.entrees.yml diff --git a/sites/default/config/sync/simple_sitemap.custom_links.default.yml b/web/sites/default/config/sync/simple_sitemap.custom_links.default.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.custom_links.default.yml rename to web/sites/default/config/sync/simple_sitemap.custom_links.default.yml diff --git a/sites/default/config/sync/simple_sitemap.settings.yml b/web/sites/default/config/sync/simple_sitemap.settings.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.settings.yml rename to web/sites/default/config/sync/simple_sitemap.settings.yml diff --git a/sites/default/config/sync/simple_sitemap.variants.default_hreflang.yml b/web/sites/default/config/sync/simple_sitemap.variants.default_hreflang.yml similarity index 100% rename from sites/default/config/sync/simple_sitemap.variants.default_hreflang.yml rename to web/sites/default/config/sync/simple_sitemap.variants.default_hreflang.yml diff --git a/sites/default/config/sync/synonyms.synonym.field.synonyms.behavior.autocomplete_taxonomy_term_genres_field_synonyms.yml b/web/sites/default/config/sync/synonyms.synonym.field.synonyms.behavior.autocomplete_taxonomy_term_genres_field_synonyms.yml similarity index 100% rename from sites/default/config/sync/synonyms.synonym.field.synonyms.behavior.autocomplete_taxonomy_term_genres_field_synonyms.yml rename to web/sites/default/config/sync/synonyms.synonym.field.synonyms.behavior.autocomplete_taxonomy_term_genres_field_synonyms.yml diff --git a/sites/default/config/sync/system.action.change_a_node_to_next_workflow_state.yml b/web/sites/default/config/sync/system.action.change_a_node_to_next_workflow_state.yml similarity index 100% rename from sites/default/config/sync/system.action.change_a_node_to_next_workflow_state.yml rename to web/sites/default/config/sync/system.action.change_a_node_to_next_workflow_state.yml diff --git a/sites/default/config/sync/system.action.change_a_node_to_workflow_double_fond_state_documents_.yml b/web/sites/default/config/sync/system.action.change_a_node_to_workflow_double_fond_state_documents_.yml similarity index 100% rename from sites/default/config/sync/system.action.change_a_node_to_workflow_double_fond_state_documents_.yml rename to web/sites/default/config/sync/system.action.change_a_node_to_workflow_double_fond_state_documents_.yml diff --git a/sites/default/config/sync/system.action.change_a_node_to_workflow_state_publie_documents_.yml b/web/sites/default/config/sync/system.action.change_a_node_to_workflow_state_publie_documents_.yml similarity index 100% rename from sites/default/config/sync/system.action.change_a_node_to_workflow_state_publie_documents_.yml rename to web/sites/default/config/sync/system.action.change_a_node_to_workflow_state_publie_documents_.yml diff --git a/sites/default/config/sync/system.action.change_workflow_state_to_sas_documents_.yml b/web/sites/default/config/sync/system.action.change_workflow_state_to_sas_documents_.yml similarity index 100% rename from sites/default/config/sync/system.action.change_workflow_state_to_sas_documents_.yml rename to web/sites/default/config/sync/system.action.change_workflow_state_to_sas_documents_.yml diff --git a/sites/default/config/sync/system.action.domain_access_add_action.encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_add_action.encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_add_action.encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_add_action.encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_add_action.m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_add_action.m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_add_action.m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_add_action.m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_add_editor_action.encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_add_editor_action.encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_add_editor_action.encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_add_editor_action.encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_add_editor_action.m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_add_editor_action.m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_add_editor_action.m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_add_editor_action.m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_all_action.yml b/web/sites/default/config/sync/system.action.domain_access_all_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_all_action.yml rename to web/sites/default/config/sync/system.action.domain_access_all_action.yml diff --git a/sites/default/config/sync/system.action.domain_access_edit_all_action.yml b/web/sites/default/config/sync/system.action.domain_access_edit_all_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_edit_all_action.yml rename to web/sites/default/config/sync/system.action.domain_access_edit_all_action.yml diff --git a/sites/default/config/sync/system.action.domain_access_edit_none_action.yml b/web/sites/default/config/sync/system.action.domain_access_edit_none_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_edit_none_action.yml rename to web/sites/default/config/sync/system.action.domain_access_edit_none_action.yml diff --git a/sites/default/config/sync/system.action.domain_access_none_action.yml b/web/sites/default/config/sync/system.action.domain_access_none_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_none_action.yml rename to web/sites/default/config/sync/system.action.domain_access_none_action.yml diff --git a/sites/default/config/sync/system.action.domain_access_remove_action.encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_remove_action.encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_remove_action.encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_remove_action.encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_remove_action.m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_remove_action.m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_remove_action.m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_remove_action.m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_remove_editor_action.encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_remove_editor_action.encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_remove_editor_action.encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_remove_editor_action.encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_access_remove_editor_action.m_encyclopediedelaparole_org.yml b/web/sites/default/config/sync/system.action.domain_access_remove_editor_action.m_encyclopediedelaparole_org.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_access_remove_editor_action.m_encyclopediedelaparole_org.yml rename to web/sites/default/config/sync/system.action.domain_access_remove_editor_action.m_encyclopediedelaparole_org.yml diff --git a/sites/default/config/sync/system.action.domain_default_action.yml b/web/sites/default/config/sync/system.action.domain_default_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_default_action.yml rename to web/sites/default/config/sync/system.action.domain_default_action.yml diff --git a/sites/default/config/sync/system.action.domain_delete_action.yml b/web/sites/default/config/sync/system.action.domain_delete_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_delete_action.yml rename to web/sites/default/config/sync/system.action.domain_delete_action.yml diff --git a/sites/default/config/sync/system.action.domain_disable_action.yml b/web/sites/default/config/sync/system.action.domain_disable_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_disable_action.yml rename to web/sites/default/config/sync/system.action.domain_disable_action.yml diff --git a/sites/default/config/sync/system.action.domain_enable_action.yml b/web/sites/default/config/sync/system.action.domain_enable_action.yml similarity index 100% rename from sites/default/config/sync/system.action.domain_enable_action.yml rename to web/sites/default/config/sync/system.action.domain_enable_action.yml diff --git a/sites/default/config/sync/system.action.node_delete_action.yml b/web/sites/default/config/sync/system.action.node_delete_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_delete_action.yml rename to web/sites/default/config/sync/system.action.node_delete_action.yml diff --git a/sites/default/config/sync/system.action.node_make_sticky_action.yml b/web/sites/default/config/sync/system.action.node_make_sticky_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_make_sticky_action.yml rename to web/sites/default/config/sync/system.action.node_make_sticky_action.yml diff --git a/sites/default/config/sync/system.action.node_make_unsticky_action.yml b/web/sites/default/config/sync/system.action.node_make_unsticky_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_make_unsticky_action.yml rename to web/sites/default/config/sync/system.action.node_make_unsticky_action.yml diff --git a/sites/default/config/sync/system.action.node_promote_action.yml b/web/sites/default/config/sync/system.action.node_promote_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_promote_action.yml rename to web/sites/default/config/sync/system.action.node_promote_action.yml diff --git a/sites/default/config/sync/system.action.node_publish_action.yml b/web/sites/default/config/sync/system.action.node_publish_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_publish_action.yml rename to web/sites/default/config/sync/system.action.node_publish_action.yml diff --git a/sites/default/config/sync/system.action.node_save_action.yml b/web/sites/default/config/sync/system.action.node_save_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_save_action.yml rename to web/sites/default/config/sync/system.action.node_save_action.yml diff --git a/sites/default/config/sync/system.action.node_unpromote_action.yml b/web/sites/default/config/sync/system.action.node_unpromote_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_unpromote_action.yml rename to web/sites/default/config/sync/system.action.node_unpromote_action.yml diff --git a/sites/default/config/sync/system.action.node_unpublish_action.yml b/web/sites/default/config/sync/system.action.node_unpublish_action.yml similarity index 100% rename from sites/default/config/sync/system.action.node_unpublish_action.yml rename to web/sites/default/config/sync/system.action.node_unpublish_action.yml diff --git a/sites/default/config/sync/system.action.pathauto_update_alias_node.yml b/web/sites/default/config/sync/system.action.pathauto_update_alias_node.yml similarity index 100% rename from sites/default/config/sync/system.action.pathauto_update_alias_node.yml rename to web/sites/default/config/sync/system.action.pathauto_update_alias_node.yml diff --git a/sites/default/config/sync/system.action.pathauto_update_alias_user.yml b/web/sites/default/config/sync/system.action.pathauto_update_alias_user.yml similarity index 100% rename from sites/default/config/sync/system.action.pathauto_update_alias_user.yml rename to web/sites/default/config/sync/system.action.pathauto_update_alias_user.yml diff --git a/sites/default/config/sync/system.action.profile_delete_action.yml b/web/sites/default/config/sync/system.action.profile_delete_action.yml similarity index 100% rename from sites/default/config/sync/system.action.profile_delete_action.yml rename to web/sites/default/config/sync/system.action.profile_delete_action.yml diff --git a/sites/default/config/sync/system.action.profile_publish_action.yml b/web/sites/default/config/sync/system.action.profile_publish_action.yml similarity index 100% rename from sites/default/config/sync/system.action.profile_publish_action.yml rename to web/sites/default/config/sync/system.action.profile_publish_action.yml diff --git a/sites/default/config/sync/system.action.profile_unpublish_action.yml b/web/sites/default/config/sync/system.action.profile_unpublish_action.yml similarity index 100% rename from sites/default/config/sync/system.action.profile_unpublish_action.yml rename to web/sites/default/config/sync/system.action.profile_unpublish_action.yml diff --git a/sites/default/config/sync/system.action.redirect_delete_action.yml b/web/sites/default/config/sync/system.action.redirect_delete_action.yml similarity index 100% rename from sites/default/config/sync/system.action.redirect_delete_action.yml rename to web/sites/default/config/sync/system.action.redirect_delete_action.yml diff --git a/sites/default/config/sync/system.action.user_add_role_action.admin.yml b/web/sites/default/config/sync/system.action.user_add_role_action.admin.yml similarity index 100% rename from sites/default/config/sync/system.action.user_add_role_action.admin.yml rename to web/sites/default/config/sync/system.action.user_add_role_action.admin.yml diff --git a/sites/default/config/sync/system.action.user_add_role_action.collectionneur.yml b/web/sites/default/config/sync/system.action.user_add_role_action.collectionneur.yml similarity index 100% rename from sites/default/config/sync/system.action.user_add_role_action.collectionneur.yml rename to web/sites/default/config/sync/system.action.user_add_role_action.collectionneur.yml diff --git a/sites/default/config/sync/system.action.user_add_role_action.invite.yml b/web/sites/default/config/sync/system.action.user_add_role_action.invite.yml similarity index 100% rename from sites/default/config/sync/system.action.user_add_role_action.invite.yml rename to web/sites/default/config/sync/system.action.user_add_role_action.invite.yml diff --git a/sites/default/config/sync/system.action.user_add_role_action.root.yml b/web/sites/default/config/sync/system.action.user_add_role_action.root.yml similarity index 100% rename from sites/default/config/sync/system.action.user_add_role_action.root.yml rename to web/sites/default/config/sync/system.action.user_add_role_action.root.yml diff --git a/sites/default/config/sync/system.action.user_add_role_action.user.yml b/web/sites/default/config/sync/system.action.user_add_role_action.user.yml similarity index 100% rename from sites/default/config/sync/system.action.user_add_role_action.user.yml rename to web/sites/default/config/sync/system.action.user_add_role_action.user.yml diff --git a/sites/default/config/sync/system.action.user_block_user_action.yml b/web/sites/default/config/sync/system.action.user_block_user_action.yml similarity index 100% rename from sites/default/config/sync/system.action.user_block_user_action.yml rename to web/sites/default/config/sync/system.action.user_block_user_action.yml diff --git a/sites/default/config/sync/system.action.user_cancel_user_action.yml b/web/sites/default/config/sync/system.action.user_cancel_user_action.yml similarity index 100% rename from sites/default/config/sync/system.action.user_cancel_user_action.yml rename to web/sites/default/config/sync/system.action.user_cancel_user_action.yml diff --git a/sites/default/config/sync/system.action.user_remove_role_action.admin.yml b/web/sites/default/config/sync/system.action.user_remove_role_action.admin.yml similarity index 100% rename from sites/default/config/sync/system.action.user_remove_role_action.admin.yml rename to web/sites/default/config/sync/system.action.user_remove_role_action.admin.yml diff --git a/sites/default/config/sync/system.action.user_remove_role_action.collectionneur.yml b/web/sites/default/config/sync/system.action.user_remove_role_action.collectionneur.yml similarity index 100% rename from sites/default/config/sync/system.action.user_remove_role_action.collectionneur.yml rename to web/sites/default/config/sync/system.action.user_remove_role_action.collectionneur.yml diff --git a/sites/default/config/sync/system.action.user_remove_role_action.invite.yml b/web/sites/default/config/sync/system.action.user_remove_role_action.invite.yml similarity index 100% rename from sites/default/config/sync/system.action.user_remove_role_action.invite.yml rename to web/sites/default/config/sync/system.action.user_remove_role_action.invite.yml diff --git a/sites/default/config/sync/system.action.user_remove_role_action.root.yml b/web/sites/default/config/sync/system.action.user_remove_role_action.root.yml similarity index 100% rename from sites/default/config/sync/system.action.user_remove_role_action.root.yml rename to web/sites/default/config/sync/system.action.user_remove_role_action.root.yml diff --git a/sites/default/config/sync/system.action.user_remove_role_action.user.yml b/web/sites/default/config/sync/system.action.user_remove_role_action.user.yml similarity index 100% rename from sites/default/config/sync/system.action.user_remove_role_action.user.yml rename to web/sites/default/config/sync/system.action.user_remove_role_action.user.yml diff --git a/sites/default/config/sync/system.action.user_unblock_user_action.yml b/web/sites/default/config/sync/system.action.user_unblock_user_action.yml similarity index 100% rename from sites/default/config/sync/system.action.user_unblock_user_action.yml rename to web/sites/default/config/sync/system.action.user_unblock_user_action.yml diff --git a/sites/default/config/sync/system.authorize.yml b/web/sites/default/config/sync/system.authorize.yml similarity index 100% rename from sites/default/config/sync/system.authorize.yml rename to web/sites/default/config/sync/system.authorize.yml diff --git a/sites/default/config/sync/system.cron.yml b/web/sites/default/config/sync/system.cron.yml similarity index 100% rename from sites/default/config/sync/system.cron.yml rename to web/sites/default/config/sync/system.cron.yml diff --git a/sites/default/config/sync/system.date.yml b/web/sites/default/config/sync/system.date.yml similarity index 100% rename from sites/default/config/sync/system.date.yml rename to web/sites/default/config/sync/system.date.yml diff --git a/sites/default/config/sync/system.diff.yml b/web/sites/default/config/sync/system.diff.yml similarity index 100% rename from sites/default/config/sync/system.diff.yml rename to web/sites/default/config/sync/system.diff.yml diff --git a/sites/default/config/sync/system.file.yml b/web/sites/default/config/sync/system.file.yml similarity index 100% rename from sites/default/config/sync/system.file.yml rename to web/sites/default/config/sync/system.file.yml diff --git a/sites/default/config/sync/system.image.gd.yml b/web/sites/default/config/sync/system.image.gd.yml similarity index 100% rename from sites/default/config/sync/system.image.gd.yml rename to web/sites/default/config/sync/system.image.gd.yml diff --git a/sites/default/config/sync/system.image.yml b/web/sites/default/config/sync/system.image.yml similarity index 100% rename from sites/default/config/sync/system.image.yml rename to web/sites/default/config/sync/system.image.yml diff --git a/sites/default/config/sync/system.logging.yml b/web/sites/default/config/sync/system.logging.yml similarity index 100% rename from sites/default/config/sync/system.logging.yml rename to web/sites/default/config/sync/system.logging.yml diff --git a/sites/default/config/sync/system.mail.yml b/web/sites/default/config/sync/system.mail.yml similarity index 100% rename from sites/default/config/sync/system.mail.yml rename to web/sites/default/config/sync/system.mail.yml diff --git a/sites/default/config/sync/system.maintenance.yml b/web/sites/default/config/sync/system.maintenance.yml similarity index 100% rename from sites/default/config/sync/system.maintenance.yml rename to web/sites/default/config/sync/system.maintenance.yml diff --git a/sites/default/config/sync/system.menu.account.yml b/web/sites/default/config/sync/system.menu.account.yml similarity index 100% rename from sites/default/config/sync/system.menu.account.yml rename to web/sites/default/config/sync/system.menu.account.yml diff --git a/sites/default/config/sync/system.menu.admin.yml b/web/sites/default/config/sync/system.menu.admin.yml similarity index 100% rename from sites/default/config/sync/system.menu.admin.yml rename to web/sites/default/config/sync/system.menu.admin.yml diff --git a/sites/default/config/sync/system.menu.devel.yml b/web/sites/default/config/sync/system.menu.devel.yml similarity index 100% rename from sites/default/config/sync/system.menu.devel.yml rename to web/sites/default/config/sync/system.menu.devel.yml diff --git a/sites/default/config/sync/system.menu.footer.yml b/web/sites/default/config/sync/system.menu.footer.yml similarity index 100% rename from sites/default/config/sync/system.menu.footer.yml rename to web/sites/default/config/sync/system.menu.footer.yml diff --git a/sites/default/config/sync/system.menu.main.yml b/web/sites/default/config/sync/system.menu.main.yml similarity index 100% rename from sites/default/config/sync/system.menu.main.yml rename to web/sites/default/config/sync/system.menu.main.yml diff --git a/sites/default/config/sync/system.menu.productions.yml b/web/sites/default/config/sync/system.menu.productions.yml similarity index 100% rename from sites/default/config/sync/system.menu.productions.yml rename to web/sites/default/config/sync/system.menu.productions.yml diff --git a/sites/default/config/sync/system.menu.tools.yml b/web/sites/default/config/sync/system.menu.tools.yml similarity index 100% rename from sites/default/config/sync/system.menu.tools.yml rename to web/sites/default/config/sync/system.menu.tools.yml diff --git a/sites/default/config/sync/system.performance.yml b/web/sites/default/config/sync/system.performance.yml similarity index 100% rename from sites/default/config/sync/system.performance.yml rename to web/sites/default/config/sync/system.performance.yml diff --git a/sites/default/config/sync/system.rss.yml b/web/sites/default/config/sync/system.rss.yml similarity index 100% rename from sites/default/config/sync/system.rss.yml rename to web/sites/default/config/sync/system.rss.yml diff --git a/sites/default/config/sync/system.site.yml b/web/sites/default/config/sync/system.site.yml similarity index 100% rename from sites/default/config/sync/system.site.yml rename to web/sites/default/config/sync/system.site.yml diff --git a/sites/default/config/sync/system.theme.global.yml b/web/sites/default/config/sync/system.theme.global.yml similarity index 100% rename from sites/default/config/sync/system.theme.global.yml rename to web/sites/default/config/sync/system.theme.global.yml diff --git a/sites/default/config/sync/system.theme.yml b/web/sites/default/config/sync/system.theme.yml similarity index 100% rename from sites/default/config/sync/system.theme.yml rename to web/sites/default/config/sync/system.theme.yml diff --git a/sites/default/config/sync/taxonomy.settings.yml b/web/sites/default/config/sync/taxonomy.settings.yml similarity index 100% rename from sites/default/config/sync/taxonomy.settings.yml rename to web/sites/default/config/sync/taxonomy.settings.yml diff --git a/sites/default/config/sync/taxonomy.vocabulary.collectionneurs.yml b/web/sites/default/config/sync/taxonomy.vocabulary.collectionneurs.yml similarity index 100% rename from sites/default/config/sync/taxonomy.vocabulary.collectionneurs.yml rename to web/sites/default/config/sync/taxonomy.vocabulary.collectionneurs.yml diff --git a/sites/default/config/sync/taxonomy.vocabulary.entrees.yml b/web/sites/default/config/sync/taxonomy.vocabulary.entrees.yml similarity index 100% rename from sites/default/config/sync/taxonomy.vocabulary.entrees.yml rename to web/sites/default/config/sync/taxonomy.vocabulary.entrees.yml diff --git a/sites/default/config/sync/taxonomy.vocabulary.genres.yml b/web/sites/default/config/sync/taxonomy.vocabulary.genres.yml similarity index 100% rename from sites/default/config/sync/taxonomy.vocabulary.genres.yml rename to web/sites/default/config/sync/taxonomy.vocabulary.genres.yml diff --git a/sites/default/config/sync/taxonomy.vocabulary.langues.yml b/web/sites/default/config/sync/taxonomy.vocabulary.langues.yml similarity index 100% rename from sites/default/config/sync/taxonomy.vocabulary.langues.yml rename to web/sites/default/config/sync/taxonomy.vocabulary.langues.yml diff --git a/sites/default/config/sync/taxonomy.vocabulary.locuteurs.yml b/web/sites/default/config/sync/taxonomy.vocabulary.locuteurs.yml similarity index 100% rename from sites/default/config/sync/taxonomy.vocabulary.locuteurs.yml rename to web/sites/default/config/sync/taxonomy.vocabulary.locuteurs.yml diff --git a/sites/default/config/sync/taxonomy.vocabulary.page_type.yml b/web/sites/default/config/sync/taxonomy.vocabulary.page_type.yml similarity index 100% rename from sites/default/config/sync/taxonomy.vocabulary.page_type.yml rename to web/sites/default/config/sync/taxonomy.vocabulary.page_type.yml diff --git a/sites/default/config/sync/text.settings.yml b/web/sites/default/config/sync/text.settings.yml similarity index 100% rename from sites/default/config/sync/text.settings.yml rename to web/sites/default/config/sync/text.settings.yml diff --git a/sites/default/config/sync/toolbar_themes.settings.yml b/web/sites/default/config/sync/toolbar_themes.settings.yml similarity index 100% rename from sites/default/config/sync/toolbar_themes.settings.yml rename to web/sites/default/config/sync/toolbar_themes.settings.yml diff --git a/sites/default/config/sync/update.settings.yml b/web/sites/default/config/sync/update.settings.yml similarity index 100% rename from sites/default/config/sync/update.settings.yml rename to web/sites/default/config/sync/update.settings.yml diff --git a/sites/default/config/sync/user.flood.yml b/web/sites/default/config/sync/user.flood.yml similarity index 100% rename from sites/default/config/sync/user.flood.yml rename to web/sites/default/config/sync/user.flood.yml diff --git a/sites/default/config/sync/user.mail.yml b/web/sites/default/config/sync/user.mail.yml similarity index 100% rename from sites/default/config/sync/user.mail.yml rename to web/sites/default/config/sync/user.mail.yml diff --git a/sites/default/config/sync/user.role.admin.yml b/web/sites/default/config/sync/user.role.admin.yml similarity index 100% rename from sites/default/config/sync/user.role.admin.yml rename to web/sites/default/config/sync/user.role.admin.yml diff --git a/sites/default/config/sync/user.role.anonymous.yml b/web/sites/default/config/sync/user.role.anonymous.yml similarity index 100% rename from sites/default/config/sync/user.role.anonymous.yml rename to web/sites/default/config/sync/user.role.anonymous.yml diff --git a/sites/default/config/sync/user.role.authenticated.yml b/web/sites/default/config/sync/user.role.authenticated.yml similarity index 100% rename from sites/default/config/sync/user.role.authenticated.yml rename to web/sites/default/config/sync/user.role.authenticated.yml diff --git a/sites/default/config/sync/user.role.collectionneur.yml b/web/sites/default/config/sync/user.role.collectionneur.yml similarity index 100% rename from sites/default/config/sync/user.role.collectionneur.yml rename to web/sites/default/config/sync/user.role.collectionneur.yml diff --git a/sites/default/config/sync/user.role.invite.yml b/web/sites/default/config/sync/user.role.invite.yml similarity index 100% rename from sites/default/config/sync/user.role.invite.yml rename to web/sites/default/config/sync/user.role.invite.yml diff --git a/sites/default/config/sync/user.role.root.yml b/web/sites/default/config/sync/user.role.root.yml similarity index 100% rename from sites/default/config/sync/user.role.root.yml rename to web/sites/default/config/sync/user.role.root.yml diff --git a/sites/default/config/sync/user.role.user.yml b/web/sites/default/config/sync/user.role.user.yml similarity index 100% rename from sites/default/config/sync/user.role.user.yml rename to web/sites/default/config/sync/user.role.user.yml diff --git a/sites/default/config/sync/user.settings.yml b/web/sites/default/config/sync/user.settings.yml similarity index 100% rename from sites/default/config/sync/user.settings.yml rename to web/sites/default/config/sync/user.settings.yml diff --git a/sites/default/config/sync/views.settings.yml b/web/sites/default/config/sync/views.settings.yml similarity index 100% rename from sites/default/config/sync/views.settings.yml rename to web/sites/default/config/sync/views.settings.yml diff --git a/sites/default/config/sync/views.view.archive.yml b/web/sites/default/config/sync/views.view.archive.yml similarity index 100% rename from sites/default/config/sync/views.view.archive.yml rename to web/sites/default/config/sync/views.view.archive.yml diff --git a/sites/default/config/sync/views.view.content.yml b/web/sites/default/config/sync/views.view.content.yml similarity index 100% rename from sites/default/config/sync/views.view.content.yml rename to web/sites/default/config/sync/views.view.content.yml diff --git a/sites/default/config/sync/views.view.content_recent.yml b/web/sites/default/config/sync/views.view.content_recent.yml similarity index 100% rename from sites/default/config/sync/views.view.content_recent.yml rename to web/sites/default/config/sync/views.view.content_recent.yml diff --git a/sites/default/config/sync/views.view.content_translations.yml b/web/sites/default/config/sync/views.view.content_translations.yml similarity index 100% rename from sites/default/config/sync/views.view.content_translations.yml rename to web/sites/default/config/sync/views.view.content_translations.yml diff --git a/sites/default/config/sync/views.view.entree_s_.yml b/web/sites/default/config/sync/views.view.entree_s_.yml similarity index 100% rename from sites/default/config/sync/views.view.entree_s_.yml rename to web/sites/default/config/sync/views.view.entree_s_.yml diff --git a/sites/default/config/sync/views.view.files.yml b/web/sites/default/config/sync/views.view.files.yml similarity index 100% rename from sites/default/config/sync/views.view.files.yml rename to web/sites/default/config/sync/views.view.files.yml diff --git a/sites/default/config/sync/views.view.frontpage.yml b/web/sites/default/config/sync/views.view.frontpage.yml similarity index 100% rename from sites/default/config/sync/views.view.frontpage.yml rename to web/sites/default/config/sync/views.view.frontpage.yml diff --git a/sites/default/config/sync/views.view.glossary.yml b/web/sites/default/config/sync/views.view.glossary.yml similarity index 100% rename from sites/default/config/sync/views.view.glossary.yml rename to web/sites/default/config/sync/views.view.glossary.yml diff --git a/sites/default/config/sync/views.view.maillog_overview.yml b/web/sites/default/config/sync/views.view.maillog_overview.yml similarity index 100% rename from sites/default/config/sync/views.view.maillog_overview.yml rename to web/sites/default/config/sync/views.view.maillog_overview.yml diff --git a/sites/default/config/sync/views.view.profiles.yml b/web/sites/default/config/sync/views.view.profiles.yml similarity index 100% rename from sites/default/config/sync/views.view.profiles.yml rename to web/sites/default/config/sync/views.view.profiles.yml diff --git a/sites/default/config/sync/views.view.redirect.yml b/web/sites/default/config/sync/views.view.redirect.yml similarity index 100% rename from sites/default/config/sync/views.view.redirect.yml rename to web/sites/default/config/sync/views.view.redirect.yml diff --git a/sites/default/config/sync/views.view.taxonomy_term.yml b/web/sites/default/config/sync/views.view.taxonomy_term.yml similarity index 100% rename from sites/default/config/sync/views.view.taxonomy_term.yml rename to web/sites/default/config/sync/views.view.taxonomy_term.yml diff --git a/sites/default/config/sync/views.view.user_admin_people.yml b/web/sites/default/config/sync/views.view.user_admin_people.yml similarity index 100% rename from sites/default/config/sync/views.view.user_admin_people.yml rename to web/sites/default/config/sync/views.view.user_admin_people.yml diff --git a/sites/default/config/sync/views.view.watchdog.yml b/web/sites/default/config/sync/views.view.watchdog.yml similarity index 100% rename from sites/default/config/sync/views.view.watchdog.yml rename to web/sites/default/config/sync/views.view.watchdog.yml diff --git a/sites/default/config/sync/views.view.who_s_new.yml b/web/sites/default/config/sync/views.view.who_s_new.yml similarity index 100% rename from sites/default/config/sync/views.view.who_s_new.yml rename to web/sites/default/config/sync/views.view.who_s_new.yml diff --git a/sites/default/config/sync/views.view.who_s_online.yml b/web/sites/default/config/sync/views.view.who_s_online.yml similarity index 100% rename from sites/default/config/sync/views.view.who_s_online.yml rename to web/sites/default/config/sync/views.view.who_s_online.yml diff --git a/sites/default/config/sync/views.view.workflow_entity_history.yml b/web/sites/default/config/sync/views.view.workflow_entity_history.yml similarity index 100% rename from sites/default/config/sync/views.view.workflow_entity_history.yml rename to web/sites/default/config/sync/views.view.workflow_entity_history.yml diff --git a/sites/default/config/sync/workflow.settings.yml b/web/sites/default/config/sync/workflow.settings.yml similarity index 100% rename from sites/default/config/sync/workflow.settings.yml rename to web/sites/default/config/sync/workflow.settings.yml diff --git a/sites/default/config/sync/workflow.state.corpus_documents_creation.yml b/web/sites/default/config/sync/workflow.state.corpus_documents_creation.yml similarity index 100% rename from sites/default/config/sync/workflow.state.corpus_documents_creation.yml rename to web/sites/default/config/sync/workflow.state.corpus_documents_creation.yml diff --git a/sites/default/config/sync/workflow.state.corpus_documents_double_fond.yml b/web/sites/default/config/sync/workflow.state.corpus_documents_double_fond.yml similarity index 100% rename from sites/default/config/sync/workflow.state.corpus_documents_double_fond.yml rename to web/sites/default/config/sync/workflow.state.corpus_documents_double_fond.yml diff --git a/sites/default/config/sync/workflow.state.corpus_documents_masque.yml b/web/sites/default/config/sync/workflow.state.corpus_documents_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.state.corpus_documents_masque.yml rename to web/sites/default/config/sync/workflow.state.corpus_documents_masque.yml diff --git a/sites/default/config/sync/workflow.state.corpus_documents_publie.yml b/web/sites/default/config/sync/workflow.state.corpus_documents_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.state.corpus_documents_publie.yml rename to web/sites/default/config/sync/workflow.state.corpus_documents_publie.yml diff --git a/sites/default/config/sync/workflow.state.corpus_documents_sas.yml b/web/sites/default/config/sync/workflow.state.corpus_documents_sas.yml similarity index 100% rename from sites/default/config/sync/workflow.state.corpus_documents_sas.yml rename to web/sites/default/config/sync/workflow.state.corpus_documents_sas.yml diff --git a/sites/default/config/sync/workflow.state.generique_creation.yml b/web/sites/default/config/sync/workflow.state.generique_creation.yml similarity index 100% rename from sites/default/config/sync/workflow.state.generique_creation.yml rename to web/sites/default/config/sync/workflow.state.generique_creation.yml diff --git a/sites/default/config/sync/workflow.state.generique_masque.yml b/web/sites/default/config/sync/workflow.state.generique_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.state.generique_masque.yml rename to web/sites/default/config/sync/workflow.state.generique_masque.yml diff --git a/sites/default/config/sync/workflow.state.generique_publie.yml b/web/sites/default/config/sync/workflow.state.generique_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.state.generique_publie.yml rename to web/sites/default/config/sync/workflow.state.generique_publie.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_creation_double_fond.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_creation_double_fond.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_creation_double_fond.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_creation_double_fond.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_creation_masque.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_creation_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_creation_masque.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_creation_masque.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_creation_publie.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_creation_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_creation_publie.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_creation_publie.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_creation_sas.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_creation_sas.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_creation_sas.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_creation_sas.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_double_fond.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_double_fond.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_double_fond_double_fond.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_double_fond.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_masque.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_double_fond_masque.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_masque.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_publie.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_double_fond_publie.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_publie.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_sas.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_sas.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_double_fond_sas.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_double_fond_sas.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_masque_double_fond.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_masque_double_fond.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_masque_double_fond.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_masque_double_fond.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_masque_masque.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_masque_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_masque_masque.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_masque_masque.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_masque_publie.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_masque_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_masque_publie.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_masque_publie.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_masque_sas.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_masque_sas.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_masque_sas.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_masque_sas.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_publie_double_fond.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_publie_double_fond.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_publie_double_fond.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_publie_double_fond.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_publie_masque.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_publie_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_publie_masque.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_publie_masque.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_publie_publie.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_publie_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_publie_publie.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_publie_publie.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_publie_sas.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_publie_sas.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_publie_sas.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_publie_sas.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_sas_double_fond.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_sas_double_fond.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_sas_double_fond.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_sas_double_fond.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_sas_masque.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_sas_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_sas_masque.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_sas_masque.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_sas_publie.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_sas_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_sas_publie.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_sas_publie.yml diff --git a/sites/default/config/sync/workflow.transition.corpus_documents_sas_sas.yml b/web/sites/default/config/sync/workflow.transition.corpus_documents_sas_sas.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.corpus_documents_sas_sas.yml rename to web/sites/default/config/sync/workflow.transition.corpus_documents_sas_sas.yml diff --git a/sites/default/config/sync/workflow.transition.generique_creation_masque.yml b/web/sites/default/config/sync/workflow.transition.generique_creation_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.generique_creation_masque.yml rename to web/sites/default/config/sync/workflow.transition.generique_creation_masque.yml diff --git a/sites/default/config/sync/workflow.transition.generique_creation_publie.yml b/web/sites/default/config/sync/workflow.transition.generique_creation_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.generique_creation_publie.yml rename to web/sites/default/config/sync/workflow.transition.generique_creation_publie.yml diff --git a/sites/default/config/sync/workflow.transition.generique_masque_masque.yml b/web/sites/default/config/sync/workflow.transition.generique_masque_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.generique_masque_masque.yml rename to web/sites/default/config/sync/workflow.transition.generique_masque_masque.yml diff --git a/sites/default/config/sync/workflow.transition.generique_masque_publie.yml b/web/sites/default/config/sync/workflow.transition.generique_masque_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.generique_masque_publie.yml rename to web/sites/default/config/sync/workflow.transition.generique_masque_publie.yml diff --git a/sites/default/config/sync/workflow.transition.generique_publie_masque.yml b/web/sites/default/config/sync/workflow.transition.generique_publie_masque.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.generique_publie_masque.yml rename to web/sites/default/config/sync/workflow.transition.generique_publie_masque.yml diff --git a/sites/default/config/sync/workflow.transition.generique_publie_publie.yml b/web/sites/default/config/sync/workflow.transition.generique_publie_publie.yml similarity index 100% rename from sites/default/config/sync/workflow.transition.generique_publie_publie.yml rename to web/sites/default/config/sync/workflow.transition.generique_publie_publie.yml diff --git a/sites/default/config/sync/workflow.workflow.corpus_documents.yml b/web/sites/default/config/sync/workflow.workflow.corpus_documents.yml similarity index 100% rename from sites/default/config/sync/workflow.workflow.corpus_documents.yml rename to web/sites/default/config/sync/workflow.workflow.corpus_documents.yml diff --git a/sites/default/config/sync/workflow.workflow.generique.yml b/web/sites/default/config/sync/workflow.workflow.generique.yml similarity index 100% rename from sites/default/config/sync/workflow.workflow.generique.yml rename to web/sites/default/config/sync/workflow.workflow.generique.yml diff --git a/sites/default/config/sync/workflow_access.role.yml b/web/sites/default/config/sync/workflow_access.role.yml similarity index 100% rename from sites/default/config/sync/workflow_access.role.yml rename to web/sites/default/config/sync/workflow_access.role.yml diff --git a/sites/default/config/sync/workflow_access.settings.yml b/web/sites/default/config/sync/workflow_access.settings.yml similarity index 100% rename from sites/default/config/sync/workflow_access.settings.yml rename to web/sites/default/config/sync/workflow_access.settings.yml diff --git a/web/sites/default/default.services.yml b/web/sites/default/default.services.yml new file mode 100644 index 000000000..e1bbbc7e2 --- /dev/null +++ b/web/sites/default/default.services.yml @@ -0,0 +1,174 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp + + # Configure Cross-Site HTTP requests (CORS). + # Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS + # for more information about the topic in general. + # Note: By default the configuration is disabled. + cors.config: + enabled: false + # Specify allowed headers, like 'x-allowed-header'. + allowedHeaders: [] + # Specify allowed request methods, specify ['*'] to allow all possible ones. + allowedMethods: [] + # Configure requests allowed from specific origins. + allowedOrigins: ['*'] + # Sets the Access-Control-Expose-Headers header. + exposedHeaders: false + # Sets the Access-Control-Max-Age header. + maxAge: false + # Sets the Access-Control-Allow-Credentials header. + supportsCredentials: false diff --git a/web/sites/default/default.settings.php b/web/sites/default/default.settings.php new file mode 100644 index 000000000..5bcecc267 --- /dev/null +++ b/web/sites/default/default.settings.php @@ -0,0 +1,770 @@ + 'databasename', + * 'username' => 'sqlusername', + * 'password' => 'sqlpassword', + * 'host' => 'localhost', + * 'port' => '3306', + * 'driver' => 'mysql', + * 'prefix' => '', + * 'collation' => 'utf8mb4_general_ci', + * ); + * @endcode + */ +$databases = []; + +/** + * Customizing database settings. + * + * Many of the values of the $databases array can be customized for your + * particular database system. Refer to the sample in the section above as a + * starting point. + * + * The "driver" property indicates what Drupal database driver the + * connection should use. This is usually the same as the name of the + * database type, such as mysql or sqlite, but not always. The other + * properties will vary depending on the driver. For SQLite, you must + * specify a database file name in a directory that is writable by the + * webserver. For most other drivers, you must specify a + * username, password, host, and database name. + * + * Transaction support is enabled by default for all drivers that support it, + * including MySQL. To explicitly disable it, set the 'transactions' key to + * FALSE. + * Note that some configurations of MySQL, such as the MyISAM engine, don't + * support it and will proceed silently even if enabled. If you experience + * transaction related crashes with such configuration, set the 'transactions' + * key to FALSE. + * + * For each database, you may optionally specify multiple "target" databases. + * A target database allows Drupal to try to send certain queries to a + * different database if it can but fall back to the default connection if not. + * That is useful for primary/replica replication, as Drupal may try to connect + * to a replica server when appropriate and if one is not available will simply + * fall back to the single primary server (The terms primary/replica are + * traditionally referred to as master/slave in database server documentation). + * + * The general format for the $databases array is as follows: + * @code + * $databases['default']['default'] = $info_array; + * $databases['default']['replica'][] = $info_array; + * $databases['default']['replica'][] = $info_array; + * $databases['extra']['default'] = $info_array; + * @endcode + * + * In the above example, $info_array is an array of settings described above. + * The first line sets a "default" database that has one primary database + * (the second level default). The second and third lines create an array + * of potential replica databases. Drupal will select one at random for a given + * request as needed. The fourth line creates a new database with a name of + * "extra". + * + * You can optionally set prefixes for some or all database table names + * by using the 'prefix' setting. If a prefix is specified, the table + * name will be prepended with its value. Be sure to use valid database + * characters only, usually alphanumeric and underscore. If no prefixes + * are desired, leave it as an empty string ''. + * + * To have all database names prefixed, set 'prefix' as a string: + * @code + * 'prefix' => 'main_', + * @endcode + * + * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in + * Drupal 9.0. After that, only a single prefix for all tables will be + * supported. + * + * To provide prefixes for specific tables, set 'prefix' as an array. + * The array's keys are the table names and the values are the prefixes. + * The 'default' element is mandatory and holds the prefix for any tables + * not specified elsewhere in the array. Example: + * @code + * 'prefix' => array( + * 'default' => 'main_', + * 'users' => 'shared_', + * 'sessions' => 'shared_', + * 'role' => 'shared_', + * 'authmap' => 'shared_', + * ), + * @endcode + * You can also use a reference to a schema/database as a prefix. This may be + * useful if your Drupal installation exists in a schema that is not the default + * or you want to access several databases from the same code base at the same + * time. + * Example: + * @code + * 'prefix' => array( + * 'default' => 'main.', + * 'users' => 'shared.', + * 'sessions' => 'shared.', + * 'role' => 'shared.', + * 'authmap' => 'shared.', + * ); + * @endcode + * NOTE: MySQL and SQLite's definition of a schema is a database. + * + * Advanced users can add or override initial commands to execute when + * connecting to the database server, as well as PDO connection settings. For + * example, to enable MySQL SELECT queries to exceed the max_join_size system + * variable, and to reduce the database connection timeout to 5 seconds: + * @code + * $databases['default']['default'] = array( + * 'init_commands' => array( + * 'big_selects' => 'SET SQL_BIG_SELECTS=1', + * ), + * 'pdo' => array( + * PDO::ATTR_TIMEOUT => 5, + * ), + * ); + * @endcode + * + * WARNING: The above defaults are designed for database portability. Changing + * them may cause unexpected behavior, including potential data loss. See + * https://www.drupal.org/developing/api/database/configuration for more + * information on these defaults and the potential issues. + * + * More details can be found in the constructor methods for each driver: + * - \Drupal\Core\Database\Driver\mysql\Connection::__construct() + * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct() + * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct() + * + * Sample Database configuration format for PostgreSQL (pgsql): + * @code + * $databases['default']['default'] = array( + * 'driver' => 'pgsql', + * 'database' => 'databasename', + * 'username' => 'sqlusername', + * 'password' => 'sqlpassword', + * 'host' => 'localhost', + * 'prefix' => '', + * ); + * @endcode + * + * Sample Database configuration format for SQLite (sqlite): + * @code + * $databases['default']['default'] = array( + * 'driver' => 'sqlite', + * 'database' => '/path/to/databasefilename', + * ); + * @endcode + */ + +/** + * Location of the site configuration files. + * + * The $config_directories array specifies the location of file system + * directories used for configuration data. On install, the "sync" directory is + * created. This is used for configuration imports. The "active" directory is + * not created by default since the default storage for active configuration is + * the database rather than the file system. (This can be changed. See "Active + * configuration settings" below). + * + * The default location for the "sync" directory is inside a randomly-named + * directory in the public files path. The setting below allows you to override + * the "sync" location. + * + * If you use files for the "active" configuration, you can tell the + * Configuration system where this directory is located by adding an entry with + * array key CONFIG_ACTIVE_DIRECTORY. + * + * Example: + * @code + * $config_directories = array( + * CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot', + * ); + * @endcode + */ +$config_directories = []; + +/** + * Settings: + * + * $settings contains environment-specific configuration, such as the files + * directory and reverse proxy address, and temporary configuration, such as + * security overrides. + * + * @see \Drupal\Core\Site\Settings::get() + */ + +/** + * Salt for one-time login links, cancel links, form tokens, etc. + * + * This variable will be set to a random value by the installer. All one-time + * login links will be invalidated if the value is changed. Note that if your + * site is deployed on a cluster of web servers, you must ensure that this + * variable has the same value on each server. + * + * For enhanced security, you may set this variable to the contents of a file + * outside your document root; you should also ensure that this file is not + * stored with backups of your database. + * + * Example: + * @code + * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt'); + * @endcode + */ +$settings['hash_salt'] = ''; + +/** + * Deployment identifier. + * + * Drupal's dependency injection container will be automatically invalidated and + * rebuilt when the Drupal core version changes. When updating contributed or + * custom code that changes the container, changing this identifier will also + * allow the container to be invalidated as soon as code is deployed. + */ +# $settings['deployment_identifier'] = \Drupal::VERSION; + +/** + * Access control for update.php script. + * + * If you are updating your Drupal installation using the update.php script but + * are not logged in using either an account with the "Administer software + * updates" permission or the site maintenance account (the account that was + * created during installation), you will need to modify the access check + * statement below. Change the FALSE to a TRUE to disable the access check. + * After finishing the upgrade, be sure to open this file again and change the + * TRUE back to a FALSE! + */ +$settings['update_free_access'] = FALSE; + +/** + * External access proxy settings: + * + * If your site must access the Internet via a web proxy then you can enter the + * proxy settings here. Set the full URL of the proxy, including the port, in + * variables: + * - $settings['http_client_config']['proxy']['http']: The proxy URL for HTTP + * requests. + * - $settings['http_client_config']['proxy']['https']: The proxy URL for HTTPS + * requests. + * You can pass in the user name and password for basic authentication in the + * URLs in these settings. + * + * You can also define an array of host names that can be accessed directly, + * bypassing the proxy, in $settings['http_client_config']['proxy']['no']. + */ +# $settings['http_client_config']['proxy']['http'] = 'http://proxy_user:proxy_pass@example.com:8080'; +# $settings['http_client_config']['proxy']['https'] = 'http://proxy_user:proxy_pass@example.com:8080'; +# $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost']; + +/** + * Reverse Proxy Configuration: + * + * Reverse proxy servers are often used to enhance the performance + * of heavily visited sites and may also provide other site caching, + * security, or encryption benefits. In an environment where Drupal + * is behind a reverse proxy, the real IP address of the client should + * be determined such that the correct client IP address is available + * to Drupal's logging, statistics, and access management systems. In + * the most simple scenario, the proxy server will add an + * X-Forwarded-For header to the request that contains the client IP + * address. However, HTTP headers are vulnerable to spoofing, where a + * malicious client could bypass restrictions by setting the + * X-Forwarded-For header directly. Therefore, Drupal's proxy + * configuration requires the IP addresses of all remote proxies to be + * specified in $settings['reverse_proxy_addresses'] to work correctly. + * + * Enable this setting to get Drupal to determine the client IP from + * the X-Forwarded-For header (or $settings['reverse_proxy_header'] if set). + * If you are unsure about this setting, do not have a reverse proxy, + * or Drupal operates in a shared hosting environment, this setting + * should remain commented out. + * + * In order for this setting to be used you must specify every possible + * reverse proxy IP address in $settings['reverse_proxy_addresses']. + * If a complete list of reverse proxies is not available in your + * environment (for example, if you use a CDN) you may set the + * $_SERVER['REMOTE_ADDR'] variable directly in settings.php. + * Be aware, however, that it is likely that this would allow IP + * address spoofing unless more advanced precautions are taken. + */ +# $settings['reverse_proxy'] = TRUE; + +/** + * Specify every reverse proxy IP address in your environment. + * This setting is required if $settings['reverse_proxy'] is TRUE. + */ +# $settings['reverse_proxy_addresses'] = ['a.b.c.d', ...]; + +/** + * Set this value if your proxy server sends the client IP in a header + * other than X-Forwarded-For. + */ +# $settings['reverse_proxy_header'] = 'X_CLUSTER_CLIENT_IP'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than X-Forwarded-Proto. + */ +# $settings['reverse_proxy_proto_header'] = 'X_FORWARDED_PROTO'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than X-Forwarded-Host. + */ +# $settings['reverse_proxy_host_header'] = 'X_FORWARDED_HOST'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than X-Forwarded-Port. + */ +# $settings['reverse_proxy_port_header'] = 'X_FORWARDED_PORT'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than Forwarded. + */ +# $settings['reverse_proxy_forwarded_header'] = 'FORWARDED'; + +/** + * Page caching: + * + * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page + * views. This tells a HTTP proxy that it may return a page from its local + * cache without contacting the web server, if the user sends the same Cookie + * header as the user who originally requested the cached page. Without "Vary: + * Cookie", authenticated users would also be served the anonymous page from + * the cache. If the site has mostly anonymous users except a few known + * editors/administrators, the Vary header can be omitted. This allows for + * better caching in HTTP proxies (including reverse proxies), i.e. even if + * clients send different cookies, they still get content served from the cache. + * However, authenticated users should access the site directly (i.e. not use an + * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid + * getting cached pages from the proxy. + */ +# $settings['omit_vary_cookie'] = TRUE; + + +/** + * Cache TTL for client error (4xx) responses. + * + * Items cached per-URL tend to result in a large number of cache items, and + * this can be problematic on 404 pages which by their nature are unbounded. A + * fixed TTL can be set for these items, defaulting to one hour, so that cache + * backends which do not support LRU can purge older entries. To disable caching + * of client error responses set the value to 0. Currently applies only to + * page_cache module. + */ +# $settings['cache_ttl_4xx'] = 3600; + +/** + * Expiration of cached forms. + * + * Drupal's Form API stores details of forms in a cache and these entries are + * kept for at least 6 hours by default. Expired entries are cleared by cron. + * + * @see \Drupal\Core\Form\FormCache::setCache() + */ +# $settings['form_cache_expiration'] = 21600; + +/** + * Class Loader. + * + * If the APC extension is detected, the Symfony APC class loader is used for + * performance reasons. Detection can be prevented by setting + * class_loader_auto_detect to false, as in the example below. + */ +# $settings['class_loader_auto_detect'] = FALSE; + +/* + * If the APC extension is not detected, either because APC is missing or + * because auto-detection has been disabled, auto-loading falls back to + * Composer's ClassLoader, which is good for development as it does not break + * when code is moved in the file system. You can also decorate the base class + * loader with another cached solution than the Symfony APC class loader, as + * all production sites should have a cached class loader of some sort enabled. + * + * To do so, you may decorate and replace the local $class_loader variable. For + * example, to use Symfony's APC class loader without automatic detection, + * uncomment the code below. + */ +/* +if ($settings['hash_salt']) { + $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']); + $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader); + unset($prefix); + $class_loader->unregister(); + $apc_loader->register(); + $class_loader = $apc_loader; +} +*/ + +/** + * Authorized file system operations: + * + * The Update Manager module included with Drupal provides a mechanism for + * site administrators to securely install missing updates for the site + * directly through the web user interface. On securely-configured servers, + * the Update manager will require the administrator to provide SSH or FTP + * credentials before allowing the installation to proceed; this allows the + * site to update the new files as the user who owns all the Drupal files, + * instead of as the user the webserver is running as. On servers where the + * webserver user is itself the owner of the Drupal files, the administrator + * will not be prompted for SSH or FTP credentials (note that these server + * setups are common on shared hosting, but are inherently insecure). + * + * Some sites might wish to disable the above functionality, and only update + * the code directly via SSH or FTP themselves. This setting completely + * disables all functionality related to these authorized file operations. + * + * @see https://www.drupal.org/node/244924 + * + * Remove the leading hash signs to disable. + */ +# $settings['allow_authorize_operations'] = FALSE; + +/** + * Default mode for directories and files written by Drupal. + * + * Value should be in PHP Octal Notation, with leading zero. + */ +# $settings['file_chmod_directory'] = 0775; +# $settings['file_chmod_file'] = 0664; + +/** + * Public file base URL: + * + * An alternative base URL to be used for serving public files. This must + * include any leading directory path. + * + * A different value from the domain used by Drupal to be used for accessing + * public files. This can be used for a simple CDN integration, or to improve + * security by serving user-uploaded files from a different domain or subdomain + * pointing to the same server. Do not include a trailing slash. + */ +# $settings['file_public_base_url'] = 'http://downloads.example.com/files'; + +/** + * Public file path: + * + * A local file system path where public files will be stored. This directory + * must exist and be writable by Drupal. This directory must be relative to + * the Drupal installation directory and be accessible over the web. + */ +# $settings['file_public_path'] = 'sites/default/files'; + +/** + * Private file path: + * + * A local file system path where private files will be stored. This directory + * must be absolute, outside of the Drupal installation directory and not + * accessible over the web. + * + * Note: Caches need to be cleared when this value is changed to make the + * private:// stream wrapper available to the system. + * + * See https://www.drupal.org/documentation/modules/file for more information + * about securing private files. + */ +# $settings['file_private_path'] = ''; + +/** + * Session write interval: + * + * Set the minimum interval between each session write to database. + * For performance reasons it defaults to 180. + */ +# $settings['session_write_interval'] = 180; + +/** + * String overrides: + * + * To override specific strings on your site with or without enabling the Locale + * module, add an entry to this list. This functionality allows you to change + * a small number of your site's default English language interface strings. + * + * Remove the leading hash signs to enable. + * + * The "en" part of the variable name, is dynamic and can be any langcode of + * any added language. (eg locale_custom_strings_de for german). + */ +# $settings['locale_custom_strings_en'][''] = [ +# 'forum' => 'Discussion board', +# '@count min' => '@count minutes', +# ]; + +/** + * A custom theme for the offline page: + * + * This applies when the site is explicitly set to maintenance mode through the + * administration page or when the database is inactive due to an error. + * The template file should also be copied into the theme. It is located inside + * 'core/modules/system/templates/maintenance-page.html.twig'. + * + * Note: This setting does not apply to installation and update pages. + */ +# $settings['maintenance_theme'] = 'bartik'; + +/** + * PHP settings: + * + * To see what PHP settings are possible, including whether they can be set at + * runtime (by using ini_set()), read the PHP documentation: + * http://php.net/manual/ini.list.php + * See \Drupal\Core\DrupalKernel::bootEnvironment() for required runtime + * settings and the .htaccess file for non-runtime settings. + * Settings defined there should not be duplicated here so as to avoid conflict + * issues. + */ + +/** + * If you encounter a situation where users post a large amount of text, and + * the result is stripped out upon viewing but can still be edited, Drupal's + * output filter may not have sufficient memory to process it. If you + * experience this issue, you may wish to uncomment the following two lines + * and increase the limits of these variables. For more information, see + * http://php.net/manual/pcre.configuration.php. + */ +# ini_set('pcre.backtrack_limit', 200000); +# ini_set('pcre.recursion_limit', 200000); + +/** + * Active configuration settings. + * + * By default, the active configuration is stored in the database in the + * {config} table. To use a different storage mechanism for the active + * configuration, do the following prior to installing: + * - Create an "active" directory and declare its path in $config_directories + * as explained under the 'Location of the site configuration files' section + * above in this file. To enhance security, you can declare a path that is + * outside your document root. + * - Override the 'bootstrap_config_storage' setting here. It must be set to a + * callable that returns an object that implements + * \Drupal\Core\Config\StorageInterface. + * - Override the service definition 'config.storage.active'. Put this + * override in a services.yml file in the same directory as settings.php + * (definitions in this file will override service definition defaults). + */ +# $settings['bootstrap_config_storage'] = ['Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage']; + +/** + * Configuration overrides. + * + * To globally override specific configuration values for this site, + * set them here. You usually don't need to use this feature. This is + * useful in a configuration file for a vhost or directory, rather than + * the default settings.php. + * + * Note that any values you provide in these variable overrides will not be + * viewable from the Drupal administration interface. The administration + * interface displays the values stored in configuration so that you can stage + * changes to other environments that don't have the overrides. + * + * There are particular configuration values that are risky to override. For + * example, overriding the list of installed modules in 'core.extension' is not + * supported as module install or uninstall has not occurred. Other examples + * include field storage configuration, because it has effects on database + * structure, and 'core.menu.static_menu_link_overrides' since this is cached in + * a way that is not config override aware. Also, note that changing + * configuration values in settings.php will not fire any of the configuration + * change events. + */ +# $config['system.file']['path']['temporary'] = '/tmp'; +# $config['system.site']['name'] = 'My Drupal site'; +# $config['system.theme']['default'] = 'stark'; +# $config['user.settings']['anonymous'] = 'Visitor'; + +/** + * Fast 404 pages: + * + * Drupal can generate fully themed 404 pages. However, some of these responses + * are for images or other resource files that are not displayed to the user. + * This can waste bandwidth, and also generate server load. + * + * The options below return a simple, fast 404 page for URLs matching a + * specific pattern: + * - $config['system.performance']['fast_404']['exclude_paths']: A regular + * expression to match paths to exclude, such as images generated by image + * styles, or dynamically-resized images. The default pattern provided below + * also excludes the private file system. If you need to add more paths, you + * can add '|path' to the expression. + * - $config['system.performance']['fast_404']['paths']: A regular expression to + * match paths that should return a simple 404 page, rather than the fully + * themed 404 page. If you don't have any aliases ending in htm or html you + * can add '|s?html?' to the expression. + * - $config['system.performance']['fast_404']['html']: The html to return for + * simple 404 pages. + * + * Remove the leading hash signs if you would like to alter this functionality. + */ +# $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//'; +# $config['system.performance']['fast_404']['paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +# $config['system.performance']['fast_404']['html'] = '404 Not Found

        Not Found

        The requested URL "@path" was not found on this server.

        '; + +/** + * Load services definition file. + */ +$settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml'; + +/** + * Override the default service container class. + * + * This is useful for example to trace the service container for performance + * tracking purposes, for testing a service container with an error condition or + * to test a service container that throws an exception. + */ +# $settings['container_base_class'] = '\Drupal\Core\DependencyInjection\Container'; + +/** + * Override the default yaml parser class. + * + * Provide a fully qualified class name here if you would like to provide an + * alternate implementation YAML parser. The class must implement the + * \Drupal\Component\Serialization\SerializationInterface interface. + */ +# $settings['yaml_parser_class'] = NULL; + +/** + * Trusted host configuration. + * + * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host + * header spoofing. + * + * To enable the trusted host mechanism, you enable your allowable hosts + * in $settings['trusted_host_patterns']. This should be an array of regular + * expression patterns, without delimiters, representing the hosts you would + * like to allow. + * + * For example: + * @code + * $settings['trusted_host_patterns'] = array( + * '^www\.example\.com$', + * ); + * @endcode + * will allow the site to only run from www.example.com. + * + * If you are running multisite, or if you are running your site from + * different domain names (eg, you don't redirect http://www.example.com to + * http://example.com), you should specify all of the host patterns that are + * allowed by your site. + * + * For example: + * @code + * $settings['trusted_host_patterns'] = array( + * '^example\.com$', + * '^.+\.example\.com$', + * '^example\.org$', + * '^.+\.example\.org$', + * ); + * @endcode + * will allow the site to run off of all variants of example.com and + * example.org, with all subdomains included. + */ + +/** + * The default list of directories that will be ignored by Drupal's file API. + * + * By default ignore node_modules and bower_components folders to avoid issues + * with common frontend tools and recursive scanning of directories looking for + * extensions. + * + * @see file_scan_directory() + * @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory() + */ +$settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', +]; + +/** + * The default number of entities to update in a batch process. + * + * This is used by update and post-update functions that need to go through and + * change all the entities on a site, so it is useful to increase this number + * if your hosting configuration (i.e. RAM allocation, CPU speed) allows for a + * larger number of entities to be processed in a single batch run. + */ +$settings['entity_update_batch_size'] = 50; + +/** + * Load local development override configuration, if available. + * + * Use settings.local.php to override variables on secondary (staging, + * development, etc) installations of this site. Typically used to disable + * caching, JavaScript/CSS compression, re-routing of outgoing emails, and + * other things that should not happen on development and testing sites. + * + * Keep this code block at the end of this file to take full effect. + */ +# +# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { +# include $app_root . '/' . $site_path . '/settings.local.php'; +# } diff --git a/web/sites/default/services.yml b/web/sites/default/services.yml new file mode 100644 index 000000000..34d51509f --- /dev/null +++ b/web/sites/default/services.yml @@ -0,0 +1,162 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp + +services: + cache_tags.invalidator.checksum: + class: Drupal\redis\Cache\RedisCacheTagsChecksum + arguments: ['@redis.factory'] + tags: + - { name: cache_tags_invalidator } diff --git a/sites/development.services.yml b/web/sites/development.services.yml similarity index 100% rename from sites/development.services.yml rename to web/sites/development.services.yml diff --git a/sites/example.settings.local.php b/web/sites/example.settings.local.php similarity index 100% rename from sites/example.settings.local.php rename to web/sites/example.settings.local.php diff --git a/sites/example.sites.php b/web/sites/example.sites.php similarity index 100% rename from sites/example.sites.php rename to web/sites/example.sites.php diff --git a/sites/all/modules/contrib/dev/mobile_js_redirect/cia_report_mstr_persona_trn.csv_.gztmp b/web/themes/.gitkeep similarity index 100% rename from sites/all/modules/contrib/dev/mobile_js_redirect/cia_report_mstr_persona_trn.csv_.gztmp rename to web/themes/.gitkeep diff --git a/update.php b/web/update.php similarity index 100% rename from update.php rename to web/update.php diff --git a/web.config b/web/web.config similarity index 100% rename from web.config rename to web/web.config